← Docs

Module Reference

· 6 min read

The layer palette has 86 modules in 15 categories. Each maps to its PyTorch counterpart with the same parameters, shown as a node you configure in the Properties panel, where the ? beside each parameter explains it. The defaults below are what a new node starts with.

To add one, drag it from the Layers panel, click it there, or press Ctrl+K and type its name.

Input / Output

ModuleWhat it doesParameters (defaults)
InputNetwork input tensorshape=[1, 3, 224, 224], dtype=float32
OutputNetwork output—

Data

ModuleWhat it doesParameters (defaults)
DataData source — built-in presets or custom tensor filesBuilt-in datasets or your own files; see Custom Data

Linear

ModuleWhat it doesParameters (defaults)
LinearFully connected layer: y = xA^T + bin_features=512, out_features=256, bias=true
IdentityPass-through (identity mapping)—

Convolution

ModuleWhat it doesParameters (defaults)
Conv1d1D convolution over temporal datain_channels=1, out_channels=32, kernel_size=3, stride=1, padding=0, dilation=1, groups=1, bias=true
Conv2d2D convolution over imagesin_channels=3, out_channels=64, kernel_size=3, stride=1, padding=0, dilation=1, groups=1, bias=true
Conv3d3D convolution over volumesin_channels=1, out_channels=32, kernel_size=3, stride=1, padding=0, dilation=1, groups=1, bias=true
ConvTranspose2d2D transposed convolution (upsampling)in_channels=64, out_channels=32, kernel_size=3, stride=1, padding=0, output_padding=0, bias=true
ConvTranspose1d1D transposed convolution (upsampling)in_channels=64, out_channels=32, kernel_size=3, stride=1, padding=0, bias=true

Pooling

ModuleWhat it doesParameters (defaults)
MaxPool2d2D max pooling — downsample by taking maximumkernel_size=2, stride, padding=0
AvgPool2d2D average poolingkernel_size=2, stride, padding=0
AdaptiveAvgPool2dAdaptive average pooling to target output sizeoutput_size=[1,1]
MaxPool1d1D maximum poolingkernel_size=2, stride, padding=0
AvgPool1d1D average poolingkernel_size=2, stride, padding=0
MaxPool3d3D maximum poolingkernel_size=2, stride, padding=0
AdaptiveMaxPool2dAdaptive max pooling to target output sizeoutput_size=[1,1]
AdaptiveAvgPool1dAdaptive average pooling for 1D dataoutput_size=1

Normalization

ModuleWhat it doesParameters (defaults)
BatchNorm1d1D batch normalizationnum_features=64, eps=0.00001, momentum=0.1, affine=true
BatchNorm2d2D batch normalization (after Conv2d)num_features=64, eps=0.00001, momentum=0.1, affine=true
LayerNormLayer normalization (transformers)normalized_shape=[512], eps=0.00001, elementwise_affine=true
GroupNormGroup normalizationnum_groups=32, num_channels=64, eps=0.00001, affine=true
RMSNormRoot mean square normalizationnormalized_shape=[512], eps=0.00001
InstanceNorm1d1D instance normalization (style transfer)num_features=64, eps=0.00001, affine=false
InstanceNorm2d2D instance normalization (style transfer)num_features=64, eps=0.00001, affine=false
BatchNorm3d3D batch normalizationnum_features=64, eps=0.00001, momentum=0.1, affine=true

Activation

ModuleWhat it doesParameters (defaults)
ReLURectified Linear Unit: max(0, x)inplace=false
LeakyReLULeaky ReLU: max(neg_slope*x, x)negative_slope=0.01, inplace=false
GELUGaussian Error Linear Unitapproximate=none
SiLUSigmoid Linear Unit (Swish): x * sigmoid(x)inplace=false
MishMish: x * tanh(softplus(x))inplace=false
SigmoidSigmoid: 1 / (1 + exp(-x))—
TanhHyperbolic tangent—
SoftmaxSoftmax normalization along a dimensiondim=-1
PReLUParametric ReLU with learnable slopenum_parameters=1, init=0.25
ELUExponential Linear Unitalpha=1, inplace=false
SELUScaled Exponential Linear Unit (self-normalizing)inplace=false
CELUContinuously Differentiable ELUalpha=1, inplace=false
HardswishEfficient piecewise-linear Swish approximationinplace=false
HardsigmoidEfficient piecewise-linear Sigmoid approximationinplace=false
ReLU6ReLU capped at 6 (mobile networks)inplace=false
LogSoftmaxLog of softmax (use with NLLLoss)dim=-1
SoftplusSmooth approximation of ReLU: log(1 + exp(x))beta=1, threshold=20
GLUGated Linear Unit — splits and gates with sigmoiddim=-1

Recurrent

