Diff of /ecg_gan/config.py [000000] .. [6bf179]

Switch to side-by-side view

--- a
+++ b/ecg_gan/config.py
@@ -0,0 +1,19 @@
+import numpy as np
+import torch
+
+
+class Config:
+    csv_path = ''
+    seed = 2021
+    device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
+
+def seed_everything(seed: int):
+    np.random.seed(seed)
+    torch.manual_seed(seed)
+    if torch.cuda.is_available():
+        torch.cuda.manual_seed(seed)
+        
+        
+if __name__ == '__main__':
+    config = Config()
+    seed_everything(config.seed)