bartz.mcmcstep.StepConfig¶
- class bartz.mcmcstep.StepConfig(steps_done, sparse_on_at, resid_reduction_config, count_reduction_config, prec_reduction_config, prec_count_num_trees, one_bin_prec_reduction, sequential_unroll, sequential_block_size, parallel_block_size, random_tree_scan, augment, mesh, leaf_quantization=None)[source]¶
Options for the MCMC step.
- steps_done: Int32[Array, '']¶
The number of MCMC steps completed so far.
- sparse_on_at: Int32[Array, ''] | None¶
After how many steps to turn on variable selection. If
None, variable selection is disabled.
- resid_reduction_config: ReductionConfig¶
How to sum the residuals in each leaf.
- count_reduction_config: ReductionConfig¶
How to count the datapoints in each leaf.
- prec_reduction_config: ReductionConfig¶
How to sum the likelihood precisions in each leaf.
- prec_count_num_trees: int | None¶
Batch size for processing trees to compute count and prec trees, see
init.
- one_bin_prec_reduction: bool¶
Whether to sum the precisions in only one child of a grown node and derive the other by difference. Ignored (always off) if there’s no constraint on the number of points per leaf (
Forest.min_points_per_decision_nodeandForest.min_points_per_leafareNone).
- sequential_unroll: int | bool¶
How much to unroll the sequential accept/reject loop over trees in
step, ifForest.used_treesis not set. See theunrollargument ofjax.lax.scan.
- sequential_block_size: int | None¶
If
Forest.used_treesis set, the sequential accept/reject loop over trees instepvisits them in fully unrolled blocks of this size, and checks whether there are trees in use left only between blocks. The visits to the trees not in use in the last block have no effect. IfNone, 2 on cpu and 4 on gpu.
- parallel_block_size: int | None¶
If
Forest.used_treesis set, the update ofForest.leaf_indicesand related caches instep, which is parallel across trees, processes the trees in blocks of this size, a divisor of the number of trees, stopping after the trees in use. IfNone, the size is set based on the number of datapoints, and on cpu all the trees are processed at once instead unless few are in use.
- random_tree_scan: bool¶
Whether the sequential accept/reject loop over trees in
stepvisits the trees in a new random order at each step, instead of in storage order.
- augment: bool¶
Whether to account exactly, via data augmentation, for the decision rules forbidden by the ancestors of each node when updating
Sparsity.log_s.
- leaf_quantization: Int32[Array, ''] | None = None¶
If set, quantize the leaves to multiples of
eps(resid dtype) * 2 ** leaf_quantizationinState.resid_eff_scaleunits, which makes the running updates ofState.residmostly exact, (almost) stopping their random-walk rounding drift, assuming|resid| < 2 ** (leaf_quantization + 1)holds (in the same units) for most datapoints most of the time. Intended mostly for use with float16 residuals. Sensible settings are 0 and 1, with 0 leaving some drift, 1 practically no drift, and no setting above 1 justifying the reduced accuracy. With enough datapoints or trees the MCMC breaks down because the sampled leaf variation becomes smaller than the quantum, so this setting can not be used liberally.