fishy.models.deep.tcn

Temporal Convolutional Network (TCN) model for spectral classification.

Classes

class fishy.models.deep.tcn.Chomp1d(chomp_size)[source]

Bases: Module

__init__(chomp_size)[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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class fishy.models.deep.tcn.TCN(input_dim: int, output_dim: int, hidden_dim: int = 128, num_layers: int = 4, dropout: float = 0.2, kernel_size: int = 3, **kwargs)[source]

Bases: Module

Temporal Convolutional Network model.

__init__(input_dim: int, output_dim: int, hidden_dim: int = 128, num_layers: int = 4, dropout: float = 0.2, kernel_size: int = 3, **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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class fishy.models.deep.tcn.TemporalBlock(n_inputs, n_outputs, kernel_size, stride, dilation, padding, dropout=0.2)[source]

Bases: Module

__init__(n_inputs, n_outputs, kernel_size, stride, dilation, padding, 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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

s