Question about sequential data

How can I use sequential data in current perceptilabs version? If I have 1000 numbers I cannot have for each separate column. I want to have only one colum with 1000 numbers in my csv file or another file type if it’s possible

Hi @Ilya,
I think this is the same issue as in your other thread, where you would want to have them as an array or timeseries?
Both of those data types are unfortunately yet to be released, but at least arrays are something we will implement as the next data type in about a month.
Sorry about lacking this feature for now, hopefully temporarily downgrading to 0.11.15 will be an Ok solution.

All the best,
Robert

1 Like

Thank you for your reply

Hi,
Can I use sequential data in version 0.12.21 now? I wanna use sequential images as input data with only one label, but it seems that I can only use a single image with one label as input, shall I downgrade to 0.15.15?

Hi @hotfinda,

The way around that in PL right now would be to have one column for each timestep, that would allow you to have X number of input images that correspond to a single label.
Then the work would be to Merge them all together (using the Concatenate setting), effectively creating a time series of images, which you can feed into your model.

If using a numpy based approach would be easier for you, I would recommend to downgrade to 0.11.15 though :slight_smile:

Hope that helps!

Hi,Thanks for reply!
Sorry but I am still not clear about the procedure. Like, I have 200 image sequences, the shape of each sequence is (22,640,640), cause each sequence have 22 sequential images with size 640*640.
I want to import the 200 sequences as input data. But in PL now I can only import single images.

You can import multiple images by doing like this, but with as many images as you wish to use (22 in your case):

The once inside PL you can take all of these inputs and merge them into a (22,640,640) shape.

A heads up though, you may need to disable the Resize option in the pre-processing settings (the three lines next to the column name when defining the dataset) otherwise it will take quite a while.

Hi, thanks a lot for your help! Now I could use sequential images as input data. But I encounter another another problem, I cannot use 3D convolution.
For example, in the image, I use the “Merge function” to concatenate the images, but I got the ValueError: Input 0 of layer conv3d_3 is incompatible with the layer: : expected min_ndim=5, found ndim=4. Full shape received: (1, 250, 250, 18)
I thought the input shape shuld be (1,3,250,250,6), (1:batch_size; 3:channel of images; 250: width of image; 6: number of images ), so what should I do if I wanna use the 3D convolution into the sequential data?

Hi @hotfinda

I’m watching this thread with interest as not many people have emphasised sequential data lately (I was interested in some LSTM stuff a while back, but now I’m hanging out for Transformers!)

I will let @robertl address the specifics, but I have also encountered some low level problems with Merge Concatenate. I believe it’s due for some attention soon-ish but your 3 x 6 becoming 18 seems familiar.

Very much lokoing forward to seeingt what you do with this! @Birdstream has recently shared his resolution enchancer 2x super resolution model with simple FastAPI serving - it would be great to see more user projects like that.

I mentioned to @Birdstream that what we as users learn from doing these personal projects is probably well worth sharing - let me know if you’d be interested in seeing how we might take that forward.

(It doesn’t have to be heavy-duty - simply noting challenges and solutions can lead to incremental improvement through shared knowledge)

Hi @hotfinda,
The Merge component concatenates on the last (-1) dimension by default, which is why you will have something that looks like 250x250x18.
I was going to suggest that you can change it into the size you want by using the Reshape component, but I realized that the reshape component only has 3 input boxes :man_facepalming:
You can make it work with a little bit of custom code though:


Just pretend that the Convs are Input components here. The code window is showing the reshape layer and the settings are showing how I’m using 3d Conv.
In the custom code, I simply just removed line 9 (which is to apply the permutation, which we might not need here) and then I changed line 22 to reshape it into the dimension I wanted.

Note: There is currently a caching issue going on, so if you save the custom code more than once you won’t see the effect of it in the preview or dimensionality. In other words, you probably only want to save it once and if you did something wrong just delete the component and add in a fresh one. Sorry about that.

I noticed that the previews look a bit strange once we add the new dimension, need to look into how we visualize this best.

Hi roberti,
Thanks so so much for your help! :grinning:, Now things become easier for me, but still I have one more question: Contrary to “Merge" function, is there a function like"Split"? Or how can I define a split function using "Custom’ Module in PL?
For example, the output of 3D convolution is (1,3,128,128,8), (1:batch_size; 3: depth_size;128:width of Image ;128:height of Image;8:Number of feature map), and I want to split this output into three (1,1,128,128,8), so that I could process the (1,1,128,128,8) data individually.

Hi Julian,
Thanks for your interest. :grinning:
Currently, there are still some probelms with my LSTM simple model, and I will share my model build with our community once they are done. BTW: I am using an updated version of LSTM, and I try to realize it using ‘Custom Module’, but I am not still familiar with it, any document can help me with it ?

Hi @hotfinda - no promises about being to to anything to help but I am willing to try!

Suggestion: start a new question to describe what you are trying to achieve and how you are approaching it + what seems different about the updated LSTM (or anything else LSTM specific) and I’ll take a look.

So far, my LSTM experience is purely theoretical but as I said, I’d be happy to work with you if it helps!

H again @hotfinda,
Glad I could help! :slight_smile:

There is no split component in PL at the moment, so you would have to build a custom component for it.
Easiest is likely to drag in 3 custom components, connect all of them to the 3D conv and then customize them to each take one part of the split.

Here is also some documentation on the custom component: https://docs.perceptilabs.com/perceptilabs/references/components/custom
Doesn’t say too much, but points out where in the code you want to customize.
For your case, you’ll likely just need a single line of code to get it working as you want :slight_smile: