This PR proposes storing the index (i.e. the number of the agent) that achieved the best fitness value during each iteration. This allows the user to recover information stored by the agents in the disk after the optimization procedure, for instance, to reload the top kbest neural networks.
Previously history.best returned a list of tuples in the format [(agent-finess_0, agent-position_0), ... (agent-fitness_n, agent-position_n)]. This PR replaces this format by [(agent-finess_0, agent-position_0, agent-index_n), ... (agent-fitness_n, agent-position_n, agent-index_n)], thus mantaining backward compatibility.
This PR proposes storing the index (i.e. the number of the agent) that achieved the best fitness value during each iteration. This allows the user to recover information stored by the agents in the disk after the optimization procedure, for instance, to reload the top
k
best neural networks.Previously
history.best
returned a list of tuples in the format[(agent-finess_0, agent-position_0), ... (agent-fitness_n, agent-position_n)]
. This PR replaces this format by[(agent-finess_0, agent-position_0, agent-index_n), ... (agent-fitness_n, agent-position_n, agent-index_n)]
, thus mantaining backward compatibility.Further, some unused imports were also removed.