aibedo.models.BaseModel.raw_outputs_to_denormalized_per_variable_dict
- BaseModel.raw_outputs_to_denormalized_per_variable_dict(outputs_tensor: torch.Tensor, month_of_outputs: Optional[torch.Tensor] = None, input_tensor: Optional[torch.Tensor] = None, return_normalized_outputs: bool = False) Dict[str, torch.Tensor][source]
Convert the output tensor into a dictionary of denormalized (!) per-output-variable tensors. This function can be used for target tensors. For predicted tensors, please use
postprocess_raw_predictions().- Parameters
outputs_tensor (Tensor) – A tensor of shape \((B, *, C_{out})\) in normalized scale.
month_of_outputs (Tensor, optional) – A tensor of shape \((B,)\) with the month of each output.
input_tensor (Tensor, optional) – A tensor of shape \((B, *, C_{in})\).
return_normalized_outputs (bool) – If True, the raw outputs (vars with ‘_pre’) will be returned as well.
Note
One of
month_of_outputsorinput_tensormust be provided!- Returns
Dict[str, Tensor] – A dictionary of denormalized tensors of shape \((B, *)\). E.g. ‘pr’, ‘tas’ will all be the keys to the respective predicted/target tensor.
- Shapes:
Input: \((B, *, C_{out})\)
Output: Dict k_i -> v_i, and each v_i has shape \((B, *)\) for \(i=1,..,C_{out}\),
where \(B\) is the batch size, \(*\) is the spatial dimension(s) of the data, and \(C_{out}\) is the number of output features,