7a1e5bf80d5a631fbc6a30a7d16ab4615d96ea5a,pb_bss/distribution/vmfmm.py,VMFMM,_predict,#VMFMM#Any#,29

Before Change


        return self._predict(y)

    def _predict(self, y):
        log_pdf = self.vmf.log_pdf(y[..., None, :, :])

        affiliation = np.log(self.weight)[..., :, None] + log_pdf
        affiliation -= np.max(affiliation, axis=-2, keepdims=True)
        np.exp(affiliation, out=affiliation)
        denominator = np.maximum(
            np.einsum("...kn->...n", affiliation)[..., None, :],
            np.finfo(affiliation.dtype).tiny,
        )
        affiliation /= denominator
        return affiliation


class VMFMMTrainer:
    The vMFMM can be used to cluster the embeddings.

After Change


        return self._predict(y)

    def _predict(self, y):
        return log_pdf_to_affiliation(
                self.weight[..., :, None],
                self.vmf.log_pdf(y[..., None, :, :]),
        )


class VMFMMTrainer:
    The vMFMM can be used to cluster the embeddings.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 22

Instances


Project Name: fgnt/pb_bss
Commit Name: 7a1e5bf80d5a631fbc6a30a7d16ab4615d96ea5a
Time: 2019-08-09
Author: mail@lukas-drude.de
File Name: pb_bss/distribution/vmfmm.py
Class Name: VMFMM
Method Name: _predict


Project Name: fgnt/pb_bss
Commit Name: 7a1e5bf80d5a631fbc6a30a7d16ab4615d96ea5a
Time: 2019-08-09
Author: mail@lukas-drude.de
File Name: pb_bss/distribution/ccsgmm.py
Class Name: CCSGMM
Method Name: _predict


Project Name: fgnt/pb_bss
Commit Name: 7a1e5bf80d5a631fbc6a30a7d16ab4615d96ea5a
Time: 2019-08-09
Author: mail@lukas-drude.de
File Name: pb_bss/distribution/cwmm.py
Class Name: CWMM
Method Name: _predict


Project Name: fgnt/pb_bss
Commit Name: 7a1e5bf80d5a631fbc6a30a7d16ab4615d96ea5a
Time: 2019-08-09
Author: mail@lukas-drude.de
File Name: pb_bss/distribution/vmfmm.py
Class Name: VMFMM
Method Name: _predict