Git Product home page Git Product logo

Comments (10)

hit-computer avatar hit-computer commented on July 17, 2024 3

Hi, I have my own bookcorpus and if I want to train the decoder, how should I do? I want to know what is C and what is X in "train.trainer(X, C, skmodel)". When I run "train.trainer(X, C, skmodel)", is X and C the same list of passages from my own bookcorpus? And I think it miss function "init_tparams" in trian.py, is right? Thanks very very much :)

from skip-thoughts.

ryankiros avatar ryankiros commented on July 17, 2024

Are you looking for a pre-trained decoder which decodes the encoded sentence (like an autoencoder?).

from skip-thoughts.

oxingoxing avatar oxingoxing commented on July 17, 2024

yes. Can I get that one?

from skip-thoughts.

ryankiros avatar ryankiros commented on July 17, 2024

I only have one trained on the Romance part of the BookCorpus (that we used for the "neural-storyteller" project). I don't have one on the full BookCorpus though. You could train one yourself using the decoder code available. I will probably train one myself and make it available in the future.

Depending on what you're decoding, the one included with the neural-storyteller project might be sufficient, so I would give that a try first.

from skip-thoughts.

oxingoxing avatar oxingoxing commented on July 17, 2024

ok, I will try. Thank you for reply:)

from skip-thoughts.

wllps1988315 avatar wllps1988315 commented on July 17, 2024

Hi. Thanks very very much for your skip-thought vector.
I tried the Step3:Launch the training with ipython and met the problems as following:

In [1]: import vocab

In [2]: X=[]

In [3]: fd = file( "8911.txt", "r" )

In [4]: for line in fd.readlines():
...: X.append(list(map(string,line.split(','))))

...:

NameError Traceback (most recent call last)
in ()
1 for line in fd.readlines():
----> 2 X.append(list(map(string,line.split(','))))
3

NameError: name 'string' is not defined

In [5]: for line in fd.readlines():
X.append(list(map(String,line.split(','))))
...:

In [6]: import train

In [7]: train.trainer(X)
{'grad_clip': 5.0, 'dim': 2400, 'optimizer': 'adam', 'dim_word': 620, 'dictionary': '/data/skip-thoughts/training/temp/book_dictionary_large.pkl', 'reload_': False, 'n_words': 20000, 'batch_size': 64, 'encoder': 'gru', 'maxlen_w': 30, 'saveto': '/data/skip-thoughts/training/temp/toy.npz', 'decoder': 'gru', 'max_epochs': 5, 'dispFreq': 1, 'decay_c': 0.0, 'saveFreq': 1000}
Loading dictionary...
Building model
/usr/lib/python2.7/site-packages/theano/scan_module/scan.py:1019: Warning: In the strict mode, all neccessary shared variables must be passed as a part of non_sequences
'must be passed as a part of non_sequences', Warning)
Building f_log_probs... Done
Building f_cost... Done
Done
Building f_grad... Building optimizers... Optimization

Epoch 0

IndexError Traceback (most recent call last)
in ()
----> 1 train.trainer(X)

/data/skip-thoughts/training/train.pyc in trainer(X, dim_word, dim, encoder, decoder, max_epochs, dispFreq, decay_c, grad_clip, n_words, maxlen_w, optimizer, batch_size, saveto, dictionary, saveFreq, reload_)
151 print 'Epoch ', eidx
152
--> 153 for x, y, z in train_iter:
154 n_samples += len(x)
155 uidx += 1

/data/skip-thoughts/training/homogeneous_data.pyc in next(self)
48 while True:
49 self.len_idx = numpy.mod(self.len_idx+1, len(self.len_unique))
---> 50 if self.len_curr_counts[self.len_unique[self.len_idx]] > 0:
51 break
52 count += 1

IndexError: index 0 is out of bounds for axis 0 with size 0

In [8]:

could you help me ?
best,
Lan

from skip-thoughts.

wllps1988315 avatar wllps1988315 commented on July 17, 2024

never mind, I already solved it.

best,
Lan

from skip-thoughts.

jtoy avatar jtoy commented on July 17, 2024

+1

from skip-thoughts.

Pratyusha1796 avatar Pratyusha1796 commented on July 17, 2024

@wllps1988315 I am having the same error if i give a sentence into X, if i give many sentences it is giving this error. can you give me a brief insight on how you solved that error?
screenshot from 2018-02-04 15 22 03
screenshot from 2018-02-04 15 22 39

Thank You

from skip-thoughts.

HassanAzzam avatar HassanAzzam commented on July 17, 2024

@oxingoxing did you find one?

from skip-thoughts.

Related Issues (20)

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.