softopt 0.5.2__tar.gz → 0.5.3__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.
- {softopt-0.5.2/softopt.egg-info → softopt-0.5.3}/PKG-INFO +2 -2
- {softopt-0.5.2 → softopt-0.5.3}/README.md +1 -1
- {softopt-0.5.2 → softopt-0.5.3}/pyproject.toml +1 -1
- {softopt-0.5.2 → softopt-0.5.3}/softopt/__init__.py +1 -1
- {softopt-0.5.2 → softopt-0.5.3}/softopt/numpy_optimizer.py +11 -2
- {softopt-0.5.2 → softopt-0.5.3/softopt.egg-info}/PKG-INFO +2 -2
- {softopt-0.5.2 → softopt-0.5.3}/LICENSE +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/setup.cfg +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/softopt/compile.py +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/softopt/soft_number.py +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/softopt.egg-info/SOURCES.txt +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/softopt.egg-info/dependency_links.txt +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/softopt.egg-info/requires.txt +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/softopt.egg-info/top_level.txt +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/tests/test_basic.py +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/tests/test_causal.py +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/tests/test_compile.py +0 -0
- {softopt-0.5.2 → softopt-0.5.3}/tests/test_soft_number.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: softopt
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: A standalone optimizer for problems with a known computation graph, built on Klein–Maimon soft-number calculus
|
|
5
5
|
Author: Ido Angel
|
|
6
6
|
License: MIT
|
|
@@ -114,7 +114,7 @@ All results below use IBM's `FakeFez` noise model via Qiskit + Aer, or realistic
|
|
|
114
114
|
|
|
115
115
|
| Domain | Improvement | Win rate |
|
|
116
116
|
|---|---|---|
|
|
117
|
-
| Camera calibration (bundle adjustment, realistic pixel + outlier noise) |
|
|
117
|
+
| Camera calibration (bundle adjustment, realistic pixel + outlier noise) | 91.6% | 16/20 |
|
|
118
118
|
|
|
119
119
|
**Finance**
|
|
120
120
|
|
|
@@ -90,7 +90,7 @@ All results below use IBM's `FakeFez` noise model via Qiskit + Aer, or realistic
|
|
|
90
90
|
|
|
91
91
|
| Domain | Improvement | Win rate |
|
|
92
92
|
|---|---|---|
|
|
93
|
-
| Camera calibration (bundle adjustment, realistic pixel + outlier noise) |
|
|
93
|
+
| Camera calibration (bundle adjustment, realistic pixel + outlier noise) | 91.6% | 16/20 |
|
|
94
94
|
|
|
95
95
|
**Finance**
|
|
96
96
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "softopt"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.3"
|
|
8
8
|
description = "A standalone optimizer for problems with a known computation graph, built on Klein–Maimon soft-number calculus"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -29,6 +29,7 @@ class SoftOpt:
|
|
|
29
29
|
self.v = None
|
|
30
30
|
self.t = 0
|
|
31
31
|
self.rng = np.random.default_rng(seed)
|
|
32
|
+
self._ablation_rng = None
|
|
32
33
|
self._test_frozen_constant = _test_frozen_constant
|
|
33
34
|
|
|
34
35
|
def step(self, theta, grad_estimate, _test_magnitude_source=None, _test_foreign_sampler=None, _test_rng=None):
|
|
@@ -69,6 +70,13 @@ class SoftOpt:
|
|
|
69
70
|
n = theta.shape[0]
|
|
70
71
|
gen_rng = _test_rng if _test_rng is not None else self.rng
|
|
71
72
|
delta = gen_rng.choice([-1.0, 1.0], size=n)
|
|
73
|
+
|
|
74
|
+
# The ablation arms must not disturb the probe-direction stream, or
|
|
75
|
+
# a corrupted arm would also change every direction that follows and
|
|
76
|
+
# the comparison would no longer be like-for-like.
|
|
77
|
+
if self._ablation_rng is None:
|
|
78
|
+
self._ablation_rng = np.random.default_rng(
|
|
79
|
+
self.rng.integers(0, 2**63 - 1))
|
|
72
80
|
D1 = self.g_delta(theta_after_adam, delta)
|
|
73
81
|
gp = self.g_delta(theta_after_adam + self.h_fd * delta, delta)
|
|
74
82
|
gm = self.g_delta(theta_after_adam - self.h_fd * delta, delta)
|
|
@@ -79,8 +87,9 @@ class SoftOpt:
|
|
|
79
87
|
elif _test_magnitude_source == 'frozen':
|
|
80
88
|
D2_used = self._test_frozen_constant
|
|
81
89
|
elif _test_magnitude_source in ('foreign_point_and_dir', 'foreign_point_same_dir'):
|
|
82
|
-
theta_f = _test_foreign_sampler(
|
|
83
|
-
delta_f =
|
|
90
|
+
theta_f = _test_foreign_sampler(self._ablation_rng)
|
|
91
|
+
delta_f = (self._ablation_rng.choice([-1.0, 1.0], size=n)
|
|
92
|
+
if _test_magnitude_source == 'foreign_point_and_dir' else delta)
|
|
84
93
|
gp_f = self.g_delta(theta_f + self.h_fd * delta_f, delta_f)
|
|
85
94
|
gm_f = self.g_delta(theta_f - self.h_fd * delta_f, delta_f)
|
|
86
95
|
D2_used = abs((gp_f - gm_f) / (2 * self.h_fd))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: softopt
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: A standalone optimizer for problems with a known computation graph, built on Klein–Maimon soft-number calculus
|
|
5
5
|
Author: Ido Angel
|
|
6
6
|
License: MIT
|
|
@@ -114,7 +114,7 @@ All results below use IBM's `FakeFez` noise model via Qiskit + Aer, or realistic
|
|
|
114
114
|
|
|
115
115
|
| Domain | Improvement | Win rate |
|
|
116
116
|
|---|---|---|
|
|
117
|
-
| Camera calibration (bundle adjustment, realistic pixel + outlier noise) |
|
|
117
|
+
| Camera calibration (bundle adjustment, realistic pixel + outlier noise) | 91.6% | 16/20 |
|
|
118
118
|
|
|
119
119
|
**Finance**
|
|
120
120
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|