SplitLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
Represents a layer that splits the input tensor along a specific dimension into multiple equal parts.
Inheritance: LayerBase<T> → SplitLayer<T>
Implements: IShapeContract
For Beginners
This layer breaks up your input data into smaller, equal-sized chunks.
Think of it like cutting a pizza into equal slices:
- Your input data is the whole pizza
- The number of splits determines how many slices you want
- Each slice has the same size and shape
Benefits include:
- Processing different parts of the input in parallel
- Allowing different operations on different parts of the input
- Creating multi-stream architectures where each stream handles a portion of the data
For example, in natural language processing, you might split word embeddings to create multiple “attention heads” that each focus on different aspects of the text.
How It Works
A split layer divides the input tensor into multiple equal parts along a specified dimension. This is useful for parallel processing of data or for implementing multi-headed attention mechanisms. The layer ensures that the input size is divisible by the number of splits to maintain consistency.
Constructors
| Constructor | Summary |
|---|---|
SplitLayer(int numSplits) |
Initializes a new instance of the SplitLayer class. |
Properties
| Property | Summary |
|---|---|
bool SupportsGpuTraining { get; } |
|
bool SupportsTraining { get; } |
Gets a value indicating whether this layer supports training through backpropagation. |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
|
void ResetState() |
Resets the internal state of the split layer. |