Preliminary Updates and Installations
(http://markus.com/install-theano-on-aws/)
sudo apt-get update
sudo apt-get -y dist-upgrade
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
import numpy as np | |
import cPickle as pickle | |
import gym | |
# hyperparameters | |
H = 200 # number of hidden layer neurons | |
batch_size = 10 # every how many episodes to do a param update? | |
learning_rate = 1e-4 | |
gamma = 0.99 # discount factor for reward |
Preliminary Updates and Installations
(http://markus.com/install-theano-on-aws/)
sudo apt-get update
sudo apt-get -y dist-upgrade
""" | |
The MIT License (MIT) | |
Copyright (c) 2015 Alec Radford | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
""" | |
This is a batched LSTM forward and backward pass | |
""" | |
import numpy as np | |
import code | |
class LSTM: | |
@staticmethod | |
def init(input_size, hidden_size, fancy_forget_bias_init = 3): |
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#!/usr/bin/env bash | |
# This file contains environment variables required to run Spark. Copy it as | |
# spark-env.sh and edit that to configure Spark for your site. | |
# | |
# The following variables can be set in this file: | |
# - SPARK_LOCAL_IP, to set the IP address Spark binds to on this node | |
# - MESOS_NATIVE_LIBRARY, to point to your libmesos.so if you use Mesos | |
# - SPARK_JAVA_OPTS, to set node-specific JVM options for Spark. Note that | |
# we recommend setting app-wide options in the application's driver program. |