framework
framework copied to clipboard
Bug with Elementwise.Pow
What would you like to submit? (put an 'x' inside the bracket that applies)
- [ ] question
- [x] bug report
- [ ] feature request
Issue description
double[] v = new double[] {1, -2, 3, 4}; ElementWise.Pow(v,1); //returns {1 2 3 4}
There seems to be an unnecessary "Math.Abs()" in the Pow operation.
Agree, and if you try and use ElementWise.SignedPow instead this is what happens.
double[] v = new double[] {1, -2, 3, 4}; ElementWise.SignedPow(v,1); //returns {1 -2 3 4}
Which is correct but this happens
double[] v = new double[] {1, -2, 3, 4}; ElementWise.SignedPow(v,2); //returns {1 -4 9 16}
So currently there is no element-wise power function that works without knowing the answer for each element in the matrix/vector. The only workaround is to manually cycle through each element of the matrix/vector and perform the element-wise power operation yourself.