instadeepai / Mava

🦁 A research-friendly codebase for fast experimentation of multi-agent reinforcement learning in JAX
Apache License 2.0
709 stars 83 forks source link

feat: simplify logger #989

Closed sash-a closed 8 months ago

sash-a commented 8 months ago

What?

Loggers were getting a bit complicated so I've simplified them.

Why?

Keep code complexity as low as possible.

How?

With the refactor I wanted to achieve two things:

Big change is experiment output now looks like this:

class ExperimentOutput(NamedTuple, Generic[MavaState]):
    """Experiment output."""

    learner_state: MavaState
    episode_metrics: Dict[str, chex.Array]
    train_metrics: Dict[str, chex.Array]

So our train metrics are a dict and no longer explicit - value_loss, actor_loss etc.

Note: I removed mava/logger.py and put it's contents in mava/utils/logger.py. I think this is better because I kept getting confused as to where to look for logging stuff, but open to opinions on this :smile:

sash-a commented 8 months ago

todo: check this works with MarlEval

sash-a commented 8 months ago

Neptune runs&sortBy=%5B%22sys%2Fcreation_time%22%5D&sortFieldType=%5B%22datetime%22%5D&sortFieldAggregationMode=%5B%22auto%22%5D&sortDirection=%5B%22descending%22%5D&suggestionsEnabled=true&lbViewUnpacked=true&compare=EwZgLCCcA0CMcPiRig)