Ejemplo n.º 1
0
 def __init__(self, dtype):
     x = theano.scalar.Scalar(dtype=dtype).make_variable()
     mean = theano.scalar.Scalar(dtype=dtype).make_variable()
     std = theano.scalar.Scalar(dtype=dtype).make_variable()
     gamma = theano.scalar.Scalar(dtype=dtype).make_variable()
     beta = theano.scalar.Scalar(dtype=dtype).make_variable()
     o = add(mul(true_div(sub(x, mean), std), gamma), beta)
     inputs = [x, mean, std, gamma, beta]
     outputs = [o]
     super(BNComposite, self).__init__(inputs, outputs)
Ejemplo n.º 2
0
 def __init__(self, dtype):
     self.dtype = dtype
     x = theano.scalar.Scalar(dtype=dtype).make_variable()
     mean = theano.scalar.Scalar(dtype=dtype).make_variable()
     std = theano.scalar.Scalar(dtype=dtype).make_variable()
     gamma = theano.scalar.Scalar(dtype=dtype).make_variable()
     beta = theano.scalar.Scalar(dtype=dtype).make_variable()
     o = add(mul(true_div(sub(x, mean), std), gamma), beta)
     inputs = [x, mean, std, gamma, beta]
     outputs = [o]
     super().__init__(inputs, outputs)
Ejemplo n.º 3
0
 def fn():
     x,s = T.scalars('xs')
     fn = function([In(x, update=mul(s,s)+x)], x)