comparison keras_model_builder.xml @ 8:449a757be9c9 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
author bgruening
date Tue, 13 Apr 2021 18:29:36 +0000
parents 818896cd2213
children 624e2afa1313
comparison
equal deleted inserted replaced
7:053570bac5ea 8:449a757be9c9
1 <tool id="keras_model_builder" name="Create deep learning model" version="@KERAS_VERSION@"> 1 <tool id="keras_model_builder" name="Create deep learning model" version="@KERAS_VERSION@" profile="20.05">
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 "@KERAS_VERSION@"</version_command>
10 <command> 10 <command><![CDATA[
11 <![CDATA[
12 python '$__tool_directory__/keras_deep_learning.py' 11 python '$__tool_directory__/keras_deep_learning.py'
13 --inputs '$inputs' 12 --inputs '$inputs'
14 --tool_id 'keras_model_builder' 13 --tool_id 'keras_model_builder'
15 --outfile '$outfile' 14 --outfile '$outfile'
16 --model_json '$mode_selection.infile_json' 15 --model_json '$mode_selection.infile_json'
21 --outfile_params '$outfile_params' 20 --outfile_params '$outfile_params'
22 #end if 21 #end if
23 ]]> 22 ]]>
24 </command> 23 </command>
25 <configfiles> 24 <configfiles>
26 <inputs name="inputs"/> 25 <inputs name="inputs" />
27 </configfiles> 26 </configfiles>
28 <inputs> 27 <inputs>
29 <conditional name="mode_selection"> 28 <conditional name="mode_selection">
30 <param name="mode_type" type="select" label="Choose a building mode"> 29 <param name="mode_type" type="select" label="Choose a building mode">
31 <option value="train_model" selected="true">Build a training model</option> 30 <option value="train_model" selected="true">Build a training model</option>
32 <option value="prefitted">Load a pretrained model for prediction</option> 31 <option value="prefitted">Load a pretrained model for prediction</option>
33 </param> 32 </param>
34 <when value="train_model"> 33 <when value="train_model">
35 <param name="infile_json" type="data" format="json" label="Select the dataset containing model configurations (JSON)"/> 34 <param name="infile_json" type="data" format="json" label="Select the dataset containing model configurations (JSON)" />
36 <param name="learning_type" type="select" label="Do classification or regression?"> 35 <param name="learning_type" type="select" label="Do classification or regression?">
37 <option value="KerasGClassifier">KerasGClassifier</option> 36 <option value="KerasGClassifier">KerasGClassifier</option>
38 <option value="KerasGRegressor">KerasGRegressor</option> 37 <option value="KerasGRegressor">KerasGRegressor</option>
39 </param> 38 </param>
40 <expand macro="keras_compile_params_section"/> 39 <expand macro="keras_compile_params_section" />
41 <expand macro="keras_fit_params_section"/> 40 <expand macro="keras_fit_params_section" />
42 <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."/> 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." />
43 <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."/> 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." />
44 </when> 43 </when>
45 <when value="prefitted"> 44 <when value="prefitted">
46 <param name="infile_json" type="data" format="json" label="Select the dataset containing model configurations (JSON)"/> 45 <param name="infile_json" type="data" format="json" label="Select the dataset containing model configurations (JSON)" />
47 <param name="infile_weights" type="data" format="h5" label="Select the dataset containing keras layers weights"/> 46 <param name="infile_weights" type="data" format="h5" label="Select the dataset containing keras layers weights" />
48 </when> 47 </when>
49 </conditional> 48 </conditional>
50 </inputs> 49 </inputs>
51 <outputs> 50 <outputs>
52 <data format="zip" name="outfile" label="Keras Model Builder on ${on_string}"/> 51 <data format="zip" name="outfile" label="Keras Model Builder on ${on_string}" />
53 <data format="tabular" name="outfile_params" label="get_params for Keras Model Builder on ${on_string}"> 52 <data format="tabular" name="outfile_params" label="get_params for Keras Model Builder on ${on_string}">
54 <filter>mode_selection['mode_type'] == 'train_model' and mode_selection['get_params']</filter> 53 <filter>mode_selection['mode_type'] == 'train_model' and mode_selection['get_params']</filter>
55 </data> 54 </data>
56 </outputs> 55 </outputs>
57 <tests> 56 <tests>
58 <test> 57 <test>
59 <conditional name="mode_selection"> 58 <conditional name="mode_selection">
60 <param name="infile_json" value="keras01.json" ftype="json"/> 59 <param name="infile_json" value="keras01.json" ftype="json" />
61 <param name="learning_type" value="KerasGRegressor"/> 60 <param name="learning_type" value="KerasGRegressor" />
62 <section name="fit_params"> 61 <section name="fit_params">
63 <param name="epochs" value="100"/> 62 <param name="epochs" value="100" />
64 </section> 63 </section>
65 </conditional> 64 </conditional>
66 <output name="outfile" file="keras_model01" compare="sim_size" delta="5"/> 65 <output name="outfile" file="keras_model01" compare="sim_size" delta="30" />
67 </test> 66 </test>
68 <test> 67 <test>
69 <conditional name="mode_selection"> 68 <conditional name="mode_selection">
70 <param name="infile_json" value="keras02.json" ftype="json"/> 69 <param name="infile_json" value="keras02.json" ftype="json" />
71 <section name="compile_params"> 70 <section name="compile_params">
72 <conditional name="optimizer_selection"> 71 <conditional name="optimizer_selection">
73 <param name="optimizer_type" value="Adam"/> 72 <param name="optimizer_type" value="Adam" />
74 </conditional> 73 </conditional>
75 </section> 74 </section>
76 <section name="fit_params"> 75 <section name="fit_params">
77 <param name="epochs" value="100"/> 76 <param name="epochs" value="100" />
78 </section> 77 </section>
79 </conditional> 78 </conditional>
80 <output name="outfile" file="keras_model02" compare="sim_size" delta="5"/> 79 <output name="outfile" file="keras_model02" compare="sim_size" delta="30" />
81 </test> 80 </test>
82 <test> 81 <test>
83 <conditional name="mode_selection"> 82 <conditional name="mode_selection">
84 <param name="mode_type" value="prefitted"/> 83 <param name="mode_type" value="prefitted" />
85 <param name="infile_json" value="keras03.json" ftype="json"/> 84 <param name="infile_json" value="keras03.json" ftype="json" />
86 <param name="infile_weights" value="keras_save_weights01.h5" ftype="h5"/> 85 <param name="infile_weights" value="keras_save_weights01.h5" ftype="h5" />
87 </conditional> 86 </conditional>
88 <output name="outfile" file="keras_prefitted01.zip" compare="sim_size" delta="5"/> 87 <output name="outfile" file="keras_prefitted01.zip" compare="sim_size" delta="30" />
89 </test> 88 </test>
90 <test> 89 <test>
91 <conditional name="mode_selection"> 90 <conditional name="mode_selection">
92 <param name="infile_json" value="keras04.json" ftype="json"/> 91 <param name="infile_json" value="keras04.json" ftype="json" />
93 <param name="learning_type" value="KerasGRegressor"/> 92 <param name="learning_type" value="KerasGRegressor" />
94 <section name="compile_params"> 93 <section name="compile_params">
95 <conditional name="optimizer_selection"> 94 <conditional name="optimizer_selection">
96 <param name="optimizer_type" value="Adam"/> 95 <param name="optimizer_type" value="Adam" />
97 </conditional> 96 </conditional>
98 <param name="metrics" value="mse"/> 97 <param name="metrics" value="mse" />
99 <param name="loss" value="mean_squared_error"/> 98 <param name="loss" value="mean_squared_error" />
100 </section> 99 </section>
101 <section name="fit_params"> 100 <section name="fit_params">
102 <param name="epochs" value="100"/> 101 <param name="epochs" value="100" />
103 </section> 102 </section>
104 <param name="random_seed" value="42"/> 103 <param name="random_seed" value="42" />
105 <param name="get_params" value="true"/> 104 <param name="get_params" value="true" />
106 </conditional> 105 </conditional>
107 <output name="outfile" file="keras_model04" compare="sim_size" delta="1"/> 106 <output name="outfile" file="keras_model04" compare="sim_size" delta="30" />
108 <output name="outfile_params" file="keras_params04.tabular"/> 107 <output name="outfile_params" file="keras_params04.tabular" />
109 </test> 108 </test>
110 </tests> 109 </tests>
111 <help> 110 <help>
112 <![CDATA[ 111 <![CDATA[
113 **Help** 112 **Help**
114 113
115 **What it does** 114 **What it does**
116 115
117 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. 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.
130 6. Execute the tool to get a compiled estimator object. 129 6. Execute the tool to get a compiled estimator object.
131 130
132 ]]> 131 ]]>
133 </help> 132 </help>
134 <citations> 133 <citations>
135 <expand macro="keras_citation"/> 134 <expand macro="keras_citation" />
136 <expand macro="tensorflow_citation"/> 135 <expand macro="tensorflow_citation" />
137 </citations> 136 </citations>
138 </tool> 137 </tool>