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