自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

爱飞的企鹅

萌新小白文

  • 博客(17)
  • 收藏
  • 关注

原创 语言模型和数据集

1.自然语言统计import randomimport torchfrom d2l import torch as d2ltokens = d2l.tokenize(d2l.read_time_machine())# 因为每个文本行不一定是一个句子或一个段落,因此我们把所有文本行拼接到一起corpus = [token for line in tokens for token in line]corpus['the', 'time', 'machine', 'by', 'h',

2022-05-23 20:40:29 395 1

原创 31. 文本预处理

文本预处理将文本作为字符串加载到内存中将字符串拆分为词元(如单词和字符)建立一个词汇表,将拆分的词元映射到数字索引将文本转换为数字索引序列,方便模型操作1.读取数据集import collectionsimport refrom d2l import torch as d2ld2l.DATA_HUB['time_machine'] = (d2l.DATA_URL + 'timemachine.txt', '090b5e7

2022-05-23 18:34:58 254

原创 Markdown

Markdown语法Markdown语法_大月亮小地球的博客-CSDN博客Markdown 常用数学符号和公式Markdown 常用数学符号和公式_healer-c的博客-CSDN博客_markdown数学符号

2022-05-23 16:39:50 933

原创 动手学深度学习---序列模型

%matplotlib inlineimport torchfrom torch import nnfrom d2l import torch as d2lT = 1000 # 总共产生1000个点time = torch.arange(1,T+1,dtype = torch.float32)x = torch.sin(0.01*time) + torch.normal(0,0.2,(T,))d2l.plot(time, [x], 'time', 'x', xlim=[1, 1000],

2022-05-23 02:29:42 378

原创 12.线性回归pytorch实现

import numpy as npimport torchfrom torch.utils import datafrom d2l import torch as d2ltrue_w = torch.tensor([2, -3.4])true_b = 4.2features, labels = d2l.synthetic_data(true_w, true_b, 1000)def load_array(datast,batch_size,is_train=True): datas

2022-05-22 00:01:52 189

原创 11 从零实现线性回归

%matplotlib inlineimport randomimport torchfrom d2l import torch as d2l1.生成数据集def synthetic_data(w,b,num_examples): #生成y=Xw+b+噪声 x = torch.normal(0,1,(num_examples,len(w)))#mean:0 标准差:1 shape:(1000,2) y = torch.matmul(x, w) + b #二维矩阵相乘 维

2022-05-21 23:59:57 487

原创 9 正态分布

import mathimport timeimport numpy as npimport torchfrom d2l import torch as d2l1.矢量化加速class Timer: '''记录多次运行时间''' def __init__(self): self.times = [] self.start() def start(self): self.tik = time.time() def s

2022-05-21 23:56:42 138

原创 AlexNet实现

import osphotos = os.listdir("./data/image/train/")with open("data/dataset.txt","w") as f: for photo in photos: name = photo.split(".")[0] if name=="cat": f.write(photo + ";0\n") elif name=="dog": f.wr

2022-05-21 20:06:34 84

原创 7 概率

1.概率import torchfrom torch.distributions import multinomial #torch关于概率的库from d2l import torch as d2lfair_probs = torch.ones([6])/6fair_probs<frozen importlib._bootstrap>:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incom

2022-05-20 16:42:11 413

原创 6. 自动求导

import torchx = torch.arange(4.0)xtensor([0., 1., 2., 3.])1.反向传播#告诉pytorch x需要计算梯度x.requires_grad_(True)tensor([0., 1., 2., 3.], requires_grad=True)#反向传播y = 2*torch.dot(x,x)y.backward()x.gradtensor([ 0., 4., 8., 12.])#梯度清0x.grad.zero

2022-05-20 15:56:18 63

原创 5 pytorch与微分 数学基础

%matplotlib inline #省去plt.show() %config Completer.use_jedi=False #jupyter 补全代码太慢解决办法import numpy as npfrom IPython import displayfrom d2l import torch as d2l1.导数f′(x)=lim⁡h→0f(x+h)−f(x)hf^{'}(x) = \lim_{h \to 0}\frac{f(x+h)-f(x)}{h}f′(x)=limh→0​

2022-05-20 00:50:52 155

原创 4.pytorch 线性代数基础练习

import osos.makedirs(os.path.join('..','data'),exist_ok=True)datafile = os.path.join('..','data','house_tiny.csv')with open(datafile,'w') as f: f.write('NumRooms,Alley,Price\n') f.write('NA,Pave,127500\n') f.write('2,NA,106000\n') f.wri

2022-05-20 00:13:57 162

原创 天池龙珠训练营深度学习基础知识学习笔记基于人脸的常见表情识别实战Task(1)

本学习笔记为阿里云天池龙珠计划深度学习训练营的学习内容,学习链接为:https://tianchi.aliyun.com/specials/promotion/aicampdl一、学习知识点概要1. 神经网络- 感知机- 反向传播2. 卷积神经网络3. 卷积神经网络的基本网络层填充(Padding)步长(Stride)池化卷积和池化输出尺寸计算二、学习内容1. 感知机1.感知机是二分类线性分类器,通常情况下指单层的人工神经网络2.感知机本质上是一种线性模型,只能处理线性

2022-04-13 21:32:40 549

原创 天池龙珠训练营机器学习基础知识学习笔记Task(2) ----- XGBoost

本学习笔记为阿里云天池龙珠计划机器学习训练营的学习内容,学习链接为:https://tianchi.aliyun.com/specials/promotion/aicampml一、学习知识点概要XGBoost介绍XGBoost原理粗略讲解基于天气数据集的XGBoost分类实战二、学习内容1. XGBoost原理:XGBoost是基于CART树的集成模型,它的思想是串联多个决策树模型共同进行决策。那么如何串联呢?XGBoost采用迭代预测误差的方法串联。举个通俗的例子,我们现在需要预测一

2022-04-13 02:34:42 128

原创 天池龙珠训练营机器学习基础知识学习笔记Task(1) -----逻辑回归

本学习笔记为阿里云天池龙珠计划机器学习训练营的学习内容,学习链接为:https://tianchi.aliyun.com/specials/promotion/aicampml一、学习知识点概要1. 逻辑回归 - 是分类模型,一个线性分类器2. 逻辑回归模型的优劣势:优点:实现简单,易于理解和实现;计算代价不高,速度很快,存储资源低;缺点:容易欠拟合,分类精度可能不高逻辑回归方程:z=W0W_{0}W0​ + ∑iM\sum_{i}^{M}∑iM​WiW_{i}Wi​ Xi

2022-04-12 23:27:47 882

原创 RDO安装单节点OPENSTACK网络问题

我在学习单节点使用RDO安装P版本open stack时,会碰到一个问题,从宿主机无法ping通虚拟网络网关我们可以看见创建完路由后,我们的网关是172.24.4.4当我们在宿主机去ping这个网关时,发现没有通为什么呢?当我检测完我的网络路由配置没问题时,我想是不是因为我没有第二块网卡的原因,所以我去看了配置文件,发现这个float网络的物理网络绑定的是br-ex,并...

2019-04-18 14:22:26 423

原创 2块网卡同时接通内网和外网

我的电脑上有一块自带网卡和一块无限网卡,理想情况(用自带网卡访问内网,用无限网卡问外网),现实是无限网卡可以访问内网,自带网卡却ping不通内网。上网查了好多方法有改活跃点数,有设定优先级,都不管用。最后找到一个办法,我们可以在电脑上做一个静态路由。因为系统内存在两个网关了,系统不知道该走哪个网卡访问外部网络你得将内网的网卡取消网关,然后手工为内网的访问建单独的静态路由。这样就不影响外...

2019-04-17 22:07:08 350

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除