|
1 | 1 | <a name="nn.Containers"/>
|
2 | 2 | # Containers #
|
3 | 3 | Complex neural networks are easily built using container classes:
|
4 |
| - * [Sequential](#nn.Sequential) : plugs layers in a feed-forward fully connected manner ; |
5 |
| - * [Parallel](#nn.Parallel) : applies its `ith` child module to the `ith` slice of the input Tensor ; |
6 |
| - * [Concat](#nn.Concat) : concatenates in one layer several modules along dimension `dim` ; |
7 |
| - * [DepthConcat](#nn.DepthConcat) : like Concat, but adds zero-padding when non-`dim` sizes don't match; |
| 4 | + * [Container](#nn.Container) : abstract class inherited by containers ; |
| 5 | + * [Sequential](#nn.Sequential) : plugs layers in a feed-forward fully connected manner ; |
| 6 | + * [Parallel](#nn.Parallel) : applies its `ith` child module to the `ith` slice of the input Tensor ; |
| 7 | + * [Concat](#nn.Concat) : concatenates in one layer several modules along dimension `dim` ; |
| 8 | + * [DepthConcat](#nn.DepthConcat) : like Concat, but adds zero-padding when non-`dim` sizes don't match; |
8 | 9 |
|
9 | 10 | See also the [Table Containers](#nn.TableContainers) for manipulating tables of [Tensors](https://github.com/torch/torch7/blob/master/doc/tensor.md).
|
10 | 11 |
|
| 12 | +<a name="nn.Container"/> |
| 13 | +## Container ## |
| 14 | + |
| 15 | +This is an abstract [Module](module.md#nn.Module) class which declares methods defined in all containers. |
| 16 | +It reimplements many of the Module methods such that calls are propagated to the |
| 17 | +contained modules. For example, a call to [zeroGradParameters](module.md#nn.Module.zeroGradParameters) |
| 18 | +will be propagated to all contained modules. |
| 19 | + |
| 20 | +<a name="nn.Container.add"/> |
| 21 | +### add(module) ### |
| 22 | +Adds the given `module` to the container. The order is important |
| 23 | + |
| 24 | +<a name="nn.Container.get"/> |
| 25 | +### get(index) ### |
| 26 | +Returns the contained modules at index `index`. |
| 27 | + |
| 28 | +<a name="nn.Container.size"/> |
| 29 | +### size() ### |
| 30 | +Returns the number of contained modules. |
| 31 | + |
11 | 32 | <a name="nn.Sequential"/>
|
12 | 33 | ## Sequential ##
|
13 | 34 |
|
|
0 commit comments