# Tune logs

**URL:** https://community.wandb.ai/t/tune-logs/5779
**Category:** W&B Help
**Created:** [January 24, 2024, 12:57pm UTC](https://community.wandb.ai/t/tune-logs/5779 "2024-01-24T12:57:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![alyssonpereira41](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@alyssonpereira41](https://community.wandb.ai/u/alyssonpereira41)
#### Post date: [January 24, 2024, 12:57pm UTC](https://community.wandb.ai/t/tune-logs/5779/1 "2024-01-24T12:57:49Z")

</div>

I use tune.Tuner to train my customized parallel peetingZoo environment, but there is data within this environment that I want to be recorded as logs in wandb, can anyone help me configure it?

---

<div class="post-metadata">

### Author: ![nathank](https://avatars.discourse-cdn.com/v4/letter/n/7ea924/32.png) [@nathank](https://community.wandb.ai/u/nathank)
#### Post date: [January 29, 2024, 4:50pm UTC](https://community.wandb.ai/t/tune-logs/5779/2 "2024-01-29T16:50:50Z")

</div>

Hi @alyssonpereira41, here are [our docs](https://docs.ray.io/en/latest/tune/examples/tune-wandb.html) on using wandb with Ray Tune. Are you using the `WandbLoggerCallback` currently?

---

<div class="post-metadata">

### Author: ![alyssonpereira41](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@alyssonpereira41](https://community.wandb.ai/u/alyssonpereira41)
#### Post date: [January 29, 2024, 6:50pm UTC](https://community.wandb.ai/t/tune-logs/5779/3 "2024-01-29T18:50:53Z")

</div>

Yes, I had already found the documentation and already applied it, but I have another problem in relation to the parameters that are being returned from my environment and they are not faithful to those that rllib returns by default, for example when I record the reward metrics they Shouldn’t they be the same ones returned?  
Follow the images to get an idea of what I’m talking about

 ![W&B Chart 29_01_2024, 15_44_35](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/2X/a/adb791312b1f823ca23b3c1325b2ebc40d9004e6.png)  
I collect data as follows  
´´´python  
class MyCallbacks(DefaultCallbacks):

```
def on_episode_step(self, *, worker: RolloutWorker, base_env, policies=None, episode: Episode, env_index=None, **kwargs):
    for agent_id in episode.get_agents():
        agent_info = episode.last_info_for(agent_id)

        # episode.custom_metrics[f"reward agente {agent_id} pela função"] = episode.agent_rewards[agent_id]
        episode.custom_metrics[f"Reward agente {agent_id}"] = agent_info["rw"]
        episode.custom_metrics[f"Lucro agente {agent_id}"] = agent_info["rw_pr"]
        episode.custom_metrics[f"Variabilidade agente {agent_id}"] = agent_info["rw_va"]        
        episode.custom_metrics[f"Sustentabilidade agente {agent_id}"] = agent_info["rw_su"]
        episode.custom_metrics[f"Ocupacao Yard agente {agent_id}"] = agent_info["yard"]

```

´´´  
and my information is saved as follows

```python
info[f"{agent}"] = {"rw": self.reward[f"{agent}"],
                    "rw_pr": self.rw_pr,
                    "rw_va": self.rw_va,
                    "rw_su": self.rw_su,
                    "VA": self.variabilidade,
                    "SU": self.sustentabilidade,
                    "F": self.F,
                    "acoes": self.acoes,
                    "atrasos_reais": self.atrasos_reais,
                    "acao_on_state_plan": self.acao_on_state_plan,
                    "carga_on_state_plan": self.carga_on_state_plan,
                    "patio_on_state_plan": self.patio_on_state_plan,
                    "yard" : (self.YA[agent].cont/self.YA[agent].Y)*100
                    }  

```

---

<div class="post-metadata">

### Author: ![alyssonpereira41](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@alyssonpereira41](https://community.wandb.ai/u/alyssonpereira41)
#### Post date: [January 29, 2024, 6:51pm UTC](https://community.wandb.ai/t/tune-logs/5779/4 "2024-01-29T18:51:30Z")

</div>

and the second graphic because you can’t put two images in one post

 ![W&B Chart 29_01_2024, 15_46_39](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/2X/a/a7cc34255638de8b688a72da21100a0d3f0216a3.png)

---

<div class="post-metadata">

### Author: ![nathank](https://avatars.discourse-cdn.com/v4/letter/n/7ea924/32.png) [@nathank](https://community.wandb.ai/u/nathank)
#### Post date: [April 30, 2024, 6:56pm UTC](https://community.wandb.ai/t/tune-logs/5779/5 "2024-04-30T18:56:25Z")

</div>

Hi @alyssonpereira41 sorry for the delayed response. Is this still an issue?

I’m not sure I’m following the issue. Is the plot incorrect or is what you are logging incorrect? Do you mind helping clarify this a bit?

Thank you,  
Nate

---

<div class="post-metadata">

### Author: ![anmolmann](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@anmolmann](https://community.wandb.ai/u/anmolmann)
#### Post date: [May 8, 2024, 1:39pm UTC](https://community.wandb.ai/t/tune-logs/5779/6 "2024-05-08T13:39:24Z")

</div>

Hi @alyssonpereira41 , since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!
