intermediate variables influnences in a for loop of MATLAB code
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everyone,
I have a problem about intermediate varaibles in a for loop. It's part of MLP code, for simplicity I don't write it down here. In the last section of the for loop, it is
W1Ex=W1Ex+lr*dW1Ex;
W2Ex=W2Ex+lr*dW2Ex;
W2=W2Ex(:,1:HiddenUnitNum);
end
And now I want to add intermediate varaibles as
W1_2Ex=W1Ex+lr*dW1Ex;
W2_2Ex=W2Ex+lr*dW2Ex;
W2=W2_2Ex(:,1:HiddenUnitNum);
W1Ex=W1_2Ex;
W2Ex=W2_2Ex;
end
And Since W1_2Ex and W2_2Ex only exist in this part, the rest of the loop remain the same. I don't know why the simulation under these two scenarios are different. Actually, the changed one did not converge. Moreover, when I switch back to the orignal code(without intermediate varaibles). The results are wrong too and I have to restart MATLAB to run it again to get the right answer! Could someone give me some hints!
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!