Skip to content

Commit 83574f6

Browse files
committed
Please, linter gods, pleaaaase stop hating me
1 parent a21c387 commit 83574f6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/neural-network.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,12 @@ export class NeuralNetwork<
323323
constructor(
324324
options: Partial<INeuralNetworkOptions & INeuralNetworkTrainOptions> = {}
325325
) {
326-
this.options = { ...this.options, ...options };
326+
this.options.binaryThresh = options.binaryThresh ?? 0.5;
327+
this.options.hiddenLayers = options.hiddenLayers ?? [];
328+
this.options.inputSize = options.inputSize ?? 1;
329+
this.options.loss = options.loss ?? loss;
330+
this.options.outputSize = options.outputSize ?? options.inputSize ?? 1;
331+
this.options.ramSize = options.ramSize ?? 1;
327332
this.updateTrainingOptions(options);
328333

329334
const { inputSize, hiddenLayers, outputSize } = this.options;

src/utilities/to-svg.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,9 @@ export function toSVG<
467467
// Get network size array for NeuralNetwork or NeuralNetworkGPU
468468
let sizes: number[] = [];
469469
if (net instanceof NeuralNetwork || net instanceof NeuralNetworkGPU) {
470-
sizes = getNeuralNetworkSizes(net);
470+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
471+
// @ts-expect-error
472+
sizes = getNeuralNetworkSizes((net as unknown) as NeuralNetwork);
471473
}
472474
// get network size for Recurrent
473475
else if (net instanceof Recurrent) {

0 commit comments

Comments
 (0)