Fastai library notes

Thanks @ravivijay that’s a nice idea. One correction: there aren’t separate ‘torch’ and ‘pytorch’ libs in fastai - just one, for which the module is called ‘torch’, but it’s actually referring to pytorch! Pretty confusing… :wink:

Got it. We use only torch. Because torch was modified to work in python, it’s called pytorch.

Thank you!

Thanks for this library description. Does anyone know how I can get the final val_loss (or accuracy) from the learner object after running the fit function? When saving the weights learn.save(‘name’), I want to include the date and the val_loss in the ‘name’, for ease of finding later. Currently, I am doing this:

learn.fit(1e-2, 8, cycle_len=1)

preds,targs=learn.predict_with_targs()
targs_hot = one_hot(targs, preds.shape[1])
loss = preds.shape[1] * (targs_hot * preds).mean()

loss_str = “{:.03f}”.format(loss)
model_name = learn.models.name
now = datetime.datetime.now()
nowstr = now.strftime("%Y-%m-%d-%H-%M-")

learn.save(f’{nowstr}{model_name}{loss_str}dogbreeds’)
learn.load(f’{nowstr}{model_name}{loss_str}dogbreeds’)

I’d rather not have to do the validation prediction and loss calculation again, if the learn object has the loss data saved already. I searched in the metrics and data functions, but couldn’t find it. I also tried to seach the forums for the answer, but couldnt find it. Sorry if it is answered elsewhere.

Thanks again!

Hi. I am new to fast.ai. Will this library support gpu computations ?? Thanks in advance

Could anyone who can tell me why I can not install fastai package?