Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update naming and remove unused package from AmplitudeRescaleTransform #1732

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lightly/transforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# All Rights Reserved

from lightly.transforms.aim_transform import AIMTransform
from lightly.transforms.amplitude_rescale_transform import AmplitudeRescaleTranform
from lightly.transforms.amplitude_rescale_transform import AmplitudeRescaleTransform
from lightly.transforms.byol_transform import (
BYOLTransform,
BYOLView1Transform,
Expand Down
3 changes: 1 addition & 2 deletions lightly/transforms/amplitude_rescale_transform.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from typing import Tuple

import numpy as np
import torch
from torch import Tensor
from torch.distributions import Uniform


class AmplitudeRescaleTranform:
class AmplitudeRescaleTransform:
"""Implementation of amplitude rescaling transformation.
This transform will rescale the amplitude of the Fourier Spectrum (`freq_image`) of the image and return it.
Expand Down
11 changes: 3 additions & 8 deletions tests/transforms/test_amplitude_rescale_transform.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import numpy as np
import torch

from lightly.transforms import (
AmplitudeRescaleTranform,
IRFFT2DTransform,
RFFT2DTransform,
)
from lightly.transforms import AmplitudeRescaleTransform, RFFT2DTransform


# Testing function image -> FFT -> AmplitudeRescale.
Expand All @@ -16,10 +11,10 @@ def test() -> None:
rfftTransform = RFFT2DTransform()
rfft = rfftTransform(image)

ampRescaleTf_1 = AmplitudeRescaleTranform()
ampRescaleTf_1 = AmplitudeRescaleTransform()
rescaled_rfft_1 = ampRescaleTf_1(rfft)

ampRescaleTf_2 = AmplitudeRescaleTranform(range=(1.0, 2.0))
ampRescaleTf_2 = AmplitudeRescaleTransform(range=(1.0, 2.0))
rescaled_rfft_2 = ampRescaleTf_2(rfft)

assert rescaled_rfft_1.shape == rfft.shape
Expand Down