I'm trying to use breeze to test some of my own code.
I.e., I have some code that computes exp(M).
I'd like to test using breeze.
My testing code computes (u,s,v) by calling svd(m)
Then I compute: exp(m) = u * (s.map {x:Double => math.exp(x)}) * v
There are two issues I see. Are these known issues? Or do I need to prepare a test case and file a bug report? I'm a 1st time user, so maybe these are known issues?
1. I get a bunch of unwanted INFO messages of the form:
Apr 04, 2021 11:35:58 AM com.github.fommil.jni.JniLoader liberalLoad
INFO: successfully loaded
Apr 04, 2021 11:35:58 AM com.github.fommil.jni.JniLoader load
2. java.lang.IllegalArgumentException on the following code
val dm = DenseMatrix.tabulate(dim, dim){case (i, j) => this(i,j)}
val svd.SVD(u,s,v) = svd(dm)
println(s"dm=[$dm]")
println(s"u=[$u]")
println(s"s=[$s]")
println(s"v=[$v]")
println("exp lambda = " + (s.map {x:Double => math.exp(x)}))
val em = u * (s.map {x:Double => math.exp(x)}) * v
Here is the output
dm=[-0.9315079940605946 -0.8636480438490705
-0.9371076081540446 0.3813488062121273 ]
u=[-0.8593567106990224 -0.5113766163763811
-0.5113766163763811 0.8593567106990224 ]
s=[DenseVector(1.39178232086381, 0.8367404849973938)]
v=[0.9194775249120006 0.39314257106258693
-0.39314257106258693 0.9194775249120006 ]
exp lambda = DenseVector(4.02201218472115, 2.308829035558848)
requirement failed: b.rows == 1 (2 != 1)
java.lang.IllegalArgumentException: requirement failed: b.rows == 1 (2 != 1)
at breeze.linalg.operators.DenseMatrixMultiplyStuff$$anon$3.apply(DenseMatrixOps.scala:126)
at breeze.linalg.operators.DenseMatrixMultiplyStuff$$anon$3.apply(DenseMatrixOps.scala:124)
at breeze.linalg.ImmutableNumericOps.$times(NumericOps.scala:118)
at breeze.linalg.ImmutableNumericOps.$times$(NumericOps.scala:117)
at breeze.linalg.DenseVector.$times(DenseVector.scala:56)
at homework.Transcendentals$sqMatrix.expB(HW-Transcendentals-solution.scala:308)
at TranscendentalsTestSuite.$anonfun$new$76(TranscendentalsTestSuite.scala:515)
at scala.collection.immutable.Vector.foreach(Vector.scala:1856)
at TranscendentalsTestSuite.$anonfun$new$70(TranscendentalsTestSuite.scala:494)
at scala.runtime.java8.JFunction1$mcVI$sp.apply(JFunction1$mcVI$sp.scala:18)
at scala.collection.immutable.List.foreach(List.scala:333)
at TranscendentalsTestSuite.$anonfun$new$69(TranscendentalsTestSuite.scala:493)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)