Skip to content

Tag: lstm

Word2Vec + LSTM Good Training and Validation but Poor on Test

currently I’am training my Word2Vec + LSTM for Twitter sentiment analysis. I use the pre-trained GoogleNewsVectorNegative300 word embedding. The reason I used the pre-trained GoogleNewsVectorNegative300 because the performance much worse when I trained my own Word2Vec using own dataset. The problem is why my training process had validation acc and loss stuck at 0.88 and 0.34 respectively. Then, my confussion

name ‘Bidirectional’ is not defined

Im following this tutorial and right when I want to initialize a sequential keras, like the code below: I get an error saying : What is the problem ? it is the exact same code as in the tutorial. Answer You’re most likely missing the import statement from the tensorflow package. It appears that’s there is a link to the

Fitting LSTM model

I am trying to fit LSTM model, but it gave me an error with the shape. my dataset has 218 rows and 16 features including the targeted one. I split the data, %80 for training and %20 for testing, after compiling the model and run it, i got this error: Variable definitions: batch_size = 160 epochs = 20 timesteps =

Specifying number of cells in LSTM layer in PyTorch

I don’t fully understand the LSTM layer in PyTorch. When I instantiate an LSTM layer how can I specify the number of LSTM cells inside the layer? My first thought was that it was the “num_layers” argument, if we assume that LSTM cells are connected vertically. But if that is the case how can we implement stacked LSTM with for