Giter VIP home page Giter VIP logo

hamzaaitbenyissa / coding-neural_network-for-xor-logic-from-scratch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shayanalibhatti/coding-neural_network-for-xor-logic-from-scratch

0.0 0.0 0.0 603 KB

In this repository, I implemented a proof of concept of all my theoretical knowledge of neural network to code a simple neural network for XOR logic function from scratch without using any machine learning library

Jupyter Notebook 100.00%

coding-neural_network-for-xor-logic-from-scratch's Introduction

Coding a neural network for XOR logic from scratch

In this repository, I implemented a proof of concept of all my theoretical knowledge of neural network to code a simple neural network from scratch in Python without using any machine learning library.

Introduction:

Some machine learning algorithms like neural networks are already a black box, we enter input in them and expect magic to happen. Still, it is important to understand what is happening behind the scenes in a neural network. We can use libraries such as Keras to make our life easy but if we dont understand what happens inside a neural network, then we can easily get stuck in an infinite loop without understanding what is going wrong with our neural network. Coding a simple neural network from scratch acts as a Proof of Concept in this regard and further strengthens our understanding of neural networks.

In this project, a single hidden layer neural network is used, with sigmoid activation function in hidden layer units and sigmoid activation function for output layer too, since the output of XOR logic is binary i.e. 0 or 1 only one neuron is in the output layer. The maths behind neural network is explained below:

Explanation of Maths behind Neural Network:

Following work shows the maths behind a single hidden layer neural network:

pic1

pic2

pic3

pic4

Results

Following image shows the loss function for our network, it can be seen that it is decreasing.

pic5

Following are the predictions of neural network on test inputs:

pic6

Please view the jupyter notebook file attached, it has the code with comments to make it easy to understand for the readers.

Conclusion:

Coding a neural network from scratch strengthened my understanding of what goes on behind the scenes in a neural network. I hope this project helps other readers understand the working of a neural network.

coding-neural_network-for-xor-logic-from-scratch's People

Contributors

shayanalibhatti 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.