Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot intermediate values of running trials #225

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion optuna_dashboard/ts/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const actionCreator = () => {
studyId in studyDetails
? studyDetails[studyId].trials.slice(0, nLocalFixedTrials)
: []
study.trials = study.trials.concat(currentFixedTrials)
study.trials = currentFixedTrials.concat(study.trials)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry. Now I understand what you said. Your changes looks perfect 💯

setStudyDetailState(studyId, study)
})
.catch((err) => {
Expand Down
8 changes: 6 additions & 2 deletions optuna_dashboard/ts/components/GraphIntermediateValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ const plotIntermediateValue = (trials: Trial[], mode: string) => {
const filteredTrials = trials.filter(
(t) =>
t.state === "Complete" ||
(t.state === "Pruned" && t.values && t.values.length > 0)
(t.state === "Pruned" && t.values && t.values.length > 0) ||
t.state == "Running"
)
const plotData: Partial<plotly.PlotData>[] = filteredTrials.map((trial) => {
const values = trial.intermediate_values.filter((iv) => iv.value !== "inf")
Expand All @@ -63,7 +64,10 @@ const plotIntermediateValue = (trials: Trial[], mode: string) => {
y: values.map((iv) => iv.value),
mode: "lines+markers",
type: "scatter",
name: `trial #${trial.number}`,
name:
trial.state !== "Running"
? `trial #${trial.number}`
: `trial #${trial.number} (running)`,
}
})
plotly.react(plotDomId, plotData, layout)
Expand Down