Commit 83e14fc2 authored by Sebastian Wolf's avatar Sebastian Wolf

xALS working

parent 8303563d
Pipeline #702 failed with stages
in 4 minutes and 44 seconds
......@@ -54,6 +54,7 @@
#include "xerus/performanceData.h"
#include "xerus/measurments.h"
#include "xerus/algorithms/als.h"
#include "xerus/algorithms/xals.h"
#include "xerus/algorithms/steepestDescent.h"
#include "xerus/algorithms/cg.h"
#include "xerus/algorithms/decompositionAls.h"
......
......@@ -24,6 +24,7 @@
#pragma once
#include <stddef.h>
#include "misc/allocator.h"
#include "misc/standard.h"
#include "misc/namedLogger.h"
......
......@@ -24,6 +24,7 @@
#pragma once
#include <stddef.h>
#include <cstdint>
#include <cstddef>
......
......@@ -119,7 +119,6 @@ static misc::UnitTest als_tut("ALS", "tutorial", [](){
xerus::ALS_SPD(A, X, B);
// LOG(asd, frob_norm(X-B));
TEST(frob_norm(X-B) < 1e-12);
......@@ -142,10 +141,20 @@ static misc::UnitTest als_tut("ALS", "tutorial", [](){
// ALSb.useResidualForEndCriterion = true;
// std::vector<value_t> perfdata;
ALS_SPD(A, X, C, 1e-12, pd);
LOG(woopR, frob_norm(A(i/2, j/2)*X(j&0) - C(i&0))/frob_norm(C));
xerus::xals(X, A, C);
TEST(frob_norm(A(i/2, j/2)*X(j&0) - C(i&0)) < 1e-4);
LOG(woop, frob_norm(A(i/2, j/2)*X(j&0) - C(i&0))/frob_norm(C));
X = xerus::TTTensor::random(stateDims, 2);
LOG(woopR, frob_norm(A(i/2, j/2)*X(j&0) - C(i&0))/frob_norm(C));
xerus::ALS_SPD(A, X, C, 1e-12, pd);
TEST(frob_norm(A(i/2, j/2)*X(j&0) - C(i&0)) < 1e-4);
LOG(woop, frob_norm(A(i/2, j/2)*X(j&0) - C(i&0))/frob_norm(C));
// perfdata.clear();
// ALSb(A, X, B, 1e-4, &perfdata);
// TEST(!misc::approx_equal(frob_norm(A(i^d, j^d)*X(j&0) - B(i&0)), 0., 1.));
......
This diff is collapsed.
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