3
$\begingroup$

In the case of a neural network,are there different cost functions for different hidden layers? or is there one cost function for the final layer ? For example, in the neural network, the hidden layer has sigmoid and Relu activations, and the output layer has linear activation. So, Will the cost function be MSE depending on the final output layer's activation? or Will there be different cost function for different layer- hidden Cost function log loss for sigmoid activation in hidden layer ?

$\endgroup$
0

1 Answer 1

8
$\begingroup$

Is there hidden cost function for hidden layer in the neural network?

Nearly all neural networks have loss functions only at the final layer. All weights and biases are updated by using , which computes the loss on the final layer and uses the gradient of the loss wrt the weights and biases to adjust them.

The exceptions to this are explicit about having auxiliary loss functions sprinkled throughout, but this is a very specialized case. There are several examples in What is auxiliary loss as mentioned in PSPNet paper. These include:

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.