测试文件
This commit is contained in:
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -49,13 +49,25 @@ export const sourceCurveData = {
|
||||
'''
|
||||
import argparse
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
# 获取当前脚本(Data_Load.py)所在的目录
|
||||
current_script_dir = os.path.dirname(__file__) # 结果:/home/app/model/ModelTrainingPython/FC_ML_Baseline/FC_ML_Baseline_Data_Handler
|
||||
|
||||
# 从当前目录回退 2 级,得到项目根目录 ModelTrainingPython
|
||||
root_path = os.path.abspath(os.path.join(current_script_dir, "..", ".."))
|
||||
|
||||
# 将根目录添加到 Python 搜索路径
|
||||
sys.path.append(root_path)
|
||||
|
||||
from FC_ML_Data.FC_ML_Data_Load.Data_Load_Excel import get_data_from_csv_feature
|
||||
from FC_ML_Model.Model_Train_Data import TrainData
|
||||
from FC_ML_Tool.Serialization import parse_json_file
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='导入数据文件参数')
|
||||
parser.add_argument('--param', default='D:\liyong\project\TVS_ML\FC_ML_Baseline\FC_ML_Baseline_Test\param.json',
|
||||
parser.add_argument('--param', default=r'D:\liyong\project\TVS_ML\FC_ML_Baseline\FC_ML_Baseline_Test\param.json',
|
||||
help='配置参数文件绝对路径')
|
||||
parser.add_argument('--export', default='source.json',
|
||||
help='导出JSON文件名')
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"files": ["sample1.CSV"],
|
||||
"path": "/home/app/model/ModelTrainingPython/FC_ML_Baseline/FC_ML_Baseline_Test/Data_Handle/"
|
||||
}
|
||||
23
FC_ML_Baseline/FC_ML_Baseline_Test/Train/param-linux.json
Normal file
23
FC_ML_Baseline/FC_ML_Baseline_Test/Train/param-linux.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"files":["sample1.CSV"],
|
||||
"path": "/home/app/model/ModelTrainingPython/FC_ML_Baseline/FC_ML_Baseline_Test/Train/",
|
||||
"algorithmParam": {
|
||||
"inputSize": 8,
|
||||
"outputSize": 8,
|
||||
"algorithm": "多项式拟合",
|
||||
"activateFun": "sigmod",
|
||||
"lossFun": "l1",
|
||||
"optimizeFun": "sgd",
|
||||
"exportFormat": ".onnx",
|
||||
"trainingRatio": 80,
|
||||
"loadSize": 32,
|
||||
"studyPercent": 0.001,
|
||||
"stepCounts": 3,
|
||||
"roundPrint": 11,
|
||||
"round": 1001,
|
||||
"preDisposeData": false,
|
||||
"disposeMethod": "minmax",
|
||||
"dataNoOrder": false
|
||||
},
|
||||
"algorithm": "基础神经网络NN"
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
* 传参:python xxx.py 源文件路径 文件名 /xx/xx/param.json
|
||||
* param.json 包含:
|
||||
* {
|
||||
*
|
||||
* files:[xxx.excel,xxx.excel,xxx.excel],
|
||||
* path: '/xx/xx/xx',//源文件路径
|
||||
* algorithmParam:{
|
||||
algorithm: '多项式拟合',
|
||||
@@ -35,6 +35,18 @@
|
||||
*/
|
||||
'''
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
|
||||
# 获取当前脚本(Data_Load.py)所在的目录
|
||||
current_script_dir = os.path.dirname(__file__) # 结果:/home/app/model/ModelTrainingPython/FC_ML_Baseline/FC_ML_Baseline_Data_Handler
|
||||
|
||||
# 从当前目录回退 2 级,得到项目根目录 ModelTrainingPython
|
||||
root_path = os.path.abspath(os.path.join(current_script_dir, "..", ".."))
|
||||
|
||||
# 将根目录添加到 Python 搜索路径
|
||||
sys.path.append(root_path)
|
||||
|
||||
from locale import normalize
|
||||
|
||||
import torch
|
||||
|
||||
Reference in New Issue
Block a user