# How to provide fold information in WandbCallback?

**URL:** <https://community.wandb.ai/t/how-to-provide-fold-information-in-wandbcallback/1599>\
**Category:** W&B Help\
**Created:** [December 23, 2021, 6:50am UTC](https://community.wandb.ai/t/how-to-provide-fold-information-in-wandbcallback/1599 "2021-12-23T06:50:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![harveenchadha](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/harveenchadha/32/575_2.png) [@harveenchadha](https://community.wandb.ai/u/harveenchadha)\
**Post date:** [December 23, 2021, 6:50am UTC](https://community.wandb.ai/t/how-to-provide-fold-information-in-wandbcallback/1599/1 "2021-12-23T06:50:46Z")

</div>

How to provide fold information in multi-fold training?

I am trying to do something like this:

```auto
for fold in range(5):
model.fit()

```

So it actually creates a single graph where steps are continued from the last executed step of previous epoch.  
For ref see below:

 ![Screenshot 2021-12-23 at 12.19.28 PM](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/5384d8c3e8faa471e61a07d930f7f839a42650b5.png)

---

<div class="post-metadata">

**Author:** ![kuangda](https://avatars.discourse-cdn.com/v4/letter/k/45deac/32.png) [@kuangda](https://community.wandb.ai/u/kuangda)\
**Post date:** [December 26, 2021, 5:38pm UTC](https://community.wandb.ai/t/how-to-provide-fold-information-in-wandbcallback/1599/2 "2021-12-26T17:38:34Z")

</div>

I am thinking about this as well. I am about to give each fold a run name in wandb but not sure it is a good practice.

---

<div class="post-metadata">

**Author:** ![morgan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/morgan/32/74_2.png) [@morgan](https://community.wandb.ai/u/morgan)\
**Post date:** [December 27, 2021, 6:09pm UTC](https://community.wandb.ai/t/how-to-provide-fold-information-in-wandbcallback/1599/3 "2021-12-27T18:09:52Z")

</div>

Not sure if I fully understand the question, you’d like to train on different folds, but continue training the model, as opposed to training a fresh model on each fold?

If you’re resuming the run you could update a `fold` config variable at the beginning of each for loop, so you would know the latest fold the model is training on?

```auto
for fold in range(5):
    wandb.config.update({'fold':fold})
    model.fit()

```

What other fold information were you hoping to log?

---

<div class="post-metadata">

**Author:** ![\_scott](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/_scott/32/95_2.png) [@\_scott](https://community.wandb.ai/u/_scott)\
**Post date:** [January 4, 2022, 1:05pm UTC](https://community.wandb.ai/t/how-to-provide-fold-information-in-wandbcallback/1599/4 "2022-01-04T13:05:22Z")

</div>

> [@harveenchadha](#):
>
> How to provide fold information in multi-fold

I’d love to help more here if you could clarify what you’re hoping would happen.

You can customise your x-axis using x-axis expressions if that’s all you want to do:

Here you can see I’m redefining the x-axis to be `step - (fold*num_steps)` where `config:num_steps` is the number of steps in each fold (100 in this case), fold is the current fold, and `_step` is the internal step logged by wandb.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/ed686bc99de10d283012548a0979562bad514c2e.png)

---

<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:** [April 20, 2022, 6:02pm UTC](https://community.wandb.ai/t/how-to-provide-fold-information-in-wandbcallback/1599/5 "2022-04-20T18:02:07Z")

</div>

Closed on April 20, 2022, 6:02pm UTC

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