Web3 Voice🎙
query { aggregateAccounts(filter: { acc_type: { eq: 1 } }, fields: [{ fn: COUNT }]) }
2287454query { aggregateAccounts(filter: { acc_type: { ne: 1 } }, fields: [{ fn: COUNT }]) }
151291
"tensor.fif" include
// CNN Training on MNIST dataset
10 28 28 1 nn.model // create a network model (input dimensions)
0.5 10 conv2d 2 maxpool relu // add a convolution block
0.5 20 conv2d 0.5 dropout 2 maxpool relu // add another convolution block
flatten 0.0 49 linear // add reduction layer, and
0.5 dropout 0.0 10 linear softmax // final fully connected output
constant md0 // we can store the model in a constant
md0 batchsize dataset mnist_train // create a MNIST dataset with model batch size
constant ds0 // save dataset in a constant
variable acc 0 acc ! // create an accuracy counter, and zero it
// here's the entire training framework in 3 lines
{ for forward backprop nn.hit acc +! 0.01 0.0 nn.sgd 46 emit next } : cnn // (N D -- N')
{ cr . ." >" clock . ." : hit=" acc @ . 0 acc ! ." , loss=" loss.ce . cr } : stat
{ for cnn r@ stat ds0 rewind next } : epoch
ds0 // put dataset as TOS
19 epoch // execute multiple epoches
drop // drop dataset from TOS
// persist the trained network
"tests/my_net.t4" nn.save
3f80 = 0 01111111 0000000 = 1
c000 = 1 10000000 0000000 = −2
7f7f = 0 11111110 1111111 = (28 − 1) × 2−7 × 2127 ≈ 3.38953139 × 1038 (max finite positive value in bfloat16 precision)
0080 = 0 00000001 0000000 = 2−126 ≈ 1.175494351 × 10−38 (min normalized positive value in bfloat16 precision and single-precision floating point)
Zeros and infinities0000 = 0 00000000 0000000 = 0
8000 = 1 00000000 0000000 = −0
7f80 = 0 11111111 0000000 = infinity
ff80 = 1 11111111 0000000 = −infinity
Special values4049 = 0 10000000 1001001 = 3.140625 ≈ π ( pi )
3eab = 0 01111101 0101011 = 0.333984375 ≈ 1/3
ffc1 = x 11111111 1000001 => qNaN
ff81 = x 11111111 0000001 => sNaN