‫So in this video we will see how functional EPA can help us build complex neural network architectures.
‫They know we have been building simple architectures that as input goes into foster and layer which
‫goes in two seconds to deliver the output of which goes into the final output layer.
‫Now we're slightly modified this architecture will take this input and merged with the output of it
‫and led to that is will create an additional concatenation layer where the output of the layer too will
‫be there and the input layer will also be added here.
‫So in the contract layer we will have 64 values from different layer two because it has 64 units of
‫neurons and 13 values from the input layer because we have 13 variables.
‫So in the concatenation layer we have seventy seven values which will be imported into our final output
‫layer which has a single layer on.
‫So this kind of architecture is called deep and wide architecture.
‫And this architecture cannot be built using a sequentially be a
‫this is where functionally B is used.
‫Now let's go back to our to do
‫now let's see how we can create that architecture using functional Libya.
‫The first step is same.
‫We have to define the input layer input layer has those 13 variables only so we define the input layer
‫with a shape of 13 variables.
‫The first production layer has only two layers after which will come the concatenation layer.
‫So in the first prediction layer we keep the two hidden layers.
‫We specified that this layer has the input from inputs Splunk.
‫This is the rebel that we define for input layer.
‫Then we have to put the layers after these two hidden layers.
‫We need a concatenation layer in this layer.
‫The output of this
‫first output layer will be concatenated with the initial input layer.
‫To How do we do that.
‫We create this new layer mean output in this we concatenate these two parts.
‫The first part is the prediction func.
‫This includes these three layers and we also add the input func which is this input layer.
‫So these do not become the input layer of this main output and this goes into the last layer which is
‫a dense single unit output layer.
‫I hope you understand the architecture that we have defined here.
‫We have this input layer this is we what we stored in input func then we created predictions func which
‫contained the two layers.
‫Then we create main output structure in which we take the output of this prediction func and the input
‫layer and we concatenated to create a can get layer after which we put a output layer of one single
‫neuron.
‫So all this is done in this part.
‫You can notice here that inputs layer has been used twice.
‫This has been made possible because in functional API we are having each layer as individual part of
‫the structure so we can use those parts many times in the structure.
‫So this input func became a part of the predictions one variable also.
‫And it became part of the main output structure also so next on this
‫and now we will define the architecture of our model using kid US model function in which we will call
‫the inputs are the inputs funk and output is to be taken from the main output structure because this
‫structure has everything it has predictions func also an input Fung also as a concatenated layer in
‫IT structure.
‫When we done this we have model form ready with us is a dysfunctional API model and it has that complex
‫architecture stored in it.
‫Now we can figure this model again we will use outermost properties optimizer lost is messy and the
‫matrix to be recorded is mean absolute error
‫you can see the structure of this model func also using this somebody come on man and on this you can
‫see here that the first layer is the input layer with 13 variables then comes a dense 64 neutron layer
‫which is decoding Layer 1 it is connected to the input layer then comes another dense layer which tells
‫sixty 64 neurons and it is connected to firstly the layer after this we have a concatenation layer in
‫which we can get energy the output of this dense layer with the 13 variables from input.
‫So this concatenation layer is connected to layer 2 and the input layer
‫then we have the last layer which is the output layer which has only one neuron and it is connected
‫to the concatenation.
‫Now we can bring this model using different function
‫and we can compare the best performance of our normal model with a normal deep architecture.
‫What is this complex functional model with wide and deep architecture.
‫So let's run these command
‫to see that the functional model that is the complex model has a test loss of twenty nine whereas a
‫normal model has had a test loss of thirty two.
‫Similarly they mean absolute error for our functional model that is this complex model that we have
‫created is four point three.
‫Whereas the mean absolute better for the simple model that we created earlier was four point forty seven.
‫So there is slight improvement on both of these parameters.
‫Now you have seen how to use functional API to create complex neural network architecture because functional
‫API enables us to use several layers or several structures multiple times.
‫Also in that example this time we solve the immigration problem.
‫The few differences that we have integration problem is instead of using accuracy.
‫We were using MSE
‫for the lost function and the metric we were observing integration problem was mean absolute.
‫Edit in the architecture of integration problem the output layer has no activation function.
‫So with this we conclude our lecture on functional API and regression problems.