tx · 5iNUFVUiuLxLyD9zsZtxLmY1BS5THCkkmFMT6kNw969S 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.05.24 17:59 [3120241] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "5iNUFVUiuLxLyD9zsZtxLmY1BS5THCkkmFMT6kNw969S", "fee": 1000000, "feeAssetId": null, "timestamp": 1716562750825, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "5M6rTHi4g7gfyNcQVYJcP6UtgzaUtjxtoXuqSZp8rjWdq5VzzLk4cbBeXQHxy9FuvpZPTU15mMbp6JJvbMPrknHJ" ], "script": "base64:BwIICAISBAoCAQEHAA93ZWlnaHRzX2xheWVyXzEJAMwIAgkAzAgCAJLVAwkAzAgCAKnVAwUDbmlsCQDMCAIJAMwIAgDMwwIJAMwIAgDRwwIFA25pbAUDbmlsAA5iaWFzZXNfbGF5ZXJfMQkAzAgCAM+1/v///////wEJAMwIAgC0j/z///////8BBQNuaWwAD3dlaWdodHNfbGF5ZXJfMgkAzAgCCQDMCAIA4YoFCQDMCAIAjsP6////////AQUDbmlsBQNuaWwADmJpYXNlc19sYXllcl8yCQDMCAIAmtb9////////AQUDbmlsAQ5saW5lYXJfZm9yd2FyZAMFaW5wdXQHd2VpZ2h0cwZiaWFzZXMEDXdlaWdodGVkX3N1bTEJAGQCCQBpAgkAZAIJAGgCCQCRAwIFBWlucHV0AAAJAJEDAgkAkQMCBQd3ZWlnaHRzAAAAAAkAaAIJAJEDAgUFaW5wdXQAAQkAkQMCCQCRAwIFB3dlaWdodHMAAAABAJBOCQCRAwIFBmJpYXNlcwAABA13ZWlnaHRlZF9zdW0yCQBkAgkAaQIJAGQCCQBoAgkAkQMCBQVpbnB1dAAACQ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VyXzIAAAQCYTIJAQdzaWdtb2lkAQUCejIEBnJlc3VsdAkAaQIFAmEyAJBOBAhkZWJ1Z196MgkBDEludGVnZXJFbnRyeQICCGRlYnVnX3oyBQJ6MgQIZGVidWdfYTIJAQxJbnRlZ2VyRW50cnkCAghkZWJ1Z19hMgUCYTIEDGRlYnVnX3Jlc3VsdAkBDEludGVnZXJFbnRyeQICDGRlYnVnX3Jlc3VsdAUGcmVzdWx0CQCUCgIJAMwIAgUKZGVidWdfejFfMQkAzAgCBQpkZWJ1Z196MV8yCQDMCAIFCmRlYnVnX2ExXzEJAMwIAgUKZGVidWdfYTFfMgkAzAgCBQhkZWJ1Z196MgkAzAgCBQhkZWJ1Z19hMgkAzAgCBQxkZWJ1Z19yZXN1bHQFA25pbAUGcmVzdWx0AIn6qtg=", "height": 3120241, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EPzQDj6V1WSZyt31d5JN4yQdfxqisDnUmXHEcK9HZnRU Next: CSKB8iCwwXfruTvzLC9tm5jdhrri1eMoeLApwdfSEHCE Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | - | func relu (input) = { | |
20 | - | let out1 = if ((input[0] > 0)) | |
21 | - | then input[0] | |
22 | - | else 0 | |
23 | - | let out2 = if ((input[1] > 0)) | |
24 | - | then input[1] | |
25 | - | else 0 | |
26 | - | [out1, out2] | |
27 | - | } | |
28 | - | ||
29 | - | ||
30 | 19 | func sigmoid (input) = if ((-10000 > input)) | |
31 | 20 | then 0 | |
32 | 21 | else if ((input > 10000)) | |
34 | 23 | else (5000 + (input / 2)) | |
35 | 24 | ||
36 | 25 | ||
26 | + | func sigmoid_activation (inputs) = [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
27 | + | ||
28 | + | ||
37 | 29 | @Callable(i) | |
38 | 30 | func predict (x1,x2) = { | |
39 | 31 | let inputs = [(x1 * 10000), (x2 * 10000)] | |
40 | 32 | let z1 = linear_forward(inputs, weights_layer_1, biases_layer_1) | |
41 | - | let a1 = | |
33 | + | let a1 = sigmoid_activation(z1) | |
42 | 34 | let debug_z1_1 = IntegerEntry("debug_z1_1", z1[0]) | |
43 | 35 | let debug_z1_2 = IntegerEntry("debug_z1_2", z1[1]) | |
44 | 36 | let debug_a1_1 = IntegerEntry("debug_a1_1", a1[0]) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let weights_layer_1 = [[60050, 60073], [41420, 41425]] | |
5 | 5 | ||
6 | 6 | let biases_layer_1 = [-25905, -63564] | |
7 | 7 | ||
8 | 8 | let weights_layer_2 = [[83297, -89714]] | |
9 | 9 | ||
10 | 10 | let biases_layer_2 = [-38118] | |
11 | 11 | ||
12 | 12 | func linear_forward (input,weights,biases) = { | |
13 | 13 | let weighted_sum1 = ((((input[0] * weights[0][0]) + (input[1] * weights[0][1])) / 10000) + biases[0]) | |
14 | 14 | let weighted_sum2 = ((((input[0] * weights[1][0]) + (input[1] * weights[1][1])) / 10000) + biases[1]) | |
15 | 15 | [weighted_sum1, weighted_sum2] | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | - | func relu (input) = { | |
20 | - | let out1 = if ((input[0] > 0)) | |
21 | - | then input[0] | |
22 | - | else 0 | |
23 | - | let out2 = if ((input[1] > 0)) | |
24 | - | then input[1] | |
25 | - | else 0 | |
26 | - | [out1, out2] | |
27 | - | } | |
28 | - | ||
29 | - | ||
30 | 19 | func sigmoid (input) = if ((-10000 > input)) | |
31 | 20 | then 0 | |
32 | 21 | else if ((input > 10000)) | |
33 | 22 | then 10000 | |
34 | 23 | else (5000 + (input / 2)) | |
35 | 24 | ||
36 | 25 | ||
26 | + | func sigmoid_activation (inputs) = [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
27 | + | ||
28 | + | ||
37 | 29 | @Callable(i) | |
38 | 30 | func predict (x1,x2) = { | |
39 | 31 | let inputs = [(x1 * 10000), (x2 * 10000)] | |
40 | 32 | let z1 = linear_forward(inputs, weights_layer_1, biases_layer_1) | |
41 | - | let a1 = | |
33 | + | let a1 = sigmoid_activation(z1) | |
42 | 34 | let debug_z1_1 = IntegerEntry("debug_z1_1", z1[0]) | |
43 | 35 | let debug_z1_2 = IntegerEntry("debug_z1_2", z1[1]) | |
44 | 36 | let debug_a1_1 = IntegerEntry("debug_a1_1", a1[0]) | |
45 | 37 | let debug_a1_2 = IntegerEntry("debug_a1_2", a1[1]) | |
46 | 38 | let z2 = ((((a1[0] * weights_layer_2[0][0]) + (a1[1] * weights_layer_2[0][1])) / 10000) + biases_layer_2[0]) | |
47 | 39 | let a2 = sigmoid(z2) | |
48 | 40 | let result = (a2 / 10000) | |
49 | 41 | let debug_z2 = IntegerEntry("debug_z2", z2) | |
50 | 42 | let debug_a2 = IntegerEntry("debug_a2", a2) | |
51 | 43 | let debug_result = IntegerEntry("debug_result", result) | |
52 | 44 | $Tuple2([debug_z1_1, debug_z1_2, debug_a1_1, debug_a1_2, debug_z2, debug_a2, debug_result], result) | |
53 | 45 | } | |
54 | 46 | ||
55 | 47 |
github/deemru/w8io/169f3d6 31.25 ms ◑