Fix non-prefetch variant of Mixup. Fixes #50

pull/52/head
Ross Wightman 5 years ago
parent 0d58c50fb1
commit 4748c6dff2

@ -439,7 +439,7 @@ def train_epoch(
lam = 1. lam = 1.
if not args.mixup_off_epoch or epoch < args.mixup_off_epoch: if not args.mixup_off_epoch or epoch < args.mixup_off_epoch:
lam = np.random.beta(args.mixup, args.mixup) lam = np.random.beta(args.mixup, args.mixup)
input.mul_(lam).add_(1 - lam, input.flip(0)) input = input.mul(lam).add_(1 - lam, input.flip(0))
target = mixup_target(target, args.num_classes, lam, args.smoothing) target = mixup_target(target, args.num_classes, lam, args.smoothing)
output = model(input) output = model(input)

Loading…
Cancel
Save