@@ -0,0 +1,1419 @@
+import logging%0Aimport argparse%0Afrom os import remove%0A%0Afrom cptm.utils.experiment import load_config, get_corpus, get_sampler%0A%0A%0Alogger = logging.getLogger(__name__)%0Alogging.basicConfig(format='%25(levelname)s : %25(message)s', level=logging.INFO)%0A%0Alogging.getLogger('gensim').setLevel(logging.ERROR)%0Alogging.getLogger('CPTCorpus').setLevel(logging.ERROR)%0Alogging.getLogger('CPT_Gibbs').setLevel(logging.ERROR)%0A%0Aparser = argparse.ArgumentParser()%0Aparser.add_argument('json', help='json file containing experiment '%0A                    'configuration.')%0Aargs = parser.parse_args()%0A%0Aconfig = load_config(args.json)%0Acorpus = get_corpus(config)%0AnTopics = config.get('expNumTopics')%0AnIter = config.get('nIter')%0AoutDir = config.get('outDir')%0AsampleInterval = 10%0A%0Afor nt in nTopics:%0A    sampler = get_sampler(config, corpus, nTopics=nt)%0A    logging.info('removing parameter sample files for nTopics = %7B%7D'.format(nt))%0A    for t in range(sampler.nIter):%0A        if t != 0 and (t+1) %25 sampleInterval != 0:%0A            try:%0A                remove(sampler.get_theta_file_name(t))%0A            except:%0A                pass%0A%0A            try:%0A                remove(sampler.get_phi_topic_file_name(t))%0A            except:%0A                pass%0A%0A            for persp in range(sampler.nPerspectives):%0A                try:%0A                    remove(sampler.get_phi_opinion_file_name(persp, t))%0A                except:%0A                    pass%0A

Add script to prune parameter sample files