def keras_model2(num_classes, input_dim): nn_deep_model = OverwrittenSequentialClassifier() nn_deep_model.add(Dense(2500, input_dim=input_dim, activation='relu')) nn_deep_model.add(Dense(2000, activation='relu')) nn_deep_model.add(Dense(1500, activation='relu')) nn_deep_model.add(Dense(num_classes, activation='softmax')) model_optimizer = optimizers.Adam(lr=0.001) nn_deep_model.compile(loss='mean_squared_error', optimizer=model_optimizer, metrics=['accuracy']) return nn_deep_model
def keras_model_1_lr01(num_classes, input_dim): model = OverwrittenSequentialClassifier() model.add(Dense(288, input_dim=input_dim, activation='relu')) model.add(Dense(144, activation='relu')) model.add(Dropout(0.5)) model.add(Dense(12, activation='relu')) model.add(Dense(num_classes, activation='softmax')) model_optimizer = optimizers.Adam(lr=0.1) model.compile(loss='mean_squared_error', optimizer=model_optimizer, metrics=['accuracy']) return model
def keras_model_6_lr1(num_classes, input_dim): nn_deep_model = OverwrittenSequentialClassifier() nn_deep_model.add(Dropout(0.7, input_shape=(input_dim,))) nn_deep_model.add(Dense(1024, activation='relu')) nn_deep_model.add(Dropout(0.5)) nn_deep_model.add(Dense(num_classes, activation='softmax')) model_optimizer = optimizers.Adam(lr=1) nn_deep_model.compile(loss='mean_squared_error', optimizer=model_optimizer, metrics=['accuracy']) return nn_deep_model