Skip to content

Could you please provide the code for train and neuron selection ? #11

@CHR-ray

Description

@CHR-ray

we are replicating you results, but the trigger generation part always return high loss trigger pattern. Could you please provide the code for train and neuron selection ?

this is my implementation part of selecting neuron in torch:

if isinstance(net.getattr(layer_name), torch.nn.modules.Linear): #weight is (n,m)
connect_level = torch.abs(net.getattr(layer_name).weight).sum(1) # if is a matrix, then all rows is summed.
elif isinstance(net.getattr(layer_name), torch.nn.modules.Conv2d): #weight is (c_out, c_in, h, w)
connect_level = torch.abs(net.getattr(layer_name).weight).sum([1,2,3])

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