1919import os
2020import time
2121import torch
22- from typing import Callable , List , Optional
22+ from typing import Callable , Optional
2323from absl import logging
2424
2525import alf
@@ -603,15 +603,14 @@ def _async_unroll(self, unroll_length: int):
603603
604604 def post_process_experience (self , rollout_info , step_type : StepType ,
605605 experiences : Experience ):
606- """A function for postprocessing experience. By default, it returns the input
606+ """A function for postprocessing experience. By default, it returns the input
607607 experience unmodified. Users can customize this function in the derived
608608 class to achieve different effects. For example:
609609 - per-step processing: return the current step of experience unmodified (by default)
610- or a modified version according to the customized ``post_process_experience`` function .
610+ or a modified version according to the customized ``post_process_experience``.
611611 As another example, task filtering can be simply achieved by returning ``[]``
612- in ``post_process_experience`` for that particular task.
613- - per-episode processing: ``should_post_process_experience`` returns True on episode
614- end and ``post_process_experience`` can return a list of processed
612+ for that particular task.
613+ - per-episode processing: this can be achieved by returning a list of processed
615614 experiences. For example, this can be used for success episode labeling.
616615
617616 Args:
@@ -637,9 +636,7 @@ def _process_unroll_step(self, policy_step, action, time_step,
637636 to create customized post processing behaviors.
638637
639638 Args:
640- experiences: a list of experience, containing the experience starting from the
641- initial time when ``should_post_process_experience`` is False to the step where
642- ``should_post_process_experience`` is True.
639+ experiences: a list of experience
643640 """
644641
645642 self .observe_for_metrics (time_step .cpu ())
0 commit comments