classy-szfast 0.0.25.post12__tar.gz → 0.0.25.post13__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.
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/PKG-INFO +1 -1
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/cosmopower_jax.py +27 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast.egg-info/PKG-INFO +1 -1
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/pyproject.toml +1 -1
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/README.md +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/__init__.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/classy_sz.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/classy_szfast.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/config.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/cosmopower.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/cosmosis_classy_szfast_interface.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/custom_bias/__init__.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/custom_bias/custom_bias.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/custom_profiles/__init__.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/custom_profiles/custom_profiles.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/emulators_meta_data.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/pks_and_sigmas.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/restore_nn.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/suppress_warnings.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/utils.py +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast.egg-info/SOURCES.txt +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast.egg-info/dependency_links.txt +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast.egg-info/requires.txt +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast.egg-info/top_level.txt +0 -0
- {classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/setup.cfg +0 -0
@@ -7,6 +7,7 @@ from .suppress_warnings import suppress_warnings
|
|
7
7
|
from .emulators_meta_data import *
|
8
8
|
|
9
9
|
from cosmopower_jax.cosmopower_jax import CosmoPowerJAX as CPJ
|
10
|
+
from jax.errors import TracerArrayConversionError
|
10
11
|
|
11
12
|
|
12
13
|
cp_tt_nn_jax = {}
|
@@ -28,6 +29,32 @@ class CosmoPowerJAX_custom(CPJ):
|
|
28
29
|
if 'ten_to_predictions' in kwargs.keys():
|
29
30
|
self.ten_to_predictions = kwargs['ten_to_predictions']
|
30
31
|
|
32
|
+
def _dict_to_ordered_arr_np(self,
|
33
|
+
input_dict,
|
34
|
+
):
|
35
|
+
"""
|
36
|
+
Sort input parameters. Takend verbatim from CP
|
37
|
+
(https://github.com/alessiospuriomancini/cosmopower/blob/main/cosmopower/cosmopower_NN.py#LL291C1-L308C73)
|
38
|
+
|
39
|
+
Parameters:
|
40
|
+
input_dict (dict [numpy.ndarray]):
|
41
|
+
input dict of (arrays of) parameters to be sorted
|
42
|
+
|
43
|
+
Returns:
|
44
|
+
numpy.ndarray:
|
45
|
+
parameters sorted according to desired order
|
46
|
+
"""
|
47
|
+
if self.parameters is not None:
|
48
|
+
try:
|
49
|
+
return np.stack([input_dict[k] for k in self.parameters], axis=1)
|
50
|
+
except TracerArrayConversionError:
|
51
|
+
converted_dict = {k: jnp.array(v) if isinstance(v, list) else v for k, v in input_dict.items()}
|
52
|
+
return jnp.stack([converted_dict[k] for k in self.parameters], axis=1)
|
53
|
+
|
54
|
+
else:
|
55
|
+
return np.stack([input_dict[k] for k in input_dict], axis=1)
|
56
|
+
|
57
|
+
|
31
58
|
def _predict(self, weights, hyper_params, param_train_mean, param_train_std,
|
32
59
|
feature_train_mean, feature_train_std, input_vec):
|
33
60
|
""" Forward pass through pre-trained network.
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/custom_bias/__init__.py
RENAMED
File without changes
|
{classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/custom_bias/custom_bias.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/emulators_meta_data.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast/suppress_warnings.py
RENAMED
File without changes
|
File without changes
|
{classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast.egg-info/requires.txt
RENAMED
File without changes
|
{classy_szfast-0.0.25.post12 → classy_szfast-0.0.25.post13}/classy_szfast.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|