Closed tkelestemur closed 3 years ago
My plan is to implement a torch.nn.Module subclass in which the forward function takes the tuple of observations and feed the them into corresponding layers and returns the output of the fully connected layer. Finally, I would put this model inside the pfrl.nn.RecurrentSequential.
I think this should work.
Feel free to reopen if it didn't work.
I am trying to do this in #128. @tkelestemur if you have made this work, can I see how inputs are passed to your NN?
@tarokiritani answered in your question.
I've been trying to implement a recurrent model for the PPO agent that can take two different types of observations. My environment has a Tuple observation space and consists a 2-channel image and a timeseries data. I want to feed the images into a series of 2d-conv layers and feed the time series into 1d-conv data. The output of these layers would be flattened and feed into a fully connected layer and output of the this layer would go into an LSTM.
My plan is to implement a
torch.nn.Module
subclass in which theforward
function takes the tuple of observations and feed the them into corresponding layers and returns the output of the fully connected layer. Finally, I would put this model inside thepfrl.nn.RecurrentSequential
.This was the only way I could think of implementing this, however, I'm not sure it would work since the tuple observations might break something in the data collection. If this wouldn't work, how I can deal with using two types of observations and recurrent model?