Your first evaluation¶
Once you have a verified training (or, actually, even if you don't), you can post metrics for it to our website.
1. Install DVBench¶
If you haven't done this already in the previous step.
2. Connect a Client¶
Begin by connecting to DVBench.
What's API_URL?
As we are currently in (probably very broken) alpha testing, you will
receive API_URL from someone, presumably whomever you found out about
this from... Sorry for the wet paint.
2. Load your checkpoint¶
To ensure that the validation is bound to your declared training run, use the same model and checkpoint produced during attested training.
You can checkpoint and load however you'd like, but ensure its the same structure as what you had during training.
3. Bind the checkpoint¶
You now open the experiment and add some measurements! Use the same name as your training run if you want them to be associated together.
measure() will bind the local checkpoint against the run.
4. Describe the evaluation¶
Declare how you are going to do the evaluation. Note that your code in these functions will be uploaded for reference.
import torch
from torch.func import functional_call
@measurement.evaluate(params=0, batch=1)
def evaluate(params, batch):
# tip: use functional_call here to call your model
# given its state_dict
outputs = functional_call(model, params, **batch)
return logits.softmax(dim=-1).max(dim=-1).values
@measurement.aggregate
def aggregate(outputs):
return torch.cat(outputs).mean().item()
5. Run and submit¶
Finally, we are ready to submit the measurements to the website. First
locate the name of the measurement you are submitting to in /measurements,
and then pass that to .submit().
batches = load_your_evaluation_batches()
score = measurement.run(checkpoint, batches)
request_id = measurement.submit("measurement_name", score)
client.close()
Check the website again. Your result appears after validation.
What if measurement_name doesn't exist?
Only create a measurement when it is not already on the website.
Next: participate in a leaderboard.