tx · BgJxwNe2CWQhu6e8YQTPKDw8KySzHCR28WNTUgBG6V1v 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.05.04 11:55 [3091169] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "BgJxwNe2CWQhu6e8YQTPKDw8KySzHCR28WNTUgBG6V1v", "fee": 1000000, "feeAssetId": null, "timestamp": 1714812889556, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "gQgzUjYgdxMUtGWt849niJRfTP5GC1sdDA6fWCHVMhaSeLk5YgEwHpAsJ173Q4qzko5SeKZLySMFqQffSxmdt2g" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAgAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmwCQAETAAAAAIAAAAAAAAJKp0FAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcYJAARMAAAAAgD///////JPiwUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAABHJlbHUAAAABAAAAAXgDCQAAZgAAAAIFAAAAAXgAAAAAAAAAAAAFAAAAAXgAAAAAAAAAAAABAAAADnNpZ21vaWRfYXBwcm94AAAAAQAAAAF4AwkAAGYAAAACAP///////+iQBQAAAAF4AAAAAAAAAAH0AwkAAGYAAAACAP////////BgBQAAAAF4AAAAAAAAAAPoAwkA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VjdDIFAAAAA2RwMgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAANbGF5ZXIxUmVzdWx0MQUAAAANbGF5ZXIxUmVzdWx0MQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAANbGF5ZXIxUmVzdWx0MgUAAAANbGF5ZXIxUmVzdWx0MgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAALZG90UHJvZHVjdDMFAAAAA2RwMwUAAAADbmlsAAAAAFZpX6Q=", "height": 3091169, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HQYVbfLQm6q7Et1MgYX3SjNGapVKGrrmzK5duBWV2fLi Next: 8W4DpmGZprxE3grV984a9nnSJ6PF59WrUbFKJyDihWDj Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | else 0 | |
15 | 15 | ||
16 | 16 | ||
17 | - | func sigmoid_approx (x) = if ((-5000 > x)) | |
18 | - | then 0 | |
19 | - | else if ((0 > x)) | |
20 | - | then 5000 | |
21 | - | else if ((5000 > x)) | |
22 | - | then 9500 | |
23 | - | else 10000 | |
17 | + | func sigmoid_approx (x) = if ((-6000 > x)) | |
18 | + | then 500 | |
19 | + | else if ((-4000 > x)) | |
20 | + | then 1000 | |
21 | + | else if ((-2000 > x)) | |
22 | + | then 2000 | |
23 | + | else if ((0 > x)) | |
24 | + | then 3000 | |
25 | + | else if ((2000 > x)) | |
26 | + | then 5000 | |
27 | + | else if ((4000 > x)) | |
28 | + | then 7000 | |
29 | + | else if ((6000 > x)) | |
30 | + | then 8000 | |
31 | + | else if ((8000 > x)) | |
32 | + | then 9000 | |
33 | + | else 9500 | |
24 | 34 | ||
25 | 35 | ||
26 | 36 | func dotProduct (v1,v2) = { | |
45 | 55 | @Callable(i) | |
46 | 56 | func predict (input1,input2) = { | |
47 | 57 | let inputs = [input1, input2] | |
48 | - | let $ | |
49 | - | let prediction = $ | |
50 | - | let dp1 = $ | |
51 | - | let dp2 = $ | |
52 | - | let layer1Result1 = $ | |
53 | - | let layer1Result2 = $ | |
54 | - | let dp3 = $ | |
58 | + | let $t016011684 = feedforward(inputs) | |
59 | + | let prediction = $t016011684._1 | |
60 | + | let dp1 = $t016011684._2 | |
61 | + | let dp2 = $t016011684._3 | |
62 | + | let layer1Result1 = $t016011684._4 | |
63 | + | let layer1Result2 = $t016011684._5 | |
64 | + | let dp3 = $t016011684._6 | |
55 | 65 | [IntegerEntry("prediction", prediction), IntegerEntry("dotProduct1", dp1), IntegerEntry("dotProduct2", dp2), IntegerEntry("layer1Result1", layer1Result1), IntegerEntry("layer1Result2", layer1Result2), IntegerEntry("dotProduct3", dp3)] | |
56 | 66 | } | |
57 | 67 |
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 | - | func sigmoid_approx (x) = if ((-5000 > x)) | |
18 | - | then 0 | |
19 | - | else if ((0 > x)) | |
20 | - | then 5000 | |
21 | - | else if ((5000 > x)) | |
22 | - | then 9500 | |
23 | - | else 10000 | |
17 | + | func sigmoid_approx (x) = if ((-6000 > x)) | |
18 | + | then 500 | |
19 | + | else if ((-4000 > x)) | |
20 | + | then 1000 | |
21 | + | else if ((-2000 > x)) | |
22 | + | then 2000 | |
23 | + | else if ((0 > x)) | |
24 | + | then 3000 | |
25 | + | else if ((2000 > x)) | |
26 | + | then 5000 | |
27 | + | else if ((4000 > x)) | |
28 | + | then 7000 | |
29 | + | else if ((6000 > x)) | |
30 | + | then 8000 | |
31 | + | else if ((8000 > x)) | |
32 | + | then 9000 | |
33 | + | else 9500 | |
24 | 34 | ||
25 | 35 | ||
26 | 36 | func dotProduct (v1,v2) = { | |
27 | 37 | let sum1 = ((v1[0] * v2[0]) / 10000) | |
28 | 38 | let sum2 = ((v1[1] * v2[1]) / 10000) | |
29 | 39 | (sum1 + sum2) | |
30 | 40 | } | |
31 | 41 | ||
32 | 42 | ||
33 | 43 | func feedforward (inputs) = { | |
34 | 44 | let dp1 = dotProduct(inputs, layer1Weights[0]) | |
35 | 45 | let dp2 = dotProduct(inputs, layer1Weights[1]) | |
36 | 46 | let layer1Result1 = sigmoid_approx((dp1 + layer1Biases[0])) | |
37 | 47 | let layer1Result2 = sigmoid_approx((dp2 + layer1Biases[1])) | |
38 | 48 | let layer2Inputs = [layer1Result1, layer1Result2] | |
39 | 49 | let dp3 = dotProduct(layer2Inputs, layer2Weights[0]) | |
40 | 50 | let output = sigmoid_approx((dp3 + layer2Biases[0])) | |
41 | 51 | $Tuple6(output, dp1, dp2, layer1Result1, layer1Result2, dp3) | |
42 | 52 | } | |
43 | 53 | ||
44 | 54 | ||
45 | 55 | @Callable(i) | |
46 | 56 | func predict (input1,input2) = { | |
47 | 57 | let inputs = [input1, input2] | |
48 | - | let $ | |
49 | - | let prediction = $ | |
50 | - | let dp1 = $ | |
51 | - | let dp2 = $ | |
52 | - | let layer1Result1 = $ | |
53 | - | let layer1Result2 = $ | |
54 | - | let dp3 = $ | |
58 | + | let $t016011684 = feedforward(inputs) | |
59 | + | let prediction = $t016011684._1 | |
60 | + | let dp1 = $t016011684._2 | |
61 | + | let dp2 = $t016011684._3 | |
62 | + | let layer1Result1 = $t016011684._4 | |
63 | + | let layer1Result2 = $t016011684._5 | |
64 | + | let dp3 = $t016011684._6 | |
55 | 65 | [IntegerEntry("prediction", prediction), IntegerEntry("dotProduct1", dp1), IntegerEntry("dotProduct2", dp2), IntegerEntry("layer1Result1", layer1Result1), IntegerEntry("layer1Result2", layer1Result2), IntegerEntry("dotProduct3", dp3)] | |
56 | 66 | } | |
57 | 67 | ||
58 | 68 |
github/deemru/w8io/169f3d6 28.19 ms ◑