Data at times the model writes no output for are refused or fitted depending on where the clock starts, the fit type, and how t_end is written
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start with objective.matching_row and Configuration._refuse_data_without_rows, then compare the constraint matching in constraint._crossing_indices and output grid handling in bngsim_model.grid.kept_output_rows. Run the named strict xfail tests in tests/test_ms_review14_segments.py and tests/test_ms_review15_segments.py to reproduce the time-base, fit-type, constraint, and t_end cases. Done means the tests pass and data and constraints are handled consistently across time bases, fit types, and equivalent t_end expressions.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What you do. Fit data at times the model does not write output at. For example, a model whose action writes a row every 1.0 (n_steps too small) and data every 0.25.
What you see. Whether that is an error depends on where the clock starts, on the fit type, and on how t_end is spelled. It should depend on none of them.
- Where the clock starts. With
t_start=>100the configuration is refused as it loads: "the data for "tc" has t = 100.25, ... where the action writes no row". Witht_start=>100000and nothing else changed, it loads and fits.gntranddescore each datum against the nearest whole-number row and report k = 1.0686. The data's own optimum is k = 1.0063 (scipy on the closed form). - The fit type. In that same job,
job_type = msreports k = 1.0063. It simulates at each datum's own time and never reads the action's rows. So two fit types report two best fits for one configuration, with no message from either. - How
t_endis spelled. Witht_start=>0, t_end=>2every fit type refuses the job at load. Witht_end=>1+1, the output times are not worked out at load. Thengntrstops at its first evaluation ("time=0.25 ... is not in the simulation output"), andmsfits it. - Constraints. A constraint
at time = T, with T three quarters of the way between two rows, reads the earlier row (PyBNF's documented convention) when the time base is 0, 100 or 1e4. From 1e5 on, it reads the later row. On a trajectory whose value is ten times its row number, the penalty ofA < 0 at time = Tis 20 at the lower bases and 30 at the higher ones.
Why. A datum is matched to a simulated row when the two times agree to within 1e-5 of the time, numpy's default relative tolerance. That is deliberate: a time written to six significant digits, such as 10.1667 for 10 h 10 min, has to match its row at 10.16666.... But the tolerance grows with the time. Far enough from t = 0 it is wider than the step between rows, so a datum between two rows is matched to one of them instead of being refused. The constraints' own time match does the same.
What should happen. Whether a datum or a constraint time has a row should not depend on the time base, the fit type, or how the action's arguments are written. A tolerance alone cannot decide it. An attempt during review of fix/ms-batch required a row to be within a thousandth of the row spacing, as well as within the relative tolerance. That refused valid data: a per-minute 24 h course with times written to six digits lost 56 of its 145 data. It was reverted before merge. Two other directions:
- Have the simulator write output at each data time, as
msalready does. Then there is nothing to match. - Refuse at load when the relative tolerance at a datum's time is wider than the step between rows, unless the datum is on a row.
The second is narrower, but on its own it refuses jobs on a late time base that load today.
Where.
objective.matching_row(the objective and the load-time checkConfiguration._refuse_data_without_rows).constraint._crossing_indices.bngsim_model.grid.kept_output_rows, which gives up when an action argument is an expression such as1+1.msscores segments at the data's own times (pybnf/shooting/).
Reproduction. These tests are in the branch as strict xfails:
tests/test_ms_review14_segments.py:test_a_datum_between_two_simulated_rows_is_refused_at_any_time_base,test_data_finer_than_the_models_output_grid_is_refused_on_a_late_time_baseandtest_ms_and_gntr_report_one_fit_for_one_configuration_on_a_late_time_base.tests/test_ms_review15_segments.py: the constraint andt_end=>1+1cases.
The model is A() -> 0 at k_deg from A = 1, with simulate({method=>"ode",t_start=>100000,t_end=>100002,n_steps=>2,suffix=>"tc"}), and data every 0.25 from 100000 to 100002. The job:
edition = 2
bngl_backend = bngsim
model = m.bngl : tc.exp
objective = sos
uniform_var = k_deg 0.1 10
job_type = gntr
Found during review of the multiple-shooting batch (fix/ms-batch). The behaviour is the same on main, except that main also matched a datum to the first row within the tolerance rather than the nearest one. fix/ms-batch fixes that.
- Ngôn ngữ chính
- Python
- Star
- 26
- Fork
- 25
- Merge trung bình
- 4 giờ 25 phút
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của lanl/PyBNF
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
min_objective stops a sampler run early and reports "Fitting complete": samplers should refuse itĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
bug minor
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
-
bug minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Issue tương tự
-
docs(contributing): the two things that silently block a PRCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởavailable documentation good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 95/100
Nixitov/Riptide-Native#944 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
JTHCode/secretguard#24 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: middleware documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainer thường phản hồi trong vòng 1 ngày