-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcm_simulate.py
51 lines (41 loc) · 1.42 KB
/
cm_simulate.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# coding=utf-8
import sys
import os
import src.simulator.data_process as dp
import src.simulator.model_train as mt
import src.simulator.behavior_predict as bp
cpuCoreCnt = 3
gpuNos = None
gpuMemFraction = None
def main():
cdrDir = "demo/resource/cdr"
propertyDir = "demo/resource/property"
dp_wkdir = "demo/data_process"
dp.run(
cdrDir=cdrDir, propertyDir=propertyDir,
wkdir=dp_wkdir,
workerCnt=3, maxTaskCnt=6,
)
featureFrame3dDir = os.path.join(dp_wkdir, "featureFrame3d")
targetBehaviorDir = os.path.join(dp_wkdir, "targetBehavior")
cacheDir = "demo/__cache"
mt_wkdir = "demo/model_train"
mt.run(
featureFrame3dDir=featureFrame3dDir, targetBehaviorDir=targetBehaviorDir, cacheDir=cacheDir,
wkdir=mt_wkdir,
cpuCoreCnt=cpuCoreCnt, gpuNos=gpuNos, gpuMemFraction=gpuMemFraction,
)
modelFilePath = os.path.join(mt_wkdir, "model", "cm")
featureFrame3dDir = os.path.join(dp_wkdir, "featureFrame3d")
targetBehaviorDir = os.path.join(dp_wkdir, "targetBehavior")
cacheDir = "demo/__cache"
bp_wkdir = "demo/behavior_predict"
bp.run(
modelFilePath=modelFilePath,
featureFrame3dDir=featureFrame3dDir, targetBehaviorDir=targetBehaviorDir, cacheDir=cacheDir,
wkdir=bp_wkdir,
cpuCoreCnt=cpuCoreCnt, gpuNos=gpuNos, gpuMemFraction=gpuMemFraction,
)
return 0
if __name__ == "__main__":
sys.exit(main())