Very simple example of words polarity analysis based on Logit Regression coefficients.:
Here are attempts by classmates to load up the dataset with multiple labels (towards the bottom of the thread) if you find it helpful.
Thank you so much for the help. I’m going to check out that discussion!
I am training a Bidirectional LSTM with pretrained GLOVE embedding using Crestle GPU. It is taking 1 hour to train per epoch. Is it normal ?
When I had trained CNN with pretrained GLOVE embedding it took only 1 minute per epoch.
CuDNNLSTM 1 epoch takes 2-3 minutes to run on GTX 1080 Ti with 300-x embeddings.
How much time did it train to train CNN ? Was it significantly less ?
Maybe 4-6 minutes for same 1 bidirectional layers LSTM with single FC layer of size 128.
Is anything wrong with this code ?
#MAIN Create LSTM model
model.add(Embedding(vocab_size, 300, weights=[embedding_matrix],
compile the model
Adam_opt = Adam(lr=0.0001, beta_1=0.9, beta_2=0.999, epsilon=1e-08, decay=0.0)
model.compile(optimizer=Adam_opt, loss=‘binary_crossentropy’, metrics=[‘acc’])
early_stopping = EarlyStopping(monitor=‘val_loss’, patience=5, mode=‘min’)
save_best = ModelCheckpoint(’/home/nbuser/toxic.hdf’, save_best_only=True,
history = model.fit(X_train, y_train, validation_data=(X_eval, y_eval),
I tried with 2 bi-directional LSTM layers but the model did not improve as much as I expected.
I used CuDNNLSTM instead of LSTM, that helped. Brought down the training time
Well, it is just deeper and wider. I use input_length 100-250, you use 500. I use 1 LSTM, you use 2 LSTMs. I do not use RepeatVector which, I assume, make output of LSTM1 500 times deeper. +LSTM instead of CuDNNLSTM. This might be the difference.
Yes reducing 1 LSTM and using using CuDNNLSTM made it better.
Is 1 LSTM enough to learn a good representation ?
Hard to say what kind of architectures guys use in this competition. Some declared they can achieve 0.987 public and 0.99+ CV with a single model. My best GRU model gets 0.9811 and 0.987 CV. This very simple GRU gets 0.983 on public leaderboard but I have no idea about its CV score.
The number of words in my sentence(maxlen)=500. How much maxlen did you keep ?
I tried 100-500. GRU I shared in previous reply uses 100. On a forum I seen a recommendation to start with 100.
Ok. Thanks !!
Anyone planning to train embeddings for this competition?
I’m having trouble setting the sequential attribute for a field to False. My code includes the following.
LABEL = data.Field(sequential=False)
But when I check whether sequential is False or not…
I get “True”. When I try to set the attribute…
LABEL.sequential = False hasattr(LABEL, 'sequential')
I still get True!
Any help would be much appreciated!
Sources that I found useful for this competition:
- Lesson 6, RNN, Jeremy
- Understanding LSTM Networks
- Recurrent Neural Networks Tutorial 4 parts, all are good
- Feed forward attention
- Advanced LSTM
- NB-SVM strong linear baseline
- Pooled GRU + Fasttext
- Word2Vec Tutorial - The Skip-Gram Model
- GloVe: Global Vectors for Word Representation
- Attention layer in keras 1
- Attention layer in keras 2
From python documentation:
The arguments are an object and a string. The result is True if the string is the name of one of the object’s attributes, False if not. (This is implemented by calling getattr(object, name) and seeing whether it raises an AttributeError or not.)
So it is not checking whether the variable has the value of
False - it is simply checking whether that variable exists. Hope that helps!