- 博客(6)
- 收藏
- 关注
转载 【人工智能作业】6-CNN实现XO识别
数据集来源Convolutional Neural Networks with Matlab, Caffe and TensorFlow — Optophysiology (uni-freiburg.de)https://www.optophysiology.uni-freiburg.de/Research/research_DL/CNNsWithMatlabAndCaffe构建训练模型代码如下:# https://blog.csdn.net/qq_53345829/article/details
2022-05-28 19:11:53 158
原创 【人工智能作业】5-池化-卷积-激活
for循环版本代码如下:import numpy as npx = np.array([[-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, 1, -1, -1, -1, -1, -1, 1, -1], [-1, -1, 1, -1, -1, -1, 1, -1, -1], [-1, -1, -1, 1, -1, 1, -1, -1, -1], [-1,
2022-05-28 18:38:38 246
原创 【人工智能作业】4-CNN-卷积
卷积模块pytorch代码如下:import numpy as npimport torchfrom torch import nnfrom torch.autograd import Variablefrom PIL import Imageimport matplotlib.pyplot as pltplt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签plt.rcParams['axes.unicode_minus']
2022-05-28 17:00:21 143
原创 【人工智能作业】3-例题程序复现 PyTorch版
还是用的老师给的参考代码:)import torchx1, x2 = torch.Tensor([0.5]), torch.Tensor([0.3])y1, y2 = torch.Tensor([0.23]), torch.Tensor([-0.07])print("=====输入值:x1, x2;真实输出值:y1, y2=====")print(x1, x2, y1, y2)w1, w2, w3, w4, w5, w6, w7, w8 = torch.Tensor([0.2]), tor
2022-05-19 22:29:36 368
原创 【人工智能作业】2-例题程序复现
直接用的老师给的参考代码:)import numpy as npdef sigmoid(z): a = 1 / (1 + np.exp(-z)) return adef forward_propagate(x1, x2, y1, y2, w1, w2, w3, w4, w5, w6, w7, w8): in_h1 = w1 * x1 + w3 * x2 out_h1 = sigmoid(in_h1) in_h2 = w2 * x1 + w4 * x.
2022-05-18 01:46:14 69
原创 【人工智能作业】1-使用Pytorch实现反向传播
代码如下import torchx_data = [1.0, 2.0, 3.0]y_data = [2.0, 4.0, 6.0]w = torch.tensor([1.0]) w.requires_grad = True def forward(x): return x * w def loss(x, y): y_pred = forward(x) return (y_pred - y) ** 2print("predict (before trai
2022-05-01 20:17:46 262
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人