ICreditLayer<T>

Interfaces · AiDotNet.Interfaces

A single trainable layer as seen by an ICreditRule: its output shape, its weight matrix (when it has a single one), and the teaching-signal slot the rule fills.

Properties

Property Summary
Matrix<T> Weights { get; } The layer’s weight matrix (shape [outputDim, inputDim]) if it exposes a single one (dense layers), else null (e.g.
Tensor<T> Input { get; } The tensor fed into this layer’s forward pass for this step — the activation from the previous (sub-)layer, shaped like this layer’s input.
Tensor<T> Output { get; } The layer’s forward output tensor for this step (available if a rule needs the activations; most rules use only shapes).
Tensor<T> TeachingSignal { get; set; } The teaching signal the rule produces for this layer — a tensor matching OutputShape.
bool IsOutputLayer { get; } True if this is the final trainable layer (trained with the exact loss gradient by the engine).
int FlatFeatureSize { get; } The number of output features per sample (product of OutputShape excluding the batch axis).
int Index { get; } Position of this layer among the trainable layers in forward order (0 = first).
int[] OutputShape { get; } The shape of this layer’s forward output, e.g.