diff --git a/.gitee/ISSUE_TEMPLATE/6-application-case.yml b/.gitee/ISSUE_TEMPLATE/6-application-case.yml index dfbf8e154b1fa9ff77b6e154895f911627c8ce97..6ea117ca91cf112235559b7e17e151e9210c1562 100644 --- a/.gitee/ISSUE_TEMPLATE/6-application-case.yml +++ b/.gitee/ISSUE_TEMPLATE/6-application-case.yml @@ -1,5 +1,5 @@ -name: 🤗 Support request for a new application case of science -description: Submit a proposal/request for a new application case of science +name: 🤗 Support request for a new application case of AIForScience +description: Submit a proposal/request for a new application case of AIForScience title: "[Application Case]: " labels: ["application-case"] diff --git a/MindSPONGE/applications/model_cards/MEGAProtein.md b/MindSPONGE/applications/model_cards/MEGAProtein.md index dd00ed33eb0f287bda059f5fede62a55abdff962..1d9e74e7ca62714f3ffa374548f5ff315eb01bab 100644 --- a/MindSPONGE/applications/model_cards/MEGAProtein.md +++ b/MindSPONGE/applications/model_cards/MEGAProtein.md @@ -102,8 +102,8 @@ msa_feature['decoy_aatype'] = np.pad(aatype, (0, 256 - aatype.shape[0])) msa_feature['decoy_atom_positions'] = np.pad(final_atom_positions, ((0, 256 - final_atom_positions.shape[0]), (0, 0), (0, 0))) msa_feature['decoy_atom_mask'] = np.pad(final_atom_mask, ((0, 256 - final_atom_mask.shape[0]), (0, 0))) -res = protein_assessment.predict(msa_feature) -print("score is:", np.mean(res)) +res = protein_assessment.model.predict(msa_feature) +print("score is:", np.mean(res[:msa_feature['num_residues']])) ``` ### 使用场景 diff --git a/docs/api_python/mindflow/cell/mindflow.cell.MultiHeadAttention.rst b/docs/api_python/mindflow/cell/mindflow.cell.MultiHeadAttention.rst index 4198935102cd0257fd8bef12d30421533156c1ef..5d245889df1929ca2b91d1fb11f5459be19d130b 100644 --- a/docs/api_python/mindflow/cell/mindflow.cell.MultiHeadAttention.rst +++ b/docs/api_python/mindflow/cell/mindflow.cell.MultiHeadAttention.rst @@ -10,7 +10,7 @@ mindflow.cell.MultiHeadAttention - **num_heads** (int) - 输出的输出特征维度。 - **enable_flash_attn** (bool) - 是否使能FlashAttention。FlashAttention只支持 `Ascend` 后端。具体细节参见 `FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness `_ 。 默认值: ``False`` 。 - - **fa_dtype** (mindspore.dtype): FlashAttention计算类型。支持以下类型: `mstype.bfloat16`、 `mstype.float16`。默认值: ``mstype.bfloat16`` ,表示 ``mindspore.bfloat16`` 。 + - **fa_dtype** (mindspore.dtype) - FlashAttention计算类型。支持以下类型: `mstype.bfloat16`、 `mstype.float16`。默认值: ``mstype.bfloat16`` ,表示 ``mindspore.bfloat16`` 。 - **drop_mode** (str) - dropout方式。默认值: ``dropout`` 。支持以下类型: ``dropout`` 和 ``droppath`` 。 - **dropout_rate** (float) - dropout层丢弃的比率。取值在 `[0, 1]` 。默认值: ``0.0`` 。 - **compute_dtype** (mindspore.dtype) - 网络层的数据类型。默认值: ``mstype.float32`` ,表示 ``mindspore.float32`` 。 diff --git a/tests/st/mindsponge/test_megaprotein/test_megaprotein.py b/tests/st/mindsponge/test_megaprotein/test_megaprotein.py new file mode 100644 index 0000000000000000000000000000000000000000..b47f661c5db46e801e013a4ec8dd2b2cfc88917a --- /dev/null +++ b/tests/st/mindsponge/test_megaprotein/test_megaprotein.py @@ -0,0 +1,32 @@ +import numpy as np +import mindspore as ms +from mindsponge import PipeLine + +ms.set_context(mode=ms.GRAPH_MODE) + +# MEGA-EvoGenȡMSA +fasta = "GYDKDLCEWSMTADQTEVETQIEADIMNIVKRDRPEMKAEVQKQLKSGGVMQYNYVLYCDKNFNNKNIIAEVVGE" +msa_generator = PipeLine(name="MEGAEvoGen") +msa_generator.set_device_id(0) +msa_generator.initialize(key="evogen_predict_256") +msa_generator.model.from_pretrained() +msa_feature = msa_generator.predict(fasta) + +# MEGA-FoldȡʽṹϢ +fold_prediction = PipeLine(name="MEGAFold") +fold_prediction.set_device_id(0) +fold_prediction.initialize(key="predict_256") +fold_prediction.model.from_pretrained() +final_atom_positions, final_atom_mask, aatype, _, _ = fold_prediction.model.predict(msa_feature) + +# MEGA-AssessmentԵʽṹ +protein_assessment = PipeLine(name = "MEGAAssessment") +protein_assessment.set_device_id(0) +protein_assessment.initialize("predict_256") +protein_assessment.model.from_pretrained() +msa_feature['decoy_aatype'] = np.pad(aatype, (0, 256 - aatype.shape[0])) +msa_feature['decoy_atom_positions'] = np.pad(final_atom_positions, ((0, 256 - final_atom_positions.shape[0]), (0, 0), (0, 0))) +msa_feature['decoy_atom_mask'] = np.pad(final_atom_mask, ((0, 256 - final_atom_mask.shape[0]), (0, 0))) + +res = protein_assessment.model.predict(msa_feature) +print("score is:", np.mean(res[:msa_feature['num_residues']])) \ No newline at end of file