You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation in #637 removes representation approach. This is not as good, but right now I am really struggling to unfurl this problem and I'd rather get something that works. Here's a demo/comparison between branches
# In patch branch:
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,#> tapplyn<-3e3Sigma<- wishart(n+1, diag(n))
#> ℹ Initialising python and checking dependencies, this may take a moment.#> ✔ Initialising python and checking dependencies ... done!#> chol_Sigma<- chol(Sigma)
Sigma2<- wishart(n+1, diag(n))
Sigma2_node<-greta:::get_node(Sigma2)
Sigma2_node$representations$cholesky<-NULLSigma2<-greta:::as.greta_array(Sigma2_node)
chol_Sigma2<- chol(Sigma2)
greta:::has_representation(Sigma, "cholesky")
#> [1] FALSEgreta:::has_representation(Sigma2, "cholesky")
#> [1] FALSEbm_patch<-bench::mark(
sigma_asis= calculate(chol_Sigma, nsim=10),
sigma_altered= calculate(chol_Sigma2, nsim=10),
check=FALSE
)
#> Warning: Some expressions had a GC in every iteration; so filtering is#> disabled.bm_patch#> # A tibble: 2 × 6#> expression min median `itr/sec` mem_alloc `gc/sec`#> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl>#> 1 sigma_asis 14s 14s 0.0717 831MB 0.0717#> 2 sigma_altered 12.7s 12.7s 0.0785 824MB 0
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,#> tapplyn<-3e3Sigma<- wishart(n+1, diag(n))
#> ℹ Initialising python and checking dependencies, this may take a moment.#> ✔ Initialising python and checking dependencies ... done!#> chol_Sigma<- chol(Sigma)
Sigma2<- wishart(n+1, diag(n))
Sigma2_node<-greta:::get_node(Sigma2)
Sigma2_node$representations$cholesky<-NULLSigma2<-greta:::as.greta_array(Sigma2_node)
chol_Sigma2<- chol(Sigma2)
greta:::has_representation(Sigma, "cholesky")
#> [1] TRUEgreta:::has_representation(Sigma2, "cholesky")
#> [1] FALSEbm_patch<-bench::mark(
sigma_asis= calculate(chol_Sigma, nsim=10),
sigma_altered= calculate(chol_Sigma2, nsim=10),
check=FALSE
)
#> Warning: Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Cannot use `calculate()` to sample a cholesky factor of a greta array#> E.g., `x_chol <- chol(wishart(df = 4, Sigma = diag(3)))`#> `calculate(x_chol)`#> This is due to an internal issue with how greta handles cholesky#> representations.#> See issue here on github for more details:#> <https://github.com/greta-dev/greta/issues/593>#> Warning: Some expressions had a GC in every iteration; so filtering is#> disabled.bm_patch#> # A tibble: 2 × 6#> expression min median `itr/sec` mem_alloc `gc/sec`#> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl>#> 1 sigma_asis 49.5ms 56ms 16.0 76.6MB 2.00 #> 2 sigma_altered 13.2s 13.2s 0.0759 824.1MB 0.152
Current implementation in #637 removes representation approach. This is not as good, but right now I am really struggling to unfurl this problem and I'd rather get something that works. Here's a demo/comparison between branches
Created on 2024-07-25 with reprex v2.1.0
Session info
Compared to the TF2 poke fun branch: #534
Created on 2024-07-25 with reprex v2.1.0
Session info
Overall we have removed the representation system by doing things this way.
The text was updated successfully, but these errors were encountered: