code-loader 1.0.22__py3-none-any.whl → 1.0.24__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.
@@ -122,6 +122,7 @@ class MetadataHandler:
122
122
  class PredictionTypeHandler:
123
123
  name: str
124
124
  labels: List[str]
125
+ channel_dim: int
125
126
 
126
127
 
127
128
  @dataclass
@@ -62,6 +62,7 @@ class CustomLayerInstance:
62
62
  class PredictionTypeInstance:
63
63
  name: str
64
64
  labels: List[str]
65
+ channel_dim: int
65
66
 
66
67
 
67
68
  @dataclass
@@ -107,8 +107,8 @@ class LeapBinder:
107
107
  arg_names = inspect.getfullargspec(function)[0]
108
108
  self.setup_container.metrics.append(MetricHandler(name, function, arg_names))
109
109
 
110
- def add_prediction(self, name: str, labels: List[str]) -> None:
111
- self.setup_container.prediction_types.append(PredictionTypeHandler(name, labels))
110
+ def add_prediction(self, name: str, labels: List[str], channel_dim: int = -1) -> None:
111
+ self.setup_container.prediction_types.append(PredictionTypeHandler(name, labels, channel_dim))
112
112
 
113
113
  def set_ground_truth(self, function: SectionCallableInterface, name: str) -> None:
114
114
  function = to_numpy_return_wrapper(function)
@@ -119,7 +119,11 @@ class LeapBinder:
119
119
  def set_metadata(self, function: MetadataSectionCallableInterface, name: str) -> None:
120
120
  self.setup_container.metadata.append(MetadataHandler(name, function))
121
121
 
122
- def set_custom_layer(self, custom_layer: Type[Any], name: str) -> None:
122
+ def set_custom_layer(self, custom_layer: Type[Any], name: str, inspect_layer: bool = False,
123
+ kernel_index: Optional[int] = None) -> None:
124
+ if inspect_layer and kernel_index is not None:
125
+ custom_layer.kernel_index = kernel_index
126
+
123
127
  init_args = inspect.getfullargspec(custom_layer.__init__)[0][1:]
124
128
  call_args = inspect.getfullargspec(custom_layer.call)[0][1:]
125
129
  self.setup_container.custom_layers[name] = CustomLayerHandler(name, custom_layer, init_args, call_args)
code_loader/leaploader.py CHANGED
@@ -256,7 +256,8 @@ class LeapLoader:
256
256
 
257
257
  prediction_types = []
258
258
  for prediction_type in setup.prediction_types:
259
- pred_type_inst = PredictionTypeInstance(prediction_type.name, prediction_type.labels)
259
+ pred_type_inst = PredictionTypeInstance(prediction_type.name, prediction_type.labels,
260
+ prediction_type.channel_dim)
260
261
  prediction_types.append(pred_type_inst)
261
262
 
262
263
  metrics = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.22
3
+ Version: 1.0.24
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -1,18 +1,18 @@
1
1
  LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
2
2
  code_loader/__init__.py,sha256=V3DEXSN6Ie6PlGeSAbzjp9ufRj0XPJLpD7pDLLYxk6M,122
3
3
  code_loader/contract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- code_loader/contract/datasetclasses.py,sha256=h02sNsg4p-ypf5Dh00lIe1D3Bw1tnVMbKs2yO8X-2Vg,4433
4
+ code_loader/contract/datasetclasses.py,sha256=xuPrL3cKZ-tNBMQ5FsSh7oI8U6ITA_QPI57LN2T8aF8,4454
5
5
  code_loader/contract/enums.py,sha256=KDIeNl79e8rCp4ybJat7U03j50McrcBTWUxko5SXrug,1481
6
6
  code_loader/contract/exceptions.py,sha256=jWqu5i7t-0IG0jGRsKF4DjJdrsdpJjIYpUkN1F4RiyQ,51
7
- code_loader/contract/responsedataclasses.py,sha256=thIxKSx3mwoKHYICULGaeh2-S56L1xBlmDThCE11yT4,2658
7
+ code_loader/contract/responsedataclasses.py,sha256=0bo4iLbfu6-3tpgzeKakIH2i_1jtR8BiLdupa1TVT0o,2679
8
8
  code_loader/contract/visualizer_classes.py,sha256=1FjVO744J_EMuJfHWXGdvSz6vl3Vu7iS3CDfs8MzEEQ,5138
9
9
  code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
10
- code_loader/inner_leap_binder/leapbinder.py,sha256=ctlz4D75L8LJjCEBr9TcdWi2RrFMCiLN4UmRclmvauc,12305
11
- code_loader/leaploader.py,sha256=eyCxajK7hdkFQHRhmXUjppT1BJ4dRcTRmGXxeHiaZKQ,15322
10
+ code_loader/inner_leap_binder/leapbinder.py,sha256=Nb3UXrtoYMDNLGbL6JvIIaVMEAQ_B8YpUPXxZ5DThrE,12540
11
+ code_loader/leaploader.py,sha256=XUziFXq89AFbqUoWnlh5sYkoGA8jqUziORcOQA6W0GQ,15403
12
12
  code_loader/utils.py,sha256=lluWgGpG7sYB-o9Wk9vZlm4uQqb7qbPZBa_qnSe0BkU,1933
13
13
  code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  code_loader/visualizers/default_visualizers.py,sha256=HqWx2qfTrroGl2n8Fpmr_4X-rk7tE2oGapjO3gzz4WY,2226
15
- code_loader-1.0.22.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
16
- code_loader-1.0.22.dist-info/METADATA,sha256=65xWzMqYH8T-ywVNs_hBbxUyeT6-wLwBsD9lJ3VHejM,768
17
- code_loader-1.0.22.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
18
- code_loader-1.0.22.dist-info/RECORD,,
15
+ code_loader-1.0.24.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
16
+ code_loader-1.0.24.dist-info/METADATA,sha256=yG5kENlLeu9eMRYZP2LYbVYdN5cBhRe1eLtxbgD0yeI,768
17
+ code_loader-1.0.24.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
18
+ code_loader-1.0.24.dist-info/RECORD,,