Icon

04_​Train_​DL_​Model_​with_​Keras

04 Train DL Model with Keras

This workflow is part of a collection of exercise/solution materials used at a hands on workshop held at German Conference for Bioinformatics (GCB-2020). The title of the workshop is "Binding Preference Prediction using KNIME Analytics Platform and its Keras Deep Learning Integration"

Exercise 04 The Keras Network Reader node is preloaded with the network saved with the workflow from Exercise 03. Similarly, the Table Reader node reads the preprocessed data (40,000 rows)we will be using for training and evaluating our deep learning model.Activity I:Train a Deep Learning Model with Keras1. Use a Partitioning node to split the data into training and testing sets. Configure the node in such a way that 75% of the data from the top is used for training. 2. Add a Keras Network Learner node and connect the input ports to the output of Keras Network Reader node and the top port of the Partitioning node. 3. Configure the added Keras Network Learner node as follows: - In the Input data configuration tab, add all columns except "IsBindingSite" and "IsNotBindingSite" - In the Target data tab, use columns "IsBindingSite" and "IsNotBindingSite" and set the loss function to Binary cross entropy. - On the Options tab, set Epocs=5, Training batch size=80, and optimizer = “RMSProp” Once the node is configured execute it. While the node is executing, you can monitor the training by right clicking on the node and choosing the menu item View: Learning monitor 4. Add a Keras Network Executor node and connect it to the output port of Keras Network Learner node and the 2nd partition of the Partitioning node (testing set). Configure the input columns by removing "IsBindingSite" and "IsNotBindingSite" columns from the selection. Check the option Keep input columns in output table. Then, click on the add output button (below the column selection panel), select the “Softmax” layer and click ok. Close the configuration dialog by clicking OK. Activity II: Evaluate Model Performance Using Interactive Views 1. Connect a Table view and a Scorer (JavaScript) node to the Format Prediction Output metanode. 2. Configure the Scorer (JavaScript) node by selecting the correct actual and predicted columns. 3. Create a component containing the two newly added nodes (select nodes -> right click-> create component -> use the name “Visualise Model Performance” ) 4. Execute the component and open its view to see and investigate the performance of the trained model. (Hint: to open the components view, right click on the component and select Interactive view) The data used in this workflow are from the following publication:Xiaoyong Pan, Peter Rijnbeek, Junchi Yan, Hong-Bin Shen. Prediction of RNA-protein sequence and structure binding preferences using deep convolutional and recurrent neuralnetworks. BMC Genomics, 2018, 19:511.Specifically: https://github.com/xypan1232/iDeepS/tree/master/datasets/clip Load NW architectureLoad DataRMSPropLoad DataLoad NW architecture30,000 vs10,000 Keras NetworkReader Table Reader Keras NetworkExecutor Keras NetworkLearner Table Reader Keras NetworkReader Partitioning Format PredictionOutput Exercise 04 The Keras Network Reader node is preloaded with the network saved with the workflow from Exercise 03. Similarly, the Table Reader node reads the preprocessed data (40,000 rows)we will be using for training and evaluating our deep learning model.Activity I:Train a Deep Learning Model with Keras1. Use a Partitioning node to split the data into training and testing sets. Configure the node in such a way that 75% of the data from the top is used for training. 2. Add a Keras Network Learner node and connect the input ports to the output of Keras Network Reader node and the top port of the Partitioning node. 3. Configure the added Keras Network Learner node as follows: - In the Input data configuration tab, add all columns except "IsBindingSite" and "IsNotBindingSite" - In the Target data tab, use columns "IsBindingSite" and "IsNotBindingSite" and set the loss function to Binary cross entropy. - On the Options tab, set Epocs=5, Training batch size=80, and optimizer = “RMSProp” Once the node is configured execute it. While the node is executing, you can monitor the training by right clicking on the node and choosing the menu item View: Learning monitor 4. Add a Keras Network Executor node and connect it to the output port of Keras Network Learner node and the 2nd partition of the Partitioning node (testing set). Configure the input columns by removing "IsBindingSite" and "IsNotBindingSite" columns from the selection. Check the option Keep input columns in output table. Then, click on the add output button (below the column selection panel), select the “Softmax” layer and click ok. Close the configuration dialog by clicking OK. Activity II: Evaluate Model Performance Using Interactive Views 1. Connect a Table view and a Scorer (JavaScript) node to the Format Prediction Output metanode. 2. Configure the Scorer (JavaScript) node by selecting the correct actual and predicted columns. 3. Create a component containing the two newly added nodes (select nodes -> right click-> create component -> use the name “Visualise Model Performance” ) 4. Execute the component and open its view to see and investigate the performance of the trained model. (Hint: to open the components view, right click on the component and select Interactive view) The data used in this workflow are from the following publication:Xiaoyong Pan, Peter Rijnbeek, Junchi Yan, Hong-Bin Shen. Prediction of RNA-protein sequence and structure binding preferences using deep convolutional and recurrent neuralnetworks. BMC Genomics, 2018, 19:511.Specifically: https://github.com/xypan1232/iDeepS/tree/master/datasets/clip Load NW architectureLoad DataRMSPropLoad DataLoad NW architecture30,000 vs10,000 Keras NetworkReader Table Reader Keras NetworkExecutor Keras NetworkLearner Table Reader Keras NetworkReader Partitioning Format PredictionOutput

Nodes

Extensions

Links