CalibrationProfile#
An immutable record of the PDF and entropy chunk budgets used by a run. Obtain a measured profile with calibrate, or construct one explicitly to reproduce chosen settings. Profiles carry compact provenance; detailed campaign measurements are kept separately in the cache.
from pyvbmc import CalibrationProfile, VariationalPosterior
profile = CalibrationProfile(
pdf_chunk_elements=65536,
entropy_grad_chunk_elements=65536,
entropy_value_chunk_elements=65536,
)
vp = VariationalPosterior(D=4, K=20, calibration=profile)
The budgets stay fixed for the lifetime of a resolved posterior. Copies, saved posteriors and resumed VBMC runs preserve them. Machine compatibility controls automatic cache reuse; it does not replace an explicitly supplied or restored profile.
- class pyvbmc.CalibrationProfile(pdf_chunk_elements: int = 65536, entropy_grad_chunk_elements: int = 65536, entropy_value_chunk_elements: int = 65536, source: str = 'explicit', status: str = 'complete', fingerprint: str | None = None, provenance: Mapping[str, Any] = {}, cache_path: str | None = None)[source]#
Fixed chunk settings selected for one PyVBMC run.
The profile stores only compact provenance. Detailed measurements belong to the machine-local calibration report rather than posterior histories.
- Parameters:
- pdf_chunk_elementsint, optional
Element budget for posterior density evaluation.
- entropy_grad_chunk_elementsint, optional
Element budget for Monte Carlo entropy calls that request gradients.
- entropy_value_chunk_elementsint, optional
Element budget for value-only Monte Carlo entropy calls.
- sourcestr, optional
Provenance label for the settings. Profiles returned by
calibrate()use"calibrated","memory","cache"or"default". The default for a directly constructed profile is"explicit".- statusstr, optional
Status associated with the settings. Profiles returned by
calibrate()use"complete","busy","incomplete"or"invalid". The default is"complete".- fingerprintstr or None, optional
Compatible machine/configuration fingerprint, when available.
- provenancemapping, optional
Compact string-keyed metadata with JSON scalar values.
- cache_pathstr or None, optional
Calibration report path, when the profile was persisted.
- cache_path: str | None = None#
- entropy_grad_chunk_elements: int = 65536#
- entropy_value_chunk_elements: int = 65536#
- fingerprint: str | None = None#
- classmethod from_dict(data: Mapping[str, Any]) CalibrationProfile[source]#
Validate and deserialize a profile from its versioned schema.
- pdf_chunk_elements: int = 65536#
- provenance: Mapping[str, Any] = {}#
- schema_version: ClassVar[int] = 1#
- property settings: dict[str, int]#
Return the three numerical settings as a new dictionary.
- source: str = 'explicit'#
- status: str = 'complete'#
- property uses_historical_defaults: bool#
Whether all numerical settings equal the historical constants.