aspire-inference 0.1.0a11__py3-none-any.whl → 0.1.0a12__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.
- aspire/aspire.py +3 -2
- aspire/utils.py +21 -0
- {aspire_inference-0.1.0a11.dist-info → aspire_inference-0.1.0a12.dist-info}/METADATA +1 -1
- {aspire_inference-0.1.0a11.dist-info → aspire_inference-0.1.0a12.dist-info}/RECORD +7 -7
- {aspire_inference-0.1.0a11.dist-info → aspire_inference-0.1.0a12.dist-info}/WHEEL +0 -0
- {aspire_inference-0.1.0a11.dist-info → aspire_inference-0.1.0a12.dist-info}/licenses/LICENSE +0 -0
- {aspire_inference-0.1.0a11.dist-info → aspire_inference-0.1.0a12.dist-info}/top_level.txt +0 -0
aspire/aspire.py
CHANGED
|
@@ -20,6 +20,7 @@ from .transforms import (
|
|
|
20
20
|
)
|
|
21
21
|
from .utils import (
|
|
22
22
|
AspireFile,
|
|
23
|
+
function_id,
|
|
23
24
|
load_from_h5_file,
|
|
24
25
|
recursively_save_to_h5_file,
|
|
25
26
|
resolve_xp,
|
|
@@ -687,8 +688,8 @@ class Aspire:
|
|
|
687
688
|
method of the sampler.
|
|
688
689
|
"""
|
|
689
690
|
config = {
|
|
690
|
-
"log_likelihood": self.log_likelihood
|
|
691
|
-
"log_prior": self.log_prior
|
|
691
|
+
"log_likelihood": function_id(self.log_likelihood),
|
|
692
|
+
"log_prior": function_id(self.log_prior),
|
|
692
693
|
"dims": self.dims,
|
|
693
694
|
"parameters": self.parameters,
|
|
694
695
|
"periodic_parameters": self.periodic_parameters,
|
aspire/utils.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import functools
|
|
3
4
|
import inspect
|
|
4
5
|
import logging
|
|
5
6
|
import pickle
|
|
@@ -911,3 +912,23 @@ def track_calls(wrapped=None):
|
|
|
911
912
|
return wrapped_func(*args, **kwargs)
|
|
912
913
|
|
|
913
914
|
return wrapper(wrapped) if wrapped else wrapper
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
def function_id(fn: Any) -> str:
|
|
918
|
+
"""Get a unique identifier for a function.
|
|
919
|
+
|
|
920
|
+
Parameters
|
|
921
|
+
----------
|
|
922
|
+
fn : Any
|
|
923
|
+
The function to get the identifier for.
|
|
924
|
+
|
|
925
|
+
Returns
|
|
926
|
+
-------
|
|
927
|
+
str
|
|
928
|
+
The unique identifier for the function.
|
|
929
|
+
"""
|
|
930
|
+
if isinstance(fn, functools.partial):
|
|
931
|
+
base = fn.func
|
|
932
|
+
else:
|
|
933
|
+
base = fn
|
|
934
|
+
return f"{base.__module__}:{getattr(base, '__qualname__', type(base).__name__)}"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
aspire/__init__.py,sha256=B2IETvlpB0oBh57prRYLdi8jB5yFGw8qVviGdf1NcnE,409
|
|
2
|
-
aspire/aspire.py,sha256=
|
|
2
|
+
aspire/aspire.py,sha256=7DDRpwMezJABzX3AyHamRf8hjLAEeqCtg-_s5qSRjg0,30885
|
|
3
3
|
aspire/history.py,sha256=l_j-riZKbTWK7Wz9zvvD_mTk9psNCKItiveYhr_pYv8,4313
|
|
4
4
|
aspire/plot.py,sha256=oXwUDOb_953_ADm2KLk41JIfpE3JeiiQiSYKvUVwLqw,1423
|
|
5
5
|
aspire/samples.py,sha256=v7y8DkirUCHOJbCE-o9y2K7xzU2HicIo_O0CdFhLgXE,19478
|
|
6
6
|
aspire/transforms.py,sha256=CHrfPQHEyHQ9I0WWiAgUplWwxYypZsD7uCYIHUbSFtY,24974
|
|
7
|
-
aspire/utils.py,sha256=
|
|
7
|
+
aspire/utils.py,sha256=sIONKn3gT7i3hVdlK9bRWy_I79rdk0QPkXTA4O1FlCI,27405
|
|
8
8
|
aspire/flows/__init__.py,sha256=GUZToPVNJoTwULpbeW10UijfQukNrILoAQ_ubeq7G3w,2110
|
|
9
9
|
aspire/flows/base.py,sha256=5UWKAiXDXLJ6Sg6a380ajLrGFaZSQyOnFEihQiiA4ko,2237
|
|
10
10
|
aspire/flows/jax/__init__.py,sha256=7cmiY_MbEC8RDA8Cmi8HVnNJm0sqFKlBsDethdsy5lA,52
|
|
@@ -21,8 +21,8 @@ aspire/samplers/smc/base.py,sha256=40A9yVuKS1F8cPzbfVQ9rNk3y07mnkfbuyRDIh_fy5A,1
|
|
|
21
21
|
aspire/samplers/smc/blackjax.py,sha256=2riWDSRmpL5lGmnhNtdieiRs0oYC6XZA2X-nVlQaqpE,12490
|
|
22
22
|
aspire/samplers/smc/emcee.py,sha256=4CI9GvH69FCoLiFBbKKYwYocYyiM95IijC5EvrcAmUo,2891
|
|
23
23
|
aspire/samplers/smc/minipcn.py,sha256=IJ5466VvARd4qZCWXXl-l3BPaKW1AgcwmbP3ISL2bto,3368
|
|
24
|
-
aspire_inference-0.1.
|
|
25
|
-
aspire_inference-0.1.
|
|
26
|
-
aspire_inference-0.1.
|
|
27
|
-
aspire_inference-0.1.
|
|
28
|
-
aspire_inference-0.1.
|
|
24
|
+
aspire_inference-0.1.0a12.dist-info/licenses/LICENSE,sha256=DN-eRtBfS9dZyT0Ds0Mdn2Y4nb-ZQ7h71vpASYBm5k4,1076
|
|
25
|
+
aspire_inference-0.1.0a12.dist-info/METADATA,sha256=snzuBueTUZazIqKt6yEYfI4JdY3QVhY0C-vxl7Urauw,3869
|
|
26
|
+
aspire_inference-0.1.0a12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
aspire_inference-0.1.0a12.dist-info/top_level.txt,sha256=9FRIYEl2xwVFG7jSOBHsElHQ0y3_4fq01Cf4_OyMQn8,7
|
|
28
|
+
aspire_inference-0.1.0a12.dist-info/RECORD,,
|
|
File without changes
|
{aspire_inference-0.1.0a11.dist-info → aspire_inference-0.1.0a12.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|