Skip to content

Commit

Permalink
Move trends plots inside of "Custom" section (#3404)
Browse files Browse the repository at this point in the history
  • Loading branch information
julieg18 authored Mar 20, 2023
1 parent 8cae564 commit 6cfade1
Show file tree
Hide file tree
Showing 43 changed files with 1,686 additions and 2,048 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
8 changes: 3 additions & 5 deletions extension/resources/walkthrough/live-plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ for epoch in range(NUM_EPOCHS):
`DVCLive` is _optional_, and you can just append or modify plot files using any
language and any tool.

💡 `Trends` section of the plots dashboard is being updated automatically based
on the data in the table. You don't even have to manage or write any special
plot files, but you need to enable
[checkpoints](https://dvc.org/doc/user-guide/experiment-management/checkpoints)
in the project.
💡 Plots created in the `Custom` section of the plots dashboard are being
updated automatically based on the data in the table. You don't even have to
manage or write any special plot files.
24 changes: 14 additions & 10 deletions extension/resources/walkthrough/plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,29 @@ templates], which may be predefined (e.g. confusion matrix, linear) or custom
alt="Plots: Images" />
</p>

<p align="center">
<img src="images/plots-trends.png"
alt="Plots: Trends" />
</p>

**Images** (e.g. `.jpg` or `.svg` files) can be visualized as well. They will be
rendered side by side for the selected experiments.

<p align="center">
<img src="images/plots-view-icon.png"
alt="Plots View Icon" />
<img src="images/plots-custom.png"
alt="Plots: Custom" />
</p>

Automatically generated and updated **Trends** that show scalar [metrics] value
per epoch if [checkpoints] are enabled.
**Custom** plots are generated linear plots comparing metrics and params. A user
can add two types of plots, "Checkpoint Trend" and "Metric Vs Param".

"Metric Vs Param" plots compare a chosen metric and param across experiments.
"Checkpoint Trend" plots can compare a chosen [metric] value per epoch if
[checkpoints] are enabled.

[metrics]: https://dvc.org/doc/command-reference/metrics
[metric]: https://dvc.org/doc/command-reference/metrics
[checkpoints]: https://dvc.org/doc/user-guide/experiment-management/checkpoints

<p align="center">
<img src="images/plots-view-icon.png"
alt="Plots View Icon" />
</p>

The **Plots Dashboard** can be configured and accessed from the _Plots_ and
_Experiments_ side panels in the [**DVC View**](command:views.dvc-views).

Expand Down
4 changes: 4 additions & 0 deletions extension/src/experiments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ export class Experiments extends BaseRepository<TableData> {
return this.experiments.getExperimentCount()
}

public getExperimentsWithCheckpoints() {
return this.experiments.getExperimentsWithCheckpoints()
}

public async selectExperiments() {
const experiments = this.experiments.getExperimentsWithCheckpoints()

Expand Down
4 changes: 4 additions & 0 deletions extension/src/experiments/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export type ExperimentWithCheckpoints = Experiment & {
checkpoints?: Experiment[]
}

export type ExperimentWithDefinedCheckpoints = Experiment & {
checkpoints: Experiment[]
}

export enum ExperimentType {
WORKSPACE = 'workspace',
COMMIT = 'commit',
Expand Down
9 changes: 4 additions & 5 deletions extension/src/plots/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { Experiments } from '../experiments'
import { Resource } from '../resourceLocator'
import { InternalCommands } from '../commands/internal'
import { definedAndNonEmpty } from '../util/array'
import { ExperimentsOutput } from '../cli/dvc/contract'
import { TEMP_PLOTS_DIR } from '../cli/dvc/constants'
import { removeDir } from '../fileSystem'
import { Toast } from '../vscode/toast'
Expand Down Expand Up @@ -173,7 +172,7 @@ export class Plots extends BaseRepository<TPlotsData> {
waitForInitialExpData.dispose()
this.data.setMetricFiles(data)
this.setupExperimentsListener(experiments)
void this.initializeData(data)
void this.initializeData()
}
})
)
Expand All @@ -184,7 +183,7 @@ export class Plots extends BaseRepository<TPlotsData> {
experiments.onDidChangeExperiments(async data => {
if (data) {
await Promise.all([
this.plots.transformAndSetExperiments(data),
this.plots.transformAndSetExperiments(),
this.data.setMetricFiles(data)
])
}
Expand All @@ -200,8 +199,8 @@ export class Plots extends BaseRepository<TPlotsData> {
)
}

private async initializeData(data: ExperimentsOutput) {
await this.plots.transformAndSetExperiments(data)
private async initializeData() {
await this.plots.transformAndSetExperiments()
void this.data.managedUpdate()
await Promise.all([
this.data.isReady(),
Expand Down
Loading

0 comments on commit 6cfade1

Please sign in to comment.