cc.mallet.topics
Class WorkerRunnable
- java.lang.Object
-
- cc.mallet.topics.WorkerRunnable
-
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- DMRRunnable
public class WorkerRunnable extends java.lang.Object implements java.lang.RunnableA parallel topic model runnable task.
-
-
Field Summary
Fields Modifier and Type Field and Description static doubleDEFAULT_BETA
-
Constructor Summary
Constructors Constructor and Description WorkerRunnable()WorkerRunnable(int numTopics, double[] alpha, double alphaSum, double beta, Randoms random, java.util.ArrayList<TopicAssignment> data, int[][] typeTopicCounts, int[] tokensPerTopic, int startDoc, int numDocs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidbuildLocalTypeTopicCounts()Once we have sampled the local counts, trash the "global" type topic counts and reuse the space to build a summary of the type topic counts specific to this worker's section of the corpus.voidcollectAlphaStatistics()int[]getDocLengthCounts()int[]getTokensPerTopic()int[][]getTopicDocCounts()int[][]getTypeTopicCounts()voidinitializeAlphaStatistics(int size)voidmakeOnlyThread()If there is only one thread, we don't need to go through communication overhead.voidresetBeta(double beta, double betaSum)voidrun()
-
-
-
Field Detail
-
DEFAULT_BETA
public static final double DEFAULT_BETA
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WorkerRunnable
public WorkerRunnable()
-
WorkerRunnable
public WorkerRunnable(int numTopics, double[] alpha, double alphaSum, double beta, Randoms random, java.util.ArrayList<TopicAssignment> data, int[][] typeTopicCounts, int[] tokensPerTopic, int startDoc, int numDocs)
-
-
Method Detail
-
makeOnlyThread
public void makeOnlyThread()
If there is only one thread, we don't need to go through communication overhead. This method asks this worker not to prepare local type-topic counts. The method should be called when we are using this code in a non-threaded environment.
-
getTokensPerTopic
public int[] getTokensPerTopic()
-
getTypeTopicCounts
public int[][] getTypeTopicCounts()
-
getDocLengthCounts
public int[] getDocLengthCounts()
-
getTopicDocCounts
public int[][] getTopicDocCounts()
-
initializeAlphaStatistics
public void initializeAlphaStatistics(int size)
-
collectAlphaStatistics
public void collectAlphaStatistics()
-
resetBeta
public void resetBeta(double beta, double betaSum)
-
buildLocalTypeTopicCounts
public void buildLocalTypeTopicCounts()
Once we have sampled the local counts, trash the "global" type topic counts and reuse the space to build a summary of the type topic counts specific to this worker's section of the corpus.
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
-
DataMelt 3.0 © DataMelt by jWork.ORG