convert_to_seconds() { date -d "${1//_/ }" +%s } start_time=$(date +%Y-%m-%d_%H:%M:%S) echo "Train start time: $start_time" mace_run_train \ --name="MACE_model" \ --train_file="/users/PAS2490/marcusshen/cmame/Data/aimd/trainset_0ads.xyz" \ --num_workers=16 \ --valid_fraction=0.05 \ --test_file="/users/PAS2490/marcusshen/cmame/Data/aimd/testset_0ads.xyz" \ --config_type_weights='{"Default":1.0}' \ --E0s='{1:-13.663181292231226, 6:-1029.2809654211628, 7:-1484.1187695035828, 8:-2042.0330099956639, 30:-500.123456789}' \ --model="MACE" \ --hidden_irreps='128x0e + 128x1o' \ --r_max=5.0 \ --batch_size=10 \ --max_num_epochs=2 \ --swa \ --start_swa=1200 \ --ema \ --ema_decay=0.99 \ --amsgrad \ --restart_latest \ --device=cuda \ end_time=$(date +%Y-%m-%d_%H:%M:%S) echo "Train end time: $end_time" # Calculate the time difference start_seconds=$(convert_to_seconds "$start_time") end_seconds=$(convert_to_seconds "$end_time") time_difference=$((end_seconds - start_seconds)) echo "Training duration: $time_difference seconds"