tx · 8bA5jMEQ6Vm9Rh4z9C9TER3GXZ2QKwTuAjWySbzGzVBv 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.05.26 20:26 [3123258] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "8bA5jMEQ6Vm9Rh4z9C9TER3GXZ2QKwTuAjWySbzGzVBv", "fee": 1000000, "feeAssetId": null, "timestamp": 1716744390173, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "5ntGQw4pCv1tKJgEKTq1HzRiU9ZiG7NhQhHqVAVTWBqaMLpwHqKy9K7DSVtEXQJc8Cvv3D5tumLUqpdeCHZGhpn4" ], "script": "base64:BwIICAISBAoCAQEHAA93ZWlnaHRzX2xheWVyXzEJAMwIAgkAzAgCAJHVAwkAzAgCAKnVAwUDbmlsCQDMCAIJAMwIAgDLwwIJAMwIAgDRwwIFA25pbAUDbmlsAA5iaWFzZXNfbGF5ZXJfMQkAzAgCAM+1/v///////wEJAMwIAgC1j/z///////8BBQNuaWwAD3dlaWdodHNfbGF5ZXJfMgkAzAgCCQDMCAIA4IoFCQDMCAIAjsP6////////AQUDbmlsBQNuaWwADmJpYXNlc19sYXllcl8yCQDMCAIAm9b9////////AQUDbmlsAQ5saW5lYXJfZm9yd2FyZAMFaW5wdXQHd2VpZ2h0cwZiaWFzZXMEDXdlaWdodGVkX3N1bTEJAGQCCQBpAgkAZAIJAGgCCQCRAwIFBWlucHV0AAAJAJEDAgkAkQMCBQd3ZWlnaHRzAAAAAAkAaAIJAJEDAgUFaW5wdXQAAQkAkQMCCQCRAwIFB3dlaWdodHMAAAABAJBOCQCRAwIFBmJpYXNlcwAABA13ZWlnaHRlZF9zdW0yCQBkAgkAaQIJAGQCCQBoAgkAkQMCB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AIJAQxJbnRlZ2VyRW50cnkCAgpkZWJ1Z196MV8yCQCRAwIFAnoxAAEJAMwIAgkBDEludGVnZXJFbnRyeQICCmRlYnVnX2ExXzIJAJEDAgUCYTEAAQkAzAgCCQEMSW50ZWdlckVudHJ5AgIIZGVidWdfYTIFAmEyCQDMCAIJAQxJbnRlZ2VyRW50cnkCAghkZWJ1Z196MgUCejIJAMwIAgkBDEludGVnZXJFbnRyeQICDGRlYnVnX3Jlc3VsdAUGcmVzdWx0BQNuaWwJAJQKAgUNZGVidWdfb3V0cHV0cwUGcmVzdWx0AE3RO68=", "height": 3123258, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CSKB8iCwwXfruTvzLC9tm5jdhrri1eMoeLApwdfSEHCE Next: FYY5e1t899S1xjoEgphoEeWuywfGRLTVAt65iBN8Pxv9 Diff:
Old | New | Differences | |
---|---|---|---|
33 | 33 | let inputs = [x1_scaled, x2_scaled] | |
34 | 34 | let z1 = linear_forward(inputs, weights_layer_1, biases_layer_1) | |
35 | 35 | let a1 = sigmoid_activation(z1) | |
36 | - | let z2 = | |
37 | - | let a2 = sigmoid(z2 | |
36 | + | let z2 = ((((a1[0] * weights_layer_2[0][0]) + (a1[1] * weights_layer_2[0][1])) / 10000) + biases_layer_2[0]) | |
37 | + | let a2 = sigmoid(z2) | |
38 | 38 | let result = (a2 / 10000) | |
39 | - | let debug_outputs = [IntegerEntry("debug_z1_1", z1[0]), IntegerEntry("debug_a1_1", a1[0]), IntegerEntry("debug_z1_2", z1[1]), IntegerEntry("debug_a1_2", a1[1]), IntegerEntry("debug_ | |
39 | + | let debug_outputs = [IntegerEntry("debug_z1_1", z1[0]), IntegerEntry("debug_a1_1", a1[0]), IntegerEntry("debug_z1_2", z1[1]), IntegerEntry("debug_a1_2", a1[1]), IntegerEntry("debug_a2", a2), IntegerEntry("debug_z2", z2), IntegerEntry("debug_result", result)] | |
40 | 40 | $Tuple2(debug_outputs, result) | |
41 | 41 | } | |
42 | 42 |
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 (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 sigmoid (input) = if ((-10000 > input)) | |
20 | 20 | then 0 | |
21 | 21 | else if ((input > 10000)) | |
22 | 22 | then 10000 | |
23 | 23 | else (5000 + (input / 2)) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func sigmoid_activation (inputs) = [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | @Callable(i) | |
30 | 30 | func predict (x1,x2) = { | |
31 | 31 | let x1_scaled = (x1 * 10000) | |
32 | 32 | let x2_scaled = (x2 * 10000) | |
33 | 33 | let inputs = [x1_scaled, x2_scaled] | |
34 | 34 | let z1 = linear_forward(inputs, weights_layer_1, biases_layer_1) | |
35 | 35 | let a1 = sigmoid_activation(z1) | |
36 | - | let z2 = | |
37 | - | let a2 = sigmoid(z2 | |
36 | + | let z2 = ((((a1[0] * weights_layer_2[0][0]) + (a1[1] * weights_layer_2[0][1])) / 10000) + biases_layer_2[0]) | |
37 | + | let a2 = sigmoid(z2) | |
38 | 38 | let result = (a2 / 10000) | |
39 | - | let debug_outputs = [IntegerEntry("debug_z1_1", z1[0]), IntegerEntry("debug_a1_1", a1[0]), IntegerEntry("debug_z1_2", z1[1]), IntegerEntry("debug_a1_2", a1[1]), IntegerEntry("debug_ | |
39 | + | let debug_outputs = [IntegerEntry("debug_z1_1", z1[0]), IntegerEntry("debug_a1_1", a1[0]), IntegerEntry("debug_z1_2", z1[1]), IntegerEntry("debug_a1_2", a1[1]), IntegerEntry("debug_a2", a2), IntegerEntry("debug_z2", z2), IntegerEntry("debug_result", result)] | |
40 | 40 | $Tuple2(debug_outputs, result) | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 |
github/deemru/w8io/169f3d6 23.95 ms ◑