Skip to content

Setting the value of x <= 0 to alpha argument of AugMix() doesn't get error even if Dirichlet() is used for it #8955

Open
@hyperkai

Description

@hyperkai

🐛 Describe the bug

Dirichlet() is used for alpha argument of AugMix(), then setting the value of x <= 0 to concentration argument of Dirichlet() gets error as shown below:

from torch.distributions.dirichlet import Dirichlet
import torch

Dirichlet(concentration=torch.tensor([0.0])) # Error
Dirichlet(concentration=torch.tensor([-1.0])) # Error
Dirichlet(concentration=torch.tensor([-2.0])) # Error

But setting the value of x <= 0 to alpha argument of AugMix() doesn't get error as shown below:

from torchvision.datasets import OxfordIIITPet
from torchvision.transforms.v2 import AugMix

my_data = OxfordIIITPet(
    root="data",
    transform=AugMix(alpha=0.0)
    # transform=AugMix(alpha=-1.0)
    # transform=AugMix(alpha=-2.0)
)

my_data[0]
# (<PIL.Image.Image image mode=RGB size=394x500>, 0)

So, setting the value of x <= 0 to alpha argument of AugMix() should get error same as concentration argument of Dirichlet().

Versions

import torchvision

torchvision.__version__ # '0.20.1'

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