ModuleWhat it doesParameters (defaults)
LSTMLong Short-Term Memoryinput_size=512, hidden_size=256, num_layers=1, bias=true, batch_first=true, dropout=0, bidirectional=false
GRUGated Recurrent Unitinput_size=512, hidden_size=256, num_layers=1, bias=true, batch_first=true, dropout=0, bidirectional=false
RNNSimple recurrent neural networkinput_size=128, hidden_size=128, num_layers=1, nonlinearity=tanh, bias=true, batch_first=true, bidirectional=false

Transformer

ModuleWhat it doesParameters (defaults)
MultiheadAttentionMulti-head scaled dot-product attentionembed_dim=512, num_heads=8, dropout=0, bias=true, batch_first=true
TransformerEncoderLayerSelf-attention + FFN + norms + residualsd_model=512, nhead=8, dim_feedforward=2048, dropout=0.1, activation=relu, batch_first=true, norm_first=false
DecoderBlockLLM block (Llama, Mistral, Qwen): causal attention with rotary positions, then a gated MLPd_model=512, n_heads=8, n_kv_heads=8, head_dim=0, ffn_dim=1408, mlp=swiglu, norm=rmsnorm, norm_eps=0.00001, rope_theta=10000, bias=none, n_experts=0, experts_per_token=2
TransformerDecoderLayerSelf-attn + cross-attn + FFN + normsd_model=512, nhead=8, dim_feedforward=2048, dropout=0.1, activation=relu, batch_first=true, norm_first=false
TransformerFull encoder-decoder transformerd_model=512, nhead=8, num_encoder_layers=6, num_decoder_layers=6, dim_feedforward=2048, dropout=0.1, batch_first=true

Regularization

ModuleWhat it doesParameters (defaults)
DropoutRandomly zero elements during trainingp=0.5, inplace=false
Dropout2dZero entire channels randomlyp=0.5, inplace=false
Dropout3dZero entire channels for volumetric datap=0.5, inplace=false
AlphaDropoutDropout preserving self-normalizing property (for SELU)p=0.5

Embedding

ModuleWhat it doesParameters (defaults)
EmbeddingLookup table: index -> dense vectornum_embeddings=10000, embedding_dim=512, padding_idx
EmbeddingBagEmbedding with sum/mean/max pooling (efficient for sparse)num_embeddings=10000, embedding_dim=128, mode=mean

Loss Function

ModuleWhat it doesParameters (defaults)
CrossEntropyLossCross entropy for multi-class classificationreduction=mean, label_smoothing=0
MSELossMean Squared Error for regressionreduction=mean
BCEWithLogitsLossBinary cross entropy with sigmoidreduction=mean
L1LossMean Absolute Error lossreduction=mean
HuberLossRobust regression loss (smooth L1)reduction=mean, delta=1
NLLLossNegative log likelihood (after LogSoftmax)reduction=mean
KLDivLossKL divergence (for VAEs, knowledge distillation)reduction=mean, log_target=false
TripletMarginLossMetric learning with anchor/positive/negativemargin=1, p=2
CosineEmbeddingLossCosine distance-based loss for similaritymargin=0
CTCLossConnectionist Temporal Classification (OCR, ASR)blank=0, reduction=mean

Reshape

ModuleWhat it doesParameters (defaults)
FlattenFlatten dimensions into onestart_dim=1, end_dim=-1
UnflattenExpand a dimension into multipledim=1, unflattened_size=[8, 8]
ZeroPad2dPad tensor with zeros around spatial dimspadding=1
ReflectionPad2dPad with reflection of inputpadding=1
ReplicationPad2dPad by replicating border valuespadding=1
PermuteRearrange tensor dimensionsdims=[0, 2, 1]
SqueezeRemove dimensions of size 1dim
UnsqueezeAdd a dimension of size 1dim=0

Math

ModuleWhat it doesParameters (defaults)
AddElement-wise addition (residual connection)—
ConcatConcatenate tensors along a dimensiondim=1
MatMulMatrix multiplication—
CosineSimilarityCosine similarity between two tensorsdim=1
PairwiseDistancePairwise distance between tensor rowsp=2
MultiplyElement-wise multiplication—
SplitSplit tensor into chunks along a dimensionsplit_size=1, dim=0

Vision

ModuleWhat it doesParameters (defaults)
UpsampleUpsample tensor spatiallyscale_factor=2, mode=nearest
PixelShuffleSub-pixel convolution upsamplingupscale_factor=2
PixelUnshuffleInverse of PixelShuffle (downsampling)downscale_factor=2

Your own layers

When none of these does the job, write one: Insert > Custom Block adds a reusable layer with its own __init__ and forward, and Convert to Code Block turns any node into code. See Code Blocks.