trw.transforms.renormalize
¶
Module Contents¶
Functions¶
|
Transform the data so that it has desired mean and standard deviation element wise |
|
|
|
Transform the data so that it has desired mean and standard deviation element wise |
- trw.transforms.renormalize.renormalize_torch(data, desired_mean, desired_std, current_mean=None, current_std=None)¶
Transform the data so that it has desired mean and standard deviation element wise
- Parameters
data – a torch.Tensor
desired_mean – the mean to transform data to
desired_std – the std to transform data to
current_mean – if the mean if known, do not recalculate it (e.g., training mean to be used in validation split)
current_std – if the std if known, do not recalculate it (e.g., training std to be used in validation split)
- Returns
a torch.Tensor data with mean desired_mean and std desired_std
- trw.transforms.renormalize.renormalize_numpy(data, desired_mean, desired_std, current_mean=None, current_std=None)¶
- trw.transforms.renormalize.renormalize(data, desired_mean, desired_std, current_mean=None, current_std=None)¶
Transform the data so that it has desired mean and standard deviation element wise
- Parameters
data – a torch or numpy array
desired_mean – the mean to transform data to
desired_std – the std to transform data to
current_mean – if the mean if known, do not recalculate it (e.g., training mean to be used in validation split)
current_std – if the std if known, do not recalculate it (e.g., training std to be used in validation split)
- Returns
a data with mean desired_mean and std desired_std