Skip to content

Commit 5124f1b

Browse files
committed
Add assets and update README.md
1 parent 6b32cfc commit 5124f1b

File tree

7 files changed

+18
-11
lines changed

7 files changed

+18
-11
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ insert_final_newline = true
1717
indent_style = space
1818
indent_size = 3
1919

20+
[*.nix]
21+
indent_style = space
22+
indent_size = 2
23+
2024
[*.zig]
2125
indent_style = space
2226
indent_size = 4

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
!.github/
44
!assets/
5+
!assets/**/
56
!.editorconfig
67
!.gitattributes
78
!.gitignore
@@ -14,8 +15,10 @@
1415
!src/**/
1516
!examples/
1617

17-
!*.lock
1818
!*.md
19+
!*.svg
20+
!*.png
1921
!*.nix
22+
!*.lock
2023
!*.zig
2124
!*.zon

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
</div>
2424

2525
<!-- ABOUT THE PROJECT -->
26-
27-
A Zig implementation of Karpathy's micrograd.
26+
A scalar-valued automatic differentiation (autograd) engine for deep learning written in Zig.
2827

2928
### Built With
3029

@@ -36,9 +35,9 @@ A Zig implementation of Karpathy's micrograd.
3635
## Preview
3736

3837
<p align="center">
39-
<img src="assets/img/demo.mp4"
38+
<img src="assets/img/train.png"
4039
width = "80%"
41-
alt = "Video demonstration"
40+
alt = "Training a model on MNIST dataset"
4241
/>
4342
</p>
4443

@@ -76,7 +75,7 @@ To get a local copy of the project up and running on your machine, follow these
7675
4. Run the project
7776

7877
```sh
79-
just run <package_name>
78+
just run
8079
```
8180

8281
### Add as a dependency
@@ -138,6 +137,9 @@ kiwigrad/
138137
├── src/ # Library source files
139138
│ ├── lib.zig # Public API entry point
140139
│ └── ...
140+
├── examples/ # Example projects
141+
│ ├── benchmark.zig # Benchmarking the library
142+
│ └── train.zig # Training a model on MNIST
141143
├── build.zig # Zig build script
142144
├── build.zig.zon # Zig build script dependencies
143145
├── LICENSE # Project license

assets/img/train.png

64.4 KB
Loading

examples/train.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ pub fn main() !void {
7171
print("output.data: {d:.4}\n", .{output.data});
7272
print("output.grad: {d:.4}\n", .{output.grad});
7373

74-
try draw_graph(f64, output, "n_f64", stdout);
74+
try draw_graph(f64, output, "assets/img/train", stdout);
7575
try bw.flush(); // Don't forget to flush!
7676
}

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pkgs.mkShell {
44
buildInputs = with pkgs; [
55
zig # Zig compiler
66
just # Just runner
7-
nixfmt # Nix formatter
7+
nixfmt-classic # Nix formatter
88
graphviz # Graphviz
99
];
1010

src/root.zig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
//! By convention, root.zig is the root source file when making a library. If
2-
//! you are making an executable, the convention is to delete this file and
3-
//! start with main.zig instead.
1+
//! A scalar-valued automatic differentiation (autograd) engine for deep learning written in Zig.
42

53
const std = @import("std");
64
const testing = std.testing;

0 commit comments

Comments
 (0)