Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not good enough accuracy ! #2

Open
akshath123 opened this issue Aug 27, 2018 · 0 comments
Open

Not good enough accuracy ! #2

akshath123 opened this issue Aug 27, 2018 · 0 comments

Comments

@akshath123
Copy link

akshath123 commented Aug 27, 2018

Hey! First of all thanks for the tutorial, I have a problem and not able to resolve it.

The accuracy what I have got is around 63% it's not good enough has mentioned in the video so I thought of adding more bidirectional LSTM layers to the existing network to check out the result but I am getting this error. Please help me to resolve this issue.

sequence = Input(shape = (max_len, ), dtype = np.int32)
embedding = Embedding(max_features, embedding_dim, input_length = max_len)(sequence)
batch_norm = BatchNormalization()(embedding)

bi_lstm = Bidirectional(LSTM(lstm_layer_dim))(batch_norm)
drop_out = Dropout(0.25)(bi_lstm)
bi_lstm_1 = Bidirectional(LSTM(lstm_layer_dim_1))(drop_out)
drop_out_1 = Dropout(0.25)(bi_lstm_1)
preds = Dense(2, activation = 'softmax')(drop_out_1)

model = Model(sequence, preds)
model.summary()

The Error which I am getting is this,


IndexError Traceback (most recent call last)
in ()
6 bi_lstm = Bidirectional(LSTM(lstm_layer_dim))(batch_norm)
7 drop_out = Dropout(0.25)(bi_lstm)
----> 8 bi_lstm_1 = Bidirectional(LSTM(lstm_layer_dim_1))(drop_out)
9 drop_out_1 = Dropout(0.25)(bi_lstm_1)
10 preds = Dense(2, activation = 'softmax')(drop_out_1)

C:\Users\Akshath\AppData\Local\Continuum\Anaconda3\envs\py35\lib\site-packages\keras\engine\topology.py in call(self, inputs, **kwargs)
573 'layer.build(batch_input_shape)')
574 if len(input_shapes) == 1:
--> 575 self.build(input_shapes[0])
576 else:
577 self.build(input_shapes)

C:\Users\Akshath\AppData\Local\Continuum\Anaconda3\envs\py35\lib\site-packages\keras\layers\wrappers.py in build(self, input_shape)
322 def build(self, input_shape):
323 with K.name_scope(self.forward_layer.name):
--> 324 self.forward_layer.build(input_shape)
325 with K.name_scope(self.backward_layer.name):
326 self.backward_layer.build(input_shape)

C:\Users\Akshath\AppData\Local\Continuum\Anaconda3\envs\py35\lib\site-packages\keras\layers\recurrent.py in build(self, input_shape)
1015
1016 batch_size = input_shape[0] if self.stateful else None
-> 1017 self.input_dim = input_shape[2]
1018 self.input_spec[0] = InputSpec(shape=(batch_size, None, self.input_dim))
1019

IndexError: tuple index out of range

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant