MCPcopy Create free account
hub / github.com/BrainJS/brain.js / _trainPattern

Method _trainPattern

src/neural-network.js:490–504  ·  view source on GitHub ↗

* * @param input * @param target

(input, target, logErrorRate)

Source from the content-addressed store, hash-verified

488 * @param target
489 */
490 _trainPattern(input, target, logErrorRate) {
491
492 // forward propagate
493 this.runInput(input);
494
495 // back propagate
496 this.calculateDeltas(target);
497 this._adjustWeights();
498
499 if (logErrorRate) {
500 return mse(this.errors[this.outputLayer]);
501 } else {
502 return null;
503 }
504 }
505
506 /**
507 *

Callers 5

_trainPatternsMethod · 0.95
browser.min.jsFile · 0.45
browser.jsFile · 0.45
trainDatumMethod · 0.45

Calls 4

_adjustWeightsMethod · 0.95
calculateDeltasMethod · 0.80
mseFunction · 0.50
runInputMethod · 0.45

Tested by

no test coverage detected