<commit_before><a name="nn.TableLayers"/>
# Table Layers #

This set of modules allows the manipulation of tables through the layers of a neural network.
This allows one to build very rich architectures:
 * Table Container Modules encapsulate sub-Modules:
   * [ConcatTable](#nn.ConcatTable) : applies each member module to the same input     [Tensor](https://github.com/torch/torch7/blob/master/doc/tensor.md#tensor) and outputs a table;
   * [ParallelTable](#nn.ParallelTable) : applies the `ith` member module to the `ith` input and outputs a table;
 * Table Conversion Modules convert between tables and Tensors:
   * [SplitTable](#nn.SplitTable) : splits a Tensor into a table of Tensors;
   * [JoinTable](#nn.JoinTable) : joins a table of Tensors into a Tensor;
   * [MixtureTable](#nn.MixtureTable) : mixture of experts weighted by a gater;
   * [SelectTable](#nn.SelectTable) : select one element from a table;
 * Pair Modules compute a measure like distance or similarity from a pair (table) of input Tensors :
   * [PairwiseDistance](#nn.PairwiseDistance) : outputs the `p`-norm. distance between inputs;
   * [DotProduct](#nn.DotProduct) : outputs the dot product (similarity) between inputs;
   * [CosineDistance](#nn.CosineDistance) : outputs the cosine distance between inputs;
 * CMath Modules perform element-wise operations on a table of Tensors:
   * [CAddTable](#nn.CAddTable) : addition of input Tensors;
   * [CSubTable](#nn.CSubTable) : substraction of input Tensors;
   * [CMulTable](#nn.CMulTable) : multiplication of input Tensors;
   * [CDivTable](#nn.CDivTable) : division of input Tensors;
 * Table of Criteria :
   * [CriterionTable](#nn.CriterionTable) : wraps a [Criterion](criterion.md#nn.Criterion) so that it can accept a Table of inputs.

Table-based modules work by supporting forward and backward methods that can accept 
tables as inputs. It turns out that the usual [Sequential](containers.md#nn.Sequential) module can do this, so all that is needed is other child modules that take advantage of such tables.
```lua
mlp = nn.Sequential();
t={x,y,z}
pred=mlp:forward(t)
pred=mlp:forward{x,y,z}      -- This is equivalent to the line before
```

<a name="nn.ConcatTable"/>
## ConcatTable ##

ConcatTable is a container module that applies each member module to 
the same input [Tensor](https://github.com/torch/torch7/blob/master/doc/tensor.md#tensor)
or Table.<commit_msg>added FlattenTable to table.md index<commit_after><a name="nn.TableLayers"/>
# Table Layers #

This set of modules allows the manipulation of tables through the layers of a neural network.
This allows one to build very rich architectures:
 * Table Container Modules encapsulate sub-Modules:
   * [ConcatTable](#nn.ConcatTable) : applies each member module to the same input     [Tensor](https://github.com/torch/torch7/blob/master/doc/tensor.md#tensor) and outputs a table;
   * [ParallelTable](#nn.ParallelTable) : applies the `ith` member module to the `ith` input and outputs a table;
 * Table Conversion Modules convert between tables and Tensors or tables:
   * [SplitTable](#nn.SplitTable) : splits a Tensor into a table of Tensors;
   * [JoinTable](#nn.JoinTable) : joins a table of Tensors into a Tensor;
   * [MixtureTable](#nn.MixtureTable) : mixture of experts weighted by a gater;
   * [SelectTable](#nn.SelectTable) : select one element from a table;
   * [FlattenTable](#nn.FlattenTable) : flattens a nested table hierarchy;
 * Pair Modules compute a measure like distance or similarity from a pair (table) of input Tensors :
   * [PairwiseDistance](#nn.PairwiseDistance) : outputs the `p`-norm. distance between inputs;
   * [DotProduct](#nn.DotProduct) : outputs the dot product (similarity) between inputs;
   * [CosineDistance](#nn.CosineDistance) : outputs the cosine distance between inputs;
 * CMath Modules perform element-wise operations on a table of Tensors:
   * [CAddTable](#nn.CAddTable) : addition of input Tensors;
   * [CSubTable](#nn.CSubTable) : substraction of input Tensors;
   * [CMulTable](#nn.CMulTable) : multiplication of input Tensors;
   * [CDivTable](#nn.CDivTable) : division of input Tensors;
 * Table of Criteria :
   * [CriterionTable](#nn.CriterionTable) : wraps a [Criterion](criterion.md#nn.Criterion) so that it can accept a Table of inputs.

Table-based modules work by supporting forward and backward methods that can accept 
tables as inputs. It turns out that the usual [Sequential](containers.md#nn.Sequential) module can do this, so all that is needed is other child modules that take advantage of such tables.
```lua
mlp = nn.Sequential();
t={x,y,z}
pred=mlp:forward(t)
pred=mlp:forward{x,y,z}      -- This is equivalent to the line before
```

<a name="nn.ConcatTable"/>
## ConcatTable ##

ConcatTable is a container module that applies each member module to 
the same input [Tensor](https://github.com/torch/torch7/blob/master/doc/tensor.md#tensor)
or Table.
{'fraction_non_alphanumeric': 0.10511363636363637, 'fraction_numerical': 0.0008116883116883117, 'mean_word_length': 4.758177570093458, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6362970', 'n_tokens_mistral': 1468, 'n_tokens_neox': 1423, 'n_words': 531}