f64

package
v0.0.0-...-41d7962 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StateM is the state for the mean
	StateM = iota
	// StateV is the state for the variance
	StateV
	// StateTotal is the total number of states
	StateTotal
)
View Source
const (
	// S is the scaling factor for the softmax
	S = 1.0 - 1e-300
)

Variables

This section is empty.

Functions

func SelfEntropy

func SelfEntropy(Q, K, V Matrix) []float64

SelfEntropy computes the self entropy of Q, K, V

Types

type Matrix

type Matrix struct {
	Cols   int
	Rows   int
	Data   []float64
	States [][]float64
}

Matrix is a matrix

func Add

func Add(m Matrix, n Matrix) Matrix

Add adds two matrices

func Entropy

func Entropy(m Matrix) Matrix

Entropy is the entropy of the matrix

func Everett

func Everett(m Matrix) Matrix

Everett computes the split reality activation function

func H

func H(m Matrix, n Matrix) Matrix

H element wise multiplies two matrices

func MulT

func MulT(m Matrix, n Matrix) Matrix

Mul multiplies two matrices and computes the transpose

func Neg

func Neg(m Matrix) Matrix

Neg negates a matrix

func NewMatrix

func NewMatrix(states, cols, rows int) Matrix

NewMatrix creates a new matrix

func NewRandMatrix

func NewRandMatrix(rnd *rand.Rand, states, cols, rows int) Matrix

NewRandMatrix creates a new random matrix

func Normalize

func Normalize(m Matrix) Matrix

Normalize normalizes a matrix to the unit vector

func Sigmoid

func Sigmoid(m Matrix) Matrix

Sigmoid computes the sigmoid of a matrix

func Softmax

func Softmax(m Matrix) Matrix

Softmax is the softmax of a matrix

func Step

func Step(m Matrix) Matrix

Step computes the step function of a matrix

func Sub

func Sub(m Matrix, n Matrix) Matrix

Sub subtracts two matrices

func T

func T(m Matrix) Matrix

T tramsposes a matrix

func (Matrix) Size

func (m Matrix) Size() int

Size is the size of the matrix

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL