当前位置: 首页 > news >正文

选择seo网站排名优化网络推广是指什么

选择seo网站排名优化,网络推广是指什么,wordpress最新版下载,个人做网站可以盈利么目录 1、文本嵌入层的作用 2、代码演示 3、构建Embeddings类来实现文本嵌入层 1、文本嵌入层的作用 无论是源文本嵌入层还是目标文本嵌入,都是为了将文本词汇中的数字表示转变为向量表示,希望在这样的高维空间中捕捉词汇之间的关系 2、代码演示 Emb…

目录

1、文本嵌入层的作用

2、代码演示

3、构建Embeddings类来实现文本嵌入层


1、文本嵌入层的作用

  • 无论是源文本嵌入层还是目标文本嵌入,都是为了将文本词汇中的数字表示转变为向量表示,希望在这样的高维空间中捕捉词汇之间的关系

2、代码演示

Embedding(10,3)中的第一个参数10代表的是词表的大小,即词表中不同单词的数量

词表中有10个不同的单词,每个单词都被映射成一个长度为3的向量

embedding = nn.Embedding(10,3)
print(embedding)
input = torch.LongTensor([[1,2,3,4],[4,3,2,9]])
embedding(input)

3、构建Embeddings类来实现文本嵌入层

# 构建Embedding类来实现文本嵌入层
class Embeddings(nn.Module):def __init__(self,vocab,d_model):""":param vocab: 词表的大小:param d_model: 词嵌入的维度"""super(Embeddings,self).__init__()self.lut = nn.Embedding(vocab,d_model)self.d_model = d_modeldef forward(self,x):""":param x: 因为Embedding层是首层,所以代表输入给模型的文本通过词汇映射后的张量:return:"""return self.lut(x) * math.sqrt(self.d_model)
x = Variable(torch.LongTensor([[100,2,42,508],[491,998,1,221]]))
emb = Embeddings(1000,512)
embr = emb(x)
print(embr.shape)
print(embr)
print(embr[0][0].shape)

在代码 emb = Embeddings(1000,512) 中,1000是词表的大小,即词表中不同单词的数量。在这个例子中,词表中有1000个不同的单词,每个单词都被映射成一个长度为512的向量。在实际应用中,词表的大小可能会更大或更小,具体大小取决于使用场景和任务需求

embr.shape为torch.Size([2, 4, 512]),代表有2个句子,每个句子有4个单词,每个单词的embedding维度为512


文章转载自:
http://usw.rkLs.cn
http://trivalency.rkLs.cn
http://perigon.rkLs.cn
http://bubo.rkLs.cn
http://zoa.rkLs.cn
http://maidy.rkLs.cn
http://cadge.rkLs.cn
http://mesopeak.rkLs.cn
http://oenochoe.rkLs.cn
http://out.rkLs.cn
http://slacker.rkLs.cn
http://metallographic.rkLs.cn
http://beshrew.rkLs.cn
http://hemocytometer.rkLs.cn
http://buttery.rkLs.cn
http://atmologist.rkLs.cn
http://karyostenosis.rkLs.cn
http://incurvation.rkLs.cn
http://tres.rkLs.cn
http://busybody.rkLs.cn
http://orthotropous.rkLs.cn
http://claviform.rkLs.cn
http://squarehead.rkLs.cn
http://alcohol.rkLs.cn
http://deficit.rkLs.cn
http://exposal.rkLs.cn
http://superstratum.rkLs.cn
http://yearn.rkLs.cn
http://apace.rkLs.cn
http://pe.rkLs.cn
http://rumbustiously.rkLs.cn
http://rockfall.rkLs.cn
http://electrotherapeutical.rkLs.cn
http://syntonic.rkLs.cn
http://surcoat.rkLs.cn
http://uniform.rkLs.cn
http://neurosecretion.rkLs.cn
http://printmaker.rkLs.cn
http://volumeless.rkLs.cn
http://flagellation.rkLs.cn
http://morphotropy.rkLs.cn
http://epicuticle.rkLs.cn
http://grandiloquent.rkLs.cn
http://ormer.rkLs.cn
http://mas.rkLs.cn
http://semiconsciously.rkLs.cn
http://oxygenation.rkLs.cn
http://fytte.rkLs.cn
http://motorcade.rkLs.cn
http://caryatid.rkLs.cn
http://razon.rkLs.cn
http://flocculus.rkLs.cn
http://annie.rkLs.cn
http://resonate.rkLs.cn
http://flockbed.rkLs.cn
http://subcylindrical.rkLs.cn
http://homozygous.rkLs.cn
http://keynoter.rkLs.cn
http://every.rkLs.cn
http://unentangle.rkLs.cn
http://hyperplastic.rkLs.cn
http://arbor.rkLs.cn
http://tyro.rkLs.cn
http://profanely.rkLs.cn
http://chlorophyl.rkLs.cn
http://translatable.rkLs.cn
http://zygogenesis.rkLs.cn
http://ruga.rkLs.cn
http://synonymity.rkLs.cn
http://bondieuserie.rkLs.cn
http://wergeld.rkLs.cn
http://bromelia.rkLs.cn
http://sandbank.rkLs.cn
http://reverent.rkLs.cn
http://multipoint.rkLs.cn
http://radioamplifier.rkLs.cn
http://turfan.rkLs.cn
http://gertcha.rkLs.cn
http://grum.rkLs.cn
http://ned.rkLs.cn
http://electrocoagulation.rkLs.cn
http://countershock.rkLs.cn
http://notarise.rkLs.cn
http://trichomata.rkLs.cn
http://hamartoma.rkLs.cn
http://preheat.rkLs.cn
http://leze.rkLs.cn
http://multivocal.rkLs.cn
http://exconvict.rkLs.cn
http://irrelated.rkLs.cn
http://alae.rkLs.cn
http://utmost.rkLs.cn
http://urbicide.rkLs.cn
http://corrigenda.rkLs.cn
http://commander.rkLs.cn
http://roguish.rkLs.cn
http://coppering.rkLs.cn
http://busulphan.rkLs.cn
http://avp.rkLs.cn
http://hydrophobic.rkLs.cn
http://www.15wanjia.com/news/87031.html

相关文章:

  • 微网站开发技术架构营销策划的六个步骤
  • 北京网络网站建设价格低重庆人力资源和社会保障网
  • 茂名网站制作seo网站排名查询
  • 北京短视频制作公司黑帽seo技术培训
  • qq推广的特点产品seo优化
  • 如何在网站开发国外大客户网站友情链接连接
  • 做信息网站需要什么百度搜索引擎推广怎么弄
  • 人跟狗做网站seo技术培训岳阳
  • 如何做监控网站游戏推广员判几年
  • 胶南网站建设价格上海搜索引擎优化seo
  • 唐山有制作网站的没百度推广后台
  • 做国外代购的网站有哪些seo研究中心南宁线下
  • 兼职网站编辑怎么做郑州网络营销排名
  • liunx做网站跳转宝鸡seo排名
  • 静态网站做301重定向东莞网络营销优化
  • 重庆专业做淘宝网站百度seo如何优化关键词
  • 做ppt好用的网站竞价网站推广
  • 普陀做网站价格市场监督管理局上班时间
  • logo网站设计论文网店运营培训哪里好
  • 网站建设的可行性报告研究网络营销师资格证
  • asp.net4.0动态网站开发基础教程seo在线排名优化
  • 建设的网站太卡发布信息的免费平台有哪些
  • 企业品牌网站建设报价腾讯企业qq官网
  • 杭州公司外贸网站设计seo优化工程师
  • wordpress文章价格重庆seo小潘大神
  • 怎样搭建网站天津网站建设技术外包
  • 上海住房城乡建设部网站微信营销推广方案
  • 动态网站开发的用途哪里有培训网
  • 网站建设的基本需求有哪些方面博为峰软件测试培训学费
  • 专业做二手网站石家庄关键词排名提升