Icon

01 Train a Feed Forward Neural Network - Solution

01 Train a Feed Forward Neural Network - Exercise (Solution)

This workflow shows a solution to a hands-on exercise in the L4-DL Introduction to Deep Learning self-paced course


Task 1. Build a FFNN network1. Create an input layer using the Keras Input Layer node. The input Shape corresponds tothe number of features of the input data2. Add a Keras Dense Layer node. Set 6 units and ReLU activation function3. Add a second Keras Dense Layer node configured as the previous one4. Create the output layer with one more Keras Dense Layer node. This time select 1 unitand Sigmoid activation function Task 2. Train the network1. Connect the Keras Network Learner node tothe last Keras Dense Layer node and providethe training data2. Use all the double columns as input. Selectthe income column as target column3. Train the network for 20 epochs, leaving allthe other options with the default setting Task 3. Apply and test the trained network1. Connect the Keras Network Executor node to the trained networkproduced by the Keras Network Learner node. Provide the testing data2. Select the last dense layer as the only output3. Transform the network output to a categorical value using the RuleEngine node. The predicted income is ">50K" if the value is greater orequal 0.5. Otherwise, the model predicted "<=50K"4. Evaluate the prediction using the Scorer node Task 0. Read and preprocess dataExecute the provided nodes to read the adult dataset . The income column is the targetcolumn, containing two possible values (<=50K and >50K). These values are integerencoded using the Rule Engine node. adult.csvTarget column: incomeconvert outputPrediction fromthe testing setTraining networkBatch size: 100Epochs: 20Optimizer: adam11 inputfeaturesHidden layer6 unitsReLUHidden layer6 unitsReLUOutput1 unitSigmoidInteger encodingof target values(Training set)top: training (70%)bottom: testing (30%)CSV Reader Rule Engine Keras NetworkExecutor Keras NetworkLearner Keras Input Layer Keras Dense Layer Keras Dense Layer Keras Dense Layer Rule Engine Scorer Data Preparation& Partition Task 1. Build a FFNN network1. Create an input layer using the Keras Input Layer node. The input Shape corresponds tothe number of features of the input data2. Add a Keras Dense Layer node. Set 6 units and ReLU activation function3. Add a second Keras Dense Layer node configured as the previous one4. Create the output layer with one more Keras Dense Layer node. This time select 1 unitand Sigmoid activation function Task 2. Train the network1. Connect the Keras Network Learner node tothe last Keras Dense Layer node and providethe training data2. Use all the double columns as input. Selectthe income column as target column3. Train the network for 20 epochs, leaving allthe other options with the default setting Task 3. Apply and test the trained network1. Connect the Keras Network Executor node to the trained networkproduced by the Keras Network Learner node. Provide the testing data2. Select the last dense layer as the only output3. Transform the network output to a categorical value using the RuleEngine node. The predicted income is ">50K" if the value is greater orequal 0.5. Otherwise, the model predicted "<=50K"4. Evaluate the prediction using the Scorer node Task 0. Read and preprocess dataExecute the provided nodes to read the adult dataset . The income column is the targetcolumn, containing two possible values (<=50K and >50K). These values are integerencoded using the Rule Engine node. adult.csvTarget column: incomeconvert outputPrediction fromthe testing setTraining networkBatch size: 100Epochs: 20Optimizer: adam11 inputfeaturesHidden layer6 unitsReLUHidden layer6 unitsReLUOutput1 unitSigmoidInteger encodingof target values(Training set)top: training (70%)bottom: testing (30%)CSV Reader Rule Engine Keras NetworkExecutor Keras NetworkLearner Keras Input Layer Keras Dense Layer Keras Dense Layer Keras Dense Layer Rule Engine Scorer Data Preparation& Partition

Nodes

Extensions

Links