greta-dev / greta-dev/greta

error when thinning with lots of bad samples in mcmc

Open
#241 2 comments 0 reactions 0 assignees View on GitHub
bug samplers
Dominant language
C++
Stars
607
Forks
67
Avg merge
3d 8h
Merged PRs (30d)
1

Description

When there are lots of bad samples in the warmup period of an `mcmc()` call, and the user requests thinning, a tensorflow error often appears:
```r
library(greta)
set.seed(1)
x <- rnorm(10000, 1e6, 1)
z <- normal(-1e6, 1e-6)
distribution(x) <- normal(z, 1e6)
m <- model(z, precision = "single")
draws <- mcmc(m, n_samples = 10, warmup = 20, thin = 20)
```
> ```
> Error: greta hit a tensorflow error:
> Error in py_call_impl(callable, dots$args, dots$keywords): UnimplementedError: TensorArray > has size zero, but element shape [?,1] is not fully defined. Currently only static shapes > are supported when packing zero-size
> ```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.