Unevaluated population in callback
rogiervandergeer opened this issue · 0 comments
rogiervandergeer commented
The callback function in the callback step gets a copy of the population -- which is not evaluated.
Even though we evaluate beforehand:
def callback(self, callback_function: Callable[['BasePopulation'], None],
**kwargs) -> 'BasePopulation':
"""
Performs a callback function on the population. Can be used for
custom logging/checkpointing.
:param callback_function: Function that accepts the population
as a first argument.
:return:
"""
self.evaluate(lazy=True)
callback_function(copy(self), **kwargs)
return self
the copy creates a new population with new individuals, who aren't evaluated.