Method
__init__
(self,
linear=False,
eps=1e-6,
reduction='mean',
loss_weight=1.0,
mode='log')
Source from the content-addressed store, hash-verified
| 251 | Default: 'log' |
| 252 | """ |
| 253 | def __init__(self, |
| 254 | linear=False, |
| 255 | eps=1e-6, |
| 256 | reduction='mean', |
| 257 | loss_weight=1.0, |
| 258 | mode='log'): |
| 259 | super(IoULoss, self).__init__() |
| 260 | assert mode in ['linear', 'square', 'log'] |
| 261 | if linear: |
| 262 | mode = 'linear' |
| 263 | warnings.warn('DeprecationWarning: Setting "linear=True" in ' |
| 264 | 'IOULoss is deprecated, please use "mode=`linear`" ' |
| 265 | 'instead.') |
| 266 | self.mode = mode |
| 267 | self.linear = linear |
| 268 | self.eps = eps |
| 269 | self.reduction = reduction |
| 270 | self.loss_weight = loss_weight |
| 271 | |
| 272 | def forward(self, |
| 273 | pred, |
Tested by
no test coverage detected