renate.benchmark.models.mlp module#
- class renate.benchmark.models.mlp.MultiLayerPerceptron(num_inputs, num_outputs, num_hidden_layers, hidden_size, activation='ReLU', batch_normalization=False, prediction_strategy=None, add_icarl_class_means=True)[source]#
Bases:
RenateBenchmarkingModuleA simple Multi Layer Perceptron with hidden layers, activation and Batch Normalization if enabled.
- Parameters:
num_inputs¶ (
int) – Number of input nodes.num_outputs¶ (
int) – Number of output nodes.num_hidden_layers¶ (
int) – Number of hidden layers.hidden_size¶ (
Union[int,List[int],Tuple[int]]) – Uniform hidden size or the list or tuple of hidden sizes for individual hidden layers.activation¶ (
str) – Activation name, matching activation name intorch.nnto be used between the hidden layers.batch_normalization¶ (
bool) – Whether to use Batch Normalization after the activation. By default the Batch Normalization tracks the running statistics.prediction_strategy¶ (
Optional[PredictionStrategy]) – Continual learning strategies may alter the prediction at train or test time.add_icarl_class_means¶ (
bool) – IfTrue, additional parameters used only by theICaRLModelUpdaterare added. Only required when using that updater.