Esempio 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)
Esempio 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)