fishy.models.deep.dense¶
Dense Neural Network model for spectral classification.
Classes
- class fishy.models.deep.dense.Dense(input_dim: int, output_dim: int, hidden_dim: int = 128, num_layers: int = 4, dropout: float = 0.2, **kwargs)[source]¶
Bases:
ModuleStandard fully connected (dense) neural network.
- input_dim¶
Number of input features.
- Type:
int
- output_dim¶
Number of output classes.
- Type:
int
Hidden layer dimension.
- Type:
int
- dropout¶
Dropout probability.
- Type:
float
- __init__(input_dim: int, output_dim: int, hidden_dim: int = 128, num_layers: int = 4, dropout: float = 0.2, **kwargs) None[source]¶
Initializes the Dense model.
- Parameters:
input_dim (int) – Number of input features.
output_dim (int) – Number of output classes.
hidden_dim (int, optional) – Hidden layer dimension. Defaults to 128.
num_layers (int, optional) – Number of hidden layers. Defaults to 4.
dropout (float, optional) – Dropout rate. Defaults to 0.2.
- forward(x: Tensor) Tensor[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
s