[6bf179]: / ecg_classification / config.py

Download this file

32 lines (24 with data), 985 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import random
import numpy as np
import torch
class Config:
csv_path = ''
seed = 2021
device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
attn_state_path = '../input/mitbih-with-synthetic/attn.pth'
lstm_state_path = '../input/mitbih-with-synthetic/lstm.pth'
cnn_state_path = '../input/mitbih-with-synthetic/cnn.pth'
attn_logs = '../input/mitbih-with-synthetic/attn.csv'
lstm_logs = '../input/mitbih-with-synthetic/lstm.csv'
cnn_logs = '../input/mitbih-with-synthetic/cnn.csv'
train_csv_path = '../input/mitbih-with-synthetic/mitbih_with_syntetic_train.csv'
test_csv_path = '../input/mitbih-with-synthetic/mitbih_with_syntetic_test.csv'
def seed_everything(seed: int):
random.seed(seed)
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)