neat-python icon indicating copy to clipboard operation
neat-python copied to clipboard

Ability to load checkpoint with new configuration settings.

Open matthew-hre opened this issue 2 years ago • 2 comments

Currently, neat.Checkpointer.restore_checkpoint loads the checkpoint, along with the configuration used at the time. Would love to be able to load a checkpoint using an updated configuration file, to allow tweaking of factors such as fitness_threshold.

matthew-hre avatar Feb 04 '23 00:02 matthew-hre

I support this. I dont know how that would work or if its possible as I am a new user, but I think it could see some cool benefits.

MikeUchmanowicz avatar Apr 15 '23 04:04 MikeUchmanowicz

I'd looked into this last year. The following allows a new config to be defined when restoring a checkpoint. I've only briefly tested the change. It did appear to 'work', however, I'm unsure which new values take effect or if there are any adverse effects. I'd be keen to know how you go with it. https://github.com/luke-saunders/neat-python/tree/CheckpointNewConfig

neat/checkpoint.py def restore_checkpoint(filename, update_config=None): """Resumes the simulation from a previous saved point""" with gzip.open(filename) as f: generation, config, population, species_set, rndstate = pickle.load(f) random.setstate(rndstate) if update_config==None: return Population(config, (population, species_set, generation)) else: return Population(update_config, (population, species_set, generation))

On Sat, 15 Apr 2023 at 14:05, Michal A Uchmanowicz @.***> wrote:

I support this. I dont know how that would work or if its possible as I am a new user, but I think it could see some cool benefits.

— Reply to this email directly, view it on GitHub https://github.com/CodeReclaimers/neat-python/issues/259#issuecomment-1509492554, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLTFOJFFIWKJDEHB2AXG3DXBINAPANCNFSM6AAAAAAUQ26EHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

luke-saunders avatar May 08 '23 12:05 luke-saunders