Effacer les filtres
Effacer les filtres

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

4 vues (au cours des 30 derniers jours)
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 commentaires
ferda sonmez
ferda sonmez le 22 Mar 2019
I uploaded the matrixes. The matrix named error_of_hidden_layer2 did not include any NaN values.

Connectez-vous pour commenter.

Réponse acceptée

ferda sonmez
ferda sonmez le 31 Mar 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

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by