Expand description
A thin wrapper of atari-env for Border.
The code under atari_env is adapted from the
atari-env crate
(rev = 0ef0422f953d79e96b32ad14284c9600bd34f335),
because the crate registered in crates.io does not implement
atari_env::AtariEnv::lives() method, which is required for episodic life environments.
This environment applies some preprocessing to observation as in
atari_wrapper.py.
You need to place Atari Rom directories under the directory specified by environment variable
ATARI_ROM_DIR. An easy way to do this is to use AutoROM
Python package.
pip install autorom
mkdir $HOME/atari_rom
AutoROM --install-dir $HOME/atari_rom
export ATARI_ROM_DIR=$HOME/atari_romHere is an example of running Pong environment with a random policy.
use anyhow::Result;
use border_atari_env::{
BorderAtariAct, BorderAtariActRawFilter, BorderAtariEnv, BorderAtariEnvConfig,
BorderAtariObs, BorderAtariObsRawFilter,
};
use border_core::{Env as _, Policy, DefaultEvaluator, Evaluator as _, NullReplayBuffer, Agent};
fn main() -> Result<()> {
// Creates Pong environment
let env_config = env_config("pong".to_string());
// Creates a random policy
let n_acts = 4;
let mut policy = Box::new(RandomPolicy::build(n_acts)) as _;
// Runs evaluation
let env_config = env_config.render(true);
let _ = DefaultEvaluator::new(&env_config, 42, 5)?
.evaluate(&mut policy);
Ok(())
}Modules§
Structs§
- Border
Atari Act - Action for
BorderAtariEnv. - Border
Atari ActRaw Filter - A filter that performs no processing.
- Border
Atari Env - A wrapper of atari learning environment.
- Border
Atari EnvConfig - Configuration of
BorderAtariEnv. - Border
Atari Obs - Observation of
BorderAtariEnv. - Border
Atari ObsRaw Filter - A filter that performs no processing.
Traits§
- Border
Atari ActFilter - Converts action of type
AtoBorderAtariAct. - Border
Atari ObsFilter - Converts
BorderAtariObsto observation of typeOwith an arbitrary processing.