tx · 5K3SesFjoRF1HkRqSncDmVU95ew5cKw5DxSrJdSM3sXu

3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY:  -0.01000000 Waves

2024.04.28 13:59 [3082630] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves

{ "type": 13, "id": "5K3SesFjoRF1HkRqSncDmVU95ew5cKw5DxSrJdSM3sXu", "fee": 1000000, "feeAssetId": null, "timestamp": 1714301865213, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "2MeJbQyFn1ZSDpv2Pic5PwkEDF8QEPAGoSqmGPbspgDhALhYVZoabYY3jN5BQkEcsn9k4QZbY6gRrC3PJbPbph45" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAkAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmwCQAETAAAAAIAAAAAAAAJKp0FAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLAUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcUJAARMAAAAAgD///////JPigUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAABmNsYW1wWgAAAAIAAAABegAAAAVsaW1pdAMJAABmAAAAAgUAAAABegUAAAAFbGltaXQFAAAABWxpbWl0AwkAAGYAAAACCQEAAAABLQAAAAEFAAAABWxpbWl0BQAAAAF6CQEAAAABLQAAAAEFAAAABWxpbWl0BQAAAAF6AQAAAApleHBfYXBwcm94AAAAAQAAAAF4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BQAAAAZpbnB1dDIAAAAAAAAAAAEAAAAAAAAPQkAAAAAAAAAAAAAEAAAABmlucHV0cwkABEwAAAACBQAAAAxzY2FsZWRJbnB1dDEJAARMAAAAAgUAAAAMc2NhbGVkSW5wdXQyBQAAAANuaWwEAAAACyR0MDI1NTEyNjQ5CQEAAAARZm9yd2FyZFBhc3NMYXllcjEAAAAEBQAAAAZpbnB1dHMFAAAADWxheWVyMVdlaWdodHMFAAAADGxheWVyMUJpYXNlcwIAAAAGTGF5ZXIxBAAAAAtkZWJ1Z0xheWVyMQgFAAAACyR0MDI1NTEyNjQ5AAAAAl8xBAAAAAxsYXllcjFPdXRwdXQIBQAAAAskdDAyNTUxMjY0OQAAAAJfMgQAAAALJHQwMjY1NDI3NTgJAQAAABFmb3J3YXJkUGFzc0xheWVyMgAAAAQFAAAADGxheWVyMU91dHB1dAUAAAANbGF5ZXIyV2VpZ2h0cwUAAAAMbGF5ZXIyQmlhc2VzAgAAAAZMYXllcjIEAAAAC2RlYnVnTGF5ZXIyCAUAAAALJHQwMjY1NDI3NTgAAAACXzEEAAAADGxheWVyMk91dHB1dAgFAAAACyR0MDI2NTQyNzU4AAAAAl8yCQAETgAAAAIJAAROAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAGcmVzdWx0BQAAAAxsYXllcjJPdXRwdXQFAAAAA25pbAUAAAALZGVidWdMYXllcjEFAAAAC2RlYnVnTGF5ZXIyAAAAAKS23mA=", "height": 3082630, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BQxK6Q9RxFkuvKPme7hUqZ728mZQD9T4F4MFJRiKaPvb Next: 8Tiq9PrpLGFMXBGGABe7MVibryxyyrcnbvTnKbFxbEWk Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let layer1Weights = [[600496, 600732], [414196, 414252]]
4+let layer1Weights = [[600496, 600733], [414197, 414252]]
55
6-let layer1Biases = [-259051, -635637]
6+let layer1Biases = [-259050, -635637]
77
8-let layer2Weights = [[832965, -897141]]
8+let layer2Weights = [[832965, -897142]]
99
1010 let layer2Biases = [-381179]
1111
1717
1818
1919 func exp_approx (x) = {
20- let scaled_x = (x / 10000)
21- let scaled_x2 = fraction(scaled_x, scaled_x, 1, DOWN)
22- let scaled_x3 = fraction(scaled_x2, scaled_x, 1, DOWN)
23- let exp_result = (((10000 - fraction(scaled_x, 10, 1, DOWN)) + fraction(scaled_x2, 200, 1, DOWN)) - fraction(scaled_x3, 6000, 1, DOWN))
24- if ((0 > x))
25- then (10000 + exp_result)
26- else (10000 - exp_result)
20+ let maxExp = 100000
21+ if ((-(maxExp) > x))
22+ then 1
23+ else if ((x > maxExp))
24+ then 1000000000
25+ else {
26+ let scaled_x = (x / 10000)
27+ let scaled_x2 = fraction(scaled_x, scaled_x, 10000, DOWN)
28+ let exp_result = ((10000 - scaled_x) + (scaled_x2 / 2))
29+ (10000 - exp_result)
30+ }
2731 }
2832
2933
3034 func sigmoid (z,debugPrefix) = {
3135 let clampedZ = clampZ(z, 100000)
32- let positiveZ = if ((0 > z))
33- then -(z)
34- else z
35- let expValue = exp_approx(-(positiveZ))
36+ let expValue = exp_approx(-(clampedZ))
3637 let sigValue = fraction(10000, (10000 + expValue), 1, DOWN)
37- $Tuple2([IntegerEntry((debugPrefix + "inputZ"), z), IntegerEntry((debugPrefix + "clampedZ"), clampedZ), IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
38+ $Tuple2([IntegerEntry((debugPrefix + "clampedZ"), clampedZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
3839 }
3940
4041
4142 func forwardPassLayer1 (input,weights,biases,debugPrefix) = {
4243 let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000))
4344 let sum1 = (((input[0] * weights[1][0]) + (input[1] * weights[1][1])) + (biases[1] * 100000))
44- let $t020552108 = sigmoid(sum0, "Layer1N0")
45- let debugEntries0 = $t020552108._1
46- let sig0 = $t020552108._2
47- let $t021132166 = sigmoid(sum1, "Layer1N1")
48- let debugEntries1 = $t021132166._1
49- let sig1 = $t021132166._2
45+ let $t017651818 = sigmoid(sum0, "Layer1N0")
46+ let debugEntries0 = $t017651818._1
47+ let sig0 = $t017651818._2
48+ let $t018231876 = sigmoid(sum1, "Layer1N1")
49+ let debugEntries1 = $t018231876._1
50+ let sig1 = $t018231876._2
5051 let debugInfo = (debugEntries0 ++ debugEntries1)
5152 let output = [sig0, sig1]
5253 $Tuple2(debugInfo, output)
5556
5657 func forwardPassLayer2 (input,weights,biases,debugPrefix) = {
5758 let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000))
58- let $t024762529 = sigmoid(sum0, "Layer2N0")
59- let debugEntries0 = $t024762529._1
60- let sig0 = $t024762529._2
59+ let $t021862239 = sigmoid(sum0, "Layer2N0")
60+ let debugEntries0 = $t021862239._1
61+ let sig0 = $t021862239._2
6162 let debugInfo = debugEntries0
6263 let output = sig0
6364 $Tuple2(debugInfo, output)
7374 then 1000000
7475 else 0
7576 let inputs = [scaledInput1, scaledInput2]
76- let $t028412939 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
77- let debugLayer1 = $t028412939._1
78- let layer1Output = $t028412939._2
79- let $t029443048 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
80- let debugLayer2 = $t029443048._1
81- let layer2Output = $t029443048._2
77+ let $t025512649 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
78+ let debugLayer1 = $t025512649._1
79+ let layer1Output = $t025512649._2
80+ let $t026542758 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
81+ let debugLayer2 = $t026542758._1
82+ let layer2Output = $t026542758._2
8283 (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2)
8384 }
8485
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let layer1Weights = [[600496, 600732], [414196, 414252]]
4+let layer1Weights = [[600496, 600733], [414197, 414252]]
55
6-let layer1Biases = [-259051, -635637]
6+let layer1Biases = [-259050, -635637]
77
8-let layer2Weights = [[832965, -897141]]
8+let layer2Weights = [[832965, -897142]]
99
1010 let layer2Biases = [-381179]
1111
1212 func clampZ (z,limit) = if ((z > limit))
1313 then limit
1414 else if ((-(limit) > z))
1515 then -(limit)
1616 else z
1717
1818
1919 func exp_approx (x) = {
20- let scaled_x = (x / 10000)
21- let scaled_x2 = fraction(scaled_x, scaled_x, 1, DOWN)
22- let scaled_x3 = fraction(scaled_x2, scaled_x, 1, DOWN)
23- let exp_result = (((10000 - fraction(scaled_x, 10, 1, DOWN)) + fraction(scaled_x2, 200, 1, DOWN)) - fraction(scaled_x3, 6000, 1, DOWN))
24- if ((0 > x))
25- then (10000 + exp_result)
26- else (10000 - exp_result)
20+ let maxExp = 100000
21+ if ((-(maxExp) > x))
22+ then 1
23+ else if ((x > maxExp))
24+ then 1000000000
25+ else {
26+ let scaled_x = (x / 10000)
27+ let scaled_x2 = fraction(scaled_x, scaled_x, 10000, DOWN)
28+ let exp_result = ((10000 - scaled_x) + (scaled_x2 / 2))
29+ (10000 - exp_result)
30+ }
2731 }
2832
2933
3034 func sigmoid (z,debugPrefix) = {
3135 let clampedZ = clampZ(z, 100000)
32- let positiveZ = if ((0 > z))
33- then -(z)
34- else z
35- let expValue = exp_approx(-(positiveZ))
36+ let expValue = exp_approx(-(clampedZ))
3637 let sigValue = fraction(10000, (10000 + expValue), 1, DOWN)
37- $Tuple2([IntegerEntry((debugPrefix + "inputZ"), z), IntegerEntry((debugPrefix + "clampedZ"), clampedZ), IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
38+ $Tuple2([IntegerEntry((debugPrefix + "clampedZ"), clampedZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
3839 }
3940
4041
4142 func forwardPassLayer1 (input,weights,biases,debugPrefix) = {
4243 let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000))
4344 let sum1 = (((input[0] * weights[1][0]) + (input[1] * weights[1][1])) + (biases[1] * 100000))
44- let $t020552108 = sigmoid(sum0, "Layer1N0")
45- let debugEntries0 = $t020552108._1
46- let sig0 = $t020552108._2
47- let $t021132166 = sigmoid(sum1, "Layer1N1")
48- let debugEntries1 = $t021132166._1
49- let sig1 = $t021132166._2
45+ let $t017651818 = sigmoid(sum0, "Layer1N0")
46+ let debugEntries0 = $t017651818._1
47+ let sig0 = $t017651818._2
48+ let $t018231876 = sigmoid(sum1, "Layer1N1")
49+ let debugEntries1 = $t018231876._1
50+ let sig1 = $t018231876._2
5051 let debugInfo = (debugEntries0 ++ debugEntries1)
5152 let output = [sig0, sig1]
5253 $Tuple2(debugInfo, output)
5354 }
5455
5556
5657 func forwardPassLayer2 (input,weights,biases,debugPrefix) = {
5758 let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000))
58- let $t024762529 = sigmoid(sum0, "Layer2N0")
59- let debugEntries0 = $t024762529._1
60- let sig0 = $t024762529._2
59+ let $t021862239 = sigmoid(sum0, "Layer2N0")
60+ let debugEntries0 = $t021862239._1
61+ let sig0 = $t021862239._2
6162 let debugInfo = debugEntries0
6263 let output = sig0
6364 $Tuple2(debugInfo, output)
6465 }
6566
6667
6768 @Callable(i)
6869 func predict (input1,input2) = {
6970 let scaledInput1 = if ((input1 == 1))
7071 then 1000000
7172 else 0
7273 let scaledInput2 = if ((input2 == 1))
7374 then 1000000
7475 else 0
7576 let inputs = [scaledInput1, scaledInput2]
76- let $t028412939 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
77- let debugLayer1 = $t028412939._1
78- let layer1Output = $t028412939._2
79- let $t029443048 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
80- let debugLayer2 = $t029443048._1
81- let layer2Output = $t029443048._2
77+ let $t025512649 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
78+ let debugLayer1 = $t025512649._1
79+ let layer1Output = $t025512649._2
80+ let $t026542758 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
81+ let debugLayer2 = $t026542758._1
82+ let layer2Output = $t026542758._2
8283 (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2)
8384 }
8485
8586

github/deemru/w8io/026f985 
46.60 ms