fishy.models.deep.rwkv

Receptance Weighted Key-Value (RWKV) model for spectral classification.

Parallelized implementation for efficient training on spectral data.

Classes

class fishy.models.deep.rwkv.RWKV(input_dim: int, output_dim: int, hidden_dim: int = 128, num_layers: int = 2, dropout: float = 0.1, **kwargs)[source]

Bases: Module

RWKV model for spectral classification.

__init__(input_dim: int, output_dim: int, hidden_dim: int = 128, num_layers: int = 2, dropout: float = 0.1, **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.rwkv.RWKVBlock(n_embd: int, dropout: float = 0.1)[source]

Bases: Module

__init__(n_embd: int, dropout: float = 0.1)[source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x: 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.rwkv.RWKVParallel(n_embd: int)[source]

Bases: Module

RWKV Parallel block for efficient 1D sequence processing.

__init__(n_embd: int)[source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x: 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.

s