text: -- This SQL code was generated by sklearn2sql (development version).
  -- Copyright 2018
  
  -- Model : KerasClassifier_LSTM
  -- Dataset : FourClass_10
  -- Database : sqlite
  
  
  -- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
  
  
  
  -- Model deployment code
  
  WITH RECURSIVE keras_input AS 
  (SELECT "ADS"."KEY" AS "KEY", "ADS"."Feature_0" AS "Feature_0", "ADS"."Feature_1" AS "Feature_1", "ADS"."Feature_2" AS "Feature_2", "ADS"."Feature_3" AS "Feature_3", "ADS"."Feature_4" AS "Feature_4", "ADS"."Feature_5" AS "Feature_5", "ADS"."Feature_6" AS "Feature_6", "ADS"."Feature_7" AS "Feature_7", "ADS"."Feature_8" AS "Feature_8", "ADS"."Feature_9" AS "Feature_9" 
  FROM "FourClass_10" AS "ADS"), 
  keras_input_1 AS 
  (SELECT keras_input."KEY" AS "KEY", keras_input."Feature_0" AS "Feature_0", keras_input."Feature_1" AS "Feature_1", keras_input."Feature_2" AS "Feature_2", keras_input."Feature_3" AS "Feature_3", keras_input."Feature_4" AS "Feature_4", keras_input."Feature_5" AS "Feature_5", keras_input."Feature_6" AS "Feature_6", keras_input."Feature_7" AS "Feature_7", keras_input."Feature_8" AS "Feature_8", keras_input."Feature_9" AS "Feature_9" 
  FROM keras_input), 
  keras_input_1_rn AS 
  (SELECT (SELECT count(t."KEY") AS count_1 
  FROM (SELECT keras_input_1."KEY" AS "KEY" 
  FROM keras_input_1) AS t 
  WHERE t."KEY" <= keras_input_1."KEY") AS rn, keras_input_1."KEY" AS "KEY", keras_input_1."Feature_0" AS "Feature_0", keras_input_1."Feature_1" AS "Feature_1", keras_input_1."Feature_2" AS "Feature_2", keras_input_1."Feature_3" AS "Feature_3", keras_input_1."Feature_4" AS "Feature_4", keras_input_1."Feature_5" AS "Feature_5", keras_input_1."Feature_6" AS "Feature_6", keras_input_1."Feature_7" AS "Feature_7", keras_input_1."Feature_8" AS "Feature_8", keras_input_1."Feature_9" AS "Feature_9" 
  FROM keras_input_1), 
  lstm_input_kernel_bias AS 
  (SELECT keras_input_1_rn.rn AS rn, keras_input_1_rn."KEY" AS "KEY", keras_input_1_rn."Feature_0" AS "Feature_0", keras_input_1_rn."Feature_1" AS "Feature_1", keras_input_1_rn."Feature_2" AS "Feature_2", keras_input_1_rn."Feature_3" AS "Feature_3", keras_input_1_rn."Feature_4" AS "Feature_4", keras_input_1_rn."Feature_5" AS "Feature_5", keras_input_1_rn."Feature_6" AS "Feature_6", keras_input_1_rn."Feature_7" AS "Feature_7", keras_input_1_rn."Feature_8" AS "Feature_8", keras_input_1_rn."Feature_9" AS "Feature_9", 0.17970746367349674 + -0.0787776693450094 * keras_input_1_rn."Feature_0" + -0.009197609425304693 * keras_input_1_rn."Feature_1" + -0.17023090067686375 * keras_input_1_rn."Feature_2" + -0.12024101449380926 * keras_input_1_rn."Feature_3" + 0.6232346654617928 * keras_input_1_rn."Feature_4" + -0.24613138847297147 * keras_input_1_rn."Feature_5" + -0.12348695991598792 * keras_input_1_rn."Feature_6" + 0.3821770999459343 * keras_input_1_rn."Feature_7" + 0.20938426906828078 * keras_input_1_rn."Feature_8" + 0.12352086153309146 * keras_input_1_rn."Feature_9" AS dot_prod_i_1, -0.05822842818260122 + 0.417137975640654 * keras_input_1_rn."Feature_0" + 0.2864207664971066 * keras_input_1_rn."Feature_1" + 0.25360581244386315 * keras_input_1_rn."Feature_2" + -0.08571299635457848 * keras_input_1_rn."Feature_3" + 0.08033015490390517 * keras_input_1_rn."Feature_4" + 0.4122308234307741 * keras_input_1_rn."Feature_5" + 0.2459042719846345 * keras_input_1_rn."Feature_6" + -0.2008634937629015 * keras_input_1_rn."Feature_7" + 0.03490109994849495 * keras_input_1_rn."Feature_8" + 0.534632957586614 * keras_input_1_rn."Feature_9" AS dot_prod_i_2, 0.029976851914389598 + -0.3218377598655138 * keras_input_1_rn."Feature_0" + -0.5530234362323172 * keras_input_1_rn."Feature_1" + -0.32624166230465523 * keras_input_1_rn."Feature_2" + -0.021276364606019203 * keras_input_1_rn."Feature_3" + 0.1825019518182223 * keras_input_1_rn."Feature_4" + 0.3386495895851138 * keras_input_1_rn."Feature_5" + 0.21148131713413829 * keras_input_1_rn."Feature_6" + -0.5178802721473102 * keras_input_1_rn."Feature_7" + -0.4466567073412389 * keras_input_1_rn."Feature_8" + -0.05254161515253494 * keras_input_1_rn."Feature_9" AS dot_prod_i_3, 0.9615108364667326 + -0.20401857668246157 * keras_input_1_rn."Feature_0" + -0.1633623808556855 * keras_input_1_rn."Feature_1" + 0.5221071032023323 * keras_input_1_rn."Feature_2" + -0.23144948266944715 * keras_input_1_rn."Feature_3" + 0.07079142717152892 * keras_input_1_rn."Feature_4" + 0.28413822391556104 * keras_input_1_rn."Feature_5" + 0.4614087615937554 * keras_input_1_rn."Feature_6" + 0.41584198347973733 * keras_input_1_rn."Feature_7" + -0.06028741939924187 * keras_input_1_rn."Feature_8" + 0.4640978541665819 * keras_input_1_rn."Feature_9" AS dot_prod_f_1, 0.9338914823589419 + -0.35902484541595947 * keras_input_1_rn."Feature_0" + -0.3775203376166257 * keras_input_1_rn."Feature_1" + -0.44224584070646694 * keras_input_1_rn."Feature_2" + -0.5299589106053212 * keras_input_1_rn."Feature_3" + -0.35524807460711844 * keras_input_1_rn."Feature_4" + 0.4335730352925888 * keras_input_1_rn."Feature_5" + -0.20681681102842653 * keras_input_1_rn."Feature_6" + -0.13085623480191041 * keras_input_1_rn."Feature_7" + -0.22536122747267176 * keras_input_1_rn."Feature_8" + 0.06631259633930034 * keras_input_1_rn."Feature_9" AS dot_prod_f_2, 0.9179846733057166 + 0.20021642975799006 * keras_input_1_rn."Feature_0" + 0.03710918967583164 * keras_input_1_rn."Feature_1" + 0.31076997151154023 * keras_input_1_rn."Feature_2" + 0.1265017967794327 * keras_input_1_rn."Feature_3" + 0.0022382501968979816 * keras_input_1_rn."Feature_4" + 0.26734993979968247 * keras_input_1_rn."Feature_5" + -0.39597477739209913 * keras_input_1_rn."Feature_6" + 0.13953926953770227 * keras_input_1_rn."Feature_7" + -0.16631658168352798 * keras_input_1_rn."Feature_8" + -0.09711735521172893 * keras_input_1_rn."Feature_9" AS dot_prod_f_3, -0.07493495806669823 + 0.1930074632574346 * keras_input_1_rn."Feature_0" + 0.12728351768472618 * keras_input_1_rn."Feature_1" + 0.15500842580674545 * keras_input_1_rn."Feature_2" + 0.6571849209561322 * keras_input_1_rn."Feature_3" + -0.12809912794906703 * keras_input_1_rn."Feature_4" + 0.017935279899546647 * keras_input_1_rn."Feature_5" + -0.40666593747669283 * keras_input_1_rn."Feature_6" + -0.031066563158366426 * keras_input_1_rn."Feature_7" + -0.14558039011311763 * keras_input_1_rn."Feature_8" + 0.4140469040339139 * keras_input_1_rn."Feature_9" AS dot_prod_c_1, -0.02715669490446667 + -0.14633216982351638 * keras_input_1_rn."Feature_0" + 0.43015689477908114 * keras_input_1_rn."Feature_1" + 0.5316234116948745 * keras_input_1_rn."Feature_2" + -0.1434162532260725 * keras_input_1_rn."Feature_3" + 0.23715058871344116 * keras_input_1_rn."Feature_4" + 0.550421144796619 * keras_input_1_rn."Feature_5" + 0.4936460540036144 * keras_input_1_rn."Feature_6" + -0.4457973269087321 * keras_input_1_rn."Feature_7" + 0.17396142943681356 * keras_input_1_rn."Feature_8" + -0.21242844347754997 * keras_input_1_rn."Feature_9" AS dot_prod_c_2, 0.027702177814940852 + -0.4074188452667893 * keras_input_1_rn."Feature_0" + -0.4961348372651167 * keras_input_1_rn."Feature_1" + 0.21231107228390117 * keras_input_1_rn."Feature_2" + -0.4908642522947441 * keras_input_1_rn."Feature_3" + 0.04362086423092728 * keras_input_1_rn."Feature_4" + 0.23431521947147163 * keras_input_1_rn."Feature_5" + -0.14785916923190018 * keras_input_1_rn."Feature_6" + -0.240864024374449 * keras_input_1_rn."Feature_7" + 0.3136273645756769 * keras_input_1_rn."Feature_8" + 0.21619055107638377 * keras_input_1_rn."Feature_9" AS dot_prod_c_3, -0.03223975792712481 + 0.09771302008671315 * keras_input_1_rn."Feature_0" + -0.23529995666476422 * keras_input_1_rn."Feature_1" + -0.21871623543000207 * keras_input_1_rn."Feature_2" + 0.22317841344562622 * keras_input_1_rn."Feature_3" + 0.2588315351776665 * keras_input_1_rn."Feature_4" + 0.42946875316104605 * keras_input_1_rn."Feature_5" + 0.07394187019078943 * keras_input_1_rn."Feature_6" + -0.28462634863229236 * keras_input_1_rn."Feature_7" + -0.053162809924934724 * keras_input_1_rn."Feature_8" + -0.02667524505349452 * keras_input_1_rn."Feature_9" AS dot_prod_o_1, -0.16111126167250403 + -0.4644189835163299 * keras_input_1_rn."Feature_0" + -0.03688292201281057 * keras_input_1_rn."Feature_1" + -0.09089839129073984 * keras_input_1_rn."Feature_2" + -0.5300406332520456 * keras_input_1_rn."Feature_3" + -0.24401599069081267 * keras_input_1_rn."Feature_4" + -0.33669989576751985 * keras_input_1_rn."Feature_5" + 0.39155937857346745 * keras_input_1_rn."Feature_6" + -0.3222403091149625 * keras_input_1_rn."Feature_7" + 0.013910065894775314 * keras_input_1_rn."Feature_8" + 0.16750708078671472 * keras_input_1_rn."Feature_9" AS dot_prod_o_2, -0.16781882567084397 + -0.21842586456811341 * keras_input_1_rn."Feature_0" + -0.34625002618947864 * keras_input_1_rn."Feature_1" + -0.06787431946792177 * keras_input_1_rn."Feature_2" + 0.2984983383012134 * keras_input_1_rn."Feature_3" + 0.37216732162119903 * keras_input_1_rn."Feature_4" + -0.4401704746824753 * keras_input_1_rn."Feature_5" + -0.30231753632750985 * keras_input_1_rn."Feature_6" + 0.06617844743057233 * keras_input_1_rn."Feature_7" + 0.24517288857899872 * keras_input_1_rn."Feature_8" + -0.41788282621394435 * keras_input_1_rn."Feature_9" AS dot_prod_o_3 
  FROM keras_input_1_rn), 
  rnn_cte_lstm_1(rn_1, "KEY", "PreviousState_1", "PreviousState_2", "PreviousState_3", "PreviousState_4", "PreviousState_5", "PreviousState_6", "State_1", "State_2", "State_3", "State_4", "State_5", "State_6") AS 
  (SELECT lstm_input_kernel_bias.rn AS rn_1, lstm_input_kernel_bias."KEY" AS "KEY", CAST(0.0 AS FLOAT) AS "PreviousState_1", CAST(0.0 AS FLOAT) AS "PreviousState_2", CAST(0.0 AS FLOAT) AS "PreviousState_3", CAST(0.0 AS FLOAT) AS "PreviousState_4", CAST(0.0 AS FLOAT) AS "PreviousState_5", CAST(0.0 AS FLOAT) AS "PreviousState_6", max(lstm_input_kernel_bias.dot_prod_o_1 + 0.0, 0) * tanh(max(lstm_input_kernel_bias.dot_prod_i_1 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_1 + 0.0) + max(lstm_input_kernel_bias.dot_prod_f_1 + 0.0, 0) * 0.0) AS "State_1", max(lstm_input_kernel_bias.dot_prod_o_2 + 0.0, 0) * tanh(max(lstm_input_kernel_bias.dot_prod_i_2 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_2 + 0.0) + max(lstm_input_kernel_bias.dot_prod_f_2 + 0.0, 0) * 0.0) AS "State_2", max(lstm_input_kernel_bias.dot_prod_o_3 + 0.0, 0) * tanh(max(lstm_input_kernel_bias.dot_prod_i_3 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_3 + 0.0) + max(lstm_input_kernel_bias.dot_prod_f_3 + 0.0, 0) * 0.0) AS "State_3", max(lstm_input_kernel_bias.dot_prod_i_1 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_1 + 0.0) + max(lstm_input_kernel_bias.dot_prod_f_1 + 0.0, 0) * 0.0 AS "State_4", max(lstm_input_kernel_bias.dot_prod_i_2 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_2 + 0.0) + max(lstm_input_kernel_bias.dot_prod_f_2 + 0.0, 0) * 0.0 AS "State_5", max(lstm_input_kernel_bias.dot_prod_i_3 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_3 + 0.0) + max(lstm_input_kernel_bias.dot_prod_f_3 + 0.0, 0) * 0.0 AS "State_6" 
  FROM lstm_input_kernel_bias 
  WHERE lstm_input_kernel_bias.rn = 1 UNION ALL SELECT lstm_input_kernel_bias.rn AS rn, lstm_input_kernel_bias."KEY" AS "KEY", rnn_cte_lstm_1."State_1" AS "PreviousState_1", rnn_cte_lstm_1."State_2" AS "PreviousState_2", rnn_cte_lstm_1."State_3" AS "PreviousState_3", rnn_cte_lstm_1."State_4" AS "PreviousState_4", rnn_cte_lstm_1."State_5" AS "PreviousState_5", rnn_cte_lstm_1."State_6" AS "PreviousState_6", max(lstm_input_kernel_bias.dot_prod_o_1 + -0.23833719851113644 * rnn_cte_lstm_1."State_1" + 0.05697445610560118 * rnn_cte_lstm_1."State_2" + -0.10108138642224408 * rnn_cte_lstm_1."State_3", 0) * tanh(max(lstm_input_kernel_bias.dot_prod_i_1 + 0.0948482662884923 * rnn_cte_lstm_1."State_1" + 0.3290837186295132 * rnn_cte_lstm_1."State_2" + -0.0773609835753345 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_1 + 0.07724349033417974 * rnn_cte_lstm_1."State_1" + -0.11258365678493894 * rnn_cte_lstm_1."State_2" + 0.500700076751556 * rnn_cte_lstm_1."State_3") + max(lstm_input_kernel_bias.dot_prod_f_1 + -0.5274598641164077 * rnn_cte_lstm_1."State_1" + 0.1187589124926481 * rnn_cte_lstm_1."State_2" + -0.014756337288640524 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_4") AS "State_1", max(lstm_input_kernel_bias.dot_prod_o_2 + 0.07571875536133268 * rnn_cte_lstm_1."State_1" + 0.5445155329989007 * rnn_cte_lstm_1."State_2" + -0.24130858833890798 * rnn_cte_lstm_1."State_3", 0) * tanh(max(lstm_input_kernel_bias.dot_prod_i_2 + -0.19470526290583107 * rnn_cte_lstm_1."State_1" + -0.31042807618833096 * rnn_cte_lstm_1."State_2" + -0.12971487239743895 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_2 + 0.18087455265734442 * rnn_cte_lstm_1."State_1" + 0.37934828569621243 * rnn_cte_lstm_1."State_2" + 0.16353022061755923 * rnn_cte_lstm_1."State_3") + max(lstm_input_kernel_bias.dot_prod_f_2 + 0.35645732975628885 * rnn_cte_lstm_1."State_1" + -0.06659166189984893 * rnn_cte_lstm_1."State_2" + 0.5454130939823799 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_5") AS "State_2", max(lstm_input_kernel_bias.dot_prod_o_3 + 0.5946596570612948 * rnn_cte_lstm_1."State_1" + -0.26173828866669985 * rnn_cte_lstm_1."State_2" + -0.46406451213597805 * rnn_cte_lstm_1."State_3", 0) * tanh(max(lstm_input_kernel_bias.dot_prod_i_3 + -0.05806186719723443 * rnn_cte_lstm_1."State_1" + 0.30802074511598804 * rnn_cte_lstm_1."State_2" + -0.1789347032135904 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_3 + -0.029767030439820548 * rnn_cte_lstm_1."State_1" + -0.20259645853435093 * rnn_cte_lstm_1."State_2" + -0.14932499067731878 * rnn_cte_lstm_1."State_3") + max(lstm_input_kernel_bias.dot_prod_f_3 + 0.4032960143280446 * rnn_cte_lstm_1."State_1" + 0.2328833636408148 * rnn_cte_lstm_1."State_2" + 0.06912282782154469 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_6") AS "State_3", max(lstm_input_kernel_bias.dot_prod_i_1 + 0.0948482662884923 * rnn_cte_lstm_1."State_1" + 0.3290837186295132 * rnn_cte_lstm_1."State_2" + -0.0773609835753345 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_1 + 0.07724349033417974 * rnn_cte_lstm_1."State_1" + -0.11258365678493894 * rnn_cte_lstm_1."State_2" + 0.500700076751556 * rnn_cte_lstm_1."State_3") + max(lstm_input_kernel_bias.dot_prod_f_1 + -0.5274598641164077 * rnn_cte_lstm_1."State_1" + 0.1187589124926481 * rnn_cte_lstm_1."State_2" + -0.014756337288640524 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_4" AS "State_4", max(lstm_input_kernel_bias.dot_prod_i_2 + -0.19470526290583107 * rnn_cte_lstm_1."State_1" + -0.31042807618833096 * rnn_cte_lstm_1."State_2" + -0.12971487239743895 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_2 + 0.18087455265734442 * rnn_cte_lstm_1."State_1" + 0.37934828569621243 * rnn_cte_lstm_1."State_2" + 0.16353022061755923 * rnn_cte_lstm_1."State_3") + max(lstm_input_kernel_bias.dot_prod_f_2 + 0.35645732975628885 * rnn_cte_lstm_1."State_1" + -0.06659166189984893 * rnn_cte_lstm_1."State_2" + 0.5454130939823799 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_5" AS "State_5", max(lstm_input_kernel_bias.dot_prod_i_3 + -0.05806186719723443 * rnn_cte_lstm_1."State_1" + 0.30802074511598804 * rnn_cte_lstm_1."State_2" + -0.1789347032135904 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_3 + -0.029767030439820548 * rnn_cte_lstm_1."State_1" + -0.20259645853435093 * rnn_cte_lstm_1."State_2" + -0.14932499067731878 * rnn_cte_lstm_1."State_3") + max(lstm_input_kernel_bias.dot_prod_f_3 + 0.4032960143280446 * rnn_cte_lstm_1."State_1" + 0.2328833636408148 * rnn_cte_lstm_1."State_2" + 0.06912282782154469 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_6" AS "State_6" 
  FROM lstm_input_kernel_bias, rnn_cte_lstm_1 
  WHERE lstm_input_kernel_bias.rn = rnn_cte_lstm_1.rn_1 + 1), 
  lstm_1 AS 
  (SELECT rnn_cte_lstm_1."KEY" AS "KEY", CAST(rnn_cte_lstm_1."State_1" AS FLOAT) AS output_1, CAST(rnn_cte_lstm_1."State_2" AS FLOAT) AS output_2, CAST(rnn_cte_lstm_1."State_3" AS FLOAT) AS output_3 
  FROM rnn_cte_lstm_1), 
  lstm_1_1 AS 
  (SELECT lstm_1."KEY" AS "KEY", lstm_1.output_1 AS output_1, lstm_1.output_2 AS output_2, lstm_1.output_3 AS output_3 
  FROM lstm_1), 
  layer_dense_1 AS 
  (SELECT lstm_1_1."KEY" AS "KEY", -0.0648135010016236 + -0.4751122306884854 * lstm_1_1.output_1 + -0.30042413537619794 * lstm_1_1.output_2 + 0.6190301897018439 * lstm_1_1.output_3 AS output_1, -0.05899585873563504 + 0.8017120162097515 * lstm_1_1.output_1 + 0.0633360026854401 * lstm_1_1.output_2 + 0.5962827013060759 * lstm_1_1.output_3 AS output_2, -0.03122114399053033 + -0.37996880354052487 * lstm_1_1.output_1 + 0.492814007705102 * lstm_1_1.output_2 + -0.7473059930548134 * lstm_1_1.output_3 AS output_3, 0.14541882724722727 + -0.16012105256627204 * lstm_1_1.output_1 + -0.1704324239628105 * lstm_1_1.output_2 + -0.48135148021773033 * lstm_1_1.output_3 AS output_4 
  FROM lstm_1_1), 
  layer_dense_1_1 AS 
  (SELECT layer_dense_1."KEY" AS "KEY", layer_dense_1.output_1 AS output_1, layer_dense_1.output_2 AS output_2, layer_dense_1.output_3 AS output_3, layer_dense_1.output_4 AS output_4 
  FROM layer_dense_1), 
  score_soft_max_step1 AS 
  (SELECT layer_dense_1_1."KEY" AS "KEY", layer_dense_1_1.output_1 AS "Score_0", exp(min(100.0, max(-100.0, layer_dense_1_1.output_1))) AS "exp_Score_0", layer_dense_1_1.output_2 AS "Score_1", exp(min(100.0, max(-100.0, layer_dense_1_1.output_2))) AS "exp_Score_1", layer_dense_1_1.output_3 AS "Score_2", exp(min(100.0, max(-100.0, layer_dense_1_1.output_3))) AS "exp_Score_2", layer_dense_1_1.output_4 AS "Score_3", exp(min(100.0, max(-100.0, layer_dense_1_1.output_4))) AS "exp_Score_3" 
  FROM layer_dense_1_1), 
  score_class_union_soft AS 
  (SELECT soft_scu."KEY" AS "KEY", soft_scu.class AS class, soft_scu."exp_Score" AS "exp_Score" 
  FROM (SELECT score_soft_max_step1."KEY" AS "KEY", 0 AS class, score_soft_max_step1."exp_Score_0" AS "exp_Score" 
  FROM score_soft_max_step1 UNION ALL SELECT score_soft_max_step1."KEY" AS "KEY", 1 AS class, score_soft_max_step1."exp_Score_1" AS "exp_Score" 
  FROM score_soft_max_step1 UNION ALL SELECT score_soft_max_step1."KEY" AS "KEY", 2 AS class, score_soft_max_step1."exp_Score_2" AS "exp_Score" 
  FROM score_soft_max_step1 UNION ALL SELECT score_soft_max_step1."KEY" AS "KEY", 3 AS class, score_soft_max_step1."exp_Score_3" AS "exp_Score" 
  FROM score_soft_max_step1) AS soft_scu), 
  score_soft_max AS 
  (SELECT score_soft_max_step1."KEY" AS "KEY", score_soft_max_step1."Score_0" AS "Score_0", score_soft_max_step1."exp_Score_0" AS "exp_Score_0", score_soft_max_step1."Score_1" AS "Score_1", score_soft_max_step1."exp_Score_1" AS "exp_Score_1", score_soft_max_step1."Score_2" AS "Score_2", score_soft_max_step1."exp_Score_2" AS "exp_Score_2", score_soft_max_step1."Score_3" AS "Score_3", score_soft_max_step1."exp_Score_3" AS "exp_Score_3", sum_exp_t."KEY_sum" AS "KEY_sum", sum_exp_t."sum_ExpScore" AS "sum_ExpScore" 
  FROM score_soft_max_step1 LEFT OUTER JOIN (SELECT score_class_union_soft."KEY" AS "KEY_sum", sum(score_class_union_soft."exp_Score") AS "sum_ExpScore" 
  FROM score_class_union_soft GROUP BY score_class_union_soft."KEY") AS sum_exp_t ON score_soft_max_step1."KEY" = sum_exp_t."KEY_sum"), 
  layer_softmax AS 
  (SELECT score_soft_max."KEY" AS "KEY", score_soft_max."exp_Score_0" / score_soft_max."sum_ExpScore" AS output_1, score_soft_max."exp_Score_1" / score_soft_max."sum_ExpScore" AS output_2, score_soft_max."exp_Score_2" / score_soft_max."sum_ExpScore" AS output_3, score_soft_max."exp_Score_3" / score_soft_max."sum_ExpScore" AS output_4 
  FROM score_soft_max), 
  orig_cte AS 
  (SELECT layer_softmax."KEY" AS "KEY", CAST(NULL AS FLOAT) AS "Score_0", CAST(NULL AS FLOAT) AS "Score_1", CAST(NULL AS FLOAT) AS "Score_2", CAST(NULL AS FLOAT) AS "Score_3", layer_softmax.output_1 AS "Proba_0", layer_softmax.output_2 AS "Proba_1", layer_softmax.output_3 AS "Proba_2", layer_softmax.output_4 AS "Proba_3", CAST(NULL AS FLOAT) AS "LogProba_0", CAST(NULL AS FLOAT) AS "LogProba_1", CAST(NULL AS FLOAT) AS "LogProba_2", CAST(NULL AS FLOAT) AS "LogProba_3", CAST(NULL AS BIGINT) AS "Decision", CAST(NULL AS FLOAT) AS "DecisionProba" 
  FROM layer_softmax), 
  score_class_union AS 
  (SELECT scu."KEY_u" AS "KEY_u", scu.class AS class, scu."LogProba" AS "LogProba", scu."Proba" AS "Proba", scu."Score" AS "Score" 
  FROM (SELECT orig_cte."KEY" AS "KEY_u", 0 AS class, orig_cte."LogProba_0" AS "LogProba", orig_cte."Proba_0" AS "Proba", orig_cte."Score_0" AS "Score" 
  FROM orig_cte UNION ALL SELECT orig_cte."KEY" AS "KEY_u", 1 AS class, orig_cte."LogProba_1" AS "LogProba", orig_cte."Proba_1" AS "Proba", orig_cte."Score_1" AS "Score" 
  FROM orig_cte UNION ALL SELECT orig_cte."KEY" AS "KEY_u", 2 AS class, orig_cte."LogProba_2" AS "LogProba", orig_cte."Proba_2" AS "Proba", orig_cte."Score_2" AS "Score" 
  FROM orig_cte UNION ALL SELECT orig_cte."KEY" AS "KEY_u", 3 AS class, orig_cte."LogProba_3" AS "LogProba", orig_cte."Proba_3" AS "Proba", orig_cte."Score_3" AS "Score" 
  FROM orig_cte) AS scu), 
  score_max AS 
  (SELECT orig_cte."KEY" AS "KEY", orig_cte."Score_0" AS "Score_0", orig_cte."Score_1" AS "Score_1", orig_cte."Score_2" AS "Score_2", orig_cte."Score_3" AS "Score_3", orig_cte."Proba_0" AS "Proba_0", orig_cte."Proba_1" AS "Proba_1", orig_cte."Proba_2" AS "Proba_2", orig_cte."Proba_3" AS "Proba_3", orig_cte."LogProba_0" AS "LogProba_0", orig_cte."LogProba_1" AS "LogProba_1", orig_cte."LogProba_2" AS "LogProba_2", orig_cte."LogProba_3" AS "LogProba_3", orig_cte."Decision" AS "Decision", orig_cte."DecisionProba" AS "DecisionProba", max_select."KEY_m" AS "KEY_m", max_select."max_Proba" AS "max_Proba" 
  FROM orig_cte LEFT OUTER JOIN (SELECT score_class_union."KEY_u" AS "KEY_m", max(score_class_union."Proba") AS "max_Proba" 
  FROM score_class_union GROUP BY score_class_union."KEY_u") AS max_select ON orig_cte."KEY" = max_select."KEY_m"), 
  union_with_max AS 
  (SELECT score_class_union."KEY_u" AS "KEY_u", score_class_union.class AS class, score_class_union."LogProba" AS "LogProba", score_class_union."Proba" AS "Proba", score_class_union."Score" AS "Score", score_max."KEY" AS "KEY", score_max."Score_0" AS "Score_0", score_max."Score_1" AS "Score_1", score_max."Score_2" AS "Score_2", score_max."Score_3" AS "Score_3", score_max."Proba_0" AS "Proba_0", score_max."Proba_1" AS "Proba_1", score_max."Proba_2" AS "Proba_2", score_max."Proba_3" AS "Proba_3", score_max."LogProba_0" AS "LogProba_0", score_max."LogProba_1" AS "LogProba_1", score_max."LogProba_2" AS "LogProba_2", score_max."LogProba_3" AS "LogProba_3", score_max."Decision" AS "Decision", score_max."DecisionProba" AS "DecisionProba", score_max."KEY_m" AS "KEY_m", score_max."max_Proba" AS "max_Proba" 
  FROM score_class_union LEFT OUTER JOIN score_max ON score_class_union."KEY_u" = score_max."KEY"), 
  arg_max_cte AS 
  (SELECT score_max."KEY" AS "KEY", score_max."Score_0" AS "Score_0", score_max."Score_1" AS "Score_1", score_max."Score_2" AS "Score_2", score_max."Score_3" AS "Score_3", score_max."Proba_0" AS "Proba_0", score_max."Proba_1" AS "Proba_1", score_max."Proba_2" AS "Proba_2", score_max."Proba_3" AS "Proba_3", score_max."LogProba_0" AS "LogProba_0", score_max."LogProba_1" AS "LogProba_1", score_max."LogProba_2" AS "LogProba_2", score_max."LogProba_3" AS "LogProba_3", score_max."Decision" AS "Decision", score_max."DecisionProba" AS "DecisionProba", score_max."KEY_m" AS "KEY_m", score_max."max_Proba" AS "max_Proba", "arg_max_t_Proba"."KEY_Proba" AS "KEY_Proba", "arg_max_t_Proba"."arg_max_Proba" AS "arg_max_Proba" 
  FROM score_max LEFT OUTER JOIN (SELECT union_with_max."KEY" AS "KEY_Proba", max(union_with_max.class) AS "arg_max_Proba" 
  FROM union_with_max 
  WHERE union_with_max."max_Proba" <= union_with_max."Proba" GROUP BY union_with_max."KEY") AS "arg_max_t_Proba" ON score_max."KEY" = "arg_max_t_Proba"."KEY_Proba")
   SELECT arg_max_cte."KEY" AS "KEY", arg_max_cte."Score_0" AS "Score_0", arg_max_cte."Score_1" AS "Score_1", arg_max_cte."Score_2" AS "Score_2", arg_max_cte."Score_3" AS "Score_3", arg_max_cte."Proba_0" AS "Proba_0", arg_max_cte."Proba_1" AS "Proba_1", arg_max_cte."Proba_2" AS "Proba_2", arg_max_cte."Proba_3" AS "Proba_3", CASE WHEN (arg_max_cte."Proba_0" IS NULL OR arg_max_cte."Proba_0" > 0.0) THEN ln(arg_max_cte."Proba_0") ELSE -1.79769313486231e+308 END AS "LogProba_0", CASE WHEN (arg_max_cte."Proba_1" IS NULL OR arg_max_cte."Proba_1" > 0.0) THEN ln(arg_max_cte."Proba_1") ELSE -1.79769313486231e+308 END AS "LogProba_1", CASE WHEN (arg_max_cte."Proba_2" IS NULL OR arg_max_cte."Proba_2" > 0.0) THEN ln(arg_max_cte."Proba_2") ELSE -1.79769313486231e+308 END AS "LogProba_2", CASE WHEN (arg_max_cte."Proba_3" IS NULL OR arg_max_cte."Proba_3" > 0.0) THEN ln(arg_max_cte."Proba_3") ELSE -1.79769313486231e+308 END AS "LogProba_3", arg_max_cte."arg_max_Proba" AS "Decision", arg_max_cte."max_Proba" AS "DecisionProba" 
  FROM arg_max_cte