code-loader 1.0.135__py3-none-any.whl → 1.0.136__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.
Potentially problematic release.
This version of code-loader might be problematic. Click here for more details.
- code_loader/inner_leap_binder/leapbinder_decorators.py +23 -3
- {code_loader-1.0.135.dist-info → code_loader-1.0.136.dist-info}/METADATA +1 -1
- {code_loader-1.0.135.dist-info → code_loader-1.0.136.dist-info}/RECORD +5 -5
- {code_loader-1.0.135.dist-info → code_loader-1.0.136.dist-info}/LICENSE +0 -0
- {code_loader-1.0.135.dist-info → code_loader-1.0.136.dist-info}/WHEEL +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# mypy: ignore-errors
|
|
2
2
|
import os
|
|
3
|
+
from collections import defaultdict
|
|
3
4
|
from functools import lru_cache
|
|
4
5
|
from typing import Optional, Union, Callable, List, Dict
|
|
5
6
|
|
|
@@ -232,9 +233,11 @@ def tensorleap_custom_metric(name: str,
|
|
|
232
233
|
direction: Union[MetricDirection, Dict[str, MetricDirection]] = MetricDirection.Downward,
|
|
233
234
|
compute_insights: Optional[Union[bool, Dict[str, bool]]] = None,
|
|
234
235
|
connects_to=None):
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
name_to_unique_name = defaultdict(set)
|
|
237
|
+
|
|
238
|
+
def decorating_function(
|
|
239
|
+
user_function: Union[CustomCallableInterfaceMultiArgs, CustomMultipleReturnCallableInterfaceMultiArgs,
|
|
240
|
+
ConfusionMatrixCallableInterfaceMultiArgs]):
|
|
238
241
|
for metric_handler in leap_binder.setup_container.metrics:
|
|
239
242
|
if metric_handler.metric_handler_data.name == name:
|
|
240
243
|
raise Exception(f'Metric with name {name} already exists. '
|
|
@@ -354,6 +357,11 @@ def tensorleap_custom_metric(name: str,
|
|
|
354
357
|
|
|
355
358
|
ordered_connections = [kwargs[n] for n in mapping_inner.arg_names if n in kwargs]
|
|
356
359
|
ordered_connections = list(args) + ordered_connections
|
|
360
|
+
|
|
361
|
+
if user_unique_name in name_to_unique_name[mapping_inner.name]:
|
|
362
|
+
user_unique_name = f'{user_unique_name}_{len(name_to_unique_name[mapping_inner.name])}'
|
|
363
|
+
name_to_unique_name[mapping_inner.name].add(user_unique_name)
|
|
364
|
+
|
|
357
365
|
_add_mapping_connection(user_unique_name, ordered_connections, mapping_inner.arg_names,
|
|
358
366
|
mapping_inner.name, NodeMappingType.Metric)
|
|
359
367
|
|
|
@@ -376,6 +384,8 @@ def tensorleap_custom_metric(name: str,
|
|
|
376
384
|
def tensorleap_custom_visualizer(name: str, visualizer_type: LeapDataType,
|
|
377
385
|
heatmap_function: Optional[Callable[..., npt.NDArray[np.float32]]] = None,
|
|
378
386
|
connects_to=None):
|
|
387
|
+
name_to_unique_name = defaultdict(set)
|
|
388
|
+
|
|
379
389
|
def decorating_function(user_function: VisualizerCallableInterface):
|
|
380
390
|
for viz_handler in leap_binder.setup_container.visualizers:
|
|
381
391
|
if viz_handler.visualizer_handler_data.name == name:
|
|
@@ -452,6 +462,10 @@ def tensorleap_custom_visualizer(name: str, visualizer_type: LeapDataType,
|
|
|
452
462
|
if 'user_unique_name' in kwargs:
|
|
453
463
|
user_unique_name = kwargs['user_unique_name']
|
|
454
464
|
|
|
465
|
+
if user_unique_name in name_to_unique_name[mapping_inner.name]:
|
|
466
|
+
user_unique_name = f'{user_unique_name}_{len(name_to_unique_name[mapping_inner.name])}'
|
|
467
|
+
name_to_unique_name[mapping_inner.name].add(user_unique_name)
|
|
468
|
+
|
|
455
469
|
ordered_connections = [kwargs[n] for n in mapping_inner.arg_names if n in kwargs]
|
|
456
470
|
ordered_connections = list(args) + ordered_connections
|
|
457
471
|
_add_mapping_connection(user_unique_name, ordered_connections, mapping_inner.arg_names,
|
|
@@ -974,6 +988,8 @@ def tensorleap_gt_encoder(name: str):
|
|
|
974
988
|
|
|
975
989
|
|
|
976
990
|
def tensorleap_custom_loss(name: str, connects_to=None):
|
|
991
|
+
name_to_unique_name = defaultdict(set)
|
|
992
|
+
|
|
977
993
|
def decorating_function(user_function: CustomCallableInterface):
|
|
978
994
|
for loss_handler in leap_binder.setup_container.custom_loss_handlers:
|
|
979
995
|
if loss_handler.custom_loss_handler_data.name == name:
|
|
@@ -1042,6 +1058,10 @@ def tensorleap_custom_loss(name: str, connects_to=None):
|
|
|
1042
1058
|
if 'user_unique_name' in kwargs:
|
|
1043
1059
|
user_unique_name = kwargs['user_unique_name']
|
|
1044
1060
|
|
|
1061
|
+
if user_unique_name in name_to_unique_name[mapping_inner.name]:
|
|
1062
|
+
user_unique_name = f'{user_unique_name}_{len(name_to_unique_name[mapping_inner.name])}'
|
|
1063
|
+
name_to_unique_name[mapping_inner.name].add(user_unique_name)
|
|
1064
|
+
|
|
1045
1065
|
ordered_connections = [kwargs[n] for n in mapping_inner.arg_names if n in kwargs]
|
|
1046
1066
|
ordered_connections = list(args) + ordered_connections
|
|
1047
1067
|
_add_mapping_connection(user_unique_name, ordered_connections, mapping_inner.arg_names,
|
|
@@ -21,7 +21,7 @@ code_loader/experiment_api/utils.py,sha256=XZHtxge12TS4H4-8PjV3sKuhp8Ud6ojAiIzTZ
|
|
|
21
21
|
code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaSbeTVzq-2ja_SQw4zi7LXwKL9cY,990
|
|
22
22
|
code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
|
|
23
23
|
code_loader/inner_leap_binder/leapbinder.py,sha256=Q3D9yVM-GNEJfYRFvMV__BoZbcWOgnWKhrZXAv6Tu7o,33232
|
|
24
|
-
code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=
|
|
24
|
+
code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=EptQhu4dPVXmAfUnv_Whzmess0ueRYy5RLpm7WYe6Ho,50981
|
|
25
25
|
code_loader/leaploader.py,sha256=85XUWd7Y8kup76xeqefgd8db7pGaeHMhE7QlmYlNFMw,29747
|
|
26
26
|
code_loader/leaploaderbase.py,sha256=LIFcC6xo6V_iiGN3BjibXETu_l84EWM_WIOKAvkfTiM,4458
|
|
27
27
|
code_loader/mixpanel_tracker.py,sha256=l9z_szKKQ7apEbdNZpGH1TKAiT_TsBHb9AQnePaWTyo,4942
|
|
@@ -31,7 +31,7 @@ code_loader/plot_functions/visualize.py,sha256=gsBAYYkwMh7jIpJeDMPS8G4CW-pxwx6Lz
|
|
|
31
31
|
code_loader/utils.py,sha256=gXENTYpjdidq2dx0gVbXlErPeHoNs-4TYAZbLRe0y2c,2712
|
|
32
32
|
code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
code_loader/visualizers/default_visualizers.py,sha256=onRnLE_TXfgLN4o52hQIOOhUcFexGlqJ3xSpQDVLuZM,2604
|
|
34
|
-
code_loader-1.0.
|
|
35
|
-
code_loader-1.0.
|
|
36
|
-
code_loader-1.0.
|
|
37
|
-
code_loader-1.0.
|
|
34
|
+
code_loader-1.0.136.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
|
|
35
|
+
code_loader-1.0.136.dist-info/METADATA,sha256=pNpIswJBMtQtorkL80niuBszYQ38F9repsK8WOCHRJ8,1090
|
|
36
|
+
code_loader-1.0.136.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
37
|
+
code_loader-1.0.136.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|