Filter löschen
Filter löschen

Elementwise multiplication of two matrices which does not contain NaN elements Results a matrix with lots of Nan Values

4 Ansichten (letzte 30 Tage)
Hi,
I have a matrix multiplication. First matrix is input_of_hidden_layer2 second matrix is error_of_hidden_layer2.
Before multiplication I check the number of NAn values in the matrixes as below:
result1 = sum(isnan(input_of_hidden_layer2(:)));
result2 = sum(isnan(error_of_hidden_layer2(:)));
disp("result1 " + result1);
disp("result2 " + result2);
I also print the matrix values.
This is the multiplication
delta2 = vpa(((input_of_hidden_layer2>0).*error_of_hidden_layer2),150);
The resulting matrix delta2 is a (30,1) matrix and contains 14 NaN values. There is no Inf value, there is no division. I think this is nonsense. Please help me to understand and fix this problem.
I attached the matrix values in a separate file for you to check.
Best Regards,
Ferda
  4 Kommentare
ferda sonmez
ferda sonmez am 22 Mär. 2019
I uploaded the matrixes. The matrix named error_of_hidden_layer2 did not include any NaN values.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

ferda sonmez
ferda sonmez am 31 Mär. 2019
Hi,
The problem was the matrixes didn't store double values but they were symbolic for some reason. The problem was not related to elementwise multiplication. I casted all the matrixes to double prior to this operation.
Best Regards,
Ferda Özdemir Sönmez

Weitere Antworten (0)

Tags

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by