GithubHelp home page GithubHelp logo

liuyuemaicha / adversarial-learning-for-neural-dialogue-generation-in-tensorflow Goto Github PK

View Code? Open in Web Editor NEW
188.0 11.0 75.0 136 KB

Adversarial-Learning-for-Neural-Dialogue-Generation-in-Tensorflow

Home Page: http://blog.csdn.net/liuyuemaicha/article/details/60581187

Python 100.00%
adversarial-learning tensorflow reinforce-learning chitchat chatbot

adversarial-learning-for-neural-dialogue-generation-in-tensorflow's People

Contributors

liuyuemaicha avatar ofrik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adversarial-learning-for-neural-dialogue-generation-in-tensorflow's Issues

Correctly formatted data

Hello!

I'm trying to run this repo, and am running into problems with the data. Can you please share how to obtain and format the data? What was the source?

Thank you!

a simple question and the total run time

For line 114 in gen:generator.py, why is the while loop always true and there is no explicit break within the loop? In addition, what is the typical total runtime for a CPU and a gpu? I am using a Tesla K80.

all_train里的decode部分

Hi…打扰了…我又来问问题了……
我在跑all_train 这部分的时候,
if mc_search:
train_query, train_answer, train_labels = decoder(gen_config.beam_size)
不是说对每个输入要输出beam_size个输出,然后来判断reward吗………………
但是对于一样的输入来说……我的输出都是一样的……= =所以虽然它decode了beam_size次,但是完全没起到作用啊……
所以这是发生了什么……

弱弱地问个问题。。。

disc/hier_rnn_model.py文件中第42-43行

query_output, query_state = tf.nn.rnn(encoder_emb, inputs=self.query[:bucket[0]], dtype=tf.float32)

output [max_len, batch_size, emb_dim] state [num_layer, 2, batch_size, emb_dim]

其中的state的第二维为啥是2?

关于代码的来源

您好, 最近在做对抗神经网络和对话系统的研究。想实现Jiwei Li et al“Adversarial Learning for Neural Dialogue Generation”的baselines.但是自己不会lua语言,所以参照着您的python+tensorflow的源码跑了一下。结果和自己预想的有些出入。所以想请问一下,您的源码和文章中提到的方法是完全一致的么。方便的话请致信:[email protected]

关于数据集

您好!
我没有找到文章的原作者使用的数据集,请问原作者开放数据集了吗?

about code

在代码里gen_disc()生成的训练数据没有被 h_disc.hier_train(disc_config, evl_config)函数用到,不是说 gen_disc()函数是生成判别器的训练数据的吗,而且代码中h_disc.hier_train(disc_config, evl_config)需要用到训练集和验证集。同时在训练的过程中,一直使用while true语句,没有判断训练停止的时候吗?

gen.decode生成的结果有问题…

您好,我试图运行这个程序,因为我想要跑不同的数据,所以我改动了pre_data() 这部分的代码,但是在运行过程中,出现了一些问题。
当我运行gen.train()的时候,结果看上去是正常的,perplexity也在减小。但是我想用gen.decode()来生成discriminator的训练数据时,我发现生成的train.gen文件是空的。
然后我试图把out_logits打出来,结果发现每一行的预测数据相差都不大,然后在这部分代码中:
for seq in out_logits:
token = []
for t in seq:
token.append(int(np.argmax(t, axis=0)))
tokens.append(token)
np.argmax(t,axis = 0),结果都是一个数,在我的vocal里正好对应了" ",所以导致train.gen里每一个预测出来的句子都是" "组成的....
我现在完全不明白自己哪里错了……希望可以得到您的帮助……非常感谢……

tf新版本 _linear 被移除的问题

您好,在跑这个代码的时候,因为rnn_cell.linear被移除,所以我手动加了一段linear(),但是却有报错……代码如下:
def linear(input
, output_size, scope=None):
print('linear')
input_tensor = tf.convert_to_tensor(input_)
shape = input_tensor.get_shape().as_list()
if len(shape) != 2:
raise ValueError("Linear is expecting 2D arguments: %s" % str(shape))
if not shape[1]:
raise ValueError("Linear expects shape[1] of arguments: %s" % str(shape))
input_size = shape[1]

# Now the computation.  
with tf.variable_scope(scope or "SimpleLinear"):  
    matrix = tf.get_variable("Matrix", [output_size, input_size], dtype=input_tensor.dtype)  
    bias_term = tf.get_variable("Bias", [output_size], dtype=input_tensor.dtype)  

return tf.matmul(input_, tf.transpose(matrix)) + bias_term  

报错: in linear(input_, output_size, scope)
4 shape = input_tensor.get_shape().as_list()
5 if len(shape) != 2:
----> 6 raise ValueError("Linear is expecting 2D arguments: %s" % str(shape))
7 if not shape[1]:
8 raise ValueError("Linear expects shape[1] of arguments: %s" % str(shape))

ValueError: Linear is expecting 2D arguments: [2, None, 512]

.....请问这个linear是哪里不对吗……和原本的rnn_cell._linear 应该是一样的呀………………

请教代码问题

line 214:

4.Update G on (X, ^Y ) using reward r

gan_adjusted_loss, gen_step_loss, _ =gen_model.step(sess, encoder, decoder, weights, bucket_id, forward_only=False, reward=reward, up_reward=True, debug=True)
gen_loss += gen_step_loss / gen_config.steps_per_checkpoint

这里的encoder, decoder, weights应该指的是(X,Y),而不是(X, ^Y ),这部分是不是应该修改为(X, ^Y )的输入?我想请问下,这部分是我理解错了么?

data

Hi.

Thanks for sharing your code and work.

Can you provide training data?

Error while running the script

Dear researchers,

I am very enthusiastic about the idea of improving artificial dialog quality by using adversarial learning techniques. That's why after reading your paper I wanted to try to run the script myself.
Unfortunately, even though I used the recommended versions of Python and TensorFlow, I got the following error:

 File "/home/vergeest/.local/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1323, in fully_connected
    raise ValueError('num_outputs should be int or long, got %s.', num_outputs)
ValueError: ('num_outputs should be int or long, got %s.', Dimension(512))

I tried to solve this, but to no avail as of yet. Do you have any clue what I could do to fix this?
Might it be easier/quicker to run it in a cloud environment rather than locally as well?
Thanks in advance!

关于disc_data数据问题

disc.dev.answer,disc.dev.query自己准备的,但 disc.dev.gen 这个数据是怎么来的?自己准备的还是生成的吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.