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.
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
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) |
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
""" 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 |
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
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) |