Documentation
¶
Index ¶
- func Logistic(x, a float64) float64
- func Normal(stdDev, mean float64) float64
- func Uniform(stdDev, mean float64) float64
- type ActivationType
- type BinaryCrossEntropy
- type Config
- type CrossEntropy
- type Differentiable
- type Dump
- type Layer
- type Linear
- type Loss
- type LossType
- type MeanSquared
- type Mode
- type Neural
- func (n *Neural) ApplyWeights(weights [][][]float64)
- func (n Neural) Dump() *Dump
- func (n *Neural) Forward(input []float64) error
- func (n Neural) Marshal() ([]byte, error)
- func (n *Neural) NumWeights() (num int)
- func (n *Neural) Predict(input []float64) []float64
- func (n *Neural) String() string
- func (n Neural) Weights() [][][]float64
- type Neuron
- type ReLU
- type Sigmoid
- type Synapse
- type Tanh
- type WeightInitializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActivationType ¶
type ActivationType int
const ( ActivationNone ActivationType = iota ActivationSigmoid ActivationTanh ActivationReLU ActivationLinear ActivationSoftmax )
func OutputActivation ¶
func OutputActivation(c Mode) ActivationType
type BinaryCrossEntropy ¶
type BinaryCrossEntropy struct{}
func (BinaryCrossEntropy) Df ¶
func (l BinaryCrossEntropy) Df(estimate, ideal, activation float64) float64
func (BinaryCrossEntropy) F ¶
func (l BinaryCrossEntropy) F(estimate, ideal [][]float64) float64
type Config ¶
type Config struct {
Inputs int
Layout []int
Activation ActivationType
Mode Mode
Weight WeightInitializer `json:"-"`
Loss LossType
Bias bool
}
type CrossEntropy ¶
type CrossEntropy struct{}
func (CrossEntropy) Df ¶
func (l CrossEntropy) Df(estimate, ideal, activation float64) float64
func (CrossEntropy) F ¶
func (l CrossEntropy) F(estimate, ideal [][]float64) float64
type Differentiable ¶
func GetActivation ¶
func GetActivation(act ActivationType) Differentiable
type Layer ¶
type Layer struct {
Neurons []*Neuron
A ActivationType
}
func NewLayer ¶
func NewLayer(n int, activation ActivationType) *Layer
func (*Layer) ApplyBias ¶
func (l *Layer) ApplyBias(weight WeightInitializer) []*Synapse
func (*Layer) Connect ¶
func (l *Layer) Connect(next *Layer, weight WeightInitializer)
type Loss ¶
type MeanSquared ¶
type MeanSquared struct{}
func (MeanSquared) Df ¶
func (l MeanSquared) Df(estimate, ideal, activation float64) float64
func (MeanSquared) F ¶
func (l MeanSquared) F(estimate, ideal [][]float64) float64
type Neuron ¶
type Neuron struct {
A ActivationType `json:"-"`
In []*Synapse
Out []*Synapse
Value float64 `json:"-"`
}
func NewNeuron ¶
func NewNeuron(activation ActivationType) *Neuron
type Synapse ¶
func NewSynapse ¶
type WeightInitializer ¶
type WeightInitializer func() float64
func NewNormal ¶
func NewNormal(stdDev, mean float64) WeightInitializer
func NewUniform ¶
func NewUniform(stdDev, mean float64) WeightInitializer
Source Files
¶
Click to show internal directories.
Click to hide internal directories.