CUQIpy 1.2.0.post0.dev8__tar.gz → 1.2.0.post0.dev15__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.

Potentially problematic release.


This version of CUQIpy might be problematic. Click here for more details.

Files changed (118) hide show
  1. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/CUQIpy.egg-info/PKG-INFO +1 -1
  2. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/PKG-INFO +1 -1
  3. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/_version.py +3 -3
  4. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_hmc.py +19 -23
  5. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/CUQIpy.egg-info/SOURCES.txt +0 -0
  6. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/CUQIpy.egg-info/dependency_links.txt +0 -0
  7. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/CUQIpy.egg-info/requires.txt +0 -0
  8. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/CUQIpy.egg-info/top_level.txt +0 -0
  9. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/LICENSE +0 -0
  10. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/README.md +0 -0
  11. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/__init__.py +0 -0
  12. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/_messages.py +0 -0
  13. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/array/__init__.py +0 -0
  14. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/array/_array.py +0 -0
  15. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/config.py +0 -0
  16. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/data/__init__.py +0 -0
  17. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/data/_data.py +0 -0
  18. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/data/astronaut.npz +0 -0
  19. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/data/camera.npz +0 -0
  20. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/data/cat.npz +0 -0
  21. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/data/cookie.png +0 -0
  22. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/data/satellite.mat +0 -0
  23. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/density/__init__.py +0 -0
  24. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/density/_density.py +0 -0
  25. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/diagnostics.py +0 -0
  26. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/__init__.py +0 -0
  27. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_beta.py +0 -0
  28. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_cauchy.py +0 -0
  29. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_cmrf.py +0 -0
  30. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_custom.py +0 -0
  31. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_distribution.py +0 -0
  32. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_gamma.py +0 -0
  33. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_gaussian.py +0 -0
  34. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_gmrf.py +0 -0
  35. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_inverse_gamma.py +0 -0
  36. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_joint_distribution.py +0 -0
  37. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_laplace.py +0 -0
  38. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_lmrf.py +0 -0
  39. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_lognormal.py +0 -0
  40. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_modifiedhalfnormal.py +0 -0
  41. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_normal.py +0 -0
  42. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_posterior.py +0 -0
  43. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_smoothed_laplace.py +0 -0
  44. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/distribution/_uniform.py +0 -0
  45. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/__init__.py +0 -0
  46. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/__init__.py +0 -0
  47. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_conjugate.py +0 -0
  48. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_conjugate_approx.py +0 -0
  49. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_cwmh.py +0 -0
  50. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_direct.py +0 -0
  51. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_gibbs.py +0 -0
  52. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_langevin_algorithm.py +0 -0
  53. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_laplace_approximation.py +0 -0
  54. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_mh.py +0 -0
  55. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_pcn.py +0 -0
  56. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_rto.py +0 -0
  57. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_sampler.py +0 -0
  58. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/experimental/mcmc/_utilities.py +0 -0
  59. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/geometry/__init__.py +0 -0
  60. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/geometry/_geometry.py +0 -0
  61. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/implicitprior/__init__.py +0 -0
  62. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/implicitprior/_regularizedGMRF.py +0 -0
  63. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/implicitprior/_regularizedGaussian.py +0 -0
  64. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/implicitprior/_regularizedUnboundedUniform.py +0 -0
  65. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/likelihood/__init__.py +0 -0
  66. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/likelihood/_likelihood.py +0 -0
  67. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/model/__init__.py +0 -0
  68. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/model/_model.py +0 -0
  69. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/operator/__init__.py +0 -0
  70. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/operator/_operator.py +0 -0
  71. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/pde/__init__.py +0 -0
  72. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/pde/_pde.py +0 -0
  73. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/problem/__init__.py +0 -0
  74. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/problem/_problem.py +0 -0
  75. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/__init__.py +0 -0
  76. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_conjugate.py +0 -0
  77. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_conjugate_approx.py +0 -0
  78. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_cwmh.py +0 -0
  79. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_gibbs.py +0 -0
  80. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_hmc.py +0 -0
  81. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_langevin_algorithm.py +0 -0
  82. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_laplace_approximation.py +0 -0
  83. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_mh.py +0 -0
  84. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_pcn.py +0 -0
  85. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_rto.py +0 -0
  86. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/sampler/_sampler.py +0 -0
  87. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/samples/__init__.py +0 -0
  88. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/samples/_samples.py +0 -0
  89. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/solver/__init__.py +0 -0
  90. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/solver/_solver.py +0 -0
  91. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/testproblem/__init__.py +0 -0
  92. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/testproblem/_testproblem.py +0 -0
  93. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/utilities/__init__.py +0 -0
  94. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/utilities/_get_python_variable_name.py +0 -0
  95. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/cuqi/utilities/_utilities.py +0 -0
  96. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/pyproject.toml +0 -0
  97. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/requirements.txt +0 -0
  98. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/setup.cfg +0 -0
  99. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/setup.py +0 -0
  100. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_MRFs.py +0 -0
  101. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_abstract_distribution_density.py +0 -0
  102. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_bayesian_inversion.py +0 -0
  103. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_density.py +0 -0
  104. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_distribution.py +0 -0
  105. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_distributions_shape.py +0 -0
  106. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_geometry.py +0 -0
  107. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_implicit_priors.py +0 -0
  108. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_joint_distribution.py +0 -0
  109. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_likelihood.py +0 -0
  110. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_model.py +0 -0
  111. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_pde.py +0 -0
  112. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_posterior.py +0 -0
  113. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_problem.py +0 -0
  114. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_sampler.py +0 -0
  115. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_samples.py +0 -0
  116. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_solver.py +0 -0
  117. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_testproblem.py +0 -0
  118. {cuqipy-1.2.0.post0.dev8 → cuqipy-1.2.0.post0.dev15}/tests/test_utilities.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CUQIpy
