Keras-IndRNN icon indicating copy to clipboard operation
Keras-IndRNN copied to clipboard

Negative input error

Open yusufmet opened this issue 5 years ago • 2 comments

Dear Majumdar, I used your code and works well. When I standadized my data between -1 and 1, it gives error:

InvalidArgumentError: indices[40,496] = -1 is not in [0, 20000) [[{{node embedding_3/embedding_lookup}}]]

I searched web and try different options, but I could not make it. Do you have any suggestion to correct it? Regards

yusufmet avatar Jul 31 '19 13:07 yusufmet

Embedding lookup is done for the Keras Embedding layer, which I don't use in this model. It is likely an issue in your overall architecure.

Embedding layers accept only integer indices, not float values which is what the error is saying.

titu1994 avatar Jul 31 '19 13:07 titu1994

I have the same problem... It seems the embedding layer doesn't accept negative inputs, but I am not sure about it. The closest answer I read is that the value* you write in the 'input_dim' will limit your data value in the range [0,*). Negative values are not in this range so that they cause problems. So far, I have two ideas to solve it: Increase values of all data or change a machine learning method. If anyone knows how to solve the problems, please share solutions! I appreciate.

angelxd84130 avatar Jun 01 '21 08:06 angelxd84130