-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
File: FeedForwardNeuralNetwork.js
Location: Inside the default constructor branch, around line 30.
When you instantiate the network with a supported activation (e.g. "relu", "logistic", "identity"), the constructor still resets this.activation to "tanh".
That happens because the code is using "in" operator together with "Object.keys". The "in" operator must be used with objects only, but you are converting ACTIVATION_FUNCTIONS with the use of "Object.keys
❌ error:
if (!(this.activation in Object.keys(ACTIVATION_FUNCTIONS))) { this.activation = 'tanh'; }
✅ solution:
if (!ACTIVATION_FUNCTIONS.hasOwnProperty(this.activation)) { this.activation = 'tanh'; }
Metadata
Metadata
Assignees
Labels
No labels