Parameter

Contents

Parameter#

class penzai.core.variables.Parameter[source]#

Bases: LabeledVariable[T]

A model parameter variable.

Parameters are variables that are usually updated by optimizers, but not updated inside the model itself.

Variables:
  • label (VariableLabel) – The unique label for this parameter.

  • value – The mutable value stored in the parameter. Should be a JAX pytree.

  • metadata (dict[Any, Any]) – A dictionary of metadata associated with this parameter.

Inherited Attributes

value

Methods

freeze()

get_slot()

treescope_color()

Attributes

value

label

metadata

Inherited Methods

(expand to view inherited methods)

__init__(*, label, value[, metadata])

Constructs a new variable.

set_value(new_val)

Sets the value of the Variable.

update(new_frozen_value)

Updates the value of this variable to match a frozen variable.