RNA碱基不成对概率比赛的基线模型
RNA碱基不成对概率预测竞赛基线模型基于飞桨2.0开发,可预测RNA序列各点位不成对概率,该概率在mRNA疫苗设计等领域有重要应用。提供5000条训练数据,基线用简单网络模型,训练脚本和测试脚本可分别训练模型和预测,开发者可从数据预处理等多方面优化模型。

RNA碱基不成对概率预测的基线模型
RNA结构预测竞赛:RNA碱基不成对概率预测基线模型现已开放,采用非常简单的网络模型,就能得到还不错的结果。欢迎开发者贡献更好的基线作品~
免费影视、动漫、音乐、游戏、小说资源长期稳定更新! 👉 点此立即查看 👈
赛题介绍
“RNA碱基不成对概率”衡量了RNA序列在各个点位是否能形成稳定的碱基对(base pair),是RNA结构的重要属性,并可被应用在mRNA疫苗序列设计、药物研发等领域。例如mRNA疫苗序列通常不稳定,而RNA碱基不成对概率较高的点位正是易被降解的位置;又如RNA 碱基不成对概率较高的点位通常更容易与其他RNA序列相互作用,形成RNA-RNA binding等,这一特性也被广泛应用于疾病诊断和RNA药物研发。
本次比赛提供了5000条训练数据,请选手基于训练数据和飞桨平台,开发模型预测RNA碱基不成对概率。
(Tips:机器学习框架方面只允许使用飞桨深度学习框架哦)
竞赛数据集
In [ ]# 检查数据集所在路径!tree /home/aistudio/data登录后复制
基线系统代码结构
本次基线基于飞桨PaddlePaddle2.0版本。
In [3]# 检查源代码文件结构# !cd work; mkdir model!tree /home/aistudio/work -L 2登录后复制
/home/aistudio/work├── data│ ├── dev.txt│ ├── test_nolabel.txt│ └── train.txt├── model│ └── placeholder.txt├── model-0│ └── model_dev=0.0772├── README.txt├── src│ ├── const.py│ ├── dataset.py│ ├── __init__.py│ ├── main.py│ ├── network.py│ ├── utils.py│ └── vocabulary.py├── test_log.txt└── train_log.txt5 directories, 14 files登录后复制登录后复制
训练脚本
python src/main.py train --model-path-base [model_directory_name]
本代码会训练一个模型,并且保存到指定位置,训练日志默认保存到文件train_log.txt
注意:由于初始化的不稳定,可能需要多次训练,比较合理的验证集(dev)均方误差损失值(MSE loss)为0.05-0.08
样例
python src/main.py train --model-path-base model
你将会看到类似如下的训练日志
epoch 1 batch 40 processed 640 batch-loss 0.1984 epoch-elapsed 0h00m10s total-elapsed 0h00m11s epoch 1 batch 41 processed 656 batch-loss 0.2119 epoch-elapsed 0h00m10s total-elapsed 0h00m11s epoch 1 batch 42 processed 672 batch-loss 0.2205 epoch-elapsed 0h00m11s total-elapsed 0h00m11s epoch 1 batch 43 processed 688 batch-loss 0.2128 epoch-elapsed 0h00m11s total-elapsed 0h00m11s # Dev Average Loss: 0.212 (MSE) -> 0.461 (RMSD)登录后复制登录后复制
注意事项
请使用GPU版本的配置环境运行本模块
In [ ]# To train:# python src/main.py train --model-path-base [model_directory_name]!cd work; python src/main.py train --model-path-base model登录后复制登录后复制
预测脚本
python src/main.py test --model-path-base [saved_model_directory]
本代码会预测一个模型,日志和结果默认保存到文件test_log.txt
样例
用不带标签的测试集来预测:python src/main.py test --model-path-base model-0/model_dev\=0.0772/用带标签的测试集来预测并评估:
python src/main.py test_withlabel --model-path-base model-0/model_dev\=0.0772/
样例输出
# python3 src/main.py test_withlabel --model-path-base model-0/model_dev=0.0772Loading data...Loading model...initializing vacabularies... done.Sequence(6): ['登录后复制登录后复制 由于比赛的公开数据不提供测试集的标签,故本基线模型无法运行预设的test_withlabel,除非用户自己生成一个带标签的测试集~/data/test.txt。', ' ', 'A', 'C', 'G', 'U']Brackets(5): [' ', ' ', '(', ')', '.']W0113 21:57:44.871776 221 device_context.cc:252] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 11.0, Runtime API Version: 9.0W0113 21:57:44.878015 221 device_context.cc:260] device: 0, cuDNN Version: 7.6.# Dev Average Loss: 0.0772 (MSE) -> 0.2778 (RMSD)# Test Average Loss: 0.0445 (MSE) -> 0.2111 (RMSD)
注意事项
请使用GPU版本的配置环境运行本模块
In [ ]# To test 1:# python src/main.py test --model-path-base [saved_model_directory]!cd work; python src/main.py test --model-path-base model-0/model_dev\=0.0772登录后复制登录后复制 In [ ]
# To test 2:# python src/main.py test_withlabel --model-path-base [saved_model_directory]# 由于比赛的公开数据不提供测试集的标签,故本基线模型无法运行预设的test_withlabel,除非用户自己生成一个带标签的测试集~/data/test.txt#### !cd work; python src/main.py test_withlabel --model-path-base model-0/model_dev\=0.0772登录后复制
写在最后
选手可在基线模型基础上持续改进,也可以采用全新的模型。可以尝试从以下几方面来进行调优:
输入数据预处理,提取更多feature基线模型使用LinearFold预测的RNA二级结构作为辅助feature。选手可以尝试增加更多的辅助feature,如:使用其他二级结构预测软件(如Vienna RNAfold, RNAstructure, CONTRAfold等)生成新的二级结构feature。更复杂的Embedding形式可以尝试在Embedding层使用Elmo, Bert等预训练模型优化网络结构和参数隐层大小选择 - 宽度和层数尝试复杂网络构建尝试正则化、dropout等方式避免过拟合选择学习率等超参数选择合适的损失函数尝试不同的优化器点击跳转到 中文 说明
Baseline for RNA base unpaired probability
RNA structure prediction contest: The baseline model of RNA base unpairing probability prediction is now released. Using a very simple network model, you can get good results. Developers are welcome to contribute better baseline works~
About the challange
"RNA base unpaired probability" measures whether the RNA sequence can form a stable base pair at certain point. It is an important attribute of RNA structure and can be used in the design of mRNA vaccine sequence, drug development and other fields. For example, mRNA vaccine sequences are usually unstable, and the points with a higher probability of unpaired RNA bases are the positions that are easily degraded; another example is the points with higher probability of unpaired RNA bases are usually more likely to interact with other RNA sequences, with the formation of RNA-RNA binding, etc. This feature is also widely used in disease diagnosis and RNA drug development.
This competition provides 5000 training data. You are asked to develop a model to predict the unpaired probability of RNA bases, given the training data and PaddlePaddle platform.
(Tips:Machine learning models can be only developed with PaddlePaddle deep learning frameworks)
Dataset for RNA contest
In [ ]# check dataset!tree /home/aistudio/data登录后复制
Baseline system
This baseline is developed with PaddlePaddle2.0.
In [4]# check codebase# !cd work; mkdir model!tree /home/aistudio/work -L 2登录后复制
/home/aistudio/work├── data│ ├── dev.txt│ ├── test_nolabel.txt│ └── train.txt├── model│ └── placeholder.txt├── model-0│ └── model_dev=0.0772├── README.txt├── src│ ├── const.py│ ├── dataset.py│ ├── __init__.py│ ├── main.py│ ├── network.py│ ├── utils.py│ └── vocabulary.py├── test_log.txt└── train_log.txt5 directories, 14 files登录后复制登录后复制
To train
python src/main.py train --model-path-base [model_directory_name]
This will train a paddle model and save it in the specified directory. Training log will be outputed to train_log.txt by default.
Note: You may need to train a few times, as the model might have bad initialization and may not train well. (A dev MSE loss of about 0.05-0.08 is good)
Example
python src/main.py train --model-path-base model
training log like this
epoch 1 batch 40 processed 640 batch-loss 0.1984 epoch-elapsed 0h00m10s total-elapsed 0h00m11s epoch 1 batch 41 processed 656 batch-loss 0.2119 epoch-elapsed 0h00m10s total-elapsed 0h00m11s epoch 1 batch 42 processed 672 batch-loss 0.2205 epoch-elapsed 0h00m11s total-elapsed 0h00m11s epoch 1 batch 43 processed 688 batch-loss 0.2128 epoch-elapsed 0h00m11s total-elapsed 0h00m11s # Dev Average Loss: 0.212 (MSE) -> 0.461 (RMSD)登录后复制登录后复制
Note
Please use GPU/CUDA configuration to run this block
In [ ]# To train:# python src/main.py train --model-path-base [model_directory_name]!cd work; python src/main.py train --model-path-base model登录后复制登录后复制
To test
python src/main.py test --model-path-base [saved_model_directory]
This will evaluate a trained model. Testing log will be outputed to test_log.txt by default.
Example
if you have blind testset to predict:python src/main.py test --model-path-base model-0/model_dev\=0.0772/if you have full testset (with label) to predict and validate:
python src/main.py test_withlabel --model-path-base model-0/model_dev\=0.0772/
Outpit like this:
# python3 src/main.py test_withlabel --model-path-base model-0/model_dev=0.0772Loading data...Loading model...initializing vacabularies... done.Sequence(6): ['登录后复制登录后复制 Since we don't offer labelled testset in baseline, you may not run test_withlabel unless you create ~/data/test.txt by yourself.', ' ', 'A', 'C', 'G', 'U']Brackets(5): [' ', ' ', '(', ')', '.']W0113 21:57:44.871776 221 device_context.cc:252] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 11.0, Runtime API Version: 9.0W0113 21:57:44.878015 221 device_context.cc:260] device: 0, cuDNN Version: 7.6.# Dev Average Loss: 0.0772 (MSE) -> 0.2778 (RMSD)# Test Average Loss: 0.0445 (MSE) -> 0.2111 (RMSD)
Note
Please use GPU/CUDA configuration to run this block
In [ ]# To test 1:# python src/main.py test --model-path-base [saved_model_directory]!cd work; python src/main.py test --model-path-base model-0/model_dev\=0.0772登录后复制登录后复制 In [ ]
# To test 2:# python src/main.py test_withlabel --model-path-base [saved_model_directory]# since we don't offer labelled testset, you may not run the following command unless you create ~/data/test.txt by yourself#### !cd work; python src/main.py test_withlabel --model-path-base model-0/model_dev\=0.0772登录后复制
One more thing
You can continue to improve on the basis of the baseline model, or use a brand new model. You can try to tune from the following aspects:
Preprocess input data to extract more features. The baseline model uses the RNA secondary structure predicted from LinearFold as parts of features. You can try to add more features with other secondary structure prediction software (Vienna RNAfold, RNAstructure, CONTRAfold, etc.)More complex embeddingUse pre-trained models such as Elmo and Bert in the Embedding layerOptimize network structure and parametersHidden layer size selection-width and number of layersTry complex network architectureTry regularization, dropout, etc. to avoid overfittingOptimize hyperparameters such as learning rateChoose a good loss functionTry different optimizers相关攻略
Pywinrm 通过Windows远程管理(WinRM)协议,让Python能够像操作本地一样执行远程Windows命令,真正打通了跨平台管理的最后一公里。 在混合IT环境中,Linux机器管理Wi
早些时候,聊过 Python 领域那场惊心动魄的供应链攻击。当时我就感叹,虽然我们 JavaScript 开发者对这类套路烂熟于心,但亲眼目睹这种规模的“投毒”还是头一次。 早些时候,聊过 Pyth
Toga 是 BeeWare 家族的核心成员,号称“写一次,跑遍所有平台”,而且用的是系统原生控件,不是那种一看就是网页套壳的界面 。 写了这么多年 Python,你是不是也想过:要是能一套代码跑
异常处理的核心:让错误在正确的地方被有效处理。正确的地方,就是别在底层就把异常吞了,也别在顶层还抛裸奔的 Exception。 异常处理写得好,半夜不用起来改 bug。1 你是不是也这么干过?tr
1 Skills机制概述 提起OpenClaw的Skills机制,不少人可能会把它想象成传统意义上的可执行插件。其实,它的内涵要更精妙一些。 简单说,Skills本质上是一套基于提示驱动的能力扩展机制。它并不是一个可以独立“跑”起来的程序模块,而是通过一份结构化描述文件(核心就是那个SKILL m
热门专题
热门推荐
加密货币行业翘首以盼的监管里程碑,终于有了实质性进展。美国证券交易委员会(SEC)主席保罗·阿特金斯(Paul Atkins)近日证实,那份允许加密项目在早期获得注册豁免权的“安全港”框架提案,已经正式送抵白宫,进入了最终审查阶段。 在范德堡大学与区块链协会联合举办的数字资产峰会上,阿特金斯透露了这
微策略Strategy报告:第一季录得144 6亿美元浮亏 再斥资约3 3亿美元买进4871枚比特币 市场震荡的威力有多大?看看Strategy的最新季报就明白了。根据其最新向美国证管会(SEC)提交的8-K报告,受市场剧烈波动影响,这家公司所持的比特币在第一季度录得了一笔惊人的数字——144 6亿
稳定币巨头Tether的动向,向来是加密世界的风向标。这不,它向Web3基础设施的版图扩张,又迈出了关键一步。公司执行长Paolo Ardoino在社交平台X上透露,其工程团队正在全力“烹制”一个新项目——去中心化搜索引擎 “Hypersearch”。这个消息一出,立刻引发了行业的广泛猜想。 采用D
基地位于Coinbase旗下以太坊Layer2网络Base的Seamless Protocol,日前正式宣告了服务的终结。这个曾经吸引了超过20万用户的原生DeFi借贷协议,在运营不到三年后,终究没能跑赢时间。它主打的核心产品是Integrated Leverage Markets(ILMs)——一
PAAL代币揭秘:深度解析Web3社区治理的核心钥匙 在去中心化自治组织的浪潮中,谁真正掌握了项目的话语权?PAAL代币提供了一套系统化的答案。它不仅是生态内流转的价值媒介,更是开启链上治理大门的核心凭证。通过持有并质押PAAL代币,用户能够对协议升级、资金分配乃至战略方向等关键事务投出决定性的一票





