Skip to content

Instantly share code, notes, and snippets.

@msegala
msegala / Autoencoder
Created February 6, 2015 14:45
Autoencoder Layer
class AutoEncoder(Layer):
def __init__(self, incoming, num_units, n_hidden, W=init.Uniform(), bhid=init.Constant(0.), bvis=init.Constant(0.),
nonlinearity=nonlinearities.rectify, **kwargs):
super(AutoEncoder, self).__init__(incoming, **kwargs)
if nonlinearity is None:
self.nonlinearity = nonlinearities.identity
else:
self.nonlinearity = nonlinearity
self.num_units = num_units