fishy.models.deep.rcnn¶
Residual Convolutional Neural Network (RCNN) for spectral classification.
This model uses residual blocks with 1D convolutions to capture spectral patterns while allowing for deeper architectures via skip connections.
Classes
- class fishy.models.deep.rcnn.RCNN(input_dim: int, output_dim: int, hidden_dim: int = 128, num_layers: int = 6, dropout: float = 0.2, **kwargs)[source]¶
Bases:
ModuleImproved Residual Convolutional Neural Network (RCNN) model.
- __init__(input_dim: int, output_dim: int, hidden_dim: int = 128, num_layers: int = 6, dropout: float = 0.2, **kwargs) None[source]¶
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- 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.
- class fishy.models.deep.rcnn.ResidualBlock(channels, dropout=0.2)[source]¶
Bases:
Module- __init__(channels, dropout=0.2)[source]¶
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(x)[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