Comments (5)
I am very confused with the terms batch_size and n_steps. Does the lstm updates his parameters after n_steps ? In the recurrent network, the lstm is feed with a n_steps list of [batch_size,n_input]. So, in the case of the MNIST classification, the cell is feed with 128 samples of 28pixels every step in range(n_steps) ??
from tensorflow-examples.
It is working fine because it is using argmax of pred. Last layer of RNN example is a 10 dimension vector (for every label). So the predicted class is represented by that layer highest value index (that you get with argmax). Softmax is just used to squash values between 0 and 1.
Softmax is used while training because having a normalized probabilities distribution may help for better performances, but when predicting, softmax is actually not needed.
from tensorflow-examples.
It is hard to say without knowing your data, because network structure is also dependent of your data. If you are parsing words (ids), then your need to add an embedding layer.
from tensorflow-examples.
I also have a question to recurrent network. The RNN function returns only the last model output. return tf.matmul(outputs[-1], weights['out']) + biases['out']
which means the loss is also only calculated from the last output. One example in the Tensorflow repo (ptb_word_lm) uses the every output, not only the output of the last step. What is the right approach, or on what does it depend?
from tensorflow-examples.
It is because seq2seq is an encoding/decoding process that output a sequence, so calculating loss for every output is important. However in our example, we are simply doing classification over a whole sequence with a single output (predicted class), so only the last output is meaningful (which is the output after all timesteps have been 'processed').
from tensorflow-examples.
Related Issues (20)
- What should TFlearn users do?
- 404 not
- 404 not found
- Please provide a example for stacked bidirectional LSTM for Tensorflow 2.x
- [Potential NAN bug] Loss may become NAN during training HOT 1
- Tensor
- How to get prediction code ?
- fixes for Word2Vec for Python 3
- ml_introduction.ipynb Links
- InternalError: Dst tensor is not initialized. [[{{node IteratorGetNext/_2}}]] [Op:__inference_distributed_function_24557]
- In the tf1 example: I replace the weigtht and bias with tf.layers.dense, I found the accuracy decrease. why??? HOT 1
- The CNN example diagram shows 3 conv & pooling layers but the implementation only has 2
- AttributeError on placeholder HOT 1
- fig
- In K-Means Example, when i am running "from tensorflow.contrib.factorization import KMeans" line, i am getting an error "ModuleNotFoundError: No module named 'tensorflow.contrib'" HOT 2
- possible issue at: tensorflow_v2/notebooks/3_NeuralNetworks/autoencoder.ipynb HOT 6
- Add a development container HOT 3
- Ikvvh
- TPU Usage
- Activities HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow-examples.