Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BPCostFunc ¶
type BPCostFunc interface { CostFunc CreateSlave() BPCostFunc BackPropagate() *tensor.Tensor }
BPCostFunc is a CostFunc than can backpropagate error
type BPLearnerLayer ¶
type BPLearnerLayer interface { Layer //BackPropagate updates the stored gradient for each parameter and returns the backpropagated gradient BackPropagate(err *tensor.Tensor) (*tensor.Tensor, error) //GetParamGradPointers returns a slice of pointers to prameters and gradients (in the same order) so gradient descent can update them. GetParamGradPointers() ([]*float64, []*float64) }
BPLearnerLayer is a layer that can be trained using backpropagation
type CostFunc ¶
CostFunc is an object capable of computing the loss value given a result and the correct answer
type DataSet ¶
type DataSet interface { GetDataSize() []int GetAnswersSize() []int GetSetSize() int //GetNextSet returns an input, the desired answer, and and error GetNextSet() (*tensor.Tensor, *tensor.Tensor, error) //After a reset, NextSet will be the first Reset() Close() //IsAnswer returns true if the output is to be considered correct based on the correct answer. For example, in classification data sets, this should return true if the maximum probability in output and answer is in the same label. IsAnswer(output *tensor.Tensor, answer *tensor.Tensor) bool }
DataSet is an interface that returns neural net inputs and tells you if the outputs are correct.
type EnslaverLayer ¶
type EnslaverLayer interface { //TODO maybe merge this with BPLearnerLayer Layer //A slave is a copy of the layer but with the parameters (for example weghts & biases) as a pointer to the parameters of the original layer. This is used to learn a batch in parallel. The learning method should be able to call different slave's Activate and Backpropagate methods in parallel. The parameter's update will be done syncronously, only on the base layer using the gradients from all slave layers. CreateSlave() Layer }
EnslaverLayer is a layer than can create slaves of itself
type Layer ¶
type Layer interface { ID() string //Activate takes and input tensor and computes an output tensor given the parameters and configuration of the layer Activate(input *tensor.Tensor) (*tensor.Tensor, error) GetInputSize() []int GetOutputSize() []int }
Layer is any object that accepts tensor.Tensor and returns tensor.Tensor. Each tensor.Tensor has a shape specified by GetSize. Layers only accept a specific shape. If any shape does not match the requirements the Layer will return error on Activate.
Click to show internal directories.
Click to hide internal directories.