super_loss
SuperLoss
¶
Bases: LossOp
Loss class to compute a 'super loss' (automatic curriculum learning) based on a regular loss.
This class adds automatic curriculum learning on top of any other loss metric. It is especially useful in for noisy datasets. See https://papers.nips.cc/paper/2020/file/2cfa8f9e50e0f510ede9d12338a5f564-Paper.pdf for details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
loss
|
LossOp
|
A loss object which we use to calculate the underlying regular loss. This should be an object of type fe.op.tensorop.loss.loss.LossOp. |
required |
threshold
|
Union[float, str]
|
Either a constant value corresponding to an average expected loss (for example log(n_classes) for cross-entropy classification), or 'exp' to use an exponential moving average loss. |
'exp'
|
regularization
|
float
|
The regularization parameter to use for the super loss (must by >0, as regularization approaches infinity the SuperLoss converges to the regular loss value). |
1.0
|
average_loss
|
bool
|
Whether the final loss should be averaged or not. |
True
|
output_confidence
|
Optional[str]
|
If not None then the confidence scores for each sample will be written into the specified key. This can be useful for finding difficult or mislabeled data. |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If the provided |
Source code in fastestimator/fastestimator/op/tensorop/loss/super_loss.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|