Rate error bugfix
Esse commit está contido em:
externo
+3
-1
@@ -1969,6 +1969,7 @@
|
|||||||
testSet = set.slice(numTrain);
|
testSet = set.slice(numTrain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var lastError = 0;
|
||||||
while ((!abort && iterations < this.iterations && error > this.error)) {
|
while ((!abort && iterations < this.iterations && error > this.error)) {
|
||||||
if (crossValidate && error <= this.crossValidate.testError) {
|
if (crossValidate && error <= this.crossValidate.testError) {
|
||||||
break;
|
break;
|
||||||
@@ -1984,7 +1985,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(typeof this.rate === 'function') {
|
if(typeof this.rate === 'function') {
|
||||||
currentRate = this.rate(iterations, error);
|
currentRate = this.rate(iterations, lastError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crossValidate) {
|
if (crossValidate) {
|
||||||
@@ -1998,6 +1999,7 @@
|
|||||||
|
|
||||||
// check error
|
// check error
|
||||||
error /= currentSetSize;
|
error /= currentSetSize;
|
||||||
|
lastError = error;
|
||||||
|
|
||||||
if (options) {
|
if (options) {
|
||||||
if (this.schedule && this.schedule.every && iterations %
|
if (this.schedule && this.schedule.every && iterations %
|
||||||
|
|||||||
+3
-1
@@ -74,6 +74,7 @@ Trainer.prototype = {
|
|||||||
testSet = set.slice(numTrain);
|
testSet = set.slice(numTrain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var lastError = 0;
|
||||||
while ((!abort && iterations < this.iterations && error > this.error)) {
|
while ((!abort && iterations < this.iterations && error > this.error)) {
|
||||||
if (crossValidate && error <= this.crossValidate.testError) {
|
if (crossValidate && error <= this.crossValidate.testError) {
|
||||||
break;
|
break;
|
||||||
@@ -89,7 +90,7 @@ Trainer.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(typeof this.rate === 'function') {
|
if(typeof this.rate === 'function') {
|
||||||
currentRate = this.rate(iterations, error);
|
currentRate = this.rate(iterations, lastError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crossValidate) {
|
if (crossValidate) {
|
||||||
@@ -103,6 +104,7 @@ Trainer.prototype = {
|
|||||||
|
|
||||||
// check error
|
// check error
|
||||||
error /= currentSetSize;
|
error /= currentSetSize;
|
||||||
|
lastError = error;
|
||||||
|
|
||||||
if (options) {
|
if (options) {
|
||||||
if (this.schedule && this.schedule.every && iterations %
|
if (this.schedule && this.schedule.every && iterations %
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário