https://stats.stackexchange.com/questions/179026/objective-function-cost-function-loss-function-are-they-the-same-thing
These are not very strict terms and they are highly related. However:
Loss function is usually a function defined on a data point, prediction and label, and measures the penalty. For example:
square loss l(f(xi∣θ),yi)=(f(xi∣θ)−yi)2l(f(x_i|\theta),y_i) = \left (f(x_i|\theta)-y_i \right )^2l(f(xi∣θ),yi)=(f(xi∣θ)−yi)2, used in linear regression
hinge loss l(f(xi∣θ),yi)=max(0,1−f(xi∣θ)yi)l(f(x_i|\theta), y_i) = \max(0, 1-f(x_i|\theta)y_i)l(f(xi∣θ),yi)=max(0,1−f(xi∣θ)yi), used in SVM
0/1 loss l(f(xi∣θ),yi)=1 ⟺ f(xi∣θ)≠yil(f(x_i|\theta), y_i) = 1 \iff f(x_i|\theta) \neq y_il(f(xi∣θ),yi)=1⟺f(xi∣θ)=yi, used in theoretical analysis and definition of accuracy
Cost function is usually more general. It might be a sum of loss functions over your training set plus some model complexity penalty (regularization). For example:
Mean Squared Error MSE(θ)=1N∑i=1N(f(xi∣θ)−yi)2MSE(\theta) = \frac{1}{N} \sum_{i=1}^N \left (f(x_i|\theta)-y_i \right )^2MSE(θ)=N1∑i=1N(f(xi∣θ)−yi)2
SVM cost function SVM(θ)=∥θ∥2+C∑i=1NξiSVM(\theta) = \|\theta\|^2 + C \sum_{i=1}^N \xi_iSVM(θ)=∥θ∥2+C∑i=1Nξi (there are additional constraints connecting ξi\xi_iξi with CCC and with training set)
Objective function is the most general term for any function that you optimize during training. For example, a probability of generating training set in maximum likelihood approach is a well defined objective function, but it is not a loss function nor cost function (however you could define an equivalent cost function). For example:
MLE is a type of objective function (which you maximize)
Divergence between classes can be an objective function but it is barely a cost function, unless you define something artificial, like 1-Divergence, and name it a cost
Long story short, I would say that:
A loss function is a part of a cost function which is a type of an objective function.