tx · 4mYq43JfanRZQyBETXNzpVZnazq9HeDF1xkokwGuKXa5

3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY:  -0.01000000 Waves

2024.04.28 12:46 [3082542] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves

{ "type": 13, "id": "4mYq43JfanRZQyBETXNzpVZnazq9HeDF1xkokwGuKXa5", "fee": 1000000, "feeAssetId": null, "timestamp": 1714297558509, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "5FyYDx64RL6qRhvuBaExaKJCPugv5pq8K7QGTiMYYWZsxV4Dfe3721BYqoNapv66HkVdEQtgBEMbQT7s8KQVun9Z" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAcAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmwCQAETAAAAAIAAAAAAAAJKp0FAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcUJAARMAAAAAgD///////JPiwUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAAB3NpZ21vaWQAAAACAAAAAXoAAAALZGVidWdQcmVmaXgEAAAAAWUAAAAAAAApekkEAAAABGJhc2UAAAAAAAAPQkAEAAAACXBvc2l0aXZlWgMJAABmAAAAAgAAAAAAAAAAAAUAAAABegkBAAAAAS0AAAABBQAAAAF6BQAAAAF6BAAAAAdleHBQYXJ0CQAAawAAAAMFA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IdEw48=", "height": 3082542, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JCkBbNxDPwS9TmpCQ9srGadxFoSNr8BhMnsUqjfEDxmf Next: 6V35pBudomPg2sNkERM1SV5yreXyCvfUjZxcnWEAwv9b Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let layer1Weights = [[600497, 600733], [414197, 414252]]
4+let layer1Weights = [[600496, 600733], [414197, 414253]]
55
6-let layer1Biases = [-259050, -635638]
6+let layer1Biases = [-259050, -635637]
77
8-let layer2Weights = [[832966, -897141]]
8+let layer2Weights = [[832965, -897141]]
99
1010 let layer2Biases = [-381179]
1111
12-func exp_approx (x) = {
13- let scale = 100000
14- if (((-6 * scale) > x))
15- then 1
16- else if ((x > (6 * scale)))
17- then scale
18- else {
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- let index = ((x + 60000) / 10000)
21- let $t0926968 = coefficients[index]
22- let coefficient = $t0926968._1
23- let y = $t0926968._2
24- y
25- }
26- }
27-
28-
2912 func sigmoid (z,debugPrefix) = {
30- let base = 100000
13+ let e = 2718281
14+ let base = 1000000
3115 let positiveZ = if ((0 > z))
3216 then -(z)
3317 else z
34- let expValue = exp_approx(positiveZ)
35- let sigValue = (base - ((base * base) / (base + expValue)))
36- $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
18+ let expPart = fraction(e, base, positiveZ)
19+ let sigValue = fraction(base, (base + expPart), base)
20+ $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expPart"), expPart), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
3721 }
3822
3923
4024 func forwardPassLayer1 (input,weights,biases,debugPrefix) = {
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 $t018331886 = sigmoid(sum0, "Layer1N0")
44- let debugEntries0 = $t018331886._1
45- let sig0 = $t018331886._2
46- let $t018911944 = sigmoid(sum1, "Layer1N1")
47- let debugEntries1 = $t018911944._1
48- let sig1 = $t018911944._2
49- let debugInfo = (debugEntries0 ++ debugEntries1)
50- let output = [sig0, sig1]
51- $Tuple2(debugInfo, output)
25+ let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0])
26+ let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1])
27+ let $t010791125 = sigmoid(sum0, "Layer1N0")
28+ let debug0 = $t010791125._1
29+ let sig0 = $t010791125._2
30+ let $t011301176 = sigmoid(sum1, "Layer1N1")
31+ let debug1 = $t011301176._1
32+ let sig1 = $t011301176._2
33+ $Tuple2([sig0, sig1], (debug0 ++ debug1))
5234 }
5335
5436
5537 func forwardPassLayer2 (input,weights,biases,debugPrefix) = {
56- let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000))
57- let $t022542307 = sigmoid(sum0, "Layer2N0")
58- let debugEntries0 = $t022542307._1
59- let sig0 = $t022542307._2
60- let debugInfo = debugEntries0
61- let output = sig0
62- $Tuple2(debugInfo, output)
38+ let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0])
39+ let $t014451491 = sigmoid(sum0, "Layer2N0")
40+ let debug0 = $t014451491._1
41+ let sig0 = $t014451491._2
42+ $Tuple2(sig0, debug0)
6343 }
6444
6545
7252 then 1000000
7353 else 0
7454 let inputs = [scaledInput1, scaledInput2]
75- let $t026192717 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
76- let debugLayer1 = $t026192717._1
77- let layer1Output = $t026192717._2
78- let $t027222826 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
79- let debugLayer2 = $t027222826._1
80- let layer2Output = $t027222826._2
55+ let $t017421840 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
56+ let layer1Output = $t017421840._1
57+ let debugLayer1 = $t017421840._2
58+ let $t018451949 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
59+ let layer2Output = $t018451949._1
60+ let debugLayer2 = $t018451949._2
8161 (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2)
8262 }
8363
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let layer1Weights = [[600497, 600733], [414197, 414252]]
4+let layer1Weights = [[600496, 600733], [414197, 414253]]
55
6-let layer1Biases = [-259050, -635638]
6+let layer1Biases = [-259050, -635637]
77
8-let layer2Weights = [[832966, -897141]]
8+let layer2Weights = [[832965, -897141]]
99
1010 let layer2Biases = [-381179]
1111
12-func exp_approx (x) = {
13- let scale = 100000
14- if (((-6 * scale) > x))
15- then 1
16- else if ((x > (6 * scale)))
17- then scale
18- else {
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- let index = ((x + 60000) / 10000)
21- let $t0926968 = coefficients[index]
22- let coefficient = $t0926968._1
23- let y = $t0926968._2
24- y
25- }
26- }
27-
28-
2912 func sigmoid (z,debugPrefix) = {
30- let base = 100000
13+ let e = 2718281
14+ let base = 1000000
3115 let positiveZ = if ((0 > z))
3216 then -(z)
3317 else z
34- let expValue = exp_approx(positiveZ)
35- let sigValue = (base - ((base * base) / (base + expValue)))
36- $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
18+ let expPart = fraction(e, base, positiveZ)
19+ let sigValue = fraction(base, (base + expPart), base)
20+ $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expPart"), expPart), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
3721 }
3822
3923
4024 func forwardPassLayer1 (input,weights,biases,debugPrefix) = {
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 $t018331886 = sigmoid(sum0, "Layer1N0")
44- let debugEntries0 = $t018331886._1
45- let sig0 = $t018331886._2
46- let $t018911944 = sigmoid(sum1, "Layer1N1")
47- let debugEntries1 = $t018911944._1
48- let sig1 = $t018911944._2
49- let debugInfo = (debugEntries0 ++ debugEntries1)
50- let output = [sig0, sig1]
51- $Tuple2(debugInfo, output)
25+ let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0])
26+ let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1])
27+ let $t010791125 = sigmoid(sum0, "Layer1N0")
28+ let debug0 = $t010791125._1
29+ let sig0 = $t010791125._2
30+ let $t011301176 = sigmoid(sum1, "Layer1N1")
31+ let debug1 = $t011301176._1
32+ let sig1 = $t011301176._2
33+ $Tuple2([sig0, sig1], (debug0 ++ debug1))
5234 }
5335
5436
5537 func forwardPassLayer2 (input,weights,biases,debugPrefix) = {
56- let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000))
57- let $t022542307 = sigmoid(sum0, "Layer2N0")
58- let debugEntries0 = $t022542307._1
59- let sig0 = $t022542307._2
60- let debugInfo = debugEntries0
61- let output = sig0
62- $Tuple2(debugInfo, output)
38+ let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0])
39+ let $t014451491 = sigmoid(sum0, "Layer2N0")
40+ let debug0 = $t014451491._1
41+ let sig0 = $t014451491._2
42+ $Tuple2(sig0, debug0)
6343 }
6444
6545
6646 @Callable(i)
6747 func predict (input1,input2) = {
6848 let scaledInput1 = if ((input1 == 1))
6949 then 1000000
7050 else 0
7151 let scaledInput2 = if ((input2 == 1))
7252 then 1000000
7353 else 0
7454 let inputs = [scaledInput1, scaledInput2]
75- let $t026192717 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
76- let debugLayer1 = $t026192717._1
77- let layer1Output = $t026192717._2
78- let $t027222826 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
79- let debugLayer2 = $t027222826._1
80- let layer2Output = $t027222826._2
55+ let $t017421840 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
56+ let layer1Output = $t017421840._1
57+ let debugLayer1 = $t017421840._2
58+ let $t018451949 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
59+ let layer2Output = $t018451949._1
60+ let debugLayer2 = $t018451949._2
8161 (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2)
8262 }
8363
8464

github/deemru/w8io/026f985 
41.12 ms