Open r-jenish opened 8 years ago
I'm experiencing the same issue.
It seems the problem occurs because the example uses the empty LocalOnLineLda.empty
method to create the lda
object.
When using empty, the numTopics
is set to zero (0
). Later, this value is used to create the initialGamma
which returns an empty matrix (1 row, 0 columns).
For what I can tell this matrix is used in several operations and eventually fails as it is expected to have the same number of columns as the original model had, and since it was set to zero, it fails 😞.
A possible solution is to use the model.lambda.rows
instead of the params.numTopics
in the topicProportions
method as this matches the original number of topics.
// LocalOnlineLDA.topicProportions
val initialGamma = new DenseMatrix[Double](
1,
model.lambda.rows,
G(100.0, 1.0 / 100.0).sample(model.lambda.rows).toArray
)
Maybe the Nitro team can tell us if this is the correct way to address the problem?
Thanks!
Saving the model as:
and loading it as:
Gives
Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: Dimension mismatch!
error in the lineval topicprops = lda.topicProportions(....)
.Error Log:
Scala Version: 2.11.8 System: Ubuntu 14.04