2d325991589692bb25d398209022ae03a65074d3,examples/transformer/transformer.py,,,#,27

Before Change


                swords = [ " ".join([vocab._id_to_token_map_py[i] for i in sent]) for sent in source ]
                dwords = [ " ".join([vocab._id_to_token_map_py[i] for i in sent]) for sent in dec_in ]
                twords = [ " ".join([vocab._id_to_token_map_py[i] for i in sent]) for sent in target ]
                if step < 1000:
                    logging.info("source:{}".format(source))
                    logging.info("swords:{}".format(swords))
                    logging.info("dec_in:{}".format(dec_in))
                    logging.info("dwords:{}".format(dwords))
                    logging.info("target:{}".format(target))
                    logging.info("twords:{}".format(twords))
                writer.add_summary(mgd, global_step=step)
                if step % 1000 == 0:
                    print("step:{} loss:{}".format(step, loss))
                    saver.save(sess, logdir+"my-model", global_step=step)

After Change


                    [encoder_input, decoder_input, labels, preds, train_op, global_step, mle_loss, merged],
                    feed_dict={context.is_train(): True})
                if step % 100 == 0:
                    logging.info("step:{} source:{} targets:{} loss:{}".format(\
                        step, source.shape, target.shape, loss))
                source, dec_in, target = source.tolist(), dec_in.tolist(), target.tolist()
                swords = [ " ".join([vocab._id_to_token_map_py[i] for i in sent]) for sent in source ]
                dwords = [ " ".join([vocab._id_to_token_map_py[i] for i in sent]) for sent in dec_in ]
                twords = [ " ".join([vocab._id_to_token_map_py[i] for i in sent]) for sent in target ]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: asyml/texar
Commit Name: 2d325991589692bb25d398209022ae03a65074d3
Time: 2018-03-18
Author: zhiting.hu@petuum.com
File Name: examples/transformer/transformer.py
Class Name:
Method Name:


Project Name: deepmipt/DeepPavlov
Commit Name: b1eaa3487165ebaedb489ced63a38eb45f650b5f
Time: 2018-10-17
Author: yoptar@gmail.com
File Name: deeppavlov/models/embedders/fasttext_embedder.py
Class Name: FasttextEmbedder
Method Name: load


Project Name: deepmipt/DeepPavlov
Commit Name: b1eaa3487165ebaedb489ced63a38eb45f650b5f
Time: 2018-10-17
Author: yoptar@gmail.com
File Name: deeppavlov/models/embedders/glove_embedder.py
Class Name: GloVeEmbedder
Method Name: load