diff options
Diffstat (limited to '')
| -rw-r--r-- | projects/autograd.md | 30 | ||||
| -rw-r--r-- | projects/bubbl.md | 20 | ||||
| -rw-r--r-- | projects/chip8emu.md | 22 | ||||
| -rw-r--r-- | projects/msg.md | 95 | ||||
| -rw-r--r-- | projects/zuk-msm8996.md | 2 | 
5 files changed, 163 insertions, 6 deletions
| diff --git a/projects/autograd.md b/projects/autograd.md index e382112..e3259d2 100644 --- a/projects/autograd.md +++ b/projects/autograd.md @@ -3,6 +3,34 @@ description = An implementation of autograd / backpropagation.  languages = Python  url = /projects/autograd  template = project.html +link = https://github.com/compromyse/autograd +linklabel = SOURCE  --- -# Autograd +All you need to run a simple neural network using autograd is the following code: + +The code defines a data set `X`, expected output (or ground truth) `y`. It then trains the neural network by performing backward propagation (`.backward()`), then applies the calculated gradients through `.optimise()` along with a learning rate of `0.01`. + +```py +from src.nn import MLP +from src.loss import mse + +X = [ +    [ 0.0, 1.0, 2.0 ], +    [ 2.0, 1.0, 0.0 ], +    [ 2.0, 2.0, 2.0 ], +    [ 3.0, 3.0, 3.0 ] +] + +y = [ 1.0, -1.0, 1.0, -1.0 ] +n = MLP(3, [ 4, 4, 1 ]) + +for i in range(400): +    pred = [ n(x) for x in X ] +    loss = mse(y, pred) +    loss.zero_grad() +    loss.backward() +    n.optimise(0.01) + +print(pred) +``` diff --git a/projects/bubbl.md b/projects/bubbl.md index 26b794c..d9d9947 100644 --- a/projects/bubbl.md +++ b/projects/bubbl.md @@ -3,10 +3,24 @@ description = An Operating System for The x86 Architecture.  languages = C / C++ / ASM  url = /projects/bubbl  template = project.html +link = https://github.com/compromyse/bubbl +linklabel = SOURCE  --- -# BUBBL +## Building -```py -import time +#### Dependencies: Nix with flakes enabled and (optionally) direnv + +After entering the devshell (with direnv or `nix develop`), + +```sh +mkdir build && cd build +cmake -G Ninja .. +ninja +``` + +## Running + +```sh +ninja run # or run-headless or run-gdb  ``` diff --git a/projects/chip8emu.md b/projects/chip8emu.md index df2aaa5..ffe32f4 100644 --- a/projects/chip8emu.md +++ b/projects/chip8emu.md @@ -3,6 +3,26 @@ description = An Emulator/Interpreter for CHIP-8.  languages = C++  url = /projects/chip8emu  template = project.html +link = https://github.com/compromyse/autograd +linklabel = SOURCE  --- -# CHIP8Emu + + +## About The Project + +CHIP8Emu is an emulator for the 1977 interpreter CHIP-8 written in C++. It aims to make games designed for the same playable on modern hardware. + +## Compilation & Usage + +For compilation, you need Clang, CMake, GNUMake, and SDL2. With them installed, run the following. +```sh +mkdir build; cd build +cmake .. +make +``` + +Replace `[scale]` with your preferred display scaling, `[delay]` with the your preferred delay, and `[ROM]` with the path to the game you intend to play. +```sh +./chip8emu [scale] [delay] [ROM] +``` diff --git a/projects/msg.md b/projects/msg.md index 0eaeddf..2a8851e 100644 --- a/projects/msg.md +++ b/projects/msg.md @@ -3,6 +3,99 @@ description = An incredibly opinionated, hackable, minimal Static Site Generator  languages = C  url = /projects/msg  template = project.html +link = https://github.com/compromyse/msg +linklabel = SOURCE  --- -# MSG +> See https://github.com/compromyse/compromyse.xyz for an example site. + +### Compilation & Usage +```sh +# REQUIREMENTS: CMake, Git, GCC/Clang, GNUMake/Ninja +$ git clone https://github.com/compromyse/msg +$ mkdir build && cd build +$ cmake .. +$ make # or ninja +$ ./msg -h +msg: The Minimal Static Site Generator + +Usage: ./msg [-h] [-w] [-v] [-o <output>] <directory> +        -h         : Help +        -w         : Watch working directory for changes +        -v         : Verbose +        -o <output>: Output directory +        <directory>: Working directory +``` + +### Site Structure +```sh +. +├── assets +│   └── me.webp +├── config.cfg +├── index.html +├── partials +│   ├── footer.html +│   ├── navbar.html +├── projects.html +└── templates +    └── base.html +``` + +### Features + +#### Includes - include files from `/partials` + +```html +<!-- index.html --> +<html> +  <body> +    {{ include "navbar.html" }} +    ... +  </body> +</html> +``` + +#### Contentfor - define content for templates + +```html +<!-- templates/base.html --> +<html> +  <head> +    {{ content "head" }} +  </head> +  <body> +    {{ body }} +  </body> +</html> + +<!-- index.html --> +{{ contentfor "head" }} +<title>HOME</title> +{{ endcontent }} + +<p>...</p> +``` + +#### Eachdo - iterate over resources +```html +<!-- projects/xyz.html --> +title = XYZ +--- + +<h1>XYZ!</h1> + +<!-- index.html --> +{{ eachdo projects }} +<p>{{ put title }}</p> +{{ endeachdo }} +``` + +#### Template - specify template for page +```html +<!-- projects/xyz.html --> +template = base_tailwind.html +--- + +<h1 class="p-2">XYZ!</h1> +``` diff --git a/projects/zuk-msm8996.md b/projects/zuk-msm8996.md index 090d304..73fc4c7 100644 --- a/projects/zuk-msm8996.md +++ b/projects/zuk-msm8996.md @@ -3,6 +3,8 @@ description = A port of Android 13 & 14 to the Zuk Z2 PLUS.  languages = AOSP / LineageOS  url = /projects/zuk-msm8996  template = project.html +link = https://github.com/compromyse/bubbl +linklabel = XDA POST  ---  # Zuk MSM8996 | 
