:py:mod:`src.lscd.permutation`
==============================

.. py:module:: src.lscd.permutation


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   src.lscd.permutation.Permutation




.. py:class:: Permutation


   Bases: :py:obj:`src.lscd.model.GradedLSCDModel`

   .. py:attribute:: wic
      :type: src.wic.ContextualEmbedder

      

   .. py:attribute:: n_perms
      :type: int

      

   .. py:attribute:: whiten
      :type: bool

      

   .. py:attribute:: k
      :type: int | None

      

   .. py:method:: compute_kernel_bias(vecs: numpy.typing.NDArray[numpy.float32], k: int | None = None) -> tuple[numpy.typing.NDArray[numpy.float32], numpy.typing.NDArray[numpy.float32]]
      :staticmethod:

      vecs = matrix (n x 768) with the sentence representations of your whole
      dataset (in the paper they use train, val and test sets)


   .. py:method:: transform_and_normalize(vecs: numpy.typing.NDArray[numpy.float32], kernel: numpy.typing.NDArray[numpy.float32] | None = None, bias: numpy.typing.NDArray[numpy.float32] | None = None) -> numpy.typing.NDArray[numpy.float32]
      :staticmethod:

      Kernel and bias are W and -mu from previous function. They're passed to
      this function when inputing vecs vecs = vectors we need to whiten.


   .. py:method:: euclidean_dist(m0: numpy.typing.NDArray[numpy.float32], m1: numpy.typing.NDArray[numpy.float32]) -> numpy.typing.NDArray[numpy.float32]
      :staticmethod:


   .. py:method:: get_n_rows(len_m0: int, len_m1: int) -> int


   .. py:method:: permute_indices(len_m0: int, len_m1: int) -> tuple[list[int], list[int]]


   .. py:method:: predict(lemma: src.lemma.Lemma) -> float


   .. py:method:: predict_all(lemmas: list[src.lemma.Lemma]) -> list[float]



