-
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
[RELAY][OPS]LRN and L2_Normalize #1860
Conversation
e5255fb
to
9c814b2
Compare
@tqchen @srkreddy1238 @junrushao1994 @MarisaKirisame please review. |
python/tvm/relay/op/nn/nn.py
Outdated
The size of the local region to be considered for normalization. | ||
|
||
axis : int, optional | ||
input data layout channel axis. default value is 1 for NCHW format |
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.
Captialize
include/tvm/relay/attrs/nn.h
Outdated
TVM_ATTR_FIELD(size).set_default(5) | ||
.describe("The size of the local region to be considered for normalization."); | ||
TVM_ATTR_FIELD(axis).set_default(1) | ||
.describe("Input data layout channel axis"); |
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.
Axis of input data layout channel?
9c814b2
to
4a17f63
Compare
e1e978d
to
054496a
Compare
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.
LGTM
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.
LGTM
@@ -383,3 +383,66 @@ def relu(data): | |||
The computed result. | |||
""" | |||
return _make.relu(data) | |||
|
|||
|
|||
def lrn(data, size=5, axis=1, bias=2, alpha=.00001, beta=0.75): |
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.
idk if it is good or not to use these defaults, but seems only AlexNet-like archs apply lrn somewhere, so it is fine.
l2 normalization is not as common and let us move it to level2 |
#1799
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.