Argparse transformation for Jupyter Notebook execution. (for quick testing in .ipynb)
Copy & paste class-formatted arguments to replace argparse.
Notice! It's better to use args = parser.parse_args(args=[])
syntax - https://stackoverflow.com/a/47587545/3618853
http://35.192.144.192:8000/arg2cls.html
python3 arg2cls.py [target.py] [target2.py(optional)] ...
parser = argparse.ArgumentParser(description='PyTorch PennTreeBank RNN/LSTM Language Model')
parser.add_argument('--data', type=str, default='./data/penn',
help='location of the data corpus')
parser.add_argument('--model', type=str, default='LSTM',
help='type of recurrent net (RNN_TANH, RNN_RELU, LSTM, GRU)')
parser.add_argument('--emsize', type=int, default=200,
help='size of word embeddings')
parser.add_argument('--nhid', type=int, default=200,
help='number of hidden units per layer')
class args:
data = './data/penn'
model = 'LSTM'
emsize = 200
nhid = 200
If there's no default value for argument, It will have warning value. (###manual_setting_required###)