This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Visualize actor critic agent in mini gridworld | |
Plot (dynamic): | |
- agent navigating gridworld env | |
- bar plot of discrete actions | |
- line plot of value function over time | |
""" | |
import matplotlib.pyplot as plt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert gif to mp4 | |
ffmpeg -i gifts.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" gifts.mp4 | |
# create mp4 from images (*_value.png) in current dir | |
ffmpeg -framerate 2 -pattern_type glob -i '*.png' -c:v libx264 -r 30 -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" value.mp4 | |
# create mp4 from images (*_policy.png) in current dir | |
ffmpeg -framerate 2 -pattern_type glob -i '*.png' -c:v libx264 -r 30 -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" policy.mp4 | |
# create vertically stacked single video from the individual value and policy videos (they have the same width) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# Every Vagrant development environment requires a box. You can search for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CERTIFICATE_DIR="/home/ubuntu/certificate" | |
JUPYTER_CONFIG_DIR="/home/ubuntu/.jupyter" | |
if [ ! -d "$CERTIFICATE_DIR" ]; then | |
mkdir $CERTIFICATE_DIR | |
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout "$CERTIFICATE_DIR/mykey.key" -out "$CERTIFICATE_DIR/mycert.pem" -batch | |
chown -R ubuntu $CERTIFICATE_DIR | |
fi |