weight of a sample #23441
Replies: 3 comments 9 replies
|
👋 Hello @max-dev-14, thank you for your interest in Ultralytics 🚀! This is an automated response, and an Ultralytics engineer will also assist soon. We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered. If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it. If this is a custom training ❓ Question (like class imbalance / per-class sample weighting), please provide as much information as possible so we can point you to the right built-in options or recommended workflow, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results. Join the Ultralytics community where it suits you best 🙂. For real-time chat, head to Discord 🎧. Prefer in-depth discussions? Check out Discourse. Or dive into threads on our Subreddit to share knowledge with the community. UpgradeUpgrade to the latest pip install -U ultralyticsEnvironmentsYOLO may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLO Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit. |
|
You can try weighted dataloader: |

Uh oh!
There was an error while loading. Please reload this page.
I have heard that there is a technique to effectively train a model using an unbalanced dataset. The methodology is as follows:
Let's say there are two abstract categories: cats and dogs. But the number of cats is much less than the number of dogs (the case of an unbalanced dataset). You can set up the learning pipeline so that the sample weight is determined, which affects the gradient. For example, there are 100 cats and 10,000 dogs in the dataset. You indicate that the model should be more attentive to cats and change its weights faster than for dogs. It turns out that the model learns at different rates for different classes, since the model is more sensitive to errors in the cat category.
is this technique implemented in Ultralytics?
All reactions