Deep Learning Quick Reference
上QQ阅读APP看书,第一时间看更新

The input layer

As before, our input layer needs to know the dimensions of our dataset. I like to build the entire Keras model inside a function, and allow that function to pass back the compiled model. Right now, this function only takes a single argument, the number of features. The following code is used to define the input layer:

def build_network(input_features=None):
# first we specify an input layer, with a shape == features
inputs = Input(shape=(input_features,), name="input")