This file contains hidden or 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
| Code & Data |
This file contains hidden or 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
| # data file | |
| *.h5 | |
| *.pkl | |
| # log file | |
| *.log | |
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] |
This file contains hidden or 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
| /* -*- C -*- (not really, but good for syntax highlighting) */ | |
| /* numpy 1.9 */ | |
| #ifdef SWIGPYTHON | |
| %{ | |
| #ifndef SWIG_FILE_WITH_INIT | |
| #define NO_IMPORT_ARRAY | |
| #endif | |
| #include "stdio.h" | |
| #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION |
This file contains hidden or 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
| """ | |
| http://en.wikipedia.org/wiki/ID3_algorithm | |
| http://www.cise.ufl.edu/~ddd/cap6635/Fall-97/Short-papers/2.htm | |
| """ | |
| from collections import namedtuple, Counter, defaultdict | |
| from math import log2 |
This file contains hidden or 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
| """ | |
| url: http://stackoverflow.com/questions/4233476/sort-a-list-by-multiple-attributes | |
| """ | |
| s=[[12, 'tall', 'blue', 1], | |
| [15, 'tall', 'black', 3], | |
| [13, 'tall', 'blue', 8], | |
| [9, 'short', 'blue', 3], | |
| [1, 'short', 'black', 2], | |
| [2, 'short', 'red', 9], |
This file contains hidden or 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 | |
| # files | |
| find . -type f -exec chmod 644 {} \; | |
| # dirs | |
| find . -type d -exec chmod 755 {} \; |
This file contains hidden or 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
| #coding: utf8 | |
| """ | |
| 1. Download this gist. | |
| 2. Get the MNIST data. | |
| wget http://deeplearning.net/data/mnist/mnist.pkl.gz | |
| 3. Run this code. | |
| python autoencoder.py 100 -e 1 -b 20 -v | |
| Wait about a minute ... and get a vialization of weights. | |
| """ |
This file contains hidden or 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
| """Parallel grid search for sklearn's GradientBoosting. | |
| This script uses IPython.parallel to run cross-validated | |
| grid search on an IPython cluster. Each cell on the parameter grid | |
| will be evaluated ``K`` times - results are stored in MongoDB. | |
| The procedure tunes the number of trees ``n_estimators`` by averaging | |
| the staged scores of the GBRT model averaged over all K folds. | |
| You need an IPython ipcluster to connect to - for local use simply |
This file contains hidden or 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 | |
| from scipy import linalg | |
| from sklearn.utils import array2d, as_float_array | |
| from sklearn.base import TransformerMixin, BaseEstimator | |
| class ZCA(BaseEstimator, TransformerMixin): | |
| def __init__(self, regularization=10**-5, copy=False): | |
| self.regularization = regularization |
This file contains hidden or 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 simple script for the example in https://code.google.com/p/cuda-convnet/wiki/Methodology | |
| # Please add two params cfgs 'layer-params-conv-local-13pct-pw1.cfg' and 'layer-params-conv-local-13pct-pw2.cfg' in $CUDA_CONVNET/example-layers/ | |
| # Just copy layer-params-conv-local-13pct.cfg to layer-params-conv-local-13pct-pw1.cfg and layer-params-conv-local-13pct-pw2.cfg, | |
| # and reduce all learning rates (the epsW parameters) to 0.001 and 0.0001, respectively | |
| # Result: training error 5.80% and testing error 12.90% (NVIDIA Tesla C2075) | |
| # Junbo Zhang: zjb2046<at>gmail<dot>com | |
| # Jan. 3, 2014 | |
| #set the output dir, which is used for `--save-path` | |
| export OUTPUT=$HOME/RET/cuda-convnet/cifar10_13pct |
NewerOlder