from pgd_attack import LinfPGDAttack

os.environ["CUDA_VISIBLE_DEVICES"] = "0"

# Global constants
with open('config.json') as config_file:
    config = json.load(config_file)

num_eval_examples = config['num_eval_examples']
eval_batch_size = config['eval_batch_size']
data_path = config['data_path']
model_dir = config['model_dir']

# Set upd the data, hyperparameters, and the model
flower = flower_input.FlowerData(data_path)

model = Model(mode='eval')

global_step = tf.contrib.framework.get_or_create_global_step()

# Setting up the Tensorboard and checkpoint outputs
if not os.path.exists(model_dir):
    os.makedirs(model_dir)
eval_dir = os.path.join(model_dir, 'eval')
if not os.path.exists(eval_dir):
    os.makedirs(eval_dir)

saver = tf.train.Saver()
summary_writer = tf.summary.FileWriter(eval_dir)
Beispiel #2
0
def dataReader():
    flower = flower_input.FlowerData('data')
    X = flower.eval_data.xs
    y = flower.eval_data.ys
    return X, y.astype(int)