greta-dev / greta-dev/greta

TF dimension error when initialising in a model with a simplex variable

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

Description

It looks like there's something wrong with how the custom initial free state is constructed, when there's a simplex variable in there, possibly an issue in the function used to map simplices to the free state?

Will add an issue for a possibly related problem in a sec...

``` r
library(greta)
#>
#> Attaching package: 'greta'
#> The following objects are masked from 'package:stats':
#>
#> binomial, cov2cor, poisson
#> The following objects are masked from 'package:base':
#>
#> %*%, apply, backsolve, beta, chol2inv, colMeans, colSums, diag,
#> eigen, forwardsolve, gamma, identity, rowMeans, rowSums, sweep,
#> tapply
x <- simplex_variable(3)
y <- normal(0, 1)
#> ℹ Initialising python and checking dependencies, this may take a moment.
#> ✔ Initialising python and checking dependencies ... done!
#>
z <- x * y
m <- model(z)
inits <- initials(y = 1)
mcmc(m, initial_values = inits)
#> Only one set of initial values was provided, and was used for all chains
#> can't split axis of size 4 into pieces of size [2,1] for '{{node split}} =
#> SplitV[T=DT_DOUBLE, Tlen=DT_INT32, num_split=2](free_state, Const,
#> split/split_dim)' with input shapes: [1,4], [2], [] and with computed input
#> tensors: input[1] = <2 1>, input[2] = <1>.
```

Created on 2024-11-12 with [reprex v2.0.2](https://reprex.tidyverse.org)

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.