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.compute_renamed_ground_truth

View Source On Gitee
mindsponge.metrics.compute_renamed_ground_truth(atom14_gt_positions, atom14_alt_gt_positions, atom14_atom_is_ambiguous, atom14_gt_exists, atom14_pred_positions, atom14_alt_gt_exists)[source]

Find optimal renaming of ground truth based on the predicted positions.

Jumper et al. (2021) Suppl. Alg. 26 "renameSymmetricGroundTruthAtoms"

This renamed ground truth is then used for all losses, such that each loss moves the atoms in the same direction. Shape (N).

Parameters
  • atom14_gt_positions (Tensor) – Ground truth positions. shape (Nres,14,3) .

  • atom14_alt_gt_positions (Tensor) – Ground truth positions with renaming swaps. shape (Nres,14,3) .

  • atom14_atom_is_ambiguous (Tensor) – 1.0 for atoms that are affected by renaming swaps. shape (Nres,14) .

  • atom14_gt_exists (Tensor) – Mask for which atoms exist in ground truth. shape (Nres,14) .

  • atom14_pred_positions (Tensor) – Array of atom positions in global frame with shape (Nres,14,3) .

  • atom14_alt_gt_exists (Tensor) – Mask for which atoms exist in ground truth after renaming. shape (Nres,14) .

Returns

  • alt_naming_is_better (Tensor) - Array with 1.0 where alternative swap is better. shape (Nres,) .

  • renamed_atom14_gt_positions (Tensor) - Array of optimal ground truth positions after renaming swaps are performed. shape (Nres,14,3) .

  • renamed_atom14_gt_exists (Tensor) - Mask after renaming swap is performed. shape (Nres,14) .

Symbol:

Nres, number of amino acids.

Supported Platforms:

Ascend GPU

Examples

>>> import mindspore as ms
>>> from mindspore import Tensor
>>> import numpy as np
>>> from mindsponge.metrics import compute_renamed_ground_truth
>>> atom14_gt_positions = Tensor(np.random.random(size=(50, 14, 3)), ms.float32)
>>> atom14_alt_gt_positions = Tensor(np.random.random(size=(50, 14, 3)), ms.float32)
>>> atom14_atom_is_ambiguous = Tensor(np.random.random(size=(50, 14)), ms.float32)
>>> atom14_gt_exists = Tensor(np.random.random(size=(50, 14)), ms.float32)
>>> atom14_pred_positions = Tensor(np.random.random(size=(50, 14, 3)), ms.float32)
>>> atom14_alt_gt_exists = Tensor(np.random.random(size=(50, 14)), ms.float32)
>>> alt_naming_is_better, renamed_atom14_gt_positions, renamed_atom14_gt_exists =         ...     compute_renamed_ground_truth(atom14_gt_positions, atom14_alt_gt_positions, atom14_atom_is_ambiguous,
...                                  atom14_gt_exists, atom14_pred_positions, atom14_alt_gt_exists)
>>> print(alt_naming_is_better.shape, renamed_atom14_gt_positions.shape, renamed_atom14_gt_exists.shape)
(50,) (50, 14, 3) (50, 14)