invrs-opt 0.5.2__tar.gz → 0.7.0__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.
Files changed (28) hide show
  1. {invrs_opt-0.5.2/src/invrs_opt.egg-info → invrs_opt-0.7.0}/PKG-INFO +3 -2
  2. {invrs_opt-0.5.2 → invrs_opt-0.7.0}/README.md +1 -1
  3. {invrs_opt-0.5.2 → invrs_opt-0.7.0}/pyproject.toml +2 -1
  4. invrs_opt-0.7.0/src/invrs_opt/__init__.py +21 -0
  5. {invrs_opt-0.5.2 → invrs_opt-0.7.0}/src/invrs_opt/experimental/client.py +2 -3
  6. {invrs_opt-0.5.2/src/invrs_opt → invrs_opt-0.7.0/src/invrs_opt/optimizers}/base.py +10 -0
  7. {invrs_opt-0.5.2/src/invrs_opt/lbfgsb → invrs_opt-0.7.0/src/invrs_opt/optimizers}/lbfgsb.py +293 -153
  8. invrs_opt-0.7.0/src/invrs_opt/optimizers/wrapped_optax.py +300 -0
  9. invrs_opt-0.7.0/src/invrs_opt/parameterization/base.py +148 -0
  10. invrs_opt-0.7.0/src/invrs_opt/parameterization/filter_project.py +92 -0
  11. invrs_opt-0.7.0/src/invrs_opt/parameterization/gaussian_levelset.py +643 -0
  12. invrs_opt-0.7.0/src/invrs_opt/parameterization/pixel.py +45 -0
  13. invrs_opt-0.5.2/src/invrs_opt/lbfgsb/transform.py → invrs_opt-0.7.0/src/invrs_opt/parameterization/transforms.py +76 -11
  14. invrs_opt-0.7.0/src/invrs_opt/py.typed +0 -0
  15. {invrs_opt-0.5.2 → invrs_opt-0.7.0/src/invrs_opt.egg-info}/PKG-INFO +3 -2
  16. invrs_opt-0.7.0/src/invrs_opt.egg-info/SOURCES.txt +23 -0
  17. {invrs_opt-0.5.2 → invrs_opt-0.7.0}/src/invrs_opt.egg-info/requires.txt +1 -0
  18. invrs_opt-0.5.2/src/invrs_opt/__init__.py +0 -10
  19. invrs_opt-0.5.2/src/invrs_opt.egg-info/SOURCES.txt +0 -18
  20. invrs_opt-0.5.2/tests/test_algos.py +0 -258
  21. {invrs_opt-0.5.2 → invrs_opt-0.7.0}/LICENSE +0 -0
  22. {invrs_opt-0.5.2 → invrs_opt-0.7.0}/setup.cfg +0 -0
  23. {invrs_opt-0.5.2 → invrs_opt-0.7.0}/src/invrs_opt/experimental/__init__.py +0 -0
  24. {invrs_opt-0.5.2 → invrs_opt-0.7.0}/src/invrs_opt/experimental/labels.py +0 -0
  25. {invrs_opt-0.5.2/src/invrs_opt/lbfgsb → invrs_opt-0.7.0/src/invrs_opt/optimizers}/__init__.py +0 -0
  26. /invrs_opt-0.5.2/src/invrs_opt/py.typed → /invrs_opt-0.7.0/src/invrs_opt/parameterization/__init__.py +0 -0
  27. {invrs_opt-0.5.2 → invrs_opt-0.7.0}/src/invrs_opt.egg-info/dependency_links.txt +0 -0
  28. {invrs_opt-0.5.2 → invrs_opt-0.7.0}/src/invrs_opt.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: invrs_opt
3
- Version: 0.5.2
3
+ Version: 0.7.0
4
4
  Summary: Algorithms for inverse design
5
5
  Author-email: "Martin F. Schubert" <mfschubert@gmail.com>
