Skip to content

amitphadke1405/Research-Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Backpropagation Neural Network (XOR Problem Implementation)

Overview

This task implements a simple neural network using Python and NumPy to solve the XOR problem.

The main goal is to demonstrate how the backpropagation algorithm helps a neural network learn non-linear patterns that cannot be solved using a single-layer perceptron.


Problem Statement (XOR Dataset) :

We use the XOR truth table as input.

Why XOR?

  • XOR is not linearly separable
  • A single-layer perceptron cannot solve it
  • A hidden layer is required

Model Architecture

  • Input Layer: 2 neurons
  • Hidden Layer: 2 neurons
  • Output Layer: 1 neuron
  • Activation Function: Sigmoid

Forward Propagation

Inputs are passed through the network:

  1. Input to Hidden Layer
  2. Hidden Layer to Output Layer

Each neuron performs:

  • Weighted sum
  • Sigmoid activation

This generates the final prediction.

Loss Function

The loss is equal to half times the average of the squared difference between the actual output and the predicted output.

In this implementation:

error = targets - final_output

loss = np.mean(error ** 2)

About

This task is performed to implement backpropagation concept in neural networks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages