Last active
April 22, 2021 17:46
-
-
Save nsorros/e35bd72f68099b569322c67a70345f76 to your computer and use it in GitHub Desktop.
Train with argparse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
def train(data_path, model_path, learning_rate, batch_size): | |
... | |
if __name__ == "__main__": | |
argparser = argparse.ArgumentParser() | |
argparser.add_argument("--data_path", type=str, help="path to train data") | |
argparser.add_argument("--model_path", type=str, help="path to save the model") | |
argparser.add_argument("--learning_rate", type=float, help="learning rate param") | |
argparser.add_argument("--batch_size", type=int, help="batch size param") | |
args = argparser.parse_args() | |
data_path = args.data_path | |
model_path = args.model_path | |
learning_rate = args.learning_rate | |
batch_size = args.batch_size | |
train(data_path, model_path, learning_rate, batch_size) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment