Replace sampler balancing by loss balancing
This MR removes balancing of the training sampler and replaces it by loss balancing, if the loss function allows it (= contains a pos_weight
parameter). Binary and exclusive, multi-class targets are supported. Using a database with multi-class, non-exclusive targets will raise a NotImplementedError
for now.
Models now expect the class and arguments of the loss used instead of an instance, just like it is done with the optimizer. It is instantiated in trainer.py::run() and balanced if possible.
A base Model
class has been created that other models should inherit from.
closes #6 (closed)
Merge request reports
Activity
- Resolved by André Anjos
- Resolved by André Anjos
- Resolved by André Anjos
- Resolved by André Anjos
- Resolved by André Anjos
@dcarron: thanks for this useful set of changes. I left some minor comments, but this looks great already.
added 1 commit
- 6f04a219 - [model] Use a single type of loss for train and validation
added 1 commit
- 9aff0292 - [logging] Prevent PL from adding dataloader index to logged metrics
- Resolved by André Anjos
@dcarron: thanks for this useful set of changes. I left some minor comments, but this looks great already.
@dcarron: thanks for the reaction - are we ready?
requested review from @andre.anjos
assigned to @dcarron
mentioned in issue #6 (closed)