tx · 63HL2ET9udUcXr31RyWXVSbexg4dmVv2RJVheQd1HjGm 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.04.16 23:30 [3065797] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "63HL2ET9udUcXr31RyWXVSbexg4dmVv2RJVheQd1HjGm", "fee": 1000000, "feeAssetId": null, "timestamp": 1713299503939, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "5djkcFQ8wp8YHeTXssn5irgfBH5NTLyUXyou19PcU1PP4g7kRx6ekvvW4bomCkWTS5iT8TCJ2DiQs6GbwJSFjxoJ" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAoAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAP//////8djcCQAETAAAAAIAAAAAAAAJfoYFAAAAA25pbAkABEwAAAACCQAETAAAAAIA///////x9YoJAARMAAAAAgD///////YOnQUAAAADbmlsCQAETAAAAAIJAARMAAAAAgD///////2q1gkABEwAAAACAAAAAAAAEXjQBQAAAANuaWwJAARMAAAAAgkABEwAAAACAP//////9IScCQAETAAAAAIA///////2xr8FAAAAA25pbAUAAAADbmlsAAAAAAxsYXllcjFCaWFzZXMJAARMAAAAAgD///////wUPgkABEwAAAACAAAAAAAAA4dVCQAETAAAAAIA///////4v14JAARMAAAAAgAAAAAAAALkTQUAAAADbmlsAAAAAA1sYXllcjJXZWlnaHRzCQAETAAAAAIJAARMAAAAAgD///////Rw7wkABEwAAAACAAAAAAAACG2NCQAETAAAAAIAAAAAAAAKCr8JAARMAAAAAgAAAAAAAAXB6AUAAAADbmlsCQAETAAAAAIJAARMAAAAAgAAAAAAAAp4FgkABEwAAAACAP//////90sDCQAETAAAAAIA///////2ymIJAAR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zCAUAAAALJHQwMzE2MzMyNjcAAAACXzIJAAROAAAAAgkABE4AAAACCQAETgAAAAIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAABnJlc3VsdAUAAAAMbGF5ZXIzT3V0cHV0BQAAAANuaWwFAAAAC2RlYnVnTGF5ZXIxBQAAAAtkZWJ1Z0xheWVyMgUAAAALZGVidWdMYXllcjMAAAAAEnVuKA==", "height": 3065797, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GrYgFiPFtYBHK5z9HdzqdS27NYqqNRNR7QHf3AxwJu1z Next: 2EAsscTWTcXLbZe4WsBMSSeTj11Qf1Abr2c6XurS2kqL 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 = [[-927524, 622214], [-920182, -651619], [-152874, 1145040], [-752484, -604481]] | |
5 | 5 | ||
6 | - | let layer1Biases = [- | |
6 | + | let layer1Biases = [-256962, 231253, -475298, 189517] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[-757521, 552333, 658111, 377320], [686102, -570621, -603550, -332354]] | |
9 | 9 | ||
10 | - | let layer2Biases = [-381178] | |
10 | + | let layer2Biases = [-316162, 294501] | |
11 | + | ||
12 | + | let layer3Weights = [[-893964, 951736]] | |
13 | + | ||
14 | + | let layer3Biases = [-19235] | |
11 | 15 | ||
12 | 16 | func sigmoid (z,debugPrefix) = { | |
13 | 17 | let e = 2718281 | |
24 | 28 | func forwardPassLayer1 (input,weights,biases,debugPrefix) = { | |
25 | 29 | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
26 | 30 | let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1]) | |
27 | - | let $t010671113 = sigmoid(sum0, "Layer1N0") | |
28 | - | let debug0 = $t010671113._1 | |
29 | - | let sig0 = $t010671113._2 | |
30 | - | let $t011181164 = sigmoid(sum1, "Layer1N1") | |
31 | - | let debug1 = $t011181164._1 | |
32 | - | let sig1 = $t011181164._2 | |
31 | + | let sum2 = ((fraction(input[0], weights[2][0], 1000000) + fraction(input[1], weights[2][1], 1000000)) + biases[2]) | |
32 | + | let sum3 = ((fraction(input[0], weights[3][0], 1000000) + fraction(input[1], weights[3][1], 1000000)) + biases[3]) | |
33 | + | let $t014931539 = sigmoid(sum0, "Layer1N0") | |
34 | + | let debug0 = $t014931539._1 | |
35 | + | let sig0 = $t014931539._2 | |
36 | + | let $t015441590 = sigmoid(sum1, "Layer1N1") | |
37 | + | let debug1 = $t015441590._1 | |
38 | + | let sig1 = $t015441590._2 | |
39 | + | let $t015951641 = sigmoid(sum2, "Layer1N2") | |
40 | + | let debug2 = $t015951641._1 | |
41 | + | let sig2 = $t015951641._2 | |
42 | + | let $t016461692 = sigmoid(sum3, "Layer1N3") | |
43 | + | let debug3 = $t016461692._1 | |
44 | + | let sig3 = $t016461692._2 | |
45 | + | $Tuple2([sig0, sig1, sig2, sig3], (((debug0 ++ debug1) ++ debug2) ++ debug3)) | |
46 | + | } | |
47 | + | ||
48 | + | ||
49 | + | func forwardPassLayer2 (input,weights,biases,debugPrefix) = { | |
50 | + | 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]) | |
51 | + | 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]) | |
52 | + | let $t022882334 = sigmoid(sum0, "Layer2N0") | |
53 | + | let debug0 = $t022882334._1 | |
54 | + | let sig0 = $t022882334._2 | |
55 | + | let $t023392385 = sigmoid(sum1, "Layer2N1") | |
56 | + | let debug1 = $t023392385._1 | |
57 | + | let sig1 = $t023392385._2 | |
33 | 58 | $Tuple2([sig0, sig1], (debug0 ++ debug1)) | |
34 | 59 | } | |
35 | 60 | ||
36 | 61 | ||
37 | - | func | |
62 | + | func forwardPassLayer3 (input,weights,biases,debugPrefix) = { | |
38 | 63 | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
39 | - | let $ | |
40 | - | let debug0 = $ | |
41 | - | let sig0 = $ | |
64 | + | let $t026542700 = sigmoid(sum0, "Layer3N0") | |
65 | + | let debug0 = $t026542700._1 | |
66 | + | let sig0 = $t026542700._2 | |
42 | 67 | $Tuple2(sig0, debug0) | |
43 | 68 | } | |
44 | 69 | ||
52 | 77 | then 1000000 | |
53 | 78 | else 0 | |
54 | 79 | let inputs = [scaledInput1, scaledInput2] | |
55 | - | let $t017301828 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
56 | - | let layer1Output = $t017301828._1 | |
57 | - | let debugLayer1 = $t017301828._2 | |
58 | - | let $t018331937 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
59 | - | let layer2Output = $t018331937._1 | |
60 | - | let debugLayer2 = $t018331937._2 | |
61 | - | (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2) | |
80 | + | let $t029513049 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
81 | + | let layer1Output = $t029513049._1 | |
82 | + | let debugLayer1 = $t029513049._2 | |
83 | + | let $t030543158 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
84 | + | let layer2Output = $t030543158._1 | |
85 | + | let debugLayer2 = $t030543158._2 | |
86 | + | let $t031633267 = forwardPassLayer3(layer2Output, layer3Weights, layer3Biases, "Layer3") | |
87 | + | let layer3Output = $t031633267._1 | |
88 | + | let debugLayer3 = $t031633267._2 | |
89 | + | ((([IntegerEntry("result", layer3Output)] ++ debugLayer1) ++ debugLayer2) ++ debugLayer3) | |
62 | 90 | } | |
63 | 91 | ||
64 | 92 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[ | |
4 | + | let layer1Weights = [[-927524, 622214], [-920182, -651619], [-152874, 1145040], [-752484, -604481]] | |
5 | 5 | ||
6 | - | let layer1Biases = [- | |
6 | + | let layer1Biases = [-256962, 231253, -475298, 189517] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[-757521, 552333, 658111, 377320], [686102, -570621, -603550, -332354]] | |
9 | 9 | ||
10 | - | let layer2Biases = [-381178] | |
10 | + | let layer2Biases = [-316162, 294501] | |
11 | + | ||
12 | + | let layer3Weights = [[-893964, 951736]] | |
13 | + | ||
14 | + | let layer3Biases = [-19235] | |
11 | 15 | ||
12 | 16 | func sigmoid (z,debugPrefix) = { | |
13 | 17 | let e = 2718281 | |
14 | 18 | let base = 1000000 | |
15 | 19 | let positiveZ = if ((0 > z)) | |
16 | 20 | then -(z) | |
17 | 21 | else z | |
18 | 22 | let expPart = fraction(e, base, positiveZ) | |
19 | 23 | let sigValue = fraction(base, (base + expPart), base) | |
20 | 24 | $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expPart"), expPart), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue) | |
21 | 25 | } | |
22 | 26 | ||
23 | 27 | ||
24 | 28 | func forwardPassLayer1 (input,weights,biases,debugPrefix) = { | |
25 | 29 | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
26 | 30 | let sum1 = ((fraction(input[0], weights[1][0], 1000000) + fraction(input[1], weights[1][1], 1000000)) + biases[1]) | |
27 | - | let $t010671113 = sigmoid(sum0, "Layer1N0") | |
28 | - | let debug0 = $t010671113._1 | |
29 | - | let sig0 = $t010671113._2 | |
30 | - | let $t011181164 = sigmoid(sum1, "Layer1N1") | |
31 | - | let debug1 = $t011181164._1 | |
32 | - | let sig1 = $t011181164._2 | |
31 | + | let sum2 = ((fraction(input[0], weights[2][0], 1000000) + fraction(input[1], weights[2][1], 1000000)) + biases[2]) | |
32 | + | let sum3 = ((fraction(input[0], weights[3][0], 1000000) + fraction(input[1], weights[3][1], 1000000)) + biases[3]) | |
33 | + | let $t014931539 = sigmoid(sum0, "Layer1N0") | |
34 | + | let debug0 = $t014931539._1 | |
35 | + | let sig0 = $t014931539._2 | |
36 | + | let $t015441590 = sigmoid(sum1, "Layer1N1") | |
37 | + | let debug1 = $t015441590._1 | |
38 | + | let sig1 = $t015441590._2 | |
39 | + | let $t015951641 = sigmoid(sum2, "Layer1N2") | |
40 | + | let debug2 = $t015951641._1 | |
41 | + | let sig2 = $t015951641._2 | |
42 | + | let $t016461692 = sigmoid(sum3, "Layer1N3") | |
43 | + | let debug3 = $t016461692._1 | |
44 | + | let sig3 = $t016461692._2 | |
45 | + | $Tuple2([sig0, sig1, sig2, sig3], (((debug0 ++ debug1) ++ debug2) ++ debug3)) | |
46 | + | } | |
47 | + | ||
48 | + | ||
49 | + | func forwardPassLayer2 (input,weights,biases,debugPrefix) = { | |
50 | + | 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]) | |
51 | + | 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]) | |
52 | + | let $t022882334 = sigmoid(sum0, "Layer2N0") | |
53 | + | let debug0 = $t022882334._1 | |
54 | + | let sig0 = $t022882334._2 | |
55 | + | let $t023392385 = sigmoid(sum1, "Layer2N1") | |
56 | + | let debug1 = $t023392385._1 | |
57 | + | let sig1 = $t023392385._2 | |
33 | 58 | $Tuple2([sig0, sig1], (debug0 ++ debug1)) | |
34 | 59 | } | |
35 | 60 | ||
36 | 61 | ||
37 | - | func | |
62 | + | func forwardPassLayer3 (input,weights,biases,debugPrefix) = { | |
38 | 63 | let sum0 = ((fraction(input[0], weights[0][0], 1000000) + fraction(input[1], weights[0][1], 1000000)) + biases[0]) | |
39 | - | let $ | |
40 | - | let debug0 = $ | |
41 | - | let sig0 = $ | |
64 | + | let $t026542700 = sigmoid(sum0, "Layer3N0") | |
65 | + | let debug0 = $t026542700._1 | |
66 | + | let sig0 = $t026542700._2 | |
42 | 67 | $Tuple2(sig0, debug0) | |
43 | 68 | } | |
44 | 69 | ||
45 | 70 | ||
46 | 71 | @Callable(i) | |
47 | 72 | func predict (input1,input2) = { | |
48 | 73 | let scaledInput1 = if ((input1 == 1)) | |
49 | 74 | then 1000000 | |
50 | 75 | else 0 | |
51 | 76 | let scaledInput2 = if ((input2 == 1)) | |
52 | 77 | then 1000000 | |
53 | 78 | else 0 | |
54 | 79 | let inputs = [scaledInput1, scaledInput2] | |
55 | - | let $t017301828 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
56 | - | let layer1Output = $t017301828._1 | |
57 | - | let debugLayer1 = $t017301828._2 | |
58 | - | let $t018331937 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
59 | - | let layer2Output = $t018331937._1 | |
60 | - | let debugLayer2 = $t018331937._2 | |
61 | - | (([IntegerEntry("result", layer2Output)] ++ debugLayer1) ++ debugLayer2) | |
80 | + | let $t029513049 = forwardPassLayer1(inputs, layer1Weights, layer1Biases, "Layer1") | |
81 | + | let layer1Output = $t029513049._1 | |
82 | + | let debugLayer1 = $t029513049._2 | |
83 | + | let $t030543158 = forwardPassLayer2(layer1Output, layer2Weights, layer2Biases, "Layer2") | |
84 | + | let layer2Output = $t030543158._1 | |
85 | + | let debugLayer2 = $t030543158._2 | |
86 | + | let $t031633267 = forwardPassLayer3(layer2Output, layer3Weights, layer3Biases, "Layer3") | |
87 | + | let layer3Output = $t031633267._1 | |
88 | + | let debugLayer3 = $t031633267._2 | |
89 | + | ((([IntegerEntry("result", layer3Output)] ++ debugLayer1) ++ debugLayer2) ++ debugLayer3) | |
62 | 90 | } | |
63 | 91 | ||
64 | 92 |
github/deemru/w8io/169f3d6 45.97 ms ◑