摘要: 实际运用例子: https://zhuanlan.zhihu.com/p/35709485 pytorch CrossEntropyLoss,参考博客如下: https://mathpretty.com/12068.html https://blog.csdn.net/wyyang2/article 阅读全文
posted @ 2020-11-09 17:51 qiezi_online 阅读(166) 评论(0) 推荐(0) 编辑
摘要: %matplotlib inline import numpy as np import torch from torch import nn import matplotlib.pyplot as plt d = 1 n = 200 X = torch.rand(n,d) #200*1, batc 阅读全文
posted @ 2020-11-09 16:35 qiezi_online 阅读(3290) 评论(0) 推荐(0) 编辑
摘要: #define y = X @ w import torch from torch import nn #第一模块,数据初始化 n = 100 X = torch.rand(n,2) true_w = torch.tensor([[-1.],[2]]) y = X @ true_w + torch. 阅读全文
posted @ 2020-11-09 11:31 qiezi_online 阅读(450) 评论(0) 推荐(0) 编辑