getting started with neural networks output (probabilitydense (units= dense (units= dense (units= sequential input (vectorized textfigure the hree-layer net work figure shows what the network looks like and here' the keras implementationsimilar to the mnist example you saw previously listing the model definit ion from keras import models from keras import layers model models sequential(model add(layers dense( activation='relu'input_shape=( ,))model add(layers dense( activation='relu')model add(layers dense( activation='sigmoid')what are act ivation functionsand why are they necessarywithout an activation function like relu (also called non-linearity)the dense layer would consist of two linear operations-- dot product and an additionoutput dot(winputb so the layer could only learn linear transformations (affine transformationsof the input datathe hypothesis space of the layer would be the set of all possible linear transformations of the input data into -dimensional space such hypothesis space is too restricted and wouldn' benefit from multiple layers of representationsbecause deep stack of linear layers would still implement linear operationadding more layers wouldn' extend the hypothesis space in order to get access to much richer hypothesis space that would benefit from deep representationsyou need non-linearityor activation function relu is the most popular activation function in deep learningbut there are many other candidateswhich all come with similarly strange namesprelueluand so on finallyyou need to choose loss function and an optimizer because you're facing binary classification problem and the output of your network is probability (you end your network with single-unit layer with sigmoid activation)it' best to use the licensed to