mirror of
https://github.com/ilyakooo0/grenade.git
synced 2024-09-11 06:35:23 +03:00
Fix off-by-one error in C code
This commit is contained in:
parent
9b18913acd
commit
2c68ddc27c
@ -6,7 +6,7 @@ void decend_cpu(int len, double rate, double momentum, double regulariser,
|
||||
const double* last,
|
||||
double* outputWeights, double* outputMomentum) {
|
||||
|
||||
for (int i = 0; i <= len; i++) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
outputMomentum[i] = momentum * last[i] - rate * gradient[i];
|
||||
outputWeights[i] = weights[i] + outputMomentum[i] - (rate * regulariser) * weights[i];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user