stanbkt.fits.PFFitOptions#
- class stanbkt.fits.PFFitOptions(seed=None, extra_kwargs=<factory>, init_alpha=None, tol_obj=None, tol_rel_obj=None, tol_grad=None, tol_rel_grad=None, tol_param=None, history_size=None, num_paths=None, max_lbfgs_iters=None, draws=None, num_elbo_draws=None, psis_resample=True, calculate_lp=True, inits=None, show_console=False, refresh=None, num_threads=None)#
Bases:
BaseFitOptionsCommon options for
cmdstanpy.CmdStanModel.pathfinder().- Parameters:
init_alpha (
float|None) – Initial step size parameter for Pathfinder.tol_obj (
float|None) – Absolute tolerance on the objective value.tol_rel_obj (
float|None) – Relative tolerance on the objective value.tol_grad (
float|None) – Absolute tolerance on the gradient norm.tol_rel_grad (
float|None) – Relative tolerance on the gradient norm.history_size (
int|None) – History size used by the underlying L-BFGS optimizer.num_paths (
int|None) – Number of Pathfinder optimization paths.max_lbfgs_iters (
int|None) – Maximum number of L-BFGS iterations per path.draws (
int|None) – Number of draws returned from the Pathfinder approximation.num_elbo_draws (
int|None) – Number of draws used for ELBO estimation.psis_resample (
bool) – Whether to use PSIS resampling for returned draws.calculate_lp (
bool) – Whether to calculate log probability values for draws.inits (
dict[str,float] |float|PathLike|str|None) – Initial parameter values or path to an initialization file.show_console (
bool) – Whether to stream CmdStan console output.refresh (
int|None) – Frequency of progress messages written by CmdStan.num_threads (
int|None) – Number of threads available to the CmdStan process.
Notes
This dataclass intentionally exposes only a small set of commonly used Pathfinder arguments. Less common options can be supplied through
extra_kwargs.- classmethod from_dict(d)#
Create fit options from a dictionary.
Known dataclass fields are extracted and used for instantiation. Remaining keys are stored in
extra_kwargsfor CmdStanPy.
- to_dict()#
Convert options to a CmdStanPy kwargs dictionary.
Nonevalues are removed so CmdStanPy can apply its own defaults.