code-loader 1.0.74__tar.gz → 1.0.76__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 code-loader might be problematic. Click here for more details.
- {code_loader-1.0.74 → code_loader-1.0.76}/PKG-INFO +1 -1
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/inner_leap_binder/leapbinder_decorators.py +21 -17
- {code_loader-1.0.74 → code_loader-1.0.76}/pyproject.toml +1 -1
- {code_loader-1.0.74 → code_loader-1.0.76}/LICENSE +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/README.md +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/__init__.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/contract/__init__.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/contract/datasetclasses.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/contract/enums.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/contract/exceptions.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/contract/responsedataclasses.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/contract/visualizer_classes.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/default_losses.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/default_metrics.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/__init__.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/api.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/cli_config_utils.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/client.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/epoch.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/experiment.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/experiment_context.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/types.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/utils.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/workingspace_config_utils.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/inner_leap_binder/__init__.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/inner_leap_binder/leapbinder.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/leaploader.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/leaploaderbase.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/utils.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/visualizers/__init__.py +0 -0
- {code_loader-1.0.74 → code_loader-1.0.76}/code_loader/visualizers/default_visualizers.py +0 -0
{code_loader-1.0.74 → code_loader-1.0.76}/code_loader/inner_leap_binder/leapbinder_decorators.py
RENAMED
@@ -8,7 +8,7 @@ import numpy.typing as npt
|
|
8
8
|
from code_loader.contract.datasetclasses import CustomCallableInterfaceMultiArgs, \
|
9
9
|
CustomMultipleReturnCallableInterfaceMultiArgs, ConfusionMatrixCallableInterfaceMultiArgs, CustomCallableInterface, \
|
10
10
|
VisualizerCallableInterface, MetadataSectionCallableInterface, PreprocessResponse, SectionCallableInterface, \
|
11
|
-
ConfusionMatrixElement
|
11
|
+
ConfusionMatrixElement, SamplePreprocessResponse
|
12
12
|
from code_loader.contract.enums import MetricDirection, LeapDataType
|
13
13
|
from code_loader import leap_binder
|
14
14
|
from code_loader.contract.visualizer_classes import LeapImage, LeapImageMask, LeapTextMask, LeapText, LeapGraph, \
|
@@ -30,18 +30,20 @@ def tensorleap_custom_metric(name: str,
|
|
30
30
|
|
31
31
|
def _validate_input_args(*args, **kwargs) -> None:
|
32
32
|
for i, arg in enumerate(args):
|
33
|
-
assert isinstance(arg, np.ndarray), (
|
34
|
-
|
35
|
-
|
33
|
+
assert isinstance(arg, (np.ndarray, SamplePreprocessResponse)), (
|
34
|
+
f'tensorleap_custom_metric validation failed: '
|
35
|
+
f'Argument #{i} should be a numpy array. Got {type(arg)}.')
|
36
|
+
if leap_binder.batch_size_to_validate and isinstance(arg, np.ndarray):
|
36
37
|
assert arg.shape[0] == leap_binder.batch_size_to_validate, \
|
37
38
|
(f'tensorleap_custom_metric validation failed: Argument #{i} '
|
38
39
|
f'first dim should be as the batch size. Got {arg.shape[0]} '
|
39
40
|
f'instead of {leap_binder.batch_size_to_validate}')
|
40
41
|
|
41
42
|
for _arg_name, arg in kwargs.items():
|
42
|
-
assert isinstance(arg, np.ndarray), (
|
43
|
-
|
44
|
-
|
43
|
+
assert isinstance(arg, (np.ndarray, SamplePreprocessResponse)), (
|
44
|
+
f'tensorleap_custom_metric validation failed: '
|
45
|
+
f'Argument {_arg_name} should be a numpy array. Got {type(arg)}.')
|
46
|
+
if leap_binder.batch_size_to_validate and isinstance(arg, np.ndarray):
|
45
47
|
assert arg.shape[0] == leap_binder.batch_size_to_validate, \
|
46
48
|
(f'tensorleap_custom_metric validation failed: Argument {_arg_name} '
|
47
49
|
f'first dim should be as the batch size. Got {arg.shape[0]} '
|
@@ -58,8 +60,8 @@ def tensorleap_custom_metric(name: str,
|
|
58
60
|
assert isinstance(single_metric_result[0][0], ConfusionMatrixElement), \
|
59
61
|
f'{supported_types_message}Got List[List[{type(single_metric_result[0][0])}]].'
|
60
62
|
else:
|
61
|
-
assert isinstance(single_metric_result[0],
|
62
|
-
|
63
|
+
assert isinstance(single_metric_result[0], (
|
64
|
+
float, int, type(None))), f'{supported_types_message}Got List[{type(single_metric_result[0])}].'
|
63
65
|
else:
|
64
66
|
assert isinstance(single_metric_result,
|
65
67
|
np.ndarray), f'{supported_types_message}Got {type(single_metric_result)}.'
|
@@ -115,17 +117,19 @@ def tensorleap_custom_visualizer(name: str, visualizer_type: LeapDataType,
|
|
115
117
|
|
116
118
|
def _validate_input_args(*args, **kwargs):
|
117
119
|
for i, arg in enumerate(args):
|
118
|
-
assert isinstance(arg, np.ndarray), (
|
119
|
-
|
120
|
-
|
120
|
+
assert isinstance(arg, (np.ndarray, SamplePreprocessResponse)), (
|
121
|
+
f'tensorleap_custom_visualizer validation failed: '
|
122
|
+
f'Argument #{i} should be a numpy array. Got {type(arg)}.')
|
123
|
+
if leap_binder.batch_size_to_validate and isinstance(arg, np.ndarray):
|
121
124
|
assert arg.shape[0] != leap_binder.batch_size_to_validate, \
|
122
125
|
(f'tensorleap_custom_visualizer validation failed: '
|
123
126
|
f'Argument #{i} should be without batch dimension. ')
|
124
127
|
|
125
128
|
for _arg_name, arg in kwargs.items():
|
126
|
-
assert isinstance(arg, np.ndarray), (
|
127
|
-
|
128
|
-
|
129
|
+
assert isinstance(arg, (np.ndarray, SamplePreprocessResponse)), (
|
130
|
+
f'tensorleap_custom_visualizer validation failed: '
|
131
|
+
f'Argument {_arg_name} should be a numpy array. Got {type(arg)}.')
|
132
|
+
if leap_binder.batch_size_to_validate and isinstance(arg, np.ndarray):
|
129
133
|
assert arg.shape[0] != leap_binder.batch_size_to_validate, \
|
130
134
|
(f'tensorleap_custom_visualizer validation failed: Argument {_arg_name} '
|
131
135
|
f'should be without batch dimension. ')
|
@@ -353,10 +357,10 @@ def tensorleap_custom_loss(name: str):
|
|
353
357
|
|
354
358
|
leap_binder.add_custom_loss(user_function, name)
|
355
359
|
|
356
|
-
valid_types = np.ndarray
|
360
|
+
valid_types = (np.ndarray, SamplePreprocessResponse)
|
357
361
|
try:
|
358
362
|
import tensorflow as tf
|
359
|
-
valid_types = (np.ndarray, tf.Tensor)
|
363
|
+
valid_types = (np.ndarray, SamplePreprocessResponse, tf.Tensor)
|
360
364
|
except ImportError:
|
361
365
|
pass
|
362
366
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{code_loader-1.0.74 → code_loader-1.0.76}/code_loader/experiment_api/workingspace_config_utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|