parent
3baa80ee49
commit
c2719708ef
@ -0,0 +1,8 @@
|
|||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# 基于编辑器的 HTTP 客户端请求
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
@ -0,0 +1,12 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="ignoredIdentifiers">
|
||||||
|
<list>
|
||||||
|
<option value="mybkauth.views.conn" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Black">
|
||||||
|
<option name="sdkName" value="C:\Users\28326\anaconda3" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="C:\Users\28326\anaconda3" project-jdk-type="Python SDK" />
|
||||||
|
</project>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/识别.iml" filepath="$PROJECT_DIR$/.idea/识别.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="PYTHON_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="jdk" jdkName="C:\Users\28326\anaconda3" jdkType="Python SDK" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,42 @@
|
|||||||
|
import torch
|
||||||
|
import torch.nn as nn
|
||||||
|
import torch.optim as optim
|
||||||
|
import torch.nn.functional as F
|
||||||
|
import torchvision
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
||||||
|
class CNN(nn.Module):
|
||||||
|
def __init__(self):
|
||||||
|
super(CNN, self).__init__()
|
||||||
|
self.conv1 = nn.Sequential(
|
||||||
|
nn.Conv2d(1, 16, 5, 1, 2),
|
||||||
|
nn.ReLU(),
|
||||||
|
nn.MaxPool2d(2)
|
||||||
|
)
|
||||||
|
self.conv2 = nn.Sequential(
|
||||||
|
nn.Conv2d(16, 32, 5, 1, 2),
|
||||||
|
nn.ReLU(),
|
||||||
|
nn.MaxPool2d(2)
|
||||||
|
)
|
||||||
|
self.conv3 = nn.Sequential(
|
||||||
|
nn.Conv2d(32, 64, 5, 1, 2),
|
||||||
|
nn.ReLU(),
|
||||||
|
nn.MaxPool2d(2)
|
||||||
|
)
|
||||||
|
self.conv4 = nn.Sequential(
|
||||||
|
nn.Conv2d(64, 32, 5, 1, 2),
|
||||||
|
nn.ReLU(),
|
||||||
|
nn.MaxPool2d(2)
|
||||||
|
)
|
||||||
|
self.out = nn.Linear(32, 10) # 确保输出类别数正确
|
||||||
|
|
||||||
|
def forward(self, x):
|
||||||
|
x = self.conv1(x).to(device) # 将数据迁移到GPU
|
||||||
|
x = self.conv2(x).to(device)
|
||||||
|
x=self.conv3(x).to(device)
|
||||||
|
x = self.conv4(x).to(device)
|
||||||
|
x = x.view(x.size(0), -1).to(device)
|
||||||
|
x = self.out(x).to(device)
|
||||||
|
return x
|
Binary file not shown.
@ -0,0 +1,28 @@
|
|||||||
|
certifi==2024.6.2
|
||||||
|
charset-normalizer==3.3.2
|
||||||
|
contourpy==1.2.1
|
||||||
|
cycler==0.12.1
|
||||||
|
filelock==3.15.1
|
||||||
|
fonttools==4.53.0
|
||||||
|
idna==3.7
|
||||||
|
Jinja2==3.1.4
|
||||||
|
kiwisolver==1.4.5
|
||||||
|
MarkupSafe==2.1.5
|
||||||
|
matplotlib==3.6.3
|
||||||
|
mpmath==1.3.0
|
||||||
|
networkx==3.2.1
|
||||||
|
numpy==1.22.4
|
||||||
|
packaging==24.1
|
||||||
|
Pillow==9.1.0
|
||||||
|
pyparsing==3.1.2
|
||||||
|
PyQt5==5.15.6
|
||||||
|
PyQt5-Qt5==5.15.2
|
||||||
|
PyQt5-sip==12.13.0
|
||||||
|
python-dateutil==2.9.0.post0
|
||||||
|
requests==2.32.3
|
||||||
|
six==1.16.0
|
||||||
|
sympy==1.12.1
|
||||||
|
torch==1.13.1
|
||||||
|
torchvision==0.14.0
|
||||||
|
typing_extensions==4.12.2
|
||||||
|
urllib3==2.2.1
|
Loading…
Reference in new issue