A quick way to test CNN on a separate test set

Quick testing

One of the problems I am facing while using FastAI is testing on a separate data set. I need to keep the test set invisible to the classifier while quickly and frequency testing. In other words, the test set is not a subset of my dataset.
I did not find an easy or quick way of doing it using FastAI functions. Hence, I wrote a function that links the model weights to the test-set without interrupting the training process. It returns testing accuracy instantly. It also keeps the test-set invisible to the classifier.

  • Usage:
    fastai_test(img_dir,model_dir,learner_type,img_size,labels,tfms)

This helps to avoid overfitting. It gives you instant feedback when you change hyperparameters or do other training techniques like progressive resizing and transfer learning. For my projects, this improved my model drastically.

I am wondering if I missed an easier way of doing so? Also, this is still the first version, I am open to feedback and other contributions.
@jeremy #fastai-users #fastai-users:fastai-dev