afef503d34919fb2febc0b475085f140e1a4e977,ann_architectures/cifar10/cnn.py,,,#,24

Before Change


    // Fit the model on the batches generated by datagen.flow()
    history = model.fit_generator(
        datagen.flow(X_train, Y_train, batch_size=batch_size),
        samples_per_epoch=X_train.shape[0], validation_data=(X_test, Y_test),
        nb_epoch=nb_epoch)

plot_history(history)

After Change



    trainflow = traingen.flow(X_train, Y_train, batch_size=batch_size)

    testgen = ImageDataGenerator(featurewise_center=gcn,
                                 featurewise_std_normalization=gcn,
                                 zca_whitening=zca)

    testgen.fit(X_test)

    testflow = testgen.flow(X_test, Y_test, batch_size=batch_size)

    // Fit the model on the batches generated by datagen.flow()
    history = model.fit_generator(trainflow, nb_epoch=nb_epoch,
                                  samples_per_epoch=len(X_train),
                                  validation_data=testflow,
                                  nb_val_samples=len(X_test))

plot_history(history)

score = model.evaluate_generator(testflow, val_samples=len(X_test))
print("Test score:", score[0])
print("Test accuracy:", score[1])

model.save("{:2.2f}.h5".format(score[1]*100))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: NeuromorphicProcessorProject/snn_toolbox
Commit Name: afef503d34919fb2febc0b475085f140e1a4e977
Time: 2016-08-31
Author: bodo.rueckauer@gmail.com
File Name: ann_architectures/cifar10/cnn.py
Class Name:
Method Name:


Project Name: tensorflow/tpu
Commit Name: 6fba896139f58be395742137385ccf5c72ec7416
Time: 2018-08-24
Author: xiejw0217@gmail.com
File Name: models/experimental/keras/resnet50.py
Class Name:
Method Name: main


Project Name: NeuromorphicProcessorProject/snn_toolbox
Commit Name: afef503d34919fb2febc0b475085f140e1a4e977
Time: 2016-08-31
Author: bodo.rueckauer@gmail.com
File Name: ann_architectures/cifar10/alexnet.py
Class Name:
Method Name: