Skip to content

Commit 84788a1

Browse files
committed
Log action name for reward as well
1 parent a66e44b commit 84788a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/reward_preprocessing/interpret.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ def interpret(
294294
# Set of images, one for each feature, add each to plot
295295
for feature_i in range(next_obs.shape[0]):
296296
# Log the rewards
297-
custom_logger.record(f"reward_feature_{feature_i:02}", rews[feature_i])
297+
rew_key = f"rew_feat_{feature_i:02}"
298+
if features_are_actions:
299+
rew_key += f"_{_get_action_meaning(action_id=feature_i)}"
300+
custom_logger.record(rew_key, rews[feature_i])
298301
# Log the images
299302
sub_img_obs = obs[feature_i]
300303
sub_img_next_obs = next_obs[feature_i]

0 commit comments

Comments
 (0)