Skip to content

Commit b184c76

Browse files
committed
Update docs
1 parent 065fb2a commit b184c76

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

docs/templates/applications.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,15 @@ block4_pool_features = model.predict(x)
8484
from keras.applications.inception_v3 import InceptionV3
8585
from keras.preprocessing import image
8686
from keras.models import Model
87-
from keras.layers import Dense, Lambda
87+
from keras.layers import Dense, GlobalAveragePooling2D
8888
from keras import backend as K
8989

9090
# create the base pre-trained model
9191
base_model = InceptionV3(weights='imagenet', include_top=False)
9292

9393
# add a global spatial average pooling layer
9494
x = base_model.output
95-
x = Lambda(lambda x: K.mean(x, axis=[1, 2]))(x) # assuming 'tf' dim ordering
96-
# note that if you are using Theano instead of TensorFlow as your backend,
97-
# you will need to pass an output_shape argument to your Lambda layer, e.g.:
98-
# x = Lambda(lambda x: K.mean(x, axis=[1, 2]), output_shape=lambda x: (x[0], x[-1]))(x)
99-
# this is because Theano doesn't do offline shape inference like TensorFlow does.
100-
95+
x = GlobalAveragePooling2D()(x)
10196
# let's add a fully-connected layer
10297
x = Dense(1024, activation='relu')(x)
10398
# and a logistic layer -- let's say we have 200 classes

0 commit comments

Comments
 (0)