interplane.Get Omega
Read in your language

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

branch main Branches Tags History

aien-train / native / neuralese / gradientcheck.om

77 lines · 1145 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note Independent central differences of all31 parameters and atomic SGD controls.
3global GV f64 31
4global GB f64 31
5text GP "G,"
6text GEND "NL1GRAD PASS\n"
7
8fn ginit to void
9for i ulong 31
10v = div f64 add i 1 64.0f64
11if eq rem add i 1 2 1
12v = neg v
13end
14put LP i v
15put GB i v
16end
17linput 5 5
18end
19
20fn geval to f64
21lsend 0
22lrecv true
23ret lloss
24end
25
26fn main to int
27ginit
28v = geval
29lgrad
30for i ulong 31
31put GV i get LG i
32end
33for i ulong 31
34put LP i add get GB i 0.000001f64
35plus = geval
36put LP i sub get GB i 0.000001f64
37minus = geval
38put LP i get GB i
39diff = div sub plus minus 0.000002f64
40if gt fabs sub diff get GV i 0.00000001f64
41ret 61
42end
43end
44for i ulong 31
45put LG i get GV i
46end
47rc = lstep 0.1f64 0
48if ne rc 0
49ret 62
50end
51for i ulong 31
52wanted = sub get GB i mul 0.1f64 get GV i
53if gt fabs sub get LP i wanted 0.000000000001f64
54ret 63
55end
56z = write 1 GP 0 2
57if ne z 2
58ret 80
59end
60nnum i
61nsep
62nnum bitcast ulong get GB i
63nsep
64nnum bitcast ulong get GV i
65nsep
66nnum bitcast ulong get LP i
67z = write 1 EOL 0 1
68if ne z 1
69ret 80
70end
71end
72z = write 1 GEND 0 len GEND
73if ne z long len GEND
74ret 80
75end
76ret 0
77end