Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
Muhammad Fiky
Muhammad Fiky am 30 Dez. 2023
Beantwortet: Hassaan am 30 Dez. 2023
i used bpnn for modeling my experiment, and i must make surface plot to know my bpnn function experienced overfitting or not

Antworten (1)

Hassaan
Hassaan am 30 Dez. 2023
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.

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by