6
6
  Maintainer-email: "Martin F. Schubert" <mfschubert@gmail.com>
@@ -34,6 +34,7 @@ Requires-Dist: jax
34
34
  Requires-Dist: jaxlib
35
35
  Requires-Dist: numpy
36
36
  Requires-Dist: requests
37
+ Requires-Dist: optax
37
38
  Requires-Dist: scipy
38
39
  Requires-Dist: totypes
39
40
  Requires-Dist: types-requests
@@ -49,7 +50,7 @@ Requires-Dist: mypy; extra == "dev"
49
50
  Requires-Dist: pre-commit; extra == "dev"
50
51
 
51
52
  # invrs-opt - Optimization algorithms for inverse design
52
- `v0.5.2`
53
+ `v0.7.0`
53
54
 
54
55
  ## Overview
55
56
 
@@ -1,5 +1,5 @@
1
1
  # invrs-opt - Optimization algorithms for inverse design
2
- `v0.5.2`
2
+ `v0.7.0`
3
3
 
4
4
  ## Overview
5
5
 
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
 
3
3
  name = "invrs_opt"
4
- version = "v0.5.2"
4
+ version = "v0.7.0"
5
5
  description = "Algorithms for inverse design"
6
6
  keywords = ["topology", "optimization", "jax", "inverse design"]
7
7
  readme = "README.md"
@@ -20,6 +20,7 @@ dependencies = [
20
20
  "jaxlib",
21
21
  "numpy",
22
22
  "requests",
23
+ "optax",
23
24
  "scipy",
24
25
  "totypes",
25
26
  "types-requests",
@@ -0,0 +1,21 @@
1
+ """invrs_opt - Optimization algorithms for inverse design.
2
+
3
+ Copyright (c) 2023 The INVRS-IO authors.
4
+ """
5
+
6
+ __version__ = "v0.7.0"
7
+ __author__ = "Martin F. Schubert <mfschubert@gmail.com>"
8
+
9
+ from invrs_opt import parameterization as parameterization
10
+
11
+ from invrs_opt.optimizers.lbfgsb import (
12
+ density_lbfgsb as density_lbfgsb,
13
+ lbfgsb as lbfgsb,
14
+ levelset_lbfgsb as levelset_lbfgsb,
15
+ )
16
+
17
+ from invrs_opt.optimizers.wrapped_optax import (
18
+ density_wrapped_optax as density_wrapped_optax,
19
+ levelset_wrapped_optax as levelset_wrapped_optax,
20
+ wrapped_optax as wrapped_optax,
21
+ )
@@ -4,15 +4,14 @@ Copyright (c) 2023 The INVRS-IO authors.
4
4
  """
5
5
 
6
6
  import json
7
- import requests
8
7
  import time
9
8
  from typing import Any, Dict, Optional
10
9
 
10
+ import requests
11
11
  from totypes import json_utils
12
12
 
13
- from invrs_opt import base
14
13
  from invrs_opt.experimental import labels
15
-
14
+ from invrs_opt.optimizers import base
16
15
 
17
16
  PyTree = Any
18
17
  StateToken = str
@@ -4,8 +4,12 @@ Copyright (c) 2023 The INVRS-IO authors.
4
4
  """
5
5
 
6
6
  import dataclasses
7
+ import inspect
7
8
  from typing import Any, Protocol
8
9
 
10
+ import optax # type: ignore[import-untyped]
11
+ from totypes import json_utils
12
+
9
13
  PyTree = Any
10
14
 
11
15
 
@@ -44,3 +48,9 @@ class Optimizer:
44
48
  init: InitFn
45
49
  params: ParamsFn
46
50
  update: UpdateFn
51
+
52
+
53
+ # Register all optax state types for serialization.
54
+ for name, obj in inspect.getmembers(optax):
55
+ if name.endswith("State") and isinstance(obj, type):
56
+ json_utils.register_custom_type(obj)