Thyra Package Browser (Single Doxygen Collection) Version of the Day
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Related Functions
Thyra::DefaultInverseModelEvaluator< Scalar > Class Template Reference

This class wraps any ModelEvaluator object and adds a simple, but fairly general, inverse response function. More...

#include <Thyra_DefaultInverseModelEvaluator.hpp>

Inheritance diagram for Thyra::DefaultInverseModelEvaluator< Scalar >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 STANDARD_CONST_COMPOSITION_MEMBERS (VectorBase< Scalar >, observationTarget)
 Observation target vector ot.
 STANDARD_CONST_COMPOSITION_MEMBERS (VectorBase< Scalar >, parameterBase)
 Parameter base vector pt.
 STANDARD_CONST_COMPOSITION_MEMBERS (LinearOpBase< Scalar >, observationMatchWeightingOp)
 Observation match weighting operator Q_o.
 STANDARD_CONST_COMPOSITION_MEMBERS (LinearOpBase< Scalar >, parameterRegularizationWeightingOp)
 Parameter regulization weighting operator Q_p.
 STANDARD_NONCONST_COMPOSITION_MEMBERS (MultiVectorFileIOBase< Scalar >, observationTargetIO)
 MultiVectorFileIOBase object used to read the observation target vector ot as directed by the parameter list.
 STANDARD_NONCONST_COMPOSITION_MEMBERS (MultiVectorFileIOBase< Scalar >, parameterBaseIO)
 MultiVectorFileIOBase object used to read the parameter base vector pt as directed by the parameter list.

Private Member Functions

void initializeDefaults ()
void initializeInArgsOutArgs () const
RCP< const VectorSpaceBase
< Scalar > > 
get_obs_space () const

Private Attributes

RCP< const Teuchos::ParameterListvalidParamList_
RCP< Teuchos::ParameterListparamList_
RCP< const VectorSpaceBase
< Scalar > > 
inv_g_space_
ModelEvaluatorBase::InArgs
< Scalar > 
prototypeInArgs_
ModelEvaluatorBase::OutArgs
< Scalar > 
prototypeOutArgs_
bool usingObservationTargetAsParameter_
int obs_idx_
int p_idx_
double observationMultiplier_
double parameterMultiplier_
bool observationTargetAsParameter_
bool observationPassThrough_
Teuchos::EVerbosityLevel localVerbLevel_
ParameterDrivenMultiVectorInput
< Scalar > 
observationTargetReader_
ParameterDrivenMultiVectorInput
< Scalar > 
parameterBaseReader_

Static Private Attributes

static const std::string ObservationIndex_name_ = "Observation Index"
static const int ObservationIndex_default_ = -1
static const std::string ParameterSubvectorIndex_name_ = "Parameter Subvector Ordinal"
static const int ParameterSubvectorIndex_default_ = 0
static const std::string ObservationMultiplier_name_ = "Observation Multiplier"
static const double ObservationMultiplier_default_ = 1.0
static const std::string ObservationTargetVector_name_ = "Observation Target Vector"
static const std::string ObservationTargetAsParameter_name_ = "Observation Target as Parameter"
static const bool ObservationTargetAsParameter_default_ = false
static const std::string ObservationPassThrough_name_ = "Observation Pass Through"
static const bool ObservationPassThrough_default_ = false
static const std::string ParameterMultiplier_name_ = "Parameter Multiplier"
static const double ParameterMultiplier_default_ = 1e-6
static const std::string ParameterBaseVector_name_ = "Parameter Base Vector"

Related Functions

(Note that these are not member functions.)

template<class Scalar >
RCP
< DefaultInverseModelEvaluator
< Scalar > > 
defaultInverseModelEvaluator (const RCP< ModelEvaluator< Scalar > > &thyraModel)
 Non-member constructor.

Constructors/initializers/accessors/utilities.

 DefaultInverseModelEvaluator ()
 
void initialize (const RCP< ModelEvaluator< Scalar > > &thyraModel)
 
void uninitialize (RCP< ModelEvaluator< Scalar > > *thyraModel)
 

Overridden from ParameterListAcceptor

void setParameterList (RCP< Teuchos::ParameterList > const &paramList)
 
RCP< Teuchos::ParameterListgetNonconstParameterList ()
 
