SeqModule

scalation.modeling.autograd.SeqModule
abstract class SeqModule(localParameters: IndexedSeq[Variabl] = ...) extends BaseModule

Module for layers that take multiple inputs (e.g., RNN cells, attention blocks). Defines the abstract forward function for sequence or multiple inputs.

Value parameters

localParameters

the parameters (Variables) directly belonging to this module

Attributes

Graph
Supertypes
class BaseModule
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def forward(inputs: IndexedSeq[Variabl]): IndexedSeq[Variabl]

Forward pass for multiple input Variables. Must be implemented by subclasses.

Forward pass for multiple input Variables. Must be implemented by subclasses.

Attributes

Concrete methods

def apply(inputs: IndexedSeq[Variabl]): IndexedSeq[Variabl]

Alias for forward, allows calling the module as a function: module(xs).

Alias for forward, allows calling the module as a function: module(xs).

Attributes

Inherited methods

def eval(): Unit

Set the module to evaluation mode (and all submodules recursively).

Set the module to evaluation mode (and all submodules recursively).

Attributes

Inherited from:
BaseModule
def gradients: IndexedSeq[TensorD]

Return the gradients of all parameters.

Return the gradients of all parameters.

Attributes

Inherited from:
BaseModule
def parameters: IndexedSeq[Variabl]

Return all trainable parameters, including those from submodules.

Return all trainable parameters, including those from submodules.

Attributes

Inherited from:
BaseModule
def setParameters(newParams: IndexedSeq[Variabl]): Unit

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
def train(mode: Boolean = ...): Unit

Set the module to training mode (and all submodules recursively).

Set the module to training mode (and all submodules recursively).

Attributes

Inherited from:
BaseModule
def zeroGrad()(using ops: AutogradOps): Unit

Zero out all gradients (in-place).

Zero out all gradients (in-place).

Attributes

Inherited from:
BaseModule

Inherited fields

var inTrainingMode: Boolean

Flag to control training or evaluation behavior.

Flag to control training or evaluation behavior.

Attributes

Inherited from:
BaseModule
lazy val subModules: IndexedSeq[BaseModule]

Automatically detect submodules (other BaseModules) within this module.

Automatically detect submodules (other BaseModules) within this module.

Attributes

Inherited from:
BaseModule