# NOT RUN {
# Simulate from a Normal Distribution with uninformative prior
dataset = list("x" = rnorm(1000))
params = list("theta" = 0)
logLik = function(params, dataset) {
distn = tf$distributions$Normal(params$theta, 1)
return(tf$reduce_sum(distn$log_prob(dataset$x)))
}
stepsize = list("theta" = 1e-4)
optStepsize = 1e-1
output = sgldcv(logLik, dataset, params, stepsize, optStepsize)
# }
Run the code above in your browser using DataLab