tx · GtG7mCapTmYceaRkKY1vhdnd2yLu3vXtwL6gnTomt2N9

3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY:  -0.01000000 Waves

2024.04.28 14:25 [3082655] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves

{ "type": 13, "id": "GtG7mCapTmYceaRkKY1vhdnd2yLu3vXtwL6gnTomt2N9", "fee": 1000000, "feeAssetId": null, "timestamp": 1714303469498, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "21SPdzhzPPKjDKz7mSUHHX6qmiQY9Ucrh6vTU8dNKvwpjvFJ1SmHyx6K5H2Z7THDSECMmeLa6VuPLj2sKdXJEon6" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAgAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmxCQAETAAAAAIAAAAAAAAJKpwFAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwVCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcYJAARMAAAAAgD///////JPigUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAACWV4cEFwcHJveAAAAAEAAAABeAQAAAAHc2NhbGVkWAkAAGsAAAADBQAAAAF4AAAAAAAAAAABAAAAAAAAD0JABAAAAAhzY2FsZWRYMgkAAGsAAAADBQAAAAdzY2FsZWRYBQAAAAdzY2FsZWRYAAAAAAAAD0JABAAAAAV0ZXJtMQkAAGUAAAACAAAAAA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AABkxheWVyMQQAAAALZGVidWdMYXllcjEIBQAAAAskdDAyMTEzMjIxMQAAAAJfMQQAAAAMbGF5ZXIxT3V0cHV0CAUAAAALJHQwMjExMzIyMTEAAAACXzIEAAAACyR0MDIyMTYyMzIwCQEAAAARZm9yd2FyZFBhc3NMYXllcjIAAAAEBQAAAAxsYXllcjFPdXRwdXQFAAAADWxheWVyMldlaWdodHMFAAAADGxheWVyMkJpYXNlcwIAAAAGTGF5ZXIyBAAAAAtkZWJ1Z0xheWVyMggFAAAACyR0MDIyMTYyMzIwAAAAAl8xBAAAAAxsYXllcjJPdXRwdXQIBQAAAAskdDAyMjE2MjMyMAAAAAJfMgkABE4AAAACCQAETgAAAAIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAABnJlc3VsdAUAAAAMbGF5ZXIyT3V0cHV0BQAAAANuaWwFAAAAC2RlYnVnTGF5ZXIxBQAAAAtkZWJ1Z0xheWVyMgAAAADdWWHy", "height": 3082655, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8Tiq9PrpLGFMXBGGABe7MVibryxyyrcnbvTnKbFxbEWk Next: CdzzpSdtWkMdq88oLky7G7s1vveHjZQsJ1rC8WaAeC1X Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let layer1Weights = [[600496, 600733], [414197, 414253]]
4+let layer1Weights = [[600497, 600732], [414197, 414253]]
55
66 let layer1Biases = [-259051, -635637]
77
99
1010 let layer2Biases = [-381179]
1111
12-func clampZ (z,limit) = if ((z > limit))
13- then limit
14- else if ((-(limit) > z))
15- then -(limit)
16- else z
17-
18-
19-func exp_approx (x) = {
20- let abs_x = if ((0 > x))
21- then -(x)
22- else x
23- let adjusted_x = if ((abs_x > 100000))
24- then 100000
25- else abs_x
26- let scaled_x = (adjusted_x / 1000)
27- (100000 - (10 * scaled_x))
12+func expApprox (x) = {
13+ let scaledX = fraction(x, 1, 1000000)
14+ let scaledX2 = fraction(scaledX, scaledX, 1000000)
15+ let term1 = (1000000 - scaledX)
16+ let term2 = fraction(scaledX2, 500000, 1)
17+ (term1 + term2)
2818 }
2919
3020
3121 func sigmoid (z,debugPrefix) = {
32- let clampedZ = clampZ(z, 100000)
33- let expValue = exp_approx(-(clampedZ))
34- let sigValue = fraction(1000000, (1000000 + expValue), 1, DOWN)
35- $Tuple2([IntegerEntry((debugPrefix + "inputZ"), z), IntegerEntry((debugPrefix + "clampedZ"), clampedZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
22+ let expNegZ = expApprox(-(z))
23+ let onePlusExpNegZ = (1000000 + expNegZ)
24+ let sigValue = fraction(1000000000000, onePlusExpNegZ, 1)
25+ $Tuple2([IntegerEntry((debugPrefix + "inputZ"), z), IntegerEntry((debugPrefix + "expNegZ"), expNegZ), IntegerEntry((debugPrefix + "onePlusExpNegZ"), onePlusExpNegZ), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
3626 }
3727
3828
3929 func forwardPassLayer1 (input,weights,biases,debugPrefix) = {
4030 let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000))
4131 let sum1 = (((input[0] * weights[1][0]) + (input[1] * weights[1][1])) + (biases[1] * 100000))
42- let $t018561909 = sigmoid(sum0, "Layer1N0")
43- let debugEntries0 = $t018561909._1
44- let sig0 = $t018561909._2
45- let $t019141967 = sigmoid(sum1, "Layer1N1")
46- let debugEntries1 = $t019141967._1
47- let sig1 = $t019141967._2
32+ let $t013271380 = sigmoid(sum0, "Layer1N0")
33+ let debugEntries0 = $t013271380._1
34+ let sig0 = $t013271380._2
35+ let $t013851438 = sigmoid(sum1, "Layer1N1")
36+ let debugEntries1 = $t013851438._1
37+ let sig1 = $t013851438._2
4838 let debugInfo = (debugEntries0 ++ debugEntries1)
4939 let output = [sig0, sig1]
5040 $Tuple2(debugInfo, output)
5343
5444 func forwardPassLayer2 (input,weights,biases,debugPrefix) = {
5545 let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000))
56- let $t022772330 = sigmoid(sum0, "Layer2N0")
57- let debugEntries0 = $t022772330._1
58- let sig0 = $t022772330._2
46+ let $t017481801 = sigmoid(sum0, "Layer2N0")
47+ let debugEntries0 = $t017481801._1
48+ let sig0 = $t017481801._2
5949 let debugInfo = debugEntries0
6050 let output = sig0
6151 $Tuple2(debugInfo, output)
7161 then 1000000
7262 else 0
7363 let inputs = [scaledInput1, scaledInput2]
74- let $t026422740 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
75- let debugLayer1 = $t026422740._1
76- let layer1Output = $t026422740._2
77- let $t027452849 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
78- let debugLayer2 = $t027452849._1
79- let layer2Output = $t027452849._2
64+ let $t021132211 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
65+ let debugLayer1 = $t021132211._1
66+ let layer1Output = $t021132211._2
67+ let $t022162320 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
68+ let debugLayer2 = $t022162320._1
69+ let layer2Output = $t022162320._2
8070 (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2)
8171 }
8272
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let layer1Weights = [[600496, 600733], [414197, 414253]]
4+let layer1Weights = [[600497, 600732], [414197, 414253]]
55
66 let layer1Biases = [-259051, -635637]
77
88 let layer2Weights = [[832966, -897142]]
99
1010 let layer2Biases = [-381179]
1111
12-func clampZ (z,limit) = if ((z > limit))
13- then limit
14- else if ((-(limit) > z))
15- then -(limit)
16- else z
17-
18-
19-func exp_approx (x) = {
20- let abs_x = if ((0 > x))
21- then -(x)
22- else x
23- let adjusted_x = if ((abs_x > 100000))
24- then 100000
25- else abs_x
26- let scaled_x = (adjusted_x / 1000)
27- (100000 - (10 * scaled_x))
12+func expApprox (x) = {
13+ let scaledX = fraction(x, 1, 1000000)
14+ let scaledX2 = fraction(scaledX, scaledX, 1000000)
15+ let term1 = (1000000 - scaledX)
16+ let term2 = fraction(scaledX2, 500000, 1)
17+ (term1 + term2)
2818 }
2919
3020
3121 func sigmoid (z,debugPrefix) = {
32- let clampedZ = clampZ(z, 100000)
33- let expValue = exp_approx(-(clampedZ))
34- let sigValue = fraction(1000000, (1000000 + expValue), 1, DOWN)
35- $Tuple2([IntegerEntry((debugPrefix + "inputZ"), z), IntegerEntry((debugPrefix + "clampedZ"), clampedZ), IntegerEntry((debugPrefix + "expValue"), expValue), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
22+ let expNegZ = expApprox(-(z))
23+ let onePlusExpNegZ = (1000000 + expNegZ)
24+ let sigValue = fraction(1000000000000, onePlusExpNegZ, 1)
25+ $Tuple2([IntegerEntry((debugPrefix + "inputZ"), z), IntegerEntry((debugPrefix + "expNegZ"), expNegZ), IntegerEntry((debugPrefix + "onePlusExpNegZ"), onePlusExpNegZ), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue)
3626 }
3727
3828
3929 func forwardPassLayer1 (input,weights,biases,debugPrefix) = {
4030 let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000))
4131 let sum1 = (((input[0] * weights[1][0]) + (input[1] * weights[1][1])) + (biases[1] * 100000))
42- let $t018561909 = sigmoid(sum0, "Layer1N0")
43- let debugEntries0 = $t018561909._1
44- let sig0 = $t018561909._2
45- let $t019141967 = sigmoid(sum1, "Layer1N1")
46- let debugEntries1 = $t019141967._1
47- let sig1 = $t019141967._2
32+ let $t013271380 = sigmoid(sum0, "Layer1N0")
33+ let debugEntries0 = $t013271380._1
34+ let sig0 = $t013271380._2
35+ let $t013851438 = sigmoid(sum1, "Layer1N1")
36+ let debugEntries1 = $t013851438._1
37+ let sig1 = $t013851438._2
4838 let debugInfo = (debugEntries0 ++ debugEntries1)
4939 let output = [sig0, sig1]
5040 $Tuple2(debugInfo, output)
5141 }
5242
5343
5444 func forwardPassLayer2 (input,weights,biases,debugPrefix) = {
5545 let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (biases[0] * 100000))
56- let $t022772330 = sigmoid(sum0, "Layer2N0")
57- let debugEntries0 = $t022772330._1
58- let sig0 = $t022772330._2
46+ let $t017481801 = sigmoid(sum0, "Layer2N0")
47+ let debugEntries0 = $t017481801._1
48+ let sig0 = $t017481801._2
5949 let debugInfo = debugEntries0
6050 let output = sig0
6151 $Tuple2(debugInfo, output)
6252 }
6353
6454
6555 @Callable(i)
6656 func predict (input1,input2) = {
6757 let scaledInput1 = if ((input1 == 1))
6858 then 1000000
6959 else 0
7060 let scaledInput2 = if ((input2 == 1))
7161 then 1000000
7262 else 0
7363 let inputs = [scaledInput1, scaledInput2]
74- let $t026422740 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
75- let debugLayer1 = $t026422740._1
76- let layer1Output = $t026422740._2
77- let $t027452849 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
78- let debugLayer2 = $t027452849._1
79- let layer2Output = $t027452849._2
64+ let $t021132211 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
65+ let debugLayer1 = $t021132211._1
66+ let layer1Output = $t021132211._2
67+ let $t022162320 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
68+ let debugLayer2 = $t022162320._1
69+ let layer2Output = $t022162320._2
8070 (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2)
8171 }
8272
8373

github/deemru/w8io/026f985 
28.67 ms