Search code examples
machine-learningdeep-learningartificial-intelligencecosine-similarity

Can cosine similarity be objective function for deep learning?


I want to train an output vector(which is from deep learning model) like fixed vector. Hence, I chose a cosine similarity between two vectors as the objective function. However, I don't know if that is a correct approach for my need.


Solution

  • No. The cosine similarity is a measure of how similar two items (samples in your dataset) are.

    In contrast, the objective function when training a neural network should be a definition of the current estimation error over the data - so they are different things.