pub struct TensorboardRecorder<E, R>where
E: Env,
R: ReplayBufferBase,{ /* private fields */ }Expand description
Write records to TFRecord.
Implementations§
Source§impl<E, R> TensorboardRecorder<E, R>where
E: Env,
R: ReplayBufferBase,
impl<E, R> TensorboardRecorder<E, R>where
E: Env,
R: ReplayBufferBase,
Sourcepub fn new(
log_dir: impl AsRef<Path>,
model_dir: impl AsRef<Path>,
check_unsupported_value: bool,
) -> Self
pub fn new( log_dir: impl AsRef<Path>, model_dir: impl AsRef<Path>, check_unsupported_value: bool, ) -> Self
Construct a TensorboardRecorder.
log_dir- Directory in which TFRecords will be stored.model_dir- Directory in which the trained model will be saved.check_unsupported_value- If true, check unsupported record value in the write() method.
Trait Implementations§
Source§impl<E, R> Recorder<E, R> for TensorboardRecorder<E, R>where
E: Env,
R: ReplayBufferBase,
impl<E, R> Recorder<E, R> for TensorboardRecorder<E, R>where
E: Env,
R: ReplayBufferBase,
Source§fn write(&mut self, record: Record)
fn write(&mut self, record: Record)
Writes a given Record into a TFRecord.
This method handles RecordValue::Scalar and RecordValue::DateTime in the Record.
Other variants will be ignored.
Source§fn save_model(&self, base: &Path, agent: &Box<dyn Agent<E, R>>) -> Result<()>
fn save_model(&self, base: &Path, agent: &Box<dyn Agent<E, R>>) -> Result<()>
Saves the model parameters in the local file system.
Source§fn load_model(
&self,
base: &Path,
agent: &mut Box<dyn Agent<E, R>>,
) -> Result<()>
fn load_model( &self, base: &Path, agent: &mut Box<dyn Agent<E, R>>, ) -> Result<()>
Loads the model parameters from the local file system.
Auto Trait Implementations§
impl<E, R> Freeze for TensorboardRecorder<E, R>
impl<E, R> !RefUnwindSafe for TensorboardRecorder<E, R>
impl<E, R> Send for TensorboardRecorder<E, R>
impl<E, R> Sync for TensorboardRecorder<E, R>
impl<E, R> Unpin for TensorboardRecorder<E, R>
impl<E, R> !UnwindSafe for TensorboardRecorder<E, R>
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> 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