This is the discussion about implementing normalization in maxie, a next step following #2 .
Implementing norm
Normalization itself should be available in torchvision (https://pytorch.org/vision/main/generated/torchvision.transforms.Normalize.html). It might be a good idea to create a wrapper so that our norm is conditioned on the detector in use. We can pass in the following dictionary to our custom norm class during initialization.
This is the discussion about implementing normalization in maxie, a next step following #2 .
Implementing norm
Normalization itself should be available in torchvision (https://pytorch.org/vision/main/generated/torchvision.transforms.Normalize.html). It might be a good idea to create a wrapper so that our norm is conditioned on the detector in use. We can pass in the following dictionary to our custom norm class during initialization.
The current dataset class is aware of which detector (
detector_name
) is associated with the current image. https://github.com/carbonscott/maxie/blob/f211b00dca0d51bd5514d0bc24e9179a6300a9d5/maxie/datasets/ipc_segmented_dataset_dist.py#L140so the
__call__(self, batch_img, **kwargs)
in the normalization class can take an additional argument{'detector_name' : detector_name}
.Of course, we also need to add
kwargs = ...
inimage_tensor = trans(image_tensor)
https://github.com/carbonscott/maxie/blob/f211b00dca0d51bd5514d0bc24e9179a6300a9d5/maxie/datasets/ipc_segmented_dataset_dist.py#L152Concerning the config
dataset/transforms
section in the yaml config (https://github.com/carbonscott/maxie/blob/f211b00dca0d51bd5514d0bc24e9179a6300a9d5/train/hydra_config/train_config/base.yaml#L14), considering norm is implemented as a transformation. Maybe add a new parameter called norm, which will point to a dictionary containing per-detector norm parameters.