@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!