nn.combinators.Sequential
- class nn.combinators.Sequential(*args, **kwargs)[source]
Bases:
Build a sequential stack of modules by connecting them end-to-end
Sequential
accepts any number of modules. The shapes of the modules must be compatible – the output sizesize_out
of each module must match the input sizesize_in
of the following module.Examples
Build a
Sequential
stack will be returned aModule
, containingmod0
,mod1
andmod2
. When evolving this stack, signals will be passed throughmod0
, thenmod1
, thenmod2
:>>> Sequential(mod0, mod1, mod2)
Index into a
Sequential
stack using Python indexing:>>> mod = Sequential(mod0, mod1, mod2) >>> mod[0] A module with shape (xx, xx)
- Parameters
*mods – Any number of modules to connect. The
size_out
attribute of one module must match thesize_in
attribute of the following module.- Returns
A
Module
subclass object that encapsulates the provided modules
- __init__ = <method-wrapper '__init__' of function object>