592c161032bfd697ef6f2f334c5cd007062bec4b,rllib/models/torch/recurrent_net.py,LSTMWrapper,forward,#LSTMWrapper#Any#Any#Any#,156
Before Change
// Concat. prev-action/reward if required.
if self.model_config["lstm_use_prev_action_reward"]:
wrapped_out = torch.cat(
[
wrapped_out,
torch.reshape(input_dict[SampleBatch.PREV_ACTIONS].float(),
[-1, self.action_dim]),
torch.reshape(input_dict[SampleBatch.PREV_REWARDS].float(),
[-1, 1]),
],
dim=1)
// Then through our LSTM.
After Change
prev_a_r = []
if self.model_config["lstm_use_prev_action"]:
if isinstance(self.action_space, (Discrete, MultiDiscrete)):
prev_a = one_hot(input_dict[SampleBatch.PREV_ACTIONS].float(),
self.action_space)
else:
prev_a = input_dict[SampleBatch.PREV_ACTIONS].float()
prev_a_r.append(torch.reshape(prev_a, [-1, self.action_dim]))
if self.model_config["lstm_use_prev_reward"]:
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: ray-project/ray
Commit Name: 592c161032bfd697ef6f2f334c5cd007062bec4b
Time: 2020-11-25
Author: sven@anyscale.io
File Name: rllib/models/torch/recurrent_net.py
Class Name: LSTMWrapper
Method Name: forward
Project Name: tensorflow/tpu
Commit Name: a2a75e00e06924be9d8258726cded889abc017c7
Time: 2018-01-08
Author: frankchn@google.com
File Name: cloud_tpu/models/resnet_garden/resnet_main.py
Class Name:
Method Name: resnet_model_fn
Project Name: reinforceio/tensorforce
Commit Name: b0fd7d13ff1392c60dfef432bfea7a7dd035f71f
Time: 2017-07-29
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/models/dqfd_model.py
Class Name: DQFDModel
Method Name: create_tf_operations
Project Name: ray-project/ray
Commit Name: 592c161032bfd697ef6f2f334c5cd007062bec4b
Time: 2020-11-25
Author: sven@anyscale.io
File Name: rllib/models/tf/recurrent_net.py
Class Name: LSTMWrapper
Method Name: forward