scale
RandomizedScaleX
Bases: BaseTransform
Applies ScaleX with a scaling factor sampled uniformly from
[min_scale, max_scale].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_scale
|
float
|
Lower bound of the sampled scaling factor. |
required |
max_scale
|
float
|
Upper bound of the sampled scaling factor. |
required |
Example
transform = RandomizedScaleX(min_scale=0.5, max_scale=2.0) data = transform(data)
Source code in src/torch_structure/transforms/scale.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
forward(data)
Sample a scaling factor and apply ScaleX with it.
Source code in src/torch_structure/transforms/scale.py
93 94 95 96 97 98 99 | |
ScaleX
Bases: BaseTransform
Applies a scaling transformation along the x-axis of the coordinates. Args: scaling_factor (float): The factor by which to scale the x-coordinates.
Example
transform = ScaleX(scaling_factor=2.0) data = transform(data)
Source code in src/torch_structure/transforms/scale.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
forward(data)
Scale data.coords along x and recompute length/force to compensate, in place.
Source code in src/torch_structure/transforms/scale.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
ScaleZ
Bases: BaseTransform
Applies a scaling transformation along the z-axis of the coordinates. Args: scaling_factor (float): The factor by which to scale the z-coordinates.
Example
transform = ScaleZ(scaling_factor=2.0) data = transform(data)
Source code in src/torch_structure/transforms/scale.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
forward(data)
Scale data.coords along z and rescale force_density/force to compensate, in place.
Source code in src/torch_structure/transforms/scale.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |