SynthShapes.utils
MinMaxScaler
Bases: Module
A torch.nn.Module subclass that scales an input tensor to a specified range.
| PARAMETER | DESCRIPTION |
|---|---|
lower_bound
|
The lower bound of the scaling interval. Default is 0.1.
TYPE:
|
upper_bound
|
The upper bound of the scaling interval. Default is 0.9.
TYPE:
|
Source code in SynthShapes/utils.py
forward
Forward pass to scale the input tensor X to the interval [lower_bound, upper_bound].
| PARAMETER | DESCRIPTION |
|---|---|
X
|
Input tensor with arbitrary floating point values.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
Scaled tensor with values in the interval [lower_bound, upper_bound]. |
Source code in SynthShapes/utils.py
ensure_5d_tensor
Ensures the input tensor has 5 dimensions [batch_size, channels, depth, height, width].
| PARAMETER | DESCRIPTION |
|---|---|
volume
|
Input tensor representing the volume.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
Tensor with 5 dimensions. |