Merge branch 'master' into Project_Record
This commit is contained in:
commit
9b5c0eadf3
|
|
@ -1,3 +1,4 @@
|
||||||
Static
|
Static
|
||||||
Result
|
Result
|
||||||
|
.vscode
|
||||||
__pycache__
|
__pycache__
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Python Debugger: Current File",
|
"name": "Python Debugger: Current this project",
|
||||||
"type": "debugpy",
|
"type": "debugpy",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "main.py",
|
"program": "main.py",
|
||||||
|
|
|
||||||
47
README.md
47
README.md
|
|
@ -1,5 +1,48 @@
|
||||||
# Deeplearning
|
#README
|
||||||
|
## Quickly Start
|
||||||
|
1. 将项目文件夹编辑成**日期+项目名**
|
||||||
|
2. 编辑好label名称,label名称命名变成英文或者数字
|
||||||
|
>例如:”PDMS“, ”1“ 等, , 如果你的每一个类,下面又多个子特征则可以建立一个文件夹,在创建神经网络类的时候将**isDir**参数改成True即可.
|
||||||
|
>详细如下图:
|
||||||
|
>2.1. 如果只有一类特征
|
||||||
|
> 
|
||||||
|
>2.2. 如果有多类特征
|
||||||
|
>
|
||||||
|
3. 将准备好的文件夹移动到**Static**文件夹中(没有就建立),如果没有 **Result** 建立一个**Result**文件夹用来存放结果
|
||||||
|
|
||||||
1. 使用前先建立一个分支,分支名字以日期加项目英文名称,比如`20241110Deeplearning`,方便回溯。
|
4. 读取数据:
|
||||||
|
```python
|
||||||
|
# 以MaterialDiv为例
|
||||||
|
projet_name = '20241009MaterialDiv'
|
||||||
|
label_names = ['Acrlic', 'Ecoflex', 'PDMS', 'PLA', 'Wood']
|
||||||
|
# 使用库 divSet 划分训练集和数据集
|
||||||
|
data = load_data(projet_name, label_names, isDir=False, fileClass='xlsx')
|
||||||
|
X_train, X_test, y_train, y_test, encoder = divSet(
|
||||||
|
data=data, labels=label_names, test_size= 0.3
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
5. 创建神经网络类
|
||||||
|
```python
|
||||||
|
model = Qmlp(
|
||||||
|
X_train=X_train, X_test=X_test, y_train=y_train, y_test= y_test,
|
||||||
|
hidden_layers = [128],
|
||||||
|
dropout_rate=0
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
6. 训练并获取数据
|
||||||
|
```python
|
||||||
|
pca_2d, pca_3d = model.get_PCA()
|
||||||
|
|
||||||
|
model.fit(300)
|
||||||
|
|
||||||
|
cm = model.get_cm()
|
||||||
|
epoch_data = model.get_epoch_data()
|
||||||
|
|
||||||
|
save_to_xlsx(project_name=projet_name, file_name="pca_2d", data=pca_2d)
|
||||||
|
save_to_xlsx(project_name=projet_name, file_name="pca_3d", data=pca_3d)
|
||||||
|
save_to_xlsx(project_name=projet_name, file_name="cm", data=cm )
|
||||||
|
save_to_xlsx(project_name=projet_name, file_name="acc_and_loss", data=epoch_data)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue