tx · CTK5XZL5t8cmyyJ2vqgR2bTBcRpvXGeA2RrB6hGC8GVB

3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY:  -0.01000000 Waves

2024.04.28 11:26 [3082465] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves

{ "type": 13, "id": "CTK5XZL5t8cmyyJ2vqgR2bTBcRpvXGeA2RrB6hGC8GVB", "fee": 1000000, "feeAssetId": null, "timestamp": 1714292777376, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "235Csg3re1txjvvECKHzUCogjAGHmxmCPkkCvxiBfZg6z8jtdYwd7JmpiJziBBDx37XE3EsQcEggWY2NBXU9STco" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAgAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmxCQAETAAAAAIAAAAAAAAJKp0FAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQoFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcUJAARMAAAAAgD///////JPigUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAAEWV4cF9hcHByb3hpbWF0aW9uAAAAAQAAAAF4BAAAAAVzY2FsZQkAATYAAAABAAAAAAAAAYagBAAAAAFlCQABNgAAAAEAAAAAAAAEJdQEAAAAB2ZhY3RvcjEJAAE8AAAAAwUAAAABeAUAAAAFc2NhbGUJAAE2AAAAAQAAAAAAAAAAAQQAAAAHZmFjd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AAAAAAAACBQAAAAZpbnB1dDIAAAAAAAAAAAEAAAAAAAAPQkAAAAAAAAAAAAAEAAAABmlucHV0cwkABEwAAAACBQAAAAxzY2FsZWRJbnB1dDEJAARMAAAAAgUAAAAMc2NhbGVkSW5wdXQyBQAAAANuaWwEAAAACyR0MDIzODcyNDg1CQEAAAARZm9yd2FyZFBhc3NMYXllcjEAAAAEBQAAAAZpbnB1dHMFAAAADWxheWVyMVdlaWdodHMFAAAADGxheWVyMUJpYXNlcwIAAAAGTGF5ZXIxBAAAAAxsYXllcjFPdXRwdXQIBQAAAAskdDAyMzg3MjQ4NQAAAAJfMQQAAAALZGVidWdMYXllcjEIBQAAAAskdDAyMzg3MjQ4NQAAAAJfMgQAAAALJHQwMjQ5MDI1OTQJAQAAABFmb3J3YXJkUGFzc0xheWVyMgAAAAQFAAAADGxheWVyMU91dHB1dAUAAAANbGF5ZXIyV2VpZ2h0cwUAAAAMbGF5ZXIyQmlhc2VzAgAAAAZMYXllcjIEAAAADGxheWVyMk91dHB1dAgFAAAACyR0MDI0OTAyNTk0AAAAAl8xBAAAAAtkZWJ1Z0xheWVyMggFAAAACyR0MDI0OTAyNTk0AAAAAl8yCQAETgAAAAIJAAROAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAGcmVzdWx0BQAAAAxsYXllcjJPdXRwdXQFAAAAA25pbAUAAAALZGVidWdMYXllcjEFAAAAC2RlYnVnTGF5ZXIyAAAAAEKODyA=", "height": 3082465, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8cdRbGHsNfmgK7NCToFRuLF7cqYNwNiYjBcET9w8VCPR Next: AwRrLAxF5aEBEdiTUheEyimrHT9gq5mRd1ki8zFuTWZw Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let layer1Weights = [[600496, 600733], [414196, 414253]]
4+let layer1Weights = [[600497, 600733], [414197, 414253]]
55
6-let layer1Biases = [-259050, -635637]
6+let layer1Biases = [-259050, -635638]
77
88 let layer2Weights = [[832965, -897142]]
99
1010 let layer2Biases = [-381179]
1111
1212 func exp_approximation (x) = {
13- let e = toBigInt(2718281)
14- let factor1 = x
15- let factor2 = fraction((x * x), toBigInt((2 * 1000000)), toBigInt(1000000))
16- let factor3 = fraction(((x * x) * x), toBigInt(((6 * 1000000) * 1000000)), toBigInt(1000000))
13+ let scale = toBigInt(100000)
14+ let e = toBigInt(271828)
15+ let factor1 = fraction(x, scale, toBigInt(1))
16+ let factor2 = fraction(fraction((x * x), scale, toBigInt(1)), toBigInt((2 * 100000)), toBigInt(1))
17+ let factor3 = fraction(fraction(((x * x) * x), scale, toBigInt(1)), toBigInt(((6 * 100000) * 100000)), toBigInt(1))
1718 fraction((((toBigInt(1000000) + factor1) + factor2) + factor3), toBigInt(1), toBigInt(1))
1819 }
1920
2021
2122 func sigmoid (z,debugPrefix) = {
22- let base = toBigInt(1000000)
23+ let base = toBigInt(100000)
2324 let positiveZ = toBigInt(if ((0 > z))
2425 then -(z)
2526 else z)
3233 func forwardPassLayer1 (input,weights,biases,debugPrefix) = {
3334 let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0])
3435 let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1])
35- let $t015111557 = sigmoid(sum0, "Layer1N0")
36- let debug0 = $t015111557._1
37- let sig0 = $t015111557._2
38- let $t015621608 = sigmoid(sum1, "Layer1N1")
39- let debug1 = $t015621608._1
40- let sig1 = $t015621608._2
36+ let $t017241770 = sigmoid(sum0, "Layer1N0")
37+ let debug0 = $t017241770._1
38+ let sig0 = $t017241770._2
39+ let $t017751821 = sigmoid(sum1, "Layer1N1")
40+ let debug1 = $t017751821._1
41+ let sig1 = $t017751821._2
4142 $Tuple2([sig0, sig1], (debug0 ++ debug1))
4243 }
4344
4445
4546 func forwardPassLayer2 (input,weights,biases,debugPrefix) = {
4647 let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0])
47- let $t018771923 = sigmoid(sum0, "Layer2N0")
48- let debug0 = $t018771923._1
49- let sig0 = $t018771923._2
48+ let $t020902136 = sigmoid(sum0, "Layer2N0")
49+ let debug0 = $t020902136._1
50+ let sig0 = $t020902136._2
5051 $Tuple2(sig0, debug0)
5152 }
5253
6061 then 1000000
6162 else 0
6263 let inputs = [scaledInput1, scaledInput2]
63- let $t021742272 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
64- let layer1Output = $t021742272._1
65- let debugLayer1 = $t021742272._2
66- let $t022772381 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
67- let layer2Output = $t022772381._1
68- let debugLayer2 = $t022772381._2
64+ let $t023872485 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
65+ let layer1Output = $t023872485._1
66+ let debugLayer1 = $t023872485._2
67+ let $t024902594 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
68+ let layer2Output = $t024902594._1
69+ let debugLayer2 = $t024902594._2
6970 (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2)
7071 }
7172
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let layer1Weights = [[600496, 600733], [414196, 414253]]
4+let layer1Weights = [[600497, 600733], [414197, 414253]]
55
6-let layer1Biases = [-259050, -635637]
6+let layer1Biases = [-259050, -635638]
77
88 let layer2Weights = [[832965, -897142]]
99
1010 let layer2Biases = [-381179]
1111
1212 func exp_approximation (x) = {
13- let e = toBigInt(2718281)
14- let factor1 = x
15- let factor2 = fraction((x * x), toBigInt((2 * 1000000)), toBigInt(1000000))
16- let factor3 = fraction(((x * x) * x), toBigInt(((6 * 1000000) * 1000000)), toBigInt(1000000))
13+ let scale = toBigInt(100000)
14+ let e = toBigInt(271828)
15+ let factor1 = fraction(x, scale, toBigInt(1))
16+ let factor2 = fraction(fraction((x * x), scale, toBigInt(1)), toBigInt((2 * 100000)), toBigInt(1))
17+ let factor3 = fraction(fraction(((x * x) * x), scale, toBigInt(1)), toBigInt(((6 * 100000) * 100000)), toBigInt(1))
1718 fraction((((toBigInt(1000000) + factor1) + factor2) + factor3), toBigInt(1), toBigInt(1))
1819 }
1920
2021
2122 func sigmoid (z,debugPrefix) = {
22- let base = toBigInt(1000000)
23+ let base = toBigInt(100000)
2324 let positiveZ = toBigInt(if ((0 > z))
2425 then -(z)
2526 else z)
2627 let expValue = exp_approximation(positiveZ)
2728 let sigValue = fraction(base, (base + expValue), toBigInt(1))
2829 $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), toInt(positiveZ)), IntegerEntry((debugPrefix + "expValue"), toInt(expValue)), IntegerEntry((debugPrefix + "sigValue"), toInt(sigValue))], toInt(sigValue))
2930 }
3031
3132
3233 func forwardPassLayer1 (input,weights,biases,debugPrefix) = {
3334 let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0])
3435 let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1])
35- let $t015111557 = sigmoid(sum0, "Layer1N0")
36- let debug0 = $t015111557._1
37- let sig0 = $t015111557._2
38- let $t015621608 = sigmoid(sum1, "Layer1N1")
39- let debug1 = $t015621608._1
40- let sig1 = $t015621608._2
36+ let $t017241770 = sigmoid(sum0, "Layer1N0")
37+ let debug0 = $t017241770._1
38+ let sig0 = $t017241770._2
39+ let $t017751821 = sigmoid(sum1, "Layer1N1")
40+ let debug1 = $t017751821._1
41+ let sig1 = $t017751821._2
4142 $Tuple2([sig0, sig1], (debug0 ++ debug1))
4243 }
4344
4445
4546 func forwardPassLayer2 (input,weights,biases,debugPrefix) = {
4647 let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0])
47- let $t018771923 = sigmoid(sum0, "Layer2N0")
48- let debug0 = $t018771923._1
49- let sig0 = $t018771923._2
48+ let $t020902136 = sigmoid(sum0, "Layer2N0")
49+ let debug0 = $t020902136._1
50+ let sig0 = $t020902136._2
5051 $Tuple2(sig0, debug0)
5152 }
5253
5354
5455 @Callable(i)
5556 func predict (input1,input2) = {
5657 let scaledInput1 = if ((input1 == 1))
5758 then 1000000
5859 else 0
5960 let scaledInput2 = if ((input2 == 1))
6061 then 1000000
6162 else 0
6263 let inputs = [scaledInput1, scaledInput2]
63- let $t021742272 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
64- let layer1Output = $t021742272._1
65- let debugLayer1 = $t021742272._2
66- let $t022772381 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
67- let layer2Output = $t022772381._1
68- let debugLayer2 = $t022772381._2
64+ let $t023872485 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1")
65+ let layer1Output = $t023872485._1
66+ let debugLayer1 = $t023872485._2
67+ let $t024902594 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2")
68+ let layer2Output = $t024902594._1
69+ let debugLayer2 = $t024902594._2
6970 (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2)
7071 }
7172
7273

github/deemru/w8io/169f3d6 
32.41 ms