imitation.scripts.ingredients.bc#

This ingredient provides BC algorithm instance.

It is either loaded from disk or constructed from scratch.

Functions

make_bc(venv, expert_trajs, custom_logger, ...)

rtype

BC

make_or_load_policy(venv, agent_path)

Makes a policy or loads a policy from a path if provided.

imitation.scripts.ingredients.bc.make_bc(venv, expert_trajs, custom_logger, batch_size, l2_weight, optimizer_cls, optimizer_kwargs, _rnd)[source]#
Return type

BC

imitation.scripts.ingredients.bc.make_or_load_policy(venv, agent_path)[source]#

Makes a policy or loads a policy from a path if provided.

Parameters
  • venv (VecEnv) – Vectorized environment we will be imitating demos from.

  • agent_path (Optional[str]) – Path to serialized policy. If provided, then load the policy from this path. Otherwise, make a new policy. Specify only if policy_cls and policy_kwargs are not specified.

Returns

A Stable Baselines3 policy.