fix: Update TradingBot signal processing to handle NaN values and improve MLFilter ONNX session configuration

This commit is contained in:
21in7
2026-03-02 00:47:17 +09:00
parent 031adac977
commit 361b0f4e00
3 changed files with 15 additions and 5 deletions

View File

@@ -71,10 +71,15 @@ def _export_onnx(
transB=1),
# sigmoid → (N, 1)
helper.make_node("Sigmoid", ["logits"], ["proba_2d"]),
# squeeze: (N, 1) → (N,)
helper.make_node("Flatten", ["proba_2d"], ["proba"], axis=0),
# squeeze: (N, 1) → (N,) — axis=-1 로 마지막 차원만 제거
helper.make_node("Squeeze", ["proba_2d", "squeeze_axes"], ["proba"]),
]
squeeze_axes = numpy_helper.from_array(
np.array([-1], dtype=np.int64), name="squeeze_axes"
)
initializers.append(squeeze_axes)
graph = helper.make_graph(
nodes,
"mlx_filter",