Code for paper "Reusing Convolutional Activations from Frame to Frame to Speed up Learning and Inference"
Andrej Karpathy for main training loop
Pytorch contributors REINFORCE functions select_action() and updade_policy()/finish_episode()
Results are averaged over 10 runs. The policy network used for the experiments consists of 2 convolutional layer followed by a dense layer.
Inference: time to run 3000 steps (in seconds), grayscale, downsampled by a factor of 4 in each dimension
Number of filters in convolutional layers one and two: 20/40
Number of filters in convolutional layers one and two: 40/80
Number of filters in convolutional layers one and two: 80/160
Inference: time to run 3000 steps (in seconds), grayscale, downsampled by a factor of 2 in each dimension
Number of filters in convolutional layers one and two: 20/40
Number of filters in convolutional layers one and two: 40/80
Number of filters in convolutional layers one and two: 80/160
Training: time to run 3000 steps (in seconds), grayscale, downsampled by a factor of 4 in each dimension
Number of filters in convolutional layers one and two: 20/40
Number of filters in convolutional layers one and two: 40/80
Number of filters in convolutional layers one and two: 80/160
Training: time to run 3000 steps (in seconds), grayscale, downsampled by a factor of 2 in each dimension
Number of filters in convolutional layers one and two: 20/40
Number of filters in convolutional layers one and two: 40/80
Requires:
numpy
torch
torchvision
gym[atari]
jupyter notebook is required to view and run the notebooks in the root directory, but is not required for running performance tests.
To rerun tests (with modification):
Editing number of filters in each layer: Download the repo, and edit the bash scripts located in each subfolder (e.g. "reusing_convolutions/performance_tests/INFERENCE_D2/REUSE_CPU/run_performance_tests_2_layers_1.sh"). You can run those tests individually or run them all at once from the parent directory.
Editing architecture further and other options: Download the repo, and edit the python file located in each subfolder (e.g. "reusing_convolutions/performance_tests/INFERENCE_D2/REUSE_CPU/test_atari_2_layer_reuse_cpu.py").
To rerun tests (without modification):
Download the repo, and run the bash script in each experiment category directory (e.g. "reusing_convolutions/tree/master/performance_tests/INFERENCE_D2/run_tests.sh")
Alternatively, to run specific tests, you can edit and run scripts in the subfolders.