tx · HQYVbfLQm6q7Et1MgYX3SjNGapVKGrrmzK5duBWV2fLi
3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves
2024.05.04 11:47 [3091161] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{
"type": 13,
"id": "HQYVbfLQm6q7Et1MgYX3SjNGapVKGrrmzK5duBWV2fLi",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1714812492950,
"version": 2,
"chainId": 84,
"sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY",
"senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc",
"proofs": [
"2ZVGoA64vK9mEiXosJoWafczHnpCQRhkpGKQbYExvXnJTjB2JqrLXCuh9DVn7rXXmYJS7YSe5kbUr2WdfxkrcRm5"
],
"script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAgAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmwCQAETAAAAAIAAAAAAAAJKp0FAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcYJAARMAAAAAgD///////JPiwUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAABHJlbHUAAAABAAAAAXgDCQAAZgAAAAIFAAAAAXgAAAAAAAAAAAAFAAAAAXgAAAAAAAAAAAABAAAADnNpZ21vaWRfYXBwcm94AAAAAQAAAAF4AwkAAGYAAAACAP///////+x4BQAAAAF4AAAAAAAAAAAAAwkAAGYAAAACAAAAAAAAAAAABQAAAA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ABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAALZG90UHJvZHVjdDMFAAAAA2RwMwUAAAADbmlsAAAAAL0zdOk=",
"height": 3091161,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: CrFqEGY8DWvwsYq3yExJteW66i3hdNFg277CA3AXDGFm
Next: BgJxwNe2CWQhu6e8YQTPKDw8KySzHCR28WNTUgBG6V1v
Diff:
Old | New | | Differences |
---|
31 | 31 | | |
---|
32 | 32 | | |
---|
33 | 33 | | func feedforward (inputs) = { |
---|
34 | | - | let layer1Result1 = sigmoid_approx((dotProduct(inputs, layer1Weights[0]) + layer1Biases[0])) |
---|
35 | | - | let layer1Result2 = sigmoid_approx((dotProduct(inputs, layer1Weights[1]) + layer1Biases[1])) |
---|
| 34 | + | let dp1 = dotProduct(inputs, layer1Weights[0]) |
---|
| 35 | + | let dp2 = dotProduct(inputs, layer1Weights[1]) |
---|
| 36 | + | let layer1Result1 = sigmoid_approx((dp1 + layer1Biases[0])) |
---|
| 37 | + | let layer1Result2 = sigmoid_approx((dp2 + layer1Biases[1])) |
---|
36 | 38 | | let layer2Inputs = [layer1Result1, layer1Result2] |
---|
37 | | - | sigmoid_approx((dotProduct(layer2Inputs, layer2Weights[0]) + layer2Biases[0])) |
---|
| 39 | + | let dp3 = dotProduct(layer2Inputs, layer2Weights[0]) |
---|
| 40 | + | let output = sigmoid_approx((dp3 + layer2Biases[0])) |
---|
| 41 | + | $Tuple6(output, dp1, dp2, layer1Result1, layer1Result2, dp3) |
---|
38 | 42 | | } |
---|
39 | 43 | | |
---|
40 | 44 | | |
---|
41 | 45 | | @Callable(i) |
---|
42 | 46 | | func predict (input1,input2) = { |
---|
43 | 47 | | let inputs = [input1, input2] |
---|
44 | | - | let prediction = feedforward(inputs) |
---|
45 | | - | [IntegerEntry("prediction", prediction)] |
---|
| 48 | + | let $t014341517 = feedforward(inputs) |
---|
| 49 | + | let prediction = $t014341517._1 |
---|
| 50 | + | let dp1 = $t014341517._2 |
---|
| 51 | + | let dp2 = $t014341517._3 |
---|
| 52 | + | let layer1Result1 = $t014341517._4 |
---|
| 53 | + | let layer1Result2 = $t014341517._5 |
---|
| 54 | + | let dp3 = $t014341517._6 |
---|
| 55 | + | [IntegerEntry("prediction", prediction), IntegerEntry("dotProduct1", dp1), IntegerEntry("dotProduct2", dp2), IntegerEntry("layer1Result1", layer1Result1), IntegerEntry("layer1Result2", layer1Result2), IntegerEntry("dotProduct3", dp3)] |
---|
46 | 56 | | } |
---|
47 | 57 | | |
---|
48 | 58 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let layer1Weights = [[600496, 600733], [414197, 414253]] |
---|
5 | 5 | | |
---|
6 | 6 | | let layer1Biases = [-259050, -635637] |
---|
7 | 7 | | |
---|
8 | 8 | | let layer2Weights = [[832966, -897141]] |
---|
9 | 9 | | |
---|
10 | 10 | | let layer2Biases = [-381179] |
---|
11 | 11 | | |
---|
12 | 12 | | func relu (x) = if ((x > 0)) |
---|
13 | 13 | | then x |
---|
14 | 14 | | else 0 |
---|
15 | 15 | | |
---|
16 | 16 | | |
---|
17 | 17 | | func sigmoid_approx (x) = if ((-5000 > x)) |
---|
18 | 18 | | then 0 |
---|
19 | 19 | | else if ((0 > x)) |
---|
20 | 20 | | then 5000 |
---|
21 | 21 | | else if ((5000 > x)) |
---|
22 | 22 | | then 9500 |
---|
23 | 23 | | else 10000 |
---|
24 | 24 | | |
---|
25 | 25 | | |
---|
26 | 26 | | func dotProduct (v1,v2) = { |
---|
27 | 27 | | let sum1 = ((v1[0] * v2[0]) / 10000) |
---|
28 | 28 | | let sum2 = ((v1[1] * v2[1]) / 10000) |
---|
29 | 29 | | (sum1 + sum2) |
---|
30 | 30 | | } |
---|
31 | 31 | | |
---|
32 | 32 | | |
---|
33 | 33 | | func feedforward (inputs) = { |
---|
34 | | - | let layer1Result1 = sigmoid_approx((dotProduct(inputs, layer1Weights[0]) + layer1Biases[0])) |
---|
35 | | - | let layer1Result2 = sigmoid_approx((dotProduct(inputs, layer1Weights[1]) + layer1Biases[1])) |
---|
| 34 | + | let dp1 = dotProduct(inputs, layer1Weights[0]) |
---|
| 35 | + | let dp2 = dotProduct(inputs, layer1Weights[1]) |
---|
| 36 | + | let layer1Result1 = sigmoid_approx((dp1 + layer1Biases[0])) |
---|
| 37 | + | let layer1Result2 = sigmoid_approx((dp2 + layer1Biases[1])) |
---|
36 | 38 | | let layer2Inputs = [layer1Result1, layer1Result2] |
---|
37 | | - | sigmoid_approx((dotProduct(layer2Inputs, layer2Weights[0]) + layer2Biases[0])) |
---|
| 39 | + | let dp3 = dotProduct(layer2Inputs, layer2Weights[0]) |
---|
| 40 | + | let output = sigmoid_approx((dp3 + layer2Biases[0])) |
---|
| 41 | + | $Tuple6(output, dp1, dp2, layer1Result1, layer1Result2, dp3) |
---|
38 | 42 | | } |
---|
39 | 43 | | |
---|
40 | 44 | | |
---|
41 | 45 | | @Callable(i) |
---|
42 | 46 | | func predict (input1,input2) = { |
---|
43 | 47 | | let inputs = [input1, input2] |
---|
44 | | - | let prediction = feedforward(inputs) |
---|
45 | | - | [IntegerEntry("prediction", prediction)] |
---|
| 48 | + | let $t014341517 = feedforward(inputs) |
---|
| 49 | + | let prediction = $t014341517._1 |
---|
| 50 | + | let dp1 = $t014341517._2 |
---|
| 51 | + | let dp2 = $t014341517._3 |
---|
| 52 | + | let layer1Result1 = $t014341517._4 |
---|
| 53 | + | let layer1Result2 = $t014341517._5 |
---|
| 54 | + | let dp3 = $t014341517._6 |
---|
| 55 | + | [IntegerEntry("prediction", prediction), IntegerEntry("dotProduct1", dp1), IntegerEntry("dotProduct2", dp2), IntegerEntry("layer1Result1", layer1Result1), IntegerEntry("layer1Result2", layer1Result2), IntegerEntry("dotProduct3", dp3)] |
---|
46 | 56 | | } |
---|
47 | 57 | | |
---|
48 | 58 | | |
---|