"src/array/vscode:/vscode.git/clone" did not exist on "6014623d8f01bbb6858febb08e20596682b75175"
Commit fa508492 authored by Myle Ott's avatar Myle Ott
Browse files

Output number of model parameters in train.py

parent 18a6d85c
...@@ -70,6 +70,7 @@ def main(): ...@@ -70,6 +70,7 @@ def main():
model = utils.build_model(args, dataset.src_dict, dataset.dst_dict) model = utils.build_model(args, dataset.src_dict, dataset.dst_dict)
criterion = utils.build_criterion(args, dataset.src_dict, dataset.dst_dict) criterion = utils.build_criterion(args, dataset.src_dict, dataset.dst_dict)
print('| model {}, criterion {}'.format(args.arch, criterion.__class__.__name__)) print('| model {}, criterion {}'.format(args.arch, criterion.__class__.__name__))
print('| num. model params: {}'.format(sum(p.data.numel() for p in model.parameters())))
# The max number of positions can be different for train and valid # The max number of positions can be different for train and valid
# e.g., RNNs may support more positions at test time than seen in training # e.g., RNNs may support more positions at test time than seen in training
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment