Documentation
¶
Index ¶
- func DotInto(out, a, b *Matrix) error
- func DotTAInto(out, a, b *Matrix) error
- func LoadParams(r io.Reader, params ...*Node) error
- func LoadParamsFile(path string, params ...*Node) error
- func SaveParams(w io.Writer, params ...*Node) error
- func SaveParamsFile(path string, params ...*Node) error
- func TInto(dst, src *Matrix) error
- func ZeroGrads(nodes ...*Node)
- type Adam
- type BatchNorm
- func (b *BatchNorm) Backward(gradOutput *Matrix) (*Matrix, error)
- func (b *BatchNorm) Forward(input *Matrix) (*Matrix, error)
- func (b *BatchNorm) Grads() (*Matrix, []Float)
- func (b *BatchNorm) Init(inputCols int, _ *rand.Rand) (int, error)
- func (b *BatchNorm) Params() (*Matrix, []Float)
- func (b *BatchNorm) RunningStats() (mean, variance []Float)
- func (b *BatchNorm) SetParams(weights *Matrix, bias []Float) error
- type BinaryCrossEntropy
- type Conv2D
- func (c *Conv2D) Backward(gradOutput *Matrix) (*Matrix, error)
- func (c *Conv2D) Forward(input *Matrix) (*Matrix, error)
- func (c *Conv2D) Grads() (*Matrix, []Float)
- func (c *Conv2D) Init(inputCols int, rng *rand.Rand) (int, error)
- func (c *Conv2D) Params() (*Matrix, []Float)
- func (c *Conv2D) SetParams(weights *Matrix, bias []Float) error
- func (c *Conv2D) Shape() (inH, inW, inC, outC, kernel, stride, pad int)
- type Dense
- func (d *Dense) Backward(gradOutput *Matrix) (*Matrix, error)
- func (d *Dense) Forward(input *Matrix) (*Matrix, error)
- func (d *Dense) Grads() (*Matrix, []Float)
- func (d *Dense) Init(inputCols int, rng *rand.Rand) (int, error)
- func (d *Dense) Params() (*Matrix, []Float)
- func (d *Dense) SetParams(weights *Matrix, bias []Float) error
- type Dropout
- func (d *Dropout) Backward(gradOutput *Matrix) (*Matrix, error)
- func (d *Dropout) Forward(input *Matrix) (*Matrix, error)
- func (d *Dropout) Grads() (*Matrix, []Float)
- func (d *Dropout) Init(inputCols int, rng *rand.Rand) (int, error)
- func (d *Dropout) Params() (*Matrix, []Float)
- func (d *Dropout) SetParams(*Matrix, []Float) error
- type Embedding
- func (e *Embedding) Backward(gradOutput *Matrix) (*Matrix, error)
- func (e *Embedding) Forward(input *Matrix) (*Matrix, error)
- func (e *Embedding) Grads() (*Matrix, []Float)
- func (e *Embedding) Init(inputCols int, rng *rand.Rand) (int, error)
- func (e *Embedding) Params() (*Matrix, []Float)
- func (e *Embedding) SetParams(weights *Matrix, bias []Float) error
- type Float
- type GELU
- func (g *GELU) Backward(gradOutput *Matrix) (*Matrix, error)
- func (g *GELU) Forward(input *Matrix) (*Matrix, error)
- func (a *GELU) Grads() (*Matrix, []Float)
- func (g *GELU) Init(inputCols int, _ *rand.Rand) (int, error)
- func (a *GELU) Params() (*Matrix, []Float)
- func (a *GELU) SetParams(*Matrix, []Float) error
- type KNN
- type LSTMCell
- type Layer
- type LayerNorm
- func (l *LayerNorm) Backward(gradOutput *Matrix) (*Matrix, error)
- func (l *LayerNorm) Forward(input *Matrix) (*Matrix, error)
- func (l *LayerNorm) Grads() (*Matrix, []Float)
- func (l *LayerNorm) Init(inputCols int, _ *rand.Rand) (int, error)
- func (l *LayerNorm) Params() (*Matrix, []Float)
- func (l *LayerNorm) SetParams(weights *Matrix, bias []Float) error
- type LeakyReLU
- func (l *LeakyReLU) Backward(gradOutput *Matrix) (*Matrix, error)
- func (l *LeakyReLU) Forward(input *Matrix) (*Matrix, error)
- func (a *LeakyReLU) Grads() (*Matrix, []Float)
- func (l *LeakyReLU) Init(inputCols int, _ *rand.Rand) (int, error)
- func (a *LeakyReLU) Params() (*Matrix, []Float)
- func (a *LeakyReLU) SetParams(*Matrix, []Float) error
- type Loss
- type Matrix
- func Add(a, b *Matrix) (*Matrix, error)
- func AddBias(a *Matrix, bias []Float) (*Matrix, error)
- func Dot(a, b *Matrix) (*Matrix, error)
- func NewMatrix(rows, cols int) *Matrix
- func NewMatrixFromSlice(rows, cols int, data []Float) (*Matrix, error)
- func RandomMatrix(rows, cols int, rng *rand.Rand) *Matrix
- type MaxPool2D
- func (p *MaxPool2D) Backward(gradOutput *Matrix) (*Matrix, error)
- func (p *MaxPool2D) Forward(input *Matrix) (*Matrix, error)
- func (p *MaxPool2D) Grads() (*Matrix, []Float)
- func (p *MaxPool2D) Init(inputCols int, _ *rand.Rand) (int, error)
- func (p *MaxPool2D) Params() (*Matrix, []Float)
- func (p *MaxPool2D) SetParams(*Matrix, []Float) error
- func (p *MaxPool2D) Shape() (inH, inW, channels, size int)
- type MeanSquaredError
- type Model
- type Node
- func (n *Node) Add(o *Node) *Node
- func (n *Node) AddRow(row *Node) *Node
- func (n *Node) Backward()
- func (n *Node) MSELoss(target *Matrix) *Node
- func (n *Node) MatMul(o *Node) *Node
- func (n *Node) Mean() *Node
- func (n *Node) MulElem(o *Node) *Node
- func (n *Node) Named(name string) *Node
- func (n *Node) ReLU() *Node
- func (n *Node) Scalar() Float
- func (n *Node) Scale(s Float) *Node
- func (n *Node) Sigmoid() *Node
- func (n *Node) Softmax() *Node
- func (n *Node) SoftmaxCELoss(target *Matrix) *Node
- func (n *Node) Sub(o *Node) *Node
- func (n *Node) Sum() *Node
- func (n *Node) T() *Node
- func (n *Node) Tanh() *Node
- func (n *Node) ToDot() string
- type Optimizer
- type RNNCell
- type ReLU
- func (r *ReLU) Backward(gradOutput *Matrix) (*Matrix, error)
- func (r *ReLU) Forward(input *Matrix) (*Matrix, error)
- func (a *ReLU) Grads() (*Matrix, []Float)
- func (r *ReLU) Init(inputCols int, _ *rand.Rand) (int, error)
- func (a *ReLU) Params() (*Matrix, []Float)
- func (a *ReLU) SetParams(*Matrix, []Float) error
- type SGD
- type SelfAttention
- type Sequential
- func (s *Sequential) Add(layer Layer) *Sequential
- func (s *Sequential) Compile(inputCols int, loss Loss, optimizer Optimizer) error
- func (s *Sequential) Fit(input, target *Matrix, epochs int) error
- func (s *Sequential) FitStep(input, target *Matrix) (Float, error)
- func (s *Sequential) Layers() []Layer
- func (s *Sequential) Load(r io.Reader) error
- func (s *Sequential) LoadFile(path string) error
- func (s *Sequential) Predict(input *Matrix) (*Matrix, error)
- func (s *Sequential) Save(w io.Writer) error
- func (s *Sequential) SaveFile(path string) error
- type Sigmoid
- func (s *Sigmoid) Backward(gradOutput *Matrix) (*Matrix, error)
- func (s *Sigmoid) Forward(input *Matrix) (*Matrix, error)
- func (a *Sigmoid) Grads() (*Matrix, []Float)
- func (s *Sigmoid) Init(inputCols int, _ *rand.Rand) (int, error)
- func (a *Sigmoid) Params() (*Matrix, []Float)
- func (a *Sigmoid) SetParams(*Matrix, []Float) error
- type Softmax
- func (s *Softmax) Backward(gradOutput *Matrix) (*Matrix, error)
- func (s *Softmax) Forward(input *Matrix) (*Matrix, error)
- func (a *Softmax) Grads() (*Matrix, []Float)
- func (s *Softmax) Init(inputCols int, _ *rand.Rand) (int, error)
- func (a *Softmax) Params() (*Matrix, []Float)
- func (a *Softmax) SetParams(*Matrix, []Float) error
- type SoftmaxCrossEntropy
- type Tanh
- func (t *Tanh) Backward(gradOutput *Matrix) (*Matrix, error)
- func (t *Tanh) Forward(input *Matrix) (*Matrix, error)
- func (a *Tanh) Grads() (*Matrix, []Float)
- func (t *Tanh) Init(inputCols int, _ *rand.Rand) (int, error)
- func (a *Tanh) Params() (*Matrix, []Float)
- func (a *Tanh) SetParams(*Matrix, []Float) error
- type Trainer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DotTAInto ¶
DotTAInto computes out = a^T * b into an existing matrix, overwriting it, without materializing the transpose: a is read row by row and scattered into out with the same vector kernel Dot uses. Shapes: a is RxI, b is RxJ, out is IxJ.
func LoadParams ¶
LoadParams restores parameter values saved by SaveParams. The parameters must be passed in the same order and have the same shapes as when saved.
func LoadParamsFile ¶
LoadParamsFile restores autograd parameters from a file written by SaveParamsFile.
func SaveParams ¶
SaveParams writes the values of autograd parameters as JSON, in the given order. Pass the same parameter list a Trainer uses, e.g. SaveParams(w, cell.Params()...).
func SaveParamsFile ¶
SaveParamsFile writes autograd parameters to a JSON file.
Types ¶
type Adam ¶
type Adam struct {
LR Float
Beta1 Float
Beta2 Float
Eps Float
WeightDecay Float
// contains filtered or unexported fields
}
Adam optimizer. With WeightDecay > 0 it becomes AdamW: decay is decoupled from the gradient update and applied to weights only (never to biases).
type BatchNorm ¶
type BatchNorm struct {
Momentum Float // running-stats decay, default 0.9
Eps Float // numerical stability, default 1e-5
// contains filtered or unexported fields
}
BatchNorm normalizes each feature column over the batch, then applies a learned scale (gamma) and shift (beta). During training it normalizes with batch statistics and maintains running estimates; during inference it uses the running estimates.
gamma is exposed as the layer's weights (a 1xC matrix) and beta as its bias, so optimizers update them like any other parameters.
func NewBatchNorm ¶
func NewBatchNorm() *BatchNorm
NewBatchNorm returns a BatchNorm layer with standard defaults.
func (*BatchNorm) RunningStats ¶
RunningStats returns the running mean and variance estimates used at inference time, for exporters.
type BinaryCrossEntropy ¶
type BinaryCrossEntropy struct{}
BinaryCrossEntropy computes the average binary cross-entropy between predicted probabilities in (0,1) and 0/1 targets of the same shape. Pair it with a Sigmoid output layer.
func (BinaryCrossEntropy) Loss ¶
func (BinaryCrossEntropy) Loss(pred, target *Matrix) (Float, *Matrix, error)
Loss returns the average binary cross-entropy and its gradient.
type Conv2D ¶
type Conv2D struct {
// contains filtered or unexported fields
}
Conv2D is a 2D convolution layer. Because the framework moves data as flat MxN matrices, each sample row must be laid out channel-major: index = (channel*height + y)*width + x. The output uses the same layout.
The convolution is computed as a matrix product over an im2col expansion, so it reuses the tuned Dot kernel. Weights are stored as an (inC*kernel*kernel) x outC matrix.
type Dense ¶
type Dense struct {
// contains filtered or unexported fields
}
Dense is a fully-connected layer: y = x*W + b.
type Dropout ¶
type Dropout struct {
Rate Float
// contains filtered or unexported fields
}
Dropout randomly zeroes elements during training with probability Rate and scales the survivors by 1/(1-Rate) ("inverted dropout"), so inference is a plain pass-through with no rescaling.
func NewDropout ¶
NewDropout returns a Dropout layer that drops the given fraction of activations during training. Rate must be in [0, 1).
type Embedding ¶
type Embedding struct {
// contains filtered or unexported fields
}
Embedding looks up a learned vector for each token id in the input row and concatenates the vectors across columns.
func NewEmbedding ¶
NewEmbedding returns a trainable embedding table of shape vocabSize x dim.
type Float ¶
type Float = float32
Float is the element type of every tensor. float32 halves memory traffic versus float64 and enables the 8-lane AVX2 kernel (see dot_simd.go); its ~7 decimal digits are plenty for neural-network training.
type GELU ¶
type GELU struct {
// contains filtered or unexported fields
}
GELU activation: f(x) = 0.5*x*(1+erf(x/sqrt(2))).
type KNN ¶
type KNN struct {
K int
// contains filtered or unexported fields
}
KNN is a k-nearest-neighbors classifier. It is a lazy learner: Fit just stores the training data, and Predict ranks neighbors by squared Euclidean distance. The distance computation is reduced to one matrix product per chunk (||a-b||^2 = ||a||^2 + ||b||^2 - 2*a.b), so it runs on the same tuned Dot kernel as the neural networks.
type LSTMCell ¶
type LSTMCell struct {
// One (Wx, Wh, B) triple per gate: forget, input, output, candidate.
Wxf, Whf, Bf *Node
Wxi, Whi, Bi *Node
Wxo, Who, Bo *Node
Wxg, Whg, Bg *Node
}
LSTMCell is a long short-term memory cell with forget/input/output gates.
func NewLSTMCell ¶
NewLSTMCell returns a randomly initialized LSTM cell. Forget-gate biases start at 1 so early training defaults to remembering.
type Layer ¶
type Layer interface {
// Init configures parameters using the given RNG and input width.
Init(inputCols int, rng *rand.Rand) (outputCols int, err error)
// Forward computes activations given the input batch.
Forward(input *Matrix) (*Matrix, error)
// Backward computes the gradient with respect to the layer input,
// given the gradient with respect to the layer output.
Backward(gradOutput *Matrix) (*Matrix, error)
// Grads returns the parameter gradients accumulated during the last
// backward pass, in the order [weights, bias]. Layers without
// parameters return nil.
Grads() (*Matrix, []Float)
// Params returns the current parameters [weights, bias].
Params() (*Matrix, []Float)
// SetParams replaces the parameters [weights, bias].
SetParams(weights *Matrix, bias []Float) error
}
Layer is a single differentiable stage of a Sequential model. Forward and Backward are batched: inputs/outputs are MxN matrices where M is the batch size and N is the feature dimension.
type LayerNorm ¶
type LayerNorm struct {
// contains filtered or unexported fields
}
LayerNorm normalizes each row over its feature dimension and applies a learnable affine transform.
func NewLayerNorm ¶
func NewLayerNorm() *LayerNorm
NewLayerNorm returns a LayerNorm with the default epsilon.
type LeakyReLU ¶
type LeakyReLU struct {
Alpha Float
// contains filtered or unexported fields
}
LeakyReLU activation: f(x) = x for x > 0, alpha*x otherwise.
func NewLeakyReLU ¶
NewLeakyReLU returns a LeakyReLU with the given negative-side slope.
type Loss ¶
type Loss interface {
// Loss returns the average loss and the per-element gradient dL/dpred.
Loss(pred, target *Matrix) (Float, *Matrix, error)
// Name is a short identifier for logging.
Name() string
}
Loss is a differentiable loss function operating on a prediction batch and a target batch of the same shape. It returns the scalar loss and the gradient of the loss with respect to the predictions.
type Matrix ¶
Matrix is a row-major 2D tensor of Float.
func NewMatrixFromSlice ¶
NewMatrixFromSlice creates a rows x cols matrix from row-major data.
func RandomMatrix ¶
RandomMatrix fills a matrix with samples from a normal distribution scaled by the Glorot/Bengio gain for the given fan-in / fan-out.
type MaxPool2D ¶
type MaxPool2D struct {
// contains filtered or unexported fields
}
MaxPool2D downsamples each channel by taking the maximum over non-overlapping size x size windows. It expects the same channel-major layout as Conv2D.
func NewMaxPool2D ¶
NewMaxPool2D returns a max-pooling layer with stride equal to size.
type MeanSquaredError ¶
type MeanSquaredError struct{}
MeanSquaredError computes the average of squared differences.
func (MeanSquaredError) Loss ¶
func (MeanSquaredError) Loss(pred, target *Matrix) (Float, *Matrix, error)
Loss returns the mean squared error and its gradient.
type Node ¶
Node is a matrix-valued node in a dynamically built computation graph for reverse-mode automatic differentiation. Build the forward computation by chaining operations, then call Backward on the (scalar) result to fill Grad on every Param node that contributed to it.
Unlike the Layer API, shape mismatches panic: graph construction errors are programming errors, and error returns would make chaining unusable.
w := tensai.Param(tensai.RandomMatrix(2, 8, rng)) b := tensai.Param(tensai.NewMatrix(1, 8)) loss := tensai.Input(x).MatMul(w).AddRow(b).ReLU().MSELoss(y) loss.Backward() // w.Grad and b.Grad now hold dLoss/dw and dLoss/db.
func Attention ¶
Attention computes scaled dot-product attention softmax(q*k^T/sqrt(d))*v for a single sequence, where q, k, v are (seqLen x d) nodes.
func Param ¶
Param wraps a matrix as a trainable graph leaf. Backward accumulates its gradient into Grad.
func (*Node) Backward ¶
func (n *Node) Backward()
Backward runs reverse-mode differentiation from n, which should be a scalar (1x1) loss. Gradients accumulate into the Grad field of every contributing Param node.
func (*Node) SoftmaxCELoss ¶
SoftmaxCELoss returns the scalar softmax cross-entropy against integer class labels (an Mx1 matrix of class indices), matching the SoftmaxCrossEntropy loss used by Sequential models.
func (*Node) ToDot ¶
ToDot renders the computation graph rooted at n in Graphviz DOT format, in the spirit of Gorgonia's encoding/dot. Pipe it through the dot tool to get an image:
go run ./_example/dot | dot -Tsvg > graph.svg
Leaves are drawn as boxes (Param blue, Input gray) and operations as rounded nodes; every node shows its shape. Use Named to label leaves.
type Optimizer ¶
type Optimizer interface {
// Step applies one update to the given parameters using their gradients.
// It is called once per parameterized layer.
Step(idx int, weights, gradW *Matrix, bias, gradB []Float)
// NewLayer registers a new parameterized layer and returns its index.
NewLayer() int
// Name returns a short identifier.
Name() string
}
Optimizer updates a set of (weights, bias) parameter pairs using their gradients. One Optimizer instance is shared by the model; each parameterized layer gets its own state buffer inside the optimizer.
type RNNCell ¶
RNNCell is a simple (Elman) recurrent cell: h' = tanh(x*Wx + h*Wh + b).
func NewRNNCell ¶
NewRNNCell returns a randomly initialized RNN cell.
type ReLU ¶
type ReLU struct {
// contains filtered or unexported fields
}
ReLU activation: f(x) = max(0, x).
type SGD ¶
SGD is stochastic gradient descent with optional momentum.
type SelfAttention ¶
type SelfAttention struct {
Wq, Wk, Wv *Node // inSize x dModel
}
SelfAttention is a single-head self-attention block with learned query, key, and value projections. It operates on one sequence at a time: the input is a (seqLen x inSize) node.
func NewSelfAttention ¶
func NewSelfAttention(inSize, dModel int, rng *rand.Rand) *SelfAttention
NewSelfAttention returns a randomly initialized self-attention block.
func (*SelfAttention) Forward ¶
func (a *SelfAttention) Forward(x *Node) *Node
Forward applies self-attention to a (seqLen x inSize) sequence, returning a (seqLen x dModel) sequence.
func (*SelfAttention) Params ¶
func (a *SelfAttention) Params() []*Node
Params returns the block's trainable parameters, for NewTrainer.
type Sequential ¶
type Sequential struct {
// contains filtered or unexported fields
}
Sequential stacks layers and runs forward/backward passes.
func NewSequential ¶
func NewSequential() *Sequential
NewSequential returns an empty Sequential model. optimizer and loss are configured via Compile.
func (*Sequential) Add ¶
func (s *Sequential) Add(layer Layer) *Sequential
Add appends a layer to the network. Layers are added in forward order.
func (*Sequential) Compile ¶
func (s *Sequential) Compile(inputCols int, loss Loss, optimizer Optimizer) error
Compile wires the loss and optimizer and initializes all parameters. inputCols is the number of features in a single input row.
func (*Sequential) Fit ¶
func (s *Sequential) Fit(input, target *Matrix, epochs int) error
Fit trains the model for the given number of epochs over the dataset. If epochs > 1 the full dataset is reused each epoch (full-batch by default; callers can pass minibatches to FitStep directly for finer control).
func (*Sequential) FitStep ¶
func (s *Sequential) FitStep(input, target *Matrix) (Float, error)
FitStep performs one forward + loss + backward + update pass for a batch and returns the average loss for that batch.
func (*Sequential) Layers ¶
func (s *Sequential) Layers() []Layer
Layers returns the layers in forward order, for tools that walk the model structure (e.g. format exporters).
func (*Sequential) Load ¶
func (s *Sequential) Load(r io.Reader) error
Load restores parameters saved by Save into a model compiled with the same architecture.
func (*Sequential) LoadFile ¶
func (s *Sequential) LoadFile(path string) error
LoadFile restores parameters from a file written by SaveFile.
func (*Sequential) Predict ¶
func (s *Sequential) Predict(input *Matrix) (*Matrix, error)
Predict runs a forward pass with no gradient tracking.
func (*Sequential) Save ¶
func (s *Sequential) Save(w io.Writer) error
Save writes the model's parameters as JSON. The architecture itself is not stored: Load must be called on a model built and compiled with the same layers.
func (*Sequential) SaveFile ¶
func (s *Sequential) SaveFile(path string) error
SaveFile writes the model's parameters to a JSON file.
type Sigmoid ¶
type Sigmoid struct {
// contains filtered or unexported fields
}
Sigmoid activation: f(x) = 1 / (1 + e^-x).
type Softmax ¶
type Softmax struct {
// contains filtered or unexported fields
}
Softmax normalizes each row into a probability distribution. Unlike the element-wise activations its backward pass couples all columns of a row. Note that SoftmaxCrossEntropy already applies softmax internally; use this layer only when the model output itself must be probabilities (e.g. with a custom loss).
type SoftmaxCrossEntropy ¶
type SoftmaxCrossEntropy struct{}
SoftmaxCrossEntropy combines softmax + cross-entropy with integer class labels. Targets must be an Mx1 matrix whose entries are class indices.
func (SoftmaxCrossEntropy) Loss ¶
func (SoftmaxCrossEntropy) Loss(pred, target *Matrix) (Float, *Matrix, error)
Loss returns the average negative log-likelihood of the target classes and the combined softmax-cross-entropy gradient (pred - onehot) / batch.
func (SoftmaxCrossEntropy) LossInto ¶
func (SoftmaxCrossEntropy) LossInto(pred, target, grad *Matrix) (Float, error)
LossInto writes the softmax-cross-entropy gradient into grad.
func (SoftmaxCrossEntropy) Name ¶
func (SoftmaxCrossEntropy) Name() string
Name returns "softmax_ce".
type Tanh ¶
type Tanh struct {
// contains filtered or unexported fields
}
Tanh activation: f(x) = tanh(x).
type Trainer ¶
type Trainer struct {
// contains filtered or unexported fields
}
Trainer owns the optimizer bookkeeping for a set of autograd parameters, so a training step is just building the loss graph and calling Step.
trainer := tensai.NewTrainer(tensai.NewAdam(0.05), w1, b1, w2, b2)
for step := 0; step < 2000; step++ {
loss := forward(x).MSELoss(y)
trainer.Step(loss)
}
func NewTrainer ¶
NewTrainer registers the parameters with the optimizer and returns a Trainer that updates them.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
_example
|
|
|
charrnn
command
Command charrnn trains a character-level LSTM on a small embedded corpus and generates text from it.
|
Command charrnn trains a character-level LSTM on a small embedded corpus and generates text from it. |
|
dot
command
Command dot prints the computation graph of z = x + y in Graphviz DOT format — tensai's equivalent of Gorgonia's encoding/dot example.
|
Command dot prints the computation graph of z = x + y in Graphviz DOT format — tensai's equivalent of Gorgonia's encoding/dot example. |
|
fizzbuzz
command
|
|
|
helloworld
command
Command helloworld is the smallest possible tensai program: build a computation graph that adds two values, evaluate it, and differentiate it — tensai's equivalent of Gorgonia's hello world.
|
Command helloworld is the smallest possible tensai program: build a computation graph that adds two values, evaluate it, and differentiate it — tensai's equivalent of Gorgonia's hello world. |
|
iris
command
|
|
|
mnist
command
|
|
|
plasma
command
Command plasma renders a demoscene-style plasma effect in the terminal — except the plasma function is a neural network.
|
Command plasma renders a demoscene-style plasma effect in the terminal — except the plasma function is a neural network. |
|
spiral
command
|
|
|
xor
command
|