Skip to content

Commit

Permalink
Please, linter gods, pleaaaase stop hating me
Browse files Browse the repository at this point in the history
  • Loading branch information
voidvoxel committed Jun 17, 2024
1 parent a21c387 commit 83574f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/neural-network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,12 @@ export class NeuralNetwork<
constructor(
options: Partial<INeuralNetworkOptions & INeuralNetworkTrainOptions> = {}
) {
this.options = { ...this.options, ...options };
this.options.binaryThresh = options.binaryThresh ?? 0.5;
this.options.hiddenLayers = options.hiddenLayers ?? [];
this.options.inputSize = options.inputSize ?? 1;
this.options.loss = options.loss ?? loss;
this.options.outputSize = options.outputSize ?? options.inputSize ?? 1;
this.options.ramSize = options.ramSize ?? 1;
this.updateTrainingOptions(options);

const { inputSize, hiddenLayers, outputSize } = this.options;
Expand Down
4 changes: 3 additions & 1 deletion src/utilities/to-svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,9 @@ export function toSVG<
// Get network size array for NeuralNetwork or NeuralNetworkGPU
let sizes: number[] = [];
if (net instanceof NeuralNetwork || net instanceof NeuralNetworkGPU) {
sizes = getNeuralNetworkSizes(net);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
sizes = getNeuralNetworkSizes((net as unknown) as NeuralNetwork);
}
// get network size for Recurrent
else if (net instanceof Recurrent) {
Expand Down

0 comments on commit 83574f6

Please sign in to comment.