Giter Club home page Giter Club logo

deconv_paragraph_represention's People

Contributors

dependabot[bot] avatar dreasysnail 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

deconv_paragraph_represention's Issues

Trying free the batch_size of placeholder

Trying to let the model to accept any batch size, for test and validation purpose.
x_ = tf.placeholder(tf.int32, shape=[None, opt.sent_len])
x_org_ = tf.placeholder(tf.int32, shape=[None, opt.sent_len])
y_ = tf.placeholder(tf.int32, shape=[None, 1])
But the "None" value leads the following error:


ValueError Traceback (most recent call last)
in ()
----> 1 main()

in main()
202 y_ = tf.placeholder(tf.int32, shape=[None, 1])
203 dp_ratio_ = tf.placeholder(tf.float32, name='dp_ratio_')
--> 204 res_, dis_loss_, rec_loss_, loss_, train_op, prob_, acc_ = auto_encoder(alpha_, x_, x_org_, y_, dp_ratio_, opt)
205
206

in auto_encoder(alpha, x, x_org, y, dp_ratio, opt, opt_t)
109 H_enc, res = conv_encoder(x_emb, is_train, opt, res)
110 H_dec = H_enc
--> 111 logits = classifier_2layer(H_dec, opt, dropout = dp_ratio, num_outputs=opt.num_classes, prefix='classify')
112
113 dis_loss = tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=tf.one_hot(y, opt.num_classes))

~\Desktop\AutoEncoder\model.py in classifier_2layer(H, opt, dropout, prefix, num_outputs, is_reuse)
56 H = tf.squeeze(H)
57 biasInit = tf.constant_initializer(0.001, dtype=tf.float32)
---> 58 H_dis = layers.fully_connected(tf.nn.dropout(H, keep_prob = dropout), num_outputs = opt.H_dis, biases_initializer=biasInit, activation_fn = tf.nn.elu, scope = prefix + 'dis_1', reuse = is_reuse)
59 print("H_dis = ",H_dis)
60 logits = layers.fully_connected(tf.nn.dropout(H_dis, keep_prob = dropout), num_outputs = num_outputs, biases_initializer=biasInit, activation_fn = tf.nn.elu, scope = prefix + 'dis_2', reuse = is_reuse)

D:\anaconda\envs\tensorflow\lib\site-packages\tensorflow\contrib\framework\python\ops\arg_scope.py in func_with_args(*args, **kwargs)
179 current_args = current_scope[key_func].copy()
180 current_args.update(kwargs)
--> 181 return func(*args, **current_args)
182 _add_op(func)
183 setattr(func_with_args, '_key_op', _key_op(func))

D:\anaconda\envs\tensorflow\lib\site-packages\tensorflow\contrib\layers\python\layers\layers.py in fully_connected(inputs, num_outputs, activation_fn, normalizer_fn, normalizer_params, weights_initializer, weights_regularizer, biases_initializer, biases_regularizer, reuse, variables_collections, outputs_collections, trainable, scope)
1431 _scope=sc,
1432 _reuse=reuse)
-> 1433 outputs = layer.apply(inputs)
1434
1435 # Add variables to collections.

D:\anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\layers\base.py in apply(self, inputs, **kwargs)
318 Output tensor(s).
319 """
--> 320 return self.call(inputs, **kwargs)
321
322

D:\anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\layers\base.py in call(self, inputs, **kwargs)
284 input_shapes = [x.get_shape() for x in input_list]
285 if len(input_shapes) == 1:
--> 286 self.build(input_shapes[0])
287 else:
288 self.build(input_shapes)

D:\anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\layers\core.py in build(self, input_shape)
106 input_shape = tensor_shape.TensorShape(input_shape)
107 if input_shape.ndims is None:
--> 108 raise ValueError('Inputs to Dense should have known rank.')
109 if len(input_shape) < 2:
110 raise ValueError('Inputs to Dense should have rank >= 2.')

ValueError: Inputs to Dense should have known rank.

local variable 'test' referenced before assignment and not used

Should we remove "test = [list(s) for s in test]" in demo.py
I got the error
Traceback (most recent call last):
File "textCNN_public-master/demo.py", line 315, in
main()
File "textCNN_public-master/demo.py", line 193, in main
test = [list(s) for s in test]
UnboundLocalError: local variable 'test' referenced before assignment
And the local variable 'test' is not used.

maybe a bug when adding noise

Hello,
Thanks for your generous code sharing.

While I want to add some noises to the sentences (in demo.py set opt.substitution='s' and opt.permutation=10), I find that the 'sents' and 'sents_permutated' are the same. Actually, the 'sents_permutated' had been permutated, but the same as 'sents'. they point to the same memory space.

You have used "sent_temp = sents[ss][:]" to make sure a list copy, but the 'sents' is a list of arrays, shallow copy doesn't work well. Maybe "import copy" and use deep copy such as "copy.deepcopy(sents)" could repair it.

Reproduce results for hotel review reconstruction

Hi,

I read through your paper on ArXiv and was fascinated by the reconstruction result of your model. However, I found out that directly running the current version of demo code could not reproduce your claimed result. (Current BLEU2 is ~25, far from ~94 as in the paper)

I wonder if there is some special settings for your experiment in the paper. It would be very helpful if you can kindly provide more instructions on how to run the code correctly. Thanks!

Best,

Replicating the semi-supervised experiments

I was unable to locate the code to replicate the semi-supervised experiments (on the 3 datasets - Yelp, DBPedia and Y! Answers). Could you please point out how to run the same.

Also Could you please let me know how the datasets were pre-processed to obtain the statistics you mention in the SM, Table 7. (especially Vocabulary)

Thanks!

Arxiv data

Code and data to replicate the summarization experiments on Arxiv data. I could not find a citation to the arxiv data, was that constructed as part of this paper ? If so could it be shared ?

Thanks!

KeyError: 'rec_sents_feed_y'

KeyError: 'rec_sents_feed_y'
when using 'cnn-rnn' and 'rnn-rnn'.
File "demo.py", line 304, in main
print "Reconstructed:" + " ".join([ixtoword[x] for x in res['rec_sents_feed_y'][0] if x != 0])
KeyError: 'rec_sents_feed_y'

'Options' object has no attribute 'cnn_layer_dropout'

Hello,

I got the following error when running the code. Could you help solve this issue?

Thanks

Traceback (most recent call last):
File "demo.py", line 314, in
main()
File "demo.py", line 216, in main
res_, loss_, train_op = auto_encoder(x_, x_org_, opt)
File "demo.py", line 112, in auto_encoder
H_enc = conv_model_3layer(x_emb, opt)
File "model.py", line 237, in conv_model_3layer
X = regularization(X, opt, prefix= prefix + 'reg_X', is_reuse= is_reuse, is_train = is_train)
File "model.py", line 202, in regularization
X = X if not opt.cnn_layer_dropout else layers.dropout(X, keep_prob = opt.dropout_ratio, scope=prefix + '_dropout')
AttributeError: 'Options' object has no attribute 'cnn_layer_dropout'

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.