Artificial Neuron - Pseudocode Algorithm

Pseudocode Algorithm

The following is a simple pseudocode implementation of a single TLU which takes boolean inputs (true or false), and returns a single boolean output when activated. An object-oriented model is used. No method of training is defined, since several exist. If a purely functional model were used, the class TLU below would be replaced with a function TLU with input parameters threshold, weights, and inputs that returned a boolean value.

class TLU defined as: data member threshold : number data member weights : list of numbers of size X function member fire( inputs : list of booleans of size X ) : boolean defined as: variable T : number T 0 for each i in 1 to X : if inputs(i) is true : T T + weights(i) end if end for each if T > threshold : return true else: return false end if end function end class

Read more about this topic:  Artificial Neuron