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

Method constructor

src/neural-network.js:66–89  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

64 }
65
66 constructor(options = {}) {
67 Object.assign(this, this.constructor.defaults, options);
68 this.hiddenLayers = options.hiddenLayers;
69 this.trainOpts = {};
70 this._updateTrainingOptions(Object.assign({}, this.constructor.trainDefaults, options));
71
72 this.sizes = null;
73 this.outputLayer = null;
74 this.biases = null; // weights for bias nodes
75 this.weights = null;
76 this.outputs = null;
77
78 // state for training
79 this.deltas = null;
80 this.changes = null; // for momentum
81 this.errors = null;
82 this.errorCheckInterval = 1;
83 if (!this.constructor.prototype.hasOwnProperty('runInput')) {
84 this.runInput = null;
85 }
86 if (!this.constructor.prototype.hasOwnProperty('calculateDeltas')) {
87 this.calculateDeltas = null;
88 }
89 }
90
91 /**
92 *

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected