Hi, This is regarding the Issue Math-1651. The order of neurons in the neuron is non deterministic as it uses a ConcurrentHashMap which does not store the elements in any specific order.
The junit org.apache.commons.math4.neuralnet.NetworkTest#testIterationOrder in commons-math-neuralnet contradicts this behavior and checks if the neurons in the neuron map are ordered in increasing order. It would be best to remove this flaky test. I have raised a PR for the same : https://github.com/apache/commons-math/pull/213 [https://opengraph.githubassets.com/c766c85f43f29469acf1494ebeb40b6eb190b2bd072e8c61f589758f5be68866/apache/commons-math/pull/213]<https://github.com/apache/commons-math/pull/213> [MATH-1651] fix flaky test in commons-math-neuralnet by anantdahiya8 · Pull Request #213 · apache/commons-math<https://github.com/apache/commons-math/pull/213> ConcurrentHashMap does not guarantee the order of elements. Replacing it with Collections.synchronizedMap which guarantees the order of the elements. Test which were failing : org.apache.commons.ma... github.com Thanks & Regards, Anant Dahiya