public void setK ( final int K ) { if ( K < 2 ) throw new IllegalArgumentException ( "At least 2 topics must be learned" ) ; this . K = K ; gammaLocal = new ThreadLocal < Vec > ( ) { @ Override protected Vec initialValue ( ) { return new DenseVector ( K ) ; } } ; logThetaLocal = new ThreadLocal < Vec > ( ) { @ Override protected Vec initialValue ( ) { return new DenseVector ( K ) ; } } ; expLogThetaLocal = new ThreadLocal < Vec > ( ) { @ Override protected Vec initialValue ( ) { return new DenseVector ( K ) ; } } ; lambda = null ; }
Sets the number of topics that LDA will try to learn