mirror of
https://github.com/sjwhitworth/golearn.git
synced 2025-04-28 13:48:56 +08:00
Merge e99043d4ac7412554fc0d3ed95e79fe6fbb62ddc into 74ae077eafb245fa3bdca0288854b6d51f97fe60
This commit is contained in:
commit
d781c9002e
@ -12,6 +12,14 @@ var Sigmoid NeuralFunction = NeuralFunction{
|
|||||||
func(v float64) float64 { return v * (1 - v) },
|
func(v float64) float64 { return v * (1 - v) },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TanhForward function does tanh(t) = \frac{1 - e^{-2t}}{1 + e^{-2t}}
|
||||||
|
//
|
||||||
|
// See https://en.wikipedia.org/wiki/Hyperbolic_functions
|
||||||
|
var Tanh NeuralFunction = NeuralFunction{
|
||||||
|
func(v float64) float64 { return math.Tanh(v) },
|
||||||
|
func(v float64) float64 { return 1 - (v * v) },
|
||||||
|
}
|
||||||
|
|
||||||
// LinearFunction doesn't modify the value
|
// LinearFunction doesn't modify the value
|
||||||
var Linear NeuralFunction = NeuralFunction{
|
var Linear NeuralFunction = NeuralFunction{
|
||||||
func(v float64) float64 { return v },
|
func(v float64) float64 { return v },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user