tx · Cz1bL3xdP7eKdZwGURLxJR4c2Z5n6VT2qikSTCDKNthw 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.05.28 00:54 [3124967] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "Cz1bL3xdP7eKdZwGURLxJR4c2Z5n6VT2qikSTCDKNthw", "fee": 1000000, "feeAssetId": null, "timestamp": 1716846869831, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "52m3iDKP26HgovQiVdiAi4ewfyfgbbSDx7kgrmaXciWzvSccHLazE5CwzG2BR6nFMhjXXAcBKuxzfGQ5JtnV9TeQ" ], "script": "base64:BwIICAISBAoCAQEJAA93ZWlnaHRzX2xheWVyXzEJAMwIAgkAzAgCAJHVAwkAzAgCAKnVAwUDbmlsCQDMCAIJAMwIAgDLwwIJAMwIAgDRwwIFA25pbAUDbmlsAA5iaWFzZXNfbGF5ZXJfMQkAzAgCAM+1/v///////wEJAMwIAgC1j/z///////8BBQNuaWwAD3dlaWdodHNfbGF5ZXJfMgkAzAgCCQDMCAIA4IoFCQDMCAIAjsP6////////AQUDbmlsBQNuaWwADmJpYXNlc19sYXllcl8yCQDMCAIAm9b9////////AQUDbmlsARBsaW5lYXJfZm9yd2FyZF8xAwVpbnB1dAd3ZWlnaHRzBmJpYXNlcwQNd2VpZ2h0ZWRfc3VtMQkAZAIJAGkCCQBkAgkAaAIJAJEDAgUFaW5wdXQAAAkAkQMCCQCRAwIFB3dlaWdodHMAAAAACQBoAgkAkQMCBQVpbnB1dAABCQCRAwIJAJEDAgUHd2VpZ2h0cwAAAAEAkE4JAJEDAgUGYmlhc2VzAAAEDXdlaWdodGVkX3N1bTIJAGQCCQBpAgkAZAIJAGgCCQCRAwIFBWlucHV0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cl9mb3J3YXJkXzIDBQJhMQUPd2VpZ2h0c19sYXllcl8yBQ5iaWFzZXNfbGF5ZXJfMgQCYTIJARRzaWdtb2lkX2FjdGl2YXRpb25fMgEFAnoyBAdyZXN1bHRzCQDMCAIJAJEDAgUCYTIAAAUDbmlsBA5yZXN1bHRfZW50cmllcwkAzAgCCQEMSW50ZWdlckVudHJ5AgIGcmVzdWx0CQCRAwIFB3Jlc3VsdHMAAAUDbmlsBA1kZWJ1Z19vdXRwdXRzBQNuaWwJAJQKAgUNZGVidWdfb3V0cHV0cwUOcmVzdWx0X2VudHJpZXMAL/povw==", "height": 3124967, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FUqhqF9AWPAyMck9vfpp3RJunmYtHj7gP65drM8M9LGm Next: 62JzRAm5QWVYBQSVpA6zUc8SWBcZ9vo8XoCvqrnmQK9 Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | else (5000 + (input / 2)) | |
30 | 30 | ||
31 | 31 | ||
32 | - | func sigmoid_activation (inputs,num_outputs) = [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
32 | + | func sigmoid_activation_1 (inputs) = [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
33 | + | ||
34 | + | ||
35 | + | func sigmoid_activation_2 (inputs) = [sigmoid(inputs[0])] | |
33 | 36 | ||
34 | 37 | ||
35 | 38 | @Callable(i) | |
38 | 41 | let x2_scaled = (x2 * 10000) | |
39 | 42 | let inputs = [x1_scaled, x2_scaled] | |
40 | 43 | let z1 = linear_forward_1(inputs, weights_layer_1, biases_layer_1) | |
41 | - | let a1 = sigmoid_activation(z1 | |
44 | + | let a1 = sigmoid_activation_1(z1) | |
42 | 45 | let z2 = linear_forward_2(a1, weights_layer_2, biases_layer_2) | |
43 | - | let a2 = sigmoid_activation(z2 | |
46 | + | let a2 = sigmoid_activation_2(z2) | |
44 | 47 | let results = [a2[0]] | |
45 | 48 | let result_entries = [IntegerEntry("result", results[0])] | |
46 | 49 | let debug_outputs = nil |
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 ((-10000 > input)) | |
26 | 26 | then 0 | |
27 | 27 | else if ((input > 10000)) | |
28 | 28 | then 10000 | |
29 | 29 | else (5000 + (input / 2)) | |
30 | 30 | ||
31 | 31 | ||
32 | - | func sigmoid_activation (inputs,num_outputs) = [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
32 | + | func sigmoid_activation_1 (inputs) = [sigmoid(inputs[0]), sigmoid(inputs[1])] | |
33 | + | ||
34 | + | ||
35 | + | func sigmoid_activation_2 (inputs) = [sigmoid(inputs[0])] | |
33 | 36 | ||
34 | 37 | ||
35 | 38 | @Callable(i) | |
36 | 39 | func predict (x1,x2) = { | |
37 | 40 | let x1_scaled = (x1 * 10000) | |
38 | 41 | let x2_scaled = (x2 * 10000) | |
39 | 42 | let inputs = [x1_scaled, x2_scaled] | |
40 | 43 | let z1 = linear_forward_1(inputs, weights_layer_1, biases_layer_1) | |
41 | - | let a1 = sigmoid_activation(z1 | |
44 | + | let a1 = sigmoid_activation_1(z1) | |
42 | 45 | let z2 = linear_forward_2(a1, weights_layer_2, biases_layer_2) | |
43 | - | let a2 = sigmoid_activation(z2 | |
46 | + | let a2 = sigmoid_activation_2(z2) | |
44 | 47 | let results = [a2[0]] | |
45 | 48 | let result_entries = [IntegerEntry("result", results[0])] | |
46 | 49 | let debug_outputs = nil | |
47 | 50 | $Tuple2(debug_outputs, result_entries) | |
48 | 51 | } | |
49 | 52 | ||
50 | 53 |
github/deemru/w8io/169f3d6 26.11 ms ◑