comparison keras_model_builder.xml @ 13:ebd3bd2f2985 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 80417bf0158a9b596e485dd66408f738f405145a
author bgruening
date Mon, 02 Oct 2023 08:46:12 +0000
parents ebe52da3c0bb
children
comparison
equal deleted inserted replaced
12:0460590afd6e 13:ebd3bd2f2985
1 <tool id="keras_model_builder" name="Create deep learning model" version="@KERAS_VERSION@" profile="20.05"> 1 <tool id="keras_model_builder" name="Create deep learning model" version="@VERSION@" profile="@PROFILE@">
2 <description>with an optimizer, loss function and fit parameters</description> 2 <description>with an optimizer, loss function and fit parameters</description>
3 <macros> 3 <macros>
4 <import>main_macros.xml</import> 4 <import>main_macros.xml</import>
5 <import>keras_macros.xml</import> 5 <import>keras_macros.xml</import>
6 </macros> 6 </macros>
7 <expand macro="python_requirements" /> 7 <expand macro="python_requirements" />
8 <expand macro="macro_stdio" /> 8 <expand macro="macro_stdio" />
9 <version_command>echo "@KERAS_VERSION@"</version_command> 9 <version_command>echo "@VERSION@"</version_command>
10 <command><![CDATA[ 10 <command>
11 <![CDATA[
11 python '$__tool_directory__/keras_deep_learning.py' 12 python '$__tool_directory__/keras_deep_learning.py'
12 --inputs '$inputs' 13 --inputs '$inputs'
13 --tool_id 'keras_model_builder' 14 --tool_id 'keras_model_builder'
14 --outfile '$outfile' 15 --outfile '$outfile'
15 --model_json '$mode_selection.infile_json' 16 --model_json '$mode_selection.infile_json'
16 #if $mode_selection.mode_type == 'prefitted'
17 --infile_weights '$mode_selection.infile_weights'
18 #end if
19 #if $mode_selection.mode_type == 'train_model' and $mode_selection.get_params
20 --outfile_params '$outfile_params'
21 #end if
22 ]]> 17 ]]>
23 </command> 18 </command>
24 <configfiles> 19 <configfiles>
25 <inputs name="inputs" /> 20 <inputs name="inputs" />
26 </configfiles> 21 </configfiles>
27 <inputs> 22 <inputs>
28 <conditional name="mode_selection"> 23 <conditional name="mode_selection">
29 <param name="mode_type" type="select" label="Choose a building mode"> 24 <param name="mode_type" type="select" label="Choose a building mode">
30 <option value="train_model" selected="true">Build a training model</option> 25 <option value="train_model" selected="true">Build a training model</option>
31 <option value="prefitted">Load a pretrained model for prediction</option> 26 <!--option value="prefitted">Load a pretrained model for prediction</option>-->
32 </param> 27 </param>
33 <when value="train_model"> 28 <when value="train_model">
34 <param name="infile_json" type="data" format="json" label="Select the dataset containing model configurations (JSON)" /> 29 <param name="infile_json" type="data" format="json" label="Select the dataset containing model configurations (JSON)" />
35 <param name="learning_type" type="select" label="Do classification or regression?"> 30 <param name="learning_type" type="select" label="Do classification or regression?">
36 <option value="KerasGClassifier">KerasGClassifier</option> 31 <option value="KerasGClassifier">KerasGClassifier</option>
37 <option value="KerasGRegressor">KerasGRegressor</option> 32 <option value="KerasGRegressor">KerasGRegressor</option>
38 </param> 33 </param>
39 <expand macro="keras_compile_params_section" /> 34 <expand macro="keras_compile_params_section" />
40 <expand macro="keras_fit_params_section" /> 35 <expand macro="keras_fit_params_section">
36 <param name="validation_split" type="float" value="0.1" optional="true" label="The proportion of training data to set aside as validation set." help="Will be ignored if `validation_data` is set explicitly, such as in `Deep learning training and evaluation` tool." />
37 </expand>
41 <param name="random_seed" type="integer" value="" optional="true" label="Random Seed" help="Integer or blank for None. Warning: when random seed is set to an integer, training will be running in single thread mode, which may cause slowness." /> 38 <param name="random_seed" type="integer" value="" optional="true" label="Random Seed" help="Integer or blank for None. Warning: when random seed is set to an integer, training will be running in single thread mode, which may cause slowness." />
42 <param name="get_params" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="false" label="Output parameters for searchCV?" help="Optional. Tunable parameters could be obtained through `estimator_attributes` tool." />
43 </when> 39 </when>
44 <when value="prefitted"> 40 <!--when value="prefitted">
45 <param name="infile_json" type="data" format="json" label="Select the dataset containing model configurations (JSON)" /> 41 <param name="infile_json" type="data" format="json" label="Select the dataset containing model configurations (JSON)" />
46 <param name="infile_weights" type="data" format="h5" label="Select the dataset containing keras layers weights" /> 42 <param name="infile_weights" type="data" format="h5" label="Select the dataset containing keras layers weights" />
47 </when> 43 </when>-->
48 </conditional> 44 </conditional>
49 </inputs> 45 </inputs>
50 <outputs> 46 <outputs>
51 <data format="zip" name="outfile" label="Keras Model Builder on ${on_string}" /> 47 <data format="h5mlm" name="outfile" label="Keras Model Builder on ${on_string}" />
52 <data format="tabular" name="outfile_params" label="get_params for Keras Model Builder on ${on_string}">
53 <filter>mode_selection['mode_type'] == 'train_model' and mode_selection['get_params']</filter>
54 </data>
55 </outputs> 48 </outputs>
56 <tests> 49 <tests>
57 <test> 50 <test>
58 <conditional name="mode_selection"> 51 <conditional name="mode_selection">
59 <param name="infile_json" value="keras01.json" ftype="json" /> 52 <param name="infile_json" value="keras01.json" ftype="json" />
60 <param name="learning_type" value="KerasGRegressor" /> 53 <param name="learning_type" value="KerasGRegressor" />
61 <section name="fit_params"> 54 <section name="fit_params">
62 <param name="epochs" value="100" /> 55 <param name="epochs" value="100" />
63 </section> 56 </section>
64 </conditional> 57 </conditional>
65 <output name="outfile" file="keras_model01" compare="sim_size" delta="30" /> 58 <output name="outfile" file="keras_model01" compare="sim_size" delta="20" />
66 </test> 59 </test>
67 <test> 60 <test>
68 <conditional name="mode_selection"> 61 <conditional name="mode_selection">
69 <param name="infile_json" value="keras02.json" ftype="json" /> 62 <param name="infile_json" value="keras02.json" ftype="json" />
70 <section name="compile_params"> 63 <section name="compile_params">
74 </section> 67 </section>
75 <section name="fit_params"> 68 <section name="fit_params">
76 <param name="epochs" value="100" /> 69 <param name="epochs" value="100" />
77 </section> 70 </section>
78 </conditional> 71 </conditional>
79 <output name="outfile" file="keras_model02" compare="sim_size" delta="30" /> 72 <output name="outfile" file="keras_model02" compare="sim_size" delta="20" />
80 </test> 73 </test>
81 <test> 74 <!--test>
82 <conditional name="mode_selection"> 75 <conditional name="mode_selection">
83 <param name="mode_type" value="prefitted" /> 76 <param name="mode_type" value="prefitted" />
84 <param name="infile_json" value="keras03.json" ftype="json" /> 77 <param name="infile_json" value="keras03.json" ftype="json" />
85 <param name="infile_weights" value="keras_save_weights01.h5" ftype="h5" /> 78 <param name="infile_weights" value="keras_save_weights01.h5" ftype="h5" />
86 </conditional> 79 </conditional>
87 <output name="outfile" file="keras_prefitted01.zip" compare="sim_size" delta="30" /> 80 <output name="outfile" file="keras_prefitted01.zip" compare="sim_size" delta="5" />
88 </test> 81 </test>-->
89 <test> 82 <test>
90 <conditional name="mode_selection"> 83 <conditional name="mode_selection">
91 <param name="infile_json" value="keras04.json" ftype="json" /> 84 <param name="infile_json" value="keras04.json" ftype="json" />
92 <param name="learning_type" value="KerasGRegressor" /> 85 <param name="learning_type" value="KerasGRegressor" />
93 <section name="compile_params"> 86 <section name="compile_params">
99 </section> 92 </section>
100 <section name="fit_params"> 93 <section name="fit_params">
101 <param name="epochs" value="100" /> 94 <param name="epochs" value="100" />
102 </section> 95 </section>
103 <param name="random_seed" value="42" /> 96 <param name="random_seed" value="42" />
104 <param name="get_params" value="true" />
105 </conditional> 97 </conditional>
106 <output name="outfile" file="keras_model04" compare="sim_size" delta="30" /> 98 <output name="outfile" file="keras_model04" compare="sim_size" delta="20" />
107 <output name="outfile_params" file="keras_params04.tabular" />
108 </test> 99 </test>
109 </tests> 100 </tests>
110 <help> 101 <help>
111 <![CDATA[ 102 <![CDATA[
112 **Help** 103 **Help**
113 104
114 **What it does** 105 **What it does**
115 106
116 Creates an estimator object (classifier or regressor) by using the architecture JSON from 'Create architecture' tool and adding an optimizer, loss function and other fit parameters. The fit parameters include the number of training epochs and batch size. Multiple attributes of an optimizer can also be set. A pre-trained deep learning model can also be used with this tool. 107 Creates an estimator object (classifier or regressor) by using the architecture JSON from 'Create architecture' tool and adding an optimizer, loss function and other fit parameters. The fit parameters include the number of training epochs and batch size. Multiple attributes of an optimizer can also be set. A pre-trained deep learning model can also be used with this tool.