Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rebanto/ai-algorithms-from-scratch

Repository files navigation

AI From Scratch (NumPy Edition)

I wanted to see how these algorithms actually work under the hood. No TensorFlow, no PyTorch, no "magic" libraries—just raw NumPy and the math I learned from diving deep into linear algebra and calculus.

Most ML tutorials just tell you to import a library and call .fit(), which feels like cheating. This project is my attempt to build the "engines" from scratch: implementing the gradients, the backprop, and the decision logic from the ground up.

Check it Out (The Master Runner)

I built a cool interactive script to show everything off. You can pick an algorithm, watch it train, and see the graphs pop up in real-time.

# Start the interactive menu
python run_all.py

If you're in a hurry and just want to run one thing from the terminal:

python run_all.py linear cnn # runs specific ones
python run_all.py rnn # runs the Hamlet text generator

The "Under the Hood" Stuff

I wrote down the math and the "why" for each algorithm. If you want to see the derivatives or how the convolution stride tricks work, check these out:


Visualizing the Math

I spent a lot of time on the plots because seeing the math is way better than just looking at loss numbers:

  • 3D Loss Bowls: Watch the gradient descent fall down the convex surface.
  • Saliency Maps: See exactly which pixels the CNN thinks are important.
  • Hidden State Heatmaps: Peek into how the RNN's "brain" remembers characters.

The Setup

.
├── documentation/ # Where I explain all the math
├── plots/ # All the generated graphs
├── run_all.py # The main entry point
└── [Algos]_From_Scratch/ # The actual source code

About

AI algorithms from scratch!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /