tx · JCkBbNxDPwS9TmpCQ9srGadxFoSNr8BhMnsUqjfEDxmf 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.04.28 12:38 [3082536] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "JCkBbNxDPwS9TmpCQ9srGadxFoSNr8BhMnsUqjfEDxmf", "fee": 1000000, "feeAssetId": null, "timestamp": 1714297104684, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "2TP622WAknAZtppM1mDrE3x4GagsULA4kg3riju4Dt74ByM3HruBsU6midTfp6iFK5sEUwao8vdbd19JEEifH547" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAgAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmxCQAETAAAAAIAAAAAAAAJKp0FAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLAUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQoFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcYJAARMAAAAAgD///////JPiwUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAACmV4cF9hcHByb3gAAAABAAAAAXgEAAAABXNjYWxlAAAAAAAAAYagAwkAAGYAAAACCQAAaAAAAAIA//////////oFAAAABXNjYWxlBQAAAAF4AAAAAAAAAAABAwkAAGYAAAACBQAAAAF4CQAAaAAAAAIAAAAAAAAAAAYFAAAABXNjYWxlBQAAAAVzY2FsZQQAAAAMY29lZmZpY2ll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wMjcyMjI4MjYJAQAAABFmb3J3YXJkUGFzc0xheWVyMgAAAAQFAAAADGxheWVyMU91dHB1dAUAAAANbGF5ZXIyV2VpZ2h0cwUAAAAMbGF5ZXIyQmlhc2VzAgAAAAZMYXllcjIEAAAAC2RlYnVnTGF5ZXIyCAUAAAALJHQwMjcyMjI4MjYAAAACXzEEAAAADGxheWVyMk91dHB1dAgFAAAACyR0MDI3MjIyODI2AAAAAl8yCQAETgAAAAIJAAROAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAGcmVzdWx0BQAAAAxsYXllcjJPdXRwdXQFAAAAA25pbAUAAAALZGVidWdMYXllcjEFAAAAC2RlYnVnTGF5ZXIyAAAAAGwGHDc=", "height": 3082536, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EATSuZcqxZ3f4MpdgivbU9TvBRaU6kTdhJqYqJQa4wae Next: 4mYq43JfanRZQyBETXNzpVZnazq9HeDF1xkokwGuKXa5 Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[600497, | |
4 | + | let layer1Weights = [[600497, 600733], [414197, 414252]] | |
5 | 5 | ||
6 | - | let layer1Biases = [-259050, - | |
6 | + | let layer1Biases = [-259050, -635638] | |
7 | 7 | ||
8 | - | let layer2Weights = [[832966, - | |
8 | + | let layer2Weights = [[832966, -897141]] | |
9 | 9 | ||
10 | 10 | let layer2Biases = [-381179] | |
11 | 11 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[600497, | |
4 | + | let layer1Weights = [[600497, 600733], [414197, 414252]] | |
5 | 5 | ||
6 | - | let layer1Biases = [-259050, - | |
6 | + | let layer1Biases = [-259050, -635638] | |
7 | 7 | ||
8 | - | let layer2Weights = [[832966, - | |
8 | + | let layer2Weights = [[832966, -897141]] | |
9 | 9 | ||
10 | 10 | let layer2Biases = [-381179] | |
11 | 11 | ||
12 | 12 | func exp_approx (x) = { | |
13 | 13 | let scale = 100000 | |
14 | 14 | if (((-6 * scale) > x)) | |
15 | 15 | then 1 | |
16 | 16 | else if ((x > (6 * scale))) | |
17 | 17 | then scale | |
18 | 18 | else { | |
19 | 19 | let coefficients = [$Tuple2(60000, (scale - 1)), $Tuple2(50000, (scale - 2)), $Tuple2(40000, (scale - 3)), $Tuple2(30000, (scale - 10)), $Tuple2(20000, (scale - 20)), $Tuple2(10000, (scale - 30)), $Tuple2(0, scale), $Tuple2(-10000, (scale + 30)), $Tuple2(-20000, (scale + 20)), $Tuple2(-30000, (scale + 10)), $Tuple2(-40000, (scale + 3)), $Tuple2(-50000, (scale + 2)), $Tuple2(-60000, (scale + 1))] | |
20 | 20 | let index = ((x + 60000) / 10000) | |
21 | 21 | let $t0926968 = coefficients[index] | |
22 | 22 | let coefficient = $t0926968._1 | |
23 | 23 | let y = $t0926968._2 | |
24 | 24 | y | |
25 | 25 | } | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func sigmoid (z,debugPrefix) = { | |
30 | 30 | let base = 100000 | |
31 | 31 | let positiveZ = if ((0 > z)) | |
32 | 32 | then -(z) | |
33 | 33 | else z | |
34 | 34 | let expValue = exp_approx(positiveZ) | |
35 | 35 | let sigValue = (base - ((base * base) / (base + expValue))) | |
36 | 36 | $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue) | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func forwardPassLayer1 (input,weights,biases,debugPrefix) = { | |
41 | 41 | let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000)) | |
42 | 42 | let sum1 = (((input[0] * weights[1][0]) + (input[1] * weights[1][1])) + (biases[1] * 100000)) | |
43 | 43 | let $t018331886 = sigmoid(sum0, "Layer1N0") | |
44 | 44 | let debugEntries0 = $t018331886._1 | |
45 | 45 | let sig0 = $t018331886._2 | |
46 | 46 | let $t018911944 = sigmoid(sum1, "Layer1N1") | |
47 | 47 | let debugEntries1 = $t018911944._1 | |
48 | 48 | let sig1 = $t018911944._2 | |
49 | 49 | let debugInfo = (debugEntries0 ++ debugEntries1) | |
50 | 50 | let output = [sig0, sig1] | |
51 | 51 | $Tuple2(debugInfo, output) | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func forwardPassLayer2 (input,weights,biases,debugPrefix) = { | |
56 | 56 | let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000)) | |
57 | 57 | let $t022542307 = sigmoid(sum0, "Layer2N0") | |
58 | 58 | let debugEntries0 = $t022542307._1 | |
59 | 59 | let sig0 = $t022542307._2 | |
60 | 60 | let debugInfo = debugEntries0 | |
61 | 61 | let output = sig0 | |
62 | 62 | $Tuple2(debugInfo, output) | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | @Callable(i) | |
67 | 67 | func predict (input1,input2) = { | |
68 | 68 | let scaledInput1 = if ((input1 == 1)) | |
69 | 69 | then 1000000 | |
70 | 70 | else 0 | |
71 | 71 | let scaledInput2 = if ((input2 == 1)) | |
72 | 72 | then 1000000 | |
73 | 73 | else 0 | |
74 | 74 | let inputs = [scaledInput1, scaledInput2] | |
75 | 75 | let $t026192717 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
76 | 76 | let debugLayer1 = $t026192717._1 | |
77 | 77 | let layer1Output = $t026192717._2 | |
78 | 78 | let $t027222826 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
79 | 79 | let debugLayer2 = $t027222826._1 | |
80 | 80 | let layer2Output = $t027222826._2 | |
81 | 81 | (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2) | |
82 | 82 | } | |
83 | 83 | ||
84 | 84 |
github/deemru/w8io/026f985 38.68 ms ◑