-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Neroxn
committed
Mar 6, 2023
1 parent
9646657
commit da87464
Showing
16 changed files
with
805 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ wandb | |
*.ipynb_checkpoints | ||
*.ipynb | ||
*.DS_Store | ||
*.pth | ||
*.pth | ||
regression_datasets/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
network: # basic MLP layer configuration | ||
num_networks: 5 | ||
layer_sizes: [16,32,64] | ||
estimator: # basic MLP layer configuration | ||
class: 'ensemble' | ||
model: | ||
num_networks : 5 | ||
layer_sizes : [50] | ||
optimizer: | ||
class : 'Adam' | ||
lr : 0.01 | ||
dataset: # for now, just use toy-dataset | ||
class: 'toy' | ||
func: 'toy_function_complex' | ||
bounds : [0, 4] | ||
bounds: [-6, -4, 1, 4] | ||
sigmas: [0, 0, 0] | ||
imbalance_ratios: [0.1, 0.9, 0.7] | ||
batch_size : 128 | ||
test_ratio : 0.1 | ||
transforms: | ||
x : | ||
- class : standardize | ||
y : | ||
- class : standardize | ||
train: | ||
num_iter : 5000 | ||
print_every : 250 | ||
weighted : False | ||
test: | ||
batch_size : 32 | ||
logger: | ||
type: 'wandb' | ||
project: 'uncertainty-estimation' | ||
entity: 'kbora' | ||
name: 'Toy Dataset Complex Weighted' | ||
train_type : iter | ||
num_iter : 100 | ||
# logger: | ||
# type: 'wandb' | ||
# project: 'uncertainty-estimation' | ||
# entity: 'kbora' | ||
# name: 'Toy Dataset Complex Weighted' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,41 @@ | ||
# Estimator configurations | ||
estimator: # basic MLP layer configuration | ||
class: 'ensemble' | ||
model: | ||
num_networks : 5 | ||
layer_sizes : [100] | ||
num_networks : 5 | ||
network: | ||
estimator_network: | ||
- fc1 : {class : Linear, in_features : 13, out_features : 32} | ||
- fc2 : {class : Linear, in_features : 32, out_features : 64} | ||
- projection : {class : LinearVarianceNetworkHead, in_features : 64, out_features : 1} | ||
predictor_network: | ||
- fc1 : {class : Linear, in_features : 13, out_features : 32} | ||
- fc2 : {class : Linear, in_features : 32, out_features : 64} | ||
- projection : {class : Linear, in_features : 64, out_features : 1} | ||
optimizer: | ||
class : 'Adam' | ||
lr : 0.01 | ||
dataset: # for now, just use toy-dataset | ||
|
||
# Dataset configurations | ||
dataset: | ||
class: 'xls' | ||
path: "regression_datasets/year_prediction.csv" | ||
batch_size : 128 | ||
cv_split_num: 1 | ||
path: "regression_datasets/boston.csv" | ||
batch_size : 512 | ||
cv_split_num: 10 | ||
test_ratio: 0.10 | ||
y_col : [0] | ||
transforms: | ||
x : | ||
- class : standardize | ||
- {class : standardize} | ||
y : | ||
- class : standardize | ||
- {class : standardize} | ||
|
||
# Training configurations | ||
train: | ||
train_type : epoch | ||
num_iter : 40 | ||
print_every : 5 | ||
val_every: 10 | ||
logger: | ||
type: 'wandb' | ||
project: 'uncertainty-estimation' | ||
entity: 'kbora' | ||
name: 'Toy Dataset Complex Weighted' | ||
|
||
# Logger configurations | ||
# logger: | ||
# type: 'wandb' | ||
# project: 'uncertainty-estimation' | ||
# entity: 'kbora' | ||
# name: 'Toy Dataset Complex Weighted' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
import typing | ||
import torch | ||
import abc | ||
|
||
|
||
from models import create_model | ||
|
||
class UncertaintyEstimator(object): | ||
def init_estimator(self, **kwargs): | ||
raise NotImplementedError | ||
|
||
def init_predictor(self, **kwargs): | ||
raise NotImplementedError | ||
|
||
def train_estimator(self, **kwargs): | ||
raise NotImplementedError | ||
|
||
def test_estimator(self, **kwargs): | ||
raise NotImplementedError | ||
|
||
def train_predictor(self, **kwargs): | ||
raise NotImplementedError | ||
|
||
def test_predictor(self, **kwargs): | ||
raise NotImplementedError | ||
|
||
def _build_network(self, network_build_config, network_name): | ||
return create_model(network_build_config.get(network_name, None)) | ||
|
||
def __repr__(self) -> str: | ||
return self.__class__.__name__ + '()' |
Oops, something went wrong.