tensorflow-probability

Setting hyperparameter optimization bounds in GPflow 2.0

拜拜、爱过 提交于 2020-01-15 08:20:07
问题 In GPflow 1.0, if I wanted to set hard bounds on a parameter like lengthscale (i.e. limiting the optimisation range for the parameter), transforms.Logistic(a=4., b=6.) would bound the parameter between 4 and 6. GPflow 2.0's documentation says that transforms are handled by TensorFlow Probability's Bijector classes. Which Bijector class handles setting hard limits on parameters, and what is the proper way to implement it? A similar question was asked here (Kernel's hyper-parameters;

Bounding hyperparameter optimization with Tensorflow bijector chain in GPflow 2.0

我们两清 提交于 2020-01-06 05:27:09
问题 While doing GP regression in GPflow 2.0, I want to set hard bounds on lengthscale (i.e. limiting lengthscale optimization range). Following this thread (Setting hyperparameter optimization bounds in GPflow 2.0), I constructed a TensorFlow Bijector chain (see bounded_lengthscale function below). However, the bijector chain below does not prevent the model from optimizing outside the supposed bounds. What do I need to change to make the bounded_lengthscale function put hard bounds on

Perform a RandomWalk step with Tensorflow Probability's RandomWalkMetropolis function

醉酒当歌 提交于 2019-12-13 04:39:11
问题 I am new to Tensorflow Probability and would like to do a RandomWalk Montecarlo simulation. Let's say I have tensor r that represents a state. I want the tfp.mcmc.RandomWalkMetropolis function to return a proposal for a new state r'. tfp.mcmc.RandomWalkMetropolis(r) >>> <tensorflow_probability.python.mcmc.random_walk_metropolis.RandomWalkMetropolis object at 0x14abed2185c0> Instead of the same state, or a slightly perturbed state only this RandomWalkMetropolis object is returned. The

Optimise function for many pseudodata realisations in TensorFlow 2

那年仲夏 提交于 2019-12-12 07:20:14
问题 My end goal is to simulate likelihood ratio test statistics, however, the core problem I am having is that I do not understand how to get TensorFlow 2 to perform many optimizations for different data inputs. Here is my attempt, hopefully, it gives you the idea of what I am trying: import tensorflow as tf import tensorflow_probability as tfp from tensorflow_probability import distributions as tfd import numpy as np # Bunch of independent Poisson distributions that we want to combine poises0 =

Optimise function for many pseudodata realisations in TensorFlow 2

浪子不回头ぞ 提交于 2019-12-01 00:24:48
My end goal is to simulate likelihood ratio test statistics, however, the core problem I am having is that I do not understand how to get TensorFlow 2 to perform many optimizations for different data inputs. Here is my attempt, hopefully, it gives you the idea of what I am trying: import tensorflow as tf import tensorflow_probability as tfp from tensorflow_probability import distributions as tfd import numpy as np # Bunch of independent Poisson distributions that we want to combine poises0 = [tfp.distributions.Poisson(rate = 10) for i in range(5)] # Construct joint distributions joint0 = tfd