Skip to content

[QUESTION]If My model return a dict,how can I produce adv sample? #201

Description

@LYAFJJ

❔ Any questions

I use the model from other package,and the model output is a dict,which contains 'logits' value which is pytorch model output like.If I want to use [torchattacks] to produce adv samples.What should I do?

I have a solution is that create a subclass that inherits from nn.Module and rewrite the forward() method that output the 'logits' in dict.Finally use self class in code 'torchattacks.FGSM(my_model)'.Is there any more easier method?

Thanks you for taking the time to read. : - D

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions