This project implements artificial neural networks (ANN) using perceptrons as per the ANN university subject.
- Sum Function
- Single Layer
- Single Layer and Training
- Multi Layer
The sum_function is designed to compute the sum of the products of corresponding elements from two lists: inputs and weights. This is a common operation in neural networks, particularly in the calculation of the net input to a neuron.
def sum_function(inputs, weights) -> float:
'''
Sum of the product of the inputs by the weights
@return float: The Net Input / Pre-Activation result
'''
...
In this section, we implement a simple step function, which is often used in academic settings to illustrate the basic principles of neural networks and perceptrons.
def step_function(net_input) -> int:
'''
1, if net_input >= 1
0, if net_input < 1
@return int: The Activation result
'''
...
The following chart is made using both the
Sum
andStep
functions