carpentries-incubator / deep-learning-intro

Learn Deep Learning with Python
https://carpentries-incubator.github.io/deep-learning-intro/
Other
29 stars 37 forks source link

Using prefilled notebooks #477

Open qualiaMachine opened 4 weeks ago

qualiaMachine commented 4 weeks ago

I taught this lesson last week (third time!) at the University of Wisconsin-Madison. This year, I experimented with using prefilled Jupyter notebooks rather than having everyone type out all of the code from scratch. I tried the same approach at a recent Intro to Text Analysis workshop, and learners seemed to really appreciate that we could spend more time unpacking concepts and less time fiddling with typos. I think I would generally argue in favor of using prefilled notebooks at any workshop that (a) requires more time unpacking concepts / intended for intermediates and (b) assumes learners already have background programming experience. That said, additional exercises may be warranted when using too much prefilled code (mainly to get additional practice using the Keras syntax).

Using prefilled notebooks, we were able to effectively teach episodes 1-4 (getting through advanced layers) in a 3 half-day schedule (8:30am-12:30pm on each day; 10 min. breaks every hour). We got about halfway through the transfer learning episode before we had to cut things off. I will most likely try a 4 half-day schedule next year.

If others are on board with using prefilled notebooks or want to give it a shot, here is a link to a Jupyter notebook you can use to convert each episode's R markdown file to a Jupyter notebook (allowing us to quickly generate prefilled scripts when lesson materials evolve). I'm happy to upload this notebook to the repo if the maintainers/authors are in support of this. I'm not expecting everyone to agree with the use of prefilled notebooks, but I think it's worthwhile to give other instructors the option. I'll warn folks that the conversion isn't 100% perfect. Code output that is shown on the lesson page is shown in the converted notebooks, and those cells have to be deleted manually.

svenvanderburg commented 3 weeks ago

@qualiaMachine thanks for the suggestion and nice that this worked out in your teaching! I agree that in more advanced carpentries-style lessons (like this one) it makes sense to focus more on advanced concepts than on getting to know the syntax.

Some thoughts:

  1. For us, and for I think for others too, we would still prefer live coding instead of prefilled notebooks.
  2. Maintaining pre-filled notebooks is extra work (although it would help keeping all the figures up to date).

3 possible solutions: A. Add a note on possibility of using pre-filled notebooks to the instructor notes with a link to the jupyter notebook converter. B. Maintain pre-filled jupyter notebooks C. Somehow automatically sync markdown files with pre-filled notebooks, or at least have a Github action check

Other thoughts @psteinb @colinsauze @carschno @dsmits ?

carschno commented 3 weeks ago

I am curious about the details of the initial issue. How much extra time does it cost to type the commands accurately? Just executing pre-filled notebook cells is faster, of course, but it also skips the part in which learners interactively experience the small practical difficulties by typing out the code. Are the learners able to cope with the increased speed?

I suppose it depends on the audience. In general, however, I understand that the extra time needed for building things up from the bottom is part of the Carpentries philosophy.

Furthermore, notebooks are notoriously difficult to maintain in Git. A solution might be to keep the cell contents (linked) in the instructor notes so that instructors can copy-paste them into a notebook and run them anywhere, without having to type them out. That might be an option in particular for longer functions that are less relevant for understanding the lesson material.

qualiaMachine commented 3 weeks ago

@carschno It's less an issue and more a difference in priorities. For my learners, I'm less concerned that they memorize Keras syntax perfectly and more concerned that they understand the concepts and procedures of a typical deep learning workflow. PyTorch is where most people (in research anyways) end up transitioning to anyways. With less time spent typing, we have more time to address the many questions that come up during this workshop. Notes can be added to the notebook as we go along to make things more concrete.

That said, even if your goal is to teach Keras syntax, there is a lot of non-Keras code in this lesson. A lot of it is Python basics, data manipulation, plotting, etc. A partially filled notebook (with most of the Keras stuff left out) would help with this. Copying and pasting isn't a bad option, but it can be nice to have the lesson notes available for learners as we go over the concepts (and also saves learners the hassle of having two windows open).

I wouldn't suggest we try to maintain notebooks directly, but we could maintain a conversion script to generate the notebooks (option A or C in @svenvanderburg 's comment).