Giter VIP home page Giter VIP logo

gmongaras / visualizing_gradient_descent_for_bce_loss Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 530 KB

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.

Python 100.00%
neural-network python backpropagation backpropagation-learning-algorithm backpropagation-algorithm backpropagation-neural-network backprop ai machine-learning machine-learning-algorithms

visualizing_gradient_descent_for_bce_loss's Introduction

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

visualizing_gradient_descent_for_bce_loss's People

Contributors

gmongaras avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.