tx · 5hqRJoKMtNcDRPoU3dMpZhfLar5vJieTpCzaPJWSNuV7 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.04.27 17:19 [3081365] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "5hqRJoKMtNcDRPoU3dMpZhfLar5vJieTpCzaPJWSNuV7", "fee": 1000000, "feeAssetId": null, "timestamp": 1714227581671, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "3kU8Ygwj2TyKfp5xFDBEEynrqQZGGkoYQRqWJdLsQoxrAkg9GNvZVBJ8n9i4t3qE227931bkPaEEWr3yBM32tznE" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAcAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmxCQAETAAAAAIAAAAAAAAJKp0FAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcUJAARMAAAAAgD///////JPigUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAAB3NpZ21vaWQAAAACAAAAAXoAAAALZGVidWdQcmVmaXgEAAAAAWUAAAAAAAApekkEAAAABGJhc2UAAAAAAAAPQkAEAAAACXBvc2l0aXZlWgMJAABmAAAAAgAAAAAAAAAAAAUAAAABegkBAAAAAS0AAAABBQAAAAF6BQAAAAF6BAAAAAdzY2FsZWRaCQAAaQA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lsBQAAAAtkZWJ1Z0xheWVyMQUAAAALZGVidWdMYXllcjIAAAAA+5sCSw==", "height": 3081365, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2EAsscTWTcXLbZe4WsBMSSeTj11Qf1Abr2c6XurS2kqL Next: FiMyqvSHG2XofDqbcQV7uKntJhFJuUqyBaApsxEwfpwT Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let layer1Weights = [[600497, 600733], [414197, 414253]] | |
5 | 5 | ||
6 | 6 | let layer1Biases = [-259050, -635637] | |
7 | 7 | ||
8 | 8 | let layer2Weights = [[832965, -897142]] | |
9 | 9 | ||
10 | 10 | let layer2Biases = [-381179] | |
11 | 11 | ||
12 | 12 | func sigmoid (z,debugPrefix) = { | |
13 | 13 | let e = 2718281 | |
14 | 14 | let base = 1000000 | |
15 | 15 | let positiveZ = if ((0 > z)) | |
16 | 16 | then -(z) | |
17 | 17 | else z | |
18 | 18 | let scaledZ = (positiveZ / 10000) | |
19 | 19 | let expPart = fraction(e, base, scaledZ) | |
20 | 20 | let sigValue = fraction(base, (base + expPart), base) | |
21 | 21 | $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expPart"), expPart), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue) | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func forwardPassLayer1 (input,weights,biases,debugPrefix) = { | |
26 | 26 | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
27 | 27 | let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1]) | |
28 | 28 | let $t011451191 = sigmoid(sum0, "Layer1N0") | |
29 | 29 | let debug0 = $t011451191._1 | |
30 | 30 | let sig0 = $t011451191._2 | |
31 | 31 | let $t011961242 = sigmoid(sum1, "Layer1N1") | |
32 | 32 | let debug1 = $t011961242._1 | |
33 | 33 | let sig1 = $t011961242._2 | |
34 | 34 | $Tuple2([sig0, sig1], (debug0 ++ debug1)) | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func forwardPassLayer2 (input,weights,biases,debugPrefix) = { | |
39 | 39 | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
40 | 40 | let $t015111557 = sigmoid(sum0, "Layer2N0") | |
41 | 41 | let debug0 = $t015111557._1 | |
42 | 42 | let sig0 = $t015111557._2 | |
43 | 43 | $Tuple2(sig0, debug0) | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(i) | |
48 | 48 | func predict (input1,input2) = { | |
49 | 49 | let scaledInput1 = if ((input1 == 1)) | |
50 | 50 | then 1000000 | |
51 | 51 | else 0 | |
52 | 52 | let scaledInput2 = if ((input2 == 1)) | |
53 | 53 | then 1000000 | |
54 | 54 | else 0 | |
55 | 55 | let inputs = [scaledInput1, scaledInput2] | |
56 | 56 | let $t018081906 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
57 | 57 | let layer1Output = $t018081906._1 | |
58 | 58 | let debugLayer1 = $t018081906._2 | |
59 | 59 | let $t019112015 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
60 | 60 | let layer2Output = $t019112015._1 | |
61 | 61 | let debugLayer2 = $t019112015._2 | |
62 | 62 | (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2) | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 |
github/deemru/w8io/169f3d6 26.34 ms ◑