LearnedVector#

class hybrid_aif.LearnedVector[source]#

Bases: Module

A trainable vector behind an activation: a parametrized constant, with no parents.

The canonical use is an episode-start carry: zeros through tanh, so a fresh one starts at the zero carry and stays in [-1, 1]. Role-free; its gradient arrives from whatever consumes its value. Trainable, it is DreamerV3’s initial: 'learned'; frozen, initial: 'zeros'.

value: Array#

The pre-activation parameter.

activation: str = 'tanh'#

The activation the value passes through (static).

frozen: bool = False#

The trainable marking: True keeps value fixed.

classmethod zeros(dim, *, activation='tanh', frozen=False)[source]#

The zero pre-activation — hence, under tanh, the zero output.

property learnable: bool#

Capability: a non-frozen vector is a trainable block.

__init__(value, activation='tanh', frozen=False)#