--- myst: substitutions: macro: python: 1-5,18-26,29-42,44-49 cpp: 5-8,15-20,23-34,36-41 bloc1: python: 21-22 cpp: 6,16 bloc2: python: "26" cpp: "20" bloc3: python: "31" cpp: "25" bloc4: python: 33,35-36,41-42,44 cpp: 7,27,29,34,36 console: python: 2-17 cpp: 6-21 --- # Macro "**modelerFlowrateNeuralNetworksLoadingPMML.{{extension}}**" ## Objective The objective of this macro is to build a surrogate model (an Artificial Neural Network) from a PMML file. ## Macro {{uranie}} {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/modeler/use_cases/" + language + "/modelerFlowrateNeuralNetworksLoadingPMML." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + macro[language] + "\n" + "```" }} A {{tds}} loads `_flowrate_sampler_launcher_app_.dat`: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/modeler/use_cases/" + language + "/modelerFlowrateNeuralNetworksLoadingPMML." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc1[language] + "\n" + "```" }} The surrogate model is loaded from a PMML file: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/modeler/use_cases/" + language + "/modelerFlowrateNeuralNetworksLoadingPMML." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc2[language] + "\n" + "```" }} The model is exported in an external file in C++ language `"uranie_ann_flowrate_loaded.C"` where the function name is `ANNflowrate`: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/modeler/use_cases/" + language + "/modelerFlowrateNeuralNetworksLoadingPMML." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc3[language] + "\n" + "```" }} The model is loaded from the macro `"uranie_ann_flowrate_loaded.C"` and applied on the database with the function `ANNflowrate`: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/modeler/use_cases/" + language + "/modelerFlowrateNeuralNetworksLoadingPMML." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc4[language] + "\n" + "```" }} ## Graph {{ "```{figure} " + parent_dir + "/roottest/build/uranie/doc/modeler/use_cases/" + language + "/neural_network_pmml/modelerFlowrateNeuralNetworksLoadingPMML.png\n" + ":align: center\n" + ":name: use_cases_modelerFlowrateNeuralNetworksLoadingPMML\n" + figure_scale + "\n" + "\n" + "Graph of the macro **\"modelerFlowrateNeuralNetworksLoadingPMML." + extension + "\"**" + "\n" + "```" }} ## Console {{ "```{literalinclude} " + parent_dir + "/roottest/build/uranie/doc/modeler/use_cases/" + language + "/modelerFlowrateNeuralNetworksLoadingPMML_clean.log\n" + ":language: none\n" + ":lines: " + console[language] + "\n" + "```" }}