Package gmisclib :: Module mcmc_newlogger :: Class logger
[frames] | no frames]

Class logger

source code


Instance Methods
 
__init__(self, fd, huge=1e+30)
Create a data log.
source code
 
add(self, uid, prms, map, logp, iter, extra=None, reason=None)
Adds a set of parameters to the log file.
source code
 
close(self) (Inherited from gmisclib.mcmc_newlogger.logger_base) source code
 
comment(self, comment) (Inherited from gmisclib.mcmc_newlogger.logger_base) source code
 
flush(self) (Inherited from gmisclib.mcmc_newlogger.logger_base) source code
 
header(self, k, v) (Inherited from gmisclib.mcmc_newlogger.logger_base) source code
 
headers(self, hdict) (Inherited from gmisclib.mcmc_newlogger.logger_base) source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, fd, huge=1e+30)
(Constructor)

source code 

Create a data log.

Parameters:
  • fd (file) - Where to log the results
  • huge (normally float, but could be numpy.ndarray) - sets a threshold for throwing WildNumber. If the absolute value of any parameter gets bigger than huge, something is assumed to be wrong.
Overrides: object.__init__

add(self, uid, prms, map, logp, iter, extra=None, reason=None)

source code 

Adds a set of parameters to the log file.

Parameters:
  • uid (string) - which subset of parameters,
  • prms (numpy.ndarray) - a vector of the actual numbers,
  • map (dict) - a dictionary mapping from parameter names to an index into the prms array.
  • logp (float) - how good is the fit? log(probability)
  • iter (int) - which iteration is it?
  • extra (None or a dictionary.) - any extra information desired.