91f834a5329d7f4c440811441095c9d574764dfe,thinc/neural/_classes/multiheaded_attention.py,MultiHeadedAttention,begin_update,#MultiHeadedAttention#,87

Before Change


            masks = [None for _ in Qs]
        assert len(Qs) == len(Ks) == len(Vs)
        Ys, get_dQs_dKs_dVs = self._attend_seqs(Qs, Ks, Vs, masks)
        lengths = self.ops.asarray([len(y) for y in Ys], dtype="i")
        assert sum(lengths) == sum([len(q) for q in Qs])
        Y = self.ops.flatten(Ys)
        
        def finish_update(dY, sgd=None):
            dYs = self.ops.unflatten(dY, lengths)
            return get_dQs_dKs_dVs(dYs, sgd=sgd)
        
        assert sum(lengths) == Y.shape[0], (sum(lengths, Y.shape[0]))
        assert sum([len(q) for q in Qs]) == sum(lengths)
        return (Y, lengths), finish_update

    def _attend_seqs(self, Qs, Ks, Vs, masks):
        outputs = []
        backprops = []

After Change


        if masks is None:
            masks = [None for _ in Qs]
        assert len(Qs) == len(Ks) == len(Vs)
        return self._attend_seqs(Qs, Ks, Vs, masks)
        
    def _attend_seqs(self, Qs, Ks, Vs, masks):
        outputs = []
        backprops = []
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: explosion/thinc
Commit Name: 91f834a5329d7f4c440811441095c9d574764dfe
Time: 2019-06-11
Author: honnibal+gh@gmail.com
File Name: thinc/neural/_classes/multiheaded_attention.py
Class Name: MultiHeadedAttention
Method Name: begin_update


Project Name: hmmlearn/hmmlearn
Commit Name: 934f26003a1b794a3a03ca824817fb1252dff270
Time: 2016-07-09
Author: yanenkoalexandr@gmail.com
File Name: hmmlearn/hmm.py
Class Name: GMMHMM
Method Name: _generate_sample_from_state


Project Name: tyiannak/pyAudioAnalysis
Commit Name: bdf9307e91354ed415c9e3493a37c326941bec7b
Time: 2019-11-13
Author: dsgou@hotmail.gr
File Name: pyAudioAnalysis/audioBasicIO.py
Class Name:
Method Name: stereo2mono