Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 147512,7 "name": "Juna",8 "username": "Juna",9 "avatar_template": "/user_avatar/discuss.pytorch.org/juna/{size}/15142_2.png",10 "created_at": "2019-11-20T14:45:12.266Z",11 "cooked": "<p>Hi<br>\nI get this caution when I use random seed.</p>\n<p>UserWarning: You have chosen to seed training. This will turn on the CUDNN deterministic setting, which can slow down your training considerably! You may see unexpected behavior when restarting from checkpoints.</p>\n<p>What I want to do is to get some multiple outputs with the model I get after training with a random seed.<br>\nPlus I want to save the model first before I get multiple outputs.</p>\n<ol>\n<li>Should I use the same random seed when I get the outputs?</li>\n<li>If I should, then is this the only thing I should do?</li>\n<li>With the answers to the above questions, can I get the same outputs whenever I use the same input? (e.g. the outputs I get with the same input and the same model but multiple times)</li>\n</ol>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 4,15 "updated_at": "2019-11-20T14:45:12.266Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 217,20 "reads": 18,21 "readers_count": 17,22 "score": 1088.6,23 "yours": false,24 "topic_id": 61623,25 "topic_slug": "random-seed-caution",26 "display_username": "Juna",27 "primary_group_name": null,28 "flair_name": null,29 "flair_url": null,30 "flair_bg_color": null,31 "flair_color": null,32 "flair_group_id": null,33 "badges_granted": [],34 "version": 1,35 "can_edit": false,36 "can_delete": false,37 "can_recover": false,38 "can_see_hidden_post": false,39 "can_wiki": false,40 "read": true,41 "user_title": null,42 "bookmarked": false,43 "actions_summary": [],44 "moderator": false,45 "admin": false,46 "staff": false,47 "user_id": 11833,48 "hidden": false,49 "trust_level": 1,50 "deleted_at": null,51 "user_deleted": false,52 "edit_reason": null,53 "can_view_edit_history": true,54 "wiki": false,55 "post_url": "/t/random-seed-caution/61623/1",56 "can_accept_answer": false,57 "can_unaccept_answer": false,58 "accepted_answer": false,59 "topic_accepted_answer": null,60 "can_vote": false61 },62 {63 "id": 147513,64 "name": "Juna",65 "username": "Juna",66 "avatar_template": "/user_avatar/discuss.pytorch.org/juna/{size}/15142_2.png",67 "created_at": "2019-11-20T14:46:37.819Z",68 "cooked": "<p>By the way, I used the imagenet classifier example in pytorch github tutorial.</p>",69 "post_number": 2,70 "post_type": 1,71 "posts_count": 4,72 "updated_at": "2019-11-20T14:46:37.819Z",73 "reply_count": 1,74 "reply_to_post_number": null,75 "quote_count": 0,76 "incoming_link_count": 5,77 "reads": 18,78 "readers_count": 17,79 "score": 33.6,80 "yours": false,81 "topic_id": 61623,82 "topic_slug": "random-seed-caution",83 "display_username": "Juna",84 "primary_group_name": null,85 "flair_name": null,86 "flair_url": null,87 "flair_bg_color": null,88 "flair_color": null,89 "flair_group_id": null,90 "badges_granted": [],91 "version": 1,92 "can_edit": false,93 "can_delete": false,94 "can_recover": false,95 "can_see_hidden_post": false,96 "can_wiki": false,97 "read": true,98 "user_title": null,99 "bookmarked": false,100 "actions_summary": [],101 "moderator": false,102 "admin": false,103 "staff": false,104 "user_id": 11833,105 "hidden": false,106 "trust_level": 1,107 "deleted_at": null,108 "user_deleted": false,109 "edit_reason": null,110 "can_view_edit_history": true,111 "wiki": false,112 "post_url": "/t/random-seed-caution/61623/2",113 "can_accept_answer": false,114 "can_unaccept_answer": false,115 "accepted_answer": false,116 "topic_accepted_answer": null117 },118 {119 "id": 147675,120 "name": "",121 "username": "ptrblck",122 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",123 "created_at": "2019-11-21T05:56:33.605Z",124 "cooked": "<ol>\n<li>If all runs should return the same output, you would have to use the same seed. A seed is usually used to get reproducible results.</li>\n<li>Using the script, it seems other deterministic options will also be enabled. Have a look at the <a href=\"https://pytorch.org/docs/stable/notes/randomness.html\">Reproducibility docs</a> for more information</li>\n<li>If you don’t use the mentioned non-deterministic ops (from the repro docs), you should get the same answers.</li>\n</ol>",125 "post_number": 3,126 "post_type": 1,127 "posts_count": 4,128 "updated_at": "2019-11-21T05:56:33.605Z",129 "reply_count": 1,130 "reply_to_post_number": 2,131 "quote_count": 0,132 "incoming_link_count": 3,133 "reads": 15,134 "readers_count": 14,135 "score": 38.0,136 "yours": false,137 "topic_id": 61623,138 "topic_slug": "random-seed-caution",139 "display_username": "",140 "primary_group_name": null,141 "flair_name": null,142 "flair_url": null,143 "flair_bg_color": null,144 "flair_color": null,145 "flair_group_id": null,146 "badges_granted": [],147 "version": 1,148 "can_edit": false,149 "can_delete": false,150 "can_recover": false,151 "can_see_hidden_post": false,152 "can_wiki": false,153 "link_counts": [154 {155 "url": "https://pytorch.org/docs/stable/notes/randomness.html",156 "internal": false,157 "reflection": false,158 "title": "Reproducibility — PyTorch master documentation",159 "clicks": 16160 }161 ],162 "read": true,163 "user_title": "",164 "reply_to_user": {165 "id": 11833,166 "username": "Juna",167 "name": "Juna",168 "avatar_template": "/user_avatar/discuss.pytorch.org/juna/{size}/15142_2.png"169 },170 "bookmarked": false,171 "actions_summary": [172 {173 "id": 2,174 "count": 1175 }176 ],177 "moderator": true,178 "admin": true,179 "staff": true,180 "user_id": 3534,181 "hidden": false,182 "trust_level": 2,183 "deleted_at": null,184 "user_deleted": false,185 "edit_reason": null,186 "can_view_edit_history": true,187 "wiki": false,188 "post_url": "/t/random-seed-caution/61623/3",189 "can_accept_answer": false,190 "can_unaccept_answer": false,191 "accepted_answer": false,192 "topic_accepted_answer": null193 },194 {195 "id": 147953,196 "name": "Juna",197 "username": "Juna",198 "avatar_template": "/user_avatar/discuss.pytorch.org/juna/{size}/15142_2.png",199 "created_at": "2019-11-22T04:42:28.183Z",200 "cooked": "<aside class=\"quote no-group\" data-username=\"ptrblck\" data-post=\"3\" data-topic=\"61623\">\n<div class=\"title\">\n<div class=\"quote-controls\"></div>\n<img loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/48/1823_2.png\" class=\"avatar\"> ptrblck:</div>\n<blockquote>\n<p>mentioned non-deterministic ops</p>\n</blockquote>\n</aside>\n<p>It seems to work properly. Thanks a lot!!</p>",201 "post_number": 4,202 "post_type": 1,203 "posts_count": 4,204 "updated_at": "2019-11-22T04:42:28.183Z",205 "reply_count": 0,206 "reply_to_post_number": 3,207 "quote_count": 1,208 "incoming_link_count": 2,209 "reads": 12,210 "readers_count": 11,211 "score": 12.4,212 "yours": false,213 "topic_id": 61623,214 "topic_slug": "random-seed-caution",215 "display_username": "Juna",216 "primary_group_name": null,217 "flair_name": null,218 "flair_url": null,219 "flair_bg_color": null,220 "flair_color": null,221 "flair_group_id": null,222 "badges_granted": [],223 "version": 1,224 "can_edit": false,225 "can_delete": false,226 "can_recover": false,227 "can_see_hidden_post": false,228 "can_wiki": false,229 "read": true,230 "user_title": null,231 "bookmarked": false,232 "actions_summary": [],233 "moderator": false,234 "admin": false,235 "staff": false,236 "user_id": 11833,237 "hidden": false,238 "trust_level": 1,239 "deleted_at": null,240 "user_deleted": false,241 "edit_reason": null,242 "can_view_edit_history": true,243 "wiki": false,244 "post_url": "/t/random-seed-caution/61623/4",245 "can_accept_answer": false,246 "can_unaccept_answer": false,247 "accepted_answer": false,248 "topic_accepted_answer": null249 }250 ],251 "stream": [252 147512,253 147513,254 147675,255 147953256 ]257 },258 "timeline_lookup": [259 [260 1,261 2166262 ],263 [264 4,265 2165266 ]267 ],268 "suggested_topics": [269 {270 "fancy_title": "Has no gradient in bias",271 "id": 213235,272 "title": "Has no gradient in bias",273 "slug": "has-no-gradient-in-bias",274 "posts_count": 2,275 "reply_count": 0,276 "highest_post_number": 2,277 "image_url": null,278 "created_at": "2024-11-20T22:30:42.969Z",279 "last_posted_at": "2024-11-21T06:11:05.813Z",280 "bumped": true,281 "bumped_at": "2024-11-21T06:11:05.813Z",282 "archetype": "regular",283 "unseen": false,284 "pinned": false,285 "unpinned": null,286 "visible": true,287 "closed": false,288 "archived": false,289 "bookmarked": null,290 "liked": null,291 "tags_descriptions": {},292 "like_count": 0,293 "views": 105,294 "category_id": 1,295 "featured_link": null,296 "has_accepted_answer": false,297 "posters": [298 {299 "extras": null,300 "description": "Original Poster",301 "user": {302 "id": 81034,303 "username": "olegkufa",304 "name": "olegkufa",305 "avatar_template": "/user_avatar/discuss.pytorch.org/olegkufa/{size}/74104_2.png",306 "trust_level": 1307 }308 },309 {310 "extras": "latest",311 "description": "Most Recent Poster",312 "user": {313 "id": 3534,314 "username": "ptrblck",315 "name": "",316 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",317 "admin": true,318 "moderator": true,319 "trust_level": 2320 }321 }322 ]323 },324 {325 "fancy_title": "Nan values caused by scatter",326 "id": 216931,327 "title": "Nan values caused by scatter",328 "slug": "nan-values-caused-by-scatter",329 "posts_count": 1,330 "reply_count": 0,331 "highest_post_number": 1,332 "image_url": null,333 "created_at": "2025-02-20T07:18:49.680Z",334 "last_posted_at": "2025-02-20T07:18:49.722Z",335 "bumped": true,336 "bumped_at": "2025-02-20T07:18:49.722Z",337 "archetype": "regular",338 "unseen": false,339 "pinned": false,340 "unpinned": null,341 "visible": true,342 "closed": false,343 "archived": false,344 "bookmarked": null,345 "liked": null,346 "tags_descriptions": {},347 "like_count": 0,348 "views": 36,349 "category_id": 1,350 "featured_link": null,351 "has_accepted_answer": false,352 "posters": [353 {354 "extras": "latest single",355 "description": "Original Poster, Most Recent Poster",356 "user": {357 "id": 82813,358 "username": "gitKincses",359 "name": "Git Kincses",360 "avatar_template": "/user_avatar/discuss.pytorch.org/gitkincses/{size}/75774_2.png",361 "trust_level": 0362 }363 }364 ]365 },366 {367 "fancy_title": "Optimizing difference of two outer products help",368 "id": 214326,369 "title": "Optimizing difference of two outer products help",370 "slug": "optimizing-difference-of-two-outer-products-help",371 "posts_count": 2,372 "reply_count": 0,373 "highest_post_number": 2,374 "image_url": null,375 "created_at": "2024-12-17T17:23:18.739Z",376 "last_posted_at": "2024-12-17T21:31:49.025Z",377 "bumped": true,378 "bumped_at": "2024-12-17T21:31:49.025Z",379 "archetype": "regular",380 "unseen": false,381 "pinned": false,382 "unpinned": null,383 "visible": true,384 "closed": false,385 "archived": false,386 "bookmarked": null,387 "liked": null,388 "tags_descriptions": {},389 "like_count": 1,390 "views": 30,391 "category_id": 1,392 "featured_link": null,393 "has_accepted_answer": false,394 "posters": [395 {396 "extras": null,397 "description": "Original Poster",398 "user": {399 "id": 57398,400 "username": "Nyakov",401 "name": "",402 "avatar_template": "/user_avatar/discuss.pytorch.org/nyakov/{size}/51180_2.png",403 "trust_level": 1404 }405 },406 {407 "extras": "latest",408 "description": "Most Recent Poster",409 "user": {410 "id": 41396,411 "username": "soulitzer",412 "name": "",413 "avatar_template": "/letter_avatar_proxy/v4/letter/s/839c29/{size}.png",414 "trust_level": 2415 }416 }417 ]418 },419 {420 "fancy_title": "PyTorch scatter max for sparse tensors?",421 "id": 214472,422 "title": "PyTorch scatter max for sparse tensors?",423 "slug": "pytorch-scatter-max-for-sparse-tensors",424 "posts_count": 1,425 "reply_count": 0,426 "highest_post_number": 1,427 "image_url": null,428 "created_at": "2024-12-20T21:37:04.327Z",429 "last_posted_at": "2024-12-20T21:37:04.366Z",430 "bumped": true,431 "bumped_at": "2024-12-20T21:37:04.366Z",432 "archetype": "regular",433 "unseen": false,434 "pinned": false,435 "unpinned": null,436 "visible": true,437 "closed": false,438 "archived": false,439 "bookmarked": null,440 "liked": null,441 "tags_descriptions": {},442 "like_count": 0,443 "views": 150,444 "category_id": 1,445 "featured_link": null,446 "has_accepted_answer": false,447 "posters": [448 {449 "extras": "latest single",450 "description": "Original Poster, Most Recent Poster",451 "user": {452 "id": 79111,453 "username": "MartensCedric",454 "name": "",455 "avatar_template": "/user_avatar/discuss.pytorch.org/martenscedric/{size}/72949_2.png",456 "trust_level": 1457 }458 }459 ]460 },461 {462 "fancy_title": "RuntimeError: Input tensors need to be on the same GPU",463 "id": 217286,464 "title": "RuntimeError: Input tensors need to be on the same GPU",465 "slug": "runtimeerror-input-tensors-need-to-be-on-the-same-gpu",466 "posts_count": 1,467 "reply_count": 0,468 "highest_post_number": 1,469 "image_url": null,470 "created_at": "2025-02-28T12:44:11.593Z",471 "last_posted_at": "2025-02-28T12:44:11.634Z",472 "bumped": true,473 "bumped_at": "2025-02-28T12:44:11.634Z",474 "archetype": "regular",475 "unseen": false,476 "pinned": false,477 "unpinned": null,478 "visible": true,479 "closed": false,480 "archived": false,481 "bookmarked": null,482 "liked": null,483 "tags_descriptions": {},484 "like_count": 0,485 "views": 57,486 "category_id": 1,487 "featured_link": null,488 "has_accepted_answer": false,489 "posters": [490 {491 "extras": "latest single",492 "description": "Original Poster, Most Recent Poster",493 "user": {494 "id": 73637,495 "username": "chrathans",496 "name": "Kris Tosh",497 "avatar_template": "/user_avatar/discuss.pytorch.org/chrathans/{size}/67980_2.png",498 "trust_level": 1499 }500 }501 ]502 }503 ],504 "tags_descriptions": {},505 "fancy_title": "Random_seed caution",506 "id": 61623,507 "title": "Random_seed caution",508 "posts_count": 4,509 "created_at": "2019-11-20T14:45:12.211Z",510 "views": 860,511 "reply_count": 2,512 "like_count": 1,513 "last_posted_at": "2019-11-22T04:42:28.183Z",514 "visible": true,515 "closed": false,516 "archived": false,517 "has_summary": false,518 "archetype": "regular",519 "slug": "random-seed-caution",520 "category_id": 1,521 "word_count": 249,522 "deleted_at": null,523 "user_id": 11833,524 "featured_link": null,525 "pinned_globally": false,526 "pinned_at": null,527 "pinned_until": null,528 "image_url": null,529 "slow_mode_seconds": 0,530 "draft": null,531 "draft_key": "topic_61623",532 "draft_sequence": null,533 "unpinned": null,534 "pinned": false,535 "current_post_number": 1,536 "highest_post_number": 4,537 "deleted_by": null,538 "actions_summary": [539 {540 "id": 4,541 "count": 0,542 "hidden": false,543 "can_act": false544 },545 {546 "id": 8,547 "count": 0,548 "hidden": false,549 "can_act": false550 },551 {552 "id": 10,553 "count": 0,554 "hidden": false,555 "can_act": false556 },557 {558 "id": 7,559 "count": 0,560 "hidden": false,561 "can_act": false562 }563 ],564 "chunk_size": 20,565 "bookmarked": false,566 "topic_timer": null,567 "message_bus_last_id": 0,568 "participant_count": 2,569 "show_read_indicator": false,570 "thumbnails": null,571 "slow_mode_enabled_until": null,572 "can_vote": false,573 "vote_count": 0,574 "user_voted": false,575 "discourse_zendesk_plugin_zendesk_id": null,576 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",577 "details": {578 "can_edit": false,579 "notification_level": 1,580 "participants": [581 {582 "id": 11833,583 "username": "Juna",584 "name": "Juna",585 "avatar_template": "/user_avatar/discuss.pytorch.org/juna/{size}/15142_2.png",586 "post_count": 3,587 "primary_group_name": null,588 "flair_name": null,589 "flair_url": null,590 "flair_color": null,591 "flair_bg_color": null,592 "flair_group_id": null,593 "trust_level": 1594 },595 {596 "id": 3534,597 "username": "ptrblck",598 "name": "",599 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",600 "post_count": 1,601 "primary_group_name": null,602 "flair_name": null,603 "flair_url": null,604 "flair_color": null,605 "flair_bg_color": null,606 "flair_group_id": null,607 "admin": true,608 "moderator": true,609 "trust_level": 2610 }611 ],612 "created_by": {613 "id": 11833,614 "username": "Juna",615 "name": "Juna",616 "avatar_template": "/user_avatar/discuss.pytorch.org/juna/{size}/15142_2.png"617 },618 "last_poster": {619 "id": 11833,620 "username": "Juna",621 "name": "Juna",622 "avatar_template": "/user_avatar/discuss.pytorch.org/juna/{size}/15142_2.png"623 },624 "links": [625 {626 "url": "https://pytorch.org/docs/stable/notes/randomness.html",627 "title": "Reproducibility — PyTorch master documentation",628 "internal": false,629 "attachment": false,630 "reflection": false,631 "clicks": 16,632 "user_id": 3534,633 "domain": "pytorch.org",634 "root_domain": "pytorch.org"635 }636 ]637 },638 "bookmarks": []639 },640 {641 "post_stream": {642 "posts": [643 {644 "id": 147196,645 "name": "",646 "username": "CalmLife",647 "avatar_template": "/letter_avatar_proxy/v4/letter/c/eb9ed0/{size}.png",648 "created_at": "2019-11-19T08:51:27.415Z",649 "cooked": "<p>Here is my code, it’s similar to official example.</p>\n<pre><code class=\"lang-auto\">import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nloss = nn.CrossEntropyLoss()\nfeature = torch.ones(3, 5, requires_grad=True)\ntarget = torch.empty(3, dtype=torch.long).random_(5)\n\noutput_sm = F.log_softmax(feature, dim=1)\noutput_nll = F.nll_loss(output_sm, target)\noutput = output_nll\noutput.backward()\n\nprint(\"Input:\\n\", feature)\nprint(\"Target:\\n\", target)\nprint(\"Gradient in feature:\\n\", feature.grad)\n</code></pre>\n<p>The picture below is my results.</p>\n<p><img src=\"https://discuss.pytorch.org/uploads/default/original/3X/a/c/acfe583093eda01b9b4db08ef16bc5128fab4aba.png\" alt=\"result\" data-base62-sha1=\"oGn3rfBL64NVCrnZlEyzkHAcar8\" width=\"594\" height=\"252\"></p>\n<p>The result of theoretical deduction is as follow:</p>\n<p>Partial derivative of L to z equals p - y</p>\n<p>L represents loss function<br>\nz is the input feature<br>\np is the output of softmax<br>\ny is the target<br>\nRegarding the detailed derivation of this formula, I am not here because it is easy to get.</p>\n<p>What confused me is the experimental results do not match the theoretical values?<br>\nCan you give me some suggestion? Thank you!</p>",650 "post_number": 1,651 "post_type": 1,652 "posts_count": 6,653 "updated_at": "2019-11-19T08:51:27.415Z",654 "reply_count": 0,655 "reply_to_post_number": null,656 "quote_count": 0,657 "incoming_link_count": 21,658 "reads": 9,659 "readers_count": 8,660 "score": 106.8,661 "yours": false,662 "topic_id": 61462,663 "topic_slug": "why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value",664 "display_username": "",665 "primary_group_name": null,666 "flair_name": null,667 "flair_url": null,668 "flair_bg_color": null,669 "flair_color": null,670 "flair_group_id": null,671 "badges_granted": [],672 "version": 1,673 "can_edit": false,674 "can_delete": false,675 "can_recover": false,676 "can_see_hidden_post": false,677 "can_wiki": false,678 "read": true,679 "user_title": null,680 "bookmarked": false,681 "actions_summary": [],682 "moderator": false,683 "admin": false,684 "staff": false,685 "user_id": 24559,686 "hidden": false,687 "trust_level": 0,688 "deleted_at": null,689 "user_deleted": false,690 "edit_reason": null,691 "can_view_edit_history": true,692 "wiki": false,693 "post_url": "/t/why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value/61462/1",694 "can_accept_answer": false,695 "can_unaccept_answer": false,696 "accepted_answer": false,697 "topic_accepted_answer": null,698 "can_vote": false699 },700 {701 "id": 147254,702 "name": "Alban D",703 "username": "albanD",704 "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png",705 "created_at": "2019-11-19T14:53:08.261Z",706 "cooked": "<p>What is the value you expect?<br>\nGiven there is a log then softmax then nll then averaging. Plus the backward computations of each. I wouldn’t say it’s a trivial computation to do.</p>",707 "post_number": 2,708 "post_type": 1,709 "posts_count": 6,710 "updated_at": "2019-11-19T14:53:08.261Z",711 "reply_count": 1,712 "reply_to_post_number": null,713 "quote_count": 0,714 "incoming_link_count": 0,715 "reads": 9,716 "readers_count": 8,717 "score": 6.8,718 "yours": false,719 "topic_id": 61462,720 "topic_slug": "why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value",721 "display_username": "Alban D",722 "primary_group_name": null,723 "flair_name": null,724 "flair_url": null,725 "flair_bg_color": null,726 "flair_color": null,727 "flair_group_id": null,728 "badges_granted": [],729 "version": 1,730 "can_edit": false,731 "can_delete": false,732 "can_recover": false,733 "can_see_hidden_post": false,734 "can_wiki": false,735 "read": true,736 "user_title": "",737 "bookmarked": false,738 "actions_summary": [],739 "moderator": true,740 "admin": true,741 "staff": true,742 "user_id": 211,743 "hidden": false,744 "trust_level": 4,745 "deleted_at": null,746 "user_deleted": false,747 "edit_reason": null,748 "can_view_edit_history": true,749 "wiki": false,750 "post_url": "/t/why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value/61462/2",751 "can_accept_answer": false,752 "can_unaccept_answer": false,753 "accepted_answer": false,754 "topic_accepted_answer": null755 },756 {757 "id": 147634,758 "name": "",759 "username": "CalmLife",760 "avatar_template": "/letter_avatar_proxy/v4/letter/c/eb9ed0/{size}.png",761 "created_at": "2019-11-21T01:51:03.531Z",762 "cooked": "<p>Thanks for your answer!<br>\nThis is the formula.<br>\n<img src=\"https://discuss.pytorch.org/uploads/default/original/3X/d/7/d79df21ab44518248c3d76c22242dd3a92f535fc.png\" alt=\"derivate\" data-base62-sha1=\"uLr3iQIw9EjrcURDmnQB6TS46ao\" width=\"295\" height=\"89\"></p>\n<p>p = [<br>\n 0.2 0.2 0.2 0.2 -0.8<br>\n-0.8 0.2 0.2 0.2 0.2<br>\n 0.2 0.2 -0.8 0.2 0.2<br>\n]</p>\n<p>y = [4, 0, 2]</p>\n<p>The values I expected as follows:<br>\n[<br>\n 0.2 0.2 0.2 0.2 -0.8<br>\n-0.8 0.2 0.2 0.2 0.2<br>\n 0.2 0.2 -0.8 0.2 0.2<br>\n]</p>",763 "post_number": 3,764 "post_type": 1,765 "posts_count": 6,766 "updated_at": "2019-11-21T01:51:03.531Z",767 "reply_count": 1,768 "reply_to_post_number": 2,769 "quote_count": 0,770 "incoming_link_count": 0,771 "reads": 7,772 "readers_count": 6,773 "score": 6.4,774 "yours": false,775 "topic_id": 61462,776 "topic_slug": "why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value",777 "display_username": "",778 "primary_group_name": null,779 "flair_name": null,780 "flair_url": null,781 "flair_bg_color": null,782 "flair_color": null,783 "flair_group_id": null,784 "badges_granted": [],785 "version": 1,786 "can_edit": false,787 "can_delete": false,788 "can_recover": false,789 "can_see_hidden_post": false,790 "can_wiki": false,791 "read": true,792 "user_title": null,793 "reply_to_user": {794 "id": 211,795 "username": "albanD",796 "name": "Alban D",797 "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png"798 },799 "bookmarked": false,800 "actions_summary": [],801 "moderator": false,802 "admin": false,803 "staff": false,804 "user_id": 24559,805 "hidden": false,806 "trust_level": 0,807 "deleted_at": null,808 "user_deleted": false,809 "edit_reason": null,810 "can_view_edit_history": true,811 "wiki": false,812 "post_url": "/t/why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value/61462/3",813 "can_accept_answer": false,814 "can_unaccept_answer": false,815 "accepted_answer": false,816 "topic_accepted_answer": null817 },818 {819 "id": 147778,820 "name": "Alban D",821 "username": "albanD",822 "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png",823 "created_at": "2019-11-21T14:43:40.930Z",824 "cooked": "<p>Could you explain how you get <code>dL/dz = p - y</code> please?</p>",825 "post_number": 4,826 "post_type": 1,827 "posts_count": 6,828 "updated_at": "2019-11-21T14:43:40.930Z",829 "reply_count": 2,830 "reply_to_post_number": 3,831 "quote_count": 0,832 "incoming_link_count": 1,833 "reads": 7,834 "readers_count": 6,835 "score": 16.4,836 "yours": false,837 "topic_id": 61462,838 "topic_slug": "why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value",839 "display_username": "Alban D",840 "primary_group_name": null,841 "flair_name": null,842 "flair_url": null,843 "flair_bg_color": null,844 "flair_color": null,845 "flair_group_id": null,846 "badges_granted": [],847 "version": 1,848 "can_edit": false,849 "can_delete": false,850 "can_recover": false,851 "can_see_hidden_post": false,852 "can_wiki": false,853 "read": true,854 "user_title": "",855 "reply_to_user": {856 "id": 24559,857 "username": "CalmLife",858 "name": "",859 "avatar_template": "/letter_avatar_proxy/v4/letter/c/eb9ed0/{size}.png"860 },861 "bookmarked": false,862 "actions_summary": [],863 "moderator": true,864 "admin": true,865 "staff": true,866 "user_id": 211,867 "hidden": false,868 "trust_level": 4,869 "deleted_at": null,870 "user_deleted": false,871 "edit_reason": null,872 "can_view_edit_history": true,873 "wiki": false,874 "post_url": "/t/why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value/61462/4",875 "can_accept_answer": false,876 "can_unaccept_answer": false,877 "accepted_answer": false,878 "topic_accepted_answer": null879 },880 {881 "id": 147917,882 "name": "",883 "username": "CalmLife",884 "avatar_template": "/letter_avatar_proxy/v4/letter/c/eb9ed0/{size}.png",885 "created_at": "2019-11-22T01:22:14.906Z",886 "cooked": "<p>Thank you! I have solved this problem. I did not divide by batches when caculating.<br>\nI will explain how I get <code>dL/dz = p - y</code> later.</p>",887 "post_number": 5,888 "post_type": 1,889 "posts_count": 6,890 "updated_at": "2019-11-22T01:22:14.906Z",891 "reply_count": 0,892 "reply_to_post_number": 4,893 "quote_count": 0,894 "incoming_link_count": 0,895 "reads": 7,896 "readers_count": 6,897 "score": 1.4,898 "yours": false,899 "topic_id": 61462,900 "topic_slug": "why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value",901 "display_username": "",902 "primary_group_name": null,903 "flair_name": null,904 "flair_url": null,905 "flair_bg_color": null,906 "flair_color": null,907 "flair_group_id": null,908 "badges_granted": [],909 "version": 1,910 "can_edit": false,911 "can_delete": false,912 "can_recover": false,913 "can_see_hidden_post": false,914 "can_wiki": false,915 "read": true,916 "user_title": null,917 "reply_to_user": {918 "id": 211,919 "username": "albanD",920 "name": "Alban D",921 "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png"922 },923 "bookmarked": false,924 "actions_summary": [],925 "moderator": false,926 "admin": false,927 "staff": false,928 "user_id": 24559,929 "hidden": false,930 "trust_level": 0,931 "deleted_at": null,932 "user_deleted": false,933 "edit_reason": null,934 "can_view_edit_history": true,935 "wiki": false,936 "post_url": "/t/why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value/61462/5",937 "can_accept_answer": false,938 "can_unaccept_answer": false,939 "accepted_answer": false,940 "topic_accepted_answer": null941 },942 {943 "id": 147952,944 "name": "",945 "username": "CalmLife",946 "avatar_template": "/letter_avatar_proxy/v4/letter/c/eb9ed0/{size}.png",947 "created_at": "2019-11-22T04:33:36.171Z",948 "cooked": "<p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://discuss.pytorch.org/uploads/default/original/3X/5/2/5246b7d9c9bccdeb0187a92e561178315395639b.png\" data-download-href=\"https://discuss.pytorch.org/uploads/default/5246b7d9c9bccdeb0187a92e561178315395639b\" title=\"%E6%8D%95%E8%8E%B7\"><img src=\"https://discuss.pytorch.org/uploads/default/optimized/3X/5/2/5246b7d9c9bccdeb0187a92e561178315395639b_2_345x500.png\" alt=\"%E6%8D%95%E8%8E%B7\" data-base62-sha1=\"bJQFgnmOzgMDQ7WbGpzREMfF2yL\" width=\"345\" height=\"500\" srcset=\"https://discuss.pytorch.org/uploads/default/optimized/3X/5/2/5246b7d9c9bccdeb0187a92e561178315395639b_2_345x500.png, https://discuss.pytorch.org/uploads/default/optimized/3X/5/2/5246b7d9c9bccdeb0187a92e561178315395639b_2_517x750.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/5/2/5246b7d9c9bccdeb0187a92e561178315395639b.png 2x\" data-dominant-color=\"FCFCFC\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">%E6%8D%95%E8%8E%B7</span><span class=\"informations\">540×781 13.1 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p>",949 "post_number": 6,950 "post_type": 1,951 "posts_count": 6,952 "updated_at": "2019-11-22T04:33:36.171Z",953 "reply_count": 0,954 "reply_to_post_number": 4,955 "quote_count": 0,956 "incoming_link_count": 2,957 "reads": 6,958 "readers_count": 5,959 "score": 56.2,960 "yours": false,961 "topic_id": 61462,962 "topic_slug": "why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value",963 "display_username": "",964 "primary_group_name": null,965 "flair_name": null,966 "flair_url": null,967 "flair_bg_color": null,968 "flair_color": null,969 "flair_group_id": null,970 "badges_granted": [],971 "version": 1,972 "can_edit": false,973 "can_delete": false,974 "can_recover": false,975 "can_see_hidden_post": false,976 "can_wiki": false,977 "link_counts": [978 {979 "url": "https://discuss.pytorch.org/uploads/default/original/3X/5/2/5246b7d9c9bccdeb0187a92e561178315395639b.png",980 "internal": true,981 "reflection": false,982 "clicks": 0983 }984 ],985 "read": true,986 "user_title": null,987 "reply_to_user": {988 "id": 211,989 "username": "albanD",990 "name": "Alban D",991 "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png"992 },993 "bookmarked": false,994 "actions_summary": [995 {996 "id": 2,997 "count": 1998 }999 ],1000 "moderator": false,1001 "admin": false,1002 "staff": false,1003 "user_id": 24559,1004 "hidden": false,1005 "trust_level": 0,1006 "deleted_at": null,1007 "user_deleted": false,1008 "edit_reason": null,1009 "can_view_edit_history": true,1010 "wiki": false,1011 "post_url": "/t/why-the-gradient-of-feature-passing-into-crossentroyloss-function-is-different-from-the-theoretical-value/61462/6",1012 "can_accept_answer": false,1013 "can_unaccept_answer": false,1014 "accepted_answer": false,1015 "topic_accepted_answer": null1016 }1017 ],1018 "stream": [1019 147196,1020 147254,1021 147634,1022 147778,1023 147917,1024 1479521025 ]1026 },1027 "timeline_lookup": [1028 [1029 1,1030 21681031 ],1032 [1033 2,1034 21671035 ],1036 [1037 3,1038 21661039 ],1040 [1041 4,1042 21651043 ]1044 ],1045 "suggested_topics": [1046 {1047 "fancy_title": "Freezing CNN Channels",1048 "id": 216265,1049 "title": "Freezing CNN Channels",1050 "slug": "freezing-cnn-channels",1051 "posts_count": 3,1052 "reply_count": 0,1053 "highest_post_number": 3,1054 "image_url": null,1055 "created_at": "2025-02-05T11:04:17.000Z",1056 "last_posted_at": "2025-02-07T14:41:56.375Z",1057 "bumped": true,1058 "bumped_at": "2025-02-07T14:41:56.375Z",1059 "archetype": "regular",1060 "unseen": false,1061 "pinned": false,1062 "unpinned": null,1063 "visible": true,1064 "closed": false,1065 "archived": false,1066 "bookmarked": null,1067 "liked": null,1068 "tags_descriptions": {},1069 "like_count": 0,1070 "views": 184,1071 "category_id": 7,1072 "featured_link": null,1073 "has_accepted_answer": false,1074 "posters": [1075 {1076 "extras": "latest",1077 "description": "Original Poster, Most Recent Poster",1078 "user": {1079 "id": 82501,1080 "username": "SudakshK",1081 "name": "",1082 "avatar_template": "/user_avatar/discuss.pytorch.org/sudakshk/{size}/75478_2.png",1083 "trust_level": 11084 }1085 },1086 {1087 "extras": null,1088 "description": "Frequent Poster",1089 "user": {1090 "id": 19553,1091 "username": "anantguptadbl",1092 "name": "Anant Gupta",1093 "avatar_template": "/user_avatar/discuss.pytorch.org/anantguptadbl/{size}/17784_2.png",1094 "trust_level": 21095 }1096 }1097 ]1098 },1099 {1100 "fancy_title": "How to reduce the for loop with torch.einsum function?",1101 "id": 216322,1102 "title": "How to reduce the for loop with torch.einsum function?",1103 "slug": "how-to-reduce-the-for-loop-with-torch-einsum-function",1104 "posts_count": 2,1105 "reply_count": 0,1106 "highest_post_number": 2,1107 "image_url": null,1108 "created_at": "2025-02-06T17:05:20.062Z",1109 "last_posted_at": "2025-02-07T16:46:16.606Z",1110 "bumped": true,1111 "bumped_at": "2025-02-07T16:46:16.606Z",1112 "archetype": "regular",1113 "unseen": false,1114 "pinned": false,1115 "unpinned": null,1116 "visible": true,1117 "closed": false,1118 "archived": false,1119 "bookmarked": null,1120 "liked": null,1121 "tags_descriptions": {},1122 "like_count": 0,1123 "views": 53,1124 "category_id": 7,1125 "featured_link": null,1126 "has_accepted_answer": false,1127 "posters": [1128 {1129 "extras": null,1130 "description": "Original Poster",1131 "user": {1132 "id": 82526,1133 "username": "maroo_sky",1134 "name": "",1135 "avatar_template": "/user_avatar/discuss.pytorch.org/maroo_sky/{size}/75510_2.png",1136 "trust_level": 01137 }1138 },1139 {1140 "extras": "latest",1141 "description": "Most Recent Poster",1142 "user": {1143 "id": 18088,1144 "username": "KFrank",1145 "name": "K. Frank",1146 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",1147 "trust_level": 21148 }1149 }1150 ]1151 },1152 {1153 "fancy_title": "Loss.backward() called after torch.nograd()",1154 "id": 215480,1155 "title": "Loss.backward() called after torch.nograd()",1156 "slug": "loss-backward-called-after-torch-nograd",1157 "posts_count": 5,1158 "reply_count": 3,1159 "highest_post_number": 5,1160 "image_url": null,1161 "created_at": "2025-01-16T15:42:16.612Z",1162 "last_posted_at": "2025-01-19T16:44:10.276Z",1163 "bumped": true,1164 "bumped_at": "2025-01-19T16:44:10.276Z",1165 "archetype": "regular",1166 "unseen": false,1167 "pinned": false,1168 "unpinned": null,1169 "visible": true,1170 "closed": false,1171 "archived": false,1172 "bookmarked": null,1173 "liked": null,1174 "tags_descriptions": {},1175 "like_count": 0,1176 "views": 81,1177 "category_id": 7,1178 "featured_link": null,1179 "has_accepted_answer": true,1180 "posters": [1181 {1182 "extras": "latest",1183 "description": "Original Poster, Most Recent Poster",1184 "user": {1185 "id": 82127,1186 "username": "hanxix",1187 "name": "",1188 "avatar_template": "/letter_avatar_proxy/v4/letter/h/8797f3/{size}.png",1189 "trust_level": 01190 }1191 },1192 {1193 "extras": null,1194 "description": "Frequent Poster, Accepted Answer",1195 "user": {1196 "id": 3534,1197 "username": "ptrblck",1198 "name": "",1199 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1200 "admin": true,