Errors in multi-threaded LDA and with SparseOnlineLDA in factorie_2.11-1.2-SNAPSHOT

30 views
Skip to first unread message

Charles Earl

unread,
Feb 22, 2015, 9:03:48 AM2/22/15
to dis...@factorie.cs.umass.edu
Hi,
I am getting the two errors below:
./bin/fac lda --num-topics 100 --read-lines=./data/articles_396.txt.corpus --num-threads=2:

Exception in thread "main" java.lang.Error: Method zero() not defined on class cc.factorie.variable.GrowableDenseProportions1
at cc.factorie.la.ReadOnlyTensor$class.zero(Tensor.scala:145)
at cc.factorie.variable.GrowableDenseProportions1.zero(ProportionsVariable.scala:177)
at cc.factorie.app.topics.lda.LDA$$anonfun$maximizePhisAndThetas$1.apply(LDA.scala:234)
at cc.factorie.app.topics.lda.LDA$$anonfun$maximizePhisAndThetas$1.apply(LDA.scala:234)

When attempting to run SparseOnlineLDA:

java -cp ./target/factorie_2.11-1.2-SNAPSHOT-jar-with-dependencies.jar:./target/classes \
                     cc.factorie.app.topics.lda.SparseOnlineLDA --num-topics=100 --num-batches=500 \
                     --read-lines=./data/articles_396.txt.corpus.content
numTopics: 100 numTypes: 12956 numDocs: 386 maxIterations: 500
Changes/Samples: 58633/64806 Rate:0.904746 scale: 0.8781414776545313
Exception in thread "main" java.lang.Error: Method zero() not defined on class cc.factorie.variable.GrowableDenseProportions1
at cc.factorie.la.ReadOnlyTensor$class.zero(Tensor.scala:145)
at cc.factorie.variable.GrowableDenseProportions1.zero(ProportionsVariable.scala:177)
at cc.factorie.app.topics.lda.SparseOnlineLDA$$anonfun$export$2.apply(SparseOnlineLDA.scala:95)
at cc.factorie.app.topics.lda.SparseOnlineLDA$$anonfun$export$2.apply(SparseOnlineLDA.scala:95)
at scala.collection.Iterator$class.foreach(Iterator.scala:743)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1177)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at cc.factorie.directed.Mixture.foreach(Mixture.scala:48)
at cc.factorie.app.topics.lda.SparseOnlineLDA.export(SparseOnlineLDA.scala:95)
at cc.factorie.app.topics.lda.SparseOnlineLDA.train(SparseOnlineLDA.scala:291)
at cc.factorie.app.topics.lda.SparseOnlineLDA$.main(SparseOnlineLDA.scala:435)
at cc.factorie.app.topics.lda.SparseOnlineLDA.main(SparseOnlineLDA.scala)

These seem both related to assumptions about the data type of phis matrix:
    phis.foreach(_.value.zero())

Is there a quick fix?

C

Craig Pfeifer

unread,
Feb 22, 2015, 12:15:23 PM2/22/15
to dis...@factorie.cs.umass.edu

Seems similar to a previous issue:

https://github.com/factorie/factorie/issues/208


--
--
Factorie Discuss group.
To post, email: dis...@factorie.cs.umass.edu
To unsubscribe, email: discuss+u...@factorie.cs.umass.edu

To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@factorie.cs.umass.edu.

Emma Strubell

unread,
Feb 22, 2015, 12:48:02 PM2/22/15
to dis...@factorie.cs.umass.edu
Should be fixed by changing phis.foreach(_.value.zero()) to phis.foreach(_.value.weights.zero()), I'll push a fix shortly.

Emma

Emma Strubell

unread,
Feb 22, 2015, 1:19:33 PM2/22/15
to dis...@factorie.cs.umass.edu
I just merged a fix, I didn't test it though so let us know how it goes :) 

It will take a little bit for the changes to deploy to maven.

Emma

To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@factorie.cs.umass.edu.

--
--
Factorie Discuss group.
To post, email: dis...@factorie.cs.umass.edu

Charles Earl

unread,
Feb 22, 2015, 3:45:37 PM2/22/15
to dis...@factorie.cs.umass.edu
Thanks Emma!
It is working on the CollaspedGibbsSampler.
When I use the same fix on the SparseOnlineLDA, I do not get the error, but it looks like the topics are all the same. Any thoughts there?
Cheers,
Charles
To unsubscribe, email: discuss+u...@factorie.cs.umass.edu

To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@factorie.cs.umass.edu.

--
--
Factorie Discuss group.
To post, email: dis...@factorie.cs.umass.edu
To unsubscribe, email: discuss+u...@factorie.cs.umass.edu

Charles Earl

unread,
Feb 22, 2015, 5:36:58 PM2/22/15
to dis...@factorie.cs.umass.edu

Is this also related to issue 105?
https://github.com/factorie/factorie/issues/105

Reply all
Reply to author
Forward
0 new messages