Skip to content

Commit

Permalink
corrected n_out bug with optuna
Browse files Browse the repository at this point in the history
  • Loading branch information
nepslor committed Dec 12, 2023
1 parent 2d5cc09 commit c057b40
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pyforecaster/forecasting_models/neural_forecasters.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,8 @@ def __init__(self, learning_rate: float = 0.01, batch_size: int = None, load_pat

def set_arch(self):
model = PartiallyICNN(num_layers=self.n_layers, features_x=self.n_hidden_x, features_y=self.n_hidden_y,
features_out=self.n_out, init_type=self.init_type, augment_ctrl_inputs=self.augment_ctrl_inputs, probabilistic=self.probabilistic)
features_out=self.n_out*2 if self.probabilistic else self.n_out, init_type=self.init_type,
augment_ctrl_inputs=self.augment_ctrl_inputs, probabilistic=self.probabilistic)
return model

@staticmethod
Expand Down Expand Up @@ -650,8 +651,8 @@ def __init__(self, learning_rate: float = 0.01, batch_size: int = None, load_pat

def set_arch(self):
model = PartiallyIQCNN(num_layers=self.n_layers, features_x=self.n_hidden_x, features_y=self.n_hidden_y,
features_out=self.n_out, init_type=self.init_type, augment_ctrl_inputs=self.augment_ctrl_inputs,
probabilistic=self.probabilistic)
features_out=self.n_out*2 if self.probabilistic else self.n_out, init_type=self.init_type,
augment_ctrl_inputs=self.augment_ctrl_inputs, probabilistic=self.probabilistic)
return model


Expand All @@ -678,7 +679,7 @@ def __init__(self, learning_rate: float = 0.01, batch_size: int = None, load_pat

def set_arch(self):
model = PartiallyICNN(num_layers=self.n_layers, features_x=self.n_hidden_x, features_y=self.n_hidden_y,
features_out=self.n_out, init_type=self.init_type,
features_out=self.n_out*2 if self.probabilistic else self.n_out, init_type=self.init_type,
augment_ctrl_inputs=self.augment_ctrl_inputs, activation=nn.sigmoid,
rec_activation=nn.sigmoid, probabilistic=self.probabilistic)
return model
Expand All @@ -702,6 +703,6 @@ def __init__(self, learning_rate: float = 0.01, batch_size: int = None, load_pat

def set_arch(self):
model = PartiallyICNN(num_layers=self.n_layers, features_x=self.n_hidden_x, features_y=self.n_hidden_y,
features_out=self.n_out, activation=nn.relu, init_type=self.init_type,
probabilistic=self.probabilistic)
features_out=self.n_out*2 if self.probabilistic else self.n_out, activation=nn.relu,
init_type=self.init_type, probabilistic=self.probabilistic)
return model

0 comments on commit c057b40

Please sign in to comment.