You need to write your model in such a way that it supports challenges such as
output = model.fprop(input_tensor)
or
output = model.fprop(input_tensor, params)
The fprop method twice generates the same direct distribution expression, but with a different input tensor for each call:
raw_output = model.fprop(clean_examples) adv_examples = ... adv_output = model.fprop(adv_examples)
If you want to apply this to one of our open source models and do not support the interface for this, write about the problem on github.
source share