Doubt Regarding the activation function

Why do we use 2 activation functions in this sentiment analyzer? Cant we do it using only sigmoid function or only using relu function?

hey @Sid10 ,
while building a neural network , you need to understand and examine what input you need to provide to each layer as it will defines the information your network will learn from your actual input and along with it you need to also keep in mind about the final output as it is the one based over which your network will update itself to learn things more accurately as requried.
Keeping these things in mind , we use different activation functions between the layers and for final output layer.
There is no such rule that you need to use these different activation functions only , you can use relu in the final output or any else ,but keep in mind what your actual should be .
Just an example , you are performing a classification problem with final output as sigmoid function ( probability between 0-1 ) so , you can use a relu function as it also changes your values in between 0-1 . But if the output is 1 , your function can move your prediction towards 0 , like 0.3256.
So with this i dont think your model will perform the task for which it is made so.

Just an example , when you go to store you search for the thing you need to buy , not the thing you just free after entering.
Similarly, sigmoid or softmax functions work accordingly as required for a classification task , not just simply like a linear or tanh or relu function.

I hope this would have helped you understand it.
Thank You and Happy Learning :slightly_smiling_face:.