-
Notifications
You must be signed in to change notification settings - Fork 49
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
Question on reduction with empty axes and scalar input #740
Comments
Not
|
So if you specify empty axes for none scalar input, do these pre/post function apply too? Or you only apply these functions for empty axes and scalar input case? |
Pre/post functions are always applied. So for reduceSumSquare, pre function is "square", reduction is "sum", post function is "identity". reduceSumSquare([2,2,2,2]) → 16 - each input squared, all dimensions reduced For reduceLogSumExp, pre function is "exp", reduction is "sum", post function is "log" reduceLogSumExp([2,2,2,2]) → 3.386... - each input exp'd, all dimensions reduced, sum log'd |
... but all of this implies that the spec text could be improved. Reducing a dimension is different from applying the reduction operation to an input, so writing "no dimensions are reduced" is unclear. And behavior for scalars should be called out, since those don't have a dimension to reduce. |
Improve the description of the reduction ops: - Give in-line definition for L1/L2. - Make "input values" slightly clearer. - Explicitly note that if the input is a scalar, so is the output. - State how the reduction function is applied for empty axes. - Standardize on "reduction operation" not "reduce operation". Fixes webmachinelearning#740
👍
Great examples. |
In
MLReduceOptions
Does that mean it should be an no-op (a.k.a
identity
)?Is that true when you specifies empty axes for scalar input too?
If that's the case, our WPTs are wrong - it's clearly still reducing?
The text was updated successfully, but these errors were encountered: