{"id":19956118,"url":"https://github.com/dvelkow/barebones_numpy_neural_network","last_synced_at":"2025-03-01T15:42:21.717Z","repository":{"id":247479320,"uuid":"822218475","full_name":"dvelkow/barebones_numpy_neural_network","owner":"dvelkow","description":"A hands-on exploration of neural networks through a from-scratch NumPy implementation, featuring real-time terminal visualization and tackling the classic XOR problem to deepen understanding of core machine learning concepts.","archived":false,"fork":false,"pushed_at":"2024-07-09T23:15:51.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T01:11:30.007Z","etag":null,"topics":["forfun","machine-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvelkow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-30T16:00:01.000Z","updated_at":"2024-08-02T00:41:54.000Z","dependencies_parsed_at":"2024-11-13T01:41:07.391Z","dependency_job_id":null,"html_url":"https://github.com/dvelkow/barebones_numpy_neural_network","commit_stats":null,"previous_names":["dvelkow/barebones_numpy_neural_network"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvelkow%2Fbarebones_numpy_neural_network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvelkow%2Fbarebones_numpy_neural_network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvelkow%2Fbarebones_numpy_neural_network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvelkow%2Fbarebones_numpy_neural_network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvelkow","download_url":"https://codeload.github.com/dvelkow/barebones_numpy_neural_network/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241389101,"owners_count":19955105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["forfun","machine-learning"],"created_at":"2024-11-13T01:30:07.835Z","updated_at":"2025-03-01T15:42:21.674Z","avatar_url":"https://github.com/dvelkow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Overview\n\nThis is a from-scratch implementation of a neural network using NumPy for core functionality, with Blessed for terminal visualization and Matplotlib for post-training graphing. The project includes:\n- A flexible neural network that can handle multiple hidden layers\n- Real-time visualization of the training process in your terminal\n- Implementation of backpropagation, mini-batch gradient descent, and regularization\n\n\n\n\n![image](https://github.com/dvelkow/barebones_numpy_neural_network/assets/71397644/8c6e728b-4dd9-43fc-9db0-374d69a1b441)\n\n![image](https://github.com/dvelkow/barebones_numpy_neural_network/assets/71397644/cedff2c1-0c35-4d67-9b90-95a50c73b3c7)\n\n## Features\n\n- **Customizable Architecture**: You can change the amount of hidden layers depending on your needs.\n- **Real-time Training Visualization**: You see it update Real Time on the terminal\n- **XOR Problem Solver**: The network is demonstrating solving the XOR problem, which is a classic benchmark for neural networks.\n- **Loss History Plotting**: Through a graph made with the help of Matplotlib after the training finishes you can see how your network improved over time\n- **Flexible Input**: Can be adapted to solve various binary classification problems.\n\n## How to Use\n\n1. Clone this repo:\n   ```\n   git clone https://github.com/your-username/barebones-numpy-neural-network.git\n   ```\n\n2. Make sure you have the requirements:\n   ```\n   pip install numpy matplotlib blessed\n   ```\n\n3. Run the main script:\n   ```\n   python3 nn_trainer.py\n   ```\n\n## Customization\n\nModify the `main()` function in nn_trainer.py if you want to experiment with different network configurations, you are free to:\n\nChange `layer_sizes` to adjust the network architecture\nModify `learning_rate` and 'regularization' parameters\nAdjust `epochs` and `batch_size` for different training dynamics\n\nExample:\n```\nlayer_sizes = [2, 8, 8, 1]  # Two hidden layers with 8 neurons each\nnn = NeuralNetwork(layer_sizes=layer_sizes, learning_rate=0.05, regularization=0.01) #decreased the learning_rate\nnn.train(X, y, epochs=10000, batch_size=4, visualizer=visualizer) #changed the epochs (might cause overfitting)\n```\n\n## What I Learned in the process\n\nBuilding this helped me understand:\n- How Backpropagation actually works, because before that I had experience with it only through libraries and never dived in the processes\n- How Forward Propagation work, more specifically how data flows through a neural network and how predictions are made\n- The impact of different activation functions on network performance and training dynamics\n- The process of handling non-linear problems through XOR\n\n## Future Ideas\n\n- Add more activation functions\n- Maybe tackle some complex datasets with it\n- Extend the network to handle multi-class classification problems\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvelkow%2Fbarebones_numpy_neural_network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvelkow%2Fbarebones_numpy_neural_network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvelkow%2Fbarebones_numpy_neural_network/lists"}