Skip to content

Commit

Permalink
Adopt to blocks new initial_states(..) handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jbornschein committed Jun 25, 2015
1 parent dfd9ccf commit c351c50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions draw/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def get_dim(self, name):
@recurrent(sequences=['u'], contexts=['x'],
states=['c', 'h_enc', 'c_enc', 'z', 'kl', 'h_dec', 'c_dec'],
outputs=['c', 'h_enc', 'c_enc', 'z', 'kl', 'h_dec', 'c_dec'])
def iterate(self, u, c, h_enc, c_enc, z, kl, h_dec, c_dec, x):
def apply(self, u, c, h_enc, c_enc, z, kl, h_dec, c_dec, x):
x_hat = x-T.nnet.sigmoid(c)
r = self.reader.apply(x, x_hat, h_dec)
i_enc = self.encoder_mlp.apply(T.concatenate([r, h_dec], axis=1))
Expand Down Expand Up @@ -339,7 +339,7 @@ def reconstruct(self, features):
avg=0., std=1.)

c, h_enc, c_enc, z, kl, h_dec, c_dec = \
rvals = self.iterate(x=features, u=u)
rvals = self.apply(x=features, u=u)

x_recons = T.nnet.sigmoid(c[-1,:,:])
x_recons.name = "reconstruction"
Expand Down

0 comments on commit c351c50

Please sign in to comment.