Skip to content

Anjas2005/Neural-Network-in-C.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🧠 Simple Neural Network in C ⚙️

Language C made-with-love

A lightweight, from-scratch implementation of a feedforward neural network in pure C. This project demonstrates the fundamental principles of neural networks by teaching a simple model to solve the classic XOR problem.


✨ Features

  • Pure C: Built with only standard C libraries (stdlib.h, stdio.h, math.h). No heavy dependencies!
  • Feedforward Architecture: A simple and classic neural network structure with an input layer, a hidden layer, and an output layer.
  • Backpropagation Algorithm: Learns from its mistakes by propagating errors backward through the network to adjust weights and biases.
  • Sigmoid Activation: Uses the sigmoid function to introduce non-linearity, allowing it to learn complex patterns.
  • Stochastic Training: Shuffles the training data for each epoch to prevent the model from getting stuck in local minima and improve generalization.

🚀 How to Get Started

You can compile and run this project with any standard C compiler like GCC.

Prerequisites

  • A C compiler (e.g., GCC)

Compilation

  1. Clone the repository:

    git clone [https://github.com/Anjas2005/Neural-Network-in-C.git](https://github.com/Anjas2005/Neural-Network-in-C.git)
    cd Neural-Network-in-C
  2. Compile the C code. The -lm flag is necessary to link the math library.

    gcc main.c -o neural_network -lm

Execution

Run the compiled executable from your terminal:

./neural_network

About

Ok so i tried to implement a neural Network in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages