Skip to content

Commit de09c2e

Browse files
committed
Improved support for continued sampling, various cleanup
If using 'continue' CMD line option, ParalllelLDA will now try to load a stored sampler matching the given configuration and continue sampling from it (with all the same settings)
1 parent ffea0d6 commit de09c2e

13 files changed

Lines changed: 664 additions & 153 deletions

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
<!-- v8.2.1: Added 'continue sampling' and 'init from' functionality -->
100100
<!-- v8.2.2: Support 'raw' mode when reading corpus from string -->
101101
<!-- v8.3.0: Support saving sampler from main Java application -->
102-
<version>8.3.0</version>
102+
<!-- v8.4.0: Added support for continued sampling in main, controlled by 'continue' CMD line option -->
103+
<version>8.4.0</version>
103104

104105
<name>Partially Collapsed Parallel LDA</name>
105106

src/main/java/cc/mallet/configuration/LDACommandLineParser.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ protected CommandLine parseCommandLine(String [] args) throws ParseException {
4444
@SuppressWarnings("static-access")
4545
protected void addOptions() {
4646
options.addOption( "dbg", "debug", true, "use debugging " );
47-
options.addOption( "cm", "comment", true, "a comment ot be added to the logfile " );
47+
options.addOption( "c", "continue", false, "continue sampling from a saved state (give in config file by option 'saved_sampler_dir') " );
48+
options.addOption( "cm", "comment", true, "a comment to be added to the logfile " );
4849
options.addOption( "ds", "dataset", true, "filename of dataset file" );
4950
options.addOption( "ts", "topics", true, "number of topics" );
5051
options.addOption( "a", "alpha", true, "uniform alpha prior" );
@@ -66,7 +67,11 @@ protected void addOptions() {
6667
public boolean hasOption(String key) {
6768
return options.hasOption(key);
6869
}
69-
70+
71+
public boolean isOptionSet(String key) {
72+
return parsedCommandLine.hasOption(key);
73+
}
74+
7075
public String getOption(String key) {
7176
return parsedCommandLine.getOptionValue(key);
7277
}

0 commit comments

Comments
 (0)