Skip to content

Linking data module to BCELoss is broken #131

@sfluegel05

Description

@sfluegel05

Problem

  • BCELoss requires access to the data module to calculate weights (the weight is based on the number of positive labels in the dataset)
  • This data module could (theoretically) be added to the config of the loss (which would be a lot of additional effort and a source of errors since the actual data used during training and the data used to calculate loss weights have to match)
  • The current solution was to link the data module to the BCELoss via add_arguments_to_parser
  • This has been commented out (most likely because it was breaking stuff when someone didn't want to use this loss)

Solution Option A

  • Fix argument linking s.t. it is possible to "conditionally link" arguments (only link for custom BCELoss class, not for other loss functions)

Solution Option B

  • Find another way to link the data module to the loss function (maybe by passing a reference from the model to the loss (which in turn checks which loss function is used)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions