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

Class Archive

source code


This maintains a list of all the recent accepted positions.

Instance Methods
 
__init__(self, lop, np_eff, strategy='intermediate', maxArchSize=None, alpha=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
distinct_count(self)
How many distinct values of the parameters are there in the archive?
source code
 
prmlist(self, n) source code
 
sort(self)
Called under lock.
source code
 
reset(self)
We sort the archive to speed the convergence to the best solution.
source code
 
__len__(self) source code
 
choose(self) source code
 
truncate(self, desired_length)
Shortens the archive and updates the various counters and statistics.
source code
str
append(self, x, maxdups)
Adds stuff to the archive, possibly sorting the new information into place.
source code
 
append_hook(self, x) source code
 
truncate_hook(self, to_be_dropped) source code

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

Class Variables
  SUPHILL = 'hillclimb'
Always keep the list of positions sorted.
  SSAMPLE = 'sample'
Never sort the list.
  SANNEAL = 'intermediate'
Sort the list only when logp() is making substantial improvements.
  Sfac = {'hillclimb': 100, 'intermediate': 5, 'sample': 2}
Instance Variables
  min_l
The minimum length for the archive.
Properties

Inherited from object: __class__

Method Details

__init__(self, lop, np_eff, strategy='intermediate', maxArchSize=None, alpha=None)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

sort(self)

source code 

Called under lock. Sort the archive into order of logp.

reset(self)

source code 

We sort the archive to speed the convergence to the best solution. After all, if you've just gotten a reset, it is likely that you're not at the bottom yet, so statistical properties of the distribution are likely to be irrelevant.

truncate(self, desired_length)

source code 

Shortens the archive and updates the various counters and statistics.

Parameters:
  • desired_length - Measured in terms of the number of distinct positions.

Note: Must be called under lock.

append(self, x, maxdups)

source code 

Adds stuff to the archive, possibly sorting the new information into place. It updates all kinds of counters and summary statistics.

Parameters:
  • x (position_base) - A position to (possibly) add to the archive.
Returns: str
A one-letter code indicating what happened. 'f' if x is a duplicate and duplicates are forbidden. 'd' if it is a duplicate and there have been too many duplicates lately. 'a' otherwise -- x has been added to the archive.

Class Variable Details

SUPHILL

Always keep the list of positions sorted. This improves mimimization performance at the cost of a distorted probability distribution.

Value:
'hillclimb'

SSAMPLE

Never sort the list. Best if you really want an exact Monte Carlo distribution.

Value:
'sample'

Instance Variable Details

min_l

The minimum length for the archive. This is chosen to be big enough so that all the parallel copies probably span the full parameter space.