Infinity/NaN output
See original GitHub issueAn old Neataptic bug which is still bugging me.
I’m getting Infinity/NaN outputs while training. Using the latest Node.js.
My settings:
Methods.mutation.MOD_ACTIVATION.mutateOutput = false;
Methods.mutation.MOD_ACTIVATION.allowed = [
Methods.activation.LOGISTIC,
Methods.activation.TANH,
Methods.activation.STEP,
Methods.activation.SOFTSIGN,
Methods.activation.SINUSOID,
Methods.activation.GAUSSIAN,
Methods.activation.BIPOLAR,
Methods.activation.BIPOLAR_SIGMOID,
Methods.activation.HARD_TANH,
Methods.activation.INVERSE,
Methods.activation.SELU,
Methods.activation.RELU,
Methods.activation.BENT_IDENTITY,
Methods.activation.IDENTITY,
];
neat = new Neat(4, 1, null,
{
mutation: Methods.mutation.ALL,
popsize: 100,
mutationRate: 0.2,
elitism: 10,
equal: true,
network: new Architect.Random(4, 5, 1),
provenance: 2,
maxNodes: 7,
maxConns: 10,
maxGates: 5,
}
);
Infinity Example:
The normalised data:
[0.9354838709677419, 0.5, 0.5933786078098472, 0.5880669161907702]
The genome:
{"nodes":[{"bias":0,"type":"input","squash":"LOGISTIC","mask":1,"index":0},{"bias":0,"type":"input","squash":"LOGISTIC","mask":1,"index":1},{"bias":0,"type":"input","squash":"LOGISTIC","mask":1,"index":2},{"bias":0,"type":"input","squash":"LOGISTIC","mask":1,"index":3},{"bias":1.1508084667830487,"type":"output","squash":"SELU","mask":1,"index":4}],"connections":[{"weight":1,"from":4,"to":4,"gater":4},{"weight":-0.05001360658035439,"from":3,"to":4,"gater":null},{"weight":0.9984137443904727,"from":2,"to":4,"gater":null},{"weight":-0.7832753538521565,"from":1,"to":4,"gater":null},{"weight":-0.9040067054346645,"from":0,"to":4,"gater":4}],"input":4,"output":1,"dropout":0}
NaN Example:
The normalised data:
[0.3870967741935484, 0.75, 0.5040295048190726, 0.5575469079452833]
The genome:
{"nodes":[{"bias":0,"type":"input","squash":"LOGISTIC","mask":1,"index":0},{"bias":0,"type":"input","squash":"LOGISTIC","mask":1,"index":1},{"bias":0,"type":"input","squash":"LOGISTIC","mask":1,"index":2},{"bias":0,"type":"input","squash":"LOGISTIC","mask":1,"index":3},{"bias":-0.0717463180924848,"type":"hidden","squash":"BENT_IDENTITY","mask":1,"index":4},{"bias":-0.02994106373052867,"type":"output","squash":"LOGISTIC","mask":1,"index":5}],"connections":[{"weight":1,"from":4,"to":4,"gater":null},{"weight":1,"from":5,"to":5,"gater":null},{"weight":-0.048341462482942354,"from":4,"to":5,"gater":null},{"weight":-0.4890970041600281,"from":3,"to":5,"gater":5},{"weight":0.9984137443904727,"from":2,"to":5,"gater":5},{"weight":-0.4890970041600281,"from":3,"to":4,"gater":4},{"weight":0.024574079733371557,"from":1,"to":5,"gater":null},{"weight":0.9984137443904727,"from":2,"to":4,"gater":4},{"weight":-0.9040067054346645,"from":0,"to":5,"gater":5},{"weight":0.049181674792330154,"from":1,"to":4,"gater":null},{"weight":0.04742932010695605,"from":0,"to":4,"gater":null}],"input":4,"output":1,"dropout":0}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Infinity and NaN (The GNU C Library)
In comparison operations, positive infinity is larger than all values except itself and NaN, and negative infinity is smaller than all values except...
Read more >Finite, Infinite and NaN Numbers - R
Inf and -Inf are positive and negative infinity whereas NaN means 'Not a Number'. (These apply to numeric values and real and imaginary...
Read more >Infinity and NaN - MATLAB & Simulink - MathWorks
MATLAB represents infinity by the special value inf, and values that are neither real nor complex by the special value NaN, which stands...
Read more >NaN - Wikipedia
In computing, NaN standing for Not a Number, is a member of a numeric data type that can be interpreted as a value...
Read more >Check if the value is infinity or NaN in Python - GeeksforGeeks
NaN Stands for “Not a Number” and it is a numeric datatype used as a proxy for values that are either mathematically undefined...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@luiscarbonell I’ve sent you an email. A simple enough example to get running and able to get NaNs and Infinities quickly.
There was an attempt in the past to fix NaNs. https://github.com/wagenaartje/neataptic/commit/2fd4dbdeeecc055ab36ee4492264065488fc190e