Interface Layer<T>
- Type Parameters:
T- the data type (e.g., Real, Complex).
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ActivationLayer, Linear, ReLU, Sequential
Represents a layer in a neural network.
Unified interface supporting both automatic differentiation (training) and direct tensor operations (optimized inference).
- Since:
- 2.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionPerforms an optimized forward pass using raw tensors.Performs a forward pass using explicit autograd nodes.Returns the gradients of the learnable parameters.Returns the learnable parameters of this layer.default voidsetTraining(boolean training) Sets the training mode.
-
Method Details
-
forward
-
forward
Performs an optimized forward pass using raw tensors. By default, wraps the tensor in a non-grad node and delegates toforward(GraphNode).- Parameters:
input- the input tensor.- Returns:
- the transformed output tensor.
-
getParameters
-
getGradients
-
setTraining
default void setTraining(boolean training) Sets the training mode.- Parameters:
training- true for training, false for inference.
-