Closed mincheulkim closed 2 years ago
Short answer: Yes, but it will either make the network slower or performs worse.
Long answer: Because of the batch operation, the network's input dimension has to be the same at all times, so we need to keep the shape of observation the same. To do this with changing number of humans, in the gym environment, you can set the number of people to a maximum limit and use some special numbers like -1 to represent the people not present at each timestep. However, the above fix may affect the network's performance since the human trajectories are less continuous. A possible solution is to create a mask to indicate whether each human is present at each timestep (similar to the done mask), but you will have to use a for loop in the forward function to iterate through all humans, which makes it slower.
Thanks for your kind explanation, Unfortunately, I'm not good at understanding below suggestions in your explanation.
Thanks,
I've been working on changing number of humans recently, so I apologize if I'm inconsistent with my own words earlier.
pytorchBaselines/a2c_ppo_acktr/srnn_model.py
. But I now realized for loop is not necessary if you combine the done masks and this non-existent mask.Thanks!
Hi, I wonder this simulation can be applied to the dynamic changing number of people.
Since the hidden states and spatial edges are dependent on human_num, it seems to cause a problem in the forward() of srnn_model.py if the number of people changes at every step.
Where am I missing something?
Thanks,