- Mac version: 10.11.3
- Python version: 3.5.1
$ brew tap homebrew/versions
$ brew install llvm37
import numpy as np | |
def fvecs_read(filename, c_contiguous=True): | |
fv = np.fromfile(filename, dtype=np.float32) | |
if fv.size == 0: | |
return np.zeros((0, 0)) | |
dim = fv.view(np.int32)[0] | |
assert dim > 0 | |
fv = fv.reshape(-1, 1 + dim) |
""" 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 |
In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
url = 'https://openreview.net/notes?invitation=ICLR.cc%2F2018%2FConference%2F-%2FBlind_Submission&offset=0&limit=1000' | |
df = pd.DataFrame(requests.get(url).json()['notes']) # Each row in this data frame is a paper. | |
forum_content = [] | |
for i, forum_id in list(enumerate(df.forum)): # Each forum_id is a review, comment, or acceptance decision about a paper. | |
forum_content.append(requests.get('https://openreview.net/notes?forum={}&trash=true'.format(forum_id)).json()) | |
time.sleep(.3) | |
df['forumContent'] = pd.Series(forum_content) |