-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclassifier.py
More file actions
26 lines (18 loc) · 805 Bytes
/
Copy pathclassifier.py
File metadata and controls
26 lines (18 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#Classifier
#######################################################################
from __future__ import print_function, division
from keras.layers import Input, Dense,Dropout,Softmax
from keras.models import Sequential, Model
#######################################################################
def build_classificationLayer(class_dim=50):
##########################################
features_dim = 2048
in_shape = features_dim
##########################################
model = Sequential()
model.add(Dense(class_dim, activation='softmax', input_shape=(in_shape,),name='LC1'))
model.summary()
##########################################
feature = Input(shape=(features_dim,),name="INC")
classes = model(feature)
return Model(feature, classes)