evolutionary-policy-optimization 0.2.9__tar.gz → 0.2.10__tar.gz
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.
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/PKG-INFO +12 -1
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/README.md +11 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/evolutionary_policy_optimization/experimental.py +24 -1
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/pyproject.toml +1 -1
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/.github/workflows/lint.yml +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/.github/workflows/python-publish.yml +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/.github/workflows/test.yml +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/.gitignore +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/LICENSE +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/evolutionary_policy_optimization/__init__.py +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/evolutionary_policy_optimization/distributed.py +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/evolutionary_policy_optimization/env_wrappers.py +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/evolutionary_policy_optimization/epo.py +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/evolutionary_policy_optimization/mock_env.py +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/requirements.txt +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/tests/test_epo.py +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/train_crossover_weight_space.py +0 -0
- {evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/train_gym.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: evolutionary-policy-optimization
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.10
|
4
4
|
Summary: EPO - Pytorch
|
5
5
|
Project-URL: Homepage, https://pypi.org/project/evolutionary-policy-optimization/
|
6
6
|
Project-URL: Repository, https://github.com/lucidrains/evolutionary-policy-optimization
|
@@ -278,4 +278,15 @@ That's it
|
|
278
278
|
}
|
279
279
|
```
|
280
280
|
|
281
|
+
```bibtex
|
282
|
+
@article{Chebykin2023ShrinkPerturbIA,
|
283
|
+
title = {Shrink-Perturb Improves Architecture Mixing during Population Based Training for Neural Architecture Search},
|
284
|
+
author = {Alexander Chebykin and Arkadiy Dushatskiy and Tanja Alderliesten and Peter A. N. Bosman},
|
285
|
+
journal = {ArXiv},
|
286
|
+
year = {2023},
|
287
|
+
volume = {abs/2307.15621},
|
288
|
+
url = {https://api.semanticscholar.org/CorpusID:260316291}
|
289
|
+
}
|
290
|
+
```
|
291
|
+
|
281
292
|
*Evolution is cleverer than you are.* - Leslie Orgel
|
{evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/README.md
RENAMED
@@ -221,4 +221,15 @@ That's it
|
|
221
221
|
}
|
222
222
|
```
|
223
223
|
|
224
|
+
```bibtex
|
225
|
+
@article{Chebykin2023ShrinkPerturbIA,
|
226
|
+
title = {Shrink-Perturb Improves Architecture Mixing during Population Based Training for Neural Architecture Search},
|
227
|
+
author = {Alexander Chebykin and Arkadiy Dushatskiy and Tanja Alderliesten and Peter A. N. Bosman},
|
228
|
+
journal = {ArXiv},
|
229
|
+
year = {2023},
|
230
|
+
volume = {abs/2307.15621},
|
231
|
+
url = {https://api.semanticscholar.org/CorpusID:260316291}
|
232
|
+
}
|
233
|
+
```
|
234
|
+
|
224
235
|
*Evolution is cleverer than you are.* - Leslie Orgel
|
@@ -2,6 +2,7 @@ from random import uniform
|
|
2
2
|
from copy import deepcopy
|
3
3
|
|
4
4
|
import torch
|
5
|
+
from torch import Tensor
|
5
6
|
import torch.nn.functional as F
|
6
7
|
from torch.func import vmap, functional_call
|
7
8
|
from torch.nn import Module, ParameterList
|
@@ -14,7 +15,26 @@ def exists(v):
|
|
14
15
|
def l2norm(t, dim = -1):
|
15
16
|
return F.normalize(t, dim = dim)
|
16
17
|
|
17
|
-
def
|
18
|
+
def shrink_and_perturb_(
|
19
|
+
t: Tensor,
|
20
|
+
shrink_factor = 0.4,
|
21
|
+
perturb_factor = 0.1
|
22
|
+
):
|
23
|
+
# Shrink & Perturb
|
24
|
+
# Ash et al. https://arxiv.org/abs/1910.08475
|
25
|
+
# Applied to PBT NAS here https://arxiv.org/abs/2307.15621 - (0.4, 0.1)
|
26
|
+
|
27
|
+
assert 0. <= shrink_factor <= 1.
|
28
|
+
noise = torch.randn_like(t)
|
29
|
+
t.mul_(1. - shrink_factor).add_(noise * perturb_factor)
|
30
|
+
return t
|
31
|
+
|
32
|
+
def crossover_weights(
|
33
|
+
w1, w2,
|
34
|
+
shrink_perturb = False,
|
35
|
+
shrink_factor = 0.4,
|
36
|
+
perturb_factor = 0.1
|
37
|
+
):
|
18
38
|
assert w2.shape == w2.shape
|
19
39
|
|
20
40
|
no_batch = w1.ndim == 2
|
@@ -53,6 +73,9 @@ def crossover_weights(w1, w2):
|
|
53
73
|
if no_batch:
|
54
74
|
out = rearrange(out, '1 ... -> ...')
|
55
75
|
|
76
|
+
if shrink_perturb:
|
77
|
+
shrink_and_perturb_(out, shrink_factor = shrink_factor, perturb_factor = perturb_factor)
|
78
|
+
|
56
79
|
return out
|
57
80
|
|
58
81
|
def mutate_weight(
|
File without changes
|
File without changes
|
File without changes
|
{evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/.gitignore
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/requirements.txt
RENAMED
File without changes
|
{evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/tests/test_epo.py
RENAMED
File without changes
|
File without changes
|
{evolutionary_policy_optimization-0.2.9 → evolutionary_policy_optimization-0.2.10}/train_gym.py
RENAMED
File without changes
|