Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rounakdatta committed Apr 13, 2024
1 parent 89d120b commit e546385
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## smolgrad.ml
Smolgrad is a very simple and educational project around the constructs of a neural network. It implements algorithmic (or automatic) differentiation for some common binary operators, can dynamically build out the graph out of an algebraic expression and then apply backpropagation on that graph. Additionally, it also abstracts the concept of a neuron, stacks up those neurons into layers and propagates input through the network. It is written in OCaml, for the fun (and pun) of it.

Needless to say, it is very rudimentary at the moment and doesn't implement training of the weights and biases. However that is in plan, along with exploration of some other architectures! Of course, it is an inspiration from legendary projects like [micrograd](https://github.com/karpathy/micrograd), [tinygrad](https://github.com/tinygrad/tinygrad) and such.

### Experiment
This is built as a library, but not yet published. To experiment, you can tweak the tests, or try importing the modules directly (into say a utop REPL).

- The project is packaged using Nix, so you're in luck if you happen to have the setup. `nix develop` is all you need.
- Otherwise, you need to setup the OCaml tooling on your system. The project uses Dune as the build system and Opam for package management.

### TODO

- [ ] Implement training.
- [ ] Use a plotting library like [oplot](https://github.com/sanette/oplot) to visualize training and output for simple classification scenarios.
- [ ] Use a graph library like [ocamlgraph](https://anwarmamat.github.io/ocaml/ocamlgraph) to visualize the DAG generated out of variable operations.

0 comments on commit e546385

Please sign in to comment.