A fully connected linear (affine) layer: output =weight.bmm(input) + bias Computes a linear transformation of the input tensor:
- Weight shape: (1, outFeatures, inFeatures)
- Bias shape: (1, outFeatures, 1)
- Input shape: (batch, inFeatures, 1)
- Output shape: (batch, outFeatures, 1) The weight and bias are learnable parameters wrapped in
Variabl. Internally uses batched matrix multiplication and broadcasting for bias addition.
Value parameters
- inFeatures
-
the number of input features
- outFeatures
-
the number of output features
Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Forward pass for a single input Variable. Must be implemented by subclasses.
Forward pass for a single input Variable. Must be implemented by subclasses.
Attributes
- Definition Classes
Return all trainable parameters, including those from submodules.
Return all trainable parameters, including those from submodules.
Attributes
- Definition Classes
Inherited methods
Alias for forward, allows calling the module as a function: module(x).
Alias for forward, allows calling the module as a function: module(x).
Attributes
- Inherited from:
- Module
Set the module to evaluation mode (and all submodules recursively).
Set the module to evaluation mode (and all submodules recursively).
Attributes
- Inherited from:
- BaseModule
Return the gradients of all parameters.
Replace the current parameters with new ones. Useful for weight updates, loading saved models, etc.
Replace the current parameters with new ones. Useful for weight updates, loading saved models, etc.
Value parameters
- newParams
-
The new parameter list to assign
Attributes
- Inherited from:
- BaseModule
Set the module to training mode (and all submodules recursively).
Set the module to training mode (and all submodules recursively).
Attributes
- Inherited from:
- BaseModule
Zero out all gradients (in-place).
Inherited fields
Flag to control training or evaluation behavior.
Automatically detect submodules (other BaseModules) within this module.
Automatically detect submodules (other BaseModules) within this module.
Attributes
- Inherited from:
- BaseModule