Documentation ¶
Index ¶
- Variables
- func Collatz(x float64, n *Node) float64
- func Compute_loss(value float64) float64
- func ExpE(x float64, n *Node) float64
- func ExpPi(x float64, n *Node) float64
- func ExpSqrtE(x float64, n *Node) float64
- func ExpSqrtPi(x float64, n *Node) float64
- func Log(x float64, n *Node) float64
- func NA(x *mat.VecDense, L Layer)
- func NodeLU(x float64, n *Node) float64
- func ReLU(x float64, n *Node) float64
- func SoftMax(x *mat.VecDense, L Layer)
- type Gorebrum
- func (N *Gorebrum) Computer_fraward_pass()
- func (N *Gorebrum) Display_Network()
- func (N *Gorebrum) Encode_model(name string)
- func (N Gorebrum) Get_Depth() int
- func (N Gorebrum) Get_Layers() []*Layer
- func (N Gorebrum) Get_Output() *mat.VecDense
- func (N Gorebrum) Get_Width() int
- func (N Gorebrum) Get_input() *mat.VecDense
- func (N Gorebrum) Get_layer(index int) *Layer
- func (net *Gorebrum) New_Layer(length int, inputsLen int, Activation string, Index int)
- func (N *Gorebrum) Set_Depth(depth int)
- func (N *Gorebrum) Set_In_dimensions(inDimensions int)
- func (N *Gorebrum) Set_Layer(index int, layer *Layer)
- func (N *Gorebrum) Set_Out_dimensions(outDimensions int)
- func (N *Gorebrum) Set_Output(output *mat.VecDense)
- func (N *Gorebrum) Set_Width(width int)
- func (N *Gorebrum) Set_inputs(inputs []float64)
- func (N *Gorebrum) ToXML() string
- func (N *Gorebrum) Update_Output()
- type Layer
- func (L Layer) Compute_Layer()
- func (L Layer) Display_info()
- func (L *Layer) Get_Activation() string
- func (L *Layer) Get_Index() int
- func (L *Layer) Get_Nodes() []*Node
- func (L *Layer) Get_parent_network() *Gorebrum
- func (L *Layer) New_Node(Weights []float64, Bias float64, Activation string, i int)
- func (L *Layer) Set_Activation(activation string)
- func (L *Layer) Set_Index(index int)
- func (L *Layer) Set_Nodes(nodes []*Node)
- func (L *Layer) Set_Output(output *mat.VecDense)
- func (L *Layer) Set_parent_network(parent_network *Gorebrum)
- func (L Layer) ToXML() string
- type Node
- func (n *Node) Compute_node()
- func (n Node) Display_info()
- func (n Node) Get_Activation() string
- func (n Node) Get_Bias() float64
- func (n Node) Get_Weights() *mat.VecDense
- func (n Node) Get_input() *mat.VecDense
- func (n Node) Get_output() float64
- func (n Node) Get_parent_layer() *Layer
- func (n *Node) Set_Activation(Activation string)
- func (n *Node) Set_Bias(Bias float64)
- func (n *Node) Set_Output(Output float64)
- func (n *Node) Set_Weights(Weights *mat.VecDense)
- func (n *Node) Set_input(input *mat.VecDense)
- func (n *Node) Set_parent_layer(Layer *Layer)
- func (n Node) ToXML() string
- type Trainer
Constants ¶
This section is empty.
Variables ¶
var Layer_Activation_Functions map[string]func(*mat.VecDense, Layer) = map[string]func(x *mat.VecDense, L Layer){ "NA": NA, "SoftMax": SoftMax, }
var Node_Activation_Functions map[string]func(float64, *Node) float64 = map[string]func(float64, *Node) float64{ "NodeLU": NodeLU, "ReLU": ReLU, "Log": Log, "ExpE": ExpE, "ExpSqrtE": ExpSqrtE, "ExpPi": ExpPi, "ExpSqrtPi": ExpSqrtPi, "Collatz": Collatz, }
▄▀█ █▀▀ ▀█▀ █ █░█ ▄▀█ ▀█▀ █ █▀█ █▄░█ █▀▀ █░█ █▄░█ █▀▀ ▀█▀ █ █▀█ █▄░█ █▀ █▀█ █▄▄ ░█░ █ ▀▄▀ █▀█ ░█░ █ █▄█ █░▀█ █▀░ █▄█ █░▀█ █▄▄ ░█░ █ █▄█ █░▀█ ▄█
we are using a dict to store the funtions. each function will be stored under a key that is a string so that each node can have a key to a actavation function all
dict to map funtions for the Node obj, this is done for dinamic calls to diffrent func. all func must be plan func and not methods with the parma(x float64, n Node) or cannot be placed inside the map
Functions ¶
func Collatz ¶
the hailstone algorithom or Collatz conjecture https://en.wikipedia.org/wiki/Collatz_conjecture
func Compute_loss ¶
func Log ¶
natral log: takes a float64 as var x and returns 0 if input < 0 else returns var log10(x)
Types ¶
type Gorebrum ¶
type Gorebrum struct { Layers []*Layer Output *mat.VecDense Width int Depth int Out_dimensions int In_dimensions int Log []string // for training // contains filtered or unexported fields }
func Dcode_model ¶
func New_Network ¶
this is the functon that makes a new network, New_Network takes 4 variabels as int as fallows
In_dimensions int, (this is the length of the vector that is pasesed into the network)
Width int, (the number of Layers includeing the frist and last Layers)
Depth int, (the lenght of the vectors in the hidden Layers)
Out_dimensions int, (the length of the Output layer)
the function will then return a *Gorebrum:
type Gorebrum struct { input *mat.VecDense Layers []*Layer Output *mat.VecDense Width int Depth int Out_dimensions int In_dimensions int } the Output layer will allwase be a softmax actavation
func (*Gorebrum) Computer_fraward_pass ¶
func (N *Gorebrum) Computer_fraward_pass()
the farward pass for the network
func (*Gorebrum) Display_Network ¶
func (N *Gorebrum) Display_Network()
func (*Gorebrum) Encode_model ¶
encodes the network and wrigths the model to a gob file wich
func (Gorebrum) Get_Layers ¶
func (Gorebrum) Get_Output ¶
func (*Gorebrum) Set_In_dimensions ¶
func (*Gorebrum) Set_Out_dimensions ¶
func (*Gorebrum) Set_Output ¶
func (*Gorebrum) Set_inputs ¶
sets an input to the seme vec that is passed to it
func (*Gorebrum) Update_Output ¶
func (N *Gorebrum) Update_Output()
this updates the Output for the network
type Layer ¶
type Layer struct { Output *mat.VecDense Nodes []*Node Activation string Index int Log []string // for training // contains filtered or unexported fields }
this is the structur of the Layers in the network the goal is to apstrat all the
func (Layer) Display_info ¶
func (L Layer) Display_info()
func (*Layer) Get_Activation ¶
func (*Layer) Get_parent_network ¶
func (*Layer) Set_Activation ¶
func (*Layer) Set_Output ¶
func (*Layer) Set_parent_network ¶
setters
type Node ¶
type Node struct { Weights *mat.VecDense Bias float64 Activation string Output float64 Index int Log []string // for training // contains filtered or unexported fields }
this is the struct for creating Nodes this will eventualy be a nural network
func (Node) Display_info ¶
func (n Node) Display_info()
func (Node) Get_Activation ¶
reternds the activation of the network.
func (Node) Get_Weights ¶
returns the weights of the node as a *mat.VecDence
func (Node) Get_input ¶
this function grabs the Outputs from the layer before it. unless it is the frist layer, in that case the input for the network is used
func (Node) Get_parent_layer ¶
returs the address of the layer that the node is a part of
func (*Node) Set_Activation ¶
func (*Node) Set_Output ¶
func (*Node) Set_Weights ¶
sets the weights of the node to a *mat.VecDence
func (*Node) Set_parent_layer ¶
type Trainer ¶
type Trainer struct { Traing_algoithms map[string]func(*Trainer) // contains filtered or unexported fields }
func New_trainer ¶
this creates a new training obj for training a model on a data set doing it this way will give is freedom to implement different training strategies
func (*Trainer) Compute_Training_Pass ¶
func (T *Trainer) Compute_Training_Pass()