3
- Version: 1.2.0.post0.dev8
3
+ Version: 1.2.0.post0.dev15
4
4
  Summary: Computational Uncertainty Quantification for Inverse problems in Python
5
5
  Maintainer-email: "Nicolai A. B. Riis" <nabr@dtu.dk>, "Jakob S. Jørgensen" <jakj@dtu.dk>, "Amal M. Alghamdi" <amaal@dtu.dk>, Chao Zhang <chaz@dtu.dk>
6
6
  License: Apache License
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CUQIpy
3
- Version: 1.2.0.post0.dev8
3
+ Version: 1.2.0.post0.dev15
4
4
  Summary: Computational Uncertainty Quantification for Inverse problems in Python
5
5
  Maintainer-email: "Nicolai A. B. Riis" <nabr@dtu.dk>, "Jakob S. Jørgensen" <jakj@dtu.dk>, "Amal M. Alghamdi" <amaal@dtu.dk>, Chao Zhang <chaz@dtu.dk>
6
6
  License: Apache License
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-09-30T09:16:05+0200",
11
+ "date": "2024-09-30T18:06:47+0200",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "915f2f14ca7a4f588b561d25a1c4a47b8e295835",
15
- "version": "1.2.0.post0.dev8"
14
+ "full-revisionid": "59a6730dfe1227a35a2def467daf63265bdba87f",
15
+ "version": "1.2.0.post0.dev15"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -88,14 +88,16 @@ class NUTS(Sampler):
88
88
  """
89
89
 
90
90
  _STATE_KEYS = Sampler._STATE_KEYS.union({'_epsilon', '_epsilon_bar',
91
- '_H_bar', '_mu',
92
- '_alpha', '_n_alpha'})
91
+ '_H_bar',
92
+ 'current_target_logd',
93
+ 'current_target_grad',
94
+ 'max_depth'})
93
95
 
94
96
  _HISTORY_KEYS = Sampler._HISTORY_KEYS.union({'num_tree_node_list',
95
97
  'epsilon_list',
96
98
  'epsilon_bar_list'})
97
99
 
98
- def __init__(self, target=None, initial_point=None, max_depth=15,
100
+ def __init__(self, target=None, initial_point=None, max_depth=None,
99
101
  step_size=None, opt_acc_rate=0.6, **kwargs):
100
102
  super().__init__(target, initial_point=initial_point, **kwargs)
101
103
 
@@ -104,30 +106,23 @@ class NUTS(Sampler):
104
106
  self.step_size = step_size
105
107
  self.opt_acc_rate = opt_acc_rate
106
108
 
107
- # Initialize epsilon and epsilon_bar
108
- # epsilon is the step size used in the current iteration
109
- # after warm up and one sampling step, epsilon is updated
110
- # to epsilon_bar for the remaining sampling steps.
111
- self._epsilon = None
112
- self._epsilon_bar = None
113
- self._H_bar = None
114
-
115
- # Extra parameters for tuning
116
- self._n_alpha = None
117
- self._alpha = None
118
-
119
109
 
120
110
  def _initialize(self):
121
111
 
122
112
  # Arrays to store acceptance rate
123
113
  self._acc = [None] # Overwrites acc from Sampler. TODO. Check if this is necessary
124
114
 
125
- self._alpha = 0 # check if meaningful value
126
- self._n_alpha = 0 # check if meaningful value
115
+ self._current_alpha_ratio = np.nan # Current alpha ratio is set to some
116
+ # value (other than np.nan) before
117
+ # being used
127
118
 
128
119
  self.current_target_logd, self.current_target_grad = self._nuts_target(self.current_point)
129
120
 
130
- # parameters dual averaging
121
+ # Parameters dual averaging
122
+ # Initialize epsilon and epsilon_bar
123
+ # epsilon is the step size used in the current iteration
124
+ # after warm up and one sampling step, epsilon is updated
125
+ # to epsilon_bar for the remaining sampling steps.
131
126
  if self.step_size is None:
132
127
  self._epsilon = self._FindGoodEpsilon()
133
128
  else:
@@ -155,6 +150,8 @@ class NUTS(Sampler):
155
150
 
156
151
  @max_depth.setter
157
152
  def max_depth(self, value):
153
+ if value is None:
154
+ value = 15 # default value
158
155
  if not isinstance(value, int):
159
156
  raise TypeError('max_depth must be an integer.')
160
157
  if value < 0:
@@ -273,8 +270,7 @@ class NUTS(Sampler):
273
270
  s = s_prime *\
274
271
  int((dpoints @ r_minus.T) >= 0) * int((dpoints @ r_plus.T) >= 0)
275
272
  j += 1
276
- self._alpha = alpha
277
- self._n_alpha = n_alpha
273
+ self._current_alpha_ratio = alpha/n_alpha
278
274
 
279
275
  # update run diagnostic attributes
280
276
  self._update_run_diagnostic_attributes(
@@ -293,7 +289,7 @@ class NUTS(Sampler):
293
289
 
294
290
  eta1 = 1/(k + t_0)
295
291
  self._H_bar = (1-eta1)*self._H_bar +\
296
- eta1*(self.opt_acc_rate - (self._alpha/self._n_alpha))
292
+ eta1*(self.opt_acc_rate - (self._current_alpha_ratio))
297
293
  self._epsilon = np.exp(self._mu - (np.sqrt(k)/gamma)*self._H_bar)
298
294
  eta = k**(-kappa)
299
295
  self._epsilon_bar =\
@@ -309,12 +305,12 @@ class NUTS(Sampler):
309
305
  # self._epsilon
310
306
  # Parameters that does not change during the run
311
307
  # self._mu
312
-
308
+ self._ensure_initialized()
313
309
  if self._epsilon_bar == "unset": # Initial value of epsilon_bar for tuning
314
310
  self._epsilon_bar = 1
315
311
 
316
312
  def _pre_sample(self):
317
-
313
+ self._ensure_initialized()
318
314
  if self._epsilon_bar == "unset": # Initial value of epsilon_bar for sampling
319
315
  self._epsilon_bar = self._epsilon
320
316