Skip to content

Commit

Permalink
Fix MSB order.
Browse files Browse the repository at this point in the history
  • Loading branch information
sigilante committed May 21, 2024
1 parent ad4d33b commit 027c328
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ To run inference on the first image: `0.mnist` do:

```hoon
+mnist!run-onnx /=mnist=/data/net-quant/json /=mnist=/data/0/mnist
+mnist!run-onnx /=mnist=/data/net-float/json /=mnist=/data/0/mnist
```

Where `/=mnist=/data/net-quant/json` is the path of the ONNX weight file. The generator should output `[%pred 0]`, making its prediction for the first image the number `0`.
Expand Down
32 changes: 16 additions & 16 deletions desk/lib/lagoon.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
?- kind.meta
%uint
%ud
::
%int2
!!
::
%real
?+ bloq.meta ~|(bloq.meta !!)
Expand All @@ -57,9 +60,6 @@
%5 %rs
%4 %rh
==
::
%int2
%ux :: XXX revisit
==
::
++ squeeze |*(a=* `(list _a)`~[a])
Expand Down Expand Up @@ -390,6 +390,8 @@
^- @
?- kind.meta
%uint `@`1
::
%int2 !!
::
%real
?+ bloq.meta ~|(bloq.meta !!)
Expand All @@ -398,8 +400,6 @@
%5 .1
%4 .~~1
==
::
%int2 `@`1
==
:: Zeroes
++ zeros
Expand All @@ -416,6 +416,8 @@
=/ one
?- kind.meta
%uint `@`1
::
%int2 !!
::
%real
?+ bloq.meta !!
Expand All @@ -424,8 +426,6 @@
%5 .1
%4 .~~1
==
::
%int2 `@`1
==
(fill meta one)
:: Produce a 1-dimensional index array.
Expand Down Expand Up @@ -570,6 +570,9 @@
?- kind.meta
%uint
(spac [meta `@ux`data])
::
%int2
(spac [meta `@ux`data])
::
%real
:: convert date to fl to @r XXX TODO REVISIT whether we want to specify input type
Expand All @@ -581,9 +584,6 @@
%4 (bit:ma:rh (sea:ma:rh data))
==
(spac [meta `@ux`fin])
::
%int2
(spac [meta `@ux`data])
==
::
:: Operators
Expand All @@ -593,7 +593,7 @@
|= a=ray
=/ fun
|: [b=1 c=-:(ravel a)]
?: =(((fun-scalar meta.a %gth) b c) 0)
?. =(((fun-scalar meta.a %gth) b c) 0)
b c
(scalar-to-ray meta.a (reel (ravel a) fun))
::
Expand All @@ -608,7 +608,7 @@
|= a=ray
=/ fun
|: [b=1 c=-:(ravel a)]
?: =(((fun-scalar meta.a %lth) b c) 0)
?. =(((fun-scalar meta.a %lth) b c) 0)
b c
(scalar-to-ray meta.a (reel (ravel a) fun))
::
Expand Down Expand Up @@ -975,6 +975,8 @@
%equ |=([b=@ c=@] ?:(.=(b c) 1 0))
%neq |=([b=@ c=@] ?:(.=(b c) 0 1))
==
::
%int2 !!
::
%real
?+ `^bloq`bloq !!
Expand Down Expand Up @@ -1035,8 +1037,6 @@
%neq |=([a=@rh b=@rh] ?:(.=(a b) .~~0 .~~1))
==
== :: bloq real
::
%int2 !!
== :: kind
::
++ trans-scalar
Expand All @@ -1047,6 +1047,8 @@
?+ fun !!
%abs |=(b=@ b)
==
::
%int2 !!
::
%real
?+ bloq !!
Expand All @@ -1067,8 +1069,6 @@
%abs |=(b=@ ?:((gte:rh b .~~0) b (mul:rh b .~~-1)))
==
==
::
%int2 !!
==
::
++ el-wise-op
Expand Down
2 changes: 1 addition & 1 deletion desk/lib/onnx.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
=/ dat q:(need (de:base64:mimes:html raw))
%- spac:la
:- [(parse-shape shape) bloq.m kind.m ~]
dat
(rep 5 (flop (rip 5 dat)))
::
++ preprocess-onnx
|= onnx=json
Expand Down
1 change: 0 additions & 1 deletion desk/sys.kelvin

This file was deleted.

0 comments on commit 027c328

Please sign in to comment.