You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defmixup_one_target(x, y, gpu, alpha=1.0, is_bias=False):
"""Returns mixed inputs, mixed targets, and lambda
"""
ifalpha>0:
lam=np.random.beta(alpha, alpha)
else:
lam=1
ifis_bias:
lam=max(lam, 1-lam)
index=torch.randperm(x.size(0)).cuda(gpu)
mixed_x=lam*x+ (1-lam) *x[index]
mixed_y=lam*y+ (1-lam) *y[index]
returnmixed_x, mixed_y, lam
In the code snippet above, a single lam parameter is selected for all mix-up operations. In google's implementation of MixMatch they sample a beta distribution individually for each sample (see code below). Is there a reason for the choice to only sample the beta distribution once here?
TorchSSL/models/mixmatch/mixmatch_utils.py
Lines 23 to 37 in b45c3b3
In the code snippet above, a single
lam
parameter is selected for all mix-up operations. In google's implementation of MixMatch they sample a beta distribution individually for each sample (see code below). Is there a reason for the choice to only sample the beta distribution once here?https://github.com/google-research/mixmatch/blob/1011a1d51eaa9ca6f5dba02096a848d1fe3fc38e/libml/layers.py#L166-L175
The text was updated successfully, but these errors were encountered: