Skip to content

Commit

Permalink
remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanlimy committed Feb 6, 2024
1 parent f030d10 commit 40219bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions autoemulate/emulators/neural_net_torch.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# experimental version of a PyTorch neural network emulator wrapped in Skorch
# to make it compatible with scikit-learn. Works with cross_validate and GridSearchCV,
# but doesn't pass tests, because we're subclassing
import random

import warnings
from typing import List, Tuple
from typing import List

import numpy as np
import torch
Expand All @@ -13,7 +13,6 @@
from skopt.space import Integer, Real
from skorch import NeuralNetRegressor
from skorch.callbacks import Callback
from torch import nn

from autoemulate.emulators.neural_networks import get_module
from autoemulate.utils import set_random_seed
Expand Down
6 changes: 4 additions & 2 deletions tests/test_emulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_nn_sk_pred_type(nn_sk_model, simulation_io):

# Test PyTorch Neural Network (skorch)
def test_nn_torch_initialisation():
nn_torch = NeuralNetTorch()
nn_torch = NeuralNetTorch(module="mlp")
assert nn_torch is not None


Expand Down Expand Up @@ -183,7 +183,9 @@ def test_nn_torch_shape_setter():
X = np.random.rand(100, input_size)
y = np.random.rand(100, output_size)
nn_torch_model = NeuralNetTorch(
module__input_size=input_size, module__output_size=output_size
module="mlp",
module__input_size=input_size,
module__output_size=output_size,
)
nn_torch_model.fit(X, y)
assert nn_torch_model.module__input_size == input_size
Expand Down

0 comments on commit 40219bb

Please sign in to comment.