Add Summary to Experiment Recorder

Summary to get quick glimpse of an experiment.

A summary provides a quick overview of an experiment, making it easier to compare multiple experiments efficiently. With the Markov SDK, you can conveniently set the summary of an experiment, aiding in better understanding and comparison of experiment outcomes.

For New Experiment

Follow the below steps to add a new experiment summary to the Experiment recorder.

Step 1: Create an Experiment recorder

Step 2: Register the Experiment recorder with MarkovML backend.

Step 3: Calculate and record model accuracy and loss.

Step 4: Add a summary of training loss using thesummary.add_training_loss(), and the summary of training accuracy using summary.add_training_accuracy().

Sample Code

import markov

# Your model definition 
# model = ...

# create recorder
recorder = markov.ExperimentRecorder(
    name="MarkovML experiment #1"
)
# The register method registers this recorder with the MarkovML backend. 
# You can record data with the backend only through a registered recorder.
recorder.register()

with recorder:
    for epoch in range(500):
        pred = model(x)  
        # Calculate and record loss
        loss = loss_function(pred, y)
        recorder.add_record({"loss": loss})
        
        # calculate and record accuracy
        accuracy = accuracy_function(pred, y)
        recorder.add_record({"accuracy": accuracy})
    
        # REST OF THE MODEL TRAINING CODE GOES HERE
            
    recorder.summary.add_training_loss(value=str(loss))
    recorder.summary.add_training_accuracy(value=str(accuracy))