Skip to content

Commit

Permalink
saving results
Browse files Browse the repository at this point in the history
  • Loading branch information
alicebizeul committed Apr 16, 2023
1 parent d61782b commit 8392ba2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bash_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,22 @@ python main.py \
--learn_std=${LEARNSTD} \
--std_epochs=${LSTD_EPOCHS} \
--epochs=${EPOCHS} \
--epoch_num=${EPOCHS} \
--classes=${CLASSES} \
--normalize=${NORM} \
--lr_change=${LR_CHANGE} \
--lr=${LR} \
--bound=${BOUND} \
--subsample=${SUBSAMPLE} \
--model_path=${MODEL_PATH}


python linear_evaluation.py \
--custom=True \
--learn_std=${LEARNSTD} \
--std_epochs=${LSTD_EPOCHS} \
--epochs=${EPOCHS} \
--epoch_num=${EPOCHS} \
--classes=${CLASSES} \
--normalize=${NORM} \
--lr_change=${LR_CHANGE} \
Expand Down
4 changes: 4 additions & 0 deletions linear_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,7 @@ def test(args, loader, simclr_model, model, criterion, optimizer):
print(
f"[FINAL]\t Loss: {loss_epoch / len(arr_test_loader)}\t Accuracy: {accuracy_epoch / len(arr_test_loader)}"
)

with open(args.model_path+'/accuracy.npy', 'wb') as f:
np.save(f, np.array([accuracy_epoch / len(arr_test_loader)]))

0 comments on commit 8392ba2

Please sign in to comment.