You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.py 943B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import random
  2. import torch
  3. class Config:
  4. DEBUG = False
  5. batch_size = 32
  6. eval_batch_size = 128
  7. test_percent = 20
  8. val_percent = 10
  9. learning_rate = 0.0001
  10. decay_rate = 1 # 0.99**50=0.6, 0.99**100=0.36
  11. n_epoch = 2 if DEBUG else 20
  12. available_device = "cuda" if torch.cuda.is_available() and not DEBUG else "cpu"
  13. print(f"Device: {available_device}")
  14. workers = 1 if DEBUG else 40
  15. # learned from evaluate_image_patcher_and_visualize.py
  16. laplacian_threshold = 298
  17. # RANDOM SEED
  18. seed = 115
  19. @staticmethod
  20. def reset_random_seeds():
  21. random.seed(Config.seed)
  22. torch.manual_seed(Config.seed)
  23. class_names = ["BENIGN", "MALIGNANT"]
  24. class_idx_dict = {"BENIGN": 0, "MALIGNANT": 1}
  25. train_val_acc_max_distance_for_best_epoch = 6 # Percent
  26. n_epoch_for_image_patcher = 60
  27. train_phase = False
  28. evaluate_phase = False
  29. Config.reset_random_seeds()