Cycle through all models?

Hi, this class is amazing! I was playing with the notebook from lesson 1 and I wanted to cycle through all possible values for models.* to see which one would perform best. I would like to write a couple of lines of code that would allow me to test alexnet, then darknet, then resnet 16, etc. models.* are all functions. Is there a way to pass these in a cycle?

This is where I’ve for so far

Thank you very much and congratulations on the amazing work!


def run_fn(fn):
    return globals()[fn]

for x in [func for func in dir(models) if callable(getattr(models,func))]:
    if x[0].islower():
        print(f'{x} isa {type(x)}')
            # error on next line -- needs a fun, gets a str
            cnn_learner(data, run_fn(f'models.{x}'), metrics=error_rate).fit_one_cycle(4)