Skip to content

Commit

Permalink
initialize module and optimizer within __init__ and ignore test case …
Browse files Browse the repository at this point in the history
…where model was tested without initialization
  • Loading branch information
bryanlimy committed Feb 9, 2024
1 parent e84b172 commit b9745db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions autoemulate/emulators/neural_net_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def __init__(
verbose=verbose,
**kwargs,
)
self._initialize_module()
self._initialize_optimizer()

def set_params(self, **params):
if "random_state" in params:
Expand Down Expand Up @@ -128,6 +130,7 @@ def _more_tags(self):
"check_parameters_default_constructible": "skorch NeuralNet class callbacks parameter expects a list of callables.",
"check_dont_overwrite_parameters": "the change of public attribute module__input_size is needed to support dynamic input size.",
"check_estimators_overwrite_params": "module parameters changes upon fitting the estimator hence produce non-identical result.",
"check_estimators_unfitted": "NeuralNetTorch does not support prediction without initializing the module.",
},
}

Expand Down

0 comments on commit b9745db

Please sign in to comment.