I have some trouble navigating the fastai2 codebase. I tried to do this using a simple editor instead of nbdev so I wonder if nbdev is required. For example I wanted to know which loss function is used for simple image classification (X-entropy loss with weights for unbalanced classes I guess, but how are the weights calculated)?
vision/learner.py. This function has an argument called
loss_func which is set to
None by default and passed to
Learner. In the constructor I find the following code:
if loss_func is None: loss_func = getattr(dls.train_ds, 'loss_func', None)
dls has to have it by default. After some more digging I find that the type of
DataLoaders but I could neither find it in
DataLoaders or in
DataSet itself. I also found the class
layers.py but could not figure out if and this is instantiated when calling
Please enlighten me!