I have to find the index of first occurrence of a sub array in each frame.The data is of size (batch_size,400). i need to find the index of occurrence of three consecutive ones in each frame of size 400.
Data-> [0 0 0 1 1 1 0 1 1 1 1 1][0 0 0 0 1 1 1 0 0 1 1 1] [0 1 1 1 0 0 0 1 1 1 1 1]
output should be [3 4 1]
The native solution is using for loop but since data is large it is very time consuming.
any implementation in numpy
or tensorflow
which is fast and efficient