|
|
|
|
|
|
|
|
- history (dict): Dictionary containing evaluation metrics for each run. |
|
|
- history (dict): Dictionary containing evaluation metrics for each run. |
|
|
""" |
|
|
""" |
|
|
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") |
|
|
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") |
|
|
print(torch.cuda.is_available()) |
|
|
|
|
|
torch.zeros(1).cuda() |
|
|
|
|
|
# Step 1: Initialize a dictionary to store evaluation metrics |
|
|
# Step 1: Initialize a dictionary to store evaluation metrics |
|
|
history = {'AUC': [], 'AUPRC': [], "Accuracy": [], "Precision": [], "Recall": [], "F1 score": []} |
|
|
history = {'AUC': [], 'AUPRC': [], "Accuracy": [], "Precision": [], "Recall": [], "F1 score": []} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
torch.manual_seed(RANDOM_SEED) |
|
|
torch.manual_seed(RANDOM_SEED) |
|
|
random.seed(RANDOM_SEED) |
|
|
random.seed(RANDOM_SEED) |
|
|
np.random.seed(RANDOM_SEED) |
|
|
np.random.seed(RANDOM_SEED) |
|
|
run(10, is_test=True) |
|
|
|
|
|
|
|
|
run(10, is_test=False) |