Networks¶
How to use networks¶
- class dynapsetorch.networks.DelayChain(n_channels: int, n_pool: int, n_out: int)[source]¶
Bases:
Module
Delay chain network
- forward(input)[source]¶
Defines 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 dynapsetorch.networks.DelayChainLIF(n_channels: int, n_pool: int, n_out: int, thr: float = 1.0, tau: float = 20.0, dt: float = 1.0, activation_fn: ~torch.autograd.function.Function = <built-in method apply of FunctionMeta object>)[source]¶
Bases:
Module
Delay chain network using LIF neurons
- forward(input)[source]¶
Defines 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 dynapsetorch.networks.EIBalancedNetwork(n_in: int, n_class: int, ex_per_class: int = 1, activation_fn: ~torch.autograd.function.Function = <built-in method apply of FunctionMeta object>)[source]¶
Bases:
Module
EI-balanced network
- forward(input)[source]¶
Defines 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.