-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Frontend][Darknet] L2 normalization support in darknet #1916
Conversation
@siju-samuel @yzhliu Welcome for review. |
"""Process the l2 normalization operation.""" | ||
op_name, new_attrs = 'l2_normalize', {} | ||
new_attrs['eps'] = attrs.get('eps', 0) | ||
new_attrs['axis'] = attrs.get('axis', 1) |
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 don't really know darknet, would appreciate if you could point out where these two attrs come from. The overall functionality looks good to me.
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.
Sure. The darknet computes the l2 normalization always along the channel axis. So it doesn't store the axis information anywhere. And while dividing by sum it doesn't check if sum is greater than eps or not.
So i have made default eps as 0 and axis as 1 to make it compatible with TVM's L2 normalization implementation. You can have look at darknet's l2 normalization implementation here
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.
got it. thanks!
* l2 normalization * retrigger CI
* l2 normalization * retrigger CI
* l2 normalization * retrigger CI
* l2 normalization * retrigger CI
Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from others in the community.