# Logging all summary metrics based on the max of one

**URL:** <https://community.wandb.ai/t/logging-all-summary-metrics-based-on-the-max-of-one/1836>\
**Category:** W&B Help\
**Created:** [January 28, 2022, 11:16pm UTC](https://community.wandb.ai/t/logging-all-summary-metrics-based-on-the-max-of-one/1836 "2022-01-28T23:16:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsturgeo](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dsturgeo](https://community.wandb.ai/u/dsturgeo)\
**Post date:** [January 28, 2022, 11:16pm UTC](https://community.wandb.ai/t/logging-all-summary-metrics-based-on-the-max-of-one/1836/1 "2022-01-28T23:16:27Z")

</div>

If you’re doing something like early stopping, you might simply save the model with the best loss and let it run for 10 more epochs, but discard those model weights. I see that for individual metrics I can tell it to store the “max” or “min”, but what if I want the entire summary to happen based on a single metric’s max/min?

---

<div class="post-metadata">

**Author:** ![armanharutyunyan](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@armanharutyunyan](https://community.wandb.ai/u/armanharutyunyan)\
**Post date:** [January 31, 2022, 7:24am UTC](https://community.wandb.ai/t/logging-all-summary-metrics-based-on-the-max-of-one/1836/2 "2022-01-31T07:24:45Z")

</div>

Hey Darrick, I am not sure I fully understand your use-case. Could you give me an example?

---

<div class="post-metadata">

**Author:** ![dsturgeo](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dsturgeo](https://community.wandb.ai/u/dsturgeo)\
**Post date:** [February 1, 2022, 8:39pm UTC](https://community.wandb.ai/t/logging-all-summary-metrics-based-on-the-max-of-one/1836/3 "2022-02-01T20:39:13Z")

</div>

Sure, let’s say I’m training a model, but during training I save only the _best performing model_, for example, when the model has the best validation accuracy I save the weights. Let’s say I train for 50 epochs, but at epoch 40, the model has its peak accuracy. Therefore, the weights I have saved for this model reflect the state of the model at epoch 40. However, the weights and biases _summary metrics_ reflect the state of the model at epoch 50.

Ideally, I’d like to change some simple setting which allows me to do this. I realize that I could probably put code in the training workflow to manually check accuracy and set the summary metrics, but it would be nice if there was more a setting for this purpose. I can already tell wandb to log the best accuracy (at epoch 40) instead of the final accuracy (at epoch 50), but I would like to tell wandb to give me _all of the metrics_ at epoch 40 where the best accuracy was achieved.

---

<div class="post-metadata">

**Author:** ![armanharutyunyan](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@armanharutyunyan](https://community.wandb.ai/u/armanharutyunyan)\
**Post date:** [February 9, 2022, 5:59am UTC](https://community.wandb.ai/t/logging-all-summary-metrics-based-on-the-max-of-one/1836/4 "2022-02-09T05:59:36Z")

</div>

Hey Darrick,

Apologies about the delay on this one. You should be able to set all the summary metrics in your code. Here is an example. Doesn’t this cover your use-case?

Best,  
Arman

---

<div class="post-metadata">

**Author:** ![armanharutyunyan](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@armanharutyunyan](https://community.wandb.ai/u/armanharutyunyan)\
**Post date:** [February 10, 2022, 8:08am UTC](https://community.wandb.ai/t/logging-all-summary-metrics-based-on-the-max-of-one/1836/5 "2022-02-10T08:08:14Z")

</div>

Hi Darrick,

We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.

Best,  
Weights & Biases

---

<div class="post-metadata">

**Author:** ![armanharutyunyan](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@armanharutyunyan](https://community.wandb.ai/u/armanharutyunyan)\
**Post date:** [February 12, 2022, 9:22am UTC](https://community.wandb.ai/t/logging-all-summary-metrics-based-on-the-max-of-one/1836/6 "2022-02-12T09:22:13Z")

</div>

Hey Darrick, since we have not heard back from you, I’ll be closing this ticket. But please let me know if you have further questions.

---

<div class="post-metadata">

**Author:** ![dsturgeo](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dsturgeo](https://community.wandb.ai/u/dsturgeo)\
**Post date:** [March 15, 2022, 2:17am UTC](https://community.wandb.ai/t/logging-all-summary-metrics-based-on-the-max-of-one/1836/7 "2022-03-15T02:17:10Z")

</div>

I don’t see any example along with your reply

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [May 14, 2022, 2:17am UTC](https://community.wandb.ai/t/logging-all-summary-metrics-based-on-the-max-of-one/1836/8 "2022-05-14T02:17:31Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
