summaryrefslogtreecommitdiff
path: root/training/mira/mira.py
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-09-07 13:57:52 -0400
committerChris Dyer <redpony@gmail.com>2014-09-07 13:57:52 -0400
commit2bc24dd0f10e2acbad118d5fce5aecdff6a90764 (patch)
tree99a79b38f1c293f299522c0ff080c045b346b179 /training/mira/mira.py
parentb40c064987b1fb188daf040a068a459711385eac (diff)
parentf33ab2ff3f1cf135ffb80721e1f4d71d124bc8f9 (diff)
Merge pull request #50 from pks/master
alignment features, PassThroughN features, dtrain update, mira qsub, and pro fix
Diffstat (limited to 'training/mira/mira.py')
-rwxr-xr-xtraining/mira/mira.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/training/mira/mira.py b/training/mira/mira.py
index 3e6aa2db..ec9c2d64 100755
--- a/training/mira/mira.py
+++ b/training/mira/mira.py
@@ -143,6 +143,12 @@ def main():
parser.add_argument('--pass-suffix',
help='multipass decoding iteration. see documentation '
'at www.cdec-decoder.org for more information')
+ parser.add_argument('--qsub',
+ help='use qsub', action='store_true')
+ parser.add_argument('--pmem',
+ help='memory for qsub', type=str, default='5G')
+ parser.add_argument('-v', '--verbose',
+ help='more verbose mira optimizers')
args = parser.parse_args()
args.metric = args.metric.upper()
@@ -315,6 +321,8 @@ def split_devset(dev, outdir):
def optimize(args, script_dir, dev_size):
parallelize = script_dir+'/../utils/parallelize.pl'
+ if args.qsub:
+ parallelize += " -p %s"%args.pmem
decoder = script_dir+'/kbest_cut_mira'
(source, refs) = split_devset(args.devset, args.output_dir)
port = random.randint(15000,50000)
@@ -353,10 +361,15 @@ def optimize(args, script_dir, dev_size):
decoder_cmd += ' -a'
if not args.no_pseudo:
decoder_cmd += ' -e'
+ if args.verbose:
+ decoder_cmd += ' -v'
- #always use fork
- parallel_cmd = '{0} --use-fork -e {1} -j {2} --'.format(
- parallelize, logdir, args.jobs)
+ if args.qsub:
+ parallel_cmd = '{0} -e {1} -j {2} --'.format(
+ parallelize, logdir, args.jobs)
+ else:
+ parallel_cmd = '{0} --use-fork -e {1} -j {2} --'.format(
+ parallelize, logdir, args.jobs)
cmd = parallel_cmd + ' ' + decoder_cmd
logging.info('OPTIMIZATION COMMAND: {}'.format(cmd))