Skip to content

Instantly share code, notes, and snippets.

@Akaame Akaame/ecs50_model.py
Last active Feb 4, 2018

Embed
What would you like to do?
# Keras modelimizi olusturalim
from keras.models import Sequential
from keras.layers import Dense, Flatten, Dropout, Conv1D, BatchNormalization
def get_model(no_inputs, no_outputs):
m = Sequential()
m.add(Conv1D(32,kernel_size=(5,),strides=(1,),activation='relu',input_shape=no_inputs))
m.add(BatchNormalization())
m.add(Conv1D(32,kernel_size=(5,),strides=(1,),activation='relu'))
m.add(BatchNormalization())
m.add(Conv1D(32,kernel_size=(5,),strides=(1,),activation='relu'))
m.add(BatchNormalization())
m.add(Flatten())
m.add(Dense(256,activation='relu'))
m.add(Dropout(0.2))
m.add(Dense(no_outputs, activation="softmax"))
return m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.