Support `RandomChoice` - randomly pick from list!
See original GitHub issueShort Description
Let’s say in your training, you want to use all of the follows:
cutmix-mixup-fmix-mosaic
gaussian_blur-zoom_blur-motion_blur-median-blur
optical_distortion-elastic-transform-grid_distortion
equalization-clahe
grid_mask-cutput
- etc.
then it’s required to randomly pick one among others (in general) in a single pass during training, for example: [cutmix-zoom_blur-optical_distortion-clahe-cutput]
. So, it would be nice to have a functionality to feasibly do this task.
Papers Most of the top used libraries/frameworks offer similar strategies.
Existing Implementations
Other Information
In the title, the name RandomChoice
is picked for demonstration purposes. The thing is, we may need to introduce or modify any of the existing functionality if it’s reasonable to take.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Python random choice() function to select a random item from ...
Use random.choice() function to randomly select an item from a list, String, Dictionary, and set. Pick a single random number from a range....
Read more >How can I randomly select an item from a list? - Stack Overflow
In short, use random.sample method ... The sample method returns a new list containing elements from the population while leaving the original ...
Read more >Python Random choice() Method - W3Schools
The choice() method returns a randomly selected element from the specified sequence. The sequence can be a string, a range, a list, a...
Read more >Python | Select random value from a list - GeeksforGeeks
Using random.sample() to select random value from a list ... Python has a built-in function called random.sample(). The random module contains the ...
Read more >How to Randomly Select Elements From a List in Python
Selecting a Random Element From Python List · Using random.randint() · Using random.randrange() · Using random.choice().
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I like the way Albumnations
OneOf
works; but I don’t like that they take ap
parameter in their constructor for the augmentations themselves that behaves differently depending on context; very unintuitive.We should strive to support custom probabilities, but not in that way.
Awesome, thanks for the links @sebastian-sz and @chjort.
Here is my thought:
rate
parameter.So for a PR I’d like:
Feel free to send this PR @chjort