Dali: Custom augmentation. How can I write a mean augmentation?

Created on 21 Oct 2020  ·  8Comments  ·  Source: NVIDIA/DALI

Hello,
I'd like to create a custom augmentation like this: input/mean(input)
I started with the mean computation. Is there a way I can achieve this by combining cupy.ElementWiseKernel and cupy.ReductionKernel. Is there a simpler way to achieve this or do I have to write some cuda kernels like this: https://github.com/NVIDIA/DALI/blob/master/dali/kernels/reduce/mean_gpu.cu? Do I stand a chance?
Thanks!

question

All 8 comments

Hi,
This sounds like normalization. Please check this tutorial how to do that.

HI, I don't want to divide by standard deviation, but the mean. Can I compute the mean separately somehow?

Oh, I missed that you want to divide, not subtract. We are developing a mean reduce operator and then you can just divide the input by the result of the mean operator. We will get back to you when the relevant operator is ready.
@awolant - FYI

This PR should do what you are asking for. https://github.com/NVIDIA/DALI/pull/2395. Please check the nightly DALI build after it is merged.

@bamfpga - https://github.com/NVIDIA/DALI/pull/2395 just have been merged. Can you check the most recent nightly build that follows it to see if that works for you?

That's great! Thank you very much!

DALI 0.28 has been released, it should address this issue.

Great news. thank you!

Was this page helpful?
0 / 5 - 0 ratings