Open gingerBill opened 1 month ago
Don't forget about array programming
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/viz.odin#L205-L209
shape_pos = (s.start + s.end)/2
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/train.odin#L280
clamp is already a built-in operation just like min and max. Just use clamp(x, lo, hi) anywhere.
clamp
min
max
clamp(x, lo, hi)
ui_checkbox should return bool instead of taking a callback.
ui_checkbox
bool
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/viz.odin#L539-L557
if ui_checkbox("Rotate Cam", {30, 30}, g_flags.cam_rotate) { g_flags.cam_rotate = !g_flags.cam_rotate } if ui_checkbox("Show Connections", {30, 60}, g_flags.draw_connections) { g_flags.draw_connections = !g_flags.draw_connections } if ui_checkbox("Show Cube Lines", {30, 90}, g_flags.draw_cube_lines) { g_flags.draw_cube_lines = !g_flags.draw_cube_lines } if ui_checkbox("Show Cubes", {30, 120}, g_flags.draw_cubes) { g_flags.draw_cubes = !g_flags.draw_cubes } if ui_checkbox("Show Weight Cloud", {30, 150}, g_flags.draw_weight_cloud) { g_flags.draw_weight_cloud = !g_flags.draw_weight_cloud } if ui_checkbox("Load Test Images", {30, 180}, g_flags.load_test_imgs) { g_flags.load_test_imgs = !g_flags.load_test_imgs }
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/train.odin#L27-L30
ret = make([dynamic]MnistRecord, size) for i := 0; ; i += 1 { ...
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/train.odin#L78C4-L78C18
Typo? trian vs trian?
trian
Possible division by zero?
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/train.odin#L155
return f32(count) / max(f32(len(test_dataset)), 1)
hey, thanks for pointing these things out :)
Don't forget about array programming
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/viz.odin#L205-L209
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/train.odin#L280
clamp
is already a built-in operation just likemin
andmax
. Just useclamp(x, lo, hi)
anywhere.ui_checkbox
should returnbool
instead of taking a callback.https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/viz.odin#L539-L557
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/train.odin#L27-L30
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/train.odin#L78C4-L78C18
Typo?
trian
vstrian
?Possible division by zero?
https://github.com/bones-ai/odin-mnist-nn/blob/eb32f633d242f827d43407a02382af2f60426736/train.odin#L155