Commit 139b810c authored by Sebastian Wolf's avatar Sebastian Wolf

Fixed Python wrapper

parent 53ae48ff
Pipeline #1101 passed with stages
in 16 minutes and 13 seconds
......@@ -48,14 +48,14 @@ namespace xerus {
double targetRelativeResidual;
///@brief Minimal decrease of the residual norm ( newRes/oldRes ) until either the ranks are increased (if allowed) or the algorithm stops.
double minimalResidualNormDecrease;
double minimalResidualDecrease;
///@brief Number of iterations used to check for stopping criteria (e.g. residual[iterations] <= residual[iteration-tracking]*pow(minimalResidualNormDecrease, tracking) )
///@brief Number of iterations used to check for stopping criteria (e.g. residual[iterations] <= residual[iteration-tracking]*pow(minimalResidualDecrease, tracking) )
size_t tracking = 10;
protected:
OptimizationAlgorithm(const size_t _minIterations, const size_t _maxIterations, const double _targetRelativeResidual, const double _minimalResidualNormDecrease);
OptimizationAlgorithm(const size_t _minIterations, const size_t _maxIterations, const double _targetRelativeResidual, const double _minimalResidualDecrease);
};
......@@ -72,12 +72,12 @@ namespace xerus {
const double targetRelativeResidual;
///@brief Minimal decrease of the residual norm ( newRes/oldRes ) until either the ranks are increased (if allowed) or the algorithm stops.
const double minimalResidualNormDecrease;
const double minimalResidualDecrease;
///@brief Number of iterations used to check for stopping criteria (e.g. residual[iterations] <= residual[iteration-tracking]*pow(minimalResidualNormDecrease, tracking) )
///@brief Number of iterations used to check for stopping criteria (e.g. residual[iterations] <= residual[iteration-tracking]*pow(minimalResidualDecrease, tracking) )
const size_t tracking;
///@brief Defined as pow(minimalResidualNormDecrease, tracking).
///@brief Defined as pow(minimalResidualDecrease, tracking).
const double convergenceFactor;
private:
......@@ -105,7 +105,7 @@ namespace xerus {
///@brief True if either the maxIterations are reached or the targetRelativeResidual is reached.
bool reached_stopping_criteria() const;
///@brief True if either the minInterations are reached and convegence is reached (i.e. residual[iterations] <= residual[iteration-tracking]*pow(minimalResidualNormDecrease, tracking) ).
///@brief True if either the minInterations are reached and convegence is reached (i.e. residual[iterations] <= residual[iteration-tracking]*pow(minimalResidualDecrease, tracking) ).
bool reached_convergence_criteria() const;
///@brief Resets the convergence buffer with max doubles. In particular at least tracking iterations are then nessecary the reach convergence.
......
......@@ -160,7 +160,7 @@ namespace xerus { namespace impl_TrASD {
minIterations(_optiSettings.minIterations),
maxIterations(_optiSettings.maxIterations),
targetRelativeResidual(_optiSettings.targetRelativeResidual),
minimalResidualNormDecrease(_optiSettings.minimalResidualNormDecrease),
minimalResidualNormDecrease(_optiSettings.minimalResidualDecrease),
tracking(_optiSettings.tracking),
maxRanks(TTTensor::reduce_to_maximal_ranks(_maxRanks, _x.dimensions)),
......
......@@ -29,11 +29,11 @@
#include <xerus/performanceData.h>
namespace xerus {
OptimizationAlgorithm::OptimizationAlgorithm(const size_t _minIterations, const size_t _maxIterations, const double _targetRelativeResidual, const double _minimalResidualNormDecrease) :
OptimizationAlgorithm::OptimizationAlgorithm(const size_t _minIterations, const size_t _maxIterations, const double _targetRelativeResidual, const double _minimalResidualDecrease) :
minIterations(_minIterations),
maxIterations(_maxIterations),
targetRelativeResidual(_targetRelativeResidual),
minimalResidualNormDecrease(_minimalResidualNormDecrease)
minimalResidualDecrease(_minimalResidualDecrease)
{}
......@@ -41,9 +41,9 @@ namespace xerus {
minIterations(_optiAlgorithm.minIterations),
maxIterations(_optiAlgorithm.maxIterations),
targetRelativeResidual(_optiAlgorithm.targetRelativeResidual),
minimalResidualNormDecrease(_optiAlgorithm.minimalResidualNormDecrease),
minimalResidualDecrease(_optiAlgorithm.minimalResidualDecrease),
tracking(_optiAlgorithm.tracking),
convergenceFactor(misc::pow(minimalResidualNormDecrease, tracking)),
convergenceFactor(misc::pow(minimalResidualDecrease, tracking)),
lastResiduals(tracking, std::numeric_limits<double>::max()),
perfData(_perfData)
{ }
......
......@@ -149,8 +149,8 @@ void expose_recoveryAlgorithms() {
class_<ADFVariant>("ADFVariant", init<size_t, double, double>())
.def(init<ADFVariant>())
.def_readwrite("maxIterations", &ADFVariant::maxIterations)
.def_readwrite("targetResidualNorm", &ADFVariant::targetResidualNorm)
.def_readwrite("minimalResidualNormDecrease", &ADFVariant::minimalResidualNormDecrease)
.def_readwrite("targetResidualNorm", &ADFVariant::targetRelativeResidual)
.def_readwrite("minimalResidualDecrease", &ADFVariant::minimalResidualDecrease)
.def("__call__", +[](ADFVariant &_this, TTTensor& _x, const SinglePointMeasurementSet& _meas, PerformanceData& _pd){
return _this(_x, _meas, _pd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment