x-evolution 0.1.14__py3-none-any.whl → 0.1.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- x_evolution/x_evolution.py +17 -2
- {x_evolution-0.1.14.dist-info → x_evolution-0.1.16.dist-info}/METADATA +1 -1
- x_evolution-0.1.16.dist-info/RECORD +6 -0
- x_evolution-0.1.14.dist-info/RECORD +0 -6
- {x_evolution-0.1.14.dist-info → x_evolution-0.1.16.dist-info}/WHEEL +0 -0
- {x_evolution-0.1.14.dist-info → x_evolution-0.1.16.dist-info}/licenses/LICENSE +0 -0
x_evolution/x_evolution.py
CHANGED
|
@@ -366,11 +366,17 @@ class EvoStrategy(Module):
|
|
|
366
366
|
self,
|
|
367
367
|
filename = 'evolved.model',
|
|
368
368
|
num_generations = None,
|
|
369
|
-
disable_distributed = False
|
|
369
|
+
disable_distributed = False,
|
|
370
|
+
rollback_model_at_end = False
|
|
370
371
|
):
|
|
371
372
|
|
|
372
373
|
model = self.noisable_model.to(self.device)
|
|
373
374
|
|
|
375
|
+
# maybe save model for rolling back (for meta-evo)
|
|
376
|
+
|
|
377
|
+
if rollback_model_at_end:
|
|
378
|
+
self.checkpoint('initial.model')
|
|
379
|
+
|
|
374
380
|
# maybe sigmas
|
|
375
381
|
|
|
376
382
|
if self.learned_noise_scale:
|
|
@@ -515,7 +521,7 @@ class EvoStrategy(Module):
|
|
|
515
521
|
if self.learned_noise_scale:
|
|
516
522
|
packed_sigma, _ = pack(list(self.sigmas), '*')
|
|
517
523
|
avg_sigma = packed_sigma.mean().item()
|
|
518
|
-
msg += f' |
|
|
524
|
+
msg += f' | average sigma: {avg_sigma:.3f}'
|
|
519
525
|
|
|
520
526
|
self.print(msg)
|
|
521
527
|
|
|
@@ -533,8 +539,17 @@ class EvoStrategy(Module):
|
|
|
533
539
|
|
|
534
540
|
self.print('evolution complete')
|
|
535
541
|
|
|
542
|
+
# final checkpoint
|
|
543
|
+
|
|
536
544
|
self.checkpoint(f'{filename}.final.{generation}')
|
|
537
545
|
|
|
546
|
+
# maybe rollback
|
|
547
|
+
|
|
548
|
+
if rollback_model_at_end:
|
|
549
|
+
orig_state_dict = torch.load(str(self.checkpoint_folder / 'initial.model.pt'), weights_only = True)
|
|
550
|
+
|
|
551
|
+
self.model.load_state_dict(orig_state_dict)
|
|
552
|
+
|
|
538
553
|
# return fitnesses across generations
|
|
539
554
|
# for meta-evolutionary (nesting EvoStrategy within the environment of another and optimizing some meta-network)
|
|
540
555
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
x_evolution/__init__.py,sha256=XcwXJgIMPnCWGfGws3-vKgoR_7IfVslJBtiMvmEeSg0,57
|
|
2
|
+
x_evolution/x_evolution.py,sha256=2zK32idsczSaGlLZDg0IzQmptZiVkE049inbafy2Hh8,18416
|
|
3
|
+
x_evolution-0.1.16.dist-info/METADATA,sha256=XtCSXqLRM3BYXu5UwrwCq4RiQIKLCPEN8KxYstyTwPM,5649
|
|
4
|
+
x_evolution-0.1.16.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
5
|
+
x_evolution-0.1.16.dist-info/licenses/LICENSE,sha256=1yCiA9b5nhslTavxPjsQAO-wpOnwJR9-l8LTVi7GJuk,1066
|
|
6
|
+
x_evolution-0.1.16.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
x_evolution/__init__.py,sha256=XcwXJgIMPnCWGfGws3-vKgoR_7IfVslJBtiMvmEeSg0,57
|
|
2
|
-
x_evolution/x_evolution.py,sha256=VuLTFYERMjXS4KqUozzHJ2fdlPuuNN3Q4b1_gLT3vvM,17975
|
|
3
|
-
x_evolution-0.1.14.dist-info/METADATA,sha256=sYEaF1TMe6USTepyoNQFgnFgA-waguqEQpdz-o8zD8o,5649
|
|
4
|
-
x_evolution-0.1.14.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
5
|
-
x_evolution-0.1.14.dist-info/licenses/LICENSE,sha256=1yCiA9b5nhslTavxPjsQAO-wpOnwJR9-l8LTVi7GJuk,1066
|
|
6
|
-
x_evolution-0.1.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|