필터 지우기
필터 지우기

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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by