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) Complex(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
- 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) Exp(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- func (c *Context) Get(node int) []complex128
- func (context *Context) H(k Continuation, node int, a *V, options ...map[string]interface{}) bool
- 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) Phase(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 (c *Context) Set(node int, value []complex128)
- 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 LFSRMask = 0x80000057
LFSRMask is a LFSR mask with a maximum period
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) // H the conjugate transpose of the matrix H = U(Static.H) // 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) // 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) // Avg computes the average of the tensor Avg = U(Static.Avg) // Combines two complex tensors to a complex tensor Complex = B(Static.Complex) // Phase computes the phase of a complex tensor Phase = U(Static.Phase) )
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 ¶
type Context struct { Quantize uint Node int Cache map[int][]complex128 }
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) Complex ¶
func (context *Context) Complex(k Continuation, node int, a, b *V, options ...map[string]interface{}) bool
Combines two complex tensors to a complex tensor
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) 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) Phase ¶
func (context *Context) Phase(k Continuation, node int, a *V, options ...map[string]interface{}) bool
Phase computes the phase of a complex tensor
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) Set ¶
func (c *Context) Set(node int, value []complex128)
Set sets a value in the cache
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
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
type V ¶
type V struct { N string // the name Seed RNG Drop float64 X []complex128 // the tensor D []complex128 // the derivative S []int // the shape States [][]complex128 }
V is a tensor value
func (*V) Set ¶
func (a *V) Set(values []complex128)
Set sets the values and zeros the partial derivatives