Build your neural network

Dipanwita Mallick
IWriteAsILearn
Published in
May 21, 2021

How to build a basic neural network using PyTorch

Just follow these basic steps while building your neural network.

In this article, I am going to train a simple neural network how to subtract.

Let’s get started:

#define the network and the forward function

#define the loss function

#define the optimizer

#let’s get the data ready now

#Now let’s train the model for 2000 epochs

#Let’s plot the losses with epochs

#Lastly, want to see how the neural network performs on unknown data

Yippiee!!!!!!!! Very accurate :)

Now that you know how to build a neural network, go ahead define your own problem statement, and try solving it with your own neural network.

And do let me know how it went!

--

--

Dipanwita Mallick
IWriteAsILearn

I am working as a Senior Data Scientist at Hewlett Packard Enterprise. I love exploring new ideas and new places !! :)