In this homework we will predict the future. You’ll use a new tux dataset and design a model to predict the users actions conditioned on their previous actions.
You will design a network similar to the earlier homeworks to predict what action (keyboard input) your fellow classmates took, when they played the game. The input is a vector of the previous actions where each action is a 6d binary vector of key states (0: up, 1:down). You have to predict the next action as six binary predictions (one per key), for this given sequence and you can use standard classification models you built in earlier homeworks.
In this homework we simply measure how well you can fit these actions. The next homework will focus on using these actions to play supertux.
Once you have specified the network, train it.
Keystates for current Action:
0 0 1 1 0 0
Logits of prediction actions:
-5.1 -1 0.6 0.2 -0.1 0.1
which is equivalent to the key states:
0 0 1 1 0 1
We provide you with starter code that loads the dataset from a training and validation set. We also provide an optional tensorboard interface.
- Define your model in
models.pyand modify the training code in
- Train your model.
python3 -m homework.train
- Optionally, you can use tensorboard to visualize your training loss and accuracy.
python3 -m homework.train -l myRun
and in another terminal
tensorboard --logdir myRun, where
myRunis the log directory. Pro-tip: You can run tensorboard on the parent directory of many logs to visualize them all.
- Test your model by measuring the prediction accuracy
python3 -m homework.test -i 32
- To evaluate your code against grader, execute:
python3 -m grader homework
- Create the submission file
python3 -m homework.bundle
We will have a linear grading scheme depending on your log-likelihood scores.
* Log-likelihood 0.2: 0 points * Log-likelihood 0.1: 100 points
In order to evaluate your model properly, we will feed evaluation sequences in action by action.
We created a special
SeqPredictor class that will help with this.
SeqPredictor is guaranteed to read a sequence in order, and can optionally keep some internal state (or past inputs) around.
SeqPredictor needs to return a prediction for the next action before it sees the next input.
This is different from the model training, where you get to see the entire input sequence at once.
- Recurrent Layers
- operations of prior assignments