def testMC(self):
        """Checks true samples from the model against the ground truth."""
        # Note the side-effect of setting the eager seed.
        seed = tfp_test_util.test_seed_stream()
        model = ill_conditioned_gaussian.IllConditionedGaussian(
            ndims=10, gamma_shape_parameter=2., seed=seed())

        self.validate_ground_truth_using_monte_carlo(
            model,
            num_samples=int(1e6),
            seed=seed(),
        )
    def testBasic(self):
        """Checks that you get finite values given unconstrained samples.

    We check `unnormalized_log_prob` as well as the values of the sample
    transformations.
    """
        model = ill_conditioned_gaussian.IllConditionedGaussian()
        self.validate_log_prob_and_transforms(
            model,
            sample_transformation_shapes=dict(identity=[100], ),
            check_ground_truth_mean=True,
            check_ground_truth_standard_deviation=True,
        )
    def testHMC(self):
        """Checks approximate samples from the model against the ground truth."""
        # Note the side-effect of setting the eager seed.
        seed = tfp_test_util.test_seed_stream()
        model = ill_conditioned_gaussian.IllConditionedGaussian(
            ndims=10, gamma_shape_parameter=2., seed=seed())

        self.validate_ground_truth_using_hmc(
            model,
            num_chains=4,
            num_steps=2000,
            num_leapfrog_steps=3,
            step_size=0.5,
            seed=seed(),
        )