ispamm/hTorch

Adding a collate_fn to handle real-valued data

Closed this issue · 1 comments

It would be helpful to have a custom collate_fn to convert real-valued images to quaternion-valued images. Something like:

cifar = torchvision.datasets.CIFAR()
loader = torch.utils.data.DataLoader(cifar, batch_size=4, shuffle=True, collate_fn=convert_to_quaternion)

In this way, all image datasets in torchvision could be used directly. I think this could go together with the model conversion tools in a new utils.py module.

added function convert_data_for_quaternion to convert RGB to RGB + gray and use it in a QNN. Also renamed conver_to_quaternion.py to utils.py.