Skip to content
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

Merged
merged 2 commits into from
Oct 24, 2018

Conversation

PariksheetPinjari909
Copy link
Contributor

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.

@PariksheetPinjari909
Copy link
Contributor Author

@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)
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it. thanks!

@yzhliu yzhliu merged commit 55d26ae into apache:master Oct 24, 2018
eqy pushed a commit to eqy/tvm that referenced this pull request Oct 29, 2018
FrozenGene pushed a commit to FrozenGene/tvm that referenced this pull request Dec 27, 2018
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants