BiasNode¶
- class BiasNode(*shape: int | None)[source]¶
Bases:
NodeTrainable bias node for unsupervised predictive coding.
- Parameters:
*shape (int | None) – shape of the learned bias.
- error(pred: Tensor) Tensor[source]¶
Error between the prediction and node state.
\[\boldsymbol{\varepsilon} = \mathbf{b} - \boldsymbol{\mu}\]
- forward(inputs: Tensor, **kwargs) Tensor[source]¶
Expands bias tensor for the network.
- Parameters:
inputs (Tensor) – tensor to use as the shape for the returned bias.
- Returns:
expanded bias tensor.
- Return type:
Tip
inputsshould have the desired shape (including the batch dimension) to use the returned bias as a prediction for initialization/inference. The contents, device, and data type ofinputsare unused.