MCPcopy Create free account
hub / github.com/DFin/Neural-Network-Visualisation / constructor

Method constructor

assets/main.js:1272–1281  ·  view source on GitHub ↗
(definition)

Source from the content-addressed store, hash-verified

1270
1271class FeedForwardModel {
1272 constructor(definition) {
1273 if (!definition.layers?.length) {
1274 throw new Error("Die Netzwerkdefinition muss Schichten enthalten.");
1275 }
1276 this.normalization = definition.normalization ?? { mean: 0, std: 1 };
1277 this.architecture = Array.isArray(definition.architecture)
1278 ? definition.architecture.slice()
1279 : this.computeArchitecture(definition.layers);
1280 this.layers = definition.layers.map((layer, index) => this.normaliseLayer(layer, index));
1281 }
1282
1283 computeArchitecture(layers) {
1284 if (!layers.length) return [];

Callers

nothing calls this directly

Calls 2

computeArchitectureMethod · 0.95
normaliseLayerMethod · 0.95

Tested by

no test coverage detected