March 2018
Intermediate to advanced
272 pages
7h 53m
English
And finally, we need an output layer for our network. We will use the following code to define our output layer:
prediction = Dense(1, activation='sigmoid', name="final")(x)
We're building a binary classifier in this example, so we want our network to output the probability the observation belongs to class 1. Luckily, the sigmoid activation will do exactly that, constraining the network output to be between 0 and 1.