Skip to content

Commit

Permalink
(#3) Defense: Logging images generated by defense models
Browse files Browse the repository at this point in the history
  • Loading branch information
betarixm committed May 2, 2022
1 parent 1b8944d commit afb63f0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/defense/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ def custom_callbacks(self) -> List[keras.callbacks.Callback]:
progress = keras.utils.Progbar(test_set.take(1).cardinality().numpy())

with defense_model.tensorboard_file_writer().as_default():
for idx, (x, _) in enumerate(test_set.take(1)):
for idx, (x, _) in enumerate(test_set):
y = defense_model.predict(x)
tf.summary.image(f"{args.defense.upper()} result - {idx}", [x, y])
tf.summary.image(
f"{args.defense.upper()} processing result", [x, y], step=idx
)

progress.add(1)

0 comments on commit afb63f0

Please sign in to comment.