Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotEnoughLayers is returned when trying to create a new network with too few layers. ErrNotEnoughLayers = errors.New("too few layers, minimum of 3 required") )
Functions ¶
This section is empty.
Types ¶
type ActivationFunction ¶
type ActivationFunction int
ActivationFunction is the type of function to use for the neural network.
const ( Sigmond ActivationFunction = iota BentIdentity ReLU LeakyReLU ArSinH )
Activation functions available to this package. These are taken from https://en.wikipedia.org/wiki/Activation_function
func (ActivationFunction) String ¶
func (a ActivationFunction) String() string
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network is containing all the needed settings/variables.
func NewNetwork ¶
func NewNetwork(ls []int, activationFunc ActivationFunction) (*Network, error)
NewNetwork is for creating a new network with the defined layers.
func (*Network) MarshalJSON ¶
MarshalJSON implements the Marshaler interface for JSON encoding.
func (*Network) Train ¶
Train is for training the network with the specified dataset, epoch and learning rate. The last bool parameter is for tracking where the training is. It'll log each epoch.
func (*Network) UnmarshalJSON ¶
UnmarshalJSON implements the Unmarshaler interface for JSON encoding.
Click to show internal directories.
Click to hide internal directories.