2 Star 3 Fork 1

st / RNA_Prediction

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

螺旋桨RNA结构预测竞赛第七名项目:Unpaired Probability Prediction


成员有: 舒涛,姚智超,朱满琴,邱凯,叶永志 and so on...
内容有待开发,前路一片光明。
革命尚未成功,同志仍需努力。
加油,奥利给!!!

项目目录树


.
├── config.py   // 配置文件
├── data
│   ├── data_explanation.txt   // 数据说明文件
│   ├── dev.txt   // 验证数据集文件
│   ├── README.md   // 数据说明.md
│   ├── test_nolabel.txt   // A榜测试数据
│   └── train.txt   // 训练数据集文件
├── demo.py   // 演示脚本
├── inference_model
│   │   ├──  ...
│   │   ├──  ...
│   │   ├──  ...
│   └── ├──  ...   // 训练模型参数
├── logs
│   └── train_1612239291.log   // 日志文件
├── max_models   // 最优模型存放目录
│   │   ├──  ...
│   │   ├──  ...
│   │   ├──  ...
│   └── 4.635   // 最优模型
├── net
│   ├── network.py   // 网络模型代码
│   └── bilm.py   // Elmo结构
├── README.md   // 项目说明
├── requestments.txt   // 配置库
├── result
│   ├── prediction   // 预测结果存放路径
│   │   ├── 1.predict.txt   // 预测结果1
│   │   ├── 2.predict.txt   // 预测结果2
│   │   ├──  ...
│   │   ├──  ...
│   │   ├──  ...
│   │   ├── n.predict.txt   // 预测结果n
│   ├── model.svg   // 模型结构图
│   ├── predict.file.zip   // 待提交压缩文件
└── utils
├── process.py   // 创建词汇表
├── reader.py   // 数据读入程序
├── utils.py   // 数据预处理
└── vocabulary.py   // 数据格式化类
├── test.py   // 验证程序
├── train.py   // 训练程序

项目依赖下载,模型训练、测试


  • 运行pip install -r requestments -i https://pypi.douban.com/simple下载安装所需依赖
  • 运行python train.py开始训练,训练参数会保存在./inference_model目录下
  • 运行visualdl --logdir ./log post 8040,再在浏览器打开http://localhost:8040/可以查看训练进度
  • 运行python test.py产生测试结果(可设置读取模型的目录参数--param_path=参数目录,各个模型参数全在./max_models目录下,也可以读取./inference下的模型参数,如不设置此参数,则默认值为./max_models/3.739B),测试结果保存在./result/prediction目录下,同时在./result目录下生成predict.files.zip作为提交文件

模型


主要结构采用bidirectional-LSTM(双向LSTM网络结构),and so on......
可以尝试从以下几方面来进行调优:(此处调用官方提示说明)

  • 输入数据预处理,提取更多feature
    • 基线模型使用LinearFold预测的RNA二级结构作为辅助feature。选手可以尝试增加更多的辅助feature,如:使用其他二级结构预测软件(如Vienna RNAfold, RNAstructure, CONTRAfold等)生成新的二级结构feature。
  • 更复杂的Embedding形式
  • 可以尝试在Embedding层使用Elmo, Bert等预训练模型
  • 优化网络结构和参数
    • 隐层大小选择 - 宽度和层数
    • 尝试复杂网络构建
    • 尝试正则化、dropout等方式避免过拟合
    • 选择学习率等超参数
    • 选择合适的损失函数
    • 尝试不同的优化器

不同参数下的验证结果


  • A榜:
序号 Embedding数据维度 Lstm 层数 Loss Step Score rmsd_avg rmsd_std 时间 备注
1 128 8 0.068 None 4.296 0.233 0.041 2021-02-19 09:01 None
2 128 6 0.075 4270 4.534 0.221 0.046 2021-02-19 09:42 None
3 128 6 0.076 4750 4.562 0.219 0.048 2021-02-19 10:06 None
4 256 6 0.074 8550 4.635 0.216 0.05 2021-02-20 09:05 None
5 256 6 0.071 4270 4.595 0.218 0.049 2021-02-22 09:45 续4的模型参数继续训练
6 256 6 0.077 1420 4.587 0.218 0.054 2021-03-01 10:15 续4的模型参数继续训练
7 256 6 0.072 475 4.632 0.216 0.05 2021-03-04 10:56:23 续4的模型参数继续训练,使用了增广数据

模型训练过程综述


  • 在模型上的深度改进上,发现在Baseline基线模型上增加LSTM层数会导致损失剧增,所以选择减小模型参数,经过大量的实验,发现当LSTM layers=6时在A榜可达到最佳评分。
  • 在模型输入尺寸上,增大或减小embedding的数据维度也会导致损失的变化,当其为256时亦可使得A榜测试达到最佳。
  • embedding模型上的改进,我们试着引进ElemGRU网络结构,在实际训练中,损失最终会稳定在和未添此trip大致一样的数值,但当提交此模型产生的预测结果到A榜后会导致分数骤降,所以在之后的训练实验中未采取此trip。  
  • 在数据的预处理中,我们试着用官方工具PaddleHelix针对数据集的碱基序列产生新的二级结构,此trip帮助我们在A榜上取得了最佳的成绩,但在B榜上的表现并不如人意,之后我们又采用同源序列的方法对数据集预处理,此trip使得我们在B榜上取得了最佳的成绩。  
  • 模型超参数的改进,learning_rate采取阶梯下降的方式,优化方法试过几乎全部的优化器,还是Baseline的优化器取得的成绩最高。增大训练的Batch size也没有很好的表现。
  • 此外,由于官方不提供RMSD_STD的计算方案,所以我们在对A榜的所有提交数据的分析下,自创了RMST_STD的计算方案,并应用于训练时的验证上。
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

螺旋浆RNA结构预测,针对输入的RNA序列和二级结构,输出其的不成对概率 展开 收起
Python
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/nameLacker/RNA_Prediction.git
git@gitee.com:nameLacker/RNA_Prediction.git
nameLacker
RNA_Prediction
RNA_Prediction
master

搜索帮助