Reproduce experiments
2 minute read
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:
- Navigate to the project where the run is logged to.
- Select the Workspace tab in the left sidebar.
- From the list of runs, select the run that you want to reproduce.
- 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:
- In the Command field, make a note of the name of the script that created the experiment.
- Select the Code tab in the left navigation bar.
- 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:
- If necessary, gain access to the GitHub repository that your teammate used to create the experiment.
- Copy the Git repository field, which contains the GitHub repository URL.
- Clone the repository:
git clone https://github.com/your-repo.git && cd your-repo
- 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
-
Select Files in the left navigation bar.
-
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. -
(Recommended) Create a Python virtual environment.
-
Install the requirements specified in the
requirements.txt
file.pip install -r requirements.txt
-
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
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.