Skip to content

Commit 68dc0fb

Browse files
Fix EnsembleView FileNotFoundError in example notebooks by using explicit best_checkpoint_fn_kwargs (#21)
* Initial plan * Fix default loss_file_name from 'epe' to 'loss' in Ensemble, EnsembleView, and NetworkView Co-authored-by: lappalainenj <34949352+lappalainenj@users.noreply.github.com> * Revert source defaults to 'epe'; add explicit best_checkpoint_fn_kwargs to all example notebooks Co-authored-by: lappalainenj <34949352+lappalainenj@users.noreply.github.com> * Revert flyvis/analysis/__main__.ipynb to original state Co-authored-by: lappalainenj <34949352+lappalainenj@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lappalainenj <34949352+lappalainenj@users.noreply.github.com>
1 parent bb8218f commit 68dc0fb

11 files changed

Lines changed: 31 additions & 31 deletions

docs/docs/examples/__main__.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ensemble_name = "flow/0001" # type: str
3535

3636
```python
3737
validation_subdir = "validation"
38-
loss_file_name = "epe"
38+
loss_file_name = "loss"
3939
```
4040

4141

examples/02_flyvision_optic_flow_task.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@
18301830
},
18311831
"outputs": [],
18321832
"source": [
1833-
"ensemble = EnsembleView(\"flow/0000\")"
1833+
"EnsembleView(\n \"flow/0000\",\n best_checkpoint_fn_kwargs={\"validation_subdir\": \"validation\", \"loss_file_name\": \"loss\"},\n)"
18341834
]
18351835
},
18361836
{
@@ -2613,4 +2613,4 @@
26132613
},
26142614
"nbformat": 4,
26152615
"nbformat_minor": 5
2616-
}
2616+
}

examples/03_flyvision_flash_responses.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@
522522
"source": [
523523
"from flyvis import EnsembleView\n",
524524
"\n",
525-
"ensemble = EnsembleView(\"flow/0000\")"
525+
"EnsembleView(\n \"flow/0000\",\n best_checkpoint_fn_kwargs={\"validation_subdir\": \"validation\", \"loss_file_name\": \"loss\"},\n)"
526526
]
527527
},
528528
{
@@ -1163,4 +1163,4 @@
11631163
},
11641164
"nbformat": 4,
11651165
"nbformat_minor": 1
1166-
}
1166+
}

examples/04_flyvision_moving_edge_responses.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@
714714
"source": [
715715
"from flyvis import EnsembleView\n",
716716
"\n",
717-
"ensemble = EnsembleView(results_dir / \"flow/0000\")\n",
717+
"EnsembleView(\n results_dir / \"flow/0000\",\n best_checkpoint_fn_kwargs={\"validation_subdir\": \"validation\", \"loss_file_name\": \"loss\"},\n)\n",
718718
"# choose best 10\n",
719719
"ensemble = ensemble[ensemble.argsort()[:10]]"
720720
]
@@ -1807,4 +1807,4 @@
18071807
},
18081808
"nbformat": 4,
18091809
"nbformat_minor": 1
1810-
}
1810+
}

examples/05_flyvision_umap_and_clustering_models.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
"outputs": [],
281281
"source": [
282282
"# We load the ensemble trained on the optic flow task\n",
283-
"ensemble = flyvis.EnsembleView(\"flow/0000\")"
283+
"EnsembleView(\n \"flow/0000\",\n best_checkpoint_fn_kwargs={\"validation_subdir\": \"validation\", \"loss_file_name\": \"loss\"},\n)"
284284
]
285285
},
286286
{
@@ -1307,4 +1307,4 @@
13071307
},
13081308
"nbformat": 4,
13091309
"nbformat_minor": 2
1310-
}
1310+
}

examples/07_flyvision_providing_custom_stimuli.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@
16001600
},
16011601
"outputs": [],
16021602
"source": [
1603-
"ensemble = EnsembleView(flyvis.results_dir / \"flow/0000\")"
1603+
"EnsembleView(\n flyvis.results_dir / \"flow/0000\",\n best_checkpoint_fn_kwargs={\"validation_subdir\": \"validation\", \"loss_file_name\": \"loss\"},\n)"
16041604
]
16051605
},
16061606
{
@@ -2781,4 +2781,4 @@
27812781
},
27822782
"nbformat": 4,
27832783
"nbformat_minor": 5
2784-
}
2784+
}

