Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
Muhammad Fiky
Muhammad Fiky el 30 de Dic. de 2023
Respondida: Hassaan el 30 de Dic. de 2023
i used bpnn for modeling my experiment, and i must make surface plot to know my bpnn function experienced overfitting or not

Respuestas (1)

Hassaan
Hassaan el 30 de Dic. de 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.

Categorías

Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by