Commit 3d956056 authored by Philipp Trunschke's avatar Philipp Trunschke
Browse files

server-updates

parent 7a8346a8
Pipeline #2128 failed with stages
in 4 minutes and 12 seconds
......@@ -348,9 +348,9 @@ clean:
-rm -f $(TEST_NAME)
-rm -f include/xerus.h.gch
make -C doc clean
-rm xerus/libxerus_misc.so
-rm xerus/libxerus.so
-rm xerus/xerus.so
-rm -f xerus/libxerus_misc.so
-rm -f xerus/libxerus.so
-rm -f xerus/xerus.so
......
......@@ -66,9 +66,9 @@ namespace xerus { namespace uq {
// Stagnation/Divergence parameters
double minDecrease = 1e-3;
size_t maxIterations = 1000;
size_t maxSweeps = 1000;
size_t trackingPeriodLength = 10;
size_t maxNonImprovingAlphaCycles = 10;
size_t maxStagnatingEpochs = 10;
// Inactive rank parameters
size_t kmin = 2;
......@@ -81,11 +81,11 @@ namespace xerus { namespace uq {
// SALSA parameters
double fomega = 1.05;
double omega_factor = 1;
double omegaFactor = 1;
// LASSO parameters
double falpha = 1.05;
double alpha_factor = 1;
double alphaFactor = 1;
std::vector<Tensor> basisWeights;
/* // Reweighting parameters */
......@@ -93,9 +93,14 @@ namespace xerus { namespace uq {
double initialResidual; //TODO: rename
size_t bestIteration;
TTTensor bestX;
double bestTrainingResidual;
double bestValidationResidual;
struct State {
double alpha;
double omega;
TTTensor x;
double trainingResidual;
double validationResidual;
} bestState;
SALSA(const TTTensor& _x, const std::vector<Tensor>& _measures, const Tensor& _values);
void run();
......
......@@ -308,11 +308,11 @@ namespace xerus { namespace uq { namespace impl_uqRaAdf {
Tensor delta(x.get_core(_setId).dimensions);
Tensor dyadComp, tmp;
#pragma omp declare reduction(+: Tensor: omp_out += omp_in) initializer(omp_priv = Tensor(omp_orig.dimensions))
if(_corePosition > 0) {
const Tensor shuffledX = reshuffle(x.get_core(_setId), {1, 0, 2});
//TODO: schedule, threadprivate(dyadComp, tmp)
#pragma omp declare reduction(+: Tensor: omp_out += omp_in) initializer(omp_priv = Tensor(omp_orig.dimensions))
#pragma omp parallel for reduction(+: delta) firstprivate(_corePosition, _setId, dyadComp, tmp, shuffledX) default(none)
for(size_t jIdx = 0; jIdx < sets[_setId].size(); ++jIdx) {
const size_t j = sets[_setId][jIdx];
......@@ -350,8 +350,6 @@ namespace xerus { namespace uq { namespace impl_uqRaAdf {
Tensor shuffledX = x.get_core(_setId);
shuffledX.reinterpret_dimensions({shuffledX.dimensions[1], shuffledX.dimensions[2]});
//TODO: schedule, threadprivate(dyadComp, tmp)
#pragma omp declare reduction(+: Tensor: omp_out += omp_in) initializer(omp_priv = Tensor(omp_orig.dimensions))
#pragma omp parallel for reduction(+: delta) firstprivate(_corePosition, _setId, dyadComp, tmp, shuffledX) default(none)
for(size_t jIdx = 0; jIdx < sets[_setId].size(); ++jIdx) {
const size_t j = sets[_setId][jIdx];
......
This diff is collapsed.
......@@ -155,6 +155,13 @@ void expose_recoveryAlgorithms(module& m) {
.value("Legendre", uq::PolynomBasis::Legendre)
;
class_<uq::SALSA::State>(m, "uqSALSAState")
.def_readonly("alpha", &uq::SALSA::State::alpha)
.def_readonly("omega", &uq::SALSA::State::omega)
.def_readonly("x", &uq::SALSA::State::x)
.def_readonly("bestTrainingResidual", &uq::SALSA::State::trainingResidual)
.def_readonly("bestValidationResidual", &uq::SALSA::State::validationResidual)
;
class_<uq::SALSA>(m, "uqSALSA")
.def(init<TTTensor, std::vector<Tensor>, Tensor>())
......@@ -162,25 +169,23 @@ void expose_recoveryAlgorithms(module& m) {
.def_readwrite("controlSetFraction", &uq::SALSA::controlSetFraction)
.def_readwrite("targetResidual", &uq::SALSA::targetResidual)
.def_readwrite("minDecrease", &uq::SALSA::minDecrease)
.def_readwrite("maxIterations", &uq::SALSA::maxIterations)
.def_readwrite("maxSweeps", &uq::SALSA::maxSweeps)
.def_readwrite("trackingPeriodLength", &uq::SALSA::trackingPeriodLength)
.def_readwrite("maxNonImprovingAlphaCycles", &uq::SALSA::maxNonImprovingAlphaCycles)
.def_readwrite("maxStagnatingEpochs", &uq::SALSA::maxStagnatingEpochs)
.def_readwrite("kmin", &uq::SALSA::kmin)
.def_readwrite("maxRanks;", &uq::SALSA::maxRanks)
.def_readwrite("maxRanks", &uq::SALSA::maxRanks)
.def_readwrite("maxIRsteps", &uq::SALSA::maxIRsteps)
.def_readwrite("IRtolerance", &uq::SALSA::IRtolerance)
.def_readwrite("sparsityThreshold", &uq::SALSA::sparsityThreshold)
.def_readwrite("fomega", &uq::SALSA::fomega)
.def_readwrite("omega_factor", &uq::SALSA::omega_factor)
.def_readwrite("omegaFactor", &uq::SALSA::omegaFactor)
.def_readwrite("falpha", &uq::SALSA::falpha)
.def_readwrite("alpha_factor", &uq::SALSA::alpha_factor)
.def_readwrite("alphaFactor", &uq::SALSA::alphaFactor)
.def_readwrite("basisWeights", &uq::SALSA::basisWeights)
.def_readonly("initialResidual", &uq::SALSA::initialResidual)
.def_readonly("bestIteration", &uq::SALSA::bestIteration)
.def_readonly("bestX", &uq::SALSA::bestX)
.def_readonly("bestTrainingResidual", &uq::SALSA::bestTrainingResidual)
.def_readonly("bestValidationResidual", &uq::SALSA::bestValidationResidual)
.def_readonly("bestState", &uq::SALSA::bestState)
.def("run", &uq::SALSA::run)
;
......
Supports Markdown
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