フィルターのクリア

How to make surface plot from results training BPNN with 3 input

1 回表示 (過去 30 日間)
Muhammad Fiky
Muhammad Fiky 2023 年 12 月 30 日
回答済み: Hassaan 2023 年 12 月 30 日
i used bpnn for modeling my experiment, and i must make surface plot to know my bpnn function experienced overfitting or not

回答 (1 件)

Hassaan
Hassaan 2023 年 12 月 30 日
I am assumes you have a function bpnn_predict which takes two inputs and produces an output, and you wish to plot the results for a range of these inputs:
% Define the range of inputs for the two input variables
input1_range = linspace(min_input1, max_input1, num_points);
input2_range = linspace(min_input2, max_input2, num_points);
% Create a grid of input values
[Input1, Input2] = meshgrid(input1_range, input2_range);
% Initialize the matrix to hold the BPNN outputs
Output = zeros(size(Input1));
% Loop over each input combination and compute the BPNN output
for i = 1:numel(Input1)
Output(i) = bpnn_predict(Input1(i), Input2(i), constant_input3); % constant_input3 is the third input held constant
end
% Create the surface plot
surf(Input1, Input2, Output)
xlabel('Input 1')
ylabel('Input 2')
zlabel('Output')
title('BPNN Output Surface')
To diagnose overfitting, you can compare this surface plot with one generated from validation data that the network hasn't seen during training. If the surface looks overly complex or if it changes drastically when compared with the validation data, it might be a sign of overfitting.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by