Make a neural network and Train it

Logix_Quest
3 min readAug 27, 2020

--

Using Jupyter Notebook

An artificial neural network (ANN) is the piece of a computing system designed to simulate the way the human brain analyzes and processes information. It is the foundation of artificial intelligence (AI) and solves problems that would prove impossible or difficult by human or statistical standards.

Neural Network

ANNs have the ability to learn and model non-linear and complex relationships , which is really important because in real-life, many of the relationships between inputs and outputs are non-linear as well as complex.

Here, we’re going to create an artificial neural network and train it. So, let’s start.

Firstly, we’ve to import libraries.

importing libraries

Now, we create a neural network that will be used further for training.

Neural Network

Here is its output (artificial neural network).

Output

To see input shape:

input_shape

To see output shape:

output_shape

We’ll train our neural network against random numbers. So for that, we’ve to import libraries.

importing library

Now, generate random numbers and train our neural network according to this.

random numbers

To find length of input_train:

length of input_train

Now, we’ll train it providing 10 epochs. You can have any number for epochs.

training a neural network

Now, let’s have a look on predict method. The predict() function takes an array of one or more data instances. The example below demonstrates how to make regression predictions on multiple data instances with an unknown expected outcome.

predict method

Here project ends. So readers! if you like it, don’t forget to clap.

Thank You.

--

--

Logix_Quest
Logix_Quest

No responses yet