08 2023 档案
摘要:## LLM inference workflow **Generative Inference**. A typical LLM generative inference task consists of two stages: i) the prefill stage which takes a
阅读全文
摘要:- VSCode启动Debug模式调试带参数的python文件: https://blog.csdn.net/weixin_39329055/article/details/119530587 - 单步调试进入外部文件:launch.json中写入以下: ```json { // 使用 Intell
阅读全文
摘要:- Towards Topic-Guided Conversational Recommender System - RecInDial: A Unified Framework for Conversational Recommendation with Pretrained Language M
阅读全文
摘要:## TD learning of state values The data/experience required by the algorithm: - or
阅读全文
摘要:### the discounted return $$ \begin{aligned} G_t & =R_{t+1}+\gamma R_{t+2}+\gamma^2 R_{t+3}+\ldots \\ & =R_{t+1}+\gamma\left(R_{t+2}+\gamma R_{t+3}+\l
阅读全文
摘要:# 1.7 Markov decision processes This section presents these concepts in a more formal way under the framework of Markov decision processes (MDPs). An
阅读全文
摘要:第6课-随机近似与随机梯度下降 ## 6.1 Motivating examples ## Mean Estimation Revisit the mean estimation problem: - Consider a random variable . - Our aim is to e
阅读全文
摘要:```python import torch def promptGating(gating, adding, x): ''' gating: (num_prefix, dim) adding: (num_prefix, dim) x: (seq_length, batch_size, dim) '
阅读全文
摘要:prefix_tuning.py ```python import torch from transformers import PretrainedConfig class PrefixEncoder(torch.nn.Module): r''' The torch.nn model to enc
阅读全文
摘要:今天我们阅读peft源码,主要是为了弄清楚prefix tuning的工作原理和代码细节。 # 理解和思考 (1) prefix tuning和zero-shot的区别在于,把指令/要求(比如要生成positive的句子)和输入的文字直接区分开,指令用连续向量而不是离散词元表示。如果不是prefix
阅读全文
摘要:记录运行这个代码的过程:https://huggingface.co/docs/peft/task_guides/seq2seq-prefix-tuning # 环境配置 虚拟环境 ```bash python -V conda create -n peft-practice python=3.10
阅读全文
摘要:今天的任务很艰巨,需要把下面这张图的模型架构复现一遍,要有耐心哦。我参考了哈佛NLP小组对transformer的分拆讲解[The Annotated Transformer](http://nlp.seas.harvard.edu/annotated-transformer/),但思路不同于原文。
阅读全文
摘要:Transformer鼎鼎大名人尽皆知,2017年就问津于世,鸽鸽2023年才学习它,任何时候圆梦都不算晚!本文记录了我像建房子一样从头到尾打造变形金刚的全过程,目的是熟悉pytorch和深入理解transformer。 先看下我设定的任务难度,我们要解决的是经典的seq2seq翻译任务。使用的数据
阅读全文