Skip to content

Commit

Permalink
make tests pass, remove unused model argument
Browse files Browse the repository at this point in the history
  • Loading branch information
goodfeli committed Jan 9, 2018
1 parent ef44ae4 commit 05c37a4
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 138 deletions.
8 changes: 6 additions & 2 deletions cleverhans/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,15 @@ def get_probs(self, x):
:return: A symbolic representation of the output probabilities (i.e.,
the output values produced by the softmax layer).
"""
use_logits = False
try:
return self.get_layer(x, 'probs')
except NoSuchLayerError:
import tensorflow as tf
return tf.nn.softmax(self.get_logits(x))
pass
except NotImplementedError:
pass
import tensorflow as tf
return tf.nn.softmax(self.get_logits(x))

def get_layer_names(self):
"""
Expand Down
7 changes: 2 additions & 5 deletions cleverhans/utils_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def model_train(sess, x, y, predictions, X_train, Y_train, save=False,
return True


def model_eval(sess, x, y, predictions=None, X_test=None, Y_test=None,
feed=None, args=None, model=None):
def model_eval(sess, x, y, predictions, X_test=None, Y_test=None,
feed=None, args=None):
"""
Compute the accuracy of a TF model on some data
:param sess: TF session to use when training the graph
Expand All @@ -206,9 +206,6 @@ def model_eval(sess, x, y, predictions=None, X_test=None, Y_test=None,
if X_test is None or Y_test is None:
raise ValueError("X_test argument and Y_test argument "
"must be supplied.")
if model is None and predictions is None:
raise ValueError("One of model argument "
"or predictions argument must be supplied.")

# Define accuracy symbolically
if LooseVersion(tf.__version__) >= LooseVersion('1.0.0'):
Expand Down
Loading

0 comments on commit 05c37a4

Please sign in to comment.