MCPcopy
hub / github.com/BrainJS/brain.js / _updateTrainingOptions

Method _updateTrainingOptions

src/neural-network.js:323–328  ·  view source on GitHub ↗

* * @param opts * Supports all `trainDefaults` properties * also supports: * learningRate: (number), * momentum: (number), * activation: 'sigmoid', 'relu', 'leaky-relu', 'tanh'

(opts)

Source from the content-addressed store, hash-verified

321 * activation: 'sigmoid', 'relu', 'leaky-relu', 'tanh'
322 */
323 _updateTrainingOptions(opts) {
324 Object.keys(NeuralNetwork.trainDefaults).forEach(opt => this.trainOpts[opt] = (opts.hasOwnProperty(opt)) ? opts[opt] : this.trainOpts[opt]);
325 NeuralNetwork._validateTrainingOptions(this.trainOpts);
326 this._setLogMethod(opts.log || this.trainOpts.log);
327 this.activation = opts.activation || this.activation;
328 }
329
330 /**
331 *

Callers 9

constructorMethod · 0.95
_prepTrainingMethod · 0.95
fromJSONMethod · 0.95
browser.min.jsFile · 0.80
tFunction · 0.80
browser.jsFile · 0.80
NeuralNetworkFunction · 0.80
trainopts.jsFile · 0.80
_prepTrainingMethod · 0.80

Calls 2

_setLogMethodMethod · 0.95

Tested by

no test coverage detected