nn.combinators.Residual
- class nn.combinators.Residual(*args, **kwargs)[source]
Bases:
Build a residual block over a sequential stack of modules
Residualaccepts any number of modules. The shapes of the modules must be compatible – the output sizesize_outof each module must match the input sizesize_inof the following module.Examples
Build a
Residualstack will be returned aModule, containingmod0,mod1andmod2. When evolving this stack, signals will be passed throughmod0, thenmod1, thenmod2:>>> Residual(mod0, mod1, mod2)
Index into a
Residualstack using Python indexing:>>> mod = Residual(mod0, mod1, mod2) >>> mod[0] A module with shape (xx, xx)
- Parameters:
*mods – Any number of modules to connect. The
size_outattribute of one module must match thesize_inattribute of the following module.- Returns:
A
Modulesubclass object that encapsulates the provided modules
- __init__ = <method-wrapper '__init__' of function object>