Edit to conform to PEP8 guidelines
@@ -75,8 +75,8 @@ def prep_bbox(sess, x, y, X_train, Y_train, X_test, Y_test,
'learning_rate': learning_rate
}
# treat keras model and tensorflow model separately
- if (model.__class__ in [keras.models.Sequential
- or keras.engine.training.Model]):
+ if (model.__class__ in
+ [keras.models.Sequential or keras.engine.training.Model]):
print("Keras model detected...")
model_train(sess, x, y, predictions, X_train, Y_train,
args=train_params, rng=rng)
@@ -84,7 +84,6 @@ def prep_bbox(sess, x, y, X_train, Y_train, X_test, Y_test,
model_train(sess, x, y, predictions, X_train, Y_train,
args=train_params, rng=rng, var_list=model.get_params())
-
# Print out the accuracy on legitimate data
eval_params = {'batch_size': batch_size}
accuracy = model_eval(sess, x, y, predictions, X_test, Y_test,
@@ -246,7 +245,8 @@ def mnist_blackbox(train_start=0, train_end=60000, test_start=0,
print("Training the substitute model.")
# set keras model as non-trainable
- if (model.__class__ in [keras.models.Sequential or keras.engine.training.Model]):
+ if (model.__class__ in
+ [keras.models.Sequential or keras.engine.training.Model]):
model.trainable = False
train_sub_out = train_sub(sess, x, y, bbox_preds, X_sub, Y_sub,
