utils¶
Functions
|
Create new parameters dict or add field to existing one. |
|
Prepare batch with data for forecasting. |
|
Prepare batch with training data. |
|
Convert data to tensor and put on default device. |
- prepare_test_batch(data: List[Dict[str, Any]], input_size: int) Dict[str, Any] [source]¶
Prepare batch with data for forecasting.
- Parameters
data (List[Dict[str, Any]]) –
input_size (int) –
- Return type
Dict[str, Any]
- prepare_train_batch(data: List[Dict[str, Any]], input_size: int, output_size: int, window_sampling_limit: Optional[int] = None, random_state: Optional[numpy.random.mtrand.RandomState] = None) Dict[str, Optional[torch.Tensor]] [source]¶
Prepare batch with training data.
- Parameters
data (List[Dict[str, Any]]) –
input_size (int) –
output_size (int) –
window_sampling_limit (Optional[int]) –
random_state (Optional[numpy.random.mtrand.RandomState]) –
- Return type
Dict[str, Optional[torch.Tensor]]
- to_tensor(x: Any) torch.Tensor [source]¶
Convert data to tensor and put on default device.
- Parameters
x (Any) – Initial data for the tensor. Can be a list, tuple, NumPy ndarray, scalar, and other types.
- Returns
Input data as tensor.
- Return type