Machine-Learning  by DorsaRoh

ML implementations from scratch, using NumPy

created 1 year ago
1,955 stars

Top 22.9% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides foundational implementations of core machine learning concepts, specifically neural networks and the Transformer architecture, using only NumPy. It's designed for educational purposes, enabling users to understand the underlying mechanics of these powerful models by building them from scratch.

How It Works

The neural network implementation details forward propagation, backpropagation, and gradient descent. It uses a simple feed-forward, multi-layer perceptron structure with ReLU activation and Mean Squared Error loss. The Transformer section breaks down self-attention, multi-head attention, positional encoding, embeddings, and softmax, explaining their roles in contextualizing token representations.

Quick Start & Requirements

  • Install: Requires Python 3.x and NumPy.
  • Run: Execute the provided Python scripts directly.
  • Dependencies: NumPy.
  • Resources: Minimal; suitable for CPU execution.
  • Docs: The README serves as the primary documentation.

Highlighted Details

  • Pure NumPy implementation for deep learning fundamentals.
  • Step-by-step explanation of neural network training loop (forward, loss, backprop, update).
  • Detailed breakdown of Transformer components: attention, positional encoding, embeddings.
  • Includes code for Neuron, Layer, and NeuralNetwork classes.

Maintenance & Community

  • Primarily a personal educational project. No active community or maintenance signals are apparent.

Licensing & Compatibility

  • No license is explicitly stated in the README.

Limitations & Caveats

The project is purely educational and lacks optimizations, advanced layer types, or robust error handling typically found in production ML libraries. It is not intended for practical deployment or large-scale training.

Health Check
Last commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
763 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.