cihangxie / NIPS2017_adv_challenge_defense

Mitigating Adversarial Effects Through Randomization
MIT License
118 stars 20 forks source link

A strange line in defense.py #4

Closed KunlinLiu closed 6 years ago

KunlinLiu commented 6 years ago

code:
output_long = tf.to_int32(tf.ceil(

    • tf.to_float(output_short) * tf.to_float(input_long) / tf.to_float(input_short)))

Was the '1.*' wrong ? Why is there three ')'? Maybe I miss some important key points. Could you plz give me some help ? Thank you !

bairdzhang commented 6 years ago

We are trying to compute the long side of the output by ceil(out_short*in_long/in_short).

I am not sure the 1.* is necessary but I think keeping it won't make it wrong.

There are three ')'s because there are two '('s in the previous line, and there is another '(' for the last 'tf.to_float'.