You want to create a
Learner object. The most basic way to do that is to do
learn = learner(data, model, loss_func = loss_func)
data should be a
DataBunch, that feeds data to your model.
Your model should then process that data and return a prediction vector which will be used with the
loss_func and a target vector to compute the loss. You can use the
data_block API to construct the DataBunch. If your models takes multiple input in its forward pass, your
collate_fn will have to stack them in the form
((x1, x2, x3, ...), y) where x1, x2, x3, … are the different arguments of the
method of your model, if not, either
x, y or
[x], y are fine and most likely you won’t have to touch the
collate_fn at all.