Skip to content

Instantly share code, notes, and snippets.

@codingneo
codingneo / pg-pong.py
Created January 27, 2017 09:09 — forked from karpathy/pg-pong.py
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
@codingneo
codingneo / digits.md
Created May 1, 2016 02:32 — forked from joyofdata/digits.md
Installing CUDA, cuDNN, caffe and DIGITS on EC2
@codingneo
codingneo / adam.py
Created December 30, 2015 15:30 — forked from Newmu/adam.py
Adam Optimizer
"""
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
@codingneo
codingneo / gist:59c8a4fca6ff5b534bb7
Created December 21, 2015 14:58 — forked from karpathy/gist:587454dc0146a6ae21fc
An efficient, batched LSTM.
"""
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):
@codingneo
codingneo / min-char-rnn.py
Created November 18, 2015 23:38 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
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)
@codingneo
codingneo / gist:7eff40e88f0a1066793a
Last active August 29, 2015 14:08 — forked from jimbojsb/gist:1630790
Syntax Highlighted Code in OS X Keynote

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

#!/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.
@codingneo
codingneo / gist:d738d46950446277fb4e
Last active August 29, 2015 14:04 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structure
  1. General Background and Overview