forked from sophie091524/Noise-Reduction-in-ECG-Signals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
30 lines (22 loc) · 841 Bytes
/
main.py
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
import argparse, os
import numpy as np
import tensorflow as tf
from math import floor
from train import train
from test import test
from read import load_train_data, load_valid_data, load_test_data
if __name__ == '__main__':
parser = argparse.ArgumentParser('')
parser.add_argument('--gpus', type=str) #determine gpu to use
parser.add_argument('--path', type=str) #determine path to save
parser.add_argument('--mode', type=str)
args = parser.parse_args()
os.environ['CUDA_VISIBLE_DEVICES'] = args.gpus
if args.mode == 'train':
data = load_train_data()
Test_data = load_valid_data()
#Test_data = load_test_data()
train(data, Test_data, args.path)
elif args.mode == 'test':
data = load_test_data()
test(data, args.path)