Skip to content

Using only numpy in Python, a neural network with a forward and backward method is used to classify given points (x1, x2) to a color of red or blue.

Notifications You must be signed in to change notification settings

gmongaras/Visualizing_Gradient_Descent_For_BCE_Loss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Explanation

Using only numpy in Python, a neural network with a forward and backward method is used to classify given points (x1, x2) to a color of red or blue. The neural network is initially assigned random weights and biases, which cause it to make terrible predictions. Through the use of gradient descent with backpropagation, the network learns a function that classifies most of the points correctly, resulting in better predictions by the model. Note that not all outcomes will be good due to random weight assignment when initializing the model.

Example Graphics

While the network is trained, graphics are displayed to show the current model's loss on the training set as well as predictions vs. real data points on the training set (Graphic 1). When the model is finished training, more graphics appear to show the model's loss on the test set as well as predictions vs. real data points on the test set (Graphic 2).

Alt text

Alt text

Alt text

Requirements To Run Code

Here are the necessary libraries to run the code:

  • numpy
  • scipy
  • sklearn
  • matplotlib

Note: I tested the code using Python 3.8.10

About

Using only numpy in Python, a neural network with a forward and backward method is used to classify given points (x1, x2) to a color of red or blue.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages