Skip to content

Error in TTAA code #4

@nano-vision

Description

@nano-vision

Hi, I met some errors when running TTAA code. Could you please re-check your code? Thanks a lot.

  1. gaussian_smoothing is missing

from gaussian_smoothing import *

  1. there are a lot of variables which are not defined before in train.py.

feature_layer in Line 146, Line 156, and Line 170

feature in Line157

_, t_features = l_d(normalize(t_img.clone().detach()))
t_feature = t_features[feature_layer]
t_feature_similarity = f_d(t_feature)
adv = netG(img.clone())
# Projection
adv = torch.min(torch.max(adv, img - eps), img + eps)
adv = torch.clamp(adv, 0.0, 1.0)
_, s_features = l_d(normalize(adv.clone().detach()))
s_feature = s_features[feature_layer]
s_feature_similarity = f_d(feature)

t_outputs in Line 161

D_real_loss = BCE(t_feature_similarity, torch.ones(t_outputs.shape).detach().to(device))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions