Neural networks are the core of deep learning, a field which has practical applications in many different areas. Today neural networks are used for image classification, speech recognition, object detection etc. Now, Let’s try to understand the basic unit behind all this state of art technique.
A single neuron transforms given input into some output. Depending on the given input and weights assigned to each input, decide whether the neuron fired or not. Let’s assume the neuron has 3 input connections and one output.
We will be using tanh activation function in given example.
The end goal is to find the optimal set of weights for this neuron which produces correct results. Do this by training the neuron with several different training examples. At each step calculate the error in the output of neuron, and back propagate the gradients. The step of calculating the output of neuron is called forward propagation while calculation of gradients is called back propagation.
Below is the implementation :
Random weights at the start of training [[-0.16595599] [ 0.44064899] [-0.99977125]] New weights after training [[5.39428067] [0.19482422] [0.34317086]] Testing network on new examples -> [0.99995873]
- Implementing Artificial Neural Network training process in Python
- Introduction to Artificial Neural Network | Set 2
- Introduction to Recurrent Neural Network
- Introduction to Convolution Neural Network
- Applying Convolutional Neural Network on mnist dataset
- Python | super() in single inheritance
- Single and Double Quotes | Python
- Python | Split a list having single integer
- Print Single and Multiple variable in Python
- Transpose a matrix in Single line in Python
- Python | Associating a single value with all list items
- Python | Single Point Crossover in Genetic Algorithm
- Multiplication of two Matrices in Single line using Numpy in Python
- Python | Convert tuple records to single string
- Python | Replace multiple occurrence of character by single
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.