Thesis docs
Loading...
Searching...
No Matches
neal.hpp
Go to the documentation of this file.
1
13
14#pragma once
15
16#include "../utils/Sampler.hpp"
17
41class Neal3 : public Sampler {
42private:
43 // ========== Random Number Generation ==========
44
46 mutable std::mt19937 gen;
47
48 // ========== Core Algorithm Methods ==========
49
64 void step_1_observation(int index);
65
66 int sample_from_log_probs(const std::vector<double>& log_probs);
67
68public:
69 // ========== Constructor ==========
70
83 : Sampler(d, p, l, pr), gen(rd()) {};
84
85 // ========== MCMC Interface ==========
86
101 void step() override;
102};
Abstract base class for MCMC sampling algorithms.
Manages distance matrices and cluster allocations for points.
Definition Data.hpp:26
Computes log-likelihood for clusters based on distance-based cohesion and repulsion.
Definition Likelihood.hpp:19
void step() override
Perform one complete iteration of Neal's Algorithm 3.
Definition neal.cpp:80
Neal3(Data &d, Params &p, Likelihood &l, Process &pr)
Constructor for Neal's Algorithm 3 sampler.
Definition neal.hpp:82
Abstract base class for Bayesian nonparametric processes.
Definition Process.hpp:41
Sampler(Data &d, Params &p, Likelihood &l, Process &pr)
Constructor initializing sampler with required components.
Definition Sampler.hpp:98
std::random_device rd
Random device for generating random numbers across sampling algorithms.
Definition Sampler.hpp:74
Structure containing all parameters needed for the NGGP (Normalized Generalized Gamma Process) and DP...
Definition Params.hpp:35