I am trying to combine a Keras
model with a Lasagne
layer. I am calling this function in the Lasagne
layer:
def get_output_for(self, inputs, deterministic=False):
self.p = self.nonlinearity(T.dot(inputs[1], self.pi))
self.mask = sample_mask(self.p)
if deterministic or T.mean(self.p) == 0:
return self.p*inputs[0]
else:
return inputs[0]*self.mask
The problem is that my inputs
object is the output of the previous Keras
layer, which is a Tesnor
object as Keras
layers produce Tensor
outputs. This does not work. I am not sure what type inputs
are supposed to have or how to convert between Tensor
and the type expected by this function.