-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathmain.py
More file actions
45 lines (37 loc) · 2.3 KB
/
main.py
File metadata and controls
45 lines (37 loc) · 2.3 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
__author__ = "Yizhuo Wu, Chang Gao, Ang Li"
__license__ = "Apache-2.0 License"
__email__ = "yizhuo.wu@tudelft.nl, chang.gao@tudelft.nl, a.li-2@tudelft.nl"
import os
# Prevent duplicate OpenMP runtime initialization on macOS (libomp vs. Apple's libomp)
os.environ.setdefault("KMP_DUPLICATE_LIB_OK", "TRUE")
from steps import train_pa, train_dpd, run_dpd
from steps import plot as plot_step
from project import Project
if __name__ == '__main__':
proj = Project()
# PA Modeling
if proj.step == 'train_pa':
print("####################################################################################################")
print("# Step: Train PA #")
print("####################################################################################################")
train_pa.main(proj)
# DPD Learning
elif proj.step == 'train_dpd':
print("####################################################################################################")
print("# Step: Train DPD #")
print("####################################################################################################")
train_dpd.main(proj)
# Run DPD to Generate Predistorted PA Outputs
elif proj.step == 'run_dpd':
print("####################################################################################################")
print("# Step: Run DPD #")
print("####################################################################################################")
run_dpd.main(proj)
# Generate Comparison Plots (Without DPD vs With DPD)
elif proj.step == 'plot':
print("####################################################################################################")
print("# Step: Plot (Compare Without DPD vs With DPD) #")
print("####################################################################################################")
plot_step.main(proj)
else:
raise ValueError(f"The step '{proj.step}' is not supported.")