cs');

%%

% Run the algorithm
[M_plus,~,output] = cp_opt(X, R+1, 'init', M_plus_init);
exitmsg = output.ExitMsg
fit = output.Fit

%%

% Check the answer (1 is perfect)
scr = score(M_plus, M_true)

%% Nonnegative factorization
% We can employ lower bounds to get a nonnegative factorization.

%% Create an example problem. 
% Create an example 50 x 40 x 30 tensor with rank 5 and add 10% noise. We
% select nonnegative factor matrices and lambdas. The
% create_problem doesn't really know how to add noise withou