Skip to content

Commit fa2c1db

Browse files
chore: Lint
1 parent c84f562 commit fa2c1db

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

src/layer/fully-connected.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,12 @@ export class FullyConnected extends Filter {
278278

279279
compare(): void {
280280
const inputLayerDeltas = this.inputLayer.deltas;
281-
this.inputLayer.deltas = (
282-
this.compareInputDeltasKernel as IKernelRunShortcut
283-
)(inputLayerDeltas, this.deltas, this.filters);
281+
this.inputLayer.deltas = (this
282+
.compareInputDeltasKernel as IKernelRunShortcut)(
283+
inputLayerDeltas,
284+
this.deltas,
285+
this.filters
286+
);
284287
release(inputLayerDeltas);
285288

286289
const { biasDeltas, filterDeltas } = this;

src/layer/pool.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,8 @@ export class Pool extends Filter {
313313
}
314314

315315
predict(): void {
316-
const {
317-
result: weights,
318-
switchX,
319-
switchY,
320-
} = (this.predictKernelMap as IKernelMapRunShortcut<ISubKernelObject>)(
316+
const { result: weights, switchX, switchY } = (this
317+
.predictKernelMap as IKernelMapRunShortcut<ISubKernelObject>)(
321318
this.inputLayer.weights
322319
);
323320
this.switchX = switchX;

src/neural-network-gpu.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,9 @@ export class NeuralNetworkGPU<
307307
}
308308
const result = this._divideMSESum(data.length, sum);
309309
release(sum);
310-
return (
311-
result instanceof Texture
312-
? (result.toArray() as number[])
313-
: (result as number[])
314-
)[0];
310+
return (result instanceof Texture
311+
? (result.toArray() as number[])
312+
: (result as number[]))[0];
315313
}
316314

317315
adjustWeights(): void {
@@ -621,11 +619,11 @@ export class NeuralNetworkGPU<
621619
if (this.inputLookup) {
622620
formattedInput = lookup.toArray(
623621
this.inputLookup,
624-
input as unknown as INumberHash,
622+
(input as unknown) as INumberHash,
625623
this.inputLookupLength
626624
);
627625
} else {
628-
formattedInput = input as unknown as Float32Array;
626+
formattedInput = (input as unknown) as Float32Array;
629627
}
630628
this.validateInput(formattedInput);
631629
const outputTextures = this.runInput(formattedInput);
@@ -635,13 +633,13 @@ export class NeuralNetworkGPU<
635633
: outputTextures;
636634

637635
if (this.outputLookup) {
638-
return lookup.toObject(
636+
return (lookup.toObject(
639637
this.outputLookup,
640638
output as Float32Array
641-
) as unknown as OutputType;
639+
) as unknown) as OutputType;
642640
}
643641

644-
return output as unknown as OutputType;
642+
return (output as unknown) as OutputType;
645643
}
646644

647645
// @ts-expect-error the underlying network works as normal, but we are working on the GPU
@@ -694,10 +692,9 @@ export class NeuralNetworkGPU<
694692
}
695693
// use Array.from, keeping json small
696694
const jsonLayerWeights = this.weights.map((layerWeights) => {
697-
return (
698-
layerWeights instanceof Texture
699-
? (layerWeights.toArray() as Float32Array[])
700-
: (layerWeights as Float32Array[])
695+
return (layerWeights instanceof Texture
696+
? (layerWeights.toArray() as Float32Array[])
697+
: (layerWeights as Float32Array[])
701698
).map((layerWeights) => Array.from(layerWeights));
702699
});
703700
const jsonLayerBiases = this.biases.map((layerBiases) =>

src/utilities/to-svg.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { FeedForward, IFeedForwardJSON } from '../feed-forward';
22
import { recurrentZeros } from '../layer/recurrent-zeros';
33
import { Recurrent } from '../recurrent';
44
import { IRNNJSON, RNN } from '../recurrent/rnn';
5-
import { INeuralNetworkData, INeuralNetworkJSON, NeuralNetwork } from '../neural-network'
5+
import {
6+
INeuralNetworkData,
7+
INeuralNetworkJSON,
8+
NeuralNetwork,
9+
} from '../neural-network';
610
import { GRU } from '../recurrent/gru';
711
import { LSTM } from '../recurrent/lstm';
812
import { NeuralNetworkGPU } from '../neural-network-gpu';

0 commit comments

Comments
 (0)