tx · 5711d92xhrVacoLCGnr4ueRPQEShjH5WZkJkuy3oQGDY 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.06.10 00:49 [3143761] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "5711d92xhrVacoLCGnr4ueRPQEShjH5WZkJkuy3oQGDY", "fee": 1000000, "feeAssetId": null, "timestamp": 1717969794872, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "5PBgCCSkCL8SzBdPraCTX6MBYKGZTBNi1c3zY5kPKNzxQXsEJZLVabFMtgNLzzfWfniJqSwobKrJTFGjcFXXt7Eh" ], "script": "base64:BwIHCAISAwoBEQsAD3dlaWdodHNfbGF5ZXJfMQkAzAgCCQDMCAIAsKv6////////AQkAzAgCAI3mAwUDbmlsCQDMCAIJAMwIAgCOsfr///////8BCQDMCAIA94L8////////AQUDbmlsCQDMCAIJAMwIAgDJiP////////8BCQDMCAIAx/4GBQNuaWwJAMwIAgkAzAgCAJC0+////////wEJAMwIAgDgp/z///////8BBQNuaWwFA25pbAAOYmlhc2VzX2xheWVyXzEJAMwIAgCgt/7///////8BCQDMCAIA1bQBCQDMCAIA14z9////////AQkAzAgCAIeUAQUDbmlsAA93ZWlnaHRzX2xheWVyXzIJAMwIAgkAzAgCAJiw+////////wEJAMwIAgDBrwMJAMwIAgCTggQJAMwIAgDkpgIFA25pbAkAzAgCCQDMCAIAgpgECQDMCAIAmsL8////////AQkAzAgCAL2o/P///////wEJAMwIAgCt/P3///////8BBQNuaWwFA25pbAAOYmlhc2VzX2xheWVyXzIJAMwIAgCAif7///////8BCQDMCAIAiuYBBQNuaWwAD3dlaWdodHNfbGF5ZXJfMwkAzAgCCQDMCAIAzMX6////////AQkAzAgCAMXnBQUDbm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AnoxBAJ6MgkBEGxpbmVhcl9mb3J3YXJkXzIDBQJhMQUPd2VpZ2h0c19sYXllcl8yBQ5iaWFzZXNfbGF5ZXJfMgQCYTIJARJzaWdtb2lkX2FjdGl2YXRpb24BBQJ6MgQCejMJARBsaW5lYXJfZm9yd2FyZF8zAwUCYTIFD3dlaWdodHNfbGF5ZXJfMwUOYmlhc2VzX2xheWVyXzMEAmEzCQESc2lnbW9pZF9hY3RpdmF0aW9uAQUCejMEB3Jlc3VsdDAJAJEDAgUCYTMAAAQNZGVidWdfb3V0cHV0cwUDbmlsCQDOCAIJAMwIAgkBDEludGVnZXJFbnRyeQICEW1vdmVfcHJlZGljdGlvbl8wBQdyZXN1bHQwBQNuaWwFDWRlYnVnX291dHB1dHMA6KusYw==", "height": 3143761, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8Z98WBSbg5ME521Bx7gZ74ugVt4yCFseUCkB5daWEzqE Next: 8VVtUKLww8RFMZxyXTJzCbqcRAgJRfWJbWtuXA2dDDoU Diff:
Old | New | Differences | |
---|---|---|---|
56 | 56 | else 10000 | |
57 | 57 | ||
58 | 58 | ||
59 | - | func sigmoid_activation (inputs,num_outputs) = if ((num_outputs == 1)) | |
60 | - | then [sigmoid(inputs[0])] | |
61 | - | else [sigmoid(inputs[0]), sigmoid(inputs[1]), sigmoid(inputs[2]), sigmoid(inputs[3])] | |
59 | + | func sigmoid_activation (inputs) = { | |
60 | + | let num_outputs = size(inputs) | |
61 | + | if ((num_outputs == 1)) | |
62 | + | then [sigmoid(inputs[0])] | |
63 | + | else if ((num_outputs == 2)) | |
64 | + | then [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
65 | + | else [sigmoid(inputs[0]), sigmoid(inputs[1]), sigmoid(inputs[2]), sigmoid(inputs[3])] | |
66 | + | } | |
62 | 67 | ||
63 | 68 | ||
64 | 69 | @Callable(i) | |
67 | 72 | let x2_scaled = (inputs[1] * 10000) | |
68 | 73 | let scaled_inputs = [x1_scaled, x2_scaled] | |
69 | 74 | let z1 = linear_forward_1(scaled_inputs, weights_layer_1, biases_layer_1) | |
70 | - | let a1 = sigmoid_activation(z1 | |
75 | + | let a1 = sigmoid_activation(z1) | |
71 | 76 | let z2 = linear_forward_2(a1, weights_layer_2, biases_layer_2) | |
72 | - | let a2 = sigmoid_activation(z2 | |
77 | + | let a2 = sigmoid_activation(z2) | |
73 | 78 | let z3 = linear_forward_3(a2, weights_layer_3, biases_layer_3) | |
74 | - | let a3 = sigmoid_activation(z3 | |
79 | + | let a3 = sigmoid_activation(z3) | |
75 | 80 | let result0 = a3[0] | |
76 | 81 | let debug_outputs = nil | |
77 | 82 | ([IntegerEntry("move_prediction_0", result0)] ++ debug_outputs) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let weights_layer_1 = [[-92752, 62221], [-92018, -65161], [-15287, 114503], [-75248, -60448]] | |
5 | 5 | ||
6 | 6 | let biases_layer_1 = [-25696, 23125, -47529, 18951] | |
7 | 7 | ||
8 | 8 | let weights_layer_2 = [[-75752, 55233, 65811, 37732], [68610, -57062, -60355, -33235]] | |
9 | 9 | ||
10 | 10 | let biases_layer_2 = [-31616, 29450] | |
11 | 11 | ||
12 | 12 | let weights_layer_3 = [[-89396, 95173]] | |
13 | 13 | ||
14 | 14 | let biases_layer_3 = [-1923] | |
15 | 15 | ||
16 | 16 | func linear_forward_1 (input,weights,biases) = { | |
17 | 17 | let weighted_sum1 = ((((input[0] * weights[0][0]) + (input[1] * weights[0][1])) / 10000) + biases[0]) | |
18 | 18 | let weighted_sum2 = ((((input[0] * weights[1][0]) + (input[1] * weights[1][1])) / 10000) + biases[1]) | |
19 | 19 | let weighted_sum3 = ((((input[0] * weights[2][0]) + (input[1] * weights[2][1])) / 10000) + biases[2]) | |
20 | 20 | let weighted_sum4 = ((((input[0] * weights[3][0]) + (input[1] * weights[3][1])) / 10000) + biases[3]) | |
21 | 21 | [weighted_sum1, weighted_sum2, weighted_sum3, weighted_sum4] | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func linear_forward_2 (input,weights,biases) = { | |
26 | 26 | let weighted_sum1 = ((((((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + (input[2] * weights[0][2])) + (input[3] * weights[0][3])) / 10000) + biases[0]) | |
27 | 27 | let weighted_sum2 = ((((((input[0] * weights[1][0]) + (input[1] * weights[1][1])) + (input[2] * weights[1][2])) + (input[3] * weights[1][3])) / 10000) + biases[1]) | |
28 | 28 | [weighted_sum1, weighted_sum2] | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func linear_forward_3 (input,weights,biases) = { | |
33 | 33 | let weighted_sum1 = ((((input[0] * weights[0][0]) + (input[1] * weights[0][1])) / 10000) + biases[0]) | |
34 | 34 | [weighted_sum1] | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func sigmoid (input) = if ((-80000 > input)) | |
39 | 39 | then 0 | |
40 | 40 | else if ((-60000 > input)) | |
41 | 41 | then fraction((input + 80000), 125, 10000) | |
42 | 42 | else if ((-40000 > input)) | |
43 | 43 | then fraction((input + 60000), 100, 10000) | |
44 | 44 | else if ((-20000 > input)) | |
45 | 45 | then fraction((input + 40000), 75, 10000) | |
46 | 46 | else if ((0 > input)) | |
47 | 47 | then fraction((input + 20000), 50, 10000) | |
48 | 48 | else if ((20000 > input)) | |
49 | 49 | then (fraction(input, 50, 10000) + 5000) | |
50 | 50 | else if ((40000 > input)) | |
51 | 51 | then (fraction((input - 20000), 75, 10000) + 7500) | |
52 | 52 | else if ((60000 > input)) | |
53 | 53 | then (fraction((input - 40000), 100, 10000) + 8750) | |
54 | 54 | else if ((80000 > input)) | |
55 | 55 | then (fraction((input - 60000), 125, 10000) + 9375) | |
56 | 56 | else 10000 | |
57 | 57 | ||
58 | 58 | ||
59 | - | func sigmoid_activation (inputs,num_outputs) = if ((num_outputs == 1)) | |
60 | - | then [sigmoid(inputs[0])] | |
61 | - | else [sigmoid(inputs[0]), sigmoid(inputs[1]), sigmoid(inputs[2]), sigmoid(inputs[3])] | |
59 | + | func sigmoid_activation (inputs) = { | |
60 | + | let num_outputs = size(inputs) | |
61 | + | if ((num_outputs == 1)) | |
62 | + | then [sigmoid(inputs[0])] | |
63 | + | else if ((num_outputs == 2)) | |
64 | + | then [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
65 | + | else [sigmoid(inputs[0]), sigmoid(inputs[1]), sigmoid(inputs[2]), sigmoid(inputs[3])] | |
66 | + | } | |
62 | 67 | ||
63 | 68 | ||
64 | 69 | @Callable(i) | |
65 | 70 | func predict (inputs) = { | |
66 | 71 | let x1_scaled = (inputs[0] * 10000) | |
67 | 72 | let x2_scaled = (inputs[1] * 10000) | |
68 | 73 | let scaled_inputs = [x1_scaled, x2_scaled] | |
69 | 74 | let z1 = linear_forward_1(scaled_inputs, weights_layer_1, biases_layer_1) | |
70 | - | let a1 = sigmoid_activation(z1 | |
75 | + | let a1 = sigmoid_activation(z1) | |
71 | 76 | let z2 = linear_forward_2(a1, weights_layer_2, biases_layer_2) | |
72 | - | let a2 = sigmoid_activation(z2 | |
77 | + | let a2 = sigmoid_activation(z2) | |
73 | 78 | let z3 = linear_forward_3(a2, weights_layer_3, biases_layer_3) | |
74 | - | let a3 = sigmoid_activation(z3 | |
79 | + | let a3 = sigmoid_activation(z3) | |
75 | 80 | let result0 = a3[0] | |
76 | 81 | let debug_outputs = nil | |
77 | 82 | ([IntegerEntry("move_prediction_0", result0)] ++ debug_outputs) | |
78 | 83 | } | |
79 | 84 | ||
80 | 85 |
github/deemru/w8io/169f3d6 31.35 ms ◑