File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -323,7 +323,12 @@ export class NeuralNetwork<
323
323
constructor (
324
324
options : Partial < INeuralNetworkOptions & INeuralNetworkTrainOptions > = { }
325
325
) {
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 ;
327
332
this . updateTrainingOptions ( options ) ;
328
333
329
334
const { inputSize, hiddenLayers, outputSize } = this . options ;
Original file line number Diff line number Diff line change @@ -467,7 +467,9 @@ export function toSVG<
467
467
// Get network size array for NeuralNetwork or NeuralNetworkGPU
468
468
let sizes : number [ ] = [ ] ;
469
469
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 ) ;
471
473
}
472
474
// get network size for Recurrent
473
475
else if ( net instanceof Recurrent ) {
You can’t perform that action at this time.
0 commit comments