tx · 6sK5SDfsLBqsGfy4qjtYGMKo72xqzbCSDcxVnRpEtrLn 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.05.04 12:27 [3091200] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "6sK5SDfsLBqsGfy4qjtYGMKo72xqzbCSDcxVnRpEtrLn", "fee": 1000000, "feeAssetId": null, "timestamp": 1714814861757, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "3cCDQznVYEzXzQ696up9y3JgnMHcGSFm16LG5vxGbPLXMn3pmFtchv1PXs6BNDsuU29kr39m4qUgprdPirXLFPaV" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAgAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAAABGQCQAETAAAAAIA////////5cIFAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAAj4IJAARMAAAAAgD///////9wfgUAAAADbmlsCQAETAAAAAIJAARMAAAAAgAAAAAAAAANvQkABEwAAAACAP////////JYBQAAAANuaWwJAARMAAAAAgkABEwAAAACAP///////2Q4CQAETAAAAAIAAAAAAAAAm8gFAAAAA25pbAUAAAADbmlsAAAAAAxsYXllcjFCaWFzZXMJAARMAAAAAgAAAAAAAABJHwkABEwAAAACAP//////////CQAETAAAAAIAAAAAAAAAcZUJAARMAAAAAgAAAAAAAAAAAAUAAAADbmlsAAAAAA1sYXllcjJXZWlnaHRzCQAETAAAAAIJAARMAAAAAgD////////RggkABEwAAAACAAAAAAAAAPtmCQAETAAAAAIA////////lusJAARMAAAAAgAAAAAAAAC9BwUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP///////+UnBQAAAANuaWwBAAAABHJ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N0AAAAAgUAAAAGaW5wdXRzCQABkQAAAAIFAAAADWxheWVyMVdlaWdodHMAAAAAAAAAAAIJAAGRAAAAAgUAAAAMbGF5ZXIxQmlhc2VzAAAAAAAAAAACBAAAAANkcDQJAABkAAAAAgkBAAAACmRvdFByb2R1Y3QAAAACBQAAAAZpbnB1dHMJAAGRAAAAAgUAAAANbGF5ZXIxV2VpZ2h0cwAAAAAAAAAAAwkAAZEAAAACBQAAAAxsYXllcjFCaWFzZXMAAAAAAAAAAAMEAAAADWxheWVyMVJlc3VsdHMJAARMAAAAAgkBAAAABHJlbHUAAAABBQAAAANkcDEJAARMAAAAAgkBAAAABHJlbHUAAAABBQAAAANkcDIJAARMAAAAAgkBAAAABHJlbHUAAAABBQAAAANkcDMJAARMAAAAAgkBAAAABHJlbHUAAAABBQAAAANkcDQFAAAAA25pbAQAAAAIZHBMYXllcjIJAABkAAAAAgkBAAAACmRvdFByb2R1Y3QAAAACBQAAAA1sYXllcjFSZXN1bHRzCQABkQAAAAIFAAAADWxheWVyMldlaWdodHMAAAAAAAAAAAAJAAGRAAAAAgUAAAAMbGF5ZXIyQmlhc2VzAAAAAAAAAAAACQEAAAAOc2lnbW9pZF9hcHByb3gAAAABBQAAAAhkcExheWVyMgAAAAEAAAABaQEAAAAHcHJlZGljdAAAAAIAAAAGaW5wdXQxAAAABmlucHV0MgQAAAAGaW5wdXRzCQAETAAAAAIFAAAABmlucHV0MQkABEwAAAACBQAAAAZpbnB1dDIFAAAAA25pbAQAAAAKcHJlZGljdGlvbgkBAAAAC2ZlZWRmb3J3YXJkAAAAAQUAAAAGaW5wdXRzCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAApwcmVkaWN0aW9uBQAAAApwcmVkaWN0aW9uBQAAAANuaWwAAAAAvle2sQ==", "height": 3091200, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FZharDfu9u3yURdpNVPoqVoSWuAJo4VBm5dPLS1sNtbM Next: 9o2vqzbv5JjJKboqkHfGhnn2XCjoXwLe8EaH4ffdKaSu Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[ | |
4 | + | let layer1Weights = [[4496, -6718], [36738, -36738], [3517, -3496], [-39880, 39880]] | |
5 | 5 | ||
6 | - | let layer1Biases = [ | |
6 | + | let layer1Biases = [18719, -1, 29077, 0] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[-11902, 64358, -26901, 48391]] | |
9 | 9 | ||
10 | - | let layer2Biases = [- | |
10 | + | let layer2Biases = [-6873] | |
11 | 11 | ||
12 | 12 | func relu (x) = if ((x > 0)) | |
13 | 13 | then x | |
33 | 33 | else 10000 | |
34 | 34 | ||
35 | 35 | ||
36 | - | func dotProduct (v1,v2) = { | |
37 | - | let sum1 = ((v1[0] * v2[0]) / 10000) | |
38 | - | let sum2 = ((v1[1] * v2[1]) / 10000) | |
39 | - | (sum1 + sum2) | |
40 | - | } | |
36 | + | func dotProduct (v1,v2) = (((v1[0] * v2[0]) + (v1[1] * v2[1])) / 10000) | |
41 | 37 | ||
42 | 38 | ||
43 | 39 | func feedforward (inputs) = { | |
44 | - | let dp1 = dotProduct(inputs, layer1Weights[0]) | |
45 | - | let dp2 = dotProduct(inputs, layer1Weights[1]) | |
46 | - | let layer1Result1 = sigmoid_approx((dp1 + layer1Biases[0])) | |
47 | - | let layer1Result2 = sigmoid_approx((dp2 + layer1Biases[1])) | |
48 | - | let layer2Inputs = [layer1Result1, layer1Result2] | |
49 | - | let dp3 = dotProduct(layer2Inputs, layer2Weights[0]) | |
50 | - | let output = sigmoid_approx((dp3 + layer2Biases[0])) | |
51 | - | $Tuple6(output, dp1, dp2, layer1Result1, layer1Result2, dp3) | |
40 | + | let dp1 = (dotProduct(inputs, layer1Weights[0]) + layer1Biases[0]) | |
41 | + | let dp2 = (dotProduct(inputs, layer1Weights[1]) + layer1Biases[1]) | |
42 | + | let dp3 = (dotProduct(inputs, layer1Weights[2]) + layer1Biases[2]) | |
43 | + | let dp4 = (dotProduct(inputs, layer1Weights[3]) + layer1Biases[3]) | |
44 | + | let layer1Results = [relu(dp1), relu(dp2), relu(dp3), relu(dp4)] | |
45 | + | let dpLayer2 = (dotProduct(layer1Results, layer2Weights[0]) + layer2Biases[0]) | |
46 | + | sigmoid_approx(dpLayer2) | |
52 | 47 | } | |
53 | 48 | ||
54 | 49 | ||
55 | 50 | @Callable(i) | |
56 | 51 | func predict (input1,input2) = { | |
57 | 52 | let inputs = [input1, input2] | |
58 | - | let $t015191602 = feedforward(inputs) | |
59 | - | let prediction = $t015191602._1 | |
60 | - | let dp1 = $t015191602._2 | |
61 | - | let dp2 = $t015191602._3 | |
62 | - | let layer1Result1 = $t015191602._4 | |
63 | - | let layer1Result2 = $t015191602._5 | |
64 | - | let dp3 = $t015191602._6 | |
65 | - | [IntegerEntry("prediction", prediction), IntegerEntry("dotProduct1", dp1), IntegerEntry("dotProduct2", dp2), IntegerEntry("layer1Result1", layer1Result1), IntegerEntry("layer1Result2", layer1Result2), IntegerEntry("dotProduct3", dp3)] | |
53 | + | let prediction = feedforward(inputs) | |
54 | + | [IntegerEntry("prediction", prediction)] | |
66 | 55 | } | |
67 | 56 | ||
68 | 57 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[ | |
4 | + | let layer1Weights = [[4496, -6718], [36738, -36738], [3517, -3496], [-39880, 39880]] | |
5 | 5 | ||
6 | - | let layer1Biases = [ | |
6 | + | let layer1Biases = [18719, -1, 29077, 0] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[-11902, 64358, -26901, 48391]] | |
9 | 9 | ||
10 | - | let layer2Biases = [- | |
10 | + | let layer2Biases = [-6873] | |
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 ((-4000 > x)) | |
18 | 18 | then 0 | |
19 | 19 | else if ((-2000 > x)) | |
20 | 20 | then 1000 | |
21 | 21 | else if ((-1000 > x)) | |
22 | 22 | then 2000 | |
23 | 23 | else if ((0 > x)) | |
24 | 24 | then 3000 | |
25 | 25 | else if ((1000 > x)) | |
26 | 26 | then 5000 | |
27 | 27 | else if ((2000 > x)) | |
28 | 28 | then 7000 | |
29 | 29 | else if ((3000 > x)) | |
30 | 30 | then 8000 | |
31 | 31 | else if ((4000 > x)) | |
32 | 32 | then 9000 | |
33 | 33 | else 10000 | |
34 | 34 | ||
35 | 35 | ||
36 | - | func dotProduct (v1,v2) = { | |
37 | - | let sum1 = ((v1[0] * v2[0]) / 10000) | |
38 | - | let sum2 = ((v1[1] * v2[1]) / 10000) | |
39 | - | (sum1 + sum2) | |
40 | - | } | |
36 | + | func dotProduct (v1,v2) = (((v1[0] * v2[0]) + (v1[1] * v2[1])) / 10000) | |
41 | 37 | ||
42 | 38 | ||
43 | 39 | func feedforward (inputs) = { | |
44 | - | let dp1 = dotProduct(inputs, layer1Weights[0]) | |
45 | - | let dp2 = dotProduct(inputs, layer1Weights[1]) | |
46 | - | let layer1Result1 = sigmoid_approx((dp1 + layer1Biases[0])) | |
47 | - | let layer1Result2 = sigmoid_approx((dp2 + layer1Biases[1])) | |
48 | - | let layer2Inputs = [layer1Result1, layer1Result2] | |
49 | - | let dp3 = dotProduct(layer2Inputs, layer2Weights[0]) | |
50 | - | let output = sigmoid_approx((dp3 + layer2Biases[0])) | |
51 | - | $Tuple6(output, dp1, dp2, layer1Result1, layer1Result2, dp3) | |
40 | + | let dp1 = (dotProduct(inputs, layer1Weights[0]) + layer1Biases[0]) | |
41 | + | let dp2 = (dotProduct(inputs, layer1Weights[1]) + layer1Biases[1]) | |
42 | + | let dp3 = (dotProduct(inputs, layer1Weights[2]) + layer1Biases[2]) | |
43 | + | let dp4 = (dotProduct(inputs, layer1Weights[3]) + layer1Biases[3]) | |
44 | + | let layer1Results = [relu(dp1), relu(dp2), relu(dp3), relu(dp4)] | |
45 | + | let dpLayer2 = (dotProduct(layer1Results, layer2Weights[0]) + layer2Biases[0]) | |
46 | + | sigmoid_approx(dpLayer2) | |
52 | 47 | } | |
53 | 48 | ||
54 | 49 | ||
55 | 50 | @Callable(i) | |
56 | 51 | func predict (input1,input2) = { | |
57 | 52 | let inputs = [input1, input2] | |
58 | - | let $t015191602 = feedforward(inputs) | |
59 | - | let prediction = $t015191602._1 | |
60 | - | let dp1 = $t015191602._2 | |
61 | - | let dp2 = $t015191602._3 | |
62 | - | let layer1Result1 = $t015191602._4 | |
63 | - | let layer1Result2 = $t015191602._5 | |
64 | - | let dp3 = $t015191602._6 | |
65 | - | [IntegerEntry("prediction", prediction), IntegerEntry("dotProduct1", dp1), IntegerEntry("dotProduct2", dp2), IntegerEntry("layer1Result1", layer1Result1), IntegerEntry("layer1Result2", layer1Result2), IntegerEntry("dotProduct3", dp3)] | |
53 | + | let prediction = feedforward(inputs) | |
54 | + | [IntegerEntry("prediction", prediction)] | |
66 | 55 | } | |
67 | 56 | ||
68 | 57 |
github/deemru/w8io/6500d08 26.56 ms ◑