tx · EagziTUuatBGN4yrywpoprrknF46urgJ1q46iavxr1Ng 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.04.28 12:50 [3082549] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "EagziTUuatBGN4yrywpoprrknF46urgJ1q46iavxr1Ng", "fee": 1000000, "feeAssetId": null, "timestamp": 1714297898147, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "4ngVfQtVHW4o297Y1CdpAiN4Qn2mKg7VyeMFMUbGn3vTyvETqx8twFZh162EB6Kiv2KK6QD6hHt1vEzQLipYJ1bP" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAgAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmxCQAETAAAAAIAAAAAAAAJKpwFAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwVCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcUJAARMAAAAAgD///////JPigUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8GBQAAAANuaWwBAAAACmV4cF9hcHByb3gAAAABAAAAAXgEAAAABXNjYWxlAAAAAAAAAYagAwkAAGYAAAACCQAAaAAAAAIA//////////oFAAAABXNjYWxlBQAAAAF4AAAAAAAAAAABAwkAAGYAAAACBQAAAAF4CQAAaAAAAAIAAAAAAAAAAAYFAAAABXNjYWxlAAAAAAAAAYafBAAAAAxjb2VmZmljaWVudHM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uaWwFAAAAC2RlYnVnTGF5ZXIxBQAAAAtkZWJ1Z0xheWVyMgAAAADY8rlu", "height": 3082549, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6V35pBudomPg2sNkERM1SV5yreXyCvfUjZxcnWEAwv9b Next: 2b25PWcsfJJqtzYdx5PHEx5557PpxguKVWbbsMW8ffgA 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, 600732], [414197, 414253]] | |
5 | 5 | ||
6 | - | let layer1Biases = [- | |
6 | + | let layer1Biases = [-259051, -635637] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[832965, -897142]] | |
9 | 9 | ||
10 | - | let layer2Biases = [- | |
10 | + | let layer2Biases = [-381178] | |
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 | - | then | |
17 | + | then 99999 | |
18 | 18 | else { | |
19 | - | let coefficients = [$Tuple2(60000, | |
19 | + | let coefficients = [$Tuple2(60000, 99999), $Tuple2(50000, 95000), $Tuple2(40000, 90000), $Tuple2(30000, 85000), $Tuple2(20000, 80000), $Tuple2(10000, 75000), $Tuple2(0, 70000), $Tuple2(-10000, 65000), $Tuple2(-20000, 60000), $Tuple2(-30000, 55000), $Tuple2(-40000, 50000), $Tuple2(-50000, 45000), $Tuple2(-60000, 40000)] | |
20 | 20 | let index = ((x + 60000) / 10000) | |
21 | - | let $ | |
22 | - | let | |
23 | - | let y = $ | |
21 | + | let $t0920957 = coefficients[index] | |
22 | + | let blabla = $t0920957._1 | |
23 | + | let y = $t0920957._2 | |
24 | 24 | y | |
25 | 25 | } | |
26 | 26 | } | |
32 | 32 | then -(z) | |
33 | 33 | else z | |
34 | 34 | let expValue = exp_approx(positiveZ) | |
35 | - | let sigValue = ( | |
35 | + | let sigValue = ((base * expValue) / (base + expValue)) | |
36 | 36 | $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue) | |
37 | 37 | } | |
38 | 38 | ||
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 | - | let $ | |
44 | - | let debugEntries0 = $ | |
45 | - | let sig0 = $ | |
46 | - | let $ | |
47 | - | let debugEntries1 = $ | |
48 | - | let sig1 = $ | |
43 | + | let $t017891842 = sigmoid(sum0, "Layer1N0") | |
44 | + | let debugEntries0 = $t017891842._1 | |
45 | + | let sig0 = $t017891842._2 | |
46 | + | let $t018471900 = sigmoid(sum1, "Layer1N1") | |
47 | + | let debugEntries1 = $t018471900._1 | |
48 | + | let sig1 = $t018471900._2 | |
49 | 49 | let debugInfo = (debugEntries0 ++ debugEntries1) | |
50 | 50 | let output = [sig0, sig1] | |
51 | 51 | $Tuple2(debugInfo, output) | |
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 | - | let $ | |
58 | - | let debugEntries0 = $ | |
59 | - | let sig0 = $ | |
57 | + | let $t022102263 = sigmoid(sum0, "Layer2N0") | |
58 | + | let debugEntries0 = $t022102263._1 | |
59 | + | let sig0 = $t022102263._2 | |
60 | 60 | let debugInfo = debugEntries0 | |
61 | 61 | let output = sig0 | |
62 | 62 | $Tuple2(debugInfo, output) | |
72 | 72 | then 1000000 | |
73 | 73 | else 0 | |
74 | 74 | let inputs = [scaledInput1, scaledInput2] | |
75 | - | let $ | |
76 | - | let debugLayer1 = $ | |
77 | - | let layer1Output = $ | |
78 | - | let $ | |
79 | - | let debugLayer2 = $ | |
80 | - | let layer2Output = $ | |
75 | + | let $t025752673 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
76 | + | let debugLayer1 = $t025752673._1 | |
77 | + | let layer1Output = $t025752673._2 | |
78 | + | let $t026782782 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
79 | + | let debugLayer2 = $t026782782._1 | |
80 | + | let layer2Output = $t026782782._2 | |
81 | 81 | (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2) | |
82 | 82 | } | |
83 | 83 |
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, 600732], [414197, 414253]] | |
5 | 5 | ||
6 | - | let layer1Biases = [- | |
6 | + | let layer1Biases = [-259051, -635637] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[832965, -897142]] | |
9 | 9 | ||
10 | - | let layer2Biases = [- | |
10 | + | let layer2Biases = [-381178] | |
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 | - | then | |
17 | + | then 99999 | |
18 | 18 | else { | |
19 | - | let coefficients = [$Tuple2(60000, | |
19 | + | let coefficients = [$Tuple2(60000, 99999), $Tuple2(50000, 95000), $Tuple2(40000, 90000), $Tuple2(30000, 85000), $Tuple2(20000, 80000), $Tuple2(10000, 75000), $Tuple2(0, 70000), $Tuple2(-10000, 65000), $Tuple2(-20000, 60000), $Tuple2(-30000, 55000), $Tuple2(-40000, 50000), $Tuple2(-50000, 45000), $Tuple2(-60000, 40000)] | |
20 | 20 | let index = ((x + 60000) / 10000) | |
21 | - | let $ | |
22 | - | let | |
23 | - | let y = $ | |
21 | + | let $t0920957 = coefficients[index] | |
22 | + | let blabla = $t0920957._1 | |
23 | + | let y = $t0920957._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 | - | let sigValue = ( | |
35 | + | let sigValue = ((base * expValue) / (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 | - | let $ | |
44 | - | let debugEntries0 = $ | |
45 | - | let sig0 = $ | |
46 | - | let $ | |
47 | - | let debugEntries1 = $ | |
48 | - | let sig1 = $ | |
43 | + | let $t017891842 = sigmoid(sum0, "Layer1N0") | |
44 | + | let debugEntries0 = $t017891842._1 | |
45 | + | let sig0 = $t017891842._2 | |
46 | + | let $t018471900 = sigmoid(sum1, "Layer1N1") | |
47 | + | let debugEntries1 = $t018471900._1 | |
48 | + | let sig1 = $t018471900._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 | - | let $ | |
58 | - | let debugEntries0 = $ | |
59 | - | let sig0 = $ | |
57 | + | let $t022102263 = sigmoid(sum0, "Layer2N0") | |
58 | + | let debugEntries0 = $t022102263._1 | |
59 | + | let sig0 = $t022102263._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 | - | let $ | |
76 | - | let debugLayer1 = $ | |
77 | - | let layer1Output = $ | |
78 | - | let $ | |
79 | - | let debugLayer2 = $ | |
80 | - | let layer2Output = $ | |
75 | + | let $t025752673 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
76 | + | let debugLayer1 = $t025752673._1 | |
77 | + | let layer1Output = $t025752673._2 | |
78 | + | let $t026782782 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
79 | + | let debugLayer2 = $t026782782._1 | |
80 | + | let layer2Output = $t026782782._2 | |
81 | 81 | (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2) | |
82 | 82 | } | |
83 | 83 | ||
84 | 84 |
github/deemru/w8io/169f3d6 63.88 ms ◑