摘要:
代码: #集中不同的优化方式 import torch import torch.utils.data as Data import torch.nn.functional as F from torch.autograd import Variable import matplotlib.pypl 阅读全文
posted @ 2020-02-12 17:34
清心lh
阅读(687)
评论(0)
推荐(0)
摘要:
代码: #进行批训练 import torch import torch.utils.data as Data BATCH_SIZE = 5 #每批5个数据 if __name__ == '__main__': x = torch.linspace(1, 10, 10) #x是从1到10共10个数据 阅读全文
posted @ 2020-02-12 17:32
清心lh
阅读(1137)
评论(0)
推荐(0)
摘要:
代码如下: #实现网络的保存和提取 import torch from torch.autograd import Variable import matplotlib.pyplot as plt #设置随机种子实现结果复现,在神经网络中,参数默认是进行随机初始化的。 # 不同的初始化参数往往会导致 阅读全文
posted @ 2020-02-12 17:30
清心lh
阅读(1854)
评论(0)
推荐(0)