sccoda.model.other_models.SimpleModel.sample_hmc¶
-
SimpleModel.
sample_hmc
(num_results=20000, num_burnin=5000, num_adapt_steps=None, num_leapfrog_steps=10, step_size=0.01)¶ Hamiltonian Monte Carlo (HMC) sampling in tensorflow 2.
Tracked diagnostic statistics:
target_log_prob
: Value of the model’s log-probabilitydiverging
: Marks samples as diverging (NOTE: Handle with care, the spike-and-slab prior of scCODA usually leads to many samples being flagged as diverging)is_accepted
: Whether the proposed sample was accepted in the algorithm’s acceptance stepstep_size
: The step size used by the algorithm in each step
- Parameters
- num_results :
int
int
(default:20000
) MCMC chain length (default 20000)
- num_burnin :
int
int
(default:5000
) Number of burnin iterations (default 5000)
- num_adapt_steps :
int
,None
Optional
[int
] (default:None
) Length of step size adaptation procedure
- num_leapfrog_steps :
int
,None
Optional
[int
] (default:10
) HMC leapfrog steps (default 10)
- step_size :
float
float
(default:0.01
) Initial step size (default 0.01)
- num_results :
- Return type
- Returns
results object
result – Compositional analysis result