Skip to content

Instantly share code, notes, and snippets.

@JasonKessler
JasonKessler / crawl_icrl_2018_from_openreview.py
Created February 7, 2018 02:15
Scraping Openreview.net for ICLR Reviews (1)
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)
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active February 20, 2025 01:42
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" 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
@sangheestyle
sangheestyle / install_and_using.md
Last active February 25, 2021 21:43
Install and using numba on mac

Install and using numba on mac

  • Mac version: 10.11.3
  • Python version: 3.5.1

Install

$ brew tap homebrew/versions
$ brew install llvm37
@danoneata
danoneata / fvecs_read.py
Last active October 12, 2024 18:53
Reading fvecs format in Python
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)