How to reset GRU?

I’m using video MOS predicting AI with GRU.

GRU will feed all of the frame’s data and return one single MOS value.

I’ll load pre-trained AI model and predict MOS for one video file.

Also, I want to predict another MOS value from another video file.

In this case, loading AI model to GPU takes about 20~30secs in my old laptop.

So I don’t want to reload the AI model and just want to reset the hidden state of the GRU.

my question is,

  1. Should I reset hidden state of GRU to predict MOS value for another video file?
    because hidden state of GRU may affect different behavior?

  2. If yes, how to reset the hidden state of the GRU, like end of the train-step?

Thanks in advance.

The nn.GRU module expects the initial hidden state as the second input argument and will default it to zeros, if none is provided.
In case you are not manually passing the hidden state to it, you are already using the zeroed out hidden state.

Thank you, I recently discovered that my question has a little unfamiliar word.
I’ll add some comment, what I want to mean ‘MOS’ is ‘video quality score’.

Also, After I read your comment, I realized that when the GRU’s second input argument is not defined, GRU is automatically reset as pre-trained state when I loaded first.
So I don’t need to reset GRU when input is changed, because the second input argument is not defined.

Thanks a lot.