tx · M1cUmR4buw3m1ApiJjeGXmKDuNfXDeYV5g723kcmemh 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.04.15 23:04 [3064337] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "M1cUmR4buw3m1ApiJjeGXmKDuNfXDeYV5g723kcmemh", "fee": 1000000, "feeAssetId": null, "timestamp": 1713211540219, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "4y9FzuXmXzc2ZMtmxNa1BYFyD9R2x9o8AaFPCT9QhdmGCUt6Fy5XtkPKcsioavsXE4wLqM2hPtwv7cWg6Cn1oFmF" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAcAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmwCQAETAAAAAIAAAAAAAAJKpwFAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfQJAARMAAAAAgAAAAAAAAZSLAUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcUJAARMAAAAAgD///////JPiwUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8GBQAAAANuaWwBAAAAB3NpZ21vaWQAAAACAAAAAXoAAAALZGVidWdQcmVmaXgEAAAAAWUAAAAAAAApekkEAAAABGJhc2UAAAAAAAAPQkAEAAAACXBvc2l0aXZlWgMJAABmAAAAAgAAAAAAAAAAAAUAAAABegkBAAAAAS0AAAABBQAAAAF6BQAAAAF6BAAAAAdleHBQYXJ0CQAAawAA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EFAAAAC2RlYnVnTGF5ZXIyAAAAAIkQsT8=", "height": 3064337, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CS21i4va4bE4wpJLLVcMuLnJmUSs6ayZzKEjCtJzd3f3 Next: GrYgFiPFtYBHK5z9HdzqdS27NYqqNRNR7QHf3AxwJu1z Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[ | |
4 | + | let layer1Weights = [[600496, 600732], [414196, 414252]] | |
5 | 5 | ||
6 | 6 | let layer1Biases = [-259050, -635637] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[832965, -897141]] | |
9 | 9 | ||
10 | - | let layer2Biases = [- | |
10 | + | let layer2Biases = [-381178] | |
11 | 11 | ||
12 | 12 | func sigmoid (z,debugPrefix) = { | |
13 | 13 | let e = 2718281 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[ | |
4 | + | let layer1Weights = [[600496, 600732], [414196, 414252]] | |
5 | 5 | ||
6 | 6 | let layer1Biases = [-259050, -635637] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[832965, -897141]] | |
9 | 9 | ||
10 | - | let layer2Biases = [- | |
10 | + | let layer2Biases = [-381178] | |
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 | 38 | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
39 | 39 | let $t015381584 = sigmoid(sum0, "Layer2N0") | |
40 | 40 | let debug0 = $t015381584._1 | |
41 | 41 | let sig0 = $t015381584._2 | |
42 | 42 | $Tuple2([sig0], debug0) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func predict (input1,input2) = { | |
48 | 48 | let scaledInput1 = if ((input1 == 1)) | |
49 | 49 | then 1000000 | |
50 | 50 | else 0 | |
51 | 51 | let scaledInput2 = if ((input2 == 1)) | |
52 | 52 | then 1000000 | |
53 | 53 | else 0 | |
54 | 54 | let inputs = [scaledInput1, scaledInput2] | |
55 | 55 | let $t018371935 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
56 | 56 | let layer1Output = $t018371935._1 | |
57 | 57 | let debugLayer1 = $t018371935._2 | |
58 | 58 | let $t019402044 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
59 | 59 | let layer2Output = $t019402044._1 | |
60 | 60 | let debugLayer2 = $t019402044._2 | |
61 | 61 | (([IntegerEntry("result", layer2Output[0])] ++ debugLayer1) ++ debugLayer2) | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 |
github/deemru/w8io/169f3d6 30.09 ms ◑