There seems to be a type coercion bug somewhere in the code that produces the activation values as they are consistently of string type, which could be because some initial construction value is technically a string which coerces all operations. The networks seem to be producing the right values, but this is potentially problematic due to the ambiguity of the "plus" sign in string operations which can produce numbers that seem correct and then are used unassumingly.
To Reproduce
Create a fresh network using the standard constructor, call .activate immediately after, then pass it an array of numbers of equal length to the inputs, when you test the returned array contents individually using typeof you will get string
Description
There seems to be a type coercion bug somewhere in the code that produces the activation values as they are consistently of string type, which could be because some initial construction value is technically a string which coerces all operations. The networks seem to be producing the right values, but this is potentially problematic due to the ambiguity of the "plus" sign in string operations which can produce numbers that seem correct and then are used unassumingly.
To Reproduce
Create a fresh network using the standard constructor, call
.activate
immediately after, then pass it an array of numbers of equal length to the inputs, when you test the returned array contents individually usingtypeof
you will getstring
Tasks