fix(argo): auto-adjust n-initial when trials < 5

Hyperopt requires trials > n_initial. When running quick smoke tests
with few trials, auto-reduce n_initial to trials-1 so workflows don't
fail with "trials must be greater than n_initial".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-04 19:18:08 +01:00
parent 1ad77b6427
commit 4d5885cc02

View File

@@ -155,11 +155,17 @@ spec:
*) BINARY=hyperopt_baseline_supervised ;;
esac
echo "Running $BINARY --model $MODEL ({{workflow.parameters.hyperopt-trials}} trials x {{workflow.parameters.hyperopt-epochs}} epochs)"
TRIALS={{workflow.parameters.hyperopt-trials}}
N_INITIAL=5
if [ "$TRIALS" -le "$N_INITIAL" ]; then
N_INITIAL=$((TRIALS > 1 ? TRIALS - 1 : 1))
fi
echo "Running $BINARY --model $MODEL ($TRIALS trials, $N_INITIAL initial x {{workflow.parameters.hyperopt-epochs}} epochs)"
$BINARY \
--model "$MODEL" \
--trials {{workflow.parameters.hyperopt-trials}} \
--n-initial 5 \
--trials "$TRIALS" \
--n-initial "$N_INITIAL" \
--epochs {{workflow.parameters.hyperopt-epochs}} \
--parallel 0 \
--symbol {{workflow.parameters.symbol}} \