Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 2.33 KB

wall-keras.md

File metadata and controls

29 lines (19 loc) · 2.33 KB

Control of a wall-following robot with Keras

Objectives

  • Introduce Keras.
  • Better understand the influence of some hyperparameters and data preprocessing to the model performance.

Introduction

In this practice a robot controller is going to be trained to follow walls. The controller's perception is based on readings from 24 sensors spread around the robot, spaced at a constant angle. The robot can perform four actions: Move-Forward, Sharp-Right-Turn, Slight-Right-Turn and Slight-Left-Turn. The training of the controller will be performed with a dataset available at this link.

Tasks

1.- We will start the practice by loading the data:

  • Download the dataset.
  • Build a Pandas dataframe from the CSV. Note that the CSV has no headers, so you will have to add them somehow. Please, try not to write down a 25-elements list by hand.

2.- Perform an EDA, if it has not been previously done.

3.- We continue with predictive modeling. The goal is to predict the robot's action based on its sonar sensor readings.

  • Implement a neural network with Keras that classifies the robot action. Remember that the output layer activation should be 'sigmoid' and the input data should be scaled. Compute the loss and accuracy on validation and apply a 'sparse_categorical_crossentropy' as loss function.
  • Manually choose (i.e. do not use grid or random search) a good learning rate by plotting the loss and accuracy on validation over time.
  • Compare the evolution of loss and accuracy over time of the network trained with "sgd", "adam", "rmsprop", "adagrad" and "adam".
  • Now we will play with some hyperparameters. In the following, do not expect an improvement of the model performance.
    • Change the output layer activation function to linear or ReLu. How does the performance change?
    • Train the network with unscaled data and the best hyperparameters you have found. What happens?