hopsy.setup#
- hopsy.setup(problem: Problem, random_seed: int, n_chains: int | None = None, proposal=None, n_tuning=0, n_tuning_rounds=100, target_accrate=0.234, tuning_target='accrate')#
- Parameters:
problem
random_seed (int) – To force easier reproducibility of scientific results, the user is forced to specify a random seed
n_chains (int) – Optional, if none is given, will use all cores available on machine
proposal (hopsy.ProposalType or proposal object (duck typing!)) – Optional: Will heuristically select fitting algorithm, see MarkovChain documentation
n_tuning (int, default 1000) – Total budget of samples that may be drawn for tuning per chain. Only applicable if selected proposal is tunable, ignored otherwise
n_tuning_rounds (int, default 0) – Number of Thompson Sampling rounds. Only applicable if selected proposal is tunable and n_tuning>0, ignored otherwise
target_accrate (float, default=0.234) – Target accpetance rate for acceptance rate tuning.
tuning_target (str) – What tuning_target to use, if n_tuning>0 Valid tuning targets are “accrate” for acceptance rate tuning, “esjd” for expected squared jump distance tuning and “esjd/s” for expected squared jump distance per second tuning.
- Returns:
tuple containing either 2 or 3 elements
1) markov chains with sensible defaults
2) random number generators
3) tuning results only if tuning_target was not None