refactored digits_adjust.py (dataset preprocess in cloud)

This commit is contained in:
Alexander Mordvintsev
2012-07-02 07:49:46 +00:00
parent 6977a89525
commit 83ccdbd0ce
2 changed files with 92 additions and 67 deletions

View File

@@ -17,6 +17,7 @@ from common import clock, mosaic
SZ = 20 # size of each digit is SZ x SZ
CLASS_N = 10
DIGITS_FN = 'digits.png'
def load_digits(fn):
print 'loading "%s" ...' % fn
@@ -95,7 +96,7 @@ def evaluate_model(model, digits, samples, labels):
if __name__ == '__main__':
print __doc__
digits, labels = load_digits('digits.png')
digits, labels = load_digits(DIGITS_FN)
print 'preprocessing...'
# shuffle digits