|
In Mark Steyvers & Tom Griffiths's Matlab Topic Modeling Toolbox 1.4 http://psiexp.ss.uci.edu/research/programs_data/toolbox.htm, in the file "GibbsSamplerLDA.cpp", line48-56:
} can any one tell me what's this used for? and why " rp = i + (int) ((double) (n-i) * (double) randomMT() / (double) (4294967296.0 + 1.0));" this is reasonable? many thanks!! |
|
Firstly, this is not a Matlab / Math help forum, it's for machine learning questions. Your question might get closed or moved somewhere. With that said ... randomMT() is a C/C++ function that returns an unsigned 32-bit int. 4294967296 is 2^32, so adding To break this down more succinctly:
The only reason I can think for them to use Lastly, I'm not sure I see a need to add the Anyway, I'm done. -Brian
This answer is marked "community wiki".
Sorry for all the edits. The preview window doesn't render nested lists the same as the final version.
(Apr 08 '11 at 16:43)
Brian Vandenberg
sorry ,i don't know where to ask this problem, just know metaop... Maybe my expression is not very correct, i mainly intended to ask what's the code "// switch contents on position i and position rp temp = order[rp]; order[rp]=order[i]; order[i]=temp;" for , many thanks again!
(Apr 08 '11 at 22:16)
ylqfp
|