Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Better comments#84

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sdpython merged 2 commits intomainfrombug
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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
7 changes: 5 additions & 2 deletions_doc/examples/plot_benchmark_rf.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,8 +22,6 @@
import numpy
import pandas
from lightgbm import LGBMRegressor
from onnxmltools.convert.lightgbm.operator_converters.LightGbm import convert_lightgbm
from onnxmltools.convert.xgboost.operator_converters.XGBoost import convert_xgboost
from onnxruntime import InferenceSession, SessionOptions
from psutil import cpu_count
from sphinx_runpython.runpython import run_cmd
Expand All@@ -33,9 +31,14 @@
from sklearn.ensemble import RandomForestRegressor
from tqdm import tqdm
from xgboost import XGBRegressor
from onnxmltools.convert.xgboost.operator_converters.XGBoost import convert_xgboost


def skl2onnx_convert_lightgbm(scope, operator, container):
from onnxmltools.convert.lightgbm.operator_converters.LightGbm import (
convert_lightgbm,
)

options = scope.get_options(operator.raw_operator)
if "split" in options:
operator.split = options["split"]
Expand Down
6 changes: 6 additions & 0 deletionsonnx_array_api/_command_lines_parser.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -123,8 +123,14 @@ def _cmd_compare(argv: List[Any]):

parser = get_parser_compare()
args = parser.parse_args(argv[1:])
if args.verbose in ("1", 1, "True", True):
print(f"[compare] first model {args.model1!r}")
print(f"[compare] second model {args.model2!r}")
onx1 = onnx.load(args.model1)
onx2 = onnx.load(args.model2)
if args.verbose in ("1", 1, "True", True):
print(f"[compare] first model has {len(onx1.graph.node)} nodes")
print(f"[compare] second model has {len(onx2.graph.node)} nodes")
res1, res2, align, dc = compare_onnx_execution(
onx1,
onx2,
Expand Down
5 changes: 3 additions & 2 deletionsonnx_array_api/reference/evaluator_yield.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -642,15 +642,16 @@ def compare_onnx_execution(
print("[compare_onnx_execution] loading first model")
proto1 = load(model1) if isinstance(model1, str) else model1
if verbose:
print("[compare_onnx_execution] loadingfirst model")
print("[compare_onnx_execution] loadingsecond model")
proto2 = load(model2) if isinstance(model2, str) else model2
res1 = list(_enumerate_result_no_execution(proto1))
res2 = list(_enumerate_result_no_execution(proto2))
else:
return

if verbose:
print(f"[compare_onnx_execution] got {len(res2)} results")
print(f"[compare_onnx_execution] got {len(res1)} results (first model)")
print(f"[compare_onnx_execution] got {len(res2)} results (second model)")
print("[compare_onnx_execution] compute edit distance")
dc = DistanceExecution()
_, align = dc.distance_sequence(res1, res2)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp