just a friendly ping about interfacing ADVI.
NIPS is just around the corner and i'm being asked to submit my slides to the organizers soon.
do let me know how i can help.
hope you all had a nice thanksgiving!
cheers
alp
just a friendly ping about interfacing ADVI.NIPS is just around the corner and i'm being asked to submit my slides to the organizers soon.
do let me know how i can help.
--
You received this message because you are subscribed to a topic in the Google Groups "stan development mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-dev/qkQsG0f8krk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
load("matrices.RData")
lapply(matrices, FUN = function(x) round(head(x), digits = 3))
--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
I am having problem with a simple example as in testvb.R with branch feature/adapt_eta. I suppose you don't have this problem. Do you have any idea what I have missed?
Yes, I am using clang++. I will try g++ when I have time.
Weird, it is working for me now with clang++ and without any change of Rcpp or RcppEigen.
btw guys, i have no clear idea what's going on but please let me know
if i can help.
Which messages are being truncated? There is a chance I've made an error setting up the streams. How do you test this?
library(RUnit)
library(rstan)
source("runit.test.partial_inits.R")
test_partial_inits()
[1] "Error : " I have ADVI with adaptation working again in R.
ROOT <- "https://raw.githubusercontent.com/stan-dev/example-models/master/ARM/Ch.5/"
wells_data <- read_rdump(paste0(ROOT, "wells.data.R"))
wells_model <- stan_model(paste0(ROOT, "wells_d100ars.stan"))
MCMC <- sampling(wells_model, data = wells_data)
MF <- vb(wells_model, data = wells_data, algorithm = "meanfield")
FR <- vb(wells_model, data = wells_data, algorithm = "fullrank")
if (link == 1) { // logit link
// This was not working well
// 0 ~ bernoulli_logit(eta0);
// 1 ~ bernoulli_logit(eta1);
increment_log_prob(logistic_ccdf_log(eta0, 0, 1));
increment_log_prob(logistic_cdf_log(eta1, 0, 1));
}
do you know (off the top of your head) what this branch logic looks like?
// pull out values of arguments
const int n_int = value_of(n_vec[n]);
const T_partials_return theta_dbl = value_of(theta_vec[n]);
// reusable subexpression values
const int sign = 2*n_int-1;
const T_partials_return ntheta = sign * theta_dbl;
const T_partials_return exp_m_ntheta = exp(-ntheta);
// Handle extreme values gracefully using Taylor approximations.
static const double cutoff = 20.0;
if (ntheta > cutoff)
logp -= exp_m_ntheta;
else if (ntheta < -cutoff)
logp += ntheta;
else
logp -= log1p(exp_m_ntheta);
// gradients
if (!is_constant_struct<T_prob>::value) {
static const double cutoff = 20.0;
if (ntheta > cutoff)
operands_and_partials.d_x1[n] -= exp_m_ntheta;
else if (ntheta < -cutoff)
operands_and_partials.d_x1[n] += sign;
else
operands_and_partials.d_x1[n] += sign * exp_m_ntheta
/ (exp_m_ntheta + 1);
}
I have ADVI with adaptation working again in R.
ROOT <- "https://raw.githubusercontent.com/stan-dev/example-models/master/ARM/Ch.4/"
mesquite_data <- read_rdump(paste0(ROOT, "mesquite.data.R"))
mesquite_data$weight <- mesquite_data$weight / 100
mesquite_model <- stan_model(paste0(ROOT, "mesquite.stan"))
ols <- lm(weight ~ diam1 + diam2 + canopy_height + total_height +
density + group, data = mesquite_data)
MCMC <- sampling(mesquite_model, data = mesquite_data)
MF <- vb(mesquite_model, data = mesquite_data, algorithm = "meanfield")
FR <- vb(mesquite_model, data = mesquite_data, algorithm = "fullrank")
cbind(OLS = coef(ols), MCMC = summary(MCMC)[[1]][1:7,1],
MF = summary(MF)[[1]][1:7,1], FR = summary(FR)[[1]][1:7,1])
OLS MCMC MF FR
(Intercept) -7.285929 -7.274599 -6.8556038 -1.48931304
diam1 1.896690 1.880635 2.2193935 1.21671570
diam2 3.714621 3.746621 3.3493838 2.28108869
canopy_height 3.556653 3.597312 2.1498317 0.02911905
total_height -1.017325 -1.061082 -0.6275955 -0.13897944
density 1.312542 1.310747 1.2938405 1.50406152
group -3.632951 -3.651722 -3.4180468 -1.81033995MF <- stan_glm(weight ~ diam1 + diam2 + canopy_height + total_height +
density + group, data = mesquite_data, prior = NULL,
prior_intercept = NULL, prior_ops = prior_options(scaled = FALSE),
algorithm = "meanfield", QR = TRUE)
FR <- stan_glm(weight ~ diam1 + diam2 + canopy_height + total_height +
density + group, data = mesquite_data, prior = NULL,
prior_intercept = NULL, prior_ops = prior_options(scaled = FALSE),
algorithm = "fullrank", QR = TRUE)
cbind(OLS = coef(ols), MCMC = summary(MCMC)[[1]][1:7,1],
MF = coef(MF), FR = coef(FR))
OLS MCMC MF FR
(Intercept) -7.285929 -7.274599 -7.575135 -6.4010700
diam1 1.896690 1.880635 2.327150 1.2509559
diam2 3.714621 3.746621 3.258451 3.7515768
canopy_height 3.556653 3.597312 3.493274 3.6575743
total_height -1.017325 -1.061082 -0.770157 -0.9841014
density 1.312542 1.310747 1.209084 1.3232964
group -3.632951 -3.651722 -3.585129 -3.7281053what does the QR option in stan_glm do precisely?
it parameterizes the stan model with the QR of the X matrix?