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 5 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
8 changes: 3 additions & 5 deletions tests/transforms/test_amplitude_rescale_transform.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import numpy as np
import torch

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

Expand All @@ -16,10 +14,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
Loading