Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { InputSize int QuerySize int KeySize int ValueSize int ScaleFactor mat.Float UseCausalMask bool }
Config provides configuration settings for a Self-Attention Model.
type Model ¶
Model contains the serializable parameters.
func (*Model) Forward ¶
Forward performs the forward step for each input node and returns the result. It generates the queries, keys and values from the same input xs.
func (*Model) ForwardWithPastKeysValues ¶ added in v0.5.0
func (m *Model) ForwardWithPastKeysValues(qkv attention.QKV, past attention.KeysValuesPair) attention.Output
ForwardWithPastKeysValues performs the forward step for each input node and returns the result. It generates the queries, keys and values from the same input xs.
Click to show internal directories.
Click to hide internal directories.