aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2025-05-07 16:10:05 -0400
committerAnthony Wang2025-05-07 16:10:05 -0400
commit85ecba2304d455f30eab1a5cc36083d8a5bf66ef (patch)
treedb224857229f958a5fbdfdec8cbae835d7359651
parent6b92bbabe87e801c0b4c2d602a11e2041306f9ac (diff)
Try even larger window
-rwxr-xr-xmkthingy.sh6
-rw-r--r--notes (renamed from best)2
-rw-r--r--src/main.rs6
3 files changed, 6 insertions, 8 deletions
diff --git a/mkthingy.sh b/mkthingy.sh
index 139840e..05fd5bf 100755
--- a/mkthingy.sh
+++ b/mkthingy.sh
@@ -1,10 +1,8 @@
#!/bin/sh
rg TODO src
-if rg ' dbg!' src; then
- echo CONTAINS DEBUG OUTPUT!
- exit 1
-fi
+# Remove debug stuff
+sed -i 's| dbg!| // dbg!|g' src/main.rs
podman start ubuntu
podman exec ubuntu bash -c "cd /work; RUSTFLAGS='-C target-cpu=native' /root/.cargo/bin/cargo b -r"
cp target/release/decoder .
diff --git a/best b/notes
index ac48685..888982b 100644
--- a/best
+++ b/notes
@@ -1,4 +1,4 @@
-62
+best: 62
first half correct
5
diff --git a/src/main.rs b/src/main.rs
index af6aa82..e491fdd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -20,7 +20,7 @@ const SEQ_LEN: usize = 256;
const EMBED: i64 = 12;
const HIDDEN: i64 = 512;
const KERNEL: i64 = 16;
-const WINDOW: usize = 25;
+const WINDOW: usize = 30;
const ITERS: usize = 15000; // Iters for length 100
const THREADS: usize = 4;
const VOCAB: usize = 28;
@@ -62,7 +62,7 @@ const TRANS: [[f32; VOCAB]; VOCAB] = [
[-7.057_105, -7.864_855_3, -6.832_732_7, -3.767_181_4, -4.200_749, -4.790_685, -4.105_086, -5.590_689, -7.180_27, -5.557_085, -4.052_763, -4.921_688_6, -4.251_131, -4.469_908_7, -6.025_704, -5.421_922, -6.783_435, -3.429_898, -3.662_474, -4.345_318, -5.380_872_7, -8.071_246, -5.128_164_3, -4.732_333_7, -3.275_528_7, -11.513_105, -20.723_267, -20.723_267],
];
-// Conv2D with middle element masked
+/// Conv2D with middle element masked
#[derive(Debug)]
struct MaskedConv {
pub convl: nn::Conv2D,
@@ -127,7 +127,7 @@ fn probs(net: &impl Module, s: &[u8]) -> (Tensor, f64) {
(ys, loss)
}
-// Pad both sides with spaces
+/// Pad both sides with spaces
fn probs_padded(net: &impl Module, s: &[u8]) -> (Tensor, f64) {
probs(
net,