pub struct OffPolicyConfig {
pub num_envs: usize,
pub autobatch_size: usize,
pub replay_buffer_size: usize,
pub train_interval: usize,
pub train_steps: usize,
pub eval_interval: usize,
pub eval_episodes: usize,
pub train_batch_size: usize,
pub warmup_steps: usize,
}rl only.Expand description
Parameters of an on policy training with multi environments and double-batching.
Fields§
§num_envs: usizeThe number of environments to run simultaneously for experience collection.
autobatch_size: usizeNumber of environment state to accumulate before running one step of inference with the policy. Must be equal or less than the number of simultaneous environments.
replay_buffer_size: usizeMax number of transitions stored in the replay buffer.
train_interval: usizeThe number of steps to collect between each step of training.
train_steps: usizeNumber of optimization steps done each train_interval.
eval_interval: usizeThe number of steps to collect between each evaluation.
eval_episodes: usizeThe number of episodes to run for each evaluation.
train_batch_size: usizeThe number of transition to train on.
warmup_steps: usizeNumber of steps to collect before starting to train.
Implementations§
Source§impl OffPolicyConfig
impl OffPolicyConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance of the config.
§Arguments
§Default Arguments
§num_envs
The number of environments to run simultaneously for experience collection.
- Defaults to
1
§autobatch_size
Number of environment state to accumulate before running one step of inference with the policy. Must be equal or less than the number of simultaneous environments.
- Defaults to
1
§replay_buffer_size
Max number of transitions stored in the replay buffer.
- Defaults to
1024
§train_interval
The number of steps to collect between each step of training.
- Defaults to
1
§train_steps
Number of optimization steps done each train_interval.
- Defaults to
1
§eval_interval
The number of steps to collect between each evaluation.
- Defaults to
10_000
§eval_episodes
The number of episodes to run for each evaluation.
- Defaults to
1
§train_batch_size
The number of transition to train on.
- Defaults to
32
§warmup_steps
Number of steps to collect before starting to train.
- Defaults to
0
Source§impl OffPolicyConfig
impl OffPolicyConfig
Sourcepub fn with_num_envs(self, num_envs: usize) -> Self
pub fn with_num_envs(self, num_envs: usize) -> Self
Sets the value for the field num_envs.
The number of environments to run simultaneously for experience collection.
- Defaults to
1
Sourcepub fn with_autobatch_size(self, autobatch_size: usize) -> Self
pub fn with_autobatch_size(self, autobatch_size: usize) -> Self
Sets the value for the field autobatch_size.
Number of environment state to accumulate before running one step of inference with the policy. Must be equal or less than the number of simultaneous environments.
- Defaults to
1
Sourcepub fn with_replay_buffer_size(self, replay_buffer_size: usize) -> Self
pub fn with_replay_buffer_size(self, replay_buffer_size: usize) -> Self
Sets the value for the field replay_buffer_size.
Max number of transitions stored in the replay buffer.
- Defaults to
1024
Sourcepub fn with_train_interval(self, train_interval: usize) -> Self
pub fn with_train_interval(self, train_interval: usize) -> Self
Sets the value for the field train_interval.
The number of steps to collect between each step of training.
- Defaults to
1
Sourcepub fn with_train_steps(self, train_steps: usize) -> Self
pub fn with_train_steps(self, train_steps: usize) -> Self
Sets the value for the field train_steps.
Number of optimization steps done each train_interval.
- Defaults to
1
Sourcepub fn with_eval_interval(self, eval_interval: usize) -> Self
pub fn with_eval_interval(self, eval_interval: usize) -> Self
Sets the value for the field eval_interval.
The number of steps to collect between each evaluation.
- Defaults to
10_000
Sourcepub fn with_eval_episodes(self, eval_episodes: usize) -> Self
pub fn with_eval_episodes(self, eval_episodes: usize) -> Self
Sets the value for the field eval_episodes.
The number of episodes to run for each evaluation.
- Defaults to
1
Sourcepub fn with_train_batch_size(self, train_batch_size: usize) -> Self
pub fn with_train_batch_size(self, train_batch_size: usize) -> Self
Sourcepub fn with_warmup_steps(self, warmup_steps: usize) -> Self
pub fn with_warmup_steps(self, warmup_steps: usize) -> Self
Sets the value for the field warmup_steps.
Number of steps to collect before starting to train.
- Defaults to
0
Trait Implementations§
Source§impl Clone for OffPolicyConfig
impl Clone for OffPolicyConfig
Source§impl Config for OffPolicyConfig
impl Config for OffPolicyConfig
Source§fn save<P>(&self, file: P) -> Result<(), Error>
fn save<P>(&self, file: P) -> Result<(), Error>
std only.Source§fn load<P>(file: P) -> Result<Self, ConfigError>
fn load<P>(file: P) -> Result<Self, ConfigError>
std only.Source§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Source§impl Debug for OffPolicyConfig
impl Debug for OffPolicyConfig
Source§impl<'de> Deserialize<'de> for OffPolicyConfig
impl<'de> Deserialize<'de> for OffPolicyConfig
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Display for OffPolicyConfig
impl Display for OffPolicyConfig
Auto Trait Implementations§
impl Freeze for OffPolicyConfig
impl RefUnwindSafe for OffPolicyConfig
impl Send for OffPolicyConfig
impl Sync for OffPolicyConfig
impl Unpin for OffPolicyConfig
impl UnsafeUnpin for OffPolicyConfig
impl UnwindSafe for OffPolicyConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more