Skip to content

Make normalizer/standardizer transform #40

Description

@cshewmake2

Add a transform to make samples 0 mean and unit standard deviation.

aka, reintroduce this into our current transform module.

def preprocess_images(images, patch_size_x, patch_size_y):
data = images.detach().clone()
means = torch.mean(data, dim=(1, 2, 3), keepdims=True)
data = data - means
stds = 10torch.std(data, dim=(1, 2, 3), keepdims=True)
data = data / stds
data = data.reshape(-1, patch_size_x
patch_size_y)
return data

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions