rockpool.nn.modules.timed_module

Contains the base classes for TimedModules in Rockpool. Also contains classes to adapt Module classes -> TimedModule classes, and to wrap Module objects as TimedModule objects.

Functions

astimedmodule([v1_cls, parameters, states, ...])

Convert a Rockpool v1 class to a v2 class

gcd(a, b)

Return the greatest common divisor of two values

is_multiple(a, b[, tol_rel, tol_abs])

Check whether a % b is 0 within some tolerance.

lcm(a, b)

Return the least common multiple of two values

leaves(d)

A generator that yields the leaf nodes in a nested dict

tree_map(func, tree)

Map a function over a tree

Classes

LayerToTimedModule(*args, **kwargs)

An adapter class to wrap a Rockpool v1 Layer object, converting the object to support the TimedModule high-level Rockpool v2 API

TimedModule(*args, **kwargs)

The Rockpool base class for all TimedModule modules

TimedModuleWrapper(*args, **kwargs)

Wrap a low-level Rockpool Module automatically into a TimedModule object