Documentation ¶
Overview ¶
Holds collection of utils commonly used across various packages
Index ¶
- Variables
- func RandSign() int32
- func SingleRouletteThrow(probabilities []float64) int
- type ActivationFunction
- type ModuleActivationFunction
- type NodeActivationType
- type NodeActivatorsFactory
- func (a *NodeActivatorsFactory) ActivateByType(input float64, aux_params []float64, a_type NodeActivationType) (float64, error)
- func (a *NodeActivatorsFactory) ActivateModuleByType(inputs []float64, aux_params []float64, a_type NodeActivationType) ([]float64, error)
- func (a *NodeActivatorsFactory) ActivationNameFromType(atype NodeActivationType) (string, error)
- func (a *NodeActivatorsFactory) ActivationTypeFromName(name string) (NodeActivationType, error)
- func (a *NodeActivatorsFactory) Register(a_type NodeActivationType, a_func ActivationFunction, f_name string)
- func (a *NodeActivatorsFactory) RegisterModule(a_type NodeActivationType, a_func ModuleActivationFunction, f_name string)
Constants ¶
This section is empty.
Variables ¶
var NodeActivators = NewNodeActivatorsFactory()
The default node activators factory reference
Functions ¶
func RandSign ¶
func RandSign() int32
Returns subsequent random positive or negative integer value (1 or -1) to randomize value sign
func SingleRouletteThrow ¶
Performs a single thrown onto a roulette wheel where the wheel's space is unevenly divided. The probability that a segment will be selected is given by that segment's value in the probabilities array. Returns segment index or -1 if something goes awfully wrong
Types ¶
type ActivationFunction ¶
The neuron node activation function type
type ModuleActivationFunction ¶
The neurons module activation function type
type NodeActivationType ¶
type NodeActivationType byte
NodeActivationType defines the type of activation function to use for the neuron node
const ( // The sigmoid activation functions SigmoidPlainActivation NodeActivationType = iota + 1 SigmoidReducedActivation SigmoidBipolarActivation SigmoidSteepenedActivation SigmoidApproximationActivation SigmoidSteepenedApproximationActivation SigmoidInverseAbsoluteActivation SigmoidLeftShiftedActivation SigmoidLeftShiftedSteepenedActivation SigmoidRightShiftedSteepenedActivation // The other activators assortment TanhActivation GaussianBipolarActivation LinearActivation LinearAbsActivation LinearClippedActivation NullActivation SignActivation SineActivation StepActivation // The modular activators (with multiple inputs/outputs) MultiplyModuleActivation MaxModuleActivation MinModuleActivation )
The neuron Activation function Types
type NodeActivatorsFactory ¶
type NodeActivatorsFactory struct {
// contains filtered or unexported fields
}
The factory to provide appropriate neuron node activation function
func NewNodeActivatorsFactory ¶
func NewNodeActivatorsFactory() *NodeActivatorsFactory
Returns node activator factory initialized with default activation functions
func (*NodeActivatorsFactory) ActivateByType ¶
func (a *NodeActivatorsFactory) ActivateByType(input float64, aux_params []float64, a_type NodeActivationType) (float64, error)
Method to calculate activation value for give input and auxiliary parameters using activation function with specified type. Will return error and -0.0 activation if unsupported activation type requested.
func (*NodeActivatorsFactory) ActivateModuleByType ¶
func (a *NodeActivatorsFactory) ActivateModuleByType(inputs []float64, aux_params []float64, a_type NodeActivationType) ([]float64, error)
Method will apply corresponding module activation function to the input values and returns appropriate output values. Will panic if unsupported activation function requested
func (*NodeActivatorsFactory) ActivationNameFromType ¶
func (a *NodeActivatorsFactory) ActivationNameFromType(atype NodeActivationType) (string, error)
Returns activation function name from given type
func (*NodeActivatorsFactory) ActivationTypeFromName ¶
func (a *NodeActivatorsFactory) ActivationTypeFromName(name string) (NodeActivationType, error)
Parse node activation type name and return corresponding activation type
func (*NodeActivatorsFactory) Register ¶
func (a *NodeActivatorsFactory) Register(a_type NodeActivationType, a_func ActivationFunction, f_name string)
Registers given neuron activation function with provided type and name into the factory
func (*NodeActivatorsFactory) RegisterModule ¶
func (a *NodeActivatorsFactory) RegisterModule(a_type NodeActivationType, a_func ModuleActivationFunction, f_name string)
Registers given neuron module activation function with provided type and name into the factory