Understanding Loss function and Learning Algorithm
Learning Algorithm like SGD or Adam don't have any Loss/cost function associated with them. First You have to build a Model. Then pass the output of the model and target (Your labelled output) to the cost function.Then the cost function will compare the differences in output of target and model and also and calculate the gradient of loss function with respect to parameters.Then it is the optimizer like SGD that will use the gradient from previous step along with a learning rate to update the parameters of model. Cost function and Optimizer are two distince seperate things. You can basically use any cost function (even of your own) in combination with any optimizer.
It is easy to visualize like this:
MODEL ----&gt; LOSS FUNCTION ----&gt; OPTIMIZER