@@ -566,7 +566,9 @@ PathfinderArgs <- R6::R6Class(
566566 num_paths = NULL ,
567567 max_lbfgs_iters = NULL ,
568568 num_elbo_draws = NULL ,
569- save_single_paths = NULL ) {
569+ save_single_paths = NULL ,
570+ psis_resample = NULL ,
571+ calculate_lp = NULL ) {
570572 self $ init_alpha <- init_alpha
571573 self $ tol_obj <- tol_obj
572574 self $ tol_rel_obj <- tol_rel_obj
@@ -580,6 +582,8 @@ PathfinderArgs <- R6::R6Class(
580582 self $ max_lbfgs_iters <- max_lbfgs_iters
581583 self $ num_elbo_draws <- num_elbo_draws
582584 self $ save_single_paths <- save_single_paths
585+ self $ psis_resample <- psis_resample
586+ self $ calculate_lp <- calculate_lp
583587 invisible (self )
584588 },
585589
@@ -608,7 +612,9 @@ PathfinderArgs <- R6::R6Class(
608612 .make_arg(" num_paths" ),
609613 .make_arg(" max_lbfgs_iters" ),
610614 .make_arg(" num_elbo_draws" ),
611- .make_arg(" save_single_paths" )
615+ .make_arg(" save_single_paths" ),
616+ .make_arg(" psis_resample" ),
617+ .make_arg(" calculate_lp" )
612618 )
613619 new_args <- do.call(c , new_args )
614620 c(args , new_args )
@@ -966,6 +972,16 @@ validate_pathfinder_args <- function(self) {
966972 if (! is.null(self $ save_single_paths )) {
967973 self $ save_single_paths <- 0
968974 }
975+ if (! is.null(self $ psis_resample ) && is.logical(self $ psis_resample )) {
976+ self $ psis_resample = as.integer(self $ psis_resample )
977+ }
978+ checkmate :: assert_integerish(self $ psis_resample , null.ok = TRUE ,
979+ lower = 0 , upper = 1 , len = 1 )
980+ if (! is.null(self $ calculate_lp ) && is.logical(self $ calculate_lp )) {
981+ self $ calculate_lp = as.integer(self $ calculate_lp )
982+ }
983+ checkmate :: assert_integerish(self $ calculate_lp , null.ok = TRUE ,
984+ lower = 0 , upper = 1 , len = 1 )
969985
970986
971987 # check args only available for lbfgs and bfgs
0 commit comments