Skip to main content

Overview

Neurenix provides a comprehensive set of neural network layers for building deep learning models.

Linear Layer

Linear transformation: y = xW^T + b

Parameters

int
required
Size of each input sample.
int
required
Size of each output sample.
bool
default:"True"
If True, adds a learnable bias to the output.
Optional[DType]
Data type of the parameters.
Optional[Device]
Device to store the parameters on.

Attributes

  • weight: Learnable weights of shape (out_features, in_features)
  • bias: Learnable bias of shape (out_features,) (if bias=True)

Example

Convolutional Layers

Conv1d

1D convolution layer.
int
required
Number of input channels.
int
required
Number of output channels.
int
required
Size of the convolving kernel.
int
default:"1"
Stride of the convolution.
int
default:"0"
Zero-padding added to both sides of the input.

Conv2d

2D convolution layer for image processing.

Conv3d

3D convolution layer for video or volumetric data.

Example

Recurrent Layers

RNN

Vanilla recurrent neural network.

LSTM

Long Short-Term Memory network.
int
required
The number of expected features in the input.
int
required
The number of features in the hidden state.
int
default:"1"
Number of recurrent layers.
bool
default:"False"
If True, input and output tensors are provided as (batch, seq, feature).
bool
default:"False"
If True, becomes a bidirectional LSTM.

GRU

Gated Recurrent Unit.

Example

Pooling Layers

MaxPool2d

Max pooling over a 2D input.
Union[int, Tuple[int, int]]
required
Size of the pooling window.
Optional[Union[int, Tuple[int, int]]]
Stride of the pooling window. Default is kernel_size.

Example

Regularization Layers

Dropout

Randomly zeroes elements during training.
float
default:"0.5"
Probability of an element to be zeroed.
bool
default:"False"
If True, will do this operation in-place.

Example

Container Layers

Sequential

Sequential container for chaining layers.

Example

Complete Example