tx · 5p1i9rB1wwx7r6VVHGgpXzpPR7BQPZfUGxn9dP7VXG7j 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.06.09 18:39 [3143388] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "5p1i9rB1wwx7r6VVHGgpXzpPR7BQPZfUGxn9dP7VXG7j", "fee": 1000000, "feeAssetId": null, "timestamp": 1717947626932, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "MnQrSZ3e2oogHwznx1WugtsXYRQBhwzB3A4DCV1ozmhKwjNELR7HGHVMfK7ZJH16JcS4oyDAmwknh8UGo612zvt" ], "script": "base64:BwIHCAISAwoBEQgAD3dlaWdodHNfbGF5ZXJfMQkAzAgCCQDMCAIAkdUDCQDMCAIAqdUDBQNuaWwJAMwIAgkAzAgCAMvDAgkAzAgCANHDAgUDbmlsBQNuaWwADmJpYXNlc19sYXllcl8xCQDMCAIAz7X+////////AQkAzAgCALWP/P///////wEFA25pbAAPd2VpZ2h0c19sYXllcl8yCQDMCAIJAMwIAgDgigUJAMwIAgCOw/r///////8BBQNuaWwFA25pbAAOYmlhc2VzX2xheWVyXzIJAMwIAgCb1v3///////8BBQNuaWwBEGxpbmVhcl9mb3J3YXJkXzEDBWlucHV0B3dlaWdodHMGYmlhc2VzBA13ZWlnaHRlZF9zdW0xCQBkAgkAaQIJAGQCCQBoAgkAkQMCBQVpbnB1dAAACQCRAwIJAJEDAgUHd2VpZ2h0cwAAAAAJAGgCCQCRAwIFBWlucHV0AAEJAJEDAgkAkQMCBQd3ZWlnaHRzAAAAAQCQTgkAkQMCBQZiaWFzZXMAAAQNd2VpZ2h0ZWRfc3VtMgkAZAIJAGkCCQBkAgkAaAIJAJEDAgUFaW5wdXQAAA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QMCBQZpbnB1dHMAAAUDbmlsCQDMCAIJAQdzaWdtb2lkAQkAkQMCBQZpbnB1dHMAAAkAzAgCCQEHc2lnbW9pZAEJAJEDAgUGaW5wdXRzAAEFA25pbAEBaQEHcHJlZGljdAEGaW5wdXRzBAl4MV9zY2FsZWQJAGgCCQCRAwIFBmlucHV0cwAAAJBOBAl4Ml9zY2FsZWQJAGgCCQCRAwIFBmlucHV0cwABAJBOBA1zY2FsZWRfaW5wdXRzCQDMCAIFCXgxX3NjYWxlZAkAzAgCBQl4Ml9zY2FsZWQFA25pbAQCejEJARBsaW5lYXJfZm9yd2FyZF8xAwUNc2NhbGVkX2lucHV0cwUPd2VpZ2h0c19sYXllcl8xBQ5iaWFzZXNfbGF5ZXJfMQQCYTEJARJzaWdtb2lkX2FjdGl2YXRpb24CBQJ6MQACBAJ6MgkBEGxpbmVhcl9mb3J3YXJkXzIDBQJhMQUPd2VpZ2h0c19sYXllcl8yBQ5iaWFzZXNfbGF5ZXJfMgQCYTIJARJzaWdtb2lkX2FjdGl2YXRpb24CBQJ6MgABBAdyZXN1bHQwCQCRAwIFAmEyAAAEDWRlYnVnX291dHB1dHMFA25pbAkAzggCCQDMCAIJAQxJbnRlZ2VyRW50cnkCAhFtb3ZlX3ByZWRpY3Rpb25fMAUHcmVzdWx0MAUDbmlsBQ1kZWJ1Z19vdXRwdXRzALWPX8w=", "height": 3143388, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: iLK3jGMDmDhi5uY8BqmpYMqtqM7TxFQTu1SRiWqQRvW Next: DYnXaheJEujNk48NpccmiJUvu9Ktv5oECHD7MeaRSt1d Diff:
Old | New | Differences | |
---|---|---|---|
43 | 43 | else 10000 | |
44 | 44 | ||
45 | 45 | ||
46 | - | func sigmoid_activation (inputs,num_outputs) = [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
46 | + | func sigmoid_activation (inputs,num_outputs) = if ((num_outputs == 1)) | |
47 | + | then [sigmoid(inputs[0])] | |
48 | + | else [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
47 | 49 | ||
48 | 50 | ||
49 | 51 | @Callable(i) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let weights_layer_1 = [[60049, 60073], [41419, 41425]] | |
5 | 5 | ||
6 | 6 | let biases_layer_1 = [-25905, -63563] | |
7 | 7 | ||
8 | 8 | let weights_layer_2 = [[83296, -89714]] | |
9 | 9 | ||
10 | 10 | let biases_layer_2 = [-38117] | |
11 | 11 | ||
12 | 12 | func linear_forward_1 (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 | 19 | func linear_forward_2 (input,weights,biases) = { | |
20 | 20 | let weighted_sum1 = ((((input[0] * weights[0][0]) + (input[1] * weights[0][1])) / 10000) + biases[0]) | |
21 | 21 | [weighted_sum1] | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func sigmoid (input) = if ((-80000 > input)) | |
26 | 26 | then 0 | |
27 | 27 | else if ((-60000 > input)) | |
28 | 28 | then fraction((input + 80000), 125, 10000) | |
29 | 29 | else if ((-40000 > input)) | |
30 | 30 | then fraction((input + 60000), 100, 10000) | |
31 | 31 | else if ((-20000 > input)) | |
32 | 32 | then fraction((input + 40000), 75, 10000) | |
33 | 33 | else if ((0 > input)) | |
34 | 34 | then fraction((input + 20000), 50, 10000) | |
35 | 35 | else if ((20000 > input)) | |
36 | 36 | then (fraction(input, 50, 10000) + 5000) | |
37 | 37 | else if ((40000 > input)) | |
38 | 38 | then (fraction((input - 20000), 75, 10000) + 7500) | |
39 | 39 | else if ((60000 > input)) | |
40 | 40 | then (fraction((input - 40000), 100, 10000) + 8750) | |
41 | 41 | else if ((80000 > input)) | |
42 | 42 | then (fraction((input - 60000), 125, 10000) + 9375) | |
43 | 43 | else 10000 | |
44 | 44 | ||
45 | 45 | ||
46 | - | func sigmoid_activation (inputs,num_outputs) = [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
46 | + | func sigmoid_activation (inputs,num_outputs) = if ((num_outputs == 1)) | |
47 | + | then [sigmoid(inputs[0])] | |
48 | + | else [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
47 | 49 | ||
48 | 50 | ||
49 | 51 | @Callable(i) | |
50 | 52 | func predict (inputs) = { | |
51 | 53 | let x1_scaled = (inputs[0] * 10000) | |
52 | 54 | let x2_scaled = (inputs[1] * 10000) | |
53 | 55 | let scaled_inputs = [x1_scaled, x2_scaled] | |
54 | 56 | let z1 = linear_forward_1(scaled_inputs, weights_layer_1, biases_layer_1) | |
55 | 57 | let a1 = sigmoid_activation(z1, 2) | |
56 | 58 | let z2 = linear_forward_2(a1, weights_layer_2, biases_layer_2) | |
57 | 59 | let a2 = sigmoid_activation(z2, 1) | |
58 | 60 | let result0 = a2[0] | |
59 | 61 | let debug_outputs = nil | |
60 | 62 | ([IntegerEntry("move_prediction_0", result0)] ++ debug_outputs) | |
61 | 63 | } | |
62 | 64 | ||
63 | 65 |
github/deemru/w8io/169f3d6 30.16 ms ◑