@@ -808,15 +808,16 @@ def make_ddpg_actor(
808
808
# GPU, number of workers, and so on).
809
809
#
810
810
# Here we will use
811
- # :class:`~torchrl.collectors.MultiaSyncDataCollector`, a data collector that
812
- # will be executed in an asynchronous manner (for example, data will be collected while
813
- # the policy is being optimized). With the :class:`MultiaSyncDataCollector`,
814
- # multiple workers are running rollouts separately. When a batch is asked, it
815
- # is gathered from the first worker that can provide it.
811
+ # :class:`~torchrl.collectors.SyncDataCollector`, a simple, single-process
812
+ # data collector. TorchRL offers other collectors, such as
813
+ # :class:`~torchrl.collectors.MultiaSyncDataCollector`, which executed the
814
+ # rollouts in an asynchronous manner (for example, data will be collected while
815
+ # the policy is being optimized, thereby decoupling the training and
816
+ # data collection).
816
817
#
817
818
# The parameters to specify are:
818
819
#
819
- # - the list of environment creation functions ,
820
+ # - an environment factory or an environment ,
820
821
# - the policy,
821
822
# - the total number of frames before the collector is considered empty,
822
823
# - the maximum number of frames per trajectory (useful for non-terminating
@@ -854,14 +855,11 @@ def make_ddpg_actor(
854
855
init_random_frames = 5000
855
856
num_collectors = 2
856
857
857
- from torchrl .collectors import MultiaSyncDataCollector
858
+ from torchrl .collectors import SyncDataCollector
858
859
from torchrl .envs import ExplorationType
859
860
860
- collector = MultiaSyncDataCollector (
861
- create_env_fn = [
862
- parallel_env ,
863
- ]
864
- * num_collectors ,
861
+ collector = SyncDataCollector (
862
+ parallel_env ,
865
863
policy = actor_model_explore ,
866
864
total_frames = total_frames ,
867
865
frames_per_batch = frames_per_batch ,
0 commit comments