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//////////oFAAAABXNjYWxlBQAAAAF4AAAAAAAAAAAAAwkAAGYAAAACBQAAAAF4CQAAaAAAAAIAAAAAAAAAAAYFAAAABXNjYWxlBQAAAAVzY2Fs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HJ5AAAAAgIAAAAGcmVzdWx0BQAAAAxsYXllcjJPdXRwdXQFAAAAA25pbAUAAAALZGVidWdMYXllcjEFAAAAC2RlYnVnTGF5ZXIyAAAAAFpA3Cc=", "height": 3082524, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BM7ehgNJjRxHo7mhrVujFVsbX5FhFkTyDeqeCDjJhPbY Next: 3SS2H6aEuX3vuyY6DmmqnW7womLnia6zsZ7b9RdzwT5j Diff:
OldNewDifferences
99
1010 let layer2Biases = [-381179]
1111
12-func exp_approximation (x) = {
12+func exp_approx (x) = {
1313 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+ }
2026 }
2127
2228
2531 let positiveZ = if ((0 > z))
2632 then -(z)
2733 else z
28- let expValue = exp_approximation(positiveZ)
29- let sigValue = ((base * 100000) / (base + expValue))
34+ let expValue = exp_approx(positiveZ)
35+ let sigValue = ((base * base) / (base + expValue))
3036 $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
3137 }
3238
3339
3440 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)
4452 }
4553
4654
4755 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)
5363 }
5464
5565
6272 then 1000000
6373 else 0
6474 let inputs = [scaledInput1, scaledInput2]
65- let $t023522450 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
66- let layer1Output = $t023522450._1
67- let debugLayer1 = $t023522450._2
68- let $t024552559 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
69- let layer2Output = $t024552559._1
70- let debugLayer2 = $t024552559._2
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
7181 (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2)
7282 }
7383
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let layer1Weights = [[600497, 600732], [414197, 414253]]
55
66 let layer1Biases = [-259051, -635637]
77
88 let layer2Weights = [[832965, -897142]]
99
1010 let layer2Biases = [-381179]
1111
12-func exp_approximation (x) = {
12+func exp_approx (x) = {
1313 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+ }
2026 }
2127
2228
2329 func sigmoid (z,debugPrefix) = {
2430 let base = 100000
2531 let positiveZ = if ((0 > z))
2632 then -(z)
2733 else z
28- let expValue = exp_approximation(positiveZ)
29- let sigValue = ((base * 100000) / (base + expValue))
34+ let expValue = exp_approx(positiveZ)
35+ let sigValue = ((base * base) / (base + expValue))
3036 $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
3137 }
3238
3339
3440 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)
4452 }
4553
4654
4755 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)
5363 }
5464
5565
5666 @Callable(i)
5767 func predict (input1,input2) = {
5868 let scaledInput1 = if ((input1 == 1))
5969 then 1000000
6070 else 0
6171 let scaledInput2 = if ((input2 == 1))
6272 then 1000000
6373 else 0
6474 let inputs = [scaledInput1, scaledInput2]
65- let $t023522450 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
66- let layer1Output = $t023522450._1
67- let debugLayer1 = $t023522450._2
68- let $t024552559 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
69- let layer2Output = $t024552559._1
70- let debugLayer2 = $t024552559._2
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
7181 (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2)
7282 }
7383
7484

github/deemru/w8io/026f985 
26.55 ms