Skip to content

Updated API with v0.2.0

Compare
Choose a tag to compare
@havakv havakv released this 17 Dec 10:24
· 10 commits to master since this release

Some restructuring to make Model more general. This means that some earlier code might break.

Main differences are:

  • model.predict will use the model.net.predict method if available. If not, it will use the old model.net.forward.
  • model.predict_net will use model.net.forward.
  • Both predict methods now works with dataloader input.
  • Removed predict_dataloader as predict works with dataloaders.
  • Both predict methods take the optional argument func which can be a torch function that is applied to the output. E.g., func=torch.sigmoid can be used for binary classification.
  • target is now an optional argument in fit.
  • compute_metrics take the argument data instead of input, target.
  • set_device can be used to change the device of the model. E.g., model.set_device('cpu') will enable the model to work on cpu.
  • Renamed DataLoaderSlice to DataLoaderBatch.