poplar.nn.rescaling
Rescaling objects to be passed to LinearModel to handle the rescaling of input/output data.
These are some standard rescalers to provide something easy to use out of the box; for more complex rescaling behaviour, create your own rescaling class using these examples as a template.
Classes
A placeholder rescaler that leaves input/output data unchanged. Functions may still be applied to the targets by passing them to yfunctions. |
|
Rescales data to the unit normal distribution. |
|
Rescales data to the uniform distribution with bounds [-1, 1]. |
Module Contents
- class poplar.nn.rescaling.IdentityRescaler(yfunctions=None)
A placeholder rescaler that leaves input/output data unchanged. Functions may still be applied to the targets by passing them to yfunctions.
- Parameters:
- yfunctionslist, optional
A list containing a function and its inverse to apply to the labels prior to rescaling, by default None (i.e. no function is applied)
- class poplar.nn.rescaling.ZScoreRescaler(xdata: torch.Tensor, ydata, yfunctions=None)
Rescales data to the unit normal distribution.
- Parameters:
- xdatatorch.Tensor
Input data.
- ydatatorch.Tensor
Input labels corresponding to xdata.
- yfunctionslist, optional
A list containing a function and its inverse to apply to the labels prior to rescaling, by default None (i.e. no function is applied)
- class poplar.nn.rescaling.UniformRescaler(xdata, ydata, yfunctions=None)
Rescales data to the uniform distribution with bounds [-1, 1].
- Parameters:
- xdatatorch.Tensor
Input data.
- ydatatorch.Tensor
Input labels corresponding to xdata.
- yfunctionslist, optional
A list containing a function and its inverse to apply to the labels prior to rescaling, by default None (i.e. no function is applied)