Avoid computing self-similarity while calculating cosine average