Skip to content

Instantly share code, notes, and snippets.

View vchollati's full-sized avatar

Vamshi Chollati vchollati

View GitHub Profile
"""
Context manager or function to send text messages to your phone when a
process is done.
Edit the global variables. You might be able to find your phone e-mail
address here: http://tinywords.com/about-old/mobile/
Usage:
with SendText("long running process"):
do_something()
  1. General Background and Overview
@vchollati
vchollati / adam.py
Last active August 29, 2015 14:13 — forked from Newmu/adam.py
def Adam(cost, params, lr=0.0002, b1=0.1, b2=0.001, e=1e-8):
updates = []
grads = T.grad(cost, params)
i = theano.shared(floatX(0.))
i_t = i + 1.
fix1 = 1. - b1**(i_t)
fix2 = 1. - b2**(i_t)
lr_t = lr * (T.sqrt(fix2) / fix1)
for p, g in zip(params, grads):
m = theano.shared(p.get_value() * 0.)
# CamTracker.py - track a colourful object with a webcam mounted atop a servo
# Running on a Raspberry Pi, Raspbian Wheezy OS
# (c) Sakari Kapanen, 2013
import cv2
import numpy as np
from RPIO import PWM
# the HSV range we use to detect the colourful object
Hmin = 159
"""A stripped-down MLP example, using Theano.
Based on the tutorial here: http://deeplearning.net/tutorial/mlp.html
This example trims away some complexities, and makes it easier to see how Theano works.
Design changes:
* Model compiled in a distinct function, so that symbolic variables are not in run-time scope.
* No classes. Network shown by chained function calls.
@vchollati
vchollati / min-char-rnn.py
Last active August 29, 2015 14:25 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level demo. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('data.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
print '%d unique characters in data.' % (len(chars), )
# Author: Randal S. Olson (randalolson.com / @randal_olson)
# Uses Tableau's Tableau10 color scheme
figure.figsize: 12, 7
figure.edgecolor: white
figure.facecolor: white
lines.linewidth: 2.5
lines.markeredgewidth: 0
lines.markersize: 10
# Author: Randal S. Olson (randalolson.com / @randal_olson)
# Uses Tableau's Tableau20 color scheme
figure.figsize: 12, 7
figure.edgecolor: white
figure.facecolor: white
lines.linewidth: 2.5
lines.markeredgewidth: 0
lines.markersize: 10
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vchollati
vchollati / var.ipynb
Last active September 11, 2015 15:32 — forked from TomAugspurger/var.ipynb
Logistic regression prediction interval
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.