Uh oh!
There was an error while loading. Please reload this page.
[TOPI] LRN & L2norm Operator - #1051
Conversation
tqchen
commented
Mar 27, 2018
cc @sxjscience can you do another round of review? |
Need to work on the project in Amazon. I'll give a deep dive into how to implement it better on Thursday. For now, I think we need to support L2Normalization with arbitrary axis. |
PariksheetPinjari909
commented
Apr 2, 2018
@sxjscience , shall I follow https://www.tensorflow.org/api_docs/python/tf/nn/l2_normalize for l2norm implementation? |
PariksheetPinjari909
commented
Apr 6, 2018
@sxjscience , I have added arbitrary axis support for L2norm. Could you please help to review further. |
sxjscience
commented
Apr 9, 2018
I think it's good now. We can refactor the implementation later. |
tqchen
left a comment
There was a problem hiding this comment.
It seems that we can also make lrn axis invariant by providing an axis argument for to specify the channel, can we do that?
| rxk = tvm.reduce_axis((0, size), name='rxk') | ||
| sqr_sum = tvm.compute((b, c, h, w), lambda i, l, j, k: tvm.sum( | ||
| tvm.power(pad_data[i, l + rxk, j, k], 2.0), |
There was a problem hiding this comment.
do not use power to calculate the square, instead use x* x
| sqr_sum[i, j, k, l] = sqr_sum[i, j, k, l] + \ | ||
| (a_np[i, j, k, l + rxl] * \ | ||
| a_np[i, j, k, l + rxl]) | ||
| for i in range(axis0): |
There was a problem hiding this comment.
use broadcasting semantics, instead of the loop
tqchen
commented
Apr 13, 2018
Thanks for improving the code during the review process, this is now merged! |
LRN operator for caffe alexnet model to use with onnx frontend
@tqchen@sxjscience your review comments from #1000 is addressed here. #1000 got accidentally closed.