I am trying to implement a Bayesian Neural network with Bernoulli posterior approximations but can not find a way to define the shape of my Bernoulli variable to be a matrix of size D=784 (input layer) and P=50 (first hidden layer).
The Gaussian Posterior approximations code would be
I am trying to implement a Bayesian Neural network with Bernoulli posterior approximations but can not find a way to define the shape of my Bernoulli variable to be a matrix of size D=784 (input layer) and P=50 (first hidden layer). The Gaussian Posterior approximations code would be
qw0 = Normal(loc=tf.Variable(tf.random_normal([D,P])),scale=tf.nn.softplus(tf.Variable(tf.random_normal([D, P]))))
Any idea on how to adapt this for Bernoulli distribution?
Thanks!