examples/__main__.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"outputs": [],
7878
"source": [
7979
"validation_subdir = \"validation\"\n",
80-
"loss_file_name = \"epe\""
80+
"loss_file_name = \"loss\""
8181
]
8282
},
8383
{
@@ -721,7 +721,7 @@
721721
"description": "",
722722
"description_allow_html": false,
723723
"layout": "IPY_MODEL_2ffda1070b9f4338923299545260da7b",
724-
"placeholder": "",
724+
"placeholder": "\u200b",
725725
"style": "IPY_MODEL_5ce099a0af2b4d5b8a2992b4fd19f5aa",
726726
"tabbable": null,
727727
"tooltip": null,
@@ -760,7 +760,7 @@
760760
"description": "",
761761
"description_allow_html": false,
762762
"layout": "IPY_MODEL_dfeac10f91f641b285163a68772ec9e7",
763-
"placeholder": "",
763+
"placeholder": "\u200b",
764764
"style": "IPY_MODEL_2ce663b67d574a5085e384c077bd0ae9",
765765
"tabbable": null,
766766
"tooltip": null,
@@ -905,4 +905,4 @@
905905
},
906906
"nbformat": 4,
907907
"nbformat_minor": 4
908-
}
908+
}

examples/figure_01_fly_visual_system.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
},
5151
"outputs": [],
5252
"source": [
53-
"ensemble = EnsembleView(\"flow/0000\")"
53+
"EnsembleView(\n \"flow/0000\",\n best_checkpoint_fn_kwargs={\"validation_subdir\": \"validation\", \"loss_file_name\": \"loss\"},\n)"
5454
]
5555
},
5656
{
@@ -638,7 +638,7 @@
638638
"description": "",
639639
"description_allow_html": false,
640640
"layout": "IPY_MODEL_b1ca4db450744f8a96de2f54f98e32fc",
641-
"placeholder": "",
641+
"placeholder": "\u200b",
642642
"style": "IPY_MODEL_cab0b0c56ea040fe8af62d21ecc38c31",
643643
"tabbable": null,
644644
"tooltip": null,
@@ -661,7 +661,7 @@
661661
"description": "",
662662
"description_allow_html": false,
663663
"layout": "IPY_MODEL_031fce4c96a542b99a2b994eacde88c4",
664-
"placeholder": "",
664+
"placeholder": "\u200b",
665665
"style": "IPY_MODEL_394f1a8124b6497e8495a2f42982b4a8",
666666
"tabbable": null,
667667
"tooltip": null,
@@ -879,4 +879,4 @@
879879
},
880880
"nbformat": 4,
881881
"nbformat_minor": 5
882-
}
882+
}

examples/figure_02_simple_stimuli_responses.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"outputs": [],
4949
"source": [
50-
"ensemble = EnsembleView(\"flow/0000\")"
50+
"EnsembleView(\n \"flow/0000\",\n best_checkpoint_fn_kwargs={\"validation_subdir\": \"validation\", \"loss_file_name\": \"loss\"},\n)"
5151
]
5252
},
5353
{
@@ -579,7 +579,7 @@
579579
"description": "",
580580
"description_allow_html": false,
581581
"layout": "IPY_MODEL_45f71efdb7344ae0b81a8ed754f3ec3c",
582-
"placeholder": "",
582+
"placeholder": "\u200b",
583583
"style": "IPY_MODEL_d41cfcff82d342b0aeeddf0e9ab21c53",
584584
"tabbable": null,
585585
"tooltip": null,
@@ -671,7 +671,7 @@
671671
"description": "",
672672
"description_allow_html": false,
673673
"layout": "IPY_MODEL_d697d95874de4d59ae9ff5702edc08e3",
674-
"placeholder": "",
674+
"placeholder": "\u200b",
675675
"style": "IPY_MODEL_07d0b81b6625493cbd4253ae41d9bafe",
676676
"tabbable": null,
677677
"tooltip": null,
@@ -757,4 +757,4 @@
757757
},
758758
"nbformat": 4,
759759
"nbformat_minor": 5
760-
}
760+
}

examples/figure_03_naturalistic_stimuli_responses.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"outputs": [],
4444
"source": [
45-
"ensemble = EnsembleView(\"flow/0000\")"
45+
"EnsembleView(\n \"flow/0000\",\n best_checkpoint_fn_kwargs={\"validation_subdir\": \"validation\", \"loss_file_name\": \"loss\"},\n)"
4646
]
4747
},
4848
{
@@ -358,7 +358,7 @@
358358
"description": "",
359359
"description_allow_html": false,
360360
"layout": "IPY_MODEL_2f19915e0bdb43b185f978cfa714e0e2",
361-
"placeholder": "",
361+
"placeholder": "\u200b",
362362
"style": "IPY_MODEL_6b4ff77636d549bf920b9b8c86f633fd",
363363
"tabbable": null,
364364
"tooltip": null,
@@ -602,7 +602,7 @@
602602
"description": "",
603603
"description_allow_html": false,
604604
"layout": "IPY_MODEL_2ce5d0b2a1784b19a53e52a6edd7d968",
605-
"placeholder": "",
605+
"placeholder": "\u200b",
606606
"style": "IPY_MODEL_7e60d2ccbcea43b2b1bde6ebb309c6da",
607607
"tabbable": null,
608608
"tooltip": null,
@@ -710,4 +710,4 @@
710710
},
711711
"nbformat": 4,
712712
"nbformat_minor": 5
713-
}
713+
}

0 commit comments

Comments
 (0)