2014-08-05 16:04:43 +01:00
|
|
|
//Package neural contains Neural Network functions.
|
|
|
|
package neural
|
|
|
|
|
|
|
|
import (
|
2018-03-23 23:39:55 +00:00
|
|
|
"gonum.org/v1/gonum/mat"
|
2014-08-05 16:04:43 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type ActivationFunction func(float64) float64
|
|
|
|
|
|
|
|
// First function is always the forward activation function
|
|
|
|
// Second function is always the backward activation function
|
|
|
|
type NeuralFunction struct {
|
|
|
|
Forward ActivationFunction
|
|
|
|
Backward ActivationFunction
|
|
|
|
}
|
|
|
|
|
|
|
|
// LayerFuncs are vectorised layer value transformation functions
|
|
|
|
// (e.g. sigmoid). They must operate in-place.
|
2018-03-23 23:39:55 +00:00
|
|
|
type LayerFunc func(*mat.Dense)
|