Commit 940cdc07 authored by Naundorf's avatar Naundorf
Browse files

Update KI-KNN

parent 4b17b010
Pipeline #6557 failed with stage
in 2 minutes and 20 seconds
......@@ -23,16 +23,12 @@ def train_test_data_split(X, y):
return X_train, X_test, y_train, y_test
# creating a model
def create_and_compile_model():
print("Creating a Model")
from keras.models import Sequential
from keras.layers import Conv2D, Dense, MaxPooling2D, Dropout, Flatten,
BatchNormalization
from keras.layers import Conv2D, Dense, MaxPooling2D, Dropout, Flatten, BatchNormalization
model = models.Sequential()
model.add(Conv2D(32, kernel_size=(3, 3), activation="relu",
input_shape=(constants.N_FEATURE, constants.FEATURE_MAX_LEN,
constants.CHANNELS)))
model.add(Conv2D(32, kernel_size=(3, 3), activation="relu", input_shape=(constants.N_FEATURE, constants.FEATURE_MAX_LEN, constants.CHANNELS)))
model.add(Conv2D(32, kernel_size=(3, 3), activation="relu"))
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Conv2D(64, kernel_size=(3, 3), activation="relu"))
......@@ -43,8 +39,7 @@ constants.CHANNELS)))
model.add(Dense(constants.OUTPUT_LAYER_DIMENSIONS, activation='softmax'))
print("Compiling a Model")
optimizer = keras.optimizers.RMSprop()
model.compile(optimizer=optimizer, loss=constants.LOSS_FUNCTION_SPARSE,
metrics=[constants.ACCURACY_METRICS])
model.compile(optimizer=optimizer, loss=constants.LOSS_FUNCTION_SPARSE, metrics=[constants.ACCURACY_METRICS])
print(model.summary())
return model
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment