项目地址:https://github.com/FoundationAgents/ReCode 实验结果也印证了这一点:相比 ReAct,ReCode 在三个环境上的平均性能从 47.4% 提升到 60.8% 从 ReAct 到 ReCode: 范式升级带来的性能提升 ReCode 的设计不只是理论上的优雅,通过实验验证,它主要带来了三个方面的提升。 一条 ReCode 轨迹的平均成本比 ReAct 低 78.9%,比 CodeAct 低 84.4%。完成同样任务,ReCode 的花费不到对手的四分之一。这种成本优势源于层次分解带来的结构化探索。 ReCode 的轨迹是完整决策树,这种递归结构天然产生层次化训练数据,而 ReAct 方法的轨迹则是扁平动作序列。 在 ReCode 中,从高层规划到子任务分解再到原始动作,每一层都是独立训练样本。 但 ReCode 的效果高度依赖基础模型其生成所需格式代码的能力。
论文地址: http://arxiv.org/pdf/2212.10264v1.pdf 来源: AWS AI Labs 论文名称:ReCode: Robustness Evaluation of Code 在本文中,我们提出了ReCode,一个代码生成模型的综合鲁棒性评估基准。我们专门为文档字符串、函数和变量名、代码语法和代码格式上的代码定制了30多种转换。 我们使用HumanEval、MBPP以及从中派生的功能完成任务在SOTA模型上演示ReCode。
= "4002" RECODE_DATAEXIST = "4003" RECODE_DATAERR = "4004" RECODE_SESSIONERR = " 4101" RECODE_LOGINERR = "4102" RECODE_PARAMERR = "4103" RECODE_USERERR = "4104" RECODE_ROLEERR = "4105" RECODE_PWDERR = "4106" RECODE_REQERR = "4201" RECODE_IPERR = "4202" RECODE_THIRDERR = "4301" RECODE_IOERR = "4302" RECODE_SERVERERR = RECODE_DATAERR: "数据错误", RECODE_SESSIONERR: "用户未登录", RECODE_LOGINERR: "用户登录失败", RECODE_PARAMERR
*,user_recode.uid user_recode.start_timeuser_recode.game_id user_recode.coin FROMdevice deviceLEFT JOIN game_user_recode user_recode ON device.id = user_recode.device_id AND user_recode.use_status = 1 WHEREdevice 在这个查询中,有两个表:device(别名为device)和game_user_recode(别名为user_recode)。JOIN条件:接下来,数据库会处理JOIN条件。 在这个查询中,使用了LEFT JOIN,并且JOIN条件包括device.id = user_recode.device_id和user_recode.use_status = 1。 device device LEFT JOIN game_user_recode这里如果没有索引,将会在game_user_recode全表寻找device.use_status = 1的数据3.
先执行下面命令,把视频文件转为h264编码格式(即H.265视频编码标准): ffmpeg -i fuzhous.mp4 -vcodec h264 ff_recode_video1.mp4 再执行下面命令 vvc编码格式(即H.266视频编码标准): ffmpeg -i fuzhous.mp4 -vcodec vvc ff_recode_video3.mp4 接着执行下面命令查看转换后的视频信息: ls -lrt 命令行返回转换后的视频信息如下所示: -rw-r--r-- 1 root root 640320 May 13 16:46 ff_recode_video1.mp4 -rw-r--r-- 1 root root 306139 May 13 16:48 ff_recode_video2.mp4 -rw-r--r-- 1 root root 278684 May 13 16:48 ff_recode_video3 于是运行下面命令播放新转换的vvc格式视频文件: ffplay ff_recode_video3.mp4 发现弹出了ffplay播放窗口如下图所示,说明vvc视频可以正常播放。
--out c 「注意:」 --bfile,因为输入文件b*为二进制,所以用--bfile,如果是一般格式,用--file即可 --recode,要输出正常格式,所以用--recode指定,如果不加这个参数 vcf --out d 「注意:」 --file,用--file指定正常plink格式的文件 --recode vcf,要输出vcf文件格式 --out,输出文件的前缀 文件预览: ? 现有文件: $ ls b* b.bed b.bim b.fam b.log 将二进制文件转化为vcf文件: plink --bfile b --recode vcf --out e 结果预览 1.5 vcf文件转化为plink文件 「转化为正常plink文件:」 现有文件: $ ls e.vcf e.vcf plink --vcf e.vcf --recode --out f 「注意 :」 --vcf 需要文件名完整,不能只写前缀,所以这里要写--vcf e.vcf --recode 保存plink文件 保存为二进制文件: plink --vcf e.vcf --out g 结果
--out hebing 日志如下行: $ plink --merge-list p12.txt --recode --out hebing PLINK v1.90b6.21 64-bit (19 Options in effect: --merge-list p12.txt --out hebing --recode 15236 MB RAM detected; reserving --recode ped to hebing.ped + hebing.map ... done. 结果文件: map数据之和,是合并后的map数据。 --out hebing2 日志如下: $ plink --merge-list p12.txt --recode --out hebing2 PLINK v1.90b6.21 64-bit (19 --recode ped to hebing2.ped + hebing2.map ... done.
转为 ped/map ## 使用vcftools vcftools --vcf snp.vcf --plink --out snp ## 使用plink plink --vcf snp.vcf --recode ped/map 与 tped/tfam 格式互换 ## ped/map转换为tped/tfam plink --file snp --recode --transpose --out snp_test ## tped/tfam转换为ped/map plink --tfile snp_test --recode --out snp ped/map 与 bed/bim/fam互换 ## ped/map转换为 bim/fam plink --file snp --make-bed --out snp_test ## bed/bim/fam转换为ped/map plink --bfile snp_test --recode fam plink --tfile snp --make-bed --out snp_test ## bed/bim/fam转换为tped/tfam plink --bfile snp_test --recode
vcftools工具从所有样本的vcf文件中选取所需要的样本,将样本名字放到文本文件里,我命名为 Japonica_Indica_sample_name.txt vcftools --vcf 412_all_cp.recode.eva.vcf --keep Japonica_Indica_sample_name.txt --recode --recode-INFO-all --out keep_20_indv 查看新生成的文件的样本名 bcftools query -l keep_20_indv.recode.vcf 接下来的分析只保留snp位点 vcftools --vcf keep_20_indv.recode.vcf --remove-indels --recode --recode-INFO-all --out keep_20_indv.snp 接下来内容参考 The Simple Fool's Guide to population genomics github.com/DeWitP/SFG/blob/master/scripts/vcf2smartpca.py 使用到的命令 python2 vcf2smartpca.py keep_20_indv.snp.recode.vcf
区域的染色体位置进行提取 vcftools \ --gzvcf gwas.data.vcf.gz \ --chr X \ --from-bp 2699520 \ --to-bp 154931043 \ --recode # 剔除非PAR区域,保留PAR区域的位点信息 vcftools \ --gzvcf gwas.data.vcf.gz \ --exclude-positions Non.PAR.gwas.data.recode.vcf \ --recode \ --out PAR.gwas.data 2. the non-PAR data by Sex 对于非PAR区域, 将男性样本和女性样本分开,代码如下 # 根据样本ID进行提取 vcftools \ --vcf Non.PAR.gwas.data.recode.vcf \ --keep male.sample.list \ --recode \ --out Male.Non.PAR.gwas.data vcftools \ --vcf Non.PAR.gwas.data.recode.vcf
plink --file test_data --geno 0.02 --recode --out test1 运行日志: PLINK v1.90b6.21 64-bit (19 Oct 2020) --recode ped to test1.ped + test1.map ... done. plink --file test1 --mind 0.02 --recode --out test2 运行日志: $ plink --file test1 --mind 0.02 --recode --recode ped to test2.ped + test2.map ... done. plink --file test_data --mind 0.02 --recode --out test3 plink --file test3 --geno 0.02 --recode --out
--recode-INFO-all --min-alleles 2 --max-alleles 2 --max-missing 0.9 --out snpOnly 删除indel位点 只保留二等位变异位点 能分型的样本占总样本的比例至少为0.9 ~/biotools/plink19/plink --vcf snpOnly.recode.vcf --recode12 --allow-extra-chr - --out at.snp ~/biotools/plink19/plink --allow-extra-chr --file at.snp --indep-pairwise 50 5 0.2 --recode vcf-iid --out at.snp.LDpruned ~/biotools/plink19/plink --allow-extra-chr --file at.snp --recode vcf-iid $1,$2,"1",$3,$4,$5,$6,$7}' > PCA_snp.txt ~/biotools/plink19/plink --file at.snp --allow-extra-chr --recode
vcf 转为 ped/map 使用vcftools vcftools --vcf snp.vcf --plink --out snp 使用plink plink --vcf snp.vcf --recode ped/map 与 tped/tfam 格式互换 ped/map转换为tped/tfam plink --file snp --recode --transpose --out snp_test tped /tfam转换为ped/map plink --tfile snp_test --recode --out snp ped/map 与 bed/bim/fam互换 ped/map转换为bed/bim/ fam plink --file snp --make-bed --out snp_test bed/bim/fam转换为ped/map plink --bfile snp_test --recode bim/fam plink --tfile snp --make-bed --out snp_test bed/bim/fam转换为tped/tfam plink --bfile snp_test --recode
提示找不到recode。 | 327 B 00:00 ============================ N/S Matched: recode ================================= === php-recode.x86_64 : A module for PHP applications for using the recode library recode-devel.i686 : Header files and static libraries for development using recode recode-devel.x86_64 : Header files and static libraries for development using recode recode.i686 : Conversion between character sets and surfaces
--recode ped to hapmap-ceu.ped + hapmap-ceu.map ... done. --recode ped to re1.ped + re1.map ... done. --recode ped to re1.ped + re1.map ... done. --recode ped to re1.ped + re1.map ... done. --recode ped to re1.ped + re1.map ... done.
*图片来自recode 当苹果的应用商店于2008年7月开业时,应用程序业务开始启动。然而,消费者却开始感到疲劳。现在AppStore有超过150万个应用程序,人们已经不再寻找新的应用。为什么? 根据应用分析公司recode发布的一份研究报告显示,SensorTower表明,应用程序的下载速度正在急剧放缓,导致一些人认为应用程序最终可能会消亡。 *图片来自recode 【图中文字如下: 图3:美国应用下载量环比下降了20个百分点,因为最大的平台都已日渐成熟,趋向饱和。 *图片来自recode 【图中文字如下: Fig. 4: 国际的下载量保持一个正向而缓和的轨迹。 全球应用下载数,单位:百万】 ? *图片来自recode 的确,是的,应用程序的下载动态正在发生改变。用户下载的应用越来越少,因为大多数人都已经安装了他们想要的或需要的应用程序。
variable again banking$marital=recode(banking$marital,“‘divorced’=1;’married’=2;’single’=3;’unknown’ =4”) banking$education=recode(banking$education,“‘basic.4y’=1;’basic.6y’=2;’basic.9y’=3;’high.school’ ’=2;’unknown’=3”) banking$loan=recode(banking$loan,“‘no’=1;’yes’=2;’unknown’=3”)banking$contact=recode (banking$loan,“‘cellular’=1;’telephone’=2;”) banking$month=recode(banking$month,“‘mar’=1;’apr’=2;’may ,“‘mon’=1;’tue’=2;’wed’=3;’thu’=4;’fri’=5;”) banking$poutcome = recode(banking$poutcome,“‘failure’=1;
gzvcf 1001genomes_snp-short-indel_only_ACGTN.vcf.gz --remove-indels --min-alleles 2 --max-alleles 2 --recode java.lang.OutOfMemoryError: GC overhead limit exceeded 先跳过这一步 根据最小等位基因来过滤 vcftools --vcf 172sample.recode.vcf --maf 0.05 --recode --out 172sample_maf_filter 给每个snp位点添加ID bcftools view -h 172sample_maf_filter.recode.vcf > head bcftools view -H 172sample_maf_filter.recode.vcf | grep "^#" -v | awk '{$3=$1"_"$2;print $0}' out 172sample plink --file 172sample --indep 50 5 2 plink --file 172sample --extract plink.prune.in --recode
--recode ped to hapmap-ceu.ped + hapmap-ceu.map ... done. --recode ped to re1.ped + re1.map ... done. --recode ped to re1.ped + re1.map ... done. --recode ped to re1.ped + re1.map ... done. --recode ped to re1.ped + re1.map ... done.
ZipFile('示例压缩包.zip') # 查看压缩包内目录、文件名称 file.namelist() 这是因为zipfile中针对压缩包内容的编码兼容性差,但我们可以通过下面的函数自行矫正: def recode decode('utf-8') for file_or_path in file.namelist(): print(file_or_path, ' -------> ' , recode try: # 基于当前文件夹节点创建多层文件夹 os.makedirs(os.path.join(target_path, recode # 利用shutil.copyfileobj,从压缩包io流中提取目标文件内容写出到目标路径 with open(os.path.join(target_path, recode