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
I understood the concepts here , but I am unable to figure out how I should use this github repo wth my pytorch dataset even after going throught h colab implementations.
In order for the mixing to happen you need a batch of data. So the way to implement it here would be to generate masks and mix each batch using the sample_and_apply function in fmix.py. That will give you mixed images, you also then need to mix your loss function with the lambdas returned by sample_and_apply, as is done in this example. Those two steps should allow you to train with FMix. Peudo-code would be something like:
alpha, decay_power = 1.0, 3.0
for epoch in range(max_epochs):
for batch, target in train_loader:
batch, perm, lambda = sample_and_apply(batch, alpha, decay_power, (128, 128))
out = my_model(batch)
loss = F.cross_entropy(out, target) * lambda + F.cross_entropy(out, target[perm]) * (1 - lambda)
Let me know if that helps and I can add a notebook or similar with it. Also, if you have any other suggestions for how this could be made easier then they would be much appreciated 👍
I understood the concepts here , but I am unable to figure out how I should use this github repo wth my pytorch dataset even after going throught h colab implementations.
I am using this classification dataset.
Pleas help
The text was updated successfully, but these errors were encountered: