File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 11import pandas as pd
22import numpy as np
3- from typing import Callable , List , Optional , Union
4- from sklearn .base import BaseEstimator
3+ from typing import Callable , List
54from qolmat .imputations .imputers import ImputerRegressor
65from qolmat .utils .exceptions import PyTorchExtraNotInstalled
76
@@ -17,7 +16,7 @@ def build_mlp_example(
1716 input_dim : int ,
1817 list_num_neurons : List [int ],
1918 output_dim : int = 1 ,
20- activation : nn . Module = nn .ReLU () ,
19+ activation : Callable = nn .ReLU ,
2120) -> nn .Sequential :
2221 """
2322 Constructs a multi-layer perceptron (MLP) with a custom architecture.
@@ -60,7 +59,7 @@ def build_mlp_example(
6059 layers = []
6160 for num_neurons in list_num_neurons :
6261 layers .append (nn .Linear (input_dim , num_neurons ))
63- layers .append (activation )
62+ layers .append (activation () )
6463 input_dim = num_neurons
6564 layers .append (nn .Linear (input_dim , output_dim ))
6665
You can’t perform that action at this time.
0 commit comments