Cosine Similarity Measure According to a Convex Cost Function
This provides a theoretical extension of cosine similarity for specialized applications in machine learning, but it is incremental as it builds on existing convex optimization concepts.
The authors introduced a new vector similarity measure based on the angle between surface normals of a convex cost function, applicable to functions like negative entropy and total variation, even when non-differentiable, using gradients or subgradients.
In this paper, we describe a new vector similarity measure associated with a convex cost function. Given two vectors, we determine the surface normals of the convex function at the vectors. The angle between the two surface normals is the similarity measure. Convex cost function can be the negative entropy function, total variation (TV) function and filtered variation function. The convex cost function need not be differentiable everywhere. In general, we need to compute the gradient of the cost function to compute the surface normals. If the gradient does not exist at a given vector, it is possible to use the subgradients and the normal producing the smallest angle between the two vectors is used to compute the similarity measure.