Documentation ¶
Overview ¶
Package goceptron is a more-or-less complete package to manage a perceptron
Index ¶
- type Layer
- type Neuron
- type Perceptron
- func (p *Perceptron) AddLayer(Size int)
- func (p *Perceptron) Backpropagation(expected []float64, eta float64) (outputError float64)
- func (p *Perceptron) BackpropagationCustom(expected []float64, eta float64, fn func(float64) float64) (outputError float64)
- func (p *Perceptron) CalculateLayer(layerPos int)
- func (p *Perceptron) CalculateLayerCustom(layerPos int, fn func(float64) float64)
- func (p *Perceptron) ComputeFromInput()
- func (p *Perceptron) ComputeFromInputCustom(fn func(float64) float64)
- func (p *Perceptron) Init(inputLayersize int, hiddenLayersSizes []int, outputLayersize int)
- func (p *Perceptron) LoadFromFile(path string) (err error)
- func (p Perceptron) SaveToFile(path string) (err error)
- func (p Perceptron) TryRecognition(expected int) (float64, bool)
- func (p Perceptron) TryRecognitionCustom(expected int, fn func(float64) float64) (float64, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Layer ¶
Layer struct, contains the Position of the layer in the perceptron, the number of Neurons in it, and the list of the Neurons in the layer
type Perceptron ¶
Perceptron struct, contains the number of Layers, and the list of Layers in the perceptron
func (*Perceptron) AddLayer ¶
func (p *Perceptron) AddLayer(Size int)
AddLayer adds a layer containing <Size> Neurons to the Perceptron
func (*Perceptron) Backpropagation ¶
func (p *Perceptron) Backpropagation(expected []float64, eta float64) (outputError float64)
Backpropagation makes the perceptron learn by modifying the Weights on all Neurons
func (*Perceptron) BackpropagationCustom ¶
func (p *Perceptron) BackpropagationCustom(expected []float64, eta float64, fn func(float64) float64) (outputError float64)
BackpropagationCustom makes the perceptron learn by modifying the Weights on all Neurons The derivative of the activation function is given as parameter
func (*Perceptron) CalculateLayer ¶
func (p *Perceptron) CalculateLayer(layerPos int)
CalculateLayer calculates the new neuron Values of the layer which have the Position <layerPos> in the perceptron The activation function is a sigmoid
func (*Perceptron) CalculateLayerCustom ¶
func (p *Perceptron) CalculateLayerCustom(layerPos int, fn func(float64) float64)
CalculateLayerCustom calculates the new neuron Values of the layer which have the Position <layerPos> in the perceptron The activation function is given as a parameter
func (*Perceptron) ComputeFromInput ¶
func (p *Perceptron) ComputeFromInput()
ComputeFromInput computes new neuron Values, except for the first layer The activation function is a sigmoid
func (*Perceptron) ComputeFromInputCustom ¶
func (p *Perceptron) ComputeFromInputCustom(fn func(float64) float64)
ComputeFromInputCustom computes new neuron Values, except for the first layer The activation function is given as a parameter
func (*Perceptron) Init ¶
func (p *Perceptron) Init(inputLayersize int, hiddenLayersSizes []int, outputLayersize int)
Init initializes the perceptron
func (*Perceptron) LoadFromFile ¶
func (p *Perceptron) LoadFromFile(path string) (err error)
LoadFromFile loads the perceptron from a given file
func (Perceptron) SaveToFile ¶
func (p Perceptron) SaveToFile(path string) (err error)
SaveToFile saves the perceptron to a given file
func (Perceptron) TryRecognition ¶
func (p Perceptron) TryRecognition(expected int) (float64, bool)
TryRecognition tests the rate of recognition of the values in the input neurons The activation function is a sigmoid
func (Perceptron) TryRecognitionCustom ¶
TryRecognitionCustom tests the rate of recognition of the values in the input neurons The activation function is given as a parameter