model.continuous
Classes
A crafted neural network model that incorporates continuous features with ReLU. |
Module Contents
- class model.continuous.ContinuousFeaturesNN(n_features: int, weights: torch.Tensor)
Bases:
torch.nn.SequentialA crafted neural network model that incorporates continuous features with ReLU.
- Inherits from:
torch.nn.Sequential: Parent class for implementing neural networks with modules defined in a sequential manner.
Initializes a ContinuousFeaturesNN object.
- Parameters:
n_features (int) – dimensions of the input.
weights (torch.Tensor) – weights of the model. Should have length n_features.
- _create_layer_weights(n_features: int, weights: torch.Tensor) Tuple
Creates the weights for the layers in a ContinuousFeaturesNN model.
- Parameters:
n_features (int) – Number of features.
weights (torch.Tensor) – Feature weights of the model. Should have length continuous_dim.
- Returns:
Tuple containing the weights and activation functions for the neural network model.
- Return type:
tuple[list, NoneType, list]
- Raises:
AssertionError – If weights are not specified in a valid shape.