Skip to content

Commit

Permalink
modify train for composer
Browse files Browse the repository at this point in the history
  • Loading branch information
lruizcalico committed Mar 6, 2024
1 parent 2e58034 commit 121979b
Show file tree
Hide file tree
Showing 2 changed files with 574 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/baskerville/scripts/hound_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import argparse
import json
import os
import sys
import shutil

import numpy as np
Expand Down Expand Up @@ -56,6 +57,12 @@ def main():
default="train_out",
help="Output directory [Default: %(default)s]",
)
parser.add_argument(
"--outlog",
action="store_true",
default=False,
help="Keep a log file in out_dir/trainlog.txt [Default: %(default)s]",
)
parser.add_argument(
"--restore",
default=None,
Expand Down Expand Up @@ -84,6 +91,9 @@ def main():
)
args = parser.parse_args()

if args.outlog:
orig_stdout = sys.stdout
sys.stdout = open("%s/trainlog.txt" % args.out_dir, "w")
if args.keras_fit and len(args.data_dirs) > 1:
print("Cannot use keras fit method with multi-genome training.")
exit()
Expand Down Expand Up @@ -198,6 +208,8 @@ def main():
seqnn_trainer.fit_tape(seqnn_model)
else:
seqnn_trainer.fit2(seqnn_model)
if args.outlog:
sys.stdout = orig_stdout


################################################################################
Expand Down
Loading

0 comments on commit 121979b

Please sign in to comment.