Skip to content

Commit

Permalink
fix: make randomized as an Optional Argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Keshav-writes-code committed Sep 27, 2024
1 parent 9a678cb commit e677536
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/NN_comps/NN_classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class Neuron {
bias: number;
weights: number[];

constructor(prevLayer_neurons: number, randomized: boolean) {
constructor(prevLayer_neurons: number, randomized: boolean = false) {
const randRange = 10;
this.value = 0;
this.bias = 0
Expand All @@ -33,7 +33,7 @@ export class cNeuron {

export class Layer {
neurons: Neuron[];
constructor(size: number, prevLayerSize: number, randomized: boolean) {
constructor(size: number, prevLayerSize: number, randomized: boolean = false) {
this.neurons = new Array(size).fill(0).map(() => new Neuron(prevLayerSize, randomized));
}
}
Expand Down

0 comments on commit e677536

Please sign in to comment.