将要预测的包长度序列npy文件放在/data/data下,命名为test.npy,该文件的格式如下:
要保持51维,第51维可以随便给
[
[61, 141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[52, 52, 745, 1999, 40, 662, 40, 1999, 40, 1422, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1422, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 40, 1999, 0],
[58, 298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[63, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[58, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[63, 491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[66, 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]
然后cd到main目录,执行python main.py
,注意此时该程序main函数只需要执行mainUSE()
函数:
if __name__ == '__main__':
mainUSE()
预测结果已保存至: ..\data_BEN\result\prediction_BEN.npy
预测结果已保存至: ..\data_RAT\result\prediction_RAT.npy
预测结果已保存至: ..\data_PST\result\prediction_PST.npy
预测结果已保存至: ..\data_BDT\result\prediction_BDT.npy
预测结果已保存至: ..\data_SPT\result\prediction_SPT.npy
预测结果已保存至: ..\data_DLT\result\prediction_DLT.npy
已复制 1 个文件。
整合后的数据已保存至: ..\multi_Classifier\combined_data_with_labels.npy
已加载训练好的复杂softmax模型: ../multi_Classifier/model.pth
最终预测结果已保存至: ..\multi_Classifier\final_predictions.npy
运行结束,结果保存在\multi_Classifier\final_predictions.npy
中,手动点击该目录下手动查看精度.py
即可查看精度
基本步骤同上,main.py
里面改成:
if __name__ == '__main__':
mianTRAIN()