mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-23 13:30:25 +08:00
Support fixed_params
This commit is contained in:
@@ -162,14 +162,20 @@ def serialize_frozen_trial(
|
||||
"distribution": serialize_distribution(distribution),
|
||||
}
|
||||
)
|
||||
trial_system_attrs = getattr(trial, "_system_attrs", {})
|
||||
fixed_params = trial_system_attrs.get("fixed_params", {})
|
||||
serialized = {
|
||||
"trial_id": trial._trial_id,
|
||||
"study_id": study_id,
|
||||
"number": trial.number,
|
||||
"state": trial.state.name.capitalize(),
|
||||
"params": params,
|
||||
"fixed_params": [
|
||||
{"name": param_name, "param_external_value": str(fixed_params.get(param_name, None))}
|
||||
for param_name in fixed_params
|
||||
],
|
||||
"user_attrs": serialize_attrs(trial.user_attrs),
|
||||
"system_attrs": serialize_attrs(getattr(trial, "_system_attrs", {})),
|
||||
"system_attrs": serialize_attrs(trial_system_attrs),
|
||||
"note": note.get_note_from_system_attrs(study_system_attrs, trial._trial_id),
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@ interface TrialResponse {
|
||||
datetime_start?: string
|
||||
datetime_complete?: string
|
||||
params: TrialParam[]
|
||||
fixed_params: {
|
||||
name: string
|
||||
param_external_value: string
|
||||
}[]
|
||||
user_attrs: Attribute[]
|
||||
system_attrs: Attribute[]
|
||||
note: Note
|
||||
@@ -32,6 +36,7 @@ const convertTrialResponse = (res: TrialResponse): Trial => {
|
||||
? new Date(res.datetime_complete)
|
||||
: undefined,
|
||||
params: res.params,
|
||||
fixed_params: res.fixed_params,
|
||||
user_attrs: res.user_attrs,
|
||||
system_attrs: res.system_attrs,
|
||||
note: res.note,
|
||||
|
||||
@@ -160,13 +160,23 @@ const TrialListDetail: FC<{
|
||||
Values = [
|
||||
{trial.values?.map((v) => v.toString()).join(" ") || "None"}]
|
||||
</Typography>
|
||||
<Typography>
|
||||
Params = [
|
||||
{trial.params
|
||||
.map((p) => `${p.name}: ${p.param_external_value}`)
|
||||
.join(", ")}
|
||||
]
|
||||
</Typography>
|
||||
{trial.state !== "Waiting" ? (
|
||||
<Typography>
|
||||
Params = [
|
||||
{trial.params
|
||||
.map((p) => `${p.name}: ${p.param_external_value}`)
|
||||
.join(", ")}
|
||||
]
|
||||
</Typography>
|
||||
) : (
|
||||
<Typography>
|
||||
Params = [
|
||||
{trial.fixed_params
|
||||
.map((p) => `${p.name}: ${p.param_external_value}`)
|
||||
.join(", ")}
|
||||
]
|
||||
</Typography>
|
||||
)}
|
||||
<Typography>
|
||||
Started At ={" "}
|
||||
{trial?.datetime_start ? trial?.datetime_start.toString() : null}
|
||||
|
||||
Vendored
+4
@@ -98,6 +98,10 @@ type Trial = {
|
||||
datetime_start?: Date
|
||||
datetime_complete?: Date
|
||||
params: TrialParam[]
|
||||
fixed_params: {
|
||||
name: string
|
||||
param_external_value: string
|
||||
}[]
|
||||
user_attrs: Attribute[]
|
||||
system_attrs: Attribute[]
|
||||
note: Note
|
||||
|
||||
Reference in New Issue
Block a user