Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Identity ¶
Identity returns the input value.
Example ¶
package main import ( "fmt" "github.com/itsubaki/neu/activation" ) func main() { fmt.Println(activation.Identity(100)) }
Output: 100
func ReLU ¶
Example ¶
package main import ( "fmt" "github.com/itsubaki/neu/activation" ) func main() { fmt.Println(activation.ReLU(-1.0)) fmt.Println(activation.ReLU(-0.1)) fmt.Println(activation.ReLU(0.0)) fmt.Println(activation.ReLU(0.1)) fmt.Println(activation.ReLU(1.0)) }
Output: 0 0 0 0.1 1
func Sigmoid ¶
Example ¶
package main import ( "fmt" "github.com/itsubaki/neu/activation" ) func main() { fmt.Println(activation.Sigmoid(-1e+7)) fmt.Println(activation.Sigmoid(0.0)) fmt.Println(activation.Sigmoid(1e+7)) }
Output: 0 0.5 1
func Softmax ¶
Softmax returns the softmax of the input vector.
Example ¶
package main import ( "fmt" "github.com/itsubaki/neu/activation" ) func main() { y := activation.Softmax([]float64{0.3, 2.9, 4.0}) fmt.Println(y) var sum float64 for i := range y { sum = sum + y[i] } fmt.Println(sum) }
Output: [0.01821127329554753 0.24519181293507386 0.7365969137693786] 1
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.