Skip to content

Commit

Permalink
docs: add some documentation for the bestcheckpoint component
Browse files Browse the repository at this point in the history
  • Loading branch information
OmaymaMahjoub committed Dec 15, 2022
1 parent fcb79c3 commit fb1c975
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mava/components/building/best_checkpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ class BestCheckpointerConfig:


class BestCheckpointer(Component):
"""Best checkpointer is a component that help in storing the best network
params for two options:
1- Checkpointing the best network for a specific metric.
2- Calculating the absolute metric.
"""
def __init__(
self, config: BestCheckpointerConfig = BestCheckpointerConfig()
) -> None:
Expand Down Expand Up @@ -53,6 +58,8 @@ def on_building_executor_start(self, builder: SystemBuilder) -> None:
def on_parameter_server_init(self, server: SystemParameterServer) -> None:
"""Adding checkpointing parameters to parameter server"""
if self.config.checkpoint_best_perf:
# Store the best network in the parameter server just in
# the case of checkpointing the best performance
server.store.parameters.update(
{"best_checkpoint": self.init_checkpointing_params(server)}
)
Expand Down

0 comments on commit fb1c975

Please sign in to comment.