516c2a4c7e8f92e1ea299e966215c2ffe4c5b980,cifar10.py,,,#,14
Before Change
generator.fit(trainX, seed=0, augment=True)
test_generator = ImageDataGenerator(featurewise_center=True,
featurewise_std_normalization=True)
test_generator.fit(testX, augment=True, seed=0)
// Load model
model.load_weights("weights/DenseNet-40-12-CIFAR10.h5")
print("Model loaded.")
model.fit_generator(generator.flow(trainX, Y_train, batch_size=batch_size), samples_per_epoch=len(trainX), nb_epoch=nb_epoch,
callbacks=[ModelCheckpoint("weights/DenseNet-40-12-CIFAR10.h5", monitor="val_acc", save_best_only=True,
save_weights_only=True)],
validation_data=test_generator.flow(testX, testY, batch_size=batch_size),
nb_val_samples=testX.shape[0], verbose=1)
scores = model.evaluate_generator(test_generator.flow(testX, testY, nb_epoch), testX.shape[0])
print("Accuracy = %f" % (100 * scores[1]))
print("Error = %f" % (100 - 100 * scores[1]))
After Change
yPred = np.argmax(yPreds, axis=1)
yTrue = testY
accuracy = metrics.accuracy_score(yTrue, yPred) * 100
error = 100 - accuracy
print("Accuracy : ", accuracy)
print("Error : ", error)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: titu1994/DenseNet
Commit Name: 516c2a4c7e8f92e1ea299e966215c2ffe4c5b980
Time: 2016-12-07
Author: titu1994@gmail.com
File Name: cifar10.py
Class Name:
Method Name:
Project Name: osmr/imgclsmob
Commit Name: 09e4a76102ff4a06a835180237ea171eb475985c
Time: 2018-09-19
Author: osemery@gmail.com
File Name: keras_/models/mobilenet.py
Class Name:
Method Name: _test
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 46ad98c1b619502c926c657c1a4c4276d2fd1f79
Time: 2018-05-01
Author: Maria-Irina.Nicolae@ibm.com
File Name: art/defences/adversarial_trainer_unittest.py
Class Name: TestAdversarialTrainer
Method Name: test_shared_model_mnist