Documentation ¶
Index ¶
- Constants
- Variables
- func Panic(a *V) bool
- type Binary
- type Context
- func (context *Context) Abs(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Add(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
- func (context *Context) Avg(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) B(op Binary) func(a, b Meta, options ...map[string]interface{}) Meta
- func (c *Context) Clear()
- func (context *Context) Concat(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
- func (context *Context) Copy(k Continuation, node int, dst, src *V, options ...map[string]interface{}) bool
- func (context *Context) Cos(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) CrossEntropy(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
- func (context *Context) Dropout(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Entropy(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Everett(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) EverettReLu(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Exp(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (c *Context) Get(node int) []float32
- func (context *Context) Hadamard(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
- func (context *Context) Log(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Mul(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
- func (context *Context) Op(op Operation) func(a ...Meta) Meta
- func (context *Context) Orthogonality(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Quadratic(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
- func (context *Context) Quant(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) ReLu(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (c *Context) Set(node int, value []float32)
- func (context *Context) Sigmoid(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Similarity(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
- func (context *Context) Sin(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Slice(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Softmax(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Softplus(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) Sub(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
- func (context *Context) Sum(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) SumRows(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) T(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) TanH(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (context *Context) U(op Unary) func(a Meta, options ...map[string]interface{}) Meta
- func (context *Context) Variance(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- type Continuation
- type Meta
- type Operation
- type RNG
- type Set
- type Unary
- type V
Constants ¶
const ( QuantizeMask = (1 << 32) - 1 FractionBits = 23 )
const LFSRMask = 0x80000057
LFSRMask is a LFSR mask with a maximum period
const (
// S is the scaling factor for the softmax
S = 1.0 - 1e-300
)
Variables ¶
var ( // Static is the static context Static Context // Op is a operation Op = Static.Op // B converts a binary function into an operator B = Static.B // U converts a unary function into an operator U = Static.U // Copy copies src tensors into dst Copy = B(Static.Copy) // Add adds two tensors Add = B(Static.Add) // Sub subtracts two tensors Sub = B(Static.Sub) // Mul multiplies two tensors Mul = B(Static.Mul) // Hadamard computes the hadamard product of two tensors Hadamard = B(Static.Hadamard) // T the transpose of the matrix T = U(Static.T) // Slice slices the matrix Slice = U(Static.Slice) // Concat concats two tensors Concat = B(Static.Concat) // Dropout is a dropout regularization function Dropout = U(Static.Dropout) // Sin the sin of a tensors Sin = U(Static.Sin) // Cos the cosine of a tensor Cos = U(Static.Cos) // Exp the base e exponential of a tensor Exp = U(Static.Exp) // Log the natural logarithm of a tensor Log = U(Static.Log) // Sigmoid the sigmoid of a tensors Sigmoid = U(Static.Sigmoid) // TanH the hyperbolic tangent of a tensor TanH = U(Static.TanH) // Softplus the softplus activation function Softplus = U(Static.Softplus) // Everett computes the split reality activation function Everett = U(Static.Everett) EverettReLu = U(Static.EverettReLu) ReLu = U(Static.ReLu) // Softmax is the softmax function Softmax = U(Static.Softmax) // Sum sums a vector Sum = U(Static.Sum) // SumRows sums the rows of the matrix SumRows = U(Static.SumRows) // Quadratic computes the quadratic cost of two tensors Quadratic = B(Static.Quadratic) // CrossEntropy computes the cross entropy cost of two tensors CrossEntropy = B(Static.CrossEntropy) // Similarity computes the cosine similarity cost of two tensors Similarity = B(Static.Similarity) // Orthogonality computes the cosine similarity between all vectros Orthogonality = U(Static.Orthogonality) // Entropy computes the entropy of the vectors Entropy = U(Static.Entropy) // Variance computes the variance of the vectors Variance = U(Static.Variance) // Abs computes the absolute value of the tensor Abs = U(Static.Abs) // Quantize quantizes the values Quant = U(Static.Quant) // Avg computes the average of the tensor Avg = U(Static.Avg) )
Functions ¶
Types ¶
type Binary ¶
type Binary func(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
Binary is a binary function
type Context ¶
Context is a function context
func (*Context) Add ¶
func (context *Context) Add(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
Add adds two tensors
func (*Context) Concat ¶
func (context *Context) Concat(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
Concat concats two tensors
func (*Context) Copy ¶
func (context *Context) Copy(k Continuation, node int, dst, src *V, options ...map[string]interface{}) bool
Copy copies src tensors into dst
func (*Context) CrossEntropy ¶
func (context *Context) CrossEntropy(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
CrossEntropy computes the cross entropy cost of two tensors
func (*Context) Dropout ¶
func (context *Context) Dropout(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Dropout is a dropout regularization function
func (*Context) Entropy ¶
func (context *Context) Entropy(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Entropy computes the entropy of the vectors
func (*Context) Everett ¶
func (context *Context) Everett(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Everett computes the split reality activation function
func (*Context) EverettReLu ¶
func (context *Context) EverettReLu(k Continuation, node int, a *V, options ...map[string]interface{}) bool
EverettReLu computes an adapter relu
func (*Context) Hadamard ¶
func (context *Context) Hadamard(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
Hadamard computes the hadamard product of two tensors
func (*Context) Mul ¶
func (context *Context) Mul(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
Mul multiplies two tensors
func (*Context) Orthogonality ¶
func (context *Context) Orthogonality(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Orthogonality computes the cosine similarity between all vectros
func (*Context) Quadratic ¶
func (context *Context) Quadratic(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
Quadratic computes the quadratic cost of two tensors
func (*Context) Quant ¶
func (context *Context) Quant(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Quantize quantizes the values
func (*Context) ReLu ¶
func (context *Context) ReLu(k Continuation, node int, a *V, options ...map[string]interface{}) bool
ReLu computes the rectified linear activation function
func (*Context) Sigmoid ¶
func (context *Context) Sigmoid(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Sigmoid computes the sigmoid of a vector
func (*Context) Similarity ¶
func (context *Context) Similarity(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
Similarity computes the cosine similarity cost of two tensors
func (*Context) Slice ¶
func (context *Context) Slice(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Slice a slice of the matrix
func (*Context) Softmax ¶
func (context *Context) Softmax(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Softmax is the softmax function for big numbers
func (*Context) Softplus ¶
func (context *Context) Softplus(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Softplus the softplus activation function
func (*Context) Sub ¶
func (context *Context) Sub(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
Sub subtracts two tensors
func (*Context) SumRows ¶
func (context *Context) SumRows(k Continuation, node int, a *V, options ...map[string]interface{}) bool
SumRows sums the rows of the matrix
func (*Context) TanH ¶
func (context *Context) TanH(k Continuation, node int, a *V, options ...map[string]interface{}) bool
TanH the hyperbolic tangent of a tensor
type Meta ¶
type Meta func(k Continuation) Continuation
Meta is a function that takes a continuation and return a continuation
type Operation ¶
type Operation func(k Continuation, node int, a ...*V) bool
Operation is an operation that takes multiple parameters
type Set ¶
Set is a set of V
type Unary ¶
type Unary func(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Unary is a unary function