@MathWorks Support Team please any solution to my question? My code takes a long time to run and displaying all the results means that I can't use my system effectively when the code is running. I.e. My current window closes when every new iteration.
How to stop the display of objective function model calculation and the graphs when using GP
9 次查看(过去 30 天)
显示 更早的评论
I am computing a GP at every iteration using a for-loop. The objective function graphs and calculations in the command wind is taking a lot of space. I have about 201 figures. How can I stop the display of objective function calculation in the command window and the graphs.
N = 100;
x1 = linspace(0, 10, N);
x2 = linspace(0, 5, N);
X = [x1; x2];
X = X';
Y = sin(X(:, 1).^2 + X(:, 2).^2);
gpr = fitrgp(X,Y,'KernelFunction','squaredexponential',...
'OptimizeHyperparameters','auto','HyperparameterOptimizationOptions',...
struct('AcquisitionFunctionName','expected-improvement-plus'));
采纳的回答
Ayush Aniket
2023-11-27
Hi Telema,
As per my understanding you would like to stop the display of objective function model calculation and the graphs. You can use the ‘ShowPlots’ and ‘Verbose’ options available in the ‘HyperparameterOptimizationOptions’ name-value argument of the function “fitgrp”. These options give you the ability to suppress the display of plots and iterative calculation information. You can modify your code as follows:
% Set the options for hyperparameter optimization to suppress display and plots
opts = struct('AcquisitionFunctionName', 'expected-improvement-plus', ...
'ShowPlots', false, ... % This stops the display of plots
'Verbose', 0); % This stops the display in the command window
gpr = fitrgp(X, Y, 'KernelFunction', 'squaredexponential', ...
'OptimizeHyperparameters', 'auto', ...
'HyperparameterOptimizationOptions', opts);
To read more about the options and their functionality please refer to the following documentation page:
Hope it helps!
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!