Adding show_batch functionality to MixedItemList

I wanted to use the show_batch functionality with the MixedItemList class.

I’ve had a first attempt here. There are three main components:

  1. I added the reconstruct method to utilize the corresponding methods of the underlying ItemList's
  2. For an easy first implementation I implemented show_xys to initially display only one of the components of the MixedItemList in e.g. if my MixedItemList contained Tabular and Vision data, show_batch would only show either the table or the image. This is currently decided via a new attribute on MixedItemList -> display_index. It is hardcoded at the moment, I wasn’t sure the best way to implement this
  3. I had to modify the get_idx function in torch_core.py to account for the fact that when you used Tabular data within a MixedItemList you have nested lists that contain the Tensor data

It seems to work in my experiments. I would like to add a test, but I’m not sure how to test something that displays/plots data i.e show_batch

@sgugger Any advice on this generally?

MixedItemList is just a quick and dirty experiment for people wanting to mix different kinds of inputs. It’s not really properly supported by fastai and we won’t do anything about it until v2. If there is a way to make the show things work without changing other things in the library, I can look at a PR, but I wouldn’t want to make big changes just for this.

Thanks, that makes sense, probably not worth a PR in that case.

Out of interest, how much are mixed data types being prioritized on the fastai roadmap? It’s something I’m quite interested in, because a lot of the data I work with fit into this category (e.g. images with metadata). And what timeframe is Fastai v2 intended for?