Reproduce experiments

Reproduce an experiment that a team member creates to verify and validate their results.

Before you reproduce an experiment, you need to make note of the:

  • Name of the project the run was logged to
  • Name of the run you want to reproduce

To reproduce an experiment:

  1. Navigate to the project where the run is logged to.
  2. Select the Workspace tab in the left sidebar.
  3. From the list of runs, select the run that you want to reproduce.
  4. Click Overview.

To continue, download the experiment’s code at a given hash or clone the experiment’s entire repository.

Download the experiment’s Python script or notebook:

  1. In the Command field, make a note of the name of the script that created the experiment.
  2. Select the Code tab in the left navigation bar.
  3. Click Download next to the file that corresponds to the script or notebook.

Clone the GitHub repository your teammate used when creating the experiment. To do this:

  1. If necessary, gain access to the GitHub repository that your teammate used to create the experiment.
  2. Copy the Git repository field, which contains the GitHub repository URL.
  3. Clone the repository:
    git clone https://github.com/your-repo.git && cd your-repo
    
  4. Copy and paste the Git state field into your terminal. The Git state is a set of Git commands that checks out the exact commit that your teammate used to create the experiment. Replace values specified in the proceeding code snippet with your own:
    git checkout -b "<run-name>" 0123456789012345678901234567890123456789
    
  1. Select Files in the left navigation bar.

  2. Download the requirements.txt file and store it in your working directory. This directory should contain either the cloned GitHub repository or the downloaded Python script or notebook.

  3. (Recommended) Create a Python virtual environment.

  4. Install the requirements specified in the requirements.txt file.

    pip install -r requirements.txt
    
  5. Now that you have the code and dependencies, you can run the script or notebook to reproduce the experiment. If you cloned a repository, you might need to navigate to the directory where the script or notebook is located. Otherwise, you can run the script or notebook from your working directory.

If you downloaded a Python notebook, navigate to the directory where you downloaded the notebook and run the following command in your terminal:

jupyter notebook

If you downloaded a Python script, navigate to the directory where you downloaded the script and run the following command in your terminal; Replace values enclosed in <> with your own:

python <your-script-name>.py

Last modified February 13, 2025: a09c831