• Stars
    star
    258
  • Rank 153,471 (Top 4 %)
  • Language
    Jupyter Notebook
  • Created over 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ever wondered how to code your Neural Network using NumPy, with no frameworks involved?

Learn backpropagtion the hard way

Backpropagation

In this repository, I will show you how to build a neural network from scratch (yes, by using plain python code with no framework involved) that trains by mini-batches using gradient descent. Check nn.py for the code.

In the related notebook Neural_Network_from_scratch_with_Numpy.ipynb we will test nn.py on a set of non-linear classification problems

  • We'll train the neural network for some number of epochs and some hyperparameters
  • Plot a live/interactive decision boundary
  • Plot the train and validation metrics such as the loss and the accuracies

Example: Noisy Moons (Check the notebook for other kinds of problems)

Decision boundary (you'll get to this graph animated during training)

Decision boundary

Loss and accuracy monitoring on train and validation sets

Loss/Accuracy monitoring on train/val

Where to go from here?

nn.py is a toy neural network that is meant for educational purposes only. So there's room for a lot of improvement if you want to pimp it. Here are some guidelines:

  • Implement a different loss function such as the Binary Cross Entropy loss. For a classification problem, this loss works better than a Mean Square Error.
  • Make the code generic regarding the activation functions so that we can choose any function we want: ReLU, Sigmoid, Tanh, etc.
  • Try to code another optimizers: SGD is good but it has some limitations: sometimes it can be stuck in local minima. Look into Adam or RMSProp.
  • Play with the hyperparameters and check the validation metrics

More Repositories

1

cartoonify

Deploy and scale serverless machine learning app - in 4 steps.
Jupyter Notebook
334
star
2

character-based-cnn

Implementation of character based convolutional neural network
Python
251
star
3

How-to-score-0.8134-in-Titanic-Kaggle-Challenge

Solution of the Titanic Kaggle competition
Jupyter Notebook
117
star
4

mrnet

Building an ACL tear detector to spot knee injuries from MRIs with PyTorch (MRNet)
Python
100
star
5

How-to-mine-newsfeed-data-and-extract-interactive-insights-in-Python

A practical guide to topic mining and interactive visualizations
HTML
75
star
6

anonymization-api

How to build and deploy an anonymization API with FastAPI
Python
66
star
7

playground

A Streamlit application to play with machine learning models directly from the browser
Python
61
star
8

Understanding-deep-Convolutional-Neural-Networks-with-a-practical-use-case-in-Tensorflow-and-Keras

What makes convnets so powerful at image classification?
Jupyter Notebook
43
star
9

overview-and-benchmark-of-traditional-and-deep-learning-models-in-text-classification

NLP tutorial
Jupyter Notebook
41
star
10

mlflow

Introduction to MLflow with a demo locally and how to set it on AWS
Jupyter Notebook
37
star
11

whales-classification

My solution to the Global Data Science Challenge
Jupyter Notebook
36
star
12

dataset-builder

A script to help you quickly build custom computer vision datasets
Python
32
star
13

audiolizr

A bentoML-powered API to transcribe audio and make sense of it
Python
30
star
14

keywords-extractor-with-bert

A Streamlit app to extract keywords using KeyBert
Jupyter Notebook
26
star
15

React-App-Flask-SSL

JavaScript
23
star
16

multi-label-sentiment-classifier

How to build a multi-label sentiment classifiers with Tez and PyTorch
Jupyter Notebook
17
star
17

anonymizer

Text Anonymization app with Streamlit and Spacy
Python
16
star
18

fastapi-ssl

Python
14
star
19

twitter-agent

Scrape Tweets and chat with them using Langchain
Python
10
star
20

Quora-Insincere-Questions-Classification

Solutions of the Kaggle competition: Quora Insincere Questions Classification
Jupyter Notebook
8
star
21

scraping-tutorial

code for data scraping Youtube tutorial
Jupyter Notebook
8
star
22

assemblyai

Python
7
star
23

streamlit-cookiecutter

A cookiecutter template to bootstrap streamlit projects
Shell
6
star
24

streamlit_tutorial

Python
2
star
25

covidbert-topic-mining

How to use CovidBERT to extract topics for covid-19 papers
Jupyter Notebook
2
star
26

covid-tweets

Python
2
star
27

ahmedbesbes

My Github stats
1
star
28

cnn_char_utils

Python
1
star