{
  "id": 17825,
  "title": "Beating the Benchmark",
  "url": "/competitions/face-verification2/discussion/17825",
  "author_name": "Heikki Huttunen",
  "post_date": "2015-12-10T20:10:51.323000",
  "votes": 0,
  "comment_count": 0,
  "views": 286,
  "content": "<p>For those struggling with the submission:\nHere's a simple trick to get you above the benchmark:</p>\n\n<ol>\n<li>Load the sample code (Matlab or Python) from the first forum thread.</li>\n<li><p>Find the distance calculation part that now looks like this in Matlab version:</p>\n\n<blockquote>\n  <p>deepfeatures_difference = deepfeatures_1 - deepfeatures_2;</p>\n  \n  <p>deepfeatures_distance = sqrt(sum(deepfeatures_difference .^ 2));</p>\n</blockquote></li>\n<li><p>Change the computation such that it is done separately for two parts (separately for first 2048 numbers and separately for last 2048):</p></li>\n</ol>\n\n<blockquote>\n<pre><code>dist1 = norm(deepfeatures_1(1:end/2) - deepfeatures_2(1:end/2));\ndist2 = norm(deepfeatures_1(end/2+1:end) - deepfeatures_2(end/2+1:end));\ndeepfeatures_distance = dist1 + dist2;\n</code></pre>\n</blockquote>\n\n<p>In fact, it seems that splitting the vectors to even more parts before computing the norm is even better.</p>",
  "messages": [
    {
      "id": 100820,
      "postDate": "2015-12-10T20:10:51.323Z",
      "content": "<p>For those struggling with the submission:\nHere's a simple trick to get you above the benchmark:</p>\n\n<ol>\n<li>Load the sample code (Matlab or Python) from the first forum thread.</li>\n<li><p>Find the distance calculation part that now looks like this in Matlab version:</p>\n\n<blockquote>\n  <p>deepfeatures_difference = deepfeatures_1 - deepfeatures_2;</p>\n  \n  <p>deepfeatures_distance = sqrt(sum(deepfeatures_difference .^ 2));</p>\n</blockquote></li>\n<li><p>Change the computation such that it is done separately for two parts (separately for first 2048 numbers and separately for last 2048):</p></li>\n</ol>\n\n<blockquote>\n<pre><code>dist1 = norm(deepfeatures_1(1:end/2) - deepfeatures_2(1:end/2));\ndist2 = norm(deepfeatures_1(end/2+1:end) - deepfeatures_2(end/2+1:end));\ndeepfeatures_distance = dist1 + dist2;\n</code></pre>\n</blockquote>\n\n<p>In fact, it seems that splitting the vectors to even more parts before computing the norm is even better.</p>",
      "rawMarkdown": "For those struggling with the submission:\r\nHere's a simple trick to get you above the benchmark:\r\n\r\n 1. Load the sample code (Matlab or Python) from the first forum thread.\r\n 2. Find the distance calculation part that now looks like this in Matlab version:\r\n\r\n    > deepfeatures_difference = deepfeatures_1 - deepfeatures_2;\r\n\r\n    > deepfeatures_distance = sqrt(sum(deepfeatures_difference .^ 2));\r\n\r\n 3. Change the computation such that it is done separately for two parts (separately for first 2048 numbers and separately for last 2048):\r\n\r\n>     dist1 = norm(deepfeatures_1(1:end/2) - deepfeatures_2(1:end/2));\r\n>     dist2 = norm(deepfeatures_1(end/2+1:end) - deepfeatures_2(end/2+1:end));\r\n>     deepfeatures_distance = dist1 + dist2;\r\n\r\nIn fact, it seems that splitting the vectors to even more parts before computing the norm is even better.\r\n\r\n \r\n"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "100820": "For those struggling with the submission:\r\nHere's a simple trick to get you above the benchmark:\r\n\r\n 1. Load the sample code (Matlab or Python) from the first forum thread.\r\n 2. Find the distance calculation part that now looks like this in Matlab version:\r\n\r\n    > deepfeatures_difference = deepfeatures_1 - deepfeatures_2;\r\n\r\n    > deepfeatures_distance = sqrt(sum(deepfeatures_difference .^ 2));\r\n\r\n 3. Change the computation such that it is done separately for two parts (separately for first 2048 numbers and separately for last 2048):\r\n\r\n>     dist1 = norm(deepfeatures_1(1:end/2) - deepfeatures_2(1:end/2));\r\n>     dist2 = norm(deepfeatures_1(end/2+1:end) - deepfeatures_2(end/2+1:end));\r\n>     deepfeatures_distance = dist1 + dist2;\r\n\r\nIn fact, it seems that splitting the vectors to even more parts before computing the norm is even better.\r\n\r\n \r\n"
  }
}