|
|
|
|
|
|
self.policy = module |
|
|
|
self.exporter = ModelSerializer(self.policy) |
|
|
|
|
|
|
|
def save_checkpoint(self, behavior_name: str, step: int) -> str: |
|
|
|
def save_checkpoint(self, brain_name: str, step: int) -> str: |
|
|
|
checkpoint_path = os.path.join(self.model_path, f"{behavior_name}-{step}") |
|
|
|
checkpoint_path = os.path.join(self.model_path, f"{brain_name}-{step}") |
|
|
|
self.export(checkpoint_path, behavior_name) |
|
|
|
self.export(checkpoint_path, brain_name) |
|
|
|
def export(self, output_filepath: str, behavior_name: str) -> None: |
|
|
|
def export(self, output_filepath: str, brain_name: str) -> None: |
|
|
|
if self.exporter is not None: |
|
|
|
self.exporter.export_policy_model(output_filepath) |
|
|
|
|
|
|
|