{
  "id": 325060,
  "title": "Different training errors",
  "url": "/competitions/digit-recognizer/discussion/325060",
  "author_name": "Priya Nagda",
  "post_date": "2022-05-14T16:20:39.693000",
  "votes": 0,
  "comment_count": 0,
  "views": null,
  "content": "<p>Hey! </p>\n<pre><code>torch.manual_seed(42)\nnp.random.seed(42)\ntorch.cuda.manual_seed_all(42)\n</code></pre>\n<p>I have added seed, yet the training loss calculated is different. <br>\nOn simply running the notebook in the interactive session, the following results are obtained:</p>\n<pre><code>tensor(80.2275, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\ntensor(78.8915, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\ntensor(78.3216, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\n</code></pre>\n<p>When I submit the notebook, the following are the results:</p>\n<pre><code>141.2s    2   tensor(215.4603, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\n253.8s    3   tensor(200.4137, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\n367.4s    4   tensor(199.1156, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\n480.2s    5   tensor(198.2755, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\n</code></pre>\n<p>What am I missing?</p>",
  "messages": [
    {
      "id": 1790210,
      "postDate": "2022-05-14T16:20:39.693Z",
      "content": "<p>Hey! </p>\n<pre><code>torch.manual_seed(42)\nnp.random.seed(42)\ntorch.cuda.manual_seed_all(42)\n</code></pre>\n<p>I have added seed, yet the training loss calculated is different. <br>\nOn simply running the notebook in the interactive session, the following results are obtained:</p>\n<pre><code>tensor(80.2275, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\ntensor(78.8915, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\ntensor(78.3216, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\n</code></pre>\n<p>When I submit the notebook, the following are the results:</p>\n<pre><code>141.2s    2   tensor(215.4603, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\n253.8s    3   tensor(200.4137, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\n367.4s    4   tensor(199.1156, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\n480.2s    5   tensor(198.2755, device='cuda:0', grad_fn=&lt;AddBackward0&gt;)\n</code></pre>\n<p>What am I missing?</p>",
      "rawMarkdown": "Hey! \n```\ntorch.manual_seed(42)\nnp.random.seed(42)\ntorch.cuda.manual_seed_all(42)\n```\nI have added seed, yet the training loss calculated is different. \nOn simply running the notebook in the interactive session, the following results are obtained:\n```\ntensor(80.2275, device='cuda:0', grad_fn=<AddBackward0>)\ntensor(78.8915, device='cuda:0', grad_fn=<AddBackward0>)\ntensor(78.3216, device='cuda:0', grad_fn=<AddBackward0>)\n```\n\nWhen I submit the notebook, the following are the results:\n```\n141.2s\t2\ttensor(215.4603, device='cuda:0', grad_fn=<AddBackward0>)\n253.8s\t3\ttensor(200.4137, device='cuda:0', grad_fn=<AddBackward0>)\n367.4s\t4\ttensor(199.1156, device='cuda:0', grad_fn=<AddBackward0>)\n480.2s\t5\ttensor(198.2755, device='cuda:0', grad_fn=<AddBackward0>)\n```\n\nWhat am I missing?"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1790210": "Hey! \n```\ntorch.manual_seed(42)\nnp.random.seed(42)\ntorch.cuda.manual_seed_all(42)\n```\nI have added seed, yet the training loss calculated is different. \nOn simply running the notebook in the interactive session, the following results are obtained:\n```\ntensor(80.2275, device='cuda:0', grad_fn=<AddBackward0>)\ntensor(78.8915, device='cuda:0', grad_fn=<AddBackward0>)\ntensor(78.3216, device='cuda:0', grad_fn=<AddBackward0>)\n```\n\nWhen I submit the notebook, the following are the results:\n```\n141.2s\t2\ttensor(215.4603, device='cuda:0', grad_fn=<AddBackward0>)\n253.8s\t3\ttensor(200.4137, device='cuda:0', grad_fn=<AddBackward0>)\n367.4s\t4\ttensor(199.1156, device='cuda:0', grad_fn=<AddBackward0>)\n480.2s\t5\ttensor(198.2755, device='cuda:0', grad_fn=<AddBackward0>)\n```\n\nWhat am I missing?"
  }
}