Parse data and label files from CLI arguments

This commit is contained in:
coolneng 2021-07-05 03:49:14 +02:00
parent a3780c9761
commit bcc4f4b4d4
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 27 additions and 4 deletions

27
src/main.py Normal file
View File

@ -0,0 +1,27 @@
from argparse import ArgumentParser
from time import time
from model import run
def parse_arguments():
parser = ArgumentParser()
parser.add_argument(
"data_file", help="FASTQ file containing the sequences with errors"
)
parser.add_argument(
"label_file", help="FASTQ file containing the sequences without errors"
)
return parser.parse_args()
def main():
args = parse_arguments()
start_time = time()
run(data_file=args.data_file, label_file=args.label_file)
end_time = time()
print(f"Elapsed time: {end_time - start_time}")
if __name__ == "__main__":
main()

View File

@ -75,7 +75,3 @@ def run(data_file, label_file, seed_value=42) -> None:
model.fit(train_data, epochs=hyperparams.epochs, validation_data=eval_data) model.fit(train_data, epochs=hyperparams.epochs, validation_data=eval_data)
print("Training complete. Obtaining the model's metrics...") print("Training complete. Obtaining the model's metrics...")
show_metrics(model, eval_data, test_data) show_metrics(model, eval_data, test_data)
if __name__ == "__main__":
run(data_file="data/curesim-HVR.fastq", label_file="data/HVR.fastq")