MCPcopy Create free account
hub / github.com/RolnickLab/climart / transform

Method transform

climart/data_transform/transforms.py:34–46  ·  view source on GitHub ↗

How to transform dict X = { 'layer': layer_array, # shape (#layers, #layer-features) 'levels': levels_array, # shape (#levels, #level-features) 'globals': globals_array (#global-features,) } to the form th

(self, X: Dict[str, np.ndarray])

Source from the content-addressed store, hash-verified

32 return self._out_dim
33
34 def transform(self, X: Dict[str, np.ndarray]) -> Any:
35 """
36 How to transform dict
37 X = {
38 'layer': layer_array, # shape (#layers, #layer-features)
39 'levels': levels_array, # shape (#levels, #level-features)
40 'globals': globals_array (#global-features,)
41 }
42 to the form the model will use/receive it in forward.
43 Implementation will be applied (with multi-processing) in the _get_item(.) method of the dataset
44 --> IMPORTANT: the arrays in X will *not* have the batch dimension!
45 """
46 raise NotImplementedError
47
48 def batched_transform(self, X: Dict[str, np.ndarray]) -> Any:
49 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected