Updated API with v0.2.0
Some restructuring to make Model
more general. This means that some earlier code might break.
Main differences are:
model.predict
will use themodel.net.predict
method if available. If not, it will use the oldmodel.net.forward
.model.predict_net
will usemodel.net.forward
.- Both
predict
methods now works with dataloader input. - Removed
predict_dataloader
as predict works with dataloaders. - Both
predict
methods take the optional argumentfunc
which can be atorch
function that is applied to the output. E.g.,func=torch.sigmoid
can be used for binary classification. target
is now an optional argument infit
.compute_metrics
take the argumentdata
instead ofinput, target
.set_device
can be used to change the device of themodel
. E.g.,model.set_device('cpu')
will enable the model to work on cpu.- Renamed
DataLoaderSlice
toDataLoaderBatch
.