This takes the .elementMax while it should be the max of the absolute values. (atm, the inf-norm can even be negative).
Unfortunately, .maxAbsElement this is not part of the INDArray interface. It's only implemented in AVector as far as I could tell.
A correct way that would work for INDArrays would be (.maxElement (.absCopy m)), but requires 2 traversals.
I guess the norm protocol can be implemented for INDArrayandAVector, so it would be fast for vectors.
https://github.com/mikera/vectorz-clj/blob/81be477b05b940d6887e81f1ec08de05d9e8ad23/src/main/clojure/mikera/vectorz/matrix_api.clj#L366-L372
This takes the
.elementMax
while it should be the max of the absolute values. (atm, the inf-norm can even be negative). Unfortunately,.maxAbsElement
this is not part of the INDArray interface. It's only implemented inAVector
as far as I could tell. A correct way that would work for INDArrays would be(.maxElement (.absCopy m))
, but requires 2 traversals.I guess the norm protocol can be implemented for
INDArray
andAVector
, so it would be fast for vectors.What is the best way to deal with this?