RNNLM | Using RNNLM rescoring a sentence in Chinese ASR system | Speech library
kandi X-RAY | RNNLM Summary
kandi X-RAY | RNNLM Summary
This recipe is used for training an RNN language model and ASR rescoring ===.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Load PTB data
- Build vocabulary
- Reads words from filename
- Convert a file to a list of word ids
- Dump dictionaries to file
- Load a vocabulary from file
- Write log probabilities to a file
- Calculates the word score for the given sentence
- Load a list of words from a file
- Evaluate the given model
- Iterate through the PTB data
- Generate data from PTB data
- Compute the score of a sentence
- Get the LM configuration
RNNLM Key Features
RNNLM Examples and Code Snippets
Community Discussions
Trending Discussions on RNNLM
QUESTION
I'm getting this error
'ValueError: Tensor Tensor("Placeholder:0", shape=(1, 1), dtype=int32) is not an element of this graph.'
The code is running perfectly fine without with tf.Graph(). as_default():
. However I need to call M.sample(...)
multiple times and each time the memory won't be free after session.close()
. Probably there is a memory leak but not sure where is it.
I want to restore a pre-trained neural network, set it as default graph, and testing it multiple times (like 10000) over the default graph without making it larger each time.
The code is:
...ANSWER
Answered 2017-Nov-14 at 09:16When you create a Model
, the session hasn't been restored yet. All placeholders, variables and ops that are defined in Model.__init__
are placed in a new graph, which makes itself a default graph inside with
block. This is the key line:
QUESTION
I am testing AleaTK for a task I need done.
The GitHub repo is Here.
If I download the Repo and test the PTB example, it works fine!
If I use Nuget and download the AleaTK Nuget and add the Classes: 'Lstm.cs', 'LstmRnnType.cs' with all the extensions necessary, I get an error:
The method or operation is not implemented.
Now, the call is coming from:
...ANSWER
Answered 2019-Aug-14 at 05:45After quite some debugging, I believe I have found the problem.
QUESTION
All the tensorflow implementations of Word2Vec that I have seen has a bias in the negative sampling softmax function, including on the official tensorflow website
https://www.tensorflow.org/tutorials/word2vec#vector-representations-of-words
...ANSWER
Answered 2018-Apr-25 at 05:17The exercise you link defines softmax_biases
to be zeros:
QUESTION
Inspired from Andrej Karpathy Char-RNN, There is a Tensorflow implementation of char-rnn sherjilozair/char-rnn-tensorflow: Multi-layer Recurrent Neural Networks (LSTM, RNN) for character-level language models in Python using Tensorflow. I want to implement bidirectional character level language model from this code. I change the model.py and wrote a simple code:
...ANSWER
Answered 2018-Mar-10 at 10:38Looks like you set self.lr = tf.Variable(0.0, trainable=False)
. Try changing this to a nonzero value. If you are reading probabilities from self.probs
during the testing phase this should be normalized appropriately,
QUESTION
I have been following https://github.com/kvfrans/twitch/blob/master/main.py tutorial to create and train a chatbot based on rnn using tensorflow. From what I understand, the tutorials was written on an older version of tensorflow, so some parts are outdated and give me an error like:
...ANSWER
Answered 2017-Nov-10 at 23:34I think this is the one you need:
QUESTION
So I implemented a RNN word generator model in jupytor notebook. When I was trying to use the trained model to generate some words:
...ANSWER
Answered 2017-Aug-25 at 02:17You can call the model.sample function multiple times without a problem but everything else (creating the session, constructing the Model, loading the checkpoint) should only be run once. If you refactor your code then you won't see that error message anymore.
QUESTION
I am trying to use adam optimizer twice to minimize different tensor in my code, I have tried use GradientDescentOptimizer twice, it's fine, but I get wrong message when using adam optimizer twice, I asked another question at:tensorflowVariable RNNLM/RNNLM/embedding/Adam_2/ does not exist, but that solution doesn't work in here. I also look up page:https://github.com/tensorflow/tensorflow/issues/6220, But I still don't understand.
Here is my code, I get Error message:ValueError: Variable NN/NN/W/Adam_2/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?
Then I tried the solution at tensorflowVariable RNNLM/RNNLM/embedding/Adam_2/ does not exist, but doesn't work
ANSWER
Answered 2017-Jul-07 at 10:53If you absolutely have to do it in the same scope, make sure all variables are defined in time. I'd have to do some more research on why it works like this, but the optimizer settings are locked in the graph at a lower level, no longer dynamically accessible.
Minimal working example:
QUESTION
Function() to define Model
...ANSWER
Answered 2017-Jun-27 at 14:48You have accidentally put the declare of train_op
into the scope RNNLM
which is in 'variable share' mode by calling scope.reuse_variables()
. Move it out of the scope, and you will get your code run.
QUESTION
My problem is quite similar to tensorflow embeddings don't exist after first RNN example. But I don't think I get a answer.
I posted my entire file on https://paste.ubuntu.com/24253170/. But I believe the following code really matter.
I get this error message:
...ANSWER
Answered 2017-Mar-27 at 10:29I know what's going on here, this is constructor code:(BTW, I use tensorflow 1.0)
QUESTION
I am trying this notebook: https://github.com/sjchoi86/Tensorflow-101/blob/master/notebooks/char_rnn_sample_tutorial.ipynb
I have a problem with this line In[6]:
...ANSWER
Answered 2017-Apr-12 at 10:41Because seq2seq
has been moved to tf.contrib.legacy_seq2seq. You should change this line to:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install RNNLM
You can use RNNLM like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page