LogoLogo
MarkovML HomeLogin to appSDK Docs
  • MarkovML Developer Hub
  • Guides
    • 🖥️Setup MarkovML SDK
      • Upgrading your SDK version
    • 📊Working with Datasets
      • Register Datasets
        • Register Access Credentials (Cloud Storage)
        • Register a Data Family
        • Register a Dataset
      • Read Datasets
        • List Datasets
        • Fetch Dataset
        • Download Dataset Segment
        • Get Dataset Preview
      • Compare Datasets
      • Data Quality
      • Data Family Operations
    • 📚Manage Models and Projects
      • Manage Projects
        • Create a Project
        • Access an existing Project
      • Track Experiments
        • Create Experiment Recorder
        • Add Records to an Experiment Recorder
        • Add Summary to an Experiment Recorder
        • Integrations
        • Examples
          • Image Classifier
      • Record Model Evaluations
        • Create an Evaluation Recorder
        • Add Evaluation Records
      • Complete Examples
        • Sentiment Classifier
        • MNIST Data Classifier
    • 📧Email Notification
  • Fundamentals
    • Datasets & Data Families
    • Projects
    • Models
    • Experiments
    • Model Evaluations
  • 📖CLI Docs
  • CHANGELOG
    • July 5, 2023
    • June 14, 2023
    • May 30, 2023
    • May 1, 2023
    • March 15 2023
    • March 2 2023
    • February 14 2023
    • January 12 2023
    • December 7 2022
    • November 17 2022
Powered by GitBook
On this page

Was this helpful?

  1. Guides
  2. Manage Models and Projects
  3. Track Experiments

Add Summary to an Experiment Recorder

Summary helps in getting a glimpse of an experiment and helps in quickly comparing multiple experiments.

You can set the summary of an experiment using the Markov SDK.

Adding Summary to an existing experiment

from markov.api.recording.experiments.experiment_summary_api import ExperimentSummary

experiment_id = "paste-your-experiment-id-here"

summary = ExperimentSummary(experiment_id=experiment_id)

training_loss = 0.7
validation_loss = 0.9
training_accuracy = 0.88
validation_accuracy = 0.84
number_of_epochs = 25

summary.add_training_loss(value="{:.2f}".format(training_loss))
summary.add_validation_loss(value="{:.2f}".format(validation_loss))
summary.add_training_accuracy(value="{:.2f}".format(training_accuracy))
summary.add_validation_accuracy(value="{:.2f}".format(validation_accuracy))
summary.add_number_of_epochs(value="{}".format(number_of_epochs))

summary.add_custom(key="GPU", value="A100")

summary.set()

Adding Summary while recording a new experiment

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))

PreviousAdd Records to an Experiment RecorderNextIntegrations

Last updated 1 year ago

Was this helpful?

📚