code-loader 1.0.181.dev5__py3-none-any.whl → 1.0.182__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.
- code_loader/inner_leap_binder/leapbinder.py +1 -1
- code_loader/leaploader.py +11 -11
- code_loader/leaploaderbase.py +2 -2
- {code_loader-1.0.181.dev5.dist-info → code_loader-1.0.182.dist-info}/METADATA +1 -1
- {code_loader-1.0.181.dev5.dist-info → code_loader-1.0.182.dist-info}/RECORD +7 -7
- {code_loader-1.0.181.dev5.dist-info → code_loader-1.0.182.dist-info}/LICENSE +0 -0
- {code_loader-1.0.181.dev5.dist-info → code_loader-1.0.182.dist-info}/WHEEL +0 -0
|
@@ -694,7 +694,7 @@ class LeapBinder:
|
|
|
694
694
|
for handler in self.setup_container.inputs:
|
|
695
695
|
out1 = handler.function(preprocess_response.sample_ids[0], preprocess_response)
|
|
696
696
|
out2 = handler.function(preprocess_response.sample_ids[0], preprocess_response)
|
|
697
|
-
if not np.
|
|
697
|
+
if not np.allclose(out1, out2):
|
|
698
698
|
raise Exception(
|
|
699
699
|
"Simulation '{}': encoder '{}' is non-deterministic — consecutive calls with seed=0 returned different outputs".format(
|
|
700
700
|
sim.name, handler.name
|
code_loader/leaploader.py
CHANGED
|
@@ -328,7 +328,7 @@ class LeapLoader(LeapLoaderBase):
|
|
|
328
328
|
for handler in global_leap_binder.setup_container.inputs:
|
|
329
329
|
out1 = handler.function(preprocess_response.sample_ids[0], preprocess_response)
|
|
330
330
|
out2 = handler.function(preprocess_response.sample_ids[0], preprocess_response)
|
|
331
|
-
if not np.
|
|
331
|
+
if not np.allclose(out1, out2):
|
|
332
332
|
raise ValueError(
|
|
333
333
|
"Encoder '{}' is non-deterministic: consecutive calls with seed=0 returned different outputs".format(
|
|
334
334
|
handler.name
|
|
@@ -345,8 +345,8 @@ class LeapLoader(LeapLoaderBase):
|
|
|
345
345
|
result_payloads.append(test_result)
|
|
346
346
|
return result_payloads
|
|
347
347
|
|
|
348
|
-
def
|
|
349
|
-
# type: (str) -> Dict[str, npt.NDArray[np.float32]]
|
|
348
|
+
def run_simulation(self, sim_name, params=None, n_samples=1, seed=0):
|
|
349
|
+
# type: (str, Optional[Dict[str, Any]], int, int) -> Dict[str, npt.NDArray[np.float32]]
|
|
350
350
|
self.exec_script()
|
|
351
351
|
sim = next(
|
|
352
352
|
(s for s in global_leap_binder.setup_container.simulations if s.name == sim_name),
|
|
@@ -354,9 +354,9 @@ class LeapLoader(LeapLoaderBase):
|
|
|
354
354
|
)
|
|
355
355
|
if sim is None:
|
|
356
356
|
raise ValueError("No simulation registered with name '{}'".format(sim_name))
|
|
357
|
-
kwargs = sample_sim_params(sim.sim_config)
|
|
358
|
-
kwargs["N"] =
|
|
359
|
-
kwargs["seed"] =
|
|
357
|
+
kwargs = dict(params) if params is not None else sample_sim_params(sim.sim_config)
|
|
358
|
+
kwargs["N"] = n_samples
|
|
359
|
+
kwargs["seed"] = seed
|
|
360
360
|
_simulation_context["active"] = True
|
|
361
361
|
try:
|
|
362
362
|
sim_preprocess = sim.function(**kwargs)
|
|
@@ -364,11 +364,11 @@ class LeapLoader(LeapLoaderBase):
|
|
|
364
364
|
_simulation_context["active"] = False
|
|
365
365
|
sim_preprocess.state = DataStateType.additional
|
|
366
366
|
sim_preprocess.tl_generated = True
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
return
|
|
367
|
+
per_encoder = {handler.name: [] for handler in global_leap_binder.setup_container.inputs}
|
|
368
|
+
for sample_id in sim_preprocess.sample_ids:
|
|
369
|
+
for handler in global_leap_binder.setup_container.inputs:
|
|
370
|
+
per_encoder[handler.name].append(handler.function(sample_id, sim_preprocess))
|
|
371
|
+
return {name: np.stack(arrays) for name, arrays in per_encoder.items()}
|
|
372
372
|
|
|
373
373
|
@staticmethod
|
|
374
374
|
def _get_all_dataset_base_handlers() -> List[Union[DatasetBaseHandler, MetadataHandler]]:
|
code_loader/leaploaderbase.py
CHANGED
|
@@ -154,8 +154,8 @@ class LeapLoaderBase:
|
|
|
154
154
|
pass
|
|
155
155
|
|
|
156
156
|
@abstractmethod
|
|
157
|
-
def
|
|
158
|
-
# type: (str) -> Dict[str, Any]
|
|
157
|
+
def run_simulation(self, sim_name, params=None, n_samples=1, seed=0):
|
|
158
|
+
# type: (str, Optional[Dict[str, Any]], int, int) -> Dict[str, Any]
|
|
159
159
|
pass
|
|
160
160
|
|
|
161
161
|
def is_custom_latent_space(self) -> bool:
|
|
@@ -21,10 +21,10 @@ code_loader/experiment_api/types.py,sha256=MY8xFARHwdVA7p4dxyhD60ShmttgTvb4qdp1o
|
|
|
21
21
|
code_loader/experiment_api/utils.py,sha256=XZHtxge12TS4H4-8PjV3sKuhp8Ud6ojAiIzTZJEqBqc,3304
|
|
22
22
|
code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaSbeTVzq-2ja_SQw4zi7LXwKL9cY,990
|
|
23
23
|
code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
|
|
24
|
-
code_loader/inner_leap_binder/leapbinder.py,sha256=
|
|
24
|
+
code_loader/inner_leap_binder/leapbinder.py,sha256=XLYYcV50qjMvoC1S6WW0tLBch_0g5gl1UyHiVSWYbvg,40491
|
|
25
25
|
code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=YlK51b5Ryo396f7tOA7Ole3vYCLs3f5ZLm2qDQ9K1NE,105781
|
|
26
|
-
code_loader/leaploader.py,sha256=
|
|
27
|
-
code_loader/leaploaderbase.py,sha256=
|
|
26
|
+
code_loader/leaploader.py,sha256=Md-CsdLiBVfeGIlVqpVjNVF_fEAFbg2ahmVCCPl3iOw,36758
|
|
27
|
+
code_loader/leaploaderbase.py,sha256=HrOGX9H8eRbyrFOEdvC2OISJvtZWKMVDah0cry8PXlo,6492
|
|
28
28
|
code_loader/mixpanel_tracker.py,sha256=rNwRmFifNbdUoqLQvvhhgpKczWpWiEmd8MfyJe27sxw,9131
|
|
29
29
|
code_loader/plot_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
30
|
code_loader/plot_functions/plot_functions.py,sha256=6Q7VWGxetL2W0EK2QeCdObVATvBuHs3YBA09H4uoIk0,14996
|
|
@@ -32,7 +32,7 @@ code_loader/plot_functions/visualize.py,sha256=gsBAYYkwMh7jIpJeDMPS8G4CW-pxwx6Lz
|
|
|
32
32
|
code_loader/utils.py,sha256=YecipkdTA-VcE9F0RQcY9cFnY8P3AksPnHM2Db7xUSk,3972
|
|
33
33
|
code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
code_loader/visualizers/default_visualizers.py,sha256=onRnLE_TXfgLN4o52hQIOOhUcFexGlqJ3xSpQDVLuZM,2604
|
|
35
|
-
code_loader-1.0.
|
|
36
|
-
code_loader-1.0.
|
|
37
|
-
code_loader-1.0.
|
|
38
|
-
code_loader-1.0.
|
|
35
|
+
code_loader-1.0.182.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
|
|
36
|
+
code_loader-1.0.182.dist-info/METADATA,sha256=bdjOF01oHx8liEGiQIVqgTKHIo4yiol3I4Rd-QMKxgA,1090
|
|
37
|
+
code_loader-1.0.182.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
38
|
+
code_loader-1.0.182.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|