Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 38389,7 "name": "",8 "username": "Neo",9 "avatar_template": "/user_avatar/discuss.pytorch.org/neo/{size}/3968_2.png",10 "created_at": "2018-03-16T15:08:43.893Z",11 "cooked": "<p>Hello,</p>\n<p>How can I apply k-fold cross validation with CNN. I do not want to make it manually; for example, in leave one out, I might remove one item from the training set and train the network then apply testing with the removed item. Could you please help me to make this in a standard way.</p>\n<p>Regards,</p>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 30,15 "updated_at": "2018-03-16T15:08:58.179Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 41445,20 "reads": 1269,21 "readers_count": 1268,22 "score": 207587.8,23 "yours": false,24 "topic_id": 15035,25 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",26 "display_username": "",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 "link_counts": [41 {42 "url": "https://discuss.pytorch.org/t/how-to-perform-the-cross-validation/45974/2",43 "internal": true,44 "reflection": true,45 "title": "How to perform the cross validation?",46 "clicks": 4547 },48 {49 "url": "https://discuss.pytorch.org/t/k-fold-cross-validation-for-cnn/85446/2",50 "internal": true,51 "reflection": true,52 "title": "K fold cross validation for CNN",53 "clicks": 4354 },55 {56 "url": "https://discuss.pytorch.org/t/in-which-areas-doesnt-pytorch-yet-provide-good-solutions/34816",57 "internal": true,58 "reflection": true,59 "title": "In which areas doesn't PyTorch yet provide good solutions?",60 "clicks": 2361 },62 {63 "url": "https://discuss.pytorch.org/t/how-to-initialize-weights-when-using-a-manual-kfold-and-custom-nn-module-init-weights-how-to/20596",64 "internal": true,65 "reflection": true,66 "title": "How to initialize weights when using a manual Kfold and custom nn.module (init_weights how to?)",67 "clicks": 068 }69 ],70 "read": true,71 "user_title": null,72 "bookmarked": false,73 "actions_summary": [74 {75 "id": 2,76 "count": 777 }78 ],79 "moderator": false,80 "admin": false,81 "staff": false,82 "user_id": 6993,83 "hidden": false,84 "trust_level": 1,85 "deleted_at": null,86 "user_deleted": false,87 "edit_reason": null,88 "can_view_edit_history": true,89 "wiki": false,90 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/1",91 "can_accept_answer": false,92 "can_unaccept_answer": false,93 "accepted_answer": false,94 "topic_accepted_answer": null,95 "can_vote": false96 },97 {98 "id": 38392,99 "name": "",100 "username": "ptrblck",101 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",102 "created_at": "2018-03-16T16:00:47.074Z",103 "cooked": "<p>Have a look at <a href=\"https://github.com/dnouri/skorch\" rel=\"nofollow noopener\">Skorch</a>. It’s a scikit-learn compatible wrapper for PyTorch.<br>\nscikit itself offers a lot of <a href=\"http://scikit-learn.org/stable/modules/cross_validation.html\" rel=\"nofollow noopener\">cross-validation methods</a>. <img src=\"https://discuss.pytorch.org/images/emoji/apple/wink.png?v=5\" title=\":wink:\" class=\"emoji\" alt=\":wink:\"></p>",104 "post_number": 2,105 "post_type": 1,106 "posts_count": 30,107 "updated_at": "2018-03-16T16:00:47.074Z",108 "reply_count": 2,109 "reply_to_post_number": null,110 "quote_count": 0,111 "incoming_link_count": 343,112 "reads": 1264,113 "readers_count": 1263,114 "score": 2234.8,115 "yours": false,116 "topic_id": 15035,117 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",118 "display_username": "",119 "primary_group_name": null,120 "flair_name": null,121 "flair_url": null,122 "flair_bg_color": null,123 "flair_color": null,124 "flair_group_id": null,125 "badges_granted": [],126 "version": 1,127 "can_edit": false,128 "can_delete": false,129 "can_recover": false,130 "can_see_hidden_post": false,131 "can_wiki": false,132 "link_counts": [133 {134 "url": "https://github.com/dnouri/skorch",135 "internal": false,136 "reflection": false,137 "title": "GitHub - dnouri/skorch: A scikit-learn compatible neural network library that wraps pytorch",138 "clicks": 7570139 },140 {141 "url": "http://scikit-learn.org/stable/modules/cross_validation.html",142 "internal": false,143 "reflection": false,144 "title": "3.1. Cross-validation: evaluating estimator performance — scikit-learn 0.19.1 documentation",145 "clicks": 4289146 },147 {148 "url": "https://discuss.pytorch.org/t/cross-validation/75245/2",149 "internal": true,150 "reflection": true,151 "title": "Cross Validation",152 "clicks": 32153 }154 ],155 "read": true,156 "user_title": "",157 "bookmarked": false,158 "actions_summary": [159 {160 "id": 2,161 "count": 16162 }163 ],164 "moderator": true,165 "admin": true,166 "staff": true,167 "user_id": 3534,168 "hidden": false,169 "trust_level": 2,170 "deleted_at": null,171 "user_deleted": false,172 "edit_reason": null,173 "can_view_edit_history": true,174 "wiki": false,175 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/2",176 "can_accept_answer": false,177 "can_unaccept_answer": false,178 "accepted_answer": false,179 "topic_accepted_answer": null180 },181 {182 "id": 38450,183 "name": "",184 "username": "Neo",185 "avatar_template": "/user_avatar/discuss.pytorch.org/neo/{size}/3968_2.png",186 "created_at": "2018-03-17T05:57:43.566Z",187 "cooked": "<p>Thank you. This helped me a lot. Another question, How can I reset the network across the folds? to avoid data leakage.</p>",188 "post_number": 3,189 "post_type": 1,190 "posts_count": 30,191 "updated_at": "2018-03-17T05:57:43.566Z",192 "reply_count": 1,193 "reply_to_post_number": 2,194 "quote_count": 0,195 "incoming_link_count": 147,196 "reads": 1241,197 "readers_count": 1240,198 "score": 1003.2,199 "yours": false,200 "topic_id": 15035,201 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",202 "display_username": "",203 "primary_group_name": null,204 "flair_name": null,205 "flair_url": null,206 "flair_bg_color": null,207 "flair_color": null,208 "flair_group_id": null,209 "badges_granted": [],210 "version": 1,211 "can_edit": false,212 "can_delete": false,213 "can_recover": false,214 "can_see_hidden_post": false,215 "can_wiki": false,216 "read": true,217 "user_title": null,218 "reply_to_user": {219 "id": 3534,220 "username": "ptrblck",221 "name": "",222 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"223 },224 "bookmarked": false,225 "actions_summary": [226 {227 "id": 2,228 "count": 1229 }230 ],231 "moderator": false,232 "admin": false,233 "staff": false,234 "user_id": 6993,235 "hidden": false,236 "trust_level": 1,237 "deleted_at": null,238 "user_deleted": false,239 "edit_reason": null,240 "can_view_edit_history": true,241 "wiki": false,242 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/3",243 "can_accept_answer": false,244 "can_unaccept_answer": false,245 "accepted_answer": false,246 "topic_accepted_answer": null247 },248 {249 "id": 38461,250 "name": "",251 "username": "ptrblck",252 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",253 "created_at": "2018-03-17T09:35:33.706Z",254 "cooked": "<p>You could re-initialize the weights of the model.</p>\n<pre><code class=\"lang-auto\">def weights_init(m):\n if isinstance(m, nn.Conv2d):\n xavier(m.weight.data)\n xavier(m.bias.data)\n\nmodel.apply(weights_init)\n</code></pre>\n<p>I haven’t used skorch yet, but the model reset should be implemented somewhere.</p>",255 "post_number": 4,256 "post_type": 1,257 "posts_count": 30,258 "updated_at": "2018-03-17T09:36:51.245Z",259 "reply_count": 2,260 "reply_to_post_number": 3,261 "quote_count": 0,262 "incoming_link_count": 142,263 "reads": 1184,264 "readers_count": 1183,265 "score": 971.8,266 "yours": false,267 "topic_id": 15035,268 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",269 "display_username": "",270 "primary_group_name": null,271 "flair_name": null,272 "flair_url": null,273 "flair_bg_color": null,274 "flair_color": null,275 "flair_group_id": null,276 "badges_granted": [],277 "version": 1,278 "can_edit": false,279 "can_delete": false,280 "can_recover": false,281 "can_see_hidden_post": false,282 "can_wiki": false,283 "read": true,284 "user_title": "",285 "reply_to_user": {286 "id": 6993,287 "username": "Neo",288 "name": "",289 "avatar_template": "/user_avatar/discuss.pytorch.org/neo/{size}/3968_2.png"290 },291 "bookmarked": false,292 "actions_summary": [293 {294 "id": 2,295 "count": 1296 }297 ],298 "moderator": true,299 "admin": true,300 "staff": true,301 "user_id": 3534,302 "hidden": false,303 "trust_level": 2,304 "deleted_at": null,305 "user_deleted": false,306 "edit_reason": null,307 "can_view_edit_history": true,308 "wiki": false,309 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/4",310 "can_accept_answer": false,311 "can_unaccept_answer": false,312 "accepted_answer": false,313 "topic_accepted_answer": null314 },315 {316 "id": 38463,317 "name": "",318 "username": "ptrblck",319 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",320 "created_at": "2018-03-17T09:49:33.872Z",321 "cooked": "<p>It seems a call to <code>.fit</code> re-initializes the model when <code>warm_start</code> is set to false. The model reset should therefore be performed automatically in grid searches.</p>",322 "post_number": 5,323 "post_type": 1,324 "posts_count": 30,325 "updated_at": "2018-03-17T09:49:51.953Z",326 "reply_count": 0,327 "reply_to_post_number": 4,328 "quote_count": 0,329 "incoming_link_count": 103,330 "reads": 1030,331 "readers_count": 1029,332 "score": 721.0,333 "yours": false,334 "topic_id": 15035,335 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",336 "display_username": "",337 "primary_group_name": null,338 "flair_name": null,339 "flair_url": null,340 "flair_bg_color": null,341 "flair_color": null,342 "flair_group_id": null,343 "badges_granted": [],344 "version": 1,345 "can_edit": false,346 "can_delete": false,347 "can_recover": false,348 "can_see_hidden_post": false,349 "can_wiki": false,350 "read": true,351 "user_title": "",352 "reply_to_user": {353 "id": 3534,354 "username": "ptrblck",355 "name": "",356 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"357 },358 "bookmarked": false,359 "actions_summary": [],360 "moderator": true,361 "admin": true,362 "staff": true,363 "user_id": 3534,364 "hidden": false,365 "trust_level": 2,366 "deleted_at": null,367 "user_deleted": false,368 "edit_reason": null,369 "can_view_edit_history": true,370 "wiki": false,371 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/5",372 "can_accept_answer": false,373 "can_unaccept_answer": false,374 "accepted_answer": false,375 "topic_accepted_answer": null376 },377 {378 "id": 38603,379 "name": "",380 "username": "Neo",381 "avatar_template": "/user_avatar/discuss.pytorch.org/neo/{size}/3968_2.png",382 "created_at": "2018-03-18T18:24:22.894Z",383 "cooked": "<p>Sorry, I am not able to make it. What is m and how can I import xavier.</p>",384 "post_number": 6,385 "post_type": 1,386 "posts_count": 30,387 "updated_at": "2018-03-18T18:24:22.894Z",388 "reply_count": 1,389 "reply_to_post_number": 4,390 "quote_count": 0,391 "incoming_link_count": 96,392 "reads": 960,393 "readers_count": 959,394 "score": 677.0,395 "yours": false,396 "topic_id": 15035,397 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",398 "display_username": "",399 "primary_group_name": null,400 "flair_name": null,401 "flair_url": null,402 "flair_bg_color": null,403 "flair_color": null,404 "flair_group_id": null,405 "badges_granted": [],406 "version": 1,407 "can_edit": false,408 "can_delete": false,409 "can_recover": false,410 "can_see_hidden_post": false,411 "can_wiki": false,412 "read": true,413 "user_title": null,414 "reply_to_user": {415 "id": 3534,416 "username": "ptrblck",417 "name": "",418 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"419 },420 "bookmarked": false,421 "actions_summary": [],422 "moderator": false,423 "admin": false,424 "staff": false,425 "user_id": 6993,426 "hidden": false,427 "trust_level": 1,428 "deleted_at": null,429 "user_deleted": false,430 "edit_reason": null,431 "can_view_edit_history": true,432 "wiki": false,433 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/6",434 "can_accept_answer": false,435 "can_unaccept_answer": false,436 "accepted_answer": false,437 "topic_accepted_answer": null438 },439 {440 "id": 38604,441 "name": "",442 "username": "ptrblck",443 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",444 "created_at": "2018-03-18T18:30:19.323Z",445 "cooked": "<p><code>m</code> is each <code>nn.Module</code> or your model.<br>\nYou can specify different initializers for each type of layer with the mentioned condition.</p>\n<p>You will find all initializers in <a href=\"http://pytorch.org/docs/0.3.1/nn.html#torch-nn-init\" rel=\"nofollow noopener\">torch.nn.init</a>.</p>",446 "post_number": 7,447 "post_type": 1,448 "posts_count": 30,449 "updated_at": "2018-03-18T18:30:19.323Z",450 "reply_count": 0,451 "reply_to_post_number": 6,452 "quote_count": 0,453 "incoming_link_count": 192,454 "reads": 924,455 "readers_count": 923,456 "score": 1174.8,457 "yours": false,458 "topic_id": 15035,459 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",460 "display_username": "",461 "primary_group_name": null,462 "flair_name": null,463 "flair_url": null,464 "flair_bg_color": null,465 "flair_color": null,466 "flair_group_id": null,467 "badges_granted": [],468 "version": 1,469 "can_edit": false,470 "can_delete": false,471 "can_recover": false,472 "can_see_hidden_post": false,473 "can_wiki": false,474 "link_counts": [475 {476 "url": "http://pytorch.org/docs/0.3.1/nn.html#torch-nn-init",477 "internal": false,478 "reflection": false,479 "title": "torch.nn — PyTorch master documentation",480 "clicks": 160481 }482 ],483 "read": true,484 "user_title": "",485 "reply_to_user": {486 "id": 6993,487 "username": "Neo",488 "name": "",489 "avatar_template": "/user_avatar/discuss.pytorch.org/neo/{size}/3968_2.png"490 },491 "bookmarked": false,492 "actions_summary": [493 {494 "id": 2,495 "count": 2496 }497 ],498 "moderator": true,499 "admin": true,500 "staff": true,501 "user_id": 3534,502 "hidden": false,503 "trust_level": 2,504 "deleted_at": null,505 "user_deleted": false,506 "edit_reason": null,507 "can_view_edit_history": true,508 "wiki": false,509 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/7",510 "can_accept_answer": false,511 "can_unaccept_answer": false,512 "accepted_answer": false,513 "topic_accepted_answer": null514 },515 {516 "id": 55145,517 "name": "Alejandro",518 "username": "alejandrodebus",519 "avatar_template": "/user_avatar/discuss.pytorch.org/alejandrodebus/{size}/4375_2.png",520 "created_at": "2018-07-10T23:50:00.376Z",521 "cooked": "<p>Hi,</p>\n<p>I have developed a function to perform cross-validation in medical images, but it is easily adaptable to other types of problems.</p>\n<aside class=\"onebox whitelistedgeneric\">\n <header class=\"source\">\n <img src=\"https://assets-cdn.github.com/favicon.ico\" class=\"site-icon\" width=\"32\" height=\"32\">\n <a href=\"https://github.com/alejandrodebus/Pytorch-Utils\" target=\"_blank\" rel=\"nofollow noopener\">GitHub</a>\n </header>\n <article class=\"onebox-body\">\n <img src=\"https://avatars3.githubusercontent.com/u/3844860?s=400&v=4\" class=\"thumbnail onebox-avatar\" width=\"400\" height=\"400\">\n\n<h3><a href=\"https://github.com/alejandrodebus/Pytorch-Utils\" target=\"_blank\" rel=\"nofollow noopener\">alejandrodebus/Pytorch-Utils</a></h3>\n\n<p>Pytorch-Utils - Useful functions to work with PyTorch. At the moment, there is a function to work with cross validation.</p>\n\n\n </article>\n <div class=\"onebox-metadata\">\n \n \n </div>\n <div style=\"clear: both\"></div>\n</aside>\n\n<p>Regards</p>",522 "post_number": 8,523 "post_type": 1,524 "posts_count": 30,525 "updated_at": "2018-07-10T23:50:24.293Z",526 "reply_count": 0,527 "reply_to_post_number": null,528 "quote_count": 0,529 "incoming_link_count": 273,530 "reads": 859,531 "readers_count": 858,532 "score": 1656.8,533 "yours": false,534 "topic_id": 15035,535 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",536 "display_username": "Alejandro",537 "primary_group_name": null,538 "flair_name": null,539 "flair_url": null,540 "flair_bg_color": null,541 "flair_color": null,542 "flair_group_id": null,543 "badges_granted": [],544 "version": 1,545 "can_edit": false,546 "can_delete": false,547 "can_recover": false,548 "can_see_hidden_post": false,549 "can_wiki": false,550 "link_counts": [551 {552 "url": "https://github.com/alejandrodebus/Pytorch-Utils",553 "internal": false,554 "reflection": false,555 "title": "GitHub - alejandrodebus/Pytorch-Utils: Useful functions to work with PyTorch. At the moment, there is a function to work with cross validation.",556 "clicks": 1672557 },558 {559 "url": "https://discuss.pytorch.org/t/crossvalidation/123628/2",560 "internal": true,561 "reflection": true,562 "title": "CrossValidation",563 "clicks": 3564 }565 ],566 "read": true,567 "user_title": null,568 "bookmarked": false,569 "actions_summary": [570 {571 "id": 2,572 "count": 8573 }574 ],575 "moderator": false,576 "admin": false,577 "staff": false,578 "user_id": 7745,579 "hidden": false,580 "trust_level": 1,581 "deleted_at": null,582 "user_deleted": false,583 "edit_reason": null,584 "can_view_edit_history": true,585 "wiki": false,586 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/8",587 "can_accept_answer": false,588 "can_unaccept_answer": false,589 "accepted_answer": false,590 "topic_accepted_answer": null591 },592 {593 "id": 68176,594 "name": "Lian Jiang",595 "username": "Lian_Jiang",596 "avatar_template": "/letter_avatar_proxy/v4/letter/l/5fc32e/{size}.png",597 "created_at": "2018-09-28T17:48:07.773Z",598 "cooked": "<p><a class=\"mention\" href=\"/u/ptrblck\">@ptrblck</a>, thanks for the clue of using skorch. I am new to skorch and pytorch. My understanding is that skorch is a pytorch wrapper for sklearn. I found sklearn seems not to support CNN by searching online. For example, cross_val_score need sklearn estimators. sklearn model_selection fit function need X: array-like, shape = [n_samples, n_features] instead of images. Please help me understand how skorch can help cross validation for CNN. Thanks.</p>",599 "post_number": 9,600 "post_type": 1,601 "posts_count": 30,602 "updated_at": "2018-09-28T17:51:22.302Z",603 "reply_count": 1,604 "reply_to_post_number": 2,605 "quote_count": 0,606 "incoming_link_count": 207,607 "reads": 726,608 "readers_count": 725,609 "score": 1185.2,610 "yours": false,611 "topic_id": 15035,612 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",613 "display_username": "Lian Jiang",614 "primary_group_name": null,615 "flair_name": null,616 "flair_url": null,617 "flair_bg_color": null,618 "flair_color": null,619 "flair_group_id": null,620 "badges_granted": [],621 "version": 1,622 "can_edit": false,623 "can_delete": false,624 "can_recover": false,625 "can_see_hidden_post": false,626 "can_wiki": false,627 "read": true,628 "user_title": null,629 "reply_to_user": {630 "id": 3534,631 "username": "ptrblck",632 "name": "",633 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"634 },635 "bookmarked": false,636 "actions_summary": [],637 "moderator": false,638 "admin": false,639 "staff": false,640 "user_id": 9570,641 "hidden": false,642 "trust_level": 1,643 "deleted_at": null,644 "user_deleted": false,645 "edit_reason": null,646 "can_view_edit_history": true,647 "wiki": false,648 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/9",649 "can_accept_answer": false,650 "can_unaccept_answer": false,651 "accepted_answer": false,652 "topic_accepted_answer": null653 },654 {655 "id": 68361,656 "name": "",657 "username": "ptrblck",658 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",659 "created_at": "2018-09-30T03:57:35.541Z",660 "cooked": "<p>Skorch tries to add exactly the missing compatibility of scikit-learn for PyTorch.<br>\nThe <a href=\"https://skorch.readthedocs.io/en/latest/?badge=latest\">docs</a> have some good examples.<br>\nE.g. using the <code>NeuralNet</code> class you can call methods like <code>fit</code> and <code>predict</code> using PyTorch models in the background.</p>",661 "post_number": 10,662 "post_type": 1,663 "posts_count": 30,664 "updated_at": "2018-09-30T03:57:35.541Z",665 "reply_count": 2,666 "reply_to_post_number": 9,667 "quote_count": 0,668 "incoming_link_count": 54,669 "reads": 672,670 "readers_count": 671,671 "score": 414.4,672 "yours": false,673 "topic_id": 15035,674 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",675 "display_username": "",676 "primary_group_name": null,677 "flair_name": null,678 "flair_url": null,679 "flair_bg_color": null,680 "flair_color": null,681 "flair_group_id": null,682 "badges_granted": [],683 "version": 1,684 "can_edit": false,685 "can_delete": false,686 "can_recover": false,687 "can_see_hidden_post": false,688 "can_wiki": false,689 "link_counts": [690 {691 "url": "https://skorch.readthedocs.io/en/latest/?badge=latest",692 "internal": false,693 "reflection": false,694 "title": "skorch documentation — skorch 0.4.0a0 documentation",695 "clicks": 601696 }697 ],698 "read": true,699 "user_title": "",700 "reply_to_user": {701 "id": 9570,702 "username": "Lian_Jiang",703 "name": "Lian Jiang",704 "avatar_template": "/letter_avatar_proxy/v4/letter/l/5fc32e/{size}.png"705 },706 "bookmarked": false,707 "actions_summary": [],708 "moderator": true,709 "admin": true,710 "staff": true,711 "user_id": 3534,712 "hidden": false,713 "trust_level": 2,714 "deleted_at": null,715 "user_deleted": false,716 "edit_reason": null,717 "can_view_edit_history": true,718 "wiki": false,719 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/10",720 "can_accept_answer": false,721 "can_unaccept_answer": false,722 "accepted_answer": false,723 "topic_accepted_answer": null724 },725 {726 "id": 97408,727 "name": "Nelson Tsaku",728 "username": "Tsakunelson",729 "avatar_template": "/user_avatar/discuss.pytorch.org/tsakunelson/{size}/9682_2.png",730 "created_at": "2019-03-05T13:42:49.182Z",731 "cooked": "<p><a class=\"mention\" href=\"/u/ptrblck\">@ptrblck</a> Is there specific way to put our X, y data (generated as training and validation Loaders already) in the grid search fit method directly? For instance what is the preferred X, y input for the fit function in this scenario? It fails when I Provide the generated training data Loader (images directly from directory) in the grid search fit function. some linky examples if there are, will be quite helpful. Thanks</p>",732 "post_number": 11,733 "post_type": 1,734 "posts_count": 30,735 "updated_at": "2019-03-05T13:42:49.182Z",736 "reply_count": 1,737 "reply_to_post_number": 10,738 "quote_count": 0,739 "incoming_link_count": 86,740 "reads": 571,741 "readers_count": 570,742 "score": 549.2,743 "yours": false,744 "topic_id": 15035,745 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",746 "display_username": "Nelson Tsaku",747 "primary_group_name": null,748 "flair_name": null,749 "flair_url": null,750 "flair_bg_color": null,751 "flair_color": null,752 "flair_group_id": null,753 "badges_granted": [],754 "version": 1,755 "can_edit": false,756 "can_delete": false,757 "can_recover": false,758 "can_see_hidden_post": false,759 "can_wiki": false,760 "read": true,761 "user_title": null,762 "reply_to_user": {763 "id": 3534,764 "username": "ptrblck",765 "name": "",766 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"767 },768 "bookmarked": false,769 "actions_summary": [],770 "moderator": false,771 "admin": false,772 "staff": false,773 "user_id": 12827,774 "hidden": false,775 "trust_level": 1,776 "deleted_at": null,777 "user_deleted": false,778 "edit_reason": null,779 "can_view_edit_history": true,780 "wiki": false,781 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/11",782 "can_accept_answer": false,783 "can_unaccept_answer": false,784 "accepted_answer": false,785 "topic_accepted_answer": null786 },787 {788 "id": 97587,789 "name": "岚烟之喏",790 "username": "BarryBA",791 "avatar_template": "/user_avatar/discuss.pytorch.org/barryba/{size}/9711_2.png",792 "created_at": "2019-03-06T06:58:49.776Z",793 "cooked": "<p>A question for cross-validation.<br>\nFirstly, we divide all the data into training samples and test samples, such as the proportion of 80% and 20%.<br>\nThen, we divide the training samples into five groups, four of which used as train data (64%) and one group used as validate data (16%). The 5-fold cross-validation can be carried out to find the suitable parameters of the CNN.<br>\nSo after the 5-fold cross validation, what should we do next for the testing samples? Should we use the parameters of CNN that determined in the cross validation stage, to train the network again on the 80% samples, and test on the 20% samples?<br>\nI am a little confused. Thank you.</p>",794 "post_number": 12,795 "post_type": 1,796 "posts_count": 30,797 "updated_at": "2019-03-06T06:58:49.776Z",798 "reply_count": 1,799 "reply_to_post_number": null,800 "quote_count": 0,801 "incoming_link_count": 154,802 "reads": 537,803 "readers_count": 536,804 "score": 882.4,805 "yours": false,806 "topic_id": 15035,807 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",808 "display_username": "岚烟之喏",809 "primary_group_name": null,810 "flair_name": null,811 "flair_url": null,812 "flair_bg_color": null,813 "flair_color": null,814 "flair_group_id": null,815 "badges_granted": [],816 "version": 1,817 "can_edit": false,818 "can_delete": false,819 "can_recover": false,820 "can_see_hidden_post": false,821 "can_wiki": false,822 "read": true,823 "user_title": "",824 "bookmarked": false,825 "actions_summary": [],826 "moderator": false,827 "admin": false,828 "staff": false,829 "user_id": 15785,830 "hidden": false,831 "trust_level": 2,832 "deleted_at": null,833 "user_deleted": false,834 "edit_reason": null,835 "can_view_edit_history": true,836 "wiki": false,837 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/12",838 "can_accept_answer": false,839 "can_unaccept_answer": false,840 "accepted_answer": false,841 "topic_accepted_answer": null842 },843 {844 "id": 97647,845 "name": "",846 "username": "ptrblck",847 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",848 "created_at": "2019-03-06T11:38:27.539Z",849 "cooked": "<p>Based on the <a href=\"https://skorch.readthedocs.io/en/stable/net.html#skorch.net.NeuralNet.fit\">.fit() docs</a> the fallback should be <code>skorch.dataset.Dataset</code> in case all other inputs won’t work:</p>\n<blockquote>\n<p>If this doesn’t work with your data, you have to pass a <code>Dataset</code> that can deal with the data.</p>\n</blockquote>",850 "post_number": 13,851 "post_type": 1,852 "posts_count": 30,853 "updated_at": "2019-03-06T11:38:27.539Z",854 "reply_count": 2,855 "reply_to_post_number": 11,856 "quote_count": 0,857 "incoming_link_count": 170,858 "reads": 497,859 "readers_count": 496,860 "score": 959.4,861 "yours": false,862 "topic_id": 15035,863 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",864 "display_username": "",865 "primary_group_name": null,866 "flair_name": null,867 "flair_url": null,868 "flair_bg_color": null,869 "flair_color": null,870 "flair_group_id": null,871 "badges_granted": [],872 "version": 1,873 "can_edit": false,874 "can_delete": false,875 "can_recover": false,876 "can_see_hidden_post": false,877 "can_wiki": false,878 "link_counts": [879 {880 "url": "https://skorch.readthedocs.io/en/stable/net.html#skorch.net.NeuralNet.fit",881 "internal": false,882 "reflection": false,883 "title": "skorch.net — skorch 0.5.0.post0 documentation",884 "clicks": 37885 }886 ],887 "read": true,888 "user_title": "",889 "reply_to_user": {890 "id": 12827,891 "username": "Tsakunelson",892 "name": "Nelson Tsaku",893 "avatar_template": "/user_avatar/discuss.pytorch.org/tsakunelson/{size}/9682_2.png"894 },895 "bookmarked": false,896 "actions_summary": [],897 "moderator": true,898 "admin": true,899 "staff": true,900 "user_id": 3534,901 "hidden": false,902 "trust_level": 2,903 "deleted_at": null,904 "user_deleted": false,905 "edit_reason": null,906 "can_view_edit_history": true,907 "wiki": false,908 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/13",909 "can_accept_answer": false,910 "can_unaccept_answer": false,911 "accepted_answer": false,912 "topic_accepted_answer": null913 },914 {915 "id": 97649,916 "name": "",917 "username": "ptrblck",918 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",919 "created_at": "2019-03-06T11:42:48.098Z",920 "cooked": "<p><a class=\"mention\" href=\"/u/rasbt\">@rasbt</a> explains CV beautifully in <a href=\"https://sebastianraschka.com/blog/2016/model-evaluation-selection-part3.html\" rel=\"nofollow noopener\">his blog post</a> as well as his <a href=\"https://github.com/rasbt/stat479-machine-learning-fs18/tree/master/10_eval-cv\" rel=\"nofollow noopener\">lecture notes</a>. It’s always my source for a quick reassurance if I’m in doubt. <img src=\"https://discuss.pytorch.org/images/emoji/apple/wink.png?v=6\" title=\":wink:\" class=\"emoji\" alt=\":wink:\"></p>",921 "post_number": 14,922 "post_type": 1,923 "posts_count": 30,924 "updated_at": "2019-03-06T11:42:48.098Z",925 "reply_count": 1,926 "reply_to_post_number": 12,927 "quote_count": 0,928 "incoming_link_count": 76,929 "reads": 483,930 "readers_count": 482,931 "score": 588.6,932 "yours": false,933 "topic_id": 15035,934 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",935 "display_username": "",936 "primary_group_name": null,937 "flair_name": null,938 "flair_url": null,939 "flair_bg_color": null,940 "flair_color": null,941 "flair_group_id": null,942 "badges_granted": [],943 "version": 1,944 "can_edit": false,945 "can_delete": false,946 "can_recover": false,947 "can_see_hidden_post": false,948 "can_wiki": false,949 "link_counts": [950 {951 "url": "https://sebastianraschka.com/blog/2016/model-evaluation-selection-part3.html",952 "internal": false,953 "reflection": false,954 "title": "Model evaluation, model selection, and algorithm selection in machine learning",955 "clicks": 517956 },957 {958 "url": "https://github.com/rasbt/stat479-machine-learning-fs18/tree/master/10_eval-cv",959 "internal": false,960 "reflection": false,961 "title": "stat479-machine-learning-fs18/10_eval-cv at master · rasbt/stat479-machine-learning-fs18 · GitHub",962 "clicks": 144963 }964 ],965 "read": true,966 "user_title": "",967 "reply_to_user": {968 "id": 15785,969 "username": "BarryBA",970 "name": "岚烟之喏",971 "avatar_template": "/user_avatar/discuss.pytorch.org/barryba/{size}/9711_2.png"972 },973 "bookmarked": false,974 "actions_summary": [975 {976 "id": 2,977 "count": 6978 }979 ],980 "moderator": true,981 "admin": true,982 "staff": true,983 "user_id": 3534,984 "hidden": false,985 "trust_level": 2,986 "deleted_at": null,987 "user_deleted": false,988 "edit_reason": null,989 "can_view_edit_history": true,990 "wiki": false,991 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/14",992 "can_accept_answer": false,993 "can_unaccept_answer": false,994 "accepted_answer": false,995 "topic_accepted_answer": null996 },997 {998 "id": 97759,999 "name": "Nelson Tsaku",1000 "username": "Tsakunelson",1001 "avatar_template": "/user_avatar/discuss.pytorch.org/tsakunelson/{size}/9682_2.png",1002 "created_at": "2019-03-06T17:59:07.540Z",1003 "cooked": "<p>Thanks for the reply <a class=\"mention\" href=\"/u/ptrblck\">@ptrblck</a>. It actually works with my dataset (dataSet from ImageFolder with transformations applied), but in the forward(X) method of the neural net, It passes a List of X, y tensors, instead of just X tensors, which is weird. I do Grid Search with Skorch, and here is the sample code:</p>\n<pre><code class=\"lang-auto\">start = time.time()\nwith torch.no_grad():\n\n net = NeuralNet(model, criterion= nn.CrossEntropyLoss,\n max_epochs = args.epochs,\n lr = args.learning_rate,\n batch_size = 32,\n optimizer=optim.SGD,\n optimizer_momentum = 0.09,\n iterator_train__shuffle = True,\n iterator_train__num_workers = 4,\n iterator_valid__shuffle = True,\n iterator_valid__num_workers = 4,\n train_split= predefined_split(valid_dataset),\n callbacks= [ lr_scheduler, epoch_acc, checkpoint],\n device = 'cuda')\n\n#pipe = Pipeline([('scale',StandardScaler()),\n# ('net',net)])\n#pipe.fit()\nparams = {\n 'lr':[0.01,0.02],\n 'max_epochs':[10,20],\n 'module_num_units': [10,20],\n }\ngs = GridSearchCV(net, params,refit=False, cv=5, scoring='accuracy')\n\ngs.fit(train_dataset, y=None)\nend = time.time()\nprint(\"Total training time: \"+ str(end - start))\n</code></pre>\n<p>Is there a specific way I need to specify to send just the corresponding X tensor in my forward function? Thanks</p>",1004 "post_number": 15,1005 "post_type": 1,1006 "posts_count": 30,1007 "updated_at": "2019-03-06T17:59:07.540Z",1008 "reply_count": 1,1009 "reply_to_post_number": 13,1010 "quote_count": 0,1011 "incoming_link_count": 242,1012 "reads": 487,1013 "readers_count": 486,1014 "score": 1312.4,1015 "yours": false,1016 "topic_id": 15035,1017 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",1018 "display_username": "Nelson Tsaku",1019 "primary_group_name": null,1020 "flair_name": null,1021 "flair_url": null,1022 "flair_bg_color": null,1023 "flair_color": null,1024 "flair_group_id": null,1025 "badges_granted": [],1026 "version": 1,1027 "can_edit": false,1028 "can_delete": false,1029 "can_recover": false,1030 "can_see_hidden_post": false,1031 "can_wiki": false,1032 "read": true,1033 "user_title": null,1034 "reply_to_user": {1035 "id": 3534,1036 "username": "ptrblck",1037 "name": "",1038 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"1039 },1040 "bookmarked": false,1041 "actions_summary": [],1042 "moderator": false,1043 "admin": false,1044 "staff": false,1045 "user_id": 12827,1046 "hidden": false,1047 "trust_level": 1,1048 "deleted_at": null,1049 "user_deleted": false,1050 "edit_reason": null,1051 "can_view_edit_history": true,1052 "wiki": false,1053 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/15",1054 "can_accept_answer": false,1055 "can_unaccept_answer": false,1056 "accepted_answer": false,1057 "topic_accepted_answer": null1058 },1059 {1060 "id": 97798,1061 "name": "",1062 "username": "ptrblck",1063 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1064 "created_at": "2019-03-06T22:22:19.508Z",1065 "cooked": "<p>The <code>skorch.dataset.Dataset</code> implementation is not the same as <code>torch.utils.data.Dataset</code> as described <a href=\"https://skorch.readthedocs.io/en/stable/user/dataset.html#id1\" rel=\"nofollow noopener\">here</a>. Could you try to wrap your data in the <code>skorch</code> implementation and pass it to the <code>fit</code> function?</p>",1066 "post_number": 16,1067 "post_type": 1,1068 "posts_count": 30,1069 "updated_at": "2019-03-06T22:22:19.508Z",1070 "reply_count": 1,1071 "reply_to_post_number": 15,1072 "quote_count": 0,1073 "incoming_link_count": 1777,1074 "reads": 428,1075 "readers_count": 427,1076 "score": 8990.6,1077 "yours": false,1078 "topic_id": 15035,1079 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",1080 "display_username": "",1081 "primary_group_name": null,1082 "flair_name": null,1083 "flair_url": null,1084 "flair_bg_color": null,1085 "flair_color": null,1086 "flair_group_id": null,1087 "badges_granted": [],1088 "version": 1,1089 "can_edit": false,1090 "can_delete": false,1091 "can_recover": false,1092 "can_see_hidden_post": false,1093 "can_wiki": false,1094 "link_counts": [1095 {1096 "url": "https://skorch.readthedocs.io/en/stable/user/dataset.html#id1",1097 "internal": false,1098 "reflection": false,1099 "title": "Dataset — skorch 0.5.0.post0 documentation",1100 "clicks": 2491101 }1102 ],1103 "read": true,1104 "user_title": "",1105 "reply_to_user": {1106 "id": 12827,1107 "username": "Tsakunelson",1108 "name": "Nelson Tsaku",1109 "avatar_template": "/user_avatar/discuss.pytorch.org/tsakunelson/{size}/9682_2.png"1110 },1111 "bookmarked": false,1112 "actions_summary": [1113 {1114 "id": 2,1115 "count": 11116 }1117 ],1118 "moderator": true,1119 "admin": true,1120 "staff": true,1121 "user_id": 3534,1122 "hidden": false,1123 "trust_level": 2,1124 "deleted_at": null,1125 "user_deleted": false,1126 "edit_reason": null,1127 "can_view_edit_history": true,1128 "wiki": false,1129 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/16",1130 "can_accept_answer": false,1131 "can_unaccept_answer": false,1132 "accepted_answer": false,1133 "topic_accepted_answer": null1134 },1135 {1136 "id": 99210,1137 "name": "岚烟之喏",1138 "username": "BarryBA",1139 "avatar_template": "/user_avatar/discuss.pytorch.org/barryba/{size}/9711_2.png",1140 "created_at": "2019-03-13T09:32:36.283Z",1141 "cooked": "<p><img src=\"https://discuss.pytorch.org/images/emoji/apple/+1.png?v=6\" title=\":+1:\" class=\"emoji\" alt=\":+1:\"> Thank you very much!</p>",1142 "post_number": 17,1143 "post_type": 1,1144 "posts_count": 30,1145 "updated_at": "2019-03-13T09:32:36.283Z",1146 "reply_count": 0,1147 "reply_to_post_number": 14,1148 "quote_count": 0,1149 "incoming_link_count": 54,1150 "reads": 415,1151 "readers_count": 414,1152 "score": 398.0,1153 "yours": false,1154 "topic_id": 15035,1155 "topic_slug": "what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn",1156 "display_username": "岚烟之喏",1157 "primary_group_name": null,1158 "flair_name": null,1159 "flair_url": null,1160 "flair_bg_color": null,1161 "flair_color": null,1162 "flair_group_id": null,1163 "badges_granted": [],1164 "version": 1,1165 "can_edit": false,1166 "can_delete": false,1167 "can_recover": false,1168 "can_see_hidden_post": false,1169 "can_wiki": false,1170 "read": true,1171 "user_title": "",1172 "reply_to_user": {1173 "id": 3534,1174 "username": "ptrblck",1175 "name": "",1176 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"1177 },1178 "bookmarked": false,1179 "actions_summary": [1180 {1181 "id": 2,1182 "count": 11183 }1184 ],1185 "moderator": false,1186 "admin": false,1187 "staff": false,1188 "user_id": 15785,1189 "hidden": false,1190 "trust_level": 2,1191 "deleted_at": null,1192 "user_deleted": false,1193 "edit_reason": null,1194 "can_view_edit_history": true,1195 "wiki": false,1196 "post_url": "/t/what-is-the-best-way-to-apply-k-fold-cross-validation-in-cnn/15035/17",1197 "can_accept_answer": false,1198 "can_unaccept_answer": false,1199 "accepted_answer": false,1200 "topic_accepted_answer": null