Skip to content

Instantly share code, notes, and snippets.

@FirefoxMetzger
Last active April 1, 2018 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FirefoxMetzger/44e9e056e45c1a3cc8000ab8d6f2cebe to your computer and use it in GitHub Desktop.
Save FirefoxMetzger/44e9e056e45c1a3cc8000ab8d6f2cebe to your computer and use it in GitHub Desktop.
Comparing two small networks using dense layers. According to Keras' documentation both should be identical
from keras.models import Sequential
from keras.layers import Dense, Flatten
model1 = Sequential()
model1.add(Dense(1, input_shape=(10,10)))
model2 = Sequential()
model2.add(Flatten(input_shape=(10,10)))
model2.add(Dense(1))
# compare the two models
model1.summary()
model2.summary()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment