-
Notifications
You must be signed in to change notification settings - Fork 621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RNGBase to be used as base for noise augmentations + Add GaussianNoise operator (as an example) #2846
Conversation
c6dcc28
to
8fc78d1
Compare
!build |
CI MESSAGE: [2260255]: BUILD STARTED |
CI MESSAGE: [2260255]: BUILD FAILED |
8fc78d1
to
e4bfa14
Compare
!build |
CI MESSAGE: [2260507]: BUILD STARTED |
CI MESSAGE: [2260507]: BUILD PASSED |
Signed-off-by: Joaquin Anton <janton@nvidia.com>
e4bfa14
to
a0f7362
Compare
template <typename T> | ||
bool SetupDists(typename Dist<T>::type* dists_data, int nsamples) { | ||
if (!mean_.IsDefined() && !stddev_.IsDefined()) { | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default constructed Dist is used. This mechanism is mainly used for cases where we don't need to create a per sample instance and we are fine with the default constructed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the user know that not providing mean and stdev would make DALI to follow such code path?
Asking mostly from the user point of view.
dali/operators/random/rng_base_gpu.h
Outdated
struct BlockDesc; | ||
|
||
template <> | ||
struct BlockDesc<false> { | ||
int sample_idx; | ||
void* start; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not output
to be consistent with BlockDesc<true>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do that.
Signed-off-by: Joaquin Anton <janton@nvidia.com>
!build |
CI MESSAGE: [2266847]: BUILD STARTED |
CI MESSAGE: [2266847]: BUILD FAILED |
CI MESSAGE: [2266847]: BUILD PASSED |
Signed-off-by: Joaquin Anton janton@nvidia.com
Why we need this PR?
What happened in this PR?
Fill relevant points, put NA otherwise. Replace anything inside []
Introduced a
NeedsInput
template argument to RNGBase to support a family of noise augmentation operators.*Created a
fn.noise.gaussian
as an example. The output ofnoise.gaussian(input, ...)
is tested by comparing toinput + random.normal(...)
*.random. operators*
Design of RNGBase
Python tests
NA
JIRA TASK: [DALI-1949] [DALI-1950]