comparison create_tool_recommendation_model.xml @ 6:e94dc7945639 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/recommendation_training/tools/tool_recommendation_model commit 24bab7a797f53fe4bcc668b18ee0326625486164
author bgruening
date Sun, 16 Oct 2022 11:52:10 +0000
parents 4f7e6612906b
children
comparison
equal deleted inserted replaced
5:4f7e6612906b 6:e94dc7945639
1 <tool id="create_tool_recommendation_model" name="Create a model to recommend tools" version="0.0.4"> 1 <tool id="create_tool_recommendation_model" name="Create a model to recommend tools" version="0.0.5">
2 <description>using deep learning</description> 2 <description>using deep learning</description>
3 <requirements> 3 <requirements>
4 <requirement type="package" version="3.9.7">python</requirement> 4 <requirement type="package" version="3.9.12">python</requirement>
5 <requirement type="package" version="2.7.0">tensorflow</requirement> 5 <requirement type="package" version="2.9.1">tensorflow</requirement>
6 <requirement type="package" version="2.7.0">keras</requirement> 6 <requirement type="package" version="2.9.0">keras</requirement>
7 <requirement type="package" version="1.0.2">scikit-learn</requirement> 7 <requirement type="package" version="1.0.2">scikit-learn</requirement>
8 <requirement type="package" version="1.4.2">pandas</requirement>
8 <requirement type="package" version="3.6.0">h5py</requirement> 9 <requirement type="package" version="3.6.0">h5py</requirement>
9 <requirement type="package" version="1.0.4">csvkit</requirement>
10 <requirement type="package" version="0.2.5">hyperopt</requirement>
11 </requirements> 10 </requirements>
12 <version_command>echo "@VERSION@"</version_command> 11 <version_command>echo "@VERSION@"</version_command>
13 <command detect_errors="aggressive"> 12 <command detect_errors="aggressive">
14 <![CDATA[ 13 <![CDATA[
15 python '$__tool_directory__/main.py' 14 python '$__tool_directory__/main.py'
15
16 --workflow_file '$input_tabular_workflows' 16 --workflow_file '$input_tabular_workflows'
17 --tool_usage_file '$input_tabular_tool_usage' 17 --tool_usage_file '$input_tabular_tool_usage'
18 --cutoff_date '$data_parameters.input_cutoff_date' 18 --cutoff_date '$data_parameters.input_cutoff_date'
19 --maximum_path_length '$data_parameters.input_maximum_path_length' 19 --maximum_path_length '$data_parameters.input_maximum_path_length'
20 --n_epochs '$training_parameters.n_epochs' 20 --te_share '$training_parameters.te_share'
21 --optimize_n_epochs '$training_parameters.optimize_n_epochs' 21 --tr_batch_size '$training_parameters.tr_batch_size'
22 --max_evals '$training_parameters.max_evals' 22 --te_batch_size '$training_parameters.te_batch_size'
23 --test_share '$training_parameters.test_share' 23 --n_train_iter '$training_parameters.n_train_iter'
24 --batch_size '$nn_parameters.batch_size' 24 --tr_logging_step '$training_parameters.tr_logging_step'
25 --units '$nn_parameters.units' 25 --te_logging_step '$training_parameters.te_logging_step'
26 --embedding_size '$nn_parameters.embedding_size' 26 --n_heads '$nn_parameters.n_heads'
27 --n_embed_dim '$nn_parameters.n_embed_dim'
28 --n_feed_forward_dim '$nn_parameters.n_feed_forward_dim'
27 --dropout '$nn_parameters.dropout' 29 --dropout '$nn_parameters.dropout'
28 --spatial_dropout '$nn_parameters.spatial_dropout'
29 --recurrent_dropout '$nn_parameters.recurrent_dropout'
30 --learning_rate '$nn_parameters.learning_rate' 30 --learning_rate '$nn_parameters.learning_rate'
31 --output_model '$outfile_model' 31 --output_model '$outfile_model'
32 ]]> 32 ]]>
33 </command> 33 </command>
34 <inputs> 34 <inputs>
35 <param name="input_tabular_workflows" type="data" format="tabular" label="Dataset containing workflows" help="Please provide Galaxy workflows as a tabular file."/> 35 <param name="input_tabular_workflows" type="data" format="tabular" label="Dataset containing workflows" help="Please provide Galaxy workflows as a tabular file."/>
36 <param name="input_tabular_tool_usage" type="data" format="tabular" label="Dataset containing usage frequencies of tools" help="Please provide tools usage frequencies as a tabular file."/> 36 <param name="input_tabular_tool_usage" type="data" format="tabular" label="Dataset containing usage frequencies of tools" help="Please provide tools usage frequencies as a tabular file."/>
37
37 <section name="data_parameters" title="Data parameters" expanded="False"> 38 <section name="data_parameters" title="Data parameters" expanded="False">
38
39 <param name="input_cutoff_date" type="text" value="2017-12-01" label="Cutoff date" help="Provide a date (in the past) in yyyy-mm-dd format. The earliest date from which usage of tools will be extracted. For example, 2017-12-01 specifies that the usage of tools from this date until the data extraction date is extracted. The usage of tools before this date is not considered."/> 39 <param name="input_cutoff_date" type="text" value="2017-12-01" label="Cutoff date" help="Provide a date (in the past) in yyyy-mm-dd format. The earliest date from which usage of tools will be extracted. For example, 2017-12-01 specifies that the usage of tools from this date until the data extraction date is extracted. The usage of tools before this date is not considered."/>
40
41 <param name="input_maximum_path_length" type="integer" value="25" label="Maximum number of tools in a tool sequence" help="Provide an integer between 1 and 25. A workflow is divided into unique paths and this number specifies the maximum number of tools a path can have. Paths longer than this number are ignored and are not included in the deep learning training."/> 40 <param name="input_maximum_path_length" type="integer" value="25" label="Maximum number of tools in a tool sequence" help="Provide an integer between 1 and 25. A workflow is divided into unique paths and this number specifies the maximum number of tools a path can have. Paths longer than this number are ignored and are not included in the deep learning training."/>
42
43 </section> 41 </section>
44 <section name="training_parameters" title="Training parameters" expanded="False"> 42 <section name="training_parameters" title="Training parameters" expanded="False">
45 <param name="max_evals" type="integer" value="20" label="Maximum number of evaluations of different configurations of parameters" help="Provide an integer. Different combinations of parameters are sampled and optimized to find the best one. This number specifies the number of different configurations sampled and tested."/> 43 <param name="n_train_iter" type="integer" value="20" label="Maximum number of evaluations of different configurations of parameters" help="Provide an integer. Different combinations of parameters are sampled and optimized to find the best one. This number specifies the number of different configurations sampled and tested."/>
46 44 <param name="tr_batch_size" type="integer" value="128" label="Training batch size" help="" />
47 <param name="optimize_n_epochs" type="integer" value="5" label="Number of training iterations to optimize the neural network parameters" help="Provide an integer. This number specifies the number of training iterations done for each sampled configuration while optimising the parameters."/> 45 <param name="te_batch_size" type="integer" value="128" label="Test batch size" help=""/>
48 46 <param name="tr_logging_step" type="integer" value="5" label="Training log step" help="" />
49 <param name="n_epochs" type="integer" value="10" label="Number of training iterations" help="Provide an integer. This specifies the number of deep learning training iterations done after finding the best/optimised configuration of neural network parameters."/> 47 <param name="te_logging_step" type="integer" value="5" label="Test log step" help="" />
50 48 <param name="te_share" type="text" value="0.2" label="Share of the test data" help="Provide a real number between 0.0 and 1.0. This set of data is used to look through the prediction accuracy on unseen data after neural network training on an optimised configuration of parameters."/>
51 <param name="test_share" type="float" value="0.2" label="Share of the test data" help="Provide a real number between 0.0 and 1.0. This set of data is used to look through the prediction accuracy on unseen data after neural network training on an optimised configuration of parameters. It should be set to 0.0 while training for a model to be deployed to production. The minimum value can be 0.0 and maximum value should not be more than 0.5."/>
52
53 </section> 49 </section>
50
54 <section name="nn_parameters" title="Neural network parameters" expanded="False"> 51 <section name="nn_parameters" title="Neural network parameters" expanded="False">
55 <param name="batch_size" type="text" value="32,256" label="Training batch size" help="Provide a comma-separated range to sample the batch size from. The training of the neural network is done using batch learning in this work. The training data is divided into equal batches and for each epoch (a training iteration), all the batches of data are trained one after another. An example: 32,256." /> 52 <param name="n_heads" type="integer" value="4" label="Number of heads in Multihead attention network"/>
56 53 <param name="n_embed_dim" type="integer" value="128" label="Embedding dimensions"/>
57 <param name="units" type="text" value="32,512" label="Number of hidden recurrent units" help="Provide a comma-separated range to sample the number of hidden recurrent units. A higher value provide stronger neural network model (may lead to overfitting in case of smaller data) and smaller value leads to weaker model (may lead to underfitting in case of larger data). An example: 32,512."/> 54 <param name="n_feed_forward_dim" type="text" value="128" label="Number of units for feed forward network" help=""/>
58 55 <param name="dropout" type="text" value="0.2" label="Amount of dropout between neural network layers. E.g. 0.2 means 20%" help=""/>
59 <param name="embedding_size" type="text" value="32,512" label="Embedding vector size" help="Provide a comma-separated range to sample the embedding size for tools. A fixed-size vector is learned for each tool. This number specifies the fixed-size. An example: 32,512."/> 56 <param name="learning_rate" type="text" value="0.001" label="Learning rate" help=""/>
60
61 <param name="dropout" type="text" value="0.0,0.5" label="Dropout between neural network layers" help="Provide a comma-separated range to sample the amount of dropout to be used after neural netwrok layers. The minimum value should be 0.0 and the maximum value should be 1.0. Dropout is used to prevent or minimize overfitting after each neural network layer. An example: 0.0,0.5"/>
62
63 <param name="spatial_dropout" type="text" value="0.0,0.5" label="Dropout for the embedding layer" help="Provide a comma-separated range to sample the amount of dropout to be used after embedding layer. The minimum value should be 0.0 and the maximum value should be 1.0. Dropout is used to prevent or minimize overfitting in the embedding layer. An example: 0.0,0.5"/>
64
65 <param name="recurrent_dropout" type="text" value="0.0,0.5" label="Dropout for recurrent layers" help="Provide a comma-separated range to sample the amount of dropout to be used for the recurrent layers. The minimum value should be 0.0 and the maximum value should be 1.0. Dropout is used to prevent or minimize overfitting in the recurrent layers. An example: 0.0,0.5"/>
66
67 <param name="learning_rate" type="text" value="0.0001,0.1" label="Learning rate" help="Provide a range of positive real numbers to sample the learning rate. Learning rate defines the speed of neural network learning. A higher value will ensure fast learning and smaller value will ensure slower learning. An example: 0.0001,0.1"/>
68 </section> 57 </section>
69 </inputs> 58 </inputs>
70 <outputs> 59 <outputs>
71 <data format="h5" name="outfile_model" label="Model to recommend tools in Galaxy"></data> 60 <data format="h5" name="outfile_model" label="Model to recommend tools in Galaxy"></data>
72 </outputs> 61 </outputs>
73 <tests> 62 <tests>
74 <test> 63 <test>
75 <param name="input_tabular_workflows" value="test_workflows" ftype="tabular"/> 64 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
76 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/> 65 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
77 <param name="max_evals" value="1"/> 66 <param name="tr_batch_size" value="4"/>
78 <param name="batch_size" value="1,2"/> 67 <param name="te_batch_size" value="4"/>
79 <param name="optimize_n_epochs" value="1"/> 68 <param name="n_train_iter" value="20"/>
80 <param name="n_epochs" value="1"/> 69 <param name="tr_logging_step" value="10"/>
81 <param name="test_share" value="0.2"/> 70 <param name="te_logging_step" value="10"/>
71 <param name="te_share" value="0.4"/>
82 <output name="outfile_model"> 72 <output name="outfile_model">
83 <assert_contents> 73 <assert_contents>
84 <has_h5_keys keys="best_parameters,class_weights,compatible_tools,data_dictionary,model_config,weight_0,weight_1,weight_2,weight_3,weight_4,weight_5,weight_6,weight_7,weight_8"/> 74 <has_h5_keys keys="class_weights,compatible_tools,dense_2,dense_3,dropout_2,dropout_3,global_average_pooling1d,input_1,reverse_dict,standard_connections,token_and_position_embedding,top_level_model_weights,transformer_block"/>
85 </assert_contents> 75 </assert_contents>
86 </output> 76 </output>
87 </test> 77 </test>
88 <test> 78 <test>
89 <param name="input_tabular_workflows" value="test_workflows" ftype="tabular"/> 79 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
90 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/> 80 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
91 <param name="max_evals" value="1"/> 81 <param name="tr_batch_size" value="4"/>
92 <param name="batch_size" value="1,2"/> 82 <param name="te_batch_size" value="4"/>
93 <param name="optimize_n_epochs" value="1"/> 83 <param name="n_train_iter" value="20"/>
94 <param name="n_epochs" value="1"/> 84 <param name="tr_logging_step" value="10"/>
85 <param name="te_logging_step" value="10"/>
86 <param name="te_share" value="0.4"/>
87 <param name="n_heads" value="2"/>
88 <param name="n_embed_dim" value="32"/>
89 <param name="n_feed_forward_dim" value="32"/>
90 <param name="dropout" value="0.05"/>
91 <param name="learning_rate" value="0.0001"/>
95 <output name="outfile_model"> 92 <output name="outfile_model">
96 <assert_contents> 93 <assert_contents>
97 <has_h5_keys keys="best_parameters,class_weights,compatible_tools,data_dictionary,model_config,weight_0,weight_1,weight_2,weight_3,weight_4,weight_5,weight_6,weight_7,weight_8"/> 94 <has_h5_keys keys="class_weights,compatible_tools,dense_2,dense_3,dropout_2,dropout_3,global_average_pooling1d,input_1,reverse_dict,standard_connections,token_and_position_embedding,top_level_model_weights,transformer_block"/>
98 </assert_contents> 95 </assert_contents>
99 </output> 96 </output>
100 </test> 97 </test>
101 <test expect_failure="true"> 98
102 <param name="input_tabular_workflows" value="test_workflows" ftype="tabular"/> 99 <test expect_failure="true">
103 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/> 100 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
104 <param name="test_share" value="0.0"/> 101 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
105 </test> 102 <param name="te_share" value="0.0,0.1"/>
106 <test expect_failure="true"> 103 </test>
107 <param name="input_tabular_workflows" value="test_workflows" ftype="tabular"/> 104 <test expect_failure="true">
108 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/> 105 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
109 <param name="batch_size" value="1"/> 106 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
110 </test> 107 <param name="tr_batch_size" value="1,9"/>
111 <test expect_failure="true"> 108 </test>
112 <param name="input_tabular_workflows" value="test_workflows" ftype="tabular"/> 109 <test expect_failure="true">
113 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/> 110 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
114 <param name="units" value="1"/> 111 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
115 </test> 112 <param name="te_batch_size" value="1,1"/>
116 <test expect_failure="true"> 113 </test>
117 <param name="input_tabular_workflows" value="test_workflows" ftype="tabular"/> 114 <test expect_failure="true">
118 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/> 115 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
119 <param name="embedding_size" value="1"/> 116 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
120 </test> 117 <param name="tr_logging_step" value="1,6"/>
121 <test expect_failure="true"> 118 </test>
122 <param name="input_tabular_workflows" value="test_workflows" ftype="tabular"/> 119 <test expect_failure="true">
123 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/> 120 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
124 <param name="dropout" value="0.1"/> 121 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
125 </test> 122 <param name="n_embed_dim" value="1,6"/>
126 <test expect_failure="true"> 123 </test>
127 <param name="input_tabular_workflows" value="test_workflows" ftype="tabular"/> 124 <test expect_failure="true">
128 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/> 125 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
129 <param name="spatial_dropout" value="0.1"/> 126 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
130 </test> 127 <param name="n_feed_forward_dim" value="1,6"/>
131 <test expect_failure="true"> 128 </test>
132 <param name="input_tabular_workflows" value="test_workflows" ftype="tabular"/> 129 <test expect_failure="true">
133 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/> 130 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
134 <param name="recurrent_dropout" value="0.1"/> 131 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
132 <param name="dropout" value="0.1,0.2"/>
133 </test>
134 <test expect_failure="true">
135 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
136 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
137 <param name="n_heads" value="0.1"/>
135 </test> 138 </test>
136 <test expect_failure="true"> 139 <test expect_failure="true">
137 <param name="input_tabular_workflows" value="test_workflows" ftype="tabular"/> 140 <param name="input_tabular_workflows" value="test_workflow_connections" ftype="tabular"/>
138 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/> 141 <param name="input_tabular_tool_usage" value="test_tool_usage" ftype="tabular"/>
139 <param name="learning_rate" value="0.0001"/> 142 <param name="learning_rate" value="0.0001,0.04"/>
140 </test> 143 </test>
141 </tests> 144 </tests>
142 <help> 145 <help>
143 <![CDATA[ 146 <![CDATA[
144 **What it does** 147 **What it does**
186 189
187 2. Training parameters 190 2. Training parameters
188 - "max_evals": The hyperparameters of the neural network are tuned using a Bayesian optimisation approach and multiple configurations are sampled from different ranges of parameters. The number specified in this parameter is the number of configurations of hyperparameters evaluated to optimise them. Higher the number, the longer is the running time of the tool. 191 - "max_evals": The hyperparameters of the neural network are tuned using a Bayesian optimisation approach and multiple configurations are sampled from different ranges of parameters. The number specified in this parameter is the number of configurations of hyperparameters evaluated to optimise them. Higher the number, the longer is the running time of the tool.
189 - "optimize_n_epochs": This number specifies how many iterations would the neural network executes to evaluate each sampled configuration. 192 - "optimize_n_epochs": This number specifies how many iterations would the neural network executes to evaluate each sampled configuration.
190 - "n_epochs": Once the best configuration of hyperparameters has been found, the neural network takes this configuration and runs for "n_epochs" number of times minimising the error to produce a model at the end. 193 - "n_epochs": Once the best configuration of hyperparameters has been found, the neural network takes this configuration and runs for "n_epochs" number of times minimising the error to produce a model at the end.
191 - "test_share": It specifies the size of the test set. For example, if it is 0.5, then the test set is half of the entire data available. It should not be set to more than 0.5. This set is used for evaluating the precision on an unseen set. 194 - "te_share": It specifies the size of the test set. For example, if it is 0.5, then the test set is half of the entire data available. It should not be set to more than 0.5. This set is used for evaluating the precision on an unseen set.
192 195
193 3. Neural network parameters: 196 3. Neural network parameters:
194 - "batch_size": The training of the neural network is done using batch learning in this work. The training data is divided into equal batches and for each epoch (a training iteration), all batches of data are trained one after another. A higher or lower value can unsettle the training. Therefore, this parameter should be optimised. 197 - "batch_size": The training of the neural network is done using batch learning in this work. The training data is divided into equal batches and for each epoch (a training iteration), all batches of data are trained one after another. A higher or lower value can unsettle the training. Therefore, this parameter should be optimised.
195 - "units": This number is the number of hidden recurrent units. A higher number means stronger learning (may lead to overfitting) and a lower number means weaker learning (may lead to underfitting). Therefore, this number should be optimised. 198 - "units": This number is the number of hidden recurrent units. A higher number means stronger learning (may lead to overfitting) and a lower number means weaker learning (may lead to underfitting). Therefore, this number should be optimised.
196 - "embedding_size": For each tool, a fixed-size vector is learned and this fixed-size is known as the embedding size. This size remains same for all the tools. A lower number may underfit and a higher number may overfit. This parameter should be optimised as well. 199 - "embedding_size": For each tool, a fixed-size vector is learned and this fixed-size is known as the embedding size. This size remains same for all the tools. A lower number may underfit and a higher number may overfit. This parameter should be optimised as well.