syna.layers.layer module¶
Neural network layer definitions.
Defines the Layer base class and common layer implementations such as Linear, RNN and LSTM. Layers manage parameters and support saving/loading weights.
- class syna.layers.layer.Layer[source]¶
Bases:
object
Base layer class that tracks Parameters and sub-Layers.
Subclasses must implement forward(). Layers register any attribute that is a Parameter or Layer automatically.
- class syna.layers.layer.Linear(out_size: int, nobias: bool = False, dtype=<class 'numpy.float32'>, in_size: int | None = None)[source]¶
Bases:
Layer
Fully-connected linear layer.
- Args:
out_size: output dimension nobias: if True, no bias is used dtype: numpy dtype for parameters in_size: optional input dimension; if not provided, W is initialized
lazily on the first forward pass based on input shape.