Package gmisclib :: Module mcmc :: Class acceptor_base
[frames] | no frames]

Class acceptor_base

source code


Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
float
T(self)
Returns: A decent approximation to the system temperature.
source code
bool
__call__(self, delta)
Accept a step or not?
source code
 
probe(self, currentpos, stepper)
This is a hook for a special case where you are optimizing a random function or one that is deterministic, but very rough, and you don't care about the small-scale structure.
source code
float
jitter(self)
In the acoustic distances paper, it is called $\bar{delta}$.
source code
 
reset(self)
In order to make the overal algorithm asymptotically a Markovian, we need to make sure that (asymptotically) the acceptor function depends only on long-term averages, not on recent history.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables
  last_probe
A pair of position_base instances showing the position and logP at each end of the most recent probe for a discontinuity.
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

T(self)

source code 
Returns: float
A decent approximation to the system temperature.

__call__(self, delta)
(Call operator)

source code 

Accept a step or not?

Parameters:
  • delta (float) - The proposed step gives delta as the change in log(probability).
Returns: bool
should it be accepted or not?

probe(self, currentpos, stepper)

source code 

This is a hook for a special case where you are optimizing a random function or one that is deterministic, but very rough, and you don't care about the small-scale structure. In such a case, you might use this to probe the local variability and use that knowledge to change the temperature.

jitter(self)

source code 

In the acoustic distances paper, it is called $\bar{delta}$.

Returns: float
An estimate of how rough the function is, on a small scale.

reset(self)

source code 

In order to make the overal algorithm asymptotically a Markovian, we need to make sure that (asymptotically) the acceptor function depends only on long-term averages, not on recent history. The problem is the jitter measurement, of course. So, one needs to average the jitter over a time longer than the recurrence time, asymptotically. But that makes it horribly unresponsive in the early stages of the optimization when things are rapidly changing. The solution is to pass along resets, so that it can (temporarily) revert to a short averaging time.


Instance Variable Details

last_probe

A pair of position_base instances showing the position and logP at each end of the most recent probe for a discontinuity. Or, it could be None. This value is not used in mcmc,py. Rather, it is there for the logging modules.