tx · 7TxoJfzsmTY4kCjXtwb4Rrio9Vm5m292D5RKdp53fR9B 3Moz6HJhucpFh4V3VScXhd9efei4Curytfj: -0.01000000 Waves 2023.10.28 17:52 [2818629] smart account 3Moz6HJhucpFh4V3VScXhd9efei4Curytfj > SELF 0.00000000 Waves
{ "type": 13, "id": "7TxoJfzsmTY4kCjXtwb4Rrio9Vm5m292D5RKdp53fR9B", "fee": 1000000, "feeAssetId": null, "timestamp": 1698504827006, "version": 2, "chainId": 84, "sender": "3Moz6HJhucpFh4V3VScXhd9efei4Curytfj", "senderPublicKey": "Ec1VLg3r1E7mwHmaNidmoKrFAUJ55UVJFq3J1YKRy5Zm", "proofs": [ "5uffz4NGnTfeNm8jiP7WQB2NTfvUEAwap1bkp2KWTbroSBqkiyWRmuUssNUGEDaUU6mjySmQiJaV27J2ZzkR6frk" ], "script": "base64:BgIHCAISAwoBEQwAB3NwZWNpZXMJAMwIAgILSXJpcy1zZXRvc2EJAMwIAgIPSXJpcy12ZXJzaWNvbG9yCQDMCAICDklyaXMtdmlyZ2luaWNhBQNuaWwAB3dlaWdodDEJAMwIAgkAzAgCAI0wCQDMCAIAhuj/////////AQkAzAgCAMZeCQDMCAIAmYcBBQNuaWwJAMwIAgkAzAgCAKDh/////////wEJAMwIAgD36/////////8BCQDMCAIAgOr/////////AQkAzAgCAIgDBQNuaWwJAMwIAgkAzAgCAOkzCQDMCAIArAIJAMwIAgCrWQkAzAgCAKVbBQNuaWwJAMwIAgkAzAgCALUgCQDMCAIAodn/////////AQkAzAgCAM/n/////////wEJAMwIAgCVBwUDbmlsCQDMCAIJAMwIAgCmMQkAzAgCALq3/////////wEJAMwIAgDERAkAzAgCAIoCBQNuaWwJAMwIAgkAzAgCAPH7/////////wEJAMwIAgDqKwkAzAgCANXo/////////wEJAMwIAgDNnf////////8BBQNuaWwJAMwIAgkAzAgCAMw2CQDMCAIAw9T/////////AQkAzAgCAPlZCQDMCAIA/XIFA25pbAkAzAgCCQDMCAIAgBUJAMwIAgCvLgkAzAgCALi1/////////wEJAMwIAgCIu/////////8BBQNuaWwJAMwIAgkAzAgCAKoSCQDMCAIApDQJAMwIAgCTzv////////8BCQDMCAIArJj/////////AQUDbmlsCQDMCAIJAMwIAgDkFgkAzAgCAPpUCQDMCAIAorH/////////AQkAzAgCAJSp/////////wEFA25pbAkAzAgCCQDMCAIAx+b/////////AQkAzAgCAJqUAQkAzAgCANaU/////////wEJAMwIAgCs7v7///////8BBQNuaWwJAMwIAgkAzAgCAK1TCQDMCAIA7sj/////////AQkAzAgCAL+DAQkAzAgCALuHAQUDbmlsBQNuaWwAB2JpYXNlczEJAMwIAgCR7v////////8BCQDMCAIA0Ob/////////AQkAzAgCAL7V/////////wEJAMwIAgCe4v////////8BCQDMCAIA8xwJAMwIAgDvWwkAzAgCAP/1/////////wEJAMwIAgCGWAkAzAgCAINjCQDMCAIA6F0JAMwIAgCNVAkAzAgCALzv/////////wEFA25pbAAHd2VpZ2h0MgkAzAgCCQDMCAIAvZL/////////AQkAzAgCANb+/////////wEJAMwIAgCYmv////////8BCQDMCAIAiBMJAMwIAgCjpP////////8BCQDMCAIAy2sJAMwIAgCzh/////////8BCQDMCAIAwGMJAMwIAgD0agkAzAgCAPJzCQDMCAIA8Y4BCQDMCAIAnp7/////////AQUDbmlsCQDMCAIJAMwIAgDt+f////////8BCQDMCAIAjQQJAMwIAgDW1P////////8BCQDMCAIA5P//////////AQkAzAgCAMIdCQDMCAIA0nIJAMwIAgDKAgkAzAgCAMJ4CQDMCAIAs2sJAMwIAgCXTgkAzAgCAKja/v///////wEJAMwIAgDRAwUDbmlsCQDMCAIJAMwIAgChMAkAzAgCAMUICQDMCAIAsEsJAMwIAgChDgkAzAgCALcKCQDMCAIAg97+////////AQkAzAgCAMY1CQDMCAIA17f+////////AQkAzAgCAJ26/v///////wEJAMwIAgCy8P7///////8BCQDMCAIAoLz/////////AQkAzAgCAKI8BQNuaWwFA25pbAAFYmlhczIJAMwIAgC3MwkAzAgCAMgyCQDM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MCBQZvdXRwdXQAAAkAkQMCBQZvdXRwdXQAAQAAAAEEBG1heDIDCQBmAgUEbWF4MQkAkQMCBQZvdXRwdXQAAgUEbWF4MQACBQRtYXgyAQFpAQpwcmVkaWN0aW9uAQVpbnB1dAQGb3V0cHV0CQEMZm9yd2FyZF9wcm9wAQUFaW5wdXQEDWNhbGxlckFkZHJlc3MJAKUIAQgFAWkGY2FsbGVyBARwcmVkCQEJZmluZF9wcmVkAQUGb3V0cHV0CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFDWNhbGxlckFkZHJlc3MCAl8xCQCRAwIFBm91dHB1dAAACQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFDWNhbGxlckFkZHJlc3MCAl8yCQCRAwIFBm91dHB1dAABCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFDWNhbGxlckFkZHJlc3MCAl8zCQCRAwIFBm91dHB1dAACCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUNY2FsbGVyQWRkcmVzcwICX3AJAJEDAgUHc3BlY2llcwUEcHJlZAUDbmlsAICFX34=", "height": 2818629, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3yXAAVQ7hMyV4mpM7j8V8iJYvsLoYdyi3DGY5qod2bQT Next: edHHWZhzMocFaEmRgCHdG39rnEcosEpcE9P1JVNUaNo Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | ||
30 | 30 | ||
31 | 31 | func calculateFirstLayer (input) = { | |
32 | - | let | |
33 | - | let | |
34 | - | let | |
35 | - | let | |
36 | - | let | |
37 | - | let | |
38 | - | let | |
39 | - | let | |
40 | - | let | |
41 | - | let | |
42 | - | let | |
43 | - | let | |
44 | - | [ | |
32 | + | let output_layer1 = relu(calc(input, weight1[0], biases1[0])) | |
33 | + | let output_layer2 = relu(calc(input, weight1[1], biases1[1])) | |
34 | + | let output_layer3 = relu(calc(input, weight1[2], biases1[2])) | |
35 | + | let output_layer4 = relu(calc(input, weight1[3], biases1[3])) | |
36 | + | let output_layer5 = relu(calc(input, weight1[4], biases1[4])) | |
37 | + | let output_layer6 = relu(calc(input, weight1[5], biases1[5])) | |
38 | + | let output_layer7 = relu(calc(input, weight1[6], biases1[6])) | |
39 | + | let output_layer8 = relu(calc(input, weight1[7], biases1[7])) | |
40 | + | let output_layer9 = relu(calc(input, weight1[8], biases1[8])) | |
41 | + | let output_layer10 = relu(calc(input, weight1[9], biases1[9])) | |
42 | + | let output_layer11 = relu(calc(input, weight1[10], biases1[10])) | |
43 | + | let output_layer12 = relu(calc(input, weight1[11], biases1[11])) | |
44 | + | [output_layer1, output_layer2, output_layer3, output_layer4, output_layer5, output_layer6, output_layer7, output_layer8, output_layer9, output_layer10, output_layer11, output_layer12] | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let species = ["Iris-setosa", "Iris-versicolor", "Iris-virginica"] | |
5 | 5 | ||
6 | 6 | let weight1 = [[6157, -3066, 12102, 17305], [-3936, -2569, -2816, 392], [6633, 300, 11435, 11685], [4149, -4959, -3121, 917], [6310, -9286, 8772, 266], [-527, 5610, -2987, -12595], [6988, -5565, 11513, 14717], [2688, 5935, -9544, -8824], [2346, 6692, -6381, -13268], [2916, 10874, -10078, -11116], [-3257, 18970, -13738, -18644], [10669, -7058, 16831, 17339]] | |
7 | 7 | ||
8 | 8 | let biases1 = [-2287, -3248, -5442, -3810, 3699, 11759, -1281, 11270, 12675, 12008, 10765, -2116] | |
9 | 9 | ||
10 | 10 | let weight2 = [[-14019, -170, -13032, 2440, -11741, 13771, -15437, 12736, 13684, 14834, 18289, -12514], [-787, 525, -5546, -28, 3778, 14674, 330, 15426, 13747, 10007, -21208, 465], [6177, 1093, 9648, 1825, 1335, -20733, 6854, -25641, -25315, -18382, -8672, 7714]] | |
11 | 11 | ||
12 | 12 | let bias2 = [6583, 6472, -4596] | |
13 | 13 | ||
14 | 14 | func relu (x) = if ((x > 0)) | |
15 | 15 | then x | |
16 | 16 | else 0 | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func calc (input,weight,bias) = { | |
20 | 20 | let calc = (((((input[0] * weight[0]) + (input[1] * weight[1])) + (input[2] * weight[2])) + (input[3] * weight[3])) + bias) | |
21 | 21 | calc | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func calc_second_layer (input,weight,bias) = { | |
26 | 26 | let calc_second = (((((((((((((input[0] * weight[0]) + (input[1] * weight[1])) + (input[2] * weight[2])) + (input[3] * weight[3])) + (input[4] * weight[4])) + (input[5] * weight[5])) + (input[6] * weight[6])) + (input[7] * weight[7])) + (input[8] * weight[8])) + (input[9] * weight[9])) + (input[10] * weight[10])) + (input[11] * weight[11])) + bias) | |
27 | 27 | calc_second | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func calculateFirstLayer (input) = { | |
32 | - | let | |
33 | - | let | |
34 | - | let | |
35 | - | let | |
36 | - | let | |
37 | - | let | |
38 | - | let | |
39 | - | let | |
40 | - | let | |
41 | - | let | |
42 | - | let | |
43 | - | let | |
44 | - | [ | |
32 | + | let output_layer1 = relu(calc(input, weight1[0], biases1[0])) | |
33 | + | let output_layer2 = relu(calc(input, weight1[1], biases1[1])) | |
34 | + | let output_layer3 = relu(calc(input, weight1[2], biases1[2])) | |
35 | + | let output_layer4 = relu(calc(input, weight1[3], biases1[3])) | |
36 | + | let output_layer5 = relu(calc(input, weight1[4], biases1[4])) | |
37 | + | let output_layer6 = relu(calc(input, weight1[5], biases1[5])) | |
38 | + | let output_layer7 = relu(calc(input, weight1[6], biases1[6])) | |
39 | + | let output_layer8 = relu(calc(input, weight1[7], biases1[7])) | |
40 | + | let output_layer9 = relu(calc(input, weight1[8], biases1[8])) | |
41 | + | let output_layer10 = relu(calc(input, weight1[9], biases1[9])) | |
42 | + | let output_layer11 = relu(calc(input, weight1[10], biases1[10])) | |
43 | + | let output_layer12 = relu(calc(input, weight1[11], biases1[11])) | |
44 | + | [output_layer1, output_layer2, output_layer3, output_layer4, output_layer5, output_layer6, output_layer7, output_layer8, output_layer9, output_layer10, output_layer11, output_layer12] | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func calculateSecondLayer (input) = { | |
49 | 49 | let output_layer1 = calc_second_layer(input, weight2[0], bias2[0]) | |
50 | 50 | let output_layer2 = calc_second_layer(input, weight2[1], bias2[1]) | |
51 | 51 | let output_layer3 = calc_second_layer(input, weight2[2], bias2[2]) | |
52 | 52 | [output_layer1, output_layer2, output_layer3] | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func forward_prop (input) = { | |
57 | 57 | let first_layer = calculateFirstLayer(input) | |
58 | 58 | let second_layer = calculateSecondLayer(first_layer) | |
59 | 59 | second_layer | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func find_pred (output) = { | |
64 | 64 | let max1 = if ((output[0] > output[1])) | |
65 | 65 | then 0 | |
66 | 66 | else 1 | |
67 | 67 | let max2 = if ((max1 > output[2])) | |
68 | 68 | then max1 | |
69 | 69 | else 2 | |
70 | 70 | max2 | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | @Callable(i) | |
75 | 75 | func prediction (input) = { | |
76 | 76 | let output = forward_prop(input) | |
77 | 77 | let callerAddress = toString(i.caller) | |
78 | 78 | let pred = find_pred(output) | |
79 | 79 | [IntegerEntry((callerAddress + "_1"), output[0]), IntegerEntry((callerAddress + "_2"), output[1]), IntegerEntry((callerAddress + "_3"), output[2]), StringEntry((callerAddress + "_p"), species[pred])] | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 |
github/deemru/w8io/169f3d6 39.28 ms ◑