Skip to content

Instantly share code, notes, and snippets.

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

Embed
What would you like to do?
# 2 Boyutlu bir model olusturalim
from keras.models import Sequential
from keras.layers import Conv2D, Dense, Flatten, Dropout, BatchNormalization, MaxPooling2D
def get_model(no_inputs, no_outputs):
m = Sequential()
m.add(Conv2D(32,kernel_size=(5,5),strides=(1,1),activation='relu',input_shape=no_inputs))
m.add(BatchNormalization())
m.add(MaxPooling2D())
m.add(Conv2D(32,kernel_size=(5,5),strides=(1,1),activation='relu'))
m.add(BatchNormalization())
m.add(MaxPooling2D())
m.add(Conv2D(32,kernel_size=(5,5),strides=(1,1),activation='relu'))
m.add(BatchNormalization())
m.add(Conv2D(32,kernel_size=(5,5),strides=(1,1),activation='relu'))
m.add(BatchNormalization())
m.add(Conv2D(32,kernel_size=(5,5),strides=(1,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.