philipperemy/keras-tcn

How to handle a timestep length of 0?

jdevoldere opened this issue · 4 comments

It can handle variable timestep size just fine as long as it's not zero, in which case I get this error:

tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found.
  (0) Invalid argument: slice index -1 of dimension 1 out of bounds.
	 [[{{node tcn/lambda/strided_slice}}]]
	 [[loss/mul/_257]]
  (1) Invalid argument: slice index -1 of dimension 1 out of bounds.
	 [[{{node tcn/lambda/strided_slice}}]]

@jdevoldere in which case would you have a timestep size of 0? I'm not sure Keras/tensorflow can even handle a tensor of 0.

@philipperemy when predicting the very first step of a sequence. for now I work around it by passing a start state to the beginning of each sequence in preprocessing.

Well in deep learning, you need an input to generate an output. Otherwise you first output is just purely random. So in your case, you should leave out a few steps before predicting.

I'll close this issue if you don't have any other questions. Feel free to re-open it.