Ocean
|
This class implements an optimization for universal dense problems with one model (optimization problem). More...
Data Structures | |
class | UniversalOptimizationProvider |
This class implements a dense universal optimization provider for universal models and measurement/data values. More... | |
Public Types | |
typedef StaticBuffer< Scalar, tModelSize > | Model |
Definition of a model. More... | |
typedef StaticBuffer< Scalar, tExternalModelSize > | ExternalModel |
Definition of an external model. More... | |
typedef StaticBuffer< Scalar, tResultDimension > | Result |
Definition of a model result. More... | |
typedef Callback< void, const ExternalModel &, const size_t, Result & > | ValueCallback |
Definition of a callback function for dense value calculation. More... | |
typedef Callback< bool, const ExternalModel &, const size_t, Result & > | ErrorCallback |
Definition of a callback function for dense error calculation. More... | |
typedef Callback< void, Model &, ExternalModel & > | ModelTransformationCallback |
Definition of a dense model transformation function. More... | |
typedef Callback< void, Model & > | ModelAdjustmentCallback |
Definition of a dense model adjustment function. More... | |
Static Public Member Functions | |
static bool | optimizeUniversalModel (const Model &model, const size_t numberElements, const ValueCallback &valueCallback, const ErrorCallback &errorCallback, const ModelTransformationCallback &modelTransformationCallback, const ModelAdjustmentCallback &modelAdjustmentCallback, Model &optimizedModel, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr) |
Optimizes a universal model by minimizing the error the model produces. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from Ocean::Geometry::NonLinearOptimization | |
template<typename T > | |
static bool | denseOptimization (T &provider, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a dense (matrix) optimization problem. More... | |
template<typename T , Estimator::EstimatorType tEstimator> | |
static bool | denseOptimization (T &provider, const unsigned int iterations=5u, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a dense (matrix) optimization problem. More... | |
template<typename T > | |
static bool | sparseOptimization (T &provider, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a sparse (matrix) optimization problem. More... | |
template<typename T , Estimator::EstimatorType tEstimator> | |
static bool | sparseOptimization (T &provider, const unsigned int iterations=5u, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a sparse (matrix) optimization problem. More... | |
template<typename T > | |
static bool | advancedDenseOptimization (T &advancedDenseProvider, const unsigned int iterations, Scalar lambda, const Scalar lambdaFactor, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a dense (matrix) optimization problem using an advanced optimization provider. More... | |
template<typename T > | |
static bool | advancedSparseOptimization (T &advancedSparseProvider, const unsigned int iterations, Scalar lambda, const Scalar lambdaFactor, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a sparse (matrix) optimization problem using an advanced optimization provider. More... | |
template<Estimator::EstimatorType tEstimator> | |
static Scalar | sqrErrors2robustErrors2 (const Scalars &sqrErrors, const size_t modelParameters, Vector2 *weightedErrors, Vector2 *weightVectors, const SquareMatrix2 *transposedInvertedCovariances) |
Translates the n/2 squared errors that correspond to n elements in the error vector to robust errors. More... | |
template<Estimator::EstimatorType tEstimator, size_t tDimension> | |
static Scalar | sqrErrors2robustErrors (const Scalars &sqrErrors, const size_t modelParameters, StaticBuffer< Scalar, tDimension > *weightedErrors, StaticBuffer< Scalar, tDimension > *weightVectors, const Matrix *transposedInvertedCovariances) |
Translates the n/i squared errors that correspond to n elements in the error vector to robust errors. More... | |
template<Estimator::EstimatorType tEstimator> | |
static Scalar | sqrErrors2robustErrors_i (const Scalars &sqrErrors, const size_t modelParameters, const size_t dimension, Scalar *weightedErrors_i, Scalar *weightVectors_i, const Matrix *transposedInvertedCovariances_i) |
Translates the n/i squared errors that correspond to n elements in the error vector to robust errors. More... | |
static Scalar | sqrErrors2robustErrors2 (const Estimator::EstimatorType estimator, const Scalars &sqrErrors, const size_t modelParameters, Vector2 *weightedErrors, Vector2 *weightVectors, const SquareMatrix2 *transposedInvertedCovariances) |
Translates the n/2 squared errors that correspond to n elements in the error vector to robust errors. More... | |
template<size_t tDimension> | |
static Scalar | sqrErrors2robustErrors (const Estimator::EstimatorType estimator, const Scalars &sqrErrors, const size_t modelParameters, StaticBuffer< Scalar, tDimension > *weightedErrors, StaticBuffer< Scalar, tDimension > *weightVectors, const Matrix *transposedInvertedCovariances) |
Translates the n/i squared errors that correspond to n elements in the error vector to robust errors. More... | |
static Scalar | sqrErrors2robustErrors_i (const Estimator::EstimatorType estimator, const Scalars &sqrErrors, const size_t modelParameters, const size_t dimension, Scalar *weightedErrors_i, Scalar *weightVectors_i, const Matrix *transposedInvertedCovariances_i) |
Translates the n/i squared errors that correspond to n elements in the error vector to robust errors. More... | |
This class implements an optimization for universal dense problems with one model (optimization problem).
The implementation allows to optimize arbitrary (universal) problems with arbitrary dimensions.
tModelSize | Size of the model, the number of model parameters |
tResultDimension | Number of dimensions that result for each element (measurement) after the model has been applied |
tExternalModelSize | Size of the external model, the number of model parameters |
typedef Callback<bool, const ExternalModel&, const size_t, Result&> Ocean::Geometry::NonLinearUniversalOptimizationDense< tModelSize, tResultDimension, tExternalModelSize >::ErrorCallback |
Definition of a callback function for dense error calculation.
The first parameter provides the external model that is applied to determine the error.
The second parameter provides the index of the measurement elements that is used to determine the error.
The third parameter receives the determined error.
The return value provides True if both models provide valid information for the measurement element.
typedef StaticBuffer<Scalar, tExternalModelSize> Ocean::Geometry::NonLinearUniversalOptimizationDense< tModelSize, tResultDimension, tExternalModelSize >::ExternalModel |
Definition of an external model.
typedef StaticBuffer<Scalar, tModelSize> Ocean::Geometry::NonLinearUniversalOptimizationDense< tModelSize, tResultDimension, tExternalModelSize >::Model |
Definition of a model.
typedef Callback<void, Model&> Ocean::Geometry::NonLinearUniversalOptimizationDense< tModelSize, tResultDimension, tExternalModelSize >::ModelAdjustmentCallback |
Definition of a dense model adjustment function.
The adjustment function allows to modify the internal model (the modification should be tiny e.g., a normalization of a vector which has almost length 1) before the model will be accepted or rejected The first parameter provides the model to be adjusted
typedef Callback<void, Model&, ExternalModel&> Ocean::Geometry::NonLinearUniversalOptimizationDense< tModelSize, tResultDimension, tExternalModelSize >::ModelTransformationCallback |
Definition of a dense model transformation function.
The transformation function allows to use an external model function for value and error determination while the internal model is used for the internal optimization.
The first parameter provides the internal model.
The second parameter receives the external model.
typedef StaticBuffer<Scalar, tResultDimension> Ocean::Geometry::NonLinearUniversalOptimizationDense< tModelSize, tResultDimension, tExternalModelSize >::Result |
Definition of a model result.
typedef Callback<void, const ExternalModel&, const size_t, Result&> Ocean::Geometry::NonLinearUniversalOptimizationDense< tModelSize, tResultDimension, tExternalModelSize >::ValueCallback |
Definition of a callback function for dense value calculation.
The first parameter provides the external model that is applied to determine the value.
The second parameter provides the index of the measurement elements that is used to determine the value.
The third parameter receives the determined value.
|
static |
Optimizes a universal model by minimizing the error the model produces.
model | Universal model that will be optimized |
numberElements | Number of elements (measurements) that are used to determine the optimized model |
valueCallback | Callback function that is used to determine the value for an individual element (measurement) by application of the model |
errorCallback | Callback function that is used to determine the error for an individual element (measurement) |
modelTransformationCallback | Optional callback function allowing to transform the internal model into an extern model if intended |
modelAdjustmentCallback | Optional callback function allowing to adjust the internal (already optimized) model before it will be checked on improvements |
optimizedModel | Resulting optimized model |
iterations | Number of iterations to be applied at most, if no convergence can be reached |
estimator | Robust error estimator to be used |
lambda | Initial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity) |
lambdaFactor | Levenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity) |
initialError | Optional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator |
finalError | Optional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator |
intermediateErrors | Optional resulting intermediate (improving) errors |