yoctol / seq2vec Goto Github PK
View Code? Open in Web Editor NEWTransform sequence of words into a fix-length representation vector
License: GNU General Public License v3.0
Transform sequence of words into a fix-length representation vector
License: GNU General Public License v3.0
Seq2SeqAutoEncoderUseWordHash
cannot be picklized.
不知道要不要多加
tensorflow-gpu ??
(如果同時pip install tensorflow 和 tensorflow-gpu 不知道會發生什麼事情??)
Hi,
can you kindly update the requirements.txt file with the correct version of all modules?
Thanks a lot
from sklearn.utils import murmurhash3_32
murmurhash3_32('a', seed=0)
I am trying to execute the LSTM to LSTM auto-encoder with word embedding (RNN to RNN architecture) example. I have already trained my own word2vec model via gensim and saved it with the command
model.save('/home/estathop/Documents/word2vecmodel/w2v1model') #save model
when trying to use the
# load Gensim word2vec from word2vec_model_path
word2vec = GensimWord2vec('/home/estathop/Documents/word2vecmodel/w2v1model')
the following error occurs:
Traceback (most recent call last):
File "", line 5, in
word2vec = GensimWord2vec('/home/estathop/Documents/word2vecmodel/w2v1model')File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/seq2vec/word2vec/gensim_word2vec.py", line 9, in init
model_path, binary=TrueFile "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/gensim/models/keyedvectors.py", line 1120, in load_word2vec_format
limit=limit, datatype=datatype)File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/gensim/models/utils_any2vec.py", line 174, in _load_word2vec_format
header = utils.to_unicode(fin.readline(), encoding=encoding)File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/gensim/utils.py", line 359, in any2unicode
return unicode(text, encoding, errors=errors)File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0: invalid start byte
any ideas how to fix/bypass this ?
I tried to execute every single example from the initial README page, but everything throws different errors.
transformer = Seq2VecR2RWord(
word2vec_model=word2vec,
max_length=max_length,
latent_size=200,
encoding_size=300,
learning_rate=0.05
)
Traceback (most recent call last):
File "<ipython-input-42-34cf056a2e62>", line 6, in <module>
learning_rate=0.05
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/seq2vec/model/seq2vec_R2R_word.py", line 55, in __init__
learning_rate=learning_rate
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/seq2vec/model/seq2vec_base.py", line 68, in __init__
self.model, self.encoder = self.create_model()
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/seq2vec/model/seq2vec_R2R_word.py", line 89, in create_model
)(masked_inputs)
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/keras/layers/wrappers.py", line 325, in __call__
return super(Bidirectional, self).__call__(inputs, **kwargs)
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/keras/engine/topology.py", line 619, in __call__
output = self.call(inputs, **kwargs)
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/yklz/recurrent/bidirectional_rnn_encoder.py", line 31, in call
func_args = inspect.getfullargspec(self.layer.call).args
AttributeError: 'module' object has no attribute 'getfullargspec'
from seq2vec import Seq2VecR2RHash
transformer = Seq2VecR2RHash(
max_index=1000,
max_length=10,
latent_size=20,
embedding_size=200,
encoding_size=300,
learning_rate=0.05
)
Traceback (most recent call last):
File "<ipython-input-38-0274b84666d1>", line 9, in <module>
learning_rate=0.05
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/seq2vec/model/seq2vec_R2R_hash.py", line 58, in __init__
learning_rate
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/seq2vec/model/seq2vec_base.py", line 68, in __init__
self.model, self.encoder = self.create_model()
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/seq2vec/model/seq2vec_R2R_hash.py", line 96, in create_model
)(char_embedding)
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/keras/layers/wrappers.py", line 325, in __call__
return super(Bidirectional, self).__call__(inputs, **kwargs)
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/keras/engine/topology.py", line 619, in __call__
output = self.call(inputs, **kwargs)
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/yklz/recurrent/bidirectional_rnn_encoder.py", line 31, in call
func_args = inspect.getfullargspec(self.layer.call).args
AttributeError: 'module' object has no attribute 'getfullargspec'
In [37]: transformer = Seq2VecC2RChar(
word2vec_model=word2vec,
max_index=1000,
max_length=20,
embedding_size=200,
latent_size=200,
learning_rate=0.05,
channel_size=10,
conv_size=5
)
Traceback (most recent call last):
File "<ipython-input-37-1396dd8326f9>", line 9, in <module>
conv_size=5
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/seq2vec/model/seq2vec_C2R_char.py", line 69, in __init__
learning_rate
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/seq2vec/model/seq2vec_base.py", line 68, in __init__
self.model, self.encoder = self.create_model()
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/seq2vec/model/seq2vec_C2R_char.py", line 153, in create_model
)(encoded_feature)
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/keras/engine/topology.py", line 619, in __call__
output = self.call(inputs, **kwargs)
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/yklz/recurrent/rnn_decoder.py", line 95, in call
constants = self.layer.get_constants(inputs, training=None)
File "/home/estathop/anaconda2/envs/tensorflow/lib/python2.7/site-packages/yklz/recurrent/rnn_cell.py", line 277, in get_constants
constants = self.recurrent_layer.get_constants(
AttributeError: 'LSTM' object has no attribute 'get_constants'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.