tx · 7pAj49vY3uDEe7WV34bD7BY2ayD2n8t87qYQ9jXybgWV 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.03.23 15:34 [3030701] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "7pAj49vY3uDEe7WV34bD7BY2ayD2n8t87qYQ9jXybgWV", "fee": 1000000, "feeAssetId": null, "timestamp": 1711197295665, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "4oq6XyUna6Zq2NMKU9hHLkLArGMCbX7bowBeGmUmjrt3B7TjxoLR96aZ2DwKc2woG6fJx1gm1qsWVmHTimkTRs8h" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAcAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAAW6DlCQAETAAAAAIAAAAAAABbqhwFAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAA/M44JAARMAAAAAgAAAAAAAD81vQUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP//////2HjZCQAETAAAAAIA//////+fAm0FAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAB/GbgJAARMAAAAAgD//////3cbZgUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////xdY0BQAAAANuaWwBAAAAB3NpZ21vaWQAAAABAAAAAXoEAAAAAWUAAAAAAAApekkEAAAABGJhc2UAAAAAAAAPQkAEAAAACXBvc2l0aXZlWgMJAABmAAAAAgAAAAAAAAAAAAUAAAABegkBAAAAAS0AAAABBQAAAAF6BQAAAAF6BAAAAAdleHBQYXJ0CQAAawAAAAMFAAAAAWUFAAAABG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BQAAAAVpbnB1dAAAAAAAAAAAAAkAAZEAAAACBQAAAAd3ZWlnaHRzAAAAAAAAAAAAAAAAAAAAD0JACQAAawAAAAMJAAGRAAAAAgUAAAAFaW5wdXQAAAAAAAAAAAEJAAGRAAAAAgUAAAAHd2VpZ2h0cwAAAAAAAAAAAAAAAAAAAA9CQAQAAAADc3VtCQAAZAAAAAIFAAAACmRvdFByb2R1Y3QFAAAABGJpYXMJAQAAAAdzaWdtb2lkAAAAAQUAAAADc3VtAAAAAQAAAAFpAQAAAAdwcmVkaWN0AAAAAgAAAAZpbnB1dDEAAAAGaW5wdXQyBAAAAAxzY2FsZWRJbnB1dDEDCQAAAAAAAAIFAAAABmlucHV0MQAAAAAAAAAAAQAAAAAAAA9CQAAAAAAAAAAAAAQAAAAMc2NhbGVkSW5wdXQyAwkAAAAAAAACBQAAAAZpbnB1dDIAAAAAAAAAAAEAAAAAAAAPQkAAAAAAAAAAAAAEAAAABmlucHV0cwkABEwAAAACBQAAAAxzY2FsZWRJbnB1dDEJAARMAAAAAgUAAAAMc2NhbGVkSW5wdXQyBQAAAANuaWwEAAAADGxheWVyMU91dHB1dAkBAAAAEWZvcndhcmRQYXNzTGF5ZXIxAAAAAwUAAAAGaW5wdXRzBQAAAA1sYXllcjFXZWlnaHRzBQAAAAxsYXllcjFCaWFzZXMEAAAABm91dHB1dAkBAAAAEWZvcndhcmRQYXNzTGF5ZXIyAAAAAwUAAAAMbGF5ZXIxT3V0cHV0CQAETAAAAAIAAAAAAAB/GbgJAARMAAAAAgD//////3cbZgUAAAADbmlsAP//////xdY0CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAZyZXN1bHQFAAAABm91dHB1dAUAAAADbmlsAAAAADZcM7U=", "height": 3030701, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DqCRv1ayUUrGkR5twZhPSWEwMYD341o2LVcrJTNzDuet Next: GxmRfDVFhMDR3JZvnv8chGtkg2gj3wqrqdAiVh1pAjRP 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 = [[6004965, 6007324], [4141966, 4142525]] | |
5 | 5 | ||
6 | - | let layer1Biases = [- | |
6 | + | let layer1Biases = [-2590503, -6356371] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[8329656, -8971418]] | |
9 | 9 | ||
10 | - | let layer2Biases = [-3161622, 2945010] | |
11 | - | ||
12 | - | let layer3Weights = [[-8939640, 9517362]] | |
13 | - | ||
14 | - | let layer3Biases = [-192349] | |
10 | + | let layer2Biases = [-3811788] | |
15 | 11 | ||
16 | 12 | func sigmoid (z) = { | |
17 | 13 | let e = 2718281 | |
25 | 21 | ||
26 | 22 | ||
27 | 23 | func forwardPassLayer1 (input,weights,biases) = { | |
28 | - | let sum0 = ((((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + fraction(input[2], weights[0][2], 1000000)) + fraction(input[3], weights[0][3], 1000000)) + biases[0]) | |
29 | - | let sum1 = ((((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + fraction(input[2], weights[1][2], 1000000)) + fraction(input[3], weights[1][3], 1000000)) + biases[1]) | |
30 | - | let sum2 = ((((fraction(input[0], weights[2][0], 1000000) + fraction(input[1], weights[2][1], 1000000)) + fraction(input[2], weights[2][2], 1000000)) + fraction(input[3], weights[2][3], 1000000)) + biases[2]) | |
31 | - | let sum3 = ((((fraction(input[0], weights[3][0], 1000000) + fraction(input[1], weights[3][1], 1000000)) + fraction(input[2], weights[3][2], 1000000)) + fraction(input[3], weights[3][3], 1000000)) + biases[3]) | |
32 | - | let sig0 = sigmoid(sum0) | |
33 | - | let sig1 = sigmoid(sum1) | |
34 | - | let sig2 = sigmoid(sum2) | |
35 | - | let sig3 = sigmoid(sum3) | |
36 | - | [sig0, sig1, sig2, sig3] | |
37 | - | } | |
38 | - | ||
39 | - | ||
40 | - | func forwardPassLayer2 (input,weights,biases) = { | |
41 | 24 | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
42 | 25 | let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1]) | |
43 | 26 | let sig0 = sigmoid(sum0) | |
46 | 29 | } | |
47 | 30 | ||
48 | 31 | ||
49 | - | func | |
32 | + | func forwardPassLayer2 (input,weights,bias) = { | |
50 | 33 | let dotProduct = (fraction(input[0], weights[0], 1000000) + fraction(input[1], weights[0], 1000000)) | |
51 | 34 | let sum = (dotProduct + bias) | |
52 | 35 | sigmoid(sum) | |
54 | 37 | ||
55 | 38 | ||
56 | 39 | @Callable(i) | |
57 | - | func predict | |
40 | + | func predict (input1,input2) = { | |
58 | 41 | let scaledInput1 = if ((input1 == 1)) | |
59 | 42 | then 1000000 | |
60 | 43 | else 0 | |
63 | 46 | else 0 | |
64 | 47 | let inputs = [scaledInput1, scaledInput2] | |
65 | 48 | let layer1Output = forwardPassLayer1(inputs, layer1Weights, layer1Biases) | |
66 | - | let layer2Output = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases) | |
67 | - | let output = forwardPassLayer3(layer2Output, [-8939640, 9517362], -192349) | |
49 | + | let output = forwardPassLayer2(layer1Output, [8329656, -8971418], -3811788) | |
68 | 50 | [IntegerEntry("result", output)] | |
69 | 51 | } | |
70 | 52 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[ | |
4 | + | let layer1Weights = [[6004965, 6007324], [4141966, 4142525]] | |
5 | 5 | ||
6 | - | let layer1Biases = [- | |
6 | + | let layer1Biases = [-2590503, -6356371] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[8329656, -8971418]] | |
9 | 9 | ||
10 | - | let layer2Biases = [-3161622, 2945010] | |
11 | - | ||
12 | - | let layer3Weights = [[-8939640, 9517362]] | |
13 | - | ||
14 | - | let layer3Biases = [-192349] | |
10 | + | let layer2Biases = [-3811788] | |
15 | 11 | ||
16 | 12 | func sigmoid (z) = { | |
17 | 13 | let e = 2718281 | |
18 | 14 | let base = 1000000 | |
19 | 15 | let positiveZ = if ((0 > z)) | |
20 | 16 | then -(z) | |
21 | 17 | else z | |
22 | 18 | let expPart = fraction(e, base, positiveZ) | |
23 | 19 | fraction(base, base, (base + expPart)) | |
24 | 20 | } | |
25 | 21 | ||
26 | 22 | ||
27 | 23 | func forwardPassLayer1 (input,weights,biases) = { | |
28 | - | let sum0 = ((((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + fraction(input[2], weights[0][2], 1000000)) + fraction(input[3], weights[0][3], 1000000)) + biases[0]) | |
29 | - | let sum1 = ((((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + fraction(input[2], weights[1][2], 1000000)) + fraction(input[3], weights[1][3], 1000000)) + biases[1]) | |
30 | - | let sum2 = ((((fraction(input[0], weights[2][0], 1000000) + fraction(input[1], weights[2][1], 1000000)) + fraction(input[2], weights[2][2], 1000000)) + fraction(input[3], weights[2][3], 1000000)) + biases[2]) | |
31 | - | let sum3 = ((((fraction(input[0], weights[3][0], 1000000) + fraction(input[1], weights[3][1], 1000000)) + fraction(input[2], weights[3][2], 1000000)) + fraction(input[3], weights[3][3], 1000000)) + biases[3]) | |
32 | - | let sig0 = sigmoid(sum0) | |
33 | - | let sig1 = sigmoid(sum1) | |
34 | - | let sig2 = sigmoid(sum2) | |
35 | - | let sig3 = sigmoid(sum3) | |
36 | - | [sig0, sig1, sig2, sig3] | |
37 | - | } | |
38 | - | ||
39 | - | ||
40 | - | func forwardPassLayer2 (input,weights,biases) = { | |
41 | 24 | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
42 | 25 | let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1]) | |
43 | 26 | let sig0 = sigmoid(sum0) | |
44 | 27 | let sig1 = sigmoid(sum1) | |
45 | 28 | [sig0, sig1] | |
46 | 29 | } | |
47 | 30 | ||
48 | 31 | ||
49 | - | func | |
32 | + | func forwardPassLayer2 (input,weights,bias) = { | |
50 | 33 | let dotProduct = (fraction(input[0], weights[0], 1000000) + fraction(input[1], weights[0], 1000000)) | |
51 | 34 | let sum = (dotProduct + bias) | |
52 | 35 | sigmoid(sum) | |
53 | 36 | } | |
54 | 37 | ||
55 | 38 | ||
56 | 39 | @Callable(i) | |
57 | - | func predict | |
40 | + | func predict (input1,input2) = { | |
58 | 41 | let scaledInput1 = if ((input1 == 1)) | |
59 | 42 | then 1000000 | |
60 | 43 | else 0 | |
61 | 44 | let scaledInput2 = if ((input2 == 1)) | |
62 | 45 | then 1000000 | |
63 | 46 | else 0 | |
64 | 47 | let inputs = [scaledInput1, scaledInput2] | |
65 | 48 | let layer1Output = forwardPassLayer1(inputs, layer1Weights, layer1Biases) | |
66 | - | let layer2Output = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases) | |
67 | - | let output = forwardPassLayer3(layer2Output, [-8939640, 9517362], -192349) | |
49 | + | let output = forwardPassLayer2(layer1Output, [8329656, -8971418], -3811788) | |
68 | 50 | [IntegerEntry("result", output)] | |
69 | 51 | } | |
70 | 52 | ||
71 | 53 |
github/deemru/w8io/6500d08 23.54 ms ◑