tx · GrYgFiPFtYBHK5z9HdzqdS27NYqqNRNR7QHf3AxwJu1z 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY: -0.01000000 Waves 2024.04.16 23:30 [3065796] smart account 3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY > SELF 0.00000000 Waves
{ "type": 13, "id": "GrYgFiPFtYBHK5z9HdzqdS27NYqqNRNR7QHf3AxwJu1z", "fee": 1000000, "feeAssetId": null, "timestamp": 1713299337067, "version": 2, "chainId": 84, "sender": "3N3n75UqB8G1GKmXFr4zPhKCjGcqJPRSuJY", "senderPublicKey": "2AWdnJuBMzufXSjTvzVcawBQQhnhF1iXR6QNVgwn33oc", "proofs": [ "4xgM47Ng9cNwazp4NCtZTZthXRuUDF6s7eVwR11imeCnbo3QDCMR89CrbGbWNiC18yhZUYB8SgnCA4kFxjsF7x4H" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAcAAAAADWxheWVyMVdlaWdodHMJAARMAAAAAgkABEwAAAACAAAAAAAACSmwCQAETAAAAAIAAAAAAAAJKpwFAAAAA25pbAkABEwAAAACCQAETAAAAAIAAAAAAAAGUfUJAARMAAAAAgAAAAAAAAZSLAUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMUJpYXNlcwkABEwAAAACAP///////AwWCQAETAAAAAIA///////2TQsFAAAAA25pbAAAAAANbGF5ZXIyV2VpZ2h0cwkABEwAAAACCQAETAAAAAIAAAAAAAAMtcYJAARMAAAAAgD///////JPigUAAAADbmlsBQAAAANuaWwAAAAADGxheWVyMkJpYXNlcwkABEwAAAACAP//////+i8GBQAAAANuaWwBAAAAB3NpZ21vaWQAAAACAAAAAXoAAAALZGVidWdQcmVmaXgEAAAAAWUAAAAAAAApekkEAAAABGJhc2UAAAAAAAAPQkAEAAAACXBvc2l0aXZlWgMJAABmAAAAAgAAAAAAAAAAAAUAAAABegkBAAAAAS0AAAABBQAAAAF6BQAAAAF6BAAAAAdleHBQYXJ0CQAAawAA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bcSU=", "height": 3065796, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: M1cUmR4buw3m1ApiJjeGXmKDuNfXDeYV5g723kcmemh Next: 63HL2ET9udUcXr31RyWXVSbexg4dmVv2RJVheQd1HjGm Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[600496, 600732], [ | |
4 | + | let layer1Weights = [[600496, 600732], [414197, 414252]] | |
5 | 5 | ||
6 | 6 | let layer1Biases = [-259050, -635637] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[832966, -897142]] | |
9 | 9 | ||
10 | 10 | let layer2Biases = [-381178] | |
11 | 11 | ||
16 | 16 | then -(z) | |
17 | 17 | else z | |
18 | 18 | let expPart = fraction(e, base, positiveZ) | |
19 | - | let sigValue = fraction(base, | |
19 | + | let sigValue = fraction(base, (base + expPart), base) | |
20 | 20 | $Tuple2([IntegerEntry((debugPrefix + "positiveZ"), positiveZ), IntegerEntry((debugPrefix + "expPart"), expPart), IntegerEntry((debugPrefix + "sigValue"), sigValue)], sigValue) | |
21 | 21 | } | |
22 | 22 | ||
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 | - | let $ | |
28 | - | let debug0 = $ | |
29 | - | let sig0 = $ | |
30 | - | let $ | |
31 | - | let debug1 = $ | |
32 | - | let sig1 = $ | |
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 | |
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 | - | let $ | |
40 | - | let debug0 = $ | |
41 | - | let sig0 = $ | |
42 | - | $Tuple2( | |
39 | + | let $t014331479 = sigmoid(sum0, "Layer2N0") | |
40 | + | let debug0 = $t014331479._1 | |
41 | + | let sig0 = $t014331479._2 | |
42 | + | $Tuple2(sig0, debug0) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
52 | 52 | then 1000000 | |
53 | 53 | else 0 | |
54 | 54 | let inputs = [scaledInput1, scaledInput2] | |
55 | - | let $ | |
56 | - | let layer1Output = $ | |
57 | - | let debugLayer1 = $ | |
58 | - | let $ | |
59 | - | let layer2Output = $ | |
60 | - | let debugLayer2 = $ | |
61 | - | (([IntegerEntry("result", layer2Output | |
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) | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let layer1Weights = [[600496, 600732], [ | |
4 | + | let layer1Weights = [[600496, 600732], [414197, 414252]] | |
5 | 5 | ||
6 | 6 | let layer1Biases = [-259050, -635637] | |
7 | 7 | ||
8 | - | let layer2Weights = [[ | |
8 | + | let layer2Weights = [[832966, -897142]] | |
9 | 9 | ||
10 | 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 | - | let sigValue = fraction(base, | |
19 | + | let sigValue = fraction(base, (base + expPart), base) | |
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 | - | let $ | |
28 | - | let debug0 = $ | |
29 | - | let sig0 = $ | |
30 | - | let $ | |
31 | - | let debug1 = $ | |
32 | - | let sig1 = $ | |
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 | |
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 | - | let $ | |
40 | - | let debug0 = $ | |
41 | - | let sig0 = $ | |
42 | - | $Tuple2( | |
39 | + | let $t014331479 = sigmoid(sum0, "Layer2N0") | |
40 | + | let debug0 = $t014331479._1 | |
41 | + | let sig0 = $t014331479._2 | |
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 | - | let $ | |
56 | - | let layer1Output = $ | |
57 | - | let debugLayer1 = $ | |
58 | - | let $ | |
59 | - | let layer2Output = $ | |
60 | - | let debugLayer2 = $ | |
61 | - | (([IntegerEntry("result", layer2Output | |
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) | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 |
github/deemru/w8io/169f3d6 31.03 ms ◑