delta.data.estimateClassweights¶
- delta.data.estimateClassweights(gene: Iterator, num_samples: int = 30) Tuple[float, ...]¶
Estimate the class weights to use with the weighted categorical cross-entropy based on the output of the trainGenerator_track output.
- Parameters
- genegenerator
Tracking U-Net training generator. (output of trainGenerator_seg/track)
- num_samplesint, optional
Number of batches to use for estimation. The default is 30.
- Returns
- class_weightstuple of floats
Relative weights of each class. Note that, if 0 elements of a certain class are present in the samples, the weight for this class will be set to 0.