Define the input as a tensor with shape input_shape
X_input = Input(input_shape)
What is X_input and Input to which we are passing input shape?? it is not mentioned in the function Resnet50 arguments that we created?
It is a Keras function. We are using TF and Keras here, right? Check the “import” cell at the beginning of the notebook and you can see that Input is one of the TF layer functions that it imports.
There is copious documentation for TF and Keras which google can find for you. Here’s the top hit from “keras input”. Are you feeling lucky today?
Note that input_shape is an argument to the function, of course. Then you feed that to the Input function and the output is an instantiated Tensor, as you learned from the docpage. Of course X_input is just the LHS of an assignment statement in python, so it does not need to be defined a priori. That statement defines it.
Hi thanks for your response! Can you also explain how Con2D(f,s,padding)(inputs) layer takes in the inputs parameter? Like what data structure or method it’s calling in the first parenthesis part
Look at the import cell to see what they imported as Conv2D. You’ll find that it’s a Keras “Layer” function, a subclass of Layer. When you call that function with the parameters you want (shapes, number of filters, padding and so forth), it returns you a function. Then you call that function with a Tensor as input, which is why there are two sets of parentheses. But I see you’ve already seen this thread from ai_curious which goes through all that in detail.
thanks alot for your response I got it