Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-train/blob/main/native/neuralese/gradientcheck.om # aien-train AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-train / native / neuralese / gradientcheck.om` 77 lines ยท 1145 bytes Raw Blame History 1 note SPDX-License-Identifier: AGPL-3.0-only 2 note Independent central differences of all31 parameters and atomic SGD controls. 3 global GV f64 31 4 global GB f64 31 5 text GP "G," 6 text GEND "NL1GRAD PASS\n" 7 8 fn ginit to void 9 for i ulong 31 10 v = div f64 add i 1 64.0f64 11 if eq rem add i 1 2 1 12 v = neg v 13 end 14 put LP i v 15 put GB i v 16 end 17 linput 5 5 18 end 19 20 fn geval to f64 21 lsend 0 22 lrecv true 23 ret lloss 24 end 25 26 fn main to int 27 ginit 28 v = geval 29 lgrad 30 for i ulong 31 31 put GV i get LG i 32 end 33 for i ulong 31 34 put LP i add get GB i 0.`000001f64` 35 plus = geval 36 put LP i sub get GB i 0.`000001f64` 37 minus = geval 38 put LP i get GB i 39 diff = div sub plus minus 0.`000002f64` 40 if gt fabs sub diff get GV i 0.`00000001f64` 41 ret 61 42 end 43 end 44 for i ulong 31 45 put LG i get GV i 46 end 47 rc = lstep 0.1f64 0 48 if ne rc 0 49 ret 62 50 end 51 for i ulong 31 52 wanted = sub get GB i mul 0.1f64 get GV i 53 if gt fabs sub get LP i wanted 0.`000000000001f64` 54 ret 63 55 end 56 z = write 1 GP 0 2 57 if ne z 2 58 ret 80 59 end 60 nnum i 61 nsep 62 nnum bitcast ulong get GB i 63 nsep 64 nnum bitcast ulong get GV i 65 nsep 66 nnum bitcast ulong get LP i 67 z = write 1 EOL 0 1 68 if ne z 1 69 ret 80 70 end 71 end 72 z = write 1 GEND 0 len GEND 73 if ne z long len GEND 74 ret 80 75 end 76 ret 0 77 end