This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These hyperparameters, identified by David Warde-Farley via random search, | |
# obtain 1.08% on MNIST, nearly matching the 1.05% in Nitish Srivastava's | |
# Master's thesis. | |
# | |
# An important difference is that this uses only the first 50,000 examples | |
# and does early stopping on a validation set of the last 10,000 training | |
# points, whereas Nitish Srivastava's results trained on the entire training | |
# set for a given number of epochs. It is quite possible that re-training | |
# with these hyperparameters on the entire 60,000 using some alternate stopping | |
# criterion (matching the best training set likelihood of this job, for instance, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Extract reference documentation from the NumPy source tree. | |
""" | |
import inspect | |
import textwrap | |
import re | |
import sys | |
import types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Script to restore the last value for brightness upon ACPI wake. | |
# | |
# Hilariously, while you can write a new brightness to | |
# /sys/class/backlight/intel_backlight/brightness, | |
# | |
# to accurately determine the current brightness you must use | |
# /sys/class/backlight/intel_backlight/actual_brightness, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import theano | |
import numpy | |
class CumSumOp(theano.Op): | |
"""Use as CumSumOp(axis)(input_arg)""" | |
def __init__(self, axis=None): | |
self.axis = axis | |
def __eq__(self, other): | |
return type(self) == type(other) and self.axis == other.axis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Reverses a hex dump (of the format shown in the Firefox cache). | |
The format is as follows: | |
<OFFSET> <BYTE> [<BYTE> [<BYTE> [...]]] [render] | |
Where | |
- <OFFSET> is 8 hex digits, possibly followed by a colon | |
- each <BYTE> is (maximum 16 per line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
def plot_filters(filters, shape, num_rows, num_cols): | |
""" | |
Assumes filters are rows (so transpose it that way if necessary). | |
matplotlib isn't the speediest horse in town, I wouldn't draw | |
more than a few dozen this way if you need it to frequently update. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A proof-of-concept multi-threaded chunked NPY format reader. | |
""" | |
__author__ = "David Warde-Farley" | |
__credits__ = ["David Warde-Farley"] | |
__license__ = "3-clause BSD" | |
__email__ = 'd dot warde dot farley at gmail DOT com" | |
import threading | |
from numpy.lib.format import read_magic, read_array_header_1_0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run pyflakes on all changed .py files before commit. | |
# | |
# By David Warde-Farley, Feb 28, 2013 -- released under the 3-clause BSD license. | |
# | |
# To use, run this file from the script .git/hooks/pre-commit | |
FILES=`git diff --staged --name-status |grep '\.py$' |grep '^[AM]' |sed -e's/^[AM]\s\+//'` | |
ROOT=`git rev-parse --show-toplevel` | |
NUM_BAD_FILES=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Display Theano functions in the IPython notebook with pydotprint.""" | |
__author__ = "David Warde-Farley" | |
__copyright__ = "Copyright 2012, Universite de Montreal" | |
__credits__ = ["David Warde-Farley"] | |
__license__ = "3-clause BSD" | |
__email__ = "wardefar@iro" | |
__maintainer__ = "David Warde-Farley" | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.