07 2023 档案
摘要:# 深度学习基础-李沐课程跟学 ## 基础知识 * 深度学习与经典方法的区别主要在于:前者关注功能强大的模型,这些模型有神经网络错综复杂的交织在一起,包含层层数据转换,因此被成为深度学习。 * 所谓“学习”是指模型自主提高完成某些任务的性能。在机器学习中,我们需要定义对模型的优劣程度的度量,这个度量
阅读全文
摘要:import torch from torch import nn from d2l import torch as d2l def dropout_layer(x,dropout): assert 0<= dropout <=1 if dropout ==1: return torch.zeros
阅读全文
摘要:import torch from torch import nn from d2l import torch as d2l # 将数据做的很小,这样容易实现过拟合 n_train, n_test, num_inputs, batch_size = 20, 100, 200, 5 true_w, t
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:import torch from IPython import display from d2l import torch as d2l # from d2l.mxnet import Accumulator batch_size = 256 # 每次读256张图片,返回训练iter和测试iter
阅读全文
摘要: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
阅读全文