1# The Keras functional API is a lot more flexible than the Sequential API
2from keras.models import Model
3from keras.layers import Input
4from keras.layers import Dense
5
6# Declared the input layer with input shape 2
7visible = Input(shape=(2,))
8# Fed the output of the input layer into a hidden layer of size 2
9hidden = Dense(2)(visible)
10# Defined an actual model out of the above with an output being the same shape as the above layer and input being the size as the input layer
11model = Model(inputs=visible, outputs=hidden)
12