フィルターのクリア

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

4 ビュー (過去 30 日間)
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 件のコメント
ferda sonmez
ferda sonmez 2019 年 3 月 22 日
I uploaded the matrixes. The matrix named error_of_hidden_layer2 did not include any NaN values.

サインインしてコメントする。

採用された回答

ferda sonmez
ferda sonmez 2019 年 3 月 31 日
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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by