Sir in the code snippet of Dense Residual in Slide there is a class which inherits Layer class but then why we did not add build method in it as we did in Custom Layers
Residual network in Tensorflow advance Techniques
Hello Divyanshu,
Your question is a bit unclear. Can you share the snippet you want to compare with and have doubt with, so others can understand and explain with a proper reasoning.
Regards
DP
Build method will run when your instance is created, we will use this method to specify our local input states.
Actually, the build method is not mandatory for the custom layer. It can optionally be used to define a custom layer class to create a layer’s weight for the first time. If the shape of the input tensor is known, can define the layer’s weight at initialization, then we can ignore the build method. But to create layers dynamically we can use the build method. This is useful when the layer’s shape depends on the shape of inputs, and allows more flexibility in constructing the layer. Also, the build method advantage is that it enables late variable creation based on the shape of the input the layer will operate on.
Regards
Arif
Can you share the link to the slides?