model.conflicting
Attributes
Classes
A crafted neural network model that incorporates cancellation features. |
Module Contents
- class model.conflicting.ConflictingFeaturesNN(continuous_dim: int, weights: torch.Tensor)
Bases:
torch.nn.SequentialA crafted neural network model that incorporates cancellation features.
- Inherits from:
torch.nn.Sequential: Parent class for implementing neural networks with modules defined in a sequential manner.
Initializes a ConflictingFeaturesNN object.
- Parameters:
continuous_dim (int) – Dimension length of the continuous features, excluding cancellation features.
weights (torch.Tensor) – Feature weights of the model. Should have length continuous_dim.
- _create_layer_weights(continuous_dim: int, weights: torch.Tensor) Tuple
Creates the weights for the layers in a ConflictingFeaturesNN model.
- Parameters:
continuous_dim (int) – Number of continuous 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.
- model.conflicting.continuous_dim = 2