class_docstr: The default implementation of training vessel.
  
  ``__init__`` accepts a sequence of initial states so that iterator can be created.
  ``train``, ``validate``, ``test`` each do one collect (and also update in train).
  By default, the train initial states will be repeated infinitely during training,
  and collector will control the number of episodes for each iteration.
  In validation and testing, the val / test initial states will be used exactly once.
  
  Extra hyper-parameters (only used in train) include:
  
  - ``buffer_size``: Size of replay buffer.
  - ``episode_per_iter``: Episodes per collect at training. Can be overridden by fast dev run.
  - ``update_kwargs``: Keyword arguments appearing in ``policy.update``.
    For example, ``dict(repeat=10, batch_size=64)``.
docstr: Create a collector and collects ``episode_per_iter`` episodes.
  Update the policy on the collected replay buffer.
code: def train(self, vector_env: FiniteVectorEnv) -> Dict[str, Any]:
      """Create a collector and collects ``episode_per_iter`` episodes.
      Update the policy on the collected replay buffer.
      """
      self.policy.train()
  
      with vector_env.collector_guard():
          collector = Collector(
              self.policy,
              vector_env,
              VectorReplayBuffer(self.buffer_size, len(vector_env)),
              exploration_noise=True,
          )
  
          # Number of episodes collected in each training iteration can be overridden by fast dev run.
          if self.trainer.fast_dev_run is not None:
              episodes = self.trainer.fast_dev_run
          else:
              episodes = self.episode_per_iter
  
          col_result = collector.collect(n_episode=episodes)
          update_result = self.policy.update(
              sample_size=0,
              buffer=collector.buffer,
              **self.update_kwargs,
          )
          res = {**col_result, **update_result}
          self.log_dict(res)
          return res
  
imports: from __future__ import annotations
  import weakref
  from typing import TYPE_CHECKING, Any, Callable, ContextManager, Dict, Generic, Iterable, Sequence, TypeVar, cast
  import numpy
  from tianshou.data import Collector, VectorReplayBuffer
  from tianshou.env import BaseVectorEnv
  from tianshou.policy import BasePolicy
  from qlib.constant import INF
  from qlib.log import get_module_logger
  from qlib.rl.interpreter import ActionInterpreter, ActType, ObsType, PolicyActType, StateInterpreter, StateType
  from qlib.rl.reward import Reward
  from qlib.rl.simulator import InitialStateType, Simulator
  from qlib.rl.utils import DataQueue
  from qlib.rl.utils.finite_env import FiniteVectorEnv
label_desc: Use image node_id 5 for calling the TrainingVessel obj's underlying member method code with example usage: obj.train(vector_env) and returns: res