나는 매트랩 간단한 역 전파 네트워크를 코드에 노력하고 있으며, 나는 다음과 같은 오류가 점점 오전 : 내 코드의 라인 (144)에첨자 지수는 실제 양의 정수이어야하며, 그들은 (matlab에)는
Subscript indices must either be real positive integers
or logicals.
을
for l = 1:net.layerCount,
if l == 1, % From input layer
for i = round(1:net.inputSize),
i % i = 1 and
l % l = 1 when I get the error.
% error in this next line:
net.weight{l}(i,:) = net.weight{l}(i,:) ...
- sum(lrate .* net.delta{l} .* net.layerOutput{l-1}(i)) ...
- (momentum .* net.previousWeightDelta{l}(i,:));
net.previousWeightDelta{l}(i,:) = net.weight{l}(i,:);
end
else
for i = 1:net.layerSize{l-1},
net.weight{l}(i,:) = net.weight{l}(i,:) ...
- sum(lrate .* net.delta{l} .* net.layerOutput{l-1}(i)) ...
- (momentum .* net.previousWeightDelta{l}(i,:));
net.previousWeightDelta{l}(i,:) = net.weight{l}(i,:);
end
end
end
1 : net.layerCount와 round()가있는 다른 루프 벡터를 둘러싸고 있어도 오류가 지속됩니다. 왜 이것이 사실일까요?
감사합니다. l == 1
경우
어떤 오류가이 오류를 반환합니까? "144"는 여기에 많은 것을 말하지 않습니다 ... – liori
'dbstop if error'와'which'는 그 행에서 여러분이 빗나간 그림자 변수를 가지고 있지 않은지 확인합니다 -'sum'에 변수를 넣으 려 할 때 여기에 변수가 있습니다. 귀하의 i/l 값이 귀하가 말하는 것 인 경우. 속임수를보십시오. – nkjt