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

Method bindEquation

src/recurrent/rnn.js:128–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126 }
127
128 bindEquation() {
129 let model = this.model;
130 let equation = new Equation();
131 let outputs = [];
132 let equationConnection = model.equationConnections.length > 0
133 ? model.equationConnections[model.equationConnections.length - 1]
134 : this.initialLayerInputs
135 ;
136
137 // 0 index
138 let output = this.getEquation(equation, equation.inputMatrixToRow(model.input), equationConnection[0], model.hiddenLayers[0]);
139 outputs.push(output);
140 // 1+ indices
141 for (let i = 1, max = this.hiddenLayers.length; i < max; i++) {
142 output = this.getEquation(equation, output, equationConnection[i], model.hiddenLayers[i]);
143 outputs.push(output);
144 }
145
146 model.equationConnections.push(outputs);
147 equation.add(equation.multiply(model.outputConnector, output), model.output);
148 model.equations.push(equation);
149 }
150
151 mapModel() {
152 let model = this.model;

Callers 7

runInputMethod · 0.95
runMethod · 0.95
fromJSONMethod · 0.95
browser.min.jsFile · 0.45
browser.jsFile · 0.45
rnn-time-step.jsFile · 0.45
rnn.jsFile · 0.45

Calls 4

getEquationMethod · 0.95
inputMatrixToRowMethod · 0.95
addMethod · 0.95
multiplyMethod · 0.95

Tested by

no test coverage detected