how to do not display the manopt blog?

34 views
Skip to first unread message

jifa zhang

unread,
May 17, 2023, 10:00:41 PMMay 17
to Manopt
Hello, i want  to know how to do not display the manopt blog?

捕获2.PNG

%%
% Generate random problem data.
clc,clear;
close all;
warning('off', 'manopt:getHessian:approx')
n = 1000;
A = randn(n);
A = .5*(A+A.');
 
% Create the problem structure.
manifold = spherefactory(n);
problem.M = manifold;
 
% Define the problem cost function and its Euclidean gradient.
problem.cost  = @(x) -x'*(A*x);
problem.egrad = @(x) -2*A*x;      % notice the 'e' in 'egrad' for Euclidean
 
% Numerically check gradient consistency (optional).
checkgradient(problem);
 
% Solve.
[x, xcost, info, options] = trustregions(problem);
 
% Display some statistics.
figure;
semilogy([info.iter], [info.gradnorm], '.-');
xlabel('Iteration number');
ylabel('Norm of the gradient of f');

Nicolas Boumal

unread,
May 18, 2023, 2:57:02 AMMay 18
to Manopt
Hello,

Part of the text output (and the first figure) is generated by the line

checkgradient(problem);

That is optional (it's only useful when debugging), so you can just delete it, or comment it out.

The rest of the text output comes from the call the the solver:

[x, xcost, info, options] = trustregions(problem);

You can reduce or suppress the amount of text output by specifying this in the options, as follows:

options = struct();
options.verbosity = 0; % 0 means no output at all; 1 means very little output; 2 is more etc.
[x, xcost, info, options] = trustregions(problem, [], options);  % the second input is the initial iterate; passing [] tells manopt to use the default random initialization

You can find such information and more by typing

help trustregions

or by reading the tutorial, specifically, the table under "Solvers" about the options structure.

Best,
Nicolas

jifa zhang

unread,
May 18, 2023, 3:50:40 AMMay 18
to Manopt
thank you very much, i have got it.
Reply all
Reply to author
Forward
0 new messages