打赏
摘要: import torch from torch import nn from d2l import torch as d2l batch_size = 256 train_iter, test_iter = d2l.load_data_fashion_mnist(batch_size) num_in 阅读全文
posted @ 2023-07-29 09:22 不像话 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import torch from torch import nn from d2l import torch as d2l batch_size = 256 train_iter, test_iter = d2l.load_data_fashion_mnist(batch_size) # PyTo 阅读全文
posted @ 2023-07-29 09:16 不像话 阅读(11) 评论(0) 推荐(0) 编辑
摘要: import torch from IPython import display from d2l import torch as d2l # from d2l.mxnet import Accumulator batch_size = 256 # 每次读256张图片,返回训练iter和测试iter 阅读全文
posted @ 2023-07-29 09:14 不像话 阅读(6) 评论(0) 推荐(0) 编辑
摘要: import random import torch from d2l import torch as d2l def synthetic_data(w,b,num_examples): """生成y=Xw+b+噪声""" x = torch.normal(0,1,(num_examples,len 阅读全文
posted @ 2023-07-29 08:12 不像话 阅读(6) 评论(0) 推荐(0) 编辑