Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BiLn = Activation{ Activate: func(f float64) float64 { if f == 0 { return 0 } if f > 0 { return math.Log(1 + f) } return -math.Log(1 - f) }, Derivative: func(f float64) float64 { if f == 0 { return 1 } if f > 0 { return 1 / (1 + f) } return 1 / (1 - f) }, Show: func() string { return "BiLn" }, }
View Source
var ReLU = Activation{ Activate: func(f float64) float64 { return max(0, f) }, Derivative: func(f float64) float64 { if f > 0 { return 1 } return 0 }, Show: func() string { return "ReLU" }, }
View Source
var Sigmoid = Activation{ Activate: sigmoid, Derivative: func(f float64) float64 { s := sigmoid(f) return s * (1 - s) }, Show: func() string { return "Sigmoid" }, }
View Source
var Tanh = Activation{ Activate: math.Tanh, Derivative: func(f float64) float64 { t := math.Tanh(f) return 1 - t*t }, Show: func() string { return "Tanh" }, }
Functions ¶
This section is empty.
Types ¶
type Activation ¶
type Activation struct {
Activate func(float64) float64
Derivative func(float64) float64
Show func() string
}
func Linear ¶
func Linear(slope float64) Activation
func Scale ¶
func Scale(factor float64, General Activation) Activation
func Strech ¶
func Strech(factor float64, General Activation) Activation
func (Activation) MarshalJSON ¶ added in v0.0.2
func (a Activation) MarshalJSON() ([]byte, error)
func (Activation) String ¶ added in v0.0.2
func (a Activation) String() string
func (*Activation) UnmarshalJSON ¶ added in v0.0.2
func (a *Activation) UnmarshalJSON(text []byte) error
type Model ¶
type Model struct {
Weights []mat.Mutable
Internal Activation
Output Activation
}
func NewModel ¶
func NewModel(source *rand.Rand, Internal Activation, Output Activation, layers ...int) *Model
func (Model) OutputSize ¶
type TrainingContext ¶
Click to show internal directories.
Click to hide internal directories.