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
// nb_val_samples=testX.shape[0], verbose=2)
yPreds = model.predict(testX)
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: 5
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: yahoo/TensorFlowOnSpark
Commit Name: 981e4266d4ea816b08a762193bd52f40cd1a3242
Time: 2019-08-07
Author: leewyang@verizonmedia.com
File Name: examples/mnist/keras/mnist_inference.py
Class Name:
Method Name: inference
Project Name: chuyangliu/snake
Commit Name: 1226a2eee68336240a35fce9678320ca9430584f
Time: 2018-01-06
Author: chuyang.s.liu@gmail.com
File Name: snake/solver/dqn.py
Class Name: DQNSolver
Method Name: __choose_action