Skip to main content

Definition

The embedding similarity energy measures how much the current per-residue embeddings deviate from reference embeddings, using cosine similarity. Eembedding=11NGαGcos(eα,eαref)E_{\mathrm{embedding}} = 1 - \frac{1}{N_G} \sum_{\alpha \in G} \cos(\mathbf{e}_\alpha, \mathbf{e}_\alpha^{\mathrm{ref}})
  • eα\mathbf{e}_\alpha is the current embedding vector for residue α\alpha (L2-normalized)
  • eαref\mathbf{e}_\alpha^{\mathrm{ref}} is the reference embedding vector for residue α\alpha (L2-normalized)
  • cos(,)\cos(\cdot, \cdot) is the cosine similarity
  • NGN_G is the number of residues in the group GG

Parameters

EmbeddingOracle
required
The oracle that will be used to calculate the embeddings.
list[Residue]
required
Which residues to include in the calculation.
npt.NDArray[np.float64]
required
The reference embeddings to compare to.
float
default:"1.0"
The weight of the energy term.
str | None
default:"None"
Optional name to append to the energy term name.

Methods

compute

Parameters
OraclesResultDict
required

conserved_index_list

Returns the indices of the conserved residues (stored in .residue_group[0]) in the pLM embedding array. Parameters
list[Chain]
required

Example