Method
__init__
(
self,
degree: int = 3,
coeff_range: tuple[float, float] = (0.0, 0.1),
dtype: DtypeLike = np.float32,
prob: float = 0.1,
)
Source from the content-addressed store, hash-verified
| 766 | backend = [TransformBackends.NUMPY] |
| 767 | |
| 768 | def __init__( |
| 769 | self, |
| 770 | degree: int = 3, |
| 771 | coeff_range: tuple[float, float] = (0.0, 0.1), |
| 772 | dtype: DtypeLike = np.float32, |
| 773 | prob: float = 0.1, |
| 774 | ) -> None: |
| 775 | RandomizableTransform.__init__(self, prob) |
| 776 | if degree < 1: |
| 777 | raise ValueError(f"degree should be no less than 1, got {degree}.") |
| 778 | self.degree = degree |
| 779 | self.coeff_range = coeff_range |
| 780 | self.dtype = dtype |
| 781 | |
| 782 | self._coeff = [1.0] |
| 783 | |
| 784 | def _generate_random_field(self, spatial_shape: Sequence[int], degree: int, coeff: Sequence[float]): |
| 785 | """ |
Callers
nothing calls this directly
Tested by
no test coverage detected