Skip to content

vijay-illuru/Dynamic_neural_Network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  Dynamic Neural Network (Python From Scratch)

This project implements a fully customizable Feedforward Neural Network from scratch in Python โ€” no external libraries like TensorFlow or PyTorch required. It allows you to define the number of layers, nodes, learning rate, and test it with new inputs.


๐Ÿ“Œ Features

  • โœ… Automatically detects input/output layer size from training data
  • โœ… User-configurable or random hidden layers
  • โœ… Sigmoid activation function + derivative
  • โœ… Forward pass & backpropagation
  • โœ… Tracks best weights & biases based on lowest SSE (Sum of Squared Errors)
  • โœ… Accepts new inputs after training for prediction

โš™๏ธ How It Works

๐Ÿ”ง Model Setup

Input & Output nodes are detected automatically

3 modes for hidden layers:

Manual: User defines exact number of layers and nodes

Random: User specifies max limits; structure is randomized

Default: 5 hidden layers, 3 nodes each

๐Ÿ” Training Phase

Forward pass using sigmoid activation

Backpropagation using gradient descent

Weights & biases are updated per epoch

Model saves best parameters with minimum SSE

๐Ÿ”ฎ Prediction Phase

Predicts outputs for all training inputs

Accepts new inputs interactively and outputs predictions


๐Ÿ”ข Example Input Format

training_data = [ {"inputs": [0.2, 0.5, 0.9], "target": [1]}, {"inputs": [0.1, 0.3, 0.6], "target": [0]}, {"inputs": [0.7, 0.8, 0.2], "target": [1]}, ]


๐Ÿงช Sample Console Output

Choose one of the following options for hidden layers:

  1. Predefined hidden layer count
  2. Randomized layers and nodes
  3. Default: 5 hidden layers, 3 nodes each

Enter your choice (1, 2, or 3): 3 Enter the Learning Rate: 0.1 Enter number of epochs: 1000

Training completed! Least SSE: 0.002194

Predicted outputs for trained inputs: Input: [0.2, 0.5, 0.9] -> Predicted Output: [0.9712]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages