Document feedback

Question document fragment

When a question document fragment contains a formula, it is displayed as a space.

Submission type
issue

It's a little complicated...

I'd like to ask someone.

PR

Just a small problem.

I can fix it online!

Please select the submission type

Problem type
Specifications and Common Mistakes

- Specifications and Common Mistakes:

- Misspellings or punctuation mistakes,incorrect formulas, abnormal display.

- Incorrect links, empty cells, or wrong formats.

- Chinese characters in English context.

- Minor inconsistencies between the UI and descriptions.

- Low writing fluency that does not affect understanding.

- Incorrect version numbers, including software package names and version numbers on the UI.

Usability

- Usability:

- Incorrect or missing key steps.

- Missing main function descriptions, keyword explanation, necessary prerequisites, or precautions.

- Ambiguous descriptions, unclear reference, or contradictory context.

- Unclear logic, such as missing classifications, items, and steps.

Correctness

- Correctness:

- Technical principles, function descriptions, supported platforms, parameter types, or exceptions inconsistent with that of software implementation.

- Incorrect schematic or architecture diagrams.

- Incorrect commands or command parameters.

- Incorrect code.

- Commands inconsistent with the functions.

- Wrong screenshots.

- Sample code running error, or running results inconsistent with the expectation.

Risk Warnings

- Risk Warnings:

- Lack of risk warnings for operations that may damage the system or important data.

Content Compliance

- Content Compliance:

- Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions.

- Copyright infringement.

Please select the type of question

Problem description

Describe the bug so that we can quickly locate the problem.

mindsponge.metrics.backbone

View Source On Gitee
mindsponge.metrics.backbone(traj, backbone_affine_tensor, backbone_affine_mask, fape_clamp_distance, fape_loss_unit_distance, use_clamped_fape)[source]

Backbone FAPE Loss using frame_aligned_point_error_map function. Jumper et al. (2021) Suppl. Alg. 20 "StructureModule" line 17.

Parameters
  • traj (Tensor) – The series of backbone frames(trajectory) generated by Structure module, the shape is (Nrecycle,Nres,7) with Nrecycle the recycle number of recycle in Structure module, Nres the number of residues in protein, for the last dimension, the first 4 elements are the affine tensor which contains the rotation information, the last 3 elements are the translations in space.

  • backbone_affine_tensor (Tensor) – The ground truth backbone frames of shape (Nres,7).

  • backbone_affine_mask (Tensor) – The binary mask for backbone frames of shape (Nres,).

  • fape_clamp_distance (float) – Distance cutoff on error beyond which gradients will be zero.

  • fape_loss_unit_distance (float) – The unit distance of backbone FAPE loss, used to scale distances.

  • use_clamped_fape (float) – The indicator that if backbone FAPE loss is clamped, 0 or 1, 1 means clamping.

Returns

  • fape (Tensor) - Backbone FAPE loss (clamped if use_clamped_fape is 1) of last recycle of Structure module with shape () .

  • loss (Tensor) - Averaged Backbone FAPE loss (clamped if use_clamped_fape is 1) of all recycle of Structure module with shape () .

  • no_clamp (Tensor) - Backbone FAPE loss of last recycle of Structure module with shape () .

Supported Platforms:

Ascend GPU

Examples

>>> import numpy as np
>>> np.random.seed(0)
>>> from mindsponge.metrics import backbone
>>> from mindspore import dtype as mstype
>>> from mindspore import Tensor
>>> traj = Tensor(np.random.rand(8, 256, 7)).astype(mstype.float32)
>>> backbone_affine_tensor = Tensor(np.random.rand(256, 7)).astype(mstype.float32)
>>> backbone_affine_mask = Tensor(np.random.rand(256,)).astype(mstype.float16)
>>> fape_clamp_distance = 10.0
>>> fape_loss_unit_distance = 10.0
>>> use_clamped_fape = 1
>>> fape, loss, noclamp = backbone(traj, backbone_affine_tensor, backbone_affine_mask,
...                                fape_clamp_distance, fape_loss_unit_distance, use_clamped_fape)
>>> print(fape, loss, noclamp)
0.12813742 0.12904957 0.12813742