MultiLayerNetwork clone() method does not copy score to new object

Author: sdyuraCreated Feb 20, 2025Updated Mar 18, 2025

MultiLayerNetwork has a clone() method

but this method always returns an object with a score of 0.0, not the score of the object the method was called on

this means that if EarlyStoppingTrainer is used with the default InMemoryModelSaver

InMemoryModelSaver.saveBestModel uses clone(), and then when EarlyStoppingTrainer is finished it gets the model with getBestModel()

this means that EarlyStoppingResult.getBestModelScore() always return 0.0

Source: deeplearning4j/deeplearning4j