mirror of
https://github.com/sjwhitworth/golearn.git
synced 2025-04-26 13:49:14 +08:00
20 lines
519 B
Go
20 lines
519 B
Go
//Package neural contains Neural Network functions.
|
|
package neural
|
|
|
|
import (
|
|
"github.com/gonum/matrix/mat64"
|
|
)
|
|
|
|
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.
|
|
type LayerFunc func(*mat64.Dense)
|