Skip to content

Instantly share code, notes, and snippets.

View dennybritz's full-sized avatar

Denny Britz dennybritz

View GitHub Profile
@dennybritz
dennybritz / wp_2017_full_width.css
Created June 23, 2017 20:12
wp_2017_full_width
@media screen and (min-width: 48em) {
#content > .wrap {
max-width: 100%
}
#content #primary {
width: 65%;
}
batch_size: 128
buckets: 10,20,30,40
dev_source: newstest2013.tok.bpe.32000.en
dev_target: newstest2013.tok.bpe.32000.de
hparams:
attention.dim: 512
attention.score_type: bahdanau
decoder.rnn_cell.cell_spec:
class: GRUCell
num_units: 512
@dennybritz
dennybritz / tf8_aws.sh
Last active April 14, 2017 14:19
Tensorflow 0.9 on AWS GPU instance installation
# Install build tools
sudo apt-get update
sudo apt-get install -y build-essential git python-pip libfreetype6-dev libxft-dev libncurses-dev libopenblas-dev gfortran python3-matplotlib libblas-dev liblapack-dev libatlas-base-dev python3-dev python3-pydot linux-headers-generic linux-image-extra-virtual unzip python3-numpy swig python3-pandas python-sklearn unzip python3-pip python3-venv
# Install CUDA 7
# wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1410/x86_64/cuda-repo-ubuntu1410_7.0-28_amd64.deb
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1504/x86_64/cuda-repo-ubuntu1504_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1504_7.5-18_amd64.deb && rm cuda-repo-ubuntu1504_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install -y cuda
Variable_2: /job:localhost/replica:0/task:0/cpu:0
I tensorflow/core/common_runtime/simple_placer.cc:289] Variable_2: /job:localhost/replica:0/task:0/cpu:0
zeros: /job:localhost/replica:0/task:0/cpu:0
I tensorflow/core/common_runtime/simple_placer.cc:289] zeros: /job:localhost/replica:0/task:0/cpu:0
Variable_2/Assign: /job:localhost/replica:0/task:0/cpu:0
I tensorflow/core/common_runtime/simple_placer.cc:289] Variable_2/Assign: /job:localhost/replica:0/task:0/cpu:0
Variable_1: /job:localhost/replica:0/task:0/cpu:0
I tensorflow/core/common_runtime/simple_placer.cc:289] Variable_1: /job:localhost/replica:0/task:0/cpu:0
truncated_normal/stddev: /job:localhost/replica:0/task:0/cpu:0
I tensorflow/core/common_runtime/simple_placer.cc:289] truncated_normal/stddev: /job:localhost/replica:0/task:0/cpu:0
@dennybritz
dennybritz / plot_decision_boundary.py
Created September 18, 2015 16:45
plot_decision_boundary.py
# Helper function to plot a decision boundary.
# If you don't fully understand this function don't worry, it just generates the contour plot below.
def plot_decision_boundary(pred_func):
# Set min and max values and give it some padding
x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5
y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5
h = 0.01
# Generate a grid of points with distance h between them
xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h))
# Predict the function value for the whole gid