Documentation
¶
Index ¶
- func Backpropagation(n *neural.Network, in, ideal []float64, speed float64)
- func Learn(n *neural.Network, in, ideal []float64, speed float64)
- func Learner(n *neural.Network, samples []Sample, speed float64)
- type Deltas
- type Sample
- type Set
- func (s *Set) AddClass(label string) (bool, error)
- func (s *Set) AddSample(sample *Sample) error
- func (s *Set) GenerateOutputVector(label string) []float64
- func (s *Set) GetClasses() []string
- func (s *Set) LoadFromCSV(path string) (bool, error)
- func (s *Set) LoadFromSVMFile(path string) (bool, error)
- func (s *Set) SampleExists(test *Sample) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Backpropagation ¶
Backpropagation uses backprop on the network
Types ¶
type Sample ¶
type Sample struct { Vector []float64 Output []float64 Value float64 VectorHash string OutputHash string Label string ClassNumber int }
Sample holds the sample data, value is just used for regression annotation
func NewClassificationSample ¶
NewClassificationSample creates a new sample data point for classification
func NewRegressionSample ¶
NewRegressionSample creates a new sample data point for classification
func (*Sample) UpdateHashes ¶
func (s *Sample) UpdateHashes()
UpdateHashes updates hashes of vector and output vector
type Set ¶
type Set struct { Samples []*Sample VectorHashes []string OutputHashes []string ClassToLabel map[int]string Usage neural.NetworkType }
Set holds the samples and the output labels
func NewSet ¶
func NewSet(usage neural.NetworkType) *Set
NewSet creates a new set of empty data samples
func (*Set) GenerateOutputVector ¶
GenerateOutputVector generates the output vector for a classification task and a specific label
func (*Set) GetClasses ¶
GetClasses returns the classes in the set
func (*Set) LoadFromCSV ¶
LoadFromCSV where the last dimension is the label
func (*Set) LoadFromSVMFile ¶
LoadFromSVMFile load data from an svm problem file
func (*Set) SampleExists ¶
SampleExists looks up in the set if the presented example already exists