From 933232058c4224a0c71f0dbb699015603268e861 Mon Sep 17 00:00:00 2001 From: Seph Mard Date: Wed, 21 Aug 2024 12:05:22 -0400 Subject: [PATCH] chore(reports-api-collab-update) updated the reports api colab for v2 (#568) * Created using Colab * Created using Colab * Created using Colab * Created using Colab * Created using Colab * Created using Colab * Replaced old notebook * Removed outputs, cleaned notebook w/ nb-clean * Ran nb-helpers --------- Co-authored-by: Noah Luna <15202580+ngrayluna@users.noreply.github.com> --- colabs/intro/Report_API_Quickstart.ipynb | 1048 ++++------------------ 1 file changed, 186 insertions(+), 862 deletions(-) diff --git a/colabs/intro/Report_API_Quickstart.ipynb b/colabs/intro/Report_API_Quickstart.ipynb index c0943b73..3942a475 100644 --- a/colabs/intro/Report_API_Quickstart.ipynb +++ b/colabs/intro/Report_API_Quickstart.ipynb @@ -20,20 +20,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## What is the Report API?\n", - "- Programmatically create and modify reports in Python, including support for editing blocks, panels, and runsets.\n", - "- Create report templates to reuse and share with others\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Quick Links\n", - "- [🚀 Quickstart Guide](#quickstart) (~5min)\n", - "- [❓ FAQ](#faq)\n", - "- [📌 Complete Examples](#complete_examples)" + "## 📝 W&B Report API\n", + "Programmatically create, manage, and customize Reports by defining configurations, panel layouts, and runsets with the wandb-workspaces W&B library. Load and modify Reports with URLs, filter and group runs using expressions, and customize run appearances using Report templates.\n", + "\n", + "[wandb-workspaces](https://github.com/wandb/wandb-workspaces) is a Python library for programmatically creating and customizing W&B Workspaces and Reports.\n", + "\n", + "In this tutorial you will see how to use wandb-workspaces to create and customize W&B Reports." ] }, { @@ -42,14 +34,8 @@ "metadata": {}, "outputs": [], "source": [ - "!pip install wandb -qqq" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup" + "#install dependencies\n", + "!pip install wandb wandb-workspaces -qqq" ] }, { @@ -354,7 +340,7 @@ " panels=[\n", " wr.LinePlot(x='Step', y=['val_acc'], smoothing_factor=0.8),\n", " wr.BarPlot(metrics=['acc']),\n", - " wr.MediaBrowser(media_keys='img', num_columns=1),\n", + " wr.MediaBrowser(media_keys=['img'], num_columns=1),\n", " wr.RunComparer(diff_only='split', layout={'w': 24, 'h': 9}),\n", " ]\n", ")\n", @@ -407,63 +393,6 @@ "report.save()" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Customize run sets with grouping, filtering, and ordering\n", - "- Click on the different run sets in the iframe below and see how they are different\n", - "- Grouping: Pass in a list of columns to group by\n", - "- Filtering: Use `set_filters_with_python_expr` and pass in a valid python expression. The syntax is similar to `pandas.DataFrame.query`\n", - "- Ordering: Pass in a list of columns where each value is prefixed with `+` for ascending or `-` for descending." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pg.runsets = [\n", - " wr.Runset(ENTITY, PROJECT, name=\"Grouping\", groupby=[\"encoder\"]),\n", - " wr.Runset(ENTITY, PROJECT, name=\"Filtering\").set_filters_with_python_expr(\"encoder == 'resnet18' and loss < 0.05\"),\n", - " wr.Runset(ENTITY, PROJECT, name=\"Ordering\", order=[\"+momentum\", \"-Name\"]),\n", - "]\n", - "report.save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Customize group colors\n", - "- Pass in a `dict[ordertuple, color]`, where `ordertuple: tuple[runset_name, *groupby_values]`\n", - "- For example:\n", - " - Your runset is named `MyRunset`\n", - " - Your runset groupby is `[\"encoder\", \"optimizer\"]`\n", - " - Then your tuple can be `(\"MyRunset\", \"resnet18\", \"adam\")`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pg.custom_run_colors = {\n", - " ('Grouping', 'resnet50'): 'red',\n", - " ('Grouping', 'resnet18'): 'blue',\n", - " \n", - " # you can do both grouped and ungrouped colors in the same dict\n", - " 'adventurous-aardvark-1': '#e84118',\n", - " 'bountiful-badger-2': '#fbc531',\n", - " 'clairvoyant-chipmunk-3': '#4cd137',\n", - " 'dastardly-duck-4': '#00a8ff',\n", - " 'eloquent-elephant-5': '#9c88ff',\n", - "}\n", - "report.save()" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -471,18 +400,6 @@ "# ❓ FAQ " ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## My chart is not rendering as expected.\n", - "- We try to guess the column type, but sometimes we fail.\n", - "- Try prefixing:\n", - " - `c::` for config values\n", - " - `s::` for summary metrics\n", - " - e.g. if your config value was `optimizer`, try `c::optimizer`" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -519,8 +436,11 @@ "metadata": {}, "outputs": [], "source": [ + "import wandb_workspaces.reports.v2 as wr\n", + "\n", + "\n", "report = wr.Report(\n", - " PROJECT,\n", + " project=PROJECT,\n", " title=\"Resizing panels\",\n", " description=\"Look at this wide parallel coordinates plot!\",\n", " blocks=[\n", @@ -528,20 +448,22 @@ " panels=[\n", " wr.ParallelCoordinatesPlot(\n", " columns=[\n", - " wr.PCColumn(\"Step\"),\n", - " wr.PCColumn(\"c::model\"),\n", - " wr.PCColumn(\"c::optimizer\"),\n", - " wr.PCColumn(\"Step\"),\n", - " wr.PCColumn(\"val_acc\"),\n", - " wr.PCColumn(\"val_loss\"),\n", + " wr.ParallelCoordinatesPlotColumn(metric=\"Step\"),\n", + " wr.ParallelCoordinatesPlotColumn(metric=\"c::model\"),\n", + " wr.ParallelCoordinatesPlotColumn(metric=\"c::optimizer\"),\n", + " wr.ParallelCoordinatesPlotColumn(metric=\"Step\"),\n", + " wr.ParallelCoordinatesPlotColumn(metric=\"val_acc\"),\n", + " wr.ParallelCoordinatesPlotColumn(metric=\"val_loss\"),\n", " ],\n", - " layout={'w': 24, 'h': 9} # change the layout!\n", + " layout=wr.Layout(w=24, h=9) # Adjusting the layout for the plot size\n", " ),\n", " ]\n", " )\n", " ]\n", ")\n", - "report.save()" + "\n", + "\n", + "report.save()\n" ] }, { @@ -559,9 +481,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Panel grid is omitted. See next section for PanelGrid and panels\n", "report = wr.Report(\n", - " PROJECT,\n", + " project=PROJECT,\n", " title='W&B Block Gallery',\n", " description=\"Check out all of the blocks available in W&B\",\n", " blocks=[\n", @@ -569,37 +490,53 @@ " wr.P(text=\"Normal paragraph\"),\n", " wr.H2(text=\"Heading 2\"),\n", " wr.P(\n", - " [\n", + " text=[\n", " \"here is some text, followed by\",\n", - " wr.InlineCode(\"select * from code in line\"),\n", + " wr.InlineCode(text=\"select * from code in line\"),\n", " \"and then latex\",\n", - " wr.InlineLaTeX(\"e=mc^2\"),\n", + " wr.InlineLatex(text=\"e=mc^2\"),\n", " ]\n", " ),\n", " wr.H3(text=\"Heading 3\"),\n", " wr.CodeBlock(\n", - " code=[\"this:\", \"- is\", \"- a\", \"cool:\", \"- yaml\", \"- file\"],\n", + " code=\"this:\\n- is\\n- a\\ncool:\\n- yaml\\n- file\",\n", " language=\"yaml\",\n", " ),\n", - " wr.WeaveBlockSummaryTable(ENTITY, PROJECT, 'my-table'),\n", - " wr.WeaveBlockArtifact(ENTITY, LINEAGE_PROJECT, 'model-1', 'lineage'),\n", - " wr.WeaveBlockArtifactVersionedFile(ENTITY, LINEAGE_PROJECT, 'model-1', 'v0', \"dataframe.table.json\"),\n", + " wr.WeaveBlockSummaryTable(\n", + " entity=ENTITY,\n", + " project=PROJECT,\n", + " table_name='my-table'\n", + " ),\n", + " wr.WeaveBlockArtifact(\n", + " entity=ENTITY,\n", + " project=LINEAGE_PROJECT,\n", + " artifact='model-1',\n", + " tab='lineage'\n", + " ),\n", + " wr.WeaveBlockArtifactVersionedFile(\n", + " entity=ENTITY,\n", + " project=LINEAGE_PROJECT,\n", + " artifact='model-1',\n", + " version='v0',\n", + " file=\"dataframe.table.json\"\n", + " ),\n", " wr.MarkdownBlock(text=\"Markdown cell with *italics* and **bold** and $e=mc^2$\"),\n", - " wr.LaTeXBlock(text=\"\\\\gamma^2+\\\\theta^2=\\\\omega^2\\n\\\\\\\\ a^2 + b^2 = c^2\"),\n", - " wr.Image(\"https://api.wandb.ai/files/megatruong/images/projects/918598/350382db.gif\", caption=\"It's a me, Pikachu\"),\n", + " wr.LatexBlock(text=\"\\\\gamma^2+\\\\theta^2=\\\\omega^2\\n\\\\\\\\ a^2 + b^2 = c^2\"),\n", + " wr.Image(url=\"https://api.wandb.ai/files/megatruong/images/projects/918598/350382db.gif\", caption=\"It's a me, Pikachu\"),\n", " wr.UnorderedList(items=[\"Bullet 1\", \"Bullet 2\"]),\n", " wr.OrderedList(items=[\"Ordered 1\", \"Ordered 2\"]),\n", - " wr.CheckedList(items=[\"Unchecked\", \"Checked\"], checked=[False, True]),\n", + " wr.CheckedList(items=[\n", + " wr.CheckedListItem(text=\"Unchecked\", checked=False),\n", + " wr.CheckedListItem(text=\"Checked\", checked=True)\n", + " ]),\n", " wr.BlockQuote(text=\"Block Quote 1\\nBlock Quote 2\\nBlock Quote 3\"),\n", - " wr.CalloutBlock(text=[\"Callout 1\", \"Callout 2\", \"Callout 3\"]),\n", + " wr.CalloutBlock(text=\"Callout 1\\nCallout 2\\nCallout 3\"),\n", " wr.HorizontalRule(),\n", " wr.Video(url=\"https://www.youtube.com/embed/6riDJMI-Y8U\"),\n", - " wr.Spotify(spotify_id=\"5cfUlsdrdUE4dLMK7R9CFd\"),\n", - " wr.SoundCloud(url=\"https://api.soundcloud.com/tracks/1076901103\"),\n", " ]\n", - ").save()\n", - "report.blocks += [wr.Gallery(ids=[report.id])] # get report id on save\n", - "report.save()" + ")\n", + "\n", + "report.save()\n" ] }, { @@ -618,6 +555,8 @@ "metadata": {}, "outputs": [], "source": [ + "import wandb_workspaces.reports.v2 as wr\n", + "\n", "report = wr.Report(\n", " project=PROJECT,\n", " title='W&B Panel Gallery',\n", @@ -630,17 +569,18 @@ " wr.Runset(),\n", " ],\n", " panels=[\n", - " wr.MediaBrowser(media_keys=\"img\"),\n", - " wr.MarkdownPanel(\"Hello *italic* **bold** $e=mc^2$ `something`\"),\n", - " \n", - " # LinePlot showed with many settings enabled for example\n", + " wr.MediaBrowser(media_keys=[\"img\"]),\n", + " wr.MarkdownPanel(markdown=\"Hello *italic* **bold** $e=mc^2$ `something`\"),\n", + "\n", + " # LinePlot with various settings enabled\n", " wr.LinePlot(\n", " title=\"Validation Accuracy over Time\",\n", " x=\"Step\",\n", " y=[\"val_acc\"],\n", - " range_x=[0, 1000],\n", - " range_y=[1, 4],\n", + " range_x=(0, 1000),\n", + " range_y=(1, 4),\n", " log_x=True,\n", + " log_y=False,\n", " title_x=\"Training steps\",\n", " title_y=\"Validation Accuracy\",\n", " ignore_outliers=True,\n", @@ -670,9 +610,8 @@ " title=\"Validation Loss by Encoder\",\n", " metrics=[\"val_loss\"],\n", " orientation='h',\n", - " range_x=[0, 0.11],\n", + " range_x=(0, 0.11),\n", " title_x=\"Validation Loss\",\n", - " # title_y=\"y axis title\",\n", " groupby='encoder',\n", " groupby_aggfunc=\"median\",\n", " groupby_rangefunc=\"stddev\",\n", @@ -690,46 +629,44 @@ " wr.CodeComparer(diff=\"split\"),\n", " wr.ParallelCoordinatesPlot(\n", " columns=[\n", - " wr.PCColumn(\"Step\"),\n", - " wr.PCColumn(\"c::model\"),\n", - " wr.PCColumn(\"c::optimizer\"),\n", - " wr.PCColumn(\"Step\"),\n", - " wr.PCColumn(\"val_acc\"),\n", - " wr.PCColumn(\"val_loss\"),\n", + " wr.ParallelCoordinatesPlotColumn(\"Step\"),\n", + " wr.ParallelCoordinatesPlotColumn(\"c::model\"),\n", + " wr.ParallelCoordinatesPlotColumn(\"c::optimizer\"),\n", + " wr.ParallelCoordinatesPlotColumn(\"val_acc\"),\n", + " wr.ParallelCoordinatesPlotColumn(\"val_loss\"),\n", " ],\n", " ),\n", " wr.ParameterImportancePlot(with_respect_to=\"val_loss\"),\n", - " wr.RunComparer(diff_only=\"split\"),\n", + " wr.RunComparer(diff_only=True),\n", " wr.CustomChart(\n", " query={'summary': ['val_loss', 'val_acc']},\n", " chart_name='wandb/scatter/v0',\n", " chart_fields={'x': 'val_loss', 'y': 'val_acc'}\n", " ),\n", - " wr.WeavePanelSummaryTable(\"my-table\"),\n", - " wr.WeavePanelArtifact('model-1', 'lineage', layout={'w': 24, 'h': 12}),\n", - " wr.WeavePanelArtifactVersionedFile('model-1', 'v0', \"dataframe.table.json\", layout={'w': 24, 'h': 12}),\n", " ],\n", " ),\n", + " # Add WeaveBlock types directly to the blocks list\n", + " wr.WeaveBlockSummaryTable(\n", + " entity=\"your_entity\",\n", + " project=\"your_project\",\n", + " table_name=\"my-table\"\n", + " ),\n", + " wr.WeaveBlockArtifact(\n", + " entity=\"your_entity\",\n", + " project=\"your_project\",\n", + " artifact='model-1',\n", + " tab='lineage'\n", + " ),\n", + " wr.WeaveBlockArtifactVersionedFile(\n", + " entity=\"your_entity\",\n", + " project=\"your_project\",\n", + " artifact='model-1',\n", + " version='v0',\n", + " file=\"dataframe.table.json\"\n", + " ),\n", " ]\n", ")\n", - "report.save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## What above weave?\n", - "- A limited subset of weave panels are available today, including Artifact, ArtifactVersionedFile, and SummaryTable\n", - "- Stay tuned for future updates around weave support!" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Can I use this in CI (e.g. create a report for each git commit?)\n", - "- Yep! Check out [this example](https://github.com/andrewtruong/wandb-gh-actions/actions/runs/3476558992) which creates a report via Github Actions" + "report.save()\n" ] }, { @@ -746,55 +683,106 @@ "metadata": {}, "outputs": [], "source": [ + "import wandb_workspaces.reports.v2 as wr\n", + "\n", "report1 = wr.Report(\n", - " PROJECT,\n", + " project=PROJECT,\n", " title='Report 1',\n", " description=\"Great content coming from Report 1\",\n", " blocks=[\n", - " wr.H1('Heading from Report 1'),\n", - " wr.P('Lorem ipsum dolor sit amet. Aut fuga minus nam vero saepeA aperiam eum omnis dolorum et ducimus tempore aut illum quis aut alias vero. Sed explicabo illum est eius quianon vitae sed voluptatem incidunt. Vel architecto assumenda Ad voluptatem quo dicta provident et velit officia. Aut galisum inventoreSed dolore a illum adipisci a aliquam quidem sit corporis quia cum magnam similique.'),\n", + " wr.H1(text='Heading from Report 1'),\n", + " wr.P(text='Lorem ipsum dolor sit amet. Aut fuga minus nam vero saepeA aperiam eum omnis dolorum et ducimus tempore aut illum quis aut alias vero. Sed explicabo illum est eius quianon vitae sed voluptatem incidunt. Vel architecto assumenda Ad voluptatem quo dicta provident et velit officia. Aut galisum inventoreSed dolore a illum adipisci a aliquam quidem sit corporis quia cum magnam similique.'),\n", " wr.PanelGrid(\n", " panels=[\n", - " wr.LinePlot(x='global_step', y=['charts/episodic_return'], smoothing_factor=0.85, groupby_aggfunc='mean', groupby_rangefunc='minmax', layout={'x': 0, 'y': 0, 'w': 12, 'h': 8}),\n", - " wr.MediaBrowser(media_keys=\"videos\", num_columns=4, layout={'w': 12, 'h': 8}),\n", + " wr.LinePlot(\n", + " title=\"Episodic Return\",\n", + " x='global_step',\n", + " y=['charts/episodic_return'],\n", + " smoothing_factor=0.85,\n", + " groupby_aggfunc='mean',\n", + " groupby_rangefunc='minmax',\n", + " layout=wr.Layout(x=0, y=0, w=12, h=8)\n", + " ),\n", + " wr.MediaBrowser(\n", + " media_keys=[\"videos\"],\n", + " num_columns=4,\n", + " layout=wr.Layout(w=12, h=8)\n", + " ),\n", " ],\n", " runsets=[\n", - " wr.Runset(entity='openrlbenchmark', project='cleanrl', query='bigfish', groupby=['env_id', 'exp_name'])\n", + " wr.Runset(\n", + " entity='openrlbenchmark',\n", + " project='cleanrl',\n", + " query='bigfish',\n", + " groupby=['env_id', 'exp_name']\n", + " )\n", " ],\n", " custom_run_colors={\n", - " ('Run set', 'bigfish', 'ppg_procgen'): \"#2980b9\",\n", - " ('Run set', 'bigfish', 'ppo_procgen'): \"#e74c3c\",\n", + " wr.RunsetGroup(runset_name='Run set', keys=(wr.RunsetGroupKey(key='bigfish', value='ppg_procgen'),)): \"#2980b9\",\n", + " wr.RunsetGroup(runset_name='Run set', keys=(wr.RunsetGroupKey(key='bigfish', value='ppo_procgen'),)): \"#e74c3c\",\n", " }\n", " ),\n", " ]\n", - ").save()\n", + ")\n", + "report1.save()\n", "\n", "report2 = wr.Report(\n", - " PROJECT,\n", + " project=PROJECT,\n", " title='Report 2',\n", " description=\"Great content coming from Report 2\",\n", " blocks=[\n", - " wr.H1('Heading from Report 2'),\n", - " wr.P('Est quod ducimus ut distinctio corruptiid optio qui cupiditate quibusdam ea corporis modi. Eum architecto vero sed error dignissimosEa repudiandae a recusandae sint ut sint molestiae ea pariatur quae. In pariatur voluptas ad facere neque 33 suscipit et odit nostrum ut internos molestiae est modi enim. Et rerum inventoreAut internos et dolores delectus aut Quis sunt sed nostrum magnam ab dolores dicta.'),\n", + " wr.H1(text='Heading from Report 2'),\n", + " wr.P(text='Est quod ducimus ut distinctio corruptiid optio qui cupiditate quibusdam ea corporis modi. Eum architecto vero sed error dignissimosEa repudiandae a recusandae sint ut sint molestiae ea pariatur quae. In pariatur voluptas ad facere neque 33 suscipit et odit nostrum ut internos molestiae est modi enim. Et rerum inventoreAut internos et dolores delectus aut Quis sunt sed nostrum magnam ab dolores dicta.'),\n", " wr.PanelGrid(\n", " panels=[\n", - " wr.LinePlot(x='global_step', y=['charts/SPS']),\n", - " wr.LinePlot(x='global_step', y=['charts/episodic_length']),\n", - " wr.LinePlot(x='global_step', y=['charts/episodic_return']),\n", + " wr.LinePlot(\n", + " title=\"SPS\",\n", + " x='global_step',\n", + " y=['charts/SPS']\n", + " ),\n", + " wr.LinePlot(\n", + " title=\"Episodic Length\",\n", + " x='global_step',\n", + " y=['charts/episodic_length']\n", + " ),\n", + " wr.LinePlot(\n", + " title=\"Episodic Return\",\n", + " x='global_step',\n", + " y=['charts/episodic_return']\n", + " ),\n", " ],\n", " runsets=[\n", - " wr.Runset(\"openrlbenchmark\", \"cleanrl\", \"DQN\", groupby=[\"exp_name\"]).set_filters_with_python_expr(\"env_id == 'BreakoutNoFrameskip-v4' and exp_name == 'dqn_atari'\"),\n", - " wr.Runset(\"openrlbenchmark\", \"cleanrl\", \"SAC-discrete 0.8\", groupby=[\"exp_name\"]).set_filters_with_python_expr(\"env_id == 'BreakoutNoFrameskip-v4' and exp_name == 'sac_atari' and target_entropy_scale == 0.8\"),\n", - " wr.Runset(\"openrlbenchmark\", \"cleanrl\", \"SAC-discrete 0.88\", groupby=[\"exp_name\"]).set_filters_with_python_expr(\"env_id == 'BreakoutNoFrameskip-v4' and exp_name == 'sac_atari' and target_entropy_scale == 0.88\"),\n", + " wr.Runset(\n", + " entity=\"openrlbenchmark\",\n", + " project=\"cleanrl\",\n", + " name=\"DQN\",\n", + " groupby=[\"exp_name\"]\n", + "\n", + " ),\n", + " wr.Runset(\n", + " entity=\"openrlbenchmark\",\n", + " project=\"cleanrl\",\n", + " name=\"SAC-discrete 0.8\",\n", + " groupby=[\"exp_name\"]\n", + "\n", + " ),\n", + " wr.Runset(\n", + " entity=\"openrlbenchmark\",\n", + " project=\"cleanrl\",\n", + " name=\"SAC-discrete 0.88\",\n", + " groupby=[\"exp_name\"]\n", + "\n", + " ),\n", " ],\n", " custom_run_colors={\n", - " ('DQN', 'dqn_atari'): '#e84118',\n", - " ('SAC-discrete 0.8', 'sac_atari'): '#fbc531',\n", - " ('SAC-discrete 0.88', 'sac_atari'): '#00a8ff',\n", + " wr.RunsetGroup(runset_name='DQN', keys=(wr.RunsetGroupKey(key='dqn_atari', value='exp_name'),)): '#e84118',\n", + " wr.RunsetGroup(runset_name='SAC-discrete 0.8', keys=(wr.RunsetGroupKey(key='sac_atari', value='exp_name'),)): '#fbc531',\n", + " wr.RunsetGroup(runset_name='SAC-discrete 0.88', keys=(wr.RunsetGroupKey(key='sac_atari', value='exp_name'),)): '#00a8ff',\n", " }\n", " ),\n", " ]\n", - ").save()" + ")\n", + "report2.save()\n" ] }, { @@ -845,172 +833,15 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Reference the two reports in a gallery block" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report4 = wr.Report(\n", - " PROJECT,\n", - " title=\"Referenced reports via Gallery\",\n", - " description=\"This report has gallery links to Report1 and Report 2\",\n", - " blocks=[wr.Gallery(ids=[report1.id, report2.id])]\n", - ")\n", - "report4.save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## How do I add links to text?\n", - "- Use `wr.Link`" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Do you support markdown?\n", - "Yep\n", - "- In blocks, use `wr.MarkdownBlock`\n", - "- In panels, use `wr.MarkdownPanel`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "markdown = \"\"\"\n", - "# Ducat quicquam\n", - "\n", - "## Egit sit utque torta cuncta si oret\n", - "\n", - "Lorem markdownum voco sacrorum religata. Erat ante condita mellaque Cimmerios\n", - "cultoribus pictas manu usquam illa umbra potentia inpedienda Padumque [euntes\n", - "motae](http://nec.com/necsollemnia.aspx), detraxit! Accessus discrimen,\n", - "Cyllenius *e* solum saepe terras perfringit amorem tenent consulit falce\n", - "referemus tantum. Illo qui attonitas, Adonis ultra stabunt horret requiescere\n", - "quae deam similis miserum consuetas: tantos aegram, metuam. Tetigere\n", - "**invidiae** preces indicere populo semper, limine sui dumque, lustra\n", - "alimentaque vidi nec corpusque aquarum habebat, in.\n", - "\n", - "\n", - "## Aurea simile iunctoque dux semper verbis\n", - "\n", - "Vinctorum vidisset et caede officio, viae alia ratione aer regalia, etiamnum.\n", - "Occupat tanta; vicem, Ithaceque, et ille nec exclamat. Honori carpserat visae\n", - "magniloquo perluitur corpora tamen. Caput an Minervae sed vela est cecidere\n", - "luctus umbras iunctisque referat. Accensis **aderis capillos** pendebant\n", - "[retentas parvum](http://ipse.com/).\n", - "\n", - " if (desktop(2)) {\n", - " laser_qwerty_optical.webcam += upsRoom + window;\n", - " }\n", - " if (type) {\n", - " memoryGrayscale(backbone, mask_multimedia_html);\n", - " }\n", - " if (natInterfaceFile == 23 + 92) {\n", - " interface_sku.platform = compressionMotherboard - error_veronica_ata;\n", - " dsl_windows = 57 * -2;\n", - " definition *= -4;\n", - " } else {\n", - " frame(4, market_chip_irq, megapixel_eide);\n", - " }\n", - " if (mashupApiFlash(-1, margin) - graphicSoftwareNas.ddr_samba_reimage(port)\n", - " != control_navigation_pseudocode(yahoo.microcomputerDimm(\n", - " mips_adsl))) {\n", - " postscriptViralDirectx(1, cron_router_voip(669103, managementPitch,\n", - " ospf_up_paper), frame);\n", - " servlet_cross_paper.controlLanguage(insertion_source.viewHorizontalRead(\n", - " enterprise, widget, parse_encoding), end);\n", - " script_e(rateRss(yobibyte, fddi, vci_hyper_joystick), surgeHeat / case);\n", - " }\n", - " pcmciaRealSystem.basic_exbibyte_controller = carrier.domainDesktop(-4 +\n", - " laptop + 5);\n", - "\"\"\"\n", + "## I tried mutating an object in list but it didn't work!\n", + "tl;dr: It should always work if you assign a value to the attribute instead of mutating. If you really need to mutate, do it before assignment.\n", "\n", - "report = wr.Report(\n", - " PROJECT,\n", - " title=\"Report with markdown\",\n", - " description=\"See what's possible with MarkdownBlock and MarkdownPanel\",\n", - " blocks=[\n", - " wr.MarkdownBlock(markdown),\n", - " wr.PanelGrid(\n", - " panels=[\n", - " wr.MarkdownPanel(markdown, layout={'w': 12, 'h': 18}),\n", - " wr.LinePlot(x='Step', y=['val_acc'] , layout={'x': 12, 'y': 0}),\n", - " wr.LinePlot(x='Step', y=['val_loss'], layout={'x': 12, 'y': 6}),\n", - " wr.ScatterPlot(x='val_loss', y='val_acc', layout={'x': 12, 'y': 12}),\n", - " ]\n", - " )\n", - " ]\n", - ")\n", - "report.save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Can I build the report up from smaller pieces / all at once?\n", - "Yep. We'll demonstrate by putting together a report with a parallel coordinates plot.\n", + "---\n", "\n", - "NOTE: this section assumes you have run the [sweeps notebook](https://colab.research.google.com/github/wandb/examples/blob/master/colabs/pytorch/Organizing_Hyperparameter_Sweeps_in_PyTorch_with_W%26B.ipynb) already." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Build it up incrementally\n", - "As you might do if you were creating a report in the UI" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "1. Create a report" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report = wr.Report(project=PROJECT, title='Parallel Coordinates Example', description=\"Using the pytorch sweeps demo\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "2. Add a panel grid" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pg = wr.PanelGrid()\n", - "report.blocks = [pg]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "3. Specify your runsets" + "This can happen in a few places that contain lists of wandb objects, e.g.:\n", + "- `report.blocks`\n", + "- `panel_grid.panels`\n", + "- `panel_grid.runsets`" ] }, { @@ -1019,14 +850,14 @@ "metadata": {}, "outputs": [], "source": [ - "pg.runsets = [wr.Runset(project='pytorch-sweeps-demo')]" + "report = wr.Report(project=PROJECT)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "4. Specify your panels" + "Good: Assign `b`" ] }, { @@ -1035,26 +866,17 @@ "metadata": {}, "outputs": [], "source": [ - "pg.panels = [\n", - " wr.ParallelCoordinatesPlot(\n", - " columns=[\n", - " wr.PCColumn(metric=\"c::batch_size\"),\n", - " wr.PCColumn(metric=\"c::dropout\"),\n", - " wr.PCColumn(metric=\"c::epochs\"),\n", - " wr.PCColumn(metric=\"c::fc_layer_size\"),\n", - " wr.PCColumn(metric=\"c::learning_rate\"),\n", - " wr.PCColumn(metric=\"c::optimizer\"),\n", - " wr.PCColumn(metric=\"loss\"),\n", - " ]\n", - " )\n", - "]\n" + "b = wr.H1(text=[\"Hello\", \" World!\"])\n", + "report.blocks = [b]\n", + "assert b.text == [\"Hello\", \" World!\"]\n", + "assert report.blocks[0].text == [\"Hello\", \" World!\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "5. Save the report" + "Bad: Mutate `b` without reassigning" ] }, { @@ -1063,122 +885,18 @@ "metadata": {}, "outputs": [], "source": [ - "report.save()" + "b.text = [\"Something\", \" New\"]\n", + "assert b.text == [\"Something\", \" New\"]\n", + "assert report.blocks[0].text == [\"Hello\", \" World!\"]\n", + "\n", + "# This will error!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### The same thing all-in-one" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report = wr.Report(\n", - " project=PROJECT,\n", - " title=\"Parallel Coordinates Example (all-in-one)\",\n", - " description=\"Using the pytorch sweeps demo (same as the other one but written in one expression)\",\n", - " blocks=[\n", - " wr.PanelGrid(\n", - " runsets=[wr.Runset(project=\"pytorch-sweeps-demo\")],\n", - " panels=[\n", - " wr.ParallelCoordinatesPlot(\n", - " columns=[\n", - " wr.PCColumn(metric='c::batch_size'),\n", - " wr.PCColumn(metric='c::dropout'),\n", - " wr.PCColumn(metric='c::epochs'),\n", - " wr.PCColumn(metric='c::fc_layer_size'),\n", - " wr.PCColumn(metric='c::learning_rate'),\n", - " wr.PCColumn(metric='c::optimizer'),\n", - " wr.PCColumn(metric='loss'),\n", - " ]\n", - " )\n", - " ],\n", - " )\n", - " ],\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report.save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## I tried mutating an object in list but it didn't work!\n", - "tl;dr: It should always work if you assign a value to the attribute instead of mutating. If you really need to mutate, do it before assignment.\n", - "\n", - "---\n", - "\n", - "This can happen in a few places that contain lists of wandb objects, e.g.:\n", - "- `report.blocks`\n", - "- `panel_grid.panels`\n", - "- `panel_grid.runsets`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report = wr.Report(project=PROJECT)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Good: Assign `b`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b = wr.H1(text=[\"Hello\", \" World!\"])\n", - "report.blocks = [b]\n", - "assert b.text == [\"Hello\", \" World!\"]\n", - "assert report.blocks[0].text == [\"Hello\", \" World!\"]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Bad: Mutate `b` without reassigning" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.text = [\"Something\", \" New\"]\n", - "assert b.text == [\"Something\", \" New\"]\n", - "assert report.blocks[0].text == [\"Hello\", \" World!\"]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Good: Mutate `b` and then reassign it" + "Good: Mutate `b` and then reassign it" ] }, { @@ -1191,400 +909,6 @@ "assert b.text == [\"Something\", \" New\"]\n", "assert report.blocks[0].text == [\"Something\", \" New\"]" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## How do I show tables?" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report = wr.Report(project=PROJECT, title='Adding tables to reports', description=\"Add tables with WeaveBlockSummaryTable or WeavePanelSummaryTable\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Using weave blocks" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report.blocks += [wr.WeaveBlockSummaryTable(ENTITY, PROJECT, \"my-table\")]\n", - "report.save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Using weave panels (via PanelGrid)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report.blocks += [\n", - " wr.PanelGrid(\n", - " panels=[wr.WeavePanelSummaryTable(\"my-table\")]\n", - " )\n", - "]\n", - "report.save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## How do I show artifact lineage / versions?" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report = wr.Report(project=PROJECT, title='Adding artifact lineage to reports', description=\"via WeaveBlockArtifact, WeaveBlockArtifactVersionedFile, or their panel equivalents\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Using weave blocks" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report.blocks += [\n", - " wr.WeaveBlockArtifact(ENTITY, LINEAGE_PROJECT, \"model-1\", \"lineage\"),\n", - " wr.WeaveBlockArtifactVersionedFile(ENTITY, LINEAGE_PROJECT, \"model-1\", \"v0\", \"dataframe.table.json\")\n", - "]\n", - "report.save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Using weave panels (via PanelGrid)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report.blocks += [\n", - " wr.PanelGrid(panels=[\n", - " wr.WeavePanelArtifact(\"\", \"lineage\"),\n", - " wr.WeavePanelArtifactVersionedFile(\"\", \"v0\", \"dataframe.table.json\")\n", - " ])\n", - "]\n", - "report.save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## How can I create report templates?\n", - "- See some of the examples in `wr.templates`\n", - "- The most straightforward way is to create a function that returns your target report and/or its blocks." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### A basic template\n", - "- Just use a function" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "def my_report_template(title, description, project, metric):\n", - " return wr.Report(\n", - " title=title,\n", - " description=description,\n", - " project=project,\n", - " blocks=[\n", - " wr.H1(f\"Look at our amazing metric called `{metric}`\"),\n", - " wr.PanelGrid(\n", - " panels=[wr.LinePlot(x='Step', y=metric, layout={'w': 24, 'h': 8})],\n", - " )\n", - " ]\n", - " ).save()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "my_report_template('My templated report', \"Here's an example of how you can make a function for templates\", PROJECT, 'val_acc')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### More advanced templates" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "def create_header():\n", - " return [\n", - " wr.P(),\n", - " wr.HorizontalRule(),\n", - " wr.P(),\n", - " wr.Image(\n", - " \"https://camo.githubusercontent.com/83839f20c90facc062330f8fee5a7ab910fdd04b80b4c4c7e89d6d8137543540/68747470733a2f2f692e696d6775722e636f6d2f676236423469672e706e67\"\n", - " ),\n", - " wr.P(),\n", - " wr.HorizontalRule(),\n", - " wr.P(),\n", - " ]\n", - "\n", - "def create_footer():\n", - " return [\n", - " wr.P(),\n", - " wr.HorizontalRule(),\n", - " wr.P(),\n", - " wr.H1(\"Disclaimer\"),\n", - " wr.P(\n", - " \"The views and opinions expressed in this report are those of the authors and do not necessarily reflect the official policy or position of Weights & Biases. blah blah blah blah blah boring text at the bottom\"\n", - " ),\n", - " wr.P(),\n", - " wr.HorizontalRule(),\n", - " ]\n", - "\n", - "def create_main_content(metric):\n", - " return [\n", - " wr.H1(f\"Look at our amazing metric called `{metric}`\"),\n", - " wr.PanelGrid(\n", - " panels=[wr.LinePlot(x='Step', y=metric, layout={'w': 24, 'h': 8})],\n", - " )\n", - " ]\n", - "\n", - "def create_templated_report_with_header_and_footer(title, project, metric):\n", - " return wr.Report(\n", - " title=title,\n", - " project=project,\n", - " blocks=[\n", - " *create_header(),\n", - " *create_main_content(metric),\n", - " *create_footer(),\n", - " ]).save()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "create_templated_report_with_header_and_footer(title=\"Another templated report\", project=PROJECT, metric='val_acc')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 📌 Complete Examples " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Reinforcement Learning (RL)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "wr.Report(\n", - " project=PROJECT,\n", - " title='Reinforcement Learning Report',\n", - " description='Aut totam dolores aut galisum atque aut placeat quia. Vel quisquam omnis ut quibusdam doloremque a delectus quia in omnis deserunt. Quo ipsum beatae aut veniam earum non ipsa reiciendis et fugiat asperiores est veritatis magni et corrupti internos. Ut quis libero ut alias reiciendis et animi delectus.',\n", - " blocks=[\n", - " wr.TableOfContents(),\n", - " wr.H1(\"Ea quidem illo est dolorem illo.\"),\n", - " wr.P(\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ac eros ut nunc venenatis tincidunt vel ut dolor. Sed sed felis dictum, congue risus vel, aliquet dolor. Donec ut risus vel leo dictum tristique. Nunc sed urna mi. Morbi nulla turpis, vehicula eu maximus ut, gravida id libero. Duis porta risus leo, quis lobortis enim ultrices a. Donec quam augue, vestibulum vitae mollis at, tincidunt non orci. Morbi faucibus dignissim tempor. Vestibulum ornare augue a orci tincidunt porta. Pellentesque et ante et purus gravida euismod. Maecenas sit amet sollicitudin felis, sed egestas nunc.\"),\n", - " wr.H2('Et sunt sunt eum asperiores ratione.'),\n", - " wr.PanelGrid(\n", - " panels=[\n", - " wr.LinePlot(x='global_step', y=['charts/episodic_return'], smoothing_factor=0.85, groupby_aggfunc='mean', groupby_rangefunc='minmax', layout={'x': 0, 'y': 0, 'w': 12, 'h': 8}),\n", - " wr.MediaBrowser(media_keys=\"videos\", num_columns=4, layout={'w': 12, 'h': 8}),\n", - " ],\n", - " runsets=[\n", - " wr.Runset(entity='openrlbenchmark', project='cleanrl', query='bigfish', groupby=['env_id', 'exp_name'])\n", - " ],\n", - " custom_run_colors={\n", - " ('Run set', 'bigfish', 'ppg_procgen'): \"#2980b9\",\n", - " ('Run set', 'bigfish', 'ppo_procgen'): \"#e74c3c\",\n", - " }\n", - " ),\n", - " wr.H2('Sit officia inventore non omnis deleniti.'),\n", - " wr.PanelGrid(\n", - " panels=[\n", - " wr.LinePlot(x='global_step', y=['charts/episodic_return'], smoothing_factor=0.85, groupby_aggfunc='mean', groupby_rangefunc='minmax', layout={'x': 0, 'y': 0, 'w': 12, 'h': 8}),\n", - " wr.MediaBrowser(media_keys=\"videos\", num_columns=4, layout={'w': 12, 'h': 8}),\n", - " ],\n", - " runsets=[\n", - " wr.Runset(entity='openrlbenchmark', project='cleanrl', query='starpilot', groupby=['env_id', 'exp_name'])\n", - " ],\n", - " custom_run_colors={\n", - " ('Run set', 'starpilot', 'ppg_procgen'): \"#2980b9\",\n", - " ('Run set', 'starpilot', 'ppo_procgen'): \"#e74c3c\",\n", - " }\n", - " ),\n", - " wr.H2('Aut amet nesciunt vel quisquam repellendus sed labore voluptas.'),\n", - " wr.PanelGrid(\n", - " panels=[\n", - " wr.LinePlot(x='global_step', y=['charts/episodic_return'], smoothing_factor=0.85, groupby_aggfunc='mean', groupby_rangefunc='minmax', layout={'x': 0, 'y': 0, 'w': 12, 'h': 8}),\n", - " wr.MediaBrowser(media_keys=\"videos\", num_columns=4, layout={'x': 0, 'y': 0, 'w': 12, 'h': 8}),\n", - " ],\n", - " runsets=[\n", - " wr.Runset(entity='openrlbenchmark', project='cleanrl', query='bossfight', groupby=['env_id', 'exp_name'])\n", - " ],\n", - " custom_run_colors={\n", - " ('Run set', 'bossfight', 'ppg_procgen'): \"#2980b9\",\n", - " ('Run set', 'bossfight', 'ppo_procgen'): \"#e74c3c\",\n", - " }\n", - " ),\n", - " wr.HorizontalRule(),\n", - " wr.H1(\"Sed consectetur vero et voluptas voluptatem et adipisci blanditiis.\"),\n", - " wr.P(\"Sit aliquid repellendus et numquam provident quo quaerat earum 33 sunt illo et quos voluptate est officia deleniti. Vel architecto nulla ex nulla voluptatibus qui saepe officiis quo illo excepturi ea dolorum reprehenderit.\"),\n", - " wr.H2(\"Qui debitis iure 33 voluptatum eligendi.\"),\n", - " wr.P(\"Non veniam laudantium et fugit distinctio qui aliquid eius sed laudantium consequatur et quia perspiciatis. Et odio inventore est voluptas fugiat id perspiciatis dolorum et perferendis recusandae vel Quis odio 33 beatae veritatis. Ex sunt accusamus aut soluta eligendi sed perspiciatis maxime 33 dolorem dolorum est aperiam minima. Et earum rerum eos illo sint eos temporibus similique ea fuga iste sed quia soluta sit doloribus corporis sed tenetur excepturi?\"),\n", - " wr.PanelGrid(\n", - " panels=[\n", - " wr.LinePlot(x='global_step', y=['charts/SPS']),\n", - " wr.LinePlot(x='global_step', y=['charts/episodic_length']),\n", - " wr.LinePlot(x='global_step', y=['charts/episodic_return']),\n", - " ],\n", - " runsets=[\n", - " wr.Runset(\"openrlbenchmark\", \"cleanrl\", \"DQN\", groupby=[\"exp_name\"]).set_filters_with_python_expr(\"env_id == 'BreakoutNoFrameskip-v4' and exp_name == 'dqn_atari'\"),\n", - " wr.Runset(\"openrlbenchmark\", \"cleanrl\", \"SAC-discrete 0.8\", groupby=[\"exp_name\"]).set_filters_with_python_expr(\"env_id == 'BreakoutNoFrameskip-v4' and exp_name == 'sac_atari' and target_entropy_scale == 0.8\"),\n", - " wr.Runset(\"openrlbenchmark\", \"cleanrl\", \"SAC-discrete 0.88\", groupby=[\"exp_name\"]).set_filters_with_python_expr(\"env_id == 'BreakoutNoFrameskip-v4' and exp_name == 'sac_atari' and target_entropy_scale == 0.88\"),\n", - " ],\n", - " custom_run_colors={\n", - " ('DQN', 'dqn_atari'): '#e84118',\n", - " ('SAC-discrete 0.8', 'sac_atari'): '#fbc531',\n", - " ('SAC-discrete 0.88', 'sac_atari'): '#00a8ff',\n", - " }\n", - " ),\n", - " ]\n", - ").save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Customer Landing Page" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report = wr.templates.create_customer_landing_page(\n", - " project=PROJECT,\n", - " company_name='Company',\n", - " main_contact='Contact McContact (email@company.com)',\n", - " slack_link='https://company.slack.com/blah',\n", - ")\n", - "report.save()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Enterprise Report with Branded Header and Footer" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "report = wr.templates.create_enterprise_report(\n", - " project=PROJECT,\n", - " body=[\n", - " wr.H1(\"Ea quidem illo est dolorem illo.\"),\n", - " wr.P(\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ac eros ut nunc venenatis tincidunt vel ut dolor. Sed sed felis dictum, congue risus vel, aliquet dolor. Donec ut risus vel leo dictum tristique. Nunc sed urna mi. Morbi nulla turpis, vehicula eu maximus ut, gravida id libero. Duis porta risus leo, quis lobortis enim ultrices a. Donec quam augue, vestibulum vitae mollis at, tincidunt non orci. Morbi faucibus dignissim tempor. Vestibulum ornare augue a orci tincidunt porta. Pellentesque et ante et purus gravida euismod. Maecenas sit amet sollicitudin felis, sed egestas nunc.\"),\n", - " wr.H2('Et sunt sunt eum asperiores ratione.'),\n", - " wr.PanelGrid(\n", - " panels=[\n", - " wr.LinePlot(x='global_step', y=['charts/episodic_return'], smoothing_factor=0.85, groupby_aggfunc='mean', groupby_rangefunc='minmax', layout={'x': 0, 'y': 0, 'w': 12, 'h': 8}),\n", - " wr.MediaBrowser(media_keys=\"videos\", num_columns=4, layout={'w': 12, 'h': 8}),\n", - " ],\n", - " runsets=[\n", - " wr.Runset(entity='openrlbenchmark', project='cleanrl', query='bigfish', groupby=['env_id', 'exp_name'])\n", - " ],\n", - " custom_run_colors={\n", - " ('Run set', 'bigfish', 'ppg_procgen'): \"#2980b9\",\n", - " ('Run set', 'bigfish', 'ppo_procgen'): \"#e74c3c\",\n", - " }\n", - " ),\n", - " wr.H2('Sit officia inventore non omnis deleniti.'),\n", - " wr.PanelGrid(\n", - " panels=[\n", - " wr.LinePlot(x='global_step', y=['charts/episodic_return'], smoothing_factor=0.85, groupby_aggfunc='mean', groupby_rangefunc='minmax', layout={'x': 0, 'y': 0, 'w': 12, 'h': 8}),\n", - " wr.MediaBrowser(media_keys=\"videos\", num_columns=4, layout={'w': 12, 'h': 8}),\n", - " ],\n", - " runsets=[\n", - " wr.Runset(entity='openrlbenchmark', project='cleanrl', query='starpilot', groupby=['env_id', 'exp_name'])\n", - " ],\n", - " custom_run_colors={\n", - " ('Run set', 'starpilot', 'ppg_procgen'): \"#2980b9\",\n", - " ('Run set', 'starpilot', 'ppo_procgen'): \"#e74c3c\",\n", - " }\n", - " ),\n", - " ]\n", - ")\n", - "report.save()" - ] } ], "metadata": { @@ -1600,5 +924,5 @@ } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 4 }