Package models :: Module abstract_model :: Class AbstractModel

Class AbstractModel

source code


Base class for mystic models

The 'evaluate' and 'ForwardFactory' methods must be overwritten, thus providing a standard interface for generating a forward model factory and evaluating a forward model. Additionally, two common ways to generate a cost function are built into the model. For "standard models", the cost function generator will work with no modifications.

See `mystic.models.poly` for a few basic examples.

Instance Methods
 
__init__(self, name='dummy', metric=lambda x: numpysum(x*x), sigma=1.0)
Provides a base class for mystic models.
source code
 
evaluate(self, coeffs, x)
takes list of coefficients & evaluation points, returns f(x)
source code
 
ForwardFactory(self, coeffs)
generates a forward model instance from a list of coefficients
source code
 
CostFactory(self, target, pts)
generates a cost function instance from list of coefficients and evaluation points
source code
 
CostFactory2(self, pts, datapts, nparams)
generates a cost function instance from datapoints and evaluation points
source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, name='dummy', metric=lambda x: numpysum(x*x), sigma=1.0)
(Constructor)

source code 

Provides a base class for mystic models.

Inputs:

   name    -- a name string for the model
   metric  -- the cost metric object  [default => lambda x: numpy.sum(x*x)]
   sigma   -- a scaling factor applied to the raw cost
Overrides: object.__init__