7a1e5bf80d5a631fbc6a30a7d16ab4615d96ea5a,pb_bss/distribution/gmm.py,GMM,predict,#GMM#Any#,17

Before Change


    def predict(self, x):
        *independent, num_observations, _ = x.shape

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


class GMMTrainer:
    def __init__(self, eps=1e-10):

After Change


    gaussian: Gaussian

    def predict(self, x):
        return log_pdf_to_affiliation(
            self.weight[..., :, None],
            self.gaussian.log_pdf(x[..., None, :, :]),
        )


class GMMTrainer:
    def __init__(self, eps=1e-10):
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/gmm.py
Class Name: GMM
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/gmm.py
Class Name: GMM
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


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