Skip to content

Make normalizer/standardizer transform #40

@cshewmake2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions