Skip to content

Instantly share code, notes, and snippets.

@ceceshao1
Created December 27, 2018 19:56
Show Gist options
  • Save ceceshao1/8a8b48e84944fe164124e0d8da118d4e to your computer and use it in GitHub Desktop.
Save ceceshao1/8a8b48e84944fe164124e0d8da118d4e to your computer and use it in GitHub Desktop.
Comet-REST-API Example
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"https://comet.ml/images/logo_comet_light.png\" width=\"200px\"/>\n",
"\n",
"# Comet.ml REST API\n",
"\n",
"*This page is available as an executable [Jupyter Notebook](https://nbviewer.jupyter.org/github/comet-ml/comet-examples/blob/master/notebooks/Comet-REST-API.ipynb). To launch in MyBinder, follow the link and click the icon in the upper right-hand corner*.\n",
"\n",
"Comet.ml has an extensive interface to all of your data using a [REST API](https://en.wikipedia.org/wiki/Representational_state_transfer) through [Comet.ml endpoints](https://www.comet.ml/docs/rest-api/endpoints/). Now, you can access this information easily through the Comet.ml Python SDK. Requires version comet_ml version 1.0.40 or greater.\n",
"\n",
"## Setup\n",
"\n",
"To run the following experiments, you'll need to set your COMET_API_KEY and COMET_REST_API_KEY. The easiest way to to this is to set the values in a cell like this:\n",
"\n",
"```python\n",
"%%writefile .env\n",
"COMET_API_KEY=\"...\"\n",
"COMET_REST_API_KEY=\"..\"\n",
"```\n",
"where you replace the ...'s with your keys.\n",
"\n",
"You can get your COMET_API_KEY under your quickstart link (replace YOUR_USERNAME with your Comet.ml username):\n",
"\n",
"https://www.comet.ml/YOUR_USERNAME/quickstart\n",
"\n",
"You can get your COMET_REST_API_KEY under your settings (replace YOUR_USERNAME with your Comet.ml username):\n",
"\n",
"https://www.comet.ml/YOUR_USERNAME/settings/account\n",
"\n",
"## Quick Overview\n",
"\n",
"To access the REST API through the Comet.ml SDK, you will need to make an API() instance. First, we import the API class and other libraries we will need:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from comet_ml import API\n",
"\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"and create the API instance:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"comet_api = API()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Using the `comet_api` instance, you can get the name of your workspaces:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['dsblank']"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you reference your workspace by name using comet_api.get(WORKSPACE_NAME), you'll see your projects:"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['pytorch', 'mnist-001', 'visualizations', 'testing', 'pypy', 'tensorflow', 'chainer', 'mnist-014', 'optimizer', 'general', 'jupyter-experiments', 'keras', 'fastai']"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get(\"dsblank\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Or, get the projects from another user's workspace:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['fasttext', 'comet-notebooks', 'parameter-space-exploration', 'home-credit']"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get(\"cometpublic\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Using the same method, you can refer to a project by name:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['5dc346a883964bd2b8864c40940fd864', '351afa6e498f452ca743c19d3e131767', '72b89ab961cd42db91535026687f86fb', 'd5d3cf989efd4b5f8841bd64fee5f817', '12ab8382de254a9bb678bf3d6131e255', '51cf6e588a3346cdb560fd0c09d49610']"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get(\"dsblank\", \"keras\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Or, using the slash delimiter:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['5dc346a883964bd2b8864c40940fd864', '351afa6e498f452ca743c19d3e131767', '72b89ab961cd42db91535026687f86fb', 'd5d3cf989efd4b5f8841bd64fee5f817', '12ab8382de254a9bb678bf3d6131e255', '51cf6e588a3346cdb560fd0c09d49610']"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get(\"dsblank/keras\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And one more level, get the details of an experiment:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<APIExperiment 'dsblank/keras/51cf6e588a3346cdb560fd0c09d49610'>"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get(\"dsblank\", \"keras\", '51cf6e588a3346cdb560fd0c09d49610')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Or, again using the slash shorthand:"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<APIExperiment 'dsblank/keras/51cf6e588a3346cdb560fd0c09d49610'>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get(\"dsblank/keras/51cf6e588a3346cdb560fd0c09d49610\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's get the experiment and save it to a variable named `exp`:"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"exp = comet_api.get(\"cometpublic/comet-notebooks/d21f94a1c71841d2961da1e6ddb5ab20\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<APIExperiment 'cometpublic/comet-notebooks/d21f94a1c71841d2961da1e6ddb5ab20'>"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exp"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"There are a number of items you get from the APIExperiment instance:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on APIExperiment in module comet_ml.api object:\n",
"\n",
"class APIExperiment(builtins.object)\n",
" | Methods defined here:\n",
" | \n",
" | __init__(self, api, workspace, project, experiment_key)\n",
" | REST API Experiment interface.\n",
" | \n",
" | __repr__(self)\n",
" | Return repr(self).\n",
" | \n",
" | display(self, clear=False, wait=True, new=0, autoraise=True)\n",
" | Show the comet.ml experiment page in an IFrame in a\n",
" | Jupyter notebook or Jupyter lab, OR open a browser\n",
" | window or tab.\n",
" | \n",
" | For Jupyter environments:\n",
" | \n",
" | Args:\n",
" | clear: to clear the output area, use clear=True\n",
" | wait: to wait for the next displayed item, use\n",
" | wait=True (cuts down on flashing)\n",
" | \n",
" | For non-Jupyter environments:\n",
" | \n",
" | Args:\n",
" | new: open a new browser window if new=1, otherwise re-use\n",
" | existing window/tab\n",
" | autoraise: make the browser tab/window active\n",
" | \n",
" | get_asset(self, asset_id)\n",
" | Get an asset from this experiment. Not cached.\n",
" | \n",
" | ----------------------------------------------------------------------\n",
" | Data descriptors defined here:\n",
" | \n",
" | __dict__\n",
" | dictionary for instance variables (if defined)\n",
" | \n",
" | __weakref__\n",
" | list of weak references to the object (if defined)\n",
" | \n",
" | asset_list\n",
" | Get the asssociated asset-list for this experiment. Not cached.\n",
" | \n",
" | code\n",
" | Get the associated source code for this experiment. Not cached.\n",
" | \n",
" | data\n",
" | The experiment data in JSON-like format.\n",
" | \n",
" | existing_experiment\n",
" | Get an ExistingExperiment() object for this\n",
" | experiment.\n",
" | \n",
" | git_metadata\n",
" | Get the asssociated git-metadata for this experiment. Not cached.\n",
" | \n",
" | git_patch\n",
" | Get the asssociated git-patch for this experiment. Not cached.\n",
" | \n",
" | graph\n",
" | Get the associated graph/model description for this\n",
" | experiment. Not cached.\n",
" | \n",
" | html\n",
" | Get the HTML associated with this experiment. Not cached.\n",
" | \n",
" | images\n",
" | Get the associated image data for this experiment. Not cached.\n",
" | \n",
" | The image data comes as a dictionary with the following\n",
" | keys:\n",
" | \n",
" | apiKey\n",
" | runId\n",
" | experimentKey\n",
" | projectId\n",
" | figCounter\n",
" | figName\n",
" | step\n",
" | runContext\n",
" | fileName\n",
" | imagePath\n",
" | \n",
" | installed_packages\n",
" | Get the associated installed packages for this experiment. Not cached.\n",
" | \n",
" | metrics\n",
" | Get the asssociated metrics for this experiment. Not cached.\n",
" | \n",
" | metrics_raw\n",
" | Get the asssociated raw metrics for this experiment. Not cached.\n",
" | \n",
" | os_packages\n",
" | Get the associated installed packages for this experiment. Not cached.\n",
" | \n",
" | other\n",
" | Get the asssociated other items (things logged with `log_other`)\n",
" | for this experiment. Cached.\n",
" | \n",
" | parameters\n",
" | Get the asssociated parameters for this experiment. Not cached.\n",
" | \n",
" | stdout\n",
" | Get the associated standard output for this experiment. Not cached.\n",
"\n"
]
}
],
"source": [
"help(exp)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For example, we can explore the `other` property, which shows items saved with Experiment.log_other(NAME, VALUE):"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'name': 'Name',\n",
" 'valueMax': 'example 001',\n",
" 'valueMin': 'example 001',\n",
" 'valueCurrent': 'example 001',\n",
" 'timestampMax': 1544540174200,\n",
" 'timestampMin': 1544540174200,\n",
" 'timestampCurrent': 1544540174200}]"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exp.other"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this example, we see that the experiment has the `Name` \"example 001\". We can use `Name` to also look up experiments:"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<APIExperiment 'dsblank/keras/example 001'>"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exp = comet_api.get(\"dsblank/keras/example 001\")\n",
"exp"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Perhaps one of the most useful abilities for the REST API is to access your experiment's data in order to create a variation of a plot. To access the raw metric data, use the `.metrics_raw` property of the experiment:"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2040"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(exp.metrics_raw)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Thus, there were 2040 metrics logged during the training of this experiment. We can get the first using indexing with an integer:"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'metricName': 'acc',\n",
" 'metricValue': '0.09166666865348816',\n",
" 'timestamp': 1542738532966,\n",
" 'step': 1,\n",
" 'runContext': None,\n",
" 'offset': 21}"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exp.metrics_raw[0]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"That shows that the \"acc\" (accuracy) metric had a value of about 0.09 at step 1 of the experiment.\n",
"\n",
"We can also use a string as an index to query all of the dictionaries in `metrics_raw` to only give those values at each step, like so:"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"acc_metrics = exp.metrics_raw[\"acc\"]"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"510"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(acc_metrics)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(1, 0.09166666865348816)"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acc_metrics[0]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Therefore, `exp.metrics_raw[\"acc\"]` gives us (step, value) for all \"acc\" items. We can then easily use Python's built in zip and matplotlib to plot these values:"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"steps, acc = zip(*acc_metrics)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8VNX9//HXmSWZ7CF7WEIAwyogEBFRFBUR0WpbrUrVWmtr6/L9Wrv4dWlta/19tbZft2q1VqutbV2qtVIVURFXQBaRfYvsECBsScg+M+f3x713cmdLAiSEO/k8Hw8ezNy5mTl3MnnPmc85547SWiOEECKxuLq7AUIIITqfhLsQQiQgCXchhEhAEu5CCJGAJNyFECIBSbgLIUQCknAXQogEJOEuhBAJSMJdCCESkKe7HjgvL0+XlpZ218MLIYQjLVmyZK/WOr+9/bot3EtLS1m8eHF3PbwQQjiSUmpLR/aTsowQQiQgCXchhEhAEu5CCJGAJNyFECIBSbgLIUQCajfclVJ/VkrtUUqtjHO7Uko9qpSqUEotV0qN7fxmCiGEOBwd6bk/B0xr4/bzgTLz3/XAE0ffLCGEEEej3XDXWn8E7G9jl4uBv2rDAiBbKVXcWQ0U4mgFg5qXFm2lyR/o7qYctTWVNSzYuK9D+67cUc2byyt55L0NrN9dG3V7MKh5edE2GluOzfOyZMt+Vu6ojnt7SyDIS4u2EghqAubvr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HSDhLoQQCUjCXQghEpCEuxBCJCAJdyGESEAS7kIIkYAk3IUQIgFJuAshRAL6/25B+iC0Wu/sAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.plot(steps, acc);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"That's it for a quick overview. Now let's look in detail at each component, and introduce the low-level REST API as well."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Workspaces\n",
"\n",
"By default, comet_api.get() reports only your workspace names:"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['dsblank']"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also interate over those names:"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dsblank\n"
]
}
],
"source": [
"for workspace in comet_api.get():\n",
" print(workspace)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As we saw above, you can also access other public workspaces as well:"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['fasttext', 'comet-notebooks', 'parameter-space-exploration', 'home-credit']"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get(\"cometpublic\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Projects\n",
"\n",
"Under get(WORKSPACE_NAME), you'll find the projects:"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['fasttext', 'comet-notebooks', 'parameter-space-exploration', 'home-credit']"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get(\"cometpublic\")"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"project = comet_api.get(\"cometpublic\", \"comet-notebooks\")\n",
"## OR:\n",
"#project = comet_api.get(\"cometpublic/comet-notebooks\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you just print out, or iterate over a project, you get access to the experiment ids:"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['7092a5e4c362453fb0b3f06785a1d30c', 'example 001']"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"project"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'7092a5e4c362453fb0b3f06785a1d30c'"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"project[0].experiment_key"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'d21f94a1c71841d2961da1e6ddb5ab20'"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"project[1].experiment_key"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"However, you can also access all of the project data via the `.data` property:"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'project_id': '63776506878949eb9ac225a2a24b87f6',\n",
" 'user_name': 'cometpublic',\n",
" 'project_name': 'comet-notebooks',\n",
" 'project_desc': '',\n",
" 'team_id': 'cometpublic-default',\n",
" 'is_owner': False,\n",
" 'is_public': True,\n",
" 'is_shared': False,\n",
" 'num_of_experiments': 2,\n",
" 'last_updated': 1544540181888,\n",
" 'team_name': 'cometpublic',\n",
" 'experiments': {'7092a5e4c362453fb0b3f06785a1d30c': {'code_sha': '0193bacf',\n",
" 'file_name': 'Jupyter interactive',\n",
" 'file_path': 'Jupyter interactive',\n",
" 'duration_millis': 123000,\n",
" 'start_server_timestamp': 1542824533698,\n",
" 'end_server_timestamp': 1542824657041,\n",
" 'has_images': True,\n",
" 'experiment_key': '7092a5e4c362453fb0b3f06785a1d30c',\n",
" 'is_key': True},\n",
" 'd21f94a1c71841d2961da1e6ddb5ab20': {'code_sha': '66e8551f',\n",
" 'file_name': 'Jupyter interactive',\n",
" 'file_path': 'Jupyter interactive',\n",
" 'duration_millis': 1716489000,\n",
" 'start_server_timestamp': 1542823692825,\n",
" 'end_server_timestamp': 1544540181881,\n",
" 'has_images': False,\n",
" 'experiment_key': 'd21f94a1c71841d2961da1e6ddb5ab20',\n",
" 'is_key': True,\n",
" '_other': [{'name': 'Name',\n",
" 'valueMax': 'example 001',\n",
" 'valueMin': 'example 001',\n",
" 'valueCurrent': 'example 001',\n",
" 'timestampMax': 1544540174200,\n",
" 'timestampMin': 1544540174200,\n",
" 'timestampCurrent': 1544540174200}],\n",
" 'other': ['Name'],\n",
" '_name': 'example 001'},\n",
" 'example 001': {'code_sha': '66e8551f',\n",
" 'file_name': 'Jupyter interactive',\n",
" 'file_path': 'Jupyter interactive',\n",
" 'duration_millis': 1716489000,\n",
" 'start_server_timestamp': 1542823692825,\n",
" 'end_server_timestamp': 1544540181881,\n",
" 'has_images': False,\n",
" 'experiment_key': 'd21f94a1c71841d2961da1e6ddb5ab20',\n",
" 'is_key': False,\n",
" '_other': [{'name': 'Name',\n",
" 'valueMax': 'example 001',\n",
" 'valueMin': 'example 001',\n",
" 'valueCurrent': 'example 001',\n",
" 'timestampMax': 1544540174200,\n",
" 'timestampMin': 1544540174200,\n",
" 'timestampCurrent': 1544540174200}],\n",
" 'other': ['Name']}}}"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"project.data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And that's everything there is to a project object:"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on APIExperiments in module comet_ml.api object:\n",
"\n",
"class APIExperiments(builtins.object)\n",
" | Methods defined here:\n",
" | \n",
" | __getitem__(self, item)\n",
" | \n",
" | __init__(self, api, workspace, project)\n",
" | Initialize self. See help(type(self)) for accurate signature.\n",
" | \n",
" | __iter__(self)\n",
" | \n",
" | __len__(self)\n",
" | \n",
" | __repr__(self)\n",
" | Return repr(self).\n",
" | \n",
" | ----------------------------------------------------------------------\n",
" | Data descriptors defined here:\n",
" | \n",
" | __dict__\n",
" | dictionary for instance variables (if defined)\n",
" | \n",
" | __weakref__\n",
" | list of weak references to the object (if defined)\n",
" | \n",
" | data\n",
" | The project data in JSON format.\n",
"\n"
]
}
],
"source": [
"help(project)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Experiments\n",
"\n",
"Continuing with the dictionary-like access, you can see and iterate over the experiment ids:"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['7092a5e4c362453fb0b3f06785a1d30c', 'example 001']"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get(\"cometpublic\", \"comet-notebooks\")"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [],
"source": [
"exp = comet_api.get(\"cometpublic\", \"comet-notebooks\", 'd21f94a1c71841d2961da1e6ddb5ab20')\n",
"## OR\n",
"# exp = comet_api.get(\"cometpublic/comet-notebooks/d21f94a1c71841d2961da1e6ddb5ab20\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Regular Expression Experiment Name Matching\n",
"\n",
"You can also use regular expressions as the name for the experiment:"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<APIExperiment 'cometpublic/comet-notebooks/example 001'>]"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get(\"cometpublic\", \"comet-notebooks\", \"example.*\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Experiment Properties"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"APIExperiments also have a `.data` property:"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'code_sha': '66e8551f',\n",
" 'file_name': 'Jupyter interactive',\n",
" 'file_path': 'Jupyter interactive',\n",
" 'duration_millis': 1716489000,\n",
" 'start_server_timestamp': 1542823692825,\n",
" 'end_server_timestamp': 1544540181881,\n",
" 'has_images': False,\n",
" 'experiment_key': 'd21f94a1c71841d2961da1e6ddb5ab20',\n",
" 'is_key': True,\n",
" '_other': [{'name': 'Name',\n",
" 'valueMax': 'example 001',\n",
" 'valueMin': 'example 001',\n",
" 'valueCurrent': 'example 001',\n",
" 'timestampMax': 1544540174200,\n",
" 'timestampMin': 1544540174200,\n",
" 'timestampCurrent': 1544540174200}],\n",
" 'other': ['Name'],\n",
" '_name': 'example 001',\n",
" 'metrics': ['train_accuracy',\n",
" 'train_curr_epoch',\n",
" 'train_loss',\n",
" 'train_val_loss'],\n",
" 'parameters': ['f']}"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exp.data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this brief dictionary representation, you will see that `other`, `metrics` and `parameters` give a list of names. However, as we saw above, you can get more information through properties of those same names:\n",
"\n",
"names through exp.data[\"properties\"] and more detail at exp.properties:"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'name': 'f',\n",
" 'valueMax': '/run/user/1000/jupyter/kernel-b1c4403c-c673-4e7f-90dc-853616d231e2.json',\n",
" 'valueMin': '/run/user/1000/jupyter/kernel-b1c4403c-c673-4e7f-90dc-853616d231e2.json',\n",
" 'valueCurrent': '/run/user/1000/jupyter/kernel-b1c4403c-c673-4e7f-90dc-853616d231e2.json',\n",
" 'timestampMax': 1542823692798,\n",
" 'timestampMin': 1542823692798,\n",
" 'timestampCurrent': 1542823692798}"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exp.parameters[0]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"names through exp.data[\"other\"] and more detail at exp.other:"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"('Name', 'example 001')"
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exp.other[0][\"name\"], exp.other[0][\"valueCurrent\"]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"names through exp.data[\"metrics\"] and more detail at exp.metrics:"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'name': 'train_accuracy',\n",
" 'valueMax': '0.0',\n",
" 'valueMin': '0.0',\n",
" 'valueCurrent': '0.0',\n",
" 'timestampMax': 1542823699380,\n",
" 'timestampMin': 1542823699380,\n",
" 'timestampCurrent': 1542823704609,\n",
" 'runContextMax': 'train',\n",
" 'runContextMin': 'train',\n",
" 'runContextCurrent': 'train',\n",
" 'stepMax': 1,\n",
" 'stepMin': 1,\n",
" 'stepCurrent': 3},\n",
" {'name': 'train_curr_epoch',\n",
" 'valueMax': '1.0',\n",
" 'valueMin': '0.0',\n",
" 'valueCurrent': '1.0',\n",
" 'timestampMax': 1542823693885,\n",
" 'timestampMin': 1542823693885,\n",
" 'timestampCurrent': 1542823699380,\n",
" 'runContextMax': 'train',\n",
" 'runContextMin': 'train',\n",
" 'runContextCurrent': 'train'},\n",
" {'name': 'train_loss',\n",
" 'valueMax': '2.3872790336608887',\n",
" 'valueMin': '2.3872790336608887',\n",
" 'valueCurrent': '2.3872790336608887',\n",
" 'timestampMax': 1542823695820,\n",
" 'timestampMin': 1542823695820,\n",
" 'timestampCurrent': 1542823695820,\n",
" 'runContextMax': 'train',\n",
" 'runContextMin': 'train',\n",
" 'runContextCurrent': 'train',\n",
" 'stepMax': 0,\n",
" 'stepMin': 0,\n",
" 'stepCurrent': 0},\n",
" {'name': 'train_val_loss',\n",
" 'valueMax': '2.3066751956939697',\n",
" 'valueMin': '2.2724671363830566',\n",
" 'valueCurrent': '2.2724671363830566',\n",
" 'timestampMax': 1542823699379,\n",
" 'timestampMin': 1542823699379,\n",
" 'timestampCurrent': 1542823704609,\n",
" 'runContextMax': 'train',\n",
" 'runContextMin': 'train',\n",
" 'runContextCurrent': 'train',\n",
" 'stepMax': 1,\n",
" 'stepMin': 3,\n",
" 'stepCurrent': 3}]"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exp.metrics"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can see all of the methods and propeties on an experiment instance:"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on APIExperiment in module comet_ml.api object:\n",
"\n",
"class APIExperiment(builtins.object)\n",
" | Methods defined here:\n",
" | \n",
" | __init__(self, api, workspace, project, experiment_key)\n",
" | REST API Experiment interface.\n",
" | \n",
" | __repr__(self)\n",
" | Return repr(self).\n",
" | \n",
" | display(self, clear=False, wait=True, new=0, autoraise=True)\n",
" | Show the comet.ml experiment page in an IFrame in a\n",
" | Jupyter notebook or Jupyter lab, OR open a browser\n",
" | window or tab.\n",
" | \n",
" | For Jupyter environments:\n",
" | \n",
" | Args:\n",
" | clear: to clear the output area, use clear=True\n",
" | wait: to wait for the next displayed item, use\n",
" | wait=True (cuts down on flashing)\n",
" | \n",
" | For non-Jupyter environments:\n",
" | \n",
" | Args:\n",
" | new: open a new browser window if new=1, otherwise re-use\n",
" | existing window/tab\n",
" | autoraise: make the browser tab/window active\n",
" | \n",
" | get_asset(self, asset_id)\n",
" | Get an asset from this experiment. Not cached.\n",
" | \n",
" | ----------------------------------------------------------------------\n",
" | Data descriptors defined here:\n",
" | \n",
" | __dict__\n",
" | dictionary for instance variables (if defined)\n",
" | \n",
" | __weakref__\n",
" | list of weak references to the object (if defined)\n",
" | \n",
" | asset_list\n",
" | Get the asssociated asset-list for this experiment. Not cached.\n",
" | \n",
" | code\n",
" | Get the associated source code for this experiment. Not cached.\n",
" | \n",
" | data\n",
" | The experiment data in JSON-like format.\n",
" | \n",
" | existing_experiment\n",
" | Get an ExistingExperiment() object for this\n",
" | experiment.\n",
" | \n",
" | git_metadata\n",
" | Get the asssociated git-metadata for this experiment. Not cached.\n",
" | \n",
" | git_patch\n",
" | Get the asssociated git-patch for this experiment. Not cached.\n",
" | \n",
" | graph\n",
" | Get the associated graph/model description for this\n",
" | experiment. Not cached.\n",
" | \n",
" | html\n",
" | Get the HTML associated with this experiment. Not cached.\n",
" | \n",
" | images\n",
" | Get the associated image data for this experiment. Not cached.\n",
" | \n",
" | The image data comes as a dictionary with the following\n",
" | keys:\n",
" | \n",
" | apiKey\n",
" | runId\n",
" | experimentKey\n",
" | projectId\n",
" | figCounter\n",
" | figName\n",
" | step\n",
" | runContext\n",
" | fileName\n",
" | imagePath\n",
" | \n",
" | installed_packages\n",
" | Get the associated installed packages for this experiment. Not cached.\n",
" | \n",
" | metrics\n",
" | Get the asssociated metrics for this experiment. Not cached.\n",
" | \n",
" | metrics_raw\n",
" | Get the asssociated raw metrics for this experiment. Not cached.\n",
" | \n",
" | os_packages\n",
" | Get the associated installed packages for this experiment. Not cached.\n",
" | \n",
" | other\n",
" | Get the asssociated other items (things logged with `log_other`)\n",
" | for this experiment. Cached.\n",
" | \n",
" | parameters\n",
" | Get the asssociated parameters for this experiment. Not cached.\n",
" | \n",
" | stdout\n",
" | Get the associated standard output for this experiment. Not cached.\n",
"\n"
]
}
],
"source": [
"help(exp)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For example, just like when creating and logging data, you can also use the `.display()` method to show the Comet.ml page for that experiment right in the notebook:"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"800px\"\n",
" src=\"https://www.comet.ml/cometpublic/comet-notebooks/d21f94a1c71841d2961da1e6ddb5ab20\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x7f50076c7e10>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"exp.display()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can get an existing experiment:"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"COMET INFO: old comet version (1.0.39) detected. current: 1.0.40 please update your comet lib with command: `pip install --no-cache-dir --upgrade comet_ml`\n",
"COMET INFO: Experiment is live on comet.ml https://www.comet.ml/dsblank/chainer/596d91ae1dbc420c9b13a3ced858de3c\n",
"\n"
]
}
],
"source": [
"e = comet_api.get(\"dsblank\", \"chainer\", \"596d91ae1dbc420c9b13a3ced858de3c\")\n",
"ee = e.existing_experiment"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can make changes to the saved data using the existing experiment:\n",
"\n",
"https://www.comet.ml/docs/python-sdk/ExistingExperiment/"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"COMET INFO: Uploading stats to Comet before program termination (may take several seconds)\n",
"COMET INFO: Experiment is live on comet.ml https://www.comet.ml/dsblank/chainer/596d91ae1dbc420c9b13a3ced858de3c\n",
"\n"
]
}
],
"source": [
"ee.end()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Examples\n",
"\n",
"Comet.ml is working on a query API which will allow highly efficient queries of your data. However, you can also write your own query of sorts.\n",
"\n",
"Here is some code that prints out the names of experiments that have associated HTML (this can take a long time if you have many experiments):"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"processing workspace dsblank ...\n",
" processing project pytorch ...\n",
" processing project mnist-001 ...\n",
" processing project visualizations ...\n",
" processing project testing ...\n",
" processing project pypy ...\n",
" processing project tensorflow ...\n",
" processing project chainer ...\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
"found html!\n",
" processing project mnist-014 ...\n",
" processing project optimizer ...\n",
" processing project general ...\n",
" processing project jupyter-experiments ...\n",
" processing project keras ...\n",
" processing project fastai ...\n",
"CPU times: user 2.78 s, sys: 86.7 ms, total: 2.87 s\n",
"Wall time: 17.5 s\n"
]
}
],
"source": [
"%%time\n",
"for workspace in comet_api.get():\n",
" print(\"processing workspace\", workspace, \"...\")\n",
" for project in comet_api.get(workspace):\n",
" print(\" processing project\", project, \"...\")\n",
" for exp_id in comet_api.get(workspace, project):\n",
" exp = comet_api.get(workspace, project, exp_id)\n",
" if exp.html != None:\n",
" print(\"found html!\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here is a function that will find the first experiment that has associated images:"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
"def find_image():\n",
" for workspace in comet_api.get():\n",
" for project in comet_api.get(workspace):\n",
" for exp_id in comet_api.get(workspace, project):\n",
" exp = comet_api.get(workspace, project, exp_id)\n",
" if exp.images != []:\n",
" return exp"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<APIExperiment 'dsblank/pytorch/3b56611892b7447aa8c4486a6eeb27d0'>"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"find_image()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now, we get the experiment API and explore the `.images` property:"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'apiKey': 'x0yluTXX4ysG4z1k0FaTAz3qj',\n",
" 'runId': 'EgBEDhAJMA6OxWXZ1dHv4AkSz',\n",
" 'experimentKey': '3b56611892b7447aa8c4486a6eeb27d0',\n",
" 'projectId': '1f1999d917104dbe8b6a17b2c28c171c',\n",
" 'figCounter': 0,\n",
" 'figName': 'Exponential Slowdown',\n",
" 'step': None,\n",
" 'runContext': None,\n",
" 'fileName': '4ykmnOHJFZkrRD36KDrTXvHJk.svg',\n",
" 'fileSize': 0,\n",
" 'imagePath': 'https://s3.amazonaws.com/comet.ml/4ykmnOHJFZkrRD36KDrTXvHJk.svg',\n",
" 'createdAt': 1542116223922}]"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comet_api.get('dsblank/pytorch/3b56611892b7447aa8c4486a6eeb27d0').images"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can get a URL for the image, and display it in the notebook:"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'https://s3.amazonaws.com/comet.ml/4ykmnOHJFZkrRD36KDrTXvHJk.svg'"
]
},
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"url = comet_api.get('dsblank/pytorch/3b56611892b7447aa8c4486a6eeb27d0').images[0][\"imagePath\"]\n",
"url"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import Image"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<img src=\"https://s3.amazonaws.com/comet.ml/4ykmnOHJFZkrRD36KDrTXvHJk.svg\"/>"
],
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Image(url=url)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now, let's write a short program that will find the run with the best accuracy given a workspace/project string:"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {},
"outputs": [],
"source": [
"def find_best_run(project):\n",
" runs = []\n",
" for exp_id in comet_api.get(project):\n",
" exp = comet_api.get(project, experiment=exp_id)\n",
" accs = [x[\"valueMax\"] for x in exp.metrics if x[\"name\"] == \"acc\"]\n",
" if len(accs) > 0:\n",
" runs.append([float(accs[0]), exp])\n",
" if runs:\n",
" return sorted(runs, key=lambda v: v[0], reverse=True)[0]"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1.0, <APIExperiment 'cometpublic/fasttext/44ea2d68794d4c5e9e18b86c30562bf8'>]"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"find_best_run(\"cometpublic/fasttext\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Can we get all of the `hidden_size` parameter values for the experiments in dsblank/pytorch?"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(<APIExperiment 'dsblank/pytorch/5f540fc7894146f4bbfd21ebe8549fcf'>,\n",
" 'hidden_size',\n",
" 128)"
]
},
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"experiments = [[(exp, \"hidden_size\", int(param[\"valueCurrent\"])) for param in exp.parameters \n",
" if param[\"name\"] == \"hidden_size\"][0] \n",
" for exp in comet_api.get(\"dsblank/pytorch/.*\")]\n",
"experiments[0]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Assets\n",
"\n",
"To get an asset, you need to get the asset_id. You can see all of the assets related to a project using the `APIExperiment.asset_list`:"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {},
"outputs": [],
"source": [
"for exp in comet_api.get('dsblank/visualizations/.*'):\n",
" if exp.asset_list != []:\n",
" print(exp)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"From there, you can use the `APIExperiment.get_asset(asset_id)` method to get the asset."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Low-level API\n",
"\n",
"If you would prefer a more direct, lower-level API, you can also use the following functions from the API() instance. See the full documentation in [REST API](../../rest-api/getting-started/).\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Utility functions\n",
"\n",
"* get_url(version=None)\n",
"* get_url_server(version=None)\n",
"* get_url_end_point(end_point, version=None)\n",
"* get_request(end_point, params)\n",
"* get_version(self)\n",
"\n",
"### Access functions\n",
"* get_workspaces(workspace_name=None)\n",
"* get_projects(workspace)\n",
"* get_experiment_keys(project_id)\n",
"* get_experiment_data(project_id)\n",
"* get_experiment(experiment_key)\n",
"* get_experiment_html(experiment_key)\n",
"* get_experiment_code(experiment_key)\n",
"* get_experiment_stdout(experiment_key)\n",
"* get_experiment_installed_packages(experiment_key)\n",
"* get_experiment_graph(experiment_key)\n",
"* get_experiment_images(experiment_key)\n",
"* get_experiment_parameters(experiment_key, param=None)\n",
"* get_experiment_metrics(experiment_key, metric=None)\n",
"* get_experiment_other(experiment_key, other=None, value=None)\n",
"* get_experiment_metrics_raw(experiment_key, metric=None)\n",
"* get_experiment_asset_list(experiment_key)\n",
"* get_experiment_asset(experiment_key, asset_id)\n",
"* get_experiment_git_patch(experiment_key)\n",
"* get_experiment_git_metadata(experiment_key)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We hope that this gives you some ideas of how you can use the Comet REST API!"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment