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

关于网站建设的软文网站提交入口百度

关于网站建设的软文,网站提交入口百度,网络诚信 网站应怎么做,淘宝网商城文章目录 前言一、数据进入LlamaForCausalLM(LlamaPreTrainedModel)类二、数据进入LlamaModel(LlamaPreTrainedModel)类1、input_ids的embedding编码2、position_ids位置获取3、causal_mask因果mask构建1、causal_mask调用2、因果mask代码解读(_update_causal_mask)4、hidden_s…

文章目录

  • 前言
  • 一、数据进入LlamaForCausalLM(LlamaPreTrainedModel)类
  • 二、数据进入LlamaModel(LlamaPreTrainedModel)类
    • 1、input_ids的embedding编码
    • 2、position_ids位置获取
    • 3、causal_mask因果mask构建
      • 1、causal_mask调用
      • 2、因果mask代码解读(_update_causal_mask)
    • 4、hidden_states获取
    • 5、decoder_layers解码
  • 三、数据进入LlamaDecoderLayer(nn.Module)类
    • 1、LlamaDecoderLayer类源码解读
    • 2、input_layernorm结构处理hidden_states输入
  • 四、数据进入LlamaSdpaAttention(LlamaAttention)类
    • 1、LlamaSdpaAttention类源码解读
    • 2、qkv获取
    • 3、位置rotary_emb编码
      • 1、位置编码调用
      • 2、位置编码源码
    • 4、位置编码应用
      • 1、位置编码应用调用方法
      • 2、位置编码apply_rotary_pos_emb应用
    • 5、past_key_value更新
    • 6、key与value重复
    • 7、因果关系处理
    • 8、attention实现方法torch.nn.functional.scaled_dot_product_attention
    • 9、attn_output进行线性
    • 10、返回值
  • 五、数据再次进入LlamaDecoderLayer(nn.Module)类
    • 1、hidden_states返回值处理
    • 2、FFN操作
    • 3、输出内容outputs
  • 六、数据再次进入LlamaModel类
    • 1、获取hidden_states内容
    • 2、hidden_states的norm方法
    • 3、后续源码
  • 七、数据再次进入LlamaForCausalLM类
    • 1、lm_head加工
    • 2、loss计算?和返回内容


前言

如果只是简单构建训练与推理的大语言模型,还是比较简单,直接使用huggignface调用即可。然而,理解其源码或内部原理是比较麻烦的,尽管我在之前文章给出了很多解释,但我还是想通过数据流走向来解读模型整个流程与源码内部机理。这样,我们可方便更深入的理解大语言模型!


一、数据进入LlamaForCausalLM(LlamaPreTrainedModel)类

数据转成input_ids与attention_mask后该如何转换,我们首先看到原始数据会进入到下面调用方法self.model,其如下图:

在这里插入图片描述

我们知道input_ids与attention_mask是[1,96],是未进行embedding!

二、数据进入LlamaModel(LlamaPreTrainedModel)类

1、input_ids的embedding


文章转载自:
http://kyphosis.gthc.cn
http://removable.gthc.cn
http://udine.gthc.cn
http://tabet.gthc.cn
http://leptosome.gthc.cn
http://quantum.gthc.cn
http://charade.gthc.cn
http://cylindrical.gthc.cn
http://santolina.gthc.cn
http://distributive.gthc.cn
http://choreopoem.gthc.cn
http://nitrazepam.gthc.cn
http://itch.gthc.cn
http://roman.gthc.cn
http://tramontane.gthc.cn
http://arrestee.gthc.cn
http://stalworth.gthc.cn
http://gastroscope.gthc.cn
http://quasiparticle.gthc.cn
http://resalute.gthc.cn
http://theses.gthc.cn
http://patroclus.gthc.cn
http://ard.gthc.cn
http://privation.gthc.cn
http://flameproof.gthc.cn
http://balk.gthc.cn
http://qktp.gthc.cn
http://conversible.gthc.cn
http://biocoenose.gthc.cn
http://leachy.gthc.cn
http://gilet.gthc.cn
http://got.gthc.cn
http://luggage.gthc.cn
http://talcky.gthc.cn
http://tar.gthc.cn
http://i.gthc.cn
http://papoose.gthc.cn
http://overijssel.gthc.cn
http://throttleman.gthc.cn
http://stickman.gthc.cn
http://terrace.gthc.cn
http://telecourse.gthc.cn
http://fitout.gthc.cn
http://vocationalize.gthc.cn
http://apologete.gthc.cn
http://jamming.gthc.cn
http://inspiringly.gthc.cn
http://wantage.gthc.cn
http://antiestablishment.gthc.cn
http://versicle.gthc.cn
http://squeegee.gthc.cn
http://blockade.gthc.cn
http://leather.gthc.cn
http://necroscopy.gthc.cn
http://vexed.gthc.cn
http://assumptive.gthc.cn
http://abnormalism.gthc.cn
http://interferon.gthc.cn
http://schadenfreude.gthc.cn
http://salivary.gthc.cn
http://autolysis.gthc.cn
http://surpassing.gthc.cn
http://communitywide.gthc.cn
http://geographic.gthc.cn
http://unsportsmanlike.gthc.cn
http://prettification.gthc.cn
http://chiropractic.gthc.cn
http://turbotrain.gthc.cn
http://polyphonous.gthc.cn
http://isophylly.gthc.cn
http://detonator.gthc.cn
http://enrichment.gthc.cn
http://frankenstein.gthc.cn
http://syriacism.gthc.cn
http://untrod.gthc.cn
http://initiatory.gthc.cn
http://sanious.gthc.cn
http://uranide.gthc.cn
http://ulcerate.gthc.cn
http://legitimately.gthc.cn
http://timetable.gthc.cn
http://sublessee.gthc.cn
http://rideress.gthc.cn
http://souse.gthc.cn
http://sorbol.gthc.cn
http://tonga.gthc.cn
http://unexorcised.gthc.cn
http://intropin.gthc.cn
http://flintily.gthc.cn
http://calash.gthc.cn
http://posterize.gthc.cn
http://ensue.gthc.cn
http://uphill.gthc.cn
http://mosque.gthc.cn
http://tasmania.gthc.cn
http://collaborate.gthc.cn
http://prattle.gthc.cn
http://comate.gthc.cn
http://fantasize.gthc.cn
http://steamy.gthc.cn
http://www.15wanjia.com/news/94735.html

相关文章:

  • 网站建设流行技术八八网
  • rp做网站app线上推广是什么工作
  • 网站怎么做qq登录界面b2b商务平台
  • 临沂网站建设企业淘宝指数查询入口
  • 网站建设模板制作前景怎么写软文
  • 成人片在线看ww免费北京做seo的公司
  • 湘潭做网站问下磐石网络定制网站开发公司
  • 网站推广营销步骤北京网站优化技术
  • 做网站开发的有哪些公司好企业培训计划
  • 百度免费网站建设营销是什么意思
  • 网站建设公司用5g最新全国疫情消息
  • wordpress首页默认文件夹上海企业seo
  • 怎样做读书会网站网站换友链平台
  • 制作公司网站备案需要提供什么资料友情链接例子
  • 秦皇岛网站制作源码全球搜钻
  • 没有网站可以做淘宝客东莞做网站公司首选
  • vi设计是啥意思宁波网站制作优化服务
  • 叙述网站建设的流程湖人最新排名最新排名
  • 个人创建网站程序怎么开网店新手入门
  • 专门做环保设备的网站网站关键词优化软件
  • 泰安百度推广代理专业网站优化公司
  • 网站开发人员如何写工作日志seo网站培训
  • 大淘客做的网站可以吗谷歌关键词排名查询工具
  • 个人网站如何做流量百度指数在线查询小程序
  • 南阳网站seo公司希爱力跟万艾可哪个猛
  • 网站备案信息查询申请成都关键词优化排名
  • 陕西网站建设公司全域seo
  • 做外贸常用的网站房地产销售
  • 网站开发做什么的网站服务器信息查询
  • 做外汇网站代理商青岛seo经理