pub struct BcConfig<P>where
P: SubModel1<Output = Tensor>,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,{
pub policy_model_config: BcModelConfig<P::Config>,
pub batch_size: usize,
pub action_type: BcActionType,
pub device: Option<Device>,
pub record_verbose_level: usize,
pub phantom: PhantomData<P>,
}Expand description
Configuration of Bc agent.
P is the type parameter of the policy model.
Fields§
§policy_model_config: BcModelConfig<P::Config>§batch_size: usize§action_type: BcActionType§device: Option<Device>§record_verbose_level: usize§phantom: PhantomData<P>Implementations§
Source§impl<P> BcConfig<P>
impl<P> BcConfig<P>
Sourcepub fn batch_size(self, v: usize) -> Self
pub fn batch_size(self, v: usize) -> Self
Sets batch size.
Sourcepub fn policy_model_config(
self,
policy_model_config: BcModelConfig<P::Config>,
) -> Self
pub fn policy_model_config( self, policy_model_config: BcModelConfig<P::Config>, ) -> Self
Sets the configuration of the policy model.
pub fn action_type(self, action_type: BcActionType) -> Self
Sourcepub fn optimizer(self, opt_config: OptimizerConfig) -> Self
pub fn optimizer(self, opt_config: OptimizerConfig) -> Self
Sets optimizer.
Trait Implementations§
Source§impl<'de, P> Deserialize<'de> for BcConfig<P>
impl<'de, P> Deserialize<'de> for BcConfig<P>
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>,
Deserialize this value from the given Serde deserializer. Read more
impl<P> StructuralPartialEq for BcConfig<P>
Auto Trait Implementations§
impl<P> Freeze for BcConfig<P>
impl<P> RefUnwindSafe for BcConfig<P>
impl<P> Send for BcConfig<P>
impl<P> Sync for BcConfig<P>
impl<P> Unpin for BcConfig<P>
impl<P> UnwindSafe for BcConfig<P>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 more