RCP< Teuchos::ParameterListunsetParameterList ()
 
RCP< const Teuchos::ParameterListgetParameterList () const
 
RCP< const Teuchos::ParameterListgetValidParameters () const
 

Public functions overridden from Teuchos::Describable.

std::string description () const
 

Public functions overridden from ModelEvaulator.

RCP< const VectorSpaceBase
< Scalar > > 
get_p_space (int l) const
 
RCP< const VectorSpaceBase
< Scalar > > 
get_g_space (int j) const
 
ModelEvaluatorBase::InArgs
< Scalar > 
createInArgs () const
 

Private functions overridden from ModelEvaulatorDefaultBase.

ModelEvaluatorBase::OutArgs
< Scalar > 
createOutArgsImpl () const
 
void evalModelImpl (const ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
 

Detailed Description

template<class Scalar>
class Thyra::DefaultInverseModelEvaluator< Scalar >

This class wraps any ModelEvaluator object and adds a simple, but fairly general, inverse response function.

The following response function is added to the end of the supported response functions:


  g_inv(x,p)
    = g_(getUnderlyingModel()->Ng())(x,p,...)
    = observationMultiplier * observationMatch(x,p)
    + parameterMultiplier * parameterRegularization(p)

 

where observationMatch(x,p) is some scalar-valued function that gives the match of some state observation, parameterRegularization(p) is some scaled valued function that regularizes the parameters, and observationMultiplier and parameterMultiplier are scalar constant multipliers for the state observation and the parameter regularization respectively.

The state observation matching function and the parameter regularization function can be defined in one of two ways.

If a symmetric positive definite linear operator Q_o is defined, then the state observation matching function is given as:


   observationMatch(x,p) = 0.5 * diff_o(x,p)^T * Q_o * diff_o(x,p)

 

and if Q_o is not defined, then the state observation matching function is given as:


   observationMatch(x,p) = (0.5/no) * diff_o(x,p)^T * diff_o(x,p)

 

where

diff_o(x,p) = o(x,p) - ot

where ot is the target vector for some observation (see below) and p is one of the parameter subvectors supported by the underlying model.

The observation function o(x,p) can be the state vector itself o(x,p) = x for obs_idx < 0, or can be any of the built-in response functions o(x,p) = g(obs_idx)(x,p) when 0 <= obs_idx < getUnderlyingModel()->Ng().

The parameter regularization function also has one of two definitions.

If a symmetric positive definite linear operator Q_p is defined, then the parameter regularization function is given as:


   parameterRegularization(p) = 0.5 * diff_p(p)^T * Q_p * diff_p(p)

 

and if Q_p is not defined, then the parameter regularization function is given as:


   parameterRegularization(p) = (0.5/np) * diff_p(p)^T * diff_p(p)

 

where

diff_p(p) = p - pt

where pt is a nomial parameter vector for which violations are penalized against.

Since this decorator class adds a response function, then this->Ng() == getUnderlyingModel()->Ng() + 1.

Let's consider the derivatives of this inverse function.

The first derivatives are given by:


  d(g_inv)/d(x) = observationMultiplier * d(observationMatch)/d(x)

  d(g_inv)/d(p) = observationMultiplier * d(observationMatch)/d(p)
                + parameterMultiplier * d(parameterRegularization)/d(p)

 

where the derivatives of observationMatch(x,p) and parameterRegularization(p) are given by:



                              /  diff_o(x,p)^T * Q_o * d(o)/d(x) : Q_o defined
   d(observationMatch)/d(x) = |
                              \  (1/no) * diff_o(x,p)^T * d(o)/d(x) : Q_o not defined


                              /  diff_o(x,p)^T * Q_o * d(o)/d(p) : Q_o defined
   d(observationMatch)/d(p) = |
                              \  (1/no) * diff_o(x,p)^T * d(o)/d(p) : Q_o not defined


                                     /  diff_p(p)^T * Q_p : Q_p defined
   d(parameterRegularization)/d(p) = |
                                     \  (1/np) * diff_p(p)^T : Q_p not defined


 

Of course when obs_idx < -1 where o(x,p) = x then d(o)/d(x) = I and d(o)/d(p) = 0 which also gives d(observationMatch)/d(p) = 0.

Also, we typically want these derivatives in gradient form which gives:



  d(g_inv)/d(x)^T = observationMultiplier * d(observationMatch)/d(x)^T


  d(g_inv)/d(p)^T = observationMultiplier * d(observationMatch)/d(p)^T
                  + parameterMultiplier * d(parameterRegularization)/d(p)^T


                                /  d(o)/d(x)^T * Q_o * diff_o(x,p) : Q_o defined
   d(observationMatch)/d(x)^T = |
                                \  (1/no) * d(o)/d(x)^T * diff_o(x,p) : Q_o not defined


                                /  d(o)/d(p)^T * Q_o * diff_o(x,p) : Q_o defined
   d(observationMatch)/d(p)^T = |
                                \  (1/no) * d(o)/d(p)^T * diff_o(x,p) : Q_o not defined


                                       /  Q_p * diff_p(p) : Q_p defined
   d(parameterRegularization)/d(p)^T = |
                                       \  (1/np) * diff_p(p) : Q_p not defined


 

When obs_idx >= 0, this implementation currently requires that (DoDx^T) and (DoDp^T) be computed and returned by the underlying model as multi-vector objects. In the future, we really only need the action of DoDx^T and DoDp^T onto vectors as shown above.

Another feature supported by this class is the ability to tack on parameter regularization to an existing response function. This mode is enabled by setting the parameter "Observation Pass Through" to true. This results in the observation matching term to be defined as:


   observationMatch(x,p) = o(x,p)

 

and has the derivatives:


   d(observationMatch)/d(x)^T = d(o)/d(x)^T


   d(observationMatch)/d(p)^T = d(o)/d(p)^ T

 

Everything else about the above discussion.

Note: In this case, of course, the observation response function must have dimension 1.

Definition at line 250 of file Thyra_DefaultInverseModelEvaluator.hpp.


Constructor & Destructor Documentation

template<class Scalar >
Thyra::DefaultInverseModelEvaluator< Scalar >::DefaultInverseModelEvaluator ( )

Definition at line 528 of file Thyra_DefaultInverseModelEvaluator.hpp.

References VERB_DEFAULT.


Member Function Documentation

template<class Scalar >
Thyra::DefaultInverseModelEvaluator< Scalar >::STANDARD_CONST_COMPOSITION_MEMBERS ( VectorBase< Scalar >  ,
observationTarget   
)

Observation target vector ot.

template<class Scalar >
Thyra::DefaultInverseModelEvaluator< Scalar >::STANDARD_CONST_COMPOSITION_MEMBERS ( VectorBase< Scalar >  ,
parameterBase   
)

Parameter base vector pt.

template<class Scalar >
Thyra::DefaultInverseModelEvaluator< Scalar >::STANDARD_CONST_COMPOSITION_MEMBERS ( LinearOpBase< Scalar >  ,
observationMatchWeightingOp   
)

Observation match weighting operator Q_o.

template<class Scalar >
Thyra::DefaultInverseModelEvaluator< Scalar >::STANDARD_CONST_COMPOSITION_MEMBERS ( LinearOpBase< Scalar >  ,
parameterRegularizationWeightingOp   
)

Parameter regulization weighting operator Q_p.

template<class Scalar >
Thyra::DefaultInverseModelEvaluator< Scalar >::STANDARD_NONCONST_COMPOSITION_MEMBERS ( MultiVectorFileIOBase< Scalar >  ,
observationTargetIO   
)

MultiVectorFileIOBase object used to read the observation target vector ot as directed by the parameter list.

template<class Scalar >
Thyra::DefaultInverseModelEvaluator< Scalar >::STANDARD_NONCONST_COMPOSITION_MEMBERS ( MultiVectorFileIOBase< Scalar >  ,
parameterBaseIO   
)

MultiVectorFileIOBase object used to read the parameter base vector pt as directed by the parameter list.

template<class Scalar >
void Thyra::DefaultInverseModelEvaluator< Scalar >::initialize ( const RCP< ModelEvaluator< Scalar > > &  thyraModel)
template<class Scalar >
void Thyra::DefaultInverseModelEvaluator< Scalar >::uninitialize ( RCP< ModelEvaluator< Scalar > > *  thyraModel)
template<class Scalar >
void Thyra::DefaultInverseModelEvaluator< Scalar >::setParameterList ( RCP< Teuchos::ParameterList > const &  paramList) [virtual]

Note that observationTargetIO() and parameterBaseIO() must be set before calling this function in order to use the parameter sublist to read in the vectors observationTarget() and parameterBase().

Implements Teuchos::ParameterListAcceptor.

Definition at line 563 of file Thyra_DefaultInverseModelEvaluator.hpp.

References Teuchos::ParameterList::get(), Teuchos::RCP< T >::get(), Teuchos::null, rcp(), Teuchos::rcp(), and TEST_FOR_EXCEPTION.

template<class Scalar >
RCP< Teuchos::ParameterList > Thyra::DefaultInverseModelEvaluator< Scalar >::getNonconstParameterList ( ) [virtual]
template<class Scalar >
RCP< Teuchos::ParameterList > Thyra::DefaultInverseModelEvaluator< Scalar >::unsetParameterList ( ) [virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 664 of file Thyra_DefaultInverseModelEvaluator.hpp.

References Teuchos::null.

template<class Scalar >
RCP< const Teuchos::ParameterList > Thyra::DefaultInverseModelEvaluator< Scalar >::getParameterList ( ) const [virtual]

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 674 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
RCP< const Teuchos::ParameterList > Thyra::DefaultInverseModelEvaluator< Scalar >::getValidParameters ( ) const [virtual]

Note that observationTargetIO() and parameterBaseIO() must be set before calling this function in order to have the sublists added that will allow the vectors observationTarget() and parameterBase() to be read in latter when the parameter list is set..

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 682 of file Thyra_DefaultInverseModelEvaluator.hpp.

References Teuchos::rcp().

template<class Scalar >
std::string Thyra::DefaultInverseModelEvaluator< Scalar >::description ( ) const [virtual]

Reimplemented from Teuchos::Describable.

Definition at line 769 of file Thyra_DefaultInverseModelEvaluator.hpp.

References Teuchos::RCP< T >::get().

template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultInverseModelEvaluator< Scalar >::get_p_space ( int  l) const [virtual]
template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultInverseModelEvaluator< Scalar >::get_g_space ( int  j) const [virtual]
template<class Scalar >
ModelEvaluatorBase::InArgs< Scalar > Thyra::DefaultInverseModelEvaluator< Scalar >::createInArgs ( ) const [virtual]
template<class Scalar >
ModelEvaluatorBase::OutArgs< Scalar > Thyra::DefaultInverseModelEvaluator< Scalar >::createOutArgsImpl ( ) const [private, virtual]
template<class Scalar >
void Thyra::DefaultInverseModelEvaluator< Scalar >::evalModelImpl ( const ModelEvaluatorBase::InArgs< Scalar > &  inArgs,
const ModelEvaluatorBase::OutArgs< Scalar > &  outArgs 
) const [private, virtual]
template<class Scalar >
void Thyra::DefaultInverseModelEvaluator< Scalar >::initializeDefaults ( ) [private]

Definition at line 1225 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
void Thyra::DefaultInverseModelEvaluator< Scalar >::initializeInArgsOutArgs ( ) const [private]

Definition at line 1235 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultInverseModelEvaluator< Scalar >::get_obs_space ( ) const [private]

Definition at line 1272 of file Thyra_DefaultInverseModelEvaluator.hpp.


Friends And Related Function Documentation

template<class Scalar >
RCP< DefaultInverseModelEvaluator< Scalar > > defaultInverseModelEvaluator ( const RCP< ModelEvaluator< Scalar > > &  thyraModel) [related]

Non-member constructor.

Definition at line 428 of file Thyra_DefaultInverseModelEvaluator.hpp.

References Teuchos::rcp().


Member Data Documentation

template<class Scalar >
RCP<const Teuchos::ParameterList> Thyra::DefaultInverseModelEvaluator< Scalar >::validParamList_ [mutable, private]

Definition at line 363 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
RCP<Teuchos::ParameterList> Thyra::DefaultInverseModelEvaluator< Scalar >::paramList_ [private]

Definition at line 364 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
RCP<const VectorSpaceBase<Scalar> > Thyra::DefaultInverseModelEvaluator< Scalar >::inv_g_space_ [private]

Definition at line 366 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
ModelEvaluatorBase::InArgs<Scalar> Thyra::DefaultInverseModelEvaluator< Scalar >::prototypeInArgs_ [mutable, private]

Definition at line 368 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
ModelEvaluatorBase::OutArgs<Scalar> Thyra::DefaultInverseModelEvaluator< Scalar >::prototypeOutArgs_ [mutable, private]
template<class Scalar >
bool Thyra::DefaultInverseModelEvaluator< Scalar >::usingObservationTargetAsParameter_ [mutable, private]

Definition at line 370 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
int Thyra::DefaultInverseModelEvaluator< Scalar >::obs_idx_ [private]

Definition at line 372 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
int Thyra::DefaultInverseModelEvaluator< Scalar >::p_idx_ [private]

Definition at line 373 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
double Thyra::DefaultInverseModelEvaluator< Scalar >::observationMultiplier_ [private]

Definition at line 376 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
double Thyra::DefaultInverseModelEvaluator< Scalar >::parameterMultiplier_ [private]

Definition at line 377 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
bool Thyra::DefaultInverseModelEvaluator< Scalar >::observationTargetAsParameter_ [private]

Definition at line 379 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
bool Thyra::DefaultInverseModelEvaluator< Scalar >::observationPassThrough_ [private]

Definition at line 381 of file Thyra_DefaultInverseModelEvaluator.hpp.

Definition at line 383 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
ParameterDrivenMultiVectorInput<Scalar> Thyra::DefaultInverseModelEvaluator< Scalar >::observationTargetReader_ [mutable, private]

Definition at line 385 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
ParameterDrivenMultiVectorInput<Scalar> Thyra::DefaultInverseModelEvaluator< Scalar >::parameterBaseReader_ [mutable, private]

Definition at line 386 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const std::string Thyra::DefaultInverseModelEvaluator< Scalar >::ObservationIndex_name_ = "Observation Index" [static, private]

Definition at line 388 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const int Thyra::DefaultInverseModelEvaluator< Scalar >::ObservationIndex_default_ = -1 [static, private]

Definition at line 389 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const std::string Thyra::DefaultInverseModelEvaluator< Scalar >::ParameterSubvectorIndex_name_ = "Parameter Subvector Ordinal" [static, private]

Definition at line 391 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const int Thyra::DefaultInverseModelEvaluator< Scalar >::ParameterSubvectorIndex_default_ = 0 [static, private]

Definition at line 392 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const std::string Thyra::DefaultInverseModelEvaluator< Scalar >::ObservationMultiplier_name_ = "Observation Multiplier" [static, private]

Definition at line 394 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const double Thyra::DefaultInverseModelEvaluator< Scalar >::ObservationMultiplier_default_ = 1.0 [static, private]

Definition at line 395 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const std::string Thyra::DefaultInverseModelEvaluator< Scalar >::ObservationTargetVector_name_ = "Observation Target Vector" [static, private]

Definition at line 397 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const std::string Thyra::DefaultInverseModelEvaluator< Scalar >::ObservationTargetAsParameter_name_ = "Observation Target as Parameter" [static, private]

Definition at line 399 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const bool Thyra::DefaultInverseModelEvaluator< Scalar >::ObservationTargetAsParameter_default_ = false [static, private]

Definition at line 400 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const std::string Thyra::DefaultInverseModelEvaluator< Scalar >::ObservationPassThrough_name_ = "Observation Pass Through" [static, private]

Definition at line 402 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const bool Thyra::DefaultInverseModelEvaluator< Scalar >::ObservationPassThrough_default_ = false [static, private]

Definition at line 403 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const std::string Thyra::DefaultInverseModelEvaluator< Scalar >::ParameterMultiplier_name_ = "Parameter Multiplier" [static, private]

Definition at line 405 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const double Thyra::DefaultInverseModelEvaluator< Scalar >::ParameterMultiplier_default_ = 1e-6 [static, private]

Definition at line 406 of file Thyra_DefaultInverseModelEvaluator.hpp.

template<class Scalar >
const std::string Thyra::DefaultInverseModelEvaluator< Scalar >::ParameterBaseVector_name_ = "Parameter Base Vector" [static, private]

Definition at line 408 of file Thyra_DefaultInverseModelEvaluator.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines