The output layer

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.176.72