tx · CS21i4va4bE4wpJLLVcMuLnJmUSs6ayZzKEjCtJzd3f3 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.04.15 23:00 [3064333] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "CS21i4va4bE4wpJLLVcMuLnJmUSs6ayZzKEjCtJzd3f3", "fee": 1000000, "feeAssetId": null, "timestamp": 1713211229821, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "33ijew3F8tZZB8zxehKgwkJDBSrdxVQ1TsTrbr4pfietpGz5BVH5QV6kTxWMrGiWb2VKdWspQEAFwTXjj4igx2cE" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAcAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmxCQAETAAAAAIAAAAAAAAJKp0FAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcYJAARMAAAAAgD///////JPigUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAAB3NpZ21vaWQAAAACAAAAAXoAAAALZGVidWdQcmVmaXgEAAAAAWUAAAAAAAApekkEAAAABGJhc2UAAAAAAAAPQkAEAAAACXBvc2l0aXZlWgMJAABmAAAAAgAAAAAAAAAAAAUAAAABegkBAAAAAS0AAAABBQAAAAF6BQAAAAF6BAAAAAdleHBQYXJ0CQAAawAAAA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AAAAC2RlYnVnTGF5ZXIyAAAAAOdBDRI=", "height": 3064333, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7PT7Kpvh7R2ojLzQAxqjD2to4ryUdME3RKSJ8hwMgmYZ Next: M1cUmR4buw3m1ApiJjeGXmKDuNfXDeYV5g723kcmemh Diff:
Old | New | Differences | |
---|---|---|---|
35 | 35 | ||
36 | 36 | ||
37 | 37 | func forwardPassLayer2 (input,weights,biases,debugPrefix) = { | |
38 | - | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[0], weights[0][1], 1000000)) + biases[0]) | |
39 | - | let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[0], weights[1][1], 1000000)) + biases[1]) | |
40 | - | let $t016531699 = sigmoid(sum0, "Layer2N0") | |
41 | - | let debug0 = $t016531699._1 | |
42 | - | let sig0 = $t016531699._2 | |
43 | - | let $t017041750 = sigmoid(sum1, "Layer2N1") | |
44 | - | let debug1 = $t017041750._1 | |
45 | - | let sig1 = $t017041750._2 | |
46 | - | $Tuple2([sig0, sig1], (debug0 ++ debug1)) | |
38 | + | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
39 | + | let $t015381584 = sigmoid(sum0, "Layer2N0") | |
40 | + | let debug0 = $t015381584._1 | |
41 | + | let sig0 = $t015381584._2 | |
42 | + | $Tuple2([sig0], debug0) | |
47 | 43 | } | |
48 | 44 | ||
49 | 45 | ||
56 | 52 | then 1000000 | |
57 | 53 | else 0 | |
58 | 54 | let inputs = [scaledInput1, scaledInput2] | |
59 | - | let $ | |
60 | - | let layer1Output = $ | |
61 | - | let debugLayer1 = $ | |
62 | - | let $ | |
63 | - | let layer2Output = $ | |
64 | - | let debugLayer2 = $ | |
55 | + | let $t018371935 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
56 | + | let layer1Output = $t018371935._1 | |
57 | + | let debugLayer1 = $t018371935._2 | |
58 | + | let $t019402044 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
59 | + | let layer2Output = $t019402044._1 | |
60 | + | let debugLayer2 = $t019402044._2 | |
65 | 61 | (([IntegerEntry("result", layer2Output[0])] ++ debugLayer1) ++ debugLayer2) | |
66 | 62 | } | |
67 | 63 |
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 = [[832966, -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 expPart = fraction(e, base, positiveZ) | |
19 | 19 | let sigValue = fraction(base, base, (base + expPart)) | |
20 | 20 | $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expPart"), expPart), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue) | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func forwardPassLayer1 (input,weights,biases,debugPrefix) = { | |
25 | 25 | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
26 | 26 | let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1]) | |
27 | 27 | let $t011721218 = sigmoid(sum0, "Layer1N0") | |
28 | 28 | let debug0 = $t011721218._1 | |
29 | 29 | let sig0 = $t011721218._2 | |
30 | 30 | let $t012231269 = sigmoid(sum1, "Layer1N1") | |
31 | 31 | let debug1 = $t012231269._1 | |
32 | 32 | let sig1 = $t012231269._2 | |
33 | 33 | $Tuple2([sig0, sig1], (debug0 ++ debug1)) | |
34 | 34 | } | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func forwardPassLayer2 (input,weights,biases,debugPrefix) = { | |
38 | - | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[0], weights[0][1], 1000000)) + biases[0]) | |
39 | - | let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[0], weights[1][1], 1000000)) + biases[1]) | |
40 | - | let $t016531699 = sigmoid(sum0, "Layer2N0") | |
41 | - | let debug0 = $t016531699._1 | |
42 | - | let sig0 = $t016531699._2 | |
43 | - | let $t017041750 = sigmoid(sum1, "Layer2N1") | |
44 | - | let debug1 = $t017041750._1 | |
45 | - | let sig1 = $t017041750._2 | |
46 | - | $Tuple2([sig0, sig1], (debug0 ++ debug1)) | |
38 | + | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
39 | + | let $t015381584 = sigmoid(sum0, "Layer2N0") | |
40 | + | let debug0 = $t015381584._1 | |
41 | + | let sig0 = $t015381584._2 | |
42 | + | $Tuple2([sig0], debug0) | |
47 | 43 | } | |
48 | 44 | ||
49 | 45 | ||
50 | 46 | @Callable(i) | |
51 | 47 | func predict (input1,input2) = { | |
52 | 48 | let scaledInput1 = if ((input1 == 1)) | |
53 | 49 | then 1000000 | |
54 | 50 | else 0 | |
55 | 51 | let scaledInput2 = if ((input2 == 1)) | |
56 | 52 | then 1000000 | |
57 | 53 | else 0 | |
58 | 54 | let inputs = [scaledInput1, scaledInput2] | |
59 | - | let $ | |
60 | - | let layer1Output = $ | |
61 | - | let debugLayer1 = $ | |
62 | - | let $ | |
63 | - | let layer2Output = $ | |
64 | - | let debugLayer2 = $ | |
55 | + | let $t018371935 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
56 | + | let layer1Output = $t018371935._1 | |
57 | + | let debugLayer1 = $t018371935._2 | |
58 | + | let $t019402044 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
59 | + | let layer2Output = $t019402044._1 | |
60 | + | let debugLayer2 = $t019402044._2 | |
65 | 61 | (([IntegerEntry("result", layer2Output[0])] ++ debugLayer1) ++ debugLayer2) | |
66 | 62 | } | |
67 | 63 | ||
68 | 64 |
github/deemru/w8io/169f3d6 47.44 ms ◑