Skip to content
Snippets Groups Projects
Commit 18c0826f authored by kulcsar's avatar kulcsar
Browse files

update to save model results

parent 3fda78cb
No related branches found
No related tags found
No related merge requests found
Namespace(architecture='bert-base-uncased', model_type='one', train_dataset='../datasets/data_splits/old_train_semeval.txt', test_dataset='../datasets/data_splits/semeval_test.txt', tokenizer='swp', context=False, masking=False, max_length=512, train_loop='swp', epochs=5, learning_rate=5e-06, random_seed=42, batch_size=16, test_batch_size=64, save_directory='./Results/bert_base_42.txt'){'accuracy': 0.8667400881057269, 'f1': 0.6344410876132931, 'precision': 0.7291666666666666, 'recall': 0.5614973262032086}{'accuracy': 0.9448648648648649, 'f1': 0.8521739130434782, 'precision': 0.9363057324840764, 'recall': 0.7819148936170213}
\ No newline at end of file
......@@ -68,7 +68,12 @@ def run(raw_args):
else:
print("no eligible train loop selected")
#(evaluate... is done internally) but could maybe be implemented here to make average over multiple random seeds
with open(args.save_directory, "x") as f:
f.write(str(args))
f.write(str(evaluation_test))
f.write(str(evaluation_train))
print("saved and done")
if __name__ == "__main__":
parser = argparse.ArgumentParser()
......@@ -158,6 +163,12 @@ if __name__ == "__main__":
type=int,
default=64)
#Save and Organisation
parser.add_argument(
"-sd",
"--save_directory",
help="Directory to save run")
args = parser.parse_args()
run(args)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment