tx · BgXQzeibJ6sxd4Syjnb3oFzkazJ4kF1yu3ctYeGvh9Tu 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.04.28 12:25 [3082524] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "BgXQzeibJ6sxd4Syjnb3oFzkazJ4kF1yu3ctYeGvh9Tu", "fee": 1000000, "feeAssetId": null, "timestamp": 1714296352174, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "2ZF5hkjGjMUEhBxZyJpjRUWHn7ojG1f7pEJNGv2A8C8oKh53ws9hzxPXWSF4AXexMzSRLytLrv8j78p8CLiTxQrU" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAgAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmxCQAETAAAAAIAAAAAAAAJKpwFAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwVCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcUJAARMAAAAAgD///////JPigUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAACmV4cF9hcHByb3gAAAABAAAAAXgEAAAABXNjYWxlAAAAAAAAAYagAwkAAGYAAAACCQAAaAAAAAIA//////////oFAAAABXNjYWxlBQAAAAF4AAAAAAAAAAAAAwkAAGYAAAACBQAAAAF4CQAAaAAAAAIAAAAAAAAAAAYFAAAABXNjYWxlBQAAAAVzY2FsZ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J5AAAAAgIAAAAGcmVzdWx0BQAAAAxsYXllcjJPdXRwdXQFAAAAA25pbAUAAAALZGVidWdMYXllcjEFAAAAC2RlYnVnTGF5ZXIyAAAAAFpA3Cc=", "height": 3082524, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BM7ehgNJjRxHo7mhrVujFVsbX5FhFkTyDeqeCDjJhPbY Next: 3SS2H6aEuX3vuyY6DmmqnW7womLnia6zsZ7b9RdzwT5j Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let layer2Biases = [-381179] | |
11 | 11 | ||
12 | - | func exp_ | |
12 | + | func exp_approx (x) = { | |
13 | 13 | let scale = 100000 | |
14 | - | let scaled_x = (x / scale) | |
15 | - | let e = 2718281 | |
16 | - | let factor1 = scaled_x | |
17 | - | let factor2 = ((scaled_x * scaled_x) / (2 * scale)) | |
18 | - | let factor3 = (((scaled_x * scaled_x) * scaled_x) / ((6 * scale) * scale)) | |
19 | - | (((100000 + factor1) + factor2) + factor3) | |
14 | + | if (((-6 * scale) > x)) | |
15 | + | then 0 | |
16 | + | else if ((x > (6 * scale))) | |
17 | + | then scale | |
18 | + | else { | |
19 | + | let coefficients = [$Tuple2(60000, 5000), $Tuple2(50000, 10000), $Tuple2(40000, 20000), $Tuple2(30000, 30000), $Tuple2(20000, 50000), $Tuple2(10000, 70000), $Tuple2(0, 100000), $Tuple2(-10000, 70000), $Tuple2(-20000, 50000), $Tuple2(-30000, 30000), $Tuple2(-40000, 20000), $Tuple2(-50000, 10000), $Tuple2(-60000, 5000)] | |
20 | + | let index = ((x + 60000) / 10000) | |
21 | + | let $t0811853 = coefficients[index] | |
22 | + | let coefficient = $t0811853._1 | |
23 | + | let y = $t0811853._2 | |
24 | + | y | |
25 | + | } | |
20 | 26 | } | |
21 | 27 | ||
22 | 28 | ||
25 | 31 | let positiveZ = if ((0 > z)) | |
26 | 32 | then -(z) | |
27 | 33 | else z | |
28 | - | let expValue = exp_ | |
29 | - | let sigValue = ((base * | |
34 | + | let expValue = exp_approx(positiveZ) | |
35 | + | let sigValue = ((base * base) / (base + expValue)) | |
30 | 36 | $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue) | |
31 | 37 | } | |
32 | 38 | ||
33 | 39 | ||
34 | 40 | func forwardPassLayer1 (input,weights,biases,debugPrefix) = { | |
35 | - | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
36 | - | let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1]) | |
37 | - | let $t016891735 = sigmoid(sum0, "Layer1N0") | |
38 | - | let debug0 = $t016891735._1 | |
39 | - | let sig0 = $t016891735._2 | |
40 | - | let $t017401786 = sigmoid(sum1, "Layer1N1") | |
41 | - | let debug1 = $t017401786._1 | |
42 | - | let sig1 = $t017401786._2 | |
43 | - | $Tuple2([sig0, sig1], (debug0 ++ debug1)) | |
41 | + | let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000)) | |
42 | + | let sum1 = (((input[0] * weights[1][0]) + (input[1] * weights[1][1])) + (biases[1] * 100000)) | |
43 | + | let $t017231776 = sigmoid(sum0, "Layer1N0") | |
44 | + | let debugEntries0 = $t017231776._1 | |
45 | + | let sig0 = $t017231776._2 | |
46 | + | let $t017811834 = sigmoid(sum1, "Layer1N1") | |
47 | + | let debugEntries1 = $t017811834._1 | |
48 | + | let sig1 = $t017811834._2 | |
49 | + | let debugInfo = (debugEntries0 ++ debugEntries1) | |
50 | + | let output = [sig0, sig1] | |
51 | + | $Tuple2(debugInfo, output) | |
44 | 52 | } | |
45 | 53 | ||
46 | 54 | ||
47 | 55 | func forwardPassLayer2 (input,weights,biases,debugPrefix) = { | |
48 | - | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
49 | - | let $t020552101 = sigmoid(sum0, "Layer2N0") | |
50 | - | let debug0 = $t020552101._1 | |
51 | - | let sig0 = $t020552101._2 | |
52 | - | $Tuple2(sig0, debug0) | |
56 | + | let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000)) | |
57 | + | let $t021442197 = sigmoid(sum0, "Layer2N0") | |
58 | + | let debugEntries0 = $t021442197._1 | |
59 | + | let sig0 = $t021442197._2 | |
60 | + | let debugInfo = debugEntries0 | |
61 | + | let output = sig0 | |
62 | + | $Tuple2(debugInfo, output) | |
53 | 63 | } | |
54 | 64 | ||
55 | 65 | ||
62 | 72 | then 1000000 | |
63 | 73 | else 0 | |
64 | 74 | let inputs = [scaledInput1, scaledInput2] | |
65 | - | let $ | |
66 | - | let | |
67 | - | let | |
68 | - | let $ | |
69 | - | let | |
70 | - | let | |
75 | + | let $t025092607 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
76 | + | let debugLayer1 = $t025092607._1 | |
77 | + | let layer1Output = $t025092607._2 | |
78 | + | let $t026122716 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
79 | + | let debugLayer2 = $t026122716._1 | |
80 | + | let layer2Output = $t026122716._2 | |
71 | 81 | (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2) | |
72 | 82 | } | |
73 | 83 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let layer1Weights = [[600497, 600732], [414197, 414253]] | |
5 | 5 | ||
6 | 6 | let layer1Biases = [-259051, -635637] | |
7 | 7 | ||
8 | 8 | let layer2Weights = [[832965, -897142]] | |
9 | 9 | ||
10 | 10 | let layer2Biases = [-381179] | |
11 | 11 | ||
12 | - | func exp_ | |
12 | + | func exp_approx (x) = { | |
13 | 13 | let scale = 100000 | |
14 | - | let scaled_x = (x / scale) | |
15 | - | let e = 2718281 | |
16 | - | let factor1 = scaled_x | |
17 | - | let factor2 = ((scaled_x * scaled_x) / (2 * scale)) | |
18 | - | let factor3 = (((scaled_x * scaled_x) * scaled_x) / ((6 * scale) * scale)) | |
19 | - | (((100000 + factor1) + factor2) + factor3) | |
14 | + | if (((-6 * scale) > x)) | |
15 | + | then 0 | |
16 | + | else if ((x > (6 * scale))) | |
17 | + | then scale | |
18 | + | else { | |
19 | + | let coefficients = [$Tuple2(60000, 5000), $Tuple2(50000, 10000), $Tuple2(40000, 20000), $Tuple2(30000, 30000), $Tuple2(20000, 50000), $Tuple2(10000, 70000), $Tuple2(0, 100000), $Tuple2(-10000, 70000), $Tuple2(-20000, 50000), $Tuple2(-30000, 30000), $Tuple2(-40000, 20000), $Tuple2(-50000, 10000), $Tuple2(-60000, 5000)] | |
20 | + | let index = ((x + 60000) / 10000) | |
21 | + | let $t0811853 = coefficients[index] | |
22 | + | let coefficient = $t0811853._1 | |
23 | + | let y = $t0811853._2 | |
24 | + | y | |
25 | + | } | |
20 | 26 | } | |
21 | 27 | ||
22 | 28 | ||
23 | 29 | func sigmoid (z,debugPrefix) = { | |
24 | 30 | let base = 100000 | |
25 | 31 | let positiveZ = if ((0 > z)) | |
26 | 32 | then -(z) | |
27 | 33 | else z | |
28 | - | let expValue = exp_ | |
29 | - | let sigValue = ((base * | |
34 | + | let expValue = exp_approx(positiveZ) | |
35 | + | let sigValue = ((base * base) / (base + expValue)) | |
30 | 36 | $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue) | |
31 | 37 | } | |
32 | 38 | ||
33 | 39 | ||
34 | 40 | func forwardPassLayer1 (input,weights,biases,debugPrefix) = { | |
35 | - | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
36 | - | let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1]) | |
37 | - | let $t016891735 = sigmoid(sum0, "Layer1N0") | |
38 | - | let debug0 = $t016891735._1 | |
39 | - | let sig0 = $t016891735._2 | |
40 | - | let $t017401786 = sigmoid(sum1, "Layer1N1") | |
41 | - | let debug1 = $t017401786._1 | |
42 | - | let sig1 = $t017401786._2 | |
43 | - | $Tuple2([sig0, sig1], (debug0 ++ debug1)) | |
41 | + | let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000)) | |
42 | + | let sum1 = (((input[0] * weights[1][0]) + (input[1] * weights[1][1])) + (biases[1] * 100000)) | |
43 | + | let $t017231776 = sigmoid(sum0, "Layer1N0") | |
44 | + | let debugEntries0 = $t017231776._1 | |
45 | + | let sig0 = $t017231776._2 | |
46 | + | let $t017811834 = sigmoid(sum1, "Layer1N1") | |
47 | + | let debugEntries1 = $t017811834._1 | |
48 | + | let sig1 = $t017811834._2 | |
49 | + | let debugInfo = (debugEntries0 ++ debugEntries1) | |
50 | + | let output = [sig0, sig1] | |
51 | + | $Tuple2(debugInfo, output) | |
44 | 52 | } | |
45 | 53 | ||
46 | 54 | ||
47 | 55 | func forwardPassLayer2 (input,weights,biases,debugPrefix) = { | |
48 | - | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
49 | - | let $t020552101 = sigmoid(sum0, "Layer2N0") | |
50 | - | let debug0 = $t020552101._1 | |
51 | - | let sig0 = $t020552101._2 | |
52 | - | $Tuple2(sig0, debug0) | |
56 | + | let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000)) | |
57 | + | let $t021442197 = sigmoid(sum0, "Layer2N0") | |
58 | + | let debugEntries0 = $t021442197._1 | |
59 | + | let sig0 = $t021442197._2 | |
60 | + | let debugInfo = debugEntries0 | |
61 | + | let output = sig0 | |
62 | + | $Tuple2(debugInfo, output) | |
53 | 63 | } | |
54 | 64 | ||
55 | 65 | ||
56 | 66 | @Callable(i) | |
57 | 67 | func predict (input1,input2) = { | |
58 | 68 | let scaledInput1 = if ((input1 == 1)) | |
59 | 69 | then 1000000 | |
60 | 70 | else 0 | |
61 | 71 | let scaledInput2 = if ((input2 == 1)) | |
62 | 72 | then 1000000 | |
63 | 73 | else 0 | |
64 | 74 | let inputs = [scaledInput1, scaledInput2] | |
65 | - | let $ | |
66 | - | let | |
67 | - | let | |
68 | - | let $ | |
69 | - | let | |
70 | - | let | |
75 | + | let $t025092607 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
76 | + | let debugLayer1 = $t025092607._1 | |
77 | + | let layer1Output = $t025092607._2 | |
78 | + | let $t026122716 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
79 | + | let debugLayer2 = $t026122716._1 | |
80 | + | let layer2Output = $t026122716._2 | |
71 | 81 | (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2) | |
72 | 82 | } | |
73 | 83 | ||
74 | 84 |
github/deemru/w8io/026f985 26.55 ms ◑