pub struct BorderAtariEnv<O, A, OF, AF>where
    O: Obs,
    A: Act,
    OF: BorderAtariObsFilter<O>,
    AF: BorderAtariActFilter<A>,{ /* private fields */ }
Expand description

Implementations§

source§

impl<O, A, OF, AF> BorderAtariEnv<O, A, OF, AF>where O: Obs, A: Act, OF: BorderAtariObsFilter<O>, AF: BorderAtariActFilter<A>,

source

pub fn open(&mut self) -> Result<()>

Opens window for display.

source

pub fn get_num_actions_atari(&self) -> i64

Returns the number of actions.

Trait Implementations§

source§

impl<R: ReplayBufferBase> Agent<BorderAtariEnv<BorderAtariObs, BorderAtariAct, BorderAtariObsRawFilter<BorderAtariObs>, BorderAtariActRawFilter<BorderAtariAct>>, R> for RandomAgent

source§

fn train(&mut self)

Set the policy to training mode.
source§

fn eval(&mut self)

Set the policy to evaluation mode.
source§

fn is_train(&self) -> bool

Return if it is in training mode.
source§

fn opt(&mut self, buffer: &mut R) -> Option<Record>

Do an optimization step.
source§

fn save<T: AsRef<Path>>(&self, _path: T) -> Result<()>

Save the agent in the given directory. This method commonly creates a number of files consisting the agent in the directory. For example, the DQN agent in border_tch_agent crate saves two Q-networks corresponding to the original and target networks.
source§

fn load<T: AsRef<Path>>(&mut self, _path: T) -> Result<()>

Load the agent from the given directory.
source§

impl<O, A, OF, AF> Default for BorderAtariEnv<O, A, OF, AF>where O: Obs, A: Act, OF: BorderAtariObsFilter<O>, AF: BorderAtariActFilter<A>,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<O, A, OF, AF> Env for BorderAtariEnv<O, A, OF, AF>where O: Obs, A: Act, OF: BorderAtariObsFilter<O>, AF: BorderAtariActFilter<A>,

source§

fn step_with_reset(&mut self, a: &Self::Act) -> (Step<Self>, Record)where Self: Sized,

Currently it supports non-vectorized environment.

§

type Config = BorderAtariEnvConfig<O, A, OF, AF>

Configurations.
§

type Obs = O

Observation of the environment.
§

type Act = A

Action of the environment.
§

type Info = NullInfo

Information in the self::Step object.
source§

fn build(config: &Self::Config, _seed: i64) -> Result<Self>where Self: Sized,

Builds an environment with a given random seed.
source§

fn reset(&mut self, _is_done: Option<&Vec<i8>>) -> Result<Self::Obs>

Resets the environment if is_done[0] == 1. or is_done.is_none(). Read more
source§

fn reset_with_index(&mut self, ix: usize) -> Result<Self::Obs>

Resets the environment with a given index. Read more
source§

fn step(&mut self, act: &Self::Act) -> (Step<Self>, Record)where Self: Sized,

Performes an environment step.
source§

impl Policy<BorderAtariEnv<BorderAtariObs, BorderAtariAct, BorderAtariObsRawFilter<BorderAtariObs>, BorderAtariActRawFilter<BorderAtariAct>>> for RandomAgent

§

type Config = RandomAgentConfig

Configuration of the policy.
source§

fn build(config: Self::Config) -> Self

Builds the policy.
source§

fn sample(&mut self, _: &Obs) -> Act

Sample an action given an observation.

Auto Trait Implementations§

§

impl<O, A, OF, AF> RefUnwindSafe for BorderAtariEnv<O, A, OF, AF>where A: RefUnwindSafe, AF: RefUnwindSafe, O: RefUnwindSafe, OF: RefUnwindSafe,

§

impl<O, A, OF, AF> Send for BorderAtariEnv<O, A, OF, AF>where A: Send, AF: Send, O: Send, OF: Send,

§

impl<O, A, OF, AF> Sync for BorderAtariEnv<O, A, OF, AF>where A: Sync, AF: Sync, O: Sync, OF: Sync,

§

impl<O, A, OF, AF> Unpin for BorderAtariEnv<O, A, OF, AF>where A: Unpin, AF: Unpin, O: Unpin, OF: Unpin,

§

impl<O, A, OF, AF> UnwindSafe for BorderAtariEnv<O, A, OF, AF>where A: UnwindSafe, AF: UnwindSafe, O: UnwindSafe, OF: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V