[jira] [Created] (IGNITE-13392) Incorrect Vector::kNorm evaluation for odd powers

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (IGNITE-13392) Incorrect Vector::kNorm evaluation for odd powers

Anton Vinogradov (Jira)
Mark Andreev created IGNITE-13392:
-------------------------------------

             Summary: Incorrect Vector::kNorm evaluation for odd powers
                 Key: IGNITE-13392
                 URL: https://issues.apache.org/jira/browse/IGNITE-13392
             Project: Ignite
          Issue Type: Improvement
          Components: ml
            Reporter: Mark Andreev
            Assignee: Mark Andreev


Current implementation of `Vector::kNorm` is incorrect. 

Current formula is (`org.apache.ignite.ml.math.primitives.vector.AbstractVector:882`):
{code:java}
(\sum_{i}{x^p})^{1/p}
{code}
But correct formula is:
{code:java}
(\sum_{i}{|x|^p})^{1/p}
{code}
We can verify this using lectures ([https://www.math.usm.edu/lambers/mat610/sum10/lecture2.pdf)] or using Wolfram Mathematica:
{code:java}
> Norm[{x, y, z}, p]
(Abs[x]^p+Abs[y]^p+Abs[z]^p)^(1/p){code}
  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)
Reply | Threaded
Open this post in threaded view
|

Re: [jira] [Created] (IGNITE-13392) Incorrect Vector::kNorm evaluation for odd powers

Alexey Zinoviev
Great, could you provide in comment some test cases with correct from
formula or wolfram and wrong answers

сб, 29 авг. 2020 г., 22:25 Mark Andreev (Jira) <[hidden email]>:

> Mark Andreev created IGNITE-13392:
> -------------------------------------
>
>              Summary: Incorrect Vector::kNorm evaluation for odd powers
>                  Key: IGNITE-13392
>                  URL: https://issues.apache.org/jira/browse/IGNITE-13392
>              Project: Ignite
>           Issue Type: Improvement
>           Components: ml
>             Reporter: Mark Andreev
>             Assignee: Mark Andreev
>
>
> Current implementation of `Vector::kNorm` is incorrect.
>
> Current formula is
> (`org.apache.ignite.ml.math.primitives.vector.AbstractVector:882`):
> {code:java}
> (\sum_{i}{x^p})^{1/p}
> {code}
> But correct formula is:
> {code:java}
> (\sum_{i}{|x|^p})^{1/p}
> {code}
> We can verify this using lectures ([
> https://www.math.usm.edu/lambers/mat610/sum10/lecture2.pdf)] or using
> Wolfram Mathematica:
> {code:java}
> > Norm[{x, y, z}, p]
> (Abs[x]^p+Abs[y]^p+Abs[z]^p)^(1/p){code}
>
>
>
>
> --
> This message was sent by Atlassian Jira
> (v8.3.4#803005)
>
Reply | Threaded
Open this post in threaded view
|

Re: [jira] [Created] (IGNITE-13392) Incorrect Vector::kNorm evaluation for odd powers

Mark Andreev
Hi,

I have added test cases to jira and PR with these cases.

Jira: https://issues.apache.org/jira/browse/IGNITE-13392
PR: https://github.com/apache/ignite/pull/8196

Please review and share feedback.

On Sun, 30 Aug 2020 at 12:48, Alexey Zinoviev <[hidden email]>
wrote:

> Great, could you provide in comment some test cases with correct from
> formula or wolfram and wrong answers
>
> сб, 29 авг. 2020 г., 22:25 Mark Andreev (Jira) <[hidden email]>:
>
> > Mark Andreev created IGNITE-13392:
> > -------------------------------------
> >
> >              Summary: Incorrect Vector::kNorm evaluation for odd powers
> >                  Key: IGNITE-13392
> >                  URL: https://issues.apache.org/jira/browse/IGNITE-13392
> >              Project: Ignite
> >           Issue Type: Improvement
> >           Components: ml
> >             Reporter: Mark Andreev
> >             Assignee: Mark Andreev
> >
> >
> > Current implementation of `Vector::kNorm` is incorrect.
> >
> > Current formula is
> > (`org.apache.ignite.ml.math.primitives.vector.AbstractVector:882`):
> > {code:java}
> > (\sum_{i}{x^p})^{1/p}
> > {code}
> > But correct formula is:
> > {code:java}
> > (\sum_{i}{|x|^p})^{1/p}
> > {code}
> > We can verify this using lectures ([
> > https://www.math.usm.edu/lambers/mat610/sum10/lecture2.pdf)] or using
> > Wolfram Mathematica:
> > {code:java}
> > > Norm[{x, y, z}, p]
> > (Abs[x]^p+Abs[y]^p+Abs[z]^p)^(1/p){code}
> >
> >
> >
> >
> > --
> > This message was sent by Atlassian Jira
> > (v8.3.4#803005)
> >
>


--
Best regards,
Mark Andreev
Reply | Threaded
Open this post in threaded view
|

Re: [jira] [Created] (IGNITE-13392) Incorrect Vector::kNorm evaluation for odd powers

Alexey Zinoviev
Great, many thanks for the contribution, will review till the end of this
week

пн, 31 авг. 2020 г. в 09:05, Mark Andreev <[hidden email]>:

> Hi,
>
> I have added test cases to jira and PR with these cases.
>
> Jira: https://issues.apache.org/jira/browse/IGNITE-13392
> PR: https://github.com/apache/ignite/pull/8196
>
> Please review and share feedback.
>
> On Sun, 30 Aug 2020 at 12:48, Alexey Zinoviev <[hidden email]>
> wrote:
>
> > Great, could you provide in comment some test cases with correct from
> > formula or wolfram and wrong answers
> >
> > сб, 29 авг. 2020 г., 22:25 Mark Andreev (Jira) <[hidden email]>:
> >
> > > Mark Andreev created IGNITE-13392:
> > > -------------------------------------
> > >
> > >              Summary: Incorrect Vector::kNorm evaluation for odd powers
> > >                  Key: IGNITE-13392
> > >                  URL:
> https://issues.apache.org/jira/browse/IGNITE-13392
> > >              Project: Ignite
> > >           Issue Type: Improvement
> > >           Components: ml
> > >             Reporter: Mark Andreev
> > >             Assignee: Mark Andreev
> > >
> > >
> > > Current implementation of `Vector::kNorm` is incorrect.
> > >
> > > Current formula is
> > > (`org.apache.ignite.ml.math.primitives.vector.AbstractVector:882`):
> > > {code:java}
> > > (\sum_{i}{x^p})^{1/p}
> > > {code}
> > > But correct formula is:
> > > {code:java}
> > > (\sum_{i}{|x|^p})^{1/p}
> > > {code}
> > > We can verify this using lectures ([
> > > https://www.math.usm.edu/lambers/mat610/sum10/lecture2.pdf)] or using
> > > Wolfram Mathematica:
> > > {code:java}
> > > > Norm[{x, y, z}, p]
> > > (Abs[x]^p+Abs[y]^p+Abs[z]^p)^(1/p){code}
> > >
> > >
> > >
> > >
> > > --
> > > This message was sent by Atlassian Jira
> > > (v8.3.4#803005)
> > >
> >
>
>
> --
> Best regards,
> Mark Andreev
>