Documentation
¶
Overview ¶
Package hrm implements the Hierarchical Reasoning Model.
Package hrm implements the Hierarchical Reasoning Model.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HModule ¶
type HModule[T tensor.Numeric] struct { Block *transformer.Block[T] HiddenState *tensor.TensorNumeric[T] }
HModule represents the high-level recurrent module of the HRM.
func NewHModule ¶
func NewHModule[T tensor.Numeric]( engine compute.Engine[T], ops numeric.Arithmetic[T], modelDim, ffnDim int, attention graph.Node[T], opts ...transformer.BlockOption[T], ) (*HModule[T], error)
NewHModule creates a new HModule.
func (*HModule[T]) Forward ¶
func (m *HModule[T]) Forward(ctx context.Context, lState *tensor.TensorNumeric[T]) (*tensor.TensorNumeric[T], error)
Forward performs a single step of the HModule's computation.
func (*HModule[T]) Parameters ¶
Parameters returns the parameters of the HModule.
type LModule ¶
type LModule[T tensor.Numeric] struct { Block *transformer.Block[T] HiddenState *tensor.TensorNumeric[T] }
LModule represents the low-level recurrent module of the HRM.
func NewLModule ¶
func NewLModule[T tensor.Numeric]( engine compute.Engine[T], ops numeric.Arithmetic[T], modelDim, ffnDim int, attention graph.Node[T], opts ...transformer.BlockOption[T], ) (*LModule[T], error)
NewLModule creates a new LModule.
func (*LModule[T]) Forward ¶
func (m *LModule[T]) Forward( ctx context.Context, hState, projectedInput *tensor.TensorNumeric[T], ) (*tensor.TensorNumeric[T], error)
Forward performs a single step of the LModule's computation.
func (*LModule[T]) Parameters ¶
Parameters returns the parameters of the LModule.
Click to show internal directories.
Click to hide internal directories.