altar.cuda.bayesian.cudaMetropolisVaryingSteps
Module Contents
Classes
- class altar.cuda.bayesian.cudaMetropolisVaryingSteps.cudaMetropolisVaryingSteps(name, locator, **kwds)
Bases:
altar.componentThe Metropolis algorithm as a sampler of the posterior distribution
- scaling
- doc = the parameter covariance Σ is scaled by the square of this
- acceptanceWeight
- doc = the weight of accepted samples during covariance rescaling
- rejectionWeight
- doc = the weight of rejected samples during covariance rescaling
- max_mc_steps
- doc = the maximum Monte-Carlo steps for one beta step
- corr_check_steps
- doc = the Monte-Carlo steps to compute the de
- target_correlation
- doc = the threshold of correlation to stop the chain
- mcsteps = 1
- dispatcher
- ginit = False
- gstep
- gcandidate
- gproposal
- gsigma_chol
- gvalid_indices
- gvalid_samples
- ginvalid_flags
- gacceptance_flags
- precision
- gdice
- curng
- initialize(self, application)
Initialize me and my parts given an {application} context
- cuInitialize(self, application)
- samplePosterior(self, annealer, step)
Sample the posterior distribution :param annealer - the controller: :param step - cpu CoolingStep:
- Returns:
statistics (accepted/rejected/invalid) or (accepted/unlikely/rejected)
- resample(self, annealer, statistics)
Update my statistics based on the results of walking my Markov chains
- prepareSamplingPDF(self, annealer, step)
Re-scale and decompose the parameter covariance matrix, in preparation for the Metropolis update
- finishSamplingPDF(self, step)
procedures after sampling, e.g, copy data back to cpu
- walkChains(self, annealer, step)
Run the Metropolis algorithm on the Markov chains :param annealer: cudaAnnealer :param step: cudaCoolingStep
- Returns:
statistics = (accepted, rejected, unlikely)
- displace(self, displacement)
Construct a set of displacement vectors for the random walk from a distribution with zero mean and my covariance
- adjustCovarianceScaling(self, accepted, invalid, rejected)
Compute a new value for the covariance sacling factor based on the acceptance/rejection ratio
- allocateGPUData(self, samples, parameters)
initialize gpu work data