comparison deep/convolutional_dae/scdae.py @ 303:ef28cbb5f464

Use sigmoids with cross-entropy cost in the ConvAutoencoders.
author Arnaud Bergeron <abergeron@gmail.com>
date Wed, 31 Mar 2010 15:54:47 -0400
parents be45e7db7cd4
children 2937f2a421aa
comparison
equal deleted inserted replaced
302:1adfafdc3d57 303:ef28cbb5f464
12 dtype): 12 dtype):
13 LayerStack.__init__(self, [ConvAutoencoder(filter_size=filter_size, 13 LayerStack.__init__(self, [ConvAutoencoder(filter_size=filter_size,
14 num_filt=num_filt, 14 num_filt=num_filt,
15 num_in=num_in, 15 num_in=num_in,
16 noisyness=corruption, 16 noisyness=corruption,
17 err=errors.cross_entropy,
18 nlin=nlins.sigmoid,
17 dtype=dtype), 19 dtype=dtype),
18 MaxPoolLayer(subsampling)]) 20 MaxPoolLayer(subsampling)])
19 21
20 def build(self, input, input_shape=None): 22 def build(self, input, input_shape=None):
21 LayerStack.build(self, input, input_shape) 23 LayerStack.build(self, input, input_shape)
199 dset = datasets.nist_digits(1000) 201 dset = datasets.nist_digits(1000)
200 202
201 pretrain_funcs, trainf, evalf, net = build_funcs( 203 pretrain_funcs, trainf, evalf, net = build_funcs(
202 img_size = (32, 32), 204 img_size = (32, 32),
203 batch_size=batch_size, filter_sizes=[(5,5), (3,3)], 205 batch_size=batch_size, filter_sizes=[(5,5), (3,3)],
204 num_filters=[4, 4], subs=[(2,2), (2,2)], noise=[0.2, 0.2], 206 num_filters=[12, 4], subs=[(2,2), (2,2)], noise=[0.2, 0.2],
205 mlp_sizes=[500], out_size=10, dtype=numpy.float32, 207 mlp_sizes=[500], out_size=10, dtype=numpy.float32,
206 pretrain_lr=0.01, train_lr=0.1) 208 pretrain_lr=0.001, train_lr=0.1)
207 209
208 t_it = repeat_itf(dset.train, batch_size) 210 t_it = repeat_itf(dset.train, batch_size)
209 pretrain_fs, train, valid, test = massage_funcs( 211 pretrain_fs, train, valid, test = massage_funcs(
210 t_it, t_it, dset, batch_size, 212 t_it, t_it, dset, batch_size,
211 pretrain_funcs, trainf, evalf) 213 pretrain_funcs, trainf, evalf)