# HG changeset patch # User Arnaud Bergeron # Date 1270146530 14400 # Node ID 2937f2a421aa5eadd523d323cf916122af07508a # Parent 8b31280129a9978b445b0c2a95f85e9047240cbc Print the error sometimes in the pretrain loop. diff -r 8b31280129a9 -r 2937f2a421aa deep/convolutional_dae/scdae.py --- a/deep/convolutional_dae/scdae.py Thu Apr 01 13:44:30 2010 -0400 +++ b/deep/convolutional_dae/scdae.py Thu Apr 01 14:28:50 2010 -0400 @@ -157,13 +157,20 @@ series = {} h5f = tables.openFile('series.h5', 'w') + class PrintWrap(object): + def __init__(self, series): + self.series = series + + def append(self, idx, value): + print idx, value + self.series.append(idx, value) series['recons_error'] = AccumulatorSeriesWrapper( - base_series=ErrorSeries(error_name='reconstruction_error', - table_name='reconstruction_error', - hdf5_file=h5f, - index_names=('layer', 'epoch'), - title="Reconstruction error (mse)"), + base_series=PrintWrap(ErrorSeries(error_name='reconstruction_error', + table_name='reconstruction_error', + hdf5_file=h5f, + index_names=('layer', 'epoch'), + title="Reconstruction error (mse)")), reduce_every=100) series['train_error'] = AccumulatorSeriesWrapper( @@ -203,7 +210,7 @@ pretrain_funcs, trainf, evalf, net = build_funcs( img_size = (32, 32), batch_size=batch_size, filter_sizes=[(5,5), (3,3)], - num_filters=[12, 4], subs=[(2,2), (2,2)], noise=[0.2, 0.2], + num_filters=[20, 4], subs=[(2,2), (2,2)], noise=[0.2, 0.2], mlp_sizes=[500], out_size=10, dtype=numpy.float32, pretrain_lr=0.001, train_lr=0.1)