Skip to content

Instantly share code, notes, and snippets.

@shagunsodhani
shagunsodhani / Batch Normalization.md
Last active July 25, 2023 18:07
Notes for "Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift" paper

The Batch Normalization paper describes a method to address the various issues related to training of Deep Neural Networks. It makes normalization a part of the architecture itself and reports significant improvements in terms of the number of iterations required to train the network.

Issues With Training Deep Neural Networks

Internal Covariate shift

Covariate shift refers to the change in the input distribution to a learning system. In the case of deep networks, the input to each layer is affected by parameters in all the input layers. So even small changes to the network get amplified down the network. This leads to change in the input distribution to internal layers of the deep network and is known as internal covariate shift.

It is well established that networks converge faster if the inputs have been whitened (ie zero mean, unit variances) and are uncorrelated and internal covariate shift leads to just the opposite.

@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
@floodsung
floodsung / dqn_mountaincar.py
Created June 27, 2016 11:16
DQN for MountainCar
# -------------------------------
# DQN for CartPole in OpenAI Gym
# Author: Flood Sung
# Date: 2016.6.27
# All rights reserved
# -------------------------------
import gym
import tensorflow as tf
import numpy as np
@awjuliani
awjuliani / Q-Net Learning Clean.ipynb
Created August 25, 2016 20:30
Basic Q-Learning algorithm using Tensorflow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kkweon
kkweon / simple_a3c.py
Created May 21, 2017 21:41
Simple A3C (distributed tensorflow version is preferred over threading)
import tensorflow as tf
import numpy as np
import threading
import gym
import os
from scipy.misc import imresize
def copy_src_to_dst(from_scope, to_scope):
"""Creates a copy variable weights operation
@jganzabal
jganzabal / Nvidia Titan XP + MacBook Pro + Akitio Node + Tensorflow + Keras.md
Last active November 2, 2022 11:43
How to setup Nvidia Titan XP for deep learning on a MacBook Pro with Akitio Node + Tensorflow + Keras
@mikelove
mikelove / rmosek
Created December 29, 2017 00:44
How to install Rmosek
1) Download mosek from here:
https://www.mosek.com/downloads/
(I downloaded this to my ~/bin)
cd ~/bin
tar -xvf mosektoolslinux64x86.tar.bz2
2) Add this to your ~/.bashrc
export PATH=$PATH:/home/username/bin/mosek/8/tools/platform/linux64x86/bin