tx · Caw5hteY6VE5wJWUtbXE6eTkgJhAS89NUjyTEgyWD7vy 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.04.28 15:03 [3082685] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "Caw5hteY6VE5wJWUtbXE6eTkgJhAS89NUjyTEgyWD7vy", "fee": 1000000, "feeAssetId": null, "timestamp": 1714305832290, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "4VHqqiNJ6rQpQmyU7qtsUDCNjoVgwnXgbEa4h8qXjSjtbAGTaSQorPzdaGWujYTtvKyzP7mC9rzbn94v7XFxmgiw" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAgAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmxCQAETAAAAAIAAAAAAAAJKpwFAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcYJAARMAAAAAgD///////JPigUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8FBQAAAANuaWwBAAAACWV4cEFwcHJveAAAAAEAAAABeAQAAAAHc2NhbGVkWAkAAGsAAAADBQAAAAF4AAAAAAAAAAABAAAAAAAAAAPoBAAAAAhzY2FsZWRYMgkAAGsAAAADBQAAAAdzY2FsZWRYBQAAAAdzY2FsZWRYAAAAAAAAAAPoBAAAAAV0ZXJtMQkAAGUAAAACAAAA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AyMDYwMjE1OAAAAAJfMQQAAAAMbGF5ZXIxT3V0cHV0CAUAAAALJHQwMjA2MDIxNTgAAAACXzIEAAAACyR0MDIxNjMyMjY3CQEAAAARZm9yd2FyZFBhc3NMYXllcjIAAAAEBQAAAAxsYXllcjFPdXRwdXQFAAAADWxheWVyMldlaWdodHMFAAAADGxheWVyMkJpYXNlcwIAAAAGTGF5ZXIyBAAAAAtkZWJ1Z0xheWVyMggFAAAACyR0MDIxNjMyMjY3AAAAAl8xBAAAAAxsYXllcjJPdXRwdXQIBQAAAAskdDAyMTYzMjI2NwAAAAJfMgkABE4AAAACCQAETgAAAAIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAABnJlc3VsdAUAAAAMbGF5ZXIyT3V0cHV0BQAAAANuaWwFAAAAC2RlYnVnTGF5ZXIxBQAAAAtkZWJ1Z0xheWVyMgAAAABqSdqR", "height": 3082685, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BM99xHVxdCc9EqbXsCkM7ZWSZhTJvHtirzap69CgHG6L Next: 3VfJiTQQ4gm1w42zeiKmk1fzLaxCoRabH3w4e7NAmWgj Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[600497, | |
4 | + | let layer1Weights = [[600497, 600732], [414197, 414253]] | |
5 | 5 | ||
6 | - | let layer1Biases = [-259050, - | |
6 | + | let layer1Biases = [-259050, -635637] | |
7 | 7 | ||
8 | 8 | let layer2Weights = [[832966, -897142]] | |
9 | 9 | ||
29 | 29 | func forwardPassLayer1 (input,weights,biases,debugPrefix) = { | |
30 | 30 | let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + biases[0]) | |
31 | 31 | let sum1 = (((input[0] * weights[1][0]) + (input[1] * weights[1][1])) + biases[1]) | |
32 | - | let $ | |
33 | - | let debugEntries0 = $ | |
34 | - | let sig0 = $ | |
35 | - | let $ | |
36 | - | let debugEntries1 = $ | |
37 | - | let sig1 = $ | |
32 | + | let $t012951348 = sigmoid(sum0, "Layer1N0") | |
33 | + | let debugEntries0 = $t012951348._1 | |
34 | + | let sig0 = $t012951348._2 | |
35 | + | let $t013531406 = sigmoid(sum1, "Layer1N1") | |
36 | + | let debugEntries1 = $t013531406._1 | |
37 | + | let sig1 = $t013531406._2 | |
38 | 38 | let debugInfo = (debugEntries0 ++ debugEntries1) | |
39 | 39 | let output = [sig0, sig1] | |
40 | 40 | $Tuple2(debugInfo, output) | |
43 | 43 | ||
44 | 44 | func forwardPassLayer2 (input,weights,biases,debugPrefix) = { | |
45 | 45 | let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + biases[0]) | |
46 | - | let $ | |
47 | - | let debugEntries0 = $ | |
48 | - | let sig0 = $ | |
46 | + | let $t017071760 = sigmoid(sum0, "Layer2N0") | |
47 | + | let debugEntries0 = $t017071760._1 | |
48 | + | let sig0 = $t017071760._2 | |
49 | 49 | let debugInfo = debugEntries0 | |
50 | 50 | let output = sig0 | |
51 | 51 | $Tuple2(debugInfo, output) | |
61 | 61 | then 1 | |
62 | 62 | else 0 | |
63 | 63 | let inputs = [scaledInput1, scaledInput2] | |
64 | - | let $ | |
65 | - | let debugLayer1 = $ | |
66 | - | let layer1Output = $ | |
67 | - | let $ | |
68 | - | let debugLayer2 = $ | |
69 | - | let layer2Output = $ | |
64 | + | let $t020602158 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
65 | + | let debugLayer1 = $t020602158._1 | |
66 | + | let layer1Output = $t020602158._2 | |
67 | + | let $t021632267 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
68 | + | let debugLayer2 = $t021632267._1 | |
69 | + | let layer2Output = $t021632267._2 | |
70 | 70 | (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2) | |
71 | 71 | } | |
72 | 72 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[600497, | |
4 | + | let layer1Weights = [[600497, 600732], [414197, 414253]] | |
5 | 5 | ||
6 | - | let layer1Biases = [-259050, - | |
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 expApprox (x) = { | |
13 | 13 | let scaledX = fraction(x, 1, 1000) | |
14 | 14 | let scaledX2 = fraction(scaledX, scaledX, 1000) | |
15 | 15 | let term1 = (1000 - scaledX) | |
16 | 16 | let term2 = fraction(scaledX2, 500, 1) | |
17 | 17 | (term1 + term2) | |
18 | 18 | } | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func sigmoid (z,debugPrefix) = { | |
22 | 22 | let expNegZ = expApprox(-(z)) | |
23 | 23 | let onePlusExpNegZ = (1000 + expNegZ) | |
24 | 24 | let sigValue = fraction(1000, onePlusExpNegZ, 1) | |
25 | 25 | $Tuple2([IntegerEntry((debugPrefix + "inputZ"), z), IntegerEntry((debugPrefix + "expNegZ"), expNegZ), IntegerEntry((debugPrefix + "onePlusExpNegZ"), onePlusExpNegZ), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue) | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func forwardPassLayer1 (input,weights,biases,debugPrefix) = { | |
30 | 30 | let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + biases[0]) | |
31 | 31 | let sum1 = (((input[0] * weights[1][0]) + (input[1] * weights[1][1])) + biases[1]) | |
32 | - | let $ | |
33 | - | let debugEntries0 = $ | |
34 | - | let sig0 = $ | |
35 | - | let $ | |
36 | - | let debugEntries1 = $ | |
37 | - | let sig1 = $ | |
32 | + | let $t012951348 = sigmoid(sum0, "Layer1N0") | |
33 | + | let debugEntries0 = $t012951348._1 | |
34 | + | let sig0 = $t012951348._2 | |
35 | + | let $t013531406 = sigmoid(sum1, "Layer1N1") | |
36 | + | let debugEntries1 = $t013531406._1 | |
37 | + | let sig1 = $t013531406._2 | |
38 | 38 | let debugInfo = (debugEntries0 ++ debugEntries1) | |
39 | 39 | let output = [sig0, sig1] | |
40 | 40 | $Tuple2(debugInfo, output) | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func forwardPassLayer2 (input,weights,biases,debugPrefix) = { | |
45 | 45 | let sum0 = (((input[0] * weights[0][0]) + (input[1] * weights[0][1])) + biases[0]) | |
46 | - | let $ | |
47 | - | let debugEntries0 = $ | |
48 | - | let sig0 = $ | |
46 | + | let $t017071760 = sigmoid(sum0, "Layer2N0") | |
47 | + | let debugEntries0 = $t017071760._1 | |
48 | + | let sig0 = $t017071760._2 | |
49 | 49 | let debugInfo = debugEntries0 | |
50 | 50 | let output = sig0 | |
51 | 51 | $Tuple2(debugInfo, output) | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | @Callable(i) | |
56 | 56 | func predict (input1,input2) = { | |
57 | 57 | let scaledInput1 = if ((input1 == 1)) | |
58 | 58 | then 1 | |
59 | 59 | else 0 | |
60 | 60 | let scaledInput2 = if ((input2 == 1)) | |
61 | 61 | then 1 | |
62 | 62 | else 0 | |
63 | 63 | let inputs = [scaledInput1, scaledInput2] | |
64 | - | let $ | |
65 | - | let debugLayer1 = $ | |
66 | - | let layer1Output = $ | |
67 | - | let $ | |
68 | - | let debugLayer2 = $ | |
69 | - | let layer2Output = $ | |
64 | + | let $t020602158 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
65 | + | let debugLayer1 = $t020602158._1 | |
66 | + | let layer1Output = $t020602158._2 | |
67 | + | let $t021632267 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
68 | + | let debugLayer2 = $t021632267._1 | |
69 | + | let layer2Output = $t021632267._2 | |
70 | 70 | (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2) | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 |
github/deemru/w8io/169f3d6 29.36 ms ◑