{
  "id": 267572,
  "title": "How to convert cosine similarities to probabilities?",
  "url": "/competitions/landmark-recognition-2021/discussion/267572",
  "author_name": "",
  "post_date": "2021-08-23T20:37:29.648219300Z",
  "votes": null,
  "comment_count": 1,
  "views": 0,
  "content": "<p>I have an array representing cosine similarities of classes as the output of my model.<br>\nIt's ranged in ≈ [-0.35, 0.8]  and always has a negative sum.<br>\nWhen I'm just taking max of this array as a confidence, my model with 0.83 CV gets only 0.105 on LB.<br>\nHow can I convert it to the probabilities (array ranged between 0 and 1 and with the sum=1)?</p>",
  "messages": [
    {
      "id": "1487795",
      "postDate": "08/23/2021 20:37:29",
      "content": "<p>I have an array representing cosine similarities of classes as the output of my model.<br>\nIt's ranged in ≈ [-0.35, 0.8]  and always has a negative sum.<br>\nWhen I'm just taking max of this array as a confidence, my model with 0.83 CV gets only 0.105 on LB.<br>\nHow can I convert it to the probabilities (array ranged between 0 and 1 and with the sum=1)?</p>",
      "rawMarkdown": "I have an array representing cosine similarities of classes as the output of my model.\nIt's ranged in ≈ [-0.35, 0.8]  and always has a negative sum.\nWhen I'm just taking max of this array as a confidence, my model with 0.83 CV gets only 0.105 on LB.\nHow can I convert it to the probabilities (array ranged between 0 and 1 and with the sum=1)?",
      "votes": null
    },
    {
      "id": "1494703",
      "postDate": "08/29/2021 02:02:57",
      "content": "<p>If you want to convert your values to [0,1] range with 1 sum you can just use <code>SoftMax</code> function</p>",
      "rawMarkdown": "If you want to convert your values to [0,1] range with 1 sum you can just use `SoftMax` function",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1494703,
      "author_name": "podidiving",
      "author_url": "",
      "post_date": "08/29/2021 02:02:57",
      "content": "<p>If you want to convert your values to [0,1] range with 1 sum you can just use <code>SoftMax</code> function</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1487795": "I have an array representing cosine similarities of classes as the output of my model.\nIt's ranged in ≈ [-0.35, 0.8]  and always has a negative sum.\nWhen I'm just taking max of this array as a confidence, my model with 0.83 CV gets only 0.105 on LB.\nHow can I convert it to the probabilities (array ranged between 0 and 1 and with the sum=1)?",
    "1494703": "If you want to convert your values to [0,1] range with 1 sum you can just use `SoftMax` function"
  },
  "source": "meta"
}