Skip to content
Snippets Groups Projects
Commit ef55d552 authored by Hashim Sharif's avatar Hashim Sharif
Browse files

removing unused code from AlexNet Keras script

parent 7b244d48
No related branches found
No related tags found
No related merge requests found
...@@ -27,9 +27,6 @@ from frontend.weight_utils import dumpHPVMToKerasModel ...@@ -27,9 +27,6 @@ from frontend.weight_utils import dumpHPVMToKerasModel
class AlexNet(Benchmark): class AlexNet(Benchmark):
#def __init__(self):
# self.name = "AlexNet"
def lr_schedule(self, epoch): def lr_schedule(self, epoch):
...@@ -82,35 +79,6 @@ class AlexNet(Benchmark): ...@@ -82,35 +79,6 @@ class AlexNet(Benchmark):
def buildModel_old():
model = Sequential()
model.add(Conv2D(128, kernel_size=(3, 3), activation='tanh', input_shape=(3, 32, 32), padding = 'same'))
model.add(Conv2D(256, kernel_size=(3, 3), activation='tanh', padding = 'same'))
model.add(MaxPooling2D(pool_size=(2, 2)))
#model.add(Dropout(0.25))
model.add(Conv2D(256, kernel_size=(3, 3), activation='tanh', padding = 'same'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(256, kernel_size=(3, 3), activation='tanh', padding = 'same'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(256, kernel_size=(3, 3), activation='tanh', padding = 'same'))
model.add(MaxPooling2D(pool_size=(2, 2)))
#model.add(Dropout(0.25))
model.add(Flatten())
#model.add(Flatten())
model.add(Dense(4096, activation='tanh'))
#model.add(Dropout(0.5))
model.add(Dense(2048, activation='tanh'))
model.add(Dense(10, activation='tanh'))
model.add(Activation('softmax'))
return model
def trainModel(self, model): def trainModel(self, model):
...@@ -168,16 +136,6 @@ class AlexNet(Benchmark): ...@@ -168,16 +136,6 @@ class AlexNet(Benchmark):
def reloadKerasModel(model_path):
model = load_model(model_path)
score = model.evaluate(X_test, to_categorical(Y_test, 10), verbose=0)
print('Test loss2:', score[0])
print('Test accuracy2:', score[1])
def data_preprocess(self): def data_preprocess(self):
(X_train, Y_train), (X_test, Y_test) = cifar10.load_data() (X_train, Y_train), (X_test, Y_test) = cifar10.load_data()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment