mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-11 12:30:25 +08:00
Merge pull request #225 from yoshinobc/plot-intermediate-values-of-running-trials
plot intermediate values of running trials
This commit is contained in:
@@ -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)
|
||||
setStudyDetailState(studyId, study)
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
@@ -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")
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user