d771d58a66c57aa77b8ef61501bf879de25c0c8c,deeppavlov/dataset_iterators/ranking_iterator.py,RankingIterator,gen_batches,#RankingIterator#Any#Any#Any#,31

Before Change


        }

    def gen_batches(self, batch_size, data_type="train", shuffle=True):
        y = np.zeros(batch_size)
        data = self.data[data_type]
        num_steps = len(data) // batch_size
        if data_type == "train":
            if shuffle:

After Change


                context = [el["context"] for el in context_response_data]
                response = [el["response"] for el in context_response_data]
                negative_response = self.create_neg_resp_rand(context_response_data, batch_size, data_type)
                x = [[context[i], [response[i]]+[negative_response[i]]] for i in range(len(context_response_data))]
                yield (x, y)
        if data_type in ["valid", "test"]:
            for i in range(num_steps + 1):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: deepmipt/DeepPavlov
Commit Name: d771d58a66c57aa77b8ef61501bf879de25c0c8c
Time: 2018-05-24
Author: puleon@mail.ru
File Name: deeppavlov/dataset_iterators/ranking_iterator.py
Class Name: RankingIterator
Method Name: gen_batches


Project Name: keras-team/keras
Commit Name: cfbaec60c77448e6249f912d4b4d4a8c079f2bcf
Time: 2016-07-16
Author: farizrahman4u@gmail.com
File Name: keras/engine/topology.py
Class Name: Merge
Method Name: get_output_shape_for


Project Name: keras-team/keras
Commit Name: 08f6bdeb5652550f36210f64aefda3d0d41e2d79
Time: 2019-05-28
Author: tanzheny@google.com
File Name: keras/optimizers.py
Class Name: Adam
Method Name: get_updates