diff --git a/.gitattributes b/.gitattributes index 979e30c361ec7cf63b8bcf394949812921527acb..d8b92851f687dad6056beec2431f917a3721f0fa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -84,3 +84,15 @@ shared/package-files/05/05464db9f29f3e3c72bda50625b2c3ae15931b2a75dfea352a08400d shared/package-files/05/055a8c8de66579d344ffd20ea68aa6926728f85942aaee502878b5ba3f4cbb88/blob filter=lfs diff=lfs merge=lfs -text shared/package-files/06/061ac28d1ae2fb1380babbd59c7f2ff9acf3f2a4d6c421590a31edeb3ae6f679/blob filter=lfs diff=lfs merge=lfs -text shared/package-files/06/0624808a363bd60dbec9c75b37431bbe55a5dfa4f497997723ac26b16d271099/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/06/06fe4495c90199b465e598eff59efdbb7760c4c763e344e5897e5ca6649767c9/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/07/070b788db511a6bbd5c3e5d7c4b97acef54977179bb07a61663c6e617a2e4f66/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/07/074ce037474f72e2fc9945195ed4c16fb5461760294fcf879724257094ee1810/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/07/079c3711962ff08177d6851af6de157d6353461185f7aef7227d5ee8272b5b16/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/07/079d8be918d4e69bd3effa36026a1e5764ebd6e3c99a197e03abc63ba609cbc2/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/07/07a60a6bf5b0ae455f4d4cb1df5be25ded300842e428a03bb690ab5a0567c013/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/07/07ebc7c52f195f037ed4dff87b34ba7779a311e0b94f593ab95f7e8e61109970/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/07/07ec62e718c772cda488c50484de7e6b005ffe671567dbe6421685e6874be75d/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/07/07f3689f83d0063c0d5630a7052ce390b0612fb91289362ac43974717ad2dce0/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/08/083868ebd616dc54ed63229d0c12ba65d11c41834f02554895a5f3750e67712c/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/08/08718ad705a9b35495054ffa65e35ac29445fe5ef610620778964a4413901d10/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/09/0939533feac811be371ac5aec67815b9c6fccb0c08cf86886c1b86962511fd82/blob filter=lfs diff=lfs merge=lfs -text diff --git a/shared/package-files/06/0696e309979cee7fae3a3fdc226bbe701d629950b8a1e2fcac95308f16e63787/blob b/shared/package-files/06/0696e309979cee7fae3a3fdc226bbe701d629950b8a1e2fcac95308f16e63787/blob new file mode 100644 index 0000000000000000000000000000000000000000..ae88fbc5111fdbbb6f786fbf8dc112040b3d90c2 --- /dev/null +++ b/shared/package-files/06/0696e309979cee7fae3a3fdc226bbe701d629950b8a1e2fcac95308f16e63787/blob @@ -0,0 +1,488 @@ +from .artist import Artist +from .axes import Axes +from .backend_bases import FigureCanvasBase, Event, MouseEvent, MouseButton +from .collections import LineCollection +from .figure import Figure +from .lines import Line2D +from .patches import Polygon, Rectangle +from .text import Text + +import PIL.Image + +from collections.abc import Callable, Collection, Iterable, Sequence +from typing import Any, Literal +from numpy.typing import ArrayLike +from .typing import ColorType +import numpy as np + +class LockDraw: + def __init__(self) -> None: ... + def __call__(self, o: Any) -> None: ... + def release(self, o: Any) -> None: ... + def available(self, o: Any) -> bool: ... + def isowner(self, o: Any) -> bool: ... + def locked(self) -> bool: ... + +class Widget: + drawon: bool + eventson: bool + active: bool + def set_active(self, active: bool) -> None: ... + def get_active(self) -> None: ... + def ignore(self, event) -> bool: ... + +class AxesWidget(Widget): + ax: Axes + def __init__(self, ax: Axes) -> None: ... + @property + def canvas(self) -> FigureCanvasBase | None: ... + def connect_event(self, event: Event, callback: Callable) -> None: ... + def disconnect_events(self) -> None: ... + +class Button(AxesWidget): + label: Text + color: ColorType + hovercolor: ColorType + def __init__( + self, + ax: Axes, + label: str, + image: ArrayLike | PIL.Image.Image | None = ..., + color: ColorType = ..., + hovercolor: ColorType = ..., + *, + useblit: bool = ... + ) -> None: ... + def on_clicked(self, func: Callable[[Event], Any]) -> int: ... + def disconnect(self, cid: int) -> None: ... + +class SliderBase(AxesWidget): + orientation: Literal["horizontal", "vertical"] + closedmin: bool + closedmax: bool + valmin: float + valmax: float + valstep: float | ArrayLike | None + drag_active: bool + valfmt: str + def __init__( + self, + ax: Axes, + orientation: Literal["horizontal", "vertical"], + closedmin: bool, + closedmax: bool, + valmin: float, + valmax: float, + valfmt: str, + dragging: Slider | None, + valstep: float | ArrayLike | None, + ) -> None: ... + def disconnect(self, cid: int) -> None: ... + def reset(self) -> None: ... + +class Slider(SliderBase): + slidermin: Slider | None + slidermax: Slider | None + val: float + valinit: float + track: Rectangle + poly: Polygon + hline: Line2D + vline: Line2D + label: Text + valtext: Text + def __init__( + self, + ax: Axes, + label: str, + valmin: float, + valmax: float, + *, + valinit: float = ..., + valfmt: str | None = ..., + closedmin: bool = ..., + closedmax: bool = ..., + slidermin: Slider | None = ..., + slidermax: Slider | None = ..., + dragging: bool = ..., + valstep: float | ArrayLike | None = ..., + orientation: Literal["horizontal", "vertical"] = ..., + initcolor: ColorType = ..., + track_color: ColorType = ..., + handle_style: dict[str, Any] | None = ..., + **kwargs + ) -> None: ... + def set_val(self, val: float) -> None: ... + def on_changed(self, func: Callable[[float], Any]) -> int: ... + +class RangeSlider(SliderBase): + val: tuple[float, float] + valinit: tuple[float, float] + track: Rectangle + poly: Polygon + label: Text + valtext: Text + def __init__( + self, + ax: Axes, + label: str, + valmin: float, + valmax: float, + *, + valinit: tuple[float, float] | None = ..., + valfmt: str | None = ..., + closedmin: bool = ..., + closedmax: bool = ..., + dragging: bool = ..., + valstep: float | ArrayLike | None = ..., + orientation: Literal["horizontal", "vertical"] = ..., + track_color: ColorType = ..., + handle_style: dict[str, Any] | None = ..., + **kwargs + ) -> None: ... + def set_min(self, min: float) -> None: ... + def set_max(self, max: float) -> None: ... + def set_val(self, val: ArrayLike) -> None: ... + def on_changed(self, func: Callable[[tuple[float, float]], Any]) -> int: ... + +class CheckButtons(AxesWidget): + labels: list[Text] + def __init__( + self, + ax: Axes, + labels: Sequence[str], + actives: Iterable[bool] | None = ..., + *, + useblit: bool = ..., + label_props: dict[str, Sequence[Any]] | None = ..., + frame_props: dict[str, Any] | None = ..., + check_props: dict[str, Any] | None = ..., + ) -> None: ... + def set_label_props(self, props: dict[str, Sequence[Any]]) -> None: ... + def set_frame_props(self, props: dict[str, Any]) -> None: ... + def set_check_props(self, props: dict[str, Any]) -> None: ... + def set_active(self, index: int, state: bool | None = ...) -> None: ... # type: ignore[override] + def clear(self) -> None: ... + def get_status(self) -> list[bool]: ... + def get_checked_labels(self) -> list[str]: ... + def on_clicked(self, func: Callable[[str | None], Any]) -> int: ... + def disconnect(self, cid: int) -> None: ... + +class TextBox(AxesWidget): + label: Text + text_disp: Text + cursor_index: int + cursor: LineCollection + color: ColorType + hovercolor: ColorType + capturekeystrokes: bool + def __init__( + self, + ax: Axes, + label: str, + initial: str = ..., + *, + color: ColorType = ..., + hovercolor: ColorType = ..., + label_pad: float = ..., + textalignment: Literal["left", "center", "right"] = ..., + ) -> None: ... + @property + def text(self) -> str: ... + def set_val(self, val: str) -> None: ... + def begin_typing(self) -> None: ... + def stop_typing(self) -> None: ... + def on_text_change(self, func: Callable[[str], Any]) -> int: ... + def on_submit(self, func: Callable[[str], Any]) -> int: ... + def disconnect(self, cid: int) -> None: ... + +class RadioButtons(AxesWidget): + activecolor: ColorType + value_selected: str + labels: list[Text] + def __init__( + self, + ax: Axes, + labels: Iterable[str], + active: int = ..., + activecolor: ColorType | None = ..., + *, + useblit: bool = ..., + label_props: dict[str, Sequence[Any]] | None = ..., + radio_props: dict[str, Any] | None = ..., + ) -> None: ... + def set_label_props(self, props: dict[str, Sequence[Any]]) -> None: ... + def set_radio_props(self, props: dict[str, Any]) -> None: ... + def set_active(self, index: int) -> None: ... + def clear(self) -> None: ... + def on_clicked(self, func: Callable[[str | None], Any]) -> int: ... + def disconnect(self, cid: int) -> None: ... + +class SubplotTool(Widget): + figure: Figure + targetfig: Figure + buttonreset: Button + def __init__(self, targetfig: Figure, toolfig: Figure) -> None: ... + +class Cursor(AxesWidget): + visible: bool + horizOn: bool + vertOn: bool + useblit: bool + lineh: Line2D + linev: Line2D + background: Any + needclear: bool + def __init__( + self, + ax: Axes, + *, + horizOn: bool = ..., + vertOn: bool = ..., + useblit: bool = ..., + **lineprops + ) -> None: ... + def clear(self, event: Event) -> None: ... + def onmove(self, event: Event) -> None: ... + +class MultiCursor(Widget): + axes: Sequence[Axes] + horizOn: bool + vertOn: bool + visible: bool + useblit: bool + vlines: list[Line2D] + hlines: list[Line2D] + def __init__( + self, + canvas: Any, + axes: Sequence[Axes], + *, + useblit: bool = ..., + horizOn: bool = ..., + vertOn: bool = ..., + **lineprops + ) -> None: ... + def connect(self) -> None: ... + def disconnect(self) -> None: ... + def clear(self, event: Event) -> None: ... + def onmove(self, event: Event) -> None: ... + +class _SelectorWidget(AxesWidget): + onselect: Callable[[float, float], Any] + useblit: bool + background: Any + validButtons: list[MouseButton] + def __init__( + self, + ax: Axes, + onselect: Callable[[float, float], Any] | None = ..., + useblit: bool = ..., + button: MouseButton | Collection[MouseButton] | None = ..., + state_modifier_keys: dict[str, str] | None = ..., + use_data_coordinates: bool = ..., + ) -> None: ... + def update_background(self, event: Event) -> None: ... + def connect_default_events(self) -> None: ... + def ignore(self, event: Event) -> bool: ... + def update(self) -> None: ... + def press(self, event: Event) -> bool: ... + def release(self, event: Event) -> bool: ... + def onmove(self, event: Event) -> bool: ... + def on_scroll(self, event: Event) -> None: ... + def on_key_press(self, event: Event) -> None: ... + def on_key_release(self, event: Event) -> None: ... + def set_visible(self, visible: bool) -> None: ... + def get_visible(self) -> bool: ... + def clear(self) -> None: ... + @property + def artists(self) -> tuple[Artist]: ... + def set_props(self, **props) -> None: ... + def set_handle_props(self, **handle_props) -> None: ... + def add_state(self, state: str) -> None: ... + def remove_state(self, state: str) -> None: ... + +class SpanSelector(_SelectorWidget): + snap_values: ArrayLike | None + onmove_callback: Callable[[float, float], Any] + minspan: float + grab_range: float + drag_from_anywhere: bool + ignore_event_outside: bool + def __init__( + self, + ax: Axes, + onselect: Callable[[float, float], Any], + direction: Literal["horizontal", "vertical"], + *, + minspan: float = ..., + useblit: bool = ..., + props: dict[str, Any] | None = ..., + onmove_callback: Callable[[float, float], Any] | None = ..., + interactive: bool = ..., + button: MouseButton | Collection[MouseButton] | None = ..., + handle_props: dict[str, Any] | None = ..., + grab_range: float = ..., + state_modifier_keys: dict[str, str] | None = ..., + drag_from_anywhere: bool = ..., + ignore_event_outside: bool = ..., + snap_values: ArrayLike | None = ..., + ) -> None: ... + def new_axes( + self, + ax: Axes, + *, + _props: dict[str, Any] | None = ..., + _init: bool = ..., + ) -> None: ... + def connect_default_events(self) -> None: ... + @property + def direction(self) -> Literal["horizontal", "vertical"]: ... + @direction.setter + def direction(self, direction: Literal["horizontal", "vertical"]) -> None: ... + @property + def extents(self) -> tuple[float, float]: ... + @extents.setter + def extents(self, extents: tuple[float, float]) -> None: ... + +class ToolLineHandles: + ax: Axes + def __init__( + self, + ax: Axes, + positions: ArrayLike, + direction: Literal["horizontal", "vertical"], + *, + line_props: dict[str, Any] | None = ..., + useblit: bool = ..., + ) -> None: ... + @property + def artists(self) -> tuple[Line2D]: ... + @property + def positions(self) -> list[float]: ... + @property + def direction(self) -> Literal["horizontal", "vertical"]: ... + def set_data(self, positions: ArrayLike) -> None: ... + def set_visible(self, value: bool) -> None: ... + def set_animated(self, value: bool) -> None: ... + def remove(self) -> None: ... + def closest(self, x: float, y: float) -> tuple[int, float]: ... + +class ToolHandles: + ax: Axes + def __init__( + self, + ax: Axes, + x: ArrayLike, + y: ArrayLike, + *, + marker: str = ..., + marker_props: dict[str, Any] | None = ..., + useblit: bool = ..., + ) -> None: ... + @property + def x(self) -> ArrayLike: ... + @property + def y(self) -> ArrayLike: ... + @property + def artists(self) -> tuple[Line2D]: ... + def set_data(self, pts: ArrayLike, y: ArrayLike | None = ...) -> None: ... + def set_visible(self, val: bool) -> None: ... + def set_animated(self, val: bool) -> None: ... + def closest(self, x: float, y: float) -> tuple[int, float]: ... + +class RectangleSelector(_SelectorWidget): + drag_from_anywhere: bool + ignore_event_outside: bool + minspanx: float + minspany: float + spancoords: Literal["data", "pixels"] + grab_range: float + def __init__( + self, + ax: Axes, + onselect: Callable[[MouseEvent, MouseEvent], Any] | None = ..., + *, + minspanx: float = ..., + minspany: float = ..., + useblit: bool = ..., + props: dict[str, Any] | None = ..., + spancoords: Literal["data", "pixels"] = ..., + button: MouseButton | Collection[MouseButton] | None = ..., + grab_range: float = ..., + handle_props: dict[str, Any] | None = ..., + interactive: bool = ..., + state_modifier_keys: dict[str, str] | None = ..., + drag_from_anywhere: bool = ..., + ignore_event_outside: bool = ..., + use_data_coordinates: bool = ..., + ) -> None: ... + @property + def corners(self) -> tuple[np.ndarray, np.ndarray]: ... + @property + def edge_centers(self) -> tuple[np.ndarray, np.ndarray]: ... + @property + def center(self) -> tuple[float, float]: ... + @property + def extents(self) -> tuple[float, float, float, float]: ... + @extents.setter + def extents(self, extents: tuple[float, float, float, float]) -> None: ... + @property + def rotation(self) -> float: ... + @rotation.setter + def rotation(self, value: float) -> None: ... + @property + def geometry(self) -> np.ndarray: ... + +class EllipseSelector(RectangleSelector): ... + +class LassoSelector(_SelectorWidget): + verts: None | list[tuple[float, float]] + def __init__( + self, + ax: Axes, + onselect: Callable[[list[tuple[float, float]]], Any] | None = ..., + *, + useblit: bool = ..., + props: dict[str, Any] | None = ..., + button: MouseButton | Collection[MouseButton] | None = ..., + ) -> None: ... + +class PolygonSelector(_SelectorWidget): + grab_range: float + def __init__( + self, + ax: Axes, + onselect: Callable[[ArrayLike, ArrayLike], Any] | None = ..., + *, + useblit: bool = ..., + props: dict[str, Any] | None = ..., + handle_props: dict[str, Any] | None = ..., + grab_range: float = ..., + draw_bounding_box: bool = ..., + box_handle_props: dict[str, Any] | None = ..., + box_props: dict[str, Any] | None = ... + ) -> None: ... + def onmove(self, event: Event) -> bool: ... + @property + def verts(self) -> list[tuple[float, float]]: ... + @verts.setter + def verts(self, xys: Sequence[tuple[float, float]]) -> None: ... + +class Lasso(AxesWidget): + useblit: bool + background: Any + verts: list[tuple[float, float]] | None + line: Line2D + callback: Callable[[list[tuple[float, float]]], Any] + def __init__( + self, + ax: Axes, + xy: tuple[float, float], + callback: Callable[[list[tuple[float, float]]], Any], + *, + useblit: bool = ..., + props: dict[str, Any] | None = ..., + ) -> None: ... + def onrelease(self, event: Event) -> None: ... + def onmove(self, event: Event) -> None: ... diff --git a/shared/package-files/06/069723f7ea5e8585b6d2f9f8298f7ca400d07790348330d4b94936cb8f07cf23/blob b/shared/package-files/06/069723f7ea5e8585b6d2f9f8298f7ca400d07790348330d4b94936cb8f07cf23/blob new file mode 100644 index 0000000000000000000000000000000000000000..e1b32dbb0a709174c89726d304c0629d2ef1651f --- /dev/null +++ b/shared/package-files/06/069723f7ea5e8585b6d2f9f8298f7ca400d07790348330d4b94936cb8f07cf23/blob @@ -0,0 +1,139 @@ +import numpy as np +from numba import cuda +from numba.cuda.testing import unittest, CUDATestCase, skip_on_cudasim +from numba.tests.support import linux_only, override_config +from numba.core.errors import NumbaPerformanceWarning +import warnings + + +@skip_on_cudasim('cudasim does not raise performance warnings') +class TestWarnings(CUDATestCase): + def test_inefficient_launch_configuration(self): + @cuda.jit + def kernel(): + pass + + with override_config('CUDA_LOW_OCCUPANCY_WARNINGS', 1): + with warnings.catch_warnings(record=True) as w: + kernel[1, 1]() + + self.assertEqual(w[0].category, NumbaPerformanceWarning) + self.assertIn('Grid size', str(w[0].message)) + self.assertIn('low occupancy', str(w[0].message)) + + def test_efficient_launch_configuration(self): + @cuda.jit + def kernel(): + pass + + with override_config('CUDA_LOW_OCCUPANCY_WARNINGS', 1): + with warnings.catch_warnings(record=True) as w: + kernel[256, 256]() + + self.assertEqual(len(w), 0) + + def test_warn_on_host_array(self): + @cuda.jit + def foo(r, x): + r[0] = x + 1 + + N = 10 + arr_f32 = np.zeros(N, dtype=np.float32) + with override_config('CUDA_WARN_ON_IMPLICIT_COPY', 1): + with warnings.catch_warnings(record=True) as w: + foo[1, N](arr_f32, N) + + self.assertEqual(w[0].category, NumbaPerformanceWarning) + self.assertIn('Host array used in CUDA kernel will incur', + str(w[0].message)) + self.assertIn('copy overhead', str(w[0].message)) + + def test_pinned_warn_on_host_array(self): + @cuda.jit + def foo(r, x): + r[0] = x + 1 + + N = 10 + ary = cuda.pinned_array(N, dtype=np.float32) + + with override_config('CUDA_WARN_ON_IMPLICIT_COPY', 1): + with warnings.catch_warnings(record=True) as w: + foo[1, N](ary, N) + + self.assertEqual(w[0].category, NumbaPerformanceWarning) + self.assertIn('Host array used in CUDA kernel will incur', + str(w[0].message)) + self.assertIn('copy overhead', str(w[0].message)) + + def test_nowarn_on_mapped_array(self): + @cuda.jit + def foo(r, x): + r[0] = x + 1 + + N = 10 + ary = cuda.mapped_array(N, dtype=np.float32) + + with override_config('CUDA_WARN_ON_IMPLICIT_COPY', 1): + with warnings.catch_warnings(record=True) as w: + foo[1, N](ary, N) + + self.assertEqual(len(w), 0) + + @linux_only + def test_nowarn_on_managed_array(self): + @cuda.jit + def foo(r, x): + r[0] = x + 1 + + N = 10 + ary = cuda.managed_array(N, dtype=np.float32) + + with override_config('CUDA_WARN_ON_IMPLICIT_COPY', 1): + with warnings.catch_warnings(record=True) as w: + foo[1, N](ary, N) + + self.assertEqual(len(w), 0) + + def test_nowarn_on_device_array(self): + @cuda.jit + def foo(r, x): + r[0] = x + 1 + + N = 10 + ary = cuda.device_array(N, dtype=np.float32) + + with override_config('CUDA_WARN_ON_IMPLICIT_COPY', 1): + with warnings.catch_warnings(record=True) as w: + foo[1, N](ary, N) + + self.assertEqual(len(w), 0) + + def test_warn_on_debug_and_opt(self): + with warnings.catch_warnings(record=True) as w: + cuda.jit(debug=True, opt=True) + + self.assertEqual(len(w), 1) + self.assertIn('not supported by CUDA', str(w[0].message)) + + def test_warn_on_debug_and_opt_default(self): + with warnings.catch_warnings(record=True) as w: + cuda.jit(debug=True) + + self.assertEqual(len(w), 1) + self.assertIn('not supported by CUDA', str(w[0].message)) + + def test_no_warn_on_debug_and_no_opt(self): + with warnings.catch_warnings(record=True) as w: + cuda.jit(debug=True, opt=False) + + self.assertEqual(len(w), 0) + + def test_no_warn_with_no_debug_and_opt_kwargs(self): + with warnings.catch_warnings(record=True) as w: + cuda.jit() + + self.assertEqual(len(w), 0) + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/06/069ad718312002b3c0a162ef04ff183de7efe6fbca3f338dcc1d5b4ab467cda1/blob b/shared/package-files/06/069ad718312002b3c0a162ef04ff183de7efe6fbca3f338dcc1d5b4ab467cda1/blob new file mode 100644 index 0000000000000000000000000000000000000000..6afcd3e57ca04b4a6e200925f59a5318770b307c --- /dev/null +++ b/shared/package-files/06/069ad718312002b3c0a162ef04ff183de7efe6fbca3f338dcc1d5b4ab467cda1/blob @@ -0,0 +1,133 @@ +"""Tests for the minimum dependencies in README.rst and pyproject.toml""" + +import os +import re +from collections import defaultdict +from pathlib import Path + +import pytest + +import sklearn +from sklearn._min_dependencies import dependent_packages +from sklearn.utils.fixes import parse_version + +min_depencies_tag_to_packages_without_version = defaultdict(list) +for package, (min_version, extras) in dependent_packages.items(): + for extra in extras.split(", "): + min_depencies_tag_to_packages_without_version[extra].append(package) + +min_dependencies_tag_to_pyproject_section = { + "build": "build-system.requires", + "install": "project.dependencies", +} +for tag in min_depencies_tag_to_packages_without_version: + min_dependencies_tag_to_pyproject_section[tag] = ( + f"project.optional-dependencies.{tag}" + ) + + +def test_min_dependencies_readme(): + # Test that the minimum dependencies in the README.rst file are + # consistent with the minimum dependencies defined at the file: + # sklearn/_min_dependencies.py + + pattern = re.compile( + r"\.\. \|" + r"([A-Za-z-]+)" + r"MinVersion\| replace::" + r"( [0-9]+\.[0-9]+(\.[0-9]+)?)" + ) + + readme_path = Path(sklearn.__file__).parent.parent + readme_file = readme_path / "README.rst" + + if not os.path.exists(readme_file): + # Skip the test if the README.rst file is not available. + # For instance, when installing scikit-learn from wheels + pytest.skip("The README.rst file is not available.") + + with readme_file.open("r") as f: + for line in f: + matched = pattern.match(line) + + if not matched: + continue + + package, version = matched.group(0), matched.group(1) + package = package.lower() + + if package in dependent_packages: + version = parse_version(version) + min_version = parse_version(dependent_packages[package][0]) + + assert version == min_version, f"{package} has a mismatched version" + + +def check_pyproject_section( + pyproject_section, min_dependencies_tag, skip_version_check_for=None +): + # tomllib is available in Python 3.11 + tomllib = pytest.importorskip("tomllib") + + if skip_version_check_for is None: + skip_version_check_for = [] + + expected_packages = min_depencies_tag_to_packages_without_version[ + min_dependencies_tag + ] + + root_directory = Path(sklearn.__file__).parent.parent + pyproject_toml_path = root_directory / "pyproject.toml" + + if not pyproject_toml_path.exists(): + # Skip the test if the pyproject.toml file is not available. + # For instance, when installing scikit-learn from wheels + pytest.skip("pyproject.toml is not available.") + + with pyproject_toml_path.open("rb") as f: + pyproject_toml = tomllib.load(f) + + pyproject_section_keys = pyproject_section.split(".") + info = pyproject_toml + for key in pyproject_section_keys: + info = info[key] + + pyproject_build_min_versions = {} + for requirement in info: + if ">=" in requirement: + package, version = requirement.split(">=") + elif "==" in requirement: + package, version = requirement.split("==") + else: + raise NotImplementedError( + f"{requirement} not supported yet in this test. " + "Only >= and == are supported for version requirements" + ) + + pyproject_build_min_versions[package] = version + + assert sorted(pyproject_build_min_versions) == sorted(expected_packages) + + for package, version in pyproject_build_min_versions.items(): + version = parse_version(version) + expected_min_version = parse_version(dependent_packages[package][0]) + if package in skip_version_check_for: + continue + + assert version == expected_min_version, f"{package} has a mismatched version" + + +@pytest.mark.parametrize( + "min_dependencies_tag, pyproject_section", + min_dependencies_tag_to_pyproject_section.items(), +) +def test_min_dependencies_pyproject_toml(pyproject_section, min_dependencies_tag): + """Check versions in pyproject.toml is consistent with _min_dependencies.""" + # NumPy is more complex because build-time (>=1.25) and run-time (>=1.19.5) + # requirement currently don't match + skip_version_check_for = ["numpy"] if min_dependencies_tag == "build" else None + check_pyproject_section( + pyproject_section, + min_dependencies_tag, + skip_version_check_for=skip_version_check_for, + ) diff --git a/shared/package-files/06/069d4ee48ec2edb74e10982f4c730a0d8d39bd5c9f7d2cc97ff5322a179999ea/blob b/shared/package-files/06/069d4ee48ec2edb74e10982f4c730a0d8d39bd5c9f7d2cc97ff5322a179999ea/blob new file mode 100644 index 0000000000000000000000000000000000000000..0af360b48aa33ef101d0bca001227d09611dea6d --- /dev/null +++ b/shared/package-files/06/069d4ee48ec2edb74e10982f4c730a0d8d39bd5c9f7d2cc97ff5322a179999ea/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::special_bessel_y0(Tensor self) -> Tensor +inline at::Tensor special_bessel_y0(const at::Tensor & self) { + return at::_ops::special_bessel_y0::call(self); +} + +// aten::special_bessel_y0.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & special_bessel_y0_out(at::Tensor & out, const at::Tensor & self) { + return at::_ops::special_bessel_y0_out::call(self, out); +} +// aten::special_bessel_y0.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & special_bessel_y0_outf(const at::Tensor & self, at::Tensor & out) { + return at::_ops::special_bessel_y0_out::call(self, out); +} + +} diff --git a/shared/package-files/06/069d8f07866ea9e33218850c0e8d5d0a08397899e08d6983aae65c6e82e582fa/blob b/shared/package-files/06/069d8f07866ea9e33218850c0e8d5d0a08397899e08d6983aae65c6e82e582fa/blob new file mode 100644 index 0000000000000000000000000000000000000000..87ce9456a6211905f6ccd5da472e63b0b3bb2f25 --- /dev/null +++ b/shared/package-files/06/069d8f07866ea9e33218850c0e8d5d0a08397899e08d6983aae65c6e82e582fa/blob @@ -0,0 +1,472 @@ +from statsmodels.compat.platform import PLATFORM_WIN32 + +import numpy as np +from numpy.testing import assert_allclose, assert_equal +import pandas as pd +import pytest + +from statsmodels.multivariate.pca import PCA, pca +from statsmodels.multivariate.tests.results.datamlw import ( + data, + princomp1, + princomp2, +) +from statsmodels.tools.sm_exceptions import EstimationWarning, ValueWarning + +DECIMAL_5 = 0.00001 + + +class TestPCA: + @classmethod + def setup_class(cls): + rs = np.random.RandomState() + rs.seed(1234) + k = 3 + n = 100 + t = 200 + lam = 2 + + norm_rng = rs.standard_normal + e = norm_rng((t, n)) + f = norm_rng((t, k)) + b = rs.standard_gamma(lam, size=(k, n)) / lam + cls.x = f.dot(b) + e + cls.x_copy = cls.x + 0.0 + cls.rs = rs + + k = 3 + n = 300 + t = 200 + lam = 2 + + norm_rng = rs.standard_normal + e = norm_rng((t, n)) + f = norm_rng((t, k)) + b = rs.standard_gamma(lam, size=(k, n)) / lam + cls.x_wide = f.dot(b) + e + + @pytest.mark.smoke + @pytest.mark.thread_unsafe(reason="Uses matplotlib") + @pytest.mark.matplotlib + def test_smoke_plot_and_repr(self, close_figures): + pc = PCA(self.x) + pc.plot_scree() + pc.plot_scree(ncomp=10) + pc.plot_scree(log_scale=False) + pc.plot_scree(cumulative=True) + pc.plot_rsquare() + pc.plot_rsquare(ncomp=5) + # Additional smoke test + pc.__repr__() + pc = PCA(self.x, standardize=False) + pc.__repr__() + pc = PCA(self.x, standardize=False, demean=False) + pc.__repr__() + pc = PCA(self.x, ncomp=2, gls=True) + assert "GLS" in pc.__repr__() + # Check data for no changes + assert_equal(self.x, pc.data) + + def test_eig_svd_equiv(self): + # Test leading components since the tail end can differ + pc_eig = PCA(self.x) + pc_svd = PCA(self.x, method="svd") + + assert_allclose(pc_eig.projection, pc_svd.projection) + assert_allclose(np.abs(pc_eig.factors[:, :2]), np.abs(pc_svd.factors[:, :2])) + assert_allclose(np.abs(pc_eig.coeff[:2, :]), np.abs(pc_svd.coeff[:2, :])) + assert_allclose(pc_eig.eigenvals, pc_svd.eigenvals) + assert_allclose( + np.abs(pc_eig.eigenvecs[:, :2]), np.abs(pc_svd.eigenvecs[:, :2]) + ) + + pc_svd = PCA(self.x, method="svd", ncomp=2) + pc_nipals = PCA(self.x, method="nipals", ncomp=2) + assert_allclose( + np.abs(pc_nipals.factors), np.abs(pc_svd.factors), atol=DECIMAL_5 + ) + assert_allclose(np.abs(pc_nipals.coeff), np.abs(pc_svd.coeff), atol=DECIMAL_5) + assert_allclose(pc_nipals.eigenvals, pc_svd.eigenvals, atol=DECIMAL_5) + assert_allclose( + np.abs(pc_nipals.eigenvecs), np.abs(pc_svd.eigenvecs), atol=DECIMAL_5 + ) + # Check data for no changes + assert_equal(self.x, pc_svd.data) + # Check data for no changes + assert_equal(self.x, pc_eig.data) + # Check data for no changes + assert_equal(self.x, pc_nipals.data) + + def test_options(self): + pc = PCA(self.x) + pc_no_norm = PCA(self.x, normalize=False) + assert_allclose( + pc.factors.dot(pc.coeff), pc_no_norm.factors.dot(pc_no_norm.coeff) + ) + princomp = pc.factors + assert_allclose(princomp.T.dot(princomp), np.eye(100), atol=1e-5) + weights = pc_no_norm.coeff + assert_allclose(weights.T.dot(weights), np.eye(100), atol=1e-5) + + pc_10 = PCA(self.x, ncomp=10) + assert_allclose(pc.factors[:, :10], pc_10.factors) + assert_allclose(pc.coeff[:10, :], pc_10.coeff) + assert_allclose(pc.rsquare[: (10 + 1)], pc_10.rsquare) + assert_allclose(pc.eigenvals[:10], pc_10.eigenvals) + assert_allclose(pc.eigenvecs[:, :10], pc_10.eigenvecs) + + pc = PCA(self.x, standardize=False, normalize=False) + mu = self.x.mean(0) + xdm = self.x - mu + xpx = xdm.T.dot(xdm) + val, vec = np.linalg.eigh(xpx) + ind = np.argsort(val) + ind = ind[::-1] + val = val[ind] + vec = vec[:, ind] + assert_allclose(xdm, pc.transformed_data) + assert_allclose(val, pc.eigenvals) + assert_allclose(np.abs(vec), np.abs(pc.eigenvecs)) + assert_allclose(np.abs(pc.factors), np.abs(xdm.dot(vec))) + assert_allclose(pc.projection, xdm + mu) + + pc = PCA(self.x, standardize=False, demean=False, normalize=False) + x = self.x + xpx = x.T.dot(x) + val, vec = np.linalg.eigh(xpx) + ind = np.argsort(val) + ind = ind[::-1] + val = val[ind] + vec = vec[:, ind] + assert_allclose(x, pc.transformed_data) + assert_allclose(val, pc.eigenvals) + assert_allclose(np.abs(vec), np.abs(pc.eigenvecs)) + assert_allclose(np.abs(pc.factors), np.abs(x.dot(vec))) + + def test_against_reference(self): + # Test against MATLAB, which by default demeans but does not standardize + x = data.xo / 1000.0 + pc = PCA(x, normalize=False, standardize=False) + + ref = princomp1 + assert_allclose(np.abs(pc.factors), np.abs(ref.factors)) + assert_allclose(pc.factors.dot(pc.coeff) + x.mean(0), x) + assert_allclose(np.abs(pc.coeff), np.abs(ref.coef.T)) + assert_allclose(pc.factors.dot(pc.coeff), ref.factors.dot(ref.coef.T)) + + pc = PCA(x[:20], normalize=False, standardize=False) + mu = x[:20].mean(0) + ref = princomp2 + assert_allclose(np.abs(pc.factors), np.abs(ref.factors)) + assert_allclose(pc.factors.dot(pc.coeff) + mu, x[:20]) + assert_allclose(np.abs(pc.coeff), np.abs(ref.coef.T)) + assert_allclose(pc.factors.dot(pc.coeff), ref.factors.dot(ref.coef.T)) + + @pytest.mark.thread_unsafe(reason="Issues and checks warnings") + def test_warnings(self): + with pytest.warns(ValueWarning, match="The requested number of components"): + PCA(self.x, ncomp=300) + + rs = self.rs + x = rs.standard_normal((200, 1)) * np.ones(200) + with pytest.warns(EstimationWarning, match="Only"): + PCA(x, method="eig") + + def test_errors(self): + with pytest.raises(ValueError): + PCA(self.x, method="unknown") + with pytest.raises(ValueError): + PCA(self.x, missing="unknown") + with pytest.raises(ValueError): + PCA(self.x, tol=2.0) + with pytest.raises(ValueError): + PCA(np.nan * np.ones((200, 100)), tol=2.0) + + @pytest.mark.thread_unsafe(reason="Uses matplotlib") + @pytest.mark.matplotlib + def test_pandas(self, close_figures): + pc = PCA(pd.DataFrame(self.x)) + pc1 = PCA(self.x) + assert_allclose(pc.factors.values, pc1.factors) + pc.plot_scree() + pc.plot_scree(ncomp=10) + pc.plot_scree(log_scale=False) + pc.plot_rsquare() + pc.plot_rsquare(ncomp=5) + pc.project(2) + PCA(pd.DataFrame(self.x), ncomp=4, gls=True) + PCA(pd.DataFrame(self.x), ncomp=4, standardize=False) + + def test_gls_and_weights(self): + with pytest.raises(ValueError): + PCA(self.x, gls=True) + with pytest.raises(ValueError): + PCA(self.x, weights=np.array([1.0, 1.0])) + + # Pre-standardize to make comparison simple + x = self.x - self.x.mean(0) + x = x / (x**2.0).mean(0) + pc_gls = PCA(x, ncomp=1, standardize=False, demean=False, gls=True) + pc = PCA(x, ncomp=1, standardize=False, demean=False) + errors = x - pc.projection + var = (errors**2.0).mean(0) + weights = 1.0 / var + weights = weights / np.sqrt((weights**2.0).mean()) + + assert_allclose(weights, pc_gls.weights) + assert_equal(x, pc_gls.data) + assert_equal(x, pc.data) + + pc_weights = PCA(x, ncomp=1, standardize=False, demean=False, weights=weights) + + assert_allclose(weights, pc_weights.weights) + assert_allclose(np.abs(pc_weights.factors), np.abs(pc_gls.factors)) + + @pytest.mark.slow + def test_wide(self): + pc = PCA(self.x_wide) + assert_equal(pc.factors.shape[1], self.x_wide.shape[0]) + assert_equal(pc.eigenvecs.shape[1], min(np.array(self.x_wide.shape))) + + pc = PCA(pd.DataFrame(self.x_wide)) + assert_equal(pc.factors.shape[1], self.x_wide.shape[0]) + assert_equal(pc.eigenvecs.shape[1], min(np.array(self.x_wide.shape))) + + def test_projection(self): + pc = PCA(self.x, ncomp=5) + mu = self.x.mean(0) + demean_x = self.x - mu + coef = np.linalg.pinv(pc.factors).dot(demean_x) + direct = pc.factors.dot(coef) + assert_allclose(pc.projection, direct + mu) + + pc = PCA(self.x, standardize=False, ncomp=5) + coef = np.linalg.pinv(pc.factors).dot(demean_x) + direct = pc.factors.dot(coef) + assert_allclose(pc.projection, direct + mu) + + pc = PCA(self.x, standardize=False, demean=False, ncomp=5) + coef = np.linalg.pinv(pc.factors).dot(self.x) + direct = pc.factors.dot(coef) + assert_allclose(pc.projection, direct) + + pc = PCA(self.x, ncomp=5, gls=True) + mu = self.x.mean(0) + demean_x = self.x - mu + coef = np.linalg.pinv(pc.factors).dot(demean_x) + direct = pc.factors.dot(coef) + assert_allclose(pc.projection, direct + mu) + + pc = PCA(self.x, standardize=False, ncomp=5) + coef = np.linalg.pinv(pc.factors).dot(demean_x) + direct = pc.factors.dot(coef) + assert_allclose(pc.projection, direct + mu) + + pc = PCA(self.x, standardize=False, demean=False, ncomp=5, gls=True) + coef = np.linalg.pinv(pc.factors).dot(self.x) + direct = pc.factors.dot(coef) + assert_allclose(pc.projection, direct) + + # Test error for too many factors + project = pc.project + with pytest.raises(ValueError): + project(6) + + @pytest.mark.skipif(PLATFORM_WIN32, reason="Windows 32-bit") + def test_replace_missing(self): + x = self.x.copy() + x[::5, ::7] = np.nan + + pc = PCA(x, missing="drop-row") + x_dropped_row = x[np.logical_not(np.any(np.isnan(x), 1))] + pc_dropped = PCA(x_dropped_row) + assert_allclose(pc.projection, pc_dropped.projection) + assert_equal(x, pc.data) + + pc = PCA(x, missing="drop-col") + x_dropped_col = x[:, np.logical_not(np.any(np.isnan(x), 0))] + pc_dropped = PCA(x_dropped_col) + assert_allclose(pc.projection, pc_dropped.projection) + assert_equal(x, pc.data) + + pc = PCA(x, missing="drop-min") + if x_dropped_row.size > x_dropped_col.size: + x_dropped_min = x_dropped_row + else: + x_dropped_min = x_dropped_col + pc_dropped = PCA(x_dropped_min) + assert_allclose(pc.projection, pc_dropped.projection) + assert_equal(x, pc.data) + + pc = PCA(x, ncomp=3, missing="fill-em") + missing = np.isnan(x) + mu = np.nanmean(x, axis=0) + errors = x - mu + sigma = np.sqrt(np.nanmean(errors**2, axis=0)) + x_std = errors / sigma + x_std[missing] = 0.0 + last = x_std[missing] + delta = 1.0 + count = 0 + while delta > 5e-8: + pc_temp = PCA(x_std, ncomp=3, standardize=False, demean=False) + x_std[missing] = pc_temp.projection[missing] + current = x_std[missing] + diff = current - last + delta = np.sqrt(np.sum(diff**2)) / np.sqrt(np.sum(current**2)) + last = current + count += 1 + x = self.x + 0.0 + projection = pc_temp.projection * sigma + mu + x[missing] = projection[missing] + assert_allclose(pc._adjusted_data, x) + # Check data for no changes + assert_equal(self.x, self.x_copy) + + x = self.x + pc = PCA(x) + pc_dropped = PCA(x, missing="drop-row") + assert_allclose(pc.projection, pc_dropped.projection, atol=DECIMAL_5) + + pc_dropped = PCA(x, missing="drop-col") + assert_allclose(pc.projection, pc_dropped.projection, atol=DECIMAL_5) + + pc_dropped = PCA(x, missing="drop-min") + assert_allclose(pc.projection, pc_dropped.projection, atol=DECIMAL_5) + + pc = PCA(x, ncomp=3) + pc_dropped = PCA(x, ncomp=3, missing="fill-em") + assert_allclose(pc.projection, pc_dropped.projection, atol=DECIMAL_5) + + # Test too many missing for missing='fill-em' + x = self.x.copy() + x[:, :] = np.nan + with pytest.raises(ValueError): + PCA(x, missing="drop-row") + with pytest.raises(ValueError): + PCA(x, missing="drop-col") + with pytest.raises(ValueError): + PCA(x, missing="drop-min") + with pytest.raises(ValueError): + PCA(x, missing="fill-em") + + def test_rsquare(self): + x = self.x + 0.0 + mu = x.mean(0) + x_demean = x - mu + std = np.std(x, 0) + x_std = x_demean / std + + pc = PCA(self.x) + nvar = x.shape[1] + rsquare = np.zeros(nvar + 1) + tss = np.sum(x_std**2) + for i in range(nvar + 1): + errors = x_std - pc.project(i, transform=False, unweight=False) + rsquare[i] = 1.0 - np.sum(errors**2) / tss + assert_allclose(rsquare, pc.rsquare) + + pc = PCA(self.x, standardize=False) + tss = np.sum(x_demean**2) + for i in range(nvar + 1): + errors = x_demean - pc.project(i, transform=False, unweight=False) + rsquare[i] = 1.0 - np.sum(errors**2) / tss + assert_allclose(rsquare, pc.rsquare) + + pc = PCA(self.x, standardize=False, demean=False) + tss = np.sum(x**2) + for i in range(nvar + 1): + errors = x - pc.project(i, transform=False, unweight=False) + rsquare[i] = 1.0 - np.sum(errors**2) / tss + assert_allclose(rsquare, pc.rsquare) + + @pytest.mark.slow + def test_missing_dataframe(self): + x = self.x.copy() + x[::5, ::7] = np.nan + pc = PCA(x, ncomp=3, missing="fill-em") + + x = pd.DataFrame(x) + pc_df = PCA(x, ncomp=3, missing="fill-em") + assert_allclose(pc.coeff, pc_df.coeff) + assert_allclose(pc.factors, pc_df.factors) + + pc_df_nomissing = PCA(pd.DataFrame(self.x.copy()), ncomp=3) + assert isinstance(pc_df.coeff, type(pc_df_nomissing.coeff)) + assert isinstance(pc_df.data, type(pc_df_nomissing.data)) + assert isinstance(pc_df.eigenvals, type(pc_df_nomissing.eigenvals)) + assert isinstance(pc_df.eigenvecs, type(pc_df_nomissing.eigenvecs)) + + x = self.x.copy() + x[::5, ::7] = np.nan + x_df = pd.DataFrame(x) + pc = PCA(x, missing="drop-row") + pc_df = PCA(x_df, missing="drop-row") + assert_allclose(pc.coeff, pc_df.coeff) + assert_allclose(pc.factors, pc_df.factors) + + pc = PCA(x, missing="drop-col") + pc_df = PCA(x_df, missing="drop-col") + assert_allclose(pc.coeff, pc_df.coeff) + assert_allclose(pc.factors, pc_df.factors) + + pc = PCA(x, missing="drop-min") + pc_df = PCA(x_df, missing="drop-min") + assert_allclose(pc.coeff, pc_df.coeff) + assert_allclose(pc.factors, pc_df.factors) + + def test_equivalence(self): + x = self.x.copy() + assert_allclose(PCA(x).factors, pca(x)[0]) + + def test_equivalence_full_matrices(self): + x = self.x.copy() + pca_true = PCA(x, svd_full_matrices=True) + svd_full_matrices_true = pca_true.factors + assert pca_true._svd_full_matrices + pca_false = PCA(x) + svd_full_matrices_false = pca_false.factors + assert not pca_false._svd_full_matrices + assert_allclose(svd_full_matrices_true, svd_full_matrices_false) + + +def test_missing(): + data = np.empty((200, 50)) + data[0, 0] = np.nan + with pytest.raises(ValueError, match="data contains non-finite values"): + PCA(data) + + +def test_too_many_missing(): + rs = np.random.RandomState(83429421) + data = rs.standard_normal((200, 50)) + data[0, :-3] = np.nan + with pytest.raises(ValueError): + PCA(data, ncomp=5, missing="drop-col") + p = PCA(data, missing="drop-min") + assert max(p.factors.shape) == max(data.shape) - 1 + + +def test_prepare_data_all_nan(): + # GH: _prepare_data's all-NaN branch did + # `return np.empty(adj_data.shape[1]).fill(np.nan)`, but ndarray.fill() + # mutates in place and returns None, so the branch returned None + # instead of a NaN-filled array. + rs = np.random.RandomState(0) + data = rs.standard_normal((10, 4)) + p = PCA(data) + p._adjusted_data = np.full_like(data, np.nan) + + result = p._prepare_data() + assert result is not None + assert result.shape == (4,) + assert np.all(np.isnan(result)) + + +def test_gls_warning(): + rs = np.random.RandomState(83429421) + data = rs.standard_normal((400, 200)) + data[:, 1:] = data[:, :1] + 0.01 * data[:, 1:] + with pytest.warns(EstimationWarning, match="Many series are being down weighted"): + factors = PCA(data, ncomp=2, gls=True).factors + assert factors.shape == (data.shape[0], 2) diff --git a/shared/package-files/06/069eba747d07d88ba42cb4af2f869c43673a8d5510704abea38dddb7eb689976/blob b/shared/package-files/06/069eba747d07d88ba42cb4af2f869c43673a8d5510704abea38dddb7eb689976/blob new file mode 100644 index 0000000000000000000000000000000000000000..5ed6468e98264062680f311accace8866a9c9c22 Binary files /dev/null and b/shared/package-files/06/069eba747d07d88ba42cb4af2f869c43673a8d5510704abea38dddb7eb689976/blob differ diff --git a/shared/package-files/06/069ed4c1f7c830eee873c527155d75c9819c5d48d26b4361b2e3a041a35132df/blob b/shared/package-files/06/069ed4c1f7c830eee873c527155d75c9819c5d48d26b4361b2e3a041a35132df/blob new file mode 100644 index 0000000000000000000000000000000000000000..185756300556f2fe70b76c402113ec2bb2501ef4 --- /dev/null +++ b/shared/package-files/06/069ed4c1f7c830eee873c527155d75c9819c5d48d26b4361b2e3a041a35132df/blob @@ -0,0 +1,441 @@ +from sympy.concrete.summations import Sum +from sympy.core.basic import Basic +from sympy.core.containers import Tuple +from sympy.core.function import Lambda +from sympy.core.numbers import (Rational, nan, oo, pi) +from sympy.core.relational import Eq +from sympy.core.singleton import S +from sympy.core.symbol import (Symbol, symbols) +from sympy.functions.combinatorial.factorials import (FallingFactorial, binomial) +from sympy.functions.elementary.exponential import (exp, log) +from sympy.functions.elementary.trigonometric import (cos, sin) +from sympy.functions.special.delta_functions import DiracDelta +from sympy.integrals.integrals import integrate +from sympy.logic.boolalg import (And, Or) +from sympy.matrices.dense import Matrix +from sympy.sets.sets import Interval +from sympy.tensor.indexed import Indexed +from sympy.stats import (Die, Normal, Exponential, FiniteRV, P, E, H, variance, + density, given, independent, dependent, where, pspace, GaussianUnitaryEnsemble, + random_symbols, sample, Geometric, factorial_moment, Binomial, Hypergeometric, + DiscreteUniform, Poisson, characteristic_function, moment_generating_function, + BernoulliProcess, Variance, Expectation, Probability, Covariance, covariance, cmoment, + moment, median) +from sympy.stats.rv import (IndependentProductPSpace, rs_swap, Density, NamedArgsMixin, + RandomSymbol, sample_iter, PSpace, is_random, RandomIndexedSymbol, RandomMatrixSymbol) +from sympy.testing.pytest import raises, skip, XFAIL, warns_deprecated_sympy +from sympy.external import import_module +from sympy.core.numbers import comp +from sympy.stats.frv_types import BernoulliDistribution +from sympy.core.symbol import Dummy +from sympy.functions.elementary.piecewise import Piecewise + +def test_where(): + X, Y = Die('X'), Die('Y') + Z = Normal('Z', 0, 1) + + assert where(Z**2 <= 1).set == Interval(-1, 1) + assert where(Z**2 <= 1).as_boolean() == Interval(-1, 1).as_relational(Z.symbol) + assert where(And(X > Y, Y > 4)).as_boolean() == And( + Eq(X.symbol, 6), Eq(Y.symbol, 5)) + + assert len(where(X < 3).set) == 2 + assert 1 in where(X < 3).set + + X, Y = Normal('X', 0, 1), Normal('Y', 0, 1) + assert where(And(X**2 <= 1, X >= 0)).set == Interval(0, 1) + XX = given(X, And(X**2 <= 1, X >= 0)) + assert XX.pspace.domain.set == Interval(0, 1) + assert XX.pspace.domain.as_boolean() == \ + And(0 <= X.symbol, X.symbol**2 <= 1, -oo < X.symbol, X.symbol < oo) + + with raises(TypeError): + XX = given(X, X + 3) + + +def test_random_symbols(): + X, Y = Normal('X', 0, 1), Normal('Y', 0, 1) + + assert set(random_symbols(2*X + 1)) == {X} + assert set(random_symbols(2*X + Y)) == {X, Y} + assert set(random_symbols(2*X + Y.symbol)) == {X} + assert set(random_symbols(2)) == set() + + +def test_characteristic_function(): + # Imports I from sympy + from sympy.core.numbers import I + X = Normal('X',0,1) + Y = DiscreteUniform('Y', [1,2,7]) + Z = Poisson('Z', 2) + t = symbols('_t') + P = Lambda(t, exp(-t**2/2)) + Q = Lambda(t, exp(7*t*I)/3 + exp(2*t*I)/3 + exp(t*I)/3) + R = Lambda(t, exp(2 * exp(t*I) - 2)) + + + assert characteristic_function(X).dummy_eq(P) + assert characteristic_function(Y).dummy_eq(Q) + assert characteristic_function(Z).dummy_eq(R) + + +def test_moment_generating_function(): + + X = Normal('X',0,1) + Y = DiscreteUniform('Y', [1,2,7]) + Z = Poisson('Z', 2) + t = symbols('_t') + P = Lambda(t, exp(t**2/2)) + Q = Lambda(t, (exp(7*t)/3 + exp(2*t)/3 + exp(t)/3)) + R = Lambda(t, exp(2 * exp(t) - 2)) + + + assert moment_generating_function(X).dummy_eq(P) + assert moment_generating_function(Y).dummy_eq(Q) + assert moment_generating_function(Z).dummy_eq(R) + +def test_sample_iter(): + + X = Normal('X',0,1) + Y = DiscreteUniform('Y', [1, 2, 7]) + Z = Poisson('Z', 2) + + scipy = import_module('scipy') + if not scipy: + skip('Scipy is not installed. Abort tests') + expr = X**2 + 3 + iterator = sample_iter(expr) + + expr2 = Y**2 + 5*Y + 4 + iterator2 = sample_iter(expr2) + + expr3 = Z**3 + 4 + iterator3 = sample_iter(expr3) + + def is_iterator(obj): + if ( + hasattr(obj, '__iter__') and + (hasattr(obj, 'next') or + hasattr(obj, '__next__')) and + callable(obj.__iter__) and + obj.__iter__() is obj + ): + return True + else: + return False + assert is_iterator(iterator) + assert is_iterator(iterator2) + assert is_iterator(iterator3) + +def test_pspace(): + X, Y = Normal('X', 0, 1), Normal('Y', 0, 1) + x = Symbol('x') + + raises(ValueError, lambda: pspace(5 + 3)) + raises(ValueError, lambda: pspace(x < 1)) + assert pspace(X) == X.pspace + assert pspace(2*X + 1) == X.pspace + assert pspace(2*X + Y) == IndependentProductPSpace(Y.pspace, X.pspace) + +def test_rs_swap(): + X = Normal('x', 0, 1) + Y = Exponential('y', 1) + + XX = Normal('x', 0, 2) + YY = Normal('y', 0, 3) + + expr = 2*X + Y + assert expr.subs(rs_swap((X, Y), (YY, XX))) == 2*XX + YY + + +def test_RandomSymbol(): + + X = Normal('x', 0, 1) + Y = Normal('x', 0, 2) + assert X.symbol == Y.symbol + assert X != Y + + assert X.name == X.symbol.name + + X = Normal('lambda', 0, 1) # make sure we can use protected terms + X = Normal('Lambda', 0, 1) # make sure we can use SymPy terms + + +def test_RandomSymbol_diff(): + X = Normal('x', 0, 1) + assert (2*X).diff(X) + + +def test_random_symbol_no_pspace(): + x = RandomSymbol(Symbol('x')) + assert x.pspace == PSpace() + +def test_overlap(): + X = Normal('x', 0, 1) + Y = Normal('x', 0, 2) + + raises(ValueError, lambda: P(X > Y)) + + +def test_IndependentProductPSpace(): + X = Normal('X', 0, 1) + Y = Normal('Y', 0, 1) + px = X.pspace + py = Y.pspace + assert pspace(X + Y) == IndependentProductPSpace(px, py) + assert pspace(X + Y) == IndependentProductPSpace(py, px) + + +def test_E(): + assert E(5) == 5 + + +def test_H(): + X = Normal('X', 0, 1) + D = Die('D', sides = 4) + G = Geometric('G', 0.5) + assert H(X, X > 0) == -log(2)/2 + S.Half + log(pi)/2 + assert H(D, D > 2) == log(2) + assert comp(H(G).evalf().round(2), 1.39) + + +def test_Sample(): + X = Die('X', 6) + Y = Normal('Y', 0, 1) + z = Symbol('z', integer=True) + + scipy = import_module('scipy') + if not scipy: + skip('Scipy is not installed. Abort tests') + assert sample(X) in [1, 2, 3, 4, 5, 6] + assert isinstance(sample(X + Y), float) + + assert P(X + Y > 0, Y < 0, numsamples=10).is_number + assert E(X + Y, numsamples=10).is_number + assert E(X**2 + Y, numsamples=10).is_number + assert E((X + Y)**2, numsamples=10).is_number + assert variance(X + Y, numsamples=10).is_number + + raises(TypeError, lambda: P(Y > z, numsamples=5)) + + assert P(sin(Y) <= 1, numsamples=10) == 1.0 + assert P(sin(Y) <= 1, cos(Y) < 1, numsamples=10) == 1.0 + + assert all(i in range(1, 7) for i in density(X, numsamples=10)) + assert all(i in range(4, 7) for i in density(X, X>3, numsamples=10)) + + numpy = import_module('numpy') + if not numpy: + skip('Numpy is not installed. Abort tests') + #Test Issue #21563: Output of sample must be a float or array + assert isinstance(sample(X), (numpy.int32, numpy.int64)) + assert isinstance(sample(Y), numpy.float64) + assert isinstance(sample(X, size=2), numpy.ndarray) + + with warns_deprecated_sympy(): + sample(X, numsamples=2) + +@XFAIL +def test_samplingE(): + scipy = import_module('scipy') + if not scipy: + skip('Scipy is not installed. Abort tests') + Y = Normal('Y', 0, 1) + z = Symbol('z', integer=True) + assert E(Sum(1/z**Y, (z, 1, oo)), Y > 2, numsamples=3).is_number + + +def test_given(): + X = Normal('X', 0, 1) + Y = Normal('Y', 0, 1) + A = given(X, True) + B = given(X, Y > 2) + + assert X == A == B + + +def test_factorial_moment(): + X = Poisson('X', 2) + Y = Binomial('Y', 2, S.Half) + Z = Hypergeometric('Z', 4, 2, 2) + assert factorial_moment(X, 2) == 4 + assert factorial_moment(Y, 2) == S.Half + assert factorial_moment(Z, 2) == Rational(1, 3) + + x, y, z, l = symbols('x y z l') + Y = Binomial('Y', 2, y) + Z = Hypergeometric('Z', 10, 2, 3) + assert factorial_moment(Y, l) == y**2*FallingFactorial( + 2, l) + 2*y*(1 - y)*FallingFactorial(1, l) + (1 - y)**2*\ + FallingFactorial(0, l) + assert factorial_moment(Z, l) == 7*FallingFactorial(0, l)/\ + 15 + 7*FallingFactorial(1, l)/15 + FallingFactorial(2, l)/15 + + +def test_dependence(): + X, Y = Die('X'), Die('Y') + assert independent(X, 2*Y) + assert not dependent(X, 2*Y) + + X, Y = Normal('X', 0, 1), Normal('Y', 0, 1) + assert independent(X, Y) + assert dependent(X, 2*X) + + # Create a dependency + XX, YY = given(Tuple(X, Y), Eq(X + Y, 3)) + assert dependent(XX, YY) + +def test_dependent_finite(): + X, Y = Die('X'), Die('Y') + # Dependence testing requires symbolic conditions which currently break + # finite random variables + assert dependent(X, Y + X) + + XX, YY = given(Tuple(X, Y), X + Y > 5) # Create a dependency + assert dependent(XX, YY) + + +def test_normality(): + X, Y = Normal('X', 0, 1), Normal('Y', 0, 1) + x = Symbol('x', real=True) + z = Symbol('z', real=True) + dens = density(X - Y, Eq(X + Y, z)) + + assert integrate(dens(x), (x, -oo, oo)) == 1 + + +def test_Density(): + X = Die('X', 6) + d = Density(X) + assert d.doit() == density(X) + +def test_NamedArgsMixin(): + class Foo(Basic, NamedArgsMixin): + _argnames = 'foo', 'bar' + + a = Foo(S(1), S(2)) + + assert a.foo == 1 + assert a.bar == 2 + + raises(AttributeError, lambda: a.baz) + + class Bar(Basic, NamedArgsMixin): + pass + + raises(AttributeError, lambda: Bar(S(1), S(2)).foo) + +def test_density_constant(): + assert density(3)(2) == 0 + assert density(3)(3) == DiracDelta(0) + +def test_cmoment_constant(): + assert variance(3) == 0 + assert cmoment(3, 3) == 0 + assert cmoment(3, 4) == 0 + x = Symbol('x') + assert variance(x) == 0 + assert cmoment(x, 15) == 0 + assert cmoment(x, 0) == 1 + +def test_moment_constant(): + assert moment(3, 0) == 1 + assert moment(3, 1) == 3 + assert moment(3, 2) == 9 + x = Symbol('x') + assert moment(x, 2) == x**2 + +def test_median_constant(): + assert median(3) == 3 + x = Symbol('x') + assert median(x) == x + +def test_real(): + x = Normal('x', 0, 1) + assert x.is_real + + +def test_issue_10052(): + X = Exponential('X', 3) + assert P(X < oo) == 1 + assert P(X > oo) == 0 + assert P(X < 2, X > oo) == 0 + assert P(X < oo, X > oo) == 0 + assert P(X < oo, X > 2) == 1 + assert P(X < 3, X == 2) == 0 + raises(ValueError, lambda: P(1)) + raises(ValueError, lambda: P(X < 1, 2)) + +def test_issue_11934(): + density = {0: .5, 1: .5} + X = FiniteRV('X', density) + assert E(X) == 0.5 + assert P( X>= 2) == 0 + +def test_issue_8129(): + X = Exponential('X', 4) + assert P(X >= X) == 1 + assert P(X > X) == 0 + assert P(X > X+1) == 0 + +def test_issue_12237(): + X = Normal('X', 0, 1) + Y = Normal('Y', 0, 1) + U = P(X > 0, X) + V = P(Y < 0, X) + W = P(X + Y > 0, X) + assert W == P(X + Y > 0, X) + assert U == BernoulliDistribution(S.Half, S.Zero, S.One) + assert V == S.Half + +def test_is_random(): + X = Normal('X', 0, 1) + Y = Normal('Y', 0, 1) + a, b = symbols('a, b') + G = GaussianUnitaryEnsemble('U', 2) + B = BernoulliProcess('B', 0.9) + assert not is_random(a) + assert not is_random(a + b) + assert not is_random(a * b) + assert not is_random(Matrix([a**2, b**2])) + assert is_random(X) + assert is_random(X**2 + Y) + assert is_random(Y + b**2) + assert is_random(Y > 5) + assert is_random(B[3] < 1) + assert is_random(G) + assert is_random(X * Y * B[1]) + assert is_random(Matrix([[X, B[2]], [G, Y]])) + assert is_random(Eq(X, 4)) + +def test_issue_12283(): + x = symbols('x') + X = RandomSymbol(x) + Y = RandomSymbol('Y') + Z = RandomMatrixSymbol('Z', 2, 1) + W = RandomMatrixSymbol('W', 2, 1) + RI = RandomIndexedSymbol(Indexed('RI', 3)) + assert pspace(Z) == PSpace() + assert pspace(RI) == PSpace() + assert pspace(X) == PSpace() + assert E(X) == Expectation(X) + assert P(Y > 3) == Probability(Y > 3) + assert variance(X) == Variance(X) + assert variance(RI) == Variance(RI) + assert covariance(X, Y) == Covariance(X, Y) + assert covariance(W, Z) == Covariance(W, Z) + +def test_issue_6810(): + X = Die('X', 6) + Y = Normal('Y', 0, 1) + assert P(Eq(X, 2)) == S(1)/6 + assert P(Eq(Y, 0)) == 0 + assert P(Or(X > 2, X < 3)) == 1 + assert P(And(X > 3, X > 2)) == S(1)/2 + +def test_issue_20286(): + n, p = symbols('n p') + B = Binomial('B', n, p) + k = Dummy('k', integer = True) + eq = Sum(Piecewise((-p**k*(1 - p)**(-k + n)*log(p**k*(1 - p)**(-k + n)*binomial(n, k))*binomial(n, k), (k >= 0) & (k <= n)), (nan, True)), (k, 0, n)) + assert eq.dummy_eq(H(B)) diff --git a/shared/package-files/06/069f0d6d4cdf0f03e40bf33b01cac2fc3413cce89a528caef3f9c75f4a22ea76/blob b/shared/package-files/06/069f0d6d4cdf0f03e40bf33b01cac2fc3413cce89a528caef3f9c75f4a22ea76/blob new file mode 100644 index 0000000000000000000000000000000000000000..f33ceca30f2d00a32c290eb03727502bfb4b77dd --- /dev/null +++ b/shared/package-files/06/069f0d6d4cdf0f03e40bf33b01cac2fc3413cce89a528caef3f9c75f4a22ea76/blob @@ -0,0 +1,97 @@ +#pragma once +#include +#include +#include +#include +#include + +namespace py = pybind11; + +namespace c10::ivalue { + +// concrete ivalue Holder that hold a py::object +struct C10_EXPORT ConcretePyObjectHolder final : PyObjectHolder { + public: + static c10::intrusive_ptr create(py::object py_obj) { + return c10::make_intrusive(std::move(py_obj)); + } + + static c10::intrusive_ptr create(const py::handle& handle) { + py::gil_scoped_acquire ag; + return c10::make_intrusive( + handle.cast()); + } + + PyObject* getPyObject() override { + return py_obj_.ptr(); + } + + InferredType tryToInferType() override { + pybind11::gil_scoped_acquire ag; + return torch::jit::tryToInferType(py_obj_); + } + + IValue toIValue(const TypePtr& type, c10::optional N = c10::nullopt) + override { + pybind11::gil_scoped_acquire ag; + return torch::jit::toIValue(py_obj_, type, N); + } + + std::string toStr() override { + pybind11::gil_scoped_acquire ag; + return py::str(py_obj_); + } + + std::vector extractTensors() override { + // We could implement this entirely in C++ via pybind11 but it turns out to + // be substantially slower. Namely, the total time taken by markCompleted on + // a CUDAFuture is 21.5us with this implementation, but goes up to 58.7us + // when using C++. The reason is unclear. + try { + pybind11::gil_scoped_acquire ag; + static py::object& extractorFn = *new py::object( + py::module::import("torch._jit_internal").attr("_extract_tensors")); + return extractorFn(py_obj_).cast>(); + } catch (py::error_already_set& e) { + auto err = std::runtime_error( + c10::str("Cannot extract tensors from value: ", e.what())); + { + pybind11::gil_scoped_acquire ag; + e.restore(); + PyErr_Clear(); + } + throw err; + } + } + + // Note [Destructing py::object] + // ~~~~~~~~~~~~~~~~~~~~~~~~~~ + // + // (1) Why py_obj_ = py::none(); does not work. Because we also need to + // acquire GIL when destructing py::object of None that de-references None. + // https://docs.python.org/3/c-api/none.html#c.Py_RETURN_NONE + // + // https://stackoverflow.com/questions/15287590/why-should-py-increfpy-none-be-required-before-returning-py-none-in-c + // + // (2) Why we need to call dec_ref() explicitly. Because py::object of + // nullptr, on destruction, effectively does nothing because of it calls + // Py_XDECREF(NULL) underlying. + // https://docs.python.org/3/c-api/refcounting.html#c.Py_XDECREF + ~ConcretePyObjectHolder() override { + pybind11::gil_scoped_acquire ag; + py_obj_.dec_ref(); + // explicitly setting PyObject* to nullptr to prevent py::object's dtor to + // decref on the PyObject again. + py_obj_.ptr() = nullptr; + } + + // explicit construction to avoid errornous implicit conversion and + // copy-initialization + explicit ConcretePyObjectHolder(py::object py_obj) + : py_obj_(std::move(py_obj)) {} + + private: + py::object py_obj_; +}; + +} // namespace c10::ivalue diff --git a/shared/package-files/06/069ffbf6861f5711899f998744be7a77b7e156d3899cda37f05548160b640ccf/energy_views.py b/shared/package-files/06/069ffbf6861f5711899f998744be7a77b7e156d3899cda37f05548160b640ccf/energy_views.py new file mode 100644 index 0000000000000000000000000000000000000000..87699d28914078a8de4b99e59ebb74602f90a60b --- /dev/null +++ b/shared/package-files/06/069ffbf6861f5711899f998744be7a77b7e156d3899cda37f05548160b640ccf/energy_views.py @@ -0,0 +1,15 @@ +"""Fixed shared TRAIN energy-distribution model; no per-query fitting.""" +from pathlib import Path +import json +import numpy as np +from energy_prior_runtime import predict_energy_nodes +CONFIG=json.loads(Path(__file__).with_name('energy_prior.json').read_text()) +def eligible(row):return row.get('collision_energy') is None +def perturb_meta(meta,rows,selection,view): + assert meta.dtype==np.float32 and meta.shape==(len(rows),8) and 0<=view<3 + selection=np.asarray(selection,dtype=bool);assert selection.shape==(len(rows),) + assert np.array_equal(selection,np.asarray([eligible(q) for q in rows])) and np.array_equal(meta[:,6],selection.astype(np.float32)) + out=meta.copy() + if selection.any(): + indices=np.flatnonzero(selection);nodes=predict_energy_nodes([rows[i] for i in indices],CONFIG);out[indices,6]=0.;out[indices,7]=(nodes[:,view]/100.).astype(np.float32) + return out diff --git a/shared/package-files/06/06a0d61aa47624e544ab2f31ae6c858f4ef591cf8fba38a5695276edb13d3ecb/blob b/shared/package-files/06/06a0d61aa47624e544ab2f31ae6c858f4ef591cf8fba38a5695276edb13d3ecb/blob new file mode 100644 index 0000000000000000000000000000000000000000..7df75d0d0cdede36e72cdb3145fa7e9322b5cc27 Binary files /dev/null and b/shared/package-files/06/06a0d61aa47624e544ab2f31ae6c858f4ef591cf8fba38a5695276edb13d3ecb/blob differ diff --git a/shared/package-files/06/06a1fa254fd8466f82510151513bd68696779988974e6617aaa6992a5a5379bb/blob b/shared/package-files/06/06a1fa254fd8466f82510151513bd68696779988974e6617aaa6992a5a5379bb/blob new file mode 100644 index 0000000000000000000000000000000000000000..860f46781fb8638d9e7c5c708d65a6f75a94842f --- /dev/null +++ b/shared/package-files/06/06a1fa254fd8466f82510151513bd68696779988974e6617aaa6992a5a5379bb/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor diag_embed(const at::Tensor & self, int64_t offset=0, int64_t dim1=-2, int64_t dim2=-1); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/06/06a3179ec5e260fa1a94ccc46a49fa9980f18325b937650f174028ef13ee1956/blob b/shared/package-files/06/06a3179ec5e260fa1a94ccc46a49fa9980f18325b937650f174028ef13ee1956/blob new file mode 100644 index 0000000000000000000000000000000000000000..c524ac2b1cfcaaccaf5b0985a22a7576fd7e4f31 --- /dev/null +++ b/shared/package-files/06/06a3179ec5e260fa1a94ccc46a49fa9980f18325b937650f174028ef13ee1956/blob @@ -0,0 +1 @@ +import xml.parsers as parsers diff --git a/shared/package-files/06/06a420d1fa970ff4e600124f4960c2f87d9acedec1e7735f384d520ba99b5e22/blob b/shared/package-files/06/06a420d1fa970ff4e600124f4960c2f87d9acedec1e7735f384d520ba99b5e22/blob new file mode 100644 index 0000000000000000000000000000000000000000..bd21367ce73dc39658ab3c671c2ec2ebba5341f3 --- /dev/null +++ b/shared/package-files/06/06a420d1fa970ff4e600124f4960c2f87d9acedec1e7735f384d520ba99b5e22/blob @@ -0,0 +1,1139 @@ +""" +A module for reading dvi files output by TeX. Several limitations make +this not (currently) useful as a general-purpose dvi preprocessor, but +it is currently used by the pdf backend for processing usetex text. + +Interface:: + + with Dvi(filename, 72) as dvi: + # iterate over pages: + for page in dvi: + w, h, d = page.width, page.height, page.descent + for x, y, font, glyph, width in page.text: + fontname = font.texname + pointsize = font.size + ... + for x, y, height, width in page.boxes: + ... +""" + +from collections import namedtuple +import enum +from functools import lru_cache, partial, wraps +import logging +import os +from pathlib import Path +import re +import struct +import subprocess +import sys + +import numpy as np + +from matplotlib import _api, cbook + +_log = logging.getLogger(__name__) + +# Many dvi related files are looked for by external processes, require +# additional parsing, and are used many times per rendering, which is why they +# are cached using lru_cache(). + +# Dvi is a bytecode format documented in +# https://ctan.org/pkg/dvitype +# https://texdoc.org/serve/dvitype.pdf/0 +# +# The file consists of a preamble, some number of pages, a postamble, +# and a finale. Different opcodes are allowed in different contexts, +# so the Dvi object has a parser state: +# +# pre: expecting the preamble +# outer: between pages (followed by a page or the postamble, +# also e.g. font definitions are allowed) +# page: processing a page +# post_post: state after the postamble (our current implementation +# just stops reading) +# finale: the finale (unimplemented in our current implementation) + +_dvistate = enum.Enum('DviState', 'pre outer inpage post_post finale') + +# The marks on a page consist of text and boxes. A page also has dimensions. +Page = namedtuple('Page', 'text boxes height width descent') +Box = namedtuple('Box', 'x y height width') + + +# Also a namedtuple, for backcompat. +class Text(namedtuple('Text', 'x y font glyph width')): + """ + A glyph in the dvi file. + + The *x* and *y* attributes directly position the glyph. The *font*, + *glyph*, and *width* attributes are kept public for back-compatibility, + but users wanting to draw the glyph themselves are encouraged to instead + load the font specified by `font_path` at `font_size`, warp it with the + effects specified by `font_effects`, and load the glyph specified by + `glyph_name_or_index`. + """ + + def _get_pdftexmap_entry(self): + return PsfontsMap(find_tex_file("pdftex.map"))[self.font.texname] + + @property + def font_path(self): + """The `~pathlib.Path` to the font for this glyph.""" + psfont = self._get_pdftexmap_entry() + if psfont.filename is None: + raise ValueError("No usable font file found for {} ({}); " + "the font may lack a Type-1 version" + .format(psfont.psname.decode("ascii"), + psfont.texname.decode("ascii"))) + return Path(psfont.filename) + + @property + def font_size(self): + """The font size.""" + return self.font.size + + @property + def font_effects(self): + """ + The "font effects" dict for this glyph. + + This dict contains the values for this glyph of SlantFont and + ExtendFont (if any), read off :file:`pdftex.map`. + """ + return self._get_pdftexmap_entry().effects + + @property + def glyph_name_or_index(self): + """ + Either the glyph name or the native charmap glyph index. + + If :file:`pdftex.map` specifies an encoding for this glyph's font, that + is a mapping of glyph indices to Adobe glyph names; use it to convert + dvi indices to glyph names. Callers can then convert glyph names to + glyph indices (with FT_Get_Name_Index/get_name_index), and load the + glyph using FT_Load_Glyph/load_glyph. + + If :file:`pdftex.map` specifies no encoding, the indices directly map + to the font's "native" charmap; glyphs should directly load using + FT_Load_Char/load_char after selecting the native charmap. + """ + entry = self._get_pdftexmap_entry() + return (_parse_enc(entry.encoding)[self.glyph] + if entry.encoding is not None else self.glyph) + + +# Opcode argument parsing +# +# Each of the following functions takes a Dvi object and delta, which is the +# difference between the opcode and the minimum opcode with the same meaning. +# Dvi opcodes often encode the number of argument bytes in this delta. +_arg_mapping = dict( + # raw: Return delta as is. + raw=lambda dvi, delta: delta, + # u1: Read 1 byte as an unsigned number. + u1=lambda dvi, delta: dvi._read_arg(1, signed=False), + # u4: Read 4 bytes as an unsigned number. + u4=lambda dvi, delta: dvi._read_arg(4, signed=False), + # s4: Read 4 bytes as a signed number. + s4=lambda dvi, delta: dvi._read_arg(4, signed=True), + # slen: Read delta bytes as a signed number, or None if delta is None. + slen=lambda dvi, delta: dvi._read_arg(delta, signed=True) if delta else None, + # slen1: Read (delta + 1) bytes as a signed number. + slen1=lambda dvi, delta: dvi._read_arg(delta + 1, signed=True), + # ulen1: Read (delta + 1) bytes as an unsigned number. + ulen1=lambda dvi, delta: dvi._read_arg(delta + 1, signed=False), + # olen1: Read (delta + 1) bytes as an unsigned number if less than 4 bytes, + # as a signed number if 4 bytes. + olen1=lambda dvi, delta: dvi._read_arg(delta + 1, signed=(delta == 3)), +) + + +def _dispatch(table, min, max=None, state=None, args=('raw',)): + """ + Decorator for dispatch by opcode. Sets the values in *table* + from *min* to *max* to this method, adds a check that the Dvi state + matches *state* if not None, reads arguments from the file according + to *args*. + + Parameters + ---------- + table : dict[int, callable] + The dispatch table to be filled in. + + min, max : int + Range of opcodes that calls the registered function; *max* defaults to + *min*. + + state : _dvistate, optional + State of the Dvi object in which these opcodes are allowed. + + args : list[str], default: ['raw'] + Sequence of argument specifications: + + - 'raw': opcode minus minimum + - 'u1': read one unsigned byte + - 'u4': read four bytes, treat as an unsigned number + - 's4': read four bytes, treat as a signed number + - 'slen': read (opcode - minimum) bytes, treat as signed + - 'slen1': read (opcode - minimum + 1) bytes, treat as signed + - 'ulen1': read (opcode - minimum + 1) bytes, treat as unsigned + - 'olen1': read (opcode - minimum + 1) bytes, treat as unsigned + if under four bytes, signed if four bytes + """ + def decorate(method): + get_args = [_arg_mapping[x] for x in args] + + @wraps(method) + def wrapper(self, byte): + if state is not None and self.state != state: + raise ValueError("state precondition failed") + return method(self, *[f(self, byte-min) for f in get_args]) + if max is None: + table[min] = wrapper + else: + for i in range(min, max+1): + assert table[i] is None + table[i] = wrapper + return wrapper + return decorate + + +class Dvi: + """ + A reader for a dvi ("device-independent") file, as produced by TeX. + + The current implementation can only iterate through pages in order, + and does not even attempt to verify the postamble. + + This class can be used as a context manager to close the underlying + file upon exit. Pages can be read via iteration. Here is an overly + simple way to extract text without trying to detect whitespace:: + + >>> with matplotlib.dviread.Dvi('input.dvi', 72) as dvi: + ... for page in dvi: + ... print(''.join(chr(t.glyph) for t in page.text)) + """ + # dispatch table + _dtable = [None] * 256 + _dispatch = partial(_dispatch, _dtable) + + def __init__(self, filename, dpi): + """ + Read the data from the file named *filename* and convert + TeX's internal units to units of *dpi* per inch. + *dpi* only sets the units and does not limit the resolution. + Use None to return TeX's internal units. + """ + _log.debug('Dvi: %s', filename) + self.file = open(filename, 'rb') + self.dpi = dpi + self.fonts = {} + self.state = _dvistate.pre + self._missing_font = None + + def __enter__(self): + """Context manager enter method, does nothing.""" + return self + + def __exit__(self, etype, evalue, etrace): + """ + Context manager exit method, closes the underlying file if it is open. + """ + self.close() + + def __iter__(self): + """ + Iterate through the pages of the file. + + Yields + ------ + Page + Details of all the text and box objects on the page. + The Page tuple contains lists of Text and Box tuples and + the page dimensions, and the Text and Box tuples contain + coordinates transformed into a standard Cartesian + coordinate system at the dpi value given when initializing. + The coordinates are floating point numbers, but otherwise + precision is not lost and coordinate values are not clipped to + integers. + """ + while self._read(): + yield self._output() + + def close(self): + """Close the underlying file if it is open.""" + if not self.file.closed: + self.file.close() + + def _output(self): + """ + Output the text and boxes belonging to the most recent page. + page = dvi._output() + """ + minx = miny = np.inf + maxx = maxy = -np.inf + maxy_pure = -np.inf + for elt in self.text + self.boxes: + if isinstance(elt, Box): + x, y, h, w = elt + e = 0 # zero depth + else: # glyph + x, y, font, g, w = elt + h, e = font._height_depth_of(g) + minx = min(minx, x) + miny = min(miny, y - h) + maxx = max(maxx, x + w) + maxy = max(maxy, y + e) + maxy_pure = max(maxy_pure, y) + if self._baseline_v is not None: + maxy_pure = self._baseline_v # This should normally be the case. + self._baseline_v = None + + if not self.text and not self.boxes: # Avoid infs/nans from inf+/-inf. + return Page(text=[], boxes=[], width=0, height=0, descent=0) + + if self.dpi is None: + # special case for ease of debugging: output raw dvi coordinates + return Page(text=self.text, boxes=self.boxes, + width=maxx-minx, height=maxy_pure-miny, + descent=maxy-maxy_pure) + + # convert from TeX's "scaled points" to dpi units + d = self.dpi / (72.27 * 2**16) + descent = (maxy - maxy_pure) * d + + text = [Text((x-minx)*d, (maxy-y)*d - descent, f, g, w*d) + for (x, y, f, g, w) in self.text] + boxes = [Box((x-minx)*d, (maxy-y)*d - descent, h*d, w*d) + for (x, y, h, w) in self.boxes] + + return Page(text=text, boxes=boxes, width=(maxx-minx)*d, + height=(maxy_pure-miny)*d, descent=descent) + + def _read(self): + """ + Read one page from the file. Return True if successful, + False if there were no more pages. + """ + # Pages appear to start with the sequence + # bop (begin of page) + # xxx comment + # # if using chemformula + # down + # push + # down + # # if using xcolor + # down + # push + # down (possibly multiple) + # push <= here, v is the baseline position. + # etc. + # (dviasm is useful to explore this structure.) + # Thus, we use the vertical position at the first time the stack depth + # reaches 3, while at least three "downs" have been executed (excluding + # those popped out (corresponding to the chemformula preamble)), as the + # baseline (the "down" count is necessary to handle xcolor). + down_stack = [0] + self._baseline_v = None + while True: + byte = self.file.read(1)[0] + self._dtable[byte](self, byte) + if self._missing_font: + raise self._missing_font.to_exception() + name = self._dtable[byte].__name__ + if name == "_push": + down_stack.append(down_stack[-1]) + elif name == "_pop": + down_stack.pop() + elif name == "_down": + down_stack[-1] += 1 + if (self._baseline_v is None + and len(getattr(self, "stack", [])) == 3 + and down_stack[-1] >= 4): + self._baseline_v = self.v + if byte == 140: # end of page + return True + if self.state is _dvistate.post_post: # end of file + self.close() + return False + + def _read_arg(self, nbytes, signed=False): + """ + Read and return a big-endian integer *nbytes* long. + Signedness is determined by the *signed* keyword. + """ + return int.from_bytes(self.file.read(nbytes), "big", signed=signed) + + @_dispatch(min=0, max=127, state=_dvistate.inpage) + def _set_char_immediate(self, char): + self._put_char_real(char) + if isinstance(self.fonts[self.f], cbook._ExceptionInfo): + return + self.h += self.fonts[self.f]._width_of(char) + + @_dispatch(min=128, max=131, state=_dvistate.inpage, args=('olen1',)) + def _set_char(self, char): + self._put_char_real(char) + if isinstance(self.fonts[self.f], cbook._ExceptionInfo): + return + self.h += self.fonts[self.f]._width_of(char) + + @_dispatch(132, state=_dvistate.inpage, args=('s4', 's4')) + def _set_rule(self, a, b): + self._put_rule_real(a, b) + self.h += b + + @_dispatch(min=133, max=136, state=_dvistate.inpage, args=('olen1',)) + def _put_char(self, char): + self._put_char_real(char) + + def _put_char_real(self, char): + font = self.fonts[self.f] + if isinstance(font, cbook._ExceptionInfo): + self._missing_font = font + elif font._vf is None: + self.text.append(Text(self.h, self.v, font, char, + font._width_of(char))) + else: + scale = font._scale + for x, y, f, g, w in font._vf[char].text: + newf = DviFont(scale=_mul2012(scale, f._scale), + tfm=f._tfm, texname=f.texname, vf=f._vf) + self.text.append(Text(self.h + _mul2012(x, scale), + self.v + _mul2012(y, scale), + newf, g, newf._width_of(g))) + self.boxes.extend([Box(self.h + _mul2012(x, scale), + self.v + _mul2012(y, scale), + _mul2012(a, scale), _mul2012(b, scale)) + for x, y, a, b in font._vf[char].boxes]) + + @_dispatch(137, state=_dvistate.inpage, args=('s4', 's4')) + def _put_rule(self, a, b): + self._put_rule_real(a, b) + + def _put_rule_real(self, a, b): + if a > 0 and b > 0: + self.boxes.append(Box(self.h, self.v, a, b)) + + @_dispatch(138) + def _nop(self, _): + pass + + @_dispatch(139, state=_dvistate.outer, args=('s4',)*11) + def _bop(self, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, p): + self.state = _dvistate.inpage + self.h = self.v = self.w = self.x = self.y = self.z = 0 + self.stack = [] + self.text = [] # list of Text objects + self.boxes = [] # list of Box objects + + @_dispatch(140, state=_dvistate.inpage) + def _eop(self, _): + self.state = _dvistate.outer + del self.h, self.v, self.w, self.x, self.y, self.z, self.stack + + @_dispatch(141, state=_dvistate.inpage) + def _push(self, _): + self.stack.append((self.h, self.v, self.w, self.x, self.y, self.z)) + + @_dispatch(142, state=_dvistate.inpage) + def _pop(self, _): + self.h, self.v, self.w, self.x, self.y, self.z = self.stack.pop() + + @_dispatch(min=143, max=146, state=_dvistate.inpage, args=('slen1',)) + def _right(self, b): + self.h += b + + @_dispatch(min=147, max=151, state=_dvistate.inpage, args=('slen',)) + def _right_w(self, new_w): + if new_w is not None: + self.w = new_w + self.h += self.w + + @_dispatch(min=152, max=156, state=_dvistate.inpage, args=('slen',)) + def _right_x(self, new_x): + if new_x is not None: + self.x = new_x + self.h += self.x + + @_dispatch(min=157, max=160, state=_dvistate.inpage, args=('slen1',)) + def _down(self, a): + self.v += a + + @_dispatch(min=161, max=165, state=_dvistate.inpage, args=('slen',)) + def _down_y(self, new_y): + if new_y is not None: + self.y = new_y + self.v += self.y + + @_dispatch(min=166, max=170, state=_dvistate.inpage, args=('slen',)) + def _down_z(self, new_z): + if new_z is not None: + self.z = new_z + self.v += self.z + + @_dispatch(min=171, max=234, state=_dvistate.inpage) + def _fnt_num_immediate(self, k): + self.f = k + + @_dispatch(min=235, max=238, state=_dvistate.inpage, args=('olen1',)) + def _fnt_num(self, new_f): + self.f = new_f + + @_dispatch(min=239, max=242, args=('ulen1',)) + def _xxx(self, datalen): + special = self.file.read(datalen) + _log.debug( + 'Dvi._xxx: encountered special: %s', + ''.join([chr(ch) if 32 <= ch < 127 else '<%02x>' % ch + for ch in special])) + + @_dispatch(min=243, max=246, args=('olen1', 'u4', 'u4', 'u4', 'u1', 'u1')) + def _fnt_def(self, k, c, s, d, a, l): + self._fnt_def_real(k, c, s, d, a, l) + + def _fnt_def_real(self, k, c, s, d, a, l): + n = self.file.read(a + l) + fontname = n[-l:].decode('ascii') + try: + tfm = _tfmfile(fontname) + except FileNotFoundError as exc: + # Explicitly allow defining missing fonts for Vf support; we only + # register an error when trying to load a glyph from a missing font + # and throw that error in Dvi._read. For Vf, _finalize_packet + # checks whether a missing glyph has been used, and in that case + # skips the glyph definition. + self.fonts[k] = cbook._ExceptionInfo.from_exception(exc) + return + if c != 0 and tfm.checksum != 0 and c != tfm.checksum: + raise ValueError(f'tfm checksum mismatch: {n}') + try: + vf = _vffile(fontname) + except FileNotFoundError: + vf = None + self.fonts[k] = DviFont(scale=s, tfm=tfm, texname=n, vf=vf) + + @_dispatch(247, state=_dvistate.pre, args=('u1', 'u4', 'u4', 'u4', 'u1')) + def _pre(self, i, num, den, mag, k): + self.file.read(k) # comment in the dvi file + if i != 2: + raise ValueError(f"Unknown dvi format {i}") + if num != 25400000 or den != 7227 * 2**16: + raise ValueError("Nonstandard units in dvi file") + # meaning: TeX always uses those exact values, so it + # should be enough for us to support those + # (There are 72.27 pt to an inch so 7227 pt = + # 7227 * 2**16 sp to 100 in. The numerator is multiplied + # by 10^5 to get units of 10**-7 meters.) + if mag != 1000: + raise ValueError("Nonstandard magnification in dvi file") + # meaning: LaTeX seems to frown on setting \mag, so + # I think we can assume this is constant + self.state = _dvistate.outer + + @_dispatch(248, state=_dvistate.outer) + def _post(self, _): + self.state = _dvistate.post_post + # TODO: actually read the postamble and finale? + # currently post_post just triggers closing the file + + @_dispatch(249) + def _post_post(self, _): + raise NotImplementedError + + @_dispatch(min=250, max=255) + def _malformed(self, offset): + raise ValueError(f"unknown command: byte {250 + offset}") + + +class DviFont: + """ + Encapsulation of a font that a DVI file can refer to. + + This class holds a font's texname and size, supports comparison, + and knows the widths of glyphs in the same units as the AFM file. + There are also internal attributes (for use by dviread.py) that + are *not* used for comparison. + + The size is in Adobe points (converted from TeX points). + + Parameters + ---------- + scale : float + Factor by which the font is scaled from its natural size. + tfm : Tfm + TeX font metrics for this font + texname : bytes + Name of the font as used internally by TeX and friends, as an ASCII + bytestring. This is usually very different from any external font + names; `PsfontsMap` can be used to find the external name of the font. + vf : Vf + A TeX "virtual font" file, or None if this font is not virtual. + + Attributes + ---------- + texname : bytes + size : float + Size of the font in Adobe points, converted from the slightly + smaller TeX points. + widths : list + Widths of glyphs in glyph-space units, typically 1/1000ths of + the point size. + + """ + __slots__ = ('texname', 'size', 'widths', '_scale', '_vf', '_tfm') + + def __init__(self, scale, tfm, texname, vf): + _api.check_isinstance(bytes, texname=texname) + self._scale = scale + self._tfm = tfm + self.texname = texname + self._vf = vf + self.size = scale * (72.0 / (72.27 * 2**16)) + try: + nchars = max(tfm.width) + 1 + except ValueError: + nchars = 0 + self.widths = [(1000*tfm.width.get(char, 0)) >> 20 + for char in range(nchars)] + + def __eq__(self, other): + return (type(self) is type(other) + and self.texname == other.texname and self.size == other.size) + + def __ne__(self, other): + return not self.__eq__(other) + + def __repr__(self): + return f"<{type(self).__name__}: {self.texname}>" + + def _width_of(self, char): + """Width of char in dvi units.""" + width = self._tfm.width.get(char, None) + if width is not None: + return _mul2012(width, self._scale) + _log.debug('No width for char %d in font %s.', char, self.texname) + return 0 + + def _height_depth_of(self, char): + """Height and depth of char in dvi units.""" + result = [] + for metric, name in ((self._tfm.height, "height"), + (self._tfm.depth, "depth")): + value = metric.get(char, None) + if value is None: + _log.debug('No %s for char %d in font %s', + name, char, self.texname) + result.append(0) + else: + result.append(_mul2012(value, self._scale)) + # cmsyXX (symbols font) glyph 0 ("minus") has a nonzero descent + # so that TeX aligns equations properly + # (https://tex.stackexchange.com/q/526103/) + # but we actually care about the rasterization depth to align + # the dvipng-generated images. + if re.match(br'^cmsy\d+$', self.texname) and char == 0: + result[-1] = 0 + return result + + +class Vf(Dvi): + r""" + A virtual font (\*.vf file) containing subroutines for dvi files. + + Parameters + ---------- + filename : str or path-like + + Notes + ----- + The virtual font format is a derivative of dvi: + http://mirrors.ctan.org/info/knuth/virtual-fonts + This class reuses some of the machinery of `Dvi` + but replaces the `_read` loop and dispatch mechanism. + + Examples + -------- + :: + + vf = Vf(filename) + glyph = vf[code] + glyph.text, glyph.boxes, glyph.width + """ + + def __init__(self, filename): + super().__init__(filename, 0) + try: + self._first_font = None + self._chars = {} + self._read() + finally: + self.close() + + def __getitem__(self, code): + return self._chars[code] + + def _read(self): + """ + Read one page from the file. Return True if successful, + False if there were no more pages. + """ + packet_char = packet_ends = None + packet_len = packet_width = None + while True: + byte = self.file.read(1)[0] + # If we are in a packet, execute the dvi instructions + if self.state is _dvistate.inpage: + byte_at = self.file.tell()-1 + if byte_at == packet_ends: + self._finalize_packet(packet_char, packet_width) + packet_len = packet_char = packet_width = None + # fall through to out-of-packet code + elif byte_at > packet_ends: + raise ValueError("Packet length mismatch in vf file") + else: + if byte in (139, 140) or byte >= 243: + raise ValueError(f"Inappropriate opcode {byte} in vf file") + Dvi._dtable[byte](self, byte) + continue + + # We are outside a packet + if byte < 242: # a short packet (length given by byte) + packet_len = byte + packet_char = self._read_arg(1) + packet_width = self._read_arg(3) + packet_ends = self._init_packet(byte) + self.state = _dvistate.inpage + elif byte == 242: # a long packet + packet_len = self._read_arg(4) + packet_char = self._read_arg(4) + packet_width = self._read_arg(4) + self._init_packet(packet_len) + elif 243 <= byte <= 246: + k = self._read_arg(byte - 242, byte == 246) + c = self._read_arg(4) + s = self._read_arg(4) + d = self._read_arg(4) + a = self._read_arg(1) + l = self._read_arg(1) + self._fnt_def_real(k, c, s, d, a, l) + if self._first_font is None: + self._first_font = k + elif byte == 247: # preamble + i = self._read_arg(1) + k = self._read_arg(1) + x = self.file.read(k) + cs = self._read_arg(4) + ds = self._read_arg(4) + self._pre(i, x, cs, ds) + elif byte == 248: # postamble (just some number of 248s) + break + else: + raise ValueError(f"Unknown vf opcode {byte}") + + def _init_packet(self, pl): + if self.state != _dvistate.outer: + raise ValueError("Misplaced packet in vf file") + self.h = self.v = self.w = self.x = self.y = self.z = 0 + self.stack = [] + self.text = [] + self.boxes = [] + self.f = self._first_font + self._missing_font = None + return self.file.tell() + pl + + def _finalize_packet(self, packet_char, packet_width): + if not self._missing_font: # Otherwise we don't have full glyph definition. + self._chars[packet_char] = Page( + text=self.text, boxes=self.boxes, width=packet_width, + height=None, descent=None) + self.state = _dvistate.outer + + def _pre(self, i, x, cs, ds): + if self.state is not _dvistate.pre: + raise ValueError("pre command in middle of vf file") + if i != 202: + raise ValueError(f"Unknown vf format {i}") + if len(x): + _log.debug('vf file comment: %s', x) + self.state = _dvistate.outer + # cs = checksum, ds = design size + + +def _mul2012(num1, num2): + """Multiply two numbers in 20.12 fixed point format.""" + # Separated into a function because >> has surprising precedence + return (num1*num2) >> 20 + + +class Tfm: + """ + A TeX Font Metric file. + + This implementation covers only the bare minimum needed by the Dvi class. + + Parameters + ---------- + filename : str or path-like + + Attributes + ---------- + checksum : int + Used for verifying against the dvi file. + design_size : int + Design size of the font (unknown units) + width, height, depth : dict + Dimensions of each character, need to be scaled by the factor + specified in the dvi file. These are dicts because indexing may + not start from 0. + """ + __slots__ = ('checksum', 'design_size', 'width', 'height', 'depth') + + def __init__(self, filename): + _log.debug('opening tfm file %s', filename) + with open(filename, 'rb') as file: + header1 = file.read(24) + lh, bc, ec, nw, nh, nd = struct.unpack('!6H', header1[2:14]) + _log.debug('lh=%d, bc=%d, ec=%d, nw=%d, nh=%d, nd=%d', + lh, bc, ec, nw, nh, nd) + header2 = file.read(4*lh) + self.checksum, self.design_size = struct.unpack('!2I', header2[:8]) + # there is also encoding information etc. + char_info = file.read(4*(ec-bc+1)) + widths = struct.unpack(f'!{nw}i', file.read(4*nw)) + heights = struct.unpack(f'!{nh}i', file.read(4*nh)) + depths = struct.unpack(f'!{nd}i', file.read(4*nd)) + self.width = {} + self.height = {} + self.depth = {} + for idx, char in enumerate(range(bc, ec+1)): + byte0 = char_info[4*idx] + byte1 = char_info[4*idx+1] + self.width[char] = widths[byte0] + self.height[char] = heights[byte1 >> 4] + self.depth[char] = depths[byte1 & 0xf] + + +PsFont = namedtuple('PsFont', 'texname psname effects encoding filename') + + +class PsfontsMap: + """ + A psfonts.map formatted file, mapping TeX fonts to PS fonts. + + Parameters + ---------- + filename : str or path-like + + Notes + ----- + For historical reasons, TeX knows many Type-1 fonts by different + names than the outside world. (For one thing, the names have to + fit in eight characters.) Also, TeX's native fonts are not Type-1 + but Metafont, which is nontrivial to convert to PostScript except + as a bitmap. While high-quality conversions to Type-1 format exist + and are shipped with modern TeX distributions, we need to know + which Type-1 fonts are the counterparts of which native fonts. For + these reasons a mapping is needed from internal font names to font + file names. + + A texmf tree typically includes mapping files called e.g. + :file:`psfonts.map`, :file:`pdftex.map`, or :file:`dvipdfm.map`. + The file :file:`psfonts.map` is used by :program:`dvips`, + :file:`pdftex.map` by :program:`pdfTeX`, and :file:`dvipdfm.map` + by :program:`dvipdfm`. :file:`psfonts.map` might avoid embedding + the 35 PostScript fonts (i.e., have no filename for them, as in + the Times-Bold example above), while the pdf-related files perhaps + only avoid the "Base 14" pdf fonts. But the user may have + configured these files differently. + + Examples + -------- + >>> map = PsfontsMap(find_tex_file('pdftex.map')) + >>> entry = map[b'ptmbo8r'] + >>> entry.texname + b'ptmbo8r' + >>> entry.psname + b'Times-Bold' + >>> entry.encoding + '/usr/local/texlive/2008/texmf-dist/fonts/enc/dvips/base/8r.enc' + >>> entry.effects + {'slant': 0.16700000000000001} + >>> entry.filename + """ + __slots__ = ('_filename', '_unparsed', '_parsed') + + # Create a filename -> PsfontsMap cache, so that calling + # `PsfontsMap(filename)` with the same filename a second time immediately + # returns the same object. + @lru_cache + def __new__(cls, filename): + self = object.__new__(cls) + self._filename = os.fsdecode(filename) + # Some TeX distributions have enormous pdftex.map files which would + # take hundreds of milliseconds to parse, but it is easy enough to just + # store the unparsed lines (keyed by the first word, which is the + # texname) and parse them on-demand. + with open(filename, 'rb') as file: + self._unparsed = {} + for line in file: + tfmname = line.split(b' ', 1)[0] + self._unparsed.setdefault(tfmname, []).append(line) + self._parsed = {} + return self + + def __getitem__(self, texname): + assert isinstance(texname, bytes) + if texname in self._unparsed: + for line in self._unparsed.pop(texname): + if self._parse_and_cache_line(line): + break + try: + return self._parsed[texname] + except KeyError: + raise LookupError( + f"An associated PostScript font (required by Matplotlib) " + f"could not be found for TeX font {texname.decode('ascii')!r} " + f"in {self._filename!r}; this problem can often be solved by " + f"installing a suitable PostScript font package in your TeX " + f"package manager") from None + + def _parse_and_cache_line(self, line): + """ + Parse a line in the font mapping file. + + The format is (partially) documented at + http://mirrors.ctan.org/systems/doc/pdftex/manual/pdftex-a.pdf + https://tug.org/texinfohtml/dvips.html#psfonts_002emap + Each line can have the following fields: + + - tfmname (first, only required field), + - psname (defaults to tfmname, must come immediately after tfmname if + present), + - fontflags (integer, must come immediately after psname if present, + ignored by us), + - special (SlantFont and ExtendFont, only field that is double-quoted), + - fontfile, encodingfile (optional, prefixed by <, <<, or <[; << always + precedes a font, <[ always precedes an encoding, < can precede either + but then an encoding file must have extension .enc; < and << also + request different font subsetting behaviors but we ignore that; < can + be separated from the filename by whitespace). + + special, fontfile, and encodingfile can appear in any order. + """ + # If the map file specifies multiple encodings for a font, we + # follow pdfTeX in choosing the last one specified. Such + # entries are probably mistakes but they have occurred. + # https://tex.stackexchange.com/q/10826/ + + if not line or line.startswith((b" ", b"%", b"*", b";", b"#")): + return + tfmname = basename = special = encodingfile = fontfile = None + is_subsetted = is_t1 = is_truetype = False + matches = re.finditer(br'"([^"]*)(?:"|$)|(\S+)', line) + for match in matches: + quoted, unquoted = match.groups() + if unquoted: + if unquoted.startswith(b"<<"): # font + fontfile = unquoted[2:] + elif unquoted.startswith(b"<["): # encoding + encodingfile = unquoted[2:] + elif unquoted.startswith(b"<"): # font or encoding + word = ( + # foo + unquoted[1:] + # < by itself => read the next word + or next(filter(None, next(matches).groups()))) + if word.endswith(b".enc"): + encodingfile = word + else: + fontfile = word + is_subsetted = True + elif tfmname is None: + tfmname = unquoted + elif basename is None: + basename = unquoted + elif quoted: + special = quoted + effects = {} + if special: + words = reversed(special.split()) + for word in words: + if word == b"SlantFont": + effects["slant"] = float(next(words)) + elif word == b"ExtendFont": + effects["extend"] = float(next(words)) + + # Verify some properties of the line that would cause it to be ignored + # otherwise. + if fontfile is not None: + if fontfile.endswith((b".ttf", b".ttc")): + is_truetype = True + elif not fontfile.endswith(b".otf"): + is_t1 = True + elif basename is not None: + is_t1 = True + if is_truetype and is_subsetted and encodingfile is None: + return + if not is_t1 and ("slant" in effects or "extend" in effects): + return + if abs(effects.get("slant", 0)) > 1: + return + if abs(effects.get("extend", 0)) > 2: + return + + if basename is None: + basename = tfmname + if encodingfile is not None: + encodingfile = find_tex_file(encodingfile) + if fontfile is not None: + fontfile = find_tex_file(fontfile) + self._parsed[tfmname] = PsFont( + texname=tfmname, psname=basename, effects=effects, + encoding=encodingfile, filename=fontfile) + return True + + +def _parse_enc(path): + r""" + Parse a \*.enc file referenced from a psfonts.map style file. + + The format supported by this function is a tiny subset of PostScript. + + Parameters + ---------- + path : `os.PathLike` + + Returns + ------- + list + The nth entry of the list is the PostScript glyph name of the nth + glyph. + """ + no_comments = re.sub("%.*", "", Path(path).read_text(encoding="ascii")) + array = re.search(r"(?s)\[(.*)\]", no_comments).group(1) + lines = [line for line in array.split() if line] + if all(line.startswith("/") for line in lines): + return [line[1:] for line in lines] + else: + raise ValueError(f"Failed to parse {path} as Postscript encoding") + + +class _LuatexKpsewhich: + @lru_cache # A singleton. + def __new__(cls): + self = object.__new__(cls) + self._proc = self._new_proc() + return self + + def _new_proc(self): + return subprocess.Popen( + ["luatex", "--luaonly", + str(cbook._get_data_path("kpsewhich.lua"))], + stdin=subprocess.PIPE, stdout=subprocess.PIPE) + + def search(self, filename): + if self._proc.poll() is not None: # Dead, restart it. + self._proc = self._new_proc() + self._proc.stdin.write(os.fsencode(filename) + b"\n") + self._proc.stdin.flush() + out = self._proc.stdout.readline().rstrip() + return None if out == b"nil" else os.fsdecode(out) + + +@lru_cache +def find_tex_file(filename): + """ + Find a file in the texmf tree using kpathsea_. + + The kpathsea library, provided by most existing TeX distributions, both + on Unix-like systems and on Windows (MikTeX), is invoked via a long-lived + luatex process if luatex is installed, or via kpsewhich otherwise. + + .. _kpathsea: https://www.tug.org/kpathsea/ + + Parameters + ---------- + filename : str or path-like + + Raises + ------ + FileNotFoundError + If the file is not found. + """ + + # we expect these to always be ascii encoded, but use utf-8 + # out of caution + if isinstance(filename, bytes): + filename = filename.decode('utf-8', errors='replace') + + try: + lk = _LuatexKpsewhich() + except FileNotFoundError: + lk = None # Fallback to directly calling kpsewhich, as below. + + if lk: + path = lk.search(filename) + else: + if sys.platform == 'win32': + # On Windows only, kpathsea can use utf-8 for cmd args and output. + # The `command_line_encoding` environment variable is set to force + # it to always use utf-8 encoding. See Matplotlib issue #11848. + kwargs = {'env': {**os.environ, 'command_line_encoding': 'utf-8'}, + 'encoding': 'utf-8'} + else: # On POSIX, run through the equivalent of os.fsdecode(). + kwargs = {'encoding': sys.getfilesystemencoding(), + 'errors': 'surrogateescape'} + + try: + path = (cbook._check_and_log_subprocess(['kpsewhich', filename], + _log, **kwargs) + .rstrip('\n')) + except (FileNotFoundError, RuntimeError): + path = None + + if path: + return path + else: + raise FileNotFoundError( + f"Matplotlib's TeX implementation searched for a file named " + f"{filename!r} in your texmf tree, but could not find it") + + +@lru_cache +def _fontfile(cls, suffix, texname): + return cls(find_tex_file(texname + suffix)) + + +_tfmfile = partial(_fontfile, Tfm, ".tfm") +_vffile = partial(_fontfile, Vf, ".vf") + + +if __name__ == '__main__': + from argparse import ArgumentParser + import itertools + + parser = ArgumentParser() + parser.add_argument("filename") + parser.add_argument("dpi", nargs="?", type=float, default=None) + args = parser.parse_args() + with Dvi(args.filename, args.dpi) as dvi: + fontmap = PsfontsMap(find_tex_file('pdftex.map')) + for page in dvi: + print(f"=== new page === " + f"(w: {page.width}, h: {page.height}, d: {page.descent})") + for font, group in itertools.groupby( + page.text, lambda text: text.font): + print(f"font: {font.texname.decode('latin-1')!r}\t" + f"scale: {font._scale / 2 ** 20}") + print("x", "y", "glyph", "chr", "w", "(glyphs)", sep="\t") + for text in group: + print(text.x, text.y, text.glyph, + chr(text.glyph) if chr(text.glyph).isprintable() + else ".", + text.width, sep="\t") + if page.boxes: + print("x", "y", "h", "w", "", "(boxes)", sep="\t") + for box in page.boxes: + print(box.x, box.y, box.height, box.width, sep="\t") diff --git a/shared/package-files/06/06a5c5ca12950e815126549205bfe3c4e9163f333632943aec12a2411f39d80f/blob b/shared/package-files/06/06a5c5ca12950e815126549205bfe3c4e9163f333632943aec12a2411f39d80f/blob new file mode 100644 index 0000000000000000000000000000000000000000..4392a543f185d77af3eeb18708867cf54b7d0b5f --- /dev/null +++ b/shared/package-files/06/06a5c5ca12950e815126549205bfe3c4e9163f333632943aec12a2411f39d80f/blob @@ -0,0 +1,788 @@ +"""Options manager for :class:`~.Poly` and public API functions. """ + +from __future__ import annotations + +__all__ = ["Options"] + +from sympy.core import Basic, sympify +from sympy.polys.polyerrors import GeneratorsError, OptionError, FlagError +from sympy.utilities import numbered_symbols, topological_sort, public +from sympy.utilities.iterables import has_dups, is_sequence + +import sympy.polys + +import re + +class Option: + """Base class for all kinds of options. """ + + option: str | None = None + + is_Flag = False + + requires: list[str] = [] + excludes: list[str] = [] + + after: list[str] = [] + before: list[str] = [] + + @classmethod + def default(cls): + return None + + @classmethod + def preprocess(cls, option): + return None + + @classmethod + def postprocess(cls, options): + pass + + +class Flag(Option): + """Base class for all kinds of flags. """ + + is_Flag = True + + +class BooleanOption(Option): + """An option that must have a boolean value or equivalent assigned. """ + + @classmethod + def preprocess(cls, value): + if value in [True, False]: + return bool(value) + else: + raise OptionError("'%s' must have a boolean value assigned, got %s" % (cls.option, value)) + + +class OptionType(type): + """Base type for all options that does registers options. """ + + def __init__(cls, *args, **kwargs): + @property + def getter(self): + try: + return self[cls.option] + except KeyError: + return cls.default() + + setattr(Options, cls.option, getter) + Options.__options__[cls.option] = cls + + +@public +class Options(dict): + """ + Options manager for polynomial manipulation module. + + Examples + ======== + + >>> from sympy.polys.polyoptions import Options + >>> from sympy.polys.polyoptions import build_options + + >>> from sympy.abc import x, y, z + + >>> Options((x, y, z), {'domain': 'ZZ'}) + {'auto': False, 'domain': ZZ, 'gens': (x, y, z)} + + >>> build_options((x, y, z), {'domain': 'ZZ'}) + {'auto': False, 'domain': ZZ, 'gens': (x, y, z)} + + **Options** + + * Expand --- boolean option + * Gens --- option + * Wrt --- option + * Sort --- option + * Order --- option + * Field --- boolean option + * Greedy --- boolean option + * Domain --- option + * Split --- boolean option + * Gaussian --- boolean option + * Extension --- option + * Modulus --- option + * Symmetric --- boolean option + * Strict --- boolean option + + **Flags** + + * Auto --- boolean flag + * Frac --- boolean flag + * Formal --- boolean flag + * Polys --- boolean flag + * Include --- boolean flag + * All --- boolean flag + * Gen --- flag + * Series --- boolean flag + + """ + + __order__ = None + __options__: dict[str, type[Option]] = {} + + def __init__(self, gens, args, flags=None, strict=False): + dict.__init__(self) + + if gens and args.get('gens', ()): + raise OptionError( + "both '*gens' and keyword argument 'gens' supplied") + elif gens: + args = dict(args) + args['gens'] = gens + + defaults = args.pop('defaults', {}) + + def preprocess_options(args): + for option, value in args.items(): + try: + cls = self.__options__[option] + except KeyError: + raise OptionError("'%s' is not a valid option" % option) + + if issubclass(cls, Flag): + if flags is None or option not in flags: + if strict: + raise OptionError("'%s' flag is not allowed in this context" % option) + + if value is not None: + self[option] = cls.preprocess(value) + + preprocess_options(args) + + for key, value in dict(defaults).items(): + if key in self: + del defaults[key] + else: + for option in self.keys(): + cls = self.__options__[option] + + if key in cls.excludes: + del defaults[key] + break + + preprocess_options(defaults) + + for option in self.keys(): + cls = self.__options__[option] + + for require_option in cls.requires: + if self.get(require_option) is None: + raise OptionError("'%s' option is only allowed together with '%s'" % (option, require_option)) + + for exclude_option in cls.excludes: + if self.get(exclude_option) is not None: + raise OptionError("'%s' option is not allowed together with '%s'" % (option, exclude_option)) + + for option in self.__order__: + self.__options__[option].postprocess(self) + + @classmethod + def _init_dependencies_order(cls): + """Resolve the order of options' processing. """ + if cls.__order__ is None: + vertices, edges = [], set() + + for name, option in cls.__options__.items(): + vertices.append(name) + + for _name in option.after: + edges.add((_name, name)) + + for _name in option.before: + edges.add((name, _name)) + + try: + cls.__order__ = topological_sort((vertices, list(edges))) + except ValueError: + raise RuntimeError( + "cycle detected in sympy.polys options framework") + + def clone(self, updates={}): + """Clone ``self`` and update specified options. """ + obj = dict.__new__(self.__class__) + + for option, value in self.items(): + obj[option] = value + + for option, value in updates.items(): + obj[option] = value + + return obj + + def __setattr__(self, attr, value): + if attr in self.__options__: + self[attr] = value + else: + super().__setattr__(attr, value) + + @property + def args(self): + args = {} + + for option, value in self.items(): + if value is not None and option != 'gens': + cls = self.__options__[option] + + if not issubclass(cls, Flag): + args[option] = value + + return args + + @property + def options(self): + options = {} + + for option, cls in self.__options__.items(): + if not issubclass(cls, Flag): + options[option] = getattr(self, option) + + return options + + @property + def flags(self): + flags = {} + + for option, cls in self.__options__.items(): + if issubclass(cls, Flag): + flags[option] = getattr(self, option) + + return flags + + +class Expand(BooleanOption, metaclass=OptionType): + """``expand`` option to polynomial manipulation functions. """ + + option = 'expand' + + requires: list[str] = [] + excludes: list[str] = [] + + @classmethod + def default(cls): + return True + + +class Gens(Option, metaclass=OptionType): + """``gens`` option to polynomial manipulation functions. """ + + option = 'gens' + + requires: list[str] = [] + excludes: list[str] = [] + + @classmethod + def default(cls): + return () + + @classmethod + def preprocess(cls, gens): + if isinstance(gens, Basic): + gens = (gens,) + elif len(gens) == 1 and is_sequence(gens[0]): + gens = gens[0] + + if gens == (None,): + gens = () + elif has_dups(gens): + raise GeneratorsError("duplicated generators: %s" % str(gens)) + elif any(gen.is_commutative is False for gen in gens): + raise GeneratorsError("non-commutative generators: %s" % str(gens)) + + return tuple(gens) + + +class Wrt(Option, metaclass=OptionType): + """``wrt`` option to polynomial manipulation functions. """ + + option = 'wrt' + + requires: list[str] = [] + excludes: list[str] = [] + + _re_split = re.compile(r"\s*,\s*|\s+") + + @classmethod + def preprocess(cls, wrt): + if isinstance(wrt, Basic): + return [str(wrt)] + elif isinstance(wrt, str): + wrt = wrt.strip() + if wrt.endswith(','): + raise OptionError('Bad input: missing parameter.') + if not wrt: + return [] + return list(cls._re_split.split(wrt)) + elif hasattr(wrt, '__getitem__'): + return list(map(str, wrt)) + else: + raise OptionError("invalid argument for 'wrt' option") + + +class Sort(Option, metaclass=OptionType): + """``sort`` option to polynomial manipulation functions. """ + + option = 'sort' + + requires: list[str] = [] + excludes: list[str] = [] + + @classmethod + def default(cls): + return [] + + @classmethod + def preprocess(cls, sort): + if isinstance(sort, str): + return [ gen.strip() for gen in sort.split('>') ] + elif hasattr(sort, '__getitem__'): + return list(map(str, sort)) + else: + raise OptionError("invalid argument for 'sort' option") + + +class Order(Option, metaclass=OptionType): + """``order`` option to polynomial manipulation functions. """ + + option = 'order' + + requires: list[str] = [] + excludes: list[str] = [] + + @classmethod + def default(cls): + return sympy.polys.orderings.lex + + @classmethod + def preprocess(cls, order): + return sympy.polys.orderings.monomial_key(order) + + +class Field(BooleanOption, metaclass=OptionType): + """``field`` option to polynomial manipulation functions. """ + + option = 'field' + + requires: list[str] = [] + excludes = ['domain', 'split', 'gaussian'] + + +class Greedy(BooleanOption, metaclass=OptionType): + """``greedy`` option to polynomial manipulation functions. """ + + option = 'greedy' + + requires: list[str] = [] + excludes = ['domain', 'split', 'gaussian', 'extension', 'modulus', 'symmetric'] + + +class Composite(BooleanOption, metaclass=OptionType): + """``composite`` option to polynomial manipulation functions. """ + + option = 'composite' + + @classmethod + def default(cls): + return None + + requires: list[str] = [] + excludes = ['domain', 'split', 'gaussian', 'extension', 'modulus', 'symmetric'] + + +class Domain(Option, metaclass=OptionType): + """``domain`` option to polynomial manipulation functions. """ + + option = 'domain' + + requires: list[str] = [] + excludes = ['field', 'greedy', 'split', 'gaussian', 'extension'] + + after = ['gens'] + + _re_realfield = re.compile(r"^(R|RR)(_(\d+))?$") + _re_complexfield = re.compile(r"^(C|CC)(_(\d+))?$") + _re_finitefield = re.compile(r"^(FF|GF)\((\d+)\)$") + _re_polynomial = re.compile(r"^(Z|ZZ|Q|QQ|ZZ_I|QQ_I|R|RR|C|CC)\[(.+)\]$") + _re_fraction = re.compile(r"^(Z|ZZ|Q|QQ)\((.+)\)$") + _re_algebraic = re.compile(r"^(Q|QQ)\<(.+)\>$") + + @classmethod + def preprocess(cls, domain): + if isinstance(domain, sympy.polys.domains.Domain): + return domain + elif hasattr(domain, 'to_domain'): + return domain.to_domain() + elif isinstance(domain, str): + if domain in ['Z', 'ZZ']: + return sympy.polys.domains.ZZ + + if domain in ['Q', 'QQ']: + return sympy.polys.domains.QQ + + if domain == 'ZZ_I': + return sympy.polys.domains.ZZ_I + + if domain == 'QQ_I': + return sympy.polys.domains.QQ_I + + if domain == 'EX': + return sympy.polys.domains.EX + + r = cls._re_realfield.match(domain) + + if r is not None: + _, _, prec = r.groups() + + if prec is None: + return sympy.polys.domains.RR + else: + return sympy.polys.domains.RealField(int(prec)) + + r = cls._re_complexfield.match(domain) + + if r is not None: + _, _, prec = r.groups() + + if prec is None: + return sympy.polys.domains.CC + else: + return sympy.polys.domains.ComplexField(int(prec)) + + r = cls._re_finitefield.match(domain) + + if r is not None: + return sympy.polys.domains.FF(int(r.groups()[1])) + + r = cls._re_polynomial.match(domain) + + if r is not None: + ground, gens = r.groups() + + gens = list(map(sympify, gens.split(','))) + + if ground in ['Z', 'ZZ']: + return sympy.polys.domains.ZZ.poly_ring(*gens) + elif ground in ['Q', 'QQ']: + return sympy.polys.domains.QQ.poly_ring(*gens) + elif ground in ['R', 'RR']: + return sympy.polys.domains.RR.poly_ring(*gens) + elif ground == 'ZZ_I': + return sympy.polys.domains.ZZ_I.poly_ring(*gens) + elif ground == 'QQ_I': + return sympy.polys.domains.QQ_I.poly_ring(*gens) + else: + return sympy.polys.domains.CC.poly_ring(*gens) + + r = cls._re_fraction.match(domain) + + if r is not None: + ground, gens = r.groups() + + gens = list(map(sympify, gens.split(','))) + + if ground in ['Z', 'ZZ']: + return sympy.polys.domains.ZZ.frac_field(*gens) + else: + return sympy.polys.domains.QQ.frac_field(*gens) + + r = cls._re_algebraic.match(domain) + + if r is not None: + gens = list(map(sympify, r.groups()[1].split(','))) + return sympy.polys.domains.QQ.algebraic_field(*gens) + + raise OptionError('expected a valid domain specification, got %s' % domain) + + @classmethod + def postprocess(cls, options): + if 'gens' in options and 'domain' in options and options['domain'].is_Composite and \ + (set(options['domain'].symbols) & set(options['gens'])): + raise GeneratorsError( + "ground domain and generators interfere together") + elif ('gens' not in options or not options['gens']) and \ + 'domain' in options and options['domain'] == sympy.polys.domains.EX: + raise GeneratorsError("you have to provide generators because EX domain was requested") + + +class Split(BooleanOption, metaclass=OptionType): + """``split`` option to polynomial manipulation functions. """ + + option = 'split' + + requires: list[str] = [] + excludes = ['field', 'greedy', 'domain', 'gaussian', 'extension', + 'modulus', 'symmetric'] + + @classmethod + def postprocess(cls, options): + if 'split' in options: + raise NotImplementedError("'split' option is not implemented yet") + + +class Gaussian(BooleanOption, metaclass=OptionType): + """``gaussian`` option to polynomial manipulation functions. """ + + option = 'gaussian' + + requires: list[str] = [] + excludes = ['field', 'greedy', 'domain', 'split', 'extension', + 'modulus', 'symmetric'] + + @classmethod + def postprocess(cls, options): + if 'gaussian' in options and options['gaussian'] is True: + options['domain'] = sympy.polys.domains.QQ_I + Extension.postprocess(options) + + +class Extension(Option, metaclass=OptionType): + """``extension`` option to polynomial manipulation functions. """ + + option = 'extension' + + requires: list[str] = [] + excludes = ['greedy', 'domain', 'split', 'gaussian', 'modulus', + 'symmetric'] + + @classmethod + def preprocess(cls, extension): + if extension == 1: + return bool(extension) + elif extension == 0: + raise OptionError("'False' is an invalid argument for 'extension'") + else: + if not hasattr(extension, '__iter__'): + extension = {extension} + else: + if not extension: + extension = None + else: + extension = set(extension) + + return extension + + @classmethod + def postprocess(cls, options): + if 'extension' in options and options['extension'] is not True: + options['domain'] = sympy.polys.domains.QQ.algebraic_field( + *options['extension']) + + +class Modulus(Option, metaclass=OptionType): + """``modulus`` option to polynomial manipulation functions. """ + + option = 'modulus' + + requires: list[str] = [] + excludes = ['greedy', 'split', 'domain', 'gaussian', 'extension'] + + @classmethod + def preprocess(cls, modulus): + modulus = sympify(modulus) + + if modulus.is_Integer and modulus > 0: + return int(modulus) + else: + raise OptionError( + "'modulus' must a positive integer, got %s" % modulus) + + @classmethod + def postprocess(cls, options): + if 'modulus' in options: + modulus = options['modulus'] + symmetric = options.get('symmetric', True) + options['domain'] = sympy.polys.domains.FF(modulus, symmetric) + + +class Symmetric(BooleanOption, metaclass=OptionType): + """``symmetric`` option to polynomial manipulation functions. """ + + option = 'symmetric' + + requires = ['modulus'] + excludes = ['greedy', 'domain', 'split', 'gaussian', 'extension'] + + +class Strict(BooleanOption, metaclass=OptionType): + """``strict`` option to polynomial manipulation functions. """ + + option = 'strict' + + @classmethod + def default(cls): + return True + + +class Auto(BooleanOption, Flag, metaclass=OptionType): + """``auto`` flag to polynomial manipulation functions. """ + + option = 'auto' + + after = ['field', 'domain', 'extension', 'gaussian'] + + @classmethod + def default(cls): + return True + + @classmethod + def postprocess(cls, options): + if ('domain' in options or 'field' in options) and 'auto' not in options: + options['auto'] = False + + +class Frac(BooleanOption, Flag, metaclass=OptionType): + """``auto`` option to polynomial manipulation functions. """ + + option = 'frac' + + @classmethod + def default(cls): + return False + + +class Formal(BooleanOption, Flag, metaclass=OptionType): + """``formal`` flag to polynomial manipulation functions. """ + + option = 'formal' + + @classmethod + def default(cls): + return False + + +class Polys(BooleanOption, Flag, metaclass=OptionType): + """``polys`` flag to polynomial manipulation functions. """ + + option = 'polys' + + +class Include(BooleanOption, Flag, metaclass=OptionType): + """``include`` flag to polynomial manipulation functions. """ + + option = 'include' + + @classmethod + def default(cls): + return False + + +class All(BooleanOption, Flag, metaclass=OptionType): + """``all`` flag to polynomial manipulation functions. """ + + option = 'all' + + @classmethod + def default(cls): + return False + + +class Gen(Flag, metaclass=OptionType): + """``gen`` flag to polynomial manipulation functions. """ + + option = 'gen' + + @classmethod + def default(cls): + return 0 + + @classmethod + def preprocess(cls, gen): + if isinstance(gen, (Basic, int)): + return gen + else: + raise OptionError("invalid argument for 'gen' option") + + +class Series(BooleanOption, Flag, metaclass=OptionType): + """``series`` flag to polynomial manipulation functions. """ + + option = 'series' + + @classmethod + def default(cls): + return False + + +class Symbols(Flag, metaclass=OptionType): + """``symbols`` flag to polynomial manipulation functions. """ + + option = 'symbols' + + @classmethod + def default(cls): + return numbered_symbols('s', start=1) + + @classmethod + def preprocess(cls, symbols): + if hasattr(symbols, '__iter__'): + return iter(symbols) + else: + raise OptionError("expected an iterator or iterable container, got %s" % symbols) + + +class Method(Flag, metaclass=OptionType): + """``method`` flag to polynomial manipulation functions. """ + + option = 'method' + + @classmethod + def preprocess(cls, method): + if isinstance(method, str): + return method.lower() + else: + raise OptionError("expected a string, got %s" % method) + + +def build_options(gens, args=None): + """Construct options from keyword arguments or ... options. """ + if args is None: + gens, args = (), gens + + if len(args) != 1 or 'opt' not in args or gens: + return Options(gens, args) + else: + return args['opt'] + + +def allowed_flags(args, flags): + """ + Allow specified flags to be used in the given context. + + Examples + ======== + + >>> from sympy.polys.polyoptions import allowed_flags + >>> from sympy.polys.domains import ZZ + + >>> allowed_flags({'domain': ZZ}, []) + + >>> allowed_flags({'domain': ZZ, 'frac': True}, []) + Traceback (most recent call last): + ... + FlagError: 'frac' flag is not allowed in this context + + >>> allowed_flags({'domain': ZZ, 'frac': True}, ['frac']) + + """ + flags = set(flags) + + for arg in args.keys(): + try: + if Options.__options__[arg].is_Flag and arg not in flags: + raise FlagError( + "'%s' flag is not allowed in this context" % arg) + except KeyError: + raise OptionError("'%s' is not a valid option" % arg) + + +def set_defaults(options, **defaults): + """Update options with default values. """ + if 'defaults' not in options: + options = dict(options) + options['defaults'] = defaults + + return options + +Options._init_dependencies_order() diff --git a/shared/package-files/06/06a76dad17702ab297ea355df38eb0d44f9707ac4a0e8d0e73291ee6aa4ab3af/blob b/shared/package-files/06/06a76dad17702ab297ea355df38eb0d44f9707ac4a0e8d0e73291ee6aa4ab3af/blob new file mode 100644 index 0000000000000000000000000000000000000000..c912d4021778db272ac4e35e7776216f1126e54c --- /dev/null +++ b/shared/package-files/06/06a76dad17702ab297ea355df38eb0d44f9707ac4a0e8d0e73291ee6aa4ab3af/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API bool is_set_to(const at::Tensor & self, const at::Tensor & tensor); +} // namespace native +} // namespace at diff --git a/shared/package-files/06/06afee4a9a5e3b6753f3cc5af979dc409fe959763cb7dedb2c632bc8c21a8bc4/blob b/shared/package-files/06/06afee4a9a5e3b6753f3cc5af979dc409fe959763cb7dedb2c632bc8c21a8bc4/blob new file mode 100644 index 0000000000000000000000000000000000000000..88dc9ca21cc802b6a5b142a52cb5d63597b74ca0 --- /dev/null +++ b/shared/package-files/06/06afee4a9a5e3b6753f3cc5af979dc409fe959763cb7dedb2c632bc8c21a8bc4/blob @@ -0,0 +1,960 @@ +import warnings +from typing import List, Optional, Tuple, Union + +import torch +from torch import Tensor +from torch.nn.functional import conv2d, grid_sample, interpolate, pad as torch_pad + + +def _is_tensor_a_torch_image(x: Tensor) -> bool: + return x.ndim >= 2 + + +def _assert_image_tensor(img: Tensor) -> None: + if not _is_tensor_a_torch_image(img): + raise TypeError("Tensor is not a torch image.") + + +def get_dimensions(img: Tensor) -> List[int]: + _assert_image_tensor(img) + channels = 1 if img.ndim == 2 else img.shape[-3] + height, width = img.shape[-2:] + return [channels, height, width] + + +def get_image_size(img: Tensor) -> List[int]: + # Returns (w, h) of tensor image + _assert_image_tensor(img) + return [img.shape[-1], img.shape[-2]] + + +def get_image_num_channels(img: Tensor) -> int: + _assert_image_tensor(img) + if img.ndim == 2: + return 1 + elif img.ndim > 2: + return img.shape[-3] + + raise TypeError(f"Input ndim should be 2 or more. Got {img.ndim}") + + +def _max_value(dtype: torch.dtype) -> int: + if dtype == torch.uint8: + return 255 + elif dtype == torch.int8: + return 127 + elif dtype == torch.int16: + return 32767 + elif dtype == torch.int32: + return 2147483647 + elif dtype == torch.int64: + return 9223372036854775807 + else: + # This is only here for completeness. This value is implicitly assumed in a lot of places so changing it is not + # easy. + return 1 + + +def _assert_channels(img: Tensor, permitted: List[int]) -> None: + c = get_dimensions(img)[0] + if c not in permitted: + raise TypeError(f"Input image tensor permitted channel values are {permitted}, but found {c}") + + +def convert_image_dtype(image: torch.Tensor, dtype: torch.dtype = torch.float) -> torch.Tensor: + if image.dtype == dtype: + return image + + if image.is_floating_point(): + + # TODO: replace with dtype.is_floating_point when torchscript supports it + if torch.tensor(0, dtype=dtype).is_floating_point(): + return image.to(dtype) + + # float to int + if (image.dtype == torch.float32 and dtype in (torch.int32, torch.int64)) or ( + image.dtype == torch.float64 and dtype == torch.int64 + ): + msg = f"The cast from {image.dtype} to {dtype} cannot be performed safely." + raise RuntimeError(msg) + + # https://github.com/pytorch/vision/pull/2078#issuecomment-612045321 + # For data in the range 0-1, (float * 255).to(uint) is only 255 + # when float is exactly 1.0. + # `max + 1 - epsilon` provides more evenly distributed mapping of + # ranges of floats to ints. + eps = 1e-3 + max_val = float(_max_value(dtype)) + result = image.mul(max_val + 1.0 - eps) + return result.to(dtype) + else: + input_max = float(_max_value(image.dtype)) + + # int to float + # TODO: replace with dtype.is_floating_point when torchscript supports it + if torch.tensor(0, dtype=dtype).is_floating_point(): + image = image.to(dtype) + return image / input_max + + output_max = float(_max_value(dtype)) + + # int to int + if input_max > output_max: + # factor should be forced to int for torch jit script + # otherwise factor is a float and image // factor can produce different results + factor = int((input_max + 1) // (output_max + 1)) + image = torch.div(image, factor, rounding_mode="floor") + return image.to(dtype) + else: + # factor should be forced to int for torch jit script + # otherwise factor is a float and image * factor can produce different results + factor = int((output_max + 1) // (input_max + 1)) + image = image.to(dtype) + return image * factor + + +def vflip(img: Tensor) -> Tensor: + _assert_image_tensor(img) + + return img.flip(-2) + + +def hflip(img: Tensor) -> Tensor: + _assert_image_tensor(img) + + return img.flip(-1) + + +def crop(img: Tensor, top: int, left: int, height: int, width: int) -> Tensor: + _assert_image_tensor(img) + + _, h, w = get_dimensions(img) + right = left + width + bottom = top + height + + if left < 0 or top < 0 or right > w or bottom > h: + padding_ltrb = [ + max(-left + min(0, right), 0), + max(-top + min(0, bottom), 0), + max(right - max(w, left), 0), + max(bottom - max(h, top), 0), + ] + return pad(img[..., max(top, 0) : bottom, max(left, 0) : right], padding_ltrb, fill=0) + return img[..., top:bottom, left:right] + + +def rgb_to_grayscale(img: Tensor, num_output_channels: int = 1) -> Tensor: + if img.ndim < 3: + raise TypeError(f"Input image tensor should have at least 3 dimensions, but found {img.ndim}") + _assert_channels(img, [1, 3]) + + if num_output_channels not in (1, 3): + raise ValueError("num_output_channels should be either 1 or 3") + + if img.shape[-3] == 3: + r, g, b = img.unbind(dim=-3) + # This implementation closely follows the TF one: + # https://github.com/tensorflow/tensorflow/blob/v2.3.0/tensorflow/python/ops/image_ops_impl.py#L2105-L2138 + l_img = (0.2989 * r + 0.587 * g + 0.114 * b).to(img.dtype) + l_img = l_img.unsqueeze(dim=-3) + else: + l_img = img.clone() + + if num_output_channels == 3: + return l_img.expand(img.shape) + + return l_img + + +def adjust_brightness(img: Tensor, brightness_factor: float) -> Tensor: + if brightness_factor < 0: + raise ValueError(f"brightness_factor ({brightness_factor}) is not non-negative.") + + _assert_image_tensor(img) + + _assert_channels(img, [1, 3]) + + return _blend(img, torch.zeros_like(img), brightness_factor) + + +def adjust_contrast(img: Tensor, contrast_factor: float) -> Tensor: + if contrast_factor < 0: + raise ValueError(f"contrast_factor ({contrast_factor}) is not non-negative.") + + _assert_image_tensor(img) + + _assert_channels(img, [3, 1]) + c = get_dimensions(img)[0] + dtype = img.dtype if torch.is_floating_point(img) else torch.float32 + if c == 3: + mean = torch.mean(rgb_to_grayscale(img).to(dtype), dim=(-3, -2, -1), keepdim=True) + else: + mean = torch.mean(img.to(dtype), dim=(-3, -2, -1), keepdim=True) + + return _blend(img, mean, contrast_factor) + + +def adjust_hue(img: Tensor, hue_factor: float) -> Tensor: + if not (-0.5 <= hue_factor <= 0.5): + raise ValueError(f"hue_factor ({hue_factor}) is not in [-0.5, 0.5].") + + if not (isinstance(img, torch.Tensor)): + raise TypeError("Input img should be Tensor image") + + _assert_image_tensor(img) + + _assert_channels(img, [1, 3]) + if get_dimensions(img)[0] == 1: # Match PIL behaviour + return img + + orig_dtype = img.dtype + img = convert_image_dtype(img, torch.float32) + + img = _rgb2hsv(img) + h, s, v = img.unbind(dim=-3) + h = (h + hue_factor) % 1.0 + img = torch.stack((h, s, v), dim=-3) + img_hue_adj = _hsv2rgb(img) + + return convert_image_dtype(img_hue_adj, orig_dtype) + + +def adjust_saturation(img: Tensor, saturation_factor: float) -> Tensor: + if saturation_factor < 0: + raise ValueError(f"saturation_factor ({saturation_factor}) is not non-negative.") + + _assert_image_tensor(img) + + _assert_channels(img, [1, 3]) + + if get_dimensions(img)[0] == 1: # Match PIL behaviour + return img + + return _blend(img, rgb_to_grayscale(img), saturation_factor) + + +def adjust_gamma(img: Tensor, gamma: float, gain: float = 1) -> Tensor: + if not isinstance(img, torch.Tensor): + raise TypeError("Input img should be a Tensor.") + + _assert_channels(img, [1, 3]) + + if gamma < 0: + raise ValueError("Gamma should be a non-negative real number") + + result = img + dtype = img.dtype + if not torch.is_floating_point(img): + result = convert_image_dtype(result, torch.float32) + + result = (gain * result**gamma).clamp(0, 1) + + result = convert_image_dtype(result, dtype) + return result + + +def _blend(img1: Tensor, img2: Tensor, ratio: float) -> Tensor: + ratio = float(ratio) + bound = _max_value(img1.dtype) + return (ratio * img1 + (1.0 - ratio) * img2).clamp(0, bound).to(img1.dtype) + + +def _rgb2hsv(img: Tensor) -> Tensor: + r, g, b = img.unbind(dim=-3) + + # Implementation is based on https://github.com/python-pillow/Pillow/blob/4174d4267616897df3746d315d5a2d0f82c656ee/ + # src/libImaging/Convert.c#L330 + maxc = torch.max(img, dim=-3).values + minc = torch.min(img, dim=-3).values + + # The algorithm erases S and H channel where `maxc = minc`. This avoids NaN + # from happening in the results, because + # + S channel has division by `maxc`, which is zero only if `maxc = minc` + # + H channel has division by `(maxc - minc)`. + # + # Instead of overwriting NaN afterwards, we just prevent it from occurring, so + # we don't need to deal with it in case we save the NaN in a buffer in + # backprop, if it is ever supported, but it doesn't hurt to do so. + eqc = maxc == minc + + cr = maxc - minc + # Since `eqc => cr = 0`, replacing denominator with 1 when `eqc` is fine. + ones = torch.ones_like(maxc) + s = cr / torch.where(eqc, ones, maxc) + # Note that `eqc => maxc = minc = r = g = b`. So the following calculation + # of `h` would reduce to `bc - gc + 2 + rc - bc + 4 + rc - bc = 6` so it + # would not matter what values `rc`, `gc`, and `bc` have here, and thus + # replacing denominator with 1 when `eqc` is fine. + cr_divisor = torch.where(eqc, ones, cr) + rc = (maxc - r) / cr_divisor + gc = (maxc - g) / cr_divisor + bc = (maxc - b) / cr_divisor + + hr = (maxc == r) * (bc - gc) + hg = ((maxc == g) & (maxc != r)) * (2.0 + rc - bc) + hb = ((maxc != g) & (maxc != r)) * (4.0 + gc - rc) + h = hr + hg + hb + h = torch.fmod((h / 6.0 + 1.0), 1.0) + return torch.stack((h, s, maxc), dim=-3) + + +def _hsv2rgb(img: Tensor) -> Tensor: + h, s, v = img.unbind(dim=-3) + i = torch.floor(h * 6.0) + f = (h * 6.0) - i + i = i.to(dtype=torch.int32) + + p = torch.clamp((v * (1.0 - s)), 0.0, 1.0) + q = torch.clamp((v * (1.0 - s * f)), 0.0, 1.0) + t = torch.clamp((v * (1.0 - s * (1.0 - f))), 0.0, 1.0) + i = i % 6 + + mask = i.unsqueeze(dim=-3) == torch.arange(6, device=i.device).view(-1, 1, 1) + + a1 = torch.stack((v, q, p, p, t, v), dim=-3) + a2 = torch.stack((t, v, v, q, p, p), dim=-3) + a3 = torch.stack((p, p, t, v, v, q), dim=-3) + a4 = torch.stack((a1, a2, a3), dim=-4) + + return torch.einsum("...ijk, ...xijk -> ...xjk", mask.to(dtype=img.dtype), a4) + + +def _pad_symmetric(img: Tensor, padding: List[int]) -> Tensor: + # padding is left, right, top, bottom + + # crop if needed + if padding[0] < 0 or padding[1] < 0 or padding[2] < 0 or padding[3] < 0: + neg_min_padding = [-min(x, 0) for x in padding] + crop_left, crop_right, crop_top, crop_bottom = neg_min_padding + img = img[..., crop_top : img.shape[-2] - crop_bottom, crop_left : img.shape[-1] - crop_right] + padding = [max(x, 0) for x in padding] + + in_sizes = img.size() + + _x_indices = [i for i in range(in_sizes[-1])] # [0, 1, 2, 3, ...] + left_indices = [i for i in range(padding[0] - 1, -1, -1)] # e.g. [3, 2, 1, 0] + right_indices = [-(i + 1) for i in range(padding[1])] # e.g. [-1, -2, -3] + x_indices = torch.tensor(left_indices + _x_indices + right_indices, device=img.device) + + _y_indices = [i for i in range(in_sizes[-2])] + top_indices = [i for i in range(padding[2] - 1, -1, -1)] + bottom_indices = [-(i + 1) for i in range(padding[3])] + y_indices = torch.tensor(top_indices + _y_indices + bottom_indices, device=img.device) + + ndim = img.ndim + if ndim == 3: + return img[:, y_indices[:, None], x_indices[None, :]] + elif ndim == 4: + return img[:, :, y_indices[:, None], x_indices[None, :]] + else: + raise RuntimeError("Symmetric padding of N-D tensors are not supported yet") + + +def _parse_pad_padding(padding: Union[int, List[int]]) -> List[int]: + if isinstance(padding, int): + if torch.jit.is_scripting(): + # This maybe unreachable + raise ValueError("padding can't be an int while torchscripting, set it as a list [value, ]") + pad_left = pad_right = pad_top = pad_bottom = padding + elif len(padding) == 1: + pad_left = pad_right = pad_top = pad_bottom = padding[0] + elif len(padding) == 2: + pad_left = pad_right = padding[0] + pad_top = pad_bottom = padding[1] + else: + pad_left = padding[0] + pad_top = padding[1] + pad_right = padding[2] + pad_bottom = padding[3] + + return [pad_left, pad_right, pad_top, pad_bottom] + + +def pad( + img: Tensor, padding: Union[int, List[int]], fill: Optional[Union[int, float]] = 0, padding_mode: str = "constant" +) -> Tensor: + _assert_image_tensor(img) + + if fill is None: + fill = 0 + + if not isinstance(padding, (int, tuple, list)): + raise TypeError("Got inappropriate padding arg") + if not isinstance(fill, (int, float)): + raise TypeError("Got inappropriate fill arg") + if not isinstance(padding_mode, str): + raise TypeError("Got inappropriate padding_mode arg") + + if isinstance(padding, tuple): + padding = list(padding) + + if isinstance(padding, list): + # TODO: Jit is failing on loading this op when scripted and saved + # https://github.com/pytorch/pytorch/issues/81100 + if len(padding) not in [1, 2, 4]: + raise ValueError( + f"Padding must be an int or a 1, 2, or 4 element tuple, not a {len(padding)} element tuple" + ) + + if padding_mode not in ["constant", "edge", "reflect", "symmetric"]: + raise ValueError("Padding mode should be either constant, edge, reflect or symmetric") + + p = _parse_pad_padding(padding) + + if padding_mode == "edge": + # remap padding_mode str + padding_mode = "replicate" + elif padding_mode == "symmetric": + # route to another implementation + return _pad_symmetric(img, p) + + need_squeeze = False + if img.ndim < 4: + img = img.unsqueeze(dim=0) + need_squeeze = True + + out_dtype = img.dtype + need_cast = False + if (padding_mode != "constant") and img.dtype not in (torch.float32, torch.float64): + # Here we temporarily cast input tensor to float + # until pytorch issue is resolved : + # https://github.com/pytorch/pytorch/issues/40763 + need_cast = True + img = img.to(torch.float32) + + if padding_mode in ("reflect", "replicate"): + img = torch_pad(img, p, mode=padding_mode) + else: + img = torch_pad(img, p, mode=padding_mode, value=float(fill)) + + if need_squeeze: + img = img.squeeze(dim=0) + + if need_cast: + img = img.to(out_dtype) + + return img + + +def resize( + img: Tensor, + size: List[int], + interpolation: str = "bilinear", + antialias: Optional[bool] = True, +) -> Tensor: + _assert_image_tensor(img) + + if isinstance(size, tuple): + size = list(size) + + if antialias is None: + antialias = False + + if antialias and interpolation not in ["bilinear", "bicubic"]: + # We manually set it to False to avoid an error downstream in interpolate() + # This behaviour is documented: the parameter is irrelevant for modes + # that are not bilinear or bicubic. We used to raise an error here, but + # now we don't as True is the default. + antialias = False + + img, need_cast, need_squeeze, out_dtype = _cast_squeeze_in(img, [torch.float32, torch.float64]) + + # Define align_corners to avoid warnings + align_corners = False if interpolation in ["bilinear", "bicubic"] else None + + img = interpolate(img, size=size, mode=interpolation, align_corners=align_corners, antialias=antialias) + + if interpolation == "bicubic" and out_dtype == torch.uint8: + img = img.clamp(min=0, max=255) + + img = _cast_squeeze_out(img, need_cast=need_cast, need_squeeze=need_squeeze, out_dtype=out_dtype) + + return img + + +def _assert_grid_transform_inputs( + img: Tensor, + matrix: Optional[List[float]], + interpolation: str, + fill: Optional[Union[int, float, List[float]]], + supported_interpolation_modes: List[str], + coeffs: Optional[List[float]] = None, +) -> None: + + if not (isinstance(img, torch.Tensor)): + raise TypeError("Input img should be Tensor") + + _assert_image_tensor(img) + + if matrix is not None and not isinstance(matrix, list): + raise TypeError("Argument matrix should be a list") + + if matrix is not None and len(matrix) != 6: + raise ValueError("Argument matrix should have 6 float values") + + if coeffs is not None and len(coeffs) != 8: + raise ValueError("Argument coeffs should have 8 float values") + + if fill is not None and not isinstance(fill, (int, float, tuple, list)): + warnings.warn("Argument fill should be either int, float, tuple or list") + + # Check fill + num_channels = get_dimensions(img)[0] + if fill is not None and isinstance(fill, (tuple, list)) and len(fill) > 1 and len(fill) != num_channels: + msg = ( + "The number of elements in 'fill' cannot broadcast to match the number of " + "channels of the image ({} != {})" + ) + raise ValueError(msg.format(len(fill), num_channels)) + + if interpolation not in supported_interpolation_modes: + raise ValueError(f"Interpolation mode '{interpolation}' is unsupported with Tensor input") + + +def _cast_squeeze_in(img: Tensor, req_dtypes: List[torch.dtype]) -> Tuple[Tensor, bool, bool, torch.dtype]: + need_squeeze = False + # make image NCHW + if img.ndim < 4: + img = img.unsqueeze(dim=0) + need_squeeze = True + + out_dtype = img.dtype + need_cast = False + if out_dtype not in req_dtypes: + need_cast = True + req_dtype = req_dtypes[0] + img = img.to(req_dtype) + return img, need_cast, need_squeeze, out_dtype + + +def _cast_squeeze_out(img: Tensor, need_cast: bool, need_squeeze: bool, out_dtype: torch.dtype) -> Tensor: + if need_squeeze: + img = img.squeeze(dim=0) + + if need_cast: + if out_dtype in (torch.uint8, torch.int8, torch.int16, torch.int32, torch.int64): + # it is better to round before cast + img = torch.round(img) + img = img.to(out_dtype) + + return img + + +def _apply_grid_transform( + img: Tensor, grid: Tensor, mode: str, fill: Optional[Union[int, float, List[float]]] +) -> Tensor: + + img, need_cast, need_squeeze, out_dtype = _cast_squeeze_in(img, [grid.dtype]) + + if img.shape[0] > 1: + # Apply same grid to a batch of images + grid = grid.expand(img.shape[0], grid.shape[1], grid.shape[2], grid.shape[3]) + + # Append a dummy mask for customized fill colors, should be faster than grid_sample() twice + if fill is not None: + mask = torch.ones((img.shape[0], 1, img.shape[2], img.shape[3]), dtype=img.dtype, device=img.device) + img = torch.cat((img, mask), dim=1) + + img = grid_sample(img, grid, mode=mode, padding_mode="zeros", align_corners=False) + + # Fill with required color + if fill is not None: + mask = img[:, -1:, :, :] # N * 1 * H * W + img = img[:, :-1, :, :] # N * C * H * W + mask = mask.expand_as(img) + fill_list, len_fill = (fill, len(fill)) if isinstance(fill, (tuple, list)) else ([float(fill)], 1) + fill_img = torch.tensor(fill_list, dtype=img.dtype, device=img.device).view(1, len_fill, 1, 1).expand_as(img) + if mode == "nearest": + mask = mask < 0.5 + img[mask] = fill_img[mask] + else: # 'bilinear' + img = img * mask + (1.0 - mask) * fill_img + + img = _cast_squeeze_out(img, need_cast, need_squeeze, out_dtype) + return img + + +def _gen_affine_grid( + theta: Tensor, + w: int, + h: int, + ow: int, + oh: int, +) -> Tensor: + # https://github.com/pytorch/pytorch/blob/74b65c32be68b15dc7c9e8bb62459efbfbde33d8/aten/src/ATen/native/ + # AffineGridGenerator.cpp#L18 + # Difference with AffineGridGenerator is that: + # 1) we normalize grid values after applying theta + # 2) we can normalize by other image size, such that it covers "extend" option like in PIL.Image.rotate + + d = 0.5 + base_grid = torch.empty(1, oh, ow, 3, dtype=theta.dtype, device=theta.device) + x_grid = torch.linspace(-ow * 0.5 + d, ow * 0.5 + d - 1, steps=ow, device=theta.device) + base_grid[..., 0].copy_(x_grid) + y_grid = torch.linspace(-oh * 0.5 + d, oh * 0.5 + d - 1, steps=oh, device=theta.device).unsqueeze_(-1) + base_grid[..., 1].copy_(y_grid) + base_grid[..., 2].fill_(1) + + rescaled_theta = theta.transpose(1, 2) / torch.tensor([0.5 * w, 0.5 * h], dtype=theta.dtype, device=theta.device) + output_grid = base_grid.view(1, oh * ow, 3).bmm(rescaled_theta) + return output_grid.view(1, oh, ow, 2) + + +def affine( + img: Tensor, + matrix: List[float], + interpolation: str = "nearest", + fill: Optional[Union[int, float, List[float]]] = None, +) -> Tensor: + _assert_grid_transform_inputs(img, matrix, interpolation, fill, ["nearest", "bilinear"]) + + dtype = img.dtype if torch.is_floating_point(img) else torch.float32 + theta = torch.tensor(matrix, dtype=dtype, device=img.device).reshape(1, 2, 3) + shape = img.shape + # grid will be generated on the same device as theta and img + grid = _gen_affine_grid(theta, w=shape[-1], h=shape[-2], ow=shape[-1], oh=shape[-2]) + return _apply_grid_transform(img, grid, interpolation, fill=fill) + + +def _compute_affine_output_size(matrix: List[float], w: int, h: int) -> Tuple[int, int]: + + # Inspired of PIL implementation: + # https://github.com/python-pillow/Pillow/blob/11de3318867e4398057373ee9f12dcb33db7335c/src/PIL/Image.py#L2054 + + # pts are Top-Left, Top-Right, Bottom-Left, Bottom-Right points. + # Points are shifted due to affine matrix torch convention about + # the center point. Center is (0, 0) for image center pivot point (w * 0.5, h * 0.5) + pts = torch.tensor( + [ + [-0.5 * w, -0.5 * h, 1.0], + [-0.5 * w, 0.5 * h, 1.0], + [0.5 * w, 0.5 * h, 1.0], + [0.5 * w, -0.5 * h, 1.0], + ] + ) + theta = torch.tensor(matrix, dtype=torch.float).view(2, 3) + new_pts = torch.matmul(pts, theta.T) + min_vals, _ = new_pts.min(dim=0) + max_vals, _ = new_pts.max(dim=0) + + # shift points to [0, w] and [0, h] interval to match PIL results + min_vals += torch.tensor((w * 0.5, h * 0.5)) + max_vals += torch.tensor((w * 0.5, h * 0.5)) + + # Truncate precision to 1e-4 to avoid ceil of Xe-15 to 1.0 + tol = 1e-4 + cmax = torch.ceil((max_vals / tol).trunc_() * tol) + cmin = torch.floor((min_vals / tol).trunc_() * tol) + size = cmax - cmin + return int(size[0]), int(size[1]) # w, h + + +def rotate( + img: Tensor, + matrix: List[float], + interpolation: str = "nearest", + expand: bool = False, + fill: Optional[Union[int, float, List[float]]] = None, +) -> Tensor: + _assert_grid_transform_inputs(img, matrix, interpolation, fill, ["nearest", "bilinear"]) + w, h = img.shape[-1], img.shape[-2] + ow, oh = _compute_affine_output_size(matrix, w, h) if expand else (w, h) + dtype = img.dtype if torch.is_floating_point(img) else torch.float32 + theta = torch.tensor(matrix, dtype=dtype, device=img.device).reshape(1, 2, 3) + # grid will be generated on the same device as theta and img + grid = _gen_affine_grid(theta, w=w, h=h, ow=ow, oh=oh) + + return _apply_grid_transform(img, grid, interpolation, fill=fill) + + +def _perspective_grid(coeffs: List[float], ow: int, oh: int, dtype: torch.dtype, device: torch.device) -> Tensor: + # https://github.com/python-pillow/Pillow/blob/4634eafe3c695a014267eefdce830b4a825beed7/ + # src/libImaging/Geometry.c#L394 + + # + # x_out = (coeffs[0] * x + coeffs[1] * y + coeffs[2]) / (coeffs[6] * x + coeffs[7] * y + 1) + # y_out = (coeffs[3] * x + coeffs[4] * y + coeffs[5]) / (coeffs[6] * x + coeffs[7] * y + 1) + # + theta1 = torch.tensor( + [[[coeffs[0], coeffs[1], coeffs[2]], [coeffs[3], coeffs[4], coeffs[5]]]], dtype=dtype, device=device + ) + theta2 = torch.tensor([[[coeffs[6], coeffs[7], 1.0], [coeffs[6], coeffs[7], 1.0]]], dtype=dtype, device=device) + + d = 0.5 + base_grid = torch.empty(1, oh, ow, 3, dtype=dtype, device=device) + x_grid = torch.linspace(d, ow * 1.0 + d - 1.0, steps=ow, device=device) + base_grid[..., 0].copy_(x_grid) + y_grid = torch.linspace(d, oh * 1.0 + d - 1.0, steps=oh, device=device).unsqueeze_(-1) + base_grid[..., 1].copy_(y_grid) + base_grid[..., 2].fill_(1) + + rescaled_theta1 = theta1.transpose(1, 2) / torch.tensor([0.5 * ow, 0.5 * oh], dtype=dtype, device=device) + output_grid1 = base_grid.view(1, oh * ow, 3).bmm(rescaled_theta1) + output_grid2 = base_grid.view(1, oh * ow, 3).bmm(theta2.transpose(1, 2)) + + output_grid = output_grid1 / output_grid2 - 1.0 + return output_grid.view(1, oh, ow, 2) + + +def perspective( + img: Tensor, + perspective_coeffs: List[float], + interpolation: str = "bilinear", + fill: Optional[Union[int, float, List[float]]] = None, +) -> Tensor: + if not (isinstance(img, torch.Tensor)): + raise TypeError("Input img should be Tensor.") + + _assert_image_tensor(img) + + _assert_grid_transform_inputs( + img, + matrix=None, + interpolation=interpolation, + fill=fill, + supported_interpolation_modes=["nearest", "bilinear"], + coeffs=perspective_coeffs, + ) + + ow, oh = img.shape[-1], img.shape[-2] + dtype = img.dtype if torch.is_floating_point(img) else torch.float32 + grid = _perspective_grid(perspective_coeffs, ow=ow, oh=oh, dtype=dtype, device=img.device) + return _apply_grid_transform(img, grid, interpolation, fill=fill) + + +def _get_gaussian_kernel1d(kernel_size: int, sigma: float) -> Tensor: + ksize_half = (kernel_size - 1) * 0.5 + + x = torch.linspace(-ksize_half, ksize_half, steps=kernel_size) + pdf = torch.exp(-0.5 * (x / sigma).pow(2)) + kernel1d = pdf / pdf.sum() + + return kernel1d + + +def _get_gaussian_kernel2d( + kernel_size: List[int], sigma: List[float], dtype: torch.dtype, device: torch.device +) -> Tensor: + kernel1d_x = _get_gaussian_kernel1d(kernel_size[0], sigma[0]).to(device, dtype=dtype) + kernel1d_y = _get_gaussian_kernel1d(kernel_size[1], sigma[1]).to(device, dtype=dtype) + kernel2d = torch.mm(kernel1d_y[:, None], kernel1d_x[None, :]) + return kernel2d + + +def gaussian_blur(img: Tensor, kernel_size: List[int], sigma: List[float]) -> Tensor: + if not (isinstance(img, torch.Tensor)): + raise TypeError(f"img should be Tensor. Got {type(img)}") + + _assert_image_tensor(img) + + dtype = img.dtype if torch.is_floating_point(img) else torch.float32 + kernel = _get_gaussian_kernel2d(kernel_size, sigma, dtype=dtype, device=img.device) + kernel = kernel.expand(img.shape[-3], 1, kernel.shape[0], kernel.shape[1]) + + img, need_cast, need_squeeze, out_dtype = _cast_squeeze_in(img, [kernel.dtype]) + + # padding = (left, right, top, bottom) + padding = [kernel_size[0] // 2, kernel_size[0] // 2, kernel_size[1] // 2, kernel_size[1] // 2] + img = torch_pad(img, padding, mode="reflect") + img = conv2d(img, kernel, groups=img.shape[-3]) + + img = _cast_squeeze_out(img, need_cast, need_squeeze, out_dtype) + return img + + +def invert(img: Tensor) -> Tensor: + + _assert_image_tensor(img) + + if img.ndim < 3: + raise TypeError(f"Input image tensor should have at least 3 dimensions, but found {img.ndim}") + + _assert_channels(img, [1, 3]) + + return _max_value(img.dtype) - img + + +def posterize(img: Tensor, bits: int) -> Tensor: + + _assert_image_tensor(img) + + if img.ndim < 3: + raise TypeError(f"Input image tensor should have at least 3 dimensions, but found {img.ndim}") + if img.dtype != torch.uint8: + raise TypeError(f"Only torch.uint8 image tensors are supported, but found {img.dtype}") + + _assert_channels(img, [1, 3]) + mask = -int(2 ** (8 - bits)) # JIT-friendly for: ~(2 ** (8 - bits) - 1) + return img & mask + + +def solarize(img: Tensor, threshold: float) -> Tensor: + + _assert_image_tensor(img) + + if img.ndim < 3: + raise TypeError(f"Input image tensor should have at least 3 dimensions, but found {img.ndim}") + + _assert_channels(img, [1, 3]) + + if threshold > _max_value(img.dtype): + raise TypeError("Threshold should be less than bound of img.") + + inverted_img = invert(img) + return torch.where(img >= threshold, inverted_img, img) + + +def _blurred_degenerate_image(img: Tensor) -> Tensor: + dtype = img.dtype if torch.is_floating_point(img) else torch.float32 + + kernel = torch.ones((3, 3), dtype=dtype, device=img.device) + kernel[1, 1] = 5.0 + kernel /= kernel.sum() + kernel = kernel.expand(img.shape[-3], 1, kernel.shape[0], kernel.shape[1]) + + result_tmp, need_cast, need_squeeze, out_dtype = _cast_squeeze_in(img, [kernel.dtype]) + result_tmp = conv2d(result_tmp, kernel, groups=result_tmp.shape[-3]) + result_tmp = _cast_squeeze_out(result_tmp, need_cast, need_squeeze, out_dtype) + + result = img.clone() + result[..., 1:-1, 1:-1] = result_tmp + + return result + + +def adjust_sharpness(img: Tensor, sharpness_factor: float) -> Tensor: + if sharpness_factor < 0: + raise ValueError(f"sharpness_factor ({sharpness_factor}) is not non-negative.") + + _assert_image_tensor(img) + + _assert_channels(img, [1, 3]) + + if img.size(-1) <= 2 or img.size(-2) <= 2: + return img + + return _blend(img, _blurred_degenerate_image(img), sharpness_factor) + + +def autocontrast(img: Tensor) -> Tensor: + + _assert_image_tensor(img) + + if img.ndim < 3: + raise TypeError(f"Input image tensor should have at least 3 dimensions, but found {img.ndim}") + + _assert_channels(img, [1, 3]) + + bound = _max_value(img.dtype) + dtype = img.dtype if torch.is_floating_point(img) else torch.float32 + + minimum = img.amin(dim=(-2, -1), keepdim=True).to(dtype) + maximum = img.amax(dim=(-2, -1), keepdim=True).to(dtype) + scale = bound / (maximum - minimum) + eq_idxs = torch.isfinite(scale).logical_not() + minimum[eq_idxs] = 0 + scale[eq_idxs] = 1 + + return ((img - minimum) * scale).clamp(0, bound).to(img.dtype) + + +def _scale_channel(img_chan: Tensor) -> Tensor: + # TODO: we should expect bincount to always be faster than histc, but this + # isn't always the case. Once + # https://github.com/pytorch/pytorch/issues/53194 is fixed, remove the if + # block and only use bincount. + if img_chan.is_cuda: + hist = torch.histc(img_chan.to(torch.float32), bins=256, min=0, max=255) + else: + hist = torch.bincount(img_chan.reshape(-1), minlength=256) + + nonzero_hist = hist[hist != 0] + step = torch.div(nonzero_hist[:-1].sum(), 255, rounding_mode="floor") + if step == 0: + return img_chan + + lut = torch.div(torch.cumsum(hist, 0) + torch.div(step, 2, rounding_mode="floor"), step, rounding_mode="floor") + lut = torch.nn.functional.pad(lut, [1, 0])[:-1].clamp(0, 255) + + return lut[img_chan.to(torch.int64)].to(torch.uint8) + + +def _equalize_single_image(img: Tensor) -> Tensor: + return torch.stack([_scale_channel(img[c]) for c in range(img.size(0))]) + + +def equalize(img: Tensor) -> Tensor: + + _assert_image_tensor(img) + + if not (3 <= img.ndim <= 4): + raise TypeError(f"Input image tensor should have 3 or 4 dimensions, but found {img.ndim}") + if img.dtype != torch.uint8: + raise TypeError(f"Only torch.uint8 image tensors are supported, but found {img.dtype}") + + _assert_channels(img, [1, 3]) + + if img.ndim == 3: + return _equalize_single_image(img) + + return torch.stack([_equalize_single_image(x) for x in img]) + + +def normalize(tensor: Tensor, mean: List[float], std: List[float], inplace: bool = False) -> Tensor: + _assert_image_tensor(tensor) + + if not tensor.is_floating_point(): + raise TypeError(f"Input tensor should be a float tensor. Got {tensor.dtype}.") + + if tensor.ndim < 3: + raise ValueError( + f"Expected tensor to be a tensor image of size (..., C, H, W). Got tensor.size() = {tensor.size()}" + ) + + if not inplace: + tensor = tensor.clone() + + dtype = tensor.dtype + mean = torch.as_tensor(mean, dtype=dtype, device=tensor.device) + std = torch.as_tensor(std, dtype=dtype, device=tensor.device) + if (std == 0).any(): + raise ValueError(f"std evaluated to zero after conversion to {dtype}, leading to division by zero.") + if mean.ndim == 1: + mean = mean.view(-1, 1, 1) + if std.ndim == 1: + std = std.view(-1, 1, 1) + return tensor.sub_(mean).div_(std) + + +def erase(img: Tensor, i: int, j: int, h: int, w: int, v: Tensor, inplace: bool = False) -> Tensor: + _assert_image_tensor(img) + + if not inplace: + img = img.clone() + + img[..., i : i + h, j : j + w] = v + return img + + +def _create_identity_grid(size: List[int]) -> Tensor: + hw_space = [torch.linspace((-s + 1) / s, (s - 1) / s, s) for s in size] + grid_y, grid_x = torch.meshgrid(hw_space, indexing="ij") + return torch.stack([grid_x, grid_y], -1).unsqueeze(0) # 1 x H x W x 2 + + +def elastic_transform( + img: Tensor, + displacement: Tensor, + interpolation: str = "bilinear", + fill: Optional[Union[int, float, List[float]]] = None, +) -> Tensor: + + if not (isinstance(img, torch.Tensor)): + raise TypeError(f"img should be Tensor. Got {type(img)}") + + size = list(img.shape[-2:]) + displacement = displacement.to(img.device) + + identity_grid = _create_identity_grid(size) + grid = identity_grid.to(img.device) + displacement + return _apply_grid_transform(img, grid, interpolation, fill) diff --git a/shared/package-files/06/06b040956a82a017f58a62be3255645dd5d545658338157d2730bc543b8aa64a/blob b/shared/package-files/06/06b040956a82a017f58a62be3255645dd5d545658338157d2730bc543b8aa64a/blob new file mode 100644 index 0000000000000000000000000000000000000000..293418670ce1b9ac2ded03c65c016faff5a428bb --- /dev/null +++ b/shared/package-files/06/06b040956a82a017f58a62be3255645dd5d545658338157d2730bc543b8aa64a/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor _dirichlet_grad(const at::Tensor & x, const at::Tensor & alpha, const at::Tensor & total); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/06/06b381caddd5de9c6cedd3e0e350791f7b89745b22a86f514ef65e88772e12aa/blob b/shared/package-files/06/06b381caddd5de9c6cedd3e0e350791f7b89745b22a86f514ef65e88772e12aa/blob new file mode 100644 index 0000000000000000000000000000000000000000..dbaa2ea7751a49ac5fe43b690948b675d02bdadc --- /dev/null +++ b/shared/package-files/06/06b381caddd5de9c6cedd3e0e350791f7b89745b22a86f514ef65e88772e12aa/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor special_zeta(const at::Tensor & self, const at::Tensor & other); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/06/06b39b66efb6f772121ab44293451f5d2f1ce5b7ce8c198808f967c889db9977/blob b/shared/package-files/06/06b39b66efb6f772121ab44293451f5d2f1ce5b7ce8c198808f967c889db9977/blob new file mode 100644 index 0000000000000000000000000000000000000000..edb77aff725df51e83c98d90d787cc6718d48ed8 --- /dev/null +++ b/shared/package-files/06/06b39b66efb6f772121ab44293451f5d2f1ce5b7ce8c198808f967c889db9977/blob @@ -0,0 +1,442 @@ +""" +Created on Sat May 19 15:53:21 2018 + +Author: Josef Perktold +License: BSD-3 +""" + +from collections import defaultdict + +import numpy as np + +from statsmodels.base._penalties import SCADSmoothed + + +class ScreeningResults: + """Results for Variable Screening + + Note: Indices except for exog_idx and in the iterated case also + idx_nonzero_batches are based on the combined [exog_keep, exog] array. + + Attributes + ---------- + results_final : instance + Results instance returned by the final fit of the penalized model, i.e. + after trimming exog with params below trimming threshold. + results_pen : results instance + Results instance of the penalized model before trimming. This includes + variables from the last forward selection. + idx_nonzero : ndarray + Index of exog columns in the final selection including exog_keep. + idx_exog : ndarray + Index of exog columns in the final selection for exog candidates, i.e. + without exog_keep. + idx_excl : ndarray + Index of excluded exog based on combined [exog_keep, exog] array. This + is the complement of idx_nonzero. + converged : bool + True if the iteration has converged and stopped before maxiter has been + reached. False if maxiter has been reached. + iterations : int + Number of iterations in the screening process. Each iteration consists + of a forward selection step and a trimming step. + history : dict of lists + Results collected for each iteration during the screening process. + Keys are 'idx_nonzero', 'keep', 'params_keep' and 'idx_added', each + holding a list with one entry appended per iteration. + screener : instance of VariableScreening + The VariableScreening instance that produced these results. + + The ScreeningResults returned by `screen_exog_iterator` has additional + attributes: + + idx_nonzero_batches : ndarray, 2-D + Two-dimensional array with batch index in the first column and variable + index within batch in the second column. They can be used jointly as + index for the data in the exog_iterator. + exog_final_names : list of str + 'var_' where `bidx` is the batch index and `idx` is the + index of the selected column within batch `bidx`. + history_batches : dict of lists + This provides information about the selected variables within each + batch during the first round screening. + 'idx_nonzero' is based on the array that includes exog_keep, while + 'idx_exog' is the index based on the exog of the batch. + """ + def __init__(self, screener, **kwds): + self.screener = screener + self.__dict__.update(**kwds) + + +class VariableScreening: + """Ultra-high, conditional sure independence screening + + This is an adjusted version of Fan's sure independence screening. + + Parameters + ---------- + model : instance of penalizing model + Examples: GLMPenalized, PoissonPenalized and LogitPenalized. + The attributes of the model instance `pen_weight` and `penal` will be + ignored. + pen_weight : float, optional + Penalization weight use in SCAD penalized MLE. + use_weights : bool, optional + If True, penalty weights are used so that `exog_keep` is not + penalized (weight 0) while candidate exog have weight 1. If False, + all penalty weights are set equally. + k_add : int, optional + Number of exog to add during expansion or forward selection. + See Notes section for tie handling. + k_max_add : int, optional + Maximum number of variables to include during variable addition, i.e. + forward selection. Default is 30. + threshold_trim : float, optional + Threshold for trimming parameters to zero, default is 1e-4. + k_max_included : int, optional + Maximum total number of variables to include in model. + ranking_attr : str, optional + This determines the result attribute or model method that is used for + the ranking of exog to include. The availability of attributes depends + on the model. + Default is 'resid_pearson', 'model.score_factor' can be used in GLM. + ranking_project : bool, optional + If ranking_project is True, then the exog candidates for inclusion are + first projected on the already included exog before the computation + of the ranking measure. This brings the ranking measure closer to + the statistic of a score test for variable addition. + + Notes + ----- + Status: experimental, tested only on a limited set of models and + with a limited set of model options. + + Tie handling: If there are ties at the decision threshold, then all those + tied exog columns are treated in the same way. During forward selection + all exog columns with the same boundary value are included. During + elimination, the tied columns are not dropped. Consequently, if ties are + present, then the number of included exog can be larger than specified + by k_add, k_max_add and k_max_included. + + The screening algorithm works similar to step wise regression. Each + iteration of the screening algorithm includes a forward selection step + where variables are added to the model, and a backwards selection step + where variables are removed. In contrast to step wise regression, we add + a fixed number of variables at each forward selection step. The + backwards selection step is based on SCAD penalized estimation and + trimming of variables with estimated coefficients below a threshold. + The tuning parameters can be used to adjust the number of variables to add + and to include depending on the size of the dataset. + + There is currently no automatic tuning parameter selection. Candidate + explanatory variables should be standardized or should be on a similar + scale because penalization and trimming are based on the absolute values + of the parameters. + + + TODOs and current limitations: + + freq_weights are not supported in this. Candidate ranking uses + moment condition with resid_pearson or others without freq_weights. + pearson_resid: GLM resid_pearson does not include freq_weights. + + variable names: do we keep track of those? currently made-up names + + currently only supports numpy arrays, no exog type check or conversion + + currently only single columns are selected, no terms (multi column exog) + """ + + def __init__(self, model, pen_weight=None, use_weights=True, k_add=30, + k_max_add=30, threshold_trim=1e-4, k_max_included=20, + ranking_attr="resid_pearson", ranking_project=True): + + self.model = model + self.model_class = model.__class__ + self.init_kwds = model._get_init_kwds() + # pen_weight and penal are explicitly included + # TODO: check what we want to do here + self.init_kwds.pop("pen_weight", None) + self.init_kwds.pop("penal", None) + + self.endog = model.endog + self.exog_keep = model.exog + self.k_keep = model.exog.shape[1] + self.nobs = len(self.endog) + self.penal = self._get_penal() + + if pen_weight is not None: + self.pen_weight = pen_weight + else: + self.pen_weight = self.nobs * 10 + + # option for screening algorithm + self.use_weights = use_weights + self.k_add = k_add + self.k_max_add = k_max_add + self.threshold_trim = threshold_trim + self.k_max_included = k_max_included + self.ranking_attr = ranking_attr + self.ranking_project = ranking_project + + def _get_penal(self, weights=None): + """Create new Penalty instance""" + return SCADSmoothed(0.1, c0=0.0001, weights=weights) + + def ranking_measure(self, res_pen, exog, keep=None): + """Compute measure for ranking exog candidates for inclusion""" + endog = self.endog + + if self.ranking_project: + assert res_pen.model.exog.shape[1] == len(keep) + ex_incl = res_pen.model.exog[:, keep] + exog = exog - ex_incl.dot(np.linalg.pinv(ex_incl).dot(exog)) + + if self.ranking_attr == "predicted_poisson": + # I keep this for more experiments + + # TODO: does it really help to change/trim params + # we are not reestimating with trimmed model + p = res_pen.params.copy() + if keep is not None: + p[~keep] = 0 + predicted = res_pen.model.predict(p) + # this is currently hardcoded for Poisson + resid_factor = (endog - predicted) / np.sqrt(predicted) + elif self.ranking_attr[:6] == "model.": + # use model method, this is intended for score_factor + attr = self.ranking_attr.split(".")[1] + resid_factor = getattr(res_pen.model, attr)(res_pen.params) + if resid_factor.ndim == 2: + # for score_factor when extra params are in model + resid_factor = resid_factor[:, 0] + mom_cond = np.abs(resid_factor.dot(exog))**2 + else: + # use results attribute + resid_factor = getattr(res_pen, self.ranking_attr) + mom_cond = np.abs(resid_factor.dot(exog))**2 + return mom_cond + + def screen_exog(self, exog, endog=None, maxiter=100, method="bfgs", + disp=False, fit_kwds=None): + """Screen and select variables (columns) in exog + + Parameters + ---------- + exog : ndarray + Candidate explanatory variables that are screened for inclusion in + the model. + endog : ndarray, optional + Use a new endog in the screening model. + This is not tested yet, and might not work correctly. + maxiter : int, optional + Number of screening iterations. + method : str, optional + Optimization method to use in fit, needs to be only of the gradient + optimizers. + disp : bool, optional + Display option for fit during optimization. + fit_kwds : dict-like, optional + Additional keyword arguments passed to the model's `fit` method. + + Returns + ------- + res_screen : instance of ScreeningResults + The attribute `results_final` contains the results instance + with the final model selection. + `idx_nonzero` contains the index of the selected exog in the full + exog, combined exog that are always kept plus exog_candidates. + See ScreeningResults for a full description. + """ + model_class = self.model_class + if endog is None: + # allow a different endog than used in model + endog = self.endog + x0 = self.exog_keep + k_keep = self.k_keep + x1 = exog + k_current = x0.shape[1] + # TODO: remove the need for x, use x1 separately from x0 + # needs change to idx to be based on x1 (candidate variables) + x = np.column_stack((x0, x1)) + nobs, k_vars = x.shape + fkwds = fit_kwds if fit_kwds is not None else {} + fit_kwds = {"maxiter": 200, "disp": False} + fit_kwds.update(fkwds) + + history = defaultdict(list) + idx_nonzero = np.arange(k_keep, dtype=int) + keep = np.ones(k_keep, np.bool_) + idx_excl = np.arange(k_keep, k_vars) + mod_pen = model_class(endog, x0, **self.init_kwds) + # do not penalize initial estimate + mod_pen.pen_weight = 0 + res_pen = mod_pen.fit(**fit_kwds) + start_params = res_pen.params + converged = False + idx_old = [] + iterations = 0 + for _ in range(maxiter): + iterations += 1 + # candidates for inclusion in next iteration + x1 = x[:, idx_excl] + mom_cond = self.ranking_measure(res_pen, x1, keep=keep) + assert len(mom_cond) == len(idx_excl) + mcs = np.sort(mom_cond)[::-1] + idx_thr = min((self.k_max_add, k_current + self.k_add, len(mcs))) + threshold = mcs[idx_thr] + # indices of exog in current expansion model + idx = np.concatenate((idx_nonzero, idx_excl[mom_cond > threshold])) + start_params2 = np.zeros(len(idx)) + start_params2[:len(start_params)] = start_params + + if self.use_weights: + weights = np.ones(len(idx)) + weights[:k_keep] = 0 + # modify Penalty instance attached to self + # damgerous if res_pen is reused + self.penal.weights = weights + mod_pen = model_class(endog, x[:, idx], penal=self.penal, + pen_weight=self.pen_weight, + **self.init_kwds) + + res_pen = mod_pen.fit(method=method, + start_params=start_params2, + warn_convergence=False, skip_hessian=True, + **fit_kwds) + + keep = np.abs(res_pen.params) > self.threshold_trim + # use largest params to keep + if keep.sum() > self.k_max_included: + # TODO we can use now np.partition with partial sort + thresh_params = np.sort(np.abs(res_pen.params))[ + -self.k_max_included] + keep2 = np.abs(res_pen.params) > thresh_params + keep = np.logical_and(keep, keep2) + + # Note: idx and keep are for current expansion model + # idx_nonzero has indices of selected variables in full exog + keep[:k_keep] = True # always keep exog_keep + idx_nonzero = idx[keep] + + if disp: + print(keep) + print(idx_nonzero) + # x0 is exog of currently selected model, not used in iteration + # x0 = x[:, idx_nonzero] + k_current = len(idx_nonzero) + start_params = res_pen.params[keep] + + # use mask to get excluded indices + mask_excl = np.ones(k_vars, dtype=bool) + mask_excl[idx_nonzero] = False + idx_excl = np.nonzero(mask_excl)[0] + history["idx_nonzero"].append(idx_nonzero) + history["keep"].append(keep) + history["params_keep"].append(start_params) + history["idx_added"].append(idx) + + if (len(idx_nonzero) == len(idx_old) and + (idx_nonzero == idx_old).all()): + converged = True + break + idx_old = idx_nonzero + + # final esimate + # check that we still have exog_keep + assert np.all(idx_nonzero[:k_keep] == np.arange(k_keep)) + if self.use_weights: + weights = np.ones(len(idx_nonzero)) + weights[:k_keep] = 0 + # create new Penalty instance to avoide sharing attached penal + penal = self._get_penal(weights=weights) + else: + penal = self.penal + mod_final = model_class(endog, x[:, idx_nonzero], + penal=penal, + pen_weight=self.pen_weight, + **self.init_kwds) + + res_final = mod_final.fit(method=method, + start_params=start_params, + warn_convergence=False, + **fit_kwds) + # set exog_names for final model + xnames = [f"var{ii:4d}" for ii in idx_nonzero] + res_final.model.exog_names[k_keep:] = xnames[k_keep:] + + res = ScreeningResults(self, + results_pen=res_pen, + results_final=res_final, + idx_nonzero=idx_nonzero, + idx_exog=idx_nonzero[k_keep:] - k_keep, + idx_excl=idx_excl, + history=history, + converged=converged, + iterations=iterations + ) + return res + + def screen_exog_iterator(self, exog_iterator): + """ + Batched version of screen exog + + This screens variables in a two step process: + + In the first step screen_exog is used on each element of the + exog_iterator, and the batch winners are collected. + + In the second step all batch winners are combined into a new array + of exog candidates and `screen_exog` is used to select a final + model. + + Parameters + ---------- + exog_iterator : iterator over ndarrays + Batches of candidate explanatory variables that are screened + for inclusion in the model. + + Returns + ------- + res_screen_final : instance of ScreeningResults + This is the instance returned by the second round call to + `screen_exog`. Additional attributes are added to provide + more information about the batched selection process. + The index of final nonzero variables is + `idx_nonzero_batches` which is a 2-dimensional array with batch + index in the first column and variable index within batch in the + second column. They can be used jointly as index for the data + in the exog_iterator. + See ScreeningResults for a full description. + """ + k_keep = self.k_keep + # res_batches = [] + res_idx = [] + exog_winner = [] + exog_idx = [] + for ex in exog_iterator: + res_screen = self.screen_exog(ex, maxiter=20) + # avoid storing res_screen, only for debugging + # res_batches.append(res_screen) + res_idx.append(res_screen.idx_nonzero) + exog_winner.append(ex[:, res_screen.idx_nonzero[k_keep:] - k_keep]) + exog_idx.append(res_screen.idx_nonzero[k_keep:] - k_keep) + + exog_winner = np.column_stack(exog_winner) + res_screen_final = self.screen_exog(exog_winner, maxiter=20) + + exog_winner_names = [f"var{bidx:d}_{idx:d}" + for bidx, batch in enumerate(exog_idx) + for idx in batch] + + idx_full = [(bidx, idx) + for bidx, batch in enumerate(exog_idx) + for idx in batch] + ex_final_idx = res_screen_final.idx_nonzero[k_keep:] - k_keep + final_names = np.array(exog_winner_names)[ex_final_idx] + res_screen_final.idx_nonzero_batches = np.array(idx_full)[ex_final_idx] + res_screen_final.exog_final_names = final_names + history = {"idx_nonzero": res_idx, + "idx_exog": exog_idx} + res_screen_final.history_batches = history + return res_screen_final diff --git a/shared/package-files/06/06b5f7f9a40b0fd5b5d6dd56f1fd12968d9935b46500a93b66808e44bf349ea6/blob b/shared/package-files/06/06b5f7f9a40b0fd5b5d6dd56f1fd12968d9935b46500a93b66808e44bf349ea6/blob new file mode 100644 index 0000000000000000000000000000000000000000..5f9b30a0ce5412015b14e31341215b33b1c85410 Binary files /dev/null and b/shared/package-files/06/06b5f7f9a40b0fd5b5d6dd56f1fd12968d9935b46500a93b66808e44bf349ea6/blob differ diff --git a/shared/package-files/06/06b83b8b3586648dc1ad136c0ed25301883cc7e7d7f03b3286981416a15b3057/blob b/shared/package-files/06/06b83b8b3586648dc1ad136c0ed25301883cc7e7d7f03b3286981416a15b3057/blob new file mode 100644 index 0000000000000000000000000000000000000000..960b2e1d4625fe0375339deed4514f2de6a6ba7b --- /dev/null +++ b/shared/package-files/06/06b83b8b3586648dc1ad136c0ed25301883cc7e7d7f03b3286981416a15b3057/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API clone { + using schema = at::Tensor (const at::Tensor &, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::clone") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "clone(Tensor self, *, MemoryFormat? memory_format=None) -> Tensor") + static at::Tensor call(const at::Tensor & self, c10::optional memory_format); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::optional memory_format); +}; + +struct TORCH_API clone_out { + using schema = at::Tensor & (const at::Tensor &, c10::optional, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::clone") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "clone.out(Tensor self, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, c10::optional memory_format, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::optional memory_format, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/06/06b881b824f71e95d72af4ab865de4c35553e791b6d959a125caac61401cc350/blob b/shared/package-files/06/06b881b824f71e95d72af4ab865de4c35553e791b6d959a125caac61401cc350/blob new file mode 100644 index 0000000000000000000000000000000000000000..687c50683a09c06a9315bc6511e26dd474dad638 --- /dev/null +++ b/shared/package-files/06/06b881b824f71e95d72af4ab865de4c35553e791b6d959a125caac61401cc350/blob @@ -0,0 +1,442 @@ +"""Implementation of JSONEncoder +""" +import re + +try: + from _json import encode_basestring_ascii as c_encode_basestring_ascii +except ImportError: + c_encode_basestring_ascii = None +try: + from _json import encode_basestring as c_encode_basestring +except ImportError: + c_encode_basestring = None +try: + from _json import make_encoder as c_make_encoder +except ImportError: + c_make_encoder = None + +ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]') +ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') +HAS_UTF8 = re.compile(b'[\x80-\xff]') +ESCAPE_DCT = { + '\\': '\\\\', + '"': '\\"', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', +} +for i in range(0x20): + ESCAPE_DCT.setdefault(chr(i), '\\u{0:04x}'.format(i)) + #ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,)) + +INFINITY = float('inf') + +def py_encode_basestring(s): + """Return a JSON representation of a Python string + + """ + def replace(match): + return ESCAPE_DCT[match.group(0)] + return '"' + ESCAPE.sub(replace, s) + '"' + + +encode_basestring = (c_encode_basestring or py_encode_basestring) + + +def py_encode_basestring_ascii(s): + """Return an ASCII-only JSON representation of a Python string + + """ + def replace(match): + s = match.group(0) + try: + return ESCAPE_DCT[s] + except KeyError: + n = ord(s) + if n < 0x10000: + return '\\u{0:04x}'.format(n) + #return '\\u%04x' % (n,) + else: + # surrogate pair + n -= 0x10000 + s1 = 0xd800 | ((n >> 10) & 0x3ff) + s2 = 0xdc00 | (n & 0x3ff) + return '\\u{0:04x}\\u{1:04x}'.format(s1, s2) + return '"' + ESCAPE_ASCII.sub(replace, s) + '"' + + +encode_basestring_ascii = ( + c_encode_basestring_ascii or py_encode_basestring_ascii) + +class JSONEncoder(object): + """Extensible JSON encoder for Python data structures. + + Supports the following objects and types by default: + + +-------------------+---------------+ + | Python | JSON | + +===================+===============+ + | dict | object | + +-------------------+---------------+ + | list, tuple | array | + +-------------------+---------------+ + | str | string | + +-------------------+---------------+ + | int, float | number | + +-------------------+---------------+ + | True | true | + +-------------------+---------------+ + | False | false | + +-------------------+---------------+ + | None | null | + +-------------------+---------------+ + + To extend this to recognize other objects, subclass and implement a + ``.default()`` method with another method that returns a serializable + object for ``o`` if possible, otherwise it should call the superclass + implementation (to raise ``TypeError``). + + """ + item_separator = ', ' + key_separator = ': ' + def __init__(self, *, skipkeys=False, ensure_ascii=True, + check_circular=True, allow_nan=True, sort_keys=False, + indent=None, separators=None, default=None): + """Constructor for JSONEncoder, with sensible defaults. + + If skipkeys is false, then it is a TypeError to attempt + encoding of keys that are not str, int, float or None. If + skipkeys is True, such items are simply skipped. + + If ensure_ascii is true, the output is guaranteed to be str + objects with all incoming non-ASCII characters escaped. If + ensure_ascii is false, the output can contain non-ASCII characters. + + If check_circular is true, then lists, dicts, and custom encoded + objects will be checked for circular references during encoding to + prevent an infinite recursion (which would cause an RecursionError). + Otherwise, no such check takes place. + + If allow_nan is true, then NaN, Infinity, and -Infinity will be + encoded as such. This behavior is not JSON specification compliant, + but is consistent with most JavaScript based encoders and decoders. + Otherwise, it will be a ValueError to encode such floats. + + If sort_keys is true, then the output of dictionaries will be + sorted by key; this is useful for regression tests to ensure + that JSON serializations can be compared on a day-to-day basis. + + If indent is a non-negative integer, then JSON array + elements and object members will be pretty-printed with that + indent level. An indent level of 0 will only insert newlines. + None is the most compact representation. + + If specified, separators should be an (item_separator, key_separator) + tuple. The default is (', ', ': ') if *indent* is ``None`` and + (',', ': ') otherwise. To get the most compact JSON representation, + you should specify (',', ':') to eliminate whitespace. + + If specified, default is a function that gets called for objects + that can't otherwise be serialized. It should return a JSON encodable + version of the object or raise a ``TypeError``. + + """ + + self.skipkeys = skipkeys + self.ensure_ascii = ensure_ascii + self.check_circular = check_circular + self.allow_nan = allow_nan + self.sort_keys = sort_keys + self.indent = indent + if separators is not None: + self.item_separator, self.key_separator = separators + elif indent is not None: + self.item_separator = ',' + if default is not None: + self.default = default + + def default(self, o): + """Implement this method in a subclass such that it returns + a serializable object for ``o``, or calls the base implementation + (to raise a ``TypeError``). + + For example, to support arbitrary iterators, you could + implement default like this:: + + def default(self, o): + try: + iterable = iter(o) + except TypeError: + pass + else: + return list(iterable) + # Let the base class default method raise the TypeError + return JSONEncoder.default(self, o) + + """ + raise TypeError(f'Object of type {o.__class__.__name__} ' + f'is not JSON serializable') + + def encode(self, o): + """Return a JSON string representation of a Python data structure. + + >>> from json.encoder import JSONEncoder + >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) + '{"foo": ["bar", "baz"]}' + + """ + # This is for extremely simple cases and benchmarks. + if isinstance(o, str): + if self.ensure_ascii: + return encode_basestring_ascii(o) + else: + return encode_basestring(o) + # This doesn't pass the iterator directly to ''.join() because the + # exceptions aren't as detailed. The list call should be roughly + # equivalent to the PySequence_Fast that ''.join() would do. + chunks = self.iterencode(o, _one_shot=True) + if not isinstance(chunks, (list, tuple)): + chunks = list(chunks) + return ''.join(chunks) + + def iterencode(self, o, _one_shot=False): + """Encode the given object and yield each string + representation as available. + + For example:: + + for chunk in JSONEncoder().iterencode(bigobject): + mysocket.write(chunk) + + """ + if self.check_circular: + markers = {} + else: + markers = None + if self.ensure_ascii: + _encoder = encode_basestring_ascii + else: + _encoder = encode_basestring + + def floatstr(o, allow_nan=self.allow_nan, + _repr=float.__repr__, _inf=INFINITY, _neginf=-INFINITY): + # Check for specials. Note that this type of test is processor + # and/or platform-specific, so do tests which don't depend on the + # internals. + + if o != o: + text = 'NaN' + elif o == _inf: + text = 'Infinity' + elif o == _neginf: + text = '-Infinity' + else: + return _repr(o) + + if not allow_nan: + raise ValueError( + "Out of range float values are not JSON compliant: " + + repr(o)) + + return text + + + if (_one_shot and c_make_encoder is not None + and self.indent is None): + _iterencode = c_make_encoder( + markers, self.default, _encoder, self.indent, + self.key_separator, self.item_separator, self.sort_keys, + self.skipkeys, self.allow_nan) + else: + _iterencode = _make_iterencode( + markers, self.default, _encoder, self.indent, floatstr, + self.key_separator, self.item_separator, self.sort_keys, + self.skipkeys, _one_shot) + return _iterencode(o, 0) + +def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, + _key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot, + ## HACK: hand-optimized bytecode; turn globals into locals + ValueError=ValueError, + dict=dict, + float=float, + id=id, + int=int, + isinstance=isinstance, + list=list, + str=str, + tuple=tuple, + _intstr=int.__repr__, + ): + + if _indent is not None and not isinstance(_indent, str): + _indent = ' ' * _indent + + def _iterencode_list(lst, _current_indent_level): + if not lst: + yield '[]' + return + if markers is not None: + markerid = id(lst) + if markerid in markers: + raise ValueError("Circular reference detected") + markers[markerid] = lst + buf = '[' + if _indent is not None: + _current_indent_level += 1 + newline_indent = '\n' + _indent * _current_indent_level + separator = _item_separator + newline_indent + buf += newline_indent + else: + newline_indent = None + separator = _item_separator + first = True + for value in lst: + if first: + first = False + else: + buf = separator + if isinstance(value, str): + yield buf + _encoder(value) + elif value is None: + yield buf + 'null' + elif value is True: + yield buf + 'true' + elif value is False: + yield buf + 'false' + elif isinstance(value, int): + # Subclasses of int/float may override __repr__, but we still + # want to encode them as integers/floats in JSON. One example + # within the standard library is IntEnum. + yield buf + _intstr(value) + elif isinstance(value, float): + # see comment above for int + yield buf + _floatstr(value) + else: + yield buf + if isinstance(value, (list, tuple)): + chunks = _iterencode_list(value, _current_indent_level) + elif isinstance(value, dict): + chunks = _iterencode_dict(value, _current_indent_level) + else: + chunks = _iterencode(value, _current_indent_level) + yield from chunks + if newline_indent is not None: + _current_indent_level -= 1 + yield '\n' + _indent * _current_indent_level + yield ']' + if markers is not None: + del markers[markerid] + + def _iterencode_dict(dct, _current_indent_level): + if not dct: + yield '{}' + return + if markers is not None: + markerid = id(dct) + if markerid in markers: + raise ValueError("Circular reference detected") + markers[markerid] = dct + yield '{' + if _indent is not None: + _current_indent_level += 1 + newline_indent = '\n' + _indent * _current_indent_level + item_separator = _item_separator + newline_indent + yield newline_indent + else: + newline_indent = None + item_separator = _item_separator + first = True + if _sort_keys: + items = sorted(dct.items()) + else: + items = dct.items() + for key, value in items: + if isinstance(key, str): + pass + # JavaScript is weakly typed for these, so it makes sense to + # also allow them. Many encoders seem to do something like this. + elif isinstance(key, float): + # see comment for int/float in _make_iterencode + key = _floatstr(key) + elif key is True: + key = 'true' + elif key is False: + key = 'false' + elif key is None: + key = 'null' + elif isinstance(key, int): + # see comment for int/float in _make_iterencode + key = _intstr(key) + elif _skipkeys: + continue + else: + raise TypeError(f'keys must be str, int, float, bool or None, ' + f'not {key.__class__.__name__}') + if first: + first = False + else: + yield item_separator + yield _encoder(key) + yield _key_separator + if isinstance(value, str): + yield _encoder(value) + elif value is None: + yield 'null' + elif value is True: + yield 'true' + elif value is False: + yield 'false' + elif isinstance(value, int): + # see comment for int/float in _make_iterencode + yield _intstr(value) + elif isinstance(value, float): + # see comment for int/float in _make_iterencode + yield _floatstr(value) + else: + if isinstance(value, (list, tuple)): + chunks = _iterencode_list(value, _current_indent_level) + elif isinstance(value, dict): + chunks = _iterencode_dict(value, _current_indent_level) + else: + chunks = _iterencode(value, _current_indent_level) + yield from chunks + if newline_indent is not None: + _current_indent_level -= 1 + yield '\n' + _indent * _current_indent_level + yield '}' + if markers is not None: + del markers[markerid] + + def _iterencode(o, _current_indent_level): + if isinstance(o, str): + yield _encoder(o) + elif o is None: + yield 'null' + elif o is True: + yield 'true' + elif o is False: + yield 'false' + elif isinstance(o, int): + # see comment for int/float in _make_iterencode + yield _intstr(o) + elif isinstance(o, float): + # see comment for int/float in _make_iterencode + yield _floatstr(o) + elif isinstance(o, (list, tuple)): + yield from _iterencode_list(o, _current_indent_level) + elif isinstance(o, dict): + yield from _iterencode_dict(o, _current_indent_level) + else: + if markers is not None: + markerid = id(o) + if markerid in markers: + raise ValueError("Circular reference detected") + markers[markerid] = o + o = _default(o) + yield from _iterencode(o, _current_indent_level) + if markers is not None: + del markers[markerid] + return _iterencode diff --git a/shared/package-files/06/06b8b7396bb8964915e9818b68b518b5d03de58f1e84ae4ca1b313843a024edd/blob b/shared/package-files/06/06b8b7396bb8964915e9818b68b518b5d03de58f1e84ae4ca1b313843a024edd/blob new file mode 100644 index 0000000000000000000000000000000000000000..7111d893400f2f2aee77cf51fe2f6ac914ccd58e --- /dev/null +++ b/shared/package-files/06/06b8b7396bb8964915e9818b68b518b5d03de58f1e84ae4ca1b313843a024edd/blob @@ -0,0 +1,62 @@ +import operator +from functools import reduce + + +def maybe_view(tensor, size, check_same_size=True): + if check_same_size and tensor.size() == size: + return tensor + return tensor.contiguous().view(size) + + +def maybe_unexpand(tensor, old_size, check_same_size=True): + if check_same_size and tensor.size() == old_size: + return tensor + num_unsqueezed = tensor.dim() - len(old_size) + expanded_dims = [ + dim + for dim, (expanded, original) in enumerate( + zip(tensor.size()[num_unsqueezed:], old_size) + ) + if expanded != original + ] + + for _ in range(num_unsqueezed): + tensor = tensor.sum(0, keepdim=False) + for dim in expanded_dims: + tensor = tensor.sum(dim, keepdim=True) + return tensor + + +# Check whether the op enable broadcasting, and whether it is supported by ONNX. +# If dims1 and dims2 are different, then broadcast is True. +# We always assume the combination of dims1 and dims2 is broadcastable. +# The following types of broadcasting are supported in ONNX: +# 1) Only one element in dims2, such as dims2 = [1, 1] +# 2) dims2 is suffix of dims1, such as dims1 = [2, 3, 4], and dims2 = [3, 4] +# Details can be found here: https://github.com/onnx/onnx/blob/master/docs/Operators.md#Gemm +def check_onnx_broadcast(dims1, dims2): + broadcast = False + supported = True + len1 = len(dims1) + len2 = len(dims2) + numel1 = reduce(operator.mul, dims1) + numel2 = reduce(operator.mul, dims2) + if len1 < len2: + broadcast = True + if numel2 != 1: + supported = False + elif len1 > len2: + broadcast = True + if numel2 != 1 and dims1[len1 - len2 :] != dims2: + supported = False + else: + if dims1 != dims2: + broadcast = True + if numel2 != 1: + supported = False + + if not supported: + raise ValueError( + f"Numpy style broadcasting is not supported in ONNX. Input dims are: {dims1}, {dims2}" + ) + return broadcast diff --git a/shared/package-files/06/06bcfff317bfc97d78441e81f29564e8169c33a1e2cea914088439bdcf54fbf2/blob b/shared/package-files/06/06bcfff317bfc97d78441e81f29564e8169c33a1e2cea914088439bdcf54fbf2/blob new file mode 100644 index 0000000000000000000000000000000000000000..78c6965afde020458ffd198c9497f518611d4eb6 --- /dev/null +++ b/shared/package-files/06/06bcfff317bfc97d78441e81f29564e8169c33a1e2cea914088439bdcf54fbf2/blob @@ -0,0 +1,51 @@ +from datetime import datetime, tzinfo +from typing import IO, Any, Dict, List, Mapping, Optional, Text, Tuple, Union + +_FileOrStr = Union[bytes, Text, IO[str], IO[Any]] + +class parserinfo(object): + JUMP: List[str] + WEEKDAYS: List[Tuple[str, str]] + MONTHS: List[Tuple[str, str]] + HMS: List[Tuple[str, str, str]] + AMPM: List[Tuple[str, str]] + UTCZONE: List[str] + PERTAIN: List[str] + TZOFFSET: Dict[str, int] + def __init__(self, dayfirst: bool = ..., yearfirst: bool = ...) -> None: ... + def jump(self, name: Text) -> bool: ... + def weekday(self, name: Text) -> Optional[int]: ... + def month(self, name: Text) -> Optional[int]: ... + def hms(self, name: Text) -> Optional[int]: ... + def ampm(self, name: Text) -> Optional[int]: ... + def pertain(self, name: Text) -> bool: ... + def utczone(self, name: Text) -> bool: ... + def tzoffset(self, name: Text) -> Optional[int]: ... + def convertyear(self, year: int) -> int: ... + def validate(self, res: datetime) -> bool: ... + +class parser(object): + def __init__(self, info: Optional[parserinfo] = ...) -> None: ... + def parse( + self, + timestr: _FileOrStr, + default: Optional[datetime] = ..., + ignoretz: bool = ..., + tzinfos: Optional[Mapping[Text, tzinfo]] = ..., + **kwargs: Any, + ) -> datetime: ... + +def isoparse(dt_str: Union[str, bytes, IO[str], IO[bytes]]) -> datetime: ... + +DEFAULTPARSER: parser + +def parse(timestr: _FileOrStr, parserinfo: Optional[parserinfo] = ..., **kwargs: Any) -> datetime: ... + +class _tzparser: ... + +DEFAULTTZPARSER: _tzparser + +class InvalidDatetimeError(ValueError): ... +class InvalidDateError(InvalidDatetimeError): ... +class InvalidTimeError(InvalidDatetimeError): ... +class ParserError(ValueError): ... diff --git a/shared/package-files/06/06bd03cb0ab219a5701da59b81b21664b9d0610ed2a5ad38678794f13ac7cfef/blob b/shared/package-files/06/06bd03cb0ab219a5701da59b81b21664b9d0610ed2a5ad38678794f13ac7cfef/blob new file mode 100644 index 0000000000000000000000000000000000000000..f06fa7396edfdc3f08801d7ba63264ca0286c3fb --- /dev/null +++ b/shared/package-files/06/06bd03cb0ab219a5701da59b81b21664b9d0610ed2a5ad38678794f13ac7cfef/blob @@ -0,0 +1,309 @@ +import sys +from array import array +from typing import ( + Any, + Callable, + ClassVar, + Generic, + Iterable, + Iterator, + List, + Mapping, + Optional, + Sequence, + Text, + Tuple, + Type, + TypeVar, + Union as _UnionT, + overload, +) + +if sys.version_info >= (3, 9): + from types import GenericAlias + +_T = TypeVar("_T") +_DLLT = TypeVar("_DLLT", bound=CDLL) +_CT = TypeVar("_CT", bound=_CData) + +RTLD_GLOBAL: int = ... +RTLD_LOCAL: int = ... +DEFAULT_MODE: int = ... + +class CDLL(object): + _func_flags_: ClassVar[int] = ... + _func_restype_: ClassVar[_CData] = ... + _name: str = ... + _handle: int = ... + _FuncPtr: Type[_FuncPointer] = ... + def __init__( + self, + name: Optional[str], + mode: int = ..., + handle: Optional[int] = ..., + use_errno: bool = ..., + use_last_error: bool = ..., + winmode: Optional[int] = ..., + ) -> None: ... + def __getattr__(self, name: str) -> _NamedFuncPointer: ... + def __getitem__(self, name: str) -> _NamedFuncPointer: ... + +if sys.platform == "win32": + class OleDLL(CDLL): ... + class WinDLL(CDLL): ... + +class PyDLL(CDLL): ... + +class LibraryLoader(Generic[_DLLT]): + def __init__(self, dlltype: Type[_DLLT]) -> None: ... + def __getattr__(self, name: str) -> _DLLT: ... + def __getitem__(self, name: str) -> _DLLT: ... + def LoadLibrary(self, name: str) -> _DLLT: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... + +cdll: LibraryLoader[CDLL] = ... +if sys.platform == "win32": + windll: LibraryLoader[WinDLL] = ... + oledll: LibraryLoader[OleDLL] = ... +pydll: LibraryLoader[PyDLL] = ... +pythonapi: PyDLL = ... + +# Anything that implements the read-write buffer interface. +# The buffer interface is defined purely on the C level, so we cannot define a normal Protocol +# for it. Instead we have to list the most common stdlib buffer classes in a Union. +_WritableBuffer = _UnionT[bytearray, memoryview, array, _CData] +# Same as _WritableBuffer, but also includes read-only buffer types (like bytes). +_ReadOnlyBuffer = _UnionT[_WritableBuffer, bytes] + +class _CDataMeta(type): + # By default mypy complains about the following two methods, because strictly speaking cls + # might not be a Type[_CT]. However this can never actually happen, because the only class that + # uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here. + def __mul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore + def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore + +class _CData(metaclass=_CDataMeta): + _b_base: int = ... + _b_needsfree_: bool = ... + _objects: Optional[Mapping[Any, int]] = ... + @classmethod + def from_buffer(cls: Type[_CT], source: _WritableBuffer, offset: int = ...) -> _CT: ... + @classmethod + def from_buffer_copy(cls: Type[_CT], source: _ReadOnlyBuffer, offset: int = ...) -> _CT: ... + @classmethod + def from_address(cls: Type[_CT], address: int) -> _CT: ... + @classmethod + def from_param(cls: Type[_CT], obj: Any) -> _UnionT[_CT, _CArgObject]: ... + @classmethod + def in_dll(cls: Type[_CT], library: CDLL, name: str) -> _CT: ... + +class _CanCastTo(_CData): ... +class _PointerLike(_CanCastTo): ... + +_ECT = Callable[[Optional[Type[_CData]], _FuncPointer, Tuple[_CData, ...]], _CData] +_PF = _UnionT[Tuple[int], Tuple[int, str], Tuple[int, str, Any]] + +class _FuncPointer(_PointerLike, _CData): + restype: _UnionT[Type[_CData], Callable[[int], None], None] = ... + argtypes: Sequence[Type[_CData]] = ... + errcheck: _ECT = ... + @overload + def __init__(self, address: int) -> None: ... + @overload + def __init__(self, callable: Callable[..., Any]) -> None: ... + @overload + def __init__(self, func_spec: Tuple[_UnionT[str, int], CDLL], paramflags: Tuple[_PF, ...] = ...) -> None: ... + @overload + def __init__(self, vtlb_index: int, name: str, paramflags: Tuple[_PF, ...] = ..., iid: pointer[c_int] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + +class _NamedFuncPointer(_FuncPointer): + __name__: str + +class ArgumentError(Exception): ... + +def CFUNCTYPE( + restype: Optional[Type[_CData]], *argtypes: Type[_CData], use_errno: bool = ..., use_last_error: bool = ... +) -> Type[_FuncPointer]: ... + +if sys.platform == "win32": + def WINFUNCTYPE( + restype: Optional[Type[_CData]], *argtypes: Type[_CData], use_errno: bool = ..., use_last_error: bool = ... + ) -> Type[_FuncPointer]: ... + +def PYFUNCTYPE(restype: Optional[Type[_CData]], *argtypes: Type[_CData]) -> Type[_FuncPointer]: ... + +class _CArgObject: ... + +# Any type that can be implicitly converted to c_void_p when passed as a C function argument. +# (bytes is not included here, see below.) +_CVoidPLike = _UnionT[_PointerLike, Array[Any], _CArgObject, int] +# Same as above, but including types known to be read-only (i. e. bytes). +# This distinction is not strictly necessary (ctypes doesn't differentiate between const +# and non-const pointers), but it catches errors like memmove(b'foo', buf, 4) +# when memmove(buf, b'foo', 4) was intended. +_CVoidConstPLike = _UnionT[_CVoidPLike, bytes] + +def addressof(obj: _CData) -> int: ... +def alignment(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... +def byref(obj: _CData, offset: int = ...) -> _CArgObject: ... + +_CastT = TypeVar("_CastT", bound=_CanCastTo) + +def cast(obj: _UnionT[_CData, _CArgObject, int], type: Type[_CastT]) -> _CastT: ... +def create_string_buffer(init: _UnionT[int, bytes], size: Optional[int] = ...) -> Array[c_char]: ... + +c_buffer = create_string_buffer + +def create_unicode_buffer(init: _UnionT[int, Text], size: Optional[int] = ...) -> Array[c_wchar]: ... + +if sys.platform == "win32": + def DllCanUnloadNow() -> int: ... + def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO not documented + def FormatError(code: int) -> str: ... + def GetLastError() -> int: ... + +def get_errno() -> int: ... + +if sys.platform == "win32": + def get_last_error() -> int: ... + +def memmove(dst: _CVoidPLike, src: _CVoidConstPLike, count: int) -> None: ... +def memset(dst: _CVoidPLike, c: int, count: int) -> None: ... +def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ... + +# The real ctypes.pointer is a function, not a class. The stub version of pointer behaves like +# ctypes._Pointer in that it is the base class for all pointer types. Unlike the real _Pointer, +# it can be instantiated directly (to mimic the behavior of the real pointer function). +class pointer(Generic[_CT], _PointerLike, _CData): + _type_: ClassVar[Type[_CT]] = ... + contents: _CT = ... + def __init__(self, arg: _CT = ...) -> None: ... + @overload + def __getitem__(self, i: int) -> _CT: ... + @overload + def __getitem__(self, s: slice) -> List[_CT]: ... + @overload + def __setitem__(self, i: int, o: _CT) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_CT]) -> None: ... + +def resize(obj: _CData, size: int) -> None: ... + +if sys.version_info < (3,): + def set_conversion_mode(encoding: str, errors: str) -> Tuple[str, str]: ... + +def set_errno(value: int) -> int: ... + +if sys.platform == "win32": + def set_last_error(value: int) -> int: ... + +def sizeof(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... +def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ... + +if sys.platform == "win32": + def WinError(code: Optional[int] = ..., descr: Optional[str] = ...) -> OSError: ... + +def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ... + +class _SimpleCData(Generic[_T], _CData): + value: _T = ... + def __init__(self, value: _T = ...) -> None: ... + +class c_byte(_SimpleCData[int]): ... + +class c_char(_SimpleCData[bytes]): + def __init__(self, value: _UnionT[int, bytes] = ...) -> None: ... + +class c_char_p(_PointerLike, _SimpleCData[Optional[bytes]]): + def __init__(self, value: Optional[_UnionT[int, bytes]] = ...) -> None: ... + +class c_double(_SimpleCData[float]): ... +class c_longdouble(_SimpleCData[float]): ... +class c_float(_SimpleCData[float]): ... +class c_int(_SimpleCData[int]): ... +class c_int8(_SimpleCData[int]): ... +class c_int16(_SimpleCData[int]): ... +class c_int32(_SimpleCData[int]): ... +class c_int64(_SimpleCData[int]): ... +class c_long(_SimpleCData[int]): ... +class c_longlong(_SimpleCData[int]): ... +class c_short(_SimpleCData[int]): ... +class c_size_t(_SimpleCData[int]): ... +class c_ssize_t(_SimpleCData[int]): ... +class c_ubyte(_SimpleCData[int]): ... +class c_uint(_SimpleCData[int]): ... +class c_uint8(_SimpleCData[int]): ... +class c_uint16(_SimpleCData[int]): ... +class c_uint32(_SimpleCData[int]): ... +class c_uint64(_SimpleCData[int]): ... +class c_ulong(_SimpleCData[int]): ... +class c_ulonglong(_SimpleCData[int]): ... +class c_ushort(_SimpleCData[int]): ... +class c_void_p(_PointerLike, _SimpleCData[Optional[int]]): ... +class c_wchar(_SimpleCData[Text]): ... + +class c_wchar_p(_PointerLike, _SimpleCData[Optional[Text]]): + def __init__(self, value: Optional[_UnionT[int, Text]] = ...) -> None: ... + +class c_bool(_SimpleCData[bool]): + def __init__(self, value: bool = ...) -> None: ... + +if sys.platform == "win32": + class HRESULT(_SimpleCData[int]): ... # TODO undocumented + +class py_object(_CanCastTo, _SimpleCData[_T]): ... + +class _CField: + offset: int = ... + size: int = ... + +class _StructUnionMeta(_CDataMeta): + _fields_: Sequence[_UnionT[Tuple[str, Type[_CData]], Tuple[str, Type[_CData], int]]] = ... + _pack_: int = ... + _anonymous_: Sequence[str] = ... + def __getattr__(self, name: str) -> _CField: ... + +class _StructUnionBase(_CData, metaclass=_StructUnionMeta): + def __init__(self, *args: Any, **kw: Any) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + +class Union(_StructUnionBase): ... +class Structure(_StructUnionBase): ... +class BigEndianStructure(Structure): ... +class LittleEndianStructure(Structure): ... + +class Array(Generic[_CT], _CData): + _length_: ClassVar[int] = ... + _type_: ClassVar[Type[_CT]] = ... + raw: bytes = ... # Note: only available if _CT == c_char + value: Any = ... # Note: bytes if _CT == c_char, Text if _CT == c_wchar, unavailable otherwise + # TODO These methods cannot be annotated correctly at the moment. + # All of these "Any"s stand for the array's element type, but it's not possible to use _CT + # here, because of a special feature of ctypes. + # By default, when accessing an element of an Array[_CT], the returned object has type _CT. + # However, when _CT is a "simple type" like c_int, ctypes automatically "unboxes" the object + # and converts it to the corresponding Python primitive. For example, when accessing an element + # of an Array[c_int], a Python int object is returned, not a c_int. + # This behavior does *not* apply to subclasses of "simple types". + # If MyInt is a subclass of c_int, then accessing an element of an Array[MyInt] returns + # a MyInt, not an int. + # This special behavior is not easy to model in a stub, so for now all places where + # the array element type would belong are annotated with Any instead. + def __init__(self, *args: Any) -> None: ... + @overload + def __getitem__(self, i: int) -> Any: ... + @overload + def __getitem__(self, s: slice) -> List[Any]: ... + @overload + def __setitem__(self, i: int, o: Any) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[Any]) -> None: ... + def __iter__(self) -> Iterator[Any]: ... + # Can't inherit from Sized because the metaclass conflict between + # Sized and _CData prevents using _CDataMeta. + def __len__(self) -> int: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/shared/package-files/06/06befcb259155c51e608af2dade2b9489b0fa76c41343c193b5e073f142b203e/blob b/shared/package-files/06/06befcb259155c51e608af2dade2b9489b0fa76c41343c193b5e073f142b203e/blob new file mode 100644 index 0000000000000000000000000000000000000000..05d4638f258aec916975777fabc5ada29a56caca --- /dev/null +++ b/shared/package-files/06/06befcb259155c51e608af2dade2b9489b0fa76c41343c193b5e073f142b203e/blob @@ -0,0 +1,36 @@ + +####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### +####### Any changes to this file will be overwritten by the next CMake run #### +####### The input file was reproc-config.cmake.in ######## + +get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) + +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +#################################################################################### + +set(REPROC_MULTITHREADED ON) + +include(CMakeFindDependencyMacro) + +if(REPROC_MULTITHREADED) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_dependency(Threads) +endif() + +include(${CMAKE_CURRENT_LIST_DIR}/reproc-targets.cmake) diff --git a/shared/package-files/06/06bf5768b6f7ada260d4f4009d5e66799ddfb647e56d702c17a66d0cd7ce88cb/blob b/shared/package-files/06/06bf5768b6f7ada260d4f4009d5e66799ddfb647e56d702c17a66d0cd7ce88cb/blob new file mode 100644 index 0000000000000000000000000000000000000000..cc74d29b879eb8376c06995774289e328f98f5f5 --- /dev/null +++ b/shared/package-files/06/06bf5768b6f7ada260d4f4009d5e66799ddfb647e56d702c17a66d0cd7ce88cb/blob @@ -0,0 +1,50 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API arctanh { + using schema = at::Tensor (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::arctanh") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "arctanh(Tensor self) -> Tensor") + static at::Tensor call(const at::Tensor & self); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self); +}; + +struct TORCH_API arctanh_ { + using schema = at::Tensor & (at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::arctanh_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "arctanh_(Tensor(a!) self) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self); +}; + +struct TORCH_API arctanh_out { + using schema = at::Tensor & (const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::arctanh") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "arctanh.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/06/06c51c6abfc2d276733c657669c92b27d0a9554f3fd16fe91d82b0a5d9d675d3/blob b/shared/package-files/06/06c51c6abfc2d276733c657669c92b27d0a9554f3fd16fe91d82b0a5d9d675d3/blob new file mode 100644 index 0000000000000000000000000000000000000000..5d4375536666f86a4a1cbd7467fff002705c7d36 --- /dev/null +++ b/shared/package-files/06/06c51c6abfc2d276733c657669c92b27d0a9554f3fd16fe91d82b0a5d9d675d3/blob @@ -0,0 +1 @@ +jsonpointer diff --git a/shared/package-files/06/06c640bb2cf3469d4affb4fc801035db3b053729306a5faa542e9a35104932ed/blob b/shared/package-files/06/06c640bb2cf3469d4affb4fc801035db3b053729306a5faa542e9a35104932ed/blob new file mode 100644 index 0000000000000000000000000000000000000000..b9a19951274dc858e3062b0da5e8fdf975d4b71e --- /dev/null +++ b/shared/package-files/06/06c640bb2cf3469d4affb4fc801035db3b053729306a5faa542e9a35104932ed/blob @@ -0,0 +1,23 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API ::std::tuple _native_multi_head_attention_out(const at::Tensor & query, const at::Tensor & key, const at::Tensor & value, int64_t embed_dim, int64_t num_head, const at::Tensor & qkv_weight, const at::Tensor & qkv_bias, const at::Tensor & proj_weight, const at::Tensor & proj_bias, const c10::optional & mask, bool need_weights, bool average_attn_weights, c10::optional mask_type, at::Tensor & out0, at::Tensor & out1); +TORCH_API ::std::tuple native_multi_head_attention_cpu(const at::Tensor & query, const at::Tensor & key, const at::Tensor & value, int64_t embed_dim, int64_t num_head, const at::Tensor & qkv_weight, const at::Tensor & qkv_bias, const at::Tensor & proj_weight, const at::Tensor & proj_bias, const c10::optional & mask={}, bool need_weights=true, bool average_attn_weights=true, c10::optional mask_type=c10::nullopt); +TORCH_API ::std::tuple native_multi_head_attention_cuda(const at::Tensor & query, const at::Tensor & key, const at::Tensor & value, int64_t embed_dim, int64_t num_head, const at::Tensor & qkv_weight, const at::Tensor & qkv_bias, const at::Tensor & proj_weight, const at::Tensor & proj_bias, const c10::optional & mask={}, bool need_weights=true, bool average_attn_weights=true, c10::optional mask_type=c10::nullopt); +} // namespace native +} // namespace at diff --git a/shared/package-files/06/06c8ab6557752e63d64f8b41233ea5a193e365c227a10ac819f0bbaefcea989c/blob b/shared/package-files/06/06c8ab6557752e63d64f8b41233ea5a193e365c227a10ac819f0bbaefcea989c/blob new file mode 100644 index 0000000000000000000000000000000000000000..2d8cb0208d5a2af8915bc605931931605229e263 --- /dev/null +++ b/shared/package-files/06/06c8ab6557752e63d64f8b41233ea5a193e365c227a10ac819f0bbaefcea989c/blob @@ -0,0 +1,3 @@ +# Tableau colorblind 10 palette +axes.prop_cycle: cycler('color', ['006BA4', 'FF800E', 'ABABAB', '595959', '5F9ED1', 'C85200', '898989', 'A2C8EC', 'FFBC79', 'CFCFCF']) +patch.facecolor: 006BA4 \ No newline at end of file diff --git a/shared/package-files/06/06cbdf88bccd27374d0fe0b31052b363769d1faaa425d3910e6ec2d9968b9433/blob b/shared/package-files/06/06cbdf88bccd27374d0fe0b31052b363769d1faaa425d3910e6ec2d9968b9433/blob new file mode 100644 index 0000000000000000000000000000000000000000..8a00dc9e7a1c23222702720b7ba9241396b2cd9b --- /dev/null +++ b/shared/package-files/06/06cbdf88bccd27374d0fe0b31052b363769d1faaa425d3910e6ec2d9968b9433/blob @@ -0,0 +1,61 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API eye { + using schema = at::Tensor (c10::SymInt, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::eye") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "eye(SymInt n, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor") + static at::Tensor call(c10::SymInt n, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, c10::SymInt n, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +struct TORCH_API eye_m { + using schema = at::Tensor (c10::SymInt, c10::SymInt, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::eye") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "m") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "eye.m(SymInt n, SymInt m, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor") + static at::Tensor call(c10::SymInt n, c10::SymInt m, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, c10::SymInt n, c10::SymInt m, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +struct TORCH_API eye_out { + using schema = at::Tensor & (c10::SymInt, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::eye") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "eye.out(SymInt n, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(c10::SymInt n, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, c10::SymInt n, at::Tensor & out); +}; + +struct TORCH_API eye_m_out { + using schema = at::Tensor & (c10::SymInt, c10::SymInt, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::eye") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "m_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "eye.m_out(SymInt n, SymInt m, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(c10::SymInt n, c10::SymInt m, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, c10::SymInt n, c10::SymInt m, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/06/06cc5816adde64223c0fedf112013d1636febbe83b34f8cd89d6e0155737380c/blob b/shared/package-files/06/06cc5816adde64223c0fedf112013d1636febbe83b34f8cd89d6e0155737380c/blob new file mode 100644 index 0000000000000000000000000000000000000000..22fb691366fe276d87f1aa5e29191f17254f1f74 Binary files /dev/null and b/shared/package-files/06/06cc5816adde64223c0fedf112013d1636febbe83b34f8cd89d6e0155737380c/blob differ diff --git a/shared/package-files/06/06cdac7a4743272c3fc2b5291bbbd94061f4cb44b80b801bc464a9794ffc0b6b/blob b/shared/package-files/06/06cdac7a4743272c3fc2b5291bbbd94061f4cb44b80b801bc464a9794ffc0b6b/blob new file mode 100644 index 0000000000000000000000000000000000000000..dfdf9821b6c853755ce12d0cbdfa599bd4f312e4 --- /dev/null +++ b/shared/package-files/06/06cdac7a4743272c3fc2b5291bbbd94061f4cb44b80b801bc464a9794ffc0b6b/blob @@ -0,0 +1,184 @@ +from sympy.vector.vector import Vector +from sympy.vector.coordsysrect import CoordSys3D +from sympy.vector.functions import express, matrix_to_vector, orthogonalize +from sympy.core.numbers import Rational +from sympy.core.singleton import S +from sympy.core.symbol import symbols +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.functions.elementary.trigonometric import (cos, sin) +from sympy.matrices.immutable import ImmutableDenseMatrix as Matrix +from sympy.testing.pytest import raises + +N = CoordSys3D('N') +q1, q2, q3, q4, q5 = symbols('q1 q2 q3 q4 q5') +A = N.orient_new_axis('A', q1, N.k) # type: ignore +B = A.orient_new_axis('B', q2, A.i) +C = B.orient_new_axis('C', q3, B.j) + + +def test_express(): + assert express(Vector.zero, N) == Vector.zero + assert express(S.Zero, N) is S.Zero + assert express(A.i, C) == cos(q3)*C.i + sin(q3)*C.k + assert express(A.j, C) == sin(q2)*sin(q3)*C.i + cos(q2)*C.j - \ + sin(q2)*cos(q3)*C.k + assert express(A.k, C) == -sin(q3)*cos(q2)*C.i + sin(q2)*C.j + \ + cos(q2)*cos(q3)*C.k + assert express(A.i, N) == cos(q1)*N.i + sin(q1)*N.j + assert express(A.j, N) == -sin(q1)*N.i + cos(q1)*N.j + assert express(A.k, N) == N.k + assert express(A.i, A) == A.i + assert express(A.j, A) == A.j + assert express(A.k, A) == A.k + assert express(A.i, B) == B.i + assert express(A.j, B) == cos(q2)*B.j - sin(q2)*B.k + assert express(A.k, B) == sin(q2)*B.j + cos(q2)*B.k + assert express(A.i, C) == cos(q3)*C.i + sin(q3)*C.k + assert express(A.j, C) == sin(q2)*sin(q3)*C.i + cos(q2)*C.j - \ + sin(q2)*cos(q3)*C.k + assert express(A.k, C) == -sin(q3)*cos(q2)*C.i + sin(q2)*C.j + \ + cos(q2)*cos(q3)*C.k + # Check to make sure UnitVectors get converted properly + assert express(N.i, N) == N.i + assert express(N.j, N) == N.j + assert express(N.k, N) == N.k + assert express(N.i, A) == (cos(q1)*A.i - sin(q1)*A.j) + assert express(N.j, A) == (sin(q1)*A.i + cos(q1)*A.j) + assert express(N.k, A) == A.k + assert express(N.i, B) == (cos(q1)*B.i - sin(q1)*cos(q2)*B.j + + sin(q1)*sin(q2)*B.k) + assert express(N.j, B) == (sin(q1)*B.i + cos(q1)*cos(q2)*B.j - + sin(q2)*cos(q1)*B.k) + assert express(N.k, B) == (sin(q2)*B.j + cos(q2)*B.k) + assert express(N.i, C) == ( + (cos(q1)*cos(q3) - sin(q1)*sin(q2)*sin(q3))*C.i - + sin(q1)*cos(q2)*C.j + + (sin(q3)*cos(q1) + sin(q1)*sin(q2)*cos(q3))*C.k) + assert express(N.j, C) == ( + (sin(q1)*cos(q3) + sin(q2)*sin(q3)*cos(q1))*C.i + + cos(q1)*cos(q2)*C.j + + (sin(q1)*sin(q3) - sin(q2)*cos(q1)*cos(q3))*C.k) + assert express(N.k, C) == (-sin(q3)*cos(q2)*C.i + sin(q2)*C.j + + cos(q2)*cos(q3)*C.k) + + assert express(A.i, N) == (cos(q1)*N.i + sin(q1)*N.j) + assert express(A.j, N) == (-sin(q1)*N.i + cos(q1)*N.j) + assert express(A.k, N) == N.k + assert express(A.i, A) == A.i + assert express(A.j, A) == A.j + assert express(A.k, A) == A.k + assert express(A.i, B) == B.i + assert express(A.j, B) == (cos(q2)*B.j - sin(q2)*B.k) + assert express(A.k, B) == (sin(q2)*B.j + cos(q2)*B.k) + assert express(A.i, C) == (cos(q3)*C.i + sin(q3)*C.k) + assert express(A.j, C) == (sin(q2)*sin(q3)*C.i + cos(q2)*C.j - + sin(q2)*cos(q3)*C.k) + assert express(A.k, C) == (-sin(q3)*cos(q2)*C.i + sin(q2)*C.j + + cos(q2)*cos(q3)*C.k) + + assert express(B.i, N) == (cos(q1)*N.i + sin(q1)*N.j) + assert express(B.j, N) == (-sin(q1)*cos(q2)*N.i + + cos(q1)*cos(q2)*N.j + sin(q2)*N.k) + assert express(B.k, N) == (sin(q1)*sin(q2)*N.i - + sin(q2)*cos(q1)*N.j + cos(q2)*N.k) + assert express(B.i, A) == A.i + assert express(B.j, A) == (cos(q2)*A.j + sin(q2)*A.k) + assert express(B.k, A) == (-sin(q2)*A.j + cos(q2)*A.k) + assert express(B.i, B) == B.i + assert express(B.j, B) == B.j + assert express(B.k, B) == B.k + assert express(B.i, C) == (cos(q3)*C.i + sin(q3)*C.k) + assert express(B.j, C) == C.j + assert express(B.k, C) == (-sin(q3)*C.i + cos(q3)*C.k) + + assert express(C.i, N) == ( + (cos(q1)*cos(q3) - sin(q1)*sin(q2)*sin(q3))*N.i + + (sin(q1)*cos(q3) + sin(q2)*sin(q3)*cos(q1))*N.j - + sin(q3)*cos(q2)*N.k) + assert express(C.j, N) == ( + -sin(q1)*cos(q2)*N.i + cos(q1)*cos(q2)*N.j + sin(q2)*N.k) + assert express(C.k, N) == ( + (sin(q3)*cos(q1) + sin(q1)*sin(q2)*cos(q3))*N.i + + (sin(q1)*sin(q3) - sin(q2)*cos(q1)*cos(q3))*N.j + + cos(q2)*cos(q3)*N.k) + assert express(C.i, A) == (cos(q3)*A.i + sin(q2)*sin(q3)*A.j - + sin(q3)*cos(q2)*A.k) + assert express(C.j, A) == (cos(q2)*A.j + sin(q2)*A.k) + assert express(C.k, A) == (sin(q3)*A.i - sin(q2)*cos(q3)*A.j + + cos(q2)*cos(q3)*A.k) + assert express(C.i, B) == (cos(q3)*B.i - sin(q3)*B.k) + assert express(C.j, B) == B.j + assert express(C.k, B) == (sin(q3)*B.i + cos(q3)*B.k) + assert express(C.i, C) == C.i + assert express(C.j, C) == C.j + assert express(C.k, C) == C.k == (C.k) + + # Check to make sure Vectors get converted back to UnitVectors + assert N.i == express((cos(q1)*A.i - sin(q1)*A.j), N).simplify() + assert N.j == express((sin(q1)*A.i + cos(q1)*A.j), N).simplify() + assert N.i == express((cos(q1)*B.i - sin(q1)*cos(q2)*B.j + + sin(q1)*sin(q2)*B.k), N).simplify() + assert N.j == express((sin(q1)*B.i + cos(q1)*cos(q2)*B.j - + sin(q2)*cos(q1)*B.k), N).simplify() + assert N.k == express((sin(q2)*B.j + cos(q2)*B.k), N).simplify() + + + assert A.i == express((cos(q1)*N.i + sin(q1)*N.j), A).simplify() + assert A.j == express((-sin(q1)*N.i + cos(q1)*N.j), A).simplify() + + assert A.j == express((cos(q2)*B.j - sin(q2)*B.k), A).simplify() + assert A.k == express((sin(q2)*B.j + cos(q2)*B.k), A).simplify() + + assert A.i == express((cos(q3)*C.i + sin(q3)*C.k), A).simplify() + assert A.j == express((sin(q2)*sin(q3)*C.i + cos(q2)*C.j - + sin(q2)*cos(q3)*C.k), A).simplify() + + assert A.k == express((-sin(q3)*cos(q2)*C.i + sin(q2)*C.j + + cos(q2)*cos(q3)*C.k), A).simplify() + assert B.i == express((cos(q1)*N.i + sin(q1)*N.j), B).simplify() + assert B.j == express((-sin(q1)*cos(q2)*N.i + + cos(q1)*cos(q2)*N.j + sin(q2)*N.k), B).simplify() + + assert B.k == express((sin(q1)*sin(q2)*N.i - + sin(q2)*cos(q1)*N.j + cos(q2)*N.k), B).simplify() + + assert B.j == express((cos(q2)*A.j + sin(q2)*A.k), B).simplify() + assert B.k == express((-sin(q2)*A.j + cos(q2)*A.k), B).simplify() + assert B.i == express((cos(q3)*C.i + sin(q3)*C.k), B).simplify() + assert B.k == express((-sin(q3)*C.i + cos(q3)*C.k), B).simplify() + assert C.i == express((cos(q3)*A.i + sin(q2)*sin(q3)*A.j - + sin(q3)*cos(q2)*A.k), C).simplify() + assert C.j == express((cos(q2)*A.j + sin(q2)*A.k), C).simplify() + assert C.k == express((sin(q3)*A.i - sin(q2)*cos(q3)*A.j + + cos(q2)*cos(q3)*A.k), C).simplify() + assert C.i == express((cos(q3)*B.i - sin(q3)*B.k), C).simplify() + assert C.k == express((sin(q3)*B.i + cos(q3)*B.k), C).simplify() + + +def test_matrix_to_vector(): + m = Matrix([[1], [2], [3]]) + assert matrix_to_vector(m, C) == C.i + 2*C.j + 3*C.k + m = Matrix([[0], [0], [0]]) + assert matrix_to_vector(m, N) == matrix_to_vector(m, C) == \ + Vector.zero + m = Matrix([[q1], [q2], [q3]]) + assert matrix_to_vector(m, N) == q1*N.i + q2*N.j + q3*N.k + + +def test_orthogonalize(): + C = CoordSys3D('C') + a, b = symbols('a b', integer=True) + i, j, k = C.base_vectors() + v1 = i + 2*j + v2 = 2*i + 3*j + v3 = 3*i + 5*j + v4 = 3*i + j + v5 = 2*i + 2*j + v6 = a*i + b*j + v7 = 4*a*i + 4*b*j + assert orthogonalize(v1, v2) == [C.i + 2*C.j, C.i*Rational(2, 5) + -C.j/5] + # from wikipedia + assert orthogonalize(v4, v5, orthonormal=True) == \ + [(3*sqrt(10))*C.i/10 + (sqrt(10))*C.j/10, (-sqrt(10))*C.i/10 + (3*sqrt(10))*C.j/10] + raises(ValueError, lambda: orthogonalize(v1, v2, v3)) + raises(ValueError, lambda: orthogonalize(v6, v7)) diff --git a/shared/package-files/06/06ce13e038f1e1764e6ddd251af78123ab55b15bcf19ebf9476dc6b1a8a8768b/blob b/shared/package-files/06/06ce13e038f1e1764e6ddd251af78123ab55b15bcf19ebf9476dc6b1a8a8768b/blob new file mode 100644 index 0000000000000000000000000000000000000000..05983b1ea1064c5b1c025931f5f3e53a8dda7f8e --- /dev/null +++ b/shared/package-files/06/06ce13e038f1e1764e6ddd251af78123ab55b15bcf19ebf9476dc6b1a8a8768b/blob @@ -0,0 +1,372 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include + +namespace torch { +namespace nn { + +/// Stores a type erased `Module`. +/// +/// The PyTorch C++ API does not impose an interface on the signature of +/// `forward()` in `Module` subclasses. This gives you complete freedom to +/// design your `forward()` methods to your liking. However, this also means +/// there is no unified base type you could store in order to call `forward()` +/// polymorphically for any module. This is where the `AnyModule` comes in. +/// Instead of inheritance, it relies on type erasure for polymorphism. +/// +/// An `AnyModule` can store any `nn::Module` subclass that provides a +/// `forward()` method. This `forward()` may accept any types and return any +/// type. Once stored in an `AnyModule`, you can invoke the underlying module's +/// `forward()` by calling `AnyModule::forward()` with the arguments you would +/// supply to the stored module (though see one important limitation below). +/// Example: +/// +/// \rst +/// .. code-block:: cpp +/// +/// struct GenericTrainer { +/// torch::nn::AnyModule module; +/// +/// void train(torch::Tensor input) { +/// module.forward(input); +/// } +/// }; +/// +/// GenericTrainer trainer1{torch::nn::Linear(3, 4)}; +/// GenericTrainer trainer2{torch::nn::Conv2d(3, 4, 2)}; +/// \endrst +/// +/// As `AnyModule` erases the static type of the stored module (and its +/// `forward()` method) to achieve polymorphism, type checking of arguments is +/// moved to runtime. That is, passing an argument with an incorrect type to an +/// `AnyModule` will compile, but throw an exception at runtime: +/// +/// \rst +/// .. code-block:: cpp +/// +/// torch::nn::AnyModule module(torch::nn::Linear(3, 4)); +/// // Linear takes a tensor as input, but we are passing an integer. +/// // This will compile, but throw a `torch::Error` exception at runtime. +/// module.forward(123); +/// \endrst +/// +/// \rst +/// .. attention:: +/// One noteworthy limitation of `AnyModule` is that its `forward()` method +/// does not support implicit conversion of argument types. For example, if +/// the stored module's `forward()` method accepts a `float` and you call +/// `any_module.forward(3.4)` (where `3.4` is a `double`), this will throw +/// an exception. +/// \endrst +/// +/// The return type of the `AnyModule`'s `forward()` method is controlled via +/// the first template argument to `AnyModule::forward()`. It defaults to +/// `torch::Tensor`. To change it, you can write `any_module.forward()`, +/// for example. +/// +/// \rst +/// .. code-block:: cpp +/// +/// torch::nn::AnyModule module(torch::nn::Linear(3, 4)); +/// auto output = module.forward(torch::ones({2, 3})); +/// +/// struct IntModule { +/// int forward(int x) { return x; } +/// }; +/// torch::nn::AnyModule module(IntModule{}); +/// int output = module.forward(5); +/// \endrst +/// +/// The only other method an `AnyModule` provides access to on the stored +/// module is `clone()`. However, you may acquire a handle on the module via +/// `.ptr()`, which returns a `shared_ptr`. Further, if you know +/// the concrete type of the stored module, you can get a concrete handle to it +/// using `.get()` where `T` is the concrete module type. +/// +/// \rst +/// .. code-block:: cpp +/// +/// torch::nn::AnyModule module(torch::nn::Linear(3, 4)); +/// std::shared_ptr ptr = module.ptr(); +/// torch::nn::Linear linear(module.get()); +/// \endrst +class AnyModule { + public: + /// A default-constructed `AnyModule` is in an empty state. + AnyModule() = default; + + /// Constructs an `AnyModule` from a `shared_ptr` to concrete module object. + template + explicit AnyModule(std::shared_ptr module); + + /// Constructs an `AnyModule` from a concrete module object. + template < + typename ModuleType, + typename = torch::detail::enable_if_module_t> + explicit AnyModule(ModuleType&& module); + + /// Constructs an `AnyModule` from a module holder. + template + explicit AnyModule(const ModuleHolder& module_holder); + + /// Move construction and assignment is allowed, and follows the default + /// behavior of move for `std::unique_ptr`. + AnyModule(AnyModule&&) = default; + AnyModule& operator=(AnyModule&&) = default; + + /// Creates a shallow copy of an `AnyModule`. + AnyModule(const AnyModule& other); + AnyModule& operator=(const AnyModule& other); + + /// Creates a deep copy of an `AnyModule` if it contains a module, else an + /// empty `AnyModule` if it is empty. + AnyModule clone(optional device = nullopt) const; + + /// Assigns a module to the `AnyModule` (to circumvent the explicit + /// constructor). + template + AnyModule& operator=(std::shared_ptr module); + + /// Invokes `forward()` on the contained module with the given arguments, and + /// returns the return value as an `AnyValue`. Use this method when chaining + /// `AnyModule`s in a loop. + template + AnyValue any_forward(ArgumentTypes&&... arguments); + + /// Invokes `forward()` on the contained module with the given arguments, and + /// casts the returned `AnyValue` to the supplied `ReturnType` (which defaults + /// to `torch::Tensor`). + template + ReturnType forward(ArgumentTypes&&... arguments); + + /// Attempts to cast the underlying module to the given module type. Throws an + /// exception if the types do not match. + template > + T& get(); + + /// Attempts to cast the underlying module to the given module type. Throws an + /// exception if the types do not match. + template > + const T& get() const; + + /// Returns the contained module in a `nn::ModuleHolder` subclass if possible + /// (i.e. if `T` has a constructor for the underlying module type). + template + T get() const; + + /// Returns a `std::shared_ptr` whose dynamic type is that of the underlying + /// module. + std::shared_ptr ptr() const; + + /// Like `ptr()`, but casts the pointer to the given type. + template > + std::shared_ptr ptr() const; + + /// Returns the `type_info` object of the contained value. + const std::type_info& type_info() const; + + /// Returns true if the `AnyModule` does not contain a module. + bool is_empty() const noexcept; + + private: + /// Creates a `unique_ptr` pointing to a + /// `AnyModuleHolder` of the correct type. This method is used to deduce the + /// arguments of the module's `forward()` method. + template < + typename ModuleType, + typename Class, + typename ReturnType, + typename... ArgumentTypes> + std::unique_ptr make_holder( + std::shared_ptr&& module, + ReturnType (Class::*)(ArgumentTypes...)); + + /// Helper method invoked by const and non-const `get()`. + template + ModuleType& get_(ReturnType (ModuleType::*)(ArgumentTypes...)) const; + + /// Helper method invoked by const and non-const `get()`. + template + ModuleType& get_() const; + + /// The type erased module. + std::unique_ptr content_; +}; + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AnyModule ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +template +AnyModule::AnyModule(std::shared_ptr module) + : content_(make_holder( + std::move(module), + &std::remove_reference::type::forward)) { + // `AnyModule` can only store an `nn::Module` subclass object that provides + // a `forward()` method that has a non-templatized return type. + // (e.g. `AnyModule` cannot store `nn::Sequential`, because `nn::Sequential`'s + // `forward()` method has a templatized return type.) + static_assert( + torch::detail::is_module::value, + "Can only store object derived from nn::Module into AnyModule"); + static_assert( + torch::detail::has_forward::value, + "Can only store module with a forward() method that has a non-templatized" + " argument type and return type into AnyModule (e.g. we cannot store nn::Sequential" + "into AnyModule, because its forward() method's argument type and return type are templatized." + " If you need to use nn::Sequentials inside each other you can subclass " + "nn::Sequential and write a non-templatized forward function for it. You can checkout " + "https://github.com/pytorch/vision/blob/2f46070f3cb1ea894d82578f3dc5677f82f34958/torchvision/csrc/models/mnasnet.cpp#L59 " + "for an example on how to do this.)."); +} + +template +AnyModule::AnyModule(ModuleType&& module) + : AnyModule( + std::make_shared(std::forward(module))) {} + +template +AnyModule::AnyModule(const ModuleHolder& module_holder) + : AnyModule(module_holder.ptr()) {} + +inline AnyModule::AnyModule(const AnyModule& other) + : content_(other.content_ ? other.content_->copy() : nullptr) {} + +inline AnyModule& AnyModule::operator=(const AnyModule& other) { + if (this != &other) { + content_ = other.content_ ? other.content_->copy() : nullptr; + } + return *this; +} + +inline AnyModule AnyModule::clone(optional device) const { + AnyModule clone; + clone.content_ = content_ ? content_->clone_module(device) : nullptr; + return clone; +} + +template +AnyModule& AnyModule::operator=(std::shared_ptr module) { + // NOLINTNEXTLINE(cppcoreguidelines-c-copy-assignment-signature) + return (*this = AnyModule(std::move(module))); +} + +template +AnyValue AnyModule::any_forward(ArgumentTypes&&... arguments) { + TORCH_CHECK(!is_empty(), "Cannot call forward() on an empty AnyModule"); + std::vector values; + values.reserve(sizeof...(ArgumentTypes)); + torch::apply( + [&values](AnyValue&& value) { values.push_back(std::move(value)); }, + AnyValue(std::forward(arguments))...); + return content_->forward(std::move(values)); +} + +template +ReturnType AnyModule::forward(ArgumentTypes&&... arguments) { + return any_forward(std::forward(arguments)...) + .template get(); +} + +template +T& AnyModule::get() { + TORCH_CHECK(!is_empty(), "Cannot call get() on an empty AnyModule"); + return get_(); +} + +template +const T& AnyModule::get() const { + TORCH_CHECK(!is_empty(), "Cannot call get() on an empty AnyModule"); + return get_(); +} + +template +T AnyModule::get() const { + return T(ptr()); +} + +inline std::shared_ptr AnyModule::ptr() const { + TORCH_CHECK(!is_empty(), "Cannot call ptr() on an empty AnyModule"); + return content_->ptr(); +} + +template +std::shared_ptr AnyModule::ptr() const { + TORCH_CHECK(!is_empty(), "Cannot call ptr() on an empty AnyModule"); + // Call get() but discard the value, just to do the type checking. + get_(); + return std::dynamic_pointer_cast(ptr()); +} + +inline const std::type_info& AnyModule::type_info() const { + TORCH_CHECK(!is_empty(), "Cannot call type_info() on an empty AnyModule"); + return content_->type_info; +} + +inline bool AnyModule::is_empty() const noexcept { + return content_ == nullptr; +} + +// Private Methods + +template < + typename ModuleType, + typename Class, + typename ReturnType, + typename... ArgumentTypes> +std::unique_ptr AnyModule::make_holder( + std::shared_ptr&& module, + ReturnType (Class::*)(ArgumentTypes...)) { + static_assert( + torch::detail::check_not_lvalue_references(), + "Modules stored inside AnyModule must not take references. " + "Use pointers instead."); + static_assert( + !std::is_void::value, + "AnyModule cannot store modules that return void " + "(you can return a dummy value)."); + return std::make_unique< + AnyModuleHolder, ArgumentTypes...>>( + std::move(module)); +} + +template +ModuleType& AnyModule::get_() const { + using M = typename std::remove_reference::type; + static_assert( + torch::detail::has_forward::value, + "Can only call AnyModule::get with a type T that has a forward method"); + return get_(&M::forward); +} + +template +ModuleType& AnyModule::get_( + ReturnType (ModuleType::*)(ArgumentTypes...)) const { + if (typeid(ModuleType).hash_code() == type_info().hash_code()) { + return *static_cast&>( + *content_) + .module; + } + AT_ERROR( + "Attempted to cast module of type ", + c10::demangle(type_info().name()), + " to type ", + c10::demangle(typeid(ModuleType).name())); +} + +} // namespace nn +} // namespace torch diff --git a/shared/package-files/06/06d043d88fb3f0ae88e46420f5080735f8995747a72a2e483128b14fee094525/blob b/shared/package-files/06/06d043d88fb3f0ae88e46420f5080735f8995747a72a2e483128b14fee094525/blob new file mode 100644 index 0000000000000000000000000000000000000000..a3acaa990966eda76387f0fbf92f06c42454b8c9 --- /dev/null +++ b/shared/package-files/06/06d043d88fb3f0ae88e46420f5080735f8995747a72a2e483128b14fee094525/blob @@ -0,0 +1,237 @@ +import math + +import torch +from torch.distributions import constraints +from torch.distributions.distribution import Distribution +from torch.distributions.multivariate_normal import _batch_mahalanobis, _batch_mv +from torch.distributions.utils import _standard_normal, lazy_property + +__all__ = ["LowRankMultivariateNormal"] + + +def _batch_capacitance_tril(W, D): + r""" + Computes Cholesky of :math:`I + W.T @ inv(D) @ W` for a batch of matrices :math:`W` + and a batch of vectors :math:`D`. + """ + m = W.size(-1) + Wt_Dinv = W.mT / D.unsqueeze(-2) + K = torch.matmul(Wt_Dinv, W).contiguous() + K.view(-1, m * m)[:, :: m + 1] += 1 # add identity matrix to K + return torch.linalg.cholesky(K) + + +def _batch_lowrank_logdet(W, D, capacitance_tril): + r""" + Uses "matrix determinant lemma":: + log|W @ W.T + D| = log|C| + log|D|, + where :math:`C` is the capacitance matrix :math:`I + W.T @ inv(D) @ W`, to compute + the log determinant. + """ + return 2 * capacitance_tril.diagonal(dim1=-2, dim2=-1).log().sum(-1) + D.log().sum( + -1 + ) + + +def _batch_lowrank_mahalanobis(W, D, x, capacitance_tril): + r""" + Uses "Woodbury matrix identity":: + inv(W @ W.T + D) = inv(D) - inv(D) @ W @ inv(C) @ W.T @ inv(D), + where :math:`C` is the capacitance matrix :math:`I + W.T @ inv(D) @ W`, to compute the squared + Mahalanobis distance :math:`x.T @ inv(W @ W.T + D) @ x`. + """ + Wt_Dinv = W.mT / D.unsqueeze(-2) + Wt_Dinv_x = _batch_mv(Wt_Dinv, x) + mahalanobis_term1 = (x.pow(2) / D).sum(-1) + mahalanobis_term2 = _batch_mahalanobis(capacitance_tril, Wt_Dinv_x) + return mahalanobis_term1 - mahalanobis_term2 + + +class LowRankMultivariateNormal(Distribution): + r""" + Creates a multivariate normal distribution with covariance matrix having a low-rank form + parameterized by :attr:`cov_factor` and :attr:`cov_diag`:: + + covariance_matrix = cov_factor @ cov_factor.T + cov_diag + + Example: + >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_LAPACK) + >>> # xdoctest: +IGNORE_WANT("non-deterministic") + >>> m = LowRankMultivariateNormal(torch.zeros(2), torch.tensor([[1.], [0.]]), torch.ones(2)) + >>> m.sample() # normally distributed with mean=`[0,0]`, cov_factor=`[[1],[0]]`, cov_diag=`[1,1]` + tensor([-0.2102, -0.5429]) + + Args: + loc (Tensor): mean of the distribution with shape `batch_shape + event_shape` + cov_factor (Tensor): factor part of low-rank form of covariance matrix with shape + `batch_shape + event_shape + (rank,)` + cov_diag (Tensor): diagonal part of low-rank form of covariance matrix with shape + `batch_shape + event_shape` + + Note: + The computation for determinant and inverse of covariance matrix is avoided when + `cov_factor.shape[1] << cov_factor.shape[0]` thanks to `Woodbury matrix identity + `_ and + `matrix determinant lemma `_. + Thanks to these formulas, we just need to compute the determinant and inverse of + the small size "capacitance" matrix:: + + capacitance = I + cov_factor.T @ inv(cov_diag) @ cov_factor + """ + arg_constraints = { + "loc": constraints.real_vector, + "cov_factor": constraints.independent(constraints.real, 2), + "cov_diag": constraints.independent(constraints.positive, 1), + } + support = constraints.real_vector + has_rsample = True + + def __init__(self, loc, cov_factor, cov_diag, validate_args=None): + if loc.dim() < 1: + raise ValueError("loc must be at least one-dimensional.") + event_shape = loc.shape[-1:] + if cov_factor.dim() < 2: + raise ValueError( + "cov_factor must be at least two-dimensional, " + "with optional leading batch dimensions" + ) + if cov_factor.shape[-2:-1] != event_shape: + raise ValueError( + f"cov_factor must be a batch of matrices with shape {event_shape[0]} x m" + ) + if cov_diag.shape[-1:] != event_shape: + raise ValueError( + f"cov_diag must be a batch of vectors with shape {event_shape}" + ) + + loc_ = loc.unsqueeze(-1) + cov_diag_ = cov_diag.unsqueeze(-1) + try: + loc_, self.cov_factor, cov_diag_ = torch.broadcast_tensors( + loc_, cov_factor, cov_diag_ + ) + except RuntimeError as e: + raise ValueError( + f"Incompatible batch shapes: loc {loc.shape}, cov_factor {cov_factor.shape}, cov_diag {cov_diag.shape}" + ) from e + self.loc = loc_[..., 0] + self.cov_diag = cov_diag_[..., 0] + batch_shape = self.loc.shape[:-1] + + self._unbroadcasted_cov_factor = cov_factor + self._unbroadcasted_cov_diag = cov_diag + self._capacitance_tril = _batch_capacitance_tril(cov_factor, cov_diag) + super().__init__(batch_shape, event_shape, validate_args=validate_args) + + def expand(self, batch_shape, _instance=None): + new = self._get_checked_instance(LowRankMultivariateNormal, _instance) + batch_shape = torch.Size(batch_shape) + loc_shape = batch_shape + self.event_shape + new.loc = self.loc.expand(loc_shape) + new.cov_diag = self.cov_diag.expand(loc_shape) + new.cov_factor = self.cov_factor.expand(loc_shape + self.cov_factor.shape[-1:]) + new._unbroadcasted_cov_factor = self._unbroadcasted_cov_factor + new._unbroadcasted_cov_diag = self._unbroadcasted_cov_diag + new._capacitance_tril = self._capacitance_tril + super(LowRankMultivariateNormal, new).__init__( + batch_shape, self.event_shape, validate_args=False + ) + new._validate_args = self._validate_args + return new + + @property + def mean(self): + return self.loc + + @property + def mode(self): + return self.loc + + @lazy_property + def variance(self): + return ( + self._unbroadcasted_cov_factor.pow(2).sum(-1) + self._unbroadcasted_cov_diag + ).expand(self._batch_shape + self._event_shape) + + @lazy_property + def scale_tril(self): + # The following identity is used to increase the numerically computation stability + # for Cholesky decomposition (see http://www.gaussianprocess.org/gpml/, Section 3.4.3): + # W @ W.T + D = D1/2 @ (I + D-1/2 @ W @ W.T @ D-1/2) @ D1/2 + # The matrix "I + D-1/2 @ W @ W.T @ D-1/2" has eigenvalues bounded from below by 1, + # hence it is well-conditioned and safe to take Cholesky decomposition. + n = self._event_shape[0] + cov_diag_sqrt_unsqueeze = self._unbroadcasted_cov_diag.sqrt().unsqueeze(-1) + Dinvsqrt_W = self._unbroadcasted_cov_factor / cov_diag_sqrt_unsqueeze + K = torch.matmul(Dinvsqrt_W, Dinvsqrt_W.mT).contiguous() + K.view(-1, n * n)[:, :: n + 1] += 1 # add identity matrix to K + scale_tril = cov_diag_sqrt_unsqueeze * torch.linalg.cholesky(K) + return scale_tril.expand( + self._batch_shape + self._event_shape + self._event_shape + ) + + @lazy_property + def covariance_matrix(self): + covariance_matrix = torch.matmul( + self._unbroadcasted_cov_factor, self._unbroadcasted_cov_factor.mT + ) + torch.diag_embed(self._unbroadcasted_cov_diag) + return covariance_matrix.expand( + self._batch_shape + self._event_shape + self._event_shape + ) + + @lazy_property + def precision_matrix(self): + # We use "Woodbury matrix identity" to take advantage of low rank form:: + # inv(W @ W.T + D) = inv(D) - inv(D) @ W @ inv(C) @ W.T @ inv(D) + # where :math:`C` is the capacitance matrix. + Wt_Dinv = ( + self._unbroadcasted_cov_factor.mT + / self._unbroadcasted_cov_diag.unsqueeze(-2) + ) + A = torch.linalg.solve_triangular(self._capacitance_tril, Wt_Dinv, upper=False) + precision_matrix = ( + torch.diag_embed(self._unbroadcasted_cov_diag.reciprocal()) - A.mT @ A + ) + return precision_matrix.expand( + self._batch_shape + self._event_shape + self._event_shape + ) + + def rsample(self, sample_shape=torch.Size()): + shape = self._extended_shape(sample_shape) + W_shape = shape[:-1] + self.cov_factor.shape[-1:] + eps_W = _standard_normal(W_shape, dtype=self.loc.dtype, device=self.loc.device) + eps_D = _standard_normal(shape, dtype=self.loc.dtype, device=self.loc.device) + return ( + self.loc + + _batch_mv(self._unbroadcasted_cov_factor, eps_W) + + self._unbroadcasted_cov_diag.sqrt() * eps_D + ) + + def log_prob(self, value): + if self._validate_args: + self._validate_sample(value) + diff = value - self.loc + M = _batch_lowrank_mahalanobis( + self._unbroadcasted_cov_factor, + self._unbroadcasted_cov_diag, + diff, + self._capacitance_tril, + ) + log_det = _batch_lowrank_logdet( + self._unbroadcasted_cov_factor, + self._unbroadcasted_cov_diag, + self._capacitance_tril, + ) + return -0.5 * (self._event_shape[0] * math.log(2 * math.pi) + log_det + M) + + def entropy(self): + log_det = _batch_lowrank_logdet( + self._unbroadcasted_cov_factor, + self._unbroadcasted_cov_diag, + self._capacitance_tril, + ) + H = 0.5 * (self._event_shape[0] * (1.0 + math.log(2 * math.pi)) + log_det) + if len(self._batch_shape) == 0: + return H + else: + return H.expand(self._batch_shape) diff --git a/shared/package-files/06/06d090ae1a5cf3f42e004c937acfa25d9bcd1830a4e0c7218eaf4e0ee7a40025/blob b/shared/package-files/06/06d090ae1a5cf3f42e004c937acfa25d9bcd1830a4e0c7218eaf4e0ee7a40025/blob new file mode 100644 index 0000000000000000000000000000000000000000..5857a620b802fee09cf49216dfa7afd1a9c70d09 --- /dev/null +++ b/shared/package-files/06/06d090ae1a5cf3f42e004c937acfa25d9bcd1830a4e0c7218eaf4e0ee7a40025/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API sparse_csc_tensor_ccol_row_value_size { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Tensor &, at::IntArrayRef, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::sparse_csc_tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "ccol_row_value_size") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "sparse_csc_tensor.ccol_row_value_size(Tensor ccol_indices, Tensor row_indices, Tensor values, int[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False) -> Tensor") + static at::Tensor call(const at::Tensor & ccol_indices, const at::Tensor & row_indices, const at::Tensor & values, at::IntArrayRef size, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & ccol_indices, const at::Tensor & row_indices, const at::Tensor & values, at::IntArrayRef size, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +struct TORCH_API sparse_csc_tensor_ccol_row_value { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Tensor &, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::sparse_csc_tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "ccol_row_value") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "sparse_csc_tensor.ccol_row_value(Tensor ccol_indices, Tensor row_indices, Tensor values, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False) -> Tensor") + static at::Tensor call(const at::Tensor & ccol_indices, const at::Tensor & row_indices, const at::Tensor & values, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & ccol_indices, const at::Tensor & row_indices, const at::Tensor & values, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/06/06d0d1944c1296f3a1c68d38997407a73cada15f8523f2b9c95b344405fc7812/blob b/shared/package-files/06/06d0d1944c1296f3a1c68d38997407a73cada15f8523f2b9c95b344405fc7812/blob new file mode 100644 index 0000000000000000000000000000000000000000..b6e07683500bb01c195b1cdfa8a13157353b5370 --- /dev/null +++ b/shared/package-files/06/06d0d1944c1296f3a1c68d38997407a73cada15f8523f2b9c95b344405fc7812/blob @@ -0,0 +1,1603 @@ +# Copyright (C) 2009, Pauli Virtanen +# Distributed under the same license as SciPy. + +import inspect +import sys +import warnings + +import numpy as np +from numpy import asarray, dot, vdot + +from scipy.linalg import norm, solve, inv, qr, svd, LinAlgError +import scipy.sparse.linalg +import scipy.sparse +from scipy.linalg import get_blas_funcs +from scipy._lib._util import copy_if_needed +from scipy._lib._util import getfullargspec_no_self as _getfullargspec +from ._linesearch import scalar_search_wolfe1, scalar_search_armijo + + +__all__ = [ + 'broyden1', 'broyden2', 'anderson', 'linearmixing', + 'diagbroyden', 'excitingmixing', 'newton_krylov', + 'BroydenFirst', 'KrylovJacobian', 'InverseJacobian', 'NoConvergence'] + +#------------------------------------------------------------------------------ +# Utility functions +#------------------------------------------------------------------------------ + + +class NoConvergence(Exception): + """Exception raised when nonlinear solver fails to converge within the specified + `maxiter`.""" + pass + + +def maxnorm(x): + return np.absolute(x).max() + + +def _as_inexact(x): + """Return `x` as an array, of either floats or complex floats""" + x = asarray(x) + if not np.issubdtype(x.dtype, np.inexact): + return asarray(x, dtype=np.float64) + return x + + +def _array_like(x, x0): + """Return ndarray `x` as same array subclass and shape as `x0`""" + x = np.reshape(x, np.shape(x0)) + wrap = getattr(x0, '__array_wrap__', x.__array_wrap__) + return wrap(x) + + +def _safe_norm(v): + if not np.isfinite(v).all(): + return np.array(np.inf) + return norm(v) + +#------------------------------------------------------------------------------ +# Generic nonlinear solver machinery +#------------------------------------------------------------------------------ + + +_doc_parts = dict( + params_basic=""" + F : function(x) -> f + Function whose root to find; should take and return an array-like + object. + xin : array_like + Initial guess for the solution + """.strip(), + params_extra=""" + iter : int, optional + Number of iterations to make. If omitted (default), make as many + as required to meet tolerances. + verbose : bool, optional + Print status to stdout on every iteration. + maxiter : int, optional + Maximum number of iterations to make. If more are needed to + meet convergence, `NoConvergence` is raised. + f_tol : float, optional + Absolute tolerance (in max-norm) for the residual. + If omitted, default is 6e-6. + f_rtol : float, optional + Relative tolerance for the residual. If omitted, not used. + x_tol : float, optional + Absolute minimum step size, as determined from the Jacobian + approximation. If the step size is smaller than this, optimization + is terminated as successful. If omitted, not used. + x_rtol : float, optional + Relative minimum step size. If omitted, not used. + tol_norm : function(vector) -> scalar, optional + Norm to use in convergence check. Default is the maximum norm. + line_search : {None, 'armijo' (default), 'wolfe'}, optional + Which type of a line search to use to determine the step size in the + direction given by the Jacobian approximation. Defaults to 'armijo'. + callback : function, optional + Optional callback function. It is called on every iteration as + ``callback(x, f)`` where `x` is the current solution and `f` + the corresponding residual. + + Returns + ------- + sol : ndarray + An array (of similar array type as `x0`) containing the final solution. + + Raises + ------ + NoConvergence + When a solution was not found. + + """.strip() +) + + +def _set_doc(obj): + if obj.__doc__: + obj.__doc__ = obj.__doc__ % _doc_parts + + +def nonlin_solve(F, x0, jacobian='krylov', iter=None, verbose=False, + maxiter=None, f_tol=None, f_rtol=None, x_tol=None, x_rtol=None, + tol_norm=None, line_search='armijo', callback=None, + full_output=False, raise_exception=True): + """ + Find a root of a function, in a way suitable for large-scale problems. + + Parameters + ---------- + %(params_basic)s + jacobian : Jacobian + A Jacobian approximation: `Jacobian` object or something that + `asjacobian` can transform to one. Alternatively, a string specifying + which of the builtin Jacobian approximations to use: + + krylov, broyden1, broyden2, anderson + diagbroyden, linearmixing, excitingmixing + + %(params_extra)s + full_output : bool + If true, returns a dictionary `info` containing convergence + information. + raise_exception : bool + If True, a `NoConvergence` exception is raise if no solution is found. + + See Also + -------- + asjacobian, Jacobian + + Notes + ----- + This algorithm implements the inexact Newton method, with + backtracking or full line searches. Several Jacobian + approximations are available, including Krylov and Quasi-Newton + methods. + + References + ---------- + .. [KIM] C. T. Kelley, \"Iterative Methods for Linear and Nonlinear + Equations\". Society for Industrial and Applied Mathematics. (1995) + https://archive.siam.org/books/kelley/fr16/ + + """ + # Can't use default parameters because it's being explicitly passed as None + # from the calling function, so we need to set it here. + tol_norm = maxnorm if tol_norm is None else tol_norm + condition = TerminationCondition(f_tol=f_tol, f_rtol=f_rtol, + x_tol=x_tol, x_rtol=x_rtol, + iter=iter, norm=tol_norm) + + x0 = _as_inexact(x0) + def func(z): + return _as_inexact(F(_array_like(z, x0))).flatten() + x = x0.flatten() + + dx = np.full_like(x, np.inf) + Fx = func(x) + Fx_norm = norm(Fx) + + jacobian = asjacobian(jacobian) + jacobian.setup(x.copy(), Fx, func) + + if maxiter is None: + if iter is not None: + maxiter = iter + 1 + else: + maxiter = 100*(x.size+1) + + if line_search is True: + line_search = 'armijo' + elif line_search is False: + line_search = None + + if line_search not in (None, 'armijo', 'wolfe'): + raise ValueError("Invalid line search") + + # Solver tolerance selection + gamma = 0.9 + eta_max = 0.9999 + eta_treshold = 0.1 + eta = 1e-3 + + for n in range(maxiter): + status = condition.check(Fx, x, dx) + if status: + break + + # The tolerance, as computed for scipy.sparse.linalg.* routines + tol = min(eta, eta*Fx_norm) + dx = -jacobian.solve(Fx, tol=tol) + + if norm(dx) == 0: + raise ValueError("Jacobian inversion yielded zero vector. " + "This indicates a bug in the Jacobian " + "approximation.") + + # Line search, or Newton step + if line_search: + s, x, Fx, Fx_norm_new = _nonlin_line_search(func, x, Fx, dx, + line_search) + else: + s = 1.0 + x = x + dx + Fx = func(x) + Fx_norm_new = norm(Fx) + + jacobian.update(x.copy(), Fx) + + if callback: + callback(x, Fx) + + # Adjust forcing parameters for inexact methods + eta_A = gamma * Fx_norm_new**2 / Fx_norm**2 + if gamma * eta**2 < eta_treshold: + eta = min(eta_max, eta_A) + else: + eta = min(eta_max, max(eta_A, gamma*eta**2)) + + Fx_norm = Fx_norm_new + + # Print status + if verbose: + sys.stdout.write("%d: |F(x)| = %g; step %g\n" % ( + n, tol_norm(Fx), s)) + sys.stdout.flush() + else: + if raise_exception: + raise NoConvergence(_array_like(x, x0)) + else: + status = 2 + + if full_output: + info = {'nit': condition.iteration, + 'fun': Fx, + 'status': status, + 'success': status == 1, + 'message': {1: 'A solution was found at the specified ' + 'tolerance.', + 2: 'The maximum number of iterations allowed ' + 'has been reached.' + }[status] + } + return _array_like(x, x0), info + else: + return _array_like(x, x0) + + +_set_doc(nonlin_solve) + + +def _nonlin_line_search(func, x, Fx, dx, search_type='armijo', rdiff=1e-8, + smin=1e-2): + tmp_s = [0] + tmp_Fx = [Fx] + tmp_phi = [norm(Fx)**2] + s_norm = norm(x) / norm(dx) + + def phi(s, store=True): + if s == tmp_s[0]: + return tmp_phi[0] + xt = x + s*dx + v = func(xt) + p = _safe_norm(v)**2 + if store: + tmp_s[0] = s + tmp_phi[0] = p + tmp_Fx[0] = v + return p + + def derphi(s): + ds = (abs(s) + s_norm + 1) * rdiff + return (phi(s+ds, store=False) - phi(s)) / ds + + if search_type == 'wolfe': + s, phi1, phi0 = scalar_search_wolfe1(phi, derphi, tmp_phi[0], + xtol=1e-2, amin=smin) + elif search_type == 'armijo': + s, phi1 = scalar_search_armijo(phi, tmp_phi[0], -tmp_phi[0], + amin=smin) + + if s is None: + # XXX: No suitable step length found. Take the full Newton step, + # and hope for the best. + s = 1.0 + + x = x + s*dx + if s == tmp_s[0]: + Fx = tmp_Fx[0] + else: + Fx = func(x) + Fx_norm = norm(Fx) + + return s, x, Fx, Fx_norm + + +class TerminationCondition: + """ + Termination condition for an iteration. It is terminated if + + - |F| < f_rtol*|F_0|, AND + - |F| < f_tol + + AND + + - |dx| < x_rtol*|x|, AND + - |dx| < x_tol + + """ + def __init__(self, f_tol=None, f_rtol=None, x_tol=None, x_rtol=None, + iter=None, norm=maxnorm): + + if f_tol is None: + f_tol = np.finfo(np.float64).eps ** (1./3) + if f_rtol is None: + f_rtol = np.inf + if x_tol is None: + x_tol = np.inf + if x_rtol is None: + x_rtol = np.inf + + self.x_tol = x_tol + self.x_rtol = x_rtol + self.f_tol = f_tol + self.f_rtol = f_rtol + + self.norm = norm + + self.iter = iter + + self.f0_norm = None + self.iteration = 0 + + def check(self, f, x, dx): + self.iteration += 1 + f_norm = self.norm(f) + x_norm = self.norm(x) + dx_norm = self.norm(dx) + + if self.f0_norm is None: + self.f0_norm = f_norm + + if f_norm == 0: + return 1 + + if self.iter is not None: + # backwards compatibility with SciPy 0.6.0 + return 2 * (self.iteration > self.iter) + + # NB: condition must succeed for rtol=inf even if norm == 0 + return int((f_norm <= self.f_tol + and f_norm/self.f_rtol <= self.f0_norm) + and (dx_norm <= self.x_tol + and dx_norm/self.x_rtol <= x_norm)) + + +#------------------------------------------------------------------------------ +# Generic Jacobian approximation +#------------------------------------------------------------------------------ + +class Jacobian: + """ + Common interface for Jacobians or Jacobian approximations. + + The optional methods come useful when implementing trust region + etc., algorithms that often require evaluating transposes of the + Jacobian. + + Methods + ------- + solve + Returns J^-1 * v + update + Updates Jacobian to point `x` (where the function has residual `Fx`) + + matvec : optional + Returns J * v + rmatvec : optional + Returns A^H * v + rsolve : optional + Returns A^-H * v + matmat : optional + Returns A * V, where V is a dense matrix with dimensions (N,K). + todense : optional + Form the dense Jacobian matrix. Necessary for dense trust region + algorithms, and useful for testing. + + Attributes + ---------- + shape + Matrix dimensions (M, N) + dtype + Data type of the matrix. + func : callable, optional + Function the Jacobian corresponds to + + """ + + def __init__(self, **kw): + names = ["solve", "update", "matvec", "rmatvec", "rsolve", + "matmat", "todense", "shape", "dtype"] + for name, value in kw.items(): + if name not in names: + raise ValueError(f"Unknown keyword argument {name}") + if value is not None: + setattr(self, name, kw[name]) + + + if hasattr(self, "todense"): + def __array__(self, dtype=None, copy=None): + if dtype is not None: + raise ValueError(f"`dtype` must be None, was {dtype}") + return self.todense() + + def aspreconditioner(self): + return InverseJacobian(self) + + def solve(self, v, tol=0): + raise NotImplementedError + + def update(self, x, F): + pass + + def setup(self, x, F, func): + self.func = func + self.shape = (F.size, x.size) + self.dtype = F.dtype + if self.__class__.setup is Jacobian.setup: + # Call on the first point unless overridden + self.update(x, F) + + +class InverseJacobian: + """ + A simple wrapper that inverts the Jacobian using the `solve` method. + + .. legacy:: class + + See the newer, more consistent interfaces in :mod:`scipy.optimize`. + + Parameters + ---------- + jacobian : Jacobian + The Jacobian to invert. + + Attributes + ---------- + shape + Matrix dimensions (M, N) + dtype + Data type of the matrix. + + """ + def __init__(self, jacobian): + self.jacobian = jacobian + self.matvec = jacobian.solve + self.update = jacobian.update + if hasattr(jacobian, 'setup'): + self.setup = jacobian.setup + if hasattr(jacobian, 'rsolve'): + self.rmatvec = jacobian.rsolve + + @property + def shape(self): + return self.jacobian.shape + + @property + def dtype(self): + return self.jacobian.dtype + + +def asjacobian(J): + """ + Convert given object to one suitable for use as a Jacobian. + """ + spsolve = scipy.sparse.linalg.spsolve + if isinstance(J, Jacobian): + return J + elif inspect.isclass(J) and issubclass(J, Jacobian): + return J() + elif isinstance(J, np.ndarray): + if J.ndim > 2: + raise ValueError('array must have rank <= 2') + J = np.atleast_2d(np.asarray(J)) + if J.shape[0] != J.shape[1]: + raise ValueError('array must be square') + + return Jacobian(matvec=lambda v: dot(J, v), + rmatvec=lambda v: dot(J.conj().T, v), + solve=lambda v, tol=0: solve(J, v), + rsolve=lambda v, tol=0: solve(J.conj().T, v), + dtype=J.dtype, shape=J.shape) + elif scipy.sparse.issparse(J): + if J.shape[0] != J.shape[1]: + raise ValueError('matrix must be square') + return Jacobian(matvec=lambda v: J @ v, + rmatvec=lambda v: J.conj().T @ v, + solve=lambda v, tol=0: spsolve(J, v), + rsolve=lambda v, tol=0: spsolve(J.conj().T, v), + dtype=J.dtype, shape=J.shape) + elif hasattr(J, 'shape') and hasattr(J, 'dtype') and hasattr(J, 'solve'): + return Jacobian(matvec=getattr(J, 'matvec'), + rmatvec=getattr(J, 'rmatvec'), + solve=J.solve, + rsolve=getattr(J, 'rsolve'), + update=getattr(J, 'update'), + setup=getattr(J, 'setup'), + dtype=J.dtype, + shape=J.shape) + elif callable(J): + # Assume it's a function J(x) that returns the Jacobian + class Jac(Jacobian): + def update(self, x, F): + self.x = x + + def solve(self, v, tol=0): + m = J(self.x) + if isinstance(m, np.ndarray): + return solve(m, v) + elif scipy.sparse.issparse(m): + return spsolve(m, v) + else: + raise ValueError("Unknown matrix type") + + def matvec(self, v): + m = J(self.x) + if isinstance(m, np.ndarray): + return dot(m, v) + elif scipy.sparse.issparse(m): + return m @ v + else: + raise ValueError("Unknown matrix type") + + def rsolve(self, v, tol=0): + m = J(self.x) + if isinstance(m, np.ndarray): + return solve(m.conj().T, v) + elif scipy.sparse.issparse(m): + return spsolve(m.conj().T, v) + else: + raise ValueError("Unknown matrix type") + + def rmatvec(self, v): + m = J(self.x) + if isinstance(m, np.ndarray): + return dot(m.conj().T, v) + elif scipy.sparse.issparse(m): + return m.conj().T @ v + else: + raise ValueError("Unknown matrix type") + return Jac() + elif isinstance(J, str): + return dict(broyden1=BroydenFirst, + broyden2=BroydenSecond, + anderson=Anderson, + diagbroyden=DiagBroyden, + linearmixing=LinearMixing, + excitingmixing=ExcitingMixing, + krylov=KrylovJacobian)[J]() + else: + raise TypeError('Cannot convert object to a Jacobian') + + +#------------------------------------------------------------------------------ +# Broyden +#------------------------------------------------------------------------------ + +class GenericBroyden(Jacobian): + def setup(self, x0, f0, func): + Jacobian.setup(self, x0, f0, func) + self.last_f = f0 + self.last_x = x0 + + if hasattr(self, 'alpha') and self.alpha is None: + # Autoscale the initial Jacobian parameter + # unless we have already guessed the solution. + normf0 = norm(f0) + if normf0: + self.alpha = 0.5*max(norm(x0), 1) / normf0 + else: + self.alpha = 1.0 + + def _update(self, x, f, dx, df, dx_norm, df_norm): + raise NotImplementedError + + def update(self, x, f): + df = f - self.last_f + dx = x - self.last_x + self._update(x, f, dx, df, norm(dx), norm(df)) + self.last_f = f + self.last_x = x + + +class LowRankMatrix: + r""" + A matrix represented as + + .. math:: \alpha I + \sum_{n=0}^{n=M} c_n d_n^\dagger + + However, if the rank of the matrix reaches the dimension of the vectors, + full matrix representation will be used thereon. + + """ + + def __init__(self, alpha, n, dtype): + self.alpha = alpha + self.cs = [] + self.ds = [] + self.n = n + self.dtype = dtype + self.collapsed = None + + @staticmethod + def _matvec(v, alpha, cs, ds): + axpy, scal, dotc = get_blas_funcs(['axpy', 'scal', 'dotc'], + cs[:1] + [v]) + w = alpha * v + for c, d in zip(cs, ds): + a = dotc(d, v) + w = axpy(c, w, w.size, a) + return w + + @staticmethod + def _solve(v, alpha, cs, ds): + """Evaluate w = M^-1 v""" + if len(cs) == 0: + return v/alpha + + # (B + C D^H)^-1 = B^-1 - B^-1 C (I + D^H B^-1 C)^-1 D^H B^-1 + + axpy, dotc = get_blas_funcs(['axpy', 'dotc'], cs[:1] + [v]) + + c0 = cs[0] + A = alpha * np.identity(len(cs), dtype=c0.dtype) + for i, d in enumerate(ds): + for j, c in enumerate(cs): + A[i,j] += dotc(d, c) + + q = np.zeros(len(cs), dtype=c0.dtype) + for j, d in enumerate(ds): + q[j] = dotc(d, v) + q /= alpha + q = solve(A, q) + + w = v/alpha + for c, qc in zip(cs, q): + w = axpy(c, w, w.size, -qc) + + return w + + def matvec(self, v): + """Evaluate w = M v""" + if self.collapsed is not None: + return np.dot(self.collapsed, v) + return LowRankMatrix._matvec(v, self.alpha, self.cs, self.ds) + + def rmatvec(self, v): + """Evaluate w = M^H v""" + if self.collapsed is not None: + return np.dot(self.collapsed.T.conj(), v) + return LowRankMatrix._matvec(v, np.conj(self.alpha), self.ds, self.cs) + + def solve(self, v, tol=0): + """Evaluate w = M^-1 v""" + if self.collapsed is not None: + return solve(self.collapsed, v) + return LowRankMatrix._solve(v, self.alpha, self.cs, self.ds) + + def rsolve(self, v, tol=0): + """Evaluate w = M^-H v""" + if self.collapsed is not None: + return solve(self.collapsed.T.conj(), v) + return LowRankMatrix._solve(v, np.conj(self.alpha), self.ds, self.cs) + + def append(self, c, d): + if self.collapsed is not None: + self.collapsed += c[:,None] * d[None,:].conj() + return + + self.cs.append(c) + self.ds.append(d) + + if len(self.cs) > c.size: + self.collapse() + + def __array__(self, dtype=None, copy=None): + if dtype is not None: + warnings.warn("LowRankMatrix is scipy-internal code, `dtype` " + f"should only be None but was {dtype} (not handled)", + stacklevel=3) + if copy is not None: + warnings.warn("LowRankMatrix is scipy-internal code, `copy` " + f"should only be None but was {copy} (not handled)", + stacklevel=3) + if self.collapsed is not None: + return self.collapsed + + Gm = self.alpha*np.identity(self.n, dtype=self.dtype) + for c, d in zip(self.cs, self.ds): + Gm += c[:,None]*d[None,:].conj() + return Gm + + def collapse(self): + """Collapse the low-rank matrix to a full-rank one.""" + self.collapsed = np.array(self, copy=copy_if_needed) + self.cs = None + self.ds = None + self.alpha = None + + def restart_reduce(self, rank): + """ + Reduce the rank of the matrix by dropping all vectors. + """ + if self.collapsed is not None: + return + assert rank > 0 + if len(self.cs) > rank: + del self.cs[:] + del self.ds[:] + + def simple_reduce(self, rank): + """ + Reduce the rank of the matrix by dropping oldest vectors. + """ + if self.collapsed is not None: + return + assert rank > 0 + while len(self.cs) > rank: + del self.cs[0] + del self.ds[0] + + def svd_reduce(self, max_rank, to_retain=None): + """ + Reduce the rank of the matrix by retaining some SVD components. + + This corresponds to the \"Broyden Rank Reduction Inverse\" + algorithm described in [1]_. + + Note that the SVD decomposition can be done by solving only a + problem whose size is the effective rank of this matrix, which + is viable even for large problems. + + Parameters + ---------- + max_rank : int + Maximum rank of this matrix after reduction. + to_retain : int, optional + Number of SVD components to retain when reduction is done + (ie. rank > max_rank). Default is ``max_rank - 2``. + + References + ---------- + .. [1] B.A. van der Rotten, PhD thesis, + \"A limited memory Broyden method to solve high-dimensional + systems of nonlinear equations\". Mathematisch Instituut, + Universiteit Leiden, The Netherlands (2003). + + https://web.archive.org/web/20161022015821/http://www.math.leidenuniv.nl/scripties/Rotten.pdf + + """ + if self.collapsed is not None: + return + + p = max_rank + if to_retain is not None: + q = to_retain + else: + q = p - 2 + + if self.cs: + p = min(p, len(self.cs[0])) + q = max(0, min(q, p-1)) + + m = len(self.cs) + if m < p: + # nothing to do + return + + C = np.array(self.cs).T + D = np.array(self.ds).T + + D, R = qr(D, mode='economic') + C = dot(C, R.T.conj()) + + U, S, WH = svd(C, full_matrices=False) + + C = dot(C, inv(WH)) + D = dot(D, WH.T.conj()) + + for k in range(q): + self.cs[k] = C[:,k].copy() + self.ds[k] = D[:,k].copy() + + del self.cs[q:] + del self.ds[q:] + + +_doc_parts['broyden_params'] = """ + alpha : float, optional + Initial guess for the Jacobian is ``(-1/alpha)``. + reduction_method : str or tuple, optional + Method used in ensuring that the rank of the Broyden matrix + stays low. Can either be a string giving the name of the method, + or a tuple of the form ``(method, param1, param2, ...)`` + that gives the name of the method and values for additional parameters. + + Methods available: + + - ``restart``: drop all matrix columns. Has no extra parameters. + - ``simple``: drop oldest matrix column. Has no extra parameters. + - ``svd``: keep only the most significant SVD components. + Takes an extra parameter, ``to_retain``, which determines the + number of SVD components to retain when rank reduction is done. + Default is ``max_rank - 2``. + + max_rank : int, optional + Maximum rank for the Broyden matrix. + Default is infinity (i.e., no rank reduction). + """.strip() + + +class BroydenFirst(GenericBroyden): + """ + Find a root of a function, using Broyden's first Jacobian approximation. + + This method is also known as "Broyden's good method". + + Parameters + ---------- + %(params_basic)s + %(broyden_params)s + %(params_extra)s + + See Also + -------- + root : Interface to root finding algorithms for multivariate + functions. See ``method='broyden1'`` in particular. + + Notes + ----- + This algorithm implements the inverse Jacobian Quasi-Newton update + + .. math:: H_+ = H + (dx - H df) dx^\\dagger H / ( dx^\\dagger H df) + + which corresponds to Broyden's first Jacobian update + + .. math:: J_+ = J + (df - J dx) dx^\\dagger / dx^\\dagger dx + + + References + ---------- + .. [1] B.A. van der Rotten, PhD thesis, + "A limited memory Broyden method to solve high-dimensional + systems of nonlinear equations". Mathematisch Instituut, + Universiteit Leiden, The Netherlands (2003). + https://math.leidenuniv.nl/scripties/Rotten.pdf + + Examples + -------- + The following functions define a system of nonlinear equations + + >>> def fun(x): + ... return [x[0] + 0.5 * (x[0] - x[1])**3 - 1.0, + ... 0.5 * (x[1] - x[0])**3 + x[1]] + + A solution can be obtained as follows. + + >>> from scipy import optimize + >>> sol = optimize.broyden1(fun, [0, 0]) + >>> sol + array([0.84116396, 0.15883641]) + + """ + + def __init__(self, alpha=None, reduction_method='restart', max_rank=None): + GenericBroyden.__init__(self) + self.alpha = alpha + self.Gm = None + + if max_rank is None: + max_rank = np.inf + self.max_rank = max_rank + + if isinstance(reduction_method, str): + reduce_params = () + else: + reduce_params = reduction_method[1:] + reduction_method = reduction_method[0] + reduce_params = (max_rank - 1,) + reduce_params + + if reduction_method == 'svd': + self._reduce = lambda: self.Gm.svd_reduce(*reduce_params) + elif reduction_method == 'simple': + self._reduce = lambda: self.Gm.simple_reduce(*reduce_params) + elif reduction_method == 'restart': + self._reduce = lambda: self.Gm.restart_reduce(*reduce_params) + else: + raise ValueError(f"Unknown rank reduction method '{reduction_method}'") + + def setup(self, x, F, func): + GenericBroyden.setup(self, x, F, func) + self.Gm = LowRankMatrix(-self.alpha, self.shape[0], self.dtype) + + def todense(self): + return inv(self.Gm) + + def solve(self, f, tol=0): + r = self.Gm.matvec(f) + if not np.isfinite(r).all(): + # singular; reset the Jacobian approximation + self.setup(self.last_x, self.last_f, self.func) + return self.Gm.matvec(f) + return r + + def matvec(self, f): + return self.Gm.solve(f) + + def rsolve(self, f, tol=0): + return self.Gm.rmatvec(f) + + def rmatvec(self, f): + return self.Gm.rsolve(f) + + def _update(self, x, f, dx, df, dx_norm, df_norm): + self._reduce() # reduce first to preserve secant condition + + v = self.Gm.rmatvec(dx) + c = dx - self.Gm.matvec(df) + d = v / vdot(df, v) + + self.Gm.append(c, d) + + +class BroydenSecond(BroydenFirst): + """ + Find a root of a function, using Broyden\'s second Jacobian approximation. + + This method is also known as \"Broyden's bad method\". + + Parameters + ---------- + %(params_basic)s + %(broyden_params)s + %(params_extra)s + + See Also + -------- + root : Interface to root finding algorithms for multivariate + functions. See ``method='broyden2'`` in particular. + + Notes + ----- + This algorithm implements the inverse Jacobian Quasi-Newton update + + .. math:: H_+ = H + (dx - H df) df^\\dagger / ( df^\\dagger df) + + corresponding to Broyden's second method. + + References + ---------- + .. [1] B.A. van der Rotten, PhD thesis, + \"A limited memory Broyden method to solve high-dimensional + systems of nonlinear equations\". Mathematisch Instituut, + Universiteit Leiden, The Netherlands (2003). + + https://web.archive.org/web/20161022015821/http://www.math.leidenuniv.nl/scripties/Rotten.pdf + + Examples + -------- + The following functions define a system of nonlinear equations + + >>> def fun(x): + ... return [x[0] + 0.5 * (x[0] - x[1])**3 - 1.0, + ... 0.5 * (x[1] - x[0])**3 + x[1]] + + A solution can be obtained as follows. + + >>> from scipy import optimize + >>> sol = optimize.broyden2(fun, [0, 0]) + >>> sol + array([0.84116365, 0.15883529]) + + """ + + def _update(self, x, f, dx, df, dx_norm, df_norm): + self._reduce() # reduce first to preserve secant condition + + v = df + c = dx - self.Gm.matvec(df) + d = v / df_norm**2 + self.Gm.append(c, d) + + +#------------------------------------------------------------------------------ +# Broyden-like (restricted memory) +#------------------------------------------------------------------------------ + +class Anderson(GenericBroyden): + """ + Find a root of a function, using (extended) Anderson mixing. + + The Jacobian is formed by for a 'best' solution in the space + spanned by last `M` vectors. As a result, only a MxM matrix + inversions and MxN multiplications are required. [Ey]_ + + Parameters + ---------- + %(params_basic)s + alpha : float, optional + Initial guess for the Jacobian is (-1/alpha). + M : float, optional + Number of previous vectors to retain. Defaults to 5. + w0 : float, optional + Regularization parameter for numerical stability. + Compared to unity, good values of the order of 0.01. + %(params_extra)s + + See Also + -------- + root : Interface to root finding algorithms for multivariate + functions. See ``method='anderson'`` in particular. + + References + ---------- + .. [Ey] V. Eyert, J. Comp. Phys., 124, 271 (1996). + + Examples + -------- + The following functions define a system of nonlinear equations + + >>> def fun(x): + ... return [x[0] + 0.5 * (x[0] - x[1])**3 - 1.0, + ... 0.5 * (x[1] - x[0])**3 + x[1]] + + A solution can be obtained as follows. + + >>> from scipy import optimize + >>> sol = optimize.anderson(fun, [0, 0]) + >>> sol + array([0.84116588, 0.15883789]) + + """ + + # Note: + # + # Anderson method maintains a rank M approximation of the inverse Jacobian, + # + # J^-1 v ~ -v*alpha + (dX + alpha dF) A^-1 dF^H v + # A = W + dF^H dF + # W = w0^2 diag(dF^H dF) + # + # so that for w0 = 0 the secant condition applies for last M iterates, i.e., + # + # J^-1 df_j = dx_j + # + # for all j = 0 ... M-1. + # + # Moreover, (from Sherman-Morrison-Woodbury formula) + # + # J v ~ [ b I - b^2 C (I + b dF^H A^-1 C)^-1 dF^H ] v + # C = (dX + alpha dF) A^-1 + # b = -1/alpha + # + # and after simplification + # + # J v ~ -v/alpha + (dX/alpha + dF) (dF^H dX - alpha W)^-1 dF^H v + # + + def __init__(self, alpha=None, w0=0.01, M=5): + GenericBroyden.__init__(self) + self.alpha = alpha + self.M = M + self.dx = [] + self.df = [] + self.gamma = None + self.w0 = w0 + + def solve(self, f, tol=0): + dx = -self.alpha*f + + n = len(self.dx) + if n == 0: + return dx + + df_f = np.empty(n, dtype=f.dtype) + for k in range(n): + df_f[k] = vdot(self.df[k], f) + + try: + gamma = solve(self.a, df_f) + except LinAlgError: + # singular; reset the Jacobian approximation + del self.dx[:] + del self.df[:] + return dx + + for m in range(n): + dx += gamma[m]*(self.dx[m] + self.alpha*self.df[m]) + return dx + + def matvec(self, f): + dx = -f/self.alpha + + n = len(self.dx) + if n == 0: + return dx + + df_f = np.empty(n, dtype=f.dtype) + for k in range(n): + df_f[k] = vdot(self.df[k], f) + + b = np.empty((n, n), dtype=f.dtype) + for i in range(n): + for j in range(n): + b[i,j] = vdot(self.df[i], self.dx[j]) + if i == j and self.w0 != 0: + b[i,j] -= vdot(self.df[i], self.df[i])*self.w0**2*self.alpha + gamma = solve(b, df_f) + + for m in range(n): + dx += gamma[m]*(self.df[m] + self.dx[m]/self.alpha) + return dx + + def _update(self, x, f, dx, df, dx_norm, df_norm): + if self.M == 0: + return + + self.dx.append(dx) + self.df.append(df) + + while len(self.dx) > self.M: + self.dx.pop(0) + self.df.pop(0) + + n = len(self.dx) + a = np.zeros((n, n), dtype=f.dtype) + + for i in range(n): + for j in range(i, n): + if i == j: + wd = self.w0**2 + else: + wd = 0 + a[i,j] = (1+wd)*vdot(self.df[i], self.df[j]) + + a += np.triu(a, 1).T.conj() + self.a = a + +#------------------------------------------------------------------------------ +# Simple iterations +#------------------------------------------------------------------------------ + + +class DiagBroyden(GenericBroyden): + """ + Find a root of a function, using diagonal Broyden Jacobian approximation. + + The Jacobian approximation is derived from previous iterations, by + retaining only the diagonal of Broyden matrices. + + .. warning:: + + This algorithm may be useful for specific problems, but whether + it will work may depend strongly on the problem. + + Parameters + ---------- + %(params_basic)s + alpha : float, optional + Initial guess for the Jacobian is (-1/alpha). + %(params_extra)s + + See Also + -------- + root : Interface to root finding algorithms for multivariate + functions. See ``method='diagbroyden'`` in particular. + + Examples + -------- + The following functions define a system of nonlinear equations + + >>> def fun(x): + ... return [x[0] + 0.5 * (x[0] - x[1])**3 - 1.0, + ... 0.5 * (x[1] - x[0])**3 + x[1]] + + A solution can be obtained as follows. + + >>> from scipy import optimize + >>> sol = optimize.diagbroyden(fun, [0, 0]) + >>> sol + array([0.84116403, 0.15883384]) + + """ + + def __init__(self, alpha=None): + GenericBroyden.__init__(self) + self.alpha = alpha + + def setup(self, x, F, func): + GenericBroyden.setup(self, x, F, func) + self.d = np.full((self.shape[0],), 1 / self.alpha, dtype=self.dtype) + + def solve(self, f, tol=0): + return -f / self.d + + def matvec(self, f): + return -f * self.d + + def rsolve(self, f, tol=0): + return -f / self.d.conj() + + def rmatvec(self, f): + return -f * self.d.conj() + + def todense(self): + return np.diag(-self.d) + + def _update(self, x, f, dx, df, dx_norm, df_norm): + self.d -= (df + self.d*dx)*dx/dx_norm**2 + + +class LinearMixing(GenericBroyden): + """ + Find a root of a function, using a scalar Jacobian approximation. + + .. warning:: + + This algorithm may be useful for specific problems, but whether + it will work may depend strongly on the problem. + + Parameters + ---------- + %(params_basic)s + alpha : float, optional + The Jacobian approximation is (-1/alpha). + %(params_extra)s + + See Also + -------- + root : Interface to root finding algorithms for multivariate + functions. See ``method='linearmixing'`` in particular. + + """ + + def __init__(self, alpha=None): + GenericBroyden.__init__(self) + self.alpha = alpha + + def solve(self, f, tol=0): + return -f*self.alpha + + def matvec(self, f): + return -f/self.alpha + + def rsolve(self, f, tol=0): + return -f*np.conj(self.alpha) + + def rmatvec(self, f): + return -f/np.conj(self.alpha) + + def todense(self): + return np.diag(np.full(self.shape[0], -1/self.alpha)) + + def _update(self, x, f, dx, df, dx_norm, df_norm): + pass + + +class ExcitingMixing(GenericBroyden): + """ + Find a root of a function, using a tuned diagonal Jacobian approximation. + + The Jacobian matrix is diagonal and is tuned on each iteration. + + .. warning:: + + This algorithm may be useful for specific problems, but whether + it will work may depend strongly on the problem. + + See Also + -------- + root : Interface to root finding algorithms for multivariate + functions. See ``method='excitingmixing'`` in particular. + + Parameters + ---------- + %(params_basic)s + alpha : float, optional + Initial Jacobian approximation is (-1/alpha). + alphamax : float, optional + The entries of the diagonal Jacobian are kept in the range + ``[alpha, alphamax]``. + %(params_extra)s + """ + + def __init__(self, alpha=None, alphamax=1.0): + GenericBroyden.__init__(self) + self.alpha = alpha + self.alphamax = alphamax + self.beta = None + + def setup(self, x, F, func): + GenericBroyden.setup(self, x, F, func) + self.beta = np.full((self.shape[0],), self.alpha, dtype=self.dtype) + + def solve(self, f, tol=0): + return -f*self.beta + + def matvec(self, f): + return -f/self.beta + + def rsolve(self, f, tol=0): + return -f*self.beta.conj() + + def rmatvec(self, f): + return -f/self.beta.conj() + + def todense(self): + return np.diag(-1/self.beta) + + def _update(self, x, f, dx, df, dx_norm, df_norm): + incr = f*self.last_f > 0 + self.beta[incr] += self.alpha + self.beta[~incr] = self.alpha + np.clip(self.beta, 0, self.alphamax, out=self.beta) + + +#------------------------------------------------------------------------------ +# Iterative/Krylov approximated Jacobians +#------------------------------------------------------------------------------ + +class KrylovJacobian(Jacobian): + """ + Find a root of a function, using Krylov approximation for inverse Jacobian. + + This method is suitable for solving large-scale problems. + + Parameters + ---------- + %(params_basic)s + rdiff : float, optional + Relative step size to use in numerical differentiation. + method : str or callable, optional + Krylov method to use to approximate the Jacobian. Can be a string, + or a function implementing the same interface as the iterative + solvers in `scipy.sparse.linalg`. If a string, needs to be one of: + ``'lgmres'``, ``'gmres'``, ``'bicgstab'``, ``'cgs'``, ``'minres'``, + ``'tfqmr'``. + + The default is `scipy.sparse.linalg.lgmres`. + inner_maxiter : int, optional + Parameter to pass to the "inner" Krylov solver: maximum number of + iterations. Iteration will stop after maxiter steps even if the + specified tolerance has not been achieved. + inner_M : LinearOperator or InverseJacobian + Preconditioner for the inner Krylov iteration. + Note that you can use also inverse Jacobians as (adaptive) + preconditioners. For example, + + >>> from scipy.optimize import BroydenFirst, KrylovJacobian + >>> from scipy.optimize import InverseJacobian + >>> jac = BroydenFirst() + >>> kjac = KrylovJacobian(inner_M=InverseJacobian(jac)) + + If the preconditioner has a method named 'update', it will be called + as ``update(x, f)`` after each nonlinear step, with ``x`` giving + the current point, and ``f`` the current function value. + outer_k : int, optional + Size of the subspace kept across LGMRES nonlinear iterations. + See `scipy.sparse.linalg.lgmres` for details. + inner_kwargs : kwargs + Keyword parameters for the "inner" Krylov solver + (defined with `method`). Parameter names must start with + the `inner_` prefix which will be stripped before passing on + the inner method. See, e.g., `scipy.sparse.linalg.gmres` for details. + %(params_extra)s + + See Also + -------- + root : Interface to root finding algorithms for multivariate + functions. See ``method='krylov'`` in particular. + scipy.sparse.linalg.gmres + scipy.sparse.linalg.lgmres + + Notes + ----- + This function implements a Newton-Krylov solver. The basic idea is + to compute the inverse of the Jacobian with an iterative Krylov + method. These methods require only evaluating the Jacobian-vector + products, which are conveniently approximated by a finite difference: + + .. math:: J v \\approx (f(x + \\omega*v/|v|) - f(x)) / \\omega + + Due to the use of iterative matrix inverses, these methods can + deal with large nonlinear problems. + + SciPy's `scipy.sparse.linalg` module offers a selection of Krylov + solvers to choose from. The default here is `lgmres`, which is a + variant of restarted GMRES iteration that reuses some of the + information obtained in the previous Newton steps to invert + Jacobians in subsequent steps. + + For a review on Newton-Krylov methods, see for example [1]_, + and for the LGMRES sparse inverse method, see [2]_. + + References + ---------- + .. [1] C. T. Kelley, Solving Nonlinear Equations with Newton's Method, + SIAM, pp.57-83, 2003. + :doi:`10.1137/1.9780898718898.ch3` + .. [2] D.A. Knoll and D.E. Keyes, J. Comp. Phys. 193, 357 (2004). + :doi:`10.1016/j.jcp.2003.08.010` + .. [3] A.H. Baker and E.R. Jessup and T. Manteuffel, + SIAM J. Matrix Anal. Appl. 26, 962 (2005). + :doi:`10.1137/S0895479803422014` + + Examples + -------- + The following functions define a system of nonlinear equations + + >>> def fun(x): + ... return [x[0] + 0.5 * x[1] - 1.0, + ... 0.5 * (x[1] - x[0]) ** 2] + + A solution can be obtained as follows. + + >>> from scipy import optimize + >>> sol = optimize.newton_krylov(fun, [0, 0]) + >>> sol + array([0.66731771, 0.66536458]) + + """ + + def __init__(self, rdiff=None, method='lgmres', inner_maxiter=20, + inner_M=None, outer_k=10, **kw): + self.preconditioner = inner_M + self.rdiff = rdiff + # Note that this retrieves one of the named functions, or otherwise + # uses `method` as is (i.e., for a user-provided callable). + self.method = dict( + bicgstab=scipy.sparse.linalg.bicgstab, + gmres=scipy.sparse.linalg.gmres, + lgmres=scipy.sparse.linalg.lgmres, + cgs=scipy.sparse.linalg.cgs, + minres=scipy.sparse.linalg.minres, + tfqmr=scipy.sparse.linalg.tfqmr, + ).get(method, method) + + self.method_kw = dict(maxiter=inner_maxiter, M=self.preconditioner) + + if self.method is scipy.sparse.linalg.gmres: + # Replace GMRES's outer iteration with Newton steps + self.method_kw['restart'] = inner_maxiter + self.method_kw['maxiter'] = 1 + self.method_kw.setdefault('atol', 0) + elif self.method in (scipy.sparse.linalg.gcrotmk, + scipy.sparse.linalg.bicgstab, + scipy.sparse.linalg.cgs): + self.method_kw.setdefault('atol', 0) + elif self.method is scipy.sparse.linalg.lgmres: + self.method_kw['outer_k'] = outer_k + # Replace LGMRES's outer iteration with Newton steps + self.method_kw['maxiter'] = 1 + # Carry LGMRES's `outer_v` vectors across nonlinear iterations + self.method_kw.setdefault('outer_v', []) + self.method_kw.setdefault('prepend_outer_v', True) + # But don't carry the corresponding Jacobian*v products, in case + # the Jacobian changes a lot in the nonlinear step + # + # XXX: some trust-region inspired ideas might be more efficient... + # See e.g., Brown & Saad. But needs to be implemented separately + # since it's not an inexact Newton method. + self.method_kw.setdefault('store_outer_Av', False) + self.method_kw.setdefault('atol', 0) + + for key, value in kw.items(): + if not key.startswith('inner_'): + raise ValueError(f"Unknown parameter {key}") + self.method_kw[key[6:]] = value + + def _update_diff_step(self): + mx = abs(self.x0).max() + mf = abs(self.f0).max() + self.omega = self.rdiff * max(1, mx) / max(1, mf) + + def matvec(self, v): + nv = norm(v) + if nv == 0: + return 0*v + sc = self.omega / nv + r = (self.func(self.x0 + sc*v) - self.f0) / sc + if not np.all(np.isfinite(r)) and np.all(np.isfinite(v)): + raise ValueError('Function returned non-finite results') + return r + + def solve(self, rhs, tol=0): + if 'rtol' in self.method_kw: + sol, info = self.method(self.op, rhs, **self.method_kw) + else: + sol, info = self.method(self.op, rhs, rtol=tol, **self.method_kw) + return sol + + def update(self, x, f): + self.x0 = x + self.f0 = f + self._update_diff_step() + + # Update also the preconditioner, if possible + if self.preconditioner is not None: + if hasattr(self.preconditioner, 'update'): + self.preconditioner.update(x, f) + + def setup(self, x, f, func): + Jacobian.setup(self, x, f, func) + self.x0 = x + self.f0 = f + self.op = scipy.sparse.linalg.aslinearoperator(self) + + if self.rdiff is None: + self.rdiff = np.finfo(x.dtype).eps ** (1./2) + + self._update_diff_step() + + # Setup also the preconditioner, if possible + if self.preconditioner is not None: + if hasattr(self.preconditioner, 'setup'): + self.preconditioner.setup(x, f, func) + + +#------------------------------------------------------------------------------ +# Wrapper functions +#------------------------------------------------------------------------------ + +def _nonlin_wrapper(name, jac): + """ + Construct a solver wrapper with given name and Jacobian approx. + + It inspects the keyword arguments of ``jac.__init__``, and allows to + use the same arguments in the wrapper function, in addition to the + keyword arguments of `nonlin_solve` + + """ + signature = _getfullargspec(jac.__init__) + args, varargs, varkw, defaults, kwonlyargs, kwdefaults, _ = signature + kwargs = list(zip(args[-len(defaults):], defaults)) + kw_str = ", ".join([f"{k}={v!r}" for k, v in kwargs]) + if kw_str: + kw_str = ", " + kw_str + kwkw_str = ", ".join([f"{k}={k}" for k, v in kwargs]) + if kwkw_str: + kwkw_str = kwkw_str + ", " + if kwonlyargs: + raise ValueError(f'Unexpected signature {signature}') + + # Construct the wrapper function so that its keyword arguments + # are visible in pydoc.help etc. + wrapper = """ +def %(name)s(F, xin, iter=None %(kw)s, verbose=False, maxiter=None, + f_tol=None, f_rtol=None, x_tol=None, x_rtol=None, + tol_norm=None, line_search='armijo', callback=None, **kw): + jac = %(jac)s(%(kwkw)s **kw) + return nonlin_solve(F, xin, jac, iter, verbose, maxiter, + f_tol, f_rtol, x_tol, x_rtol, tol_norm, line_search, + callback) +""" + + wrapper = wrapper % dict(name=name, kw=kw_str, jac=jac.__name__, + kwkw=kwkw_str) + ns = {} + ns.update(globals()) + exec(wrapper, ns) + func = ns[name] + func.__doc__ = jac.__doc__ + _set_doc(func) + return func + + +broyden1 = _nonlin_wrapper('broyden1', BroydenFirst) +broyden2 = _nonlin_wrapper('broyden2', BroydenSecond) +anderson = _nonlin_wrapper('anderson', Anderson) +linearmixing = _nonlin_wrapper('linearmixing', LinearMixing) +diagbroyden = _nonlin_wrapper('diagbroyden', DiagBroyden) +excitingmixing = _nonlin_wrapper('excitingmixing', ExcitingMixing) +newton_krylov = _nonlin_wrapper('newton_krylov', KrylovJacobian) diff --git a/shared/package-files/06/06d3b49e34f00c5ad736bde730aabfa7c3c384fcc7f517f30ab9cb909c73e5fc/blob b/shared/package-files/06/06d3b49e34f00c5ad736bde730aabfa7c3c384fcc7f517f30ab9cb909c73e5fc/blob new file mode 100644 index 0000000000000000000000000000000000000000..262ec1eac6f4a9ff9adfc01675d83bd98bf96f1f --- /dev/null +++ b/shared/package-files/06/06d3b49e34f00c5ad736bde730aabfa7c3c384fcc7f517f30ab9cb909c73e5fc/blob @@ -0,0 +1,364 @@ +""" +test_indexing tests the following Index methods: + __getitem__ + get_loc + get_value + __contains__ + take + where + get_indexer + get_indexer_for + slice_locs + asof_locs + +The corresponding tests.indexes.[index_type].test_indexing files +contain tests for the corresponding methods specific to those Index subclasses. +""" +import numpy as np +import pytest + +from pandas.compat import PY314 +from pandas.errors import InvalidIndexError + +from pandas.core.dtypes.common import ( + is_float_dtype, + is_scalar, +) + +from pandas import ( + NA, + DatetimeIndex, + Index, + IntervalIndex, + MultiIndex, + NaT, + PeriodIndex, + TimedeltaIndex, +) +import pandas._testing as tm + + +class TestTake: + def test_take_invalid_kwargs(self, index): + indices = [1, 2] + + msg = r"take\(\) got an unexpected keyword argument 'foo'" + with pytest.raises(TypeError, match=msg): + index.take(indices, foo=2) + + msg = "the 'out' parameter is not supported" + with pytest.raises(ValueError, match=msg): + index.take(indices, out=indices) + + msg = "the 'mode' parameter is not supported" + with pytest.raises(ValueError, match=msg): + index.take(indices, mode="clip") + + def test_take(self, index): + indexer = [4, 3, 0, 2] + if len(index) < 5: + pytest.skip("Test doesn't make sense since not enough elements") + + result = index.take(indexer) + expected = index[indexer] + assert result.equals(expected) + + if not isinstance(index, (DatetimeIndex, PeriodIndex, TimedeltaIndex)): + # GH 10791 + msg = r"'(.*Index)' object has no attribute 'freq'" + with pytest.raises(AttributeError, match=msg): + index.freq + + def test_take_indexer_type(self): + # GH#42875 + integer_index = Index([0, 1, 2, 3]) + scalar_index = 1 + msg = "Expected indices to be array-like" + with pytest.raises(TypeError, match=msg): + integer_index.take(scalar_index) + + def test_take_minus1_without_fill(self, index): + # -1 does not get treated as NA unless allow_fill=True is passed + if len(index) == 0: + # Test is not applicable + pytest.skip("Test doesn't make sense for empty index") + + result = index.take([0, 0, -1]) + + expected = index.take([0, 0, len(index) - 1]) + tm.assert_index_equal(result, expected) + + +class TestContains: + @pytest.mark.parametrize( + "index,val", + [ + (Index([0, 1, 2]), 2), + (Index([0, 1, "2"]), "2"), + (Index([0, 1, 2, np.inf, 4]), 4), + (Index([0, 1, 2, np.nan, 4]), 4), + (Index([0, 1, 2, np.inf]), np.inf), + (Index([0, 1, 2, np.nan]), np.nan), + ], + ) + def test_index_contains(self, index, val): + assert val in index + + @pytest.mark.parametrize( + "index,val", + [ + (Index([0, 1, 2]), "2"), + (Index([0, 1, "2"]), 2), + (Index([0, 1, 2, np.inf]), 4), + (Index([0, 1, 2, np.nan]), 4), + (Index([0, 1, 2, np.inf]), np.nan), + (Index([0, 1, 2, np.nan]), np.inf), + # Checking if np.inf in int64 Index should not cause an OverflowError + # Related to GH 16957 + (Index([0, 1, 2], dtype=np.int64), np.inf), + (Index([0, 1, 2], dtype=np.int64), np.nan), + (Index([0, 1, 2], dtype=np.uint64), np.inf), + (Index([0, 1, 2], dtype=np.uint64), np.nan), + ], + ) + def test_index_not_contains(self, index, val): + assert val not in index + + @pytest.mark.parametrize( + "index,val", [(Index([0, 1, "2"]), 0), (Index([0, 1, "2"]), "2")] + ) + def test_mixed_index_contains(self, index, val): + # GH#19860 + assert val in index + + @pytest.mark.parametrize( + "index,val", [(Index([0, 1, "2"]), "1"), (Index([0, 1, "2"]), 2)] + ) + def test_mixed_index_not_contains(self, index, val): + # GH#19860 + assert val not in index + + def test_contains_with_float_index(self, any_real_numpy_dtype): + # GH#22085 + dtype = any_real_numpy_dtype + data = [0, 1, 2, 3] if not is_float_dtype(dtype) else [0.1, 1.1, 2.2, 3.3] + index = Index(data, dtype=dtype) + + if not is_float_dtype(index.dtype): + assert 1.1 not in index + assert 1.0 in index + assert 1 in index + else: + assert 1.1 in index + assert 1.0 not in index + assert 1 not in index + + def test_contains_requires_hashable_raises(self, index): + if isinstance(index, MultiIndex): + return # TODO: do we want this to raise? + + msg = "unhashable type: 'list'" + with pytest.raises(TypeError, match=msg): + [] in index + + if PY314: + container_or_iterable = "a container or iterable" + else: + container_or_iterable = "iterable" + + msg = "|".join( + [ + r"unhashable type: 'dict'", + r"must be real number, not dict", + r"an integer is required", + r"\{\}", + r"pandas\._libs\.interval\.IntervalTree' is not " + f"{container_or_iterable}", + ] + ) + with pytest.raises(TypeError, match=msg): + {} in index._engine + + +class TestGetLoc: + def test_get_loc_non_hashable(self, index): + with pytest.raises(InvalidIndexError, match="[0, 1]"): + index.get_loc([0, 1]) + + def test_get_loc_non_scalar_hashable(self, index): + # GH52877 + from enum import Enum + + class E(Enum): + X1 = "x1" + + assert not is_scalar(E.X1) + + exc = KeyError + msg = "" + if isinstance( + index, + ( + DatetimeIndex, + TimedeltaIndex, + PeriodIndex, + IntervalIndex, + ), + ): + # TODO: make these more consistent? + exc = InvalidIndexError + msg = "E.X1" + with pytest.raises(exc, match=msg): + index.get_loc(E.X1) + + def test_get_loc_generator(self, index): + exc = KeyError + if isinstance( + index, + ( + DatetimeIndex, + TimedeltaIndex, + PeriodIndex, + IntervalIndex, + MultiIndex, + ), + ): + # TODO: make these more consistent? + exc = InvalidIndexError + with pytest.raises(exc, match="generator object"): + # MultiIndex specifically checks for generator; others for scalar + index.get_loc(x for x in range(5)) + + def test_get_loc_masked_duplicated_na(self): + # GH#48411 + idx = Index([1, 2, NA, NA], dtype="Int64") + result = idx.get_loc(NA) + expected = np.array([False, False, True, True]) + tm.assert_numpy_array_equal(result, expected) + + +class TestGetIndexer: + def test_get_indexer_base(self, index): + if index._index_as_unique: + expected = np.arange(index.size, dtype=np.intp) + actual = index.get_indexer(index) + tm.assert_numpy_array_equal(expected, actual) + else: + msg = "Reindexing only valid with uniquely valued Index objects" + with pytest.raises(InvalidIndexError, match=msg): + index.get_indexer(index) + + with pytest.raises(ValueError, match="Invalid fill method"): + index.get_indexer(index, method="invalid") + + def test_get_indexer_consistency(self, index): + # See GH#16819 + + if index._index_as_unique: + indexer = index.get_indexer(index[0:2]) + assert isinstance(indexer, np.ndarray) + assert indexer.dtype == np.intp + else: + msg = "Reindexing only valid with uniquely valued Index objects" + with pytest.raises(InvalidIndexError, match=msg): + index.get_indexer(index[0:2]) + + indexer, _ = index.get_indexer_non_unique(index[0:2]) + assert isinstance(indexer, np.ndarray) + assert indexer.dtype == np.intp + + def test_get_indexer_masked_duplicated_na(self): + # GH#48411 + idx = Index([1, 2, NA, NA], dtype="Int64") + result = idx.get_indexer_for(Index([1, NA], dtype="Int64")) + expected = np.array([0, 2, 3], dtype=result.dtype) + tm.assert_numpy_array_equal(result, expected) + + +class TestConvertSliceIndexer: + def test_convert_almost_null_slice(self, index): + # slice with None at both ends, but not step + + key = slice(None, None, "foo") + + if isinstance(index, IntervalIndex): + msg = "label-based slicing with step!=1 is not supported for IntervalIndex" + with pytest.raises(ValueError, match=msg): + index._convert_slice_indexer(key, "loc") + else: + msg = "'>=' not supported between instances of 'str' and 'int'" + with pytest.raises(TypeError, match=msg): + index._convert_slice_indexer(key, "loc") + + +class TestPutmask: + def test_putmask_with_wrong_mask(self, index): + # GH#18368 + if not len(index): + pytest.skip("Test doesn't make sense for empty index") + + fill = index[0] + + msg = "putmask: mask and data must be the same size" + with pytest.raises(ValueError, match=msg): + index.putmask(np.ones(len(index) + 1, np.bool_), fill) + + with pytest.raises(ValueError, match=msg): + index.putmask(np.ones(len(index) - 1, np.bool_), fill) + + with pytest.raises(ValueError, match=msg): + index.putmask("foo", fill) + + +@pytest.mark.parametrize( + "idx", [Index([1, 2, 3]), Index([0.1, 0.2, 0.3]), Index(["a", "b", "c"])] +) +def test_getitem_deprecated_float(idx): + # https://github.com/pandas-dev/pandas/issues/34191 + + msg = "Indexing with a float is no longer supported" + with pytest.raises(IndexError, match=msg): + idx[1.0] + + +@pytest.mark.parametrize( + "idx,target,expected", + [ + ([np.nan, "var1", np.nan], [np.nan], np.array([0, 2], dtype=np.intp)), + ( + [np.nan, "var1", np.nan], + [np.nan, "var1"], + np.array([0, 2, 1], dtype=np.intp), + ), + ( + np.array([np.nan, "var1", np.nan], dtype=object), + [np.nan], + np.array([0, 2], dtype=np.intp), + ), + ( + DatetimeIndex(["2020-08-05", NaT, NaT]), + [NaT], + np.array([1, 2], dtype=np.intp), + ), + (["a", "b", "a", np.nan], [np.nan], np.array([3], dtype=np.intp)), + ( + np.array(["b", np.nan, float("NaN"), "b"], dtype=object), + Index([np.nan], dtype=object), + np.array([1, 2], dtype=np.intp), + ), + ], +) +def test_get_indexer_non_unique_multiple_nans(idx, target, expected): + # GH 35392 + axis = Index(idx) + actual = axis.get_indexer_for(target) + tm.assert_numpy_array_equal(actual, expected) + + +def test_get_indexer_non_unique_nans_in_object_dtype_target(nulls_fixture): + idx = Index([1.0, 2.0]) + target = Index([1, nulls_fixture], dtype="object") + + result_idx, result_missing = idx.get_indexer_non_unique(target) + tm.assert_numpy_array_equal(result_idx, np.array([0, -1], dtype=np.intp)) + tm.assert_numpy_array_equal(result_missing, np.array([1], dtype=np.intp)) diff --git a/shared/package-files/06/06d495c7e6c9b6c8ada94a07c3e31a624c551d6fad4e2051f9728d29aeb1bb1c/score_glacier_predictions_serial.py b/shared/package-files/06/06d495c7e6c9b6c8ada94a07c3e31a624c551d6fad4e2051f9728d29aeb1bb1c/score_glacier_predictions_serial.py new file mode 100644 index 0000000000000000000000000000000000000000..17e35e00cc4d226f7d95f20464db225dc8b1d131 --- /dev/null +++ b/shared/package-files/06/06d495c7e6c9b6c8ada94a07c3e31a624c551d6fad4e2051f9728d29aeb1bb1c/score_glacier_predictions_serial.py @@ -0,0 +1,318 @@ +from contextlib import nullcontext +#!/usr/bin/env python3 +"""Score upstream GLACIER PredSpecDB output under the benchmark contract.""" + +import argparse +from collections import Counter +from functools import lru_cache +import json +import math +from pathlib import Path + +import numpy as np +from mass_tolerant_entropy import observed_peaks, tolerant_entropy, precursor_removed_entropy, adduct_conditioned_entropy +from rdkit import Chem + +from glacier_contract import condition_key +import ms_pred.common as common +from ms_pred.common import chem_utils +from ms_pred.retrieval.retrieval_benchmark import _cosine_sparse, _entropy_sparse + + +def read_jsonl(path: Path): + with path.open(encoding="utf-8") as stream: + for line_number, line in enumerate(stream, 1): + try: + value = json.loads(line) + except json.JSONDecodeError as error: + raise ValueError(f"invalid JSON at {path}:{line_number}: {error}") from error + if not isinstance(value, dict): + raise ValueError(f"expected object at {path}:{line_number}") + yield value + + +def load_pools(path: Path) -> dict: + pools = {} + for row in read_jsonl(path): + pool_id = row["candidate_pool_id"] + if pool_id in pools: + raise ValueError(f"duplicate candidate pool {pool_id}") + pools[pool_id] = row["candidates"] + return pools + + +@lru_cache(maxsize=262144) +def prediction_key_and_support(smiles: str) -> tuple[str, str]: + """Mirror GLACIER's public inference-domain structure checks.""" + try: + molecule = Chem.MolFromSmiles(smiles) + if molecule is None: + return "", "rdkit_invalid" + if any(atom.GetAtomicNum() == 0 for atom in molecule.GetAtoms()): + return "", "wildcard_atom" + if any( + atom.GetAtomicNum() not in chem_utils.VALID_ATOM_NUM + for atom in molecule.GetAtoms() + ): + return Chem.MolToInchiKey(molecule), "unsupported_atom" + molecule = Chem.RemoveHs(molecule) + if molecule.GetNumAtoms() > 100: + return Chem.MolToInchiKey(molecule), "more_than_100_heavy_atoms" + return Chem.MolToInchiKey(molecule), "supported" + except Exception: + return "", "structure_exception" + + +def sparse_observed( + query: dict, + num_bins: int, + upper_limit: int, + max_peaks: int, + intensity_threshold: float, +): + mzs = np.asarray(query["mzs"], dtype=np.float32) + intensities = np.asarray(query["intensities"], dtype=np.float32) + keep = (mzs <= float(query["precursor_mz"]) + 1) & (intensities > 0) + mzs = mzs[keep] + intensities = intensities[keep] + if intensities.size == 0: + raise ValueError(f"query {query['query_id']} has no usable intensity") + maximum = float(intensities.max()) + if maximum <= 0: + raise ValueError(f"query {query['query_id']} has no positive intensity") + # This reproduces process_spec_file() followed by max_inten_spec() in the + # official no_subform MassSpecGym preprocessing: max-normalize, square + # root, retain the strongest 50 peaks, then apply the 0.001 threshold. + intensities = np.sqrt(intensities / maximum) + strongest = np.argsort(intensities)[::-1][:max_peaks] + mzs = mzs[strongest] + intensities = intensities[strongest] + above_threshold = intensities > intensity_threshold + peaks = np.column_stack([mzs[above_threshold], intensities[above_threshold]]) + dense = common.bin_spectra([peaks], num_bins=num_bins, upper_limit=upper_limit)[0] + indices = np.flatnonzero(dense > 0).astype(np.uint32) + return indices, dense[indices].astype(np.float32, copy=False) + + +def main() -> None: + parser = argparse.ArgumentParser() + parser.add_argument("--input-root", type=Path, required=True) + parser.add_argument( + "--pred-file", + type=Path, + required=True, + nargs="+", + help="One or more GLACIER PredSpecDB shards.", + ) + parser.add_argument("--output-root", type=Path, required=True) + parser.add_argument("--distance", choices=("entropy", "cos", "mass_tolerant_entropy"), default="entropy") + parser.add_argument( + "--tie-break", + choices=("candidate_id", "input_order"), + default="candidate_id", + help=( + "Use content-derived IDs for the benchmark. input_order exists only " + "to audit answer-keyed upstream candidate tables." + ), + ) + parser.add_argument("--num-bins", type=int, default=150000) + parser.add_argument("--upper-limit", type=int, default=1500) + parser.add_argument("--max-observed-peaks", type=int, default=50) + parser.add_argument("--observed-intensity-threshold", type=float, default=0.001) + parser.add_argument("--max-queries", type=int) + parser.add_argument( + "--query-id-file", + type=Path, + help="Optional newline-delimited allowlist for query-disjoint scoring shards.", + ) + parser.add_argument( + "--exclude-ranking", + type=Path, + action="append", + default=[], + help=( + "Skip query IDs already present in a partial ranking file. This is " + "an answer-free recovery option; merge the disjoint outputs with " + "merge_partial_rankings.py." + ), + ) + parser.add_argument("--scores-output", type=Path) + args = parser.parse_args() + + input_root = args.input_root.resolve() + output_root = args.output_root.resolve() + if output_root.exists(): + raise FileExistsError(f"refusing to overwrite {output_root}") + output_root.mkdir(parents=True) + pools = load_pools(input_root / "candidate_pools.jsonl") + pool_prediction_keys = {} + predictions = [ + common.PredSpecDB(h5_path=path.resolve(), mode="r") + for path in args.pred_file + ] + selected_queries = None + if args.query_id_file is not None: + selected_queries = { + line.strip() + for line in args.query_id_file.read_text(encoding="utf-8").splitlines() + if line.strip() + } + if not selected_queries: + raise ValueError("query ID allowlist is empty") + excluded_queries = { + row["query_id"] + for ranking_path in args.exclude_ranking + for row in read_jsonl(ranking_path.resolve()) + } + + ranked_queries = 0 + candidate_rows = 0 + missing_predictions = 0 + missing_supported_predictions = 0 + unsupported_missing = Counter() + with (output_root / "rankings.jsonl").open("w", encoding="utf-8") as stream, (args.scores_output.open("w") if args.scores_output else nullcontext(None)) as score_stream: + for query in read_jsonl(input_root / "queries.jsonl"): + if ( + selected_queries is not None + and query["query_id"] not in selected_queries + ): + continue + if args.max_queries is not None and ranked_queries >= args.max_queries: + break + if query["query_id"] in excluded_queries: + continue + collision_energy = query.get("collision_energy") + if collision_energy is None:collision_energy='nan' + pred_name = 'pred_'+condition_key(query) + shard_specs = [] + for prediction_db in predictions: + spec_dict, present = prediction_db.read_from_name(pred_name) + if present: + shard_specs.append(spec_dict) + if not shard_specs: + continue + by_ikey = {} + raw_by_ikey = {} + for spec_dict in shard_specs: + for remark, ce_dict in spec_dict.items(): + normalized = str(remark).removeprefix("ikey ").strip() + normalized_specs = by_ikey.setdefault(normalized, {}) + if args.distance == "mass_tolerant_entropy": + raw_by_ikey.setdefault(normalized, {}).update({ + common.get_collision_energy(ce): spectrum.spec + for ce, spectrum in ce_dict.items() + }) + if args.distance != "mass_tolerant_entropy": + normalized_specs.update({ + common.get_collision_energy(ce): spectrum.binned_spec_sparse + if spectrum.has_matching_binned_spec( + mass_upper_limit=args.upper_limit, + num_bins=args.num_bins, + pool_fn="add", + ) + else ( + spectrum.ensure_binned_spectrum( + mass_upper_limit=args.upper_limit, + num_bins=args.num_bins, + pool_fn="add", + ) + or spectrum.binned_spec_sparse + ) + for ce, spectrum in ce_dict.items() + }) + + pool_id = query["candidate_pool_id"] + candidates = pools[pool_id] + candidate_keys = pool_prediction_keys.get(pool_id) + if candidate_keys is None: + candidate_keys = [ + prediction_key_and_support(candidate["smiles"]) + for candidate in candidates + ] + pool_prediction_keys[pool_id] = candidate_keys + observed = sparse_observed( + query, + args.num_bins, + args.upper_limit, + args.max_observed_peaks, + args.observed_intensity_threshold, + ) + ce_key = common.get_collision_energy(collision_energy) + candidate_predictions = [] + for candidate_ikey, support in candidate_keys: + pred = by_ikey.get(candidate_ikey) + if pred is None: + missing_predictions += 1 + if support == "supported": + missing_supported_predictions += 1 + else: + unsupported_missing[support] += 1 + pred = {} + candidate_predictions.append(pred) + if args.distance == "mass_tolerant_entropy": + raw_observed = observed_peaks(query) + distances = np.asarray([ + adduct_conditioned_entropy(raw_by_ikey.get(key, {}).get(ce_key, []), raw_observed, float(query['precursor_mz']), query['adduct']) + for key, support in candidate_keys + ], dtype=np.float64) + else: + distance_fn = _entropy_sparse if args.distance == "entropy" else _cosine_sparse + distances = distance_fn(candidate_predictions, observed, ce_key, sqrt_inten=True) + # GLACIER emits identical predictions for candidates that collapse to + # the same InChIKey. Break exact score ties by the content-derived + # candidate ID, never by the public candidate-file order. + candidate_ids = np.asarray( + [candidate["candidate_id"] for candidate in candidates] + ) + if args.tie_break == "candidate_id": + order = np.lexsort((candidate_ids, distances)) + else: + order = np.argsort(distances, kind="stable") + ranking = [candidates[int(index)]["candidate_id"] for index in order] + stream.write( + json.dumps( + {"query_id": query["query_id"], "ranking": ranking}, + sort_keys=True, + separators=(",", ":"), + ) + + "\n" + ) + if score_stream is not None: + score_stream.write(json.dumps({"query_id":query["query_id"],"candidate_ids":candidate_ids.tolist(),"distances":distances.tolist()},separators=(",",":"))+"\n") + ranked_queries += 1 + candidate_rows += len(candidates) + + for prediction_db in predictions: + prediction_db.close() + if selected_queries is not None and ranked_queries != len(selected_queries): + raise ValueError( + "query ID allowlist was not fully ranked: " + f"{ranked_queries}/{len(selected_queries)}" + ) + report = { + "schema": "glacier-contract-score/v2", + "distance": args.distance, + "tie_break": args.tie_break, + "ranked_queries": ranked_queries, + "candidate_rows": candidate_rows, + "missing_candidate_predictions": missing_predictions, + "missing_supported_candidate_predictions": missing_supported_predictions, + "model_unsupported_candidate_rows": dict(sorted(unsupported_missing.items())), + "num_bins": args.num_bins, + "upper_limit": args.upper_limit, + "prediction_shards": len(predictions), + "max_observed_peaks": args.max_observed_peaks, + "observed_intensity_threshold": args.observed_intensity_threshold, + "excluded_queries": len(excluded_queries), + "selected_queries": ( + None if selected_queries is None else len(selected_queries) + ), + } + (output_root / "runtime.json").write_text( + json.dumps(report, sort_keys=True, indent=2) + "\n", encoding="utf-8" + ) + print(json.dumps(report, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/shared/package-files/06/06d5a05ca7ad5be95f0bdccef3be5c8990d91c7cd8407c5c8d5079664130493a/blob b/shared/package-files/06/06d5a05ca7ad5be95f0bdccef3be5c8990d91c7cd8407c5c8d5079664130493a/blob new file mode 100644 index 0000000000000000000000000000000000000000..ffe8074557337d37e7281ead250e762eb40da0ad Binary files /dev/null and b/shared/package-files/06/06d5a05ca7ad5be95f0bdccef3be5c8990d91c7cd8407c5c8d5079664130493a/blob differ diff --git a/shared/package-files/06/06d81abe6df0ddcf6677fe7215faba55ea3fe482bd2ad94b1752443de1e16685/blob b/shared/package-files/06/06d81abe6df0ddcf6677fe7215faba55ea3fe482bd2ad94b1752443de1e16685/blob new file mode 100644 index 0000000000000000000000000000000000000000..3d3f27f88eef4e02451d18204cdcfd51f96f6d15 Binary files /dev/null and b/shared/package-files/06/06d81abe6df0ddcf6677fe7215faba55ea3fe482bd2ad94b1752443de1e16685/blob differ diff --git a/shared/package-files/06/06dd7572626df5cb0a8d3affbac9bb74cb12469076836d66fd19ae5b5fab42c7/blob b/shared/package-files/06/06dd7572626df5cb0a8d3affbac9bb74cb12469076836d66fd19ae5b5fab42c7/blob new file mode 100644 index 0000000000000000000000000000000000000000..e420f8a2ec887b04f24b666f8145214656e6b769 --- /dev/null +++ b/shared/package-files/06/06dd7572626df5cb0a8d3affbac9bb74cb12469076836d66fd19ae5b5fab42c7/blob @@ -0,0 +1,91 @@ +namespace eval ::tk { + ::msgcat::mcset de "&Abort" "&Abbruch" + ::msgcat::mcset de "&About..." "&\u00dcber..." + ::msgcat::mcset de "All Files" "Alle Dateien" + ::msgcat::mcset de "Application Error" "Applikationsfehler" + ::msgcat::mcset de "&Apply" "&Anwenden" + ::msgcat::mcset de "Bold" "Fett" + ::msgcat::mcset de "Bold Italic" "Fett kursiv" + ::msgcat::mcset de "&Blue" "&Blau" + ::msgcat::mcset de "Cancel" "Abbruch" + ::msgcat::mcset de "&Cancel" "&Abbruch" + ::msgcat::mcset de "Cannot change to the directory \"%1\$s\".\nPermission denied." "Kann nicht in das Verzeichnis \"%1\$s\" wechseln.\nKeine Rechte vorhanden." + ::msgcat::mcset de "Choose Directory" "W\u00e4hle Verzeichnis" + ::msgcat::mcset de "Cl&ear" "&R\u00fccksetzen" + ::msgcat::mcset de "&Clear Console" "&Konsole l\u00f6schen" + ::msgcat::mcset de "Color" "Farbe" + ::msgcat::mcset de "Console" "Konsole" + ::msgcat::mcset de "&Copy" "&Kopieren" + ::msgcat::mcset de "Cu&t" "Aus&schneiden" + ::msgcat::mcset de "&Delete" "&L\u00f6schen" + ::msgcat::mcset de "Details >>" + ::msgcat::mcset de "Directory \"%1\$s\" does not exist." "Das Verzeichnis \"%1\$s\" existiert nicht." + ::msgcat::mcset de "&Directory:" "&Verzeichnis:" + ::msgcat::mcset de "&Edit" "&Bearbeiten" + ::msgcat::mcset de "Effects" "Effekte" + ::msgcat::mcset de "Error: %1\$s" "Fehler: %1\$s" + ::msgcat::mcset de "E&xit" "&Ende" + ::msgcat::mcset de "&File" "&Datei" + ::msgcat::mcset de "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Die Datei \"%1\$s\" ist bereits vorhanden.\nWollen sie diese Datei \u00fcberschreiben ?" + ::msgcat::mcset de "File \"%1\$s\" already exists.\n\n" "Die Datei \"%1\$s\" ist bereits vorhanden.\n\n" + ::msgcat::mcset de "File \"%1\$s\" does not exist." "Die Datei \"%1\$s\" existiert nicht." + ::msgcat::mcset de "File &name:" "Datei&name:" + ::msgcat::mcset de "File &names:" "Datei&namen:" + ::msgcat::mcset de "Files of &type:" "Dateien des &Typs:" + ::msgcat::mcset de "Fi&les:" "Dat&eien:" + ::msgcat::mcset de "&Filter" + ::msgcat::mcset de "Fil&ter:" + ::msgcat::mcset de "Font" "Schriftart" + ::msgcat::mcset de "&Font:" "Schriftart:" + ::msgcat::mcset de "Font st&yle:" "Schriftschnitt:" + ::msgcat::mcset de "&Green" "&Gr\u00fcn" + ::msgcat::mcset de "&Help" "&Hilfe" + ::msgcat::mcset de "Hi" "Hallo" + ::msgcat::mcset de "&Hide Console" "&Konsole unsichtbar machen" + ::msgcat::mcset de "&Ignore" "&Ignorieren" + ::msgcat::mcset de "Invalid file name \"%1\$s\"." "Ung\u00fcltiger Dateiname \"%1\$s\"." + ::msgcat::mcset de "Italic" "Kursiv" + ::msgcat::mcset de "Log Files" "Protokolldatei" + ::msgcat::mcset de "&No" "&Nein" + ::msgcat::mcset de "&OK" + ::msgcat::mcset de "OK" + ::msgcat::mcset de "Ok" + ::msgcat::mcset de "Open" "\u00d6ffnen" + ::msgcat::mcset de "&Open" "\u00d6&ffnen" + ::msgcat::mcset de "Open Multiple Files" "Mehrere Dateien \u00F6ffnen" + ::msgcat::mcset de "P&aste" "E&inf\u00fcgen" + ::msgcat::mcset de "&Quit" "&Beenden" + ::msgcat::mcset de "&Red" "&Rot" + ::msgcat::mcset de "Regular" "Standard" + ::msgcat::mcset de "Replace existing file?" "Existierende Datei ersetzen?" + ::msgcat::mcset de "&Retry" "&Wiederholen" + ::msgcat::mcset de "Sample" "Beispiel" + ::msgcat::mcset de "&Save" "&Speichern" + ::msgcat::mcset de "Save As" "Speichern unter" + ::msgcat::mcset de "Save To Log" "In Protokoll speichern" + ::msgcat::mcset de "Select Log File" "Protokolldatei ausw\u00e4hlen" + ::msgcat::mcset de "Select a file to source" "Auszuf\u00fchrende Datei ausw\u00e4hlen" + ::msgcat::mcset de "&Selection:" "Auswah&l:" + ::msgcat::mcset de "&Size:" "Schriftgrad:" + ::msgcat::mcset de "Show &Hidden Directories" "Zeige versteckte Dateien" + ::msgcat::mcset de "Show &Hidden Files and Directories" "Zeige versteckte Dateien und Verzeichnisse" + ::msgcat::mcset de "Skip Messages" "Weitere Nachrichten \u00fcberspringen" + ::msgcat::mcset de "&Source..." "&Ausf\u00fchren..." + ::msgcat::mcset de "Stri&keout" "&Durchgestrichen" + ::msgcat::mcset de "Tcl Scripts" "Tcl-Skripte" + ::msgcat::mcset de "Tcl for Windows" "Tcl f\u00fcr Windows" + ::msgcat::mcset de "Text Files" "Textdateien" + ::msgcat::mcset de "&Underline" "&Unterstrichen" + ::msgcat::mcset de "&Yes" "&Ja" + ::msgcat::mcset de "abort" "abbrechen" + ::msgcat::mcset de "blue" "blau" + ::msgcat::mcset de "cancel" "abbrechen" + ::msgcat::mcset de "extension" "Erweiterung" + ::msgcat::mcset de "extensions" "Erweiterungen" + ::msgcat::mcset de "green" "gr\u00fcn" + ::msgcat::mcset de "ignore" "ignorieren" + ::msgcat::mcset de "ok" + ::msgcat::mcset de "red" "rot" + ::msgcat::mcset de "retry" "wiederholen" + ::msgcat::mcset de "yes" "ja" +} diff --git a/shared/package-files/06/06e073b6b3d045ab149956615ebdbf36026e8dd513361370779f696591e4de50/blob b/shared/package-files/06/06e073b6b3d045ab149956615ebdbf36026e8dd513361370779f696591e4de50/blob new file mode 100644 index 0000000000000000000000000000000000000000..068a6a1a0f5b5382a7d0c4fcc2b6cd33f989fdfa --- /dev/null +++ b/shared/package-files/06/06e073b6b3d045ab149956615ebdbf36026e8dd513361370779f696591e4de50/blob @@ -0,0 +1,77 @@ +""" +DType classes and utility (:mod:`numpy.dtypes`) +=============================================== + +This module is home to specific dtypes related functionality and their classes. +For more general information about dtypes, also see `numpy.dtype` and +:ref:`arrays.dtypes`. + +Similar to the builtin ``types`` module, this submodule defines types (classes) +that are not widely used directly. + +.. versionadded:: NumPy 1.25 + + The dtypes module is new in NumPy 1.25. Previously DType classes were + only accessible indirectly. + + +DType classes +------------- + +The following are the classes of the corresponding NumPy dtype instances and +NumPy scalar types. The classes can be used in ``isinstance`` checks and can +also be instantiated or used directly. Direct use of these classes is not +typical, since their scalar counterparts (e.g. ``np.float64``) or strings +like ``"float64"`` can be used. + +.. list-table:: + :header-rows: 1 + + * - Group + - DType class + + * - Boolean + - ``BoolDType`` + + * - Bit-sized integers + - ``Int8DType``, ``UInt8DType``, ``Int16DType``, ``UInt16DType``, + ``Int32DType``, ``UInt32DType``, ``Int64DType``, ``UInt64DType`` + + * - C-named integers (may be aliases) + - ``ByteDType``, ``UByteDType``, ``ShortDType``, ``UShortDType``, + ``IntDType``, ``UIntDType``, ``LongDType``, ``ULongDType``, + ``LongLongDType``, ``ULongLongDType`` + + * - Floating point + - ``Float16DType``, ``Float32DType``, ``Float64DType``, + ``LongDoubleDType`` + + * - Complex + - ``Complex64DType``, ``Complex128DType``, ``CLongDoubleDType`` + + * - Strings + - ``BytesDType``, ``BytesDType`` + + * - Times + - ``DateTime64DType``, ``TimeDelta64DType`` + + * - Others + - ``ObjectDType``, ``VoidDType`` + +""" + +__all__ = [] + + +def _add_dtype_helper(DType, alias): + # Function to add DTypes a bit more conveniently without channeling them + # through `numpy.core._multiarray_umath` namespace or similar. + from numpy import dtypes + + setattr(dtypes, DType.__name__, DType) + __all__.append(DType.__name__) + + if alias: + alias = alias.removeprefix("numpy.dtypes.") + setattr(dtypes, alias, DType) + __all__.append(alias) diff --git a/shared/package-files/06/06e09e6fc73ad2e0c7a626e83a4281976baedd3f84121ad841cb5ea2a23186a4/blob b/shared/package-files/06/06e09e6fc73ad2e0c7a626e83a4281976baedd3f84121ad841cb5ea2a23186a4/blob new file mode 100644 index 0000000000000000000000000000000000000000..f5b7a38dffac35dc10eae78b87abf9c1ed603087 --- /dev/null +++ b/shared/package-files/06/06e09e6fc73ad2e0c7a626e83a4281976baedd3f84121ad841cb5ea2a23186a4/blob @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: setuptools (84.0.0) +Root-Is-Purelib: false +Tag: cp310-cp310-manylinux_2_12_x86_64 +Tag: cp310-cp310-manylinux2010_x86_64 + diff --git a/shared/package-files/06/06e1e22eec6eeae11f64568f256dd13e93dac5a55cb44400de47522520cbd61c/blob b/shared/package-files/06/06e1e22eec6eeae11f64568f256dd13e93dac5a55cb44400de47522520cbd61c/blob new file mode 100644 index 0000000000000000000000000000000000000000..f225fbf5b52d04987ccf68f4d5ee4b735e3158b0 --- /dev/null +++ b/shared/package-files/06/06e1e22eec6eeae11f64568f256dd13e93dac5a55cb44400de47522520cbd61c/blob @@ -0,0 +1,9 @@ +from warnings import warn + +from .notebook import * # NOQA +from .notebook import __all__ # NOQA +from .std import TqdmDeprecationWarning + +warn("This function will be removed in tqdm==5.0.0\n" + "Please use `tqdm.notebook.*` instead of `tqdm._tqdm_notebook.*`", + TqdmDeprecationWarning, stacklevel=2) diff --git a/shared/package-files/06/06e2998258a8a448014c373041a91ca92f11ae7ed3cfbafe012ea3c45085f5c2/blob b/shared/package-files/06/06e2998258a8a448014c373041a91ca92f11ae7ed3cfbafe012ea3c45085f5c2/blob new file mode 100644 index 0000000000000000000000000000000000000000..5348fca85396b434154006d71e6d7c6aa7a3ac35 --- /dev/null +++ b/shared/package-files/06/06e2998258a8a448014c373041a91ca92f11ae7ed3cfbafe012ea3c45085f5c2/blob @@ -0,0 +1,35007 @@ +{ + "initialization": { + "distribution": "Normal(0,0.01)", + "seed": 20261021, + "pretrained_weights": false + }, + "training_data": "all 19880 supplied training shots per condition; all 130 conditions", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "validation_manifest_sha256": "482bb7268c6c827ebbf1f756ee6994750acfcd011adab08eaa2ada703e5faea1", + "calibration_exception": "Supplied even-fitted DEMs include validation syndromes but no logical labels or test data.", + "optimizer": "L-BFGS-B binary cross entropy plus 1e-5 L2, maximum 300 iterations", + "selection": "First trained candidate; validation reported without parameter fitting or hyperparameter selection", + "test_data_used": false, + "released_per_shot_predictions_used": false, + "history": [ + { + "group": "d3_bX_center_3_5", + "train_loss": 0.49244210477855016, + "iterations": 88, + "failure": 0.26941105769230766, + "plain_failure": 0.2847205528846154, + "correlated_failure": 0.2704326923076923, + "coset_failure": 0.2847205528846154, + "optimizer_success": true + }, + { + "group": "d3_bX_center_5_3", + "train_loss": 0.4947914557869911, + "iterations": 85, + "failure": 0.2706430288461538, + "plain_failure": 0.29103064903846154, + "correlated_failure": 0.27076322115384616, + "coset_failure": 0.29103064903846154, + "optimizer_success": true + }, + { + "group": "d3_bX_center_5_7", + "train_loss": 0.4786369068642458, + "iterations": 79, + "failure": 0.25964543269230766, + "plain_failure": 0.2741887019230769, + "correlated_failure": 0.2598106971153846, + "coset_failure": 0.2741887019230769, + "optimizer_success": true + }, + { + "group": "d3_bX_center_7_5", + "train_loss": 0.48299120621578956, + "iterations": 81, + "failure": 0.26062199519230766, + "plain_failure": 0.2762920673076923, + "correlated_failure": 0.2615234375, + "coset_failure": 0.2762920673076923, + "optimizer_success": true + }, + { + "group": "d3_bZ_center_3_5", + "train_loss": 0.4903180822446507, + "iterations": 62, + "failure": 0.2718299278846154, + "plain_failure": 0.2878605769230769, + "correlated_failure": 0.2736778846153846, + "coset_failure": 0.2878605769230769, + "optimizer_success": true + }, + { + "group": "d3_bZ_center_5_3", + "train_loss": 0.4886621962442568, + "iterations": 90, + "failure": 0.25896935096153845, + "plain_failure": 0.27548076923076925, + "correlated_failure": 0.2588942307692308, + "coset_failure": 0.27548076923076925, + "optimizer_success": true + }, + { + "group": "d3_bZ_center_5_7", + "train_loss": 0.4822654448634678, + "iterations": 71, + "failure": 0.2594200721153846, + "plain_failure": 0.2823016826923077, + "correlated_failure": 0.25961538461538464, + "coset_failure": 0.2823016826923077, + "optimizer_success": true + }, + { + "group": "d3_bZ_center_7_5", + "train_loss": 0.47379411844328495, + "iterations": 69, + "failure": 0.2542067307692308, + "plain_failure": 0.27393329326923077, + "correlated_failure": 0.2547776442307692, + "coset_failure": 0.27393329326923077, + "optimizer_success": true + }, + { + "group": "d5_bX_center_5_5", + "train_loss": 0.4801955727360068, + "iterations": 85, + "failure": 0.2616887019230769, + "plain_failure": 0.293359375, + "correlated_failure": 0.2609375, + "coset_failure": 0.293359375, + "optimizer_success": true + }, + { + "group": "d5_bZ_center_5_5", + "train_loss": 0.4661361209861219, + "iterations": 87, + "failure": 0.2465294471153846, + "plain_failure": 0.2799729567307692, + "correlated_failure": 0.24618389423076922, + "coset_failure": 0.2799729567307692, + "optimizer_success": true + } + ], + "elapsed_seconds": 30.247901678085327, + "experiment_2": { + "method": "Exact contraction of supplied DEM for d3; learned logistic mixture with matching features", + "initialization": { + "distribution": "Normal(0,0.01)", + "seed": 20261022, + "pretrained_weights": false + }, + "selection": "Minimum validation condition-mean failure per group among raw exact, calibrated exact, exact plus matching ensemble", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "exact_raw": { + "failure": 0.253125 + }, + "exact_calibrated": { + "failure": 0.25378605769230766, + "train_loss": 0.46127817271552574, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.2522686298076923, + "train_loss": 0.459112999306209, + "iterations": 115 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "exact_raw": { + "failure": 0.2569711538461538 + }, + "exact_calibrated": { + "failure": 0.25790264423076925, + "train_loss": 0.46654812103904, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.257421875, + "train_loss": 0.4647701206688181, + "iterations": 80 + } + }, + "selected": "exact_raw" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "exact_raw": { + "failure": 0.23622295673076923 + }, + "exact_calibrated": { + "failure": 0.23608774038461539, + "train_loss": 0.43883548729746, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.2357421875, + "train_loss": 0.43779428254411507, + "iterations": 82 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "exact_raw": { + "failure": 0.24507211538461537 + }, + "exact_calibrated": { + "failure": 0.24541766826923078, + "train_loss": 0.4551514021617466, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.24453125, + "train_loss": 0.4531701181347552, + "iterations": 87 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "exact_raw": { + "failure": 0.25402644230769234 + }, + "exact_calibrated": { + "failure": 0.2541316105769231, + "train_loss": 0.4629309494609537, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.25310997596153845, + "train_loss": 0.45978815429050657, + "iterations": 96 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "exact_raw": { + "failure": 0.24298377403846153 + }, + "exact_calibrated": { + "failure": 0.24182692307692308, + "train_loss": 0.4539302799880139, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.2408203125, + "train_loss": 0.45299183982324187, + "iterations": 100 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "exact_raw": { + "failure": 0.24226262019230768 + }, + "exact_calibrated": { + "failure": 0.24166165865384615, + "train_loss": 0.4465993958308988, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.24064002403846155, + "train_loss": 0.4446921891727968, + "iterations": 121 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "exact_raw": { + "failure": 0.23793569711538462 + }, + "exact_calibrated": { + "failure": 0.2377253605769231, + "train_loss": 0.43773570264641537, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.2367638221153846, + "train_loss": 0.4363258121838859, + "iterations": 103 + } + }, + "selected": "exact_ensemble" + } + ], + "numerical_check": "r01 all syndromes agrees with exhaustive enumeration to 1.2e-7" + }, + "experiment_3": { + "method": "Exact complementary CSS edge posterior marginals reweight joint error probabilities before relevant CSS exact contraction; induced correlations are factorized", + "initialization": { + "distribution": "Normal(0,0.01)", + "seed": 20261024, + "pretrained_weights": false + }, + "training": "4096 training shots sampled without replacement from each of all 26 d5 conditions, RNG seed 20261023; original matching components retain their all-training-shot fit", + "selection": "Minimum full-validation condition-mean failure per group among previous matching, raw conditional (strength 1), calibrated conditional, and learned combination of strengths 0/.5/1 with matching", + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "matching": { + "failure": 0.2616887019230769 + }, + "conditional_raw": { + "failure": 0.24053485576923078 + }, + "conditional_calibrated": { + "failure": 0.24064002403846155, + "train_loss": 0.4375296643032495, + "iterations": 8 + }, + "conditional_ensemble": { + "failure": 0.24024939903846154, + "train_loss": 0.43518462432711086, + "iterations": 107 + } + }, + "selected": "conditional_ensemble" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "matching": { + "failure": 0.2465294471153846 + }, + "conditional_raw": { + "failure": 0.229296875 + }, + "conditional_calibrated": { + "failure": 0.22944711538461537, + "train_loss": 0.42155058672043744, + "iterations": 9 + }, + "conditional_ensemble": { + "failure": 0.22627704326923076, + "train_loss": 0.4183033939719488, + "iterations": 150 + } + }, + "selected": "conditional_ensemble" + } + ], + "approximation": "Complementary-check conditioning induces error dependencies. This candidate uses their marginal probabilities independently; d5 contraction is therefore approximate." + }, + "contextual_d3_pilot": { + "training": { + "initialization": "Random variance-scaled normal first two layers, random Normal(0,.001) output; zero biases; seed 20261025", + "architecture": "Two 32-unit SiLU layers, output 2*tanh correction to original hyperedge logit; 40 local detection bits and 57 static error/geometry features", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 512, + "batch_size": 128, + "optimizer": "AdamW 1e-3, weight decay 1e-4, global gradient norm clip 1", + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 512, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.5264908075332642, + "error": 0.2578125, + "gradient_norm": 0.06699763983488083, + "elapsed": 432.866411447525 + }, + { + "step": 16, + "loss": 0.3703196942806244, + "error": 0.1484375, + "gradient_norm": 0.030896008014678955, + "elapsed": 437.98383259773254 + }, + { + "step": 32, + "loss": 0.5410848259925842, + "error": 0.3125, + "gradient_norm": 0.023287978023290634, + "elapsed": 443.36136960983276 + }, + { + "step": 48, + "loss": 0.6548658609390259, + "error": 0.3984375, + "gradient_norm": 0.08600008487701416, + "elapsed": 448.5753285884857 + }, + { + "step": 64, + "loss": 0.3396199345588684, + "error": 0.1875, + "gradient_norm": 0.09408964961767197, + "elapsed": 453.55865502357483 + }, + { + "step": 80, + "loss": 0.22403547167778015, + "error": 0.09375, + "gradient_norm": 0.11353142559528351, + "elapsed": 458.8852906227112 + }, + { + "step": 96, + "loss": 0.5754531621932983, + "error": 0.34375, + "gradient_norm": 0.10487920045852661, + "elapsed": 466.05401706695557 + }, + { + "step": 112, + "loss": 0.6411566734313965, + "error": 0.4609375, + "gradient_norm": 0.0897318571805954, + "elapsed": 472.25429010391235 + }, + { + "step": 128, + "loss": 0.4312451481819153, + "error": 0.1875, + "gradient_norm": 0.024307778105139732, + "elapsed": 477.15532541275024 + }, + { + "step": 144, + "loss": 0.18217915296554565, + "error": 0.0625, + "gradient_norm": 0.02471880242228508, + "elapsed": 481.5596089363098 + }, + { + "step": 160, + "loss": 0.3044101595878601, + "error": 0.140625, + "gradient_norm": 0.11279744654893875, + "elapsed": 485.47020196914673 + }, + { + "step": 176, + "loss": 0.6485109329223633, + "error": 0.421875, + "gradient_norm": 0.09296684712171555, + "elapsed": 489.5691695213318 + }, + { + "step": 192, + "loss": 0.2566836178302765, + "error": 0.09375, + "gradient_norm": 0.03372751921415329, + "elapsed": 493.5000331401825 + }, + { + "step": 208, + "loss": 0.5453524589538574, + "error": 0.296875, + "gradient_norm": 0.09404441714286804, + "elapsed": 497.62110686302185 + }, + { + "step": 224, + "loss": 0.19316628575325012, + "error": 0.0859375, + "gradient_norm": 0.03877737745642662, + "elapsed": 501.7119605541229 + }, + { + "step": 240, + "loss": 0.5537517070770264, + "error": 0.328125, + "gradient_norm": 0.030214278027415276, + "elapsed": 505.71154594421387 + }, + { + "step": 256, + "loss": 0.5224764347076416, + "error": 0.2734375, + "gradient_norm": 0.13780595362186432, + "elapsed": 509.65054631233215 + }, + { + "step": 272, + "loss": 0.5350009202957153, + "error": 0.3046875, + "gradient_norm": 0.08942794054746628, + "elapsed": 553.2619364261627 + }, + { + "step": 288, + "loss": 0.4561898112297058, + "error": 0.21875, + "gradient_norm": 0.02774384245276451, + "elapsed": 557.1897430419922 + }, + { + "step": 304, + "loss": 0.6102809309959412, + "error": 0.390625, + "gradient_norm": 0.04374801740050316, + "elapsed": 561.1394822597504 + }, + { + "step": 320, + "loss": 0.37536823749542236, + "error": 0.171875, + "gradient_norm": 0.10325513035058975, + "elapsed": 565.0790395736694 + }, + { + "step": 336, + "loss": 0.419940710067749, + "error": 0.2265625, + "gradient_norm": 0.04723379388451576, + "elapsed": 569.050211429596 + }, + { + "step": 352, + "loss": 0.6458156108856201, + "error": 0.4609375, + "gradient_norm": 0.04816316068172455, + "elapsed": 573.0114912986755 + }, + { + "step": 368, + "loss": 0.5628451108932495, + "error": 0.328125, + "gradient_norm": 0.09256711602210999, + "elapsed": 576.9429559707642 + }, + { + "step": 384, + "loss": 0.5773618221282959, + "error": 0.359375, + "gradient_norm": 0.16693103313446045, + "elapsed": 580.8791544437408 + }, + { + "step": 400, + "loss": 0.12261693179607391, + "error": 0.046875, + "gradient_norm": 0.06734084337949753, + "elapsed": 584.8116250038147 + }, + { + "step": 416, + "loss": 0.33368560671806335, + "error": 0.125, + "gradient_norm": 0.04156317561864853, + "elapsed": 588.7308163642883 + }, + { + "step": 432, + "loss": 0.2161063849925995, + "error": 0.109375, + "gradient_norm": 0.06895668804645538, + "elapsed": 592.6584475040436 + }, + { + "step": 448, + "loss": 0.6331151723861694, + "error": 0.3828125, + "gradient_norm": 0.12380247563123703, + "elapsed": 596.5997920036316 + }, + { + "step": 464, + "loss": 0.28776052594184875, + "error": 0.1484375, + "gradient_norm": 0.03920985758304596, + "elapsed": 600.5359675884247 + }, + { + "step": 480, + "loss": 0.639541745185852, + "error": 0.421875, + "gradient_norm": 0.029632505029439926, + "elapsed": 604.4547488689423 + }, + { + "step": 496, + "loss": 0.5919073820114136, + "error": 0.359375, + "gradient_norm": 0.11676646769046783, + "elapsed": 608.3825929164886 + }, + { + "step": 512, + "loss": 0.5479233264923096, + "error": 0.265625, + "gradient_norm": 0.03692208230495453, + "elapsed": 612.3190803527832 + } + ] + }, + "selection": "Per-group minimum failure among previous decoder and pilot steps 256 and 512, using all 532480 d3 validation shots", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "previous": 0.25226862980769227, + "256": 0.2515625, + "512": 0.2510216346153846 + }, + "selected": "512" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "previous": 0.2569711538461539, + "256": 0.2557542067307692, + "512": 0.256640625 + }, + "selected": "256" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "previous": 0.23574218750000003, + "256": 0.2356820913461538, + "512": 0.23511117788461539 + }, + "selected": "512" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "previous": 0.24453125000000003, + "256": 0.24275841346153845, + "512": 0.24224759615384617 + }, + "selected": "512" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "previous": 0.25310997596153845, + "256": 0.2524188701923077, + "512": 0.2513822115384615 + }, + "selected": "512" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "previous": 0.24082031250000002, + "256": 0.2387469951923077, + "512": 0.23933293269230768 + }, + "selected": "256" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "previous": 0.24064002403846155, + "256": 0.24053485576923073, + "512": 0.24002403846153844 + }, + "selected": "512" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "previous": 0.2367638221153846, + "256": 0.23635817307692306, + "512": 0.23584735576923077 + }, + "selected": "512" + } + ], + "initial_validation_subset": "First 512 validation rows/condition; then both trained checkpoints evaluated on full validation", + "features": "40 detection bits within five frames and 57 static error/geometry features; detector indices come from the ideal geometry/DEM; sample IDs are not features", + "derivative_check": "Relative error 1.16e-7 versus automatic differentiation on a small d3 example" + }, + "previous_package_validation": { + "performance": 0.7671762319711538, + "failure_by_distance": { + "d3": 0.2398212139423077, + "d5": 0.22582632211538461 + }, + "scorer": "Supplied qecbench.scoring on all 130 validation conditions and 665600 shots", + "contract_checks": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "shots": 1, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d3_r25_center_5_3", + "shots": 37, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d3_r13_center_5_7", + "shots": 1025, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 7, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 257, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 17, + "maximum_probability_difference": 0.0 + } + ], + "prediction_generation": "All26 d5 conditions replayed from the assembled package; unchanged d3 predictions retained. Full trusted scoring and relocated arbitrary-ID/subset checks.", + "runtime_evidence": "Full133120-shot d5 replay took 339.68s on one H100; d3 paths unchanged from the recorded incumbent.", + "d5_validation_runtime_seconds": 339.67785930633545, + "contract_execution": { + "requested_verifier_uid": 10001, + "effective_uid": 1000, + "effective_gid": 1000, + "supplementary_groups": [], + "identity_status": "Development process is already unprivileged and cannot change UID; verifier UID10001 was not executed", + "model_and_input_copy": "Owned by development UID 1000,directories0555,files0444,relocated under a fresh accessible temporary parent", + "output_directory": "Owned by execution UID 1000,mode0700", + "PYTHONPATH": "", + "backend": "Runtime default; full selected subset cases", + "scope": "Local contract check; not a Docker/network/mount-isolation test" + } + }, + "previous_model_manifest_sha256": "d8bed57d4619a87ad756d2347796e396b3169d4146f69ab426f99f9934ef1a8f", + "contextual_updates": [ + { + "name": "large512", + "training": { + "initialization": "This session's pilot checkpoint 512; original random initialization seed 20261025", + "run_config": { + "steps": 2048, + "batch": 2048, + "output": "/run-state/workspace/research/learned_exact/continuation1", + "validation_shots": 1024, + "init_weights": "/workspace/research/learned_exact/pilot/weights-512.npz", + "learning_rate": 0.001, + "eval_every": 512, + "seed": 20261028, + "validation_batch": 1024, + "uniform_validation": true, + "original_random_seed": 20261025, + "starting_checkpoint_sha256": "b14f7bf663b0484b9a79a759455ad09aca456f83a7cc29ed2e9e1d210683c180", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "validation_manifest_sha256": "482bb7268c6c827ebbf1f756ee6994750acfcd011adab08eaa2ada703e5faea1" + }, + "completed_checkpoint_steps": 512, + "new_sampled_training_shots": 1048576, + "optimizer": "AdamW 1e-3, weight decay 1e-4, global norm clip 1; optimizer reset at phase start", + "data": "Uniform sampling over all 104 d3 training conditions; training rows only", + "selection": "Checkpoint 512 evaluated on all 532480 d3 validation shots", + "full_validation_failure": 0.2428973858173077, + "termination": "Saved checkpoint 512, then stopped to restart with corrected validation NLL reporting. Any later in-flight updates were discarded.", + "reporting_correction": "Recomputed with float labels from the full checkpoint predictions; original in-flight diagnostic negated uint8 labels. Training loss and failure metrics were unaffected.", + "test_data_used": false + }, + "selection": "Minimum full validation mean failure per group between the incumbent and this trained checkpoint", + "history": [ + { + "group": "d3_bX_center_3_5", + "previous_failure": 0.2510216346153846, + "candidate_failure": 0.2491436298076923, + "selected_new": true + }, + { + "group": "d3_bX_center_5_3", + "previous_failure": 0.2557542067307692, + "candidate_failure": 0.256640625, + "selected_new": false + }, + { + "group": "d3_bX_center_5_7", + "previous_failure": 0.23511117788461539, + "candidate_failure": 0.23515625, + "selected_new": false + }, + { + "group": "d3_bX_center_7_5", + "previous_failure": 0.24224759615384617, + "candidate_failure": 0.2403996394230769, + "selected_new": true + }, + { + "group": "d3_bZ_center_3_5", + "previous_failure": 0.2513822115384615, + "candidate_failure": 0.24893329326923078, + "selected_new": true + }, + { + "group": "d3_bZ_center_5_3", + "previous_failure": 0.2387469951923077, + "candidate_failure": 0.23925781249999997, + "selected_new": false + }, + { + "group": "d3_bZ_center_5_7", + "previous_failure": 0.24002403846153844, + "candidate_failure": 0.23885216346153845, + "selected_new": true + }, + { + "group": "d3_bZ_center_7_5", + "previous_failure": 0.23584735576923077, + "candidate_failure": 0.23479567307692306, + "selected_new": true + }, + { + "group": "d5_bX_center_5_5", + "previous_failure": 0.24024939903846157, + "candidate_failure": 0.24024939903846157, + "selected_new": false + }, + { + "group": "d5_bZ_center_5_5", + "previous_failure": 0.22627704326923076, + "candidate_failure": 0.22627704326923076, + "selected_new": false + } + ], + "source_checkpoint_sha256": "7a7579b1bded95bcea7b1d26b2cf26de333c1a0f417fac6a0143eeb3a0c93aa2" + }, + { + "name": "continuation2", + "training_run": { + "initialization": "Continue from this session's trained checkpoint", + "original_initialization": "Random variance-scaled normal first two layers, random Normal(0,.001) output; zero biases; seed 20261025", + "architecture": "Two 32-unit SiLU layers, output 2*tanh correction to original hyperedge logit; 40 local detection bits and 57 static error/geometry features", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 1536, + "batch_size": 2048, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261028, + "optimizer_restored": true, + "rng_restored": true, + "session_trained_starting_checkpoint": "/workspace/research/learned_exact/continuation1/weights-512.npz", + "starting_checkpoint_sha256": "7a7579b1bded95bcea7b1d26b2cf26de333c1a0f417fac6a0143eeb3a0c93aa2", + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.05675870552659035, + "error": 0.0166015625, + "gradient_norm": 0.007466103881597519, + "elapsed": 30.636001586914062 + }, + { + "step": 16, + "loss": 0.44421544671058655, + "error": 0.22412109375, + "gradient_norm": 0.029868461191654205, + "elapsed": 35.424378871917725 + }, + { + "step": 32, + "loss": 0.46525052189826965, + "error": 0.23681640625, + "gradient_norm": 0.022205814719200134, + "elapsed": 40.526121854782104 + }, + { + "step": 48, + "loss": 0.6177924871444702, + "error": 0.3544921875, + "gradient_norm": 0.022866439074277878, + "elapsed": 45.67929220199585 + }, + { + "step": 64, + "loss": 0.5046484470367432, + "error": 0.2666015625, + "gradient_norm": 0.0222865492105484, + "elapsed": 50.80926203727722 + }, + { + "step": 80, + "loss": 0.638379693031311, + "error": 0.41064453125, + "gradient_norm": 0.012645655311644077, + "elapsed": 55.93321657180786 + }, + { + "step": 96, + "loss": 0.18619170784950256, + "error": 0.0732421875, + "gradient_norm": 0.012208878062665462, + "elapsed": 61.002137899398804 + }, + { + "step": 112, + "loss": 0.4269826412200928, + "error": 0.2109375, + "gradient_norm": 0.021279584616422653, + "elapsed": 66.13066720962524 + }, + { + "step": 128, + "loss": 0.47232550382614136, + "error": 0.25244140625, + "gradient_norm": 0.03405005484819412, + "elapsed": 85.5297167301178 + }, + { + "step": 144, + "loss": 0.2528073787689209, + "error": 0.11279296875, + "gradient_norm": 0.013145577162504196, + "elapsed": 90.68786001205444 + }, + { + "step": 160, + "loss": 0.5877531170845032, + "error": 0.35595703125, + "gradient_norm": 0.019021881744265556, + "elapsed": 95.76396131515503 + }, + { + "step": 176, + "loss": 0.45082807540893555, + "error": 0.2314453125, + "gradient_norm": 0.023904386907815933, + "elapsed": 100.9375216960907 + }, + { + "step": 192, + "loss": 0.4175146222114563, + "error": 0.19921875, + "gradient_norm": 0.021031895652413368, + "elapsed": 105.98947334289551 + }, + { + "step": 208, + "loss": 0.5424385070800781, + "error": 0.30078125, + "gradient_norm": 0.01396750845015049, + "elapsed": 111.17936706542969 + }, + { + "step": 224, + "loss": 0.29304587841033936, + "error": 0.1259765625, + "gradient_norm": 0.014725692570209503, + "elapsed": 116.36282753944397 + }, + { + "step": 240, + "loss": 0.056691475212574005, + "error": 0.015625, + "gradient_norm": 0.002859376836568117, + "elapsed": 121.54807162284851 + }, + { + "step": 256, + "loss": 0.17413178086280823, + "error": 0.06689453125, + "gradient_norm": 0.02666049636900425, + "elapsed": 126.718514919281 + }, + { + "step": 272, + "loss": 0.6115483641624451, + "error": 0.3466796875, + "gradient_norm": 0.03685307130217552, + "elapsed": 131.77990794181824 + }, + { + "step": 288, + "loss": 0.5973552465438843, + "error": 0.3349609375, + "gradient_norm": 0.02574622817337513, + "elapsed": 138.0202260017395 + }, + { + "step": 304, + "loss": 0.18595321476459503, + "error": 0.0732421875, + "gradient_norm": 0.012303492985665798, + "elapsed": 144.16412949562073 + }, + { + "step": 320, + "loss": 0.5418114066123962, + "error": 0.30126953125, + "gradient_norm": 0.018640751019120216, + "elapsed": 150.969500541687 + }, + { + "step": 336, + "loss": 0.5024716258049011, + "error": 0.26708984375, + "gradient_norm": 0.011490182019770145, + "elapsed": 158.32421374320984 + }, + { + "step": 352, + "loss": 0.5002061128616333, + "error": 0.255859375, + "gradient_norm": 0.03905056416988373, + "elapsed": 165.20316648483276 + }, + { + "step": 368, + "loss": 0.5892350077629089, + "error": 0.33837890625, + "gradient_norm": 0.046964384615421295, + "elapsed": 171.98852562904358 + }, + { + "step": 384, + "loss": 0.526427149772644, + "error": 0.2900390625, + "gradient_norm": 0.021478066220879555, + "elapsed": 178.02048754692078 + }, + { + "step": 400, + "loss": 0.5563177466392517, + "error": 0.306640625, + "gradient_norm": 0.024061864241957664, + "elapsed": 184.09671759605408 + }, + { + "step": 416, + "loss": 0.060019996017217636, + "error": 0.0205078125, + "gradient_norm": 0.006343841087073088, + "elapsed": 190.31260657310486 + }, + { + "step": 432, + "loss": 0.5484405755996704, + "error": 0.3115234375, + "gradient_norm": 0.020139696076512337, + "elapsed": 195.41702342033386 + }, + { + "step": 448, + "loss": 0.6163954138755798, + "error": 0.37646484375, + "gradient_norm": 0.011381164193153381, + "elapsed": 200.53582382202148 + }, + { + "step": 464, + "loss": 0.47678378224372864, + "error": 0.25927734375, + "gradient_norm": 0.03807748854160309, + "elapsed": 205.69636607170105 + }, + { + "step": 480, + "loss": 0.5176759362220764, + "error": 0.2705078125, + "gradient_norm": 0.017451826483011246, + "elapsed": 210.7581787109375 + }, + { + "step": 496, + "loss": 0.3626214563846588, + "error": 0.16455078125, + "gradient_norm": 0.019456032663583755, + "elapsed": 215.82069444656372 + }, + { + "step": 512, + "loss": 0.6202600598335266, + "error": 0.35302734375, + "gradient_norm": 0.013814727775752544, + "elapsed": 220.93863129615784 + }, + { + "step": 528, + "loss": 0.5610182285308838, + "error": 0.29833984375, + "gradient_norm": 0.03955027833580971, + "elapsed": 238.0407817363739 + }, + { + "step": 544, + "loss": 0.332148015499115, + "error": 0.15380859375, + "gradient_norm": 0.013710199855268002, + "elapsed": 243.12822461128235 + }, + { + "step": 560, + "loss": 0.4678276777267456, + "error": 0.23974609375, + "gradient_norm": 0.016155347228050232, + "elapsed": 248.3209776878357 + }, + { + "step": 576, + "loss": 0.6166238784790039, + "error": 0.3740234375, + "gradient_norm": 0.017382115125656128, + "elapsed": 253.49981307983398 + }, + { + "step": 592, + "loss": 0.6137416362762451, + "error": 0.373046875, + "gradient_norm": 0.007819767110049725, + "elapsed": 258.68269968032837 + }, + { + "step": 608, + "loss": 0.2780998647212982, + "error": 0.126953125, + "gradient_norm": 0.03436559438705444, + "elapsed": 263.82615661621094 + }, + { + "step": 624, + "loss": 0.6059691309928894, + "error": 0.3623046875, + "gradient_norm": 0.010842837393283844, + "elapsed": 268.9659583568573 + }, + { + "step": 640, + "loss": 0.058036163449287415, + "error": 0.02001953125, + "gradient_norm": 0.004723707213997841, + "elapsed": 274.09823632240295 + }, + { + "step": 656, + "loss": 0.6149133443832397, + "error": 0.37255859375, + "gradient_norm": 0.008533184416592121, + "elapsed": 279.26951336860657 + }, + { + "step": 672, + "loss": 0.3015868663787842, + "error": 0.1318359375, + "gradient_norm": 0.012536457739770412, + "elapsed": 284.41987442970276 + }, + { + "step": 688, + "loss": 0.16231489181518555, + "error": 0.06494140625, + "gradient_norm": 0.0067833056673407555, + "elapsed": 289.56297039985657 + }, + { + "step": 704, + "loss": 0.04929213970899582, + "error": 0.015625, + "gradient_norm": 0.005747381132096052, + "elapsed": 294.6839826107025 + }, + { + "step": 720, + "loss": 0.5615487098693848, + "error": 0.31689453125, + "gradient_norm": 0.02115021087229252, + "elapsed": 299.8546531200409 + }, + { + "step": 736, + "loss": 0.6306260228157043, + "error": 0.3759765625, + "gradient_norm": 0.02629203163087368, + "elapsed": 305.0923271179199 + }, + { + "step": 752, + "loss": 0.03828414902091026, + "error": 0.0126953125, + "gradient_norm": 0.008905005641281605, + "elapsed": 310.5417342185974 + }, + { + "step": 768, + "loss": 0.48764050006866455, + "error": 0.2626953125, + "gradient_norm": 0.024667929857969284, + "elapsed": 316.01200103759766 + }, + { + "step": 784, + "loss": 0.5836235284805298, + "error": 0.3505859375, + "gradient_norm": 0.023319393396377563, + "elapsed": 321.33294105529785 + }, + { + "step": 800, + "loss": 0.5693534016609192, + "error": 0.31396484375, + "gradient_norm": 0.048126742243766785, + "elapsed": 326.52227997779846 + }, + { + "step": 816, + "loss": 0.5710973739624023, + "error": 0.33349609375, + "gradient_norm": 0.022565416991710663, + "elapsed": 331.62225437164307 + }, + { + "step": 832, + "loss": 0.2818760275840759, + "error": 0.11865234375, + "gradient_norm": 0.025756066665053368, + "elapsed": 336.7874104976654 + }, + { + "step": 848, + "loss": 0.6127357482910156, + "error": 0.3583984375, + "gradient_norm": 0.020077377557754517, + "elapsed": 341.92783546447754 + }, + { + "step": 864, + "loss": 0.5109728574752808, + "error": 0.26171875, + "gradient_norm": 0.022484255954623222, + "elapsed": 347.0137662887573 + }, + { + "step": 880, + "loss": 0.16892661154270172, + "error": 0.06103515625, + "gradient_norm": 0.01363676693290472, + "elapsed": 352.0768094062805 + }, + { + "step": 896, + "loss": 0.593660831451416, + "error": 0.34423828125, + "gradient_norm": 0.01379447989165783, + "elapsed": 357.1796865463257 + }, + { + "step": 912, + "loss": 0.635499119758606, + "error": 0.39306640625, + "gradient_norm": 0.012278803624212742, + "elapsed": 362.29547691345215 + }, + { + "step": 928, + "loss": 0.3966389000415802, + "error": 0.19482421875, + "gradient_norm": 0.019856182858347893, + "elapsed": 367.3532474040985 + }, + { + "step": 944, + "loss": 0.05235423520207405, + "error": 0.01611328125, + "gradient_norm": 0.005415339022874832, + "elapsed": 372.4516806602478 + }, + { + "step": 960, + "loss": 0.5913074612617493, + "error": 0.3330078125, + "gradient_norm": 0.021171825006604195, + "elapsed": 377.5324194431305 + }, + { + "step": 976, + "loss": 0.6479356288909912, + "error": 0.41650390625, + "gradient_norm": 0.02845155820250511, + "elapsed": 382.5862877368927 + }, + { + "step": 992, + "loss": 0.5470497608184814, + "error": 0.30908203125, + "gradient_norm": 0.02726798877120018, + "elapsed": 387.6820628643036 + }, + { + "step": 1008, + "loss": 0.5729615688323975, + "error": 0.32861328125, + "gradient_norm": 0.011548872105777264, + "elapsed": 392.7741017341614 + }, + { + "step": 1024, + "loss": 0.0691118910908699, + "error": 0.0205078125, + "gradient_norm": 0.009204022586345673, + "elapsed": 397.8671176433563 + }, + { + "step": 1040, + "loss": 0.5171630382537842, + "error": 0.2685546875, + "gradient_norm": 0.015718232840299606, + "elapsed": 415.6616735458374 + }, + { + "step": 1056, + "loss": 0.6505192518234253, + "error": 0.39990234375, + "gradient_norm": 0.023937702178955078, + "elapsed": 420.7646098136902 + }, + { + "step": 1072, + "loss": 0.5660485625267029, + "error": 0.32666015625, + "gradient_norm": 0.026201115921139717, + "elapsed": 426.09313225746155 + }, + { + "step": 1088, + "loss": 0.4945259094238281, + "error": 0.25048828125, + "gradient_norm": 0.014495921321213245, + "elapsed": 431.2104251384735 + }, + { + "step": 1104, + "loss": 0.5695121884346008, + "error": 0.33837890625, + "gradient_norm": 0.029924258589744568, + "elapsed": 436.3099756240845 + }, + { + "step": 1120, + "loss": 0.3591366112232208, + "error": 0.16015625, + "gradient_norm": 0.017803259193897247, + "elapsed": 441.4024531841278 + }, + { + "step": 1136, + "loss": 0.3302019536495209, + "error": 0.1572265625, + "gradient_norm": 0.01632549799978733, + "elapsed": 446.55403757095337 + }, + { + "step": 1152, + "loss": 0.6093119382858276, + "error": 0.35107421875, + "gradient_norm": 0.014888457022607327, + "elapsed": 451.6241090297699 + }, + { + "step": 1168, + "loss": 0.3500004708766937, + "error": 0.1650390625, + "gradient_norm": 0.011492405086755753, + "elapsed": 456.7753965854645 + }, + { + "step": 1184, + "loss": 0.3738429844379425, + "error": 0.1845703125, + "gradient_norm": 0.015336514450609684, + "elapsed": 461.90868854522705 + }, + { + "step": 1200, + "loss": 0.2892451882362366, + "error": 0.12890625, + "gradient_norm": 0.010124214924871922, + "elapsed": 467.1151931285858 + }, + { + "step": 1216, + "loss": 0.45089617371559143, + "error": 0.23046875, + "gradient_norm": 0.03627275303006172, + "elapsed": 472.30455207824707 + }, + { + "step": 1232, + "loss": 0.6207081079483032, + "error": 0.36376953125, + "gradient_norm": 0.028164058923721313, + "elapsed": 477.4041998386383 + }, + { + "step": 1248, + "loss": 0.6022387742996216, + "error": 0.32470703125, + "gradient_norm": 0.05243176594376564, + "elapsed": 482.5445365905762 + }, + { + "step": 1264, + "loss": 0.6383136510848999, + "error": 0.38818359375, + "gradient_norm": 0.021598732098937035, + "elapsed": 488.21457719802856 + }, + { + "step": 1280, + "loss": 0.28611207008361816, + "error": 0.13037109375, + "gradient_norm": 0.010211448185145855, + "elapsed": 494.3161232471466 + }, + { + "step": 1296, + "loss": 0.5970274209976196, + "error": 0.35009765625, + "gradient_norm": 0.025076791644096375, + "elapsed": 500.2585813999176 + }, + { + "step": 1312, + "loss": 0.48383909463882446, + "error": 0.2529296875, + "gradient_norm": 0.02830139547586441, + "elapsed": 505.9930474758148 + }, + { + "step": 1328, + "loss": 0.6087884902954102, + "error": 0.365234375, + "gradient_norm": 0.01881619170308113, + "elapsed": 512.0680301189423 + }, + { + "step": 1344, + "loss": 0.49332645535469055, + "error": 0.25634765625, + "gradient_norm": 0.02215457707643509, + "elapsed": 517.9840953350067 + }, + { + "step": 1360, + "loss": 0.6202782392501831, + "error": 0.36767578125, + "gradient_norm": 0.018839120864868164, + "elapsed": 524.07217669487 + }, + { + "step": 1376, + "loss": 0.5857731699943542, + "error": 0.3330078125, + "gradient_norm": 0.015682006254792213, + "elapsed": 529.8370056152344 + }, + { + "step": 1392, + "loss": 0.52056485414505, + "error": 0.263671875, + "gradient_norm": 0.02431550808250904, + "elapsed": 535.9721219539642 + }, + { + "step": 1408, + "loss": 0.6433448791503906, + "error": 0.40625, + "gradient_norm": 0.016954610124230385, + "elapsed": 542.0041825771332 + }, + { + "step": 1424, + "loss": 0.6105660200119019, + "error": 0.35107421875, + "gradient_norm": 0.007737957406789064, + "elapsed": 547.4241607189178 + }, + { + "step": 1440, + "loss": 0.27237576246261597, + "error": 0.12451171875, + "gradient_norm": 0.01314462162554264, + "elapsed": 553.5436873435974 + }, + { + "step": 1456, + "loss": 0.5954712629318237, + "error": 0.3623046875, + "gradient_norm": 0.03746134042739868, + "elapsed": 558.7123465538025 + }, + { + "step": 1472, + "loss": 0.4519508481025696, + "error": 0.2255859375, + "gradient_norm": 0.010652865283191204, + "elapsed": 563.8585436344147 + }, + { + "step": 1488, + "loss": 0.41647869348526, + "error": 0.212890625, + "gradient_norm": 0.028575479984283447, + "elapsed": 569.0573513507843 + }, + { + "step": 1504, + "loss": 0.4384400248527527, + "error": 0.21337890625, + "gradient_norm": 0.017627721652388573, + "elapsed": 574.296462059021 + }, + { + "step": 1520, + "loss": 0.6105232238769531, + "error": 0.37109375, + "gradient_norm": 0.016302449628710747, + "elapsed": 579.4641361236572 + }, + { + "step": 1536, + "loss": 0.6215546131134033, + "error": 0.39013671875, + "gradient_norm": 0.032154034823179245, + "elapsed": 584.5684258937836 + } + ] + }, + "selected_checkpoint_steps": [ + 512, + 1024, + 1536 + ], + "checkpoint_records": { + "1536": { + "step": 1536, + "new_training_shots": 3145728, + "weights": "weights-1536.npz", + "weights_sha256": "785132032c12fa38abbb1103774d91b41828fdc5027e1fe4d42053476eb28199", + "validation": "validation-1536.json", + "complete": true + }, + "512": { + "step": 512, + "new_training_shots": 1048576, + "weights": "weights-512.npz", + "weights_sha256": "e9ebeb958eec680c5458b3a5c39aecf0a21c926aee816517b5f9d3bac5815d7f", + "validation": "validation-512.json", + "complete": true + }, + "1024": { + "step": 1024, + "new_training_shots": 2097152, + "weights": "weights-1024.npz", + "weights_sha256": "f45c568b13c92eb4e768146debbc8c50a8ad51882523938932ba26f4afde66f2", + "validation": "validation-1024.json", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.2491436298076923, + "512": 0.2478215144230769, + "1024": 0.24774639423076922, + "1536": 0.2476862980769231 + }, + "selected": "1536" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2557542067307692, + "512": 0.2544320913461538, + "1024": 0.2548527644230769, + "1536": 0.2545673076923076 + }, + "selected": "512" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.23511117788461539, + "512": 0.23602764423076927, + "1024": 0.23553185096153847, + "1536": 0.2345402644230769 + }, + "selected": "1536" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.2403996394230769, + "512": 0.23999399038461539, + "1024": 0.24008413461538464, + "1536": 0.2401141826923077 + }, + "selected": "512" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24893329326923078, + "512": 0.24894831730769235, + "1024": 0.24735576923076924, + "1536": 0.24664963942307694 + }, + "selected": "1536" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.2387469951923077, + "512": 0.23849158653846156, + "1024": 0.23789062500000002, + "1536": 0.2381610576923077 + }, + "selected": "1024" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.23885216346153845, + "512": 0.23807091346153844, + "1024": 0.2377704326923077, + "1536": 0.23733473557692303 + }, + "selected": "1536" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.23479567307692306, + "512": 0.2340895432692308, + "1024": 0.2340444711538461, + "1536": 0.23431490384615386 + }, + "selected": "1024" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.24024939903846157 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22627704326923076 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "rich1", + "training_run": { + "initialization": "Random initialization in this session", + "original_initialization": "Random variance-scaled normal first two layers, random Normal(0,.001) output; zero biases; seed 20261030", + "architecture": "Two 128-unit SiLU layers, output 4*tanh correction to original hyperedge logit; 40 local events, 40 reconstructed measurements, 8 per-stabilizer full-shot densities and 57 static features", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 1024, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261030, + "optimizer_restored": false, + "rng_restored": false, + "session_trained_starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.1747799664735794, + "error": 0.068359375, + "gradient_norm": 0.03163275867700577, + "elapsed": 30.666016340255737 + }, + { + "step": 16, + "loss": 0.5729950666427612, + "error": 0.30859375, + "gradient_norm": 0.03532477840781212, + "elapsed": 34.992138385772705 + }, + { + "step": 32, + "loss": 0.33759093284606934, + "error": 0.1435546875, + "gradient_norm": 0.03938521817326546, + "elapsed": 40.51379442214966 + }, + { + "step": 48, + "loss": 0.574704647064209, + "error": 0.3212890625, + "gradient_norm": 0.03584429249167442, + "elapsed": 46.82174754142761 + }, + { + "step": 64, + "loss": 0.6351712942123413, + "error": 0.4072265625, + "gradient_norm": 0.027485841885209084, + "elapsed": 52.75151348114014 + }, + { + "step": 80, + "loss": 0.36342084407806396, + "error": 0.1708984375, + "gradient_norm": 0.040388718247413635, + "elapsed": 58.42134428024292 + }, + { + "step": 96, + "loss": 0.613252580165863, + "error": 0.3525390625, + "gradient_norm": 0.035148631781339645, + "elapsed": 64.40935254096985 + }, + { + "step": 112, + "loss": 0.6042842864990234, + "error": 0.3564453125, + "gradient_norm": 0.06634438037872314, + "elapsed": 70.4053041934967 + }, + { + "step": 128, + "loss": 0.4366868734359741, + "error": 0.20703125, + "gradient_norm": 0.040233220905065536, + "elapsed": 76.10137701034546 + }, + { + "step": 144, + "loss": 0.340861976146698, + "error": 0.154296875, + "gradient_norm": 0.03881179168820381, + "elapsed": 81.10126686096191 + }, + { + "step": 160, + "loss": 0.5801218748092651, + "error": 0.32421875, + "gradient_norm": 0.06090407446026802, + "elapsed": 86.1252555847168 + }, + { + "step": 176, + "loss": 0.37582841515541077, + "error": 0.19140625, + "gradient_norm": 0.06935373693704605, + "elapsed": 91.53376078605652 + }, + { + "step": 192, + "loss": 0.5213879346847534, + "error": 0.291015625, + "gradient_norm": 0.038788966834545135, + "elapsed": 96.78960609436035 + }, + { + "step": 208, + "loss": 0.26441627740859985, + "error": 0.115234375, + "gradient_norm": 0.04845435172319412, + "elapsed": 101.85743975639343 + }, + { + "step": 224, + "loss": 0.4369240701198578, + "error": 0.2119140625, + "gradient_norm": 0.098305843770504, + "elapsed": 106.94148802757263 + }, + { + "step": 240, + "loss": 0.5520763397216797, + "error": 0.3037109375, + "gradient_norm": 0.04845161736011505, + "elapsed": 112.27297902107239 + }, + { + "step": 256, + "loss": 0.595374345779419, + "error": 0.3369140625, + "gradient_norm": 0.03840416297316551, + "elapsed": 117.4812536239624 + }, + { + "step": 272, + "loss": 0.2569020390510559, + "error": 0.103515625, + "gradient_norm": 0.050126779824495316, + "elapsed": 137.86142945289612 + }, + { + "step": 288, + "loss": 0.32830360531806946, + "error": 0.1455078125, + "gradient_norm": 0.035532038658857346, + "elapsed": 142.83670139312744 + }, + { + "step": 304, + "loss": 0.6040379405021667, + "error": 0.36328125, + "gradient_norm": 0.0313950814306736, + "elapsed": 148.05078554153442 + }, + { + "step": 320, + "loss": 0.35434311628341675, + "error": 0.1748046875, + "gradient_norm": 0.03184249624609947, + "elapsed": 153.22213292121887 + }, + { + "step": 336, + "loss": 0.2326659858226776, + "error": 0.099609375, + "gradient_norm": 0.06624855101108551, + "elapsed": 158.455664396286 + }, + { + "step": 352, + "loss": 0.06233043968677521, + "error": 0.017578125, + "gradient_norm": 0.02635284699499607, + "elapsed": 163.10541248321533 + }, + { + "step": 368, + "loss": 0.31427502632141113, + "error": 0.1435546875, + "gradient_norm": 0.04170582816004753, + "elapsed": 167.78928112983704 + }, + { + "step": 384, + "loss": 0.41268765926361084, + "error": 0.19921875, + "gradient_norm": 0.10103361308574677, + "elapsed": 172.34387755393982 + }, + { + "step": 400, + "loss": 0.42649346590042114, + "error": 0.2119140625, + "gradient_norm": 0.03481302782893181, + "elapsed": 176.83626103401184 + }, + { + "step": 416, + "loss": 0.6373635530471802, + "error": 0.4013671875, + "gradient_norm": 0.06979350745677948, + "elapsed": 181.35168766975403 + }, + { + "step": 432, + "loss": 0.17961856722831726, + "error": 0.072265625, + "gradient_norm": 0.018565824255347252, + "elapsed": 185.80416321754456 + }, + { + "step": 448, + "loss": 0.5501771569252014, + "error": 0.287109375, + "gradient_norm": 0.04828835278749466, + "elapsed": 190.30530858039856 + }, + { + "step": 464, + "loss": 0.5648394823074341, + "error": 0.2978515625, + "gradient_norm": 0.07398489862680435, + "elapsed": 194.7985327243805 + }, + { + "step": 480, + "loss": 0.5675262212753296, + "error": 0.3125, + "gradient_norm": 0.036255236715078354, + "elapsed": 199.30496096611023 + }, + { + "step": 496, + "loss": 0.6156162023544312, + "error": 0.3779296875, + "gradient_norm": 0.02318546548485756, + "elapsed": 203.8355917930603 + }, + { + "step": 512, + "loss": 0.0660151019692421, + "error": 0.021484375, + "gradient_norm": 0.020883027464151382, + "elapsed": 208.32652711868286 + }, + { + "step": 528, + "loss": 0.6096083521842957, + "error": 0.37890625, + "gradient_norm": 0.04742306470870972, + "elapsed": 225.1866319179535 + }, + { + "step": 544, + "loss": 0.3829265236854553, + "error": 0.18359375, + "gradient_norm": 0.05981605872511864, + "elapsed": 229.68251276016235 + }, + { + "step": 560, + "loss": 0.537099301815033, + "error": 0.2900390625, + "gradient_norm": 0.0949595719575882, + "elapsed": 234.20215129852295 + }, + { + "step": 576, + "loss": 0.5903713703155518, + "error": 0.3447265625, + "gradient_norm": 0.06430540233850479, + "elapsed": 238.70998644828796 + }, + { + "step": 592, + "loss": 0.5619152188301086, + "error": 0.298828125, + "gradient_norm": 0.03404757007956505, + "elapsed": 243.21307158470154 + }, + { + "step": 608, + "loss": 0.5997255444526672, + "error": 0.3623046875, + "gradient_norm": 0.03946321830153465, + "elapsed": 247.7153992652893 + }, + { + "step": 624, + "loss": 0.5695509910583496, + "error": 0.310546875, + "gradient_norm": 0.02815800905227661, + "elapsed": 252.3102250099182 + }, + { + "step": 640, + "loss": 0.5901973247528076, + "error": 0.34765625, + "gradient_norm": 0.04673359915614128, + "elapsed": 256.89224338531494 + }, + { + "step": 656, + "loss": 0.621924877166748, + "error": 0.37890625, + "gradient_norm": 0.04227908328175545, + "elapsed": 261.43869185447693 + }, + { + "step": 672, + "loss": 0.610299825668335, + "error": 0.35546875, + "gradient_norm": 0.036825064569711685, + "elapsed": 265.97225284576416 + }, + { + "step": 688, + "loss": 0.5249245166778564, + "error": 0.2841796875, + "gradient_norm": 0.0948338434100151, + "elapsed": 270.4997045993805 + }, + { + "step": 704, + "loss": 0.2573642134666443, + "error": 0.111328125, + "gradient_norm": 0.055987801402807236, + "elapsed": 275.0399034023285 + }, + { + "step": 720, + "loss": 0.04867870360612869, + "error": 0.0146484375, + "gradient_norm": 0.03132430091500282, + "elapsed": 279.55093908309937 + }, + { + "step": 736, + "loss": 0.24808242917060852, + "error": 0.1015625, + "gradient_norm": 0.051910530775785446, + "elapsed": 284.08127522468567 + }, + { + "step": 752, + "loss": 0.4981001615524292, + "error": 0.2529296875, + "gradient_norm": 0.06427812576293945, + "elapsed": 288.70672821998596 + }, + { + "step": 768, + "loss": 0.5241370797157288, + "error": 0.28125, + "gradient_norm": 0.10227487236261368, + "elapsed": 293.331086397171 + }, + { + "step": 784, + "loss": 0.6427845358848572, + "error": 0.400390625, + "gradient_norm": 0.08984753489494324, + "elapsed": 311.0226716995239 + }, + { + "step": 800, + "loss": 0.5990085601806641, + "error": 0.3544921875, + "gradient_norm": 0.08950027078390121, + "elapsed": 315.6725699901581 + }, + { + "step": 816, + "loss": 0.5930870771408081, + "error": 0.353515625, + "gradient_norm": 0.03096434287726879, + "elapsed": 320.38578844070435 + }, + { + "step": 832, + "loss": 0.5945324897766113, + "error": 0.359375, + "gradient_norm": 0.052297625690698624, + "elapsed": 325.3292770385742 + }, + { + "step": 848, + "loss": 0.6031227111816406, + "error": 0.3642578125, + "gradient_norm": 0.032976675778627396, + "elapsed": 330.2292652130127 + }, + { + "step": 864, + "loss": 0.3953525125980377, + "error": 0.1748046875, + "gradient_norm": 0.07015999406576157, + "elapsed": 335.1212799549103 + }, + { + "step": 880, + "loss": 0.4324202835559845, + "error": 0.2080078125, + "gradient_norm": 0.1018647849559784, + "elapsed": 339.9696366786957 + }, + { + "step": 896, + "loss": 0.5024446249008179, + "error": 0.265625, + "gradient_norm": 0.03973893076181412, + "elapsed": 344.8794775009155 + }, + { + "step": 912, + "loss": 0.5731178522109985, + "error": 0.33203125, + "gradient_norm": 0.047838907688856125, + "elapsed": 349.57729148864746 + }, + { + "step": 928, + "loss": 0.6279090642929077, + "error": 0.412109375, + "gradient_norm": 0.030738679692149162, + "elapsed": 354.4736604690552 + }, + { + "step": 944, + "loss": 0.6028326153755188, + "error": 0.341796875, + "gradient_norm": 0.04459983482956886, + "elapsed": 359.2764792442322 + }, + { + "step": 960, + "loss": 0.19082097709178925, + "error": 0.0791015625, + "gradient_norm": 0.02478513866662979, + "elapsed": 364.1252644062042 + }, + { + "step": 976, + "loss": 0.443341463804245, + "error": 0.2197265625, + "gradient_norm": 0.14411240816116333, + "elapsed": 368.8472623825073 + }, + { + "step": 992, + "loss": 0.5665505528450012, + "error": 0.3125, + "gradient_norm": 0.06498897075653076, + "elapsed": 373.6812598705292 + }, + { + "step": 1008, + "loss": 0.4306175112724304, + "error": 0.1875, + "gradient_norm": 0.04873151704668999, + "elapsed": 378.56014752388 + }, + { + "step": 1024, + "loss": 0.46258389949798584, + "error": 0.244140625, + "gradient_norm": 0.09452047199010849, + "elapsed": 383.46526074409485 + } + ] + }, + "selected_checkpoint_steps": [ + 1024 + ], + "checkpoint_records": { + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "weights": "weights-1024.npz", + "weights_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "validation": "validation-1024.json", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints; when listed, blend candidates average incumbent and new probabilities equally", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.2476862980769231, + "512": 0.24981971153846153, + "1024": 0.24861778846153845, + "blend-512": 0.24816706730769234, + "blend-1024": 0.24764122596153845 + }, + "selected": "blend-1024" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2544320913461538, + "512": 0.25530348557692306, + "1024": 0.2538461538461539, + "blend-512": 0.2550330528846154, + "blend-1024": 0.25369591346153847 + }, + "selected": "blend-1024" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.2345402644230769, + "512": 0.2346905048076923, + "1024": 0.23502103365384613, + "blend-512": 0.23520132211538458, + "blend-1024": 0.23484074519230771 + }, + "selected": "incumbent" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.23999399038461539, + "512": 0.24036959134615385, + "1024": 0.23987379807692305, + "blend-512": 0.240234375, + "blend-1024": 0.24008413461538464 + }, + "selected": "1024" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24664963942307694, + "512": 0.24878305288461539, + "1024": 0.24810697115384614, + "blend-512": 0.2468900240384615, + "blend-1024": 0.24661959134615385 + }, + "selected": "blend-1024" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.23789062500000002, + "512": 0.23919771634615386, + "1024": 0.23847656250000002, + "blend-512": 0.23802584134615382, + "blend-1024": 0.2378155048076923 + }, + "selected": "blend-1024" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.23733473557692303, + "512": 0.23939302884615382, + "1024": 0.2384465144230769, + "blend-512": 0.23829627403846151, + "blend-1024": 0.23727463942307694 + }, + "selected": "blend-1024" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.2340444711538461, + "512": 0.23482572115384615, + "1024": 0.23378906249999998, + "blend-512": 0.23434495192307692, + "blend-1024": 0.23345853365384614 + }, + "selected": "blend-1024" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.24024939903846157 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22627704326923076 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "temporal1", + "training_run": { + "initialization": "Continue from rich weights trained from random initialization in this session; new temporal parameters randomly initialized now", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 2048, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261111, + "optimizer_restored": false, + "rng_restored": false, + "session_trained_starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.6317505836486816, + "error": 0.3681640625, + "gradient_norm": 0.04013459011912346, + "elapsed": 30.971998691558838 + }, + { + "step": 16, + "loss": 0.5091081857681274, + "error": 0.291015625, + "gradient_norm": 0.042228709906339645, + "elapsed": 35.17463397979736 + }, + { + "step": 32, + "loss": 0.626472532749176, + "error": 0.3642578125, + "gradient_norm": 0.05872415751218796, + "elapsed": 39.678136110305786 + }, + { + "step": 48, + "loss": 0.6005369424819946, + "error": 0.3515625, + "gradient_norm": 0.03848014399409294, + "elapsed": 44.16946887969971 + }, + { + "step": 64, + "loss": 0.5523768663406372, + "error": 0.302734375, + "gradient_norm": 0.06031862646341324, + "elapsed": 48.65217089653015 + }, + { + "step": 80, + "loss": 0.3981674611568451, + "error": 0.19921875, + "gradient_norm": 0.0542079322040081, + "elapsed": 53.21601867675781 + }, + { + "step": 96, + "loss": 0.5601426362991333, + "error": 0.2978515625, + "gradient_norm": 0.04770371690392494, + "elapsed": 57.81089663505554 + }, + { + "step": 112, + "loss": 0.5878150463104248, + "error": 0.34765625, + "gradient_norm": 0.10699950158596039, + "elapsed": 62.42190766334534 + }, + { + "step": 128, + "loss": 0.5232458114624023, + "error": 0.2861328125, + "gradient_norm": 0.0911584198474884, + "elapsed": 67.00223755836487 + }, + { + "step": 144, + "loss": 0.6119767427444458, + "error": 0.3623046875, + "gradient_norm": 0.062474437057971954, + "elapsed": 71.54070782661438 + }, + { + "step": 160, + "loss": 0.3037984371185303, + "error": 0.1474609375, + "gradient_norm": 0.05718141421675682, + "elapsed": 76.08167362213135 + }, + { + "step": 176, + "loss": 0.6038273572921753, + "error": 0.3662109375, + "gradient_norm": 0.0437164381146431, + "elapsed": 80.71864247322083 + }, + { + "step": 192, + "loss": 0.3304370641708374, + "error": 0.1572265625, + "gradient_norm": 0.05684761330485344, + "elapsed": 85.54437017440796 + }, + { + "step": 208, + "loss": 0.5785484313964844, + "error": 0.3251953125, + "gradient_norm": 0.09597272425889969, + "elapsed": 91.51522874832153 + }, + { + "step": 224, + "loss": 0.3110499978065491, + "error": 0.13671875, + "gradient_norm": 0.04815748706459999, + "elapsed": 97.1228940486908 + }, + { + "step": 240, + "loss": 0.6213864684104919, + "error": 0.3623046875, + "gradient_norm": 0.0540502592921257, + "elapsed": 102.90286135673523 + }, + { + "step": 256, + "loss": 0.2535272240638733, + "error": 0.1064453125, + "gradient_norm": 0.029962118715047836, + "elapsed": 108.39288640022278 + }, + { + "step": 272, + "loss": 0.6126939058303833, + "error": 0.3671875, + "gradient_norm": 0.06887879222631454, + "elapsed": 113.83897161483765 + }, + { + "step": 288, + "loss": 0.4556676149368286, + "error": 0.2236328125, + "gradient_norm": 0.16127081215381622, + "elapsed": 119.93085813522339 + }, + { + "step": 304, + "loss": 0.4973585605621338, + "error": 0.255859375, + "gradient_norm": 0.08082302659749985, + "elapsed": 125.90891909599304 + }, + { + "step": 320, + "loss": 0.6455868482589722, + "error": 0.419921875, + "gradient_norm": 0.04339660331606865, + "elapsed": 131.20537638664246 + }, + { + "step": 336, + "loss": 0.5343132615089417, + "error": 0.2880859375, + "gradient_norm": 0.07518009096384048, + "elapsed": 136.59086871147156 + }, + { + "step": 352, + "loss": 0.6505346894264221, + "error": 0.4033203125, + "gradient_norm": 0.03800992667675018, + "elapsed": 142.21085906028748 + }, + { + "step": 368, + "loss": 0.4882712960243225, + "error": 0.251953125, + "gradient_norm": 0.08170920610427856, + "elapsed": 146.95903658866882 + }, + { + "step": 384, + "loss": 0.5292021036148071, + "error": 0.296875, + "gradient_norm": 0.08454013615846634, + "elapsed": 151.6385259628296 + }, + { + "step": 400, + "loss": 0.6272899508476257, + "error": 0.3837890625, + "gradient_norm": 0.051436979323625565, + "elapsed": 156.3343904018402 + }, + { + "step": 416, + "loss": 0.052130259573459625, + "error": 0.0166015625, + "gradient_norm": 0.02377190627157688, + "elapsed": 160.92345547676086 + }, + { + "step": 432, + "loss": 0.5256737470626831, + "error": 0.3046875, + "gradient_norm": 0.07986386120319366, + "elapsed": 165.52879118919373 + }, + { + "step": 448, + "loss": 0.15193665027618408, + "error": 0.0576171875, + "gradient_norm": 0.06491660326719284, + "elapsed": 170.14827823638916 + }, + { + "step": 464, + "loss": 0.6418055295944214, + "error": 0.40625, + "gradient_norm": 0.07290885597467422, + "elapsed": 174.64974284172058 + }, + { + "step": 480, + "loss": 0.6055159568786621, + "error": 0.357421875, + "gradient_norm": 0.0795595794916153, + "elapsed": 179.17218685150146 + }, + { + "step": 496, + "loss": 0.6372283697128296, + "error": 0.3916015625, + "gradient_norm": 0.04387903958559036, + "elapsed": 183.77568197250366 + }, + { + "step": 512, + "loss": 0.637977123260498, + "error": 0.408203125, + "gradient_norm": 0.060665905475616455, + "elapsed": 188.31205368041992 + }, + { + "step": 528, + "loss": 0.4668862223625183, + "error": 0.2451171875, + "gradient_norm": 0.08566711097955704, + "elapsed": 206.40719985961914 + }, + { + "step": 544, + "loss": 0.4584413170814514, + "error": 0.244140625, + "gradient_norm": 0.08538200706243515, + "elapsed": 211.02819895744324 + }, + { + "step": 560, + "loss": 0.5615692138671875, + "error": 0.3291015625, + "gradient_norm": 0.043748609721660614, + "elapsed": 215.66470766067505 + }, + { + "step": 576, + "loss": 0.5151895880699158, + "error": 0.2880859375, + "gradient_norm": 0.05164863541722298, + "elapsed": 220.18949556350708 + }, + { + "step": 592, + "loss": 0.5618112087249756, + "error": 0.3291015625, + "gradient_norm": 0.05998719856142998, + "elapsed": 224.7216100692749 + }, + { + "step": 608, + "loss": 0.659294843673706, + "error": 0.431640625, + "gradient_norm": 0.09910348802804947, + "elapsed": 229.26827573776245 + }, + { + "step": 624, + "loss": 0.5895233154296875, + "error": 0.3447265625, + "gradient_norm": 0.045334093272686005, + "elapsed": 233.83731055259705 + }, + { + "step": 640, + "loss": 0.6081801056861877, + "error": 0.3388671875, + "gradient_norm": 0.06578423827886581, + "elapsed": 238.36345624923706 + }, + { + "step": 656, + "loss": 0.5349816083908081, + "error": 0.2939453125, + "gradient_norm": 0.09989562630653381, + "elapsed": 242.95086026191711 + }, + { + "step": 672, + "loss": 0.5871994495391846, + "error": 0.328125, + "gradient_norm": 0.08132346719503403, + "elapsed": 247.67088556289673 + }, + { + "step": 688, + "loss": 0.06012660637497902, + "error": 0.0146484375, + "gradient_norm": 0.012170507572591305, + "elapsed": 252.3202247619629 + }, + { + "step": 704, + "loss": 0.42179757356643677, + "error": 0.21484375, + "gradient_norm": 0.08384513854980469, + "elapsed": 256.91991782188416 + }, + { + "step": 720, + "loss": 0.6111758947372437, + "error": 0.3720703125, + "gradient_norm": 0.06689880788326263, + "elapsed": 261.56407928466797 + }, + { + "step": 736, + "loss": 0.29969727993011475, + "error": 0.1318359375, + "gradient_norm": 0.0743367150425911, + "elapsed": 266.22199630737305 + }, + { + "step": 752, + "loss": 0.051849883049726486, + "error": 0.0166015625, + "gradient_norm": 0.017005126923322678, + "elapsed": 270.8602342605591 + }, + { + "step": 768, + "loss": 0.6178420186042786, + "error": 0.3759765625, + "gradient_norm": 0.027732960879802704, + "elapsed": 275.47888374328613 + }, + { + "step": 784, + "loss": 0.45798996090888977, + "error": 0.228515625, + "gradient_norm": 0.0630083829164505, + "elapsed": 280.1709156036377 + }, + { + "step": 800, + "loss": 0.5104988813400269, + "error": 0.2724609375, + "gradient_norm": 0.041733670979738235, + "elapsed": 286.17937707901 + }, + { + "step": 816, + "loss": 0.6336112022399902, + "error": 0.3837890625, + "gradient_norm": 0.0755191296339035, + "elapsed": 291.7506103515625 + }, + { + "step": 832, + "loss": 0.6260952353477478, + "error": 0.3603515625, + "gradient_norm": 0.0318005345761776, + "elapsed": 297.31094622612 + }, + { + "step": 848, + "loss": 0.5870074033737183, + "error": 0.3525390625, + "gradient_norm": 0.12073405832052231, + "elapsed": 303.11089158058167 + }, + { + "step": 864, + "loss": 0.5125640034675598, + "error": 0.26953125, + "gradient_norm": 0.038650237023830414, + "elapsed": 308.7288725376129 + }, + { + "step": 880, + "loss": 0.19194915890693665, + "error": 0.0703125, + "gradient_norm": 0.061878547072410583, + "elapsed": 314.37042355537415 + }, + { + "step": 896, + "loss": 0.5409250259399414, + "error": 0.2919921875, + "gradient_norm": 0.06288820505142212, + "elapsed": 319.9398190975189 + }, + { + "step": 912, + "loss": 0.6164936423301697, + "error": 0.3701171875, + "gradient_norm": 0.043224163353443146, + "elapsed": 325.361323595047 + }, + { + "step": 928, + "loss": 0.16032151877880096, + "error": 0.0625, + "gradient_norm": 0.030957572162151337, + "elapsed": 331.21752285957336 + }, + { + "step": 944, + "loss": 0.646601676940918, + "error": 0.3818359375, + "gradient_norm": 0.05670839175581932, + "elapsed": 336.7825517654419 + }, + { + "step": 960, + "loss": 0.402952641248703, + "error": 0.1865234375, + "gradient_norm": 0.07500886172056198, + "elapsed": 342.6888346672058 + }, + { + "step": 976, + "loss": 0.5537433624267578, + "error": 0.2939453125, + "gradient_norm": 0.04955969750881195, + "elapsed": 348.5554690361023 + }, + { + "step": 992, + "loss": 0.559626579284668, + "error": 0.294921875, + "gradient_norm": 0.048295993357896805, + "elapsed": 354.3531894683838 + }, + { + "step": 1008, + "loss": 0.5034694671630859, + "error": 0.2705078125, + "gradient_norm": 0.05729879066348076, + "elapsed": 360.0949149131775 + }, + { + "step": 1024, + "loss": 0.3119734525680542, + "error": 0.1259765625, + "gradient_norm": 0.052326612174510956, + "elapsed": 365.7881224155426 + }, + { + "step": 1040, + "loss": 0.35799849033355713, + "error": 0.173828125, + "gradient_norm": 0.03801804035902023, + "elapsed": 386.5749418735504 + }, + { + "step": 1056, + "loss": 0.6178948879241943, + "error": 0.3515625, + "gradient_norm": 0.03620661422610283, + "elapsed": 391.48247838020325 + }, + { + "step": 1072, + "loss": 0.49231401085853577, + "error": 0.24609375, + "gradient_norm": 0.04391559213399887, + "elapsed": 396.08718824386597 + }, + { + "step": 1088, + "loss": 0.4119300842285156, + "error": 0.2001953125, + "gradient_norm": 0.1104700043797493, + "elapsed": 400.5326828956604 + }, + { + "step": 1104, + "loss": 0.4926626682281494, + "error": 0.265625, + "gradient_norm": 0.04246886447072029, + "elapsed": 404.95741271972656 + }, + { + "step": 1120, + "loss": 0.5027930736541748, + "error": 0.2607421875, + "gradient_norm": 0.0547240674495697, + "elapsed": 409.40319633483887 + }, + { + "step": 1136, + "loss": 0.5948058366775513, + "error": 0.3544921875, + "gradient_norm": 0.06810063123703003, + "elapsed": 413.8514006137848 + }, + { + "step": 1152, + "loss": 0.26567256450653076, + "error": 0.125, + "gradient_norm": 0.06689104437828064, + "elapsed": 418.29868721961975 + }, + { + "step": 1168, + "loss": 0.2866836190223694, + "error": 0.1240234375, + "gradient_norm": 0.029536213725805283, + "elapsed": 422.75131845474243 + }, + { + "step": 1184, + "loss": 0.6342021822929382, + "error": 0.4091796875, + "gradient_norm": 0.0704190731048584, + "elapsed": 427.1991722583771 + }, + { + "step": 1200, + "loss": 0.41626787185668945, + "error": 0.212890625, + "gradient_norm": 0.04480795934796333, + "elapsed": 431.6600706577301 + }, + { + "step": 1216, + "loss": 0.28460952639579773, + "error": 0.1337890625, + "gradient_norm": 0.03666983172297478, + "elapsed": 436.14414525032043 + }, + { + "step": 1232, + "loss": 0.044482216238975525, + "error": 0.0146484375, + "gradient_norm": 0.04537617415189743, + "elapsed": 440.6220428943634 + }, + { + "step": 1248, + "loss": 0.42564862966537476, + "error": 0.2119140625, + "gradient_norm": 0.03382417559623718, + "elapsed": 445.06736421585083 + }, + { + "step": 1264, + "loss": 0.27150213718414307, + "error": 0.123046875, + "gradient_norm": 0.033046118915081024, + "elapsed": 449.544029712677 + }, + { + "step": 1280, + "loss": 0.4927375912666321, + "error": 0.255859375, + "gradient_norm": 0.06812550127506256, + "elapsed": 454.07198667526245 + }, + { + "step": 1296, + "loss": 0.5541940927505493, + "error": 0.28125, + "gradient_norm": 0.1435294896364212, + "elapsed": 458.6031415462494 + }, + { + "step": 1312, + "loss": 0.5575842261314392, + "error": 0.2958984375, + "gradient_norm": 0.03811952844262123, + "elapsed": 463.1806228160858 + }, + { + "step": 1328, + "loss": 0.3479428291320801, + "error": 0.1591796875, + "gradient_norm": 0.0709012895822525, + "elapsed": 467.84689688682556 + }, + { + "step": 1344, + "loss": 0.1685580611228943, + "error": 0.0693359375, + "gradient_norm": 0.05423415079712868, + "elapsed": 472.6908576488495 + }, + { + "step": 1360, + "loss": 0.18506410717964172, + "error": 0.0771484375, + "gradient_norm": 0.03418596833944321, + "elapsed": 477.4269769191742 + }, + { + "step": 1376, + "loss": 0.5654555559158325, + "error": 0.3173828125, + "gradient_norm": 0.0685155838727951, + "elapsed": 482.08285188674927 + }, + { + "step": 1392, + "loss": 0.6116407513618469, + "error": 0.3603515625, + "gradient_norm": 0.05198948457837105, + "elapsed": 486.7167499065399 + }, + { + "step": 1408, + "loss": 0.4014682471752167, + "error": 0.19140625, + "gradient_norm": 0.1024075523018837, + "elapsed": 491.4308760166168 + }, + { + "step": 1424, + "loss": 0.051035866141319275, + "error": 0.0166015625, + "gradient_norm": 0.010207361541688442, + "elapsed": 496.1818380355835 + }, + { + "step": 1440, + "loss": 0.4725648760795593, + "error": 0.2412109375, + "gradient_norm": 0.03977378085255623, + "elapsed": 500.8668632507324 + }, + { + "step": 1456, + "loss": 0.5407818555831909, + "error": 0.2939453125, + "gradient_norm": 0.088577501475811, + "elapsed": 505.49274134635925 + }, + { + "step": 1472, + "loss": 0.5655064582824707, + "error": 0.3076171875, + "gradient_norm": 0.04452778398990631, + "elapsed": 510.2188584804535 + }, + { + "step": 1488, + "loss": 0.5799556374549866, + "error": 0.30859375, + "gradient_norm": 0.03976206108927727, + "elapsed": 514.9319434165955 + }, + { + "step": 1504, + "loss": 0.4660354256629944, + "error": 0.25390625, + "gradient_norm": 0.04365506023168564, + "elapsed": 519.5848798751831 + }, + { + "step": 1520, + "loss": 0.5505894422531128, + "error": 0.30859375, + "gradient_norm": 0.057772211730480194, + "elapsed": 524.3388590812683 + }, + { + "step": 1536, + "loss": 0.6251416206359863, + "error": 0.400390625, + "gradient_norm": 0.09649194777011871, + "elapsed": 529.483047246933 + }, + { + "step": 1552, + "loss": 0.05424533039331436, + "error": 0.0185546875, + "gradient_norm": 0.011683990247547626, + "elapsed": 548.1828610897064 + }, + { + "step": 1568, + "loss": 0.33612310886383057, + "error": 0.1611328125, + "gradient_norm": 0.051817383617162704, + "elapsed": 553.4256420135498 + }, + { + "step": 1584, + "loss": 0.045015305280685425, + "error": 0.0166015625, + "gradient_norm": 0.022604886442422867, + "elapsed": 558.6308543682098 + }, + { + "step": 1600, + "loss": 0.2701840102672577, + "error": 0.119140625, + "gradient_norm": 0.02910422720015049, + "elapsed": 563.8571691513062 + }, + { + "step": 1616, + "loss": 0.18982334434986115, + "error": 0.0849609375, + "gradient_norm": 0.025524422526359558, + "elapsed": 568.8628678321838 + }, + { + "step": 1632, + "loss": 0.3950161337852478, + "error": 0.185546875, + "gradient_norm": 0.08419577777385712, + "elapsed": 574.0815451145172 + }, + { + "step": 1648, + "loss": 0.49384528398513794, + "error": 0.255859375, + "gradient_norm": 0.08879344165325165, + "elapsed": 579.1229114532471 + }, + { + "step": 1664, + "loss": 0.5671384930610657, + "error": 0.3115234375, + "gradient_norm": 0.05374513566493988, + "elapsed": 584.114851474762 + }, + { + "step": 1680, + "loss": 0.6192574501037598, + "error": 0.37890625, + "gradient_norm": 0.043836336582899094, + "elapsed": 589.0708522796631 + }, + { + "step": 1696, + "loss": 0.2619469463825226, + "error": 0.1171875, + "gradient_norm": 0.040093280375003815, + "elapsed": 594.2814819812775 + }, + { + "step": 1712, + "loss": 0.33178141713142395, + "error": 0.162109375, + "gradient_norm": 0.04902712255716324, + "elapsed": 599.3068840503693 + }, + { + "step": 1728, + "loss": 0.385281503200531, + "error": 0.171875, + "gradient_norm": 0.03541380167007446, + "elapsed": 604.5308682918549 + }, + { + "step": 1744, + "loss": 0.1628715693950653, + "error": 0.0693359375, + "gradient_norm": 0.06111741065979004, + "elapsed": 609.309522151947 + }, + { + "step": 1760, + "loss": 0.5239119529724121, + "error": 0.2861328125, + "gradient_norm": 0.08513613045215607, + "elapsed": 614.0396001338959 + }, + { + "step": 1776, + "loss": 0.35721707344055176, + "error": 0.150390625, + "gradient_norm": 0.06337940692901611, + "elapsed": 618.6857132911682 + }, + { + "step": 1792, + "loss": 0.5985626578330994, + "error": 0.33203125, + "gradient_norm": 0.035725343972444534, + "elapsed": 623.3352344036102 + }, + { + "step": 1808, + "loss": 0.34676820039749146, + "error": 0.15234375, + "gradient_norm": 0.08163885772228241, + "elapsed": 627.9495220184326 + }, + { + "step": 1824, + "loss": 0.5633711814880371, + "error": 0.3037109375, + "gradient_norm": 0.05938677117228508, + "elapsed": 632.5820379257202 + }, + { + "step": 1840, + "loss": 0.6256523132324219, + "error": 0.384765625, + "gradient_norm": 0.04545137286186218, + "elapsed": 637.205274105072 + }, + { + "step": 1856, + "loss": 0.28091639280319214, + "error": 0.1298828125, + "gradient_norm": 0.04705077037215233, + "elapsed": 641.883561372757 + }, + { + "step": 1872, + "loss": 0.516182541847229, + "error": 0.263671875, + "gradient_norm": 0.08828777819871902, + "elapsed": 646.5188939571381 + }, + { + "step": 1888, + "loss": 0.48386621475219727, + "error": 0.25390625, + "gradient_norm": 0.05322824418544769, + "elapsed": 651.148512840271 + }, + { + "step": 1904, + "loss": 0.6141921281814575, + "error": 0.388671875, + "gradient_norm": 0.050139278173446655, + "elapsed": 655.7796437740326 + }, + { + "step": 1920, + "loss": 0.18002840876579285, + "error": 0.0712890625, + "gradient_norm": 0.04201133921742439, + "elapsed": 660.4064948558807 + }, + { + "step": 1936, + "loss": 0.17531852424144745, + "error": 0.0732421875, + "gradient_norm": 0.024726318195462227, + "elapsed": 664.9991583824158 + }, + { + "step": 1952, + "loss": 0.5088322758674622, + "error": 0.2744140625, + "gradient_norm": 0.04693225398659706, + "elapsed": 669.5544555187225 + }, + { + "step": 1968, + "loss": 0.5684165358543396, + "error": 0.3310546875, + "gradient_norm": 0.031029095873236656, + "elapsed": 674.2354445457458 + }, + { + "step": 1984, + "loss": 0.06459524482488632, + "error": 0.017578125, + "gradient_norm": 0.03600892797112465, + "elapsed": 678.7982559204102 + }, + { + "step": 2000, + "loss": 0.3614455461502075, + "error": 0.1748046875, + "gradient_norm": 0.07060294598340988, + "elapsed": 683.2650325298309 + }, + { + "step": 2016, + "loss": 0.35535523295402527, + "error": 0.166015625, + "gradient_norm": 0.05873403698205948, + "elapsed": 687.7125518321991 + }, + { + "step": 2032, + "loss": 0.5638720989227295, + "error": 0.3232421875, + "gradient_norm": 0.07380504906177521, + "elapsed": 692.1461188793182 + }, + { + "step": 2048, + "loss": 0.5301838517189026, + "error": 0.2919921875, + "gradient_norm": 0.05435395985841751, + "elapsed": 696.6235508918762 + } + ] + }, + "selected_checkpoint_steps": [ + 1024, + 1536, + 2048 + ], + "checkpoint_records": { + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "weights": "weights-2048.npz", + "weights_sha256": "26be9e0259b69a5870bf73e80a5a29fcf3519a3ff63e1d219c57a2113d9d34be", + "validation": "validation-2048.json", + "complete": true + }, + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "weights": "weights-1024.npz", + "weights_sha256": "6ab63cf2443420bfa5f2a817a90432dfc969348a8b23b0e6ccf3ffad3c381672", + "validation": "validation-1024.json", + "complete": true + }, + "1536": { + "step": 1536, + "new_training_shots": 1572864, + "weights": "weights-1536.npz", + "weights_sha256": "a4c6152c3b8f2f8ab8cdda41e92045ebc7eb944f9931a7937bf49c404bf96668", + "validation": "validation-1536.json", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints; when listed, blend candidates average the recorded small-contextual reference and new probabilities equally", + "blend_reference": "/run-state/workspace/research/context_upgrades/continuation2/predictions", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.24764122596153845, + "512": 0.24836237980769232, + "1024": 0.24783653846153847, + "1536": 0.24682992788461539, + "2048": 0.246875, + "blend-512": 0.24767127403846154, + "blend-1024": 0.24747596153846155, + "blend-1536": 0.24684495192307693, + "blend-2048": 0.24672475961538465 + }, + "selected": "blend-2048" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.25369591346153847, + "512": 0.25387620192307697, + "1024": 0.25365084134615384, + "1536": 0.25392127403846154, + "2048": 0.2531550480769231, + "blend-512": 0.25429687500000003, + "blend-1024": 0.25419170673076924, + "blend-1536": 0.25338040865384615, + "blend-2048": 0.2532301682692308 + }, + "selected": "2048" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.2345402644230769, + "512": 0.23535156250000003, + "1024": 0.23467548076923078, + "1536": 0.23575721153846152, + "2048": 0.23529146634615386, + "blend-512": 0.23494591346153842, + "blend-1024": 0.2351862980769231, + "blend-1536": 0.23535156249999997, + "blend-2048": 0.23446514423076925 + }, + "selected": "blend-2048" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.23987379807692305, + "512": 0.2393028846153846, + "1024": 0.2391676682692308, + "1536": 0.2397686298076923, + "2048": 0.23969350961538463, + "blend-512": 0.23972355769230771, + "blend-1024": 0.23967848557692312, + "blend-1536": 0.24044471153846153, + "blend-2048": 0.24048978365384613 + }, + "selected": "1024" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24661959134615385, + "512": 0.24767127403846156, + "1024": 0.24747596153846155, + "1536": 0.24658954326923077, + "2048": 0.2467397836538462, + "blend-512": 0.24634915865384613, + "blend-1024": 0.24684495192307693, + "blend-1536": 0.24640925480769232, + "blend-2048": 0.24625901442307693 + }, + "selected": "blend-2048" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.2378155048076923, + "512": 0.23912259615384615, + "1024": 0.23805588942307693, + "1536": 0.2381610576923077, + "2048": 0.2376802884615385, + "blend-512": 0.2378155048076923, + "blend-1024": 0.23765024038461538, + "blend-1536": 0.23783052884615388, + "blend-2048": 0.23760516826923078 + }, + "selected": "blend-2048" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.23727463942307694, + "512": 0.23766526442307695, + "1024": 0.23789062500000005, + "1536": 0.23713942307692307, + "2048": 0.23778545673076923, + "blend-512": 0.2376201923076923, + "blend-1024": 0.23743990384615382, + "blend-1536": 0.2375, + "blend-2048": 0.2376201923076923 + }, + "selected": "1536" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.23345853365384614, + "512": 0.2344200721153846, + "1024": 0.23431490384615386, + "1536": 0.23435997596153843, + "2048": 0.23390925480769229, + "blend-512": 0.23448016826923074, + "blend-1024": 0.2340895432692308, + "blend-1536": 0.23360877403846156, + "blend-2048": 0.2338792067307692 + }, + "selected": "incumbent" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2338341346153846 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22182992788461542 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "temporal2", + "training_run": { + "initialization": "Continue from this session's trained checkpoint", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "training_source_sha256": { + "learned_exact__temporal_train.py": "7d48d2fc7f62d0bec3023b3df1c2ac28537d0417966131ae3a156697a34cda5f", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "eligible_training_shots": 2067520, + "unique_training_rows_seen_in_this_phase": 1778773, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 18357, + "surface_code_bX_d3_r03_center_3_5": 16816, + "surface_code_bX_d3_r05_center_3_5": 17999, + "surface_code_bX_d3_r07_center_3_5": 15225, + "surface_code_bX_d3_r09_center_3_5": 16132, + "surface_code_bX_d3_r11_center_3_5": 17041, + "surface_code_bX_d3_r13_center_3_5": 18477, + "surface_code_bX_d3_r15_center_3_5": 18214, + "surface_code_bX_d3_r17_center_3_5": 16505, + "surface_code_bX_d3_r19_center_3_5": 17120, + "surface_code_bX_d3_r21_center_3_5": 17563, + "surface_code_bX_d3_r23_center_3_5": 16681, + "surface_code_bX_d3_r25_center_3_5": 18379, + "surface_code_bX_d3_r01_center_5_3": 17450, + "surface_code_bX_d3_r03_center_5_3": 17161, + "surface_code_bX_d3_r05_center_5_3": 15797, + "surface_code_bX_d3_r07_center_5_3": 17800, + "surface_code_bX_d3_r09_center_5_3": 17190, + "surface_code_bX_d3_r11_center_5_3": 15840, + "surface_code_bX_d3_r13_center_5_3": 15178, + "surface_code_bX_d3_r15_center_5_3": 14897, + "surface_code_bX_d3_r17_center_5_3": 18252, + "surface_code_bX_d3_r19_center_5_3": 17083, + "surface_code_bX_d3_r21_center_5_3": 17229, + "surface_code_bX_d3_r23_center_5_3": 14735, + "surface_code_bX_d3_r25_center_5_3": 17949, + "surface_code_bX_d3_r01_center_5_7": 17431, + "surface_code_bX_d3_r03_center_5_7": 16583, + "surface_code_bX_d3_r05_center_5_7": 16891, + "surface_code_bX_d3_r07_center_5_7": 17969, + "surface_code_bX_d3_r09_center_5_7": 17966, + "surface_code_bX_d3_r11_center_5_7": 14424, + "surface_code_bX_d3_r13_center_5_7": 16930, + "surface_code_bX_d3_r15_center_5_7": 15205, + "surface_code_bX_d3_r17_center_5_7": 18252, + "surface_code_bX_d3_r19_center_5_7": 17077, + "surface_code_bX_d3_r21_center_5_7": 16770, + "surface_code_bX_d3_r23_center_5_7": 17308, + "surface_code_bX_d3_r25_center_5_7": 17481, + "surface_code_bX_d3_r01_center_7_5": 16630, + "surface_code_bX_d3_r03_center_7_5": 17439, + "surface_code_bX_d3_r05_center_7_5": 15811, + "surface_code_bX_d3_r07_center_7_5": 16637, + "surface_code_bX_d3_r09_center_7_5": 18306, + "surface_code_bX_d3_r11_center_7_5": 18327, + "surface_code_bX_d3_r13_center_7_5": 17974, + "surface_code_bX_d3_r15_center_7_5": 16106, + "surface_code_bX_d3_r17_center_7_5": 15834, + "surface_code_bX_d3_r19_center_7_5": 17242, + "surface_code_bX_d3_r21_center_7_5": 17889, + "surface_code_bX_d3_r23_center_7_5": 17440, + "surface_code_bX_d3_r25_center_7_5": 17087, + "surface_code_bZ_d3_r01_center_3_5": 16236, + "surface_code_bZ_d3_r03_center_3_5": 17278, + "surface_code_bZ_d3_r05_center_3_5": 16577, + "surface_code_bZ_d3_r07_center_3_5": 17376, + "surface_code_bZ_d3_r09_center_3_5": 16000, + "surface_code_bZ_d3_r11_center_3_5": 15634, + "surface_code_bZ_d3_r13_center_3_5": 14950, + "surface_code_bZ_d3_r15_center_3_5": 16600, + "surface_code_bZ_d3_r17_center_3_5": 15381, + "surface_code_bZ_d3_r19_center_3_5": 16823, + "surface_code_bZ_d3_r21_center_3_5": 18789, + "surface_code_bZ_d3_r23_center_3_5": 15616, + "surface_code_bZ_d3_r25_center_3_5": 17088, + "surface_code_bZ_d3_r01_center_5_3": 17935, + "surface_code_bZ_d3_r03_center_5_3": 16256, + "surface_code_bZ_d3_r05_center_5_3": 17959, + "surface_code_bZ_d3_r07_center_5_3": 18401, + "surface_code_bZ_d3_r09_center_5_3": 16405, + "surface_code_bZ_d3_r11_center_5_3": 17274, + "surface_code_bZ_d3_r13_center_5_3": 18172, + "surface_code_bZ_d3_r15_center_5_3": 17525, + "surface_code_bZ_d3_r17_center_5_3": 18643, + "surface_code_bZ_d3_r19_center_5_3": 17816, + "surface_code_bZ_d3_r21_center_5_3": 17404, + "surface_code_bZ_d3_r23_center_5_3": 17253, + "surface_code_bZ_d3_r25_center_5_3": 17667, + "surface_code_bZ_d3_r01_center_5_7": 16203, + "surface_code_bZ_d3_r03_center_5_7": 17214, + "surface_code_bZ_d3_r05_center_5_7": 16799, + "surface_code_bZ_d3_r07_center_5_7": 17896, + "surface_code_bZ_d3_r09_center_5_7": 16411, + "surface_code_bZ_d3_r11_center_5_7": 17726, + "surface_code_bZ_d3_r13_center_5_7": 16313, + "surface_code_bZ_d3_r15_center_5_7": 17824, + "surface_code_bZ_d3_r17_center_5_7": 15656, + "surface_code_bZ_d3_r19_center_5_7": 17169, + "surface_code_bZ_d3_r21_center_5_7": 17194, + "surface_code_bZ_d3_r23_center_5_7": 16779, + "surface_code_bZ_d3_r25_center_5_7": 16970, + "surface_code_bZ_d3_r01_center_7_5": 16762, + "surface_code_bZ_d3_r03_center_7_5": 17320, + "surface_code_bZ_d3_r05_center_7_5": 17522, + "surface_code_bZ_d3_r07_center_7_5": 17914, + "surface_code_bZ_d3_r09_center_7_5": 18439, + "surface_code_bZ_d3_r11_center_7_5": 18218, + "surface_code_bZ_d3_r13_center_7_5": 17907, + "surface_code_bZ_d3_r15_center_7_5": 17597, + "surface_code_bZ_d3_r17_center_7_5": 18252, + "surface_code_bZ_d3_r19_center_7_5": 18379, + "surface_code_bZ_d3_r21_center_7_5": 16818, + "surface_code_bZ_d3_r23_center_7_5": 18430, + "surface_code_bZ_d3_r25_center_7_5": 17924 + }, + "steps": 4096, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.0005, + "sampling_seed": 20261121, + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_exact/temporal1/rng-2048.json", + "session_trained_starting_checkpoint": "/run-state/workspace/research/learned_exact/temporal1/weights-2048.npz", + "starting_checkpoint_sha256": "26be9e0259b69a5870bf73e80a5a29fcf3519a3ff63e1d219c57a2113d9d34be", + "starting_training_provenance": { + "initialization": "Continue from rich weights trained from random initialization in this session; new temporal parameters randomly initialized now", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 2048, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261111, + "optimizer_restored": false, + "rng_restored": false, + "session_trained_starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.6317505836486816, + "error": 0.3681640625, + "gradient_norm": 0.04013459011912346, + "elapsed": 30.971998691558838 + }, + { + "step": 16, + "loss": 0.5091081857681274, + "error": 0.291015625, + "gradient_norm": 0.042228709906339645, + "elapsed": 35.17463397979736 + }, + { + "step": 32, + "loss": 0.626472532749176, + "error": 0.3642578125, + "gradient_norm": 0.05872415751218796, + "elapsed": 39.678136110305786 + }, + { + "step": 48, + "loss": 0.6005369424819946, + "error": 0.3515625, + "gradient_norm": 0.03848014399409294, + "elapsed": 44.16946887969971 + }, + { + "step": 64, + "loss": 0.5523768663406372, + "error": 0.302734375, + "gradient_norm": 0.06031862646341324, + "elapsed": 48.65217089653015 + }, + { + "step": 80, + "loss": 0.3981674611568451, + "error": 0.19921875, + "gradient_norm": 0.0542079322040081, + "elapsed": 53.21601867675781 + }, + { + "step": 96, + "loss": 0.5601426362991333, + "error": 0.2978515625, + "gradient_norm": 0.04770371690392494, + "elapsed": 57.81089663505554 + }, + { + "step": 112, + "loss": 0.5878150463104248, + "error": 0.34765625, + "gradient_norm": 0.10699950158596039, + "elapsed": 62.42190766334534 + }, + { + "step": 128, + "loss": 0.5232458114624023, + "error": 0.2861328125, + "gradient_norm": 0.0911584198474884, + "elapsed": 67.00223755836487 + }, + { + "step": 144, + "loss": 0.6119767427444458, + "error": 0.3623046875, + "gradient_norm": 0.062474437057971954, + "elapsed": 71.54070782661438 + }, + { + "step": 160, + "loss": 0.3037984371185303, + "error": 0.1474609375, + "gradient_norm": 0.05718141421675682, + "elapsed": 76.08167362213135 + }, + { + "step": 176, + "loss": 0.6038273572921753, + "error": 0.3662109375, + "gradient_norm": 0.0437164381146431, + "elapsed": 80.71864247322083 + }, + { + "step": 192, + "loss": 0.3304370641708374, + "error": 0.1572265625, + "gradient_norm": 0.05684761330485344, + "elapsed": 85.54437017440796 + }, + { + "step": 208, + "loss": 0.5785484313964844, + "error": 0.3251953125, + "gradient_norm": 0.09597272425889969, + "elapsed": 91.51522874832153 + }, + { + "step": 224, + "loss": 0.3110499978065491, + "error": 0.13671875, + "gradient_norm": 0.04815748706459999, + "elapsed": 97.1228940486908 + }, + { + "step": 240, + "loss": 0.6213864684104919, + "error": 0.3623046875, + "gradient_norm": 0.0540502592921257, + "elapsed": 102.90286135673523 + }, + { + "step": 256, + "loss": 0.2535272240638733, + "error": 0.1064453125, + "gradient_norm": 0.029962118715047836, + "elapsed": 108.39288640022278 + }, + { + "step": 272, + "loss": 0.6126939058303833, + "error": 0.3671875, + "gradient_norm": 0.06887879222631454, + "elapsed": 113.83897161483765 + }, + { + "step": 288, + "loss": 0.4556676149368286, + "error": 0.2236328125, + "gradient_norm": 0.16127081215381622, + "elapsed": 119.93085813522339 + }, + { + "step": 304, + "loss": 0.4973585605621338, + "error": 0.255859375, + "gradient_norm": 0.08082302659749985, + "elapsed": 125.90891909599304 + }, + { + "step": 320, + "loss": 0.6455868482589722, + "error": 0.419921875, + "gradient_norm": 0.04339660331606865, + "elapsed": 131.20537638664246 + }, + { + "step": 336, + "loss": 0.5343132615089417, + "error": 0.2880859375, + "gradient_norm": 0.07518009096384048, + "elapsed": 136.59086871147156 + }, + { + "step": 352, + "loss": 0.6505346894264221, + "error": 0.4033203125, + "gradient_norm": 0.03800992667675018, + "elapsed": 142.21085906028748 + }, + { + "step": 368, + "loss": 0.4882712960243225, + "error": 0.251953125, + "gradient_norm": 0.08170920610427856, + "elapsed": 146.95903658866882 + }, + { + "step": 384, + "loss": 0.5292021036148071, + "error": 0.296875, + "gradient_norm": 0.08454013615846634, + "elapsed": 151.6385259628296 + }, + { + "step": 400, + "loss": 0.6272899508476257, + "error": 0.3837890625, + "gradient_norm": 0.051436979323625565, + "elapsed": 156.3343904018402 + }, + { + "step": 416, + "loss": 0.052130259573459625, + "error": 0.0166015625, + "gradient_norm": 0.02377190627157688, + "elapsed": 160.92345547676086 + }, + { + "step": 432, + "loss": 0.5256737470626831, + "error": 0.3046875, + "gradient_norm": 0.07986386120319366, + "elapsed": 165.52879118919373 + }, + { + "step": 448, + "loss": 0.15193665027618408, + "error": 0.0576171875, + "gradient_norm": 0.06491660326719284, + "elapsed": 170.14827823638916 + }, + { + "step": 464, + "loss": 0.6418055295944214, + "error": 0.40625, + "gradient_norm": 0.07290885597467422, + "elapsed": 174.64974284172058 + }, + { + "step": 480, + "loss": 0.6055159568786621, + "error": 0.357421875, + "gradient_norm": 0.0795595794916153, + "elapsed": 179.17218685150146 + }, + { + "step": 496, + "loss": 0.6372283697128296, + "error": 0.3916015625, + "gradient_norm": 0.04387903958559036, + "elapsed": 183.77568197250366 + }, + { + "step": 512, + "loss": 0.637977123260498, + "error": 0.408203125, + "gradient_norm": 0.060665905475616455, + "elapsed": 188.31205368041992 + }, + { + "step": 528, + "loss": 0.4668862223625183, + "error": 0.2451171875, + "gradient_norm": 0.08566711097955704, + "elapsed": 206.40719985961914 + }, + { + "step": 544, + "loss": 0.4584413170814514, + "error": 0.244140625, + "gradient_norm": 0.08538200706243515, + "elapsed": 211.02819895744324 + }, + { + "step": 560, + "loss": 0.5615692138671875, + "error": 0.3291015625, + "gradient_norm": 0.043748609721660614, + "elapsed": 215.66470766067505 + }, + { + "step": 576, + "loss": 0.5151895880699158, + "error": 0.2880859375, + "gradient_norm": 0.05164863541722298, + "elapsed": 220.18949556350708 + }, + { + "step": 592, + "loss": 0.5618112087249756, + "error": 0.3291015625, + "gradient_norm": 0.05998719856142998, + "elapsed": 224.7216100692749 + }, + { + "step": 608, + "loss": 0.659294843673706, + "error": 0.431640625, + "gradient_norm": 0.09910348802804947, + "elapsed": 229.26827573776245 + }, + { + "step": 624, + "loss": 0.5895233154296875, + "error": 0.3447265625, + "gradient_norm": 0.045334093272686005, + "elapsed": 233.83731055259705 + }, + { + "step": 640, + "loss": 0.6081801056861877, + "error": 0.3388671875, + "gradient_norm": 0.06578423827886581, + "elapsed": 238.36345624923706 + }, + { + "step": 656, + "loss": 0.5349816083908081, + "error": 0.2939453125, + "gradient_norm": 0.09989562630653381, + "elapsed": 242.95086026191711 + }, + { + "step": 672, + "loss": 0.5871994495391846, + "error": 0.328125, + "gradient_norm": 0.08132346719503403, + "elapsed": 247.67088556289673 + }, + { + "step": 688, + "loss": 0.06012660637497902, + "error": 0.0146484375, + "gradient_norm": 0.012170507572591305, + "elapsed": 252.3202247619629 + }, + { + "step": 704, + "loss": 0.42179757356643677, + "error": 0.21484375, + "gradient_norm": 0.08384513854980469, + "elapsed": 256.91991782188416 + }, + { + "step": 720, + "loss": 0.6111758947372437, + "error": 0.3720703125, + "gradient_norm": 0.06689880788326263, + "elapsed": 261.56407928466797 + }, + { + "step": 736, + "loss": 0.29969727993011475, + "error": 0.1318359375, + "gradient_norm": 0.0743367150425911, + "elapsed": 266.22199630737305 + }, + { + "step": 752, + "loss": 0.051849883049726486, + "error": 0.0166015625, + "gradient_norm": 0.017005126923322678, + "elapsed": 270.8602342605591 + }, + { + "step": 768, + "loss": 0.6178420186042786, + "error": 0.3759765625, + "gradient_norm": 0.027732960879802704, + "elapsed": 275.47888374328613 + }, + { + "step": 784, + "loss": 0.45798996090888977, + "error": 0.228515625, + "gradient_norm": 0.0630083829164505, + "elapsed": 280.1709156036377 + }, + { + "step": 800, + "loss": 0.5104988813400269, + "error": 0.2724609375, + "gradient_norm": 0.041733670979738235, + "elapsed": 286.17937707901 + }, + { + "step": 816, + "loss": 0.6336112022399902, + "error": 0.3837890625, + "gradient_norm": 0.0755191296339035, + "elapsed": 291.7506103515625 + }, + { + "step": 832, + "loss": 0.6260952353477478, + "error": 0.3603515625, + "gradient_norm": 0.0318005345761776, + "elapsed": 297.31094622612 + }, + { + "step": 848, + "loss": 0.5870074033737183, + "error": 0.3525390625, + "gradient_norm": 0.12073405832052231, + "elapsed": 303.11089158058167 + }, + { + "step": 864, + "loss": 0.5125640034675598, + "error": 0.26953125, + "gradient_norm": 0.038650237023830414, + "elapsed": 308.7288725376129 + }, + { + "step": 880, + "loss": 0.19194915890693665, + "error": 0.0703125, + "gradient_norm": 0.061878547072410583, + "elapsed": 314.37042355537415 + }, + { + "step": 896, + "loss": 0.5409250259399414, + "error": 0.2919921875, + "gradient_norm": 0.06288820505142212, + "elapsed": 319.9398190975189 + }, + { + "step": 912, + "loss": 0.6164936423301697, + "error": 0.3701171875, + "gradient_norm": 0.043224163353443146, + "elapsed": 325.361323595047 + }, + { + "step": 928, + "loss": 0.16032151877880096, + "error": 0.0625, + "gradient_norm": 0.030957572162151337, + "elapsed": 331.21752285957336 + }, + { + "step": 944, + "loss": 0.646601676940918, + "error": 0.3818359375, + "gradient_norm": 0.05670839175581932, + "elapsed": 336.7825517654419 + }, + { + "step": 960, + "loss": 0.402952641248703, + "error": 0.1865234375, + "gradient_norm": 0.07500886172056198, + "elapsed": 342.6888346672058 + }, + { + "step": 976, + "loss": 0.5537433624267578, + "error": 0.2939453125, + "gradient_norm": 0.04955969750881195, + "elapsed": 348.5554690361023 + }, + { + "step": 992, + "loss": 0.559626579284668, + "error": 0.294921875, + "gradient_norm": 0.048295993357896805, + "elapsed": 354.3531894683838 + }, + { + "step": 1008, + "loss": 0.5034694671630859, + "error": 0.2705078125, + "gradient_norm": 0.05729879066348076, + "elapsed": 360.0949149131775 + }, + { + "step": 1024, + "loss": 0.3119734525680542, + "error": 0.1259765625, + "gradient_norm": 0.052326612174510956, + "elapsed": 365.7881224155426 + }, + { + "step": 1040, + "loss": 0.35799849033355713, + "error": 0.173828125, + "gradient_norm": 0.03801804035902023, + "elapsed": 386.5749418735504 + }, + { + "step": 1056, + "loss": 0.6178948879241943, + "error": 0.3515625, + "gradient_norm": 0.03620661422610283, + "elapsed": 391.48247838020325 + }, + { + "step": 1072, + "loss": 0.49231401085853577, + "error": 0.24609375, + "gradient_norm": 0.04391559213399887, + "elapsed": 396.08718824386597 + }, + { + "step": 1088, + "loss": 0.4119300842285156, + "error": 0.2001953125, + "gradient_norm": 0.1104700043797493, + "elapsed": 400.5326828956604 + }, + { + "step": 1104, + "loss": 0.4926626682281494, + "error": 0.265625, + "gradient_norm": 0.04246886447072029, + "elapsed": 404.95741271972656 + }, + { + "step": 1120, + "loss": 0.5027930736541748, + "error": 0.2607421875, + "gradient_norm": 0.0547240674495697, + "elapsed": 409.40319633483887 + }, + { + "step": 1136, + "loss": 0.5948058366775513, + "error": 0.3544921875, + "gradient_norm": 0.06810063123703003, + "elapsed": 413.8514006137848 + }, + { + "step": 1152, + "loss": 0.26567256450653076, + "error": 0.125, + "gradient_norm": 0.06689104437828064, + "elapsed": 418.29868721961975 + }, + { + "step": 1168, + "loss": 0.2866836190223694, + "error": 0.1240234375, + "gradient_norm": 0.029536213725805283, + "elapsed": 422.75131845474243 + }, + { + "step": 1184, + "loss": 0.6342021822929382, + "error": 0.4091796875, + "gradient_norm": 0.0704190731048584, + "elapsed": 427.1991722583771 + }, + { + "step": 1200, + "loss": 0.41626787185668945, + "error": 0.212890625, + "gradient_norm": 0.04480795934796333, + "elapsed": 431.6600706577301 + }, + { + "step": 1216, + "loss": 0.28460952639579773, + "error": 0.1337890625, + "gradient_norm": 0.03666983172297478, + "elapsed": 436.14414525032043 + }, + { + "step": 1232, + "loss": 0.044482216238975525, + "error": 0.0146484375, + "gradient_norm": 0.04537617415189743, + "elapsed": 440.6220428943634 + }, + { + "step": 1248, + "loss": 0.42564862966537476, + "error": 0.2119140625, + "gradient_norm": 0.03382417559623718, + "elapsed": 445.06736421585083 + }, + { + "step": 1264, + "loss": 0.27150213718414307, + "error": 0.123046875, + "gradient_norm": 0.033046118915081024, + "elapsed": 449.544029712677 + }, + { + "step": 1280, + "loss": 0.4927375912666321, + "error": 0.255859375, + "gradient_norm": 0.06812550127506256, + "elapsed": 454.07198667526245 + }, + { + "step": 1296, + "loss": 0.5541940927505493, + "error": 0.28125, + "gradient_norm": 0.1435294896364212, + "elapsed": 458.6031415462494 + }, + { + "step": 1312, + "loss": 0.5575842261314392, + "error": 0.2958984375, + "gradient_norm": 0.03811952844262123, + "elapsed": 463.1806228160858 + }, + { + "step": 1328, + "loss": 0.3479428291320801, + "error": 0.1591796875, + "gradient_norm": 0.0709012895822525, + "elapsed": 467.84689688682556 + }, + { + "step": 1344, + "loss": 0.1685580611228943, + "error": 0.0693359375, + "gradient_norm": 0.05423415079712868, + "elapsed": 472.6908576488495 + }, + { + "step": 1360, + "loss": 0.18506410717964172, + "error": 0.0771484375, + "gradient_norm": 0.03418596833944321, + "elapsed": 477.4269769191742 + }, + { + "step": 1376, + "loss": 0.5654555559158325, + "error": 0.3173828125, + "gradient_norm": 0.0685155838727951, + "elapsed": 482.08285188674927 + }, + { + "step": 1392, + "loss": 0.6116407513618469, + "error": 0.3603515625, + "gradient_norm": 0.05198948457837105, + "elapsed": 486.7167499065399 + }, + { + "step": 1408, + "loss": 0.4014682471752167, + "error": 0.19140625, + "gradient_norm": 0.1024075523018837, + "elapsed": 491.4308760166168 + }, + { + "step": 1424, + "loss": 0.051035866141319275, + "error": 0.0166015625, + "gradient_norm": 0.010207361541688442, + "elapsed": 496.1818380355835 + }, + { + "step": 1440, + "loss": 0.4725648760795593, + "error": 0.2412109375, + "gradient_norm": 0.03977378085255623, + "elapsed": 500.8668632507324 + }, + { + "step": 1456, + "loss": 0.5407818555831909, + "error": 0.2939453125, + "gradient_norm": 0.088577501475811, + "elapsed": 505.49274134635925 + }, + { + "step": 1472, + "loss": 0.5655064582824707, + "error": 0.3076171875, + "gradient_norm": 0.04452778398990631, + "elapsed": 510.2188584804535 + }, + { + "step": 1488, + "loss": 0.5799556374549866, + "error": 0.30859375, + "gradient_norm": 0.03976206108927727, + "elapsed": 514.9319434165955 + }, + { + "step": 1504, + "loss": 0.4660354256629944, + "error": 0.25390625, + "gradient_norm": 0.04365506023168564, + "elapsed": 519.5848798751831 + }, + { + "step": 1520, + "loss": 0.5505894422531128, + "error": 0.30859375, + "gradient_norm": 0.057772211730480194, + "elapsed": 524.3388590812683 + }, + { + "step": 1536, + "loss": 0.6251416206359863, + "error": 0.400390625, + "gradient_norm": 0.09649194777011871, + "elapsed": 529.483047246933 + }, + { + "step": 1552, + "loss": 0.05424533039331436, + "error": 0.0185546875, + "gradient_norm": 0.011683990247547626, + "elapsed": 548.1828610897064 + }, + { + "step": 1568, + "loss": 0.33612310886383057, + "error": 0.1611328125, + "gradient_norm": 0.051817383617162704, + "elapsed": 553.4256420135498 + }, + { + "step": 1584, + "loss": 0.045015305280685425, + "error": 0.0166015625, + "gradient_norm": 0.022604886442422867, + "elapsed": 558.6308543682098 + }, + { + "step": 1600, + "loss": 0.2701840102672577, + "error": 0.119140625, + "gradient_norm": 0.02910422720015049, + "elapsed": 563.8571691513062 + }, + { + "step": 1616, + "loss": 0.18982334434986115, + "error": 0.0849609375, + "gradient_norm": 0.025524422526359558, + "elapsed": 568.8628678321838 + }, + { + "step": 1632, + "loss": 0.3950161337852478, + "error": 0.185546875, + "gradient_norm": 0.08419577777385712, + "elapsed": 574.0815451145172 + }, + { + "step": 1648, + "loss": 0.49384528398513794, + "error": 0.255859375, + "gradient_norm": 0.08879344165325165, + "elapsed": 579.1229114532471 + }, + { + "step": 1664, + "loss": 0.5671384930610657, + "error": 0.3115234375, + "gradient_norm": 0.05374513566493988, + "elapsed": 584.114851474762 + }, + { + "step": 1680, + "loss": 0.6192574501037598, + "error": 0.37890625, + "gradient_norm": 0.043836336582899094, + "elapsed": 589.0708522796631 + }, + { + "step": 1696, + "loss": 0.2619469463825226, + "error": 0.1171875, + "gradient_norm": 0.040093280375003815, + "elapsed": 594.2814819812775 + }, + { + "step": 1712, + "loss": 0.33178141713142395, + "error": 0.162109375, + "gradient_norm": 0.04902712255716324, + "elapsed": 599.3068840503693 + }, + { + "step": 1728, + "loss": 0.385281503200531, + "error": 0.171875, + "gradient_norm": 0.03541380167007446, + "elapsed": 604.5308682918549 + }, + { + "step": 1744, + "loss": 0.1628715693950653, + "error": 0.0693359375, + "gradient_norm": 0.06111741065979004, + "elapsed": 609.309522151947 + }, + { + "step": 1760, + "loss": 0.5239119529724121, + "error": 0.2861328125, + "gradient_norm": 0.08513613045215607, + "elapsed": 614.0396001338959 + }, + { + "step": 1776, + "loss": 0.35721707344055176, + "error": 0.150390625, + "gradient_norm": 0.06337940692901611, + "elapsed": 618.6857132911682 + }, + { + "step": 1792, + "loss": 0.5985626578330994, + "error": 0.33203125, + "gradient_norm": 0.035725343972444534, + "elapsed": 623.3352344036102 + }, + { + "step": 1808, + "loss": 0.34676820039749146, + "error": 0.15234375, + "gradient_norm": 0.08163885772228241, + "elapsed": 627.9495220184326 + }, + { + "step": 1824, + "loss": 0.5633711814880371, + "error": 0.3037109375, + "gradient_norm": 0.05938677117228508, + "elapsed": 632.5820379257202 + }, + { + "step": 1840, + "loss": 0.6256523132324219, + "error": 0.384765625, + "gradient_norm": 0.04545137286186218, + "elapsed": 637.205274105072 + }, + { + "step": 1856, + "loss": 0.28091639280319214, + "error": 0.1298828125, + "gradient_norm": 0.04705077037215233, + "elapsed": 641.883561372757 + }, + { + "step": 1872, + "loss": 0.516182541847229, + "error": 0.263671875, + "gradient_norm": 0.08828777819871902, + "elapsed": 646.5188939571381 + }, + { + "step": 1888, + "loss": 0.48386621475219727, + "error": 0.25390625, + "gradient_norm": 0.05322824418544769, + "elapsed": 651.148512840271 + }, + { + "step": 1904, + "loss": 0.6141921281814575, + "error": 0.388671875, + "gradient_norm": 0.050139278173446655, + "elapsed": 655.7796437740326 + }, + { + "step": 1920, + "loss": 0.18002840876579285, + "error": 0.0712890625, + "gradient_norm": 0.04201133921742439, + "elapsed": 660.4064948558807 + }, + { + "step": 1936, + "loss": 0.17531852424144745, + "error": 0.0732421875, + "gradient_norm": 0.024726318195462227, + "elapsed": 664.9991583824158 + }, + { + "step": 1952, + "loss": 0.5088322758674622, + "error": 0.2744140625, + "gradient_norm": 0.04693225398659706, + "elapsed": 669.5544555187225 + }, + { + "step": 1968, + "loss": 0.5684165358543396, + "error": 0.3310546875, + "gradient_norm": 0.031029095873236656, + "elapsed": 674.2354445457458 + }, + { + "step": 1984, + "loss": 0.06459524482488632, + "error": 0.017578125, + "gradient_norm": 0.03600892797112465, + "elapsed": 678.7982559204102 + }, + { + "step": 2000, + "loss": 0.3614455461502075, + "error": 0.1748046875, + "gradient_norm": 0.07060294598340988, + "elapsed": 683.2650325298309 + }, + { + "step": 2016, + "loss": 0.35535523295402527, + "error": 0.166015625, + "gradient_norm": 0.05873403698205948, + "elapsed": 687.7125518321991 + }, + { + "step": 2032, + "loss": 0.5638720989227295, + "error": 0.3232421875, + "gradient_norm": 0.07380504906177521, + "elapsed": 692.1461188793182 + }, + { + "step": 2048, + "loss": 0.5301838517189026, + "error": 0.2919921875, + "gradient_norm": 0.05435395985841751, + "elapsed": 696.6235508918762 + } + ] + }, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.250907301902771, + "error": 0.1083984375, + "gradient_norm": 0.07171476632356644, + "elapsed": 44.811134576797485 + }, + { + "step": 16, + "loss": 0.5958679914474487, + "error": 0.3662109375, + "gradient_norm": 0.07673005014657974, + "elapsed": 49.90856671333313 + }, + { + "step": 32, + "loss": 0.47648972272872925, + "error": 0.2421875, + "gradient_norm": 0.08561501652002335, + "elapsed": 55.179388761520386 + }, + { + "step": 48, + "loss": 0.06145006790757179, + "error": 0.0234375, + "gradient_norm": 0.01556467730551958, + "elapsed": 61.0339195728302 + }, + { + "step": 64, + "loss": 0.3687053918838501, + "error": 0.1884765625, + "gradient_norm": 0.08752371370792389, + "elapsed": 65.95811891555786 + }, + { + "step": 80, + "loss": 0.6481984853744507, + "error": 0.4140625, + "gradient_norm": 0.05311283841729164, + "elapsed": 70.56021332740784 + }, + { + "step": 96, + "loss": 0.42319929599761963, + "error": 0.2138671875, + "gradient_norm": 0.05047478526830673, + "elapsed": 75.11613631248474 + }, + { + "step": 112, + "loss": 0.47527259588241577, + "error": 0.24609375, + "gradient_norm": 0.038366906344890594, + "elapsed": 79.53446984291077 + }, + { + "step": 128, + "loss": 0.5996723175048828, + "error": 0.3369140625, + "gradient_norm": 0.1213272362947464, + "elapsed": 83.97515749931335 + }, + { + "step": 144, + "loss": 0.04971993714570999, + "error": 0.0146484375, + "gradient_norm": 0.008080735802650452, + "elapsed": 88.44039463996887 + }, + { + "step": 160, + "loss": 0.35900360345840454, + "error": 0.162109375, + "gradient_norm": 0.03359593451023102, + "elapsed": 92.89548206329346 + }, + { + "step": 176, + "loss": 0.5342063903808594, + "error": 0.2978515625, + "gradient_norm": 0.04794691130518913, + "elapsed": 97.35658049583435 + }, + { + "step": 192, + "loss": 0.6300076246261597, + "error": 0.369140625, + "gradient_norm": 0.081769198179245, + "elapsed": 101.81493759155273 + }, + { + "step": 208, + "loss": 0.6191903948783875, + "error": 0.3828125, + "gradient_norm": 0.07145775109529495, + "elapsed": 106.2480263710022 + }, + { + "step": 224, + "loss": 0.5155678391456604, + "error": 0.28515625, + "gradient_norm": 0.06772179156541824, + "elapsed": 110.71284222602844 + }, + { + "step": 240, + "loss": 0.634708046913147, + "error": 0.3857421875, + "gradient_norm": 0.09493093192577362, + "elapsed": 115.14978742599487 + }, + { + "step": 256, + "loss": 0.1840895414352417, + "error": 0.0751953125, + "gradient_norm": 0.025586696341633797, + "elapsed": 119.61202120780945 + }, + { + "step": 272, + "loss": 0.2775103449821472, + "error": 0.12890625, + "gradient_norm": 0.06913147866725922, + "elapsed": 124.02584528923035 + }, + { + "step": 288, + "loss": 0.6163080334663391, + "error": 0.3642578125, + "gradient_norm": 0.05895426496863365, + "elapsed": 128.46512532234192 + }, + { + "step": 304, + "loss": 0.5276986360549927, + "error": 0.287109375, + "gradient_norm": 0.06955187022686005, + "elapsed": 132.89240765571594 + }, + { + "step": 320, + "loss": 0.44859516620635986, + "error": 0.22265625, + "gradient_norm": 0.07272452116012573, + "elapsed": 137.32864713668823 + }, + { + "step": 336, + "loss": 0.48315611481666565, + "error": 0.2626953125, + "gradient_norm": 0.03321139141917229, + "elapsed": 141.80009770393372 + }, + { + "step": 352, + "loss": 0.6107717752456665, + "error": 0.3544921875, + "gradient_norm": 0.05243214592337608, + "elapsed": 146.36439752578735 + }, + { + "step": 368, + "loss": 0.6215153932571411, + "error": 0.357421875, + "gradient_norm": 0.04383325204253197, + "elapsed": 150.99996852874756 + }, + { + "step": 384, + "loss": 0.6130329966545105, + "error": 0.35546875, + "gradient_norm": 0.04113119840621948, + "elapsed": 155.62374639511108 + }, + { + "step": 400, + "loss": 0.30471885204315186, + "error": 0.142578125, + "gradient_norm": 0.04447556659579277, + "elapsed": 160.17594957351685 + }, + { + "step": 416, + "loss": 0.6154489517211914, + "error": 0.37109375, + "gradient_norm": 0.04456057772040367, + "elapsed": 164.7639675140381 + }, + { + "step": 432, + "loss": 0.6134694218635559, + "error": 0.337890625, + "gradient_norm": 0.04219559207558632, + "elapsed": 169.32792139053345 + }, + { + "step": 448, + "loss": 0.5463185906410217, + "error": 0.2939453125, + "gradient_norm": 0.07746092975139618, + "elapsed": 173.88445162773132 + }, + { + "step": 464, + "loss": 0.06016772612929344, + "error": 0.01953125, + "gradient_norm": 0.01364185381680727, + "elapsed": 178.42725706100464 + }, + { + "step": 480, + "loss": 0.388141393661499, + "error": 0.18359375, + "gradient_norm": 0.04870256036520004, + "elapsed": 182.99062085151672 + }, + { + "step": 496, + "loss": 0.44524821639060974, + "error": 0.2216796875, + "gradient_norm": 0.03453445807099342, + "elapsed": 187.56396961212158 + }, + { + "step": 512, + "loss": 0.34312355518341064, + "error": 0.154296875, + "gradient_norm": 0.06794509291648865, + "elapsed": 192.27511191368103 + }, + { + "step": 528, + "loss": 0.19467462599277496, + "error": 0.0771484375, + "gradient_norm": 0.042381469160318375, + "elapsed": 197.7108268737793 + }, + { + "step": 544, + "loss": 0.46226584911346436, + "error": 0.2421875, + "gradient_norm": 0.06073570251464844, + "elapsed": 202.97405791282654 + }, + { + "step": 560, + "loss": 0.525318443775177, + "error": 0.2822265625, + "gradient_norm": 0.06954885274171829, + "elapsed": 208.69676971435547 + }, + { + "step": 576, + "loss": 0.6158387064933777, + "error": 0.349609375, + "gradient_norm": 0.07587578892707825, + "elapsed": 214.80397653579712 + }, + { + "step": 592, + "loss": 0.5515886545181274, + "error": 0.298828125, + "gradient_norm": 0.04969338700175285, + "elapsed": 220.27399611473083 + }, + { + "step": 608, + "loss": 0.18365338444709778, + "error": 0.0654296875, + "gradient_norm": 0.08657706528902054, + "elapsed": 224.81246256828308 + }, + { + "step": 624, + "loss": 0.4578855633735657, + "error": 0.2421875, + "gradient_norm": 0.04942100867629051, + "elapsed": 229.45902252197266 + }, + { + "step": 640, + "loss": 0.37826013565063477, + "error": 0.1865234375, + "gradient_norm": 0.047499872744083405, + "elapsed": 233.9695644378662 + }, + { + "step": 656, + "loss": 0.40863412618637085, + "error": 0.2001953125, + "gradient_norm": 0.07845330238342285, + "elapsed": 238.584894657135 + }, + { + "step": 672, + "loss": 0.5640332698822021, + "error": 0.2880859375, + "gradient_norm": 0.057469289749860764, + "elapsed": 243.0929844379425 + }, + { + "step": 688, + "loss": 0.030216243118047714, + "error": 0.0078125, + "gradient_norm": 0.04682641476392746, + "elapsed": 247.581125497818 + }, + { + "step": 704, + "loss": 0.375002384185791, + "error": 0.1826171875, + "gradient_norm": 0.04864194989204407, + "elapsed": 252.1564691066742 + }, + { + "step": 720, + "loss": 0.5145515203475952, + "error": 0.2744140625, + "gradient_norm": 0.052671682089567184, + "elapsed": 256.6466488838196 + }, + { + "step": 736, + "loss": 0.067174531519413, + "error": 0.0224609375, + "gradient_norm": 0.019299577921628952, + "elapsed": 261.1185076236725 + }, + { + "step": 752, + "loss": 0.24909992516040802, + "error": 0.111328125, + "gradient_norm": 0.06907463818788528, + "elapsed": 265.61960339546204 + }, + { + "step": 768, + "loss": 0.5088074207305908, + "error": 0.2744140625, + "gradient_norm": 0.06963017582893372, + "elapsed": 270.07474064826965 + }, + { + "step": 784, + "loss": 0.3783387839794159, + "error": 0.1826171875, + "gradient_norm": 0.05537794530391693, + "elapsed": 274.52722239494324 + }, + { + "step": 800, + "loss": 0.6107200980186462, + "error": 0.3623046875, + "gradient_norm": 0.0470259003341198, + "elapsed": 279.0401859283447 + }, + { + "step": 816, + "loss": 0.5778236389160156, + "error": 0.3212890625, + "gradient_norm": 0.10146680474281311, + "elapsed": 283.5114622116089 + }, + { + "step": 832, + "loss": 0.576002299785614, + "error": 0.3076171875, + "gradient_norm": 0.07760787010192871, + "elapsed": 288.04797434806824 + }, + { + "step": 848, + "loss": 0.6179666519165039, + "error": 0.3740234375, + "gradient_norm": 0.07383852452039719, + "elapsed": 292.60600209236145 + }, + { + "step": 864, + "loss": 0.3105512857437134, + "error": 0.1455078125, + "gradient_norm": 0.052953749895095825, + "elapsed": 297.12180352211 + }, + { + "step": 880, + "loss": 0.4802623987197876, + "error": 0.2548828125, + "gradient_norm": 0.07736275345087051, + "elapsed": 301.6091134548187 + }, + { + "step": 896, + "loss": 0.5572722554206848, + "error": 0.318359375, + "gradient_norm": 0.053303152322769165, + "elapsed": 306.1978073120117 + }, + { + "step": 912, + "loss": 0.34814420342445374, + "error": 0.1669921875, + "gradient_norm": 0.037726350128650665, + "elapsed": 310.78571581840515 + }, + { + "step": 928, + "loss": 0.41743016242980957, + "error": 0.21875, + "gradient_norm": 0.05238872766494751, + "elapsed": 315.24156188964844 + }, + { + "step": 944, + "loss": 0.5757850408554077, + "error": 0.3173828125, + "gradient_norm": 0.05837905779480934, + "elapsed": 319.78475165367126 + }, + { + "step": 960, + "loss": 0.40727972984313965, + "error": 0.197265625, + "gradient_norm": 0.059294261038303375, + "elapsed": 324.2090265750885 + }, + { + "step": 976, + "loss": 0.32715001702308655, + "error": 0.1533203125, + "gradient_norm": 0.11543179303407669, + "elapsed": 328.6462152004242 + }, + { + "step": 992, + "loss": 0.5578742623329163, + "error": 0.314453125, + "gradient_norm": 0.06282714009284973, + "elapsed": 333.0712504386902 + }, + { + "step": 1008, + "loss": 0.5052692294120789, + "error": 0.265625, + "gradient_norm": 0.04039420187473297, + "elapsed": 337.5182821750641 + }, + { + "step": 1024, + "loss": 0.18790806829929352, + "error": 0.08203125, + "gradient_norm": 0.028905188664793968, + "elapsed": 342.08340406417847 + }, + { + "step": 1040, + "loss": 0.6317684650421143, + "error": 0.3681640625, + "gradient_norm": 0.03441835194826126, + "elapsed": 358.8279616832733 + }, + { + "step": 1056, + "loss": 0.40474164485931396, + "error": 0.2021484375, + "gradient_norm": 0.036449309438467026, + "elapsed": 363.30218267440796 + }, + { + "step": 1072, + "loss": 0.518299400806427, + "error": 0.2666015625, + "gradient_norm": 0.0886964276432991, + "elapsed": 367.87997555732727 + }, + { + "step": 1088, + "loss": 0.2522922158241272, + "error": 0.099609375, + "gradient_norm": 0.07553310692310333, + "elapsed": 372.4414882659912 + }, + { + "step": 1104, + "loss": 0.6214810609817505, + "error": 0.3701171875, + "gradient_norm": 0.10188957303762436, + "elapsed": 376.9120502471924 + }, + { + "step": 1120, + "loss": 0.6307054162025452, + "error": 0.3720703125, + "gradient_norm": 0.07353860139846802, + "elapsed": 381.3824534416199 + }, + { + "step": 1136, + "loss": 0.5259381532669067, + "error": 0.2763671875, + "gradient_norm": 0.05779678374528885, + "elapsed": 385.8413143157959 + }, + { + "step": 1152, + "loss": 0.4995541572570801, + "error": 0.259765625, + "gradient_norm": 0.046648140996694565, + "elapsed": 390.28326058387756 + }, + { + "step": 1168, + "loss": 0.6075694561004639, + "error": 0.3701171875, + "gradient_norm": 0.10612073540687561, + "elapsed": 394.8162364959717 + }, + { + "step": 1184, + "loss": 0.2105136513710022, + "error": 0.080078125, + "gradient_norm": 0.0716402605175972, + "elapsed": 399.2960283756256 + }, + { + "step": 1200, + "loss": 0.6371631026268005, + "error": 0.3857421875, + "gradient_norm": 0.0549108125269413, + "elapsed": 403.7899103164673 + }, + { + "step": 1216, + "loss": 0.5450670719146729, + "error": 0.2939453125, + "gradient_norm": 0.11688558012247086, + "elapsed": 408.34677600860596 + }, + { + "step": 1232, + "loss": 0.035783201456069946, + "error": 0.01171875, + "gradient_norm": 0.02951689623296261, + "elapsed": 412.8558337688446 + }, + { + "step": 1248, + "loss": 0.5582903623580933, + "error": 0.3046875, + "gradient_norm": 0.055107031017541885, + "elapsed": 417.29854226112366 + }, + { + "step": 1264, + "loss": 0.5154441595077515, + "error": 0.27734375, + "gradient_norm": 0.04474929720163345, + "elapsed": 421.7792055606842 + }, + { + "step": 1280, + "loss": 0.35227546095848083, + "error": 0.16015625, + "gradient_norm": 0.05024837702512741, + "elapsed": 426.54427456855774 + }, + { + "step": 1296, + "loss": 0.19417589902877808, + "error": 0.0830078125, + "gradient_norm": 0.026926057413220406, + "elapsed": 431.320588350296 + }, + { + "step": 1312, + "loss": 0.4768218398094177, + "error": 0.248046875, + "gradient_norm": 0.15099607408046722, + "elapsed": 435.96817326545715 + }, + { + "step": 1328, + "loss": 0.48580923676490784, + "error": 0.2509765625, + "gradient_norm": 0.08925126492977142, + "elapsed": 440.64917039871216 + }, + { + "step": 1344, + "loss": 0.42041274905204773, + "error": 0.1982421875, + "gradient_norm": 0.08321093022823334, + "elapsed": 445.34370946884155 + }, + { + "step": 1360, + "loss": 0.06403929740190506, + "error": 0.0185546875, + "gradient_norm": 0.03817005455493927, + "elapsed": 449.98669385910034 + }, + { + "step": 1376, + "loss": 0.463126003742218, + "error": 0.2275390625, + "gradient_norm": 0.08894515782594681, + "elapsed": 454.6478977203369 + }, + { + "step": 1392, + "loss": 0.5995306968688965, + "error": 0.373046875, + "gradient_norm": 0.06733685731887817, + "elapsed": 459.35924530029297 + }, + { + "step": 1408, + "loss": 0.49053263664245605, + "error": 0.25, + "gradient_norm": 0.10475508868694305, + "elapsed": 464.100093126297 + }, + { + "step": 1424, + "loss": 0.6220744848251343, + "error": 0.3818359375, + "gradient_norm": 0.03653963655233383, + "elapsed": 468.89601135253906 + }, + { + "step": 1440, + "loss": 0.39706122875213623, + "error": 0.2021484375, + "gradient_norm": 0.04344598576426506, + "elapsed": 474.03999519348145 + }, + { + "step": 1456, + "loss": 0.5386708974838257, + "error": 0.3095703125, + "gradient_norm": 0.12589037418365479, + "elapsed": 478.8600504398346 + }, + { + "step": 1472, + "loss": 0.49776726961135864, + "error": 0.271484375, + "gradient_norm": 0.058137863874435425, + "elapsed": 483.5920066833496 + }, + { + "step": 1488, + "loss": 0.4757428765296936, + "error": 0.2412109375, + "gradient_norm": 0.050453316420316696, + "elapsed": 488.4611999988556 + }, + { + "step": 1504, + "loss": 0.5694847702980042, + "error": 0.337890625, + "gradient_norm": 0.052419569343328476, + "elapsed": 493.26151037216187 + }, + { + "step": 1520, + "loss": 0.5997745990753174, + "error": 0.3603515625, + "gradient_norm": 0.04338108375668526, + "elapsed": 498.0421245098114 + }, + { + "step": 1536, + "loss": 0.6195274591445923, + "error": 0.3876953125, + "gradient_norm": 0.04848463833332062, + "elapsed": 502.8808298110962 + }, + { + "step": 1552, + "loss": 0.46315908432006836, + "error": 0.2353515625, + "gradient_norm": 0.06380566209554672, + "elapsed": 507.5519721508026 + }, + { + "step": 1568, + "loss": 0.605262041091919, + "error": 0.36328125, + "gradient_norm": 0.05077619478106499, + "elapsed": 512.457685470581 + }, + { + "step": 1584, + "loss": 0.48782041668891907, + "error": 0.232421875, + "gradient_norm": 0.09017211943864822, + "elapsed": 517.2960062026978 + }, + { + "step": 1600, + "loss": 0.3881351947784424, + "error": 0.1875, + "gradient_norm": 0.07205695658922195, + "elapsed": 522.0911631584167 + }, + { + "step": 1616, + "loss": 0.4966873526573181, + "error": 0.24609375, + "gradient_norm": 0.0582038015127182, + "elapsed": 526.8861901760101 + }, + { + "step": 1632, + "loss": 0.5844199657440186, + "error": 0.33203125, + "gradient_norm": 0.05101500824093819, + "elapsed": 531.6640138626099 + }, + { + "step": 1648, + "loss": 0.31010180711746216, + "error": 0.1318359375, + "gradient_norm": 0.053135693073272705, + "elapsed": 536.4960391521454 + }, + { + "step": 1664, + "loss": 0.6174807548522949, + "error": 0.3779296875, + "gradient_norm": 0.04161194711923599, + "elapsed": 541.2560484409332 + }, + { + "step": 1680, + "loss": 0.18213607370853424, + "error": 0.0751953125, + "gradient_norm": 0.07171957194805145, + "elapsed": 546.0000085830688 + }, + { + "step": 1696, + "loss": 0.5445692539215088, + "error": 0.2998046875, + "gradient_norm": 0.054499462246894836, + "elapsed": 551.1221191883087 + }, + { + "step": 1712, + "loss": 0.05744167044758797, + "error": 0.017578125, + "gradient_norm": 0.013108699582517147, + "elapsed": 556.5286149978638 + }, + { + "step": 1728, + "loss": 0.6381571292877197, + "error": 0.3896484375, + "gradient_norm": 0.05157556012272835, + "elapsed": 561.8000066280365 + }, + { + "step": 1744, + "loss": 0.5301004648208618, + "error": 0.28125, + "gradient_norm": 0.04218568280339241, + "elapsed": 567.2760035991669 + }, + { + "step": 1760, + "loss": 0.5275102257728577, + "error": 0.26953125, + "gradient_norm": 0.06798839569091797, + "elapsed": 572.5601994991302 + }, + { + "step": 1776, + "loss": 0.6443773508071899, + "error": 0.4091796875, + "gradient_norm": 0.07035460323095322, + "elapsed": 577.9789206981659 + }, + { + "step": 1792, + "loss": 0.6012362241744995, + "error": 0.337890625, + "gradient_norm": 0.05189951881766319, + "elapsed": 583.028017282486 + }, + { + "step": 1808, + "loss": 0.2939091920852661, + "error": 0.12109375, + "gradient_norm": 0.05555355176329613, + "elapsed": 588.0501506328583 + }, + { + "step": 1824, + "loss": 0.2059091478586197, + "error": 0.08984375, + "gradient_norm": 0.045679714530706406, + "elapsed": 593.2120039463043 + }, + { + "step": 1840, + "loss": 0.6289581060409546, + "error": 0.349609375, + "gradient_norm": 0.04742642492055893, + "elapsed": 598.7767763137817 + }, + { + "step": 1856, + "loss": 0.5532636642456055, + "error": 0.294921875, + "gradient_norm": 0.05997413396835327, + "elapsed": 604.0475382804871 + }, + { + "step": 1872, + "loss": 0.45995670557022095, + "error": 0.228515625, + "gradient_norm": 0.05674462765455246, + "elapsed": 609.292379617691 + }, + { + "step": 1888, + "loss": 0.6178656816482544, + "error": 0.359375, + "gradient_norm": 0.08857566863298416, + "elapsed": 614.5639882087708 + }, + { + "step": 1904, + "loss": 0.5531284213066101, + "error": 0.287109375, + "gradient_norm": 0.10257937759160995, + "elapsed": 619.5600035190582 + }, + { + "step": 1920, + "loss": 0.04184349626302719, + "error": 0.013671875, + "gradient_norm": 0.04087059944868088, + "elapsed": 624.6679775714874 + }, + { + "step": 1936, + "loss": 0.5924860239028931, + "error": 0.3505859375, + "gradient_norm": 0.036822713911533356, + "elapsed": 629.936680316925 + }, + { + "step": 1952, + "loss": 0.46996980905532837, + "error": 0.2421875, + "gradient_norm": 0.034442272037267685, + "elapsed": 635.1109762191772 + }, + { + "step": 1968, + "loss": 0.17859068512916565, + "error": 0.0712890625, + "gradient_norm": 0.03440066799521446, + "elapsed": 640.32000207901 + }, + { + "step": 1984, + "loss": 0.6192275285720825, + "error": 0.3701171875, + "gradient_norm": 0.04386439174413681, + "elapsed": 645.6040184497833 + }, + { + "step": 2000, + "loss": 0.6160917282104492, + "error": 0.35546875, + "gradient_norm": 0.06268990784883499, + "elapsed": 650.7723731994629 + }, + { + "step": 2016, + "loss": 0.6343611478805542, + "error": 0.388671875, + "gradient_norm": 0.04243326932191849, + "elapsed": 655.972663640976 + }, + { + "step": 2032, + "loss": 0.062292590737342834, + "error": 0.021484375, + "gradient_norm": 0.016680095344781876, + "elapsed": 660.8079733848572 + }, + { + "step": 2048, + "loss": 0.5316072702407837, + "error": 0.26953125, + "gradient_norm": 0.057860780507326126, + "elapsed": 665.5760209560394 + }, + { + "step": 2064, + "loss": 0.605312705039978, + "error": 0.3623046875, + "gradient_norm": 0.04028146713972092, + "elapsed": 682.7294294834137 + }, + { + "step": 2080, + "loss": 0.56633460521698, + "error": 0.3330078125, + "gradient_norm": 0.09528280049562454, + "elapsed": 687.4644649028778 + }, + { + "step": 2096, + "loss": 0.3905397057533264, + "error": 0.1943359375, + "gradient_norm": 0.049456462264060974, + "elapsed": 692.1492264270782 + }, + { + "step": 2112, + "loss": 0.28124868869781494, + "error": 0.1259765625, + "gradient_norm": 0.059239838272333145, + "elapsed": 696.8701393604279 + }, + { + "step": 2128, + "loss": 0.6364338994026184, + "error": 0.392578125, + "gradient_norm": 0.08667811006307602, + "elapsed": 701.683988571167 + }, + { + "step": 2144, + "loss": 0.20683243870735168, + "error": 0.07421875, + "gradient_norm": 0.1100710779428482, + "elapsed": 706.4000360965729 + }, + { + "step": 2160, + "loss": 0.5912737250328064, + "error": 0.341796875, + "gradient_norm": 0.05641854554414749, + "elapsed": 711.2359964847565 + }, + { + "step": 2176, + "loss": 0.27793264389038086, + "error": 0.12109375, + "gradient_norm": 0.0893034040927887, + "elapsed": 715.9508004188538 + }, + { + "step": 2192, + "loss": 0.6474133133888245, + "error": 0.4072265625, + "gradient_norm": 0.06980258971452713, + "elapsed": 720.651974439621 + }, + { + "step": 2208, + "loss": 0.5961858630180359, + "error": 0.35546875, + "gradient_norm": 0.06530112773180008, + "elapsed": 725.496098279953 + }, + { + "step": 2224, + "loss": 0.47581571340560913, + "error": 0.263671875, + "gradient_norm": 0.04470043256878853, + "elapsed": 730.2880010604858 + }, + { + "step": 2240, + "loss": 0.577988862991333, + "error": 0.318359375, + "gradient_norm": 0.07201159745454788, + "elapsed": 735.006133556366 + }, + { + "step": 2256, + "loss": 0.28444671630859375, + "error": 0.1181640625, + "gradient_norm": 0.048656050115823746, + "elapsed": 739.6868116855621 + }, + { + "step": 2272, + "loss": 0.2776409089565277, + "error": 0.1201171875, + "gradient_norm": 0.05783981829881668, + "elapsed": 744.3517308235168 + }, + { + "step": 2288, + "loss": 0.621599555015564, + "error": 0.37109375, + "gradient_norm": 0.09731200337409973, + "elapsed": 749.0351710319519 + }, + { + "step": 2304, + "loss": 0.3333754539489746, + "error": 0.1513671875, + "gradient_norm": 0.07069239765405655, + "elapsed": 753.7588081359863 + }, + { + "step": 2320, + "loss": 0.4687051773071289, + "error": 0.2490234375, + "gradient_norm": 0.044891707599163055, + "elapsed": 758.4588432312012 + }, + { + "step": 2336, + "loss": 0.19801637530326843, + "error": 0.078125, + "gradient_norm": 0.10036595165729523, + "elapsed": 763.256409406662 + }, + { + "step": 2352, + "loss": 0.6186277866363525, + "error": 0.388671875, + "gradient_norm": 0.09069584310054779, + "elapsed": 767.9986386299133 + }, + { + "step": 2368, + "loss": 0.6177258491516113, + "error": 0.373046875, + "gradient_norm": 0.049019571393728256, + "elapsed": 772.730831861496 + }, + { + "step": 2384, + "loss": 0.17707547545433044, + "error": 0.0673828125, + "gradient_norm": 0.045190781354904175, + "elapsed": 777.4072704315186 + }, + { + "step": 2400, + "loss": 0.20144733786582947, + "error": 0.08203125, + "gradient_norm": 0.04537162929773331, + "elapsed": 782.0841658115387 + }, + { + "step": 2416, + "loss": 0.6151775121688843, + "error": 0.365234375, + "gradient_norm": 0.050534047186374664, + "elapsed": 786.762966632843 + }, + { + "step": 2432, + "loss": 0.5533859133720398, + "error": 0.314453125, + "gradient_norm": 0.06006559729576111, + "elapsed": 791.4656012058258 + }, + { + "step": 2448, + "loss": 0.5329082012176514, + "error": 0.2880859375, + "gradient_norm": 0.04018115997314453, + "elapsed": 796.1704161167145 + }, + { + "step": 2464, + "loss": 0.6338047981262207, + "error": 0.4140625, + "gradient_norm": 0.06069163978099823, + "elapsed": 800.9180119037628 + }, + { + "step": 2480, + "loss": 0.1603008508682251, + "error": 0.0673828125, + "gradient_norm": 0.040350593626499176, + "elapsed": 805.6127603054047 + }, + { + "step": 2496, + "loss": 0.505940318107605, + "error": 0.2568359375, + "gradient_norm": 0.05209952965378761, + "elapsed": 810.3740313053131 + }, + { + "step": 2512, + "loss": 0.5528728365898132, + "error": 0.298828125, + "gradient_norm": 0.11757992953062057, + "elapsed": 815.1708807945251 + }, + { + "step": 2528, + "loss": 0.5028313994407654, + "error": 0.2666015625, + "gradient_norm": 0.08823780715465546, + "elapsed": 819.8585045337677 + }, + { + "step": 2544, + "loss": 0.5002262592315674, + "error": 0.2783203125, + "gradient_norm": 0.04888603836297989, + "elapsed": 824.5714073181152 + }, + { + "step": 2560, + "loss": 0.6007894277572632, + "error": 0.328125, + "gradient_norm": 0.05186954140663147, + "elapsed": 829.3080432415009 + }, + { + "step": 2576, + "loss": 0.18641480803489685, + "error": 0.076171875, + "gradient_norm": 0.03799928352236748, + "elapsed": 834.044020652771 + }, + { + "step": 2592, + "loss": 0.3050769865512848, + "error": 0.1396484375, + "gradient_norm": 0.10119257122278214, + "elapsed": 838.8401296138763 + }, + { + "step": 2608, + "loss": 0.6063439846038818, + "error": 0.361328125, + "gradient_norm": 0.04979367554187775, + "elapsed": 844.3572654724121 + }, + { + "step": 2624, + "loss": 0.5751967430114746, + "error": 0.3369140625, + "gradient_norm": 0.04269539937376976, + "elapsed": 849.0660374164581 + }, + { + "step": 2640, + "loss": 0.3902108669281006, + "error": 0.193359375, + "gradient_norm": 0.10029696673154831, + "elapsed": 853.8638062477112 + }, + { + "step": 2656, + "loss": 0.15081660449504852, + "error": 0.0625, + "gradient_norm": 0.0303852129727602, + "elapsed": 858.9793758392334 + }, + { + "step": 2672, + "loss": 0.6503090858459473, + "error": 0.400390625, + "gradient_norm": 0.12611964344978333, + "elapsed": 863.9151141643524 + }, + { + "step": 2688, + "loss": 0.5587317943572998, + "error": 0.31640625, + "gradient_norm": 0.10028114914894104, + "elapsed": 868.7600305080414 + }, + { + "step": 2704, + "loss": 0.4399867355823517, + "error": 0.21484375, + "gradient_norm": 0.06889455020427704, + "elapsed": 873.4544236660004 + }, + { + "step": 2720, + "loss": 0.5865127444267273, + "error": 0.337890625, + "gradient_norm": 0.03671631962060928, + "elapsed": 878.0982644557953 + }, + { + "step": 2736, + "loss": 0.6078637838363647, + "error": 0.3701171875, + "gradient_norm": 0.04679318517446518, + "elapsed": 883.0424642562866 + }, + { + "step": 2752, + "loss": 0.5825340151786804, + "error": 0.337890625, + "gradient_norm": 0.05619681254029274, + "elapsed": 887.908124923706 + }, + { + "step": 2768, + "loss": 0.5970422029495239, + "error": 0.3369140625, + "gradient_norm": 0.041302867233753204, + "elapsed": 892.6760206222534 + }, + { + "step": 2784, + "loss": 0.3870226740837097, + "error": 0.1826171875, + "gradient_norm": 0.05731065198779106, + "elapsed": 897.6246056556702 + }, + { + "step": 2800, + "loss": 0.38130277395248413, + "error": 0.1943359375, + "gradient_norm": 0.059244755655527115, + "elapsed": 902.3360238075256 + }, + { + "step": 2816, + "loss": 0.2617901563644409, + "error": 0.1064453125, + "gradient_norm": 0.041736964136362076, + "elapsed": 907.1600468158722 + }, + { + "step": 2832, + "loss": 0.5819337368011475, + "error": 0.314453125, + "gradient_norm": 0.04097156226634979, + "elapsed": 912.0244295597076 + }, + { + "step": 2848, + "loss": 0.41393283009529114, + "error": 0.2001953125, + "gradient_norm": 0.10456771403551102, + "elapsed": 916.8225846290588 + }, + { + "step": 2864, + "loss": 0.5019145011901855, + "error": 0.2548828125, + "gradient_norm": 0.04843736067414284, + "elapsed": 921.538754940033 + }, + { + "step": 2880, + "loss": 0.04561338573694229, + "error": 0.0146484375, + "gradient_norm": 0.025407327339053154, + "elapsed": 926.2588667869568 + }, + { + "step": 2896, + "loss": 0.4338858723640442, + "error": 0.205078125, + "gradient_norm": 0.09900517761707306, + "elapsed": 930.9781975746155 + }, + { + "step": 2912, + "loss": 0.33922863006591797, + "error": 0.162109375, + "gradient_norm": 0.10189604014158249, + "elapsed": 935.6816267967224 + }, + { + "step": 2928, + "loss": 0.5294322967529297, + "error": 0.2822265625, + "gradient_norm": 0.09060791879892349, + "elapsed": 940.4373068809509 + }, + { + "step": 2944, + "loss": 0.037007369101047516, + "error": 0.01171875, + "gradient_norm": 0.05506489425897598, + "elapsed": 945.1270468235016 + }, + { + "step": 2960, + "loss": 0.6096771359443665, + "error": 0.349609375, + "gradient_norm": 0.04987221211194992, + "elapsed": 949.8300130367279 + }, + { + "step": 2976, + "loss": 0.6157823801040649, + "error": 0.373046875, + "gradient_norm": 0.03614233434200287, + "elapsed": 954.5701997280121 + }, + { + "step": 2992, + "loss": 0.1978239268064499, + "error": 0.080078125, + "gradient_norm": 0.05847112461924553, + "elapsed": 959.2756471633911 + }, + { + "step": 3008, + "loss": 0.5237340927124023, + "error": 0.2841796875, + "gradient_norm": 0.06993591040372849, + "elapsed": 963.9875864982605 + }, + { + "step": 3024, + "loss": 0.4559935927391052, + "error": 0.2373046875, + "gradient_norm": 0.05698448419570923, + "elapsed": 968.7997305393219 + }, + { + "step": 3040, + "loss": 0.5025208592414856, + "error": 0.259765625, + "gradient_norm": 0.14909739792346954, + "elapsed": 973.6042547225952 + }, + { + "step": 3056, + "loss": 0.3223109245300293, + "error": 0.1416015625, + "gradient_norm": 0.032974764704704285, + "elapsed": 978.4760546684265 + }, + { + "step": 3072, + "loss": 0.06682582199573517, + "error": 0.021484375, + "gradient_norm": 0.04433188587427139, + "elapsed": 983.2894048690796 + }, + { + "step": 3088, + "loss": 0.5919550061225891, + "error": 0.34765625, + "gradient_norm": 0.06721373647451401, + "elapsed": 1000.9520287513733 + }, + { + "step": 3104, + "loss": 0.5988063812255859, + "error": 0.3642578125, + "gradient_norm": 0.05654948577284813, + "elapsed": 1005.7442932128906 + }, + { + "step": 3120, + "loss": 0.4922299385070801, + "error": 0.2470703125, + "gradient_norm": 0.07545466721057892, + "elapsed": 1010.4616096019745 + }, + { + "step": 3136, + "loss": 0.4533671736717224, + "error": 0.236328125, + "gradient_norm": 0.06288722902536392, + "elapsed": 1015.3559956550598 + }, + { + "step": 3152, + "loss": 0.5070517063140869, + "error": 0.2666015625, + "gradient_norm": 0.07274917513132095, + "elapsed": 1020.0764343738556 + }, + { + "step": 3168, + "loss": 0.5999464988708496, + "error": 0.3408203125, + "gradient_norm": 0.05777016654610634, + "elapsed": 1024.9410600662231 + }, + { + "step": 3184, + "loss": 0.5758363008499146, + "error": 0.3427734375, + "gradient_norm": 0.051027461886405945, + "elapsed": 1029.7082171440125 + }, + { + "step": 3200, + "loss": 0.05016190931200981, + "error": 0.017578125, + "gradient_norm": 0.009175656363368034, + "elapsed": 1034.3982915878296 + }, + { + "step": 3216, + "loss": 0.5471057295799255, + "error": 0.318359375, + "gradient_norm": 0.07572721689939499, + "elapsed": 1039.117841243744 + }, + { + "step": 3232, + "loss": 0.4141446352005005, + "error": 0.193359375, + "gradient_norm": 0.10056859254837036, + "elapsed": 1043.880026102066 + }, + { + "step": 3248, + "loss": 0.5812438726425171, + "error": 0.3212890625, + "gradient_norm": 0.05781616270542145, + "elapsed": 1048.6406455039978 + }, + { + "step": 3264, + "loss": 0.19184701144695282, + "error": 0.078125, + "gradient_norm": 0.05367236211895943, + "elapsed": 1053.5672237873077 + }, + { + "step": 3280, + "loss": 0.5420833826065063, + "error": 0.28515625, + "gradient_norm": 0.052405405789613724, + "elapsed": 1058.3841104507446 + }, + { + "step": 3296, + "loss": 0.4419598877429962, + "error": 0.2177734375, + "gradient_norm": 0.05814693495631218, + "elapsed": 1063.1880333423615 + }, + { + "step": 3312, + "loss": 0.4525642991065979, + "error": 0.208984375, + "gradient_norm": 0.1061021164059639, + "elapsed": 1068.1370933055878 + }, + { + "step": 3328, + "loss": 0.32664671540260315, + "error": 0.154296875, + "gradient_norm": 0.05649850144982338, + "elapsed": 1073.1963467597961 + }, + { + "step": 3344, + "loss": 0.2655770182609558, + "error": 0.1220703125, + "gradient_norm": 0.04070372134447098, + "elapsed": 1078.2698318958282 + }, + { + "step": 3360, + "loss": 0.5894330739974976, + "error": 0.3544921875, + "gradient_norm": 0.0643400028347969, + "elapsed": 1083.0184152126312 + }, + { + "step": 3376, + "loss": 0.6118791103363037, + "error": 0.361328125, + "gradient_norm": 0.08537904173135757, + "elapsed": 1087.834038734436 + }, + { + "step": 3392, + "loss": 0.40694907307624817, + "error": 0.19921875, + "gradient_norm": 0.11411692947149277, + "elapsed": 1092.8119947910309 + }, + { + "step": 3408, + "loss": 0.04629015550017357, + "error": 0.0146484375, + "gradient_norm": 0.017204072326421738, + "elapsed": 1097.5751783847809 + }, + { + "step": 3424, + "loss": 0.20639702677726746, + "error": 0.0849609375, + "gradient_norm": 0.04801144450902939, + "elapsed": 1102.2970931529999 + }, + { + "step": 3440, + "loss": 0.6051071286201477, + "error": 0.33984375, + "gradient_norm": 0.045392412692308426, + "elapsed": 1107.1080610752106 + }, + { + "step": 3456, + "loss": 0.6553700566291809, + "error": 0.40625, + "gradient_norm": 0.05593863129615784, + "elapsed": 1111.8409752845764 + }, + { + "step": 3472, + "loss": 0.591402530670166, + "error": 0.3515625, + "gradient_norm": 0.051181379705667496, + "elapsed": 1116.5800333023071 + }, + { + "step": 3488, + "loss": 0.30494624376296997, + "error": 0.12109375, + "gradient_norm": 0.05175542086362839, + "elapsed": 1121.276373386383 + }, + { + "step": 3504, + "loss": 0.5065370798110962, + "error": 0.279296875, + "gradient_norm": 0.10419930517673492, + "elapsed": 1125.9883344173431 + }, + { + "step": 3520, + "loss": 0.3915700614452362, + "error": 0.1953125, + "gradient_norm": 0.060416825115680695, + "elapsed": 1130.7958455085754 + }, + { + "step": 3536, + "loss": 0.624374270439148, + "error": 0.3759765625, + "gradient_norm": 0.06069556251168251, + "elapsed": 1135.5360939502716 + }, + { + "step": 3552, + "loss": 0.5830206274986267, + "error": 0.3359375, + "gradient_norm": 0.046013280749320984, + "elapsed": 1140.312029838562 + }, + { + "step": 3568, + "loss": 0.4201379716396332, + "error": 0.2119140625, + "gradient_norm": 0.06909621506929398, + "elapsed": 1145.0904593467712 + }, + { + "step": 3584, + "loss": 0.28215405344963074, + "error": 0.1181640625, + "gradient_norm": 0.07625982910394669, + "elapsed": 1149.8156151771545 + }, + { + "step": 3600, + "loss": 0.5229164361953735, + "error": 0.275390625, + "gradient_norm": 0.055048178881406784, + "elapsed": 1154.5280592441559 + }, + { + "step": 3616, + "loss": 0.47238075733184814, + "error": 0.2314453125, + "gradient_norm": 0.06473162025213242, + "elapsed": 1159.2720873355865 + }, + { + "step": 3632, + "loss": 0.46245503425598145, + "error": 0.228515625, + "gradient_norm": 0.07382887601852417, + "elapsed": 1164.0119998455048 + }, + { + "step": 3648, + "loss": 0.37509745359420776, + "error": 0.171875, + "gradient_norm": 0.051260266453027725, + "elapsed": 1168.7440350055695 + }, + { + "step": 3664, + "loss": 0.1948484629392624, + "error": 0.080078125, + "gradient_norm": 0.059623416513204575, + "elapsed": 1173.3906588554382 + }, + { + "step": 3680, + "loss": 0.5552756786346436, + "error": 0.3115234375, + "gradient_norm": 0.08073585480451584, + "elapsed": 1178.0645008087158 + }, + { + "step": 3696, + "loss": 0.6405904293060303, + "error": 0.39453125, + "gradient_norm": 0.05899551138281822, + "elapsed": 1182.730489730835 + }, + { + "step": 3712, + "loss": 0.2767012119293213, + "error": 0.119140625, + "gradient_norm": 0.06593579798936844, + "elapsed": 1187.377315044403 + }, + { + "step": 3728, + "loss": 0.315812885761261, + "error": 0.134765625, + "gradient_norm": 0.035905495285987854, + "elapsed": 1192.0582301616669 + }, + { + "step": 3744, + "loss": 0.6033951640129089, + "error": 0.3544921875, + "gradient_norm": 0.05226197466254234, + "elapsed": 1196.7101175785065 + }, + { + "step": 3760, + "loss": 0.5202592611312866, + "error": 0.275390625, + "gradient_norm": 0.06367512047290802, + "elapsed": 1201.3543090820312 + }, + { + "step": 3776, + "loss": 0.24639368057250977, + "error": 0.1083984375, + "gradient_norm": 0.09370873868465424, + "elapsed": 1206.0717165470123 + }, + { + "step": 3792, + "loss": 0.6175658702850342, + "error": 0.375, + "gradient_norm": 0.06221585348248482, + "elapsed": 1210.754029750824 + }, + { + "step": 3808, + "loss": 0.41153696179389954, + "error": 0.2119140625, + "gradient_norm": 0.05355365574359894, + "elapsed": 1215.4374370574951 + }, + { + "step": 3824, + "loss": 0.28002214431762695, + "error": 0.1123046875, + "gradient_norm": 0.03846330568194389, + "elapsed": 1220.1207013130188 + }, + { + "step": 3840, + "loss": 0.0484195351600647, + "error": 0.013671875, + "gradient_norm": 0.03470242768526077, + "elapsed": 1224.8153104782104 + }, + { + "step": 3856, + "loss": 0.1407160609960556, + "error": 0.0458984375, + "gradient_norm": 0.04061700031161308, + "elapsed": 1229.5512235164642 + }, + { + "step": 3872, + "loss": 0.5881794691085815, + "error": 0.3427734375, + "gradient_norm": 0.062013477087020874, + "elapsed": 1234.3750183582306 + }, + { + "step": 3888, + "loss": 0.17833612859249115, + "error": 0.06640625, + "gradient_norm": 0.038856204599142075, + "elapsed": 1239.110375881195 + }, + { + "step": 3904, + "loss": 0.06211477518081665, + "error": 0.0224609375, + "gradient_norm": 0.02150108851492405, + "elapsed": 1243.800644159317 + }, + { + "step": 3920, + "loss": 0.06039723381400108, + "error": 0.01953125, + "gradient_norm": 0.019367367029190063, + "elapsed": 1248.4831748008728 + }, + { + "step": 3936, + "loss": 0.6010214686393738, + "error": 0.3525390625, + "gradient_norm": 0.051659151911735535, + "elapsed": 1253.1423478126526 + }, + { + "step": 3952, + "loss": 0.5867137312889099, + "error": 0.3388671875, + "gradient_norm": 0.058528851717710495, + "elapsed": 1257.9799931049347 + }, + { + "step": 3968, + "loss": 0.5231834650039673, + "error": 0.2578125, + "gradient_norm": 0.10128334909677505, + "elapsed": 1262.6990082263947 + }, + { + "step": 3984, + "loss": 0.6251651644706726, + "error": 0.353515625, + "gradient_norm": 0.06211795285344124, + "elapsed": 1267.4289934635162 + }, + { + "step": 4000, + "loss": 0.06667037308216095, + "error": 0.01953125, + "gradient_norm": 0.048018258064985275, + "elapsed": 1272.132089138031 + }, + { + "step": 4016, + "loss": 0.5286938548088074, + "error": 0.2744140625, + "gradient_norm": 0.05509360507130623, + "elapsed": 1276.8878977298737 + }, + { + "step": 4032, + "loss": 0.34016552567481995, + "error": 0.1591796875, + "gradient_norm": 0.07597329467535019, + "elapsed": 1281.7364926338196 + }, + { + "step": 4048, + "loss": 0.17750494182109833, + "error": 0.078125, + "gradient_norm": 0.06314503401517868, + "elapsed": 1286.5033600330353 + }, + { + "step": 4064, + "loss": 0.5882893800735474, + "error": 0.34375, + "gradient_norm": 0.10986580699682236, + "elapsed": 1291.1944887638092 + }, + { + "step": 4080, + "loss": 0.4923543930053711, + "error": 0.2568359375, + "gradient_norm": 0.050325747579336166, + "elapsed": 1295.9372322559357 + }, + { + "step": 4096, + "loss": 0.44146978855133057, + "error": 0.2236328125, + "gradient_norm": 0.06535191088914871, + "elapsed": 1300.641023159027 + } + ] + }, + "training_source_snapshot": "training_sources/temporal2", + "selected_checkpoint_steps": [ + "1024", + "2048", + "4096" + ], + "checkpoint_records": { + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "unique_training_rows_seen_in_this_phase": 804757, + "weights": "weights-1024.npz", + "weights_sha256": "0d809362d5afe1dc781f716e3aee1a9bc5a8f75fed6cc0ff6339b9abcf600ada", + "validation": "validation-1024.json", + "complete": true + }, + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints; when listed, blend candidates average the recorded small-contextual reference and new probabilities equally", + "blend_reference": "/run-state/workspace/research/context_upgrades/continuation2/predictions", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.24672475961538465, + "1024": 0.24571814903846154, + "2048": 0.24504206730769232, + "3072": 0.2456129807692308, + "4096": 0.2445763221153846, + "blend-1024": 0.2469501201923077, + "blend-2048": 0.24583834134615387, + "blend-3072": 0.2458984375, + "blend-4096": 0.2456580528846154 + }, + "selected": "4096" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2530348557692308, + "1024": 0.2528545673076923, + "2048": 0.25342548076923077, + "3072": 0.25369591346153847, + "4096": 0.25446213942307694, + "blend-1024": 0.2531550480769231, + "blend-2048": 0.2536658653846154, + "blend-3072": 0.25329026442307695, + "blend-4096": 0.2540264423076923 + }, + "selected": "1024" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.23442007211538465, + "1024": 0.23445012019230768, + "2048": 0.2340895432692308, + "3072": 0.23431490384615383, + "4096": 0.23366887019230773, + "blend-1024": 0.23440504807692308, + "blend-2048": 0.2341496394230769, + "blend-3072": 0.23416466346153844, + "blend-4096": 0.23413461538461536 + }, + "selected": "4096" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.2392427884615385, + "1024": 0.23949819711538464, + "2048": 0.23907752403846155, + "3072": 0.24014423076923078, + "4096": 0.24064002403846152, + "blend-1024": 0.23916766826923075, + "blend-2048": 0.23886718750000002, + "blend-3072": 0.2392578125, + "blend-4096": 0.23900240384615387 + }, + "selected": "blend-2048" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24630408653846156, + "1024": 0.24649939903846152, + "2048": 0.2460486778846154, + "3072": 0.24523737980769228, + "4096": 0.24463641826923077, + "blend-1024": 0.24615384615384614, + "blend-2048": 0.2456580528846154, + "blend-3072": 0.24583834134615384, + "blend-4096": 0.24576322115384613 + }, + "selected": "4096" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.23760516826923078, + "1024": 0.23733473557692308, + "2048": 0.23652343749999996, + "3072": 0.23795072115384613, + "4096": 0.2379807692307692, + "blend-1024": 0.23713942307692307, + "blend-2048": 0.23740985576923077, + "blend-3072": 0.23811598557692307, + "blend-4096": 0.23780048076923077 + }, + "selected": "2048" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.2371694711538461, + "1024": 0.23689903846153845, + "2048": 0.2371243990384615, + "3072": 0.2371844951923077, + "4096": 0.23562199519230764, + "blend-1024": 0.23715444711538464, + "blend-2048": 0.23662860576923078, + "blend-3072": 0.23712439903846153, + "blend-4096": 0.23643329326923077 + }, + "selected": "4096" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.23342848557692306, + "1024": 0.23353365384615385, + "2048": 0.23429987980769232, + "3072": 0.2335637019230769, + "4096": 0.2329627403846154, + "blend-1024": 0.23350360576923074, + "blend-2048": 0.23383413461538463, + "blend-3072": 0.23357872596153847, + "blend-4096": 0.2333533653846154 + }, + "selected": "4096" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2325420673076923 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22017728365384615 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "temporal2_swa", + "training_run": { + "initialization": "Uniform averages of the same session-trained temporal trajectory; no external weights", + "optimizer_updates_in_derived_run": 0, + "source_training_provenance": { + "initialization": "Continue from this session's trained checkpoint", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "training_source_sha256": { + "learned_exact__temporal_train.py": "7d48d2fc7f62d0bec3023b3df1c2ac28537d0417966131ae3a156697a34cda5f", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "eligible_training_shots": 2067520, + "unique_training_rows_seen_in_this_phase": 1778773, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 18357, + "surface_code_bX_d3_r03_center_3_5": 16816, + "surface_code_bX_d3_r05_center_3_5": 17999, + "surface_code_bX_d3_r07_center_3_5": 15225, + "surface_code_bX_d3_r09_center_3_5": 16132, + "surface_code_bX_d3_r11_center_3_5": 17041, + "surface_code_bX_d3_r13_center_3_5": 18477, + "surface_code_bX_d3_r15_center_3_5": 18214, + "surface_code_bX_d3_r17_center_3_5": 16505, + "surface_code_bX_d3_r19_center_3_5": 17120, + "surface_code_bX_d3_r21_center_3_5": 17563, + "surface_code_bX_d3_r23_center_3_5": 16681, + "surface_code_bX_d3_r25_center_3_5": 18379, + "surface_code_bX_d3_r01_center_5_3": 17450, + "surface_code_bX_d3_r03_center_5_3": 17161, + "surface_code_bX_d3_r05_center_5_3": 15797, + "surface_code_bX_d3_r07_center_5_3": 17800, + "surface_code_bX_d3_r09_center_5_3": 17190, + "surface_code_bX_d3_r11_center_5_3": 15840, + "surface_code_bX_d3_r13_center_5_3": 15178, + "surface_code_bX_d3_r15_center_5_3": 14897, + "surface_code_bX_d3_r17_center_5_3": 18252, + "surface_code_bX_d3_r19_center_5_3": 17083, + "surface_code_bX_d3_r21_center_5_3": 17229, + "surface_code_bX_d3_r23_center_5_3": 14735, + "surface_code_bX_d3_r25_center_5_3": 17949, + "surface_code_bX_d3_r01_center_5_7": 17431, + "surface_code_bX_d3_r03_center_5_7": 16583, + "surface_code_bX_d3_r05_center_5_7": 16891, + "surface_code_bX_d3_r07_center_5_7": 17969, + "surface_code_bX_d3_r09_center_5_7": 17966, + "surface_code_bX_d3_r11_center_5_7": 14424, + "surface_code_bX_d3_r13_center_5_7": 16930, + "surface_code_bX_d3_r15_center_5_7": 15205, + "surface_code_bX_d3_r17_center_5_7": 18252, + "surface_code_bX_d3_r19_center_5_7": 17077, + "surface_code_bX_d3_r21_center_5_7": 16770, + "surface_code_bX_d3_r23_center_5_7": 17308, + "surface_code_bX_d3_r25_center_5_7": 17481, + "surface_code_bX_d3_r01_center_7_5": 16630, + "surface_code_bX_d3_r03_center_7_5": 17439, + "surface_code_bX_d3_r05_center_7_5": 15811, + "surface_code_bX_d3_r07_center_7_5": 16637, + "surface_code_bX_d3_r09_center_7_5": 18306, + "surface_code_bX_d3_r11_center_7_5": 18327, + "surface_code_bX_d3_r13_center_7_5": 17974, + "surface_code_bX_d3_r15_center_7_5": 16106, + "surface_code_bX_d3_r17_center_7_5": 15834, + "surface_code_bX_d3_r19_center_7_5": 17242, + "surface_code_bX_d3_r21_center_7_5": 17889, + "surface_code_bX_d3_r23_center_7_5": 17440, + "surface_code_bX_d3_r25_center_7_5": 17087, + "surface_code_bZ_d3_r01_center_3_5": 16236, + "surface_code_bZ_d3_r03_center_3_5": 17278, + "surface_code_bZ_d3_r05_center_3_5": 16577, + "surface_code_bZ_d3_r07_center_3_5": 17376, + "surface_code_bZ_d3_r09_center_3_5": 16000, + "surface_code_bZ_d3_r11_center_3_5": 15634, + "surface_code_bZ_d3_r13_center_3_5": 14950, + "surface_code_bZ_d3_r15_center_3_5": 16600, + "surface_code_bZ_d3_r17_center_3_5": 15381, + "surface_code_bZ_d3_r19_center_3_5": 16823, + "surface_code_bZ_d3_r21_center_3_5": 18789, + "surface_code_bZ_d3_r23_center_3_5": 15616, + "surface_code_bZ_d3_r25_center_3_5": 17088, + "surface_code_bZ_d3_r01_center_5_3": 17935, + "surface_code_bZ_d3_r03_center_5_3": 16256, + "surface_code_bZ_d3_r05_center_5_3": 17959, + "surface_code_bZ_d3_r07_center_5_3": 18401, + "surface_code_bZ_d3_r09_center_5_3": 16405, + "surface_code_bZ_d3_r11_center_5_3": 17274, + "surface_code_bZ_d3_r13_center_5_3": 18172, + "surface_code_bZ_d3_r15_center_5_3": 17525, + "surface_code_bZ_d3_r17_center_5_3": 18643, + "surface_code_bZ_d3_r19_center_5_3": 17816, + "surface_code_bZ_d3_r21_center_5_3": 17404, + "surface_code_bZ_d3_r23_center_5_3": 17253, + "surface_code_bZ_d3_r25_center_5_3": 17667, + "surface_code_bZ_d3_r01_center_5_7": 16203, + "surface_code_bZ_d3_r03_center_5_7": 17214, + "surface_code_bZ_d3_r05_center_5_7": 16799, + "surface_code_bZ_d3_r07_center_5_7": 17896, + "surface_code_bZ_d3_r09_center_5_7": 16411, + "surface_code_bZ_d3_r11_center_5_7": 17726, + "surface_code_bZ_d3_r13_center_5_7": 16313, + "surface_code_bZ_d3_r15_center_5_7": 17824, + "surface_code_bZ_d3_r17_center_5_7": 15656, + "surface_code_bZ_d3_r19_center_5_7": 17169, + "surface_code_bZ_d3_r21_center_5_7": 17194, + "surface_code_bZ_d3_r23_center_5_7": 16779, + "surface_code_bZ_d3_r25_center_5_7": 16970, + "surface_code_bZ_d3_r01_center_7_5": 16762, + "surface_code_bZ_d3_r03_center_7_5": 17320, + "surface_code_bZ_d3_r05_center_7_5": 17522, + "surface_code_bZ_d3_r07_center_7_5": 17914, + "surface_code_bZ_d3_r09_center_7_5": 18439, + "surface_code_bZ_d3_r11_center_7_5": 18218, + "surface_code_bZ_d3_r13_center_7_5": 17907, + "surface_code_bZ_d3_r15_center_7_5": 17597, + "surface_code_bZ_d3_r17_center_7_5": 18252, + "surface_code_bZ_d3_r19_center_7_5": 18379, + "surface_code_bZ_d3_r21_center_7_5": 16818, + "surface_code_bZ_d3_r23_center_7_5": 18430, + "surface_code_bZ_d3_r25_center_7_5": 17924 + }, + "steps": 4096, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.0005, + "sampling_seed": 20261121, + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_exact/temporal1/rng-2048.json", + "session_trained_starting_checkpoint": "/run-state/workspace/research/learned_exact/temporal1/weights-2048.npz", + "starting_checkpoint_sha256": "26be9e0259b69a5870bf73e80a5a29fcf3519a3ff63e1d219c57a2113d9d34be", + "starting_training_provenance": { + "initialization": "Continue from rich weights trained from random initialization in this session; new temporal parameters randomly initialized now", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 2048, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261111, + "optimizer_restored": false, + "rng_restored": false, + "session_trained_starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.6317505836486816, + "error": 0.3681640625, + "gradient_norm": 0.04013459011912346, + "elapsed": 30.971998691558838 + }, + { + "step": 16, + "loss": 0.5091081857681274, + "error": 0.291015625, + "gradient_norm": 0.042228709906339645, + "elapsed": 35.17463397979736 + }, + { + "step": 32, + "loss": 0.626472532749176, + "error": 0.3642578125, + "gradient_norm": 0.05872415751218796, + "elapsed": 39.678136110305786 + }, + { + "step": 48, + "loss": 0.6005369424819946, + "error": 0.3515625, + "gradient_norm": 0.03848014399409294, + "elapsed": 44.16946887969971 + }, + { + "step": 64, + "loss": 0.5523768663406372, + "error": 0.302734375, + "gradient_norm": 0.06031862646341324, + "elapsed": 48.65217089653015 + }, + { + "step": 80, + "loss": 0.3981674611568451, + "error": 0.19921875, + "gradient_norm": 0.0542079322040081, + "elapsed": 53.21601867675781 + }, + { + "step": 96, + "loss": 0.5601426362991333, + "error": 0.2978515625, + "gradient_norm": 0.04770371690392494, + "elapsed": 57.81089663505554 + }, + { + "step": 112, + "loss": 0.5878150463104248, + "error": 0.34765625, + "gradient_norm": 0.10699950158596039, + "elapsed": 62.42190766334534 + }, + { + "step": 128, + "loss": 0.5232458114624023, + "error": 0.2861328125, + "gradient_norm": 0.0911584198474884, + "elapsed": 67.00223755836487 + }, + { + "step": 144, + "loss": 0.6119767427444458, + "error": 0.3623046875, + "gradient_norm": 0.062474437057971954, + "elapsed": 71.54070782661438 + }, + { + "step": 160, + "loss": 0.3037984371185303, + "error": 0.1474609375, + "gradient_norm": 0.05718141421675682, + "elapsed": 76.08167362213135 + }, + { + "step": 176, + "loss": 0.6038273572921753, + "error": 0.3662109375, + "gradient_norm": 0.0437164381146431, + "elapsed": 80.71864247322083 + }, + { + "step": 192, + "loss": 0.3304370641708374, + "error": 0.1572265625, + "gradient_norm": 0.05684761330485344, + "elapsed": 85.54437017440796 + }, + { + "step": 208, + "loss": 0.5785484313964844, + "error": 0.3251953125, + "gradient_norm": 0.09597272425889969, + "elapsed": 91.51522874832153 + }, + { + "step": 224, + "loss": 0.3110499978065491, + "error": 0.13671875, + "gradient_norm": 0.04815748706459999, + "elapsed": 97.1228940486908 + }, + { + "step": 240, + "loss": 0.6213864684104919, + "error": 0.3623046875, + "gradient_norm": 0.0540502592921257, + "elapsed": 102.90286135673523 + }, + { + "step": 256, + "loss": 0.2535272240638733, + "error": 0.1064453125, + "gradient_norm": 0.029962118715047836, + "elapsed": 108.39288640022278 + }, + { + "step": 272, + "loss": 0.6126939058303833, + "error": 0.3671875, + "gradient_norm": 0.06887879222631454, + "elapsed": 113.83897161483765 + }, + { + "step": 288, + "loss": 0.4556676149368286, + "error": 0.2236328125, + "gradient_norm": 0.16127081215381622, + "elapsed": 119.93085813522339 + }, + { + "step": 304, + "loss": 0.4973585605621338, + "error": 0.255859375, + "gradient_norm": 0.08082302659749985, + "elapsed": 125.90891909599304 + }, + { + "step": 320, + "loss": 0.6455868482589722, + "error": 0.419921875, + "gradient_norm": 0.04339660331606865, + "elapsed": 131.20537638664246 + }, + { + "step": 336, + "loss": 0.5343132615089417, + "error": 0.2880859375, + "gradient_norm": 0.07518009096384048, + "elapsed": 136.59086871147156 + }, + { + "step": 352, + "loss": 0.6505346894264221, + "error": 0.4033203125, + "gradient_norm": 0.03800992667675018, + "elapsed": 142.21085906028748 + }, + { + "step": 368, + "loss": 0.4882712960243225, + "error": 0.251953125, + "gradient_norm": 0.08170920610427856, + "elapsed": 146.95903658866882 + }, + { + "step": 384, + "loss": 0.5292021036148071, + "error": 0.296875, + "gradient_norm": 0.08454013615846634, + "elapsed": 151.6385259628296 + }, + { + "step": 400, + "loss": 0.6272899508476257, + "error": 0.3837890625, + "gradient_norm": 0.051436979323625565, + "elapsed": 156.3343904018402 + }, + { + "step": 416, + "loss": 0.052130259573459625, + "error": 0.0166015625, + "gradient_norm": 0.02377190627157688, + "elapsed": 160.92345547676086 + }, + { + "step": 432, + "loss": 0.5256737470626831, + "error": 0.3046875, + "gradient_norm": 0.07986386120319366, + "elapsed": 165.52879118919373 + }, + { + "step": 448, + "loss": 0.15193665027618408, + "error": 0.0576171875, + "gradient_norm": 0.06491660326719284, + "elapsed": 170.14827823638916 + }, + { + "step": 464, + "loss": 0.6418055295944214, + "error": 0.40625, + "gradient_norm": 0.07290885597467422, + "elapsed": 174.64974284172058 + }, + { + "step": 480, + "loss": 0.6055159568786621, + "error": 0.357421875, + "gradient_norm": 0.0795595794916153, + "elapsed": 179.17218685150146 + }, + { + "step": 496, + "loss": 0.6372283697128296, + "error": 0.3916015625, + "gradient_norm": 0.04387903958559036, + "elapsed": 183.77568197250366 + }, + { + "step": 512, + "loss": 0.637977123260498, + "error": 0.408203125, + "gradient_norm": 0.060665905475616455, + "elapsed": 188.31205368041992 + }, + { + "step": 528, + "loss": 0.4668862223625183, + "error": 0.2451171875, + "gradient_norm": 0.08566711097955704, + "elapsed": 206.40719985961914 + }, + { + "step": 544, + "loss": 0.4584413170814514, + "error": 0.244140625, + "gradient_norm": 0.08538200706243515, + "elapsed": 211.02819895744324 + }, + { + "step": 560, + "loss": 0.5615692138671875, + "error": 0.3291015625, + "gradient_norm": 0.043748609721660614, + "elapsed": 215.66470766067505 + }, + { + "step": 576, + "loss": 0.5151895880699158, + "error": 0.2880859375, + "gradient_norm": 0.05164863541722298, + "elapsed": 220.18949556350708 + }, + { + "step": 592, + "loss": 0.5618112087249756, + "error": 0.3291015625, + "gradient_norm": 0.05998719856142998, + "elapsed": 224.7216100692749 + }, + { + "step": 608, + "loss": 0.659294843673706, + "error": 0.431640625, + "gradient_norm": 0.09910348802804947, + "elapsed": 229.26827573776245 + }, + { + "step": 624, + "loss": 0.5895233154296875, + "error": 0.3447265625, + "gradient_norm": 0.045334093272686005, + "elapsed": 233.83731055259705 + }, + { + "step": 640, + "loss": 0.6081801056861877, + "error": 0.3388671875, + "gradient_norm": 0.06578423827886581, + "elapsed": 238.36345624923706 + }, + { + "step": 656, + "loss": 0.5349816083908081, + "error": 0.2939453125, + "gradient_norm": 0.09989562630653381, + "elapsed": 242.95086026191711 + }, + { + "step": 672, + "loss": 0.5871994495391846, + "error": 0.328125, + "gradient_norm": 0.08132346719503403, + "elapsed": 247.67088556289673 + }, + { + "step": 688, + "loss": 0.06012660637497902, + "error": 0.0146484375, + "gradient_norm": 0.012170507572591305, + "elapsed": 252.3202247619629 + }, + { + "step": 704, + "loss": 0.42179757356643677, + "error": 0.21484375, + "gradient_norm": 0.08384513854980469, + "elapsed": 256.91991782188416 + }, + { + "step": 720, + "loss": 0.6111758947372437, + "error": 0.3720703125, + "gradient_norm": 0.06689880788326263, + "elapsed": 261.56407928466797 + }, + { + "step": 736, + "loss": 0.29969727993011475, + "error": 0.1318359375, + "gradient_norm": 0.0743367150425911, + "elapsed": 266.22199630737305 + }, + { + "step": 752, + "loss": 0.051849883049726486, + "error": 0.0166015625, + "gradient_norm": 0.017005126923322678, + "elapsed": 270.8602342605591 + }, + { + "step": 768, + "loss": 0.6178420186042786, + "error": 0.3759765625, + "gradient_norm": 0.027732960879802704, + "elapsed": 275.47888374328613 + }, + { + "step": 784, + "loss": 0.45798996090888977, + "error": 0.228515625, + "gradient_norm": 0.0630083829164505, + "elapsed": 280.1709156036377 + }, + { + "step": 800, + "loss": 0.5104988813400269, + "error": 0.2724609375, + "gradient_norm": 0.041733670979738235, + "elapsed": 286.17937707901 + }, + { + "step": 816, + "loss": 0.6336112022399902, + "error": 0.3837890625, + "gradient_norm": 0.0755191296339035, + "elapsed": 291.7506103515625 + }, + { + "step": 832, + "loss": 0.6260952353477478, + "error": 0.3603515625, + "gradient_norm": 0.0318005345761776, + "elapsed": 297.31094622612 + }, + { + "step": 848, + "loss": 0.5870074033737183, + "error": 0.3525390625, + "gradient_norm": 0.12073405832052231, + "elapsed": 303.11089158058167 + }, + { + "step": 864, + "loss": 0.5125640034675598, + "error": 0.26953125, + "gradient_norm": 0.038650237023830414, + "elapsed": 308.7288725376129 + }, + { + "step": 880, + "loss": 0.19194915890693665, + "error": 0.0703125, + "gradient_norm": 0.061878547072410583, + "elapsed": 314.37042355537415 + }, + { + "step": 896, + "loss": 0.5409250259399414, + "error": 0.2919921875, + "gradient_norm": 0.06288820505142212, + "elapsed": 319.9398190975189 + }, + { + "step": 912, + "loss": 0.6164936423301697, + "error": 0.3701171875, + "gradient_norm": 0.043224163353443146, + "elapsed": 325.361323595047 + }, + { + "step": 928, + "loss": 0.16032151877880096, + "error": 0.0625, + "gradient_norm": 0.030957572162151337, + "elapsed": 331.21752285957336 + }, + { + "step": 944, + "loss": 0.646601676940918, + "error": 0.3818359375, + "gradient_norm": 0.05670839175581932, + "elapsed": 336.7825517654419 + }, + { + "step": 960, + "loss": 0.402952641248703, + "error": 0.1865234375, + "gradient_norm": 0.07500886172056198, + "elapsed": 342.6888346672058 + }, + { + "step": 976, + "loss": 0.5537433624267578, + "error": 0.2939453125, + "gradient_norm": 0.04955969750881195, + "elapsed": 348.5554690361023 + }, + { + "step": 992, + "loss": 0.559626579284668, + "error": 0.294921875, + "gradient_norm": 0.048295993357896805, + "elapsed": 354.3531894683838 + }, + { + "step": 1008, + "loss": 0.5034694671630859, + "error": 0.2705078125, + "gradient_norm": 0.05729879066348076, + "elapsed": 360.0949149131775 + }, + { + "step": 1024, + "loss": 0.3119734525680542, + "error": 0.1259765625, + "gradient_norm": 0.052326612174510956, + "elapsed": 365.7881224155426 + }, + { + "step": 1040, + "loss": 0.35799849033355713, + "error": 0.173828125, + "gradient_norm": 0.03801804035902023, + "elapsed": 386.5749418735504 + }, + { + "step": 1056, + "loss": 0.6178948879241943, + "error": 0.3515625, + "gradient_norm": 0.03620661422610283, + "elapsed": 391.48247838020325 + }, + { + "step": 1072, + "loss": 0.49231401085853577, + "error": 0.24609375, + "gradient_norm": 0.04391559213399887, + "elapsed": 396.08718824386597 + }, + { + "step": 1088, + "loss": 0.4119300842285156, + "error": 0.2001953125, + "gradient_norm": 0.1104700043797493, + "elapsed": 400.5326828956604 + }, + { + "step": 1104, + "loss": 0.4926626682281494, + "error": 0.265625, + "gradient_norm": 0.04246886447072029, + "elapsed": 404.95741271972656 + }, + { + "step": 1120, + "loss": 0.5027930736541748, + "error": 0.2607421875, + "gradient_norm": 0.0547240674495697, + "elapsed": 409.40319633483887 + }, + { + "step": 1136, + "loss": 0.5948058366775513, + "error": 0.3544921875, + "gradient_norm": 0.06810063123703003, + "elapsed": 413.8514006137848 + }, + { + "step": 1152, + "loss": 0.26567256450653076, + "error": 0.125, + "gradient_norm": 0.06689104437828064, + "elapsed": 418.29868721961975 + }, + { + "step": 1168, + "loss": 0.2866836190223694, + "error": 0.1240234375, + "gradient_norm": 0.029536213725805283, + "elapsed": 422.75131845474243 + }, + { + "step": 1184, + "loss": 0.6342021822929382, + "error": 0.4091796875, + "gradient_norm": 0.0704190731048584, + "elapsed": 427.1991722583771 + }, + { + "step": 1200, + "loss": 0.41626787185668945, + "error": 0.212890625, + "gradient_norm": 0.04480795934796333, + "elapsed": 431.6600706577301 + }, + { + "step": 1216, + "loss": 0.28460952639579773, + "error": 0.1337890625, + "gradient_norm": 0.03666983172297478, + "elapsed": 436.14414525032043 + }, + { + "step": 1232, + "loss": 0.044482216238975525, + "error": 0.0146484375, + "gradient_norm": 0.04537617415189743, + "elapsed": 440.6220428943634 + }, + { + "step": 1248, + "loss": 0.42564862966537476, + "error": 0.2119140625, + "gradient_norm": 0.03382417559623718, + "elapsed": 445.06736421585083 + }, + { + "step": 1264, + "loss": 0.27150213718414307, + "error": 0.123046875, + "gradient_norm": 0.033046118915081024, + "elapsed": 449.544029712677 + }, + { + "step": 1280, + "loss": 0.4927375912666321, + "error": 0.255859375, + "gradient_norm": 0.06812550127506256, + "elapsed": 454.07198667526245 + }, + { + "step": 1296, + "loss": 0.5541940927505493, + "error": 0.28125, + "gradient_norm": 0.1435294896364212, + "elapsed": 458.6031415462494 + }, + { + "step": 1312, + "loss": 0.5575842261314392, + "error": 0.2958984375, + "gradient_norm": 0.03811952844262123, + "elapsed": 463.1806228160858 + }, + { + "step": 1328, + "loss": 0.3479428291320801, + "error": 0.1591796875, + "gradient_norm": 0.0709012895822525, + "elapsed": 467.84689688682556 + }, + { + "step": 1344, + "loss": 0.1685580611228943, + "error": 0.0693359375, + "gradient_norm": 0.05423415079712868, + "elapsed": 472.6908576488495 + }, + { + "step": 1360, + "loss": 0.18506410717964172, + "error": 0.0771484375, + "gradient_norm": 0.03418596833944321, + "elapsed": 477.4269769191742 + }, + { + "step": 1376, + "loss": 0.5654555559158325, + "error": 0.3173828125, + "gradient_norm": 0.0685155838727951, + "elapsed": 482.08285188674927 + }, + { + "step": 1392, + "loss": 0.6116407513618469, + "error": 0.3603515625, + "gradient_norm": 0.05198948457837105, + "elapsed": 486.7167499065399 + }, + { + "step": 1408, + "loss": 0.4014682471752167, + "error": 0.19140625, + "gradient_norm": 0.1024075523018837, + "elapsed": 491.4308760166168 + }, + { + "step": 1424, + "loss": 0.051035866141319275, + "error": 0.0166015625, + "gradient_norm": 0.010207361541688442, + "elapsed": 496.1818380355835 + }, + { + "step": 1440, + "loss": 0.4725648760795593, + "error": 0.2412109375, + "gradient_norm": 0.03977378085255623, + "elapsed": 500.8668632507324 + }, + { + "step": 1456, + "loss": 0.5407818555831909, + "error": 0.2939453125, + "gradient_norm": 0.088577501475811, + "elapsed": 505.49274134635925 + }, + { + "step": 1472, + "loss": 0.5655064582824707, + "error": 0.3076171875, + "gradient_norm": 0.04452778398990631, + "elapsed": 510.2188584804535 + }, + { + "step": 1488, + "loss": 0.5799556374549866, + "error": 0.30859375, + "gradient_norm": 0.03976206108927727, + "elapsed": 514.9319434165955 + }, + { + "step": 1504, + "loss": 0.4660354256629944, + "error": 0.25390625, + "gradient_norm": 0.04365506023168564, + "elapsed": 519.5848798751831 + }, + { + "step": 1520, + "loss": 0.5505894422531128, + "error": 0.30859375, + "gradient_norm": 0.057772211730480194, + "elapsed": 524.3388590812683 + }, + { + "step": 1536, + "loss": 0.6251416206359863, + "error": 0.400390625, + "gradient_norm": 0.09649194777011871, + "elapsed": 529.483047246933 + }, + { + "step": 1552, + "loss": 0.05424533039331436, + "error": 0.0185546875, + "gradient_norm": 0.011683990247547626, + "elapsed": 548.1828610897064 + }, + { + "step": 1568, + "loss": 0.33612310886383057, + "error": 0.1611328125, + "gradient_norm": 0.051817383617162704, + "elapsed": 553.4256420135498 + }, + { + "step": 1584, + "loss": 0.045015305280685425, + "error": 0.0166015625, + "gradient_norm": 0.022604886442422867, + "elapsed": 558.6308543682098 + }, + { + "step": 1600, + "loss": 0.2701840102672577, + "error": 0.119140625, + "gradient_norm": 0.02910422720015049, + "elapsed": 563.8571691513062 + }, + { + "step": 1616, + "loss": 0.18982334434986115, + "error": 0.0849609375, + "gradient_norm": 0.025524422526359558, + "elapsed": 568.8628678321838 + }, + { + "step": 1632, + "loss": 0.3950161337852478, + "error": 0.185546875, + "gradient_norm": 0.08419577777385712, + "elapsed": 574.0815451145172 + }, + { + "step": 1648, + "loss": 0.49384528398513794, + "error": 0.255859375, + "gradient_norm": 0.08879344165325165, + "elapsed": 579.1229114532471 + }, + { + "step": 1664, + "loss": 0.5671384930610657, + "error": 0.3115234375, + "gradient_norm": 0.05374513566493988, + "elapsed": 584.114851474762 + }, + { + "step": 1680, + "loss": 0.6192574501037598, + "error": 0.37890625, + "gradient_norm": 0.043836336582899094, + "elapsed": 589.0708522796631 + }, + { + "step": 1696, + "loss": 0.2619469463825226, + "error": 0.1171875, + "gradient_norm": 0.040093280375003815, + "elapsed": 594.2814819812775 + }, + { + "step": 1712, + "loss": 0.33178141713142395, + "error": 0.162109375, + "gradient_norm": 0.04902712255716324, + "elapsed": 599.3068840503693 + }, + { + "step": 1728, + "loss": 0.385281503200531, + "error": 0.171875, + "gradient_norm": 0.03541380167007446, + "elapsed": 604.5308682918549 + }, + { + "step": 1744, + "loss": 0.1628715693950653, + "error": 0.0693359375, + "gradient_norm": 0.06111741065979004, + "elapsed": 609.309522151947 + }, + { + "step": 1760, + "loss": 0.5239119529724121, + "error": 0.2861328125, + "gradient_norm": 0.08513613045215607, + "elapsed": 614.0396001338959 + }, + { + "step": 1776, + "loss": 0.35721707344055176, + "error": 0.150390625, + "gradient_norm": 0.06337940692901611, + "elapsed": 618.6857132911682 + }, + { + "step": 1792, + "loss": 0.5985626578330994, + "error": 0.33203125, + "gradient_norm": 0.035725343972444534, + "elapsed": 623.3352344036102 + }, + { + "step": 1808, + "loss": 0.34676820039749146, + "error": 0.15234375, + "gradient_norm": 0.08163885772228241, + "elapsed": 627.9495220184326 + }, + { + "step": 1824, + "loss": 0.5633711814880371, + "error": 0.3037109375, + "gradient_norm": 0.05938677117228508, + "elapsed": 632.5820379257202 + }, + { + "step": 1840, + "loss": 0.6256523132324219, + "error": 0.384765625, + "gradient_norm": 0.04545137286186218, + "elapsed": 637.205274105072 + }, + { + "step": 1856, + "loss": 0.28091639280319214, + "error": 0.1298828125, + "gradient_norm": 0.04705077037215233, + "elapsed": 641.883561372757 + }, + { + "step": 1872, + "loss": 0.516182541847229, + "error": 0.263671875, + "gradient_norm": 0.08828777819871902, + "elapsed": 646.5188939571381 + }, + { + "step": 1888, + "loss": 0.48386621475219727, + "error": 0.25390625, + "gradient_norm": 0.05322824418544769, + "elapsed": 651.148512840271 + }, + { + "step": 1904, + "loss": 0.6141921281814575, + "error": 0.388671875, + "gradient_norm": 0.050139278173446655, + "elapsed": 655.7796437740326 + }, + { + "step": 1920, + "loss": 0.18002840876579285, + "error": 0.0712890625, + "gradient_norm": 0.04201133921742439, + "elapsed": 660.4064948558807 + }, + { + "step": 1936, + "loss": 0.17531852424144745, + "error": 0.0732421875, + "gradient_norm": 0.024726318195462227, + "elapsed": 664.9991583824158 + }, + { + "step": 1952, + "loss": 0.5088322758674622, + "error": 0.2744140625, + "gradient_norm": 0.04693225398659706, + "elapsed": 669.5544555187225 + }, + { + "step": 1968, + "loss": 0.5684165358543396, + "error": 0.3310546875, + "gradient_norm": 0.031029095873236656, + "elapsed": 674.2354445457458 + }, + { + "step": 1984, + "loss": 0.06459524482488632, + "error": 0.017578125, + "gradient_norm": 0.03600892797112465, + "elapsed": 678.7982559204102 + }, + { + "step": 2000, + "loss": 0.3614455461502075, + "error": 0.1748046875, + "gradient_norm": 0.07060294598340988, + "elapsed": 683.2650325298309 + }, + { + "step": 2016, + "loss": 0.35535523295402527, + "error": 0.166015625, + "gradient_norm": 0.05873403698205948, + "elapsed": 687.7125518321991 + }, + { + "step": 2032, + "loss": 0.5638720989227295, + "error": 0.3232421875, + "gradient_norm": 0.07380504906177521, + "elapsed": 692.1461188793182 + }, + { + "step": 2048, + "loss": 0.5301838517189026, + "error": 0.2919921875, + "gradient_norm": 0.05435395985841751, + "elapsed": 696.6235508918762 + } + ] + }, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.250907301902771, + "error": 0.1083984375, + "gradient_norm": 0.07171476632356644, + "elapsed": 44.811134576797485 + }, + { + "step": 16, + "loss": 0.5958679914474487, + "error": 0.3662109375, + "gradient_norm": 0.07673005014657974, + "elapsed": 49.90856671333313 + }, + { + "step": 32, + "loss": 0.47648972272872925, + "error": 0.2421875, + "gradient_norm": 0.08561501652002335, + "elapsed": 55.179388761520386 + }, + { + "step": 48, + "loss": 0.06145006790757179, + "error": 0.0234375, + "gradient_norm": 0.01556467730551958, + "elapsed": 61.0339195728302 + }, + { + "step": 64, + "loss": 0.3687053918838501, + "error": 0.1884765625, + "gradient_norm": 0.08752371370792389, + "elapsed": 65.95811891555786 + }, + { + "step": 80, + "loss": 0.6481984853744507, + "error": 0.4140625, + "gradient_norm": 0.05311283841729164, + "elapsed": 70.56021332740784 + }, + { + "step": 96, + "loss": 0.42319929599761963, + "error": 0.2138671875, + "gradient_norm": 0.05047478526830673, + "elapsed": 75.11613631248474 + }, + { + "step": 112, + "loss": 0.47527259588241577, + "error": 0.24609375, + "gradient_norm": 0.038366906344890594, + "elapsed": 79.53446984291077 + }, + { + "step": 128, + "loss": 0.5996723175048828, + "error": 0.3369140625, + "gradient_norm": 0.1213272362947464, + "elapsed": 83.97515749931335 + }, + { + "step": 144, + "loss": 0.04971993714570999, + "error": 0.0146484375, + "gradient_norm": 0.008080735802650452, + "elapsed": 88.44039463996887 + }, + { + "step": 160, + "loss": 0.35900360345840454, + "error": 0.162109375, + "gradient_norm": 0.03359593451023102, + "elapsed": 92.89548206329346 + }, + { + "step": 176, + "loss": 0.5342063903808594, + "error": 0.2978515625, + "gradient_norm": 0.04794691130518913, + "elapsed": 97.35658049583435 + }, + { + "step": 192, + "loss": 0.6300076246261597, + "error": 0.369140625, + "gradient_norm": 0.081769198179245, + "elapsed": 101.81493759155273 + }, + { + "step": 208, + "loss": 0.6191903948783875, + "error": 0.3828125, + "gradient_norm": 0.07145775109529495, + "elapsed": 106.2480263710022 + }, + { + "step": 224, + "loss": 0.5155678391456604, + "error": 0.28515625, + "gradient_norm": 0.06772179156541824, + "elapsed": 110.71284222602844 + }, + { + "step": 240, + "loss": 0.634708046913147, + "error": 0.3857421875, + "gradient_norm": 0.09493093192577362, + "elapsed": 115.14978742599487 + }, + { + "step": 256, + "loss": 0.1840895414352417, + "error": 0.0751953125, + "gradient_norm": 0.025586696341633797, + "elapsed": 119.61202120780945 + }, + { + "step": 272, + "loss": 0.2775103449821472, + "error": 0.12890625, + "gradient_norm": 0.06913147866725922, + "elapsed": 124.02584528923035 + }, + { + "step": 288, + "loss": 0.6163080334663391, + "error": 0.3642578125, + "gradient_norm": 0.05895426496863365, + "elapsed": 128.46512532234192 + }, + { + "step": 304, + "loss": 0.5276986360549927, + "error": 0.287109375, + "gradient_norm": 0.06955187022686005, + "elapsed": 132.89240765571594 + }, + { + "step": 320, + "loss": 0.44859516620635986, + "error": 0.22265625, + "gradient_norm": 0.07272452116012573, + "elapsed": 137.32864713668823 + }, + { + "step": 336, + "loss": 0.48315611481666565, + "error": 0.2626953125, + "gradient_norm": 0.03321139141917229, + "elapsed": 141.80009770393372 + }, + { + "step": 352, + "loss": 0.6107717752456665, + "error": 0.3544921875, + "gradient_norm": 0.05243214592337608, + "elapsed": 146.36439752578735 + }, + { + "step": 368, + "loss": 0.6215153932571411, + "error": 0.357421875, + "gradient_norm": 0.04383325204253197, + "elapsed": 150.99996852874756 + }, + { + "step": 384, + "loss": 0.6130329966545105, + "error": 0.35546875, + "gradient_norm": 0.04113119840621948, + "elapsed": 155.62374639511108 + }, + { + "step": 400, + "loss": 0.30471885204315186, + "error": 0.142578125, + "gradient_norm": 0.04447556659579277, + "elapsed": 160.17594957351685 + }, + { + "step": 416, + "loss": 0.6154489517211914, + "error": 0.37109375, + "gradient_norm": 0.04456057772040367, + "elapsed": 164.7639675140381 + }, + { + "step": 432, + "loss": 0.6134694218635559, + "error": 0.337890625, + "gradient_norm": 0.04219559207558632, + "elapsed": 169.32792139053345 + }, + { + "step": 448, + "loss": 0.5463185906410217, + "error": 0.2939453125, + "gradient_norm": 0.07746092975139618, + "elapsed": 173.88445162773132 + }, + { + "step": 464, + "loss": 0.06016772612929344, + "error": 0.01953125, + "gradient_norm": 0.01364185381680727, + "elapsed": 178.42725706100464 + }, + { + "step": 480, + "loss": 0.388141393661499, + "error": 0.18359375, + "gradient_norm": 0.04870256036520004, + "elapsed": 182.99062085151672 + }, + { + "step": 496, + "loss": 0.44524821639060974, + "error": 0.2216796875, + "gradient_norm": 0.03453445807099342, + "elapsed": 187.56396961212158 + }, + { + "step": 512, + "loss": 0.34312355518341064, + "error": 0.154296875, + "gradient_norm": 0.06794509291648865, + "elapsed": 192.27511191368103 + }, + { + "step": 528, + "loss": 0.19467462599277496, + "error": 0.0771484375, + "gradient_norm": 0.042381469160318375, + "elapsed": 197.7108268737793 + }, + { + "step": 544, + "loss": 0.46226584911346436, + "error": 0.2421875, + "gradient_norm": 0.06073570251464844, + "elapsed": 202.97405791282654 + }, + { + "step": 560, + "loss": 0.525318443775177, + "error": 0.2822265625, + "gradient_norm": 0.06954885274171829, + "elapsed": 208.69676971435547 + }, + { + "step": 576, + "loss": 0.6158387064933777, + "error": 0.349609375, + "gradient_norm": 0.07587578892707825, + "elapsed": 214.80397653579712 + }, + { + "step": 592, + "loss": 0.5515886545181274, + "error": 0.298828125, + "gradient_norm": 0.04969338700175285, + "elapsed": 220.27399611473083 + }, + { + "step": 608, + "loss": 0.18365338444709778, + "error": 0.0654296875, + "gradient_norm": 0.08657706528902054, + "elapsed": 224.81246256828308 + }, + { + "step": 624, + "loss": 0.4578855633735657, + "error": 0.2421875, + "gradient_norm": 0.04942100867629051, + "elapsed": 229.45902252197266 + }, + { + "step": 640, + "loss": 0.37826013565063477, + "error": 0.1865234375, + "gradient_norm": 0.047499872744083405, + "elapsed": 233.9695644378662 + }, + { + "step": 656, + "loss": 0.40863412618637085, + "error": 0.2001953125, + "gradient_norm": 0.07845330238342285, + "elapsed": 238.584894657135 + }, + { + "step": 672, + "loss": 0.5640332698822021, + "error": 0.2880859375, + "gradient_norm": 0.057469289749860764, + "elapsed": 243.0929844379425 + }, + { + "step": 688, + "loss": 0.030216243118047714, + "error": 0.0078125, + "gradient_norm": 0.04682641476392746, + "elapsed": 247.581125497818 + }, + { + "step": 704, + "loss": 0.375002384185791, + "error": 0.1826171875, + "gradient_norm": 0.04864194989204407, + "elapsed": 252.1564691066742 + }, + { + "step": 720, + "loss": 0.5145515203475952, + "error": 0.2744140625, + "gradient_norm": 0.052671682089567184, + "elapsed": 256.6466488838196 + }, + { + "step": 736, + "loss": 0.067174531519413, + "error": 0.0224609375, + "gradient_norm": 0.019299577921628952, + "elapsed": 261.1185076236725 + }, + { + "step": 752, + "loss": 0.24909992516040802, + "error": 0.111328125, + "gradient_norm": 0.06907463818788528, + "elapsed": 265.61960339546204 + }, + { + "step": 768, + "loss": 0.5088074207305908, + "error": 0.2744140625, + "gradient_norm": 0.06963017582893372, + "elapsed": 270.07474064826965 + }, + { + "step": 784, + "loss": 0.3783387839794159, + "error": 0.1826171875, + "gradient_norm": 0.05537794530391693, + "elapsed": 274.52722239494324 + }, + { + "step": 800, + "loss": 0.6107200980186462, + "error": 0.3623046875, + "gradient_norm": 0.0470259003341198, + "elapsed": 279.0401859283447 + }, + { + "step": 816, + "loss": 0.5778236389160156, + "error": 0.3212890625, + "gradient_norm": 0.10146680474281311, + "elapsed": 283.5114622116089 + }, + { + "step": 832, + "loss": 0.576002299785614, + "error": 0.3076171875, + "gradient_norm": 0.07760787010192871, + "elapsed": 288.04797434806824 + }, + { + "step": 848, + "loss": 0.6179666519165039, + "error": 0.3740234375, + "gradient_norm": 0.07383852452039719, + "elapsed": 292.60600209236145 + }, + { + "step": 864, + "loss": 0.3105512857437134, + "error": 0.1455078125, + "gradient_norm": 0.052953749895095825, + "elapsed": 297.12180352211 + }, + { + "step": 880, + "loss": 0.4802623987197876, + "error": 0.2548828125, + "gradient_norm": 0.07736275345087051, + "elapsed": 301.6091134548187 + }, + { + "step": 896, + "loss": 0.5572722554206848, + "error": 0.318359375, + "gradient_norm": 0.053303152322769165, + "elapsed": 306.1978073120117 + }, + { + "step": 912, + "loss": 0.34814420342445374, + "error": 0.1669921875, + "gradient_norm": 0.037726350128650665, + "elapsed": 310.78571581840515 + }, + { + "step": 928, + "loss": 0.41743016242980957, + "error": 0.21875, + "gradient_norm": 0.05238872766494751, + "elapsed": 315.24156188964844 + }, + { + "step": 944, + "loss": 0.5757850408554077, + "error": 0.3173828125, + "gradient_norm": 0.05837905779480934, + "elapsed": 319.78475165367126 + }, + { + "step": 960, + "loss": 0.40727972984313965, + "error": 0.197265625, + "gradient_norm": 0.059294261038303375, + "elapsed": 324.2090265750885 + }, + { + "step": 976, + "loss": 0.32715001702308655, + "error": 0.1533203125, + "gradient_norm": 0.11543179303407669, + "elapsed": 328.6462152004242 + }, + { + "step": 992, + "loss": 0.5578742623329163, + "error": 0.314453125, + "gradient_norm": 0.06282714009284973, + "elapsed": 333.0712504386902 + }, + { + "step": 1008, + "loss": 0.5052692294120789, + "error": 0.265625, + "gradient_norm": 0.04039420187473297, + "elapsed": 337.5182821750641 + }, + { + "step": 1024, + "loss": 0.18790806829929352, + "error": 0.08203125, + "gradient_norm": 0.028905188664793968, + "elapsed": 342.08340406417847 + }, + { + "step": 1040, + "loss": 0.6317684650421143, + "error": 0.3681640625, + "gradient_norm": 0.03441835194826126, + "elapsed": 358.8279616832733 + }, + { + "step": 1056, + "loss": 0.40474164485931396, + "error": 0.2021484375, + "gradient_norm": 0.036449309438467026, + "elapsed": 363.30218267440796 + }, + { + "step": 1072, + "loss": 0.518299400806427, + "error": 0.2666015625, + "gradient_norm": 0.0886964276432991, + "elapsed": 367.87997555732727 + }, + { + "step": 1088, + "loss": 0.2522922158241272, + "error": 0.099609375, + "gradient_norm": 0.07553310692310333, + "elapsed": 372.4414882659912 + }, + { + "step": 1104, + "loss": 0.6214810609817505, + "error": 0.3701171875, + "gradient_norm": 0.10188957303762436, + "elapsed": 376.9120502471924 + }, + { + "step": 1120, + "loss": 0.6307054162025452, + "error": 0.3720703125, + "gradient_norm": 0.07353860139846802, + "elapsed": 381.3824534416199 + }, + { + "step": 1136, + "loss": 0.5259381532669067, + "error": 0.2763671875, + "gradient_norm": 0.05779678374528885, + "elapsed": 385.8413143157959 + }, + { + "step": 1152, + "loss": 0.4995541572570801, + "error": 0.259765625, + "gradient_norm": 0.046648140996694565, + "elapsed": 390.28326058387756 + }, + { + "step": 1168, + "loss": 0.6075694561004639, + "error": 0.3701171875, + "gradient_norm": 0.10612073540687561, + "elapsed": 394.8162364959717 + }, + { + "step": 1184, + "loss": 0.2105136513710022, + "error": 0.080078125, + "gradient_norm": 0.0716402605175972, + "elapsed": 399.2960283756256 + }, + { + "step": 1200, + "loss": 0.6371631026268005, + "error": 0.3857421875, + "gradient_norm": 0.0549108125269413, + "elapsed": 403.7899103164673 + }, + { + "step": 1216, + "loss": 0.5450670719146729, + "error": 0.2939453125, + "gradient_norm": 0.11688558012247086, + "elapsed": 408.34677600860596 + }, + { + "step": 1232, + "loss": 0.035783201456069946, + "error": 0.01171875, + "gradient_norm": 0.02951689623296261, + "elapsed": 412.8558337688446 + }, + { + "step": 1248, + "loss": 0.5582903623580933, + "error": 0.3046875, + "gradient_norm": 0.055107031017541885, + "elapsed": 417.29854226112366 + }, + { + "step": 1264, + "loss": 0.5154441595077515, + "error": 0.27734375, + "gradient_norm": 0.04474929720163345, + "elapsed": 421.7792055606842 + }, + { + "step": 1280, + "loss": 0.35227546095848083, + "error": 0.16015625, + "gradient_norm": 0.05024837702512741, + "elapsed": 426.54427456855774 + }, + { + "step": 1296, + "loss": 0.19417589902877808, + "error": 0.0830078125, + "gradient_norm": 0.026926057413220406, + "elapsed": 431.320588350296 + }, + { + "step": 1312, + "loss": 0.4768218398094177, + "error": 0.248046875, + "gradient_norm": 0.15099607408046722, + "elapsed": 435.96817326545715 + }, + { + "step": 1328, + "loss": 0.48580923676490784, + "error": 0.2509765625, + "gradient_norm": 0.08925126492977142, + "elapsed": 440.64917039871216 + }, + { + "step": 1344, + "loss": 0.42041274905204773, + "error": 0.1982421875, + "gradient_norm": 0.08321093022823334, + "elapsed": 445.34370946884155 + }, + { + "step": 1360, + "loss": 0.06403929740190506, + "error": 0.0185546875, + "gradient_norm": 0.03817005455493927, + "elapsed": 449.98669385910034 + }, + { + "step": 1376, + "loss": 0.463126003742218, + "error": 0.2275390625, + "gradient_norm": 0.08894515782594681, + "elapsed": 454.6478977203369 + }, + { + "step": 1392, + "loss": 0.5995306968688965, + "error": 0.373046875, + "gradient_norm": 0.06733685731887817, + "elapsed": 459.35924530029297 + }, + { + "step": 1408, + "loss": 0.49053263664245605, + "error": 0.25, + "gradient_norm": 0.10475508868694305, + "elapsed": 464.100093126297 + }, + { + "step": 1424, + "loss": 0.6220744848251343, + "error": 0.3818359375, + "gradient_norm": 0.03653963655233383, + "elapsed": 468.89601135253906 + }, + { + "step": 1440, + "loss": 0.39706122875213623, + "error": 0.2021484375, + "gradient_norm": 0.04344598576426506, + "elapsed": 474.03999519348145 + }, + { + "step": 1456, + "loss": 0.5386708974838257, + "error": 0.3095703125, + "gradient_norm": 0.12589037418365479, + "elapsed": 478.8600504398346 + }, + { + "step": 1472, + "loss": 0.49776726961135864, + "error": 0.271484375, + "gradient_norm": 0.058137863874435425, + "elapsed": 483.5920066833496 + }, + { + "step": 1488, + "loss": 0.4757428765296936, + "error": 0.2412109375, + "gradient_norm": 0.050453316420316696, + "elapsed": 488.4611999988556 + }, + { + "step": 1504, + "loss": 0.5694847702980042, + "error": 0.337890625, + "gradient_norm": 0.052419569343328476, + "elapsed": 493.26151037216187 + }, + { + "step": 1520, + "loss": 0.5997745990753174, + "error": 0.3603515625, + "gradient_norm": 0.04338108375668526, + "elapsed": 498.0421245098114 + }, + { + "step": 1536, + "loss": 0.6195274591445923, + "error": 0.3876953125, + "gradient_norm": 0.04848463833332062, + "elapsed": 502.8808298110962 + }, + { + "step": 1552, + "loss": 0.46315908432006836, + "error": 0.2353515625, + "gradient_norm": 0.06380566209554672, + "elapsed": 507.5519721508026 + }, + { + "step": 1568, + "loss": 0.605262041091919, + "error": 0.36328125, + "gradient_norm": 0.05077619478106499, + "elapsed": 512.457685470581 + }, + { + "step": 1584, + "loss": 0.48782041668891907, + "error": 0.232421875, + "gradient_norm": 0.09017211943864822, + "elapsed": 517.2960062026978 + }, + { + "step": 1600, + "loss": 0.3881351947784424, + "error": 0.1875, + "gradient_norm": 0.07205695658922195, + "elapsed": 522.0911631584167 + }, + { + "step": 1616, + "loss": 0.4966873526573181, + "error": 0.24609375, + "gradient_norm": 0.0582038015127182, + "elapsed": 526.8861901760101 + }, + { + "step": 1632, + "loss": 0.5844199657440186, + "error": 0.33203125, + "gradient_norm": 0.05101500824093819, + "elapsed": 531.6640138626099 + }, + { + "step": 1648, + "loss": 0.31010180711746216, + "error": 0.1318359375, + "gradient_norm": 0.053135693073272705, + "elapsed": 536.4960391521454 + }, + { + "step": 1664, + "loss": 0.6174807548522949, + "error": 0.3779296875, + "gradient_norm": 0.04161194711923599, + "elapsed": 541.2560484409332 + }, + { + "step": 1680, + "loss": 0.18213607370853424, + "error": 0.0751953125, + "gradient_norm": 0.07171957194805145, + "elapsed": 546.0000085830688 + }, + { + "step": 1696, + "loss": 0.5445692539215088, + "error": 0.2998046875, + "gradient_norm": 0.054499462246894836, + "elapsed": 551.1221191883087 + }, + { + "step": 1712, + "loss": 0.05744167044758797, + "error": 0.017578125, + "gradient_norm": 0.013108699582517147, + "elapsed": 556.5286149978638 + }, + { + "step": 1728, + "loss": 0.6381571292877197, + "error": 0.3896484375, + "gradient_norm": 0.05157556012272835, + "elapsed": 561.8000066280365 + }, + { + "step": 1744, + "loss": 0.5301004648208618, + "error": 0.28125, + "gradient_norm": 0.04218568280339241, + "elapsed": 567.2760035991669 + }, + { + "step": 1760, + "loss": 0.5275102257728577, + "error": 0.26953125, + "gradient_norm": 0.06798839569091797, + "elapsed": 572.5601994991302 + }, + { + "step": 1776, + "loss": 0.6443773508071899, + "error": 0.4091796875, + "gradient_norm": 0.07035460323095322, + "elapsed": 577.9789206981659 + }, + { + "step": 1792, + "loss": 0.6012362241744995, + "error": 0.337890625, + "gradient_norm": 0.05189951881766319, + "elapsed": 583.028017282486 + }, + { + "step": 1808, + "loss": 0.2939091920852661, + "error": 0.12109375, + "gradient_norm": 0.05555355176329613, + "elapsed": 588.0501506328583 + }, + { + "step": 1824, + "loss": 0.2059091478586197, + "error": 0.08984375, + "gradient_norm": 0.045679714530706406, + "elapsed": 593.2120039463043 + }, + { + "step": 1840, + "loss": 0.6289581060409546, + "error": 0.349609375, + "gradient_norm": 0.04742642492055893, + "elapsed": 598.7767763137817 + }, + { + "step": 1856, + "loss": 0.5532636642456055, + "error": 0.294921875, + "gradient_norm": 0.05997413396835327, + "elapsed": 604.0475382804871 + }, + { + "step": 1872, + "loss": 0.45995670557022095, + "error": 0.228515625, + "gradient_norm": 0.05674462765455246, + "elapsed": 609.292379617691 + }, + { + "step": 1888, + "loss": 0.6178656816482544, + "error": 0.359375, + "gradient_norm": 0.08857566863298416, + "elapsed": 614.5639882087708 + }, + { + "step": 1904, + "loss": 0.5531284213066101, + "error": 0.287109375, + "gradient_norm": 0.10257937759160995, + "elapsed": 619.5600035190582 + }, + { + "step": 1920, + "loss": 0.04184349626302719, + "error": 0.013671875, + "gradient_norm": 0.04087059944868088, + "elapsed": 624.6679775714874 + }, + { + "step": 1936, + "loss": 0.5924860239028931, + "error": 0.3505859375, + "gradient_norm": 0.036822713911533356, + "elapsed": 629.936680316925 + }, + { + "step": 1952, + "loss": 0.46996980905532837, + "error": 0.2421875, + "gradient_norm": 0.034442272037267685, + "elapsed": 635.1109762191772 + }, + { + "step": 1968, + "loss": 0.17859068512916565, + "error": 0.0712890625, + "gradient_norm": 0.03440066799521446, + "elapsed": 640.32000207901 + }, + { + "step": 1984, + "loss": 0.6192275285720825, + "error": 0.3701171875, + "gradient_norm": 0.04386439174413681, + "elapsed": 645.6040184497833 + }, + { + "step": 2000, + "loss": 0.6160917282104492, + "error": 0.35546875, + "gradient_norm": 0.06268990784883499, + "elapsed": 650.7723731994629 + }, + { + "step": 2016, + "loss": 0.6343611478805542, + "error": 0.388671875, + "gradient_norm": 0.04243326932191849, + "elapsed": 655.972663640976 + }, + { + "step": 2032, + "loss": 0.062292590737342834, + "error": 0.021484375, + "gradient_norm": 0.016680095344781876, + "elapsed": 660.8079733848572 + }, + { + "step": 2048, + "loss": 0.5316072702407837, + "error": 0.26953125, + "gradient_norm": 0.057860780507326126, + "elapsed": 665.5760209560394 + }, + { + "step": 2064, + "loss": 0.605312705039978, + "error": 0.3623046875, + "gradient_norm": 0.04028146713972092, + "elapsed": 682.7294294834137 + }, + { + "step": 2080, + "loss": 0.56633460521698, + "error": 0.3330078125, + "gradient_norm": 0.09528280049562454, + "elapsed": 687.4644649028778 + }, + { + "step": 2096, + "loss": 0.3905397057533264, + "error": 0.1943359375, + "gradient_norm": 0.049456462264060974, + "elapsed": 692.1492264270782 + }, + { + "step": 2112, + "loss": 0.28124868869781494, + "error": 0.1259765625, + "gradient_norm": 0.059239838272333145, + "elapsed": 696.8701393604279 + }, + { + "step": 2128, + "loss": 0.6364338994026184, + "error": 0.392578125, + "gradient_norm": 0.08667811006307602, + "elapsed": 701.683988571167 + }, + { + "step": 2144, + "loss": 0.20683243870735168, + "error": 0.07421875, + "gradient_norm": 0.1100710779428482, + "elapsed": 706.4000360965729 + }, + { + "step": 2160, + "loss": 0.5912737250328064, + "error": 0.341796875, + "gradient_norm": 0.05641854554414749, + "elapsed": 711.2359964847565 + }, + { + "step": 2176, + "loss": 0.27793264389038086, + "error": 0.12109375, + "gradient_norm": 0.0893034040927887, + "elapsed": 715.9508004188538 + }, + { + "step": 2192, + "loss": 0.6474133133888245, + "error": 0.4072265625, + "gradient_norm": 0.06980258971452713, + "elapsed": 720.651974439621 + }, + { + "step": 2208, + "loss": 0.5961858630180359, + "error": 0.35546875, + "gradient_norm": 0.06530112773180008, + "elapsed": 725.496098279953 + }, + { + "step": 2224, + "loss": 0.47581571340560913, + "error": 0.263671875, + "gradient_norm": 0.04470043256878853, + "elapsed": 730.2880010604858 + }, + { + "step": 2240, + "loss": 0.577988862991333, + "error": 0.318359375, + "gradient_norm": 0.07201159745454788, + "elapsed": 735.006133556366 + }, + { + "step": 2256, + "loss": 0.28444671630859375, + "error": 0.1181640625, + "gradient_norm": 0.048656050115823746, + "elapsed": 739.6868116855621 + }, + { + "step": 2272, + "loss": 0.2776409089565277, + "error": 0.1201171875, + "gradient_norm": 0.05783981829881668, + "elapsed": 744.3517308235168 + }, + { + "step": 2288, + "loss": 0.621599555015564, + "error": 0.37109375, + "gradient_norm": 0.09731200337409973, + "elapsed": 749.0351710319519 + }, + { + "step": 2304, + "loss": 0.3333754539489746, + "error": 0.1513671875, + "gradient_norm": 0.07069239765405655, + "elapsed": 753.7588081359863 + }, + { + "step": 2320, + "loss": 0.4687051773071289, + "error": 0.2490234375, + "gradient_norm": 0.044891707599163055, + "elapsed": 758.4588432312012 + }, + { + "step": 2336, + "loss": 0.19801637530326843, + "error": 0.078125, + "gradient_norm": 0.10036595165729523, + "elapsed": 763.256409406662 + }, + { + "step": 2352, + "loss": 0.6186277866363525, + "error": 0.388671875, + "gradient_norm": 0.09069584310054779, + "elapsed": 767.9986386299133 + }, + { + "step": 2368, + "loss": 0.6177258491516113, + "error": 0.373046875, + "gradient_norm": 0.049019571393728256, + "elapsed": 772.730831861496 + }, + { + "step": 2384, + "loss": 0.17707547545433044, + "error": 0.0673828125, + "gradient_norm": 0.045190781354904175, + "elapsed": 777.4072704315186 + }, + { + "step": 2400, + "loss": 0.20144733786582947, + "error": 0.08203125, + "gradient_norm": 0.04537162929773331, + "elapsed": 782.0841658115387 + }, + { + "step": 2416, + "loss": 0.6151775121688843, + "error": 0.365234375, + "gradient_norm": 0.050534047186374664, + "elapsed": 786.762966632843 + }, + { + "step": 2432, + "loss": 0.5533859133720398, + "error": 0.314453125, + "gradient_norm": 0.06006559729576111, + "elapsed": 791.4656012058258 + }, + { + "step": 2448, + "loss": 0.5329082012176514, + "error": 0.2880859375, + "gradient_norm": 0.04018115997314453, + "elapsed": 796.1704161167145 + }, + { + "step": 2464, + "loss": 0.6338047981262207, + "error": 0.4140625, + "gradient_norm": 0.06069163978099823, + "elapsed": 800.9180119037628 + }, + { + "step": 2480, + "loss": 0.1603008508682251, + "error": 0.0673828125, + "gradient_norm": 0.040350593626499176, + "elapsed": 805.6127603054047 + }, + { + "step": 2496, + "loss": 0.505940318107605, + "error": 0.2568359375, + "gradient_norm": 0.05209952965378761, + "elapsed": 810.3740313053131 + }, + { + "step": 2512, + "loss": 0.5528728365898132, + "error": 0.298828125, + "gradient_norm": 0.11757992953062057, + "elapsed": 815.1708807945251 + }, + { + "step": 2528, + "loss": 0.5028313994407654, + "error": 0.2666015625, + "gradient_norm": 0.08823780715465546, + "elapsed": 819.8585045337677 + }, + { + "step": 2544, + "loss": 0.5002262592315674, + "error": 0.2783203125, + "gradient_norm": 0.04888603836297989, + "elapsed": 824.5714073181152 + }, + { + "step": 2560, + "loss": 0.6007894277572632, + "error": 0.328125, + "gradient_norm": 0.05186954140663147, + "elapsed": 829.3080432415009 + }, + { + "step": 2576, + "loss": 0.18641480803489685, + "error": 0.076171875, + "gradient_norm": 0.03799928352236748, + "elapsed": 834.044020652771 + }, + { + "step": 2592, + "loss": 0.3050769865512848, + "error": 0.1396484375, + "gradient_norm": 0.10119257122278214, + "elapsed": 838.8401296138763 + }, + { + "step": 2608, + "loss": 0.6063439846038818, + "error": 0.361328125, + "gradient_norm": 0.04979367554187775, + "elapsed": 844.3572654724121 + }, + { + "step": 2624, + "loss": 0.5751967430114746, + "error": 0.3369140625, + "gradient_norm": 0.04269539937376976, + "elapsed": 849.0660374164581 + }, + { + "step": 2640, + "loss": 0.3902108669281006, + "error": 0.193359375, + "gradient_norm": 0.10029696673154831, + "elapsed": 853.8638062477112 + }, + { + "step": 2656, + "loss": 0.15081660449504852, + "error": 0.0625, + "gradient_norm": 0.0303852129727602, + "elapsed": 858.9793758392334 + }, + { + "step": 2672, + "loss": 0.6503090858459473, + "error": 0.400390625, + "gradient_norm": 0.12611964344978333, + "elapsed": 863.9151141643524 + }, + { + "step": 2688, + "loss": 0.5587317943572998, + "error": 0.31640625, + "gradient_norm": 0.10028114914894104, + "elapsed": 868.7600305080414 + }, + { + "step": 2704, + "loss": 0.4399867355823517, + "error": 0.21484375, + "gradient_norm": 0.06889455020427704, + "elapsed": 873.4544236660004 + }, + { + "step": 2720, + "loss": 0.5865127444267273, + "error": 0.337890625, + "gradient_norm": 0.03671631962060928, + "elapsed": 878.0982644557953 + }, + { + "step": 2736, + "loss": 0.6078637838363647, + "error": 0.3701171875, + "gradient_norm": 0.04679318517446518, + "elapsed": 883.0424642562866 + }, + { + "step": 2752, + "loss": 0.5825340151786804, + "error": 0.337890625, + "gradient_norm": 0.05619681254029274, + "elapsed": 887.908124923706 + }, + { + "step": 2768, + "loss": 0.5970422029495239, + "error": 0.3369140625, + "gradient_norm": 0.041302867233753204, + "elapsed": 892.6760206222534 + }, + { + "step": 2784, + "loss": 0.3870226740837097, + "error": 0.1826171875, + "gradient_norm": 0.05731065198779106, + "elapsed": 897.6246056556702 + }, + { + "step": 2800, + "loss": 0.38130277395248413, + "error": 0.1943359375, + "gradient_norm": 0.059244755655527115, + "elapsed": 902.3360238075256 + }, + { + "step": 2816, + "loss": 0.2617901563644409, + "error": 0.1064453125, + "gradient_norm": 0.041736964136362076, + "elapsed": 907.1600468158722 + }, + { + "step": 2832, + "loss": 0.5819337368011475, + "error": 0.314453125, + "gradient_norm": 0.04097156226634979, + "elapsed": 912.0244295597076 + }, + { + "step": 2848, + "loss": 0.41393283009529114, + "error": 0.2001953125, + "gradient_norm": 0.10456771403551102, + "elapsed": 916.8225846290588 + }, + { + "step": 2864, + "loss": 0.5019145011901855, + "error": 0.2548828125, + "gradient_norm": 0.04843736067414284, + "elapsed": 921.538754940033 + }, + { + "step": 2880, + "loss": 0.04561338573694229, + "error": 0.0146484375, + "gradient_norm": 0.025407327339053154, + "elapsed": 926.2588667869568 + }, + { + "step": 2896, + "loss": 0.4338858723640442, + "error": 0.205078125, + "gradient_norm": 0.09900517761707306, + "elapsed": 930.9781975746155 + }, + { + "step": 2912, + "loss": 0.33922863006591797, + "error": 0.162109375, + "gradient_norm": 0.10189604014158249, + "elapsed": 935.6816267967224 + }, + { + "step": 2928, + "loss": 0.5294322967529297, + "error": 0.2822265625, + "gradient_norm": 0.09060791879892349, + "elapsed": 940.4373068809509 + }, + { + "step": 2944, + "loss": 0.037007369101047516, + "error": 0.01171875, + "gradient_norm": 0.05506489425897598, + "elapsed": 945.1270468235016 + }, + { + "step": 2960, + "loss": 0.6096771359443665, + "error": 0.349609375, + "gradient_norm": 0.04987221211194992, + "elapsed": 949.8300130367279 + }, + { + "step": 2976, + "loss": 0.6157823801040649, + "error": 0.373046875, + "gradient_norm": 0.03614233434200287, + "elapsed": 954.5701997280121 + }, + { + "step": 2992, + "loss": 0.1978239268064499, + "error": 0.080078125, + "gradient_norm": 0.05847112461924553, + "elapsed": 959.2756471633911 + }, + { + "step": 3008, + "loss": 0.5237340927124023, + "error": 0.2841796875, + "gradient_norm": 0.06993591040372849, + "elapsed": 963.9875864982605 + }, + { + "step": 3024, + "loss": 0.4559935927391052, + "error": 0.2373046875, + "gradient_norm": 0.05698448419570923, + "elapsed": 968.7997305393219 + }, + { + "step": 3040, + "loss": 0.5025208592414856, + "error": 0.259765625, + "gradient_norm": 0.14909739792346954, + "elapsed": 973.6042547225952 + }, + { + "step": 3056, + "loss": 0.3223109245300293, + "error": 0.1416015625, + "gradient_norm": 0.032974764704704285, + "elapsed": 978.4760546684265 + }, + { + "step": 3072, + "loss": 0.06682582199573517, + "error": 0.021484375, + "gradient_norm": 0.04433188587427139, + "elapsed": 983.2894048690796 + }, + { + "step": 3088, + "loss": 0.5919550061225891, + "error": 0.34765625, + "gradient_norm": 0.06721373647451401, + "elapsed": 1000.9520287513733 + }, + { + "step": 3104, + "loss": 0.5988063812255859, + "error": 0.3642578125, + "gradient_norm": 0.05654948577284813, + "elapsed": 1005.7442932128906 + }, + { + "step": 3120, + "loss": 0.4922299385070801, + "error": 0.2470703125, + "gradient_norm": 0.07545466721057892, + "elapsed": 1010.4616096019745 + }, + { + "step": 3136, + "loss": 0.4533671736717224, + "error": 0.236328125, + "gradient_norm": 0.06288722902536392, + "elapsed": 1015.3559956550598 + }, + { + "step": 3152, + "loss": 0.5070517063140869, + "error": 0.2666015625, + "gradient_norm": 0.07274917513132095, + "elapsed": 1020.0764343738556 + }, + { + "step": 3168, + "loss": 0.5999464988708496, + "error": 0.3408203125, + "gradient_norm": 0.05777016654610634, + "elapsed": 1024.9410600662231 + }, + { + "step": 3184, + "loss": 0.5758363008499146, + "error": 0.3427734375, + "gradient_norm": 0.051027461886405945, + "elapsed": 1029.7082171440125 + }, + { + "step": 3200, + "loss": 0.05016190931200981, + "error": 0.017578125, + "gradient_norm": 0.009175656363368034, + "elapsed": 1034.3982915878296 + }, + { + "step": 3216, + "loss": 0.5471057295799255, + "error": 0.318359375, + "gradient_norm": 0.07572721689939499, + "elapsed": 1039.117841243744 + }, + { + "step": 3232, + "loss": 0.4141446352005005, + "error": 0.193359375, + "gradient_norm": 0.10056859254837036, + "elapsed": 1043.880026102066 + }, + { + "step": 3248, + "loss": 0.5812438726425171, + "error": 0.3212890625, + "gradient_norm": 0.05781616270542145, + "elapsed": 1048.6406455039978 + }, + { + "step": 3264, + "loss": 0.19184701144695282, + "error": 0.078125, + "gradient_norm": 0.05367236211895943, + "elapsed": 1053.5672237873077 + }, + { + "step": 3280, + "loss": 0.5420833826065063, + "error": 0.28515625, + "gradient_norm": 0.052405405789613724, + "elapsed": 1058.3841104507446 + }, + { + "step": 3296, + "loss": 0.4419598877429962, + "error": 0.2177734375, + "gradient_norm": 0.05814693495631218, + "elapsed": 1063.1880333423615 + }, + { + "step": 3312, + "loss": 0.4525642991065979, + "error": 0.208984375, + "gradient_norm": 0.1061021164059639, + "elapsed": 1068.1370933055878 + }, + { + "step": 3328, + "loss": 0.32664671540260315, + "error": 0.154296875, + "gradient_norm": 0.05649850144982338, + "elapsed": 1073.1963467597961 + }, + { + "step": 3344, + "loss": 0.2655770182609558, + "error": 0.1220703125, + "gradient_norm": 0.04070372134447098, + "elapsed": 1078.2698318958282 + }, + { + "step": 3360, + "loss": 0.5894330739974976, + "error": 0.3544921875, + "gradient_norm": 0.0643400028347969, + "elapsed": 1083.0184152126312 + }, + { + "step": 3376, + "loss": 0.6118791103363037, + "error": 0.361328125, + "gradient_norm": 0.08537904173135757, + "elapsed": 1087.834038734436 + }, + { + "step": 3392, + "loss": 0.40694907307624817, + "error": 0.19921875, + "gradient_norm": 0.11411692947149277, + "elapsed": 1092.8119947910309 + }, + { + "step": 3408, + "loss": 0.04629015550017357, + "error": 0.0146484375, + "gradient_norm": 0.017204072326421738, + "elapsed": 1097.5751783847809 + }, + { + "step": 3424, + "loss": 0.20639702677726746, + "error": 0.0849609375, + "gradient_norm": 0.04801144450902939, + "elapsed": 1102.2970931529999 + }, + { + "step": 3440, + "loss": 0.6051071286201477, + "error": 0.33984375, + "gradient_norm": 0.045392412692308426, + "elapsed": 1107.1080610752106 + }, + { + "step": 3456, + "loss": 0.6553700566291809, + "error": 0.40625, + "gradient_norm": 0.05593863129615784, + "elapsed": 1111.8409752845764 + }, + { + "step": 3472, + "loss": 0.591402530670166, + "error": 0.3515625, + "gradient_norm": 0.051181379705667496, + "elapsed": 1116.5800333023071 + }, + { + "step": 3488, + "loss": 0.30494624376296997, + "error": 0.12109375, + "gradient_norm": 0.05175542086362839, + "elapsed": 1121.276373386383 + }, + { + "step": 3504, + "loss": 0.5065370798110962, + "error": 0.279296875, + "gradient_norm": 0.10419930517673492, + "elapsed": 1125.9883344173431 + }, + { + "step": 3520, + "loss": 0.3915700614452362, + "error": 0.1953125, + "gradient_norm": 0.060416825115680695, + "elapsed": 1130.7958455085754 + }, + { + "step": 3536, + "loss": 0.624374270439148, + "error": 0.3759765625, + "gradient_norm": 0.06069556251168251, + "elapsed": 1135.5360939502716 + }, + { + "step": 3552, + "loss": 0.5830206274986267, + "error": 0.3359375, + "gradient_norm": 0.046013280749320984, + "elapsed": 1140.312029838562 + }, + { + "step": 3568, + "loss": 0.4201379716396332, + "error": 0.2119140625, + "gradient_norm": 0.06909621506929398, + "elapsed": 1145.0904593467712 + }, + { + "step": 3584, + "loss": 0.28215405344963074, + "error": 0.1181640625, + "gradient_norm": 0.07625982910394669, + "elapsed": 1149.8156151771545 + }, + { + "step": 3600, + "loss": 0.5229164361953735, + "error": 0.275390625, + "gradient_norm": 0.055048178881406784, + "elapsed": 1154.5280592441559 + }, + { + "step": 3616, + "loss": 0.47238075733184814, + "error": 0.2314453125, + "gradient_norm": 0.06473162025213242, + "elapsed": 1159.2720873355865 + }, + { + "step": 3632, + "loss": 0.46245503425598145, + "error": 0.228515625, + "gradient_norm": 0.07382887601852417, + "elapsed": 1164.0119998455048 + }, + { + "step": 3648, + "loss": 0.37509745359420776, + "error": 0.171875, + "gradient_norm": 0.051260266453027725, + "elapsed": 1168.7440350055695 + }, + { + "step": 3664, + "loss": 0.1948484629392624, + "error": 0.080078125, + "gradient_norm": 0.059623416513204575, + "elapsed": 1173.3906588554382 + }, + { + "step": 3680, + "loss": 0.5552756786346436, + "error": 0.3115234375, + "gradient_norm": 0.08073585480451584, + "elapsed": 1178.0645008087158 + }, + { + "step": 3696, + "loss": 0.6405904293060303, + "error": 0.39453125, + "gradient_norm": 0.05899551138281822, + "elapsed": 1182.730489730835 + }, + { + "step": 3712, + "loss": 0.2767012119293213, + "error": 0.119140625, + "gradient_norm": 0.06593579798936844, + "elapsed": 1187.377315044403 + }, + { + "step": 3728, + "loss": 0.315812885761261, + "error": 0.134765625, + "gradient_norm": 0.035905495285987854, + "elapsed": 1192.0582301616669 + }, + { + "step": 3744, + "loss": 0.6033951640129089, + "error": 0.3544921875, + "gradient_norm": 0.05226197466254234, + "elapsed": 1196.7101175785065 + }, + { + "step": 3760, + "loss": 0.5202592611312866, + "error": 0.275390625, + "gradient_norm": 0.06367512047290802, + "elapsed": 1201.3543090820312 + }, + { + "step": 3776, + "loss": 0.24639368057250977, + "error": 0.1083984375, + "gradient_norm": 0.09370873868465424, + "elapsed": 1206.0717165470123 + }, + { + "step": 3792, + "loss": 0.6175658702850342, + "error": 0.375, + "gradient_norm": 0.06221585348248482, + "elapsed": 1210.754029750824 + }, + { + "step": 3808, + "loss": 0.41153696179389954, + "error": 0.2119140625, + "gradient_norm": 0.05355365574359894, + "elapsed": 1215.4374370574951 + }, + { + "step": 3824, + "loss": 0.28002214431762695, + "error": 0.1123046875, + "gradient_norm": 0.03846330568194389, + "elapsed": 1220.1207013130188 + }, + { + "step": 3840, + "loss": 0.0484195351600647, + "error": 0.013671875, + "gradient_norm": 0.03470242768526077, + "elapsed": 1224.8153104782104 + }, + { + "step": 3856, + "loss": 0.1407160609960556, + "error": 0.0458984375, + "gradient_norm": 0.04061700031161308, + "elapsed": 1229.5512235164642 + }, + { + "step": 3872, + "loss": 0.5881794691085815, + "error": 0.3427734375, + "gradient_norm": 0.062013477087020874, + "elapsed": 1234.3750183582306 + }, + { + "step": 3888, + "loss": 0.17833612859249115, + "error": 0.06640625, + "gradient_norm": 0.038856204599142075, + "elapsed": 1239.110375881195 + }, + { + "step": 3904, + "loss": 0.06211477518081665, + "error": 0.0224609375, + "gradient_norm": 0.02150108851492405, + "elapsed": 1243.800644159317 + }, + { + "step": 3920, + "loss": 0.06039723381400108, + "error": 0.01953125, + "gradient_norm": 0.019367367029190063, + "elapsed": 1248.4831748008728 + }, + { + "step": 3936, + "loss": 0.6010214686393738, + "error": 0.3525390625, + "gradient_norm": 0.051659151911735535, + "elapsed": 1253.1423478126526 + }, + { + "step": 3952, + "loss": 0.5867137312889099, + "error": 0.3388671875, + "gradient_norm": 0.058528851717710495, + "elapsed": 1257.9799931049347 + }, + { + "step": 3968, + "loss": 0.5231834650039673, + "error": 0.2578125, + "gradient_norm": 0.10128334909677505, + "elapsed": 1262.6990082263947 + }, + { + "step": 3984, + "loss": 0.6251651644706726, + "error": 0.353515625, + "gradient_norm": 0.06211795285344124, + "elapsed": 1267.4289934635162 + }, + { + "step": 4000, + "loss": 0.06667037308216095, + "error": 0.01953125, + "gradient_norm": 0.048018258064985275, + "elapsed": 1272.132089138031 + }, + { + "step": 4016, + "loss": 0.5286938548088074, + "error": 0.2744140625, + "gradient_norm": 0.05509360507130623, + "elapsed": 1276.8878977298737 + }, + { + "step": 4032, + "loss": 0.34016552567481995, + "error": 0.1591796875, + "gradient_norm": 0.07597329467535019, + "elapsed": 1281.7364926338196 + }, + { + "step": 4048, + "loss": 0.17750494182109833, + "error": 0.078125, + "gradient_norm": 0.06314503401517868, + "elapsed": 1286.5033600330353 + }, + { + "step": 4064, + "loss": 0.5882893800735474, + "error": 0.34375, + "gradient_norm": 0.10986580699682236, + "elapsed": 1291.1944887638092 + }, + { + "step": 4080, + "loss": 0.4923543930053711, + "error": 0.2568359375, + "gradient_norm": 0.050325747579336166, + "elapsed": 1295.9372322559357 + }, + { + "step": 4096, + "loss": 0.44146978855133057, + "error": 0.2236328125, + "gradient_norm": 0.06535191088914871, + "elapsed": 1300.641023159027 + } + ] + }, + "derived_checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_optimizer_steps": [ + 2048, + 3072, + 4096 + ], + "source_training_run": "temporal2", + "source_weights_sha256": { + "2048": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "3072": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "4096": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea" + }, + "source_checkpoint_records": { + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "3072": { + "step": 3072, + "new_training_shots": 3145728, + "unique_training_rows_seen_in_this_phase": 1594502, + "weights": "weights-3072.npz", + "weights_sha256": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "validation": "validation-3072.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "weights_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "complete": true + }, + "mean4": { + "checkpoint_label": "mean4", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_optimizer_steps": [ + 1024, + 2048, + 3072, + 4096 + ], + "source_training_run": "temporal2", + "source_weights_sha256": { + "1024": "0d809362d5afe1dc781f716e3aee1a9bc5a8f75fed6cc0ff6339b9abcf600ada", + "2048": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "3072": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "4096": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "unique_training_rows_seen_in_this_phase": 804757, + "weights": "weights-1024.npz", + "weights_sha256": "0d809362d5afe1dc781f716e3aee1a9bc5a8f75fed6cc0ff6339b9abcf600ada", + "validation": "validation-1024.json", + "complete": true + }, + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "3072": { + "step": 3072, + "new_training_shots": 3145728, + "unique_training_rows_seen_in_this_phase": 1594502, + "weights": "weights-3072.npz", + "weights_sha256": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "validation": "validation-3072.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "weights_sha256": "ff4595e8f3eb7cfaa8da5a58a31e106d9684c7b8437f330573a1291f19f5777a", + "complete": true + } + }, + "selection": "Predefined last-three and all-four noninitial temporal2 checkpoint means; every validation condition evaluated before group selection", + "test_data_used": false, + "derivation_source_sha256": "b68813c7dab697a554185020c430ef05f1c35bedcda5b85b7d165af75461e914" + }, + "training_source_snapshot": "training_sources/temporal2_swa", + "selected_checkpoint_steps": [ + "mean3" + ], + "checkpoint_records": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_optimizer_steps": [ + 2048, + 3072, + 4096 + ], + "source_training_run": "temporal2", + "source_weights_sha256": { + "2048": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "3072": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "4096": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea" + }, + "source_checkpoint_records": { + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "3072": { + "step": 3072, + "new_training_shots": 3145728, + "unique_training_rows_seen_in_this_phase": 1594502, + "weights": "weights-3072.npz", + "weights_sha256": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "validation": "validation-3072.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "weights_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints; when listed, blend candidates average the recorded small-contextual reference and new probabilities equally", + "blend_reference": "/run-state/workspace/research/context_upgrades/continuation2/predictions", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.2445763221153846, + "mean3": 0.24451622596153846, + "mean4": 0.24484675480769236, + "blend-mean3": 0.24570312499999997, + "blend-mean4": 0.24591346153846153 + }, + "selected": "mean3" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2528545673076923, + "mean3": 0.25321514423076924, + "mean4": 0.2538611778846154, + "blend-mean3": 0.25310997596153845, + "blend-mean4": 0.2530498798076923 + }, + "selected": "incumbent" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.23366887019230773, + "mean3": 0.23392427884615385, + "mean4": 0.234375, + "blend-mean3": 0.2338792067307692, + "blend-mean4": 0.23404447115384613 + }, + "selected": "incumbent" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.23886718750000002, + "mean3": 0.23937800480769234, + "mean4": 0.2393780048076923, + "blend-mean3": 0.23942307692307693, + "blend-mean4": 0.2392578125 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24463641826923077, + "mean3": 0.24471153846153845, + "mean4": 0.24505709134615386, + "blend-mean3": 0.24580829326923076, + "blend-mean4": 0.2457782451923077 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.23652343749999996, + "mean3": 0.2379957932692308, + "mean4": 0.23756009615384613, + "blend-mean3": 0.23751502403846153, + "blend-mean4": 0.23737980769230768 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.23562199519230764, + "mean3": 0.23643329326923077, + "mean4": 0.2361177884615384, + "blend-mean3": 0.23662860576923078, + "blend-mean4": 0.23634314903846157 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.2329627403846154, + "mean3": 0.2335186298076923, + "mean4": 0.23344350961538457, + "blend-mean3": 0.23333834134615383, + "blend-mean4": 0.2334134615384615 + }, + "selected": "incumbent" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2325420673076923 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22017728365384615 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "condition_same1", + "training_run": { + "initialization": "Continue from this session's trained checkpoint", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "training_source_sha256": { + "learned_exact__temporal_accumulate_train.py": "9f672468a8b72966b3aa04fd22e5d40b47b0768f1c802c267a1da08244c4323b", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "eligible_training_shots": 2067520, + "unique_training_rows_seen_in_this_phase": 803777, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 11639, + "surface_code_bX_d3_r03_center_3_5": 10232, + "surface_code_bX_d3_r05_center_3_5": 9180, + "surface_code_bX_d3_r07_center_3_5": 10239, + "surface_code_bX_d3_r09_center_3_5": 6051, + "surface_code_bX_d3_r11_center_3_5": 8012, + "surface_code_bX_d3_r13_center_3_5": 6713, + "surface_code_bX_d3_r15_center_3_5": 6022, + "surface_code_bX_d3_r17_center_3_5": 7425, + "surface_code_bX_d3_r19_center_3_5": 8635, + "surface_code_bX_d3_r21_center_3_5": 10217, + "surface_code_bX_d3_r23_center_3_5": 6026, + "surface_code_bX_d3_r25_center_3_5": 4490, + "surface_code_bX_d3_r01_center_5_3": 7371, + "surface_code_bX_d3_r03_center_5_3": 5992, + "surface_code_bX_d3_r05_center_5_3": 6712, + "surface_code_bX_d3_r07_center_5_3": 6716, + "surface_code_bX_d3_r09_center_5_3": 7941, + "surface_code_bX_d3_r11_center_5_3": 6001, + "surface_code_bX_d3_r13_center_5_3": 8037, + "surface_code_bX_d3_r15_center_5_3": 8542, + "surface_code_bX_d3_r17_center_5_3": 10153, + "surface_code_bX_d3_r19_center_5_3": 10675, + "surface_code_bX_d3_r21_center_5_3": 7993, + "surface_code_bX_d3_r23_center_5_3": 6652, + "surface_code_bX_d3_r25_center_5_3": 8608, + "surface_code_bX_d3_r01_center_5_7": 8590, + "surface_code_bX_d3_r03_center_5_7": 11633, + "surface_code_bX_d3_r05_center_5_7": 8588, + "surface_code_bX_d3_r07_center_5_7": 10695, + "surface_code_bX_d3_r09_center_5_7": 7964, + "surface_code_bX_d3_r11_center_5_7": 11658, + "surface_code_bX_d3_r13_center_5_7": 6021, + "surface_code_bX_d3_r15_center_5_7": 9727, + "surface_code_bX_d3_r17_center_5_7": 4526, + "surface_code_bX_d3_r19_center_5_7": 9642, + "surface_code_bX_d3_r21_center_5_7": 3708, + "surface_code_bX_d3_r23_center_5_7": 6687, + "surface_code_bX_d3_r25_center_5_7": 7972, + "surface_code_bX_d3_r01_center_7_5": 6757, + "surface_code_bX_d3_r03_center_7_5": 6726, + "surface_code_bX_d3_r05_center_7_5": 4504, + "surface_code_bX_d3_r07_center_7_5": 8034, + "surface_code_bX_d3_r09_center_7_5": 8633, + "surface_code_bX_d3_r11_center_7_5": 11109, + "surface_code_bX_d3_r13_center_7_5": 9695, + "surface_code_bX_d3_r15_center_7_5": 7370, + "surface_code_bX_d3_r17_center_7_5": 7323, + "surface_code_bX_d3_r19_center_7_5": 10247, + "surface_code_bX_d3_r21_center_7_5": 6718, + "surface_code_bX_d3_r23_center_7_5": 8064, + "surface_code_bX_d3_r25_center_7_5": 8018, + "surface_code_bZ_d3_r01_center_3_5": 2856, + "surface_code_bZ_d3_r03_center_3_5": 6780, + "surface_code_bZ_d3_r05_center_3_5": 8610, + "surface_code_bZ_d3_r07_center_3_5": 9152, + "surface_code_bZ_d3_r09_center_3_5": 4522, + "surface_code_bZ_d3_r11_center_3_5": 3703, + "surface_code_bZ_d3_r13_center_3_5": 6001, + "surface_code_bZ_d3_r15_center_3_5": 7377, + "surface_code_bZ_d3_r17_center_3_5": 4517, + "surface_code_bZ_d3_r19_center_3_5": 10242, + "surface_code_bZ_d3_r21_center_3_5": 6747, + "surface_code_bZ_d3_r23_center_3_5": 7422, + "surface_code_bZ_d3_r25_center_3_5": 10606, + "surface_code_bZ_d3_r01_center_5_3": 5272, + "surface_code_bZ_d3_r03_center_5_3": 11200, + "surface_code_bZ_d3_r05_center_5_3": 4514, + "surface_code_bZ_d3_r07_center_5_3": 8002, + "surface_code_bZ_d3_r09_center_5_3": 8008, + "surface_code_bZ_d3_r11_center_5_3": 8689, + "surface_code_bZ_d3_r13_center_5_3": 8604, + "surface_code_bZ_d3_r15_center_5_3": 5981, + "surface_code_bZ_d3_r17_center_5_3": 5307, + "surface_code_bZ_d3_r19_center_5_3": 6713, + "surface_code_bZ_d3_r21_center_5_3": 8570, + "surface_code_bZ_d3_r23_center_5_3": 6700, + "surface_code_bZ_d3_r25_center_5_3": 10199, + "surface_code_bZ_d3_r01_center_5_7": 6730, + "surface_code_bZ_d3_r03_center_5_7": 7959, + "surface_code_bZ_d3_r05_center_5_7": 9741, + "surface_code_bZ_d3_r07_center_5_7": 10727, + "surface_code_bZ_d3_r09_center_5_7": 11979, + "surface_code_bZ_d3_r11_center_5_7": 3694, + "surface_code_bZ_d3_r13_center_5_7": 6746, + "surface_code_bZ_d3_r15_center_5_7": 6686, + "surface_code_bZ_d3_r17_center_5_7": 10647, + "surface_code_bZ_d3_r19_center_5_7": 8011, + "surface_code_bZ_d3_r21_center_5_7": 6000, + "surface_code_bZ_d3_r23_center_5_7": 9176, + "surface_code_bZ_d3_r25_center_5_7": 6009, + "surface_code_bZ_d3_r01_center_7_5": 9076, + "surface_code_bZ_d3_r03_center_7_5": 9182, + "surface_code_bZ_d3_r05_center_7_5": 6769, + "surface_code_bZ_d3_r07_center_7_5": 11140, + "surface_code_bZ_d3_r09_center_7_5": 7359, + "surface_code_bZ_d3_r11_center_7_5": 8582, + "surface_code_bZ_d3_r13_center_7_5": 5284, + "surface_code_bZ_d3_r15_center_7_5": 6694, + "surface_code_bZ_d3_r17_center_7_5": 5965, + "surface_code_bZ_d3_r19_center_7_5": 6016, + "surface_code_bZ_d3_r21_center_7_5": 9225, + "surface_code_bZ_d3_r23_center_7_5": 4509, + "surface_code_bZ_d3_r25_center_7_5": 6694 + }, + "steps": 1024, + "batch_size": 256, + "accumulate_conditions": 4, + "effective_batch_size": 1024, + "condition_policy": "same", + "training_draws": 1048576, + "condition_sampling": "Draw one condition index per microbatch in both arms; same-condition control reuses the first index while mixed arm uses all indices. Both arms consume identical RNG draws with equal-sized condition pools.", + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.00025, + "sampling_seed": 20261190, + "optimizer_restored": false, + "rng_restored": false, + "explicit_optimizer_reset": true, + "explicit_rng_reset": true, + "sampling_state_source": "Fresh NumPy default_rng seed 20261190", + "session_trained_starting_checkpoint": "/run-state/workspace/research/learned_exact/temporal2_swa/weights-mean3.npz", + "starting_checkpoint_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "starting_training_provenance": { + "initialization": "Uniform averages of the same session-trained temporal trajectory; no external weights", + "optimizer_updates_in_derived_run": 0, + "source_training_provenance": { + "initialization": "Continue from this session's trained checkpoint", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "training_source_sha256": { + "learned_exact__temporal_train.py": "7d48d2fc7f62d0bec3023b3df1c2ac28537d0417966131ae3a156697a34cda5f", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "eligible_training_shots": 2067520, + "unique_training_rows_seen_in_this_phase": 1778773, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 18357, + "surface_code_bX_d3_r03_center_3_5": 16816, + "surface_code_bX_d3_r05_center_3_5": 17999, + "surface_code_bX_d3_r07_center_3_5": 15225, + "surface_code_bX_d3_r09_center_3_5": 16132, + "surface_code_bX_d3_r11_center_3_5": 17041, + "surface_code_bX_d3_r13_center_3_5": 18477, + "surface_code_bX_d3_r15_center_3_5": 18214, + "surface_code_bX_d3_r17_center_3_5": 16505, + "surface_code_bX_d3_r19_center_3_5": 17120, + "surface_code_bX_d3_r21_center_3_5": 17563, + "surface_code_bX_d3_r23_center_3_5": 16681, + "surface_code_bX_d3_r25_center_3_5": 18379, + "surface_code_bX_d3_r01_center_5_3": 17450, + "surface_code_bX_d3_r03_center_5_3": 17161, + "surface_code_bX_d3_r05_center_5_3": 15797, + "surface_code_bX_d3_r07_center_5_3": 17800, + "surface_code_bX_d3_r09_center_5_3": 17190, + "surface_code_bX_d3_r11_center_5_3": 15840, + "surface_code_bX_d3_r13_center_5_3": 15178, + "surface_code_bX_d3_r15_center_5_3": 14897, + "surface_code_bX_d3_r17_center_5_3": 18252, + "surface_code_bX_d3_r19_center_5_3": 17083, + "surface_code_bX_d3_r21_center_5_3": 17229, + "surface_code_bX_d3_r23_center_5_3": 14735, + "surface_code_bX_d3_r25_center_5_3": 17949, + "surface_code_bX_d3_r01_center_5_7": 17431, + "surface_code_bX_d3_r03_center_5_7": 16583, + "surface_code_bX_d3_r05_center_5_7": 16891, + "surface_code_bX_d3_r07_center_5_7": 17969, + "surface_code_bX_d3_r09_center_5_7": 17966, + "surface_code_bX_d3_r11_center_5_7": 14424, + "surface_code_bX_d3_r13_center_5_7": 16930, + "surface_code_bX_d3_r15_center_5_7": 15205, + "surface_code_bX_d3_r17_center_5_7": 18252, + "surface_code_bX_d3_r19_center_5_7": 17077, + "surface_code_bX_d3_r21_center_5_7": 16770, + "surface_code_bX_d3_r23_center_5_7": 17308, + "surface_code_bX_d3_r25_center_5_7": 17481, + "surface_code_bX_d3_r01_center_7_5": 16630, + "surface_code_bX_d3_r03_center_7_5": 17439, + "surface_code_bX_d3_r05_center_7_5": 15811, + "surface_code_bX_d3_r07_center_7_5": 16637, + "surface_code_bX_d3_r09_center_7_5": 18306, + "surface_code_bX_d3_r11_center_7_5": 18327, + "surface_code_bX_d3_r13_center_7_5": 17974, + "surface_code_bX_d3_r15_center_7_5": 16106, + "surface_code_bX_d3_r17_center_7_5": 15834, + "surface_code_bX_d3_r19_center_7_5": 17242, + "surface_code_bX_d3_r21_center_7_5": 17889, + "surface_code_bX_d3_r23_center_7_5": 17440, + "surface_code_bX_d3_r25_center_7_5": 17087, + "surface_code_bZ_d3_r01_center_3_5": 16236, + "surface_code_bZ_d3_r03_center_3_5": 17278, + "surface_code_bZ_d3_r05_center_3_5": 16577, + "surface_code_bZ_d3_r07_center_3_5": 17376, + "surface_code_bZ_d3_r09_center_3_5": 16000, + "surface_code_bZ_d3_r11_center_3_5": 15634, + "surface_code_bZ_d3_r13_center_3_5": 14950, + "surface_code_bZ_d3_r15_center_3_5": 16600, + "surface_code_bZ_d3_r17_center_3_5": 15381, + "surface_code_bZ_d3_r19_center_3_5": 16823, + "surface_code_bZ_d3_r21_center_3_5": 18789, + "surface_code_bZ_d3_r23_center_3_5": 15616, + "surface_code_bZ_d3_r25_center_3_5": 17088, + "surface_code_bZ_d3_r01_center_5_3": 17935, + "surface_code_bZ_d3_r03_center_5_3": 16256, + "surface_code_bZ_d3_r05_center_5_3": 17959, + "surface_code_bZ_d3_r07_center_5_3": 18401, + "surface_code_bZ_d3_r09_center_5_3": 16405, + "surface_code_bZ_d3_r11_center_5_3": 17274, + "surface_code_bZ_d3_r13_center_5_3": 18172, + "surface_code_bZ_d3_r15_center_5_3": 17525, + "surface_code_bZ_d3_r17_center_5_3": 18643, + "surface_code_bZ_d3_r19_center_5_3": 17816, + "surface_code_bZ_d3_r21_center_5_3": 17404, + "surface_code_bZ_d3_r23_center_5_3": 17253, + "surface_code_bZ_d3_r25_center_5_3": 17667, + "surface_code_bZ_d3_r01_center_5_7": 16203, + "surface_code_bZ_d3_r03_center_5_7": 17214, + "surface_code_bZ_d3_r05_center_5_7": 16799, + "surface_code_bZ_d3_r07_center_5_7": 17896, + "surface_code_bZ_d3_r09_center_5_7": 16411, + "surface_code_bZ_d3_r11_center_5_7": 17726, + "surface_code_bZ_d3_r13_center_5_7": 16313, + "surface_code_bZ_d3_r15_center_5_7": 17824, + "surface_code_bZ_d3_r17_center_5_7": 15656, + "surface_code_bZ_d3_r19_center_5_7": 17169, + "surface_code_bZ_d3_r21_center_5_7": 17194, + "surface_code_bZ_d3_r23_center_5_7": 16779, + "surface_code_bZ_d3_r25_center_5_7": 16970, + "surface_code_bZ_d3_r01_center_7_5": 16762, + "surface_code_bZ_d3_r03_center_7_5": 17320, + "surface_code_bZ_d3_r05_center_7_5": 17522, + "surface_code_bZ_d3_r07_center_7_5": 17914, + "surface_code_bZ_d3_r09_center_7_5": 18439, + "surface_code_bZ_d3_r11_center_7_5": 18218, + "surface_code_bZ_d3_r13_center_7_5": 17907, + "surface_code_bZ_d3_r15_center_7_5": 17597, + "surface_code_bZ_d3_r17_center_7_5": 18252, + "surface_code_bZ_d3_r19_center_7_5": 18379, + "surface_code_bZ_d3_r21_center_7_5": 16818, + "surface_code_bZ_d3_r23_center_7_5": 18430, + "surface_code_bZ_d3_r25_center_7_5": 17924 + }, + "steps": 4096, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.0005, + "sampling_seed": 20261121, + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_exact/temporal1/rng-2048.json", + "session_trained_starting_checkpoint": "/run-state/workspace/research/learned_exact/temporal1/weights-2048.npz", + "starting_checkpoint_sha256": "26be9e0259b69a5870bf73e80a5a29fcf3519a3ff63e1d219c57a2113d9d34be", + "starting_training_provenance": { + "initialization": "Continue from rich weights trained from random initialization in this session; new temporal parameters randomly initialized now", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 2048, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261111, + "optimizer_restored": false, + "rng_restored": false, + "session_trained_starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.6317505836486816, + "error": 0.3681640625, + "gradient_norm": 0.04013459011912346, + "elapsed": 30.971998691558838 + }, + { + "step": 16, + "loss": 0.5091081857681274, + "error": 0.291015625, + "gradient_norm": 0.042228709906339645, + "elapsed": 35.17463397979736 + }, + { + "step": 32, + "loss": 0.626472532749176, + "error": 0.3642578125, + "gradient_norm": 0.05872415751218796, + "elapsed": 39.678136110305786 + }, + { + "step": 48, + "loss": 0.6005369424819946, + "error": 0.3515625, + "gradient_norm": 0.03848014399409294, + "elapsed": 44.16946887969971 + }, + { + "step": 64, + "loss": 0.5523768663406372, + "error": 0.302734375, + "gradient_norm": 0.06031862646341324, + "elapsed": 48.65217089653015 + }, + { + "step": 80, + "loss": 0.3981674611568451, + "error": 0.19921875, + "gradient_norm": 0.0542079322040081, + "elapsed": 53.21601867675781 + }, + { + "step": 96, + "loss": 0.5601426362991333, + "error": 0.2978515625, + "gradient_norm": 0.04770371690392494, + "elapsed": 57.81089663505554 + }, + { + "step": 112, + "loss": 0.5878150463104248, + "error": 0.34765625, + "gradient_norm": 0.10699950158596039, + "elapsed": 62.42190766334534 + }, + { + "step": 128, + "loss": 0.5232458114624023, + "error": 0.2861328125, + "gradient_norm": 0.0911584198474884, + "elapsed": 67.00223755836487 + }, + { + "step": 144, + "loss": 0.6119767427444458, + "error": 0.3623046875, + "gradient_norm": 0.062474437057971954, + "elapsed": 71.54070782661438 + }, + { + "step": 160, + "loss": 0.3037984371185303, + "error": 0.1474609375, + "gradient_norm": 0.05718141421675682, + "elapsed": 76.08167362213135 + }, + { + "step": 176, + "loss": 0.6038273572921753, + "error": 0.3662109375, + "gradient_norm": 0.0437164381146431, + "elapsed": 80.71864247322083 + }, + { + "step": 192, + "loss": 0.3304370641708374, + "error": 0.1572265625, + "gradient_norm": 0.05684761330485344, + "elapsed": 85.54437017440796 + }, + { + "step": 208, + "loss": 0.5785484313964844, + "error": 0.3251953125, + "gradient_norm": 0.09597272425889969, + "elapsed": 91.51522874832153 + }, + { + "step": 224, + "loss": 0.3110499978065491, + "error": 0.13671875, + "gradient_norm": 0.04815748706459999, + "elapsed": 97.1228940486908 + }, + { + "step": 240, + "loss": 0.6213864684104919, + "error": 0.3623046875, + "gradient_norm": 0.0540502592921257, + "elapsed": 102.90286135673523 + }, + { + "step": 256, + "loss": 0.2535272240638733, + "error": 0.1064453125, + "gradient_norm": 0.029962118715047836, + "elapsed": 108.39288640022278 + }, + { + "step": 272, + "loss": 0.6126939058303833, + "error": 0.3671875, + "gradient_norm": 0.06887879222631454, + "elapsed": 113.83897161483765 + }, + { + "step": 288, + "loss": 0.4556676149368286, + "error": 0.2236328125, + "gradient_norm": 0.16127081215381622, + "elapsed": 119.93085813522339 + }, + { + "step": 304, + "loss": 0.4973585605621338, + "error": 0.255859375, + "gradient_norm": 0.08082302659749985, + "elapsed": 125.90891909599304 + }, + { + "step": 320, + "loss": 0.6455868482589722, + "error": 0.419921875, + "gradient_norm": 0.04339660331606865, + "elapsed": 131.20537638664246 + }, + { + "step": 336, + "loss": 0.5343132615089417, + "error": 0.2880859375, + "gradient_norm": 0.07518009096384048, + "elapsed": 136.59086871147156 + }, + { + "step": 352, + "loss": 0.6505346894264221, + "error": 0.4033203125, + "gradient_norm": 0.03800992667675018, + "elapsed": 142.21085906028748 + }, + { + "step": 368, + "loss": 0.4882712960243225, + "error": 0.251953125, + "gradient_norm": 0.08170920610427856, + "elapsed": 146.95903658866882 + }, + { + "step": 384, + "loss": 0.5292021036148071, + "error": 0.296875, + "gradient_norm": 0.08454013615846634, + "elapsed": 151.6385259628296 + }, + { + "step": 400, + "loss": 0.6272899508476257, + "error": 0.3837890625, + "gradient_norm": 0.051436979323625565, + "elapsed": 156.3343904018402 + }, + { + "step": 416, + "loss": 0.052130259573459625, + "error": 0.0166015625, + "gradient_norm": 0.02377190627157688, + "elapsed": 160.92345547676086 + }, + { + "step": 432, + "loss": 0.5256737470626831, + "error": 0.3046875, + "gradient_norm": 0.07986386120319366, + "elapsed": 165.52879118919373 + }, + { + "step": 448, + "loss": 0.15193665027618408, + "error": 0.0576171875, + "gradient_norm": 0.06491660326719284, + "elapsed": 170.14827823638916 + }, + { + "step": 464, + "loss": 0.6418055295944214, + "error": 0.40625, + "gradient_norm": 0.07290885597467422, + "elapsed": 174.64974284172058 + }, + { + "step": 480, + "loss": 0.6055159568786621, + "error": 0.357421875, + "gradient_norm": 0.0795595794916153, + "elapsed": 179.17218685150146 + }, + { + "step": 496, + "loss": 0.6372283697128296, + "error": 0.3916015625, + "gradient_norm": 0.04387903958559036, + "elapsed": 183.77568197250366 + }, + { + "step": 512, + "loss": 0.637977123260498, + "error": 0.408203125, + "gradient_norm": 0.060665905475616455, + "elapsed": 188.31205368041992 + }, + { + "step": 528, + "loss": 0.4668862223625183, + "error": 0.2451171875, + "gradient_norm": 0.08566711097955704, + "elapsed": 206.40719985961914 + }, + { + "step": 544, + "loss": 0.4584413170814514, + "error": 0.244140625, + "gradient_norm": 0.08538200706243515, + "elapsed": 211.02819895744324 + }, + { + "step": 560, + "loss": 0.5615692138671875, + "error": 0.3291015625, + "gradient_norm": 0.043748609721660614, + "elapsed": 215.66470766067505 + }, + { + "step": 576, + "loss": 0.5151895880699158, + "error": 0.2880859375, + "gradient_norm": 0.05164863541722298, + "elapsed": 220.18949556350708 + }, + { + "step": 592, + "loss": 0.5618112087249756, + "error": 0.3291015625, + "gradient_norm": 0.05998719856142998, + "elapsed": 224.7216100692749 + }, + { + "step": 608, + "loss": 0.659294843673706, + "error": 0.431640625, + "gradient_norm": 0.09910348802804947, + "elapsed": 229.26827573776245 + }, + { + "step": 624, + "loss": 0.5895233154296875, + "error": 0.3447265625, + "gradient_norm": 0.045334093272686005, + "elapsed": 233.83731055259705 + }, + { + "step": 640, + "loss": 0.6081801056861877, + "error": 0.3388671875, + "gradient_norm": 0.06578423827886581, + "elapsed": 238.36345624923706 + }, + { + "step": 656, + "loss": 0.5349816083908081, + "error": 0.2939453125, + "gradient_norm": 0.09989562630653381, + "elapsed": 242.95086026191711 + }, + { + "step": 672, + "loss": 0.5871994495391846, + "error": 0.328125, + "gradient_norm": 0.08132346719503403, + "elapsed": 247.67088556289673 + }, + { + "step": 688, + "loss": 0.06012660637497902, + "error": 0.0146484375, + "gradient_norm": 0.012170507572591305, + "elapsed": 252.3202247619629 + }, + { + "step": 704, + "loss": 0.42179757356643677, + "error": 0.21484375, + "gradient_norm": 0.08384513854980469, + "elapsed": 256.91991782188416 + }, + { + "step": 720, + "loss": 0.6111758947372437, + "error": 0.3720703125, + "gradient_norm": 0.06689880788326263, + "elapsed": 261.56407928466797 + }, + { + "step": 736, + "loss": 0.29969727993011475, + "error": 0.1318359375, + "gradient_norm": 0.0743367150425911, + "elapsed": 266.22199630737305 + }, + { + "step": 752, + "loss": 0.051849883049726486, + "error": 0.0166015625, + "gradient_norm": 0.017005126923322678, + "elapsed": 270.8602342605591 + }, + { + "step": 768, + "loss": 0.6178420186042786, + "error": 0.3759765625, + "gradient_norm": 0.027732960879802704, + "elapsed": 275.47888374328613 + }, + { + "step": 784, + "loss": 0.45798996090888977, + "error": 0.228515625, + "gradient_norm": 0.0630083829164505, + "elapsed": 280.1709156036377 + }, + { + "step": 800, + "loss": 0.5104988813400269, + "error": 0.2724609375, + "gradient_norm": 0.041733670979738235, + "elapsed": 286.17937707901 + }, + { + "step": 816, + "loss": 0.6336112022399902, + "error": 0.3837890625, + "gradient_norm": 0.0755191296339035, + "elapsed": 291.7506103515625 + }, + { + "step": 832, + "loss": 0.6260952353477478, + "error": 0.3603515625, + "gradient_norm": 0.0318005345761776, + "elapsed": 297.31094622612 + }, + { + "step": 848, + "loss": 0.5870074033737183, + "error": 0.3525390625, + "gradient_norm": 0.12073405832052231, + "elapsed": 303.11089158058167 + }, + { + "step": 864, + "loss": 0.5125640034675598, + "error": 0.26953125, + "gradient_norm": 0.038650237023830414, + "elapsed": 308.7288725376129 + }, + { + "step": 880, + "loss": 0.19194915890693665, + "error": 0.0703125, + "gradient_norm": 0.061878547072410583, + "elapsed": 314.37042355537415 + }, + { + "step": 896, + "loss": 0.5409250259399414, + "error": 0.2919921875, + "gradient_norm": 0.06288820505142212, + "elapsed": 319.9398190975189 + }, + { + "step": 912, + "loss": 0.6164936423301697, + "error": 0.3701171875, + "gradient_norm": 0.043224163353443146, + "elapsed": 325.361323595047 + }, + { + "step": 928, + "loss": 0.16032151877880096, + "error": 0.0625, + "gradient_norm": 0.030957572162151337, + "elapsed": 331.21752285957336 + }, + { + "step": 944, + "loss": 0.646601676940918, + "error": 0.3818359375, + "gradient_norm": 0.05670839175581932, + "elapsed": 336.7825517654419 + }, + { + "step": 960, + "loss": 0.402952641248703, + "error": 0.1865234375, + "gradient_norm": 0.07500886172056198, + "elapsed": 342.6888346672058 + }, + { + "step": 976, + "loss": 0.5537433624267578, + "error": 0.2939453125, + "gradient_norm": 0.04955969750881195, + "elapsed": 348.5554690361023 + }, + { + "step": 992, + "loss": 0.559626579284668, + "error": 0.294921875, + "gradient_norm": 0.048295993357896805, + "elapsed": 354.3531894683838 + }, + { + "step": 1008, + "loss": 0.5034694671630859, + "error": 0.2705078125, + "gradient_norm": 0.05729879066348076, + "elapsed": 360.0949149131775 + }, + { + "step": 1024, + "loss": 0.3119734525680542, + "error": 0.1259765625, + "gradient_norm": 0.052326612174510956, + "elapsed": 365.7881224155426 + }, + { + "step": 1040, + "loss": 0.35799849033355713, + "error": 0.173828125, + "gradient_norm": 0.03801804035902023, + "elapsed": 386.5749418735504 + }, + { + "step": 1056, + "loss": 0.6178948879241943, + "error": 0.3515625, + "gradient_norm": 0.03620661422610283, + "elapsed": 391.48247838020325 + }, + { + "step": 1072, + "loss": 0.49231401085853577, + "error": 0.24609375, + "gradient_norm": 0.04391559213399887, + "elapsed": 396.08718824386597 + }, + { + "step": 1088, + "loss": 0.4119300842285156, + "error": 0.2001953125, + "gradient_norm": 0.1104700043797493, + "elapsed": 400.5326828956604 + }, + { + "step": 1104, + "loss": 0.4926626682281494, + "error": 0.265625, + "gradient_norm": 0.04246886447072029, + "elapsed": 404.95741271972656 + }, + { + "step": 1120, + "loss": 0.5027930736541748, + "error": 0.2607421875, + "gradient_norm": 0.0547240674495697, + "elapsed": 409.40319633483887 + }, + { + "step": 1136, + "loss": 0.5948058366775513, + "error": 0.3544921875, + "gradient_norm": 0.06810063123703003, + "elapsed": 413.8514006137848 + }, + { + "step": 1152, + "loss": 0.26567256450653076, + "error": 0.125, + "gradient_norm": 0.06689104437828064, + "elapsed": 418.29868721961975 + }, + { + "step": 1168, + "loss": 0.2866836190223694, + "error": 0.1240234375, + "gradient_norm": 0.029536213725805283, + "elapsed": 422.75131845474243 + }, + { + "step": 1184, + "loss": 0.6342021822929382, + "error": 0.4091796875, + "gradient_norm": 0.0704190731048584, + "elapsed": 427.1991722583771 + }, + { + "step": 1200, + "loss": 0.41626787185668945, + "error": 0.212890625, + "gradient_norm": 0.04480795934796333, + "elapsed": 431.6600706577301 + }, + { + "step": 1216, + "loss": 0.28460952639579773, + "error": 0.1337890625, + "gradient_norm": 0.03666983172297478, + "elapsed": 436.14414525032043 + }, + { + "step": 1232, + "loss": 0.044482216238975525, + "error": 0.0146484375, + "gradient_norm": 0.04537617415189743, + "elapsed": 440.6220428943634 + }, + { + "step": 1248, + "loss": 0.42564862966537476, + "error": 0.2119140625, + "gradient_norm": 0.03382417559623718, + "elapsed": 445.06736421585083 + }, + { + "step": 1264, + "loss": 0.27150213718414307, + "error": 0.123046875, + "gradient_norm": 0.033046118915081024, + "elapsed": 449.544029712677 + }, + { + "step": 1280, + "loss": 0.4927375912666321, + "error": 0.255859375, + "gradient_norm": 0.06812550127506256, + "elapsed": 454.07198667526245 + }, + { + "step": 1296, + "loss": 0.5541940927505493, + "error": 0.28125, + "gradient_norm": 0.1435294896364212, + "elapsed": 458.6031415462494 + }, + { + "step": 1312, + "loss": 0.5575842261314392, + "error": 0.2958984375, + "gradient_norm": 0.03811952844262123, + "elapsed": 463.1806228160858 + }, + { + "step": 1328, + "loss": 0.3479428291320801, + "error": 0.1591796875, + "gradient_norm": 0.0709012895822525, + "elapsed": 467.84689688682556 + }, + { + "step": 1344, + "loss": 0.1685580611228943, + "error": 0.0693359375, + "gradient_norm": 0.05423415079712868, + "elapsed": 472.6908576488495 + }, + { + "step": 1360, + "loss": 0.18506410717964172, + "error": 0.0771484375, + "gradient_norm": 0.03418596833944321, + "elapsed": 477.4269769191742 + }, + { + "step": 1376, + "loss": 0.5654555559158325, + "error": 0.3173828125, + "gradient_norm": 0.0685155838727951, + "elapsed": 482.08285188674927 + }, + { + "step": 1392, + "loss": 0.6116407513618469, + "error": 0.3603515625, + "gradient_norm": 0.05198948457837105, + "elapsed": 486.7167499065399 + }, + { + "step": 1408, + "loss": 0.4014682471752167, + "error": 0.19140625, + "gradient_norm": 0.1024075523018837, + "elapsed": 491.4308760166168 + }, + { + "step": 1424, + "loss": 0.051035866141319275, + "error": 0.0166015625, + "gradient_norm": 0.010207361541688442, + "elapsed": 496.1818380355835 + }, + { + "step": 1440, + "loss": 0.4725648760795593, + "error": 0.2412109375, + "gradient_norm": 0.03977378085255623, + "elapsed": 500.8668632507324 + }, + { + "step": 1456, + "loss": 0.5407818555831909, + "error": 0.2939453125, + "gradient_norm": 0.088577501475811, + "elapsed": 505.49274134635925 + }, + { + "step": 1472, + "loss": 0.5655064582824707, + "error": 0.3076171875, + "gradient_norm": 0.04452778398990631, + "elapsed": 510.2188584804535 + }, + { + "step": 1488, + "loss": 0.5799556374549866, + "error": 0.30859375, + "gradient_norm": 0.03976206108927727, + "elapsed": 514.9319434165955 + }, + { + "step": 1504, + "loss": 0.4660354256629944, + "error": 0.25390625, + "gradient_norm": 0.04365506023168564, + "elapsed": 519.5848798751831 + }, + { + "step": 1520, + "loss": 0.5505894422531128, + "error": 0.30859375, + "gradient_norm": 0.057772211730480194, + "elapsed": 524.3388590812683 + }, + { + "step": 1536, + "loss": 0.6251416206359863, + "error": 0.400390625, + "gradient_norm": 0.09649194777011871, + "elapsed": 529.483047246933 + }, + { + "step": 1552, + "loss": 0.05424533039331436, + "error": 0.0185546875, + "gradient_norm": 0.011683990247547626, + "elapsed": 548.1828610897064 + }, + { + "step": 1568, + "loss": 0.33612310886383057, + "error": 0.1611328125, + "gradient_norm": 0.051817383617162704, + "elapsed": 553.4256420135498 + }, + { + "step": 1584, + "loss": 0.045015305280685425, + "error": 0.0166015625, + "gradient_norm": 0.022604886442422867, + "elapsed": 558.6308543682098 + }, + { + "step": 1600, + "loss": 0.2701840102672577, + "error": 0.119140625, + "gradient_norm": 0.02910422720015049, + "elapsed": 563.8571691513062 + }, + { + "step": 1616, + "loss": 0.18982334434986115, + "error": 0.0849609375, + "gradient_norm": 0.025524422526359558, + "elapsed": 568.8628678321838 + }, + { + "step": 1632, + "loss": 0.3950161337852478, + "error": 0.185546875, + "gradient_norm": 0.08419577777385712, + "elapsed": 574.0815451145172 + }, + { + "step": 1648, + "loss": 0.49384528398513794, + "error": 0.255859375, + "gradient_norm": 0.08879344165325165, + "elapsed": 579.1229114532471 + }, + { + "step": 1664, + "loss": 0.5671384930610657, + "error": 0.3115234375, + "gradient_norm": 0.05374513566493988, + "elapsed": 584.114851474762 + }, + { + "step": 1680, + "loss": 0.6192574501037598, + "error": 0.37890625, + "gradient_norm": 0.043836336582899094, + "elapsed": 589.0708522796631 + }, + { + "step": 1696, + "loss": 0.2619469463825226, + "error": 0.1171875, + "gradient_norm": 0.040093280375003815, + "elapsed": 594.2814819812775 + }, + { + "step": 1712, + "loss": 0.33178141713142395, + "error": 0.162109375, + "gradient_norm": 0.04902712255716324, + "elapsed": 599.3068840503693 + }, + { + "step": 1728, + "loss": 0.385281503200531, + "error": 0.171875, + "gradient_norm": 0.03541380167007446, + "elapsed": 604.5308682918549 + }, + { + "step": 1744, + "loss": 0.1628715693950653, + "error": 0.0693359375, + "gradient_norm": 0.06111741065979004, + "elapsed": 609.309522151947 + }, + { + "step": 1760, + "loss": 0.5239119529724121, + "error": 0.2861328125, + "gradient_norm": 0.08513613045215607, + "elapsed": 614.0396001338959 + }, + { + "step": 1776, + "loss": 0.35721707344055176, + "error": 0.150390625, + "gradient_norm": 0.06337940692901611, + "elapsed": 618.6857132911682 + }, + { + "step": 1792, + "loss": 0.5985626578330994, + "error": 0.33203125, + "gradient_norm": 0.035725343972444534, + "elapsed": 623.3352344036102 + }, + { + "step": 1808, + "loss": 0.34676820039749146, + "error": 0.15234375, + "gradient_norm": 0.08163885772228241, + "elapsed": 627.9495220184326 + }, + { + "step": 1824, + "loss": 0.5633711814880371, + "error": 0.3037109375, + "gradient_norm": 0.05938677117228508, + "elapsed": 632.5820379257202 + }, + { + "step": 1840, + "loss": 0.6256523132324219, + "error": 0.384765625, + "gradient_norm": 0.04545137286186218, + "elapsed": 637.205274105072 + }, + { + "step": 1856, + "loss": 0.28091639280319214, + "error": 0.1298828125, + "gradient_norm": 0.04705077037215233, + "elapsed": 641.883561372757 + }, + { + "step": 1872, + "loss": 0.516182541847229, + "error": 0.263671875, + "gradient_norm": 0.08828777819871902, + "elapsed": 646.5188939571381 + }, + { + "step": 1888, + "loss": 0.48386621475219727, + "error": 0.25390625, + "gradient_norm": 0.05322824418544769, + "elapsed": 651.148512840271 + }, + { + "step": 1904, + "loss": 0.6141921281814575, + "error": 0.388671875, + "gradient_norm": 0.050139278173446655, + "elapsed": 655.7796437740326 + }, + { + "step": 1920, + "loss": 0.18002840876579285, + "error": 0.0712890625, + "gradient_norm": 0.04201133921742439, + "elapsed": 660.4064948558807 + }, + { + "step": 1936, + "loss": 0.17531852424144745, + "error": 0.0732421875, + "gradient_norm": 0.024726318195462227, + "elapsed": 664.9991583824158 + }, + { + "step": 1952, + "loss": 0.5088322758674622, + "error": 0.2744140625, + "gradient_norm": 0.04693225398659706, + "elapsed": 669.5544555187225 + }, + { + "step": 1968, + "loss": 0.5684165358543396, + "error": 0.3310546875, + "gradient_norm": 0.031029095873236656, + "elapsed": 674.2354445457458 + }, + { + "step": 1984, + "loss": 0.06459524482488632, + "error": 0.017578125, + "gradient_norm": 0.03600892797112465, + "elapsed": 678.7982559204102 + }, + { + "step": 2000, + "loss": 0.3614455461502075, + "error": 0.1748046875, + "gradient_norm": 0.07060294598340988, + "elapsed": 683.2650325298309 + }, + { + "step": 2016, + "loss": 0.35535523295402527, + "error": 0.166015625, + "gradient_norm": 0.05873403698205948, + "elapsed": 687.7125518321991 + }, + { + "step": 2032, + "loss": 0.5638720989227295, + "error": 0.3232421875, + "gradient_norm": 0.07380504906177521, + "elapsed": 692.1461188793182 + }, + { + "step": 2048, + "loss": 0.5301838517189026, + "error": 0.2919921875, + "gradient_norm": 0.05435395985841751, + "elapsed": 696.6235508918762 + } + ] + }, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.250907301902771, + "error": 0.1083984375, + "gradient_norm": 0.07171476632356644, + "elapsed": 44.811134576797485 + }, + { + "step": 16, + "loss": 0.5958679914474487, + "error": 0.3662109375, + "gradient_norm": 0.07673005014657974, + "elapsed": 49.90856671333313 + }, + { + "step": 32, + "loss": 0.47648972272872925, + "error": 0.2421875, + "gradient_norm": 0.08561501652002335, + "elapsed": 55.179388761520386 + }, + { + "step": 48, + "loss": 0.06145006790757179, + "error": 0.0234375, + "gradient_norm": 0.01556467730551958, + "elapsed": 61.0339195728302 + }, + { + "step": 64, + "loss": 0.3687053918838501, + "error": 0.1884765625, + "gradient_norm": 0.08752371370792389, + "elapsed": 65.95811891555786 + }, + { + "step": 80, + "loss": 0.6481984853744507, + "error": 0.4140625, + "gradient_norm": 0.05311283841729164, + "elapsed": 70.56021332740784 + }, + { + "step": 96, + "loss": 0.42319929599761963, + "error": 0.2138671875, + "gradient_norm": 0.05047478526830673, + "elapsed": 75.11613631248474 + }, + { + "step": 112, + "loss": 0.47527259588241577, + "error": 0.24609375, + "gradient_norm": 0.038366906344890594, + "elapsed": 79.53446984291077 + }, + { + "step": 128, + "loss": 0.5996723175048828, + "error": 0.3369140625, + "gradient_norm": 0.1213272362947464, + "elapsed": 83.97515749931335 + }, + { + "step": 144, + "loss": 0.04971993714570999, + "error": 0.0146484375, + "gradient_norm": 0.008080735802650452, + "elapsed": 88.44039463996887 + }, + { + "step": 160, + "loss": 0.35900360345840454, + "error": 0.162109375, + "gradient_norm": 0.03359593451023102, + "elapsed": 92.89548206329346 + }, + { + "step": 176, + "loss": 0.5342063903808594, + "error": 0.2978515625, + "gradient_norm": 0.04794691130518913, + "elapsed": 97.35658049583435 + }, + { + "step": 192, + "loss": 0.6300076246261597, + "error": 0.369140625, + "gradient_norm": 0.081769198179245, + "elapsed": 101.81493759155273 + }, + { + "step": 208, + "loss": 0.6191903948783875, + "error": 0.3828125, + "gradient_norm": 0.07145775109529495, + "elapsed": 106.2480263710022 + }, + { + "step": 224, + "loss": 0.5155678391456604, + "error": 0.28515625, + "gradient_norm": 0.06772179156541824, + "elapsed": 110.71284222602844 + }, + { + "step": 240, + "loss": 0.634708046913147, + "error": 0.3857421875, + "gradient_norm": 0.09493093192577362, + "elapsed": 115.14978742599487 + }, + { + "step": 256, + "loss": 0.1840895414352417, + "error": 0.0751953125, + "gradient_norm": 0.025586696341633797, + "elapsed": 119.61202120780945 + }, + { + "step": 272, + "loss": 0.2775103449821472, + "error": 0.12890625, + "gradient_norm": 0.06913147866725922, + "elapsed": 124.02584528923035 + }, + { + "step": 288, + "loss": 0.6163080334663391, + "error": 0.3642578125, + "gradient_norm": 0.05895426496863365, + "elapsed": 128.46512532234192 + }, + { + "step": 304, + "loss": 0.5276986360549927, + "error": 0.287109375, + "gradient_norm": 0.06955187022686005, + "elapsed": 132.89240765571594 + }, + { + "step": 320, + "loss": 0.44859516620635986, + "error": 0.22265625, + "gradient_norm": 0.07272452116012573, + "elapsed": 137.32864713668823 + }, + { + "step": 336, + "loss": 0.48315611481666565, + "error": 0.2626953125, + "gradient_norm": 0.03321139141917229, + "elapsed": 141.80009770393372 + }, + { + "step": 352, + "loss": 0.6107717752456665, + "error": 0.3544921875, + "gradient_norm": 0.05243214592337608, + "elapsed": 146.36439752578735 + }, + { + "step": 368, + "loss": 0.6215153932571411, + "error": 0.357421875, + "gradient_norm": 0.04383325204253197, + "elapsed": 150.99996852874756 + }, + { + "step": 384, + "loss": 0.6130329966545105, + "error": 0.35546875, + "gradient_norm": 0.04113119840621948, + "elapsed": 155.62374639511108 + }, + { + "step": 400, + "loss": 0.30471885204315186, + "error": 0.142578125, + "gradient_norm": 0.04447556659579277, + "elapsed": 160.17594957351685 + }, + { + "step": 416, + "loss": 0.6154489517211914, + "error": 0.37109375, + "gradient_norm": 0.04456057772040367, + "elapsed": 164.7639675140381 + }, + { + "step": 432, + "loss": 0.6134694218635559, + "error": 0.337890625, + "gradient_norm": 0.04219559207558632, + "elapsed": 169.32792139053345 + }, + { + "step": 448, + "loss": 0.5463185906410217, + "error": 0.2939453125, + "gradient_norm": 0.07746092975139618, + "elapsed": 173.88445162773132 + }, + { + "step": 464, + "loss": 0.06016772612929344, + "error": 0.01953125, + "gradient_norm": 0.01364185381680727, + "elapsed": 178.42725706100464 + }, + { + "step": 480, + "loss": 0.388141393661499, + "error": 0.18359375, + "gradient_norm": 0.04870256036520004, + "elapsed": 182.99062085151672 + }, + { + "step": 496, + "loss": 0.44524821639060974, + "error": 0.2216796875, + "gradient_norm": 0.03453445807099342, + "elapsed": 187.56396961212158 + }, + { + "step": 512, + "loss": 0.34312355518341064, + "error": 0.154296875, + "gradient_norm": 0.06794509291648865, + "elapsed": 192.27511191368103 + }, + { + "step": 528, + "loss": 0.19467462599277496, + "error": 0.0771484375, + "gradient_norm": 0.042381469160318375, + "elapsed": 197.7108268737793 + }, + { + "step": 544, + "loss": 0.46226584911346436, + "error": 0.2421875, + "gradient_norm": 0.06073570251464844, + "elapsed": 202.97405791282654 + }, + { + "step": 560, + "loss": 0.525318443775177, + "error": 0.2822265625, + "gradient_norm": 0.06954885274171829, + "elapsed": 208.69676971435547 + }, + { + "step": 576, + "loss": 0.6158387064933777, + "error": 0.349609375, + "gradient_norm": 0.07587578892707825, + "elapsed": 214.80397653579712 + }, + { + "step": 592, + "loss": 0.5515886545181274, + "error": 0.298828125, + "gradient_norm": 0.04969338700175285, + "elapsed": 220.27399611473083 + }, + { + "step": 608, + "loss": 0.18365338444709778, + "error": 0.0654296875, + "gradient_norm": 0.08657706528902054, + "elapsed": 224.81246256828308 + }, + { + "step": 624, + "loss": 0.4578855633735657, + "error": 0.2421875, + "gradient_norm": 0.04942100867629051, + "elapsed": 229.45902252197266 + }, + { + "step": 640, + "loss": 0.37826013565063477, + "error": 0.1865234375, + "gradient_norm": 0.047499872744083405, + "elapsed": 233.9695644378662 + }, + { + "step": 656, + "loss": 0.40863412618637085, + "error": 0.2001953125, + "gradient_norm": 0.07845330238342285, + "elapsed": 238.584894657135 + }, + { + "step": 672, + "loss": 0.5640332698822021, + "error": 0.2880859375, + "gradient_norm": 0.057469289749860764, + "elapsed": 243.0929844379425 + }, + { + "step": 688, + "loss": 0.030216243118047714, + "error": 0.0078125, + "gradient_norm": 0.04682641476392746, + "elapsed": 247.581125497818 + }, + { + "step": 704, + "loss": 0.375002384185791, + "error": 0.1826171875, + "gradient_norm": 0.04864194989204407, + "elapsed": 252.1564691066742 + }, + { + "step": 720, + "loss": 0.5145515203475952, + "error": 0.2744140625, + "gradient_norm": 0.052671682089567184, + "elapsed": 256.6466488838196 + }, + { + "step": 736, + "loss": 0.067174531519413, + "error": 0.0224609375, + "gradient_norm": 0.019299577921628952, + "elapsed": 261.1185076236725 + }, + { + "step": 752, + "loss": 0.24909992516040802, + "error": 0.111328125, + "gradient_norm": 0.06907463818788528, + "elapsed": 265.61960339546204 + }, + { + "step": 768, + "loss": 0.5088074207305908, + "error": 0.2744140625, + "gradient_norm": 0.06963017582893372, + "elapsed": 270.07474064826965 + }, + { + "step": 784, + "loss": 0.3783387839794159, + "error": 0.1826171875, + "gradient_norm": 0.05537794530391693, + "elapsed": 274.52722239494324 + }, + { + "step": 800, + "loss": 0.6107200980186462, + "error": 0.3623046875, + "gradient_norm": 0.0470259003341198, + "elapsed": 279.0401859283447 + }, + { + "step": 816, + "loss": 0.5778236389160156, + "error": 0.3212890625, + "gradient_norm": 0.10146680474281311, + "elapsed": 283.5114622116089 + }, + { + "step": 832, + "loss": 0.576002299785614, + "error": 0.3076171875, + "gradient_norm": 0.07760787010192871, + "elapsed": 288.04797434806824 + }, + { + "step": 848, + "loss": 0.6179666519165039, + "error": 0.3740234375, + "gradient_norm": 0.07383852452039719, + "elapsed": 292.60600209236145 + }, + { + "step": 864, + "loss": 0.3105512857437134, + "error": 0.1455078125, + "gradient_norm": 0.052953749895095825, + "elapsed": 297.12180352211 + }, + { + "step": 880, + "loss": 0.4802623987197876, + "error": 0.2548828125, + "gradient_norm": 0.07736275345087051, + "elapsed": 301.6091134548187 + }, + { + "step": 896, + "loss": 0.5572722554206848, + "error": 0.318359375, + "gradient_norm": 0.053303152322769165, + "elapsed": 306.1978073120117 + }, + { + "step": 912, + "loss": 0.34814420342445374, + "error": 0.1669921875, + "gradient_norm": 0.037726350128650665, + "elapsed": 310.78571581840515 + }, + { + "step": 928, + "loss": 0.41743016242980957, + "error": 0.21875, + "gradient_norm": 0.05238872766494751, + "elapsed": 315.24156188964844 + }, + { + "step": 944, + "loss": 0.5757850408554077, + "error": 0.3173828125, + "gradient_norm": 0.05837905779480934, + "elapsed": 319.78475165367126 + }, + { + "step": 960, + "loss": 0.40727972984313965, + "error": 0.197265625, + "gradient_norm": 0.059294261038303375, + "elapsed": 324.2090265750885 + }, + { + "step": 976, + "loss": 0.32715001702308655, + "error": 0.1533203125, + "gradient_norm": 0.11543179303407669, + "elapsed": 328.6462152004242 + }, + { + "step": 992, + "loss": 0.5578742623329163, + "error": 0.314453125, + "gradient_norm": 0.06282714009284973, + "elapsed": 333.0712504386902 + }, + { + "step": 1008, + "loss": 0.5052692294120789, + "error": 0.265625, + "gradient_norm": 0.04039420187473297, + "elapsed": 337.5182821750641 + }, + { + "step": 1024, + "loss": 0.18790806829929352, + "error": 0.08203125, + "gradient_norm": 0.028905188664793968, + "elapsed": 342.08340406417847 + }, + { + "step": 1040, + "loss": 0.6317684650421143, + "error": 0.3681640625, + "gradient_norm": 0.03441835194826126, + "elapsed": 358.8279616832733 + }, + { + "step": 1056, + "loss": 0.40474164485931396, + "error": 0.2021484375, + "gradient_norm": 0.036449309438467026, + "elapsed": 363.30218267440796 + }, + { + "step": 1072, + "loss": 0.518299400806427, + "error": 0.2666015625, + "gradient_norm": 0.0886964276432991, + "elapsed": 367.87997555732727 + }, + { + "step": 1088, + "loss": 0.2522922158241272, + "error": 0.099609375, + "gradient_norm": 0.07553310692310333, + "elapsed": 372.4414882659912 + }, + { + "step": 1104, + "loss": 0.6214810609817505, + "error": 0.3701171875, + "gradient_norm": 0.10188957303762436, + "elapsed": 376.9120502471924 + }, + { + "step": 1120, + "loss": 0.6307054162025452, + "error": 0.3720703125, + "gradient_norm": 0.07353860139846802, + "elapsed": 381.3824534416199 + }, + { + "step": 1136, + "loss": 0.5259381532669067, + "error": 0.2763671875, + "gradient_norm": 0.05779678374528885, + "elapsed": 385.8413143157959 + }, + { + "step": 1152, + "loss": 0.4995541572570801, + "error": 0.259765625, + "gradient_norm": 0.046648140996694565, + "elapsed": 390.28326058387756 + }, + { + "step": 1168, + "loss": 0.6075694561004639, + "error": 0.3701171875, + "gradient_norm": 0.10612073540687561, + "elapsed": 394.8162364959717 + }, + { + "step": 1184, + "loss": 0.2105136513710022, + "error": 0.080078125, + "gradient_norm": 0.0716402605175972, + "elapsed": 399.2960283756256 + }, + { + "step": 1200, + "loss": 0.6371631026268005, + "error": 0.3857421875, + "gradient_norm": 0.0549108125269413, + "elapsed": 403.7899103164673 + }, + { + "step": 1216, + "loss": 0.5450670719146729, + "error": 0.2939453125, + "gradient_norm": 0.11688558012247086, + "elapsed": 408.34677600860596 + }, + { + "step": 1232, + "loss": 0.035783201456069946, + "error": 0.01171875, + "gradient_norm": 0.02951689623296261, + "elapsed": 412.8558337688446 + }, + { + "step": 1248, + "loss": 0.5582903623580933, + "error": 0.3046875, + "gradient_norm": 0.055107031017541885, + "elapsed": 417.29854226112366 + }, + { + "step": 1264, + "loss": 0.5154441595077515, + "error": 0.27734375, + "gradient_norm": 0.04474929720163345, + "elapsed": 421.7792055606842 + }, + { + "step": 1280, + "loss": 0.35227546095848083, + "error": 0.16015625, + "gradient_norm": 0.05024837702512741, + "elapsed": 426.54427456855774 + }, + { + "step": 1296, + "loss": 0.19417589902877808, + "error": 0.0830078125, + "gradient_norm": 0.026926057413220406, + "elapsed": 431.320588350296 + }, + { + "step": 1312, + "loss": 0.4768218398094177, + "error": 0.248046875, + "gradient_norm": 0.15099607408046722, + "elapsed": 435.96817326545715 + }, + { + "step": 1328, + "loss": 0.48580923676490784, + "error": 0.2509765625, + "gradient_norm": 0.08925126492977142, + "elapsed": 440.64917039871216 + }, + { + "step": 1344, + "loss": 0.42041274905204773, + "error": 0.1982421875, + "gradient_norm": 0.08321093022823334, + "elapsed": 445.34370946884155 + }, + { + "step": 1360, + "loss": 0.06403929740190506, + "error": 0.0185546875, + "gradient_norm": 0.03817005455493927, + "elapsed": 449.98669385910034 + }, + { + "step": 1376, + "loss": 0.463126003742218, + "error": 0.2275390625, + "gradient_norm": 0.08894515782594681, + "elapsed": 454.6478977203369 + }, + { + "step": 1392, + "loss": 0.5995306968688965, + "error": 0.373046875, + "gradient_norm": 0.06733685731887817, + "elapsed": 459.35924530029297 + }, + { + "step": 1408, + "loss": 0.49053263664245605, + "error": 0.25, + "gradient_norm": 0.10475508868694305, + "elapsed": 464.100093126297 + }, + { + "step": 1424, + "loss": 0.6220744848251343, + "error": 0.3818359375, + "gradient_norm": 0.03653963655233383, + "elapsed": 468.89601135253906 + }, + { + "step": 1440, + "loss": 0.39706122875213623, + "error": 0.2021484375, + "gradient_norm": 0.04344598576426506, + "elapsed": 474.03999519348145 + }, + { + "step": 1456, + "loss": 0.5386708974838257, + "error": 0.3095703125, + "gradient_norm": 0.12589037418365479, + "elapsed": 478.8600504398346 + }, + { + "step": 1472, + "loss": 0.49776726961135864, + "error": 0.271484375, + "gradient_norm": 0.058137863874435425, + "elapsed": 483.5920066833496 + }, + { + "step": 1488, + "loss": 0.4757428765296936, + "error": 0.2412109375, + "gradient_norm": 0.050453316420316696, + "elapsed": 488.4611999988556 + }, + { + "step": 1504, + "loss": 0.5694847702980042, + "error": 0.337890625, + "gradient_norm": 0.052419569343328476, + "elapsed": 493.26151037216187 + }, + { + "step": 1520, + "loss": 0.5997745990753174, + "error": 0.3603515625, + "gradient_norm": 0.04338108375668526, + "elapsed": 498.0421245098114 + }, + { + "step": 1536, + "loss": 0.6195274591445923, + "error": 0.3876953125, + "gradient_norm": 0.04848463833332062, + "elapsed": 502.8808298110962 + }, + { + "step": 1552, + "loss": 0.46315908432006836, + "error": 0.2353515625, + "gradient_norm": 0.06380566209554672, + "elapsed": 507.5519721508026 + }, + { + "step": 1568, + "loss": 0.605262041091919, + "error": 0.36328125, + "gradient_norm": 0.05077619478106499, + "elapsed": 512.457685470581 + }, + { + "step": 1584, + "loss": 0.48782041668891907, + "error": 0.232421875, + "gradient_norm": 0.09017211943864822, + "elapsed": 517.2960062026978 + }, + { + "step": 1600, + "loss": 0.3881351947784424, + "error": 0.1875, + "gradient_norm": 0.07205695658922195, + "elapsed": 522.0911631584167 + }, + { + "step": 1616, + "loss": 0.4966873526573181, + "error": 0.24609375, + "gradient_norm": 0.0582038015127182, + "elapsed": 526.8861901760101 + }, + { + "step": 1632, + "loss": 0.5844199657440186, + "error": 0.33203125, + "gradient_norm": 0.05101500824093819, + "elapsed": 531.6640138626099 + }, + { + "step": 1648, + "loss": 0.31010180711746216, + "error": 0.1318359375, + "gradient_norm": 0.053135693073272705, + "elapsed": 536.4960391521454 + }, + { + "step": 1664, + "loss": 0.6174807548522949, + "error": 0.3779296875, + "gradient_norm": 0.04161194711923599, + "elapsed": 541.2560484409332 + }, + { + "step": 1680, + "loss": 0.18213607370853424, + "error": 0.0751953125, + "gradient_norm": 0.07171957194805145, + "elapsed": 546.0000085830688 + }, + { + "step": 1696, + "loss": 0.5445692539215088, + "error": 0.2998046875, + "gradient_norm": 0.054499462246894836, + "elapsed": 551.1221191883087 + }, + { + "step": 1712, + "loss": 0.05744167044758797, + "error": 0.017578125, + "gradient_norm": 0.013108699582517147, + "elapsed": 556.5286149978638 + }, + { + "step": 1728, + "loss": 0.6381571292877197, + "error": 0.3896484375, + "gradient_norm": 0.05157556012272835, + "elapsed": 561.8000066280365 + }, + { + "step": 1744, + "loss": 0.5301004648208618, + "error": 0.28125, + "gradient_norm": 0.04218568280339241, + "elapsed": 567.2760035991669 + }, + { + "step": 1760, + "loss": 0.5275102257728577, + "error": 0.26953125, + "gradient_norm": 0.06798839569091797, + "elapsed": 572.5601994991302 + }, + { + "step": 1776, + "loss": 0.6443773508071899, + "error": 0.4091796875, + "gradient_norm": 0.07035460323095322, + "elapsed": 577.9789206981659 + }, + { + "step": 1792, + "loss": 0.6012362241744995, + "error": 0.337890625, + "gradient_norm": 0.05189951881766319, + "elapsed": 583.028017282486 + }, + { + "step": 1808, + "loss": 0.2939091920852661, + "error": 0.12109375, + "gradient_norm": 0.05555355176329613, + "elapsed": 588.0501506328583 + }, + { + "step": 1824, + "loss": 0.2059091478586197, + "error": 0.08984375, + "gradient_norm": 0.045679714530706406, + "elapsed": 593.2120039463043 + }, + { + "step": 1840, + "loss": 0.6289581060409546, + "error": 0.349609375, + "gradient_norm": 0.04742642492055893, + "elapsed": 598.7767763137817 + }, + { + "step": 1856, + "loss": 0.5532636642456055, + "error": 0.294921875, + "gradient_norm": 0.05997413396835327, + "elapsed": 604.0475382804871 + }, + { + "step": 1872, + "loss": 0.45995670557022095, + "error": 0.228515625, + "gradient_norm": 0.05674462765455246, + "elapsed": 609.292379617691 + }, + { + "step": 1888, + "loss": 0.6178656816482544, + "error": 0.359375, + "gradient_norm": 0.08857566863298416, + "elapsed": 614.5639882087708 + }, + { + "step": 1904, + "loss": 0.5531284213066101, + "error": 0.287109375, + "gradient_norm": 0.10257937759160995, + "elapsed": 619.5600035190582 + }, + { + "step": 1920, + "loss": 0.04184349626302719, + "error": 0.013671875, + "gradient_norm": 0.04087059944868088, + "elapsed": 624.6679775714874 + }, + { + "step": 1936, + "loss": 0.5924860239028931, + "error": 0.3505859375, + "gradient_norm": 0.036822713911533356, + "elapsed": 629.936680316925 + }, + { + "step": 1952, + "loss": 0.46996980905532837, + "error": 0.2421875, + "gradient_norm": 0.034442272037267685, + "elapsed": 635.1109762191772 + }, + { + "step": 1968, + "loss": 0.17859068512916565, + "error": 0.0712890625, + "gradient_norm": 0.03440066799521446, + "elapsed": 640.32000207901 + }, + { + "step": 1984, + "loss": 0.6192275285720825, + "error": 0.3701171875, + "gradient_norm": 0.04386439174413681, + "elapsed": 645.6040184497833 + }, + { + "step": 2000, + "loss": 0.6160917282104492, + "error": 0.35546875, + "gradient_norm": 0.06268990784883499, + "elapsed": 650.7723731994629 + }, + { + "step": 2016, + "loss": 0.6343611478805542, + "error": 0.388671875, + "gradient_norm": 0.04243326932191849, + "elapsed": 655.972663640976 + }, + { + "step": 2032, + "loss": 0.062292590737342834, + "error": 0.021484375, + "gradient_norm": 0.016680095344781876, + "elapsed": 660.8079733848572 + }, + { + "step": 2048, + "loss": 0.5316072702407837, + "error": 0.26953125, + "gradient_norm": 0.057860780507326126, + "elapsed": 665.5760209560394 + }, + { + "step": 2064, + "loss": 0.605312705039978, + "error": 0.3623046875, + "gradient_norm": 0.04028146713972092, + "elapsed": 682.7294294834137 + }, + { + "step": 2080, + "loss": 0.56633460521698, + "error": 0.3330078125, + "gradient_norm": 0.09528280049562454, + "elapsed": 687.4644649028778 + }, + { + "step": 2096, + "loss": 0.3905397057533264, + "error": 0.1943359375, + "gradient_norm": 0.049456462264060974, + "elapsed": 692.1492264270782 + }, + { + "step": 2112, + "loss": 0.28124868869781494, + "error": 0.1259765625, + "gradient_norm": 0.059239838272333145, + "elapsed": 696.8701393604279 + }, + { + "step": 2128, + "loss": 0.6364338994026184, + "error": 0.392578125, + "gradient_norm": 0.08667811006307602, + "elapsed": 701.683988571167 + }, + { + "step": 2144, + "loss": 0.20683243870735168, + "error": 0.07421875, + "gradient_norm": 0.1100710779428482, + "elapsed": 706.4000360965729 + }, + { + "step": 2160, + "loss": 0.5912737250328064, + "error": 0.341796875, + "gradient_norm": 0.05641854554414749, + "elapsed": 711.2359964847565 + }, + { + "step": 2176, + "loss": 0.27793264389038086, + "error": 0.12109375, + "gradient_norm": 0.0893034040927887, + "elapsed": 715.9508004188538 + }, + { + "step": 2192, + "loss": 0.6474133133888245, + "error": 0.4072265625, + "gradient_norm": 0.06980258971452713, + "elapsed": 720.651974439621 + }, + { + "step": 2208, + "loss": 0.5961858630180359, + "error": 0.35546875, + "gradient_norm": 0.06530112773180008, + "elapsed": 725.496098279953 + }, + { + "step": 2224, + "loss": 0.47581571340560913, + "error": 0.263671875, + "gradient_norm": 0.04470043256878853, + "elapsed": 730.2880010604858 + }, + { + "step": 2240, + "loss": 0.577988862991333, + "error": 0.318359375, + "gradient_norm": 0.07201159745454788, + "elapsed": 735.006133556366 + }, + { + "step": 2256, + "loss": 0.28444671630859375, + "error": 0.1181640625, + "gradient_norm": 0.048656050115823746, + "elapsed": 739.6868116855621 + }, + { + "step": 2272, + "loss": 0.2776409089565277, + "error": 0.1201171875, + "gradient_norm": 0.05783981829881668, + "elapsed": 744.3517308235168 + }, + { + "step": 2288, + "loss": 0.621599555015564, + "error": 0.37109375, + "gradient_norm": 0.09731200337409973, + "elapsed": 749.0351710319519 + }, + { + "step": 2304, + "loss": 0.3333754539489746, + "error": 0.1513671875, + "gradient_norm": 0.07069239765405655, + "elapsed": 753.7588081359863 + }, + { + "step": 2320, + "loss": 0.4687051773071289, + "error": 0.2490234375, + "gradient_norm": 0.044891707599163055, + "elapsed": 758.4588432312012 + }, + { + "step": 2336, + "loss": 0.19801637530326843, + "error": 0.078125, + "gradient_norm": 0.10036595165729523, + "elapsed": 763.256409406662 + }, + { + "step": 2352, + "loss": 0.6186277866363525, + "error": 0.388671875, + "gradient_norm": 0.09069584310054779, + "elapsed": 767.9986386299133 + }, + { + "step": 2368, + "loss": 0.6177258491516113, + "error": 0.373046875, + "gradient_norm": 0.049019571393728256, + "elapsed": 772.730831861496 + }, + { + "step": 2384, + "loss": 0.17707547545433044, + "error": 0.0673828125, + "gradient_norm": 0.045190781354904175, + "elapsed": 777.4072704315186 + }, + { + "step": 2400, + "loss": 0.20144733786582947, + "error": 0.08203125, + "gradient_norm": 0.04537162929773331, + "elapsed": 782.0841658115387 + }, + { + "step": 2416, + "loss": 0.6151775121688843, + "error": 0.365234375, + "gradient_norm": 0.050534047186374664, + "elapsed": 786.762966632843 + }, + { + "step": 2432, + "loss": 0.5533859133720398, + "error": 0.314453125, + "gradient_norm": 0.06006559729576111, + "elapsed": 791.4656012058258 + }, + { + "step": 2448, + "loss": 0.5329082012176514, + "error": 0.2880859375, + "gradient_norm": 0.04018115997314453, + "elapsed": 796.1704161167145 + }, + { + "step": 2464, + "loss": 0.6338047981262207, + "error": 0.4140625, + "gradient_norm": 0.06069163978099823, + "elapsed": 800.9180119037628 + }, + { + "step": 2480, + "loss": 0.1603008508682251, + "error": 0.0673828125, + "gradient_norm": 0.040350593626499176, + "elapsed": 805.6127603054047 + }, + { + "step": 2496, + "loss": 0.505940318107605, + "error": 0.2568359375, + "gradient_norm": 0.05209952965378761, + "elapsed": 810.3740313053131 + }, + { + "step": 2512, + "loss": 0.5528728365898132, + "error": 0.298828125, + "gradient_norm": 0.11757992953062057, + "elapsed": 815.1708807945251 + }, + { + "step": 2528, + "loss": 0.5028313994407654, + "error": 0.2666015625, + "gradient_norm": 0.08823780715465546, + "elapsed": 819.8585045337677 + }, + { + "step": 2544, + "loss": 0.5002262592315674, + "error": 0.2783203125, + "gradient_norm": 0.04888603836297989, + "elapsed": 824.5714073181152 + }, + { + "step": 2560, + "loss": 0.6007894277572632, + "error": 0.328125, + "gradient_norm": 0.05186954140663147, + "elapsed": 829.3080432415009 + }, + { + "step": 2576, + "loss": 0.18641480803489685, + "error": 0.076171875, + "gradient_norm": 0.03799928352236748, + "elapsed": 834.044020652771 + }, + { + "step": 2592, + "loss": 0.3050769865512848, + "error": 0.1396484375, + "gradient_norm": 0.10119257122278214, + "elapsed": 838.8401296138763 + }, + { + "step": 2608, + "loss": 0.6063439846038818, + "error": 0.361328125, + "gradient_norm": 0.04979367554187775, + "elapsed": 844.3572654724121 + }, + { + "step": 2624, + "loss": 0.5751967430114746, + "error": 0.3369140625, + "gradient_norm": 0.04269539937376976, + "elapsed": 849.0660374164581 + }, + { + "step": 2640, + "loss": 0.3902108669281006, + "error": 0.193359375, + "gradient_norm": 0.10029696673154831, + "elapsed": 853.8638062477112 + }, + { + "step": 2656, + "loss": 0.15081660449504852, + "error": 0.0625, + "gradient_norm": 0.0303852129727602, + "elapsed": 858.9793758392334 + }, + { + "step": 2672, + "loss": 0.6503090858459473, + "error": 0.400390625, + "gradient_norm": 0.12611964344978333, + "elapsed": 863.9151141643524 + }, + { + "step": 2688, + "loss": 0.5587317943572998, + "error": 0.31640625, + "gradient_norm": 0.10028114914894104, + "elapsed": 868.7600305080414 + }, + { + "step": 2704, + "loss": 0.4399867355823517, + "error": 0.21484375, + "gradient_norm": 0.06889455020427704, + "elapsed": 873.4544236660004 + }, + { + "step": 2720, + "loss": 0.5865127444267273, + "error": 0.337890625, + "gradient_norm": 0.03671631962060928, + "elapsed": 878.0982644557953 + }, + { + "step": 2736, + "loss": 0.6078637838363647, + "error": 0.3701171875, + "gradient_norm": 0.04679318517446518, + "elapsed": 883.0424642562866 + }, + { + "step": 2752, + "loss": 0.5825340151786804, + "error": 0.337890625, + "gradient_norm": 0.05619681254029274, + "elapsed": 887.908124923706 + }, + { + "step": 2768, + "loss": 0.5970422029495239, + "error": 0.3369140625, + "gradient_norm": 0.041302867233753204, + "elapsed": 892.6760206222534 + }, + { + "step": 2784, + "loss": 0.3870226740837097, + "error": 0.1826171875, + "gradient_norm": 0.05731065198779106, + "elapsed": 897.6246056556702 + }, + { + "step": 2800, + "loss": 0.38130277395248413, + "error": 0.1943359375, + "gradient_norm": 0.059244755655527115, + "elapsed": 902.3360238075256 + }, + { + "step": 2816, + "loss": 0.2617901563644409, + "error": 0.1064453125, + "gradient_norm": 0.041736964136362076, + "elapsed": 907.1600468158722 + }, + { + "step": 2832, + "loss": 0.5819337368011475, + "error": 0.314453125, + "gradient_norm": 0.04097156226634979, + "elapsed": 912.0244295597076 + }, + { + "step": 2848, + "loss": 0.41393283009529114, + "error": 0.2001953125, + "gradient_norm": 0.10456771403551102, + "elapsed": 916.8225846290588 + }, + { + "step": 2864, + "loss": 0.5019145011901855, + "error": 0.2548828125, + "gradient_norm": 0.04843736067414284, + "elapsed": 921.538754940033 + }, + { + "step": 2880, + "loss": 0.04561338573694229, + "error": 0.0146484375, + "gradient_norm": 0.025407327339053154, + "elapsed": 926.2588667869568 + }, + { + "step": 2896, + "loss": 0.4338858723640442, + "error": 0.205078125, + "gradient_norm": 0.09900517761707306, + "elapsed": 930.9781975746155 + }, + { + "step": 2912, + "loss": 0.33922863006591797, + "error": 0.162109375, + "gradient_norm": 0.10189604014158249, + "elapsed": 935.6816267967224 + }, + { + "step": 2928, + "loss": 0.5294322967529297, + "error": 0.2822265625, + "gradient_norm": 0.09060791879892349, + "elapsed": 940.4373068809509 + }, + { + "step": 2944, + "loss": 0.037007369101047516, + "error": 0.01171875, + "gradient_norm": 0.05506489425897598, + "elapsed": 945.1270468235016 + }, + { + "step": 2960, + "loss": 0.6096771359443665, + "error": 0.349609375, + "gradient_norm": 0.04987221211194992, + "elapsed": 949.8300130367279 + }, + { + "step": 2976, + "loss": 0.6157823801040649, + "error": 0.373046875, + "gradient_norm": 0.03614233434200287, + "elapsed": 954.5701997280121 + }, + { + "step": 2992, + "loss": 0.1978239268064499, + "error": 0.080078125, + "gradient_norm": 0.05847112461924553, + "elapsed": 959.2756471633911 + }, + { + "step": 3008, + "loss": 0.5237340927124023, + "error": 0.2841796875, + "gradient_norm": 0.06993591040372849, + "elapsed": 963.9875864982605 + }, + { + "step": 3024, + "loss": 0.4559935927391052, + "error": 0.2373046875, + "gradient_norm": 0.05698448419570923, + "elapsed": 968.7997305393219 + }, + { + "step": 3040, + "loss": 0.5025208592414856, + "error": 0.259765625, + "gradient_norm": 0.14909739792346954, + "elapsed": 973.6042547225952 + }, + { + "step": 3056, + "loss": 0.3223109245300293, + "error": 0.1416015625, + "gradient_norm": 0.032974764704704285, + "elapsed": 978.4760546684265 + }, + { + "step": 3072, + "loss": 0.06682582199573517, + "error": 0.021484375, + "gradient_norm": 0.04433188587427139, + "elapsed": 983.2894048690796 + }, + { + "step": 3088, + "loss": 0.5919550061225891, + "error": 0.34765625, + "gradient_norm": 0.06721373647451401, + "elapsed": 1000.9520287513733 + }, + { + "step": 3104, + "loss": 0.5988063812255859, + "error": 0.3642578125, + "gradient_norm": 0.05654948577284813, + "elapsed": 1005.7442932128906 + }, + { + "step": 3120, + "loss": 0.4922299385070801, + "error": 0.2470703125, + "gradient_norm": 0.07545466721057892, + "elapsed": 1010.4616096019745 + }, + { + "step": 3136, + "loss": 0.4533671736717224, + "error": 0.236328125, + "gradient_norm": 0.06288722902536392, + "elapsed": 1015.3559956550598 + }, + { + "step": 3152, + "loss": 0.5070517063140869, + "error": 0.2666015625, + "gradient_norm": 0.07274917513132095, + "elapsed": 1020.0764343738556 + }, + { + "step": 3168, + "loss": 0.5999464988708496, + "error": 0.3408203125, + "gradient_norm": 0.05777016654610634, + "elapsed": 1024.9410600662231 + }, + { + "step": 3184, + "loss": 0.5758363008499146, + "error": 0.3427734375, + "gradient_norm": 0.051027461886405945, + "elapsed": 1029.7082171440125 + }, + { + "step": 3200, + "loss": 0.05016190931200981, + "error": 0.017578125, + "gradient_norm": 0.009175656363368034, + "elapsed": 1034.3982915878296 + }, + { + "step": 3216, + "loss": 0.5471057295799255, + "error": 0.318359375, + "gradient_norm": 0.07572721689939499, + "elapsed": 1039.117841243744 + }, + { + "step": 3232, + "loss": 0.4141446352005005, + "error": 0.193359375, + "gradient_norm": 0.10056859254837036, + "elapsed": 1043.880026102066 + }, + { + "step": 3248, + "loss": 0.5812438726425171, + "error": 0.3212890625, + "gradient_norm": 0.05781616270542145, + "elapsed": 1048.6406455039978 + }, + { + "step": 3264, + "loss": 0.19184701144695282, + "error": 0.078125, + "gradient_norm": 0.05367236211895943, + "elapsed": 1053.5672237873077 + }, + { + "step": 3280, + "loss": 0.5420833826065063, + "error": 0.28515625, + "gradient_norm": 0.052405405789613724, + "elapsed": 1058.3841104507446 + }, + { + "step": 3296, + "loss": 0.4419598877429962, + "error": 0.2177734375, + "gradient_norm": 0.05814693495631218, + "elapsed": 1063.1880333423615 + }, + { + "step": 3312, + "loss": 0.4525642991065979, + "error": 0.208984375, + "gradient_norm": 0.1061021164059639, + "elapsed": 1068.1370933055878 + }, + { + "step": 3328, + "loss": 0.32664671540260315, + "error": 0.154296875, + "gradient_norm": 0.05649850144982338, + "elapsed": 1073.1963467597961 + }, + { + "step": 3344, + "loss": 0.2655770182609558, + "error": 0.1220703125, + "gradient_norm": 0.04070372134447098, + "elapsed": 1078.2698318958282 + }, + { + "step": 3360, + "loss": 0.5894330739974976, + "error": 0.3544921875, + "gradient_norm": 0.0643400028347969, + "elapsed": 1083.0184152126312 + }, + { + "step": 3376, + "loss": 0.6118791103363037, + "error": 0.361328125, + "gradient_norm": 0.08537904173135757, + "elapsed": 1087.834038734436 + }, + { + "step": 3392, + "loss": 0.40694907307624817, + "error": 0.19921875, + "gradient_norm": 0.11411692947149277, + "elapsed": 1092.8119947910309 + }, + { + "step": 3408, + "loss": 0.04629015550017357, + "error": 0.0146484375, + "gradient_norm": 0.017204072326421738, + "elapsed": 1097.5751783847809 + }, + { + "step": 3424, + "loss": 0.20639702677726746, + "error": 0.0849609375, + "gradient_norm": 0.04801144450902939, + "elapsed": 1102.2970931529999 + }, + { + "step": 3440, + "loss": 0.6051071286201477, + "error": 0.33984375, + "gradient_norm": 0.045392412692308426, + "elapsed": 1107.1080610752106 + }, + { + "step": 3456, + "loss": 0.6553700566291809, + "error": 0.40625, + "gradient_norm": 0.05593863129615784, + "elapsed": 1111.8409752845764 + }, + { + "step": 3472, + "loss": 0.591402530670166, + "error": 0.3515625, + "gradient_norm": 0.051181379705667496, + "elapsed": 1116.5800333023071 + }, + { + "step": 3488, + "loss": 0.30494624376296997, + "error": 0.12109375, + "gradient_norm": 0.05175542086362839, + "elapsed": 1121.276373386383 + }, + { + "step": 3504, + "loss": 0.5065370798110962, + "error": 0.279296875, + "gradient_norm": 0.10419930517673492, + "elapsed": 1125.9883344173431 + }, + { + "step": 3520, + "loss": 0.3915700614452362, + "error": 0.1953125, + "gradient_norm": 0.060416825115680695, + "elapsed": 1130.7958455085754 + }, + { + "step": 3536, + "loss": 0.624374270439148, + "error": 0.3759765625, + "gradient_norm": 0.06069556251168251, + "elapsed": 1135.5360939502716 + }, + { + "step": 3552, + "loss": 0.5830206274986267, + "error": 0.3359375, + "gradient_norm": 0.046013280749320984, + "elapsed": 1140.312029838562 + }, + { + "step": 3568, + "loss": 0.4201379716396332, + "error": 0.2119140625, + "gradient_norm": 0.06909621506929398, + "elapsed": 1145.0904593467712 + }, + { + "step": 3584, + "loss": 0.28215405344963074, + "error": 0.1181640625, + "gradient_norm": 0.07625982910394669, + "elapsed": 1149.8156151771545 + }, + { + "step": 3600, + "loss": 0.5229164361953735, + "error": 0.275390625, + "gradient_norm": 0.055048178881406784, + "elapsed": 1154.5280592441559 + }, + { + "step": 3616, + "loss": 0.47238075733184814, + "error": 0.2314453125, + "gradient_norm": 0.06473162025213242, + "elapsed": 1159.2720873355865 + }, + { + "step": 3632, + "loss": 0.46245503425598145, + "error": 0.228515625, + "gradient_norm": 0.07382887601852417, + "elapsed": 1164.0119998455048 + }, + { + "step": 3648, + "loss": 0.37509745359420776, + "error": 0.171875, + "gradient_norm": 0.051260266453027725, + "elapsed": 1168.7440350055695 + }, + { + "step": 3664, + "loss": 0.1948484629392624, + "error": 0.080078125, + "gradient_norm": 0.059623416513204575, + "elapsed": 1173.3906588554382 + }, + { + "step": 3680, + "loss": 0.5552756786346436, + "error": 0.3115234375, + "gradient_norm": 0.08073585480451584, + "elapsed": 1178.0645008087158 + }, + { + "step": 3696, + "loss": 0.6405904293060303, + "error": 0.39453125, + "gradient_norm": 0.05899551138281822, + "elapsed": 1182.730489730835 + }, + { + "step": 3712, + "loss": 0.2767012119293213, + "error": 0.119140625, + "gradient_norm": 0.06593579798936844, + "elapsed": 1187.377315044403 + }, + { + "step": 3728, + "loss": 0.315812885761261, + "error": 0.134765625, + "gradient_norm": 0.035905495285987854, + "elapsed": 1192.0582301616669 + }, + { + "step": 3744, + "loss": 0.6033951640129089, + "error": 0.3544921875, + "gradient_norm": 0.05226197466254234, + "elapsed": 1196.7101175785065 + }, + { + "step": 3760, + "loss": 0.5202592611312866, + "error": 0.275390625, + "gradient_norm": 0.06367512047290802, + "elapsed": 1201.3543090820312 + }, + { + "step": 3776, + "loss": 0.24639368057250977, + "error": 0.1083984375, + "gradient_norm": 0.09370873868465424, + "elapsed": 1206.0717165470123 + }, + { + "step": 3792, + "loss": 0.6175658702850342, + "error": 0.375, + "gradient_norm": 0.06221585348248482, + "elapsed": 1210.754029750824 + }, + { + "step": 3808, + "loss": 0.41153696179389954, + "error": 0.2119140625, + "gradient_norm": 0.05355365574359894, + "elapsed": 1215.4374370574951 + }, + { + "step": 3824, + "loss": 0.28002214431762695, + "error": 0.1123046875, + "gradient_norm": 0.03846330568194389, + "elapsed": 1220.1207013130188 + }, + { + "step": 3840, + "loss": 0.0484195351600647, + "error": 0.013671875, + "gradient_norm": 0.03470242768526077, + "elapsed": 1224.8153104782104 + }, + { + "step": 3856, + "loss": 0.1407160609960556, + "error": 0.0458984375, + "gradient_norm": 0.04061700031161308, + "elapsed": 1229.5512235164642 + }, + { + "step": 3872, + "loss": 0.5881794691085815, + "error": 0.3427734375, + "gradient_norm": 0.062013477087020874, + "elapsed": 1234.3750183582306 + }, + { + "step": 3888, + "loss": 0.17833612859249115, + "error": 0.06640625, + "gradient_norm": 0.038856204599142075, + "elapsed": 1239.110375881195 + }, + { + "step": 3904, + "loss": 0.06211477518081665, + "error": 0.0224609375, + "gradient_norm": 0.02150108851492405, + "elapsed": 1243.800644159317 + }, + { + "step": 3920, + "loss": 0.06039723381400108, + "error": 0.01953125, + "gradient_norm": 0.019367367029190063, + "elapsed": 1248.4831748008728 + }, + { + "step": 3936, + "loss": 0.6010214686393738, + "error": 0.3525390625, + "gradient_norm": 0.051659151911735535, + "elapsed": 1253.1423478126526 + }, + { + "step": 3952, + "loss": 0.5867137312889099, + "error": 0.3388671875, + "gradient_norm": 0.058528851717710495, + "elapsed": 1257.9799931049347 + }, + { + "step": 3968, + "loss": 0.5231834650039673, + "error": 0.2578125, + "gradient_norm": 0.10128334909677505, + "elapsed": 1262.6990082263947 + }, + { + "step": 3984, + "loss": 0.6251651644706726, + "error": 0.353515625, + "gradient_norm": 0.06211795285344124, + "elapsed": 1267.4289934635162 + }, + { + "step": 4000, + "loss": 0.06667037308216095, + "error": 0.01953125, + "gradient_norm": 0.048018258064985275, + "elapsed": 1272.132089138031 + }, + { + "step": 4016, + "loss": 0.5286938548088074, + "error": 0.2744140625, + "gradient_norm": 0.05509360507130623, + "elapsed": 1276.8878977298737 + }, + { + "step": 4032, + "loss": 0.34016552567481995, + "error": 0.1591796875, + "gradient_norm": 0.07597329467535019, + "elapsed": 1281.7364926338196 + }, + { + "step": 4048, + "loss": 0.17750494182109833, + "error": 0.078125, + "gradient_norm": 0.06314503401517868, + "elapsed": 1286.5033600330353 + }, + { + "step": 4064, + "loss": 0.5882893800735474, + "error": 0.34375, + "gradient_norm": 0.10986580699682236, + "elapsed": 1291.1944887638092 + }, + { + "step": 4080, + "loss": 0.4923543930053711, + "error": 0.2568359375, + "gradient_norm": 0.050325747579336166, + "elapsed": 1295.9372322559357 + }, + { + "step": 4096, + "loss": 0.44146978855133057, + "error": 0.2236328125, + "gradient_norm": 0.06535191088914871, + "elapsed": 1300.641023159027 + } + ] + }, + "derived_checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_optimizer_steps": [ + 2048, + 3072, + 4096 + ], + "source_training_run": "temporal2", + "source_weights_sha256": { + "2048": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "3072": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "4096": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea" + }, + "source_checkpoint_records": { + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "3072": { + "step": 3072, + "new_training_shots": 3145728, + "unique_training_rows_seen_in_this_phase": 1594502, + "weights": "weights-3072.npz", + "weights_sha256": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "validation": "validation-3072.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "weights_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "complete": true + }, + "mean4": { + "checkpoint_label": "mean4", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_optimizer_steps": [ + 1024, + 2048, + 3072, + 4096 + ], + "source_training_run": "temporal2", + "source_weights_sha256": { + "1024": "0d809362d5afe1dc781f716e3aee1a9bc5a8f75fed6cc0ff6339b9abcf600ada", + "2048": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "3072": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "4096": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "unique_training_rows_seen_in_this_phase": 804757, + "weights": "weights-1024.npz", + "weights_sha256": "0d809362d5afe1dc781f716e3aee1a9bc5a8f75fed6cc0ff6339b9abcf600ada", + "validation": "validation-1024.json", + "complete": true + }, + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "3072": { + "step": 3072, + "new_training_shots": 3145728, + "unique_training_rows_seen_in_this_phase": 1594502, + "weights": "weights-3072.npz", + "weights_sha256": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "validation": "validation-3072.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "weights_sha256": "ff4595e8f3eb7cfaa8da5a58a31e106d9684c7b8437f330573a1291f19f5777a", + "complete": true + } + }, + "selection": "Predefined last-three and all-four noninitial temporal2 checkpoint means; every validation condition evaluated before group selection", + "test_data_used": false, + "derivation_source_sha256": "b68813c7dab697a554185020c430ef05f1c35bedcda5b85b7d165af75461e914" + }, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.5063965320587158, + "error": 0.263671875, + "gradient_norm": 0.05583755671977997, + "elapsed": 33.61826181411743 + }, + { + "step": 16, + "loss": 0.5231766700744629, + "error": 0.2822265625, + "gradient_norm": 0.05158894136548042, + "elapsed": 48.65802335739136 + }, + { + "step": 32, + "loss": 0.2955678701400757, + "error": 0.1376953125, + "gradient_norm": 0.0717208981513977, + "elapsed": 64.75103712081909 + }, + { + "step": 48, + "loss": 0.5808531045913696, + "error": 0.337890625, + "gradient_norm": 0.0497879758477211, + "elapsed": 81.12590050697327 + }, + { + "step": 64, + "loss": 0.6466071605682373, + "error": 0.3955078125, + "gradient_norm": 0.05340445786714554, + "elapsed": 97.40131282806396 + }, + { + "step": 80, + "loss": 0.43967077136039734, + "error": 0.2197265625, + "gradient_norm": 0.05488451197743416, + "elapsed": 113.68819904327393 + }, + { + "step": 96, + "loss": 0.3481931686401367, + "error": 0.166015625, + "gradient_norm": 0.08198399841785431, + "elapsed": 129.79422783851624 + }, + { + "step": 112, + "loss": 0.37728914618492126, + "error": 0.177734375, + "gradient_norm": 0.04957005754113197, + "elapsed": 146.01310849189758 + }, + { + "step": 128, + "loss": 0.19336706399917603, + "error": 0.07421875, + "gradient_norm": 0.03228567913174629, + "elapsed": 162.3233504295349 + }, + { + "step": 144, + "loss": 0.05673666670918465, + "error": 0.013671875, + "gradient_norm": 0.010086167603731155, + "elapsed": 178.27910375595093 + }, + { + "step": 160, + "loss": 0.05576886981725693, + "error": 0.0185546875, + "gradient_norm": 0.015833213925361633, + "elapsed": 194.4404194355011 + }, + { + "step": 176, + "loss": 0.6271512508392334, + "error": 0.39453125, + "gradient_norm": 0.0890795886516571, + "elapsed": 210.55058026313782 + }, + { + "step": 192, + "loss": 0.5520341992378235, + "error": 0.2998046875, + "gradient_norm": 0.12568876147270203, + "elapsed": 226.60093927383423 + }, + { + "step": 208, + "loss": 0.5262938737869263, + "error": 0.2822265625, + "gradient_norm": 0.055265434086322784, + "elapsed": 244.85273218154907 + }, + { + "step": 224, + "loss": 0.5956001281738281, + "error": 0.3369140625, + "gradient_norm": 0.06895016878843307, + "elapsed": 264.53393387794495 + }, + { + "step": 240, + "loss": 0.25704875588417053, + "error": 0.1259765625, + "gradient_norm": 0.11300098150968552, + "elapsed": 283.89024353027344 + }, + { + "step": 256, + "loss": 0.6143664121627808, + "error": 0.369140625, + "gradient_norm": 0.05419369786977768, + "elapsed": 300.05279064178467 + }, + { + "step": 272, + "loss": 0.5590812563896179, + "error": 0.294921875, + "gradient_norm": 0.06284675002098083, + "elapsed": 315.92391777038574 + }, + { + "step": 288, + "loss": 0.6163386106491089, + "error": 0.353515625, + "gradient_norm": 0.06826888024806976, + "elapsed": 331.96330738067627 + }, + { + "step": 304, + "loss": 0.6250298619270325, + "error": 0.37890625, + "gradient_norm": 0.0710018053650856, + "elapsed": 348.11866188049316 + }, + { + "step": 320, + "loss": 0.3802686631679535, + "error": 0.1796875, + "gradient_norm": 0.05896822363138199, + "elapsed": 364.3013961315155 + }, + { + "step": 336, + "loss": 0.2594846487045288, + "error": 0.1123046875, + "gradient_norm": 0.0468285046517849, + "elapsed": 380.80411195755005 + }, + { + "step": 352, + "loss": 0.19520026445388794, + "error": 0.076171875, + "gradient_norm": 0.032125141471624374, + "elapsed": 396.8971872329712 + }, + { + "step": 368, + "loss": 0.621718168258667, + "error": 0.37890625, + "gradient_norm": 0.0545712448656559, + "elapsed": 412.920996427536 + }, + { + "step": 384, + "loss": 0.6092393398284912, + "error": 0.349609375, + "gradient_norm": 0.04697328060865402, + "elapsed": 428.92249155044556 + }, + { + "step": 400, + "loss": 0.33656495809555054, + "error": 0.171875, + "gradient_norm": 0.04851065203547478, + "elapsed": 444.8614237308502 + }, + { + "step": 416, + "loss": 0.563441812992096, + "error": 0.302734375, + "gradient_norm": 0.06761237233877182, + "elapsed": 460.89916157722473 + }, + { + "step": 432, + "loss": 0.41032207012176514, + "error": 0.205078125, + "gradient_norm": 0.07552587240934372, + "elapsed": 476.91754388809204 + }, + { + "step": 448, + "loss": 0.6176105737686157, + "error": 0.3583984375, + "gradient_norm": 0.03991354629397392, + "elapsed": 492.909494638443 + }, + { + "step": 464, + "loss": 0.47970300912857056, + "error": 0.26171875, + "gradient_norm": 0.08514834195375443, + "elapsed": 508.9842050075531 + }, + { + "step": 480, + "loss": 0.6145294904708862, + "error": 0.3779296875, + "gradient_norm": 0.04053078964352608, + "elapsed": 525.0681574344635 + }, + { + "step": 496, + "loss": 0.5232605934143066, + "error": 0.28125, + "gradient_norm": 0.07535209506750107, + "elapsed": 541.048586845398 + }, + { + "step": 512, + "loss": 0.06574343144893646, + "error": 0.01953125, + "gradient_norm": 0.038100212812423706, + "elapsed": 557.0923149585724 + }, + { + "step": 528, + "loss": 0.052529145032167435, + "error": 0.021484375, + "gradient_norm": 0.017167840152978897, + "elapsed": 588.7646441459656 + }, + { + "step": 544, + "loss": 0.5886420011520386, + "error": 0.3447265625, + "gradient_norm": 0.04695608466863632, + "elapsed": 607.2257866859436 + }, + { + "step": 560, + "loss": 0.6055985689163208, + "error": 0.3466796875, + "gradient_norm": 0.032950498163700104, + "elapsed": 625.9134004116058 + }, + { + "step": 576, + "loss": 0.4632350206375122, + "error": 0.2431640625, + "gradient_norm": 0.07214360684156418, + "elapsed": 642.5683023929596 + }, + { + "step": 592, + "loss": 0.5995157361030579, + "error": 0.33984375, + "gradient_norm": 0.05927892401814461, + "elapsed": 659.0285487174988 + }, + { + "step": 608, + "loss": 0.2751845121383667, + "error": 0.1171875, + "gradient_norm": 0.06076137721538544, + "elapsed": 675.2659955024719 + }, + { + "step": 624, + "loss": 0.0518009215593338, + "error": 0.0205078125, + "gradient_norm": 0.017002176493406296, + "elapsed": 691.3256914615631 + }, + { + "step": 640, + "loss": 0.6293823719024658, + "error": 0.4013671875, + "gradient_norm": 0.07381543517112732, + "elapsed": 707.3796145915985 + }, + { + "step": 656, + "loss": 0.2956032454967499, + "error": 0.126953125, + "gradient_norm": 0.06658996641635895, + "elapsed": 723.4796185493469 + }, + { + "step": 672, + "loss": 0.5275129079818726, + "error": 0.28125, + "gradient_norm": 0.0742238238453865, + "elapsed": 739.52592253685 + }, + { + "step": 688, + "loss": 0.48426946997642517, + "error": 0.251953125, + "gradient_norm": 0.08587855845689774, + "elapsed": 755.599978685379 + }, + { + "step": 704, + "loss": 0.5284034013748169, + "error": 0.298828125, + "gradient_norm": 0.07507473230361938, + "elapsed": 771.6798233985901 + }, + { + "step": 720, + "loss": 0.45124661922454834, + "error": 0.2333984375, + "gradient_norm": 0.040898919105529785, + "elapsed": 787.8532867431641 + }, + { + "step": 736, + "loss": 0.04965062811970711, + "error": 0.0146484375, + "gradient_norm": 0.013609266839921474, + "elapsed": 804.1182470321655 + }, + { + "step": 752, + "loss": 0.04790960252285004, + "error": 0.01171875, + "gradient_norm": 0.01157061941921711, + "elapsed": 820.3099284172058 + }, + { + "step": 768, + "loss": 0.046329010277986526, + "error": 0.0146484375, + "gradient_norm": 0.013687756843864918, + "elapsed": 836.2443821430206 + }, + { + "step": 784, + "loss": 0.20798391103744507, + "error": 0.0830078125, + "gradient_norm": 0.10879658162593842, + "elapsed": 853.994068145752 + }, + { + "step": 800, + "loss": 0.3236527144908905, + "error": 0.1494140625, + "gradient_norm": 0.04277466610074043, + "elapsed": 872.6724886894226 + }, + { + "step": 816, + "loss": 0.5978351831436157, + "error": 0.3310546875, + "gradient_norm": 0.09687308222055435, + "elapsed": 890.0722959041595 + }, + { + "step": 832, + "loss": 0.5914890766143799, + "error": 0.3515625, + "gradient_norm": 0.05389918386936188, + "elapsed": 907.574702501297 + }, + { + "step": 848, + "loss": 0.3500230312347412, + "error": 0.154296875, + "gradient_norm": 0.05182121321558952, + "elapsed": 925.516667842865 + }, + { + "step": 864, + "loss": 0.3173527717590332, + "error": 0.126953125, + "gradient_norm": 0.10333289951086044, + "elapsed": 943.2102818489075 + }, + { + "step": 880, + "loss": 0.6407152414321899, + "error": 0.41015625, + "gradient_norm": 0.03933756425976753, + "elapsed": 960.0137810707092 + }, + { + "step": 896, + "loss": 0.3448338210582733, + "error": 0.1591796875, + "gradient_norm": 0.048397257924079895, + "elapsed": 976.2672023773193 + }, + { + "step": 912, + "loss": 0.2199687361717224, + "error": 0.0830078125, + "gradient_norm": 0.11513829976320267, + "elapsed": 992.4728758335114 + }, + { + "step": 928, + "loss": 0.16880497336387634, + "error": 0.072265625, + "gradient_norm": 0.031767718493938446, + "elapsed": 1008.5988037586212 + }, + { + "step": 944, + "loss": 0.053500816226005554, + "error": 0.017578125, + "gradient_norm": 0.014627245254814625, + "elapsed": 1024.7008044719696 + }, + { + "step": 960, + "loss": 0.5974152684211731, + "error": 0.341796875, + "gradient_norm": 0.09594274312257767, + "elapsed": 1040.908540725708 + }, + { + "step": 976, + "loss": 0.34772756695747375, + "error": 0.1572265625, + "gradient_norm": 0.04134370759129524, + "elapsed": 1056.9926254749298 + }, + { + "step": 992, + "loss": 0.4953954815864563, + "error": 0.2744140625, + "gradient_norm": 0.09671331197023392, + "elapsed": 1073.0582761764526 + }, + { + "step": 1008, + "loss": 0.6424463987350464, + "error": 0.4013671875, + "gradient_norm": 0.13621115684509277, + "elapsed": 1089.2002465724945 + }, + { + "step": 1024, + "loss": 0.1914748251438141, + "error": 0.0771484375, + "gradient_norm": 0.05097605288028717, + "elapsed": 1105.341599225998 + } + ], + "condition_mixing_plan": { + "hypothesis": "Mixing uniformly sampled geometry/basis/duration conditions in each gradient update reduces condition-gradient fluctuations", + "parent": "temporal2_swa/weights-mean3.npz", + "new_random_parameter_initializations": 0, + "sampling_seed": 20261190, + "arms": [ + "same", + "mixed" + ], + "microbatches_per_update": 4, + "microbatch_size": 256, + "effective_batch_size": 1024, + "optimizer_updates": 1024, + "learning_rate": 0.00025, + "optimizer": "Fresh AdamW state, weight decay1e-4, global gradient norm clip1 after averaging gradients", + "sampling_control": "Both arms draw four condition indices then four256-row batches per update. Same arm reuses the first condition index; mixed uses all four. Equal-sized condition pools make RNG states identical.", + "training": "All104 d3 conditions and all supplied training rows eligible;1,048,576 training draws in each arm", + "selection": "Full validation checkpoints512/1024, per-group mean across all13 durations; raw or equal blend with recorded small contextual reference; incumbent retained on ties", + "test_data_used": false + }, + "accumulation_numerical_control": { + "status": "passed", + "device": "cpu", + "condition": "surface_code_bZ_d3_r13_center_5_7", + "parent_checkpoint_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "trainer_source_sha256": "9f672468a8b72966b3aa04fd22e5d40b47b0768f1c802c267a1da08244c4323b", + "gradient_relative_l2_difference": 1.0312139158546257e-06, + "maximum_gradient_difference": 4.023313522338867e-07, + "mean_loss_difference": 0.0, + "maximum_optimizer_update_difference": 1.0697840480133891e-06, + "matched_rng_state_after_1024_updates": true, + "precision_audit": { + "float64_full_vs_accumulated_gradient_relative_l2": 2.4022986924332267e-15, + "float64_full_vs_accumulated_update_maximum_difference": 1.6631390275384517e-15, + "float32_full_gradient_relative_l2_vs_float64": 1.1454018534911662e-06, + "float32_accumulated_gradient_relative_l2_vs_float64": 9.16593382832008e-07, + "float32_full_update_maximum_difference_vs_float64": 6.5271394129382524e-06, + "float32_accumulated_update_maximum_difference_vs_float64": 7.5969234609516415e-06, + "initial_failed_check": { + "maximum_float32_update_difference": 1.0697840480133891e-06, + "original_tolerance": 1e-06 + }, + "interpretation": "Float64 audit checks accumulation algebra independently of float32 reduction rounding and first-Adam-step sensitivity near zero gradients. Original failure is retained; production model/gradient precision and optimizer are unchanged." + }, + "training_draws_each_arm": 1048576, + "draws_by_condition": { + "same": [ + 17408, + 14336, + 12288, + 14336, + 7168, + 10240, + 8192, + 7168, + 9216, + 11264, + 14336, + 7168, + 5120, + 9216, + 7168, + 8192, + 8192, + 10240, + 7168, + 10240, + 11264, + 14336, + 15360, + 10240, + 8192, + 11264, + 11264, + 17408, + 11264, + 15360, + 10240, + 17408, + 7168, + 13312, + 5120, + 13312, + 4096, + 8192, + 10240, + 8192, + 8192, + 5120, + 10240, + 11264, + 16384, + 13312, + 9216, + 9216, + 14336, + 8192, + 10240, + 10240, + 3072, + 8192, + 11264, + 12288, + 5120, + 4096, + 7168, + 9216, + 5120, + 14336, + 8192, + 9216, + 15360, + 6144, + 16384, + 5120, + 10240, + 10240, + 11264, + 11264, + 7168, + 6144, + 8192, + 11264, + 8192, + 14336, + 8192, + 10240, + 13312, + 15360, + 18432, + 4096, + 8192, + 8192, + 15360, + 10240, + 7168, + 12288, + 7168, + 12288, + 12288, + 8192, + 16384, + 9216, + 11264, + 6144, + 8192, + 7168, + 7168, + 12288, + 5120, + 8192 + ], + "mixed": [ + 14336, + 9472, + 8448, + 12032, + 8960, + 11776, + 9984, + 8448, + 9216, + 11264, + 12288, + 11008, + 7936, + 11008, + 9984, + 8448, + 11776, + 9984, + 9984, + 10752, + 8448, + 9984, + 9728, + 10240, + 8704, + 8448, + 8192, + 10496, + 8704, + 11008, + 9984, + 13824, + 8960, + 11264, + 9984, + 11008, + 13824, + 11264, + 9984, + 9216, + 9472, + 11008, + 9472, + 11776, + 12800, + 10240, + 8192, + 8192, + 9728, + 11008, + 8960, + 11264, + 8704, + 10496, + 10240, + 11776, + 7936, + 9216, + 9472, + 10752, + 8448, + 12288, + 9216, + 9728, + 11008, + 9472, + 11008, + 10240, + 8704, + 8448, + 9216, + 9728, + 9728, + 8960, + 10496, + 11520, + 9216, + 8704, + 6400, + 12032, + 11008, + 12288, + 12288, + 7936, + 10752, + 7936, + 12032, + 9216, + 8448, + 9472, + 9472, + 10752, + 10752, + 10752, + 12800, + 10496, + 10496, + 12032, + 8448, + 8960, + 7680, + 9472, + 11008, + 8448 + ] + }, + "scope": "Numerical and sampling controls only. All gradient/update probes are discarded; no trained candidate checkpoint or validation score is produced.", + "test_data_used": false + } + }, + "training_source_snapshot": "training_sources/condition_same1", + "selected_checkpoint_steps": [ + "1024", + "512" + ], + "checkpoint_records": { + "512": { + "step": 512, + "new_training_shots": 524288, + "unique_training_rows_seen_in_this_phase": 451734, + "weights": "weights-512.npz", + "weights_sha256": "4cf3ebae65f19ed882d90aac2157db4127d715f9c688c987280c9aac28efad84", + "validation": "validation-512.json", + "complete": true + }, + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "unique_training_rows_seen_in_this_phase": 803777, + "weights": "weights-1024.npz", + "weights_sha256": "c515815d285cc2eafe52d8ced2df1c754ac578ba54786b98770e15238dc4eaad", + "validation": "validation-1024.json", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints; when listed, blend candidates average the recorded small-contextual reference and new probabilities equally", + "blend_reference": "/run-state/workspace/research/context_upgrades/continuation2/predictions", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.24451622596153846, + "512": 0.24528245192307693, + "1024": 0.24529747596153847, + "blend-512": 0.24562800480769229, + "blend-1024": 0.24574819711538462 + }, + "selected": "incumbent" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2527794471153846, + "512": 0.25326021634615387, + "1024": 0.252734375, + "blend-512": 0.2533954326923077, + "blend-1024": 0.25307992788461536 + }, + "selected": "1024" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.23366887019230773, + "512": 0.23359375, + "1024": 0.2334435096153846, + "blend-512": 0.23426983173076926, + "blend-1024": 0.23384915865384612 + }, + "selected": "1024" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.23889723557692305, + "512": 0.23933293269230774, + "1024": 0.23951322115384613, + "blend-512": 0.23915264423076918, + "blend-1024": 0.239453125 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.2446213942307692, + "512": 0.2444561298076923, + "1024": 0.24489182692307693, + "blend-512": 0.24508713942307692, + "blend-1024": 0.24568810096153845 + }, + "selected": "512" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.23652343749999996, + "512": 0.23765024038461538, + "1024": 0.2379206730769231, + "blend-512": 0.23787560096153845, + "blend-1024": 0.23759014423076924 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.2356670673076923, + "512": 0.23619290865384618, + "1024": 0.23629807692307692, + "blend-512": 0.23610276442307693, + "blend-1024": 0.23593750000000002 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.23294771634615385, + "512": 0.23398437499999997, + "1024": 0.23342848557692308, + "blend-512": 0.2337590144230769, + "blend-1024": 0.2334435096153846 + }, + "selected": "incumbent" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23228665865384618 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.21953124999999998 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "group_specialize1", + "training_run": { + "experiment": "group-specific d3 continuation", + "groups": { + "d3_bX_center_3_5": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bX_center_3_5", + "parent_model": { + "weights": "weights/contextual-temporal2_swa-mean3.npz", + "training_checkpoint": "temporal2_swa/mean3" + }, + "parent_weights_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162496, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 11586, + "surface_code_bX_d3_r03_center_3_5": 13164, + "surface_code_bX_d3_r05_center_3_5": 14692, + "surface_code_bX_d3_r07_center_3_5": 12423, + "surface_code_bX_d3_r09_center_3_5": 13507, + "surface_code_bX_d3_r11_center_3_5": 9165, + "surface_code_bX_d3_r13_center_3_5": 14569, + "surface_code_bX_d3_r15_center_3_5": 11563, + "surface_code_bX_d3_r17_center_3_5": 14132, + "surface_code_bX_d3_r19_center_3_5": 9704, + "surface_code_bX_d3_r21_center_3_5": 12014, + "surface_code_bX_d3_r23_center_3_5": 13117, + "surface_code_bX_d3_r25_center_3_5": 12860 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261200, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bX_center_3_5", + "step": 1, + "loss": 0.5817165970802307, + "error": 0.3388671875, + "gradient_norm": 0.07810031622648239, + "elapsed": 23.888731479644775 + }, + { + "group": "d3_bX_center_3_5", + "step": 16, + "loss": 0.43716299533843994, + "error": 0.2177734375, + "gradient_norm": 0.05689458176493645, + "elapsed": 28.204753398895264 + }, + { + "group": "d3_bX_center_3_5", + "step": 32, + "loss": 0.44627559185028076, + "error": 0.208984375, + "gradient_norm": 0.056756604462862015, + "elapsed": 32.84233617782593 + }, + { + "group": "d3_bX_center_3_5", + "step": 48, + "loss": 0.4319554567337036, + "error": 0.234375, + "gradient_norm": 0.05750993266701698, + "elapsed": 37.434494495391846 + }, + { + "group": "d3_bX_center_3_5", + "step": 64, + "loss": 0.2955609858036041, + "error": 0.1279296875, + "gradient_norm": 0.07982950657606125, + "elapsed": 42.03733849525452 + }, + { + "group": "d3_bX_center_3_5", + "step": 80, + "loss": 0.051099054515361786, + "error": 0.01953125, + "gradient_norm": 0.01472504436969757, + "elapsed": 46.64323449134827 + }, + { + "group": "d3_bX_center_3_5", + "step": 96, + "loss": 0.3553770184516907, + "error": 0.1767578125, + "gradient_norm": 0.04556305333971977, + "elapsed": 51.289584159851074 + }, + { + "group": "d3_bX_center_3_5", + "step": 112, + "loss": 0.49853652715682983, + "error": 0.255859375, + "gradient_norm": 0.05837372690439224, + "elapsed": 55.921807527542114 + }, + { + "group": "d3_bX_center_3_5", + "step": 128, + "loss": 0.6128357648849487, + "error": 0.3759765625, + "gradient_norm": 0.04268687590956688, + "elapsed": 60.54293370246887 + }, + { + "group": "d3_bX_center_3_5", + "step": 144, + "loss": 0.40158310532569885, + "error": 0.2109375, + "gradient_norm": 0.06899380683898926, + "elapsed": 66.70903372764587 + }, + { + "group": "d3_bX_center_3_5", + "step": 160, + "loss": 0.6189148426055908, + "error": 0.369140625, + "gradient_norm": 0.049649614840745926, + "elapsed": 71.31301522254944 + }, + { + "group": "d3_bX_center_3_5", + "step": 176, + "loss": 0.5736979246139526, + "error": 0.3271484375, + "gradient_norm": 0.06365907937288284, + "elapsed": 75.90330648422241 + }, + { + "group": "d3_bX_center_3_5", + "step": 192, + "loss": 0.5324695706367493, + "error": 0.294921875, + "gradient_norm": 0.05174271762371063, + "elapsed": 80.51115894317627 + }, + { + "group": "d3_bX_center_3_5", + "step": 208, + "loss": 0.6137855052947998, + "error": 0.3623046875, + "gradient_norm": 0.04891493543982506, + "elapsed": 85.1122133731842 + }, + { + "group": "d3_bX_center_3_5", + "step": 224, + "loss": 0.6262054443359375, + "error": 0.400390625, + "gradient_norm": 0.0478600338101387, + "elapsed": 89.77170705795288 + }, + { + "group": "d3_bX_center_3_5", + "step": 240, + "loss": 0.5114355087280273, + "error": 0.2802734375, + "gradient_norm": 0.06124471500515938, + "elapsed": 94.34836196899414 + }, + { + "group": "d3_bX_center_3_5", + "step": 256, + "loss": 0.3812999129295349, + "error": 0.181640625, + "gradient_norm": 0.050427597016096115, + "elapsed": 98.88006901741028 + } + ] + }, + "d3_bX_center_5_3": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bX_center_5_3", + "parent_model": { + "weights": "weights/contextual-condition_same1-1024.npz", + "training_checkpoint": "condition_same1/1024" + }, + "parent_weights_sha256": "c515815d285cc2eafe52d8ced2df1c754ac578ba54786b98770e15238dc4eaad", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 161233, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_5_3": 11129, + "surface_code_bX_d3_r03_center_5_3": 15369, + "surface_code_bX_d3_r05_center_5_3": 14677, + "surface_code_bX_d3_r07_center_5_3": 9707, + "surface_code_bX_d3_r09_center_5_3": 11152, + "surface_code_bX_d3_r11_center_5_3": 12800, + "surface_code_bX_d3_r13_center_5_3": 13443, + "surface_code_bX_d3_r15_center_5_3": 12388, + "surface_code_bX_d3_r17_center_5_3": 15158, + "surface_code_bX_d3_r19_center_5_3": 10218, + "surface_code_bX_d3_r21_center_5_3": 10711, + "surface_code_bX_d3_r23_center_5_3": 13773, + "surface_code_bX_d3_r25_center_5_3": 10708 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261201, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bX_center_5_3", + "step": 1, + "loss": 0.4805193245410919, + "error": 0.2578125, + "gradient_norm": 0.05444623902440071, + "elapsed": 102.3664813041687 + }, + { + "group": "d3_bX_center_5_3", + "step": 16, + "loss": 0.2784017324447632, + "error": 0.11328125, + "gradient_norm": 0.08824625611305237, + "elapsed": 106.75308656692505 + }, + { + "group": "d3_bX_center_5_3", + "step": 32, + "loss": 0.6410393118858337, + "error": 0.412109375, + "gradient_norm": 0.03859763592481613, + "elapsed": 111.4091112613678 + }, + { + "group": "d3_bX_center_5_3", + "step": 48, + "loss": 0.42605704069137573, + "error": 0.2099609375, + "gradient_norm": 0.050592850893735886, + "elapsed": 116.04315447807312 + }, + { + "group": "d3_bX_center_5_3", + "step": 64, + "loss": 0.5663277506828308, + "error": 0.298828125, + "gradient_norm": 0.055698245763778687, + "elapsed": 120.68257761001587 + }, + { + "group": "d3_bX_center_5_3", + "step": 80, + "loss": 0.6572779417037964, + "error": 0.4267578125, + "gradient_norm": 0.07223570346832275, + "elapsed": 125.41016721725464 + }, + { + "group": "d3_bX_center_5_3", + "step": 96, + "loss": 0.5440086126327515, + "error": 0.2998046875, + "gradient_norm": 0.08954599499702454, + "elapsed": 130.22392392158508 + }, + { + "group": "d3_bX_center_5_3", + "step": 112, + "loss": 0.5094837546348572, + "error": 0.2548828125, + "gradient_norm": 0.06551362574100494, + "elapsed": 134.7945008277893 + }, + { + "group": "d3_bX_center_5_3", + "step": 128, + "loss": 0.5803394317626953, + "error": 0.3193359375, + "gradient_norm": 0.06082230061292648, + "elapsed": 139.35728001594543 + }, + { + "group": "d3_bX_center_5_3", + "step": 144, + "loss": 0.616602897644043, + "error": 0.375, + "gradient_norm": 0.050001099705696106, + "elapsed": 145.55171418190002 + }, + { + "group": "d3_bX_center_5_3", + "step": 160, + "loss": 0.5520708560943604, + "error": 0.2880859375, + "gradient_norm": 0.06085196137428284, + "elapsed": 150.15428566932678 + }, + { + "group": "d3_bX_center_5_3", + "step": 176, + "loss": 0.6117234230041504, + "error": 0.3740234375, + "gradient_norm": 0.0825766772031784, + "elapsed": 154.74532389640808 + }, + { + "group": "d3_bX_center_5_3", + "step": 192, + "loss": 0.5692043304443359, + "error": 0.3203125, + "gradient_norm": 0.07800327241420746, + "elapsed": 159.3635880947113 + }, + { + "group": "d3_bX_center_5_3", + "step": 208, + "loss": 0.30638742446899414, + "error": 0.130859375, + "gradient_norm": 0.049805574119091034, + "elapsed": 163.99608540534973 + }, + { + "group": "d3_bX_center_5_3", + "step": 224, + "loss": 0.5141903758049011, + "error": 0.28515625, + "gradient_norm": 0.06405262649059296, + "elapsed": 168.6415627002716 + }, + { + "group": "d3_bX_center_5_3", + "step": 240, + "loss": 0.5797978639602661, + "error": 0.34765625, + "gradient_norm": 0.10031016170978546, + "elapsed": 173.26013374328613 + }, + { + "group": "d3_bX_center_5_3", + "step": 256, + "loss": 0.2809719741344452, + "error": 0.12890625, + "gradient_norm": 0.04573458060622215, + "elapsed": 177.8879518508911 + } + ] + }, + "d3_bX_center_5_7": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bX_center_5_7", + "parent_model": { + "weights": "weights/contextual-condition_same1-1024.npz", + "training_checkpoint": "condition_same1/1024" + }, + "parent_weights_sha256": "c515815d285cc2eafe52d8ced2df1c754ac578ba54786b98770e15238dc4eaad", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162612, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_5_7": 13532, + "surface_code_bX_d3_r03_center_5_7": 12060, + "surface_code_bX_d3_r05_center_5_7": 14744, + "surface_code_bX_d3_r07_center_5_7": 11642, + "surface_code_bX_d3_r09_center_5_7": 13167, + "surface_code_bX_d3_r11_center_5_7": 8639, + "surface_code_bX_d3_r13_center_5_7": 14627, + "surface_code_bX_d3_r15_center_5_7": 11178, + "surface_code_bX_d3_r17_center_5_7": 10160, + "surface_code_bX_d3_r19_center_5_7": 13125, + "surface_code_bX_d3_r21_center_5_7": 13464, + "surface_code_bX_d3_r23_center_5_7": 13143, + "surface_code_bX_d3_r25_center_5_7": 13131 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261202, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bX_center_5_7", + "step": 1, + "loss": 0.18060244619846344, + "error": 0.0712890625, + "gradient_norm": 0.035179879516363144, + "elapsed": 181.32161450386047 + }, + { + "group": "d3_bX_center_5_7", + "step": 16, + "loss": 0.5082811117172241, + "error": 0.2705078125, + "gradient_norm": 0.07098715752363205, + "elapsed": 185.63990426063538 + }, + { + "group": "d3_bX_center_5_7", + "step": 32, + "loss": 0.5253040790557861, + "error": 0.2880859375, + "gradient_norm": 0.16328570246696472, + "elapsed": 190.24219703674316 + }, + { + "group": "d3_bX_center_5_7", + "step": 48, + "loss": 0.631301760673523, + "error": 0.3994140625, + "gradient_norm": 0.057355962693691254, + "elapsed": 194.84725713729858 + }, + { + "group": "d3_bX_center_5_7", + "step": 64, + "loss": 0.27920418977737427, + "error": 0.1240234375, + "gradient_norm": 0.06183589994907379, + "elapsed": 199.47137212753296 + }, + { + "group": "d3_bX_center_5_7", + "step": 80, + "loss": 0.611309289932251, + "error": 0.3544921875, + "gradient_norm": 0.07737621665000916, + "elapsed": 204.0849051475525 + }, + { + "group": "d3_bX_center_5_7", + "step": 96, + "loss": 0.2803115248680115, + "error": 0.1279296875, + "gradient_norm": 0.05086443945765495, + "elapsed": 208.7057957649231 + }, + { + "group": "d3_bX_center_5_7", + "step": 112, + "loss": 0.5856442451477051, + "error": 0.330078125, + "gradient_norm": 0.09568645805120468, + "elapsed": 213.3731656074524 + }, + { + "group": "d3_bX_center_5_7", + "step": 128, + "loss": 0.6120781898498535, + "error": 0.3486328125, + "gradient_norm": 0.07464266568422318, + "elapsed": 218.0141613483429 + }, + { + "group": "d3_bX_center_5_7", + "step": 144, + "loss": 0.4921022355556488, + "error": 0.24609375, + "gradient_norm": 0.04171774536371231, + "elapsed": 224.291086435318 + }, + { + "group": "d3_bX_center_5_7", + "step": 160, + "loss": 0.6169480085372925, + "error": 0.375, + "gradient_norm": 0.06097063049674034, + "elapsed": 229.43670320510864 + }, + { + "group": "d3_bX_center_5_7", + "step": 176, + "loss": 0.6014459729194641, + "error": 0.3720703125, + "gradient_norm": 0.049403320997953415, + "elapsed": 235.6041157245636 + }, + { + "group": "d3_bX_center_5_7", + "step": 192, + "loss": 0.5643549561500549, + "error": 0.3076171875, + "gradient_norm": 0.034399617463350296, + "elapsed": 242.02996158599854 + }, + { + "group": "d3_bX_center_5_7", + "step": 208, + "loss": 0.04667453467845917, + "error": 0.0146484375, + "gradient_norm": 0.021298106759786606, + "elapsed": 247.37174129486084 + }, + { + "group": "d3_bX_center_5_7", + "step": 224, + "loss": 0.5067787170410156, + "error": 0.2607421875, + "gradient_norm": 0.056687332689762115, + "elapsed": 251.9976110458374 + }, + { + "group": "d3_bX_center_5_7", + "step": 240, + "loss": 0.42991048097610474, + "error": 0.2255859375, + "gradient_norm": 0.061536215245723724, + "elapsed": 256.75613379478455 + }, + { + "group": "d3_bX_center_5_7", + "step": 256, + "loss": 0.47317343950271606, + "error": 0.2529296875, + "gradient_norm": 0.060076676309108734, + "elapsed": 261.4124813079834 + } + ] + }, + "d3_bX_center_7_5": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bX_center_7_5", + "parent_model": { + "weights": "weights/contextual-temporal2-2048.npz", + "training_checkpoint": "temporal2/2048", + "blend_contextual": true + }, + "parent_weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162880, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_7_5": 13450, + "surface_code_bX_d3_r03_center_7_5": 11109, + "surface_code_bX_d3_r05_center_7_5": 14012, + "surface_code_bX_d3_r07_center_7_5": 13898, + "surface_code_bX_d3_r09_center_7_5": 12398, + "surface_code_bX_d3_r11_center_7_5": 9664, + "surface_code_bX_d3_r13_center_7_5": 11550, + "surface_code_bX_d3_r15_center_7_5": 12809, + "surface_code_bX_d3_r17_center_7_5": 10673, + "surface_code_bX_d3_r19_center_7_5": 13751, + "surface_code_bX_d3_r21_center_7_5": 13442, + "surface_code_bX_d3_r23_center_7_5": 13774, + "surface_code_bX_d3_r25_center_7_5": 12350 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261203, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bX_center_7_5", + "step": 1, + "loss": 0.6286593675613403, + "error": 0.3916015625, + "gradient_norm": 0.048550695180892944, + "elapsed": 264.77757954597473 + }, + { + "group": "d3_bX_center_7_5", + "step": 16, + "loss": 0.5998052954673767, + "error": 0.3564453125, + "gradient_norm": 0.04667327180504799, + "elapsed": 269.1457931995392 + }, + { + "group": "d3_bX_center_7_5", + "step": 32, + "loss": 0.6372991800308228, + "error": 0.3984375, + "gradient_norm": 0.03931272402405739, + "elapsed": 273.81044721603394 + }, + { + "group": "d3_bX_center_7_5", + "step": 48, + "loss": 0.32325083017349243, + "error": 0.1455078125, + "gradient_norm": 0.053585249930620193, + "elapsed": 278.48719453811646 + }, + { + "group": "d3_bX_center_7_5", + "step": 64, + "loss": 0.6184052228927612, + "error": 0.3974609375, + "gradient_norm": 0.04405878111720085, + "elapsed": 283.16093349456787 + }, + { + "group": "d3_bX_center_7_5", + "step": 80, + "loss": 0.30300217866897583, + "error": 0.1318359375, + "gradient_norm": 0.03475452959537506, + "elapsed": 287.8628993034363 + }, + { + "group": "d3_bX_center_7_5", + "step": 96, + "loss": 0.4532725214958191, + "error": 0.23828125, + "gradient_norm": 0.053579334169626236, + "elapsed": 292.54087567329407 + }, + { + "group": "d3_bX_center_7_5", + "step": 112, + "loss": 0.5722991824150085, + "error": 0.333984375, + "gradient_norm": 0.05200285091996193, + "elapsed": 297.2698106765747 + }, + { + "group": "d3_bX_center_7_5", + "step": 128, + "loss": 0.47720301151275635, + "error": 0.248046875, + "gradient_norm": 0.08435481041669846, + "elapsed": 301.9647386074066 + }, + { + "group": "d3_bX_center_7_5", + "step": 144, + "loss": 0.49832063913345337, + "error": 0.2666015625, + "gradient_norm": 0.06509781628847122, + "elapsed": 308.208101272583 + }, + { + "group": "d3_bX_center_7_5", + "step": 160, + "loss": 0.05153600126504898, + "error": 0.015625, + "gradient_norm": 0.018944455310702324, + "elapsed": 312.88946986198425 + }, + { + "group": "d3_bX_center_7_5", + "step": 176, + "loss": 0.3049379885196686, + "error": 0.1376953125, + "gradient_norm": 0.03572608530521393, + "elapsed": 317.5962097644806 + }, + { + "group": "d3_bX_center_7_5", + "step": 192, + "loss": 0.4833422899246216, + "error": 0.2275390625, + "gradient_norm": 0.11588290333747864, + "elapsed": 322.2771329879761 + }, + { + "group": "d3_bX_center_7_5", + "step": 208, + "loss": 0.5812653303146362, + "error": 0.34765625, + "gradient_norm": 0.04924288019537926, + "elapsed": 326.9544439315796 + }, + { + "group": "d3_bX_center_7_5", + "step": 224, + "loss": 0.5518968105316162, + "error": 0.2919921875, + "gradient_norm": 0.049676258116960526, + "elapsed": 331.7683095932007 + }, + { + "group": "d3_bX_center_7_5", + "step": 240, + "loss": 0.599678099155426, + "error": 0.353515625, + "gradient_norm": 0.09019427001476288, + "elapsed": 337.0053963661194 + }, + { + "group": "d3_bX_center_7_5", + "step": 256, + "loss": 0.6168051362037659, + "error": 0.373046875, + "gradient_norm": 0.045873139053583145, + "elapsed": 342.27088832855225 + } + ] + }, + "d3_bZ_center_3_5": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bZ_center_3_5", + "parent_model": { + "weights": "weights/contextual-condition_same1-512.npz", + "training_checkpoint": "condition_same1/512" + }, + "parent_weights_sha256": "4cf3ebae65f19ed882d90aac2157db4127d715f9c688c987280c9aac28efad84", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162257, + "unique_rows_by_condition": { + "surface_code_bZ_d3_r01_center_3_5": 13149, + "surface_code_bZ_d3_r03_center_3_5": 12112, + "surface_code_bZ_d3_r05_center_3_5": 12434, + "surface_code_bZ_d3_r07_center_3_5": 13778, + "surface_code_bZ_d3_r09_center_3_5": 12830, + "surface_code_bZ_d3_r11_center_3_5": 6034, + "surface_code_bZ_d3_r13_center_3_5": 13524, + "surface_code_bZ_d3_r15_center_3_5": 13160, + "surface_code_bZ_d3_r17_center_3_5": 12823, + "surface_code_bZ_d3_r19_center_3_5": 11129, + "surface_code_bZ_d3_r21_center_3_5": 13793, + "surface_code_bZ_d3_r23_center_3_5": 14080, + "surface_code_bZ_d3_r25_center_3_5": 13411 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261204, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bZ_center_3_5", + "step": 1, + "loss": 0.36515435576438904, + "error": 0.17578125, + "gradient_norm": 0.068653903901577, + "elapsed": 346.68829584121704 + }, + { + "group": "d3_bZ_center_3_5", + "step": 16, + "loss": 0.2806941568851471, + "error": 0.1318359375, + "gradient_norm": 0.06498919427394867, + "elapsed": 352.6486053466797 + }, + { + "group": "d3_bZ_center_3_5", + "step": 32, + "loss": 0.5172728300094604, + "error": 0.2578125, + "gradient_norm": 0.06919123977422714, + "elapsed": 358.0916488170624 + }, + { + "group": "d3_bZ_center_3_5", + "step": 48, + "loss": 0.5654157400131226, + "error": 0.3134765625, + "gradient_norm": 0.062110695987939835, + "elapsed": 364.1197271347046 + }, + { + "group": "d3_bZ_center_3_5", + "step": 64, + "loss": 0.5950935482978821, + "error": 0.349609375, + "gradient_norm": 0.06901932507753372, + "elapsed": 370.44589829444885 + }, + { + "group": "d3_bZ_center_3_5", + "step": 80, + "loss": 0.3655591607093811, + "error": 0.1865234375, + "gradient_norm": 0.06035780534148216, + "elapsed": 376.3442976474762 + }, + { + "group": "d3_bZ_center_3_5", + "step": 96, + "loss": 0.5849340558052063, + "error": 0.345703125, + "gradient_norm": 0.0669141560792923, + "elapsed": 381.8527054786682 + }, + { + "group": "d3_bZ_center_3_5", + "step": 112, + "loss": 0.04215944558382034, + "error": 0.013671875, + "gradient_norm": 0.029389331117272377, + "elapsed": 386.54820346832275 + }, + { + "group": "d3_bZ_center_3_5", + "step": 128, + "loss": 0.619553804397583, + "error": 0.3876953125, + "gradient_norm": 0.053926873952150345, + "elapsed": 391.31534695625305 + }, + { + "group": "d3_bZ_center_3_5", + "step": 144, + "loss": 0.3793254494667053, + "error": 0.1923828125, + "gradient_norm": 0.07844529300928116, + "elapsed": 397.51641821861267 + }, + { + "group": "d3_bZ_center_3_5", + "step": 160, + "loss": 0.3429756164550781, + "error": 0.1572265625, + "gradient_norm": 0.06213530898094177, + "elapsed": 402.1174716949463 + }, + { + "group": "d3_bZ_center_3_5", + "step": 176, + "loss": 0.2883482277393341, + "error": 0.1416015625, + "gradient_norm": 0.07786665111780167, + "elapsed": 406.72908902168274 + }, + { + "group": "d3_bZ_center_3_5", + "step": 192, + "loss": 0.03280383348464966, + "error": 0.0087890625, + "gradient_norm": 0.035463444888591766, + "elapsed": 411.33272552490234 + }, + { + "group": "d3_bZ_center_3_5", + "step": 208, + "loss": 0.6251656413078308, + "error": 0.38671875, + "gradient_norm": 0.08498021215200424, + "elapsed": 415.93534207344055 + }, + { + "group": "d3_bZ_center_3_5", + "step": 224, + "loss": 0.43049943447113037, + "error": 0.232421875, + "gradient_norm": 0.08405832201242447, + "elapsed": 420.54495644569397 + }, + { + "group": "d3_bZ_center_3_5", + "step": 240, + "loss": 0.5978946089744568, + "error": 0.3349609375, + "gradient_norm": 0.06633604317903519, + "elapsed": 425.1712546348572 + }, + { + "group": "d3_bZ_center_3_5", + "step": 256, + "loss": 0.5690029859542847, + "error": 0.341796875, + "gradient_norm": 0.06171220913529396, + "elapsed": 430.0519812107086 + } + ] + }, + "d3_bZ_center_5_3": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bZ_center_5_3", + "parent_model": { + "weights": "weights/contextual-temporal2-2048.npz", + "training_checkpoint": "temporal2/2048" + }, + "parent_weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162569, + "unique_rows_by_condition": { + "surface_code_bZ_d3_r01_center_5_3": 11619, + "surface_code_bZ_d3_r03_center_5_3": 13126, + "surface_code_bZ_d3_r05_center_5_3": 12742, + "surface_code_bZ_d3_r07_center_5_3": 9136, + "surface_code_bZ_d3_r09_center_5_3": 15337, + "surface_code_bZ_d3_r11_center_5_3": 11996, + "surface_code_bZ_d3_r13_center_5_3": 12732, + "surface_code_bZ_d3_r15_center_5_3": 13128, + "surface_code_bZ_d3_r17_center_5_3": 14689, + "surface_code_bZ_d3_r19_center_5_3": 11983, + "surface_code_bZ_d3_r21_center_5_3": 11992, + "surface_code_bZ_d3_r23_center_5_3": 11625, + "surface_code_bZ_d3_r25_center_5_3": 12464 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261205, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bZ_center_5_3", + "step": 1, + "loss": 0.6346971988677979, + "error": 0.3818359375, + "gradient_norm": 0.046160198748111725, + "elapsed": 433.7457048892975 + }, + { + "group": "d3_bZ_center_5_3", + "step": 16, + "loss": 0.46678581833839417, + "error": 0.23828125, + "gradient_norm": 0.04110230877995491, + "elapsed": 438.16989040374756 + }, + { + "group": "d3_bZ_center_5_3", + "step": 32, + "loss": 0.17910712957382202, + "error": 0.064453125, + "gradient_norm": 0.030056120827794075, + "elapsed": 442.8582558631897 + }, + { + "group": "d3_bZ_center_5_3", + "step": 48, + "loss": 0.5041052103042603, + "error": 0.27734375, + "gradient_norm": 0.045486729592084885, + "elapsed": 447.66860795021057 + }, + { + "group": "d3_bZ_center_5_3", + "step": 64, + "loss": 0.5663014054298401, + "error": 0.310546875, + "gradient_norm": 0.04649529233574867, + "elapsed": 452.51550030708313 + }, + { + "group": "d3_bZ_center_5_3", + "step": 80, + "loss": 0.5388609766960144, + "error": 0.2841796875, + "gradient_norm": 0.05346957594156265, + "elapsed": 457.18010997772217 + }, + { + "group": "d3_bZ_center_5_3", + "step": 96, + "loss": 0.6176578998565674, + "error": 0.375, + "gradient_norm": 0.08028864115476608, + "elapsed": 461.89074301719666 + }, + { + "group": "d3_bZ_center_5_3", + "step": 112, + "loss": 0.6225342750549316, + "error": 0.36328125, + "gradient_norm": 0.030471889302134514, + "elapsed": 466.5776717662811 + }, + { + "group": "d3_bZ_center_5_3", + "step": 128, + "loss": 0.2725566625595093, + "error": 0.111328125, + "gradient_norm": 0.05236189067363739, + "elapsed": 471.32313442230225 + }, + { + "group": "d3_bZ_center_5_3", + "step": 144, + "loss": 0.6361372470855713, + "error": 0.3984375, + "gradient_norm": 0.07191100716590881, + "elapsed": 478.3580629825592 + }, + { + "group": "d3_bZ_center_5_3", + "step": 160, + "loss": 0.2549514174461365, + "error": 0.1025390625, + "gradient_norm": 0.0485384576022625, + "elapsed": 484.5399954319 + }, + { + "group": "d3_bZ_center_5_3", + "step": 176, + "loss": 0.06202135607600212, + "error": 0.0205078125, + "gradient_norm": 0.01821581833064556, + "elapsed": 490.2966978549957 + }, + { + "group": "d3_bZ_center_5_3", + "step": 192, + "loss": 0.5546645522117615, + "error": 0.296875, + "gradient_norm": 0.07931670546531677, + "elapsed": 496.1227023601532 + }, + { + "group": "d3_bZ_center_5_3", + "step": 208, + "loss": 0.2724062502384186, + "error": 0.1220703125, + "gradient_norm": 0.0482773631811142, + "elapsed": 501.8398952484131 + }, + { + "group": "d3_bZ_center_5_3", + "step": 224, + "loss": 0.6230898499488831, + "error": 0.3671875, + "gradient_norm": 0.05214303359389305, + "elapsed": 508.2803044319153 + }, + { + "group": "d3_bZ_center_5_3", + "step": 240, + "loss": 0.4187527894973755, + "error": 0.2080078125, + "gradient_norm": 0.046042900532484055, + "elapsed": 513.7485942840576 + }, + { + "group": "d3_bZ_center_5_3", + "step": 256, + "loss": 0.5760256052017212, + "error": 0.3271484375, + "gradient_norm": 0.03505929186940193, + "elapsed": 519.0282807350159 + } + ] + }, + "d3_bZ_center_5_7": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bZ_center_5_7", + "parent_model": { + "weights": "weights/contextual-temporal2-4096.npz", + "training_checkpoint": "temporal2/4096" + }, + "parent_weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 163281, + "unique_rows_by_condition": { + "surface_code_bZ_d3_r01_center_5_7": 11175, + "surface_code_bZ_d3_r03_center_5_7": 13171, + "surface_code_bZ_d3_r05_center_5_7": 12697, + "surface_code_bZ_d3_r07_center_5_7": 11648, + "surface_code_bZ_d3_r09_center_5_7": 14077, + "surface_code_bZ_d3_r11_center_5_7": 13454, + "surface_code_bZ_d3_r13_center_5_7": 11564, + "surface_code_bZ_d3_r15_center_5_7": 12728, + "surface_code_bZ_d3_r17_center_5_7": 12048, + "surface_code_bZ_d3_r19_center_5_7": 14459, + "surface_code_bZ_d3_r21_center_5_7": 14010, + "surface_code_bZ_d3_r23_center_5_7": 10239, + "surface_code_bZ_d3_r25_center_5_7": 12011 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261206, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bZ_center_5_7", + "step": 1, + "loss": 0.5979939103126526, + "error": 0.357421875, + "gradient_norm": 0.0660991370677948, + "elapsed": 523.6322765350342 + }, + { + "group": "d3_bZ_center_5_7", + "step": 16, + "loss": 0.6150602102279663, + "error": 0.3701171875, + "gradient_norm": 0.04266919568181038, + "elapsed": 528.4157238006592 + }, + { + "group": "d3_bZ_center_5_7", + "step": 32, + "loss": 0.44577696919441223, + "error": 0.2099609375, + "gradient_norm": 0.06689892709255219, + "elapsed": 533.0822012424469 + }, + { + "group": "d3_bZ_center_5_7", + "step": 48, + "loss": 0.4075019657611847, + "error": 0.1884765625, + "gradient_norm": 0.05801992863416672, + "elapsed": 537.763840675354 + }, + { + "group": "d3_bZ_center_5_7", + "step": 64, + "loss": 0.5356203317642212, + "error": 0.2939453125, + "gradient_norm": 0.0543823316693306, + "elapsed": 542.4880893230438 + }, + { + "group": "d3_bZ_center_5_7", + "step": 80, + "loss": 0.45208629965782166, + "error": 0.2275390625, + "gradient_norm": 0.05819695070385933, + "elapsed": 547.1561362743378 + }, + { + "group": "d3_bZ_center_5_7", + "step": 96, + "loss": 0.4151451587677002, + "error": 0.2119140625, + "gradient_norm": 0.07201892882585526, + "elapsed": 551.8683395385742 + }, + { + "group": "d3_bZ_center_5_7", + "step": 112, + "loss": 0.5576318502426147, + "error": 0.31640625, + "gradient_norm": 0.04457806423306465, + "elapsed": 556.642165184021 + }, + { + "group": "d3_bZ_center_5_7", + "step": 128, + "loss": 0.20078304409980774, + "error": 0.08984375, + "gradient_norm": 0.040219370275735855, + "elapsed": 561.4243121147156 + }, + { + "group": "d3_bZ_center_5_7", + "step": 144, + "loss": 0.45917582511901855, + "error": 0.2236328125, + "gradient_norm": 0.0707971602678299, + "elapsed": 567.7284438610077 + }, + { + "group": "d3_bZ_center_5_7", + "step": 160, + "loss": 0.5936293601989746, + "error": 0.345703125, + "gradient_norm": 0.12180078029632568, + "elapsed": 572.3563349246979 + }, + { + "group": "d3_bZ_center_5_7", + "step": 176, + "loss": 0.24654456973075867, + "error": 0.1044921875, + "gradient_norm": 0.04859209433197975, + "elapsed": 577.008533000946 + }, + { + "group": "d3_bZ_center_5_7", + "step": 192, + "loss": 0.4809238612651825, + "error": 0.2509765625, + "gradient_norm": 0.09741280972957611, + "elapsed": 581.7403192520142 + }, + { + "group": "d3_bZ_center_5_7", + "step": 208, + "loss": 0.36378931999206543, + "error": 0.166015625, + "gradient_norm": 0.04881134256720543, + "elapsed": 586.367921590805 + }, + { + "group": "d3_bZ_center_5_7", + "step": 224, + "loss": 0.5131937265396118, + "error": 0.279296875, + "gradient_norm": 0.08562120050191879, + "elapsed": 591.1944098472595 + }, + { + "group": "d3_bZ_center_5_7", + "step": 240, + "loss": 0.4193183183670044, + "error": 0.2099609375, + "gradient_norm": 0.0680096298456192, + "elapsed": 595.8478200435638 + }, + { + "group": "d3_bZ_center_5_7", + "step": 256, + "loss": 0.467867910861969, + "error": 0.24609375, + "gradient_norm": 0.07342159003019333, + "elapsed": 600.4172458648682 + } + ] + }, + "d3_bZ_center_7_5": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bZ_center_7_5", + "parent_model": { + "weights": "weights/contextual-temporal2-4096.npz", + "training_checkpoint": "temporal2/4096" + }, + "parent_weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 159856, + "unique_rows_by_condition": { + "surface_code_bZ_d3_r01_center_7_5": 10637, + "surface_code_bZ_d3_r03_center_7_5": 13460, + "surface_code_bZ_d3_r05_center_7_5": 12002, + "surface_code_bZ_d3_r07_center_7_5": 8000, + "surface_code_bZ_d3_r09_center_7_5": 10743, + "surface_code_bZ_d3_r11_center_7_5": 16789, + "surface_code_bZ_d3_r13_center_7_5": 12364, + "surface_code_bZ_d3_r15_center_7_5": 15213, + "surface_code_bZ_d3_r17_center_7_5": 14167, + "surface_code_bZ_d3_r19_center_7_5": 11099, + "surface_code_bZ_d3_r21_center_7_5": 13178, + "surface_code_bZ_d3_r23_center_7_5": 12014, + "surface_code_bZ_d3_r25_center_7_5": 10190 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261207, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bZ_center_7_5", + "step": 1, + "loss": 0.4038092792034149, + "error": 0.197265625, + "gradient_norm": 0.05896063148975372, + "elapsed": 603.840416431427 + }, + { + "group": "d3_bZ_center_7_5", + "step": 16, + "loss": 0.6033527851104736, + "error": 0.3515625, + "gradient_norm": 0.05784430727362633, + "elapsed": 608.1250426769257 + }, + { + "group": "d3_bZ_center_7_5", + "step": 32, + "loss": 0.5283372402191162, + "error": 0.283203125, + "gradient_norm": 0.050800539553165436, + "elapsed": 612.7134759426117 + }, + { + "group": "d3_bZ_center_7_5", + "step": 48, + "loss": 0.5995811820030212, + "error": 0.3291015625, + "gradient_norm": 0.05547967553138733, + "elapsed": 617.2784404754639 + }, + { + "group": "d3_bZ_center_7_5", + "step": 64, + "loss": 0.40154707431793213, + "error": 0.205078125, + "gradient_norm": 0.06852669268846512, + "elapsed": 621.8420352935791 + }, + { + "group": "d3_bZ_center_7_5", + "step": 80, + "loss": 0.4995174705982208, + "error": 0.2763671875, + "gradient_norm": 0.061341386288404465, + "elapsed": 626.40260887146 + }, + { + "group": "d3_bZ_center_7_5", + "step": 96, + "loss": 0.5751184225082397, + "error": 0.3251953125, + "gradient_norm": 0.07929262518882751, + "elapsed": 630.9725329875946 + }, + { + "group": "d3_bZ_center_7_5", + "step": 112, + "loss": 0.624832808971405, + "error": 0.369140625, + "gradient_norm": 0.045014865696430206, + "elapsed": 635.5494453907013 + }, + { + "group": "d3_bZ_center_7_5", + "step": 128, + "loss": 0.4616764783859253, + "error": 0.224609375, + "gradient_norm": 0.0743650421500206, + "elapsed": 640.093489408493 + }, + { + "group": "d3_bZ_center_7_5", + "step": 144, + "loss": 0.5214440822601318, + "error": 0.2724609375, + "gradient_norm": 0.05418862774968147, + "elapsed": 646.2130215167999 + }, + { + "group": "d3_bZ_center_7_5", + "step": 160, + "loss": 0.27278852462768555, + "error": 0.12109375, + "gradient_norm": 0.059856753796339035, + "elapsed": 650.7696936130524 + }, + { + "group": "d3_bZ_center_7_5", + "step": 176, + "loss": 0.5251824259757996, + "error": 0.2734375, + "gradient_norm": 0.0982872024178505, + "elapsed": 655.3179745674133 + }, + { + "group": "d3_bZ_center_7_5", + "step": 192, + "loss": 0.510776937007904, + "error": 0.2744140625, + "gradient_norm": 0.0638406053185463, + "elapsed": 659.8532302379608 + }, + { + "group": "d3_bZ_center_7_5", + "step": 208, + "loss": 0.4173796772956848, + "error": 0.20703125, + "gradient_norm": 0.0652337446808815, + "elapsed": 664.3970146179199 + }, + { + "group": "d3_bZ_center_7_5", + "step": 224, + "loss": 0.42136240005493164, + "error": 0.203125, + "gradient_norm": 0.04171523451805115, + "elapsed": 668.9384174346924 + }, + { + "group": "d3_bZ_center_7_5", + "step": 240, + "loss": 0.2494639754295349, + "error": 0.1201171875, + "gradient_norm": 0.06969694793224335, + "elapsed": 673.4954979419708 + }, + { + "group": "d3_bZ_center_7_5", + "step": 256, + "loss": 0.26821407675743103, + "error": 0.1181640625, + "gradient_norm": 0.04254033416509628, + "elapsed": 678.0544662475586 + } + ] + } + }, + "initialization": "Continue session-trained selected temporal components; no new random parameters", + "training": "Each group samples uniformly over its own13 durations; supplied training labels only", + "eligible_training_shots": 2067520, + "steps": 2048, + "steps_per_group": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer_restored": false, + "rng_restored": false, + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "run_config": { + "package": "/run-state/workspace/research/context_upgrades/short_categorical3/package", + "output": "/run-state/workspace/research/learned_exact/group_specialize1", + "steps": 256, + "eval_every": 128, + "batch": 1024, + "validation_shots": 1024, + "validation_batch": 1024, + "learning_rate": 0.0001, + "seed": 20261200, + "groups": [ + "d3_bX_center_3_5", + "d3_bX_center_5_3", + "d3_bX_center_5_7", + "d3_bX_center_7_5", + "d3_bZ_center_3_5", + "d3_bZ_center_5_3", + "d3_bZ_center_5_7", + "d3_bZ_center_7_5" + ], + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "parent_config_sha256": "50123b5d6a4515814bb74a93963e83d17c2d3eb47af4d12b7757f523ac7c2f6a", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "validation_manifest_sha256": "482bb7268c6c827ebbf1f756ee6994750acfcd011adab08eaa2ada703e5faea1" + }, + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "new_random_parameters": 0, + "training_draws": 2097152, + "test_data_used": false, + "declared_plan": { + "hypothesis": "Group-specific fine-tuning may reduce conflicting updates across d3 geometries and bases", + "parents": "The temporal component selected for each of the8 groups in CURRENT after fresh2_continuation_finished.json", + "new_random_parameters": 0, + "sampling_seeds": "20261200 plus lexicographic group rank0..7", + "training": "256 updates per group,B1024,LR.0001; uniform sampling of all13 durations and all258440 training rows per group", + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global gradient norm clip1", + "total_optimizer_updates": 2048, + "total_training_draws": 2097152, + "validation": "Screen at0/128/256. Full validation at0/128/256; step0 is a diagnostic, excluded from new checkpoint selection", + "selection": "Per-group mean failure over all13 durations: incumbent, raw128/256, or equal small-contextual blend128/256; retain incumbent on ties", + "short_model_followup": "Recheck the previously training-fitted categorical1 heads after group replacement", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "selection_eligible": false, + "submission_eligible": false, + "trainer_sha256": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "run": "/run-state/workspace/research/learned_exact/specialize_smoke2", + "checks": [ + { + "group": "d3_bX_center_3_5", + "parent_exact": true, + "fresh_zero_optimizer": true, + "one_update_changes_parameters": true, + "sampling_replay_exact": true, + "all13_durations_evaluated": true + }, + { + "group": "d3_bZ_center_7_5", + "parent_exact": true, + "fresh_zero_optimizer": true, + "one_update_changes_parameters": true, + "sampling_replay_exact": true, + "all13_durations_evaluated": true + } + ], + "test_data_used": false + } + }, + "training_source_snapshot": "training_sources/group_specialize1", + "selected_checkpoints": { + "d3_bX_center_3_5": 128, + "d3_bX_center_5_7": 256, + "d3_bX_center_7_5": 128, + "d3_bZ_center_7_5": 128 + }, + "checkpoint_records": { + "d3_bX_center_3_5": { + "group": "d3_bX_center_3_5", + "step": 128, + "training_draws": 131072, + "unique_training_rows_seen_in_this_phase": 101608, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 7393, + "surface_code_bX_d3_r03_center_3_5": 9191, + "surface_code_bX_d3_r05_center_3_5": 9634, + "surface_code_bX_d3_r07_center_3_5": 9218, + "surface_code_bX_d3_r09_center_3_5": 6691, + "surface_code_bX_d3_r11_center_3_5": 6028, + "surface_code_bX_d3_r13_center_3_5": 9122, + "surface_code_bX_d3_r15_center_3_5": 5301, + "surface_code_bX_d3_r17_center_3_5": 8630, + "surface_code_bX_d3_r19_center_3_5": 5276, + "surface_code_bX_d3_r21_center_3_5": 8553, + "surface_code_bX_d3_r23_center_3_5": 7977, + "surface_code_bX_d3_r25_center_3_5": 8594 + }, + "weights": "weights-128.npz", + "weights_sha256": "90c6cb7fd3be8d363318f45257de6670ba19d9336d096dc3efb309bac88b2bf9", + "complete": true + }, + "d3_bX_center_5_7": { + "group": "d3_bX_center_5_7", + "step": 256, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162612, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_5_7": 13532, + "surface_code_bX_d3_r03_center_5_7": 12060, + "surface_code_bX_d3_r05_center_5_7": 14744, + "surface_code_bX_d3_r07_center_5_7": 11642, + "surface_code_bX_d3_r09_center_5_7": 13167, + "surface_code_bX_d3_r11_center_5_7": 8639, + "surface_code_bX_d3_r13_center_5_7": 14627, + "surface_code_bX_d3_r15_center_5_7": 11178, + "surface_code_bX_d3_r17_center_5_7": 10160, + "surface_code_bX_d3_r19_center_5_7": 13125, + "surface_code_bX_d3_r21_center_5_7": 13464, + "surface_code_bX_d3_r23_center_5_7": 13143, + "surface_code_bX_d3_r25_center_5_7": 13131 + }, + "weights": "weights-256.npz", + "weights_sha256": "7dc5b5ed51423bae023bb2c15de420850fef4fedb82760a7bcd993393301e038", + "complete": true + }, + "d3_bX_center_7_5": { + "group": "d3_bX_center_7_5", + "step": 128, + "training_draws": 131072, + "unique_training_rows_seen_in_this_phase": 101875, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_7_5": 7327, + "surface_code_bX_d3_r03_center_7_5": 6711, + "surface_code_bX_d3_r05_center_7_5": 9068, + "surface_code_bX_d3_r07_center_7_5": 9212, + "surface_code_bX_d3_r09_center_7_5": 6001, + "surface_code_bX_d3_r11_center_7_5": 7353, + "surface_code_bX_d3_r13_center_7_5": 7373, + "surface_code_bX_d3_r15_center_7_5": 8580, + "surface_code_bX_d3_r17_center_7_5": 6713, + "surface_code_bX_d3_r19_center_7_5": 9686, + "surface_code_bX_d3_r21_center_7_5": 8553, + "surface_code_bX_d3_r23_center_7_5": 7325, + "surface_code_bX_d3_r25_center_7_5": 7973 + }, + "weights": "weights-128.npz", + "weights_sha256": "1dc16b14813ebfd874acf9c907870144bc6ac98c8de8b4e8c47e41cdcfb3f1c3", + "complete": true + }, + "d3_bZ_center_7_5": { + "group": "d3_bZ_center_7_5", + "step": 128, + "training_draws": 131072, + "unique_training_rows_seen_in_this_phase": 101460, + "unique_rows_by_condition": { + "surface_code_bZ_d3_r01_center_7_5": 7386, + "surface_code_bZ_d3_r03_center_7_5": 7382, + "surface_code_bZ_d3_r05_center_7_5": 7375, + "surface_code_bZ_d3_r07_center_7_5": 4523, + "surface_code_bZ_d3_r09_center_7_5": 6016, + "surface_code_bZ_d3_r11_center_7_5": 10680, + "surface_code_bZ_d3_r13_center_7_5": 9644, + "surface_code_bZ_d3_r15_center_7_5": 7341, + "surface_code_bZ_d3_r17_center_7_5": 9210, + "surface_code_bZ_d3_r19_center_7_5": 8536, + "surface_code_bZ_d3_r21_center_7_5": 7410, + "surface_code_bZ_d3_r23_center_7_5": 8625, + "surface_code_bZ_d3_r25_center_7_5": 7332 + }, + "weights": "weights-128.npz", + "weights_sha256": "8f78092b6539927132aebd28deb0e0d1b72f43596b79e074e3206f4a784dd000", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure across all13 durations per group among incumbent, specialized128/256 and equal small-contextual blends; retain incumbent on ties", + "blend_reference": "/run-state/workspace/research/context_upgrades/continuation2/predictions", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.24451622596153846, + "128": 0.2444110576923077, + "blend-128": 0.24523737980769234, + "256": 0.24468149038461534, + "blend-256": 0.24532752403846156 + }, + "selected": "128" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2526592548076923, + "128": 0.2528094951923077, + "blend-128": 0.25312499999999993, + "256": 0.2532001201923077, + "blend-256": 0.25318509615384616 + }, + "selected": "incumbent" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.2333984375, + "128": 0.23329326923076926, + "blend-128": 0.23414963942307693, + "256": 0.233203125, + "blend-256": 0.2338641826923077 + }, + "selected": "256" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.23889723557692305, + "128": 0.23933293269230768, + "blend-128": 0.23880709134615385, + "256": 0.23907752403846153, + "blend-256": 0.23888221153846154 + }, + "selected": "blend-128" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24447115384615387, + "128": 0.24456129807692306, + "blend-128": 0.24534254807692307, + "256": 0.24462139423076923, + "blend-256": 0.24505709134615386 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.23652343749999996, + "128": 0.2371394230769231, + "blend-128": 0.23753004807692307, + "256": 0.2373347355769231, + "blend-256": 0.23728966346153849 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.2356670673076923, + "128": 0.23635817307692306, + "blend-128": 0.23662860576923073, + "256": 0.23571213942307687, + "blend-256": 0.23638822115384614 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.23294771634615385, + "128": 0.23282752403846158, + "blend-128": 0.2331280048076923, + "256": 0.23348858173076922, + "blend-256": 0.23336838942307692 + }, + "selected": "128" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23228665865384618 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.21953124999999998 + }, + "selected": "incumbent" + } + ] + } + ], + "turbo_d5_experiment": { + "method": "Three passes of extrinsic log-odds feedback between complementary exact CSS syndrome-likelihood contractions, damping 1, messages clipped to [-8,8]. Induced dependencies are approximated.", + "initialization": "Logistic coefficients randomly initialized Normal(0,.01), seed 20261103; all underlying states built in this session from permitted even-fitted DEMs.", + "training": "4096 uniformly sampled training rows per all 26 d5 conditions (sample seed 20261023); BCE plus 1e-5 L2, L-BFGS-B up to 300 iterations.", + "screen": { + "scope": "Diagnostic screen only: both d5 bases, rounds 5/13/25, 1024 uniform validation samples per condition", + "sample_seed": 20261031, + "results": [ + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "rounds": 5, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 5.466358661651611, + "elapsed": 7.00129771232605, + "first_pass_max_delta": 8.940696716308594e-07, + "failure": [ + 0.1025390625, + 0.1044921875, + 0.1025390625 + ], + "peak_gpu_bytes": 4742925056 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "rounds": 5, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 1.1764235496520996, + "elapsed": 8.178237438201904, + "first_pass_max_delta": 8.940696716308594e-07, + "failure": [ + 0.1025390625, + 0.0966796875, + 0.1005859375 + ], + "peak_gpu_bytes": 4742925056 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "rounds": 13, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 7.137438058853149, + "elapsed": 16.021901607513428, + "first_pass_max_delta": 1.1324882507324219e-06, + "failure": [ + 0.2548828125, + 0.2490234375, + 0.25 + ], + "peak_gpu_bytes": 11611887104 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "rounds": 13, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 3.088695526123047, + "elapsed": 19.11112403869629, + "first_pass_max_delta": 1.1324882507324219e-06, + "failure": [ + 0.2548828125, + 0.2490234375, + 0.2412109375 + ], + "peak_gpu_bytes": 11611887104 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "rounds": 25, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 10.504217624664307, + "elapsed": 30.677946090698242, + "first_pass_max_delta": 1.5497207641601562e-06, + "failure": [ + 0.3916015625, + 0.38671875, + 0.3896484375 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "rounds": 25, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 5.937381267547607, + "elapsed": 36.615668296813965, + "first_pass_max_delta": 1.5497207641601562e-06, + "failure": [ + 0.3916015625, + 0.3857421875, + 0.3896484375 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "rounds": 5, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 4.611798286437988, + "elapsed": 41.71111083030701, + "first_pass_max_delta": 2.0265579223632812e-06, + "failure": [ + 0.1005859375, + 0.1015625, + 0.09765625 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "rounds": 5, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 1.1570250988006592, + "elapsed": 42.86858010292053, + "first_pass_max_delta": 2.0265579223632812e-06, + "failure": [ + 0.1005859375, + 0.0986328125, + 0.095703125 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "rounds": 13, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 6.715797185897827, + "elapsed": 50.234126567840576, + "first_pass_max_delta": 1.0132789611816406e-06, + "failure": [ + 0.236328125, + 0.234375, + 0.2314453125 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "rounds": 13, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 3.08017635345459, + "elapsed": 53.31461310386658, + "first_pass_max_delta": 1.0132789611816406e-06, + "failure": [ + 0.236328125, + 0.23828125, + 0.234375 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "rounds": 25, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 9.802945375442505, + "elapsed": 64.01536726951599, + "first_pass_max_delta": 1.4901161193847656e-06, + "failure": [ + 0.384765625, + 0.3857421875, + 0.38671875 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "rounds": 25, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 5.927323341369629, + "elapsed": 69.9429976940155, + "first_pass_max_delta": 1.4901161193847656e-06, + "failure": [ + 0.384765625, + 0.3701171875, + 0.361328125 + ], + "peak_gpu_bytes": 21913887488 + } + ] + }, + "cache": { + "method": "Three extrinsic-message passes between exact CSS likelihoods, damping 1, extrinsic clipping [-8,8]", + "scope": "All 26 d5 conditions. Full validation and 4096 training shots per condition.", + "training_selection": "Same uniformly sampled training indices as d5_cache, seed 20261023; labels are only used downstream in ensemble fitting.", + "model_selection": "Damping 1 and three passes chosen from a six-condition, 1024-validation-shot diagnostic screen of .5/1 damping and 1/2/3 passes.", + "batch": 384, + "test_data_used": false, + "resume_note": "Initial dynamic allocator failed at X/r21 after saving X/r1 through r19. Those complete records are retained; remaining conditions resumed with a 90 percent preallocated pool.", + "records": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "batch": 384, + "validation": { + "seconds": 0.0023708343505859375, + "shots": 5120, + "first_pass_max_delta": 0.0, + "failure": [ + 0.0080078125, + 0.0080078125, + 0.0080078125 + ] + }, + "train": { + "seconds": 0.00203704833984375, + "shots": 4096, + "first_pass_max_delta": 0.0, + "failure": [ + 0.00830078125, + 0.00830078125, + 0.00830078125 + ] + }, + "elapsed": 0.031897783279418945, + "peak_gpu_bytes": 0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "batch": 384, + "validation": { + "seconds": 6.5025129318237305, + "shots": 5120, + "first_pass_max_delta": 1.1622905731201172e-06, + "failure": [ + 0.05390625, + 0.05234375, + 0.0515625 + ] + }, + "train": { + "seconds": 1.8498849868774414, + "shots": 4096, + "first_pass_max_delta": 1.0728836059570312e-06, + "failure": [ + 0.056640625, + 0.056884765625, + 0.057373046875 + ] + }, + "elapsed": 9.963430881500244, + "peak_gpu_bytes": 6053389568 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "batch": 384, + "validation": { + "seconds": 7.887800455093384, + "shots": 5120, + "first_pass_max_delta": 1.1920928955078125e-06, + "failure": [ + 0.1111328125, + 0.1078125, + 0.1078125 + ] + }, + "train": { + "seconds": 3.1277287006378174, + "shots": 4096, + "first_pass_max_delta": 1.5497207641601562e-06, + "failure": [ + 0.110595703125, + 0.1044921875, + 0.106689453125 + ] + }, + "elapsed": 21.591607809066772, + "peak_gpu_bytes": 9485051136 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "batch": 384, + "validation": { + "seconds": 9.284316062927246, + "shots": 5120, + "first_pass_max_delta": 1.0728836059570312e-06, + "failure": [ + 0.1638671875, + 0.16328125, + 0.16328125 + ] + }, + "train": { + "seconds": 4.408588647842407, + "shots": 4096, + "first_pass_max_delta": 3.2186508178710938e-06, + "failure": [ + 0.165771484375, + 0.15966796875, + 0.160888671875 + ] + }, + "elapsed": 35.83207678794861, + "peak_gpu_bytes": 12921052416 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "batch": 384, + "validation": { + "seconds": 10.81107211112976, + "shots": 5120, + "first_pass_max_delta": 4.172325134277344e-06, + "failure": [ + 0.1994140625, + 0.1947265625, + 0.192578125 + ] + }, + "train": { + "seconds": 5.6971564292907715, + "shots": 4096, + "first_pass_max_delta": 1.9073486328125e-06, + "failure": [ + 0.193603515625, + 0.190185546875, + 0.1865234375 + ] + }, + "elapsed": 52.94058084487915, + "peak_gpu_bytes": 16355555584 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "batch": 384, + "validation": { + "seconds": 13.042934894561768, + "shots": 5120, + "first_pass_max_delta": 1.2516975402832031e-06, + "failure": [ + 0.2330078125, + 0.229296875, + 0.2283203125 + ] + }, + "train": { + "seconds": 6.935072898864746, + "shots": 4096, + "first_pass_max_delta": 1.043081283569336e-06, + "failure": [ + 0.237060546875, + 0.2373046875, + 0.23388671875 + ] + }, + "elapsed": 73.53631615638733, + "peak_gpu_bytes": 19787549696 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "batch": 384, + "validation": { + "seconds": 14.011132955551147, + "shots": 5120, + "first_pass_max_delta": 1.430511474609375e-06, + "failure": [ + 0.251953125, + 0.243359375, + 0.2427734375 + ] + }, + "train": { + "seconds": 8.214681386947632, + "shots": 4096, + "first_pass_max_delta": 1.6689300537109375e-06, + "failure": [ + 0.261962890625, + 0.257080078125, + 0.254150390625 + ] + }, + "elapsed": 96.39840364456177, + "peak_gpu_bytes": 23221127680 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "batch": 384, + "validation": { + "seconds": 15.821684837341309, + "shots": 5120, + "first_pass_max_delta": 2.3245811462402344e-06, + "failure": [ + 0.2822265625, + 0.286328125, + 0.2798828125 + ] + }, + "train": { + "seconds": 9.5097815990448, + "shots": 4096, + "first_pass_max_delta": 1.8477439880371094e-06, + "failure": [ + 0.294677734375, + 0.28515625, + 0.2861328125 + ] + }, + "elapsed": 122.39457035064697, + "peak_gpu_bytes": 26659319552 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "batch": 384, + "validation": { + "seconds": 18.90661311149597, + "shots": 5120, + "first_pass_max_delta": 2.3245811462402344e-06, + "failure": [ + 0.329296875, + 0.323828125, + 0.3169921875 + ] + }, + "train": { + "seconds": 11.201237440109253, + "shots": 4096, + "first_pass_max_delta": 1.0728836059570312e-06, + "failure": [ + 0.3046875, + 0.304931640625, + 0.302978515625 + ] + }, + "elapsed": 153.40053129196167, + "peak_gpu_bytes": 30096252672 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "batch": 384, + "validation": { + "seconds": 22.513427734375, + "shots": 5120, + "first_pass_max_delta": 1.4007091522216797e-06, + "failure": [ + 0.3560546875, + 0.3458984375, + 0.3455078125 + ] + }, + "train": { + "seconds": 16.373472213745117, + "shots": 4096, + "first_pass_max_delta": 1.430511474609375e-06, + "failure": [ + 0.350341796875, + 0.3447265625, + 0.339111328125 + ] + }, + "elapsed": 193.22454714775085, + "peak_gpu_bytes": 33531435520 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 20.595962524414062, + "shots": 5120, + "first_pass_max_delta": 1.1920928955078125e-06, + "failure": [ + 0.3640625, + 0.3626953125, + 0.3607421875 + ] + }, + "train": { + "seconds": 13.13056755065918, + "shots": 4096, + "first_pass_max_delta": 1.6689300537109375e-06, + "failure": [ + 0.366455078125, + 0.364013671875, + 0.3603515625 + ] + }, + "elapsed": 36.23082995414734, + "peak_gpu_bytes": 36971696384 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 21.875932693481445, + "shots": 5120, + "first_pass_max_delta": 1.2516975402832031e-06, + "failure": [ + 0.3857421875, + 0.3837890625, + 0.3794921875 + ] + }, + "train": { + "seconds": 14.333576440811157, + "shots": 4096, + "first_pass_max_delta": 1.1920928955078125e-06, + "failure": [ + 0.37841796875, + 0.380859375, + 0.378173828125 + ] + }, + "elapsed": 73.29396986961365, + "peak_gpu_bytes": 40408369664 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 23.68450117111206, + "shots": 5120, + "first_pass_max_delta": 1.7285346984863281e-06, + "failure": [ + 0.38828125, + 0.39140625, + 0.390234375 + ] + }, + "train": { + "seconds": 15.625046253204346, + "shots": 4096, + "first_pass_max_delta": 2.3543834686279297e-06, + "failure": [ + 0.401611328125, + 0.3984375, + 0.3896484375 + ] + }, + "elapsed": 113.62051224708557, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 0.0020935535430908203, + "shots": 5120, + "first_pass_max_delta": 0.0, + "failure": [ + 0.0078125, + 0.0078125, + 0.0078125 + ] + }, + "train": { + "seconds": 0.0018491744995117188, + "shots": 4096, + "first_pass_max_delta": 0.0, + "failure": [ + 0.006103515625, + 0.006103515625, + 0.006103515625 + ] + }, + "elapsed": 113.74299573898315, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 6.421818256378174, + "shots": 5120, + "first_pass_max_delta": 9.5367431640625e-07, + "failure": [ + 0.0474609375, + 0.0466796875, + 0.04609375 + ] + }, + "train": { + "seconds": 2.009964942932129, + "shots": 4096, + "first_pass_max_delta": 1.6093254089355469e-06, + "failure": [ + 0.05224609375, + 0.050537109375, + 0.050537109375 + ] + }, + "elapsed": 122.82617926597595, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 8.133492231369019, + "shots": 5120, + "first_pass_max_delta": 2.115964889526367e-06, + "failure": [ + 0.1037109375, + 0.1029296875, + 0.102734375 + ] + }, + "train": { + "seconds": 3.179387331008911, + "shots": 4096, + "first_pass_max_delta": 1.6689300537109375e-06, + "failure": [ + 0.108642578125, + 0.1044921875, + 0.10595703125 + ] + }, + "elapsed": 134.6406970024109, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 13.694931983947754, + "shots": 5120, + "first_pass_max_delta": 2.3245811462402344e-06, + "failure": [ + 0.1484375, + 0.14765625, + 0.1494140625 + ] + }, + "train": { + "seconds": 6.147953748703003, + "shots": 4096, + "first_pass_max_delta": 2.0563602447509766e-06, + "failure": [ + 0.147705078125, + 0.144775390625, + 0.143310546875 + ] + }, + "elapsed": 155.0307319164276, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 14.462661504745483, + "shots": 5120, + "first_pass_max_delta": 1.4901161193847656e-06, + "failure": [ + 0.181640625, + 0.1765625, + 0.1734375 + ] + }, + "train": { + "seconds": 6.59630274772644, + "shots": 4096, + "first_pass_max_delta": 1.7285346984863281e-06, + "failure": [ + 0.181640625, + 0.173583984375, + 0.17431640625 + ] + }, + "elapsed": 176.9893820285797, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 15.458272933959961, + "shots": 5120, + "first_pass_max_delta": 1.430511474609375e-06, + "failure": [ + 0.2208984375, + 0.2169921875, + 0.2189453125 + ] + }, + "train": { + "seconds": 8.347567081451416, + "shots": 4096, + "first_pass_max_delta": 1.7285346984863281e-06, + "failure": [ + 0.2216796875, + 0.214111328125, + 0.209716796875 + ] + }, + "elapsed": 201.48220419883728, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 16.03638219833374, + "shots": 5120, + "first_pass_max_delta": 1.0728836059570312e-06, + "failure": [ + 0.2439453125, + 0.2349609375, + 0.2333984375 + ] + }, + "train": { + "seconds": 8.29888391494751, + "shots": 4096, + "first_pass_max_delta": 8.344650268554688e-07, + "failure": [ + 0.24365234375, + 0.248046875, + 0.2451171875 + ] + }, + "elapsed": 226.75215530395508, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 16.009416103363037, + "shots": 5120, + "first_pass_max_delta": 1.341104507446289e-06, + "failure": [ + 0.271875, + 0.264453125, + 0.2638671875 + ] + }, + "train": { + "seconds": 9.500921726226807, + "shots": 4096, + "first_pass_max_delta": 1.0728836059570312e-06, + "failure": [ + 0.28076171875, + 0.267333984375, + 0.267333984375 + ] + }, + "elapsed": 252.95993447303772, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 17.426681518554688, + "shots": 5120, + "first_pass_max_delta": 1.6242265701293945e-06, + "failure": [ + 0.31484375, + 0.3056640625, + 0.3087890625 + ] + }, + "train": { + "seconds": 10.742947816848755, + "shots": 4096, + "first_pass_max_delta": 1.430511474609375e-06, + "failure": [ + 0.310791015625, + 0.309814453125, + 0.31103515625 + ] + }, + "elapsed": 281.84620356559753, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 18.49993872642517, + "shots": 5120, + "first_pass_max_delta": 1.9073486328125e-06, + "failure": [ + 0.334375, + 0.334765625, + 0.33515625 + ] + }, + "train": { + "seconds": 11.90273404121399, + "shots": 4096, + "first_pass_max_delta": 1.3113021850585938e-06, + "failure": [ + 0.327880859375, + 0.315673828125, + 0.310546875 + ] + }, + "elapsed": 313.02247071266174, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 20.121089458465576, + "shots": 5120, + "first_pass_max_delta": 1.2516975402832031e-06, + "failure": [ + 0.34609375, + 0.342578125, + 0.344140625 + ] + }, + "train": { + "seconds": 13.077136278152466, + "shots": 4096, + "first_pass_max_delta": 1.6391277313232422e-06, + "failure": [ + 0.349853515625, + 0.34765625, + 0.352294921875 + ] + }, + "elapsed": 347.0259063243866, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 22.116555213928223, + "shots": 5120, + "first_pass_max_delta": 1.6689300537109375e-06, + "failure": [ + 0.3625, + 0.3625, + 0.3564453125 + ] + }, + "train": { + "seconds": 14.53529953956604, + "shots": 4096, + "first_pass_max_delta": 1.7285346984863281e-06, + "failure": [ + 0.361572265625, + 0.36083984375, + 0.35205078125 + ] + }, + "elapsed": 384.53587651252747, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 24.039794921875, + "shots": 5120, + "first_pass_max_delta": 1.2516975402832031e-06, + "failure": [ + 0.397265625, + 0.3810546875, + 0.3755859375 + ] + }, + "train": { + "seconds": 15.72797179222107, + "shots": 4096, + "first_pass_max_delta": 1.1920928955078125e-06, + "failure": [ + 0.378662109375, + 0.370849609375, + 0.369384765625 + ] + }, + "elapsed": 425.2448420524597, + "peak_gpu_bytes": 43842280448 + } + ] + }, + "selection": "Full-validation mean failure per basis group, comparing incumbent, raw pass3, calibrated pass3, confidence ensemble, and confidence+matching ensemble.", + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": { + "failure": 0.24024939903846157 + }, + "turbo_raw": { + "failure": 0.2359375 + }, + "turbo_calibrated": { + "failure": 0.23592247596153845, + "train_loss": 0.4342440304618462, + "iterations": 8, + "optimizer_success": true + }, + "turbo_confidence": { + "failure": 0.23646334134615385, + "train_loss": 0.4325824823965761, + "iterations": 31, + "optimizer_success": true + }, + "turbo_ensemble": { + "failure": 0.23825120192307692, + "train_loss": 0.43104343457008354, + "iterations": 128, + "optimizer_success": true + } + }, + "selected": "turbo_calibrated" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": { + "failure": 0.22627704326923076 + }, + "turbo_raw": { + "failure": 0.2242938701923077 + }, + "turbo_calibrated": { + "failure": 0.22444411057692307, + "train_loss": 0.41862854651685183, + "iterations": 8, + "optimizer_success": true + }, + "turbo_confidence": { + "failure": 0.22463942307692308, + "train_loss": 0.4165407454935999, + "iterations": 28, + "optimizer_success": true + }, + "turbo_ensemble": { + "failure": 0.22291165865384616, + "train_loss": 0.4143765903988058, + "iterations": 153, + "optimizer_success": true + } + }, + "selected": "turbo_ensemble" + } + ], + "test_data_used": false, + "memory_optimization": { + "method": "Logical parity retained in forward state, marginalized out of stored histories and backward syndrome-likelihood messages; half the on-partition history size.", + "equivalence_checks": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "log_likelihood_max_delta": 0.0, + "logical_max_delta": 0.0, + "edge_posterior_max_delta": 3.2687214002180554e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "log_likelihood_max_delta": 0.0, + "logical_max_delta": 0.0, + "edge_posterior_max_delta": 3.698800981055683e-07 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "log_likelihood_max_delta": 0.0, + "logical_max_delta": 0.0, + "edge_posterior_max_delta": 4.061699030444288e-07 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "log_likelihood_max_delta": 0.0, + "logical_max_delta": 0.0, + "edge_posterior_max_delta": 4.5500107148654934e-07 + } + ], + "runtime_batch": 512, + "gpu_pool": "90 percent preallocated before JAX backend initialization" + } + }, + "neural_d5_history": [ + { + "training": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261101", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to exact complementary-CSS-conditioned relevant-edge logits; exact width-14 contraction predicts logical probability", + "training": "4096 training shots per each of all 26 d5 conditions, sampled without replacement with seed 20261023. Uniform condition and within-condition sampling for optimizer batches.", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; complementary conditioning held fixed", + "steps": 512, + "batch": 256, + "learning_rate": 0.001, + "sampling_seed": 20261101, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "starting_checkpoint": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 512, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.12617039680480957, + "error": 0.0390625, + "gradient_norm": 0.04250018671154976, + "elapsed": 18.675416231155396 + }, + { + "step": 16, + "loss": 0.6377020478248596, + "error": 0.4140625, + "gradient_norm": 0.09590183943510056, + "elapsed": 23.17981266975403 + }, + { + "step": 32, + "loss": 0.29977816343307495, + "error": 0.12109375, + "gradient_norm": 0.07157808542251587, + "elapsed": 28.000701189041138 + }, + { + "step": 48, + "loss": 0.34505343437194824, + "error": 0.1484375, + "gradient_norm": 0.07669594883918762, + "elapsed": 32.97374606132507 + }, + { + "step": 64, + "loss": 0.5405071973800659, + "error": 0.29296875, + "gradient_norm": 0.08529861271381378, + "elapsed": 37.794785499572754 + }, + { + "step": 80, + "loss": 0.5131822228431702, + "error": 0.28515625, + "gradient_norm": 0.12556222081184387, + "elapsed": 42.73275876045227 + }, + { + "step": 96, + "loss": 0.6790875196456909, + "error": 0.421875, + "gradient_norm": 0.19858981668949127, + "elapsed": 47.55139684677124 + }, + { + "step": 112, + "loss": 0.4744196832180023, + "error": 0.2421875, + "gradient_norm": 0.14321450889110565, + "elapsed": 52.42716360092163 + }, + { + "step": 128, + "loss": 0.01264211069792509, + "error": 0.00390625, + "gradient_norm": 0.007236324716359377, + "elapsed": 57.2592077255249 + }, + { + "step": 144, + "loss": 0.35788118839263916, + "error": 0.15234375, + "gradient_norm": 0.07203944772481918, + "elapsed": 64.91656231880188 + }, + { + "step": 160, + "loss": 0.6330419778823853, + "error": 0.3671875, + "gradient_norm": 0.08350329101085663, + "elapsed": 69.75011849403381 + }, + { + "step": 176, + "loss": 0.6195905208587646, + "error": 0.4140625, + "gradient_norm": 0.11415330320596695, + "elapsed": 74.56864047050476 + }, + { + "step": 192, + "loss": 0.5832147598266602, + "error": 0.37109375, + "gradient_norm": 0.3569585978984833, + "elapsed": 79.38981986045837 + }, + { + "step": 208, + "loss": 0.6469261646270752, + "error": 0.4296875, + "gradient_norm": 0.18999285995960236, + "elapsed": 84.23919153213501 + }, + { + "step": 224, + "loss": 0.5015400648117065, + "error": 0.26171875, + "gradient_norm": 0.14661277830600739, + "elapsed": 89.08856391906738 + }, + { + "step": 240, + "loss": 0.5771075487136841, + "error": 0.30859375, + "gradient_norm": 0.16081298887729645, + "elapsed": 94.75072908401489 + }, + { + "step": 256, + "loss": 0.4888438582420349, + "error": 0.265625, + "gradient_norm": 0.0695391371846199, + "elapsed": 101.01203680038452 + }, + { + "step": 272, + "loss": 0.4024130702018738, + "error": 0.171875, + "gradient_norm": 0.12405848503112793, + "elapsed": 110.68109226226807 + }, + { + "step": 288, + "loss": 0.5895810723304749, + "error": 0.34375, + "gradient_norm": 0.11818791180849075, + "elapsed": 117.13554787635803 + }, + { + "step": 304, + "loss": 0.4740591049194336, + "error": 0.23828125, + "gradient_norm": 0.12323135882616043, + "elapsed": 123.14409065246582 + }, + { + "step": 320, + "loss": 0.007106379605829716, + "error": 0.0, + "gradient_norm": 0.011303205043077469, + "elapsed": 129.3651967048645 + }, + { + "step": 336, + "loss": 0.11020991206169128, + "error": 0.046875, + "gradient_norm": 0.09031850099563599, + "elapsed": 135.01193165779114 + }, + { + "step": 352, + "loss": 0.47800248861312866, + "error": 0.23046875, + "gradient_norm": 0.09636854380369186, + "elapsed": 141.10205006599426 + }, + { + "step": 368, + "loss": 0.4062168598175049, + "error": 0.203125, + "gradient_norm": 0.17921771109104156, + "elapsed": 146.6507167816162 + }, + { + "step": 384, + "loss": 0.24366013705730438, + "error": 0.12109375, + "gradient_norm": 0.11793741583824158, + "elapsed": 152.7517864704132 + }, + { + "step": 400, + "loss": 0.4949762225151062, + "error": 0.28515625, + "gradient_norm": 0.09550267457962036, + "elapsed": 160.96661829948425 + }, + { + "step": 416, + "loss": 0.21066513657569885, + "error": 0.08984375, + "gradient_norm": 0.07445460557937622, + "elapsed": 165.83068180084229 + }, + { + "step": 432, + "loss": 0.4017776548862457, + "error": 0.18359375, + "gradient_norm": 0.1278357356786728, + "elapsed": 170.6406123638153 + }, + { + "step": 448, + "loss": 0.11823543906211853, + "error": 0.04296875, + "gradient_norm": 0.09968453645706177, + "elapsed": 175.4701704978943 + }, + { + "step": 464, + "loss": 0.47654634714126587, + "error": 0.2265625, + "gradient_norm": 0.18101797997951508, + "elapsed": 180.26738119125366 + }, + { + "step": 480, + "loss": 0.4916652739048004, + "error": 0.24609375, + "gradient_norm": 0.08958703279495239, + "elapsed": 185.08883357048035 + }, + { + "step": 496, + "loss": 0.5418418645858765, + "error": 0.3515625, + "gradient_norm": 0.08218713104724884, + "elapsed": 189.9677882194519 + }, + { + "step": 512, + "loss": 0.5470219850540161, + "error": 0.359375, + "gradient_norm": 0.07939601689577103, + "elapsed": 194.77887177467346 + } + ] + }, + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with incumbent.", + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23592247596153845, + "128": 0.23888221153846154, + "blend-128": 0.23536658653846151, + "256": 0.23865685096153846, + "blend-256": 0.23538161057692308, + "384": 0.23852163461538461, + "blend-384": 0.23487079326923077, + "512": 0.23870192307692306, + "blend-512": 0.23482572115384615 + }, + "selected": "blend-512" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22291165865384616, + "128": 0.2279897836538462, + "blend-128": 0.22366286057692308, + "256": 0.2274188701923077, + "blend-256": 0.22304687500000003, + "384": 0.22729867788461536, + "blend-384": 0.22337740384615384, + "512": 0.22662259615384617, + "blend-512": 0.22355769230769235 + }, + "selected": "incumbent" + } + ], + "checkpoints": { + "512": { + "step": 512, + "training_samples": 131072, + "weights_sha256": "86aa65455686eb06a430030bd4b8242ac78521dccf4e9b07f1e93b2aa2ec40af", + "complete": true + } + }, + "runtime": "Shared initial complementary-CSS priors between neural and physical branches in blended groups. Last-only physical branches omit logical tracking in intermediate passes when intermediate probabilities are unused.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false + }, + { + "training": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "4096 training shots per each of all 26 d5 conditions, sampled without replacement with seed 20261023. Uniform condition and within-condition sampling for optimizer batches.", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1024, + "batch": 256, + "learning_rate": 0.001, + "sampling_seed": 20261108, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "starting_checkpoint": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.011146659031510353, + "error": 0.00390625, + "gradient_norm": 0.011240893043577671, + "elapsed": 21.276997089385986 + }, + { + "step": 16, + "loss": 0.645737886428833, + "error": 0.40625, + "gradient_norm": 0.1628236621618271, + "elapsed": 25.872907638549805 + }, + { + "step": 32, + "loss": 0.574029803276062, + "error": 0.35546875, + "gradient_norm": 0.3000081777572632, + "elapsed": 30.761418342590332 + }, + { + "step": 48, + "loss": 0.574467122554779, + "error": 0.296875, + "gradient_norm": 0.24150623381137848, + "elapsed": 35.67650651931763 + }, + { + "step": 64, + "loss": 0.6003620624542236, + "error": 0.35546875, + "gradient_norm": 0.07430054992437363, + "elapsed": 40.60572576522827 + }, + { + "step": 80, + "loss": 0.5429091453552246, + "error": 0.33203125, + "gradient_norm": 0.15341751277446747, + "elapsed": 45.546849727630615 + }, + { + "step": 96, + "loss": 0.368771493434906, + "error": 0.1640625, + "gradient_norm": 0.08923184871673584, + "elapsed": 50.49156332015991 + }, + { + "step": 112, + "loss": 0.516342043876648, + "error": 0.265625, + "gradient_norm": 0.10965219140052795, + "elapsed": 55.45058846473694 + }, + { + "step": 128, + "loss": 0.5925382971763611, + "error": 0.37109375, + "gradient_norm": 0.055406324565410614, + "elapsed": 60.40891766548157 + }, + { + "step": 144, + "loss": 0.19184258580207825, + "error": 0.07421875, + "gradient_norm": 0.07042146474123001, + "elapsed": 65.33323669433594 + }, + { + "step": 160, + "loss": 0.5202382206916809, + "error": 0.25390625, + "gradient_norm": 0.14782382547855377, + "elapsed": 70.26605796813965 + }, + { + "step": 176, + "loss": 0.46083134412765503, + "error": 0.22265625, + "gradient_norm": 0.09074779599905014, + "elapsed": 75.18221640586853 + }, + { + "step": 192, + "loss": 0.3054918646812439, + "error": 0.14453125, + "gradient_norm": 0.0588168129324913, + "elapsed": 80.1186010837555 + }, + { + "step": 208, + "loss": 0.4836011230945587, + "error": 0.27734375, + "gradient_norm": 0.09208947420120239, + "elapsed": 85.05764293670654 + }, + { + "step": 224, + "loss": 0.6640600562095642, + "error": 0.38671875, + "gradient_norm": 0.22026506066322327, + "elapsed": 89.98808217048645 + }, + { + "step": 240, + "loss": 0.02421322464942932, + "error": 0.00390625, + "gradient_norm": 0.008131005801260471, + "elapsed": 94.90194272994995 + }, + { + "step": 256, + "loss": 0.6302106976509094, + "error": 0.4296875, + "gradient_norm": 0.09762304276227951, + "elapsed": 99.82612204551697 + }, + { + "step": 272, + "loss": 0.5092596411705017, + "error": 0.27734375, + "gradient_norm": 0.11407691985368729, + "elapsed": 110.44065999984741 + }, + { + "step": 288, + "loss": 0.452798455953598, + "error": 0.2265625, + "gradient_norm": 0.1105576679110527, + "elapsed": 115.36984539031982 + }, + { + "step": 304, + "loss": 0.3378596305847168, + "error": 0.18359375, + "gradient_norm": 0.0841713547706604, + "elapsed": 120.29337763786316 + }, + { + "step": 320, + "loss": 0.6271854639053345, + "error": 0.38671875, + "gradient_norm": 0.1972702294588089, + "elapsed": 125.2231035232544 + }, + { + "step": 336, + "loss": 0.04562236741185188, + "error": 0.01171875, + "gradient_norm": 0.027922745794057846, + "elapsed": 130.14725255966187 + }, + { + "step": 352, + "loss": 0.5342530608177185, + "error": 0.26953125, + "gradient_norm": 0.09031179547309875, + "elapsed": 135.08111095428467 + }, + { + "step": 368, + "loss": 0.49785488843917847, + "error": 0.2578125, + "gradient_norm": 0.19366280734539032, + "elapsed": 140.00699138641357 + }, + { + "step": 384, + "loss": 0.5673326253890991, + "error": 0.30859375, + "gradient_norm": 0.20644932985305786, + "elapsed": 144.92276740074158 + }, + { + "step": 400, + "loss": 0.5581298470497131, + "error": 0.3203125, + "gradient_norm": 0.17668266594409943, + "elapsed": 149.86573243141174 + }, + { + "step": 416, + "loss": 0.5564071536064148, + "error": 0.30078125, + "gradient_norm": 0.0821610689163208, + "elapsed": 154.7953712940216 + }, + { + "step": 432, + "loss": 0.5540086030960083, + "error": 0.34765625, + "gradient_norm": 0.1438807100057602, + "elapsed": 159.72657418251038 + }, + { + "step": 448, + "loss": 0.540939450263977, + "error": 0.29296875, + "gradient_norm": 0.17986361682415009, + "elapsed": 164.6689453125 + }, + { + "step": 464, + "loss": 0.45807865262031555, + "error": 0.25, + "gradient_norm": 0.14453186094760895, + "elapsed": 169.58739304542542 + }, + { + "step": 480, + "loss": 0.5191650390625, + "error": 0.22265625, + "gradient_norm": 0.07955105602741241, + "elapsed": 174.5444438457489 + }, + { + "step": 496, + "loss": 0.1692925989627838, + "error": 0.0703125, + "gradient_norm": 0.07875128090381622, + "elapsed": 179.48035550117493 + }, + { + "step": 512, + "loss": 0.5580664873123169, + "error": 0.3125, + "gradient_norm": 0.27090802788734436, + "elapsed": 184.42834162712097 + }, + { + "step": 528, + "loss": 0.26402050256729126, + "error": 0.13671875, + "gradient_norm": 0.13135771453380585, + "elapsed": 195.17691040039062 + }, + { + "step": 544, + "loss": 0.4352915287017822, + "error": 0.1953125, + "gradient_norm": 0.15959712862968445, + "elapsed": 200.0421543121338 + }, + { + "step": 560, + "loss": 0.22861814498901367, + "error": 0.1015625, + "gradient_norm": 0.08776932209730148, + "elapsed": 204.95144605636597 + }, + { + "step": 576, + "loss": 0.28309381008148193, + "error": 0.1328125, + "gradient_norm": 0.11050742119550705, + "elapsed": 209.8526291847229 + }, + { + "step": 592, + "loss": 0.6409220695495605, + "error": 0.41015625, + "gradient_norm": 0.19826626777648926, + "elapsed": 214.84447717666626 + }, + { + "step": 608, + "loss": 0.25090643763542175, + "error": 0.109375, + "gradient_norm": 0.05864342302083969, + "elapsed": 219.72637391090393 + }, + { + "step": 624, + "loss": 0.11423969268798828, + "error": 0.05078125, + "gradient_norm": 0.05318564549088478, + "elapsed": 224.6331377029419 + }, + { + "step": 640, + "loss": 0.32663431763648987, + "error": 0.1328125, + "gradient_norm": 0.06877780705690384, + "elapsed": 229.5065622329712 + }, + { + "step": 656, + "loss": 0.24196995794773102, + "error": 0.10546875, + "gradient_norm": 0.07683655619621277, + "elapsed": 234.4042534828186 + }, + { + "step": 672, + "loss": 0.5349344611167908, + "error": 0.296875, + "gradient_norm": 0.15214307606220245, + "elapsed": 239.26656579971313 + }, + { + "step": 688, + "loss": 0.26759713888168335, + "error": 0.1171875, + "gradient_norm": 0.14698348939418793, + "elapsed": 244.21049737930298 + }, + { + "step": 704, + "loss": 0.37338894605636597, + "error": 0.18359375, + "gradient_norm": 0.10210632532835007, + "elapsed": 249.13519072532654 + }, + { + "step": 720, + "loss": 0.36807945370674133, + "error": 0.17578125, + "gradient_norm": 0.09668388962745667, + "elapsed": 254.06281065940857 + }, + { + "step": 736, + "loss": 0.3736685514450073, + "error": 0.15625, + "gradient_norm": 0.10987236350774765, + "elapsed": 259.01695108413696 + }, + { + "step": 752, + "loss": 0.5266942977905273, + "error": 0.29296875, + "gradient_norm": 0.09041415899991989, + "elapsed": 263.9530746936798 + }, + { + "step": 768, + "loss": 0.360038161277771, + "error": 0.1640625, + "gradient_norm": 0.10391079634428024, + "elapsed": 268.9019305706024 + }, + { + "step": 784, + "loss": 0.5700286626815796, + "error": 0.34375, + "gradient_norm": 0.12206032127141953, + "elapsed": 279.4174163341522 + }, + { + "step": 800, + "loss": 0.42533689737319946, + "error": 0.20703125, + "gradient_norm": 0.06605375558137894, + "elapsed": 284.3391351699829 + }, + { + "step": 816, + "loss": 0.12355346977710724, + "error": 0.046875, + "gradient_norm": 0.06571663916110992, + "elapsed": 289.2815272808075 + }, + { + "step": 832, + "loss": 0.6411258578300476, + "error": 0.3984375, + "gradient_norm": 0.160088911652565, + "elapsed": 294.2048614025116 + }, + { + "step": 848, + "loss": 0.5756919980049133, + "error": 0.3515625, + "gradient_norm": 0.0962308868765831, + "elapsed": 299.15635418891907 + }, + { + "step": 864, + "loss": 0.2706402540206909, + "error": 0.1171875, + "gradient_norm": 0.11391306668519974, + "elapsed": 304.09321761131287 + }, + { + "step": 880, + "loss": 0.33621329069137573, + "error": 0.1640625, + "gradient_norm": 0.09049320220947266, + "elapsed": 309.0412187576294 + }, + { + "step": 896, + "loss": 0.44343245029449463, + "error": 0.23828125, + "gradient_norm": 0.12484703958034515, + "elapsed": 313.98498797416687 + }, + { + "step": 912, + "loss": 0.5987736582756042, + "error": 0.359375, + "gradient_norm": 0.07541236281394958, + "elapsed": 318.9334623813629 + }, + { + "step": 928, + "loss": 0.38585522770881653, + "error": 0.1875, + "gradient_norm": 0.09290861338376999, + "elapsed": 323.86884689331055 + }, + { + "step": 944, + "loss": 0.4820440113544464, + "error": 0.234375, + "gradient_norm": 0.22198310494422913, + "elapsed": 328.7963180541992 + }, + { + "step": 960, + "loss": 0.07455944269895554, + "error": 0.015625, + "gradient_norm": 0.055282026529312134, + "elapsed": 333.75238251686096 + }, + { + "step": 976, + "loss": 0.013475366868078709, + "error": 0.0078125, + "gradient_norm": 0.009843004867434502, + "elapsed": 338.6403331756592 + }, + { + "step": 992, + "loss": 0.4429199695587158, + "error": 0.2265625, + "gradient_norm": 0.09489083290100098, + "elapsed": 343.5606532096863 + }, + { + "step": 1008, + "loss": 0.4892328381538391, + "error": 0.234375, + "gradient_norm": 0.1342826634645462, + "elapsed": 348.5243353843689 + }, + { + "step": 1024, + "loss": 0.6096819043159485, + "error": 0.32421875, + "gradient_norm": 0.17938998341560364, + "elapsed": 353.36506962776184 + } + ] + }, + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23482572115384615, + "256": 0.2346754807692308, + "blend-256": 0.23484074519230771, + "512": 0.23569711538461538, + "blend-512": 0.2338341346153846, + "768": 0.23470552884615387, + "blend-768": 0.23464543269230764, + "1024": 0.23653846153846153, + "blend-1024": 0.23445012019230768 + }, + "selected": "blend-512" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22291165865384616, + "256": 0.2231520432692308, + "blend-256": 0.2219951923076923, + "512": 0.22303185096153846, + "blend-512": 0.22211538461538463, + "768": 0.22279146634615382, + "blend-768": 0.2219501201923077, + "1024": 0.22291165865384616, + "blend-1024": 0.22182992788461542 + }, + "selected": "blend-1024" + } + ], + "checkpoints": { + "512": { + "step": 512, + "training_samples": 131072, + "weights_sha256": "6109f95c51d7b8803085c84b6bb34e3f199cc349bd846d6007c8f9a4f2a0c4fe", + "complete": true + }, + "1024": { + "step": 1024, + "training_samples": 262144, + "weights_sha256": "46aa01e703f38fa153206c54ff0ce7083d839de7aeb51bf14c8e732d52d5bd2d", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit logical tracking in intermediate passes when intermediate probabilities are unused.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false + }, + { + "training": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "training_source_sha256": { + "learned_d5__train.py": "b73af9da21332dee9a43f653b514695b020fbc3516604b2e721d8cf0ea876d53", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "5e9420df1f6dd56518925e910096fb9bc93bd796a5933b13bf894a1a96256cdf", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "All supplied training shots per each of all26 d5 conditions; uniform condition and within-condition sampling for optimizer batches.", + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 516880, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 507282, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 19592, + "surface_code_bX_d5_r03_center_5_5": 19646, + "surface_code_bX_d5_r05_center_5_5": 19513, + "surface_code_bX_d5_r07_center_5_5": 19341, + "surface_code_bX_d5_r09_center_5_5": 19211, + "surface_code_bX_d5_r11_center_5_5": 19239, + "surface_code_bX_d5_r13_center_5_5": 19679, + "surface_code_bX_d5_r15_center_5_5": 19455, + "surface_code_bX_d5_r17_center_5_5": 19479, + "surface_code_bX_d5_r19_center_5_5": 19479, + "surface_code_bX_d5_r21_center_5_5": 19551, + "surface_code_bX_d5_r23_center_5_5": 19586, + "surface_code_bX_d5_r25_center_5_5": 19526, + "surface_code_bZ_d5_r01_center_5_5": 19652, + "surface_code_bZ_d5_r03_center_5_5": 19732, + "surface_code_bZ_d5_r05_center_5_5": 19754, + "surface_code_bZ_d5_r07_center_5_5": 19194, + "surface_code_bZ_d5_r09_center_5_5": 19641, + "surface_code_bZ_d5_r11_center_5_5": 19611, + "surface_code_bZ_d5_r13_center_5_5": 19424, + "surface_code_bZ_d5_r15_center_5_5": 19380, + "surface_code_bZ_d5_r17_center_5_5": 19384, + "surface_code_bZ_d5_r19_center_5_5": 19684, + "surface_code_bZ_d5_r21_center_5_5": 19559, + "surface_code_bZ_d5_r23_center_5_5": 19524, + "surface_code_bZ_d5_r25_center_5_5": 19446 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 2048, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261113, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_d5/feedback3_pilot/rng-768.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/feedback3_pilot/weights-768.npz", + "starting_checkpoint_sha256": "bc2ba1c529317ce1b5b661efae4707eca49c6995d6f22b04193fe7642662fed8", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "4096 training shots per each of all 26 d5 conditions, sampled without replacement with seed 20261023. Uniform condition and within-condition sampling for optimizer batches.", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1024, + "batch": 256, + "learning_rate": 0.001, + "sampling_seed": 20261108, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "starting_checkpoint": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.011146659031510353, + "error": 0.00390625, + "gradient_norm": 0.011240893043577671, + "elapsed": 21.276997089385986 + }, + { + "step": 16, + "loss": 0.645737886428833, + "error": 0.40625, + "gradient_norm": 0.1628236621618271, + "elapsed": 25.872907638549805 + }, + { + "step": 32, + "loss": 0.574029803276062, + "error": 0.35546875, + "gradient_norm": 0.3000081777572632, + "elapsed": 30.761418342590332 + }, + { + "step": 48, + "loss": 0.574467122554779, + "error": 0.296875, + "gradient_norm": 0.24150623381137848, + "elapsed": 35.67650651931763 + }, + { + "step": 64, + "loss": 0.6003620624542236, + "error": 0.35546875, + "gradient_norm": 0.07430054992437363, + "elapsed": 40.60572576522827 + }, + { + "step": 80, + "loss": 0.5429091453552246, + "error": 0.33203125, + "gradient_norm": 0.15341751277446747, + "elapsed": 45.546849727630615 + }, + { + "step": 96, + "loss": 0.368771493434906, + "error": 0.1640625, + "gradient_norm": 0.08923184871673584, + "elapsed": 50.49156332015991 + }, + { + "step": 112, + "loss": 0.516342043876648, + "error": 0.265625, + "gradient_norm": 0.10965219140052795, + "elapsed": 55.45058846473694 + }, + { + "step": 128, + "loss": 0.5925382971763611, + "error": 0.37109375, + "gradient_norm": 0.055406324565410614, + "elapsed": 60.40891766548157 + }, + { + "step": 144, + "loss": 0.19184258580207825, + "error": 0.07421875, + "gradient_norm": 0.07042146474123001, + "elapsed": 65.33323669433594 + }, + { + "step": 160, + "loss": 0.5202382206916809, + "error": 0.25390625, + "gradient_norm": 0.14782382547855377, + "elapsed": 70.26605796813965 + }, + { + "step": 176, + "loss": 0.46083134412765503, + "error": 0.22265625, + "gradient_norm": 0.09074779599905014, + "elapsed": 75.18221640586853 + }, + { + "step": 192, + "loss": 0.3054918646812439, + "error": 0.14453125, + "gradient_norm": 0.0588168129324913, + "elapsed": 80.1186010837555 + }, + { + "step": 208, + "loss": 0.4836011230945587, + "error": 0.27734375, + "gradient_norm": 0.09208947420120239, + "elapsed": 85.05764293670654 + }, + { + "step": 224, + "loss": 0.6640600562095642, + "error": 0.38671875, + "gradient_norm": 0.22026506066322327, + "elapsed": 89.98808217048645 + }, + { + "step": 240, + "loss": 0.02421322464942932, + "error": 0.00390625, + "gradient_norm": 0.008131005801260471, + "elapsed": 94.90194272994995 + }, + { + "step": 256, + "loss": 0.6302106976509094, + "error": 0.4296875, + "gradient_norm": 0.09762304276227951, + "elapsed": 99.82612204551697 + }, + { + "step": 272, + "loss": 0.5092596411705017, + "error": 0.27734375, + "gradient_norm": 0.11407691985368729, + "elapsed": 110.44065999984741 + }, + { + "step": 288, + "loss": 0.452798455953598, + "error": 0.2265625, + "gradient_norm": 0.1105576679110527, + "elapsed": 115.36984539031982 + }, + { + "step": 304, + "loss": 0.3378596305847168, + "error": 0.18359375, + "gradient_norm": 0.0841713547706604, + "elapsed": 120.29337763786316 + }, + { + "step": 320, + "loss": 0.6271854639053345, + "error": 0.38671875, + "gradient_norm": 0.1972702294588089, + "elapsed": 125.2231035232544 + }, + { + "step": 336, + "loss": 0.04562236741185188, + "error": 0.01171875, + "gradient_norm": 0.027922745794057846, + "elapsed": 130.14725255966187 + }, + { + "step": 352, + "loss": 0.5342530608177185, + "error": 0.26953125, + "gradient_norm": 0.09031179547309875, + "elapsed": 135.08111095428467 + }, + { + "step": 368, + "loss": 0.49785488843917847, + "error": 0.2578125, + "gradient_norm": 0.19366280734539032, + "elapsed": 140.00699138641357 + }, + { + "step": 384, + "loss": 0.5673326253890991, + "error": 0.30859375, + "gradient_norm": 0.20644932985305786, + "elapsed": 144.92276740074158 + }, + { + "step": 400, + "loss": 0.5581298470497131, + "error": 0.3203125, + "gradient_norm": 0.17668266594409943, + "elapsed": 149.86573243141174 + }, + { + "step": 416, + "loss": 0.5564071536064148, + "error": 0.30078125, + "gradient_norm": 0.0821610689163208, + "elapsed": 154.7953712940216 + }, + { + "step": 432, + "loss": 0.5540086030960083, + "error": 0.34765625, + "gradient_norm": 0.1438807100057602, + "elapsed": 159.72657418251038 + }, + { + "step": 448, + "loss": 0.540939450263977, + "error": 0.29296875, + "gradient_norm": 0.17986361682415009, + "elapsed": 164.6689453125 + }, + { + "step": 464, + "loss": 0.45807865262031555, + "error": 0.25, + "gradient_norm": 0.14453186094760895, + "elapsed": 169.58739304542542 + }, + { + "step": 480, + "loss": 0.5191650390625, + "error": 0.22265625, + "gradient_norm": 0.07955105602741241, + "elapsed": 174.5444438457489 + }, + { + "step": 496, + "loss": 0.1692925989627838, + "error": 0.0703125, + "gradient_norm": 0.07875128090381622, + "elapsed": 179.48035550117493 + }, + { + "step": 512, + "loss": 0.5580664873123169, + "error": 0.3125, + "gradient_norm": 0.27090802788734436, + "elapsed": 184.42834162712097 + }, + { + "step": 528, + "loss": 0.26402050256729126, + "error": 0.13671875, + "gradient_norm": 0.13135771453380585, + "elapsed": 195.17691040039062 + }, + { + "step": 544, + "loss": 0.4352915287017822, + "error": 0.1953125, + "gradient_norm": 0.15959712862968445, + "elapsed": 200.0421543121338 + }, + { + "step": 560, + "loss": 0.22861814498901367, + "error": 0.1015625, + "gradient_norm": 0.08776932209730148, + "elapsed": 204.95144605636597 + }, + { + "step": 576, + "loss": 0.28309381008148193, + "error": 0.1328125, + "gradient_norm": 0.11050742119550705, + "elapsed": 209.8526291847229 + }, + { + "step": 592, + "loss": 0.6409220695495605, + "error": 0.41015625, + "gradient_norm": 0.19826626777648926, + "elapsed": 214.84447717666626 + }, + { + "step": 608, + "loss": 0.25090643763542175, + "error": 0.109375, + "gradient_norm": 0.05864342302083969, + "elapsed": 219.72637391090393 + }, + { + "step": 624, + "loss": 0.11423969268798828, + "error": 0.05078125, + "gradient_norm": 0.05318564549088478, + "elapsed": 224.6331377029419 + }, + { + "step": 640, + "loss": 0.32663431763648987, + "error": 0.1328125, + "gradient_norm": 0.06877780705690384, + "elapsed": 229.5065622329712 + }, + { + "step": 656, + "loss": 0.24196995794773102, + "error": 0.10546875, + "gradient_norm": 0.07683655619621277, + "elapsed": 234.4042534828186 + }, + { + "step": 672, + "loss": 0.5349344611167908, + "error": 0.296875, + "gradient_norm": 0.15214307606220245, + "elapsed": 239.26656579971313 + }, + { + "step": 688, + "loss": 0.26759713888168335, + "error": 0.1171875, + "gradient_norm": 0.14698348939418793, + "elapsed": 244.21049737930298 + }, + { + "step": 704, + "loss": 0.37338894605636597, + "error": 0.18359375, + "gradient_norm": 0.10210632532835007, + "elapsed": 249.13519072532654 + }, + { + "step": 720, + "loss": 0.36807945370674133, + "error": 0.17578125, + "gradient_norm": 0.09668388962745667, + "elapsed": 254.06281065940857 + }, + { + "step": 736, + "loss": 0.3736685514450073, + "error": 0.15625, + "gradient_norm": 0.10987236350774765, + "elapsed": 259.01695108413696 + }, + { + "step": 752, + "loss": 0.5266942977905273, + "error": 0.29296875, + "gradient_norm": 0.09041415899991989, + "elapsed": 263.9530746936798 + }, + { + "step": 768, + "loss": 0.360038161277771, + "error": 0.1640625, + "gradient_norm": 0.10391079634428024, + "elapsed": 268.9019305706024 + }, + { + "step": 784, + "loss": 0.5700286626815796, + "error": 0.34375, + "gradient_norm": 0.12206032127141953, + "elapsed": 279.4174163341522 + }, + { + "step": 800, + "loss": 0.42533689737319946, + "error": 0.20703125, + "gradient_norm": 0.06605375558137894, + "elapsed": 284.3391351699829 + }, + { + "step": 816, + "loss": 0.12355346977710724, + "error": 0.046875, + "gradient_norm": 0.06571663916110992, + "elapsed": 289.2815272808075 + }, + { + "step": 832, + "loss": 0.6411258578300476, + "error": 0.3984375, + "gradient_norm": 0.160088911652565, + "elapsed": 294.2048614025116 + }, + { + "step": 848, + "loss": 0.5756919980049133, + "error": 0.3515625, + "gradient_norm": 0.0962308868765831, + "elapsed": 299.15635418891907 + }, + { + "step": 864, + "loss": 0.2706402540206909, + "error": 0.1171875, + "gradient_norm": 0.11391306668519974, + "elapsed": 304.09321761131287 + }, + { + "step": 880, + "loss": 0.33621329069137573, + "error": 0.1640625, + "gradient_norm": 0.09049320220947266, + "elapsed": 309.0412187576294 + }, + { + "step": 896, + "loss": 0.44343245029449463, + "error": 0.23828125, + "gradient_norm": 0.12484703958034515, + "elapsed": 313.98498797416687 + }, + { + "step": 912, + "loss": 0.5987736582756042, + "error": 0.359375, + "gradient_norm": 0.07541236281394958, + "elapsed": 318.9334623813629 + }, + { + "step": 928, + "loss": 0.38585522770881653, + "error": 0.1875, + "gradient_norm": 0.09290861338376999, + "elapsed": 323.86884689331055 + }, + { + "step": 944, + "loss": 0.4820440113544464, + "error": 0.234375, + "gradient_norm": 0.22198310494422913, + "elapsed": 328.7963180541992 + }, + { + "step": 960, + "loss": 0.07455944269895554, + "error": 0.015625, + "gradient_norm": 0.055282026529312134, + "elapsed": 333.75238251686096 + }, + { + "step": 976, + "loss": 0.013475366868078709, + "error": 0.0078125, + "gradient_norm": 0.009843004867434502, + "elapsed": 338.6403331756592 + }, + { + "step": 992, + "loss": 0.4429199695587158, + "error": 0.2265625, + "gradient_norm": 0.09489083290100098, + "elapsed": 343.5606532096863 + }, + { + "step": 1008, + "loss": 0.4892328381538391, + "error": 0.234375, + "gradient_norm": 0.1342826634645462, + "elapsed": 348.5243353843689 + }, + { + "step": 1024, + "loss": 0.6096819043159485, + "error": 0.32421875, + "gradient_norm": 0.17938998341560364, + "elapsed": 353.36506962776184 + } + ] + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.4341062307357788, + "objective": 0.4341062307357788, + "error": 0.208984375, + "gradient_norm": 0.07617632299661636, + "elapsed": 31.45817995071411 + }, + { + "step": 16, + "loss": 0.5996706485748291, + "objective": 0.5996706485748291, + "error": 0.359375, + "gradient_norm": 0.05249844491481781, + "elapsed": 56.34200572967529 + }, + { + "step": 32, + "loss": 0.4388691186904907, + "objective": 0.4388691186904907, + "error": 0.2041015625, + "gradient_norm": 0.0376109778881073, + "elapsed": 67.83739852905273 + }, + { + "step": 48, + "loss": 0.5373439788818359, + "objective": 0.5373439788818359, + "error": 0.2919921875, + "gradient_norm": 0.06261218339204788, + "elapsed": 76.69065475463867 + }, + { + "step": 64, + "loss": 0.24871854484081268, + "objective": 0.24871854484081268, + "error": 0.1162109375, + "gradient_norm": 0.05284671485424042, + "elapsed": 86.3852767944336 + }, + { + "step": 80, + "loss": 0.26628297567367554, + "objective": 0.26628297567367554, + "error": 0.123046875, + "gradient_norm": 0.04054367542266846, + "elapsed": 95.77356100082397 + }, + { + "step": 96, + "loss": 0.48436349630355835, + "objective": 0.48436349630355835, + "error": 0.259765625, + "gradient_norm": 0.05399860441684723, + "elapsed": 107.06293416023254 + }, + { + "step": 112, + "loss": 0.41063767671585083, + "objective": 0.41063767671585083, + "error": 0.1943359375, + "gradient_norm": 0.043602071702480316, + "elapsed": 116.78119611740112 + }, + { + "step": 128, + "loss": 0.3990316390991211, + "objective": 0.3990316390991211, + "error": 0.1865234375, + "gradient_norm": 0.0424419641494751, + "elapsed": 125.6915397644043 + }, + { + "step": 144, + "loss": 0.5119550228118896, + "objective": 0.5119550228118896, + "error": 0.2646484375, + "gradient_norm": 0.07688591629266739, + "elapsed": 136.20711088180542 + }, + { + "step": 160, + "loss": 0.3388235569000244, + "objective": 0.3388235569000244, + "error": 0.1630859375, + "gradient_norm": 0.07015731930732727, + "elapsed": 145.3505516052246 + }, + { + "step": 176, + "loss": 0.5952156186103821, + "objective": 0.5952156186103821, + "error": 0.3369140625, + "gradient_norm": 0.039373140782117844, + "elapsed": 154.77994871139526 + }, + { + "step": 192, + "loss": 0.15157413482666016, + "objective": 0.15157413482666016, + "error": 0.0634765625, + "gradient_norm": 0.029710670933127403, + "elapsed": 164.46801733970642 + }, + { + "step": 208, + "loss": 0.3120684027671814, + "objective": 0.3120684027671814, + "error": 0.1474609375, + "gradient_norm": 0.035548821091651917, + "elapsed": 173.24825358390808 + }, + { + "step": 224, + "loss": 0.5486405491828918, + "objective": 0.5486405491828918, + "error": 0.2900390625, + "gradient_norm": 0.0503678023815155, + "elapsed": 185.29849314689636 + }, + { + "step": 240, + "loss": 0.6046283841133118, + "objective": 0.6046283841133118, + "error": 0.3349609375, + "gradient_norm": 0.05043461173772812, + "elapsed": 197.54880928993225 + }, + { + "step": 256, + "loss": 0.5926339626312256, + "objective": 0.5926339626312256, + "error": 0.3359375, + "gradient_norm": 0.051241543143987656, + "elapsed": 211.79861068725586 + }, + { + "step": 272, + "loss": 0.4018518924713135, + "objective": 0.4018518924713135, + "error": 0.1943359375, + "gradient_norm": 0.0772147998213768, + "elapsed": 222.41974115371704 + }, + { + "step": 288, + "loss": 0.13863243162631989, + "objective": 0.13863243162631989, + "error": 0.0556640625, + "gradient_norm": 0.03334609419107437, + "elapsed": 234.04247426986694 + }, + { + "step": 304, + "loss": 0.562490701675415, + "objective": 0.562490701675415, + "error": 0.337890625, + "gradient_norm": 0.04585934057831764, + "elapsed": 242.65421533584595 + }, + { + "step": 320, + "loss": 0.5352796316146851, + "objective": 0.5352796316146851, + "error": 0.294921875, + "gradient_norm": 0.0837635025382042, + "elapsed": 252.10656356811523 + }, + { + "step": 336, + "loss": 0.26082637906074524, + "objective": 0.26082637906074524, + "error": 0.1220703125, + "gradient_norm": 0.048336997628211975, + "elapsed": 262.33449625968933 + }, + { + "step": 352, + "loss": 0.5959363579750061, + "objective": 0.5959363579750061, + "error": 0.3388671875, + "gradient_norm": 0.06797357648611069, + "elapsed": 271.9942307472229 + }, + { + "step": 368, + "loss": 0.48994284868240356, + "objective": 0.48994284868240356, + "error": 0.2587890625, + "gradient_norm": 0.06296153366565704, + "elapsed": 283.0493588447571 + }, + { + "step": 384, + "loss": 0.5710494518280029, + "objective": 0.5710494518280029, + "error": 0.3134765625, + "gradient_norm": 0.045333269983530045, + "elapsed": 294.64637446403503 + }, + { + "step": 400, + "loss": 0.5957783460617065, + "objective": 0.5957783460617065, + "error": 0.349609375, + "gradient_norm": 0.03918786719441414, + "elapsed": 307.6200888156891 + }, + { + "step": 416, + "loss": 0.27521568536758423, + "objective": 0.27521568536758423, + "error": 0.1220703125, + "gradient_norm": 0.038001637905836105, + "elapsed": 317.01610231399536 + }, + { + "step": 432, + "loss": 0.02379823848605156, + "objective": 0.02379823848605156, + "error": 0.0078125, + "gradient_norm": 0.007661945186555386, + "elapsed": 326.9360330104828 + }, + { + "step": 448, + "loss": 0.56734299659729, + "objective": 0.56734299659729, + "error": 0.3271484375, + "gradient_norm": 0.057416290044784546, + "elapsed": 339.6289041042328 + }, + { + "step": 464, + "loss": 0.10715995728969574, + "objective": 0.10715995728969574, + "error": 0.0380859375, + "gradient_norm": 0.02532491274178028, + "elapsed": 349.8584108352661 + }, + { + "step": 480, + "loss": 0.6143364310264587, + "objective": 0.6143364310264587, + "error": 0.36328125, + "gradient_norm": 0.08023032546043396, + "elapsed": 360.36362075805664 + }, + { + "step": 496, + "loss": 0.44069671630859375, + "objective": 0.44069671630859375, + "error": 0.2197265625, + "gradient_norm": 0.048025116324424744, + "elapsed": 369.48225808143616 + }, + { + "step": 512, + "loss": 0.019900165498256683, + "objective": 0.019900165498256683, + "error": 0.0107421875, + "gradient_norm": 0.0038635791279375553, + "elapsed": 378.59970593452454 + }, + { + "step": 528, + "loss": 0.033316534012556076, + "objective": 0.033316534012556076, + "error": 0.009765625, + "gradient_norm": 0.009174940176308155, + "elapsed": 393.4021761417389 + }, + { + "step": 544, + "loss": 0.41130945086479187, + "objective": 0.41130945086479187, + "error": 0.20703125, + "gradient_norm": 0.04695262759923935, + "elapsed": 402.8586280345917 + }, + { + "step": 560, + "loss": 0.5885373950004578, + "objective": 0.5885373950004578, + "error": 0.3544921875, + "gradient_norm": 0.08534500002861023, + "elapsed": 416.98661041259766 + }, + { + "step": 576, + "loss": 0.3804720640182495, + "objective": 0.3804720640182495, + "error": 0.19140625, + "gradient_norm": 0.05163278803229332, + "elapsed": 427.7550480365753 + }, + { + "step": 592, + "loss": 0.6101120710372925, + "objective": 0.6101120710372925, + "error": 0.3525390625, + "gradient_norm": 0.05593184754252434, + "elapsed": 441.05026268959045 + }, + { + "step": 608, + "loss": 0.5586092472076416, + "objective": 0.5586092472076416, + "error": 0.302734375, + "gradient_norm": 0.07458740472793579, + "elapsed": 452.95383286476135 + }, + { + "step": 624, + "loss": 0.5992780923843384, + "objective": 0.5992780923843384, + "error": 0.357421875, + "gradient_norm": 0.03618372976779938, + "elapsed": 466.1582691669464 + }, + { + "step": 640, + "loss": 0.3536975383758545, + "objective": 0.3536975383758545, + "error": 0.1650390625, + "gradient_norm": 0.05353165790438652, + "elapsed": 477.166255235672 + }, + { + "step": 656, + "loss": 0.4926893711090088, + "objective": 0.4926893711090088, + "error": 0.2626953125, + "gradient_norm": 0.05201377719640732, + "elapsed": 491.1417751312256 + }, + { + "step": 672, + "loss": 0.5754991173744202, + "objective": 0.5754991173744202, + "error": 0.3271484375, + "gradient_norm": 0.08167096972465515, + "elapsed": 501.630366563797 + }, + { + "step": 688, + "loss": 0.5685014724731445, + "objective": 0.5685014724731445, + "error": 0.333984375, + "gradient_norm": 0.043775107711553574, + "elapsed": 514.2880456447601 + }, + { + "step": 704, + "loss": 0.022465089336037636, + "objective": 0.022465089336037636, + "error": 0.0068359375, + "gradient_norm": 0.010172540321946144, + "elapsed": 522.9173214435577 + }, + { + "step": 720, + "loss": 0.035460107028484344, + "objective": 0.035460107028484344, + "error": 0.0107421875, + "gradient_norm": 0.010515578091144562, + "elapsed": 532.8470129966736 + }, + { + "step": 736, + "loss": 0.44765588641166687, + "objective": 0.44765588641166687, + "error": 0.2138671875, + "gradient_norm": 0.09050357341766357, + "elapsed": 541.9488840103149 + }, + { + "step": 752, + "loss": 0.5933939218521118, + "objective": 0.5933939218521118, + "error": 0.3359375, + "gradient_norm": 0.0665116235613823, + "elapsed": 552.9967355728149 + }, + { + "step": 768, + "loss": 0.6100764870643616, + "objective": 0.6100764870643616, + "error": 0.3515625, + "gradient_norm": 0.0821211114525795, + "elapsed": 563.7709202766418 + }, + { + "step": 784, + "loss": 0.02964692935347557, + "objective": 0.02964692935347557, + "error": 0.009765625, + "gradient_norm": 0.012663272209465504, + "elapsed": 573.1517221927643 + }, + { + "step": 800, + "loss": 0.38091832399368286, + "objective": 0.38091832399368286, + "error": 0.1904296875, + "gradient_norm": 0.060622021555900574, + "elapsed": 582.5687477588654 + }, + { + "step": 816, + "loss": 0.552335262298584, + "objective": 0.552335262298584, + "error": 0.3076171875, + "gradient_norm": 0.14419035613536835, + "elapsed": 594.4292685985565 + }, + { + "step": 832, + "loss": 0.5943340063095093, + "objective": 0.5943340063095093, + "error": 0.34375, + "gradient_norm": 0.0633513554930687, + "elapsed": 605.2052299976349 + }, + { + "step": 848, + "loss": 0.6074100732803345, + "objective": 0.6074100732803345, + "error": 0.3486328125, + "gradient_norm": 0.04225531220436096, + "elapsed": 614.8996202945709 + }, + { + "step": 864, + "loss": 0.6198879480361938, + "objective": 0.6198879480361938, + "error": 0.361328125, + "gradient_norm": 0.04208856821060181, + "elapsed": 625.4266908168793 + }, + { + "step": 880, + "loss": 0.6151762008666992, + "objective": 0.6151762008666992, + "error": 0.369140625, + "gradient_norm": 0.06261089444160461, + "elapsed": 636.0696911811829 + }, + { + "step": 896, + "loss": 0.49680083990097046, + "objective": 0.49680083990097046, + "error": 0.25390625, + "gradient_norm": 0.0827067643404007, + "elapsed": 644.6893246173859 + }, + { + "step": 912, + "loss": 0.4610927402973175, + "objective": 0.4610927402973175, + "error": 0.23828125, + "gradient_norm": 0.06652095168828964, + "elapsed": 655.969132900238 + }, + { + "step": 928, + "loss": 0.5218505859375, + "objective": 0.5218505859375, + "error": 0.2685546875, + "gradient_norm": 0.07188194245100021, + "elapsed": 667.5352523326874 + }, + { + "step": 944, + "loss": 0.33009427785873413, + "objective": 0.33009427785873413, + "error": 0.1533203125, + "gradient_norm": 0.05718810483813286, + "elapsed": 677.8397319316864 + }, + { + "step": 960, + "loss": 0.5703234672546387, + "objective": 0.5703234672546387, + "error": 0.3193359375, + "gradient_norm": 0.11168288439512253, + "elapsed": 687.8742904663086 + }, + { + "step": 976, + "loss": 0.025548014789819717, + "objective": 0.025548014789819717, + "error": 0.0107421875, + "gradient_norm": 0.009453393518924713, + "elapsed": 698.294285774231 + }, + { + "step": 992, + "loss": 0.45398157835006714, + "objective": 0.45398157835006714, + "error": 0.2412109375, + "gradient_norm": 0.04607952758669853, + "elapsed": 707.903199672699 + }, + { + "step": 1008, + "loss": 0.3412189781665802, + "objective": 0.3412189781665802, + "error": 0.1513671875, + "gradient_norm": 0.0432075597345829, + "elapsed": 718.5662748813629 + }, + { + "step": 1024, + "loss": 0.4376429319381714, + "objective": 0.4376429319381714, + "error": 0.2275390625, + "gradient_norm": 0.07974351197481155, + "elapsed": 728.8954858779907 + }, + { + "step": 1040, + "loss": 0.33512815833091736, + "objective": 0.33512815833091736, + "error": 0.150390625, + "gradient_norm": 0.04476875811815262, + "elapsed": 744.0822694301605 + }, + { + "step": 1056, + "loss": 0.5214208364486694, + "objective": 0.5214208364486694, + "error": 0.283203125, + "gradient_norm": 0.08898192644119263, + "elapsed": 755.1484262943268 + }, + { + "step": 1072, + "loss": 0.13849599659442902, + "objective": 0.13849599659442902, + "error": 0.052734375, + "gradient_norm": 0.028359953314065933, + "elapsed": 764.3303108215332 + }, + { + "step": 1088, + "loss": 0.323838472366333, + "objective": 0.323838472366333, + "error": 0.1435546875, + "gradient_norm": 0.04081716760993004, + "elapsed": 773.2739362716675 + }, + { + "step": 1104, + "loss": 0.5627881288528442, + "objective": 0.5627881288528442, + "error": 0.3125, + "gradient_norm": 0.08322097361087799, + "elapsed": 784.7223973274231 + }, + { + "step": 1120, + "loss": 0.44111010432243347, + "objective": 0.44111010432243347, + "error": 0.2216796875, + "gradient_norm": 0.05700977146625519, + "elapsed": 795.085648059845 + }, + { + "step": 1136, + "loss": 0.6395992040634155, + "objective": 0.6395992040634155, + "error": 0.39453125, + "gradient_norm": 0.0744553729891777, + "elapsed": 805.7942585945129 + }, + { + "step": 1152, + "loss": 0.5433304309844971, + "objective": 0.5433304309844971, + "error": 0.287109375, + "gradient_norm": 0.04814797267317772, + "elapsed": 817.3382890224457 + }, + { + "step": 1168, + "loss": 0.5708576440811157, + "objective": 0.5708576440811157, + "error": 0.3203125, + "gradient_norm": 0.051331400871276855, + "elapsed": 829.288791179657 + }, + { + "step": 1184, + "loss": 0.5447035431861877, + "objective": 0.5447035431861877, + "error": 0.2939453125, + "gradient_norm": 0.10116687417030334, + "elapsed": 839.6822843551636 + }, + { + "step": 1200, + "loss": 0.6125671863555908, + "objective": 0.6125671863555908, + "error": 0.3642578125, + "gradient_norm": 0.04368080571293831, + "elapsed": 850.2262740135193 + }, + { + "step": 1216, + "loss": 0.5002380609512329, + "objective": 0.5002380609512329, + "error": 0.259765625, + "gradient_norm": 0.04939017817378044, + "elapsed": 862.3783452510834 + }, + { + "step": 1232, + "loss": 0.5698772668838501, + "objective": 0.5698772668838501, + "error": 0.3173828125, + "gradient_norm": 0.04916854575276375, + "elapsed": 871.4622664451599 + }, + { + "step": 1248, + "loss": 0.6046518683433533, + "objective": 0.6046518683433533, + "error": 0.341796875, + "gradient_norm": 0.04919794574379921, + "elapsed": 883.3905737400055 + }, + { + "step": 1264, + "loss": 0.5913128852844238, + "objective": 0.5913128852844238, + "error": 0.357421875, + "gradient_norm": 0.046917904168367386, + "elapsed": 892.4264807701111 + }, + { + "step": 1280, + "loss": 0.5027461051940918, + "objective": 0.5027461051940918, + "error": 0.2626953125, + "gradient_norm": 0.04705750197172165, + "elapsed": 902.5875842571259 + }, + { + "step": 1296, + "loss": 0.13519814610481262, + "objective": 0.13519814610481262, + "error": 0.052734375, + "gradient_norm": 0.02625490538775921, + "elapsed": 912.4087471961975 + }, + { + "step": 1312, + "loss": 0.5862359404563904, + "objective": 0.5862359404563904, + "error": 0.3271484375, + "gradient_norm": 0.05441493168473244, + "elapsed": 923.992555141449 + }, + { + "step": 1328, + "loss": 0.6031408309936523, + "objective": 0.6031408309936523, + "error": 0.3505859375, + "gradient_norm": 0.05901554971933365, + "elapsed": 933.3936491012573 + }, + { + "step": 1344, + "loss": 0.5823733806610107, + "objective": 0.5823733806610107, + "error": 0.3310546875, + "gradient_norm": 0.0842989832162857, + "elapsed": 941.979998588562 + }, + { + "step": 1360, + "loss": 0.6241492033004761, + "objective": 0.6241492033004761, + "error": 0.3720703125, + "gradient_norm": 0.04446673393249512, + "elapsed": 954.969649553299 + }, + { + "step": 1376, + "loss": 0.5829156637191772, + "objective": 0.5829156637191772, + "error": 0.361328125, + "gradient_norm": 0.06615480780601501, + "elapsed": 966.0245676040649 + }, + { + "step": 1392, + "loss": 0.5968320369720459, + "objective": 0.5968320369720459, + "error": 0.34765625, + "gradient_norm": 0.05093541368842125, + "elapsed": 975.1022663116455 + }, + { + "step": 1408, + "loss": 0.045559000223875046, + "objective": 0.045559000223875046, + "error": 0.01171875, + "gradient_norm": 0.02514980360865593, + "elapsed": 987.2391452789307 + }, + { + "step": 1424, + "loss": 0.22601813077926636, + "objective": 0.22601813077926636, + "error": 0.09765625, + "gradient_norm": 0.04834206402301788, + "elapsed": 996.4583384990692 + }, + { + "step": 1440, + "loss": 0.23011144995689392, + "objective": 0.23011144995689392, + "error": 0.111328125, + "gradient_norm": 0.050687842071056366, + "elapsed": 1007.1440904140472 + }, + { + "step": 1456, + "loss": 0.018240466713905334, + "objective": 0.018240466713905334, + "error": 0.0078125, + "gradient_norm": 0.005604141391813755, + "elapsed": 1016.4502851963043 + }, + { + "step": 1472, + "loss": 0.4498720169067383, + "objective": 0.4498720169067383, + "error": 0.232421875, + "gradient_norm": 0.08179625123739243, + "elapsed": 1028.8303294181824 + }, + { + "step": 1488, + "loss": 0.24151627719402313, + "objective": 0.24151627719402313, + "error": 0.107421875, + "gradient_norm": 0.03838668763637543, + "elapsed": 1037.8867321014404 + }, + { + "step": 1504, + "loss": 0.46122002601623535, + "objective": 0.46122002601623535, + "error": 0.232421875, + "gradient_norm": 0.0726623386144638, + "elapsed": 1047.7258644104004 + }, + { + "step": 1520, + "loss": 0.5085602402687073, + "objective": 0.5085602402687073, + "error": 0.2705078125, + "gradient_norm": 0.06673175096511841, + "elapsed": 1059.352120399475 + }, + { + "step": 1536, + "loss": 0.6105246543884277, + "objective": 0.6105246543884277, + "error": 0.3818359375, + "gradient_norm": 0.04271261766552925, + "elapsed": 1070.1413230895996 + }, + { + "step": 1552, + "loss": 0.4792126417160034, + "objective": 0.4792126417160034, + "error": 0.2578125, + "gradient_norm": 0.05200039595365524, + "elapsed": 1086.444006204605 + }, + { + "step": 1568, + "loss": 0.5814266204833984, + "objective": 0.5814266204833984, + "error": 0.330078125, + "gradient_norm": 0.05867309868335724, + "elapsed": 1097.2902619838715 + }, + { + "step": 1584, + "loss": 0.6321226358413696, + "objective": 0.6321226358413696, + "error": 0.3798828125, + "gradient_norm": 0.05418067052960396, + "elapsed": 1107.9767682552338 + }, + { + "step": 1600, + "loss": 0.5931253433227539, + "objective": 0.5931253433227539, + "error": 0.3603515625, + "gradient_norm": 0.06396215409040451, + "elapsed": 1121.782609462738 + }, + { + "step": 1616, + "loss": 0.6411516666412354, + "objective": 0.6411516666412354, + "error": 0.38671875, + "gradient_norm": 0.05035768821835518, + "elapsed": 1132.7197887897491 + }, + { + "step": 1632, + "loss": 0.4267754852771759, + "objective": 0.4267754852771759, + "error": 0.2080078125, + "gradient_norm": 0.09109894186258316, + "elapsed": 1139.1667578220367 + }, + { + "step": 1648, + "loss": 0.21246182918548584, + "objective": 0.21246182918548584, + "error": 0.095703125, + "gradient_norm": 0.04478950425982475, + "elapsed": 1149.1183021068573 + }, + { + "step": 1664, + "loss": 0.46360665559768677, + "objective": 0.46360665559768677, + "error": 0.251953125, + "gradient_norm": 0.07668188214302063, + "elapsed": 1161.1197745800018 + }, + { + "step": 1680, + "loss": 0.46281397342681885, + "objective": 0.46281397342681885, + "error": 0.236328125, + "gradient_norm": 0.07954126596450806, + "elapsed": 1171.8474535942078 + }, + { + "step": 1696, + "loss": 0.2484058141708374, + "objective": 0.2484058141708374, + "error": 0.12109375, + "gradient_norm": 0.047261305153369904, + "elapsed": 1185.6542596817017 + }, + { + "step": 1712, + "loss": 0.24310235679149628, + "objective": 0.24310235679149628, + "error": 0.1064453125, + "gradient_norm": 0.07262872904539108, + "elapsed": 1197.8986082077026 + }, + { + "step": 1728, + "loss": 0.009729458019137383, + "objective": 0.009729458019137383, + "error": 0.001953125, + "gradient_norm": 0.01146845705807209, + "elapsed": 1208.495581150055 + }, + { + "step": 1744, + "loss": 0.24568752944469452, + "objective": 0.24568752944469452, + "error": 0.10546875, + "gradient_norm": 0.05830742046236992, + "elapsed": 1219.9394850730896 + }, + { + "step": 1760, + "loss": 0.022546378895640373, + "objective": 0.022546378895640373, + "error": 0.0068359375, + "gradient_norm": 0.007667526602745056, + "elapsed": 1229.5703229904175 + }, + { + "step": 1776, + "loss": 0.5848401784896851, + "objective": 0.5848401784896851, + "error": 0.3271484375, + "gradient_norm": 0.061901818960905075, + "elapsed": 1238.750280380249 + }, + { + "step": 1792, + "loss": 0.6031335592269897, + "objective": 0.6031335592269897, + "error": 0.3671875, + "gradient_norm": 0.0676632970571518, + "elapsed": 1247.7468683719635 + }, + { + "step": 1808, + "loss": 0.6210961937904358, + "objective": 0.6210961937904358, + "error": 0.3603515625, + "gradient_norm": 0.0718468651175499, + "elapsed": 1256.1821897029877 + }, + { + "step": 1824, + "loss": 0.570877730846405, + "objective": 0.570877730846405, + "error": 0.3212890625, + "gradient_norm": 0.05575930327177048, + "elapsed": 1266.4091975688934 + }, + { + "step": 1840, + "loss": 0.5711429119110107, + "objective": 0.5711429119110107, + "error": 0.31640625, + "gradient_norm": 0.0691002607345581, + "elapsed": 1277.4722146987915 + }, + { + "step": 1856, + "loss": 0.36046335101127625, + "objective": 0.36046335101127625, + "error": 0.16796875, + "gradient_norm": 0.04694395884871483, + "elapsed": 1287.1420249938965 + }, + { + "step": 1872, + "loss": 0.4688999652862549, + "objective": 0.4688999652862549, + "error": 0.2216796875, + "gradient_norm": 0.07401346415281296, + "elapsed": 1297.3945078849792 + }, + { + "step": 1888, + "loss": 0.46385282278060913, + "objective": 0.46385282278060913, + "error": 0.2373046875, + "gradient_norm": 0.05608939751982689, + "elapsed": 1305.9779334068298 + }, + { + "step": 1904, + "loss": 0.60875403881073, + "objective": 0.60875403881073, + "error": 0.365234375, + "gradient_norm": 0.05085878074169159, + "elapsed": 1317.3097081184387 + }, + { + "step": 1920, + "loss": 0.12223530560731888, + "objective": 0.12223530560731888, + "error": 0.0458984375, + "gradient_norm": 0.024870412424206734, + "elapsed": 1328.6486887931824 + }, + { + "step": 1936, + "loss": 0.3486189544200897, + "objective": 0.3486189544200897, + "error": 0.16796875, + "gradient_norm": 0.04780663549900055, + "elapsed": 1336.6701011657715 + }, + { + "step": 1952, + "loss": 0.5777363777160645, + "objective": 0.5777363777160645, + "error": 0.3427734375, + "gradient_norm": 0.0571451336145401, + "elapsed": 1346.9158833026886 + }, + { + "step": 1968, + "loss": 0.39320266246795654, + "objective": 0.39320266246795654, + "error": 0.1884765625, + "gradient_norm": 0.05673858895897865, + "elapsed": 1354.9182631969452 + }, + { + "step": 1984, + "loss": 0.5900611281394958, + "objective": 0.5900611281394958, + "error": 0.3349609375, + "gradient_norm": 0.06593932211399078, + "elapsed": 1364.2754452228546 + }, + { + "step": 2000, + "loss": 0.6212430000305176, + "objective": 0.6212430000305176, + "error": 0.3857421875, + "gradient_norm": 0.040818918496370316, + "elapsed": 1374.7192046642303 + }, + { + "step": 2016, + "loss": 0.15605247020721436, + "objective": 0.15605247020721436, + "error": 0.0556640625, + "gradient_norm": 0.03108786791563034, + "elapsed": 1386.2740807533264 + }, + { + "step": 2032, + "loss": 0.22049596905708313, + "objective": 0.22049596905708313, + "error": 0.1015625, + "gradient_norm": 0.042733557522296906, + "elapsed": 1396.6422457695007 + }, + { + "step": 2048, + "loss": 0.5642613172531128, + "objective": 0.5642613172531128, + "error": 0.306640625, + "gradient_norm": 0.07527482509613037, + "elapsed": 1407.6688070297241 + } + ] + }, + "training_source_snapshot": "training_sources/full3_1", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2338341346153846, + "512": 0.2336688701923077, + "blend-512": 0.23399939903846154, + "1024": 0.23329326923076923, + "blend-1024": 0.23342848557692306, + "1536": 0.2330679086538462, + "blend-1536": 0.23291766826923077, + "2048": 0.2335186298076923, + "blend-2048": 0.23290264423076928 + }, + "selected": "blend-2048" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22182992788461542, + "512": 0.22143930288461539, + "blend-512": 0.22125901442307694, + "1024": 0.22104867788461538, + "blend-1024": 0.22079326923076922, + "1536": 0.22017728365384615, + "blend-1536": 0.22095853365384618, + "2048": 0.22076322115384617, + "blend-2048": 0.22025240384615385 + }, + "selected": "1536" + } + ], + "checkpoints": { + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit logical tracking in intermediate passes when intermediate probabilities are unused.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false, + "numerical_controls": { + "gpu_gradient_control.json": { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "data": "First1024 rows of the authorized4096 training sample; no validation labels", + "weights": "Random scratch parameters, seed20261112; gradients only, no parameter update", + "block_size": 32, + "records": [ + { + "batch": 256, + "seconds_per_gradient": 0.38611968358357746, + "shots_per_second": 663.0068625977924, + "memory_stats": { + "num_allocs": 694, + "bytes_in_use": 306432, + "peak_bytes_in_use": 3054084608, + "largest_alloc_size": 3047267584, + "bytes_limit": 76526240993, + "bytes_reserved": 0, + "peak_bytes_reserved": 0, + "largest_free_block_bytes": 0, + "pool_bytes": 76526240768, + "peak_pool_bytes": 76526240768 + } + }, + { + "batch": 512, + "seconds_per_gradient": 0.6622018814086914, + "shots_per_second": 773.178111350017, + "memory_stats": { + "num_allocs": 1332, + "bytes_in_use": 308480, + "peak_bytes_in_use": 6079704832, + "largest_alloc_size": 6069432576, + "bytes_limit": 76526240993, + "bytes_reserved": 0, + "peak_bytes_reserved": 0, + "largest_free_block_bytes": 0, + "pool_bytes": 76526240768, + "peak_pool_bytes": 76526240768 + } + }, + { + "batch": 1024, + "seconds_per_gradient": 1.117707888285319, + "shots_per_second": 916.1606630252231, + "memory_stats": { + "num_allocs": 1970, + "bytes_in_use": 312576, + "peak_bytes_in_use": 12138994176, + "largest_alloc_size": 12122019840, + "bytes_limit": 76526240993, + "bytes_reserved": 0, + "peak_bytes_reserved": 0, + "largest_free_block_bytes": 0, + "pool_bytes": 76526240768, + "peak_pool_bytes": 76526240768 + } + } + ], + "original_gradient_gpu_control": { + "loss_max_difference": 1.6689300537109375e-06, + "prediction_max_difference": 1.0132789611816406e-06, + "neural_gradient_relative_difference": 5.505155786522664e-05, + "float64_precision_audit": "/run-state/workspace/research/learned_d5/full3_1/gpu_gradient_precision.json", + "tolerance_rationale": "Original3e-5 GPU gradient threshold failed at5.51e-5. Independent float64 audits of both float32 algorithms across six X/Z durations found comparable relative rounding errors up to5.72e-5, with probability errors below6.2e-7. Use1e-4 relative for this accumulated derivative." + } + }, + "gpu_gradient_precision.json": { + "data": "First16 supplied training rows per listed condition; no parameter updates", + "weights": "full3_1/weights-1536.npz", + "reference": "Original unblocked algorithm in float64, fixed float32 neural edge probabilities", + "source_sha256": { + "gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8" + }, + "initial_gpu_control_failure": { + "relative_neural_gradient_difference": 5.505155786522664e-05, + "original_tolerance": 3e-05, + "maximum_loss_difference": 1.6689300537109375e-06, + "maximum_prediction_difference": 1.0132789611816406e-06 + }, + "records": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.30205945019442737, + "unblocked_float32": { + "maximum_loss_error": 2.966804864001915e-07, + "maximum_probability_error": 9.592670685565352e-08, + "neural_gradient_maximum_absolute_error": 1.6391277313232422e-07, + "neural_gradient_relative_error": 3.6604459916077934e-06, + "neural_gradient_cosine": 0.9999999999933656 + }, + "blocked_float32": { + "maximum_loss_error": 1.7747119684941026e-07, + "maximum_probability_error": 8.879568846875685e-08, + "neural_gradient_maximum_absolute_error": 1.7881393432617188e-07, + "neural_gradient_relative_error": 4.366049097416422e-06, + "neural_gradient_cosine": 0.9999999999904692 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.22069588396473294, + "unblocked_float32": { + "maximum_loss_error": 5.498523059088711e-07, + "maximum_probability_error": 9.703680636796719e-08, + "neural_gradient_maximum_absolute_error": 6.686605047434568e-08, + "neural_gradient_relative_error": 2.392500410145668e-06, + "neural_gradient_cosine": 0.999999999997144 + }, + "blocked_float32": { + "maximum_loss_error": 8.745212829311194e-08, + "maximum_probability_error": 6.418482079162402e-08, + "neural_gradient_maximum_absolute_error": 6.705522537231445e-08, + "neural_gradient_relative_error": 1.7739189351699108e-06, + "neural_gradient_cosine": 0.9999999999984265 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.4664494516878606, + "unblocked_float32": { + "maximum_loss_error": 3.922858555771569e-07, + "maximum_probability_error": 2.581999101192167e-07, + "neural_gradient_maximum_absolute_error": 1.7015263438224792e-06, + "neural_gradient_relative_error": 2.234804892316077e-05, + "neural_gradient_cosine": 0.9999999997509151 + }, + "blocked_float32": { + "maximum_loss_error": 3.3479861938356947e-07, + "maximum_probability_error": 1.4954284288659636e-07, + "neural_gradient_maximum_absolute_error": 1.6633421182632446e-06, + "neural_gradient_relative_error": 2.4167285966292737e-05, + "neural_gradient_cosine": 0.9999999997089409 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.438354906018253, + "unblocked_float32": { + "maximum_loss_error": 6.361644384611509e-07, + "maximum_probability_error": 3.6173952677742705e-07, + "neural_gradient_maximum_absolute_error": 1.9436702132225037e-06, + "neural_gradient_relative_error": 5.252014500992631e-05, + "neural_gradient_cosine": 0.9999999986254251 + }, + "blocked_float32": { + "maximum_loss_error": 5.060161181180689e-07, + "maximum_probability_error": 2.589724067414423e-07, + "neural_gradient_maximum_absolute_error": 1.946929842233658e-06, + "neural_gradient_relative_error": 5.71756656511251e-05, + "neural_gradient_cosine": 0.999999998372327 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.3057787329709659, + "unblocked_float32": { + "maximum_loss_error": 6.74491174690317e-07, + "maximum_probability_error": 4.3885854938974234e-07, + "neural_gradient_maximum_absolute_error": 8.174683898687363e-07, + "neural_gradient_relative_error": 4.090547224844183e-05, + "neural_gradient_cosine": 0.9999999991633716 + }, + "blocked_float32": { + "maximum_loss_error": 6.643292806973733e-07, + "maximum_probability_error": 4.835620329712853e-07, + "neural_gradient_maximum_absolute_error": 1.1210795491933823e-06, + "neural_gradient_relative_error": 5.584921905818847e-05, + "neural_gradient_cosine": 0.9999999984491473 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.2501411033127809, + "unblocked_float32": { + "maximum_loss_error": 1.167099820564843e-06, + "maximum_probability_error": 4.921027032533942e-07, + "neural_gradient_maximum_absolute_error": 7.14324414730072e-07, + "neural_gradient_relative_error": 4.528117886548381e-05, + "neural_gradient_cosine": 0.9999999989770499 + }, + "blocked_float32": { + "maximum_loss_error": 1.4055183996664056e-06, + "maximum_probability_error": 6.113119928041755e-07, + "neural_gradient_maximum_absolute_error": 7.075723260641098e-07, + "neural_gradient_relative_error": 5.112087336342683e-05, + "neural_gradient_cosine": 0.9999999986947755 + } + } + ], + "status": "passed" + } + } + }, + { + "training": { + "initialization": "Uniform parameter averages of checkpoints from the same session-initialized training trajectory; no external weights", + "prior_pass": 3, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "hidden_width": 64, + "training": "No new optimizer updates; all learning comes from the recorded source trajectory and its session-trained parent", + "optimizer_updates_in_derived_run": 0, + "source_training_provenance": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "training_source_sha256": { + "learned_d5__train.py": "b73af9da21332dee9a43f653b514695b020fbc3516604b2e721d8cf0ea876d53", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "5e9420df1f6dd56518925e910096fb9bc93bd796a5933b13bf894a1a96256cdf", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "All supplied training shots per each of all26 d5 conditions; uniform condition and within-condition sampling for optimizer batches.", + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 516880, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 507282, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 19592, + "surface_code_bX_d5_r03_center_5_5": 19646, + "surface_code_bX_d5_r05_center_5_5": 19513, + "surface_code_bX_d5_r07_center_5_5": 19341, + "surface_code_bX_d5_r09_center_5_5": 19211, + "surface_code_bX_d5_r11_center_5_5": 19239, + "surface_code_bX_d5_r13_center_5_5": 19679, + "surface_code_bX_d5_r15_center_5_5": 19455, + "surface_code_bX_d5_r17_center_5_5": 19479, + "surface_code_bX_d5_r19_center_5_5": 19479, + "surface_code_bX_d5_r21_center_5_5": 19551, + "surface_code_bX_d5_r23_center_5_5": 19586, + "surface_code_bX_d5_r25_center_5_5": 19526, + "surface_code_bZ_d5_r01_center_5_5": 19652, + "surface_code_bZ_d5_r03_center_5_5": 19732, + "surface_code_bZ_d5_r05_center_5_5": 19754, + "surface_code_bZ_d5_r07_center_5_5": 19194, + "surface_code_bZ_d5_r09_center_5_5": 19641, + "surface_code_bZ_d5_r11_center_5_5": 19611, + "surface_code_bZ_d5_r13_center_5_5": 19424, + "surface_code_bZ_d5_r15_center_5_5": 19380, + "surface_code_bZ_d5_r17_center_5_5": 19384, + "surface_code_bZ_d5_r19_center_5_5": 19684, + "surface_code_bZ_d5_r21_center_5_5": 19559, + "surface_code_bZ_d5_r23_center_5_5": 19524, + "surface_code_bZ_d5_r25_center_5_5": 19446 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 2048, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261113, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_d5/feedback3_pilot/rng-768.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/feedback3_pilot/weights-768.npz", + "starting_checkpoint_sha256": "bc2ba1c529317ce1b5b661efae4707eca49c6995d6f22b04193fe7642662fed8", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "4096 training shots per each of all 26 d5 conditions, sampled without replacement with seed 20261023. Uniform condition and within-condition sampling for optimizer batches.", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1024, + "batch": 256, + "learning_rate": 0.001, + "sampling_seed": 20261108, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "starting_checkpoint": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.011146659031510353, + "error": 0.00390625, + "gradient_norm": 0.011240893043577671, + "elapsed": 21.276997089385986 + }, + { + "step": 16, + "loss": 0.645737886428833, + "error": 0.40625, + "gradient_norm": 0.1628236621618271, + "elapsed": 25.872907638549805 + }, + { + "step": 32, + "loss": 0.574029803276062, + "error": 0.35546875, + "gradient_norm": 0.3000081777572632, + "elapsed": 30.761418342590332 + }, + { + "step": 48, + "loss": 0.574467122554779, + "error": 0.296875, + "gradient_norm": 0.24150623381137848, + "elapsed": 35.67650651931763 + }, + { + "step": 64, + "loss": 0.6003620624542236, + "error": 0.35546875, + "gradient_norm": 0.07430054992437363, + "elapsed": 40.60572576522827 + }, + { + "step": 80, + "loss": 0.5429091453552246, + "error": 0.33203125, + "gradient_norm": 0.15341751277446747, + "elapsed": 45.546849727630615 + }, + { + "step": 96, + "loss": 0.368771493434906, + "error": 0.1640625, + "gradient_norm": 0.08923184871673584, + "elapsed": 50.49156332015991 + }, + { + "step": 112, + "loss": 0.516342043876648, + "error": 0.265625, + "gradient_norm": 0.10965219140052795, + "elapsed": 55.45058846473694 + }, + { + "step": 128, + "loss": 0.5925382971763611, + "error": 0.37109375, + "gradient_norm": 0.055406324565410614, + "elapsed": 60.40891766548157 + }, + { + "step": 144, + "loss": 0.19184258580207825, + "error": 0.07421875, + "gradient_norm": 0.07042146474123001, + "elapsed": 65.33323669433594 + }, + { + "step": 160, + "loss": 0.5202382206916809, + "error": 0.25390625, + "gradient_norm": 0.14782382547855377, + "elapsed": 70.26605796813965 + }, + { + "step": 176, + "loss": 0.46083134412765503, + "error": 0.22265625, + "gradient_norm": 0.09074779599905014, + "elapsed": 75.18221640586853 + }, + { + "step": 192, + "loss": 0.3054918646812439, + "error": 0.14453125, + "gradient_norm": 0.0588168129324913, + "elapsed": 80.1186010837555 + }, + { + "step": 208, + "loss": 0.4836011230945587, + "error": 0.27734375, + "gradient_norm": 0.09208947420120239, + "elapsed": 85.05764293670654 + }, + { + "step": 224, + "loss": 0.6640600562095642, + "error": 0.38671875, + "gradient_norm": 0.22026506066322327, + "elapsed": 89.98808217048645 + }, + { + "step": 240, + "loss": 0.02421322464942932, + "error": 0.00390625, + "gradient_norm": 0.008131005801260471, + "elapsed": 94.90194272994995 + }, + { + "step": 256, + "loss": 0.6302106976509094, + "error": 0.4296875, + "gradient_norm": 0.09762304276227951, + "elapsed": 99.82612204551697 + }, + { + "step": 272, + "loss": 0.5092596411705017, + "error": 0.27734375, + "gradient_norm": 0.11407691985368729, + "elapsed": 110.44065999984741 + }, + { + "step": 288, + "loss": 0.452798455953598, + "error": 0.2265625, + "gradient_norm": 0.1105576679110527, + "elapsed": 115.36984539031982 + }, + { + "step": 304, + "loss": 0.3378596305847168, + "error": 0.18359375, + "gradient_norm": 0.0841713547706604, + "elapsed": 120.29337763786316 + }, + { + "step": 320, + "loss": 0.6271854639053345, + "error": 0.38671875, + "gradient_norm": 0.1972702294588089, + "elapsed": 125.2231035232544 + }, + { + "step": 336, + "loss": 0.04562236741185188, + "error": 0.01171875, + "gradient_norm": 0.027922745794057846, + "elapsed": 130.14725255966187 + }, + { + "step": 352, + "loss": 0.5342530608177185, + "error": 0.26953125, + "gradient_norm": 0.09031179547309875, + "elapsed": 135.08111095428467 + }, + { + "step": 368, + "loss": 0.49785488843917847, + "error": 0.2578125, + "gradient_norm": 0.19366280734539032, + "elapsed": 140.00699138641357 + }, + { + "step": 384, + "loss": 0.5673326253890991, + "error": 0.30859375, + "gradient_norm": 0.20644932985305786, + "elapsed": 144.92276740074158 + }, + { + "step": 400, + "loss": 0.5581298470497131, + "error": 0.3203125, + "gradient_norm": 0.17668266594409943, + "elapsed": 149.86573243141174 + }, + { + "step": 416, + "loss": 0.5564071536064148, + "error": 0.30078125, + "gradient_norm": 0.0821610689163208, + "elapsed": 154.7953712940216 + }, + { + "step": 432, + "loss": 0.5540086030960083, + "error": 0.34765625, + "gradient_norm": 0.1438807100057602, + "elapsed": 159.72657418251038 + }, + { + "step": 448, + "loss": 0.540939450263977, + "error": 0.29296875, + "gradient_norm": 0.17986361682415009, + "elapsed": 164.6689453125 + }, + { + "step": 464, + "loss": 0.45807865262031555, + "error": 0.25, + "gradient_norm": 0.14453186094760895, + "elapsed": 169.58739304542542 + }, + { + "step": 480, + "loss": 0.5191650390625, + "error": 0.22265625, + "gradient_norm": 0.07955105602741241, + "elapsed": 174.5444438457489 + }, + { + "step": 496, + "loss": 0.1692925989627838, + "error": 0.0703125, + "gradient_norm": 0.07875128090381622, + "elapsed": 179.48035550117493 + }, + { + "step": 512, + "loss": 0.5580664873123169, + "error": 0.3125, + "gradient_norm": 0.27090802788734436, + "elapsed": 184.42834162712097 + }, + { + "step": 528, + "loss": 0.26402050256729126, + "error": 0.13671875, + "gradient_norm": 0.13135771453380585, + "elapsed": 195.17691040039062 + }, + { + "step": 544, + "loss": 0.4352915287017822, + "error": 0.1953125, + "gradient_norm": 0.15959712862968445, + "elapsed": 200.0421543121338 + }, + { + "step": 560, + "loss": 0.22861814498901367, + "error": 0.1015625, + "gradient_norm": 0.08776932209730148, + "elapsed": 204.95144605636597 + }, + { + "step": 576, + "loss": 0.28309381008148193, + "error": 0.1328125, + "gradient_norm": 0.11050742119550705, + "elapsed": 209.8526291847229 + }, + { + "step": 592, + "loss": 0.6409220695495605, + "error": 0.41015625, + "gradient_norm": 0.19826626777648926, + "elapsed": 214.84447717666626 + }, + { + "step": 608, + "loss": 0.25090643763542175, + "error": 0.109375, + "gradient_norm": 0.05864342302083969, + "elapsed": 219.72637391090393 + }, + { + "step": 624, + "loss": 0.11423969268798828, + "error": 0.05078125, + "gradient_norm": 0.05318564549088478, + "elapsed": 224.6331377029419 + }, + { + "step": 640, + "loss": 0.32663431763648987, + "error": 0.1328125, + "gradient_norm": 0.06877780705690384, + "elapsed": 229.5065622329712 + }, + { + "step": 656, + "loss": 0.24196995794773102, + "error": 0.10546875, + "gradient_norm": 0.07683655619621277, + "elapsed": 234.4042534828186 + }, + { + "step": 672, + "loss": 0.5349344611167908, + "error": 0.296875, + "gradient_norm": 0.15214307606220245, + "elapsed": 239.26656579971313 + }, + { + "step": 688, + "loss": 0.26759713888168335, + "error": 0.1171875, + "gradient_norm": 0.14698348939418793, + "elapsed": 244.21049737930298 + }, + { + "step": 704, + "loss": 0.37338894605636597, + "error": 0.18359375, + "gradient_norm": 0.10210632532835007, + "elapsed": 249.13519072532654 + }, + { + "step": 720, + "loss": 0.36807945370674133, + "error": 0.17578125, + "gradient_norm": 0.09668388962745667, + "elapsed": 254.06281065940857 + }, + { + "step": 736, + "loss": 0.3736685514450073, + "error": 0.15625, + "gradient_norm": 0.10987236350774765, + "elapsed": 259.01695108413696 + }, + { + "step": 752, + "loss": 0.5266942977905273, + "error": 0.29296875, + "gradient_norm": 0.09041415899991989, + "elapsed": 263.9530746936798 + }, + { + "step": 768, + "loss": 0.360038161277771, + "error": 0.1640625, + "gradient_norm": 0.10391079634428024, + "elapsed": 268.9019305706024 + }, + { + "step": 784, + "loss": 0.5700286626815796, + "error": 0.34375, + "gradient_norm": 0.12206032127141953, + "elapsed": 279.4174163341522 + }, + { + "step": 800, + "loss": 0.42533689737319946, + "error": 0.20703125, + "gradient_norm": 0.06605375558137894, + "elapsed": 284.3391351699829 + }, + { + "step": 816, + "loss": 0.12355346977710724, + "error": 0.046875, + "gradient_norm": 0.06571663916110992, + "elapsed": 289.2815272808075 + }, + { + "step": 832, + "loss": 0.6411258578300476, + "error": 0.3984375, + "gradient_norm": 0.160088911652565, + "elapsed": 294.2048614025116 + }, + { + "step": 848, + "loss": 0.5756919980049133, + "error": 0.3515625, + "gradient_norm": 0.0962308868765831, + "elapsed": 299.15635418891907 + }, + { + "step": 864, + "loss": 0.2706402540206909, + "error": 0.1171875, + "gradient_norm": 0.11391306668519974, + "elapsed": 304.09321761131287 + }, + { + "step": 880, + "loss": 0.33621329069137573, + "error": 0.1640625, + "gradient_norm": 0.09049320220947266, + "elapsed": 309.0412187576294 + }, + { + "step": 896, + "loss": 0.44343245029449463, + "error": 0.23828125, + "gradient_norm": 0.12484703958034515, + "elapsed": 313.98498797416687 + }, + { + "step": 912, + "loss": 0.5987736582756042, + "error": 0.359375, + "gradient_norm": 0.07541236281394958, + "elapsed": 318.9334623813629 + }, + { + "step": 928, + "loss": 0.38585522770881653, + "error": 0.1875, + "gradient_norm": 0.09290861338376999, + "elapsed": 323.86884689331055 + }, + { + "step": 944, + "loss": 0.4820440113544464, + "error": 0.234375, + "gradient_norm": 0.22198310494422913, + "elapsed": 328.7963180541992 + }, + { + "step": 960, + "loss": 0.07455944269895554, + "error": 0.015625, + "gradient_norm": 0.055282026529312134, + "elapsed": 333.75238251686096 + }, + { + "step": 976, + "loss": 0.013475366868078709, + "error": 0.0078125, + "gradient_norm": 0.009843004867434502, + "elapsed": 338.6403331756592 + }, + { + "step": 992, + "loss": 0.4429199695587158, + "error": 0.2265625, + "gradient_norm": 0.09489083290100098, + "elapsed": 343.5606532096863 + }, + { + "step": 1008, + "loss": 0.4892328381538391, + "error": 0.234375, + "gradient_norm": 0.1342826634645462, + "elapsed": 348.5243353843689 + }, + { + "step": 1024, + "loss": 0.6096819043159485, + "error": 0.32421875, + "gradient_norm": 0.17938998341560364, + "elapsed": 353.36506962776184 + } + ] + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.4341062307357788, + "objective": 0.4341062307357788, + "error": 0.208984375, + "gradient_norm": 0.07617632299661636, + "elapsed": 31.45817995071411 + }, + { + "step": 16, + "loss": 0.5996706485748291, + "objective": 0.5996706485748291, + "error": 0.359375, + "gradient_norm": 0.05249844491481781, + "elapsed": 56.34200572967529 + }, + { + "step": 32, + "loss": 0.4388691186904907, + "objective": 0.4388691186904907, + "error": 0.2041015625, + "gradient_norm": 0.0376109778881073, + "elapsed": 67.83739852905273 + }, + { + "step": 48, + "loss": 0.5373439788818359, + "objective": 0.5373439788818359, + "error": 0.2919921875, + "gradient_norm": 0.06261218339204788, + "elapsed": 76.69065475463867 + }, + { + "step": 64, + "loss": 0.24871854484081268, + "objective": 0.24871854484081268, + "error": 0.1162109375, + "gradient_norm": 0.05284671485424042, + "elapsed": 86.3852767944336 + }, + { + "step": 80, + "loss": 0.26628297567367554, + "objective": 0.26628297567367554, + "error": 0.123046875, + "gradient_norm": 0.04054367542266846, + "elapsed": 95.77356100082397 + }, + { + "step": 96, + "loss": 0.48436349630355835, + "objective": 0.48436349630355835, + "error": 0.259765625, + "gradient_norm": 0.05399860441684723, + "elapsed": 107.06293416023254 + }, + { + "step": 112, + "loss": 0.41063767671585083, + "objective": 0.41063767671585083, + "error": 0.1943359375, + "gradient_norm": 0.043602071702480316, + "elapsed": 116.78119611740112 + }, + { + "step": 128, + "loss": 0.3990316390991211, + "objective": 0.3990316390991211, + "error": 0.1865234375, + "gradient_norm": 0.0424419641494751, + "elapsed": 125.6915397644043 + }, + { + "step": 144, + "loss": 0.5119550228118896, + "objective": 0.5119550228118896, + "error": 0.2646484375, + "gradient_norm": 0.07688591629266739, + "elapsed": 136.20711088180542 + }, + { + "step": 160, + "loss": 0.3388235569000244, + "objective": 0.3388235569000244, + "error": 0.1630859375, + "gradient_norm": 0.07015731930732727, + "elapsed": 145.3505516052246 + }, + { + "step": 176, + "loss": 0.5952156186103821, + "objective": 0.5952156186103821, + "error": 0.3369140625, + "gradient_norm": 0.039373140782117844, + "elapsed": 154.77994871139526 + }, + { + "step": 192, + "loss": 0.15157413482666016, + "objective": 0.15157413482666016, + "error": 0.0634765625, + "gradient_norm": 0.029710670933127403, + "elapsed": 164.46801733970642 + }, + { + "step": 208, + "loss": 0.3120684027671814, + "objective": 0.3120684027671814, + "error": 0.1474609375, + "gradient_norm": 0.035548821091651917, + "elapsed": 173.24825358390808 + }, + { + "step": 224, + "loss": 0.5486405491828918, + "objective": 0.5486405491828918, + "error": 0.2900390625, + "gradient_norm": 0.0503678023815155, + "elapsed": 185.29849314689636 + }, + { + "step": 240, + "loss": 0.6046283841133118, + "objective": 0.6046283841133118, + "error": 0.3349609375, + "gradient_norm": 0.05043461173772812, + "elapsed": 197.54880928993225 + }, + { + "step": 256, + "loss": 0.5926339626312256, + "objective": 0.5926339626312256, + "error": 0.3359375, + "gradient_norm": 0.051241543143987656, + "elapsed": 211.79861068725586 + }, + { + "step": 272, + "loss": 0.4018518924713135, + "objective": 0.4018518924713135, + "error": 0.1943359375, + "gradient_norm": 0.0772147998213768, + "elapsed": 222.41974115371704 + }, + { + "step": 288, + "loss": 0.13863243162631989, + "objective": 0.13863243162631989, + "error": 0.0556640625, + "gradient_norm": 0.03334609419107437, + "elapsed": 234.04247426986694 + }, + { + "step": 304, + "loss": 0.562490701675415, + "objective": 0.562490701675415, + "error": 0.337890625, + "gradient_norm": 0.04585934057831764, + "elapsed": 242.65421533584595 + }, + { + "step": 320, + "loss": 0.5352796316146851, + "objective": 0.5352796316146851, + "error": 0.294921875, + "gradient_norm": 0.0837635025382042, + "elapsed": 252.10656356811523 + }, + { + "step": 336, + "loss": 0.26082637906074524, + "objective": 0.26082637906074524, + "error": 0.1220703125, + "gradient_norm": 0.048336997628211975, + "elapsed": 262.33449625968933 + }, + { + "step": 352, + "loss": 0.5959363579750061, + "objective": 0.5959363579750061, + "error": 0.3388671875, + "gradient_norm": 0.06797357648611069, + "elapsed": 271.9942307472229 + }, + { + "step": 368, + "loss": 0.48994284868240356, + "objective": 0.48994284868240356, + "error": 0.2587890625, + "gradient_norm": 0.06296153366565704, + "elapsed": 283.0493588447571 + }, + { + "step": 384, + "loss": 0.5710494518280029, + "objective": 0.5710494518280029, + "error": 0.3134765625, + "gradient_norm": 0.045333269983530045, + "elapsed": 294.64637446403503 + }, + { + "step": 400, + "loss": 0.5957783460617065, + "objective": 0.5957783460617065, + "error": 0.349609375, + "gradient_norm": 0.03918786719441414, + "elapsed": 307.6200888156891 + }, + { + "step": 416, + "loss": 0.27521568536758423, + "objective": 0.27521568536758423, + "error": 0.1220703125, + "gradient_norm": 0.038001637905836105, + "elapsed": 317.01610231399536 + }, + { + "step": 432, + "loss": 0.02379823848605156, + "objective": 0.02379823848605156, + "error": 0.0078125, + "gradient_norm": 0.007661945186555386, + "elapsed": 326.9360330104828 + }, + { + "step": 448, + "loss": 0.56734299659729, + "objective": 0.56734299659729, + "error": 0.3271484375, + "gradient_norm": 0.057416290044784546, + "elapsed": 339.6289041042328 + }, + { + "step": 464, + "loss": 0.10715995728969574, + "objective": 0.10715995728969574, + "error": 0.0380859375, + "gradient_norm": 0.02532491274178028, + "elapsed": 349.8584108352661 + }, + { + "step": 480, + "loss": 0.6143364310264587, + "objective": 0.6143364310264587, + "error": 0.36328125, + "gradient_norm": 0.08023032546043396, + "elapsed": 360.36362075805664 + }, + { + "step": 496, + "loss": 0.44069671630859375, + "objective": 0.44069671630859375, + "error": 0.2197265625, + "gradient_norm": 0.048025116324424744, + "elapsed": 369.48225808143616 + }, + { + "step": 512, + "loss": 0.019900165498256683, + "objective": 0.019900165498256683, + "error": 0.0107421875, + "gradient_norm": 0.0038635791279375553, + "elapsed": 378.59970593452454 + }, + { + "step": 528, + "loss": 0.033316534012556076, + "objective": 0.033316534012556076, + "error": 0.009765625, + "gradient_norm": 0.009174940176308155, + "elapsed": 393.4021761417389 + }, + { + "step": 544, + "loss": 0.41130945086479187, + "objective": 0.41130945086479187, + "error": 0.20703125, + "gradient_norm": 0.04695262759923935, + "elapsed": 402.8586280345917 + }, + { + "step": 560, + "loss": 0.5885373950004578, + "objective": 0.5885373950004578, + "error": 0.3544921875, + "gradient_norm": 0.08534500002861023, + "elapsed": 416.98661041259766 + }, + { + "step": 576, + "loss": 0.3804720640182495, + "objective": 0.3804720640182495, + "error": 0.19140625, + "gradient_norm": 0.05163278803229332, + "elapsed": 427.7550480365753 + }, + { + "step": 592, + "loss": 0.6101120710372925, + "objective": 0.6101120710372925, + "error": 0.3525390625, + "gradient_norm": 0.05593184754252434, + "elapsed": 441.05026268959045 + }, + { + "step": 608, + "loss": 0.5586092472076416, + "objective": 0.5586092472076416, + "error": 0.302734375, + "gradient_norm": 0.07458740472793579, + "elapsed": 452.95383286476135 + }, + { + "step": 624, + "loss": 0.5992780923843384, + "objective": 0.5992780923843384, + "error": 0.357421875, + "gradient_norm": 0.03618372976779938, + "elapsed": 466.1582691669464 + }, + { + "step": 640, + "loss": 0.3536975383758545, + "objective": 0.3536975383758545, + "error": 0.1650390625, + "gradient_norm": 0.05353165790438652, + "elapsed": 477.166255235672 + }, + { + "step": 656, + "loss": 0.4926893711090088, + "objective": 0.4926893711090088, + "error": 0.2626953125, + "gradient_norm": 0.05201377719640732, + "elapsed": 491.1417751312256 + }, + { + "step": 672, + "loss": 0.5754991173744202, + "objective": 0.5754991173744202, + "error": 0.3271484375, + "gradient_norm": 0.08167096972465515, + "elapsed": 501.630366563797 + }, + { + "step": 688, + "loss": 0.5685014724731445, + "objective": 0.5685014724731445, + "error": 0.333984375, + "gradient_norm": 0.043775107711553574, + "elapsed": 514.2880456447601 + }, + { + "step": 704, + "loss": 0.022465089336037636, + "objective": 0.022465089336037636, + "error": 0.0068359375, + "gradient_norm": 0.010172540321946144, + "elapsed": 522.9173214435577 + }, + { + "step": 720, + "loss": 0.035460107028484344, + "objective": 0.035460107028484344, + "error": 0.0107421875, + "gradient_norm": 0.010515578091144562, + "elapsed": 532.8470129966736 + }, + { + "step": 736, + "loss": 0.44765588641166687, + "objective": 0.44765588641166687, + "error": 0.2138671875, + "gradient_norm": 0.09050357341766357, + "elapsed": 541.9488840103149 + }, + { + "step": 752, + "loss": 0.5933939218521118, + "objective": 0.5933939218521118, + "error": 0.3359375, + "gradient_norm": 0.0665116235613823, + "elapsed": 552.9967355728149 + }, + { + "step": 768, + "loss": 0.6100764870643616, + "objective": 0.6100764870643616, + "error": 0.3515625, + "gradient_norm": 0.0821211114525795, + "elapsed": 563.7709202766418 + }, + { + "step": 784, + "loss": 0.02964692935347557, + "objective": 0.02964692935347557, + "error": 0.009765625, + "gradient_norm": 0.012663272209465504, + "elapsed": 573.1517221927643 + }, + { + "step": 800, + "loss": 0.38091832399368286, + "objective": 0.38091832399368286, + "error": 0.1904296875, + "gradient_norm": 0.060622021555900574, + "elapsed": 582.5687477588654 + }, + { + "step": 816, + "loss": 0.552335262298584, + "objective": 0.552335262298584, + "error": 0.3076171875, + "gradient_norm": 0.14419035613536835, + "elapsed": 594.4292685985565 + }, + { + "step": 832, + "loss": 0.5943340063095093, + "objective": 0.5943340063095093, + "error": 0.34375, + "gradient_norm": 0.0633513554930687, + "elapsed": 605.2052299976349 + }, + { + "step": 848, + "loss": 0.6074100732803345, + "objective": 0.6074100732803345, + "error": 0.3486328125, + "gradient_norm": 0.04225531220436096, + "elapsed": 614.8996202945709 + }, + { + "step": 864, + "loss": 0.6198879480361938, + "objective": 0.6198879480361938, + "error": 0.361328125, + "gradient_norm": 0.04208856821060181, + "elapsed": 625.4266908168793 + }, + { + "step": 880, + "loss": 0.6151762008666992, + "objective": 0.6151762008666992, + "error": 0.369140625, + "gradient_norm": 0.06261089444160461, + "elapsed": 636.0696911811829 + }, + { + "step": 896, + "loss": 0.49680083990097046, + "objective": 0.49680083990097046, + "error": 0.25390625, + "gradient_norm": 0.0827067643404007, + "elapsed": 644.6893246173859 + }, + { + "step": 912, + "loss": 0.4610927402973175, + "objective": 0.4610927402973175, + "error": 0.23828125, + "gradient_norm": 0.06652095168828964, + "elapsed": 655.969132900238 + }, + { + "step": 928, + "loss": 0.5218505859375, + "objective": 0.5218505859375, + "error": 0.2685546875, + "gradient_norm": 0.07188194245100021, + "elapsed": 667.5352523326874 + }, + { + "step": 944, + "loss": 0.33009427785873413, + "objective": 0.33009427785873413, + "error": 0.1533203125, + "gradient_norm": 0.05718810483813286, + "elapsed": 677.8397319316864 + }, + { + "step": 960, + "loss": 0.5703234672546387, + "objective": 0.5703234672546387, + "error": 0.3193359375, + "gradient_norm": 0.11168288439512253, + "elapsed": 687.8742904663086 + }, + { + "step": 976, + "loss": 0.025548014789819717, + "objective": 0.025548014789819717, + "error": 0.0107421875, + "gradient_norm": 0.009453393518924713, + "elapsed": 698.294285774231 + }, + { + "step": 992, + "loss": 0.45398157835006714, + "objective": 0.45398157835006714, + "error": 0.2412109375, + "gradient_norm": 0.04607952758669853, + "elapsed": 707.903199672699 + }, + { + "step": 1008, + "loss": 0.3412189781665802, + "objective": 0.3412189781665802, + "error": 0.1513671875, + "gradient_norm": 0.0432075597345829, + "elapsed": 718.5662748813629 + }, + { + "step": 1024, + "loss": 0.4376429319381714, + "objective": 0.4376429319381714, + "error": 0.2275390625, + "gradient_norm": 0.07974351197481155, + "elapsed": 728.8954858779907 + }, + { + "step": 1040, + "loss": 0.33512815833091736, + "objective": 0.33512815833091736, + "error": 0.150390625, + "gradient_norm": 0.04476875811815262, + "elapsed": 744.0822694301605 + }, + { + "step": 1056, + "loss": 0.5214208364486694, + "objective": 0.5214208364486694, + "error": 0.283203125, + "gradient_norm": 0.08898192644119263, + "elapsed": 755.1484262943268 + }, + { + "step": 1072, + "loss": 0.13849599659442902, + "objective": 0.13849599659442902, + "error": 0.052734375, + "gradient_norm": 0.028359953314065933, + "elapsed": 764.3303108215332 + }, + { + "step": 1088, + "loss": 0.323838472366333, + "objective": 0.323838472366333, + "error": 0.1435546875, + "gradient_norm": 0.04081716760993004, + "elapsed": 773.2739362716675 + }, + { + "step": 1104, + "loss": 0.5627881288528442, + "objective": 0.5627881288528442, + "error": 0.3125, + "gradient_norm": 0.08322097361087799, + "elapsed": 784.7223973274231 + }, + { + "step": 1120, + "loss": 0.44111010432243347, + "objective": 0.44111010432243347, + "error": 0.2216796875, + "gradient_norm": 0.05700977146625519, + "elapsed": 795.085648059845 + }, + { + "step": 1136, + "loss": 0.6395992040634155, + "objective": 0.6395992040634155, + "error": 0.39453125, + "gradient_norm": 0.0744553729891777, + "elapsed": 805.7942585945129 + }, + { + "step": 1152, + "loss": 0.5433304309844971, + "objective": 0.5433304309844971, + "error": 0.287109375, + "gradient_norm": 0.04814797267317772, + "elapsed": 817.3382890224457 + }, + { + "step": 1168, + "loss": 0.5708576440811157, + "objective": 0.5708576440811157, + "error": 0.3203125, + "gradient_norm": 0.051331400871276855, + "elapsed": 829.288791179657 + }, + { + "step": 1184, + "loss": 0.5447035431861877, + "objective": 0.5447035431861877, + "error": 0.2939453125, + "gradient_norm": 0.10116687417030334, + "elapsed": 839.6822843551636 + }, + { + "step": 1200, + "loss": 0.6125671863555908, + "objective": 0.6125671863555908, + "error": 0.3642578125, + "gradient_norm": 0.04368080571293831, + "elapsed": 850.2262740135193 + }, + { + "step": 1216, + "loss": 0.5002380609512329, + "objective": 0.5002380609512329, + "error": 0.259765625, + "gradient_norm": 0.04939017817378044, + "elapsed": 862.3783452510834 + }, + { + "step": 1232, + "loss": 0.5698772668838501, + "objective": 0.5698772668838501, + "error": 0.3173828125, + "gradient_norm": 0.04916854575276375, + "elapsed": 871.4622664451599 + }, + { + "step": 1248, + "loss": 0.6046518683433533, + "objective": 0.6046518683433533, + "error": 0.341796875, + "gradient_norm": 0.04919794574379921, + "elapsed": 883.3905737400055 + }, + { + "step": 1264, + "loss": 0.5913128852844238, + "objective": 0.5913128852844238, + "error": 0.357421875, + "gradient_norm": 0.046917904168367386, + "elapsed": 892.4264807701111 + }, + { + "step": 1280, + "loss": 0.5027461051940918, + "objective": 0.5027461051940918, + "error": 0.2626953125, + "gradient_norm": 0.04705750197172165, + "elapsed": 902.5875842571259 + }, + { + "step": 1296, + "loss": 0.13519814610481262, + "objective": 0.13519814610481262, + "error": 0.052734375, + "gradient_norm": 0.02625490538775921, + "elapsed": 912.4087471961975 + }, + { + "step": 1312, + "loss": 0.5862359404563904, + "objective": 0.5862359404563904, + "error": 0.3271484375, + "gradient_norm": 0.05441493168473244, + "elapsed": 923.992555141449 + }, + { + "step": 1328, + "loss": 0.6031408309936523, + "objective": 0.6031408309936523, + "error": 0.3505859375, + "gradient_norm": 0.05901554971933365, + "elapsed": 933.3936491012573 + }, + { + "step": 1344, + "loss": 0.5823733806610107, + "objective": 0.5823733806610107, + "error": 0.3310546875, + "gradient_norm": 0.0842989832162857, + "elapsed": 941.979998588562 + }, + { + "step": 1360, + "loss": 0.6241492033004761, + "objective": 0.6241492033004761, + "error": 0.3720703125, + "gradient_norm": 0.04446673393249512, + "elapsed": 954.969649553299 + }, + { + "step": 1376, + "loss": 0.5829156637191772, + "objective": 0.5829156637191772, + "error": 0.361328125, + "gradient_norm": 0.06615480780601501, + "elapsed": 966.0245676040649 + }, + { + "step": 1392, + "loss": 0.5968320369720459, + "objective": 0.5968320369720459, + "error": 0.34765625, + "gradient_norm": 0.05093541368842125, + "elapsed": 975.1022663116455 + }, + { + "step": 1408, + "loss": 0.045559000223875046, + "objective": 0.045559000223875046, + "error": 0.01171875, + "gradient_norm": 0.02514980360865593, + "elapsed": 987.2391452789307 + }, + { + "step": 1424, + "loss": 0.22601813077926636, + "objective": 0.22601813077926636, + "error": 0.09765625, + "gradient_norm": 0.04834206402301788, + "elapsed": 996.4583384990692 + }, + { + "step": 1440, + "loss": 0.23011144995689392, + "objective": 0.23011144995689392, + "error": 0.111328125, + "gradient_norm": 0.050687842071056366, + "elapsed": 1007.1440904140472 + }, + { + "step": 1456, + "loss": 0.018240466713905334, + "objective": 0.018240466713905334, + "error": 0.0078125, + "gradient_norm": 0.005604141391813755, + "elapsed": 1016.4502851963043 + }, + { + "step": 1472, + "loss": 0.4498720169067383, + "objective": 0.4498720169067383, + "error": 0.232421875, + "gradient_norm": 0.08179625123739243, + "elapsed": 1028.8303294181824 + }, + { + "step": 1488, + "loss": 0.24151627719402313, + "objective": 0.24151627719402313, + "error": 0.107421875, + "gradient_norm": 0.03838668763637543, + "elapsed": 1037.8867321014404 + }, + { + "step": 1504, + "loss": 0.46122002601623535, + "objective": 0.46122002601623535, + "error": 0.232421875, + "gradient_norm": 0.0726623386144638, + "elapsed": 1047.7258644104004 + }, + { + "step": 1520, + "loss": 0.5085602402687073, + "objective": 0.5085602402687073, + "error": 0.2705078125, + "gradient_norm": 0.06673175096511841, + "elapsed": 1059.352120399475 + }, + { + "step": 1536, + "loss": 0.6105246543884277, + "objective": 0.6105246543884277, + "error": 0.3818359375, + "gradient_norm": 0.04271261766552925, + "elapsed": 1070.1413230895996 + }, + { + "step": 1552, + "loss": 0.4792126417160034, + "objective": 0.4792126417160034, + "error": 0.2578125, + "gradient_norm": 0.05200039595365524, + "elapsed": 1086.444006204605 + }, + { + "step": 1568, + "loss": 0.5814266204833984, + "objective": 0.5814266204833984, + "error": 0.330078125, + "gradient_norm": 0.05867309868335724, + "elapsed": 1097.2902619838715 + }, + { + "step": 1584, + "loss": 0.6321226358413696, + "objective": 0.6321226358413696, + "error": 0.3798828125, + "gradient_norm": 0.05418067052960396, + "elapsed": 1107.9767682552338 + }, + { + "step": 1600, + "loss": 0.5931253433227539, + "objective": 0.5931253433227539, + "error": 0.3603515625, + "gradient_norm": 0.06396215409040451, + "elapsed": 1121.782609462738 + }, + { + "step": 1616, + "loss": 0.6411516666412354, + "objective": 0.6411516666412354, + "error": 0.38671875, + "gradient_norm": 0.05035768821835518, + "elapsed": 1132.7197887897491 + }, + { + "step": 1632, + "loss": 0.4267754852771759, + "objective": 0.4267754852771759, + "error": 0.2080078125, + "gradient_norm": 0.09109894186258316, + "elapsed": 1139.1667578220367 + }, + { + "step": 1648, + "loss": 0.21246182918548584, + "objective": 0.21246182918548584, + "error": 0.095703125, + "gradient_norm": 0.04478950425982475, + "elapsed": 1149.1183021068573 + }, + { + "step": 1664, + "loss": 0.46360665559768677, + "objective": 0.46360665559768677, + "error": 0.251953125, + "gradient_norm": 0.07668188214302063, + "elapsed": 1161.1197745800018 + }, + { + "step": 1680, + "loss": 0.46281397342681885, + "objective": 0.46281397342681885, + "error": 0.236328125, + "gradient_norm": 0.07954126596450806, + "elapsed": 1171.8474535942078 + }, + { + "step": 1696, + "loss": 0.2484058141708374, + "objective": 0.2484058141708374, + "error": 0.12109375, + "gradient_norm": 0.047261305153369904, + "elapsed": 1185.6542596817017 + }, + { + "step": 1712, + "loss": 0.24310235679149628, + "objective": 0.24310235679149628, + "error": 0.1064453125, + "gradient_norm": 0.07262872904539108, + "elapsed": 1197.8986082077026 + }, + { + "step": 1728, + "loss": 0.009729458019137383, + "objective": 0.009729458019137383, + "error": 0.001953125, + "gradient_norm": 0.01146845705807209, + "elapsed": 1208.495581150055 + }, + { + "step": 1744, + "loss": 0.24568752944469452, + "objective": 0.24568752944469452, + "error": 0.10546875, + "gradient_norm": 0.05830742046236992, + "elapsed": 1219.9394850730896 + }, + { + "step": 1760, + "loss": 0.022546378895640373, + "objective": 0.022546378895640373, + "error": 0.0068359375, + "gradient_norm": 0.007667526602745056, + "elapsed": 1229.5703229904175 + }, + { + "step": 1776, + "loss": 0.5848401784896851, + "objective": 0.5848401784896851, + "error": 0.3271484375, + "gradient_norm": 0.061901818960905075, + "elapsed": 1238.750280380249 + }, + { + "step": 1792, + "loss": 0.6031335592269897, + "objective": 0.6031335592269897, + "error": 0.3671875, + "gradient_norm": 0.0676632970571518, + "elapsed": 1247.7468683719635 + }, + { + "step": 1808, + "loss": 0.6210961937904358, + "objective": 0.6210961937904358, + "error": 0.3603515625, + "gradient_norm": 0.0718468651175499, + "elapsed": 1256.1821897029877 + }, + { + "step": 1824, + "loss": 0.570877730846405, + "objective": 0.570877730846405, + "error": 0.3212890625, + "gradient_norm": 0.05575930327177048, + "elapsed": 1266.4091975688934 + }, + { + "step": 1840, + "loss": 0.5711429119110107, + "objective": 0.5711429119110107, + "error": 0.31640625, + "gradient_norm": 0.0691002607345581, + "elapsed": 1277.4722146987915 + }, + { + "step": 1856, + "loss": 0.36046335101127625, + "objective": 0.36046335101127625, + "error": 0.16796875, + "gradient_norm": 0.04694395884871483, + "elapsed": 1287.1420249938965 + }, + { + "step": 1872, + "loss": 0.4688999652862549, + "objective": 0.4688999652862549, + "error": 0.2216796875, + "gradient_norm": 0.07401346415281296, + "elapsed": 1297.3945078849792 + }, + { + "step": 1888, + "loss": 0.46385282278060913, + "objective": 0.46385282278060913, + "error": 0.2373046875, + "gradient_norm": 0.05608939751982689, + "elapsed": 1305.9779334068298 + }, + { + "step": 1904, + "loss": 0.60875403881073, + "objective": 0.60875403881073, + "error": 0.365234375, + "gradient_norm": 0.05085878074169159, + "elapsed": 1317.3097081184387 + }, + { + "step": 1920, + "loss": 0.12223530560731888, + "objective": 0.12223530560731888, + "error": 0.0458984375, + "gradient_norm": 0.024870412424206734, + "elapsed": 1328.6486887931824 + }, + { + "step": 1936, + "loss": 0.3486189544200897, + "objective": 0.3486189544200897, + "error": 0.16796875, + "gradient_norm": 0.04780663549900055, + "elapsed": 1336.6701011657715 + }, + { + "step": 1952, + "loss": 0.5777363777160645, + "objective": 0.5777363777160645, + "error": 0.3427734375, + "gradient_norm": 0.0571451336145401, + "elapsed": 1346.9158833026886 + }, + { + "step": 1968, + "loss": 0.39320266246795654, + "objective": 0.39320266246795654, + "error": 0.1884765625, + "gradient_norm": 0.05673858895897865, + "elapsed": 1354.9182631969452 + }, + { + "step": 1984, + "loss": 0.5900611281394958, + "objective": 0.5900611281394958, + "error": 0.3349609375, + "gradient_norm": 0.06593932211399078, + "elapsed": 1364.2754452228546 + }, + { + "step": 2000, + "loss": 0.6212430000305176, + "objective": 0.6212430000305176, + "error": 0.3857421875, + "gradient_norm": 0.040818918496370316, + "elapsed": 1374.7192046642303 + }, + { + "step": 2016, + "loss": 0.15605247020721436, + "objective": 0.15605247020721436, + "error": 0.0556640625, + "gradient_norm": 0.03108786791563034, + "elapsed": 1386.2740807533264 + }, + { + "step": 2032, + "loss": 0.22049596905708313, + "objective": 0.22049596905708313, + "error": 0.1015625, + "gradient_norm": 0.042733557522296906, + "elapsed": 1396.6422457695007 + }, + { + "step": 2048, + "loss": 0.5642613172531128, + "objective": 0.5642613172531128, + "error": 0.306640625, + "gradient_norm": 0.07527482509613037, + "elapsed": 1407.6688070297241 + } + ] + }, + "derived_checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ce5951e7095a9912dc74719254f2fcf9654f219078392b7acf7a8545e6f9f3f4", + "complete": true + }, + "mean4": { + "checkpoint_label": "mean4", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 512, + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "512": "d4194b40470453e5df9b75e12326cbbd0e6845946870bb0d53a2cbbdd6ea32dc", + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "512": { + "step": 512, + "training_samples": 524288, + "unique_training_rows_seen_in_this_phase": 324661, + "weights_sha256": "d4194b40470453e5df9b75e12326cbbd0e6845946870bb0d53a2cbbdd6ea32dc", + "complete": true + }, + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ff5a023ce2c18be7c29f810a3788a450e3ad3ad2237d6e9448923aa6a28c5074", + "complete": true + } + }, + "selection": "Predefined averages of the last3 or all4 saved noninitial full3_1 checkpoints; evaluate every validation condition before selecting", + "test_data_used": false, + "derivation_source_sha256": "08c498d6952b0380e001371df9a0461a483631a301f93747b821e529e72b349d" + }, + "training_source_snapshot": "training_sources/full3_swa", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23290264423076928, + "mean3": 0.2335186298076923, + "blend-mean3": 0.2325420673076923, + "mean4": 0.23326322115384618, + "blend-mean4": 0.23300781250000002 + }, + "selected": "blend-mean3" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22017728365384615, + "mean3": 0.22037259615384613, + "blend-mean3": 0.22091346153846153, + "mean4": 0.2205528846153846, + "blend-mean4": 0.22100360576923078 + }, + "selected": "incumbent" + } + ], + "checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ce5951e7095a9912dc74719254f2fcf9654f219078392b7acf7a8545e6f9f3f4", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit logical tracking in intermediate passes when intermediate probabilities are unused.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false + }, + { + "training": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261134", + "prior_pass": 3, + "initial_seed": 20261134, + "training_source_sha256": { + "learned_d5__train.py": "1f66b75e34e385a6d2654021f3fd124c9d8a359da1f677369e3e774728f83168", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "All supplied training shots per each of all26 d5 conditions; uniform condition and within-condition sampling for optimizer batches.", + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 516880, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 491030, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18670, + "surface_code_bX_d5_r03_center_5_5": 18940, + "surface_code_bX_d5_r05_center_5_5": 19128, + "surface_code_bX_d5_r07_center_5_5": 18988, + "surface_code_bX_d5_r09_center_5_5": 18523, + "surface_code_bX_d5_r11_center_5_5": 19227, + "surface_code_bX_d5_r13_center_5_5": 18816, + "surface_code_bX_d5_r15_center_5_5": 18107, + "surface_code_bX_d5_r17_center_5_5": 18728, + "surface_code_bX_d5_r19_center_5_5": 18983, + "surface_code_bX_d5_r21_center_5_5": 18959, + "surface_code_bX_d5_r23_center_5_5": 19079, + "surface_code_bX_d5_r25_center_5_5": 19193, + "surface_code_bZ_d5_r01_center_5_5": 18828, + "surface_code_bZ_d5_r03_center_5_5": 18896, + "surface_code_bZ_d5_r05_center_5_5": 19011, + "surface_code_bZ_d5_r07_center_5_5": 18806, + "surface_code_bZ_d5_r09_center_5_5": 18268, + "surface_code_bZ_d5_r11_center_5_5": 18927, + "surface_code_bZ_d5_r13_center_5_5": 19399, + "surface_code_bZ_d5_r15_center_5_5": 19358, + "surface_code_bZ_d5_r17_center_5_5": 18634, + "surface_code_bZ_d5_r19_center_5_5": 19126, + "surface_code_bZ_d5_r21_center_5_5": 18603, + "surface_code_bZ_d5_r23_center_5_5": 18626, + "surface_code_bZ_d5_r25_center_5_5": 19207 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1536, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261135, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "/run-state/workspace/research/learned_d5/fresh2_warm/rng-512.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/fresh2_warm/weights-512.npz", + "starting_checkpoint_sha256": "d3e3abba07693bd7fd3d17be2dd981d5b803a496e76ba230ed94afeb51f26f4f", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261134", + "prior_pass": 3, + "initial_seed": 20261134, + "training_source_sha256": { + "learned_d5__train.py": "1f66b75e34e385a6d2654021f3fd124c9d8a359da1f677369e3e774728f83168", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "All supplied training shots per each of all26 d5 conditions; uniform condition and within-condition sampling for optimizer batches.", + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 516880, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 325678, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 11962, + "surface_code_bX_d5_r03_center_5_5": 10232, + "surface_code_bX_d5_r05_center_5_5": 14014, + "surface_code_bX_d5_r07_center_5_5": 11594, + "surface_code_bX_d5_r09_center_5_5": 12805, + "surface_code_bX_d5_r11_center_5_5": 11644, + "surface_code_bX_d5_r13_center_5_5": 13845, + "surface_code_bX_d5_r15_center_5_5": 10703, + "surface_code_bX_d5_r17_center_5_5": 15460, + "surface_code_bX_d5_r19_center_5_5": 14156, + "surface_code_bX_d5_r21_center_5_5": 11568, + "surface_code_bX_d5_r23_center_5_5": 14156, + "surface_code_bX_d5_r25_center_5_5": 12021, + "surface_code_bZ_d5_r01_center_5_5": 10601, + "surface_code_bZ_d5_r03_center_5_5": 14135, + "surface_code_bZ_d5_r05_center_5_5": 11975, + "surface_code_bZ_d5_r07_center_5_5": 13841, + "surface_code_bZ_d5_r09_center_5_5": 12024, + "surface_code_bZ_d5_r11_center_5_5": 11151, + "surface_code_bZ_d5_r13_center_5_5": 10640, + "surface_code_bZ_d5_r15_center_5_5": 11089, + "surface_code_bZ_d5_r17_center_5_5": 13788, + "surface_code_bZ_d5_r19_center_5_5": 12350, + "surface_code_bZ_d5_r21_center_5_5": 12797, + "surface_code_bZ_d5_r23_center_5_5": 12809, + "surface_code_bZ_d5_r25_center_5_5": 14318 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 512, + "batch": 1024, + "learning_rate": 0.001, + "sampling_seed": 20261135, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "rng_restored": false, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "Fresh NumPy default_rng seed 20261135", + "starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "starting_training_provenance": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.6522030830383301, + "objective": 0.6522030830383301, + "error": 0.375, + "gradient_norm": 0.11649785190820694, + "elapsed": 30.089841604232788 + }, + { + "step": 16, + "loss": 0.5927819609642029, + "objective": 0.5927819609642029, + "error": 0.3466796875, + "gradient_norm": 0.07945127785205841, + "elapsed": 48.85365080833435 + }, + { + "step": 32, + "loss": 0.3115929663181305, + "objective": 0.3115929663181305, + "error": 0.13671875, + "gradient_norm": 0.039320655167102814, + "elapsed": 63.60312819480896 + }, + { + "step": 48, + "loss": 0.2456369698047638, + "objective": 0.2456369698047638, + "error": 0.1015625, + "gradient_norm": 0.029398636892437935, + "elapsed": 73.71074151992798 + }, + { + "step": 64, + "loss": 0.6231744885444641, + "objective": 0.6231744885444641, + "error": 0.3759765625, + "gradient_norm": 0.06867238879203796, + "elapsed": 83.75580954551697 + }, + { + "step": 80, + "loss": 0.3674217164516449, + "objective": 0.3674217164516449, + "error": 0.1572265625, + "gradient_norm": 0.0557992123067379, + "elapsed": 94.6383364200592 + }, + { + "step": 96, + "loss": 0.5152362585067749, + "objective": 0.5152362585067749, + "error": 0.2568359375, + "gradient_norm": 0.08284599334001541, + "elapsed": 106.90000939369202 + }, + { + "step": 112, + "loss": 0.020773420110344887, + "objective": 0.020773420110344887, + "error": 0.0048828125, + "gradient_norm": 0.008813572116196156, + "elapsed": 117.77558088302612 + }, + { + "step": 128, + "loss": 0.02593131735920906, + "objective": 0.02593131735920906, + "error": 0.0087890625, + "gradient_norm": 0.00872033555060625, + "elapsed": 128.93439435958862 + }, + { + "step": 144, + "loss": 0.5852900743484497, + "objective": 0.5852900743484497, + "error": 0.3291015625, + "gradient_norm": 0.04771002382040024, + "elapsed": 139.5588686466217 + }, + { + "step": 160, + "loss": 0.46074625849723816, + "objective": 0.46074625849723816, + "error": 0.232421875, + "gradient_norm": 0.08834747970104218, + "elapsed": 151.5595977306366 + }, + { + "step": 176, + "loss": 0.6310865879058838, + "objective": 0.6310865879058838, + "error": 0.376953125, + "gradient_norm": 0.14084596931934357, + "elapsed": 163.7892107963562 + }, + { + "step": 192, + "loss": 0.246865376830101, + "objective": 0.246865376830101, + "error": 0.1103515625, + "gradient_norm": 0.041402049362659454, + "elapsed": 174.28971648216248 + }, + { + "step": 208, + "loss": 0.3103577196598053, + "objective": 0.3103577196598053, + "error": 0.15625, + "gradient_norm": 0.04525696486234665, + "elapsed": 187.03909611701965 + }, + { + "step": 224, + "loss": 0.4523138999938965, + "objective": 0.4523138999938965, + "error": 0.208984375, + "gradient_norm": 0.09180521965026855, + "elapsed": 199.56195068359375 + }, + { + "step": 240, + "loss": 0.02241751179099083, + "objective": 0.02241751179099083, + "error": 0.009765625, + "gradient_norm": 0.009998111054301262, + "elapsed": 212.35500597953796 + }, + { + "step": 256, + "loss": 0.5487150549888611, + "objective": 0.5487150549888611, + "error": 0.294921875, + "gradient_norm": 0.12748055160045624, + "elapsed": 223.03854608535767 + }, + { + "step": 272, + "loss": 0.023057367652654648, + "objective": 0.023057367652654648, + "error": 0.0078125, + "gradient_norm": 0.006953821517527103, + "elapsed": 244.6508972644806 + }, + { + "step": 288, + "loss": 0.5845386981964111, + "objective": 0.5845386981964111, + "error": 0.330078125, + "gradient_norm": 0.06542652100324631, + "elapsed": 256.78167748451233 + }, + { + "step": 304, + "loss": 0.442532479763031, + "objective": 0.442532479763031, + "error": 0.232421875, + "gradient_norm": 0.10874580591917038, + "elapsed": 269.1364529132843 + }, + { + "step": 320, + "loss": 0.3264174163341522, + "objective": 0.3264174163341522, + "error": 0.15625, + "gradient_norm": 0.06276191771030426, + "elapsed": 282.38969564437866 + }, + { + "step": 336, + "loss": 0.386960506439209, + "objective": 0.386960506439209, + "error": 0.177734375, + "gradient_norm": 0.06561421602964401, + "elapsed": 292.9079031944275 + }, + { + "step": 352, + "loss": 0.23919886350631714, + "objective": 0.23919886350631714, + "error": 0.107421875, + "gradient_norm": 0.02755703590810299, + "elapsed": 304.16068935394287 + }, + { + "step": 368, + "loss": 0.5029175281524658, + "objective": 0.5029175281524658, + "error": 0.259765625, + "gradient_norm": 0.0378776490688324, + "elapsed": 315.11088514328003 + }, + { + "step": 384, + "loss": 0.565666675567627, + "objective": 0.565666675567627, + "error": 0.322265625, + "gradient_norm": 0.11368246376514435, + "elapsed": 324.3651068210602 + }, + { + "step": 400, + "loss": 0.5846428275108337, + "objective": 0.5846428275108337, + "error": 0.3408203125, + "gradient_norm": 0.08116643130779266, + "elapsed": 334.70786476135254 + }, + { + "step": 416, + "loss": 0.025111017748713493, + "objective": 0.025111017748713493, + "error": 0.0078125, + "gradient_norm": 0.008838560432195663, + "elapsed": 345.56963562965393 + }, + { + "step": 432, + "loss": 0.628488302230835, + "objective": 0.628488302230835, + "error": 0.3818359375, + "gradient_norm": 0.04001976177096367, + "elapsed": 355.3310384750366 + }, + { + "step": 448, + "loss": 0.4569575786590576, + "objective": 0.4569575786590576, + "error": 0.2578125, + "gradient_norm": 0.06344135850667953, + "elapsed": 367.05255675315857 + }, + { + "step": 464, + "loss": 0.49193111062049866, + "objective": 0.49193111062049866, + "error": 0.24609375, + "gradient_norm": 0.06022385507822037, + "elapsed": 377.38399291038513 + }, + { + "step": 480, + "loss": 0.5920064449310303, + "objective": 0.5920064449310303, + "error": 0.3466796875, + "gradient_norm": 0.036063045263290405, + "elapsed": 387.7266733646393 + }, + { + "step": 496, + "loss": 0.22157302498817444, + "objective": 0.22157302498817444, + "error": 0.09375, + "gradient_norm": 0.04071022942662239, + "elapsed": 397.78643012046814 + }, + { + "step": 512, + "loss": 0.39216887950897217, + "objective": 0.39216887950897217, + "error": 0.1728515625, + "gradient_norm": 0.09079446643590927, + "elapsed": 407.0137679576874 + } + ] + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.6092928647994995, + "objective": 0.6092928647994995, + "error": 0.3583984375, + "gradient_norm": 0.08161187171936035, + "elapsed": 27.421262741088867 + }, + { + "step": 16, + "loss": 0.4709879755973816, + "objective": 0.4709879755973816, + "error": 0.2529296875, + "gradient_norm": 0.0541619211435318, + "elapsed": 48.74575757980347 + }, + { + "step": 32, + "loss": 0.5842419862747192, + "objective": 0.5842419862747192, + "error": 0.34375, + "gradient_norm": 0.09450904279947281, + "elapsed": 60.68022179603577 + }, + { + "step": 48, + "loss": 0.5840846300125122, + "objective": 0.5840846300125122, + "error": 0.32421875, + "gradient_norm": 0.04569687321782112, + "elapsed": 74.63272476196289 + }, + { + "step": 64, + "loss": 0.5139708518981934, + "objective": 0.5139708518981934, + "error": 0.2646484375, + "gradient_norm": 0.16111725568771362, + "elapsed": 91.88426613807678 + }, + { + "step": 80, + "loss": 0.49099838733673096, + "objective": 0.49099838733673096, + "error": 0.251953125, + "gradient_norm": 0.04431874305009842, + "elapsed": 105.08457684516907 + }, + { + "step": 96, + "loss": 0.30287861824035645, + "objective": 0.30287861824035645, + "error": 0.14453125, + "gradient_norm": 0.03792181238532066, + "elapsed": 118.16054177284241 + }, + { + "step": 112, + "loss": 0.6026535630226135, + "objective": 0.6026535630226135, + "error": 0.359375, + "gradient_norm": 0.043088704347610474, + "elapsed": 134.6414511203766 + }, + { + "step": 128, + "loss": 0.5983598828315735, + "objective": 0.5983598828315735, + "error": 0.328125, + "gradient_norm": 0.06492504477500916, + "elapsed": 148.38875198364258 + }, + { + "step": 144, + "loss": 0.616276204586029, + "objective": 0.616276204586029, + "error": 0.3857421875, + "gradient_norm": 0.05420554056763649, + "elapsed": 164.11315298080444 + }, + { + "step": 160, + "loss": 0.017882924526929855, + "objective": 0.017882924526929855, + "error": 0.0048828125, + "gradient_norm": 0.004682278726249933, + "elapsed": 178.31525373458862 + }, + { + "step": 176, + "loss": 0.5279660820960999, + "objective": 0.5279660820960999, + "error": 0.271484375, + "gradient_norm": 0.03895021602511406, + "elapsed": 192.20261907577515 + }, + { + "step": 192, + "loss": 0.5794406533241272, + "objective": 0.5794406533241272, + "error": 0.34375, + "gradient_norm": 0.041880734264850616, + "elapsed": 200.32051873207092 + }, + { + "step": 208, + "loss": 0.3353561758995056, + "objective": 0.3353561758995056, + "error": 0.1513671875, + "gradient_norm": 0.07022152841091156, + "elapsed": 212.5193521976471 + }, + { + "step": 224, + "loss": 0.47239983081817627, + "objective": 0.47239983081817627, + "error": 0.23828125, + "gradient_norm": 0.044771477580070496, + "elapsed": 223.36571788787842 + }, + { + "step": 240, + "loss": 0.6235381364822388, + "objective": 0.6235381364822388, + "error": 0.3779296875, + "gradient_norm": 0.047636937350034714, + "elapsed": 233.90032649040222 + }, + { + "step": 256, + "loss": 0.516319751739502, + "objective": 0.516319751739502, + "error": 0.271484375, + "gradient_norm": 0.087476447224617, + "elapsed": 245.52193427085876 + }, + { + "step": 272, + "loss": 0.23385891318321228, + "objective": 0.23385891318321228, + "error": 0.091796875, + "gradient_norm": 0.05921977758407593, + "elapsed": 254.38622951507568 + }, + { + "step": 288, + "loss": 0.31280556321144104, + "objective": 0.31280556321144104, + "error": 0.1318359375, + "gradient_norm": 0.03548427298665047, + "elapsed": 263.25871300697327 + }, + { + "step": 304, + "loss": 0.6208417415618896, + "objective": 0.6208417415618896, + "error": 0.361328125, + "gradient_norm": 0.10255666077136993, + "elapsed": 273.5115919113159 + }, + { + "step": 320, + "loss": 0.5985375642776489, + "objective": 0.5985375642776489, + "error": 0.3603515625, + "gradient_norm": 0.04024764895439148, + "elapsed": 285.4135670661926 + }, + { + "step": 336, + "loss": 0.028151696547865868, + "objective": 0.028151696547865868, + "error": 0.009765625, + "gradient_norm": 0.008847440592944622, + "elapsed": 295.0800693035126 + }, + { + "step": 352, + "loss": 0.6147637963294983, + "objective": 0.6147637963294983, + "error": 0.3603515625, + "gradient_norm": 0.05709920823574066, + "elapsed": 305.32019686698914 + }, + { + "step": 368, + "loss": 0.5955979824066162, + "objective": 0.5955979824066162, + "error": 0.3486328125, + "gradient_norm": 0.04276399686932564, + "elapsed": 316.3869025707245 + }, + { + "step": 384, + "loss": 0.23504304885864258, + "objective": 0.23504304885864258, + "error": 0.1025390625, + "gradient_norm": 0.03205326199531555, + "elapsed": 325.7849349975586 + }, + { + "step": 400, + "loss": 0.13460804522037506, + "objective": 0.13460804522037506, + "error": 0.0546875, + "gradient_norm": 0.03109711967408657, + "elapsed": 335.72691917419434 + }, + { + "step": 416, + "loss": 0.5798783302307129, + "objective": 0.5798783302307129, + "error": 0.322265625, + "gradient_norm": 0.053542010486125946, + "elapsed": 345.7052640914917 + }, + { + "step": 432, + "loss": 0.3892784118652344, + "objective": 0.3892784118652344, + "error": 0.19140625, + "gradient_norm": 0.052194178104400635, + "elapsed": 357.38475036621094 + }, + { + "step": 448, + "loss": 0.23582103848457336, + "objective": 0.23582103848457336, + "error": 0.1181640625, + "gradient_norm": 0.032037943601608276, + "elapsed": 369.5841510295868 + }, + { + "step": 464, + "loss": 0.5408849716186523, + "objective": 0.5408849716186523, + "error": 0.2900390625, + "gradient_norm": 0.07508285343647003, + "elapsed": 379.84099793434143 + }, + { + "step": 480, + "loss": 0.3894873559474945, + "objective": 0.3894873559474945, + "error": 0.19140625, + "gradient_norm": 0.03977999836206436, + "elapsed": 390.9687530994415 + }, + { + "step": 496, + "loss": 0.6059300899505615, + "objective": 0.6059300899505615, + "error": 0.361328125, + "gradient_norm": 0.06041429564356804, + "elapsed": 403.2380111217499 + }, + { + "step": 512, + "loss": 0.2117740511894226, + "objective": 0.2117740511894226, + "error": 0.0908203125, + "gradient_norm": 0.05693414434790611, + "elapsed": 414.4854781627655 + }, + { + "step": 528, + "loss": 0.4666211009025574, + "objective": 0.4666211009025574, + "error": 0.2470703125, + "gradient_norm": 0.0764947235584259, + "elapsed": 433.42368054389954 + }, + { + "step": 544, + "loss": 0.22636458277702332, + "objective": 0.22636458277702332, + "error": 0.1083984375, + "gradient_norm": 0.03683016076683998, + "elapsed": 442.92575907707214 + }, + { + "step": 560, + "loss": 0.23172692954540253, + "objective": 0.23172692954540253, + "error": 0.1083984375, + "gradient_norm": 0.034071482717990875, + "elapsed": 453.3129711151123 + }, + { + "step": 576, + "loss": 0.4768703579902649, + "objective": 0.4768703579902649, + "error": 0.2529296875, + "gradient_norm": 0.06308378279209137, + "elapsed": 462.4127457141876 + }, + { + "step": 592, + "loss": 0.5165150165557861, + "objective": 0.5165150165557861, + "error": 0.291015625, + "gradient_norm": 0.07674732059240341, + "elapsed": 473.8309862613678 + }, + { + "step": 608, + "loss": 0.5919064283370972, + "objective": 0.5919064283370972, + "error": 0.3359375, + "gradient_norm": 0.06379934400320053, + "elapsed": 484.3733870983124 + }, + { + "step": 624, + "loss": 0.01804366335272789, + "objective": 0.01804366335272789, + "error": 0.0068359375, + "gradient_norm": 0.005318541545420885, + "elapsed": 495.94076347351074 + }, + { + "step": 640, + "loss": 0.41747498512268066, + "objective": 0.41747498512268066, + "error": 0.1962890625, + "gradient_norm": 0.052116431295871735, + "elapsed": 506.73559165000916 + }, + { + "step": 656, + "loss": 0.6140056848526001, + "objective": 0.6140056848526001, + "error": 0.3896484375, + "gradient_norm": 0.05376415699720383, + "elapsed": 517.2397899627686 + }, + { + "step": 672, + "loss": 0.4098930358886719, + "objective": 0.4098930358886719, + "error": 0.197265625, + "gradient_norm": 0.04737741872668266, + "elapsed": 525.7957897186279 + }, + { + "step": 688, + "loss": 0.3499884009361267, + "objective": 0.3499884009361267, + "error": 0.1650390625, + "gradient_norm": 0.0714973583817482, + "elapsed": 534.9302124977112 + }, + { + "step": 704, + "loss": 0.552291989326477, + "objective": 0.552291989326477, + "error": 0.3095703125, + "gradient_norm": 0.10188189148902893, + "elapsed": 545.4470670223236 + }, + { + "step": 720, + "loss": 0.4040689468383789, + "objective": 0.4040689468383789, + "error": 0.1943359375, + "gradient_norm": 0.06630362570285797, + "elapsed": 554.2920794487 + }, + { + "step": 736, + "loss": 0.3191133439540863, + "objective": 0.3191133439540863, + "error": 0.15625, + "gradient_norm": 0.060587506741285324, + "elapsed": 562.335791349411 + }, + { + "step": 752, + "loss": 0.5949387550354004, + "objective": 0.5949387550354004, + "error": 0.330078125, + "gradient_norm": 0.051291145384311676, + "elapsed": 570.9363489151001 + }, + { + "step": 768, + "loss": 0.4783790409564972, + "objective": 0.4783790409564972, + "error": 0.244140625, + "gradient_norm": 0.08808670938014984, + "elapsed": 581.1555306911469 + }, + { + "step": 784, + "loss": 0.4414710998535156, + "objective": 0.4414710998535156, + "error": 0.20703125, + "gradient_norm": 0.06632383912801743, + "elapsed": 590.4109175205231 + }, + { + "step": 800, + "loss": 0.2536136507987976, + "objective": 0.2536136507987976, + "error": 0.1142578125, + "gradient_norm": 0.03191893920302391, + "elapsed": 601.43274974823 + }, + { + "step": 816, + "loss": 0.22448071837425232, + "objective": 0.22448071837425232, + "error": 0.1015625, + "gradient_norm": 0.04966023191809654, + "elapsed": 612.7252013683319 + }, + { + "step": 832, + "loss": 0.5342355966567993, + "objective": 0.5342355966567993, + "error": 0.2783203125, + "gradient_norm": 0.05757307633757591, + "elapsed": 623.6647284030914 + }, + { + "step": 848, + "loss": 0.2506354749202728, + "objective": 0.2506354749202728, + "error": 0.109375, + "gradient_norm": 0.03991081938147545, + "elapsed": 635.1636409759521 + }, + { + "step": 864, + "loss": 0.40698009729385376, + "objective": 0.40698009729385376, + "error": 0.1953125, + "gradient_norm": 0.09155476838350296, + "elapsed": 645.2128469944 + }, + { + "step": 880, + "loss": 0.563283383846283, + "objective": 0.563283383846283, + "error": 0.3134765625, + "gradient_norm": 0.11409252882003784, + "elapsed": 659.2946681976318 + }, + { + "step": 896, + "loss": 0.13591040670871735, + "objective": 0.13591040670871735, + "error": 0.064453125, + "gradient_norm": 0.02692740224301815, + "elapsed": 668.6167254447937 + }, + { + "step": 912, + "loss": 0.5798318982124329, + "objective": 0.5798318982124329, + "error": 0.3310546875, + "gradient_norm": 0.06674209237098694, + "elapsed": 680.6492185592651 + }, + { + "step": 928, + "loss": 0.6140691041946411, + "objective": 0.6140691041946411, + "error": 0.3857421875, + "gradient_norm": 0.06117575615644455, + "elapsed": 693.1704411506653 + }, + { + "step": 944, + "loss": 0.3964633643627167, + "objective": 0.3964633643627167, + "error": 0.1865234375, + "gradient_norm": 0.08617512136697769, + "elapsed": 708.2128443717957 + }, + { + "step": 960, + "loss": 0.5512299537658691, + "objective": 0.5512299537658691, + "error": 0.2861328125, + "gradient_norm": 0.05705108866095543, + "elapsed": 720.2417063713074 + }, + { + "step": 976, + "loss": 0.454137921333313, + "objective": 0.454137921333313, + "error": 0.216796875, + "gradient_norm": 0.07962293922901154, + "elapsed": 730.2567391395569 + }, + { + "step": 992, + "loss": 0.5681213140487671, + "objective": 0.5681213140487671, + "error": 0.3017578125, + "gradient_norm": 0.09802286326885223, + "elapsed": 742.7380962371826 + }, + { + "step": 1008, + "loss": 0.13060352206230164, + "objective": 0.13060352206230164, + "error": 0.0537109375, + "gradient_norm": 0.04271279275417328, + "elapsed": 750.8077793121338 + }, + { + "step": 1024, + "loss": 0.6129879355430603, + "objective": 0.6129879355430603, + "error": 0.3603515625, + "gradient_norm": 0.04127912223339081, + "elapsed": 761.0585849285126 + }, + { + "step": 1040, + "loss": 0.31361687183380127, + "objective": 0.31361687183380127, + "error": 0.1455078125, + "gradient_norm": 0.04341907799243927, + "elapsed": 776.3491418361664 + }, + { + "step": 1056, + "loss": 0.6326502561569214, + "objective": 0.6326502561569214, + "error": 0.365234375, + "gradient_norm": 0.07518075406551361, + "elapsed": 786.0424168109894 + }, + { + "step": 1072, + "loss": 0.537599503993988, + "objective": 0.537599503993988, + "error": 0.2958984375, + "gradient_norm": 0.08455493301153183, + "elapsed": 795.1607735157013 + }, + { + "step": 1088, + "loss": 0.5953108072280884, + "objective": 0.5953108072280884, + "error": 0.337890625, + "gradient_norm": 0.06973882764577866, + "elapsed": 804.0053510665894 + }, + { + "step": 1104, + "loss": 0.36860400438308716, + "objective": 0.36860400438308716, + "error": 0.1923828125, + "gradient_norm": 0.04828036576509476, + "elapsed": 813.4029138088226 + }, + { + "step": 1120, + "loss": 0.5423247218132019, + "objective": 0.5423247218132019, + "error": 0.28125, + "gradient_norm": 0.04841453209519386, + "elapsed": 823.626978635788 + }, + { + "step": 1136, + "loss": 0.4766136407852173, + "objective": 0.4766136407852173, + "error": 0.236328125, + "gradient_norm": 0.07564551383256912, + "elapsed": 832.4641265869141 + }, + { + "step": 1152, + "loss": 0.5473434925079346, + "objective": 0.5473434925079346, + "error": 0.2958984375, + "gradient_norm": 0.13677075505256653, + "elapsed": 844.9307618141174 + }, + { + "step": 1168, + "loss": 0.3040686249732971, + "objective": 0.3040686249732971, + "error": 0.150390625, + "gradient_norm": 0.045926257967948914, + "elapsed": 854.336992263794 + }, + { + "step": 1184, + "loss": 0.6298375129699707, + "objective": 0.6298375129699707, + "error": 0.3798828125, + "gradient_norm": 0.06807851791381836, + "elapsed": 864.5731596946716 + }, + { + "step": 1200, + "loss": 0.6272540092468262, + "objective": 0.6272540092468262, + "error": 0.37890625, + "gradient_norm": 0.139838308095932, + "elapsed": 877.8357374668121 + }, + { + "step": 1216, + "loss": 0.5224937200546265, + "objective": 0.5224937200546265, + "error": 0.287109375, + "gradient_norm": 0.0647057592868805, + "elapsed": 887.8107197284698 + }, + { + "step": 1232, + "loss": 0.02408422902226448, + "objective": 0.02408422902226448, + "error": 0.0107421875, + "gradient_norm": 0.007562167476862669, + "elapsed": 902.201171875 + }, + { + "step": 1248, + "loss": 0.01936865597963333, + "objective": 0.01936865597963333, + "error": 0.0048828125, + "gradient_norm": 0.006423021201044321, + "elapsed": 914.0247437953949 + }, + { + "step": 1264, + "loss": 0.47522181272506714, + "objective": 0.47522181272506714, + "error": 0.2490234375, + "gradient_norm": 0.04962826892733574, + "elapsed": 927.0462884902954 + }, + { + "step": 1280, + "loss": 0.019577551633119583, + "objective": 0.019577551633119583, + "error": 0.0068359375, + "gradient_norm": 0.008308992721140385, + "elapsed": 939.3647270202637 + }, + { + "step": 1296, + "loss": 0.5085430145263672, + "objective": 0.5085430145263672, + "error": 0.2734375, + "gradient_norm": 0.06214233115315437, + "elapsed": 949.4259700775146 + }, + { + "step": 1312, + "loss": 0.23232896625995636, + "objective": 0.23232896625995636, + "error": 0.1015625, + "gradient_norm": 0.05894213914871216, + "elapsed": 961.3636543750763 + }, + { + "step": 1328, + "loss": 0.5330536365509033, + "objective": 0.5330536365509033, + "error": 0.2861328125, + "gradient_norm": 0.11579663306474686, + "elapsed": 972.1607241630554 + }, + { + "step": 1344, + "loss": 0.019525721669197083, + "objective": 0.019525721669197083, + "error": 0.0087890625, + "gradient_norm": 0.008134250529110432, + "elapsed": 983.0828921794891 + }, + { + "step": 1360, + "loss": 0.22790294885635376, + "objective": 0.22790294885635376, + "error": 0.103515625, + "gradient_norm": 0.04187086224555969, + "elapsed": 991.3167304992676 + }, + { + "step": 1376, + "loss": 0.48713046312332153, + "objective": 0.48713046312332153, + "error": 0.2666015625, + "gradient_norm": 0.06267429888248444, + "elapsed": 1003.5033710002899 + }, + { + "step": 1392, + "loss": 0.6043434143066406, + "objective": 0.6043434143066406, + "error": 0.369140625, + "gradient_norm": 0.037880122661590576, + "elapsed": 1017.8567223548889 + }, + { + "step": 1408, + "loss": 0.034499723464250565, + "objective": 0.034499723464250565, + "error": 0.0068359375, + "gradient_norm": 0.013505477458238602, + "elapsed": 1027.3547134399414 + }, + { + "step": 1424, + "loss": 0.5320160388946533, + "objective": 0.5320160388946533, + "error": 0.306640625, + "gradient_norm": 0.07510018348693848, + "elapsed": 1036.9454221725464 + }, + { + "step": 1440, + "loss": 0.3451523780822754, + "objective": 0.3451523780822754, + "error": 0.171875, + "gradient_norm": 0.06453985720872879, + "elapsed": 1046.1805095672607 + }, + { + "step": 1456, + "loss": 0.21541815996170044, + "objective": 0.21541815996170044, + "error": 0.08984375, + "gradient_norm": 0.043503839522600174, + "elapsed": 1055.850379705429 + }, + { + "step": 1472, + "loss": 0.43667086958885193, + "objective": 0.43667086958885193, + "error": 0.22265625, + "gradient_norm": 0.07311506569385529, + "elapsed": 1066.6324400901794 + }, + { + "step": 1488, + "loss": 0.6163139939308167, + "objective": 0.6163139939308167, + "error": 0.3779296875, + "gradient_norm": 0.06406569480895996, + "elapsed": 1075.7883398532867 + }, + { + "step": 1504, + "loss": 0.23901250958442688, + "objective": 0.23901250958442688, + "error": 0.10546875, + "gradient_norm": 0.04792191833257675, + "elapsed": 1085.4756922721863 + }, + { + "step": 1520, + "loss": 0.3817014694213867, + "objective": 0.3817014694213867, + "error": 0.18359375, + "gradient_norm": 0.046061187982559204, + "elapsed": 1095.974383354187 + }, + { + "step": 1536, + "loss": 0.5593156814575195, + "objective": 0.5593156814575195, + "error": 0.3017578125, + "gradient_norm": 0.0735388696193695, + "elapsed": 1105.913155078888 + } + ] + }, + "training_source_snapshot": "training_sources/fresh2_full", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2325420673076923, + "0": 0.23359374999999996, + "blend-0": 0.23372896634615387, + "512": 0.23342848557692306, + "blend-512": 0.23329326923076926, + "1024": 0.23315805288461536, + "blend-1024": 0.23309795673076922, + "1536": 0.2326923076923077, + "blend-1536": 0.23278245192307695 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22017728365384615, + "0": 0.22125901442307688, + "blend-0": 0.22125901442307694, + "512": 0.22080829326923082, + "blend-512": 0.2211838942307692, + "1024": 0.22052283653846153, + "blend-1024": 0.22031249999999997, + "1536": 0.21953124999999998, + "blend-1536": 0.21998197115384616 + }, + "selected": "1536" + } + ], + "checkpoints": { + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 491030, + "weights_sha256": "20746e71c276e720074318b0978e6ea0ddc0df206954834f13c7f36354933cea", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit unused intermediate logical tracking; raw neural branches also omit the unused final physical readout.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false, + "numerical_controls": { + "packaged_runtime_control_cpu": { + "device": "cpu", + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 7, + "same_cpu_old_vs_new_maximum_difference": 0.0, + "old_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "new_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "cpu_vs_reconstructed_old_gpu_runtime_maximum_difference": 4.976987838745117e-05, + "original_gpu_evaluation_vs_reconstructed_gpu_runtime_maximum_difference": 7.748603820800781e-07, + "initial_failed_control": { + "comparison": "CPU runtime against original GPU evaluator", + "observed_maximum_difference": 4.971027374267578e-05, + "original_tolerance": 3e-06 + }, + "sources": { + "d5_base_context_model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "d5_context_model.py": "d58bcfe01767228d18ce2078d555abf13037b5df63edf38273ba66f0966ee445", + "d5_contextual.py": "59d6c85dc4bd61e26cf7243baf0e2637c3de1d35327b2c763707badd19446550", + "turbo.py": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b" + }, + "scope": "Same-device compatibility check. Reconstructed GPU runtime removes the recorded equal physical blend; that reconstruction has floating-point rounding uncertainty.", + "status": "passed_same_device_compatibility" + }, + "cpu_probability_precision": { + "condition": "surface_code_bX_d5_r03_center_5_5", + "validation_syndromes": 7, + "logical_labels_used": false, + "parameter_updates": 0, + "reference": "Float64 neural forward and exact contraction from the same stored weights and fixed float32 input logits, on CPU", + "cpu_float32_vs_float64_maximum_difference": 7.624897924163321e-08, + "cpu_float32_edges_float64_contraction_vs_float64_maximum_difference": 4.725248914372315e-08, + "gpu_float32_vs_float64_maximum_difference": 4.964999121059854e-05, + "cpu_vs_gpu_float32_maximum_difference": 4.971027374267578e-05, + "maximum_neural_edge_probability_difference": 2.6330936014895556e-08, + "float32_edge_values_above_one_minus_1e6": 0, + "scope": "Precision diagnostic only; the published model is unchanged. Same-device old/new packaged-code compatibility was independently exact." + }, + "priors_only_control_cpu": { + "status": "passed", + "device": "cpu", + "source_sha256": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b", + "records": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 2.7116777896881104, + "priors_only_seconds_warm": 0.13569164276123047 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 3.557781457901001, + "priors_only_seconds_warm": 1.7711329460144043 + } + ], + "scope": "CPU numerical equivalence on supplied training syndromes; timings are not a controlled speed comparison." + } + } + }, + { + "training": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261271", + "prior_pass": 3, + "initial_seed": 20261271, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 466919, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18000, + "surface_code_bX_d5_r03_center_5_5": 18251, + "surface_code_bX_d5_r05_center_5_5": 18224, + "surface_code_bX_d5_r07_center_5_5": 17881, + "surface_code_bX_d5_r09_center_5_5": 18247, + "surface_code_bX_d5_r11_center_5_5": 17452, + "surface_code_bX_d5_r13_center_5_5": 17982, + "surface_code_bX_d5_r15_center_5_5": 17498, + "surface_code_bX_d5_r17_center_5_5": 18487, + "surface_code_bX_d5_r19_center_5_5": 18100, + "surface_code_bX_d5_r21_center_5_5": 17622, + "surface_code_bX_d5_r23_center_5_5": 17449, + "surface_code_bX_d5_r25_center_5_5": 17739, + "surface_code_bZ_d5_r01_center_5_5": 16689, + "surface_code_bZ_d5_r03_center_5_5": 18119, + "surface_code_bZ_d5_r05_center_5_5": 18146, + "surface_code_bZ_d5_r07_center_5_5": 18185, + "surface_code_bZ_d5_r09_center_5_5": 18473, + "surface_code_bZ_d5_r11_center_5_5": 18636, + "surface_code_bZ_d5_r13_center_5_5": 18474, + "surface_code_bZ_d5_r15_center_5_5": 17779, + "surface_code_bZ_d5_r17_center_5_5": 18474, + "surface_code_bZ_d5_r19_center_5_5": 17306, + "surface_code_bZ_d5_r21_center_5_5": 17165, + "surface_code_bZ_d5_r23_center_5_5": 18616, + "surface_code_bZ_d5_r25_center_5_5": 17925 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1536, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261272, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "/run-state/workspace/research/learned_d5/reserved1_warm/rng-512.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/reserved1_warm/weights-512.npz", + "starting_checkpoint_sha256": "1adc47acc35148d4260df25e25384124609d2b1e098ffcf30a1eccea55ef8712", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261271", + "prior_pass": 3, + "initial_seed": 20261271, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 317613, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 14297, + "surface_code_bX_d5_r03_center_5_5": 11305, + "surface_code_bX_d5_r05_center_5_5": 12479, + "surface_code_bX_d5_r07_center_5_5": 10433, + "surface_code_bX_d5_r09_center_5_5": 10919, + "surface_code_bX_d5_r11_center_5_5": 12516, + "surface_code_bX_d5_r13_center_5_5": 12043, + "surface_code_bX_d5_r15_center_5_5": 12143, + "surface_code_bX_d5_r17_center_5_5": 11354, + "surface_code_bX_d5_r19_center_5_5": 13660, + "surface_code_bX_d5_r21_center_5_5": 13753, + "surface_code_bX_d5_r23_center_5_5": 12161, + "surface_code_bX_d5_r25_center_5_5": 12531, + "surface_code_bZ_d5_r01_center_5_5": 11397, + "surface_code_bZ_d5_r03_center_5_5": 9053, + "surface_code_bZ_d5_r05_center_5_5": 13723, + "surface_code_bZ_d5_r07_center_5_5": 14763, + "surface_code_bZ_d5_r09_center_5_5": 10969, + "surface_code_bZ_d5_r11_center_5_5": 12129, + "surface_code_bZ_d5_r13_center_5_5": 10020, + "surface_code_bZ_d5_r15_center_5_5": 13170, + "surface_code_bZ_d5_r17_center_5_5": 14946, + "surface_code_bZ_d5_r19_center_5_5": 10579, + "surface_code_bZ_d5_r21_center_5_5": 11745, + "surface_code_bZ_d5_r23_center_5_5": 12426, + "surface_code_bZ_d5_r25_center_5_5": 13099 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 512, + "batch": 1024, + "learning_rate": 0.001, + "sampling_seed": 20261272, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "rng_restored": false, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "Fresh NumPy default_rng seed 20261272", + "starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "starting_training_provenance": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.1412775069475174, + "objective": 0.1412775069475174, + "error": 0.0595703125, + "gradient_norm": 0.030735325068235397, + "elapsed": 28.457472801208496 + }, + { + "step": 16, + "loss": 0.6315727233886719, + "objective": 0.6315727233886719, + "error": 0.384765625, + "gradient_norm": 0.06563512235879898, + "elapsed": 47.886730670928955 + }, + { + "step": 32, + "loss": 0.5130410194396973, + "objective": 0.5130410194396973, + "error": 0.263671875, + "gradient_norm": 0.10626910626888275, + "elapsed": 60.16136598587036 + }, + { + "step": 48, + "loss": 0.6413166522979736, + "objective": 0.6413166522979736, + "error": 0.408203125, + "gradient_norm": 0.03790846839547157, + "elapsed": 70.9611382484436 + }, + { + "step": 64, + "loss": 0.5491592884063721, + "objective": 0.5491592884063721, + "error": 0.2939453125, + "gradient_norm": 0.093081034719944, + "elapsed": 81.46673464775085 + }, + { + "step": 80, + "loss": 0.6315242648124695, + "objective": 0.6315242648124695, + "error": 0.359375, + "gradient_norm": 0.0384257510304451, + "elapsed": 91.71172666549683 + }, + { + "step": 96, + "loss": 0.6311566829681396, + "objective": 0.6311566829681396, + "error": 0.3798828125, + "gradient_norm": 0.03731638938188553, + "elapsed": 100.83252763748169 + }, + { + "step": 112, + "loss": 0.5327925682067871, + "objective": 0.5327925682067871, + "error": 0.29296875, + "gradient_norm": 0.11202990263700485, + "elapsed": 111.35073852539062 + }, + { + "step": 128, + "loss": 0.6284654140472412, + "objective": 0.6284654140472412, + "error": 0.3740234375, + "gradient_norm": 0.03215613588690758, + "elapsed": 121.32994651794434 + }, + { + "step": 144, + "loss": 0.33964547514915466, + "objective": 0.33964547514915466, + "error": 0.1259765625, + "gradient_norm": 0.05133189633488655, + "elapsed": 131.2744882106781 + }, + { + "step": 160, + "loss": 0.14193454384803772, + "objective": 0.14193454384803772, + "error": 0.0478515625, + "gradient_norm": 0.03264402225613594, + "elapsed": 139.58473920822144 + }, + { + "step": 176, + "loss": 0.14203950762748718, + "objective": 0.14203950762748718, + "error": 0.0654296875, + "gradient_norm": 0.022548990324139595, + "elapsed": 148.9861602783203 + }, + { + "step": 192, + "loss": 0.6307225227355957, + "objective": 0.6307225227355957, + "error": 0.3955078125, + "gradient_norm": 0.08607082068920135, + "elapsed": 162.27514505386353 + }, + { + "step": 208, + "loss": 0.16193106770515442, + "objective": 0.16193106770515442, + "error": 0.064453125, + "gradient_norm": 0.023293493315577507, + "elapsed": 173.59824013710022 + }, + { + "step": 224, + "loss": 0.5426318049430847, + "objective": 0.5426318049430847, + "error": 0.3037109375, + "gradient_norm": 0.03944721072912216, + "elapsed": 182.70232272148132 + }, + { + "step": 240, + "loss": 0.6270365715026855, + "objective": 0.6270365715026855, + "error": 0.3896484375, + "gradient_norm": 0.14661568403244019, + "elapsed": 193.759183883667 + }, + { + "step": 256, + "loss": 0.4933152198791504, + "objective": 0.4933152198791504, + "error": 0.2724609375, + "gradient_norm": 0.1065438985824585, + "elapsed": 205.62959718704224 + }, + { + "step": 272, + "loss": 0.3671969473361969, + "objective": 0.3671969473361969, + "error": 0.177734375, + "gradient_norm": 0.05156548321247101, + "elapsed": 222.249596118927 + }, + { + "step": 288, + "loss": 0.5478869676589966, + "objective": 0.5478869676589966, + "error": 0.3203125, + "gradient_norm": 0.08357688039541245, + "elapsed": 232.2198715209961 + }, + { + "step": 304, + "loss": 0.21171918511390686, + "objective": 0.21171918511390686, + "error": 0.0849609375, + "gradient_norm": 0.06231697276234627, + "elapsed": 241.07631373405457 + }, + { + "step": 320, + "loss": 0.5333335995674133, + "objective": 0.5333335995674133, + "error": 0.2861328125, + "gradient_norm": 0.08931853622198105, + "elapsed": 251.28962755203247 + }, + { + "step": 336, + "loss": 0.12485946714878082, + "objective": 0.12485946714878082, + "error": 0.046875, + "gradient_norm": 0.018839582800865173, + "elapsed": 262.3605041503906 + }, + { + "step": 352, + "loss": 0.2334863245487213, + "objective": 0.2334863245487213, + "error": 0.09765625, + "gradient_norm": 0.03669576346874237, + "elapsed": 273.16373229026794 + }, + { + "step": 368, + "loss": 0.5818328857421875, + "objective": 0.5818328857421875, + "error": 0.3232421875, + "gradient_norm": 0.09833699464797974, + "elapsed": 282.8677294254303 + }, + { + "step": 384, + "loss": 0.6228232383728027, + "objective": 0.6228232383728027, + "error": 0.3671875, + "gradient_norm": 0.033418990671634674, + "elapsed": 295.04902839660645 + }, + { + "step": 400, + "loss": 0.5749450922012329, + "objective": 0.5749450922012329, + "error": 0.333984375, + "gradient_norm": 0.04644288495182991, + "elapsed": 306.67032837867737 + }, + { + "step": 416, + "loss": 0.46251457929611206, + "objective": 0.46251457929611206, + "error": 0.2216796875, + "gradient_norm": 0.06633804738521576, + "elapsed": 317.759464263916 + }, + { + "step": 432, + "loss": 0.5577508211135864, + "objective": 0.5577508211135864, + "error": 0.30859375, + "gradient_norm": 0.0970199704170227, + "elapsed": 327.4626543521881 + }, + { + "step": 448, + "loss": 0.11625733226537704, + "objective": 0.11625733226537704, + "error": 0.0419921875, + "gradient_norm": 0.020417485386133194, + "elapsed": 336.3522970676422 + }, + { + "step": 464, + "loss": 0.23657961189746857, + "objective": 0.23657961189746857, + "error": 0.1025390625, + "gradient_norm": 0.03908605873584747, + "elapsed": 344.3832321166992 + }, + { + "step": 480, + "loss": 0.011504358612000942, + "objective": 0.011504358612000942, + "error": 0.00390625, + "gradient_norm": 0.006708688102662563, + "elapsed": 355.18855381011963 + }, + { + "step": 496, + "loss": 0.3410624563694, + "objective": 0.3410624563694, + "error": 0.1533203125, + "gradient_norm": 0.05804387852549553, + "elapsed": 366.2978138923645 + }, + { + "step": 512, + "loss": 0.034005306661129, + "objective": 0.034005306661129, + "error": 0.0107421875, + "gradient_norm": 0.01019973959773779, + "elapsed": 375.73491764068604 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved1_warm", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "b31e8f5ee2b5ea1b661e6bf8b5649bec45b7ab5da74fe9de46e4d06846356b87", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 256, + 512 + ], + "training_draws": 524288, + "distinct_phase_training_rows": 317613, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 14297, + "surface_code_bX_d5_r03_center_5_5": 11305, + "surface_code_bX_d5_r05_center_5_5": 12479, + "surface_code_bX_d5_r07_center_5_5": 10433, + "surface_code_bX_d5_r09_center_5_5": 10919, + "surface_code_bX_d5_r11_center_5_5": 12516, + "surface_code_bX_d5_r13_center_5_5": 12043, + "surface_code_bX_d5_r15_center_5_5": 12143, + "surface_code_bX_d5_r17_center_5_5": 11354, + "surface_code_bX_d5_r19_center_5_5": 13660, + "surface_code_bX_d5_r21_center_5_5": 13753, + "surface_code_bX_d5_r23_center_5_5": 12161, + "surface_code_bX_d5_r25_center_5_5": 12531, + "surface_code_bZ_d5_r01_center_5_5": 11397, + "surface_code_bZ_d5_r03_center_5_5": 9053, + "surface_code_bZ_d5_r05_center_5_5": 13723, + "surface_code_bZ_d5_r07_center_5_5": 14763, + "surface_code_bZ_d5_r09_center_5_5": 10969, + "surface_code_bZ_d5_r11_center_5_5": 12129, + "surface_code_bZ_d5_r13_center_5_5": 10020, + "surface_code_bZ_d5_r15_center_5_5": 13170, + "surface_code_bZ_d5_r17_center_5_5": 14946, + "surface_code_bZ_d5_r19_center_5_5": 10579, + "surface_code_bZ_d5_r21_center_5_5": 11745, + "surface_code_bZ_d5_r23_center_5_5": 12426, + "surface_code_bZ_d5_r25_center_5_5": 13099 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 512, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.5523660182952881, + "objective": 0.5523660182952881, + "error": 0.30859375, + "gradient_norm": 0.05200070142745972, + "elapsed": 30.08410096168518 + }, + { + "step": 16, + "loss": 0.5380295515060425, + "objective": 0.5380295515060425, + "error": 0.306640625, + "gradient_norm": 0.0804876759648323, + "elapsed": 50.77648210525513 + }, + { + "step": 32, + "loss": 0.6359301805496216, + "objective": 0.6359301805496216, + "error": 0.3837890625, + "gradient_norm": 0.059380218386650085, + "elapsed": 59.453776836395264 + }, + { + "step": 48, + "loss": 0.2540435492992401, + "objective": 0.2540435492992401, + "error": 0.1083984375, + "gradient_norm": 0.04367281496524811, + "elapsed": 67.29314041137695 + }, + { + "step": 64, + "loss": 0.5867692232131958, + "objective": 0.5867692232131958, + "error": 0.3447265625, + "gradient_norm": 0.053885214030742645, + "elapsed": 78.74847197532654 + }, + { + "step": 80, + "loss": 0.6015321016311646, + "objective": 0.6015321016311646, + "error": 0.365234375, + "gradient_norm": 0.04807985574007034, + "elapsed": 90.48145818710327 + }, + { + "step": 96, + "loss": 0.49287766218185425, + "objective": 0.49287766218185425, + "error": 0.271484375, + "gradient_norm": 0.07899080961942673, + "elapsed": 101.65468978881836 + }, + { + "step": 112, + "loss": 0.3271353542804718, + "objective": 0.3271353542804718, + "error": 0.15234375, + "gradient_norm": 0.049542222172021866, + "elapsed": 111.14713263511658 + }, + { + "step": 128, + "loss": 0.50013667345047, + "objective": 0.50013667345047, + "error": 0.271484375, + "gradient_norm": 0.06454745680093765, + "elapsed": 121.21207547187805 + }, + { + "step": 144, + "loss": 0.028576843440532684, + "objective": 0.028576843440532684, + "error": 0.0087890625, + "gradient_norm": 0.010781333781778812, + "elapsed": 130.69302248954773 + }, + { + "step": 160, + "loss": 0.5668779015541077, + "objective": 0.5668779015541077, + "error": 0.330078125, + "gradient_norm": 0.06098390743136406, + "elapsed": 142.14290237426758 + }, + { + "step": 176, + "loss": 0.3986494839191437, + "objective": 0.3986494839191437, + "error": 0.1884765625, + "gradient_norm": 0.042795032262802124, + "elapsed": 152.75753688812256 + }, + { + "step": 192, + "loss": 0.31897079944610596, + "objective": 0.31897079944610596, + "error": 0.142578125, + "gradient_norm": 0.040675707161426544, + "elapsed": 160.04981398582458 + }, + { + "step": 208, + "loss": 0.5092275142669678, + "objective": 0.5092275142669678, + "error": 0.255859375, + "gradient_norm": 0.07929783314466476, + "elapsed": 169.85345673561096 + }, + { + "step": 224, + "loss": 0.35782667994499207, + "objective": 0.35782667994499207, + "error": 0.1748046875, + "gradient_norm": 0.05785144120454788, + "elapsed": 179.90323066711426 + }, + { + "step": 240, + "loss": 0.5660895109176636, + "objective": 0.5660895109176636, + "error": 0.3349609375, + "gradient_norm": 0.10684454441070557, + "elapsed": 191.3668942451477 + }, + { + "step": 256, + "loss": 0.6265910863876343, + "objective": 0.6265910863876343, + "error": 0.3779296875, + "gradient_norm": 0.034383758902549744, + "elapsed": 200.3055775165558 + }, + { + "step": 272, + "loss": 0.6210677623748779, + "objective": 0.6210677623748779, + "error": 0.369140625, + "gradient_norm": 0.04434216767549515, + "elapsed": 210.09376430511475 + }, + { + "step": 288, + "loss": 0.4892377257347107, + "objective": 0.4892377257347107, + "error": 0.2490234375, + "gradient_norm": 0.1040654331445694, + "elapsed": 220.45881819725037 + }, + { + "step": 304, + "loss": 0.6407739520072937, + "objective": 0.6407739520072937, + "error": 0.3916015625, + "gradient_norm": 0.07782924920320511, + "elapsed": 233.3719048500061 + }, + { + "step": 320, + "loss": 0.4752756953239441, + "objective": 0.4752756953239441, + "error": 0.263671875, + "gradient_norm": 0.051829319447278976, + "elapsed": 244.25844407081604 + }, + { + "step": 336, + "loss": 0.6482080221176147, + "objective": 0.6482080221176147, + "error": 0.41015625, + "gradient_norm": 0.04979892820119858, + "elapsed": 253.1897099018097 + }, + { + "step": 352, + "loss": 0.34022292494773865, + "objective": 0.34022292494773865, + "error": 0.1708984375, + "gradient_norm": 0.09951864182949066, + "elapsed": 264.0781395435333 + }, + { + "step": 368, + "loss": 0.3494992256164551, + "objective": 0.3494992256164551, + "error": 0.15625, + "gradient_norm": 0.10392706841230392, + "elapsed": 275.8111581802368 + }, + { + "step": 384, + "loss": 0.47191378474235535, + "objective": 0.47191378474235535, + "error": 0.25, + "gradient_norm": 0.07366786152124405, + "elapsed": 283.9459602832794 + }, + { + "step": 400, + "loss": 0.583655595779419, + "objective": 0.583655595779419, + "error": 0.3623046875, + "gradient_norm": 0.10394527018070221, + "elapsed": 294.3349726200104 + }, + { + "step": 416, + "loss": 0.6212975978851318, + "objective": 0.6212975978851318, + "error": 0.37109375, + "gradient_norm": 0.054796766489744186, + "elapsed": 304.7477548122406 + }, + { + "step": 432, + "loss": 0.4719577431678772, + "objective": 0.4719577431678772, + "error": 0.2431640625, + "gradient_norm": 0.05418012663722038, + "elapsed": 315.91914200782776 + }, + { + "step": 448, + "loss": 0.5696494579315186, + "objective": 0.5696494579315186, + "error": 0.3330078125, + "gradient_norm": 0.047046076506376266, + "elapsed": 324.96326184272766 + }, + { + "step": 464, + "loss": 0.613875687122345, + "objective": 0.613875687122345, + "error": 0.34765625, + "gradient_norm": 0.05237002298235893, + "elapsed": 334.7670781612396 + }, + { + "step": 480, + "loss": 0.28741705417633057, + "objective": 0.28741705417633057, + "error": 0.1240234375, + "gradient_norm": 0.05365394428372383, + "elapsed": 344.03080439567566 + }, + { + "step": 496, + "loss": 0.3729455769062042, + "objective": 0.3729455769062042, + "error": 0.1875, + "gradient_norm": 0.05905403569340706, + "elapsed": 356.01581716537476 + }, + { + "step": 512, + "loss": 0.38685142993927, + "objective": 0.38685142993927, + "error": 0.17578125, + "gradient_norm": 0.048455506563186646, + "elapsed": 367.7296392917633 + }, + { + "step": 528, + "loss": 0.6062720417976379, + "objective": 0.6062720417976379, + "error": 0.369140625, + "gradient_norm": 0.07544548809528351, + "elapsed": 385.4480962753296 + }, + { + "step": 544, + "loss": 0.520085871219635, + "objective": 0.520085871219635, + "error": 0.279296875, + "gradient_norm": 0.08394371718168259, + "elapsed": 397.71993708610535 + }, + { + "step": 560, + "loss": 0.5944540500640869, + "objective": 0.5944540500640869, + "error": 0.3544921875, + "gradient_norm": 0.05468091368675232, + "elapsed": 406.9417428970337 + }, + { + "step": 576, + "loss": 0.34102559089660645, + "objective": 0.34102559089660645, + "error": 0.1611328125, + "gradient_norm": 0.07333917915821075, + "elapsed": 417.0068130493164 + }, + { + "step": 592, + "loss": 0.47373664379119873, + "objective": 0.47373664379119873, + "error": 0.2412109375, + "gradient_norm": 0.05662858858704567, + "elapsed": 425.1176447868347 + }, + { + "step": 608, + "loss": 0.48517894744873047, + "objective": 0.48517894744873047, + "error": 0.25, + "gradient_norm": 0.08127480745315552, + "elapsed": 434.92080903053284 + }, + { + "step": 624, + "loss": 0.39865612983703613, + "objective": 0.39865612983703613, + "error": 0.1904296875, + "gradient_norm": 0.07332058995962143, + "elapsed": 446.6602101325989 + }, + { + "step": 640, + "loss": 0.41867297887802124, + "objective": 0.41867297887802124, + "error": 0.2177734375, + "gradient_norm": 0.07386308163404465, + "elapsed": 457.0243580341339 + }, + { + "step": 656, + "loss": 0.5108687877655029, + "objective": 0.5108687877655029, + "error": 0.2822265625, + "gradient_norm": 0.052080318331718445, + "elapsed": 469.5842761993408 + }, + { + "step": 672, + "loss": 0.5043742656707764, + "objective": 0.5043742656707764, + "error": 0.2734375, + "gradient_norm": 0.047204963862895966, + "elapsed": 479.356397151947 + }, + { + "step": 688, + "loss": 0.5550935864448547, + "objective": 0.5550935864448547, + "error": 0.30078125, + "gradient_norm": 0.04080262407660484, + "elapsed": 489.9912152290344 + }, + { + "step": 704, + "loss": 0.5698974132537842, + "objective": 0.5698974132537842, + "error": 0.322265625, + "gradient_norm": 0.10692963004112244, + "elapsed": 500.3283371925354 + }, + { + "step": 720, + "loss": 0.45870622992515564, + "objective": 0.45870622992515564, + "error": 0.2255859375, + "gradient_norm": 0.06705734878778458, + "elapsed": 509.82279753685 + }, + { + "step": 736, + "loss": 0.555386483669281, + "objective": 0.555386483669281, + "error": 0.31640625, + "gradient_norm": 0.05112688988447189, + "elapsed": 518.507036447525 + }, + { + "step": 752, + "loss": 0.14282986521720886, + "objective": 0.14282986521720886, + "error": 0.056640625, + "gradient_norm": 0.03209136053919792, + "elapsed": 529.1373023986816 + }, + { + "step": 768, + "loss": 0.5362129807472229, + "objective": 0.5362129807472229, + "error": 0.2841796875, + "gradient_norm": 0.049996186047792435, + "elapsed": 538.9186007976532 + }, + { + "step": 784, + "loss": 0.5071826577186584, + "objective": 0.5071826577186584, + "error": 0.2744140625, + "gradient_norm": 0.04826078191399574, + "elapsed": 549.5225830078125 + }, + { + "step": 800, + "loss": 0.24775367975234985, + "objective": 0.24775367975234985, + "error": 0.107421875, + "gradient_norm": 0.06889795511960983, + "elapsed": 560.7170543670654 + }, + { + "step": 816, + "loss": 0.17432856559753418, + "objective": 0.17432856559753418, + "error": 0.06640625, + "gradient_norm": 0.05147368833422661, + "elapsed": 570.7887880802155 + }, + { + "step": 832, + "loss": 0.5410823822021484, + "objective": 0.5410823822021484, + "error": 0.3115234375, + "gradient_norm": 0.11862928420305252, + "elapsed": 581.9721121788025 + }, + { + "step": 848, + "loss": 0.5555508732795715, + "objective": 0.5555508732795715, + "error": 0.296875, + "gradient_norm": 0.060369592159986496, + "elapsed": 592.2823219299316 + }, + { + "step": 864, + "loss": 0.31839215755462646, + "objective": 0.31839215755462646, + "error": 0.1552734375, + "gradient_norm": 0.063877172768116, + "elapsed": 603.1910541057587 + }, + { + "step": 880, + "loss": 0.481766939163208, + "objective": 0.481766939163208, + "error": 0.2470703125, + "gradient_norm": 0.1623816341161728, + "elapsed": 614.4277107715607 + }, + { + "step": 896, + "loss": 0.5780366659164429, + "objective": 0.5780366659164429, + "error": 0.3037109375, + "gradient_norm": 0.06694691628217697, + "elapsed": 623.9365792274475 + }, + { + "step": 912, + "loss": 0.4794909358024597, + "objective": 0.4794909358024597, + "error": 0.2314453125, + "gradient_norm": 0.07813122123479843, + "elapsed": 633.9845306873322 + }, + { + "step": 928, + "loss": 0.6279138922691345, + "objective": 0.6279138922691345, + "error": 0.380859375, + "gradient_norm": 0.047679927200078964, + "elapsed": 643.7766675949097 + }, + { + "step": 944, + "loss": 0.6401606798171997, + "objective": 0.6401606798171997, + "error": 0.3994140625, + "gradient_norm": 0.07329051941633224, + "elapsed": 655.2369928359985 + }, + { + "step": 960, + "loss": 0.4340277910232544, + "objective": 0.4340277910232544, + "error": 0.2158203125, + "gradient_norm": 0.11762503534555435, + "elapsed": 666.9884371757507 + }, + { + "step": 976, + "loss": 0.44496864080429077, + "objective": 0.44496864080429077, + "error": 0.2236328125, + "gradient_norm": 0.05260347202420235, + "elapsed": 677.3464586734772 + }, + { + "step": 992, + "loss": 0.13230293989181519, + "objective": 0.13230293989181519, + "error": 0.05078125, + "gradient_norm": 0.030240925028920174, + "elapsed": 685.7275724411011 + }, + { + "step": 1008, + "loss": 0.2971688508987427, + "objective": 0.2971688508987427, + "error": 0.1171875, + "gradient_norm": 0.05503479763865471, + "elapsed": 694.1270356178284 + }, + { + "step": 1024, + "loss": 0.5688735246658325, + "objective": 0.5688735246658325, + "error": 0.314453125, + "gradient_norm": 0.06526188552379608, + "elapsed": 703.9192817211151 + }, + { + "step": 1040, + "loss": 0.42805811762809753, + "objective": 0.42805811762809753, + "error": 0.2080078125, + "gradient_norm": 0.13000032305717468, + "elapsed": 720.145961523056 + }, + { + "step": 1056, + "loss": 0.5543602705001831, + "objective": 0.5543602705001831, + "error": 0.298828125, + "gradient_norm": 0.15922385454177856, + "elapsed": 733.5112845897675 + }, + { + "step": 1072, + "loss": 0.031130114570260048, + "objective": 0.031130114570260048, + "error": 0.013671875, + "gradient_norm": 0.008926023729145527, + "elapsed": 742.4467866420746 + }, + { + "step": 1088, + "loss": 0.14947748184204102, + "objective": 0.14947748184204102, + "error": 0.056640625, + "gradient_norm": 0.03975249081850052, + "elapsed": 751.8575854301453 + }, + { + "step": 1104, + "loss": 0.6275734901428223, + "objective": 0.6275734901428223, + "error": 0.3671875, + "gradient_norm": 0.08096148073673248, + "elapsed": 761.5625903606415 + }, + { + "step": 1120, + "loss": 0.23923414945602417, + "objective": 0.23923414945602417, + "error": 0.0966796875, + "gradient_norm": 0.03325376287102699, + "elapsed": 773.9633615016937 + }, + { + "step": 1136, + "loss": 0.570243239402771, + "objective": 0.570243239402771, + "error": 0.31640625, + "gradient_norm": 0.07534287869930267, + "elapsed": 783.1533136367798 + }, + { + "step": 1152, + "loss": 0.4264270067214966, + "objective": 0.4264270067214966, + "error": 0.2119140625, + "gradient_norm": 0.08900073170661926, + "elapsed": 792.1710996627808 + }, + { + "step": 1168, + "loss": 0.5958121418952942, + "objective": 0.5958121418952942, + "error": 0.3583984375, + "gradient_norm": 0.08239343762397766, + "elapsed": 803.1175289154053 + }, + { + "step": 1184, + "loss": 0.2909137010574341, + "objective": 0.2909137010574341, + "error": 0.1416015625, + "gradient_norm": 0.05281354859471321, + "elapsed": 812.6055159568787 + }, + { + "step": 1200, + "loss": 0.6119058728218079, + "objective": 0.6119058728218079, + "error": 0.36328125, + "gradient_norm": 0.056254416704177856, + "elapsed": 823.2276427745819 + }, + { + "step": 1216, + "loss": 0.13595536351203918, + "objective": 0.13595536351203918, + "error": 0.0556640625, + "gradient_norm": 0.04057573154568672, + "elapsed": 834.1696293354034 + }, + { + "step": 1232, + "loss": 0.5840731263160706, + "objective": 0.5840731263160706, + "error": 0.328125, + "gradient_norm": 0.054566267877817154, + "elapsed": 845.3501887321472 + }, + { + "step": 1248, + "loss": 0.3053072690963745, + "objective": 0.3053072690963745, + "error": 0.1337890625, + "gradient_norm": 0.04617297649383545, + "elapsed": 854.9564871788025 + }, + { + "step": 1264, + "loss": 0.6288673281669617, + "objective": 0.6288673281669617, + "error": 0.3994140625, + "gradient_norm": 0.08229745179414749, + "elapsed": 864.8914043903351 + }, + { + "step": 1280, + "loss": 0.5586361289024353, + "objective": 0.5586361289024353, + "error": 0.2958984375, + "gradient_norm": 0.05713959410786629, + "elapsed": 877.0349607467651 + }, + { + "step": 1296, + "loss": 0.3648858666419983, + "objective": 0.3648858666419983, + "error": 0.16796875, + "gradient_norm": 0.08502963185310364, + "elapsed": 888.5764675140381 + }, + { + "step": 1312, + "loss": 0.4747084081172943, + "objective": 0.4747084081172943, + "error": 0.244140625, + "gradient_norm": 0.08609883487224579, + "elapsed": 899.7598609924316 + }, + { + "step": 1328, + "loss": 0.15583917498588562, + "objective": 0.15583917498588562, + "error": 0.05859375, + "gradient_norm": 0.027793049812316895, + "elapsed": 909.47514295578 + }, + { + "step": 1344, + "loss": 0.47515708208084106, + "objective": 0.47515708208084106, + "error": 0.263671875, + "gradient_norm": 0.07668807357549667, + "elapsed": 919.7640328407288 + }, + { + "step": 1360, + "loss": 0.5173689126968384, + "objective": 0.5173689126968384, + "error": 0.2744140625, + "gradient_norm": 0.05054212734103203, + "elapsed": 930.6309463977814 + }, + { + "step": 1376, + "loss": 0.46629998087882996, + "objective": 0.46629998087882996, + "error": 0.24609375, + "gradient_norm": 0.051172077655792236, + "elapsed": 939.0202586650848 + }, + { + "step": 1392, + "loss": 0.11312969774007797, + "objective": 0.11312969774007797, + "error": 0.044921875, + "gradient_norm": 0.05863805115222931, + "elapsed": 949.1451416015625 + }, + { + "step": 1408, + "loss": 0.5750841498374939, + "objective": 0.5750841498374939, + "error": 0.322265625, + "gradient_norm": 0.051106806844472885, + "elapsed": 959.94162940979 + }, + { + "step": 1424, + "loss": 0.5937192440032959, + "objective": 0.5937192440032959, + "error": 0.3408203125, + "gradient_norm": 0.05014815554022789, + "elapsed": 969.5868306159973 + }, + { + "step": 1440, + "loss": 0.5292985439300537, + "objective": 0.5292985439300537, + "error": 0.2958984375, + "gradient_norm": 0.057068243622779846, + "elapsed": 982.6692054271698 + }, + { + "step": 1456, + "loss": 0.5959951877593994, + "objective": 0.5959951877593994, + "error": 0.3408203125, + "gradient_norm": 0.0703694075345993, + "elapsed": 995.0066986083984 + }, + { + "step": 1472, + "loss": 0.018453411757946014, + "objective": 0.018453411757946014, + "error": 0.00390625, + "gradient_norm": 0.012016087770462036, + "elapsed": 1004.0057821273804 + }, + { + "step": 1488, + "loss": 0.5711684823036194, + "objective": 0.5711684823036194, + "error": 0.3095703125, + "gradient_norm": 0.07746906578540802, + "elapsed": 1016.1701967716217 + }, + { + "step": 1504, + "loss": 0.3114882707595825, + "objective": 0.3114882707595825, + "error": 0.1455078125, + "gradient_norm": 0.05321609228849411, + "elapsed": 1026.6053586006165 + }, + { + "step": 1520, + "loss": 0.6433392763137817, + "objective": 0.6433392763137817, + "error": 0.4072265625, + "gradient_norm": 0.05683734640479088, + "elapsed": 1036.1535296440125 + }, + { + "step": 1536, + "loss": 0.38409170508384705, + "objective": 0.38409170508384705, + "error": 0.19140625, + "gradient_norm": 0.07577994465827942, + "elapsed": 1046.9508447647095 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved1_full", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "7b45252d6bb77a39c003c8f34f040d0d672e9dd1a1338a14126e1fe07a02c8c9", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 512, + 1024, + 1536 + ], + "training_draws": 1572864, + "distinct_phase_training_rows": 466919, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18000, + "surface_code_bX_d5_r03_center_5_5": 18251, + "surface_code_bX_d5_r05_center_5_5": 18224, + "surface_code_bX_d5_r07_center_5_5": 17881, + "surface_code_bX_d5_r09_center_5_5": 18247, + "surface_code_bX_d5_r11_center_5_5": 17452, + "surface_code_bX_d5_r13_center_5_5": 17982, + "surface_code_bX_d5_r15_center_5_5": 17498, + "surface_code_bX_d5_r17_center_5_5": 18487, + "surface_code_bX_d5_r19_center_5_5": 18100, + "surface_code_bX_d5_r21_center_5_5": 17622, + "surface_code_bX_d5_r23_center_5_5": 17449, + "surface_code_bX_d5_r25_center_5_5": 17739, + "surface_code_bZ_d5_r01_center_5_5": 16689, + "surface_code_bZ_d5_r03_center_5_5": 18119, + "surface_code_bZ_d5_r05_center_5_5": 18146, + "surface_code_bZ_d5_r07_center_5_5": 18185, + "surface_code_bZ_d5_r09_center_5_5": 18473, + "surface_code_bZ_d5_r11_center_5_5": 18636, + "surface_code_bZ_d5_r13_center_5_5": 18474, + "surface_code_bZ_d5_r15_center_5_5": 17779, + "surface_code_bZ_d5_r17_center_5_5": 18474, + "surface_code_bZ_d5_r19_center_5_5": 17306, + "surface_code_bZ_d5_r21_center_5_5": 17165, + "surface_code_bZ_d5_r23_center_5_5": 18616, + "surface_code_bZ_d5_r25_center_5_5": 17925 + }, + "initial_optimizer_count": 512, + "last_optimizer_count": 2048, + "parent_checkpoint_sha256": "1adc47acc35148d4260df25e25384124609d2b1e098ffcf30a1eccea55ef8712", + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "training_source_snapshot": "training_sources/reserved1_full", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23228665865384618, + "0": 0.2337439903846154, + "blend-0": 0.23366887019230773, + "512": 0.23284254807692306, + "blend-512": 0.23275240384615387, + "1024": 0.23356370192307693, + "blend-1024": 0.23315805288461536, + "1536": 0.23218149038461539, + "blend-1536": 0.2330378605769231 + }, + "selected": "1536" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.21953124999999998, + "0": 0.2206580528846154, + "blend-0": 0.2208683894230769, + "512": 0.22100360576923078, + "blend-512": 0.2208984375, + "1024": 0.22104867788461538, + "blend-1024": 0.22019230769230771, + "1536": 0.22264122596153849, + "blend-1536": 0.22032752403846154 + }, + "selected": "incumbent" + } + ], + "checkpoints": { + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 466919, + "weights_sha256": "65a762bc0623024c3fbc416ff5df00d8ea275f6c7d691a54c6e0492f459a362f", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit unused intermediate logical tracking; raw neural branches also omit the unused final physical readout.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false, + "numerical_controls": { + "packaged_runtime_control_cpu": { + "device": "cpu", + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 7, + "same_cpu_old_vs_new_maximum_difference": 0.0, + "old_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "new_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "cpu_vs_reconstructed_old_gpu_runtime_maximum_difference": 4.976987838745117e-05, + "original_gpu_evaluation_vs_reconstructed_gpu_runtime_maximum_difference": 7.748603820800781e-07, + "initial_failed_control": { + "comparison": "CPU runtime against original GPU evaluator", + "observed_maximum_difference": 4.971027374267578e-05, + "original_tolerance": 3e-06 + }, + "sources": { + "d5_base_context_model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "d5_context_model.py": "53342e15dcbb8bc2dd0b288d75ea115fb504be99a33bc283a518b9d76232cd99", + "d5_temporal_context_model.py": "d58bcfe01767228d18ce2078d555abf13037b5df63edf38273ba66f0966ee445", + "d5_history_context_model.py": "4cc383b4909ff740bccfd20b687f8ee46866e67f93f82fe6c4bace162149ffb4", + "d5_history_features.py": "d709cd54225aa1b14707afa436314c8392f59f748a0007d988c6d18dedd275ee", + "d5_contextual.py": "59d6c85dc4bd61e26cf7243baf0e2637c3de1d35327b2c763707badd19446550", + "turbo.py": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b" + }, + "scope": "Same-device compatibility check. Reconstructed GPU runtime removes the recorded equal physical blend; that reconstruction has floating-point rounding uncertainty.", + "status": "passed_same_device_compatibility" + }, + "dispatcher_control_cpu": { + "status": "passed", + "device": "cpu", + "sources": { + "d5_context_model.py": "53342e15dcbb8bc2dd0b288d75ea115fb504be99a33bc283a518b9d76232cd99", + "d5_base_context_model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "d5_temporal_context_model.py": "d58bcfe01767228d18ce2078d555abf13037b5df63edf38273ba66f0966ee445", + "d5_history_context_model.py": "4cc383b4909ff740bccfd20b687f8ee46866e67f93f82fe6c4bace162149ffb4", + "d5_history_features.py": "d709cd54225aa1b14707afa436314c8392f59f748a0007d988c6d18dedd275ee" + }, + "cases": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "base64", + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "base128", + "weights_sha256": "2a21869e7669492fac8252131434b2e09c97f1def2714988382ab7f127371bd8", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "temporal", + "weights_sha256": "9446a1e6dc46e1bcae540531e4f124930bb151ebfa600746ca77bc8f5b2aaa7c", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "history", + "weights_sha256": "c508d8968ffa143be4219a207fb54ece3e1bfe144b8a880e4ed4f3d13f092c1e", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "base64", + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "base128", + "weights_sha256": "2a21869e7669492fac8252131434b2e09c97f1def2714988382ab7f127371bd8", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "temporal", + "weights_sha256": "9446a1e6dc46e1bcae540531e4f124930bb151ebfa600746ca77bc8f5b2aaa7c", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "history", + "weights_sha256": "c508d8968ffa143be4219a207fb54ece3e1bfe144b8a880e4ed4f3d13f092c1e", + "maximum_edge_probability_difference": 0.0 + } + ], + "scope": "Routing and code-copy check against each direct model implementation, using training detector inputs without labels. Tiny trained temporal/history smoke weights test nonzero feature couplings; they are excluded from model selection and submission.", + "test_data_used": false + }, + "cpu_probability_precision": { + "condition": "surface_code_bX_d5_r03_center_5_5", + "validation_syndromes": 7, + "logical_labels_used": false, + "parameter_updates": 0, + "reference": "Float64 neural forward and exact contraction from the same stored weights and fixed float32 input logits, on CPU", + "cpu_float32_vs_float64_maximum_difference": 7.624897924163321e-08, + "cpu_float32_edges_float64_contraction_vs_float64_maximum_difference": 4.725248914372315e-08, + "gpu_float32_vs_float64_maximum_difference": 4.964999121059854e-05, + "cpu_vs_gpu_float32_maximum_difference": 4.971027374267578e-05, + "maximum_neural_edge_probability_difference": 2.6330936014895556e-08, + "float32_edge_values_above_one_minus_1e6": 0, + "scope": "Precision diagnostic only; the published model is unchanged. Same-device old/new packaged-code compatibility was independently exact." + }, + "priors_only_control_cpu": { + "status": "passed", + "device": "cpu", + "source_sha256": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b", + "records": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 2.7116777896881104, + "priors_only_seconds_warm": 0.13569164276123047 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 3.557781457901001, + "priors_only_seconds_warm": 1.7711329460144043 + } + ], + "scope": "CPU numerical equivalence on supplied training syndromes; timings are not a controlled speed comparison." + } + } + } + ], + "short_syndrome_updates": [ + { + "training": { + "initialization": "256 residual logits per condition initialized independently Normal(0,.01), seeds20261126 through20261133; optimized in this session", + "architecture": "One categorical residual per possible8-bit detection syndrome, added to an exact physical DEM logit; no sample IDs or row indices are model features", + "loss": "Binomial logical BCE sufficient statistics plus strength times cross entropy to the fixed physical prior; damped Newton optimization from random residual initialization", + "fixed_prior": "Exact full-DEM probabilities for all256 possible input syndromes, computed now from the authorized packaged even-fitted DEM plans; no external trained weights or decoder answers", + "training": "All19880 supplied training labels for each of eight d3 one-round conditions; only aggregate counts by detection syndrome enter fitting", + "data_scope": "This is a finite categorical classifier, indexed by detection events, not a per-shot answer table. Other122 conditions retain the incumbent in any candidate benchmark.", + "selection": "One common strength and optional equal probability blend for all eight geometries/bases, minimizing full validation mean; all other conditions unchanged", + "base_package": { + "package": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/package", + "predictions": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/predictions", + "score": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/score.json", + "P": 0.7663217397836538 + }, + "test_data_used": false, + "training_records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 149, + "initial_seed": 20261126, + "physical_plan_sha256": "640c371577096ba08c799b70fd16d03a06a37004feaa15c85c4cb6ef87529080", + "training_arrays_sha256": "a7acd6f6e5372873cf2d34946876a791996238efdea39f7fa33f7d2eabc1c10f" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 157, + "initial_seed": 20261127, + "physical_plan_sha256": "4a0f8f630b7f34fba620a4e03bd77e14fb80149e70b7da80b6176dbd24d9ddc8", + "training_arrays_sha256": "0e2267afc5dc4e761d3b9e09288875f2077215fac2f902ce4151699c38c24531" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 152, + "initial_seed": 20261128, + "physical_plan_sha256": "de8914194be7689d70e9424540923197a5c0465fb42ec96556df97b73ba250c1", + "training_arrays_sha256": "0542609248a5d2c8b410666bb901361b60c39cb8b32b3b46fdd24a6c7913db56" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 147, + "initial_seed": 20261129, + "physical_plan_sha256": "bc1a6888cc5a854f0348cab463b8879c2d176d9509176b944b7f4265e0772ab3", + "training_arrays_sha256": "ccd43f09fba55b2138a5401e6f5c89cc7b4c4ec470a07cd037d9f715acaa1188" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 153, + "initial_seed": 20261130, + "physical_plan_sha256": "1931b5b85d0014c2a928a40c3ec502316ff30ea1632a25c5f64e2694f828434b", + "training_arrays_sha256": "aa27eee730c88b2071b5fd97f9d47a0f3ad010e29202415f786babc073d405e4" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 159, + "initial_seed": 20261131, + "physical_plan_sha256": "6d231f857bbe85040c91af1160c2dda16557a67851deaedc8092412f6abeb294", + "training_arrays_sha256": "569131ce49a2c1060ebd472c0290fc0c1de6e522cd7cd7aa92b10e17cdd1783c" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 158, + "initial_seed": 20261132, + "physical_plan_sha256": "ef285cea44ad63e0452596d4be65c8844ea8a7dcc49fb31b6a6241d367ed63eb", + "training_arrays_sha256": "6928ade685b05f76b7a3a9dc6423504d0bdce09742603c24978aa21fcf106f88" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 160, + "initial_seed": 20261133, + "physical_plan_sha256": "82bee01cf3e00079270a27cb79472322867548df5c9dc4db3252e4c6ec89e6a6", + "training_arrays_sha256": "afbc73fc5ca8e3b8e996377ab3df5a5b9397f36362e72c01feea7848ea1995f3" + } + ], + "records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261126, + "iterations": 8, + "failure": 0.0134765625, + "blended_failure": 0.013671875, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04649575086997129, + "weights_sha256": "d985985dedbe644bfae165330f4f46da14d04efbc4cad1af81c5510115380701" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261126, + "iterations": 6, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04591998541695955, + "weights_sha256": "17383d153dd1dfef62b3d4f6c5b7549c3209150faf0714e78fede09b941ecc3a" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.0458401737684183, + "weights_sha256": "f863a64ca698135f6fac6ac184d3c689db684a15d73bf0565418b240d76b5c58" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.045887733186657405, + "weights_sha256": "ded1a941e0dfc58e55ced6523720445fb70032d2d15c9929b0c93544f7c567f8" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261127, + "iterations": 8, + "failure": 0.0177734375, + "blended_failure": 0.0177734375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05532273244895745, + "weights_sha256": "02950043334a38d3e7980cc97685904338553746653bd2d6a4c9be88ae845270" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261127, + "iterations": 6, + "failure": 0.01875, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055166841080990084, + "weights_sha256": "412ee1f453695e4f3534dbe8d7eb1ca565d06fd7c718b52fe9a306b35e845d9d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261127, + "iterations": 5, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055186840974757456, + "weights_sha256": "12d8f72c2ee5cb837145aaf9a1b485d8517e4374721eebcbea9803d3bfdc8fcd" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261127, + "iterations": 4, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05544033886527203, + "weights_sha256": "d1daa90794c1c3c8cd00134d9b22a7173aee4dd9b139b86f6d3f9b8f2131056d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261128, + "iterations": 7, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.049592331750930654, + "weights_sha256": "ad21a8640e2fe7bbd550225e354dedcbad8cb70433b892f45d28fa2346ab88de" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04900882633372332, + "weights_sha256": "4664564f60149b00b1754a3f9e91c8b04b29ef819b231bf17ea7588346433a57" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04861554683295004, + "weights_sha256": "cad51322361a95020501afa64e356f2a49dd02afa0cd91294d4498f7eb0c5a8d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04843255984360956, + "weights_sha256": "5fe850e6313cb9ed6631697684afeeb7b7c5857a5c74fad66189cfcf8a08218b" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261129, + "iterations": 7, + "failure": 0.0158203125, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05156220348280275, + "weights_sha256": "56c2fd4a7c35033084020cd1f5c9dcc2ab1cf2c631d0e88cc87ac4c715c6af17" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05139675960346585, + "weights_sha256": "0bf66368e18c8d1baecaa614d4c0cec16304ac14bcd29d22d1cdb2a0ff6c0173" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05135569004239689, + "weights_sha256": "d9581a6f29f9d3ea54d482c17995a37b55e3b4253d36e1d49cfce95b398eb5c2" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05141882723288258, + "weights_sha256": "2c4e4592067fcbbe69d6ede68c4494209652a2d510e74aa2ea3b4420c3cdd741" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261130, + "iterations": 7, + "failure": 0.0173828125, + "blended_failure": 0.0173828125, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.054216247940585036, + "weights_sha256": "7b12f028f764293a9496d9fd2ddbf92ba9c23653d7889a602a9ec23f8cde3d6b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261130, + "iterations": 6, + "failure": 0.017578125, + "blended_failure": 0.0171875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05364509063427466, + "weights_sha256": "1ad2ffaafa33009129a0953d79fe2d30ad62308eb9dbf8da0b76eca018a5b55a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261130, + "iterations": 5, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05368896256105915, + "weights_sha256": "64619c9b7bd40a14651bcd056d58f5b55e79eb334a4e5105ff12cb7ff6f2400a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261130, + "iterations": 6, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05387292464104988, + "weights_sha256": "b1490702e212d7cdcc936f55186b15411ced3a8928a1a32f2d4ac1212706fabf" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261131, + "iterations": 8, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04709647994869577, + "weights_sha256": "eb56715dfc5e8c6b8866ceeb2636422acad9992dd2c625355dc21b94c25351f0" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261131, + "iterations": 6, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.046679107084477436, + "weights_sha256": "320cd10cc8cd9d13d20d9ce0ea90413ed8343587f0c77abb0e1c8c84503aa2d8" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261131, + "iterations": 5, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04621785858320204, + "weights_sha256": "c7e63309de0668bd4d5c05169ecd6af1879c88be10947d0fdb958ca37068d433" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261131, + "iterations": 4, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04577880173787941, + "weights_sha256": "494824e979e52fbf0302e706ff6786d89ce60b607afd6b376cad9700f328feda" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261132, + "iterations": 7, + "failure": 0.01484375, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.05068038016752655, + "weights_sha256": "0b4c35df1d44c9353a2ea505205f3def95bb28de0c7052ded18cf599bef2709b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049663607204405706, + "weights_sha256": "b18deed32b51a58789873a1b45718f5c40d1d9500b57e113520b700a66902f1a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261132, + "iterations": 5, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.04918133832768282, + "weights_sha256": "12e71625e223602cbc9f7ae150473a1dad2c32f2d9221a4b88ccb93babc2c41d" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049002647954447996, + "weights_sha256": "e909b83698caba60ad01e28027b28005544cd8e795f88574fc6f81bcf56b2add" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261133, + "iterations": 7, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05204562159505248, + "weights_sha256": "b03b071238dda333574a4da2d9b2bb999cf362a83b9194b1c53871e9438f9f45" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05177096705064832, + "weights_sha256": "2a4c8113ee9a1dadcfc0f1b7ff8d164e7c8771d5764b0512ee1a5de2a8aaa395" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.051861030681133645, + "weights_sha256": "f201491af84870ffa8c1b59e16dea1fea910e7fda32f0e3d82863943222b57ee" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261133, + "iterations": 6, + "failure": 0.01640625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05206536190640361, + "weights_sha256": "b7cfd76b6574457626306868e31ab5327a1950cbbca41f6384eb2c4bc759e800" + } + ], + "choices": { + "incumbent": 0.0154541015625, + "16": 0.015380859375, + "blend-16": 0.015429687499999999, + "64": 0.0155029296875, + "blend-64": 0.015600585937500001, + "256": 0.0155517578125, + "blend-256": 0.015600585937500001, + "1024": 0.0156005859375, + "blend-1024": 0.015600585937500001 + }, + "selected": "16", + "expected_full_P": 0.7663245567908653, + "validation_P_gain": 2.817007211538435e-06, + "source_sha256": "7e75f14190b18b05e9af540a8ef0f75522060e78c30b05475686ea18faf0035f", + "seconds": 3.316046953201294 + }, + "packaging_selection": { + "incumbent": 0.0154541015625, + "16": 0.015380859375, + "64": 0.0155029296875, + "256": 0.0155517578125, + "1024": 0.0156005859375 + }, + "selected": "16", + "selection_scope": "One common prior strength for all eight short conditions; other122 condition predictions retained", + "runtime_source_sha256": "451ce740551f9e13348064f2e726e7e31a611b64bcf5d95def601deb78e854af" + }, + { + "training": { + "initialization": "256 residual logits per condition initialized independently Normal(0,.01), seeds20261126 through20261133; optimized in this session", + "architecture": "One categorical residual per possible8-bit detection syndrome, added to an exact physical DEM logit; no sample IDs or row indices are model features", + "loss": "Binomial logical BCE sufficient statistics plus strength times cross entropy to the fixed physical prior; damped Newton optimization from random residual initialization", + "fixed_prior": "Exact full-DEM probabilities for all256 possible input syndromes, computed now from the authorized packaged even-fitted DEM plans; no external trained weights or decoder answers", + "training": "All19880 supplied training labels for each of eight d3 one-round conditions; only aggregate counts by detection syndrome enter fitting", + "data_scope": "This is a finite categorical classifier, indexed by detection events, not a per-shot answer table. Other122 conditions retain the incumbent in any candidate benchmark.", + "selection": "One common strength and optional equal probability blend for all eight geometries/bases, minimizing full validation mean; all other conditions unchanged", + "base_package": { + "package": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/package", + "predictions": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/predictions", + "score": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/score.json", + "P": 0.7663217397836538 + }, + "test_data_used": false, + "training_records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 149, + "initial_seed": 20261126, + "physical_plan_sha256": "640c371577096ba08c799b70fd16d03a06a37004feaa15c85c4cb6ef87529080", + "training_arrays_sha256": "a7acd6f6e5372873cf2d34946876a791996238efdea39f7fa33f7d2eabc1c10f" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 157, + "initial_seed": 20261127, + "physical_plan_sha256": "4a0f8f630b7f34fba620a4e03bd77e14fb80149e70b7da80b6176dbd24d9ddc8", + "training_arrays_sha256": "0e2267afc5dc4e761d3b9e09288875f2077215fac2f902ce4151699c38c24531" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 152, + "initial_seed": 20261128, + "physical_plan_sha256": "de8914194be7689d70e9424540923197a5c0465fb42ec96556df97b73ba250c1", + "training_arrays_sha256": "0542609248a5d2c8b410666bb901361b60c39cb8b32b3b46fdd24a6c7913db56" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 147, + "initial_seed": 20261129, + "physical_plan_sha256": "bc1a6888cc5a854f0348cab463b8879c2d176d9509176b944b7f4265e0772ab3", + "training_arrays_sha256": "ccd43f09fba55b2138a5401e6f5c89cc7b4c4ec470a07cd037d9f715acaa1188" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 153, + "initial_seed": 20261130, + "physical_plan_sha256": "1931b5b85d0014c2a928a40c3ec502316ff30ea1632a25c5f64e2694f828434b", + "training_arrays_sha256": "aa27eee730c88b2071b5fd97f9d47a0f3ad010e29202415f786babc073d405e4" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 159, + "initial_seed": 20261131, + "physical_plan_sha256": "6d231f857bbe85040c91af1160c2dda16557a67851deaedc8092412f6abeb294", + "training_arrays_sha256": "569131ce49a2c1060ebd472c0290fc0c1de6e522cd7cd7aa92b10e17cdd1783c" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 158, + "initial_seed": 20261132, + "physical_plan_sha256": "ef285cea44ad63e0452596d4be65c8844ea8a7dcc49fb31b6a6241d367ed63eb", + "training_arrays_sha256": "6928ade685b05f76b7a3a9dc6423504d0bdce09742603c24978aa21fcf106f88" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 160, + "initial_seed": 20261133, + "physical_plan_sha256": "82bee01cf3e00079270a27cb79472322867548df5c9dc4db3252e4c6ec89e6a6", + "training_arrays_sha256": "afbc73fc5ca8e3b8e996377ab3df5a5b9397f36362e72c01feea7848ea1995f3" + } + ], + "records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261126, + "iterations": 8, + "failure": 0.0134765625, + "blended_failure": 0.013671875, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04649575086997129, + "weights_sha256": "d985985dedbe644bfae165330f4f46da14d04efbc4cad1af81c5510115380701" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261126, + "iterations": 6, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04591998541695955, + "weights_sha256": "17383d153dd1dfef62b3d4f6c5b7549c3209150faf0714e78fede09b941ecc3a" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.0458401737684183, + "weights_sha256": "f863a64ca698135f6fac6ac184d3c689db684a15d73bf0565418b240d76b5c58" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.045887733186657405, + "weights_sha256": "ded1a941e0dfc58e55ced6523720445fb70032d2d15c9929b0c93544f7c567f8" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261127, + "iterations": 8, + "failure": 0.0177734375, + "blended_failure": 0.0177734375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05532273244895745, + "weights_sha256": "02950043334a38d3e7980cc97685904338553746653bd2d6a4c9be88ae845270" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261127, + "iterations": 6, + "failure": 0.01875, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055166841080990084, + "weights_sha256": "412ee1f453695e4f3534dbe8d7eb1ca565d06fd7c718b52fe9a306b35e845d9d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261127, + "iterations": 5, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055186840974757456, + "weights_sha256": "12d8f72c2ee5cb837145aaf9a1b485d8517e4374721eebcbea9803d3bfdc8fcd" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261127, + "iterations": 4, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05544033886527203, + "weights_sha256": "d1daa90794c1c3c8cd00134d9b22a7173aee4dd9b139b86f6d3f9b8f2131056d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261128, + "iterations": 7, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.049592331750930654, + "weights_sha256": "ad21a8640e2fe7bbd550225e354dedcbad8cb70433b892f45d28fa2346ab88de" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04900882633372332, + "weights_sha256": "4664564f60149b00b1754a3f9e91c8b04b29ef819b231bf17ea7588346433a57" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04861554683295004, + "weights_sha256": "cad51322361a95020501afa64e356f2a49dd02afa0cd91294d4498f7eb0c5a8d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04843255984360956, + "weights_sha256": "5fe850e6313cb9ed6631697684afeeb7b7c5857a5c74fad66189cfcf8a08218b" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261129, + "iterations": 7, + "failure": 0.0158203125, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05156220348280275, + "weights_sha256": "56c2fd4a7c35033084020cd1f5c9dcc2ab1cf2c631d0e88cc87ac4c715c6af17" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05139675960346585, + "weights_sha256": "0bf66368e18c8d1baecaa614d4c0cec16304ac14bcd29d22d1cdb2a0ff6c0173" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05135569004239689, + "weights_sha256": "d9581a6f29f9d3ea54d482c17995a37b55e3b4253d36e1d49cfce95b398eb5c2" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05141882723288258, + "weights_sha256": "2c4e4592067fcbbe69d6ede68c4494209652a2d510e74aa2ea3b4420c3cdd741" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261130, + "iterations": 7, + "failure": 0.0173828125, + "blended_failure": 0.0173828125, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.054216247940585036, + "weights_sha256": "7b12f028f764293a9496d9fd2ddbf92ba9c23653d7889a602a9ec23f8cde3d6b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261130, + "iterations": 6, + "failure": 0.017578125, + "blended_failure": 0.0171875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05364509063427466, + "weights_sha256": "1ad2ffaafa33009129a0953d79fe2d30ad62308eb9dbf8da0b76eca018a5b55a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261130, + "iterations": 5, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05368896256105915, + "weights_sha256": "64619c9b7bd40a14651bcd056d58f5b55e79eb334a4e5105ff12cb7ff6f2400a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261130, + "iterations": 6, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05387292464104988, + "weights_sha256": "b1490702e212d7cdcc936f55186b15411ced3a8928a1a32f2d4ac1212706fabf" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261131, + "iterations": 8, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04709647994869577, + "weights_sha256": "eb56715dfc5e8c6b8866ceeb2636422acad9992dd2c625355dc21b94c25351f0" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261131, + "iterations": 6, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.046679107084477436, + "weights_sha256": "320cd10cc8cd9d13d20d9ce0ea90413ed8343587f0c77abb0e1c8c84503aa2d8" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261131, + "iterations": 5, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04621785858320204, + "weights_sha256": "c7e63309de0668bd4d5c05169ecd6af1879c88be10947d0fdb958ca37068d433" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261131, + "iterations": 4, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04577880173787941, + "weights_sha256": "494824e979e52fbf0302e706ff6786d89ce60b607afd6b376cad9700f328feda" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261132, + "iterations": 7, + "failure": 0.01484375, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.05068038016752655, + "weights_sha256": "0b4c35df1d44c9353a2ea505205f3def95bb28de0c7052ded18cf599bef2709b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049663607204405706, + "weights_sha256": "b18deed32b51a58789873a1b45718f5c40d1d9500b57e113520b700a66902f1a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261132, + "iterations": 5, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.04918133832768282, + "weights_sha256": "12e71625e223602cbc9f7ae150473a1dad2c32f2d9221a4b88ccb93babc2c41d" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049002647954447996, + "weights_sha256": "e909b83698caba60ad01e28027b28005544cd8e795f88574fc6f81bcf56b2add" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261133, + "iterations": 7, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05204562159505248, + "weights_sha256": "b03b071238dda333574a4da2d9b2bb999cf362a83b9194b1c53871e9438f9f45" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05177096705064832, + "weights_sha256": "2a4c8113ee9a1dadcfc0f1b7ff8d164e7c8771d5764b0512ee1a5de2a8aaa395" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.051861030681133645, + "weights_sha256": "f201491af84870ffa8c1b59e16dea1fea910e7fda32f0e3d82863943222b57ee" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261133, + "iterations": 6, + "failure": 0.01640625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05206536190640361, + "weights_sha256": "b7cfd76b6574457626306868e31ab5327a1950cbbca41f6384eb2c4bc759e800" + } + ], + "choices": { + "incumbent": 0.0154541015625, + "16": 0.015380859375, + "blend-16": 0.015429687499999999, + "64": 0.0155029296875, + "blend-64": 0.015600585937500001, + "256": 0.0155517578125, + "blend-256": 0.015600585937500001, + "1024": 0.0156005859375, + "blend-1024": 0.015600585937500001 + }, + "selected": "16", + "expected_full_P": 0.7663245567908653, + "validation_P_gain": 2.817007211538435e-06, + "source_sha256": "7e75f14190b18b05e9af540a8ef0f75522060e78c30b05475686ea18faf0035f", + "seconds": 3.316046953201294 + }, + "packaging_selection": { + "incumbent": 0.0154296875, + "16": 0.015380859375, + "64": 0.0155029296875, + "256": 0.0155517578125, + "1024": 0.0156005859375 + }, + "selected": "16", + "new_optimizer_updates": 0, + "selection_scope": "One common prior strength for all eight short conditions; other122 condition predictions retained", + "runtime_source_sha256": "451ce740551f9e13348064f2e726e7e31a611b64bcf5d95def601deb78e854af" + }, + { + "training": { + "initialization": "256 residual logits per condition initialized independently Normal(0,.01), seeds20261126 through20261133; optimized in this session", + "architecture": "One categorical residual per possible8-bit detection syndrome, added to an exact physical DEM logit; no sample IDs or row indices are model features", + "loss": "Binomial logical BCE sufficient statistics plus strength times cross entropy to the fixed physical prior; damped Newton optimization from random residual initialization", + "fixed_prior": "Exact full-DEM probabilities for all256 possible input syndromes, computed now from the authorized packaged even-fitted DEM plans; no external trained weights or decoder answers", + "training": "All19880 supplied training labels for each of eight d3 one-round conditions; only aggregate counts by detection syndrome enter fitting", + "data_scope": "This is a finite categorical classifier, indexed by detection events, not a per-shot answer table. Other122 conditions retain the incumbent in any candidate benchmark.", + "selection": "One common strength and optional equal probability blend for all eight geometries/bases, minimizing full validation mean; all other conditions unchanged", + "base_package": { + "package": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/package", + "predictions": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/predictions", + "score": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/score.json", + "P": 0.7663217397836538 + }, + "test_data_used": false, + "training_records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 149, + "initial_seed": 20261126, + "physical_plan_sha256": "640c371577096ba08c799b70fd16d03a06a37004feaa15c85c4cb6ef87529080", + "training_arrays_sha256": "a7acd6f6e5372873cf2d34946876a791996238efdea39f7fa33f7d2eabc1c10f" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 157, + "initial_seed": 20261127, + "physical_plan_sha256": "4a0f8f630b7f34fba620a4e03bd77e14fb80149e70b7da80b6176dbd24d9ddc8", + "training_arrays_sha256": "0e2267afc5dc4e761d3b9e09288875f2077215fac2f902ce4151699c38c24531" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 152, + "initial_seed": 20261128, + "physical_plan_sha256": "de8914194be7689d70e9424540923197a5c0465fb42ec96556df97b73ba250c1", + "training_arrays_sha256": "0542609248a5d2c8b410666bb901361b60c39cb8b32b3b46fdd24a6c7913db56" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 147, + "initial_seed": 20261129, + "physical_plan_sha256": "bc1a6888cc5a854f0348cab463b8879c2d176d9509176b944b7f4265e0772ab3", + "training_arrays_sha256": "ccd43f09fba55b2138a5401e6f5c89cc7b4c4ec470a07cd037d9f715acaa1188" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 153, + "initial_seed": 20261130, + "physical_plan_sha256": "1931b5b85d0014c2a928a40c3ec502316ff30ea1632a25c5f64e2694f828434b", + "training_arrays_sha256": "aa27eee730c88b2071b5fd97f9d47a0f3ad010e29202415f786babc073d405e4" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 159, + "initial_seed": 20261131, + "physical_plan_sha256": "6d231f857bbe85040c91af1160c2dda16557a67851deaedc8092412f6abeb294", + "training_arrays_sha256": "569131ce49a2c1060ebd472c0290fc0c1de6e522cd7cd7aa92b10e17cdd1783c" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 158, + "initial_seed": 20261132, + "physical_plan_sha256": "ef285cea44ad63e0452596d4be65c8844ea8a7dcc49fb31b6a6241d367ed63eb", + "training_arrays_sha256": "6928ade685b05f76b7a3a9dc6423504d0bdce09742603c24978aa21fcf106f88" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 160, + "initial_seed": 20261133, + "physical_plan_sha256": "82bee01cf3e00079270a27cb79472322867548df5c9dc4db3252e4c6ec89e6a6", + "training_arrays_sha256": "afbc73fc5ca8e3b8e996377ab3df5a5b9397f36362e72c01feea7848ea1995f3" + } + ], + "records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261126, + "iterations": 8, + "failure": 0.0134765625, + "blended_failure": 0.013671875, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04649575086997129, + "weights_sha256": "d985985dedbe644bfae165330f4f46da14d04efbc4cad1af81c5510115380701" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261126, + "iterations": 6, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04591998541695955, + "weights_sha256": "17383d153dd1dfef62b3d4f6c5b7549c3209150faf0714e78fede09b941ecc3a" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.0458401737684183, + "weights_sha256": "f863a64ca698135f6fac6ac184d3c689db684a15d73bf0565418b240d76b5c58" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.045887733186657405, + "weights_sha256": "ded1a941e0dfc58e55ced6523720445fb70032d2d15c9929b0c93544f7c567f8" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261127, + "iterations": 8, + "failure": 0.0177734375, + "blended_failure": 0.0177734375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05532273244895745, + "weights_sha256": "02950043334a38d3e7980cc97685904338553746653bd2d6a4c9be88ae845270" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261127, + "iterations": 6, + "failure": 0.01875, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055166841080990084, + "weights_sha256": "412ee1f453695e4f3534dbe8d7eb1ca565d06fd7c718b52fe9a306b35e845d9d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261127, + "iterations": 5, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055186840974757456, + "weights_sha256": "12d8f72c2ee5cb837145aaf9a1b485d8517e4374721eebcbea9803d3bfdc8fcd" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261127, + "iterations": 4, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05544033886527203, + "weights_sha256": "d1daa90794c1c3c8cd00134d9b22a7173aee4dd9b139b86f6d3f9b8f2131056d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261128, + "iterations": 7, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.049592331750930654, + "weights_sha256": "ad21a8640e2fe7bbd550225e354dedcbad8cb70433b892f45d28fa2346ab88de" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04900882633372332, + "weights_sha256": "4664564f60149b00b1754a3f9e91c8b04b29ef819b231bf17ea7588346433a57" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04861554683295004, + "weights_sha256": "cad51322361a95020501afa64e356f2a49dd02afa0cd91294d4498f7eb0c5a8d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04843255984360956, + "weights_sha256": "5fe850e6313cb9ed6631697684afeeb7b7c5857a5c74fad66189cfcf8a08218b" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261129, + "iterations": 7, + "failure": 0.0158203125, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05156220348280275, + "weights_sha256": "56c2fd4a7c35033084020cd1f5c9dcc2ab1cf2c631d0e88cc87ac4c715c6af17" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05139675960346585, + "weights_sha256": "0bf66368e18c8d1baecaa614d4c0cec16304ac14bcd29d22d1cdb2a0ff6c0173" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05135569004239689, + "weights_sha256": "d9581a6f29f9d3ea54d482c17995a37b55e3b4253d36e1d49cfce95b398eb5c2" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05141882723288258, + "weights_sha256": "2c4e4592067fcbbe69d6ede68c4494209652a2d510e74aa2ea3b4420c3cdd741" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261130, + "iterations": 7, + "failure": 0.0173828125, + "blended_failure": 0.0173828125, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.054216247940585036, + "weights_sha256": "7b12f028f764293a9496d9fd2ddbf92ba9c23653d7889a602a9ec23f8cde3d6b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261130, + "iterations": 6, + "failure": 0.017578125, + "blended_failure": 0.0171875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05364509063427466, + "weights_sha256": "1ad2ffaafa33009129a0953d79fe2d30ad62308eb9dbf8da0b76eca018a5b55a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261130, + "iterations": 5, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05368896256105915, + "weights_sha256": "64619c9b7bd40a14651bcd056d58f5b55e79eb334a4e5105ff12cb7ff6f2400a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261130, + "iterations": 6, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05387292464104988, + "weights_sha256": "b1490702e212d7cdcc936f55186b15411ced3a8928a1a32f2d4ac1212706fabf" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261131, + "iterations": 8, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04709647994869577, + "weights_sha256": "eb56715dfc5e8c6b8866ceeb2636422acad9992dd2c625355dc21b94c25351f0" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261131, + "iterations": 6, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.046679107084477436, + "weights_sha256": "320cd10cc8cd9d13d20d9ce0ea90413ed8343587f0c77abb0e1c8c84503aa2d8" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261131, + "iterations": 5, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04621785858320204, + "weights_sha256": "c7e63309de0668bd4d5c05169ecd6af1879c88be10947d0fdb958ca37068d433" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261131, + "iterations": 4, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04577880173787941, + "weights_sha256": "494824e979e52fbf0302e706ff6786d89ce60b607afd6b376cad9700f328feda" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261132, + "iterations": 7, + "failure": 0.01484375, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.05068038016752655, + "weights_sha256": "0b4c35df1d44c9353a2ea505205f3def95bb28de0c7052ded18cf599bef2709b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049663607204405706, + "weights_sha256": "b18deed32b51a58789873a1b45718f5c40d1d9500b57e113520b700a66902f1a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261132, + "iterations": 5, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.04918133832768282, + "weights_sha256": "12e71625e223602cbc9f7ae150473a1dad2c32f2d9221a4b88ccb93babc2c41d" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049002647954447996, + "weights_sha256": "e909b83698caba60ad01e28027b28005544cd8e795f88574fc6f81bcf56b2add" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261133, + "iterations": 7, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05204562159505248, + "weights_sha256": "b03b071238dda333574a4da2d9b2bb999cf362a83b9194b1c53871e9438f9f45" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05177096705064832, + "weights_sha256": "2a4c8113ee9a1dadcfc0f1b7ff8d164e7c8771d5764b0512ee1a5de2a8aaa395" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.051861030681133645, + "weights_sha256": "f201491af84870ffa8c1b59e16dea1fea910e7fda32f0e3d82863943222b57ee" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261133, + "iterations": 6, + "failure": 0.01640625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05206536190640361, + "weights_sha256": "b7cfd76b6574457626306868e31ab5327a1950cbbca41f6384eb2c4bc759e800" + } + ], + "choices": { + "incumbent": 0.0154541015625, + "16": 0.015380859375, + "blend-16": 0.015429687499999999, + "64": 0.0155029296875, + "blend-64": 0.015600585937500001, + "256": 0.0155517578125, + "blend-256": 0.015600585937500001, + "1024": 0.0156005859375, + "blend-1024": 0.015600585937500001 + }, + "selected": "16", + "expected_full_P": 0.7663245567908653, + "validation_P_gain": 2.817007211538435e-06, + "source_sha256": "7e75f14190b18b05e9af540a8ef0f75522060e78c30b05475686ea18faf0035f", + "seconds": 3.316046953201294 + }, + "packaging_selection": { + "incumbent": 0.0155517578125, + "16": 0.015380859375, + "64": 0.0155029296875, + "256": 0.0155517578125, + "1024": 0.0156005859375 + }, + "selected": "16", + "new_optimizer_updates": 0, + "selection_scope": "One common prior strength for all eight short conditions; other122 condition predictions retained", + "runtime_source_sha256": "451ce740551f9e13348064f2e726e7e31a611b64bcf5d95def601deb78e854af" + } + ], + "research_selection_history": { + "path": "selection_history.json", + "sha256": "843e686c59c2f32d1081c1786edaf534d7aebe52ffc452150eed62c921c71f25", + "completed_training_runs": 50, + "assembled_candidates": 38 + }, + "runtime_projection": { + "measured_full_validation_seconds_by_distance": { + "d3": 68.0347409248352, + "d5": 312.38163661956787 + }, + "validation_shots_per_condition": 5120, + "benchmark_shots_per_condition": 25000, + "workload_source": "Supplied data/README.md declares 25000 benchmark rows per condition; no benchmark examples accessed", + "linear_scale": 4.8828125, + "projected_total_seconds": 1857.5018434785306, + "limit_seconds": 3600, + "interpretation": "Projection from complete validation replays, scaling startup/compilation overhead as well as shot work. Retained-path timings are inherited; one-round categorical replacements only remove contractions. This is not a timed benchmark-split run." + }, + "neural_probability_ensemble": { + "new_optimizer_updates": 0, + "new_trainable_parameters": 0, + "initialization": "Constituents trained from random initialization in this session; this step only averages their predicted probabilities.", + "new_training": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261271", + "prior_pass": 3, + "initial_seed": 20261271, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 466919, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18000, + "surface_code_bX_d5_r03_center_5_5": 18251, + "surface_code_bX_d5_r05_center_5_5": 18224, + "surface_code_bX_d5_r07_center_5_5": 17881, + "surface_code_bX_d5_r09_center_5_5": 18247, + "surface_code_bX_d5_r11_center_5_5": 17452, + "surface_code_bX_d5_r13_center_5_5": 17982, + "surface_code_bX_d5_r15_center_5_5": 17498, + "surface_code_bX_d5_r17_center_5_5": 18487, + "surface_code_bX_d5_r19_center_5_5": 18100, + "surface_code_bX_d5_r21_center_5_5": 17622, + "surface_code_bX_d5_r23_center_5_5": 17449, + "surface_code_bX_d5_r25_center_5_5": 17739, + "surface_code_bZ_d5_r01_center_5_5": 16689, + "surface_code_bZ_d5_r03_center_5_5": 18119, + "surface_code_bZ_d5_r05_center_5_5": 18146, + "surface_code_bZ_d5_r07_center_5_5": 18185, + "surface_code_bZ_d5_r09_center_5_5": 18473, + "surface_code_bZ_d5_r11_center_5_5": 18636, + "surface_code_bZ_d5_r13_center_5_5": 18474, + "surface_code_bZ_d5_r15_center_5_5": 17779, + "surface_code_bZ_d5_r17_center_5_5": 18474, + "surface_code_bZ_d5_r19_center_5_5": 17306, + "surface_code_bZ_d5_r21_center_5_5": 17165, + "surface_code_bZ_d5_r23_center_5_5": 18616, + "surface_code_bZ_d5_r25_center_5_5": 17925 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1536, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261272, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "/run-state/workspace/research/learned_d5/reserved1_warm/rng-512.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/reserved1_warm/weights-512.npz", + "starting_checkpoint_sha256": "1adc47acc35148d4260df25e25384124609d2b1e098ffcf30a1eccea55ef8712", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261271", + "prior_pass": 3, + "initial_seed": 20261271, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 317613, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 14297, + "surface_code_bX_d5_r03_center_5_5": 11305, + "surface_code_bX_d5_r05_center_5_5": 12479, + "surface_code_bX_d5_r07_center_5_5": 10433, + "surface_code_bX_d5_r09_center_5_5": 10919, + "surface_code_bX_d5_r11_center_5_5": 12516, + "surface_code_bX_d5_r13_center_5_5": 12043, + "surface_code_bX_d5_r15_center_5_5": 12143, + "surface_code_bX_d5_r17_center_5_5": 11354, + "surface_code_bX_d5_r19_center_5_5": 13660, + "surface_code_bX_d5_r21_center_5_5": 13753, + "surface_code_bX_d5_r23_center_5_5": 12161, + "surface_code_bX_d5_r25_center_5_5": 12531, + "surface_code_bZ_d5_r01_center_5_5": 11397, + "surface_code_bZ_d5_r03_center_5_5": 9053, + "surface_code_bZ_d5_r05_center_5_5": 13723, + "surface_code_bZ_d5_r07_center_5_5": 14763, + "surface_code_bZ_d5_r09_center_5_5": 10969, + "surface_code_bZ_d5_r11_center_5_5": 12129, + "surface_code_bZ_d5_r13_center_5_5": 10020, + "surface_code_bZ_d5_r15_center_5_5": 13170, + "surface_code_bZ_d5_r17_center_5_5": 14946, + "surface_code_bZ_d5_r19_center_5_5": 10579, + "surface_code_bZ_d5_r21_center_5_5": 11745, + "surface_code_bZ_d5_r23_center_5_5": 12426, + "surface_code_bZ_d5_r25_center_5_5": 13099 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 512, + "batch": 1024, + "learning_rate": 0.001, + "sampling_seed": 20261272, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "rng_restored": false, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "Fresh NumPy default_rng seed 20261272", + "starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "starting_training_provenance": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.1412775069475174, + "objective": 0.1412775069475174, + "error": 0.0595703125, + "gradient_norm": 0.030735325068235397, + "elapsed": 28.457472801208496 + }, + { + "step": 16, + "loss": 0.6315727233886719, + "objective": 0.6315727233886719, + "error": 0.384765625, + "gradient_norm": 0.06563512235879898, + "elapsed": 47.886730670928955 + }, + { + "step": 32, + "loss": 0.5130410194396973, + "objective": 0.5130410194396973, + "error": 0.263671875, + "gradient_norm": 0.10626910626888275, + "elapsed": 60.16136598587036 + }, + { + "step": 48, + "loss": 0.6413166522979736, + "objective": 0.6413166522979736, + "error": 0.408203125, + "gradient_norm": 0.03790846839547157, + "elapsed": 70.9611382484436 + }, + { + "step": 64, + "loss": 0.5491592884063721, + "objective": 0.5491592884063721, + "error": 0.2939453125, + "gradient_norm": 0.093081034719944, + "elapsed": 81.46673464775085 + }, + { + "step": 80, + "loss": 0.6315242648124695, + "objective": 0.6315242648124695, + "error": 0.359375, + "gradient_norm": 0.0384257510304451, + "elapsed": 91.71172666549683 + }, + { + "step": 96, + "loss": 0.6311566829681396, + "objective": 0.6311566829681396, + "error": 0.3798828125, + "gradient_norm": 0.03731638938188553, + "elapsed": 100.83252763748169 + }, + { + "step": 112, + "loss": 0.5327925682067871, + "objective": 0.5327925682067871, + "error": 0.29296875, + "gradient_norm": 0.11202990263700485, + "elapsed": 111.35073852539062 + }, + { + "step": 128, + "loss": 0.6284654140472412, + "objective": 0.6284654140472412, + "error": 0.3740234375, + "gradient_norm": 0.03215613588690758, + "elapsed": 121.32994651794434 + }, + { + "step": 144, + "loss": 0.33964547514915466, + "objective": 0.33964547514915466, + "error": 0.1259765625, + "gradient_norm": 0.05133189633488655, + "elapsed": 131.2744882106781 + }, + { + "step": 160, + "loss": 0.14193454384803772, + "objective": 0.14193454384803772, + "error": 0.0478515625, + "gradient_norm": 0.03264402225613594, + "elapsed": 139.58473920822144 + }, + { + "step": 176, + "loss": 0.14203950762748718, + "objective": 0.14203950762748718, + "error": 0.0654296875, + "gradient_norm": 0.022548990324139595, + "elapsed": 148.9861602783203 + }, + { + "step": 192, + "loss": 0.6307225227355957, + "objective": 0.6307225227355957, + "error": 0.3955078125, + "gradient_norm": 0.08607082068920135, + "elapsed": 162.27514505386353 + }, + { + "step": 208, + "loss": 0.16193106770515442, + "objective": 0.16193106770515442, + "error": 0.064453125, + "gradient_norm": 0.023293493315577507, + "elapsed": 173.59824013710022 + }, + { + "step": 224, + "loss": 0.5426318049430847, + "objective": 0.5426318049430847, + "error": 0.3037109375, + "gradient_norm": 0.03944721072912216, + "elapsed": 182.70232272148132 + }, + { + "step": 240, + "loss": 0.6270365715026855, + "objective": 0.6270365715026855, + "error": 0.3896484375, + "gradient_norm": 0.14661568403244019, + "elapsed": 193.759183883667 + }, + { + "step": 256, + "loss": 0.4933152198791504, + "objective": 0.4933152198791504, + "error": 0.2724609375, + "gradient_norm": 0.1065438985824585, + "elapsed": 205.62959718704224 + }, + { + "step": 272, + "loss": 0.3671969473361969, + "objective": 0.3671969473361969, + "error": 0.177734375, + "gradient_norm": 0.05156548321247101, + "elapsed": 222.249596118927 + }, + { + "step": 288, + "loss": 0.5478869676589966, + "objective": 0.5478869676589966, + "error": 0.3203125, + "gradient_norm": 0.08357688039541245, + "elapsed": 232.2198715209961 + }, + { + "step": 304, + "loss": 0.21171918511390686, + "objective": 0.21171918511390686, + "error": 0.0849609375, + "gradient_norm": 0.06231697276234627, + "elapsed": 241.07631373405457 + }, + { + "step": 320, + "loss": 0.5333335995674133, + "objective": 0.5333335995674133, + "error": 0.2861328125, + "gradient_norm": 0.08931853622198105, + "elapsed": 251.28962755203247 + }, + { + "step": 336, + "loss": 0.12485946714878082, + "objective": 0.12485946714878082, + "error": 0.046875, + "gradient_norm": 0.018839582800865173, + "elapsed": 262.3605041503906 + }, + { + "step": 352, + "loss": 0.2334863245487213, + "objective": 0.2334863245487213, + "error": 0.09765625, + "gradient_norm": 0.03669576346874237, + "elapsed": 273.16373229026794 + }, + { + "step": 368, + "loss": 0.5818328857421875, + "objective": 0.5818328857421875, + "error": 0.3232421875, + "gradient_norm": 0.09833699464797974, + "elapsed": 282.8677294254303 + }, + { + "step": 384, + "loss": 0.6228232383728027, + "objective": 0.6228232383728027, + "error": 0.3671875, + "gradient_norm": 0.033418990671634674, + "elapsed": 295.04902839660645 + }, + { + "step": 400, + "loss": 0.5749450922012329, + "objective": 0.5749450922012329, + "error": 0.333984375, + "gradient_norm": 0.04644288495182991, + "elapsed": 306.67032837867737 + }, + { + "step": 416, + "loss": 0.46251457929611206, + "objective": 0.46251457929611206, + "error": 0.2216796875, + "gradient_norm": 0.06633804738521576, + "elapsed": 317.759464263916 + }, + { + "step": 432, + "loss": 0.5577508211135864, + "objective": 0.5577508211135864, + "error": 0.30859375, + "gradient_norm": 0.0970199704170227, + "elapsed": 327.4626543521881 + }, + { + "step": 448, + "loss": 0.11625733226537704, + "objective": 0.11625733226537704, + "error": 0.0419921875, + "gradient_norm": 0.020417485386133194, + "elapsed": 336.3522970676422 + }, + { + "step": 464, + "loss": 0.23657961189746857, + "objective": 0.23657961189746857, + "error": 0.1025390625, + "gradient_norm": 0.03908605873584747, + "elapsed": 344.3832321166992 + }, + { + "step": 480, + "loss": 0.011504358612000942, + "objective": 0.011504358612000942, + "error": 0.00390625, + "gradient_norm": 0.006708688102662563, + "elapsed": 355.18855381011963 + }, + { + "step": 496, + "loss": 0.3410624563694, + "objective": 0.3410624563694, + "error": 0.1533203125, + "gradient_norm": 0.05804387852549553, + "elapsed": 366.2978138923645 + }, + { + "step": 512, + "loss": 0.034005306661129, + "objective": 0.034005306661129, + "error": 0.0107421875, + "gradient_norm": 0.01019973959773779, + "elapsed": 375.73491764068604 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved1_warm", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "b31e8f5ee2b5ea1b661e6bf8b5649bec45b7ab5da74fe9de46e4d06846356b87", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 256, + 512 + ], + "training_draws": 524288, + "distinct_phase_training_rows": 317613, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 14297, + "surface_code_bX_d5_r03_center_5_5": 11305, + "surface_code_bX_d5_r05_center_5_5": 12479, + "surface_code_bX_d5_r07_center_5_5": 10433, + "surface_code_bX_d5_r09_center_5_5": 10919, + "surface_code_bX_d5_r11_center_5_5": 12516, + "surface_code_bX_d5_r13_center_5_5": 12043, + "surface_code_bX_d5_r15_center_5_5": 12143, + "surface_code_bX_d5_r17_center_5_5": 11354, + "surface_code_bX_d5_r19_center_5_5": 13660, + "surface_code_bX_d5_r21_center_5_5": 13753, + "surface_code_bX_d5_r23_center_5_5": 12161, + "surface_code_bX_d5_r25_center_5_5": 12531, + "surface_code_bZ_d5_r01_center_5_5": 11397, + "surface_code_bZ_d5_r03_center_5_5": 9053, + "surface_code_bZ_d5_r05_center_5_5": 13723, + "surface_code_bZ_d5_r07_center_5_5": 14763, + "surface_code_bZ_d5_r09_center_5_5": 10969, + "surface_code_bZ_d5_r11_center_5_5": 12129, + "surface_code_bZ_d5_r13_center_5_5": 10020, + "surface_code_bZ_d5_r15_center_5_5": 13170, + "surface_code_bZ_d5_r17_center_5_5": 14946, + "surface_code_bZ_d5_r19_center_5_5": 10579, + "surface_code_bZ_d5_r21_center_5_5": 11745, + "surface_code_bZ_d5_r23_center_5_5": 12426, + "surface_code_bZ_d5_r25_center_5_5": 13099 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 512, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.5523660182952881, + "objective": 0.5523660182952881, + "error": 0.30859375, + "gradient_norm": 0.05200070142745972, + "elapsed": 30.08410096168518 + }, + { + "step": 16, + "loss": 0.5380295515060425, + "objective": 0.5380295515060425, + "error": 0.306640625, + "gradient_norm": 0.0804876759648323, + "elapsed": 50.77648210525513 + }, + { + "step": 32, + "loss": 0.6359301805496216, + "objective": 0.6359301805496216, + "error": 0.3837890625, + "gradient_norm": 0.059380218386650085, + "elapsed": 59.453776836395264 + }, + { + "step": 48, + "loss": 0.2540435492992401, + "objective": 0.2540435492992401, + "error": 0.1083984375, + "gradient_norm": 0.04367281496524811, + "elapsed": 67.29314041137695 + }, + { + "step": 64, + "loss": 0.5867692232131958, + "objective": 0.5867692232131958, + "error": 0.3447265625, + "gradient_norm": 0.053885214030742645, + "elapsed": 78.74847197532654 + }, + { + "step": 80, + "loss": 0.6015321016311646, + "objective": 0.6015321016311646, + "error": 0.365234375, + "gradient_norm": 0.04807985574007034, + "elapsed": 90.48145818710327 + }, + { + "step": 96, + "loss": 0.49287766218185425, + "objective": 0.49287766218185425, + "error": 0.271484375, + "gradient_norm": 0.07899080961942673, + "elapsed": 101.65468978881836 + }, + { + "step": 112, + "loss": 0.3271353542804718, + "objective": 0.3271353542804718, + "error": 0.15234375, + "gradient_norm": 0.049542222172021866, + "elapsed": 111.14713263511658 + }, + { + "step": 128, + "loss": 0.50013667345047, + "objective": 0.50013667345047, + "error": 0.271484375, + "gradient_norm": 0.06454745680093765, + "elapsed": 121.21207547187805 + }, + { + "step": 144, + "loss": 0.028576843440532684, + "objective": 0.028576843440532684, + "error": 0.0087890625, + "gradient_norm": 0.010781333781778812, + "elapsed": 130.69302248954773 + }, + { + "step": 160, + "loss": 0.5668779015541077, + "objective": 0.5668779015541077, + "error": 0.330078125, + "gradient_norm": 0.06098390743136406, + "elapsed": 142.14290237426758 + }, + { + "step": 176, + "loss": 0.3986494839191437, + "objective": 0.3986494839191437, + "error": 0.1884765625, + "gradient_norm": 0.042795032262802124, + "elapsed": 152.75753688812256 + }, + { + "step": 192, + "loss": 0.31897079944610596, + "objective": 0.31897079944610596, + "error": 0.142578125, + "gradient_norm": 0.040675707161426544, + "elapsed": 160.04981398582458 + }, + { + "step": 208, + "loss": 0.5092275142669678, + "objective": 0.5092275142669678, + "error": 0.255859375, + "gradient_norm": 0.07929783314466476, + "elapsed": 169.85345673561096 + }, + { + "step": 224, + "loss": 0.35782667994499207, + "objective": 0.35782667994499207, + "error": 0.1748046875, + "gradient_norm": 0.05785144120454788, + "elapsed": 179.90323066711426 + }, + { + "step": 240, + "loss": 0.5660895109176636, + "objective": 0.5660895109176636, + "error": 0.3349609375, + "gradient_norm": 0.10684454441070557, + "elapsed": 191.3668942451477 + }, + { + "step": 256, + "loss": 0.6265910863876343, + "objective": 0.6265910863876343, + "error": 0.3779296875, + "gradient_norm": 0.034383758902549744, + "elapsed": 200.3055775165558 + }, + { + "step": 272, + "loss": 0.6210677623748779, + "objective": 0.6210677623748779, + "error": 0.369140625, + "gradient_norm": 0.04434216767549515, + "elapsed": 210.09376430511475 + }, + { + "step": 288, + "loss": 0.4892377257347107, + "objective": 0.4892377257347107, + "error": 0.2490234375, + "gradient_norm": 0.1040654331445694, + "elapsed": 220.45881819725037 + }, + { + "step": 304, + "loss": 0.6407739520072937, + "objective": 0.6407739520072937, + "error": 0.3916015625, + "gradient_norm": 0.07782924920320511, + "elapsed": 233.3719048500061 + }, + { + "step": 320, + "loss": 0.4752756953239441, + "objective": 0.4752756953239441, + "error": 0.263671875, + "gradient_norm": 0.051829319447278976, + "elapsed": 244.25844407081604 + }, + { + "step": 336, + "loss": 0.6482080221176147, + "objective": 0.6482080221176147, + "error": 0.41015625, + "gradient_norm": 0.04979892820119858, + "elapsed": 253.1897099018097 + }, + { + "step": 352, + "loss": 0.34022292494773865, + "objective": 0.34022292494773865, + "error": 0.1708984375, + "gradient_norm": 0.09951864182949066, + "elapsed": 264.0781395435333 + }, + { + "step": 368, + "loss": 0.3494992256164551, + "objective": 0.3494992256164551, + "error": 0.15625, + "gradient_norm": 0.10392706841230392, + "elapsed": 275.8111581802368 + }, + { + "step": 384, + "loss": 0.47191378474235535, + "objective": 0.47191378474235535, + "error": 0.25, + "gradient_norm": 0.07366786152124405, + "elapsed": 283.9459602832794 + }, + { + "step": 400, + "loss": 0.583655595779419, + "objective": 0.583655595779419, + "error": 0.3623046875, + "gradient_norm": 0.10394527018070221, + "elapsed": 294.3349726200104 + }, + { + "step": 416, + "loss": 0.6212975978851318, + "objective": 0.6212975978851318, + "error": 0.37109375, + "gradient_norm": 0.054796766489744186, + "elapsed": 304.7477548122406 + }, + { + "step": 432, + "loss": 0.4719577431678772, + "objective": 0.4719577431678772, + "error": 0.2431640625, + "gradient_norm": 0.05418012663722038, + "elapsed": 315.91914200782776 + }, + { + "step": 448, + "loss": 0.5696494579315186, + "objective": 0.5696494579315186, + "error": 0.3330078125, + "gradient_norm": 0.047046076506376266, + "elapsed": 324.96326184272766 + }, + { + "step": 464, + "loss": 0.613875687122345, + "objective": 0.613875687122345, + "error": 0.34765625, + "gradient_norm": 0.05237002298235893, + "elapsed": 334.7670781612396 + }, + { + "step": 480, + "loss": 0.28741705417633057, + "objective": 0.28741705417633057, + "error": 0.1240234375, + "gradient_norm": 0.05365394428372383, + "elapsed": 344.03080439567566 + }, + { + "step": 496, + "loss": 0.3729455769062042, + "objective": 0.3729455769062042, + "error": 0.1875, + "gradient_norm": 0.05905403569340706, + "elapsed": 356.01581716537476 + }, + { + "step": 512, + "loss": 0.38685142993927, + "objective": 0.38685142993927, + "error": 0.17578125, + "gradient_norm": 0.048455506563186646, + "elapsed": 367.7296392917633 + }, + { + "step": 528, + "loss": 0.6062720417976379, + "objective": 0.6062720417976379, + "error": 0.369140625, + "gradient_norm": 0.07544548809528351, + "elapsed": 385.4480962753296 + }, + { + "step": 544, + "loss": 0.520085871219635, + "objective": 0.520085871219635, + "error": 0.279296875, + "gradient_norm": 0.08394371718168259, + "elapsed": 397.71993708610535 + }, + { + "step": 560, + "loss": 0.5944540500640869, + "objective": 0.5944540500640869, + "error": 0.3544921875, + "gradient_norm": 0.05468091368675232, + "elapsed": 406.9417428970337 + }, + { + "step": 576, + "loss": 0.34102559089660645, + "objective": 0.34102559089660645, + "error": 0.1611328125, + "gradient_norm": 0.07333917915821075, + "elapsed": 417.0068130493164 + }, + { + "step": 592, + "loss": 0.47373664379119873, + "objective": 0.47373664379119873, + "error": 0.2412109375, + "gradient_norm": 0.05662858858704567, + "elapsed": 425.1176447868347 + }, + { + "step": 608, + "loss": 0.48517894744873047, + "objective": 0.48517894744873047, + "error": 0.25, + "gradient_norm": 0.08127480745315552, + "elapsed": 434.92080903053284 + }, + { + "step": 624, + "loss": 0.39865612983703613, + "objective": 0.39865612983703613, + "error": 0.1904296875, + "gradient_norm": 0.07332058995962143, + "elapsed": 446.6602101325989 + }, + { + "step": 640, + "loss": 0.41867297887802124, + "objective": 0.41867297887802124, + "error": 0.2177734375, + "gradient_norm": 0.07386308163404465, + "elapsed": 457.0243580341339 + }, + { + "step": 656, + "loss": 0.5108687877655029, + "objective": 0.5108687877655029, + "error": 0.2822265625, + "gradient_norm": 0.052080318331718445, + "elapsed": 469.5842761993408 + }, + { + "step": 672, + "loss": 0.5043742656707764, + "objective": 0.5043742656707764, + "error": 0.2734375, + "gradient_norm": 0.047204963862895966, + "elapsed": 479.356397151947 + }, + { + "step": 688, + "loss": 0.5550935864448547, + "objective": 0.5550935864448547, + "error": 0.30078125, + "gradient_norm": 0.04080262407660484, + "elapsed": 489.9912152290344 + }, + { + "step": 704, + "loss": 0.5698974132537842, + "objective": 0.5698974132537842, + "error": 0.322265625, + "gradient_norm": 0.10692963004112244, + "elapsed": 500.3283371925354 + }, + { + "step": 720, + "loss": 0.45870622992515564, + "objective": 0.45870622992515564, + "error": 0.2255859375, + "gradient_norm": 0.06705734878778458, + "elapsed": 509.82279753685 + }, + { + "step": 736, + "loss": 0.555386483669281, + "objective": 0.555386483669281, + "error": 0.31640625, + "gradient_norm": 0.05112688988447189, + "elapsed": 518.507036447525 + }, + { + "step": 752, + "loss": 0.14282986521720886, + "objective": 0.14282986521720886, + "error": 0.056640625, + "gradient_norm": 0.03209136053919792, + "elapsed": 529.1373023986816 + }, + { + "step": 768, + "loss": 0.5362129807472229, + "objective": 0.5362129807472229, + "error": 0.2841796875, + "gradient_norm": 0.049996186047792435, + "elapsed": 538.9186007976532 + }, + { + "step": 784, + "loss": 0.5071826577186584, + "objective": 0.5071826577186584, + "error": 0.2744140625, + "gradient_norm": 0.04826078191399574, + "elapsed": 549.5225830078125 + }, + { + "step": 800, + "loss": 0.24775367975234985, + "objective": 0.24775367975234985, + "error": 0.107421875, + "gradient_norm": 0.06889795511960983, + "elapsed": 560.7170543670654 + }, + { + "step": 816, + "loss": 0.17432856559753418, + "objective": 0.17432856559753418, + "error": 0.06640625, + "gradient_norm": 0.05147368833422661, + "elapsed": 570.7887880802155 + }, + { + "step": 832, + "loss": 0.5410823822021484, + "objective": 0.5410823822021484, + "error": 0.3115234375, + "gradient_norm": 0.11862928420305252, + "elapsed": 581.9721121788025 + }, + { + "step": 848, + "loss": 0.5555508732795715, + "objective": 0.5555508732795715, + "error": 0.296875, + "gradient_norm": 0.060369592159986496, + "elapsed": 592.2823219299316 + }, + { + "step": 864, + "loss": 0.31839215755462646, + "objective": 0.31839215755462646, + "error": 0.1552734375, + "gradient_norm": 0.063877172768116, + "elapsed": 603.1910541057587 + }, + { + "step": 880, + "loss": 0.481766939163208, + "objective": 0.481766939163208, + "error": 0.2470703125, + "gradient_norm": 0.1623816341161728, + "elapsed": 614.4277107715607 + }, + { + "step": 896, + "loss": 0.5780366659164429, + "objective": 0.5780366659164429, + "error": 0.3037109375, + "gradient_norm": 0.06694691628217697, + "elapsed": 623.9365792274475 + }, + { + "step": 912, + "loss": 0.4794909358024597, + "objective": 0.4794909358024597, + "error": 0.2314453125, + "gradient_norm": 0.07813122123479843, + "elapsed": 633.9845306873322 + }, + { + "step": 928, + "loss": 0.6279138922691345, + "objective": 0.6279138922691345, + "error": 0.380859375, + "gradient_norm": 0.047679927200078964, + "elapsed": 643.7766675949097 + }, + { + "step": 944, + "loss": 0.6401606798171997, + "objective": 0.6401606798171997, + "error": 0.3994140625, + "gradient_norm": 0.07329051941633224, + "elapsed": 655.2369928359985 + }, + { + "step": 960, + "loss": 0.4340277910232544, + "objective": 0.4340277910232544, + "error": 0.2158203125, + "gradient_norm": 0.11762503534555435, + "elapsed": 666.9884371757507 + }, + { + "step": 976, + "loss": 0.44496864080429077, + "objective": 0.44496864080429077, + "error": 0.2236328125, + "gradient_norm": 0.05260347202420235, + "elapsed": 677.3464586734772 + }, + { + "step": 992, + "loss": 0.13230293989181519, + "objective": 0.13230293989181519, + "error": 0.05078125, + "gradient_norm": 0.030240925028920174, + "elapsed": 685.7275724411011 + }, + { + "step": 1008, + "loss": 0.2971688508987427, + "objective": 0.2971688508987427, + "error": 0.1171875, + "gradient_norm": 0.05503479763865471, + "elapsed": 694.1270356178284 + }, + { + "step": 1024, + "loss": 0.5688735246658325, + "objective": 0.5688735246658325, + "error": 0.314453125, + "gradient_norm": 0.06526188552379608, + "elapsed": 703.9192817211151 + }, + { + "step": 1040, + "loss": 0.42805811762809753, + "objective": 0.42805811762809753, + "error": 0.2080078125, + "gradient_norm": 0.13000032305717468, + "elapsed": 720.145961523056 + }, + { + "step": 1056, + "loss": 0.5543602705001831, + "objective": 0.5543602705001831, + "error": 0.298828125, + "gradient_norm": 0.15922385454177856, + "elapsed": 733.5112845897675 + }, + { + "step": 1072, + "loss": 0.031130114570260048, + "objective": 0.031130114570260048, + "error": 0.013671875, + "gradient_norm": 0.008926023729145527, + "elapsed": 742.4467866420746 + }, + { + "step": 1088, + "loss": 0.14947748184204102, + "objective": 0.14947748184204102, + "error": 0.056640625, + "gradient_norm": 0.03975249081850052, + "elapsed": 751.8575854301453 + }, + { + "step": 1104, + "loss": 0.6275734901428223, + "objective": 0.6275734901428223, + "error": 0.3671875, + "gradient_norm": 0.08096148073673248, + "elapsed": 761.5625903606415 + }, + { + "step": 1120, + "loss": 0.23923414945602417, + "objective": 0.23923414945602417, + "error": 0.0966796875, + "gradient_norm": 0.03325376287102699, + "elapsed": 773.9633615016937 + }, + { + "step": 1136, + "loss": 0.570243239402771, + "objective": 0.570243239402771, + "error": 0.31640625, + "gradient_norm": 0.07534287869930267, + "elapsed": 783.1533136367798 + }, + { + "step": 1152, + "loss": 0.4264270067214966, + "objective": 0.4264270067214966, + "error": 0.2119140625, + "gradient_norm": 0.08900073170661926, + "elapsed": 792.1710996627808 + }, + { + "step": 1168, + "loss": 0.5958121418952942, + "objective": 0.5958121418952942, + "error": 0.3583984375, + "gradient_norm": 0.08239343762397766, + "elapsed": 803.1175289154053 + }, + { + "step": 1184, + "loss": 0.2909137010574341, + "objective": 0.2909137010574341, + "error": 0.1416015625, + "gradient_norm": 0.05281354859471321, + "elapsed": 812.6055159568787 + }, + { + "step": 1200, + "loss": 0.6119058728218079, + "objective": 0.6119058728218079, + "error": 0.36328125, + "gradient_norm": 0.056254416704177856, + "elapsed": 823.2276427745819 + }, + { + "step": 1216, + "loss": 0.13595536351203918, + "objective": 0.13595536351203918, + "error": 0.0556640625, + "gradient_norm": 0.04057573154568672, + "elapsed": 834.1696293354034 + }, + { + "step": 1232, + "loss": 0.5840731263160706, + "objective": 0.5840731263160706, + "error": 0.328125, + "gradient_norm": 0.054566267877817154, + "elapsed": 845.3501887321472 + }, + { + "step": 1248, + "loss": 0.3053072690963745, + "objective": 0.3053072690963745, + "error": 0.1337890625, + "gradient_norm": 0.04617297649383545, + "elapsed": 854.9564871788025 + }, + { + "step": 1264, + "loss": 0.6288673281669617, + "objective": 0.6288673281669617, + "error": 0.3994140625, + "gradient_norm": 0.08229745179414749, + "elapsed": 864.8914043903351 + }, + { + "step": 1280, + "loss": 0.5586361289024353, + "objective": 0.5586361289024353, + "error": 0.2958984375, + "gradient_norm": 0.05713959410786629, + "elapsed": 877.0349607467651 + }, + { + "step": 1296, + "loss": 0.3648858666419983, + "objective": 0.3648858666419983, + "error": 0.16796875, + "gradient_norm": 0.08502963185310364, + "elapsed": 888.5764675140381 + }, + { + "step": 1312, + "loss": 0.4747084081172943, + "objective": 0.4747084081172943, + "error": 0.244140625, + "gradient_norm": 0.08609883487224579, + "elapsed": 899.7598609924316 + }, + { + "step": 1328, + "loss": 0.15583917498588562, + "objective": 0.15583917498588562, + "error": 0.05859375, + "gradient_norm": 0.027793049812316895, + "elapsed": 909.47514295578 + }, + { + "step": 1344, + "loss": 0.47515708208084106, + "objective": 0.47515708208084106, + "error": 0.263671875, + "gradient_norm": 0.07668807357549667, + "elapsed": 919.7640328407288 + }, + { + "step": 1360, + "loss": 0.5173689126968384, + "objective": 0.5173689126968384, + "error": 0.2744140625, + "gradient_norm": 0.05054212734103203, + "elapsed": 930.6309463977814 + }, + { + "step": 1376, + "loss": 0.46629998087882996, + "objective": 0.46629998087882996, + "error": 0.24609375, + "gradient_norm": 0.051172077655792236, + "elapsed": 939.0202586650848 + }, + { + "step": 1392, + "loss": 0.11312969774007797, + "objective": 0.11312969774007797, + "error": 0.044921875, + "gradient_norm": 0.05863805115222931, + "elapsed": 949.1451416015625 + }, + { + "step": 1408, + "loss": 0.5750841498374939, + "objective": 0.5750841498374939, + "error": 0.322265625, + "gradient_norm": 0.051106806844472885, + "elapsed": 959.94162940979 + }, + { + "step": 1424, + "loss": 0.5937192440032959, + "objective": 0.5937192440032959, + "error": 0.3408203125, + "gradient_norm": 0.05014815554022789, + "elapsed": 969.5868306159973 + }, + { + "step": 1440, + "loss": 0.5292985439300537, + "objective": 0.5292985439300537, + "error": 0.2958984375, + "gradient_norm": 0.057068243622779846, + "elapsed": 982.6692054271698 + }, + { + "step": 1456, + "loss": 0.5959951877593994, + "objective": 0.5959951877593994, + "error": 0.3408203125, + "gradient_norm": 0.0703694075345993, + "elapsed": 995.0066986083984 + }, + { + "step": 1472, + "loss": 0.018453411757946014, + "objective": 0.018453411757946014, + "error": 0.00390625, + "gradient_norm": 0.012016087770462036, + "elapsed": 1004.0057821273804 + }, + { + "step": 1488, + "loss": 0.5711684823036194, + "objective": 0.5711684823036194, + "error": 0.3095703125, + "gradient_norm": 0.07746906578540802, + "elapsed": 1016.1701967716217 + }, + { + "step": 1504, + "loss": 0.3114882707595825, + "objective": 0.3114882707595825, + "error": 0.1455078125, + "gradient_norm": 0.05321609228849411, + "elapsed": 1026.6053586006165 + }, + { + "step": 1520, + "loss": 0.6433392763137817, + "objective": 0.6433392763137817, + "error": 0.4072265625, + "gradient_norm": 0.05683734640479088, + "elapsed": 1036.1535296440125 + }, + { + "step": 1536, + "loss": 0.38409170508384705, + "objective": 0.38409170508384705, + "error": 0.19140625, + "gradient_norm": 0.07577994465827942, + "elapsed": 1046.9508447647095 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved1_full", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "7b45252d6bb77a39c003c8f34f040d0d672e9dd1a1338a14126e1fe07a02c8c9", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 512, + 1024, + 1536 + ], + "training_draws": 1572864, + "distinct_phase_training_rows": 466919, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18000, + "surface_code_bX_d5_r03_center_5_5": 18251, + "surface_code_bX_d5_r05_center_5_5": 18224, + "surface_code_bX_d5_r07_center_5_5": 17881, + "surface_code_bX_d5_r09_center_5_5": 18247, + "surface_code_bX_d5_r11_center_5_5": 17452, + "surface_code_bX_d5_r13_center_5_5": 17982, + "surface_code_bX_d5_r15_center_5_5": 17498, + "surface_code_bX_d5_r17_center_5_5": 18487, + "surface_code_bX_d5_r19_center_5_5": 18100, + "surface_code_bX_d5_r21_center_5_5": 17622, + "surface_code_bX_d5_r23_center_5_5": 17449, + "surface_code_bX_d5_r25_center_5_5": 17739, + "surface_code_bZ_d5_r01_center_5_5": 16689, + "surface_code_bZ_d5_r03_center_5_5": 18119, + "surface_code_bZ_d5_r05_center_5_5": 18146, + "surface_code_bZ_d5_r07_center_5_5": 18185, + "surface_code_bZ_d5_r09_center_5_5": 18473, + "surface_code_bZ_d5_r11_center_5_5": 18636, + "surface_code_bZ_d5_r13_center_5_5": 18474, + "surface_code_bZ_d5_r15_center_5_5": 17779, + "surface_code_bZ_d5_r17_center_5_5": 18474, + "surface_code_bZ_d5_r19_center_5_5": 17306, + "surface_code_bZ_d5_r21_center_5_5": 17165, + "surface_code_bZ_d5_r23_center_5_5": 18616, + "surface_code_bZ_d5_r25_center_5_5": 17925 + }, + "initial_optimizer_count": 512, + "last_optimizer_count": 2048, + "parent_checkpoint_sha256": "1adc47acc35148d4260df25e25384124609d2b1e098ffcf30a1eccea55ef8712", + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "source_reference_package": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/package", + "original_training_provenance": { + "training": { + "initialization": "Uniform parameter averages of checkpoints from the same session-initialized training trajectory; no external weights", + "prior_pass": 3, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "hidden_width": 64, + "training": "No new optimizer updates; all learning comes from the recorded source trajectory and its session-trained parent", + "optimizer_updates_in_derived_run": 0, + "source_training_provenance": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "training_source_sha256": { + "learned_d5__train.py": "b73af9da21332dee9a43f653b514695b020fbc3516604b2e721d8cf0ea876d53", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "5e9420df1f6dd56518925e910096fb9bc93bd796a5933b13bf894a1a96256cdf", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "All supplied training shots per each of all26 d5 conditions; uniform condition and within-condition sampling for optimizer batches.", + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 516880, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 507282, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 19592, + "surface_code_bX_d5_r03_center_5_5": 19646, + "surface_code_bX_d5_r05_center_5_5": 19513, + "surface_code_bX_d5_r07_center_5_5": 19341, + "surface_code_bX_d5_r09_center_5_5": 19211, + "surface_code_bX_d5_r11_center_5_5": 19239, + "surface_code_bX_d5_r13_center_5_5": 19679, + "surface_code_bX_d5_r15_center_5_5": 19455, + "surface_code_bX_d5_r17_center_5_5": 19479, + "surface_code_bX_d5_r19_center_5_5": 19479, + "surface_code_bX_d5_r21_center_5_5": 19551, + "surface_code_bX_d5_r23_center_5_5": 19586, + "surface_code_bX_d5_r25_center_5_5": 19526, + "surface_code_bZ_d5_r01_center_5_5": 19652, + "surface_code_bZ_d5_r03_center_5_5": 19732, + "surface_code_bZ_d5_r05_center_5_5": 19754, + "surface_code_bZ_d5_r07_center_5_5": 19194, + "surface_code_bZ_d5_r09_center_5_5": 19641, + "surface_code_bZ_d5_r11_center_5_5": 19611, + "surface_code_bZ_d5_r13_center_5_5": 19424, + "surface_code_bZ_d5_r15_center_5_5": 19380, + "surface_code_bZ_d5_r17_center_5_5": 19384, + "surface_code_bZ_d5_r19_center_5_5": 19684, + "surface_code_bZ_d5_r21_center_5_5": 19559, + "surface_code_bZ_d5_r23_center_5_5": 19524, + "surface_code_bZ_d5_r25_center_5_5": 19446 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 2048, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261113, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_d5/feedback3_pilot/rng-768.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/feedback3_pilot/weights-768.npz", + "starting_checkpoint_sha256": "bc2ba1c529317ce1b5b661efae4707eca49c6995d6f22b04193fe7642662fed8", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "4096 training shots per each of all 26 d5 conditions, sampled without replacement with seed 20261023. Uniform condition and within-condition sampling for optimizer batches.", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1024, + "batch": 256, + "learning_rate": 0.001, + "sampling_seed": 20261108, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "starting_checkpoint": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.011146659031510353, + "error": 0.00390625, + "gradient_norm": 0.011240893043577671, + "elapsed": 21.276997089385986 + }, + { + "step": 16, + "loss": 0.645737886428833, + "error": 0.40625, + "gradient_norm": 0.1628236621618271, + "elapsed": 25.872907638549805 + }, + { + "step": 32, + "loss": 0.574029803276062, + "error": 0.35546875, + "gradient_norm": 0.3000081777572632, + "elapsed": 30.761418342590332 + }, + { + "step": 48, + "loss": 0.574467122554779, + "error": 0.296875, + "gradient_norm": 0.24150623381137848, + "elapsed": 35.67650651931763 + }, + { + "step": 64, + "loss": 0.6003620624542236, + "error": 0.35546875, + "gradient_norm": 0.07430054992437363, + "elapsed": 40.60572576522827 + }, + { + "step": 80, + "loss": 0.5429091453552246, + "error": 0.33203125, + "gradient_norm": 0.15341751277446747, + "elapsed": 45.546849727630615 + }, + { + "step": 96, + "loss": 0.368771493434906, + "error": 0.1640625, + "gradient_norm": 0.08923184871673584, + "elapsed": 50.49156332015991 + }, + { + "step": 112, + "loss": 0.516342043876648, + "error": 0.265625, + "gradient_norm": 0.10965219140052795, + "elapsed": 55.45058846473694 + }, + { + "step": 128, + "loss": 0.5925382971763611, + "error": 0.37109375, + "gradient_norm": 0.055406324565410614, + "elapsed": 60.40891766548157 + }, + { + "step": 144, + "loss": 0.19184258580207825, + "error": 0.07421875, + "gradient_norm": 0.07042146474123001, + "elapsed": 65.33323669433594 + }, + { + "step": 160, + "loss": 0.5202382206916809, + "error": 0.25390625, + "gradient_norm": 0.14782382547855377, + "elapsed": 70.26605796813965 + }, + { + "step": 176, + "loss": 0.46083134412765503, + "error": 0.22265625, + "gradient_norm": 0.09074779599905014, + "elapsed": 75.18221640586853 + }, + { + "step": 192, + "loss": 0.3054918646812439, + "error": 0.14453125, + "gradient_norm": 0.0588168129324913, + "elapsed": 80.1186010837555 + }, + { + "step": 208, + "loss": 0.4836011230945587, + "error": 0.27734375, + "gradient_norm": 0.09208947420120239, + "elapsed": 85.05764293670654 + }, + { + "step": 224, + "loss": 0.6640600562095642, + "error": 0.38671875, + "gradient_norm": 0.22026506066322327, + "elapsed": 89.98808217048645 + }, + { + "step": 240, + "loss": 0.02421322464942932, + "error": 0.00390625, + "gradient_norm": 0.008131005801260471, + "elapsed": 94.90194272994995 + }, + { + "step": 256, + "loss": 0.6302106976509094, + "error": 0.4296875, + "gradient_norm": 0.09762304276227951, + "elapsed": 99.82612204551697 + }, + { + "step": 272, + "loss": 0.5092596411705017, + "error": 0.27734375, + "gradient_norm": 0.11407691985368729, + "elapsed": 110.44065999984741 + }, + { + "step": 288, + "loss": 0.452798455953598, + "error": 0.2265625, + "gradient_norm": 0.1105576679110527, + "elapsed": 115.36984539031982 + }, + { + "step": 304, + "loss": 0.3378596305847168, + "error": 0.18359375, + "gradient_norm": 0.0841713547706604, + "elapsed": 120.29337763786316 + }, + { + "step": 320, + "loss": 0.6271854639053345, + "error": 0.38671875, + "gradient_norm": 0.1972702294588089, + "elapsed": 125.2231035232544 + }, + { + "step": 336, + "loss": 0.04562236741185188, + "error": 0.01171875, + "gradient_norm": 0.027922745794057846, + "elapsed": 130.14725255966187 + }, + { + "step": 352, + "loss": 0.5342530608177185, + "error": 0.26953125, + "gradient_norm": 0.09031179547309875, + "elapsed": 135.08111095428467 + }, + { + "step": 368, + "loss": 0.49785488843917847, + "error": 0.2578125, + "gradient_norm": 0.19366280734539032, + "elapsed": 140.00699138641357 + }, + { + "step": 384, + "loss": 0.5673326253890991, + "error": 0.30859375, + "gradient_norm": 0.20644932985305786, + "elapsed": 144.92276740074158 + }, + { + "step": 400, + "loss": 0.5581298470497131, + "error": 0.3203125, + "gradient_norm": 0.17668266594409943, + "elapsed": 149.86573243141174 + }, + { + "step": 416, + "loss": 0.5564071536064148, + "error": 0.30078125, + "gradient_norm": 0.0821610689163208, + "elapsed": 154.7953712940216 + }, + { + "step": 432, + "loss": 0.5540086030960083, + "error": 0.34765625, + "gradient_norm": 0.1438807100057602, + "elapsed": 159.72657418251038 + }, + { + "step": 448, + "loss": 0.540939450263977, + "error": 0.29296875, + "gradient_norm": 0.17986361682415009, + "elapsed": 164.6689453125 + }, + { + "step": 464, + "loss": 0.45807865262031555, + "error": 0.25, + "gradient_norm": 0.14453186094760895, + "elapsed": 169.58739304542542 + }, + { + "step": 480, + "loss": 0.5191650390625, + "error": 0.22265625, + "gradient_norm": 0.07955105602741241, + "elapsed": 174.5444438457489 + }, + { + "step": 496, + "loss": 0.1692925989627838, + "error": 0.0703125, + "gradient_norm": 0.07875128090381622, + "elapsed": 179.48035550117493 + }, + { + "step": 512, + "loss": 0.5580664873123169, + "error": 0.3125, + "gradient_norm": 0.27090802788734436, + "elapsed": 184.42834162712097 + }, + { + "step": 528, + "loss": 0.26402050256729126, + "error": 0.13671875, + "gradient_norm": 0.13135771453380585, + "elapsed": 195.17691040039062 + }, + { + "step": 544, + "loss": 0.4352915287017822, + "error": 0.1953125, + "gradient_norm": 0.15959712862968445, + "elapsed": 200.0421543121338 + }, + { + "step": 560, + "loss": 0.22861814498901367, + "error": 0.1015625, + "gradient_norm": 0.08776932209730148, + "elapsed": 204.95144605636597 + }, + { + "step": 576, + "loss": 0.28309381008148193, + "error": 0.1328125, + "gradient_norm": 0.11050742119550705, + "elapsed": 209.8526291847229 + }, + { + "step": 592, + "loss": 0.6409220695495605, + "error": 0.41015625, + "gradient_norm": 0.19826626777648926, + "elapsed": 214.84447717666626 + }, + { + "step": 608, + "loss": 0.25090643763542175, + "error": 0.109375, + "gradient_norm": 0.05864342302083969, + "elapsed": 219.72637391090393 + }, + { + "step": 624, + "loss": 0.11423969268798828, + "error": 0.05078125, + "gradient_norm": 0.05318564549088478, + "elapsed": 224.6331377029419 + }, + { + "step": 640, + "loss": 0.32663431763648987, + "error": 0.1328125, + "gradient_norm": 0.06877780705690384, + "elapsed": 229.5065622329712 + }, + { + "step": 656, + "loss": 0.24196995794773102, + "error": 0.10546875, + "gradient_norm": 0.07683655619621277, + "elapsed": 234.4042534828186 + }, + { + "step": 672, + "loss": 0.5349344611167908, + "error": 0.296875, + "gradient_norm": 0.15214307606220245, + "elapsed": 239.26656579971313 + }, + { + "step": 688, + "loss": 0.26759713888168335, + "error": 0.1171875, + "gradient_norm": 0.14698348939418793, + "elapsed": 244.21049737930298 + }, + { + "step": 704, + "loss": 0.37338894605636597, + "error": 0.18359375, + "gradient_norm": 0.10210632532835007, + "elapsed": 249.13519072532654 + }, + { + "step": 720, + "loss": 0.36807945370674133, + "error": 0.17578125, + "gradient_norm": 0.09668388962745667, + "elapsed": 254.06281065940857 + }, + { + "step": 736, + "loss": 0.3736685514450073, + "error": 0.15625, + "gradient_norm": 0.10987236350774765, + "elapsed": 259.01695108413696 + }, + { + "step": 752, + "loss": 0.5266942977905273, + "error": 0.29296875, + "gradient_norm": 0.09041415899991989, + "elapsed": 263.9530746936798 + }, + { + "step": 768, + "loss": 0.360038161277771, + "error": 0.1640625, + "gradient_norm": 0.10391079634428024, + "elapsed": 268.9019305706024 + }, + { + "step": 784, + "loss": 0.5700286626815796, + "error": 0.34375, + "gradient_norm": 0.12206032127141953, + "elapsed": 279.4174163341522 + }, + { + "step": 800, + "loss": 0.42533689737319946, + "error": 0.20703125, + "gradient_norm": 0.06605375558137894, + "elapsed": 284.3391351699829 + }, + { + "step": 816, + "loss": 0.12355346977710724, + "error": 0.046875, + "gradient_norm": 0.06571663916110992, + "elapsed": 289.2815272808075 + }, + { + "step": 832, + "loss": 0.6411258578300476, + "error": 0.3984375, + "gradient_norm": 0.160088911652565, + "elapsed": 294.2048614025116 + }, + { + "step": 848, + "loss": 0.5756919980049133, + "error": 0.3515625, + "gradient_norm": 0.0962308868765831, + "elapsed": 299.15635418891907 + }, + { + "step": 864, + "loss": 0.2706402540206909, + "error": 0.1171875, + "gradient_norm": 0.11391306668519974, + "elapsed": 304.09321761131287 + }, + { + "step": 880, + "loss": 0.33621329069137573, + "error": 0.1640625, + "gradient_norm": 0.09049320220947266, + "elapsed": 309.0412187576294 + }, + { + "step": 896, + "loss": 0.44343245029449463, + "error": 0.23828125, + "gradient_norm": 0.12484703958034515, + "elapsed": 313.98498797416687 + }, + { + "step": 912, + "loss": 0.5987736582756042, + "error": 0.359375, + "gradient_norm": 0.07541236281394958, + "elapsed": 318.9334623813629 + }, + { + "step": 928, + "loss": 0.38585522770881653, + "error": 0.1875, + "gradient_norm": 0.09290861338376999, + "elapsed": 323.86884689331055 + }, + { + "step": 944, + "loss": 0.4820440113544464, + "error": 0.234375, + "gradient_norm": 0.22198310494422913, + "elapsed": 328.7963180541992 + }, + { + "step": 960, + "loss": 0.07455944269895554, + "error": 0.015625, + "gradient_norm": 0.055282026529312134, + "elapsed": 333.75238251686096 + }, + { + "step": 976, + "loss": 0.013475366868078709, + "error": 0.0078125, + "gradient_norm": 0.009843004867434502, + "elapsed": 338.6403331756592 + }, + { + "step": 992, + "loss": 0.4429199695587158, + "error": 0.2265625, + "gradient_norm": 0.09489083290100098, + "elapsed": 343.5606532096863 + }, + { + "step": 1008, + "loss": 0.4892328381538391, + "error": 0.234375, + "gradient_norm": 0.1342826634645462, + "elapsed": 348.5243353843689 + }, + { + "step": 1024, + "loss": 0.6096819043159485, + "error": 0.32421875, + "gradient_norm": 0.17938998341560364, + "elapsed": 353.36506962776184 + } + ] + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.4341062307357788, + "objective": 0.4341062307357788, + "error": 0.208984375, + "gradient_norm": 0.07617632299661636, + "elapsed": 31.45817995071411 + }, + { + "step": 16, + "loss": 0.5996706485748291, + "objective": 0.5996706485748291, + "error": 0.359375, + "gradient_norm": 0.05249844491481781, + "elapsed": 56.34200572967529 + }, + { + "step": 32, + "loss": 0.4388691186904907, + "objective": 0.4388691186904907, + "error": 0.2041015625, + "gradient_norm": 0.0376109778881073, + "elapsed": 67.83739852905273 + }, + { + "step": 48, + "loss": 0.5373439788818359, + "objective": 0.5373439788818359, + "error": 0.2919921875, + "gradient_norm": 0.06261218339204788, + "elapsed": 76.69065475463867 + }, + { + "step": 64, + "loss": 0.24871854484081268, + "objective": 0.24871854484081268, + "error": 0.1162109375, + "gradient_norm": 0.05284671485424042, + "elapsed": 86.3852767944336 + }, + { + "step": 80, + "loss": 0.26628297567367554, + "objective": 0.26628297567367554, + "error": 0.123046875, + "gradient_norm": 0.04054367542266846, + "elapsed": 95.77356100082397 + }, + { + "step": 96, + "loss": 0.48436349630355835, + "objective": 0.48436349630355835, + "error": 0.259765625, + "gradient_norm": 0.05399860441684723, + "elapsed": 107.06293416023254 + }, + { + "step": 112, + "loss": 0.41063767671585083, + "objective": 0.41063767671585083, + "error": 0.1943359375, + "gradient_norm": 0.043602071702480316, + "elapsed": 116.78119611740112 + }, + { + "step": 128, + "loss": 0.3990316390991211, + "objective": 0.3990316390991211, + "error": 0.1865234375, + "gradient_norm": 0.0424419641494751, + "elapsed": 125.6915397644043 + }, + { + "step": 144, + "loss": 0.5119550228118896, + "objective": 0.5119550228118896, + "error": 0.2646484375, + "gradient_norm": 0.07688591629266739, + "elapsed": 136.20711088180542 + }, + { + "step": 160, + "loss": 0.3388235569000244, + "objective": 0.3388235569000244, + "error": 0.1630859375, + "gradient_norm": 0.07015731930732727, + "elapsed": 145.3505516052246 + }, + { + "step": 176, + "loss": 0.5952156186103821, + "objective": 0.5952156186103821, + "error": 0.3369140625, + "gradient_norm": 0.039373140782117844, + "elapsed": 154.77994871139526 + }, + { + "step": 192, + "loss": 0.15157413482666016, + "objective": 0.15157413482666016, + "error": 0.0634765625, + "gradient_norm": 0.029710670933127403, + "elapsed": 164.46801733970642 + }, + { + "step": 208, + "loss": 0.3120684027671814, + "objective": 0.3120684027671814, + "error": 0.1474609375, + "gradient_norm": 0.035548821091651917, + "elapsed": 173.24825358390808 + }, + { + "step": 224, + "loss": 0.5486405491828918, + "objective": 0.5486405491828918, + "error": 0.2900390625, + "gradient_norm": 0.0503678023815155, + "elapsed": 185.29849314689636 + }, + { + "step": 240, + "loss": 0.6046283841133118, + "objective": 0.6046283841133118, + "error": 0.3349609375, + "gradient_norm": 0.05043461173772812, + "elapsed": 197.54880928993225 + }, + { + "step": 256, + "loss": 0.5926339626312256, + "objective": 0.5926339626312256, + "error": 0.3359375, + "gradient_norm": 0.051241543143987656, + "elapsed": 211.79861068725586 + }, + { + "step": 272, + "loss": 0.4018518924713135, + "objective": 0.4018518924713135, + "error": 0.1943359375, + "gradient_norm": 0.0772147998213768, + "elapsed": 222.41974115371704 + }, + { + "step": 288, + "loss": 0.13863243162631989, + "objective": 0.13863243162631989, + "error": 0.0556640625, + "gradient_norm": 0.03334609419107437, + "elapsed": 234.04247426986694 + }, + { + "step": 304, + "loss": 0.562490701675415, + "objective": 0.562490701675415, + "error": 0.337890625, + "gradient_norm": 0.04585934057831764, + "elapsed": 242.65421533584595 + }, + { + "step": 320, + "loss": 0.5352796316146851, + "objective": 0.5352796316146851, + "error": 0.294921875, + "gradient_norm": 0.0837635025382042, + "elapsed": 252.10656356811523 + }, + { + "step": 336, + "loss": 0.26082637906074524, + "objective": 0.26082637906074524, + "error": 0.1220703125, + "gradient_norm": 0.048336997628211975, + "elapsed": 262.33449625968933 + }, + { + "step": 352, + "loss": 0.5959363579750061, + "objective": 0.5959363579750061, + "error": 0.3388671875, + "gradient_norm": 0.06797357648611069, + "elapsed": 271.9942307472229 + }, + { + "step": 368, + "loss": 0.48994284868240356, + "objective": 0.48994284868240356, + "error": 0.2587890625, + "gradient_norm": 0.06296153366565704, + "elapsed": 283.0493588447571 + }, + { + "step": 384, + "loss": 0.5710494518280029, + "objective": 0.5710494518280029, + "error": 0.3134765625, + "gradient_norm": 0.045333269983530045, + "elapsed": 294.64637446403503 + }, + { + "step": 400, + "loss": 0.5957783460617065, + "objective": 0.5957783460617065, + "error": 0.349609375, + "gradient_norm": 0.03918786719441414, + "elapsed": 307.6200888156891 + }, + { + "step": 416, + "loss": 0.27521568536758423, + "objective": 0.27521568536758423, + "error": 0.1220703125, + "gradient_norm": 0.038001637905836105, + "elapsed": 317.01610231399536 + }, + { + "step": 432, + "loss": 0.02379823848605156, + "objective": 0.02379823848605156, + "error": 0.0078125, + "gradient_norm": 0.007661945186555386, + "elapsed": 326.9360330104828 + }, + { + "step": 448, + "loss": 0.56734299659729, + "objective": 0.56734299659729, + "error": 0.3271484375, + "gradient_norm": 0.057416290044784546, + "elapsed": 339.6289041042328 + }, + { + "step": 464, + "loss": 0.10715995728969574, + "objective": 0.10715995728969574, + "error": 0.0380859375, + "gradient_norm": 0.02532491274178028, + "elapsed": 349.8584108352661 + }, + { + "step": 480, + "loss": 0.6143364310264587, + "objective": 0.6143364310264587, + "error": 0.36328125, + "gradient_norm": 0.08023032546043396, + "elapsed": 360.36362075805664 + }, + { + "step": 496, + "loss": 0.44069671630859375, + "objective": 0.44069671630859375, + "error": 0.2197265625, + "gradient_norm": 0.048025116324424744, + "elapsed": 369.48225808143616 + }, + { + "step": 512, + "loss": 0.019900165498256683, + "objective": 0.019900165498256683, + "error": 0.0107421875, + "gradient_norm": 0.0038635791279375553, + "elapsed": 378.59970593452454 + }, + { + "step": 528, + "loss": 0.033316534012556076, + "objective": 0.033316534012556076, + "error": 0.009765625, + "gradient_norm": 0.009174940176308155, + "elapsed": 393.4021761417389 + }, + { + "step": 544, + "loss": 0.41130945086479187, + "objective": 0.41130945086479187, + "error": 0.20703125, + "gradient_norm": 0.04695262759923935, + "elapsed": 402.8586280345917 + }, + { + "step": 560, + "loss": 0.5885373950004578, + "objective": 0.5885373950004578, + "error": 0.3544921875, + "gradient_norm": 0.08534500002861023, + "elapsed": 416.98661041259766 + }, + { + "step": 576, + "loss": 0.3804720640182495, + "objective": 0.3804720640182495, + "error": 0.19140625, + "gradient_norm": 0.05163278803229332, + "elapsed": 427.7550480365753 + }, + { + "step": 592, + "loss": 0.6101120710372925, + "objective": 0.6101120710372925, + "error": 0.3525390625, + "gradient_norm": 0.05593184754252434, + "elapsed": 441.05026268959045 + }, + { + "step": 608, + "loss": 0.5586092472076416, + "objective": 0.5586092472076416, + "error": 0.302734375, + "gradient_norm": 0.07458740472793579, + "elapsed": 452.95383286476135 + }, + { + "step": 624, + "loss": 0.5992780923843384, + "objective": 0.5992780923843384, + "error": 0.357421875, + "gradient_norm": 0.03618372976779938, + "elapsed": 466.1582691669464 + }, + { + "step": 640, + "loss": 0.3536975383758545, + "objective": 0.3536975383758545, + "error": 0.1650390625, + "gradient_norm": 0.05353165790438652, + "elapsed": 477.166255235672 + }, + { + "step": 656, + "loss": 0.4926893711090088, + "objective": 0.4926893711090088, + "error": 0.2626953125, + "gradient_norm": 0.05201377719640732, + "elapsed": 491.1417751312256 + }, + { + "step": 672, + "loss": 0.5754991173744202, + "objective": 0.5754991173744202, + "error": 0.3271484375, + "gradient_norm": 0.08167096972465515, + "elapsed": 501.630366563797 + }, + { + "step": 688, + "loss": 0.5685014724731445, + "objective": 0.5685014724731445, + "error": 0.333984375, + "gradient_norm": 0.043775107711553574, + "elapsed": 514.2880456447601 + }, + { + "step": 704, + "loss": 0.022465089336037636, + "objective": 0.022465089336037636, + "error": 0.0068359375, + "gradient_norm": 0.010172540321946144, + "elapsed": 522.9173214435577 + }, + { + "step": 720, + "loss": 0.035460107028484344, + "objective": 0.035460107028484344, + "error": 0.0107421875, + "gradient_norm": 0.010515578091144562, + "elapsed": 532.8470129966736 + }, + { + "step": 736, + "loss": 0.44765588641166687, + "objective": 0.44765588641166687, + "error": 0.2138671875, + "gradient_norm": 0.09050357341766357, + "elapsed": 541.9488840103149 + }, + { + "step": 752, + "loss": 0.5933939218521118, + "objective": 0.5933939218521118, + "error": 0.3359375, + "gradient_norm": 0.0665116235613823, + "elapsed": 552.9967355728149 + }, + { + "step": 768, + "loss": 0.6100764870643616, + "objective": 0.6100764870643616, + "error": 0.3515625, + "gradient_norm": 0.0821211114525795, + "elapsed": 563.7709202766418 + }, + { + "step": 784, + "loss": 0.02964692935347557, + "objective": 0.02964692935347557, + "error": 0.009765625, + "gradient_norm": 0.012663272209465504, + "elapsed": 573.1517221927643 + }, + { + "step": 800, + "loss": 0.38091832399368286, + "objective": 0.38091832399368286, + "error": 0.1904296875, + "gradient_norm": 0.060622021555900574, + "elapsed": 582.5687477588654 + }, + { + "step": 816, + "loss": 0.552335262298584, + "objective": 0.552335262298584, + "error": 0.3076171875, + "gradient_norm": 0.14419035613536835, + "elapsed": 594.4292685985565 + }, + { + "step": 832, + "loss": 0.5943340063095093, + "objective": 0.5943340063095093, + "error": 0.34375, + "gradient_norm": 0.0633513554930687, + "elapsed": 605.2052299976349 + }, + { + "step": 848, + "loss": 0.6074100732803345, + "objective": 0.6074100732803345, + "error": 0.3486328125, + "gradient_norm": 0.04225531220436096, + "elapsed": 614.8996202945709 + }, + { + "step": 864, + "loss": 0.6198879480361938, + "objective": 0.6198879480361938, + "error": 0.361328125, + "gradient_norm": 0.04208856821060181, + "elapsed": 625.4266908168793 + }, + { + "step": 880, + "loss": 0.6151762008666992, + "objective": 0.6151762008666992, + "error": 0.369140625, + "gradient_norm": 0.06261089444160461, + "elapsed": 636.0696911811829 + }, + { + "step": 896, + "loss": 0.49680083990097046, + "objective": 0.49680083990097046, + "error": 0.25390625, + "gradient_norm": 0.0827067643404007, + "elapsed": 644.6893246173859 + }, + { + "step": 912, + "loss": 0.4610927402973175, + "objective": 0.4610927402973175, + "error": 0.23828125, + "gradient_norm": 0.06652095168828964, + "elapsed": 655.969132900238 + }, + { + "step": 928, + "loss": 0.5218505859375, + "objective": 0.5218505859375, + "error": 0.2685546875, + "gradient_norm": 0.07188194245100021, + "elapsed": 667.5352523326874 + }, + { + "step": 944, + "loss": 0.33009427785873413, + "objective": 0.33009427785873413, + "error": 0.1533203125, + "gradient_norm": 0.05718810483813286, + "elapsed": 677.8397319316864 + }, + { + "step": 960, + "loss": 0.5703234672546387, + "objective": 0.5703234672546387, + "error": 0.3193359375, + "gradient_norm": 0.11168288439512253, + "elapsed": 687.8742904663086 + }, + { + "step": 976, + "loss": 0.025548014789819717, + "objective": 0.025548014789819717, + "error": 0.0107421875, + "gradient_norm": 0.009453393518924713, + "elapsed": 698.294285774231 + }, + { + "step": 992, + "loss": 0.45398157835006714, + "objective": 0.45398157835006714, + "error": 0.2412109375, + "gradient_norm": 0.04607952758669853, + "elapsed": 707.903199672699 + }, + { + "step": 1008, + "loss": 0.3412189781665802, + "objective": 0.3412189781665802, + "error": 0.1513671875, + "gradient_norm": 0.0432075597345829, + "elapsed": 718.5662748813629 + }, + { + "step": 1024, + "loss": 0.4376429319381714, + "objective": 0.4376429319381714, + "error": 0.2275390625, + "gradient_norm": 0.07974351197481155, + "elapsed": 728.8954858779907 + }, + { + "step": 1040, + "loss": 0.33512815833091736, + "objective": 0.33512815833091736, + "error": 0.150390625, + "gradient_norm": 0.04476875811815262, + "elapsed": 744.0822694301605 + }, + { + "step": 1056, + "loss": 0.5214208364486694, + "objective": 0.5214208364486694, + "error": 0.283203125, + "gradient_norm": 0.08898192644119263, + "elapsed": 755.1484262943268 + }, + { + "step": 1072, + "loss": 0.13849599659442902, + "objective": 0.13849599659442902, + "error": 0.052734375, + "gradient_norm": 0.028359953314065933, + "elapsed": 764.3303108215332 + }, + { + "step": 1088, + "loss": 0.323838472366333, + "objective": 0.323838472366333, + "error": 0.1435546875, + "gradient_norm": 0.04081716760993004, + "elapsed": 773.2739362716675 + }, + { + "step": 1104, + "loss": 0.5627881288528442, + "objective": 0.5627881288528442, + "error": 0.3125, + "gradient_norm": 0.08322097361087799, + "elapsed": 784.7223973274231 + }, + { + "step": 1120, + "loss": 0.44111010432243347, + "objective": 0.44111010432243347, + "error": 0.2216796875, + "gradient_norm": 0.05700977146625519, + "elapsed": 795.085648059845 + }, + { + "step": 1136, + "loss": 0.6395992040634155, + "objective": 0.6395992040634155, + "error": 0.39453125, + "gradient_norm": 0.0744553729891777, + "elapsed": 805.7942585945129 + }, + { + "step": 1152, + "loss": 0.5433304309844971, + "objective": 0.5433304309844971, + "error": 0.287109375, + "gradient_norm": 0.04814797267317772, + "elapsed": 817.3382890224457 + }, + { + "step": 1168, + "loss": 0.5708576440811157, + "objective": 0.5708576440811157, + "error": 0.3203125, + "gradient_norm": 0.051331400871276855, + "elapsed": 829.288791179657 + }, + { + "step": 1184, + "loss": 0.5447035431861877, + "objective": 0.5447035431861877, + "error": 0.2939453125, + "gradient_norm": 0.10116687417030334, + "elapsed": 839.6822843551636 + }, + { + "step": 1200, + "loss": 0.6125671863555908, + "objective": 0.6125671863555908, + "error": 0.3642578125, + "gradient_norm": 0.04368080571293831, + "elapsed": 850.2262740135193 + }, + { + "step": 1216, + "loss": 0.5002380609512329, + "objective": 0.5002380609512329, + "error": 0.259765625, + "gradient_norm": 0.04939017817378044, + "elapsed": 862.3783452510834 + }, + { + "step": 1232, + "loss": 0.5698772668838501, + "objective": 0.5698772668838501, + "error": 0.3173828125, + "gradient_norm": 0.04916854575276375, + "elapsed": 871.4622664451599 + }, + { + "step": 1248, + "loss": 0.6046518683433533, + "objective": 0.6046518683433533, + "error": 0.341796875, + "gradient_norm": 0.04919794574379921, + "elapsed": 883.3905737400055 + }, + { + "step": 1264, + "loss": 0.5913128852844238, + "objective": 0.5913128852844238, + "error": 0.357421875, + "gradient_norm": 0.046917904168367386, + "elapsed": 892.4264807701111 + }, + { + "step": 1280, + "loss": 0.5027461051940918, + "objective": 0.5027461051940918, + "error": 0.2626953125, + "gradient_norm": 0.04705750197172165, + "elapsed": 902.5875842571259 + }, + { + "step": 1296, + "loss": 0.13519814610481262, + "objective": 0.13519814610481262, + "error": 0.052734375, + "gradient_norm": 0.02625490538775921, + "elapsed": 912.4087471961975 + }, + { + "step": 1312, + "loss": 0.5862359404563904, + "objective": 0.5862359404563904, + "error": 0.3271484375, + "gradient_norm": 0.05441493168473244, + "elapsed": 923.992555141449 + }, + { + "step": 1328, + "loss": 0.6031408309936523, + "objective": 0.6031408309936523, + "error": 0.3505859375, + "gradient_norm": 0.05901554971933365, + "elapsed": 933.3936491012573 + }, + { + "step": 1344, + "loss": 0.5823733806610107, + "objective": 0.5823733806610107, + "error": 0.3310546875, + "gradient_norm": 0.0842989832162857, + "elapsed": 941.979998588562 + }, + { + "step": 1360, + "loss": 0.6241492033004761, + "objective": 0.6241492033004761, + "error": 0.3720703125, + "gradient_norm": 0.04446673393249512, + "elapsed": 954.969649553299 + }, + { + "step": 1376, + "loss": 0.5829156637191772, + "objective": 0.5829156637191772, + "error": 0.361328125, + "gradient_norm": 0.06615480780601501, + "elapsed": 966.0245676040649 + }, + { + "step": 1392, + "loss": 0.5968320369720459, + "objective": 0.5968320369720459, + "error": 0.34765625, + "gradient_norm": 0.05093541368842125, + "elapsed": 975.1022663116455 + }, + { + "step": 1408, + "loss": 0.045559000223875046, + "objective": 0.045559000223875046, + "error": 0.01171875, + "gradient_norm": 0.02514980360865593, + "elapsed": 987.2391452789307 + }, + { + "step": 1424, + "loss": 0.22601813077926636, + "objective": 0.22601813077926636, + "error": 0.09765625, + "gradient_norm": 0.04834206402301788, + "elapsed": 996.4583384990692 + }, + { + "step": 1440, + "loss": 0.23011144995689392, + "objective": 0.23011144995689392, + "error": 0.111328125, + "gradient_norm": 0.050687842071056366, + "elapsed": 1007.1440904140472 + }, + { + "step": 1456, + "loss": 0.018240466713905334, + "objective": 0.018240466713905334, + "error": 0.0078125, + "gradient_norm": 0.005604141391813755, + "elapsed": 1016.4502851963043 + }, + { + "step": 1472, + "loss": 0.4498720169067383, + "objective": 0.4498720169067383, + "error": 0.232421875, + "gradient_norm": 0.08179625123739243, + "elapsed": 1028.8303294181824 + }, + { + "step": 1488, + "loss": 0.24151627719402313, + "objective": 0.24151627719402313, + "error": 0.107421875, + "gradient_norm": 0.03838668763637543, + "elapsed": 1037.8867321014404 + }, + { + "step": 1504, + "loss": 0.46122002601623535, + "objective": 0.46122002601623535, + "error": 0.232421875, + "gradient_norm": 0.0726623386144638, + "elapsed": 1047.7258644104004 + }, + { + "step": 1520, + "loss": 0.5085602402687073, + "objective": 0.5085602402687073, + "error": 0.2705078125, + "gradient_norm": 0.06673175096511841, + "elapsed": 1059.352120399475 + }, + { + "step": 1536, + "loss": 0.6105246543884277, + "objective": 0.6105246543884277, + "error": 0.3818359375, + "gradient_norm": 0.04271261766552925, + "elapsed": 1070.1413230895996 + }, + { + "step": 1552, + "loss": 0.4792126417160034, + "objective": 0.4792126417160034, + "error": 0.2578125, + "gradient_norm": 0.05200039595365524, + "elapsed": 1086.444006204605 + }, + { + "step": 1568, + "loss": 0.5814266204833984, + "objective": 0.5814266204833984, + "error": 0.330078125, + "gradient_norm": 0.05867309868335724, + "elapsed": 1097.2902619838715 + }, + { + "step": 1584, + "loss": 0.6321226358413696, + "objective": 0.6321226358413696, + "error": 0.3798828125, + "gradient_norm": 0.05418067052960396, + "elapsed": 1107.9767682552338 + }, + { + "step": 1600, + "loss": 0.5931253433227539, + "objective": 0.5931253433227539, + "error": 0.3603515625, + "gradient_norm": 0.06396215409040451, + "elapsed": 1121.782609462738 + }, + { + "step": 1616, + "loss": 0.6411516666412354, + "objective": 0.6411516666412354, + "error": 0.38671875, + "gradient_norm": 0.05035768821835518, + "elapsed": 1132.7197887897491 + }, + { + "step": 1632, + "loss": 0.4267754852771759, + "objective": 0.4267754852771759, + "error": 0.2080078125, + "gradient_norm": 0.09109894186258316, + "elapsed": 1139.1667578220367 + }, + { + "step": 1648, + "loss": 0.21246182918548584, + "objective": 0.21246182918548584, + "error": 0.095703125, + "gradient_norm": 0.04478950425982475, + "elapsed": 1149.1183021068573 + }, + { + "step": 1664, + "loss": 0.46360665559768677, + "objective": 0.46360665559768677, + "error": 0.251953125, + "gradient_norm": 0.07668188214302063, + "elapsed": 1161.1197745800018 + }, + { + "step": 1680, + "loss": 0.46281397342681885, + "objective": 0.46281397342681885, + "error": 0.236328125, + "gradient_norm": 0.07954126596450806, + "elapsed": 1171.8474535942078 + }, + { + "step": 1696, + "loss": 0.2484058141708374, + "objective": 0.2484058141708374, + "error": 0.12109375, + "gradient_norm": 0.047261305153369904, + "elapsed": 1185.6542596817017 + }, + { + "step": 1712, + "loss": 0.24310235679149628, + "objective": 0.24310235679149628, + "error": 0.1064453125, + "gradient_norm": 0.07262872904539108, + "elapsed": 1197.8986082077026 + }, + { + "step": 1728, + "loss": 0.009729458019137383, + "objective": 0.009729458019137383, + "error": 0.001953125, + "gradient_norm": 0.01146845705807209, + "elapsed": 1208.495581150055 + }, + { + "step": 1744, + "loss": 0.24568752944469452, + "objective": 0.24568752944469452, + "error": 0.10546875, + "gradient_norm": 0.05830742046236992, + "elapsed": 1219.9394850730896 + }, + { + "step": 1760, + "loss": 0.022546378895640373, + "objective": 0.022546378895640373, + "error": 0.0068359375, + "gradient_norm": 0.007667526602745056, + "elapsed": 1229.5703229904175 + }, + { + "step": 1776, + "loss": 0.5848401784896851, + "objective": 0.5848401784896851, + "error": 0.3271484375, + "gradient_norm": 0.061901818960905075, + "elapsed": 1238.750280380249 + }, + { + "step": 1792, + "loss": 0.6031335592269897, + "objective": 0.6031335592269897, + "error": 0.3671875, + "gradient_norm": 0.0676632970571518, + "elapsed": 1247.7468683719635 + }, + { + "step": 1808, + "loss": 0.6210961937904358, + "objective": 0.6210961937904358, + "error": 0.3603515625, + "gradient_norm": 0.0718468651175499, + "elapsed": 1256.1821897029877 + }, + { + "step": 1824, + "loss": 0.570877730846405, + "objective": 0.570877730846405, + "error": 0.3212890625, + "gradient_norm": 0.05575930327177048, + "elapsed": 1266.4091975688934 + }, + { + "step": 1840, + "loss": 0.5711429119110107, + "objective": 0.5711429119110107, + "error": 0.31640625, + "gradient_norm": 0.0691002607345581, + "elapsed": 1277.4722146987915 + }, + { + "step": 1856, + "loss": 0.36046335101127625, + "objective": 0.36046335101127625, + "error": 0.16796875, + "gradient_norm": 0.04694395884871483, + "elapsed": 1287.1420249938965 + }, + { + "step": 1872, + "loss": 0.4688999652862549, + "objective": 0.4688999652862549, + "error": 0.2216796875, + "gradient_norm": 0.07401346415281296, + "elapsed": 1297.3945078849792 + }, + { + "step": 1888, + "loss": 0.46385282278060913, + "objective": 0.46385282278060913, + "error": 0.2373046875, + "gradient_norm": 0.05608939751982689, + "elapsed": 1305.9779334068298 + }, + { + "step": 1904, + "loss": 0.60875403881073, + "objective": 0.60875403881073, + "error": 0.365234375, + "gradient_norm": 0.05085878074169159, + "elapsed": 1317.3097081184387 + }, + { + "step": 1920, + "loss": 0.12223530560731888, + "objective": 0.12223530560731888, + "error": 0.0458984375, + "gradient_norm": 0.024870412424206734, + "elapsed": 1328.6486887931824 + }, + { + "step": 1936, + "loss": 0.3486189544200897, + "objective": 0.3486189544200897, + "error": 0.16796875, + "gradient_norm": 0.04780663549900055, + "elapsed": 1336.6701011657715 + }, + { + "step": 1952, + "loss": 0.5777363777160645, + "objective": 0.5777363777160645, + "error": 0.3427734375, + "gradient_norm": 0.0571451336145401, + "elapsed": 1346.9158833026886 + }, + { + "step": 1968, + "loss": 0.39320266246795654, + "objective": 0.39320266246795654, + "error": 0.1884765625, + "gradient_norm": 0.05673858895897865, + "elapsed": 1354.9182631969452 + }, + { + "step": 1984, + "loss": 0.5900611281394958, + "objective": 0.5900611281394958, + "error": 0.3349609375, + "gradient_norm": 0.06593932211399078, + "elapsed": 1364.2754452228546 + }, + { + "step": 2000, + "loss": 0.6212430000305176, + "objective": 0.6212430000305176, + "error": 0.3857421875, + "gradient_norm": 0.040818918496370316, + "elapsed": 1374.7192046642303 + }, + { + "step": 2016, + "loss": 0.15605247020721436, + "objective": 0.15605247020721436, + "error": 0.0556640625, + "gradient_norm": 0.03108786791563034, + "elapsed": 1386.2740807533264 + }, + { + "step": 2032, + "loss": 0.22049596905708313, + "objective": 0.22049596905708313, + "error": 0.1015625, + "gradient_norm": 0.042733557522296906, + "elapsed": 1396.6422457695007 + }, + { + "step": 2048, + "loss": 0.5642613172531128, + "objective": 0.5642613172531128, + "error": 0.306640625, + "gradient_norm": 0.07527482509613037, + "elapsed": 1407.6688070297241 + } + ] + }, + "derived_checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ce5951e7095a9912dc74719254f2fcf9654f219078392b7acf7a8545e6f9f3f4", + "complete": true + }, + "mean4": { + "checkpoint_label": "mean4", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 512, + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "512": "d4194b40470453e5df9b75e12326cbbd0e6845946870bb0d53a2cbbdd6ea32dc", + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "512": { + "step": 512, + "training_samples": 524288, + "unique_training_rows_seen_in_this_phase": 324661, + "weights_sha256": "d4194b40470453e5df9b75e12326cbbd0e6845946870bb0d53a2cbbdd6ea32dc", + "complete": true + }, + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ff5a023ce2c18be7c29f810a3788a450e3ad3ad2237d6e9448923aa6a28c5074", + "complete": true + } + }, + "selection": "Predefined averages of the last3 or all4 saved noninitial full3_1 checkpoints; evaluate every validation condition before selecting", + "test_data_used": false, + "derivation_source_sha256": "08c498d6952b0380e001371df9a0461a483631a301f93747b821e529e72b349d" + }, + "training_source_snapshot": "training_sources/full3_swa", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23290264423076928, + "mean3": 0.2335186298076923, + "blend-mean3": 0.2325420673076923, + "mean4": 0.23326322115384618, + "blend-mean4": 0.23300781250000002 + }, + "selected": "blend-mean3" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22017728365384615, + "mean3": 0.22037259615384613, + "blend-mean3": 0.22091346153846153, + "mean4": 0.2205528846153846, + "blend-mean4": 0.22100360576923078 + }, + "selected": "incumbent" + } + ], + "checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ce5951e7095a9912dc74719254f2fcf9654f219078392b7acf7a8545e6f9f3f4", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit logical tracking in intermediate passes when intermediate probabilities are unused.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false + }, + "checkpoints": { + "512": { + "step": 512, + "training_samples": 524288, + "unique_training_rows_seen_in_this_phase": 317630, + "weights_sha256": "82246691e00fc2a3a621ad268bf2ed753376f4abfb39240f64814b5f6cb00f5b", + "complete": true + } + }, + "selection": "Per-basis minimum full-validation mean over the incumbent and equal old/new neural probability averages, optionally blended with physical probability at fractions 0, .25, or .5. All 13 durations included.", + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23216646634615384, + "0-physical-0": 0.232421875, + "0-physical-0.25": 0.2330228365384615, + "0-physical-0.5": 0.23330829326923078, + "512-physical-0": 0.2321364182692308, + "512-physical-0.25": 0.23296274038461537, + "512-physical-0.5": 0.2327674278846154, + "1024-physical-0": 0.23255709134615382, + "1024-physical-0.25": 0.23302283653846154, + "1024-physical-0.5": 0.23284254807692306, + "1536-physical-0": 0.23224158653846155, + "1536-physical-0.25": 0.2330228365384615, + "1536-physical-0.5": 0.2332481971153846 + }, + "selected": "512-physical-0", + "original_checkpoint": "full3_swa/mean3" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.21953124999999998, + "0-physical-0": 0.22059795673076923, + "0-physical-0.25": 0.22046274038461539, + "0-physical-0.5": 0.2205829326923077, + "512-physical-0": 0.22013221153846155, + "512-physical-0.25": 0.22046274038461539, + "512-physical-0.5": 0.22061298076923078, + "1024-physical-0": 0.22013221153846155, + "1024-physical-0.25": 0.2209885817307692, + "1024-physical-0.5": 0.22049278846153844, + "1536-physical-0": 0.22064302884615383, + "1536-physical-0.25": 0.2205078125, + "1536-physical-0.5": 0.22095853365384616 + }, + "selected": "incumbent", + "original_checkpoint": "full3_1/1536" + } + ], + "control": { + "status": "passed", + "device": "cpu", + "source_sha256": "59d6c85dc4bd61e26cf7243baf0e2637c3de1d35327b2c763707badd19446550", + "reference_package": "/run-state/workspace/research/context_upgrades/short_categorical2/package", + "members": [ + { + "weights": "weights/neural-d5-neural_d5_full3_swa-mean3.npz", + "coefficient": 1.0 + }, + { + "weights": "weights/neural-d5-neural_d5_full3_1-1536.npz", + "coefficient": 3.0 + } + ], + "cases": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 1, + "single_path_exact": true, + "shared_mixture_exact": true, + "cpu_recomputed_vs_gpu_cached_prior_max_difference": null + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 7, + "single_path_exact": true, + "shared_mixture_exact": true, + "cpu_recomputed_vs_gpu_cached_prior_max_difference": 1.7881393432617188e-07 + } + ], + "seconds": 4.879673480987549, + "scope": "Runtime probability aggregation and prior reuse; no model fitting or validation selection." + }, + "test_data_used": false + }, + "neural_d5": { + "training": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261273", + "prior_pass": 3, + "initial_seed": 20261273, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 467790, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18254, + "surface_code_bX_d5_r03_center_5_5": 18525, + "surface_code_bX_d5_r05_center_5_5": 18175, + "surface_code_bX_d5_r07_center_5_5": 18005, + "surface_code_bX_d5_r09_center_5_5": 18067, + "surface_code_bX_d5_r11_center_5_5": 18445, + "surface_code_bX_d5_r13_center_5_5": 18673, + "surface_code_bX_d5_r15_center_5_5": 17345, + "surface_code_bX_d5_r17_center_5_5": 17898, + "surface_code_bX_d5_r19_center_5_5": 18359, + "surface_code_bX_d5_r21_center_5_5": 18036, + "surface_code_bX_d5_r23_center_5_5": 17255, + "surface_code_bX_d5_r25_center_5_5": 18057, + "surface_code_bZ_d5_r01_center_5_5": 17596, + "surface_code_bZ_d5_r03_center_5_5": 18333, + "surface_code_bZ_d5_r05_center_5_5": 18250, + "surface_code_bZ_d5_r07_center_5_5": 18210, + "surface_code_bZ_d5_r09_center_5_5": 17447, + "surface_code_bZ_d5_r11_center_5_5": 18120, + "surface_code_bZ_d5_r13_center_5_5": 18224, + "surface_code_bZ_d5_r15_center_5_5": 17857, + "surface_code_bZ_d5_r17_center_5_5": 18359, + "surface_code_bZ_d5_r19_center_5_5": 17398, + "surface_code_bZ_d5_r21_center_5_5": 18235, + "surface_code_bZ_d5_r23_center_5_5": 16653, + "surface_code_bZ_d5_r25_center_5_5": 18014 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1536, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261274, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "/run-state/workspace/research/learned_d5/reserved2_warm/rng-512.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/reserved2_warm/weights-512.npz", + "starting_checkpoint_sha256": "2b00e3f258886b5c4ecf69f36fd5463a205eefc84bd10c550acc391e84515c24", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261273", + "prior_pass": 3, + "initial_seed": 20261273, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 317635, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 13700, + "surface_code_bX_d5_r03_center_5_5": 10036, + "surface_code_bX_d5_r05_center_5_5": 11768, + "surface_code_bX_d5_r07_center_5_5": 10917, + "surface_code_bX_d5_r09_center_5_5": 13458, + "surface_code_bX_d5_r11_center_5_5": 11764, + "surface_code_bX_d5_r13_center_5_5": 14018, + "surface_code_bX_d5_r15_center_5_5": 10968, + "surface_code_bX_d5_r17_center_5_5": 13469, + "surface_code_bX_d5_r19_center_5_5": 11340, + "surface_code_bX_d5_r21_center_5_5": 11327, + "surface_code_bX_d5_r23_center_5_5": 13970, + "surface_code_bX_d5_r25_center_5_5": 10500, + "surface_code_bZ_d5_r01_center_5_5": 12079, + "surface_code_bZ_d5_r03_center_5_5": 12160, + "surface_code_bZ_d5_r05_center_5_5": 9494, + "surface_code_bZ_d5_r07_center_5_5": 10910, + "surface_code_bZ_d5_r09_center_5_5": 10064, + "surface_code_bZ_d5_r11_center_5_5": 10969, + "surface_code_bZ_d5_r13_center_5_5": 13419, + "surface_code_bZ_d5_r15_center_5_5": 12842, + "surface_code_bZ_d5_r17_center_5_5": 13694, + "surface_code_bZ_d5_r19_center_5_5": 13449, + "surface_code_bZ_d5_r21_center_5_5": 13799, + "surface_code_bZ_d5_r23_center_5_5": 12754, + "surface_code_bZ_d5_r25_center_5_5": 14767 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 512, + "batch": 1024, + "learning_rate": 0.001, + "sampling_seed": 20261274, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "rng_restored": false, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "Fresh NumPy default_rng seed 20261274", + "starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "starting_training_provenance": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.2600052058696747, + "objective": 0.2600052058696747, + "error": 0.1123046875, + "gradient_norm": 0.06799795478582382, + "elapsed": 27.333195447921753 + }, + { + "step": 16, + "loss": 0.0312246885150671, + "objective": 0.0312246885150671, + "error": 0.01171875, + "gradient_norm": 0.004962741397321224, + "elapsed": 48.383540868759155 + }, + { + "step": 32, + "loss": 0.22698244452476501, + "objective": 0.22698244452476501, + "error": 0.08984375, + "gradient_norm": 0.06353150308132172, + "elapsed": 57.04609966278076 + }, + { + "step": 48, + "loss": 0.5861443281173706, + "objective": 0.5861443281173706, + "error": 0.3486328125, + "gradient_norm": 0.04095375910401344, + "elapsed": 69.08654689788818 + }, + { + "step": 64, + "loss": 0.6103856563568115, + "objective": 0.6103856563568115, + "error": 0.3662109375, + "gradient_norm": 0.04155975207686424, + "elapsed": 81.63970494270325 + }, + { + "step": 80, + "loss": 0.5673234462738037, + "objective": 0.5673234462738037, + "error": 0.3125, + "gradient_norm": 0.1773851364850998, + "elapsed": 92.5357596874237 + }, + { + "step": 96, + "loss": 0.3763846755027771, + "objective": 0.3763846755027771, + "error": 0.1875, + "gradient_norm": 0.0951203852891922, + "elapsed": 103.12279391288757 + }, + { + "step": 112, + "loss": 0.45539408922195435, + "objective": 0.45539408922195435, + "error": 0.22265625, + "gradient_norm": 0.056369006633758545, + "elapsed": 112.61882042884827 + }, + { + "step": 128, + "loss": 0.015473627485334873, + "objective": 0.015473627485334873, + "error": 0.005859375, + "gradient_norm": 0.005696057807654142, + "elapsed": 125.16960310935974 + }, + { + "step": 144, + "loss": 0.03449750319123268, + "objective": 0.03449750319123268, + "error": 0.0107421875, + "gradient_norm": 0.008358650840818882, + "elapsed": 135.8080232143402 + }, + { + "step": 160, + "loss": 0.5731935501098633, + "objective": 0.5731935501098633, + "error": 0.31640625, + "gradient_norm": 0.056162577122449875, + "elapsed": 145.0349259376526 + }, + { + "step": 176, + "loss": 0.5626271963119507, + "objective": 0.5626271963119507, + "error": 0.314453125, + "gradient_norm": 0.048817526549100876, + "elapsed": 154.84093379974365 + }, + { + "step": 192, + "loss": 0.5507581233978271, + "objective": 0.5507581233978271, + "error": 0.3173828125, + "gradient_norm": 0.06503377854824066, + "elapsed": 164.7195086479187 + }, + { + "step": 208, + "loss": 0.5725968480110168, + "objective": 0.5725968480110168, + "error": 0.3251953125, + "gradient_norm": 0.047704510390758514, + "elapsed": 175.38803815841675 + }, + { + "step": 224, + "loss": 0.5249365568161011, + "objective": 0.5249365568161011, + "error": 0.2802734375, + "gradient_norm": 0.10021239519119263, + "elapsed": 187.0162854194641 + }, + { + "step": 240, + "loss": 0.2526492476463318, + "objective": 0.2526492476463318, + "error": 0.1103515625, + "gradient_norm": 0.06751289963722229, + "elapsed": 196.51696944236755 + }, + { + "step": 256, + "loss": 0.5214780569076538, + "objective": 0.5214780569076538, + "error": 0.275390625, + "gradient_norm": 0.14627203345298767, + "elapsed": 208.2405219078064 + }, + { + "step": 272, + "loss": 0.59315025806427, + "objective": 0.59315025806427, + "error": 0.341796875, + "gradient_norm": 0.03693874180316925, + "elapsed": 224.87874341011047 + }, + { + "step": 288, + "loss": 0.37350377440452576, + "objective": 0.37350377440452576, + "error": 0.169921875, + "gradient_norm": 0.05035478249192238, + "elapsed": 235.2427306175232 + }, + { + "step": 304, + "loss": 0.6201726198196411, + "objective": 0.6201726198196411, + "error": 0.3798828125, + "gradient_norm": 0.04230104014277458, + "elapsed": 244.4733214378357 + }, + { + "step": 320, + "loss": 0.5781067609786987, + "objective": 0.5781067609786987, + "error": 0.3291015625, + "gradient_norm": 0.06764703243970871, + "elapsed": 256.96991300582886 + }, + { + "step": 336, + "loss": 0.13824111223220825, + "objective": 0.13824111223220825, + "error": 0.0556640625, + "gradient_norm": 0.02330971322953701, + "elapsed": 268.097412109375 + }, + { + "step": 352, + "loss": 0.6141752004623413, + "objective": 0.6141752004623413, + "error": 0.37890625, + "gradient_norm": 0.08660273998975754, + "elapsed": 282.79302310943604 + }, + { + "step": 368, + "loss": 0.3470626473426819, + "objective": 0.3470626473426819, + "error": 0.1611328125, + "gradient_norm": 0.05711895599961281, + "elapsed": 293.79467129707336 + }, + { + "step": 384, + "loss": 0.6023644208908081, + "objective": 0.6023644208908081, + "error": 0.3466796875, + "gradient_norm": 0.08649417012929916, + "elapsed": 305.9786322116852 + }, + { + "step": 400, + "loss": 0.03022841364145279, + "objective": 0.03022841364145279, + "error": 0.0087890625, + "gradient_norm": 0.009741511195898056, + "elapsed": 315.06104922294617 + }, + { + "step": 416, + "loss": 0.23827238380908966, + "objective": 0.23827238380908966, + "error": 0.1015625, + "gradient_norm": 0.03526044636964798, + "elapsed": 325.6410942077637 + }, + { + "step": 432, + "loss": 0.43375664949417114, + "objective": 0.43375664949417114, + "error": 0.201171875, + "gradient_norm": 0.03940205276012421, + "elapsed": 336.9890570640564 + }, + { + "step": 448, + "loss": 0.5915575623512268, + "objective": 0.5915575623512268, + "error": 0.3359375, + "gradient_norm": 0.04364592209458351, + "elapsed": 346.9254243373871 + }, + { + "step": 464, + "loss": 0.5641118288040161, + "objective": 0.5641118288040161, + "error": 0.3076171875, + "gradient_norm": 0.052896615117788315, + "elapsed": 356.9816539287567 + }, + { + "step": 480, + "loss": 0.5682889223098755, + "objective": 0.5682889223098755, + "error": 0.322265625, + "gradient_norm": 0.07130409777164459, + "elapsed": 369.16103172302246 + }, + { + "step": 496, + "loss": 0.37034764885902405, + "objective": 0.37034764885902405, + "error": 0.181640625, + "gradient_norm": 0.11464523524045944, + "elapsed": 381.041054725647 + }, + { + "step": 512, + "loss": 0.5398496389389038, + "objective": 0.5398496389389038, + "error": 0.3076171875, + "gradient_norm": 0.05673467367887497, + "elapsed": 394.5030150413513 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved2_warm", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "db182d721768f832e1c83f6258b31bef0d8bf2ded239a8ab5a45cbb76378fd30", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 256, + 512 + ], + "training_draws": 524288, + "distinct_phase_training_rows": 317635, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 13700, + "surface_code_bX_d5_r03_center_5_5": 10036, + "surface_code_bX_d5_r05_center_5_5": 11768, + "surface_code_bX_d5_r07_center_5_5": 10917, + "surface_code_bX_d5_r09_center_5_5": 13458, + "surface_code_bX_d5_r11_center_5_5": 11764, + "surface_code_bX_d5_r13_center_5_5": 14018, + "surface_code_bX_d5_r15_center_5_5": 10968, + "surface_code_bX_d5_r17_center_5_5": 13469, + "surface_code_bX_d5_r19_center_5_5": 11340, + "surface_code_bX_d5_r21_center_5_5": 11327, + "surface_code_bX_d5_r23_center_5_5": 13970, + "surface_code_bX_d5_r25_center_5_5": 10500, + "surface_code_bZ_d5_r01_center_5_5": 12079, + "surface_code_bZ_d5_r03_center_5_5": 12160, + "surface_code_bZ_d5_r05_center_5_5": 9494, + "surface_code_bZ_d5_r07_center_5_5": 10910, + "surface_code_bZ_d5_r09_center_5_5": 10064, + "surface_code_bZ_d5_r11_center_5_5": 10969, + "surface_code_bZ_d5_r13_center_5_5": 13419, + "surface_code_bZ_d5_r15_center_5_5": 12842, + "surface_code_bZ_d5_r17_center_5_5": 13694, + "surface_code_bZ_d5_r19_center_5_5": 13449, + "surface_code_bZ_d5_r21_center_5_5": 13799, + "surface_code_bZ_d5_r23_center_5_5": 12754, + "surface_code_bZ_d5_r25_center_5_5": 14767 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 512, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.30839407444000244, + "objective": 0.30839407444000244, + "error": 0.130859375, + "gradient_norm": 0.053425733000040054, + "elapsed": 28.537403345108032 + }, + { + "step": 16, + "loss": 0.021987520158290863, + "objective": 0.021987520158290863, + "error": 0.0078125, + "gradient_norm": 0.01397851575165987, + "elapsed": 48.18276286125183 + }, + { + "step": 32, + "loss": 0.5041587352752686, + "objective": 0.5041587352752686, + "error": 0.2724609375, + "gradient_norm": 0.0528741292655468, + "elapsed": 58.27348470687866 + }, + { + "step": 48, + "loss": 0.4326452612876892, + "objective": 0.4326452612876892, + "error": 0.21484375, + "gradient_norm": 0.0559566393494606, + "elapsed": 68.90473222732544 + }, + { + "step": 64, + "loss": 0.4804917275905609, + "objective": 0.4804917275905609, + "error": 0.248046875, + "gradient_norm": 0.0669105276465416, + "elapsed": 77.87249231338501 + }, + { + "step": 80, + "loss": 0.2889654338359833, + "objective": 0.2889654338359833, + "error": 0.1328125, + "gradient_norm": 0.08293467015028, + "elapsed": 86.87973022460938 + }, + { + "step": 96, + "loss": 0.5135385990142822, + "objective": 0.5135385990142822, + "error": 0.271484375, + "gradient_norm": 0.06412295252084732, + "elapsed": 95.98773431777954 + }, + { + "step": 112, + "loss": 0.31248384714126587, + "objective": 0.31248384714126587, + "error": 0.1357421875, + "gradient_norm": 0.03881710395216942, + "elapsed": 106.47444081306458 + }, + { + "step": 128, + "loss": 0.23868557810783386, + "objective": 0.23868557810783386, + "error": 0.091796875, + "gradient_norm": 0.03896595537662506, + "elapsed": 117.72143626213074 + }, + { + "step": 144, + "loss": 0.5315916538238525, + "objective": 0.5315916538238525, + "error": 0.2890625, + "gradient_norm": 0.09184520691633224, + "elapsed": 126.97882843017578 + }, + { + "step": 160, + "loss": 0.604732096195221, + "objective": 0.604732096195221, + "error": 0.3603515625, + "gradient_norm": 0.044600710272789, + "elapsed": 137.403742313385 + }, + { + "step": 176, + "loss": 0.032417282462120056, + "objective": 0.032417282462120056, + "error": 0.0107421875, + "gradient_norm": 0.010968778282403946, + "elapsed": 147.58081603050232 + }, + { + "step": 192, + "loss": 0.24050910770893097, + "objective": 0.24050910770893097, + "error": 0.087890625, + "gradient_norm": 0.052534136921167374, + "elapsed": 156.545964717865 + }, + { + "step": 208, + "loss": 0.3183761537075043, + "objective": 0.3183761537075043, + "error": 0.1435546875, + "gradient_norm": 0.05253623053431511, + "elapsed": 166.62695455551147 + }, + { + "step": 224, + "loss": 0.6407097578048706, + "objective": 0.6407097578048706, + "error": 0.3837890625, + "gradient_norm": 0.08772490173578262, + "elapsed": 174.46970582008362 + }, + { + "step": 240, + "loss": 0.597212553024292, + "objective": 0.597212553024292, + "error": 0.36328125, + "gradient_norm": 0.13039150834083557, + "elapsed": 184.2768793106079 + }, + { + "step": 256, + "loss": 0.3317721486091614, + "objective": 0.3317721486091614, + "error": 0.14453125, + "gradient_norm": 0.03749232366681099, + "elapsed": 194.6345317363739 + }, + { + "step": 272, + "loss": 0.6330116987228394, + "objective": 0.6330116987228394, + "error": 0.3955078125, + "gradient_norm": 0.06468097865581512, + "elapsed": 205.8717017173767 + }, + { + "step": 288, + "loss": 0.3141757845878601, + "objective": 0.3141757845878601, + "error": 0.138671875, + "gradient_norm": 0.046496689319610596, + "elapsed": 215.2117359638214 + }, + { + "step": 304, + "loss": 0.5782994031906128, + "objective": 0.5782994031906128, + "error": 0.345703125, + "gradient_norm": 0.06487675756216049, + "elapsed": 225.47403240203857 + }, + { + "step": 320, + "loss": 0.45729100704193115, + "objective": 0.45729100704193115, + "error": 0.2255859375, + "gradient_norm": 0.04169687256217003, + "elapsed": 233.03686332702637 + }, + { + "step": 336, + "loss": 0.49350813031196594, + "objective": 0.49350813031196594, + "error": 0.24609375, + "gradient_norm": 0.08623651415109634, + "elapsed": 244.53246903419495 + }, + { + "step": 352, + "loss": 0.25660067796707153, + "objective": 0.25660067796707153, + "error": 0.1103515625, + "gradient_norm": 0.03029652312397957, + "elapsed": 254.88137793540955 + }, + { + "step": 368, + "loss": 0.2295728325843811, + "objective": 0.2295728325843811, + "error": 0.0966796875, + "gradient_norm": 0.042884912341833115, + "elapsed": 262.7415475845337 + }, + { + "step": 384, + "loss": 0.6214326620101929, + "objective": 0.6214326620101929, + "error": 0.3759765625, + "gradient_norm": 0.08176509290933609, + "elapsed": 271.72958397865295 + }, + { + "step": 400, + "loss": 0.6463049650192261, + "objective": 0.6463049650192261, + "error": 0.3984375, + "gradient_norm": 0.08226390928030014, + "elapsed": 281.51069259643555 + }, + { + "step": 416, + "loss": 0.024987798184156418, + "objective": 0.024987798184156418, + "error": 0.0078125, + "gradient_norm": 0.0075854891911149025, + "elapsed": 291.0118627548218 + }, + { + "step": 432, + "loss": 0.5520929098129272, + "objective": 0.5520929098129272, + "error": 0.3125, + "gradient_norm": 0.09755270183086395, + "elapsed": 301.23231768608093 + }, + { + "step": 448, + "loss": 0.6077401638031006, + "objective": 0.6077401638031006, + "error": 0.361328125, + "gradient_norm": 0.04908076301217079, + "elapsed": 312.93572759628296 + }, + { + "step": 464, + "loss": 0.016434211283922195, + "objective": 0.016434211283922195, + "error": 0.005859375, + "gradient_norm": 0.007213531993329525, + "elapsed": 323.8330478668213 + }, + { + "step": 480, + "loss": 0.1582300364971161, + "objective": 0.1582300364971161, + "error": 0.064453125, + "gradient_norm": 0.028335656970739365, + "elapsed": 334.6112554073334 + }, + { + "step": 496, + "loss": 0.5916742086410522, + "objective": 0.5916742086410522, + "error": 0.35546875, + "gradient_norm": 0.08213689178228378, + "elapsed": 345.8490369319916 + }, + { + "step": 512, + "loss": 0.11447565257549286, + "objective": 0.11447565257549286, + "error": 0.04296875, + "gradient_norm": 0.028994916006922722, + "elapsed": 358.71793270111084 + }, + { + "step": 528, + "loss": 0.3011414408683777, + "objective": 0.3011414408683777, + "error": 0.1435546875, + "gradient_norm": 0.04305516928434372, + "elapsed": 373.143226146698 + }, + { + "step": 544, + "loss": 0.3099900782108307, + "objective": 0.3099900782108307, + "error": 0.130859375, + "gradient_norm": 0.06152835488319397, + "elapsed": 380.42762184143066 + }, + { + "step": 560, + "loss": 0.42917633056640625, + "objective": 0.42917633056640625, + "error": 0.203125, + "gradient_norm": 0.051812849938869476, + "elapsed": 390.78397703170776 + }, + { + "step": 576, + "loss": 0.4895544648170471, + "objective": 0.4895544648170471, + "error": 0.2451171875, + "gradient_norm": 0.059052009135484695, + "elapsed": 400.29374146461487 + }, + { + "step": 592, + "loss": 0.5950886011123657, + "objective": 0.5950886011123657, + "error": 0.328125, + "gradient_norm": 0.1449151188135147, + "elapsed": 410.06920647621155 + }, + { + "step": 608, + "loss": 0.3282078504562378, + "objective": 0.3282078504562378, + "error": 0.1484375, + "gradient_norm": 0.06495015323162079, + "elapsed": 420.5240683555603 + }, + { + "step": 624, + "loss": 0.6034166812896729, + "objective": 0.6034166812896729, + "error": 0.3388671875, + "gradient_norm": 0.05658626928925514, + "elapsed": 430.7997169494629 + }, + { + "step": 640, + "loss": 0.590431809425354, + "objective": 0.590431809425354, + "error": 0.3447265625, + "gradient_norm": 0.046094730496406555, + "elapsed": 441.8197224140167 + }, + { + "step": 656, + "loss": 0.2260439246892929, + "objective": 0.2260439246892929, + "error": 0.1015625, + "gradient_norm": 0.06323576718568802, + "elapsed": 450.76086831092834 + }, + { + "step": 672, + "loss": 0.26158156991004944, + "objective": 0.26158156991004944, + "error": 0.1162109375, + "gradient_norm": 0.08324819058179855, + "elapsed": 459.1986529827118 + }, + { + "step": 688, + "loss": 0.4871026873588562, + "objective": 0.4871026873588562, + "error": 0.244140625, + "gradient_norm": 0.051720812916755676, + "elapsed": 470.4437210559845 + }, + { + "step": 704, + "loss": 0.5861694812774658, + "objective": 0.5861694812774658, + "error": 0.341796875, + "gradient_norm": 0.05766218528151512, + "elapsed": 483.85575103759766 + }, + { + "step": 720, + "loss": 0.4168863296508789, + "objective": 0.4168863296508789, + "error": 0.21484375, + "gradient_norm": 0.05056491494178772, + "elapsed": 494.63891077041626 + }, + { + "step": 736, + "loss": 0.42054638266563416, + "objective": 0.42054638266563416, + "error": 0.21875, + "gradient_norm": 0.07021808624267578, + "elapsed": 505.4899232387543 + }, + { + "step": 752, + "loss": 0.2022928148508072, + "objective": 0.2022928148508072, + "error": 0.0849609375, + "gradient_norm": 0.0765448734164238, + "elapsed": 516.2925503253937 + }, + { + "step": 768, + "loss": 0.026398655027151108, + "objective": 0.026398655027151108, + "error": 0.0068359375, + "gradient_norm": 0.00973521638661623, + "elapsed": 524.7940125465393 + }, + { + "step": 784, + "loss": 0.5843480825424194, + "objective": 0.5843480825424194, + "error": 0.345703125, + "gradient_norm": 0.04805552959442139, + "elapsed": 535.345025062561 + }, + { + "step": 800, + "loss": 0.3102012872695923, + "objective": 0.3102012872695923, + "error": 0.134765625, + "gradient_norm": 0.09761057049036026, + "elapsed": 544.4683487415314 + }, + { + "step": 816, + "loss": 0.5332639217376709, + "objective": 0.5332639217376709, + "error": 0.30078125, + "gradient_norm": 0.10398133844137192, + "elapsed": 554.8217175006866 + }, + { + "step": 832, + "loss": 0.4870310425758362, + "objective": 0.4870310425758362, + "error": 0.2685546875, + "gradient_norm": 0.05754273384809494, + "elapsed": 564.9130115509033 + }, + { + "step": 848, + "loss": 0.1336989849805832, + "objective": 0.1336989849805832, + "error": 0.0498046875, + "gradient_norm": 0.02862304449081421, + "elapsed": 573.6143791675568 + }, + { + "step": 864, + "loss": 0.5794297456741333, + "objective": 0.5794297456741333, + "error": 0.3427734375, + "gradient_norm": 0.05002075806260109, + "elapsed": 584.2565310001373 + }, + { + "step": 880, + "loss": 0.6150081753730774, + "objective": 0.6150081753730774, + "error": 0.341796875, + "gradient_norm": 0.0605069138109684, + "elapsed": 596.845867395401 + }, + { + "step": 896, + "loss": 0.3804032504558563, + "objective": 0.3804032504558563, + "error": 0.18359375, + "gradient_norm": 0.057405781000852585, + "elapsed": 606.0786938667297 + }, + { + "step": 912, + "loss": 0.5734928846359253, + "objective": 0.5734928846359253, + "error": 0.2958984375, + "gradient_norm": 0.06807747483253479, + "elapsed": 616.9755277633667 + }, + { + "step": 928, + "loss": 0.23615539073944092, + "objective": 0.23615539073944092, + "error": 0.107421875, + "gradient_norm": 0.04033413156867027, + "elapsed": 625.9104406833649 + }, + { + "step": 944, + "loss": 0.5668450593948364, + "objective": 0.5668450593948364, + "error": 0.3134765625, + "gradient_norm": 0.04825817048549652, + "elapsed": 635.4241654872894 + }, + { + "step": 960, + "loss": 0.1369795948266983, + "objective": 0.1369795948266983, + "error": 0.0537109375, + "gradient_norm": 0.029475854709744453, + "elapsed": 646.0763671398163 + }, + { + "step": 976, + "loss": 0.026218727231025696, + "objective": 0.026218727231025696, + "error": 0.009765625, + "gradient_norm": 0.0067830472253263, + "elapsed": 656.7150173187256 + }, + { + "step": 992, + "loss": 0.6016548871994019, + "objective": 0.6016548871994019, + "error": 0.3564453125, + "gradient_norm": 0.04935981705784798, + "elapsed": 668.9989516735077 + }, + { + "step": 1008, + "loss": 0.1370980143547058, + "objective": 0.1370980143547058, + "error": 0.0546875, + "gradient_norm": 0.04418199881911278, + "elapsed": 677.3821382522583 + }, + { + "step": 1024, + "loss": 0.4085504412651062, + "objective": 0.4085504412651062, + "error": 0.19921875, + "gradient_norm": 0.07943295687437057, + "elapsed": 688.8395888805389 + }, + { + "step": 1040, + "loss": 0.34129297733306885, + "objective": 0.34129297733306885, + "error": 0.15625, + "gradient_norm": 0.04551500454545021, + "elapsed": 703.4613966941833 + }, + { + "step": 1056, + "loss": 0.5297085046768188, + "objective": 0.5297085046768188, + "error": 0.2705078125, + "gradient_norm": 0.06177444010972977, + "elapsed": 714.0862259864807 + }, + { + "step": 1072, + "loss": 0.3833361268043518, + "objective": 0.3833361268043518, + "error": 0.185546875, + "gradient_norm": 0.053057629615068436, + "elapsed": 724.1480000019073 + }, + { + "step": 1088, + "loss": 0.6497273445129395, + "objective": 0.6497273445129395, + "error": 0.421875, + "gradient_norm": 0.10790837556123734, + "elapsed": 735.8740057945251 + }, + { + "step": 1104, + "loss": 0.5393906831741333, + "objective": 0.5393906831741333, + "error": 0.2998046875, + "gradient_norm": 0.06015805900096893, + "elapsed": 743.9961709976196 + }, + { + "step": 1120, + "loss": 0.38553956151008606, + "objective": 0.38553956151008606, + "error": 0.1875, + "gradient_norm": 0.05357081815600395, + "elapsed": 753.2208635807037 + }, + { + "step": 1136, + "loss": 0.5478834509849548, + "objective": 0.5478834509849548, + "error": 0.2900390625, + "gradient_norm": 0.05761478468775749, + "elapsed": 761.3359644412994 + }, + { + "step": 1152, + "loss": 0.5732287168502808, + "objective": 0.5732287168502808, + "error": 0.341796875, + "gradient_norm": 0.07881136238574982, + "elapsed": 771.133172750473 + }, + { + "step": 1168, + "loss": 0.5174047946929932, + "objective": 0.5174047946929932, + "error": 0.29296875, + "gradient_norm": 0.07794999331235886, + "elapsed": 783.7084786891937 + }, + { + "step": 1184, + "loss": 0.5022754669189453, + "objective": 0.5022754669189453, + "error": 0.265625, + "gradient_norm": 0.05175226181745529, + "elapsed": 793.499255657196 + }, + { + "step": 1200, + "loss": 0.5698775053024292, + "objective": 0.5698775053024292, + "error": 0.34375, + "gradient_norm": 0.06385946273803711, + "elapsed": 804.970814704895 + }, + { + "step": 1216, + "loss": 0.6203033924102783, + "objective": 0.6203033924102783, + "error": 0.37109375, + "gradient_norm": 0.07393646240234375, + "elapsed": 816.1773698329926 + }, + { + "step": 1232, + "loss": 0.6154648065567017, + "objective": 0.6154648065567017, + "error": 0.3857421875, + "gradient_norm": 0.04278155043721199, + "elapsed": 827.3619928359985 + }, + { + "step": 1248, + "loss": 0.5948328971862793, + "objective": 0.5948328971862793, + "error": 0.3291015625, + "gradient_norm": 0.062024734914302826, + "elapsed": 838.8370804786682 + }, + { + "step": 1264, + "loss": 0.5644958019256592, + "objective": 0.5644958019256592, + "error": 0.3212890625, + "gradient_norm": 0.12030917406082153, + "elapsed": 849.5000331401825 + }, + { + "step": 1280, + "loss": 0.028782427310943604, + "objective": 0.028782427310943604, + "error": 0.0087890625, + "gradient_norm": 0.009096251800656319, + "elapsed": 857.8837285041809 + }, + { + "step": 1296, + "loss": 0.5129679441452026, + "objective": 0.5129679441452026, + "error": 0.2626953125, + "gradient_norm": 0.12833116948604584, + "elapsed": 868.5195860862732 + }, + { + "step": 1312, + "loss": 0.4095553159713745, + "objective": 0.4095553159713745, + "error": 0.193359375, + "gradient_norm": 0.09977155178785324, + "elapsed": 877.4712297916412 + }, + { + "step": 1328, + "loss": 0.2850862741470337, + "objective": 0.2850862741470337, + "error": 0.1240234375, + "gradient_norm": 0.05365074798464775, + "elapsed": 887.5133347511292 + }, + { + "step": 1344, + "loss": 0.41809165477752686, + "objective": 0.41809165477752686, + "error": 0.19140625, + "gradient_norm": 0.10622142255306244, + "elapsed": 895.0828025341034 + }, + { + "step": 1360, + "loss": 0.3627069890499115, + "objective": 0.3627069890499115, + "error": 0.1650390625, + "gradient_norm": 0.049557290971279144, + "elapsed": 906.2595431804657 + }, + { + "step": 1376, + "loss": 0.023341629654169083, + "objective": 0.023341629654169083, + "error": 0.0068359375, + "gradient_norm": 0.008970360271632671, + "elapsed": 916.6110022068024 + }, + { + "step": 1392, + "loss": 0.519214391708374, + "objective": 0.519214391708374, + "error": 0.26953125, + "gradient_norm": 0.052287619560956955, + "elapsed": 926.660523891449 + }, + { + "step": 1408, + "loss": 0.6152850389480591, + "objective": 0.6152850389480591, + "error": 0.3662109375, + "gradient_norm": 0.049617987126111984, + "elapsed": 936.7533056735992 + }, + { + "step": 1424, + "loss": 0.020841240882873535, + "objective": 0.020841240882873535, + "error": 0.0068359375, + "gradient_norm": 0.008459246717393398, + "elapsed": 946.8231542110443 + }, + { + "step": 1440, + "loss": 0.5963407754898071, + "objective": 0.5963407754898071, + "error": 0.3525390625, + "gradient_norm": 0.08714025467634201, + "elapsed": 956.0344398021698 + }, + { + "step": 1456, + "loss": 0.44305220246315, + "objective": 0.44305220246315, + "error": 0.2099609375, + "gradient_norm": 0.061915796250104904, + "elapsed": 967.506050825119 + }, + { + "step": 1472, + "loss": 0.5292993783950806, + "objective": 0.5292993783950806, + "error": 0.2939453125, + "gradient_norm": 0.10089804977178574, + "elapsed": 977.855934381485 + }, + { + "step": 1488, + "loss": 0.6087026596069336, + "objective": 0.6087026596069336, + "error": 0.345703125, + "gradient_norm": 0.05276322737336159, + "elapsed": 986.2705359458923 + }, + { + "step": 1504, + "loss": 0.3670162558555603, + "objective": 0.3670162558555603, + "error": 0.1796875, + "gradient_norm": 0.0575372576713562, + "elapsed": 995.2220902442932 + }, + { + "step": 1520, + "loss": 0.33479321002960205, + "objective": 0.33479321002960205, + "error": 0.1435546875, + "gradient_norm": 0.056317709386348724, + "elapsed": 1005.2168045043945 + }, + { + "step": 1536, + "loss": 0.5869293212890625, + "objective": 0.5869293212890625, + "error": 0.337890625, + "gradient_norm": 0.07419256865978241, + "elapsed": 1016.8691458702087 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved2_full", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "0f5926c94bb1aa83840c6d257757b80c081835affc2cb34bf9246ba18e00266a", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 512, + 1024, + 1536 + ], + "training_draws": 1572864, + "distinct_phase_training_rows": 467790, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18254, + "surface_code_bX_d5_r03_center_5_5": 18525, + "surface_code_bX_d5_r05_center_5_5": 18175, + "surface_code_bX_d5_r07_center_5_5": 18005, + "surface_code_bX_d5_r09_center_5_5": 18067, + "surface_code_bX_d5_r11_center_5_5": 18445, + "surface_code_bX_d5_r13_center_5_5": 18673, + "surface_code_bX_d5_r15_center_5_5": 17345, + "surface_code_bX_d5_r17_center_5_5": 17898, + "surface_code_bX_d5_r19_center_5_5": 18359, + "surface_code_bX_d5_r21_center_5_5": 18036, + "surface_code_bX_d5_r23_center_5_5": 17255, + "surface_code_bX_d5_r25_center_5_5": 18057, + "surface_code_bZ_d5_r01_center_5_5": 17596, + "surface_code_bZ_d5_r03_center_5_5": 18333, + "surface_code_bZ_d5_r05_center_5_5": 18250, + "surface_code_bZ_d5_r07_center_5_5": 18210, + "surface_code_bZ_d5_r09_center_5_5": 17447, + "surface_code_bZ_d5_r11_center_5_5": 18120, + "surface_code_bZ_d5_r13_center_5_5": 18224, + "surface_code_bZ_d5_r15_center_5_5": 17857, + "surface_code_bZ_d5_r17_center_5_5": 18359, + "surface_code_bZ_d5_r19_center_5_5": 17398, + "surface_code_bZ_d5_r21_center_5_5": 18235, + "surface_code_bZ_d5_r23_center_5_5": 16653, + "surface_code_bZ_d5_r25_center_5_5": 18014 + }, + "initial_optimizer_count": 512, + "last_optimizer_count": 2048, + "parent_checkpoint_sha256": "2b00e3f258886b5c4ecf69f36fd5463a205eefc84bd10c550acc391e84515c24", + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "training_source_snapshot": "training_sources/reserved2_full", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23212139423076927, + "0": 0.23353365384615382, + "blend-0": 0.23306790865384613, + "512": 0.23380408653846152, + "blend-512": 0.23366887019230773, + "1024": 0.23197115384615388, + "blend-1024": 0.23299278846153842, + "1536": 0.23206129807692305, + "blend-1536": 0.2329326923076923 + }, + "selected": "1024" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.21953124999999998, + "0": 0.22103365384615387, + "blend-0": 0.2211388221153846, + "512": 0.22092848557692304, + "blend-512": 0.22094350961538464, + "1024": 0.2204326923076923, + "blend-1024": 0.22046274038461539, + "1536": 0.22086838942307688, + "blend-1536": 0.22059795673076926 + }, + "selected": "incumbent" + } + ], + "checkpoints": { + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 428858, + "weights_sha256": "a346f535004381e2e0b628fac8ff7c58282a2447b9704638e46232dff46e511f", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit unused intermediate logical tracking; raw neural branches also omit the unused final physical readout.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false, + "numerical_controls": { + "packaged_runtime_control_cpu": { + "device": "cpu", + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 7, + "same_cpu_old_vs_new_maximum_difference": 0.0, + "old_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "new_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "cpu_vs_reconstructed_old_gpu_runtime_maximum_difference": 4.976987838745117e-05, + "original_gpu_evaluation_vs_reconstructed_gpu_runtime_maximum_difference": 7.748603820800781e-07, + "initial_failed_control": { + "comparison": "CPU runtime against original GPU evaluator", + "observed_maximum_difference": 4.971027374267578e-05, + "original_tolerance": 3e-06 + }, + "sources": { + "d5_base_context_model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "d5_context_model.py": "53342e15dcbb8bc2dd0b288d75ea115fb504be99a33bc283a518b9d76232cd99", + "d5_temporal_context_model.py": "d58bcfe01767228d18ce2078d555abf13037b5df63edf38273ba66f0966ee445", + "d5_history_context_model.py": "4cc383b4909ff740bccfd20b687f8ee46866e67f93f82fe6c4bace162149ffb4", + "d5_history_features.py": "d709cd54225aa1b14707afa436314c8392f59f748a0007d988c6d18dedd275ee", + "d5_contextual.py": "59d6c85dc4bd61e26cf7243baf0e2637c3de1d35327b2c763707badd19446550", + "turbo.py": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b" + }, + "scope": "Same-device compatibility check. Reconstructed GPU runtime removes the recorded equal physical blend; that reconstruction has floating-point rounding uncertainty.", + "status": "passed_same_device_compatibility" + }, + "dispatcher_control_cpu": { + "status": "passed", + "device": "cpu", + "sources": { + "d5_context_model.py": "53342e15dcbb8bc2dd0b288d75ea115fb504be99a33bc283a518b9d76232cd99", + "d5_base_context_model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "d5_temporal_context_model.py": "d58bcfe01767228d18ce2078d555abf13037b5df63edf38273ba66f0966ee445", + "d5_history_context_model.py": "4cc383b4909ff740bccfd20b687f8ee46866e67f93f82fe6c4bace162149ffb4", + "d5_history_features.py": "d709cd54225aa1b14707afa436314c8392f59f748a0007d988c6d18dedd275ee" + }, + "cases": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "base64", + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "base128", + "weights_sha256": "2a21869e7669492fac8252131434b2e09c97f1def2714988382ab7f127371bd8", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "temporal", + "weights_sha256": "9446a1e6dc46e1bcae540531e4f124930bb151ebfa600746ca77bc8f5b2aaa7c", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "history", + "weights_sha256": "c508d8968ffa143be4219a207fb54ece3e1bfe144b8a880e4ed4f3d13f092c1e", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "base64", + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "base128", + "weights_sha256": "2a21869e7669492fac8252131434b2e09c97f1def2714988382ab7f127371bd8", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "temporal", + "weights_sha256": "9446a1e6dc46e1bcae540531e4f124930bb151ebfa600746ca77bc8f5b2aaa7c", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "history", + "weights_sha256": "c508d8968ffa143be4219a207fb54ece3e1bfe144b8a880e4ed4f3d13f092c1e", + "maximum_edge_probability_difference": 0.0 + } + ], + "scope": "Routing and code-copy check against each direct model implementation, using training detector inputs without labels. Tiny trained temporal/history smoke weights test nonzero feature couplings; they are excluded from model selection and submission.", + "test_data_used": false + }, + "cpu_probability_precision": { + "condition": "surface_code_bX_d5_r03_center_5_5", + "validation_syndromes": 7, + "logical_labels_used": false, + "parameter_updates": 0, + "reference": "Float64 neural forward and exact contraction from the same stored weights and fixed float32 input logits, on CPU", + "cpu_float32_vs_float64_maximum_difference": 7.624897924163321e-08, + "cpu_float32_edges_float64_contraction_vs_float64_maximum_difference": 4.725248914372315e-08, + "gpu_float32_vs_float64_maximum_difference": 4.964999121059854e-05, + "cpu_vs_gpu_float32_maximum_difference": 4.971027374267578e-05, + "maximum_neural_edge_probability_difference": 2.6330936014895556e-08, + "float32_edge_values_above_one_minus_1e6": 0, + "scope": "Precision diagnostic only; the published model is unchanged. Same-device old/new packaged-code compatibility was independently exact." + }, + "priors_only_control_cpu": { + "status": "passed", + "device": "cpu", + "source_sha256": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b", + "records": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 2.7116777896881104, + "priors_only_seconds_warm": 0.13569164276123047 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 3.557781457901001, + "priors_only_seconds_warm": 1.7711329460144043 + } + ], + "scope": "CPU numerical equivalence on supplied training syndromes; timings are not a controlled speed comparison." + } + } + }, + "package_validation": { + "performance": 0.7672100360576923, + "failure_by_distance": { + "d3": 0.2398212139423077, + "d5": 0.2257587139423077 + }, + "scorer": "Supplied qecbench.scoring on all 130 validation conditions and 665600 shots", + "contract_checks": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "shots": 1, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d3_r25_center_5_3", + "shots": 37, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d3_r13_center_5_7", + "shots": 1025, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 7, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 257, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 17, + "maximum_probability_difference": 0.0 + } + ], + "prediction_generation": "All26 d5 conditions replayed from the assembled package; unchanged d3 predictions retained. Trusted scoring covers all130 conditions.", + "runtime_evidence": "Full133120-shot d5 replay took 312.38s on one H100; compatible physical/neural priors are shared. D3 paths unchanged from the recorded incumbent.", + "d5_validation_runtime_seconds": 312.38163661956787, + "contract_execution": { + "requested_verifier_uid": 10001, + "effective_uid": 1000, + "effective_gid": 1000, + "supplementary_groups": [], + "identity_status": "Development process is already unprivileged and cannot change UID; verifier UID10001 was not executed", + "model_and_input_copy": "Owned by development UID 1000,directories0555,files0444,relocated under a fresh accessible temporary parent", + "output_directory": "Owned by execution UID 1000,mode0700", + "PYTHONPATH": "", + "backend": "Runtime default; full selected subset cases", + "scope": "Local contract check; not a Docker/network/mount-isolation test" + } + } +} diff --git a/shared/package-files/06/06e2ecaf4175380e08780f35e81cee2c5892346a693e800ba62795dbff0d7e0f/blob b/shared/package-files/06/06e2ecaf4175380e08780f35e81cee2c5892346a693e800ba62795dbff0d7e0f/blob new file mode 100644 index 0000000000000000000000000000000000000000..29e3dc0aebe9551ae94566904372dde3563fbef9 --- /dev/null +++ b/shared/package-files/06/06e2ecaf4175380e08780f35e81cee2c5892346a693e800ba62795dbff0d7e0f/blob @@ -0,0 +1,303 @@ +""" test scalar indexing, including at and iat """ +from datetime import ( + datetime, + timedelta, +) +import itertools + +import numpy as np +import pytest + +from pandas import ( + DataFrame, + Series, + Timedelta, + Timestamp, + date_range, +) +import pandas._testing as tm + + +def generate_indices(f, values=False): + """ + generate the indices + if values is True , use the axis values + is False, use the range + """ + axes = f.axes + if values: + axes = (list(range(len(ax))) for ax in axes) + + return itertools.product(*axes) + + +class TestScalar: + @pytest.mark.parametrize("kind", ["series", "frame"]) + @pytest.mark.parametrize("col", ["ints", "uints"]) + def test_iat_set_ints(self, kind, col, request): + f = request.getfixturevalue(f"{kind}_{col}") + indices = generate_indices(f, True) + for i in indices: + f.iat[i] = 1 + expected = f.values[i] + tm.assert_almost_equal(expected, 1) + + @pytest.mark.parametrize("kind", ["series", "frame"]) + @pytest.mark.parametrize("col", ["labels", "ts", "floats"]) + def test_iat_set_other(self, kind, col, request): + f = request.getfixturevalue(f"{kind}_{col}") + msg = "iAt based indexing can only have integer indexers" + with pytest.raises(ValueError, match=msg): + idx = next(generate_indices(f, False)) + f.iat[idx] = 1 + + @pytest.mark.parametrize("kind", ["series", "frame"]) + @pytest.mark.parametrize("col", ["ints", "uints", "labels", "ts", "floats"]) + def test_at_set_ints_other(self, kind, col, request): + f = request.getfixturevalue(f"{kind}_{col}") + indices = generate_indices(f, False) + for i in indices: + f.at[i] = 1 + expected = f.loc[i] + tm.assert_almost_equal(expected, 1) + + +class TestAtAndiAT: + # at and iat tests that don't need Base class + + def test_float_index_at_iat(self): + ser = Series([1, 2, 3], index=[0.1, 0.2, 0.3]) + for el, item in ser.items(): + assert ser.at[el] == item + for i in range(len(ser)): + assert ser.iat[i] == i + 1 + + def test_at_iat_coercion(self): + # as timestamp is not a tuple! + dates = date_range("1/1/2000", periods=8) + df = DataFrame( + np.random.default_rng(2).standard_normal((8, 4)), + index=dates, + columns=["A", "B", "C", "D"], + ) + s = df["A"] + + result = s.at[dates[5]] + xp = s.values[5] + assert result == xp + + @pytest.mark.parametrize( + "ser, expected", + [ + [ + Series(["2014-01-01", "2014-02-02"], dtype="datetime64[ns]"), + Timestamp("2014-02-02"), + ], + [ + Series(["1 days", "2 days"], dtype="timedelta64[ns]"), + Timedelta("2 days"), + ], + ], + ) + def test_iloc_iat_coercion_datelike(self, indexer_ial, ser, expected): + # GH 7729 + # make sure we are boxing the returns + result = indexer_ial(ser)[1] + assert result == expected + + def test_imethods_with_dups(self): + # GH6493 + # iat/iloc with dups + + s = Series(range(5), index=[1, 1, 2, 2, 3], dtype="int64") + result = s.iloc[2] + assert result == 2 + result = s.iat[2] + assert result == 2 + + msg = "index 10 is out of bounds for axis 0 with size 5" + with pytest.raises(IndexError, match=msg): + s.iat[10] + msg = "index -10 is out of bounds for axis 0 with size 5" + with pytest.raises(IndexError, match=msg): + s.iat[-10] + + result = s.iloc[[2, 3]] + expected = Series([2, 3], [2, 2], dtype="int64") + tm.assert_series_equal(result, expected) + + df = s.to_frame() + result = df.iloc[2] + expected = Series(2, index=[0], name=2) + tm.assert_series_equal(result, expected) + + result = df.iat[2, 0] + assert result == 2 + + def test_frame_at_with_duplicate_axes(self): + # GH#33041 + arr = np.random.default_rng(2).standard_normal(6).reshape(3, 2) + df = DataFrame(arr, columns=["A", "A"]) + + result = df.at[0, "A"] + expected = df.iloc[0].copy() + + tm.assert_series_equal(result, expected) + + result = df.T.at["A", 0] + tm.assert_series_equal(result, expected) + + # setter + df.at[1, "A"] = 2 + expected = Series([2.0, 2.0], index=["A", "A"], name=1) + tm.assert_series_equal(df.iloc[1], expected) + + def test_at_getitem_dt64tz_values(self): + # gh-15822 + df = DataFrame( + { + "name": ["John", "Anderson"], + "date": [ + Timestamp(2017, 3, 13, 13, 32, 56), + Timestamp(2017, 2, 16, 12, 10, 3), + ], + } + ) + df["date"] = df["date"].dt.tz_localize("Asia/Shanghai") + + expected = Timestamp("2017-03-13 13:32:56+0800", tz="Asia/Shanghai") + + result = df.loc[0, "date"] + assert result == expected + + result = df.at[0, "date"] + assert result == expected + + def test_mixed_index_at_iat_loc_iloc_series(self): + # GH 19860 + s = Series([1, 2, 3, 4, 5], index=["a", "b", "c", 1, 2]) + for el, item in s.items(): + assert s.at[el] == s.loc[el] == item + for i in range(len(s)): + assert s.iat[i] == s.iloc[i] == i + 1 + + with pytest.raises(KeyError, match="^4$"): + s.at[4] + with pytest.raises(KeyError, match="^4$"): + s.loc[4] + + def test_mixed_index_at_iat_loc_iloc_dataframe(self): + # GH 19860 + df = DataFrame( + [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]], columns=["a", "b", "c", 1, 2] + ) + for rowIdx, row in df.iterrows(): + for el, item in row.items(): + assert df.at[rowIdx, el] == df.loc[rowIdx, el] == item + + for row in range(2): + for i in range(5): + assert df.iat[row, i] == df.iloc[row, i] == row * 5 + i + + with pytest.raises(KeyError, match="^3$"): + df.at[0, 3] + with pytest.raises(KeyError, match="^3$"): + df.loc[0, 3] + + def test_iat_setter_incompatible_assignment(self): + # GH 23236 + result = DataFrame({"a": [0.0, 1.0], "b": [4, 5]}) + result.iat[0, 0] = None + expected = DataFrame({"a": [None, 1], "b": [4, 5]}) + tm.assert_frame_equal(result, expected) + + +def test_iat_dont_wrap_object_datetimelike(): + # GH#32809 .iat calls go through DataFrame._get_value, should not + # call maybe_box_datetimelike + dti = date_range("2016-01-01", periods=3) + tdi = dti - dti + ser = Series(dti.to_pydatetime(), dtype=object) + ser2 = Series(tdi.to_pytimedelta(), dtype=object) + df = DataFrame({"A": ser, "B": ser2}) + assert (df.dtypes == object).all() + + for result in [df.at[0, "A"], df.iat[0, 0], df.loc[0, "A"], df.iloc[0, 0]]: + assert result is ser[0] + assert isinstance(result, datetime) + assert not isinstance(result, Timestamp) + + for result in [df.at[1, "B"], df.iat[1, 1], df.loc[1, "B"], df.iloc[1, 1]]: + assert result is ser2[1] + assert isinstance(result, timedelta) + assert not isinstance(result, Timedelta) + + +def test_at_with_tuple_index_get(): + # GH 26989 + # DataFrame.at getter works with Index of tuples + df = DataFrame({"a": [1, 2]}, index=[(1, 2), (3, 4)]) + assert df.index.nlevels == 1 + assert df.at[(1, 2), "a"] == 1 + + # Series.at getter works with Index of tuples + series = df["a"] + assert series.index.nlevels == 1 + assert series.at[(1, 2)] == 1 + + +@pytest.mark.filterwarnings("ignore:Setting a value on a view:FutureWarning") +def test_at_with_tuple_index_set(): + # GH 26989 + # DataFrame.at setter works with Index of tuples + df = DataFrame({"a": [1, 2]}, index=[(1, 2), (3, 4)]) + assert df.index.nlevels == 1 + df.at[(1, 2), "a"] = 2 + assert df.at[(1, 2), "a"] == 2 + + # Series.at setter works with Index of tuples + series = df["a"] + assert series.index.nlevels == 1 + series.at[1, 2] = 3 + assert series.at[1, 2] == 3 + + +class TestMultiIndexScalar: + def test_multiindex_at_get(self): + # GH 26989 + # DataFrame.at and DataFrame.loc getter works with MultiIndex + df = DataFrame({"a": [1, 2]}, index=[[1, 2], [3, 4]]) + assert df.index.nlevels == 2 + assert df.at[(1, 3), "a"] == 1 + assert df.loc[(1, 3), "a"] == 1 + + # Series.at and Series.loc getter works with MultiIndex + series = df["a"] + assert series.index.nlevels == 2 + assert series.at[1, 3] == 1 + assert series.loc[1, 3] == 1 + + @pytest.mark.filterwarnings("ignore:Setting a value on a view:FutureWarning") + def test_multiindex_at_set(self): + # GH 26989 + # DataFrame.at and DataFrame.loc setter works with MultiIndex + df = DataFrame({"a": [1, 2]}, index=[[1, 2], [3, 4]]) + assert df.index.nlevels == 2 + df.at[(1, 3), "a"] = 3 + assert df.at[(1, 3), "a"] == 3 + df.loc[(1, 3), "a"] = 4 + assert df.loc[(1, 3), "a"] == 4 + + # Series.at and Series.loc setter works with MultiIndex + series = df["a"] + assert series.index.nlevels == 2 + series.at[1, 3] = 5 + assert series.at[1, 3] == 5 + series.loc[1, 3] = 6 + assert series.loc[1, 3] == 6 + + def test_multiindex_at_get_one_level(self): + # GH#38053 + s2 = Series((0, 1), index=[[False, True]]) + result = s2.at[False] + assert result == 0 diff --git a/shared/package-files/06/06e4113c5d11f4cadb2f31b2338e39475c67e2f79bdca96cd05181611f54afda/blob b/shared/package-files/06/06e4113c5d11f4cadb2f31b2338e39475c67e2f79bdca96cd05181611f54afda/blob new file mode 100644 index 0000000000000000000000000000000000000000..f9b90dd08988f112132f24d9723c62605e032662 --- /dev/null +++ b/shared/package-files/06/06e4113c5d11f4cadb2f31b2338e39475c67e2f79bdca96cd05181611f54afda/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor linalg_tensorinv(const at::Tensor & self, int64_t ind=2); +TORCH_API at::Tensor & linalg_tensorinv_out(const at::Tensor & self, int64_t ind, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/06/06e5736b4eef85a7e4abaf15abd8328a482b85c39d0fac6eacfc0f1eaaa8a041/blob b/shared/package-files/06/06e5736b4eef85a7e4abaf15abd8328a482b85c39d0fac6eacfc0f1eaaa8a041/blob new file mode 100644 index 0000000000000000000000000000000000000000..3e68f869ea34a85fcf46e8b90d1a40c332889f3f Binary files /dev/null and b/shared/package-files/06/06e5736b4eef85a7e4abaf15abd8328a482b85c39d0fac6eacfc0f1eaaa8a041/blob differ diff --git a/shared/package-files/06/06e5eecfab0237d4daed4956441ce3c7876d0e96dd748de38cabbcc4ea430f04/blob b/shared/package-files/06/06e5eecfab0237d4daed4956441ce3c7876d0e96dd748de38cabbcc4ea430f04/blob new file mode 100644 index 0000000000000000000000000000000000000000..efd25925a9f305bfc576612dba15054329c7f856 --- /dev/null +++ b/shared/package-files/06/06e5eecfab0237d4daed4956441ce3c7876d0e96dd748de38cabbcc4ea430f04/blob @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::kl_div(Tensor self, Tensor target, int reduction=Mean, *, bool log_target=False) -> Tensor +inline at::Tensor kl_div(const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean, bool log_target=false) { + return at::_ops::kl_div::call(self, target, reduction, log_target); +} + +} diff --git a/shared/package-files/06/06e66db70bc400c63502c3f4101850917ac8015607eaa8373fc99997281bff9e/blob b/shared/package-files/06/06e66db70bc400c63502c3f4101850917ac8015607eaa8373fc99997281bff9e/blob new file mode 100644 index 0000000000000000000000000000000000000000..f4847a150f978cc90217b44533e962d4567a7aac --- /dev/null +++ b/shared/package-files/06/06e66db70bc400c63502c3f4101850917ac8015607eaa8373fc99997281bff9e/blob @@ -0,0 +1,30 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor ne(const at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor & ne_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor & ne_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out); +TORCH_API at::Tensor & ne_(at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor ne(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & ne_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & ne_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +TORCH_API at::Tensor & ne_(at::Tensor & self, const at::Tensor & other); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/06/06eb1ab5790017b7fd3eb3c6a87d7ac941a8ac223d5d8a42deb6d53a7d646de1/blob b/shared/package-files/06/06eb1ab5790017b7fd3eb3c6a87d7ac941a8ac223d5d8a42deb6d53a7d646de1/blob new file mode 100644 index 0000000000000000000000000000000000000000..e55695a411cdbc6683a602b0717a5429a339123c --- /dev/null +++ b/shared/package-files/06/06eb1ab5790017b7fd3eb3c6a87d7ac941a8ac223d5d8a42deb6d53a7d646de1/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API int64_t stride(const at::Tensor & self, int64_t dim); +TORCH_API int64_t stride(const at::Tensor & self, at::Dimname dim); +} // namespace native +} // namespace at diff --git a/shared/package-files/06/06eb7dafd9b888bec41aafe168c5bc222438562bc7d13814a33c57e293ef7691/blob b/shared/package-files/06/06eb7dafd9b888bec41aafe168c5bc222438562bc7d13814a33c57e293ef7691/blob new file mode 100644 index 0000000000000000000000000000000000000000..2665f89b52d2f17ce7b0a857bea73ec5fab2df88 --- /dev/null +++ b/shared/package-files/06/06eb7dafd9b888bec41aafe168c5bc222438562bc7d13814a33c57e293ef7691/blob @@ -0,0 +1 @@ +dict(real=dict(rk="double")) diff --git a/shared/package-files/06/06ec96e9078fc6835997e0a0c69e562da87f7be9122b686c37c1ae77f8346a87/blob b/shared/package-files/06/06ec96e9078fc6835997e0a0c69e562da87f7be9122b686c37c1ae77f8346a87/blob new file mode 100644 index 0000000000000000000000000000000000000000..a1c23ff05f3e19aca490444216ec295453483e80 --- /dev/null +++ b/shared/package-files/06/06ec96e9078fc6835997e0a0c69e562da87f7be9122b686c37c1ae77f8346a87/blob @@ -0,0 +1,160 @@ +import datetime + +import numpy as np +import pytest + +from pandas.compat import ( + IS64, + is_platform_windows, +) + +from pandas import ( + Categorical, + DataFrame, + Series, + date_range, +) +import pandas._testing as tm + + +class TestIteration: + def test_keys(self, float_frame): + assert float_frame.keys() is float_frame.columns + + def test_iteritems(self): + df = DataFrame([[1, 2, 3], [4, 5, 6]], columns=["a", "a", "b"]) + for k, v in df.items(): + assert isinstance(v, DataFrame._constructor_sliced) + + def test_items(self): + # GH#17213, GH#13918 + cols = ["a", "b", "c"] + df = DataFrame([[1, 2, 3], [4, 5, 6]], columns=cols) + for c, (k, v) in zip(cols, df.items()): + assert c == k + assert isinstance(v, Series) + assert (df[k] == v).all() + + def test_items_names(self, float_string_frame): + for k, v in float_string_frame.items(): + assert v.name == k + + def test_iter(self, float_frame): + assert list(float_frame) == list(float_frame.columns) + + def test_iterrows(self, float_frame, float_string_frame): + for k, v in float_frame.iterrows(): + exp = float_frame.loc[k] + tm.assert_series_equal(v, exp) + + for k, v in float_string_frame.iterrows(): + exp = float_string_frame.loc[k] + tm.assert_series_equal(v, exp) + + def test_iterrows_iso8601(self): + # GH#19671 + s = DataFrame( + { + "non_iso8601": ["M1701", "M1802", "M1903", "M2004"], + "iso8601": date_range("2000-01-01", periods=4, freq="ME"), + } + ) + for k, v in s.iterrows(): + exp = s.loc[k] + tm.assert_series_equal(v, exp) + + def test_iterrows_corner(self): + # GH#12222 + df = DataFrame( + { + "a": [datetime.datetime(2015, 1, 1)], + "b": [None], + "c": [None], + "d": [""], + "e": [[]], + "f": [set()], + "g": [{}], + } + ) + expected = Series( + [datetime.datetime(2015, 1, 1), None, None, "", [], set(), {}], + index=list("abcdefg"), + name=0, + dtype="object", + ) + _, result = next(df.iterrows()) + tm.assert_series_equal(result, expected) + + def test_itertuples(self, float_frame): + for i, tup in enumerate(float_frame.itertuples()): + ser = DataFrame._constructor_sliced(tup[1:]) + ser.name = tup[0] + expected = float_frame.iloc[i, :].reset_index(drop=True) + tm.assert_series_equal(ser, expected) + + def test_itertuples_index_false(self): + df = DataFrame( + {"floats": np.random.default_rng(2).standard_normal(5), "ints": range(5)}, + columns=["floats", "ints"], + ) + + for tup in df.itertuples(index=False): + assert isinstance(tup[1], int) + + def test_itertuples_duplicate_cols(self): + df = DataFrame(data={"a": [1, 2, 3], "b": [4, 5, 6]}) + dfaa = df[["a", "a"]] + + assert list(dfaa.itertuples()) == [(0, 1, 1), (1, 2, 2), (2, 3, 3)] + + # repr with int on 32-bit/windows + if not (is_platform_windows() or not IS64): + assert ( + repr(list(df.itertuples(name=None))) + == "[(0, 1, 4), (1, 2, 5), (2, 3, 6)]" + ) + + def test_itertuples_tuple_name(self): + df = DataFrame(data={"a": [1, 2, 3], "b": [4, 5, 6]}) + tup = next(df.itertuples(name="TestName")) + assert tup._fields == ("Index", "a", "b") + assert (tup.Index, tup.a, tup.b) == tup + assert type(tup).__name__ == "TestName" + + def test_itertuples_disallowed_col_labels(self): + df = DataFrame(data={"def": [1, 2, 3], "return": [4, 5, 6]}) + tup2 = next(df.itertuples(name="TestName")) + assert tup2 == (0, 1, 4) + assert tup2._fields == ("Index", "_1", "_2") + + @pytest.mark.parametrize("limit", [254, 255, 1024]) + @pytest.mark.parametrize("index", [True, False]) + def test_itertuples_py2_3_field_limit_namedtuple(self, limit, index): + # GH#28282 + df = DataFrame([{f"foo_{i}": f"bar_{i}" for i in range(limit)}]) + result = next(df.itertuples(index=index)) + assert isinstance(result, tuple) + assert hasattr(result, "_fields") + + def test_sequence_like_with_categorical(self): + # GH#7839 + # make sure can iterate + df = DataFrame( + {"id": [1, 2, 3, 4, 5, 6], "raw_grade": ["a", "b", "b", "a", "a", "e"]} + ) + df["grade"] = Categorical(df["raw_grade"]) + + # basic sequencing testing + result = list(df.grade.values) + expected = np.array(df.grade.values).tolist() + tm.assert_almost_equal(result, expected) + + # iteration + for t in df.itertuples(index=False): + str(t) + + for row, s in df.iterrows(): + str(s) + + for c, col in df.items(): + str(col) diff --git a/shared/package-files/06/06ecf92c25953c6884a271c4f9c5c85df6e406135cd2ac55adac6435dc4aa7ca/blob b/shared/package-files/06/06ecf92c25953c6884a271c4f9c5c85df6e406135cd2ac55adac6435dc4aa7ca/blob new file mode 100644 index 0000000000000000000000000000000000000000..a04da4f74849805641e4c470f6b6b8d5f7000e3a --- /dev/null +++ b/shared/package-files/06/06ecf92c25953c6884a271c4f9c5c85df6e406135cd2ac55adac6435dc4aa7ca/blob @@ -0,0 +1,174 @@ +#!/usr/bin/env python3 + +import numbers +import random +import warnings + +from torchvision.transforms import RandomCrop, RandomResizedCrop + +from . import _functional_video as F + + +__all__ = [ + "RandomCropVideo", + "RandomResizedCropVideo", + "CenterCropVideo", + "NormalizeVideo", + "ToTensorVideo", + "RandomHorizontalFlipVideo", +] + + +warnings.warn( + "The 'torchvision.transforms._transforms_video' module is deprecated since 0.12 and will be removed in the future. " + "Please use the 'torchvision.transforms' module instead." +) + + +class RandomCropVideo(RandomCrop): + def __init__(self, size): + if isinstance(size, numbers.Number): + self.size = (int(size), int(size)) + else: + self.size = size + + def __call__(self, clip): + """ + Args: + clip (torch.tensor): Video clip to be cropped. Size is (C, T, H, W) + Returns: + torch.tensor: randomly cropped/resized video clip. + size is (C, T, OH, OW) + """ + i, j, h, w = self.get_params(clip, self.size) + return F.crop(clip, i, j, h, w) + + def __repr__(self) -> str: + return f"{self.__class__.__name__}(size={self.size})" + + +class RandomResizedCropVideo(RandomResizedCrop): + def __init__( + self, + size, + scale=(0.08, 1.0), + ratio=(3.0 / 4.0, 4.0 / 3.0), + interpolation_mode="bilinear", + ): + if isinstance(size, tuple): + if len(size) != 2: + raise ValueError(f"size should be tuple (height, width), instead got {size}") + self.size = size + else: + self.size = (size, size) + + self.interpolation_mode = interpolation_mode + self.scale = scale + self.ratio = ratio + + def __call__(self, clip): + """ + Args: + clip (torch.tensor): Video clip to be cropped. Size is (C, T, H, W) + Returns: + torch.tensor: randomly cropped/resized video clip. + size is (C, T, H, W) + """ + i, j, h, w = self.get_params(clip, self.scale, self.ratio) + return F.resized_crop(clip, i, j, h, w, self.size, self.interpolation_mode) + + def __repr__(self) -> str: + return f"{self.__class__.__name__}(size={self.size}, interpolation_mode={self.interpolation_mode}, scale={self.scale}, ratio={self.ratio})" + + +class CenterCropVideo: + def __init__(self, crop_size): + if isinstance(crop_size, numbers.Number): + self.crop_size = (int(crop_size), int(crop_size)) + else: + self.crop_size = crop_size + + def __call__(self, clip): + """ + Args: + clip (torch.tensor): Video clip to be cropped. Size is (C, T, H, W) + Returns: + torch.tensor: central cropping of video clip. Size is + (C, T, crop_size, crop_size) + """ + return F.center_crop(clip, self.crop_size) + + def __repr__(self) -> str: + return f"{self.__class__.__name__}(crop_size={self.crop_size})" + + +class NormalizeVideo: + """ + Normalize the video clip by mean subtraction and division by standard deviation + Args: + mean (3-tuple): pixel RGB mean + std (3-tuple): pixel RGB standard deviation + inplace (boolean): whether do in-place normalization + """ + + def __init__(self, mean, std, inplace=False): + self.mean = mean + self.std = std + self.inplace = inplace + + def __call__(self, clip): + """ + Args: + clip (torch.tensor): video clip to be normalized. Size is (C, T, H, W) + """ + return F.normalize(clip, self.mean, self.std, self.inplace) + + def __repr__(self) -> str: + return f"{self.__class__.__name__}(mean={self.mean}, std={self.std}, inplace={self.inplace})" + + +class ToTensorVideo: + """ + Convert tensor data type from uint8 to float, divide value by 255.0 and + permute the dimensions of clip tensor + """ + + def __init__(self): + pass + + def __call__(self, clip): + """ + Args: + clip (torch.tensor, dtype=torch.uint8): Size is (T, H, W, C) + Return: + clip (torch.tensor, dtype=torch.float): Size is (C, T, H, W) + """ + return F.to_tensor(clip) + + def __repr__(self) -> str: + return self.__class__.__name__ + + +class RandomHorizontalFlipVideo: + """ + Flip the video clip along the horizontal direction with a given probability + Args: + p (float): probability of the clip being flipped. Default value is 0.5 + """ + + def __init__(self, p=0.5): + self.p = p + + def __call__(self, clip): + """ + Args: + clip (torch.tensor): Size is (C, T, H, W) + Return: + clip (torch.tensor): Size is (C, T, H, W) + """ + if random.random() < self.p: + clip = F.hflip(clip) + return clip + + def __repr__(self) -> str: + return f"{self.__class__.__name__}(p={self.p})" diff --git a/shared/package-files/06/06ed11b7397fa6e6832c433bb3be627fceac193837153ac6c0ebba3abddec8da/blob b/shared/package-files/06/06ed11b7397fa6e6832c433bb3be627fceac193837153ac6c0ebba3abddec8da/blob new file mode 100644 index 0000000000000000000000000000000000000000..935365821c027c35927e00d511be94393a741df2 --- /dev/null +++ b/shared/package-files/06/06ed11b7397fa6e6832c433bb3be627fceac193837153ac6c0ebba3abddec8da/blob @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/builder/ci_310/chardet_1640804867535/work"} \ No newline at end of file diff --git a/shared/package-files/06/06f59c12f8dab0108c06df6a5485ba40dbc7c540ed41ad1fb3b0fcfb9d4b6df7/blob b/shared/package-files/06/06f59c12f8dab0108c06df6a5485ba40dbc7c540ed41ad1fb3b0fcfb9d4b6df7/blob new file mode 100644 index 0000000000000000000000000000000000000000..612b574304fc102a1991274981772f91b65da93b --- /dev/null +++ b/shared/package-files/06/06f59c12f8dab0108c06df6a5485ba40dbc7c540ed41ad1fb3b0fcfb9d4b6df7/blob @@ -0,0 +1,161 @@ +from __future__ import annotations + +import enum +from typing import TYPE_CHECKING, Any, NoReturn + +from narwhals._utils import Version, _hasattr_static, parse_version + +if TYPE_CHECKING: + import pandas as pd + import pyarrow as pa + from typing_extensions import Self, TypeIs + + from narwhals._interchange.series import InterchangeSeries + from narwhals.dtypes import DType + from narwhals.stable.v1.typing import DataFrameLike + + +class DtypeKind(enum.IntEnum): + # https://data-apis.org/dataframe-protocol/latest/API.html + INT = 0 + UINT = 1 + FLOAT = 2 + BOOL = 20 + STRING = 21 # UTF-8 + DATETIME = 22 + CATEGORICAL = 23 + + +def map_interchange_dtype_to_narwhals_dtype( # noqa: C901, PLR0911, PLR0912 + interchange_dtype: tuple[DtypeKind, int, Any, Any], +) -> DType: + dtypes = Version.V1.dtypes + if interchange_dtype[0] == DtypeKind.INT: + if interchange_dtype[1] == 64: + return dtypes.Int64() + if interchange_dtype[1] == 32: + return dtypes.Int32() + if interchange_dtype[1] == 16: + return dtypes.Int16() + if interchange_dtype[1] == 8: + return dtypes.Int8() + msg = "Invalid bit width for INT" # pragma: no cover + raise AssertionError(msg) + if interchange_dtype[0] == DtypeKind.UINT: + if interchange_dtype[1] == 64: + return dtypes.UInt64() + if interchange_dtype[1] == 32: + return dtypes.UInt32() + if interchange_dtype[1] == 16: + return dtypes.UInt16() + if interchange_dtype[1] == 8: + return dtypes.UInt8() + msg = "Invalid bit width for UINT" # pragma: no cover + raise AssertionError(msg) + if interchange_dtype[0] == DtypeKind.FLOAT: + if interchange_dtype[1] == 64: + return dtypes.Float64() + if interchange_dtype[1] == 32: + return dtypes.Float32() + if interchange_dtype[1] == 16: + return dtypes.Float16() + msg = "Invalid bit width for FLOAT" # pragma: no cover + raise AssertionError(msg) + if interchange_dtype[0] == DtypeKind.BOOL: + return dtypes.Boolean() + if interchange_dtype[0] == DtypeKind.STRING: + return dtypes.String() + if interchange_dtype[0] == DtypeKind.DATETIME: + return dtypes.Datetime() + if interchange_dtype[0] == DtypeKind.CATEGORICAL: # pragma: no cover + # upstream issue: https://github.com/ibis-project/ibis/issues/9570 + return dtypes.Categorical() + msg = f"Invalid dtype, got: {interchange_dtype}" # pragma: no cover + raise AssertionError(msg) + + +class InterchangeFrame: + _version = Version.V1 + + def __init__(self, df: DataFrameLike) -> None: + self._interchange_frame = df.__dataframe__() + + def __narwhals_dataframe__(self) -> Self: + return self + + def __native_namespace__(self) -> NoReturn: + msg = ( + "Cannot access native namespace for interchange-level dataframes with unknown backend." + "If you would like to see this kind of object supported in Narwhals, please " + "open a feature request at https://github.com/narwhals-dev/narwhals/issues." + ) + raise NotImplementedError(msg) + + def get_column(self, name: str) -> InterchangeSeries: + from narwhals._interchange.series import InterchangeSeries + + return InterchangeSeries(self._interchange_frame.get_column_by_name(name)) + + def to_pandas(self) -> pd.DataFrame: + import pandas as pd # ignore-banned-import() + + if parse_version(pd) < (1, 5, 0): # pragma: no cover + msg = ( + "Conversion to pandas is achieved via interchange protocol which requires" + f" 'pandas>=1.5.0' to be installed, found {pd.__version__}" + ) + raise NotImplementedError(msg) + return pd.api.interchange.from_dataframe(self._interchange_frame) + + def to_arrow(self) -> pa.Table: + from pyarrow.interchange.from_dataframe import ( # ignore-banned-import() + from_dataframe, + ) + + return from_dataframe(self._interchange_frame) + + @property + def schema(self) -> dict[str, DType]: + return { + column_name: map_interchange_dtype_to_narwhals_dtype( + self._interchange_frame.get_column_by_name(column_name).dtype + ) + for column_name in self._interchange_frame.column_names() + } + + @property + def columns(self) -> list[str]: + return list(self._interchange_frame.column_names()) + + def __getattr__(self, attr: str) -> NoReturn: + msg = ( + f"Attribute {attr} is not supported for interchange-level dataframes.\n\n" + "Hint: you probably called `nw.from_native` on an object which isn't fully " + "supported by Narwhals, yet implements `__dataframe__`. If you would like to " + "see this kind of object supported in Narwhals, please open a feature request " + "at https://github.com/narwhals-dev/narwhals/issues." + ) + raise NotImplementedError(msg) + + def simple_select(self, *column_names: str) -> Self: + frame = self._interchange_frame.select_columns_by_name(list(column_names)) + if not hasattr(frame, "_df"): # pragma: no cover + msg = ( + "Expected interchange object to implement `_df` property to allow for recovering original object.\n" + "See https://github.com/data-apis/dataframe-api/issues/360." + ) + raise NotImplementedError(msg) + return self.__class__(frame._df) + + def select(self, *exprs: str) -> Self: # pragma: no cover + msg = ( + "`select`-ing not by name is not supported for interchange-only level.\n\n" + "If you would like to see this kind of object better supported in " + "Narwhals, please open a feature request " + "at https://github.com/narwhals-dev/narwhals/issues." + ) + raise NotImplementedError(msg) + + +def supports_dataframe_interchange(obj: Any) -> TypeIs[DataFrameLike]: + return _hasattr_static(obj, "__dataframe__") diff --git a/shared/package-files/06/06f7ccb74a31ab9d3c900d87c814b7ce81b8acbd938ad74fe9cc674075f07869/blob b/shared/package-files/06/06f7ccb74a31ab9d3c900d87c814b7ce81b8acbd938ad74fe9cc674075f07869/blob new file mode 100644 index 0000000000000000000000000000000000000000..4b843563bdce395b49e9dbb9121ff6c50b9262a8 --- /dev/null +++ b/shared/package-files/06/06f7ccb74a31ab9d3c900d87c814b7ce81b8acbd938ad74fe9cc674075f07869/blob @@ -0,0 +1,2196 @@ +"""Utilities to build a composite estimator as a chain of transforms and estimators.""" + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +import warnings +from collections import Counter, defaultdict +from contextlib import contextmanager +from copy import deepcopy +from itertools import chain, islice + +import numpy as np +from scipy import sparse + +from .base import TransformerMixin, _fit_context, clone +from .exceptions import NotFittedError +from .preprocessing import FunctionTransformer +from .utils import Bunch +from .utils._metadata_requests import METHODS +from .utils._param_validation import HasMethods, Hidden +from .utils._repr_html.estimator import _VisualBlock +from .utils._set_output import ( + _get_container_adapter, + _safe_set_output, +) +from .utils._tags import get_tags +from .utils._user_interface import _print_elapsed_time +from .utils.metadata_routing import ( + MetadataRouter, + MethodMapping, + _raise_for_params, + _routing_enabled, + get_routing_for_object, + process_routing, +) +from .utils.metaestimators import _BaseComposition, available_if +from .utils.parallel import Parallel, delayed +from .utils.validation import check_is_fitted, check_memory + +__all__ = ["FeatureUnion", "Pipeline", "make_pipeline", "make_union"] + + +@contextmanager +def _raise_or_warn_if_not_fitted(estimator): + """A context manager to make sure a NotFittedError is raised, if a sub-estimator + raises the error. + + Otherwise, we raise a warning if the pipeline is not fitted, with the deprecation. + + TODO(1.8): remove this context manager and replace with check_is_fitted. + """ + try: + yield + except NotFittedError as exc: + raise NotFittedError("Pipeline is not fitted yet.") from exc + + # we only get here if the above didn't raise + try: + check_is_fitted(estimator) + except NotFittedError: + warnings.warn( + "This Pipeline instance is not fitted yet. Call 'fit' with " + "appropriate arguments before using other methods such as transform, " + "predict, etc. This will raise an error in 1.8 instead of the current " + "warning.", + FutureWarning, + ) + + +def _final_estimator_has(attr): + """Check that final_estimator has `attr`. + + Used together with `available_if` in `Pipeline`.""" + + def check(self): + # raise original `AttributeError` if `attr` does not exist + getattr(self._final_estimator, attr) + return True + + return check + + +def _cached_transform( + sub_pipeline, *, cache, param_name, param_value, transform_params +): + """Transform a parameter value using a sub-pipeline and cache the result. + + Parameters + ---------- + sub_pipeline : Pipeline + The sub-pipeline to be used for transformation. + cache : dict + The cache dictionary to store the transformed values. + param_name : str + The name of the parameter to be transformed. + param_value : object + The value of the parameter to be transformed. + transform_params : dict + The metadata to be used for transformation. This passed to the + `transform` method of the sub-pipeline. + + Returns + ------- + transformed_value : object + The transformed value of the parameter. + """ + if param_name not in cache: + # If the parameter is a tuple, transform each element of the + # tuple. This is needed to support the pattern present in + # `lightgbm` and `xgboost` where users can pass multiple + # validation sets. + if isinstance(param_value, tuple): + cache[param_name] = tuple( + sub_pipeline.transform(element, **transform_params) + for element in param_value + ) + else: + cache[param_name] = sub_pipeline.transform(param_value, **transform_params) + + return cache[param_name] + + +class Pipeline(_BaseComposition): + """ + A sequence of data transformers with an optional final predictor. + + `Pipeline` allows you to sequentially apply a list of transformers to + preprocess the data and, if desired, conclude the sequence with a final + :term:`predictor` for predictive modeling. + + Intermediate steps of the pipeline must be transformers, that is, they + must implement `fit` and `transform` methods. + The final :term:`estimator` only needs to implement `fit`. + The transformers in the pipeline can be cached using ``memory`` argument. + + The purpose of the pipeline is to assemble several steps that can be + cross-validated together while setting different parameters. For this, it + enables setting parameters of the various steps using their names and the + parameter name separated by a `'__'`, as in the example below. A step's + estimator may be replaced entirely by setting the parameter with its name + to another estimator, or a transformer removed by setting it to + `'passthrough'` or `None`. + + For an example use case of `Pipeline` combined with + :class:`~sklearn.model_selection.GridSearchCV`, refer to + :ref:`sphx_glr_auto_examples_compose_plot_compare_reduction.py`. The + example :ref:`sphx_glr_auto_examples_compose_plot_digits_pipe.py` shows how + to grid search on a pipeline using `'__'` as a separator in the parameter names. + + Read more in the :ref:`User Guide `. + + .. versionadded:: 0.5 + + Parameters + ---------- + steps : list of tuples + List of (name of step, estimator) tuples that are to be chained in + sequential order. To be compatible with the scikit-learn API, all steps + must define `fit`. All non-last steps must also define `transform`. See + :ref:`Combining Estimators ` for more details. + + transform_input : list of str, default=None + The names of the :term:`metadata` parameters that should be transformed by the + pipeline before passing it to the step consuming it. + + This enables transforming some input arguments to ``fit`` (other than ``X``) + to be transformed by the steps of the pipeline up to the step which requires + them. Requirement is defined via :ref:`metadata routing `. + For instance, this can be used to pass a validation set through the pipeline. + + You can only set this if metadata routing is enabled, which you + can enable using ``sklearn.set_config(enable_metadata_routing=True)``. + + .. versionadded:: 1.6 + + memory : str or object with the joblib.Memory interface, default=None + Used to cache the fitted transformers of the pipeline. The last step + will never be cached, even if it is a transformer. By default, no + caching is performed. If a string is given, it is the path to the + caching directory. Enabling caching triggers a clone of the transformers + before fitting. Therefore, the transformer instance given to the + pipeline cannot be inspected directly. Use the attribute ``named_steps`` + or ``steps`` to inspect estimators within the pipeline. Caching the + transformers is advantageous when fitting is time consuming. See + :ref:`sphx_glr_auto_examples_neighbors_plot_caching_nearest_neighbors.py` + for an example on how to enable caching. + + verbose : bool, default=False + If True, the time elapsed while fitting each step will be printed as it + is completed. + + Attributes + ---------- + named_steps : :class:`~sklearn.utils.Bunch` + Dictionary-like object, with the following attributes. + Read-only attribute to access any step parameter by user given name. + Keys are step names and values are steps parameters. + + classes_ : ndarray of shape (n_classes,) + The classes labels. Only exist if the last step of the pipeline is a + classifier. + + n_features_in_ : int + Number of features seen during :term:`fit`. Only defined if the + underlying first estimator in `steps` exposes such an attribute + when fit. + + .. versionadded:: 0.24 + + feature_names_in_ : ndarray of shape (`n_features_in_`,) + Names of features seen during :term:`fit`. Only defined if the + underlying estimator exposes such an attribute when fit. + + .. versionadded:: 1.0 + + See Also + -------- + make_pipeline : Convenience function for simplified pipeline construction. + + Examples + -------- + >>> from sklearn.svm import SVC + >>> from sklearn.preprocessing import StandardScaler + >>> from sklearn.datasets import make_classification + >>> from sklearn.model_selection import train_test_split + >>> from sklearn.pipeline import Pipeline + >>> X, y = make_classification(random_state=0) + >>> X_train, X_test, y_train, y_test = train_test_split(X, y, + ... random_state=0) + >>> pipe = Pipeline([('scaler', StandardScaler()), ('svc', SVC())]) + >>> # The pipeline can be used as any other estimator + >>> # and avoids leaking the test set into the train set + >>> pipe.fit(X_train, y_train).score(X_test, y_test) + 0.88 + >>> # An estimator's parameter can be set using '__' syntax + >>> pipe.set_params(svc__C=10).fit(X_train, y_train).score(X_test, y_test) + 0.76 + """ + + # BaseEstimator interface + _parameter_constraints: dict = { + "steps": [list, Hidden(tuple)], + "transform_input": [list, None], + "memory": [None, str, HasMethods(["cache"])], + "verbose": ["boolean"], + } + + def __init__(self, steps, *, transform_input=None, memory=None, verbose=False): + self.steps = steps + self.transform_input = transform_input + self.memory = memory + self.verbose = verbose + + def set_output(self, *, transform=None): + """Set the output container when `"transform"` and `"fit_transform"` are called. + + Calling `set_output` will set the output of all estimators in `steps`. + + Parameters + ---------- + transform : {"default", "pandas", "polars"}, default=None + Configure output of `transform` and `fit_transform`. + + - `"default"`: Default output format of a transformer + - `"pandas"`: DataFrame output + - `"polars"`: Polars output + - `None`: Transform configuration is unchanged + + .. versionadded:: 1.4 + `"polars"` option was added. + + Returns + ------- + self : estimator instance + Estimator instance. + """ + for _, _, step in self._iter(): + _safe_set_output(step, transform=transform) + return self + + def get_params(self, deep=True): + """Get parameters for this estimator. + + Returns the parameters given in the constructor as well as the + estimators contained within the `steps` of the `Pipeline`. + + Parameters + ---------- + deep : bool, default=True + If True, will return the parameters for this estimator and + contained subobjects that are estimators. + + Returns + ------- + params : mapping of string to any + Parameter names mapped to their values. + """ + return self._get_params("steps", deep=deep) + + def set_params(self, **kwargs): + """Set the parameters of this estimator. + + Valid parameter keys can be listed with ``get_params()``. Note that + you can directly set the parameters of the estimators contained in + `steps`. + + Parameters + ---------- + **kwargs : dict + Parameters of this estimator or parameters of estimators contained + in `steps`. Parameters of the steps may be set using its name and + the parameter name separated by a '__'. + + Returns + ------- + self : object + Pipeline class instance. + """ + self._set_params("steps", **kwargs) + return self + + def _validate_steps(self): + if not self.steps: + raise ValueError("The pipeline is empty. Please add steps.") + names, estimators = zip(*self.steps) + + # validate names + self._validate_names(names) + + # validate estimators + transformers = estimators[:-1] + estimator = estimators[-1] + + for t in transformers: + if t is None or t == "passthrough": + continue + if not (hasattr(t, "fit") or hasattr(t, "fit_transform")) or not hasattr( + t, "transform" + ): + raise TypeError( + "All intermediate steps should be " + "transformers and implement fit and transform " + "or be the string 'passthrough' " + "'%s' (type %s) doesn't" % (t, type(t)) + ) + + # We allow last estimator to be None as an identity transformation + if ( + estimator is not None + and estimator != "passthrough" + and not hasattr(estimator, "fit") + ): + raise TypeError( + "Last step of Pipeline should implement fit " + "or be the string 'passthrough'. " + "'%s' (type %s) doesn't" % (estimator, type(estimator)) + ) + + def _iter(self, with_final=True, filter_passthrough=True): + """ + Generate (idx, (name, trans)) tuples from self.steps + + When filter_passthrough is True, 'passthrough' and None transformers + are filtered out. + """ + stop = len(self.steps) + if not with_final: + stop -= 1 + + for idx, (name, trans) in enumerate(islice(self.steps, 0, stop)): + if not filter_passthrough: + yield idx, name, trans + elif trans is not None and trans != "passthrough": + yield idx, name, trans + + def __len__(self): + """ + Returns the length of the Pipeline + """ + return len(self.steps) + + def __getitem__(self, ind): + """Returns a sub-pipeline or a single estimator in the pipeline + + Indexing with an integer will return an estimator; using a slice + returns another Pipeline instance which copies a slice of this + Pipeline. This copy is shallow: modifying (or fitting) estimators in + the sub-pipeline will affect the larger pipeline and vice-versa. + However, replacing a value in `step` will not affect a copy. + + See + :ref:`sphx_glr_auto_examples_feature_selection_plot_feature_selection_pipeline.py` + for an example of how to use slicing to inspect part of a pipeline. + """ + if isinstance(ind, slice): + if ind.step not in (1, None): + raise ValueError("Pipeline slicing only supports a step of 1") + return self.__class__( + self.steps[ind], memory=self.memory, verbose=self.verbose + ) + try: + name, est = self.steps[ind] + except TypeError: + # Not an int, try get step by name + return self.named_steps[ind] + return est + + # TODO(1.8): Remove this property + @property + def _estimator_type(self): + """Return the estimator type of the last step in the pipeline.""" + + if not self.steps: + return None + + return self.steps[-1][1]._estimator_type + + @property + def named_steps(self): + """Access the steps by name. + + Read-only attribute to access any step by given name. + Keys are steps names and values are the steps objects.""" + # Use Bunch object to improve autocomplete + return Bunch(**dict(self.steps)) + + @property + def _final_estimator(self): + try: + estimator = self.steps[-1][1] + return "passthrough" if estimator is None else estimator + except (ValueError, AttributeError, TypeError): + # This condition happens when a call to a method is first calling + # `_available_if` and `fit` did not validate `steps` yet. We + # return `None` and an `InvalidParameterError` will be raised + # right after. + return None + + def _log_message(self, step_idx): + if not self.verbose: + return None + name, _ = self.steps[step_idx] + + return "(step %d of %d) Processing %s" % (step_idx + 1, len(self.steps), name) + + def _check_method_params(self, method, props, **kwargs): + if _routing_enabled(): + routed_params = process_routing(self, method, **props, **kwargs) + return routed_params + else: + fit_params_steps = Bunch( + **{ + name: Bunch(**{method: {} for method in METHODS}) + for name, step in self.steps + if step is not None + } + ) + for pname, pval in props.items(): + if "__" not in pname: + raise ValueError( + "Pipeline.fit does not accept the {} parameter. " + "You can pass parameters to specific steps of your " + "pipeline using the stepname__parameter format, e.g. " + "`Pipeline.fit(X, y, logisticregression__sample_weight" + "=sample_weight)`.".format(pname) + ) + step, param = pname.split("__", 1) + fit_params_steps[step]["fit"][param] = pval + # without metadata routing, fit_transform and fit_predict + # get all the same params and pass it to the last fit. + fit_params_steps[step]["fit_transform"][param] = pval + fit_params_steps[step]["fit_predict"][param] = pval + return fit_params_steps + + def _get_metadata_for_step(self, *, step_idx, step_params, all_params): + """Get params (metadata) for step `name`. + + This transforms the metadata up to this step if required, which is + indicated by the `transform_input` parameter. + + If a param in `step_params` is included in the `transform_input` list, + it will be transformed. + + Parameters + ---------- + step_idx : int + Index of the step in the pipeline. + + step_params : dict + Parameters specific to the step. These are routed parameters, e.g. + `routed_params[name]`. If a parameter name here is included in the + `pipeline.transform_input`, then it will be transformed. Note that + these parameters are *after* routing, so the aliases are already + resolved. + + all_params : dict + All parameters passed by the user. Here this is used to call + `transform` on the slice of the pipeline itself. + + Returns + ------- + dict + Parameters to be passed to the step. The ones which should be + transformed are transformed. + """ + if ( + self.transform_input is None + or not all_params + or not step_params + or step_idx == 0 + ): + # we only need to process step_params if transform_input is set + # and metadata is given by the user. + return step_params + + sub_pipeline = self[:step_idx] + sub_metadata_routing = get_routing_for_object(sub_pipeline) + # here we get the metadata required by sub_pipeline.transform + transform_params = { + key: value + for key, value in all_params.items() + if key + in sub_metadata_routing.consumes( + method="transform", params=all_params.keys() + ) + } + transformed_params = dict() # this is to be returned + transformed_cache = dict() # used to transform each param once + # `step_params` is the output of `process_routing`, so it has a dict for each + # method (e.g. fit, transform, predict), which are the args to be passed to + # those methods. We need to transform the parameters which are in the + # `transform_input`, before returning these dicts. + for method, method_params in step_params.items(): + transformed_params[method] = Bunch() + for param_name, param_value in method_params.items(): + # An example of `(param_name, param_value)` is + # `('sample_weight', array([0.5, 0.5, ...]))` + if param_name in self.transform_input: + # This parameter now needs to be transformed by the sub_pipeline, to + # this step. We cache these computations to avoid repeating them. + transformed_params[method][param_name] = _cached_transform( + sub_pipeline, + cache=transformed_cache, + param_name=param_name, + param_value=param_value, + transform_params=transform_params, + ) + else: + transformed_params[method][param_name] = param_value + return transformed_params + + # Estimator interface + + def _fit(self, X, y=None, routed_params=None, raw_params=None): + """Fit the pipeline except the last step. + + routed_params is the output of `process_routing` + raw_params is the parameters passed by the user, used when `transform_input` + is set by the user, to transform metadata using a sub-pipeline. + """ + # shallow copy of steps - this should really be steps_ + self.steps = list(self.steps) + self._validate_steps() + # Setup the memory + memory = check_memory(self.memory) + + fit_transform_one_cached = memory.cache(_fit_transform_one) + + for step_idx, name, transformer in self._iter( + with_final=False, filter_passthrough=False + ): + if transformer is None or transformer == "passthrough": + with _print_elapsed_time("Pipeline", self._log_message(step_idx)): + continue + + if hasattr(memory, "location") and memory.location is None: + # we do not clone when caching is disabled to + # preserve backward compatibility + cloned_transformer = transformer + else: + cloned_transformer = clone(transformer) + # Fit or load from cache the current transformer + step_params = self._get_metadata_for_step( + step_idx=step_idx, + step_params=routed_params[name], + all_params=raw_params, + ) + + X, fitted_transformer = fit_transform_one_cached( + cloned_transformer, + X, + y, + weight=None, + message_clsname="Pipeline", + message=self._log_message(step_idx), + params=step_params, + ) + # Replace the transformer of the step with the fitted + # transformer. This is necessary when loading the transformer + # from the cache. + self.steps[step_idx] = (name, fitted_transformer) + return X + + @_fit_context( + # estimators in Pipeline.steps are not validated yet + prefer_skip_nested_validation=False + ) + def fit(self, X, y=None, **params): + """Fit the model. + + Fit all the transformers one after the other and sequentially transform the + data. Finally, fit the transformed data using the final estimator. + + Parameters + ---------- + X : iterable + Training data. Must fulfill input requirements of first step of the + pipeline. + + y : iterable, default=None + Training targets. Must fulfill label requirements for all steps of + the pipeline. + + **params : dict of str -> object + - If `enable_metadata_routing=False` (default): Parameters passed to the + ``fit`` method of each step, where each parameter name is prefixed such + that parameter ``p`` for step ``s`` has key ``s__p``. + + - If `enable_metadata_routing=True`: Parameters requested and accepted by + steps. Each step must have requested certain metadata for these parameters + to be forwarded to them. + + .. versionchanged:: 1.4 + Parameters are now passed to the ``transform`` method of the + intermediate steps as well, if requested, and if + `enable_metadata_routing=True` is set via + :func:`~sklearn.set_config`. + + See :ref:`Metadata Routing User Guide ` for more + details. + + Returns + ------- + self : object + Pipeline with fitted steps. + """ + if not _routing_enabled() and self.transform_input is not None: + raise ValueError( + "The `transform_input` parameter can only be set if metadata " + "routing is enabled. You can enable metadata routing using " + "`sklearn.set_config(enable_metadata_routing=True)`." + ) + + routed_params = self._check_method_params(method="fit", props=params) + Xt = self._fit(X, y, routed_params, raw_params=params) + with _print_elapsed_time("Pipeline", self._log_message(len(self.steps) - 1)): + if self._final_estimator != "passthrough": + last_step_params = self._get_metadata_for_step( + step_idx=len(self) - 1, + step_params=routed_params[self.steps[-1][0]], + all_params=params, + ) + self._final_estimator.fit(Xt, y, **last_step_params["fit"]) + + return self + + def _can_fit_transform(self): + return ( + self._final_estimator == "passthrough" + or hasattr(self._final_estimator, "transform") + or hasattr(self._final_estimator, "fit_transform") + ) + + @available_if(_can_fit_transform) + @_fit_context( + # estimators in Pipeline.steps are not validated yet + prefer_skip_nested_validation=False + ) + def fit_transform(self, X, y=None, **params): + """Fit the model and transform with the final estimator. + + Fit all the transformers one after the other and sequentially transform + the data. Only valid if the final estimator either implements + `fit_transform` or `fit` and `transform`. + + Parameters + ---------- + X : iterable + Training data. Must fulfill input requirements of first step of the + pipeline. + + y : iterable, default=None + Training targets. Must fulfill label requirements for all steps of + the pipeline. + + **params : dict of str -> object + - If `enable_metadata_routing=False` (default): Parameters passed to the + ``fit`` method of each step, where each parameter name is prefixed such + that parameter ``p`` for step ``s`` has key ``s__p``. + + - If `enable_metadata_routing=True`: Parameters requested and accepted by + steps. Each step must have requested certain metadata for these parameters + to be forwarded to them. + + .. versionchanged:: 1.4 + Parameters are now passed to the ``transform`` method of the + intermediate steps as well, if requested, and if + `enable_metadata_routing=True`. + + See :ref:`Metadata Routing User Guide ` for more + details. + + Returns + ------- + Xt : ndarray of shape (n_samples, n_transformed_features) + Transformed samples. + """ + routed_params = self._check_method_params(method="fit_transform", props=params) + Xt = self._fit(X, y, routed_params) + + last_step = self._final_estimator + with _print_elapsed_time("Pipeline", self._log_message(len(self.steps) - 1)): + if last_step == "passthrough": + return Xt + last_step_params = self._get_metadata_for_step( + step_idx=len(self) - 1, + step_params=routed_params[self.steps[-1][0]], + all_params=params, + ) + if hasattr(last_step, "fit_transform"): + return last_step.fit_transform( + Xt, y, **last_step_params["fit_transform"] + ) + else: + return last_step.fit(Xt, y, **last_step_params["fit"]).transform( + Xt, **last_step_params["transform"] + ) + + @available_if(_final_estimator_has("predict")) + def predict(self, X, **params): + """Transform the data, and apply `predict` with the final estimator. + + Call `transform` of each transformer in the pipeline. The transformed + data are finally passed to the final estimator that calls `predict` + method. Only valid if the final estimator implements `predict`. + + Parameters + ---------- + X : iterable + Data to predict on. Must fulfill input requirements of first step + of the pipeline. + + **params : dict of str -> object + - If `enable_metadata_routing=False` (default): Parameters to the + ``predict`` called at the end of all transformations in the pipeline. + + - If `enable_metadata_routing=True`: Parameters requested and accepted by + steps. Each step must have requested certain metadata for these parameters + to be forwarded to them. + + .. versionadded:: 0.20 + + .. versionchanged:: 1.4 + Parameters are now passed to the ``transform`` method of the + intermediate steps as well, if requested, and if + `enable_metadata_routing=True` is set via + :func:`~sklearn.set_config`. + + See :ref:`Metadata Routing User Guide ` for more + details. + + Note that while this may be used to return uncertainties from some + models with ``return_std`` or ``return_cov``, uncertainties that are + generated by the transformations in the pipeline are not propagated + to the final estimator. + + Returns + ------- + y_pred : ndarray + Result of calling `predict` on the final estimator. + """ + # TODO(1.8): Remove the context manager and use check_is_fitted(self) + with _raise_or_warn_if_not_fitted(self): + Xt = X + + if not _routing_enabled(): + for _, name, transform in self._iter(with_final=False): + Xt = transform.transform(Xt) + return self.steps[-1][1].predict(Xt, **params) + + # metadata routing enabled + routed_params = process_routing(self, "predict", **params) + for _, name, transform in self._iter(with_final=False): + Xt = transform.transform(Xt, **routed_params[name].transform) + return self.steps[-1][1].predict( + Xt, **routed_params[self.steps[-1][0]].predict + ) + + @available_if(_final_estimator_has("fit_predict")) + @_fit_context( + # estimators in Pipeline.steps are not validated yet + prefer_skip_nested_validation=False + ) + def fit_predict(self, X, y=None, **params): + """Transform the data, and apply `fit_predict` with the final estimator. + + Call `fit_transform` of each transformer in the pipeline. The + transformed data are finally passed to the final estimator that calls + `fit_predict` method. Only valid if the final estimator implements + `fit_predict`. + + Parameters + ---------- + X : iterable + Training data. Must fulfill input requirements of first step of + the pipeline. + + y : iterable, default=None + Training targets. Must fulfill label requirements for all steps + of the pipeline. + + **params : dict of str -> object + - If `enable_metadata_routing=False` (default): Parameters to the + ``predict`` called at the end of all transformations in the pipeline. + + - If `enable_metadata_routing=True`: Parameters requested and accepted by + steps. Each step must have requested certain metadata for these parameters + to be forwarded to them. + + .. versionadded:: 0.20 + + .. versionchanged:: 1.4 + Parameters are now passed to the ``transform`` method of the + intermediate steps as well, if requested, and if + `enable_metadata_routing=True`. + + See :ref:`Metadata Routing User Guide ` for more + details. + + Note that while this may be used to return uncertainties from some + models with ``return_std`` or ``return_cov``, uncertainties that are + generated by the transformations in the pipeline are not propagated + to the final estimator. + + Returns + ------- + y_pred : ndarray + Result of calling `fit_predict` on the final estimator. + """ + routed_params = self._check_method_params(method="fit_predict", props=params) + Xt = self._fit(X, y, routed_params) + + params_last_step = routed_params[self.steps[-1][0]] + with _print_elapsed_time("Pipeline", self._log_message(len(self.steps) - 1)): + y_pred = self.steps[-1][1].fit_predict( + Xt, y, **params_last_step.get("fit_predict", {}) + ) + return y_pred + + @available_if(_final_estimator_has("predict_proba")) + def predict_proba(self, X, **params): + """Transform the data, and apply `predict_proba` with the final estimator. + + Call `transform` of each transformer in the pipeline. The transformed + data are finally passed to the final estimator that calls + `predict_proba` method. Only valid if the final estimator implements + `predict_proba`. + + Parameters + ---------- + X : iterable + Data to predict on. Must fulfill input requirements of first step + of the pipeline. + + **params : dict of str -> object + - If `enable_metadata_routing=False` (default): Parameters to the + `predict_proba` called at the end of all transformations in the pipeline. + + - If `enable_metadata_routing=True`: Parameters requested and accepted by + steps. Each step must have requested certain metadata for these parameters + to be forwarded to them. + + .. versionadded:: 0.20 + + .. versionchanged:: 1.4 + Parameters are now passed to the ``transform`` method of the + intermediate steps as well, if requested, and if + `enable_metadata_routing=True`. + + See :ref:`Metadata Routing User Guide ` for more + details. + + Returns + ------- + y_proba : ndarray of shape (n_samples, n_classes) + Result of calling `predict_proba` on the final estimator. + """ + # TODO(1.8): Remove the context manager and use check_is_fitted(self) + with _raise_or_warn_if_not_fitted(self): + Xt = X + + if not _routing_enabled(): + for _, name, transform in self._iter(with_final=False): + Xt = transform.transform(Xt) + return self.steps[-1][1].predict_proba(Xt, **params) + + # metadata routing enabled + routed_params = process_routing(self, "predict_proba", **params) + for _, name, transform in self._iter(with_final=False): + Xt = transform.transform(Xt, **routed_params[name].transform) + return self.steps[-1][1].predict_proba( + Xt, **routed_params[self.steps[-1][0]].predict_proba + ) + + @available_if(_final_estimator_has("decision_function")) + def decision_function(self, X, **params): + """Transform the data, and apply `decision_function` with the final estimator. + + Call `transform` of each transformer in the pipeline. The transformed + data are finally passed to the final estimator that calls + `decision_function` method. Only valid if the final estimator + implements `decision_function`. + + Parameters + ---------- + X : iterable + Data to predict on. Must fulfill input requirements of first step + of the pipeline. + + **params : dict of string -> object + Parameters requested and accepted by steps. Each step must have + requested certain metadata for these parameters to be forwarded to + them. + + .. versionadded:: 1.4 + Only available if `enable_metadata_routing=True`. See + :ref:`Metadata Routing User Guide ` for more + details. + + Returns + ------- + y_score : ndarray of shape (n_samples, n_classes) + Result of calling `decision_function` on the final estimator. + """ + # TODO(1.8): Remove the context manager and use check_is_fitted(self) + with _raise_or_warn_if_not_fitted(self): + _raise_for_params(params, self, "decision_function") + + # not branching here since params is only available if + # enable_metadata_routing=True + routed_params = process_routing(self, "decision_function", **params) + + Xt = X + for _, name, transform in self._iter(with_final=False): + Xt = transform.transform( + Xt, **routed_params.get(name, {}).get("transform", {}) + ) + return self.steps[-1][1].decision_function( + Xt, + **routed_params.get(self.steps[-1][0], {}).get("decision_function", {}), + ) + + @available_if(_final_estimator_has("score_samples")) + def score_samples(self, X): + """Transform the data, and apply `score_samples` with the final estimator. + + Call `transform` of each transformer in the pipeline. The transformed + data are finally passed to the final estimator that calls + `score_samples` method. Only valid if the final estimator implements + `score_samples`. + + Parameters + ---------- + X : iterable + Data to predict on. Must fulfill input requirements of first step + of the pipeline. + + Returns + ------- + y_score : ndarray of shape (n_samples,) + Result of calling `score_samples` on the final estimator. + """ + # TODO(1.8): Remove the context manager and use check_is_fitted(self) + with _raise_or_warn_if_not_fitted(self): + Xt = X + for _, _, transformer in self._iter(with_final=False): + Xt = transformer.transform(Xt) + return self.steps[-1][1].score_samples(Xt) + + @available_if(_final_estimator_has("predict_log_proba")) + def predict_log_proba(self, X, **params): + """Transform the data, and apply `predict_log_proba` with the final estimator. + + Call `transform` of each transformer in the pipeline. The transformed + data are finally passed to the final estimator that calls + `predict_log_proba` method. Only valid if the final estimator + implements `predict_log_proba`. + + Parameters + ---------- + X : iterable + Data to predict on. Must fulfill input requirements of first step + of the pipeline. + + **params : dict of str -> object + - If `enable_metadata_routing=False` (default): Parameters to the + `predict_log_proba` called at the end of all transformations in the + pipeline. + + - If `enable_metadata_routing=True`: Parameters requested and accepted by + steps. Each step must have requested certain metadata for these parameters + to be forwarded to them. + + .. versionadded:: 0.20 + + .. versionchanged:: 1.4 + Parameters are now passed to the ``transform`` method of the + intermediate steps as well, if requested, and if + `enable_metadata_routing=True`. + + See :ref:`Metadata Routing User Guide ` for more + details. + + Returns + ------- + y_log_proba : ndarray of shape (n_samples, n_classes) + Result of calling `predict_log_proba` on the final estimator. + """ + # TODO(1.8): Remove the context manager and use check_is_fitted(self) + with _raise_or_warn_if_not_fitted(self): + Xt = X + + if not _routing_enabled(): + for _, name, transform in self._iter(with_final=False): + Xt = transform.transform(Xt) + return self.steps[-1][1].predict_log_proba(Xt, **params) + + # metadata routing enabled + routed_params = process_routing(self, "predict_log_proba", **params) + for _, name, transform in self._iter(with_final=False): + Xt = transform.transform(Xt, **routed_params[name].transform) + return self.steps[-1][1].predict_log_proba( + Xt, **routed_params[self.steps[-1][0]].predict_log_proba + ) + + def _can_transform(self): + return self._final_estimator == "passthrough" or hasattr( + self._final_estimator, "transform" + ) + + @available_if(_can_transform) + def transform(self, X, **params): + """Transform the data, and apply `transform` with the final estimator. + + Call `transform` of each transformer in the pipeline. The transformed + data are finally passed to the final estimator that calls + `transform` method. Only valid if the final estimator + implements `transform`. + + This also works where final estimator is `None` in which case all prior + transformations are applied. + + Parameters + ---------- + X : iterable + Data to transform. Must fulfill input requirements of first step + of the pipeline. + + **params : dict of str -> object + Parameters requested and accepted by steps. Each step must have + requested certain metadata for these parameters to be forwarded to + them. + + .. versionadded:: 1.4 + Only available if `enable_metadata_routing=True`. See + :ref:`Metadata Routing User Guide ` for more + details. + + Returns + ------- + Xt : ndarray of shape (n_samples, n_transformed_features) + Transformed data. + """ + # TODO(1.8): Remove the context manager and use check_is_fitted(self) + with _raise_or_warn_if_not_fitted(self): + _raise_for_params(params, self, "transform") + + # not branching here since params is only available if + # enable_metadata_routing=True + routed_params = process_routing(self, "transform", **params) + Xt = X + for _, name, transform in self._iter(): + Xt = transform.transform(Xt, **routed_params[name].transform) + return Xt + + def _can_inverse_transform(self): + return all(hasattr(t, "inverse_transform") for _, _, t in self._iter()) + + @available_if(_can_inverse_transform) + def inverse_transform(self, X, **params): + """Apply `inverse_transform` for each step in a reverse order. + + All estimators in the pipeline must support `inverse_transform`. + + Parameters + ---------- + X : array-like of shape (n_samples, n_transformed_features) + Data samples, where ``n_samples`` is the number of samples and + ``n_features`` is the number of features. Must fulfill + input requirements of last step of pipeline's + ``inverse_transform`` method. + + **params : dict of str -> object + Parameters requested and accepted by steps. Each step must have + requested certain metadata for these parameters to be forwarded to + them. + + .. versionadded:: 1.4 + Only available if `enable_metadata_routing=True`. See + :ref:`Metadata Routing User Guide ` for more + details. + + Returns + ------- + X_original : ndarray of shape (n_samples, n_features) + Inverse transformed data, that is, data in the original feature + space. + """ + # TODO(1.8): Remove the context manager and use check_is_fitted(self) + with _raise_or_warn_if_not_fitted(self): + _raise_for_params(params, self, "inverse_transform") + + # we don't have to branch here, since params is only non-empty if + # enable_metadata_routing=True. + routed_params = process_routing(self, "inverse_transform", **params) + reverse_iter = reversed(list(self._iter())) + for _, name, transform in reverse_iter: + X = transform.inverse_transform( + X, **routed_params[name].inverse_transform + ) + return X + + @available_if(_final_estimator_has("score")) + def score(self, X, y=None, sample_weight=None, **params): + """Transform the data, and apply `score` with the final estimator. + + Call `transform` of each transformer in the pipeline. The transformed + data are finally passed to the final estimator that calls + `score` method. Only valid if the final estimator implements `score`. + + Parameters + ---------- + X : iterable + Data to predict on. Must fulfill input requirements of first step + of the pipeline. + + y : iterable, default=None + Targets used for scoring. Must fulfill label requirements for all + steps of the pipeline. + + sample_weight : array-like, default=None + If not None, this argument is passed as ``sample_weight`` keyword + argument to the ``score`` method of the final estimator. + + **params : dict of str -> object + Parameters requested and accepted by steps. Each step must have + requested certain metadata for these parameters to be forwarded to + them. + + .. versionadded:: 1.4 + Only available if `enable_metadata_routing=True`. See + :ref:`Metadata Routing User Guide ` for more + details. + + Returns + ------- + score : float + Result of calling `score` on the final estimator. + """ + # TODO(1.8): Remove the context manager and use check_is_fitted(self) + with _raise_or_warn_if_not_fitted(self): + Xt = X + if not _routing_enabled(): + for _, name, transform in self._iter(with_final=False): + Xt = transform.transform(Xt) + score_params = {} + if sample_weight is not None: + score_params["sample_weight"] = sample_weight + return self.steps[-1][1].score(Xt, y, **score_params) + + # metadata routing is enabled. + routed_params = process_routing( + self, "score", sample_weight=sample_weight, **params + ) + + Xt = X + for _, name, transform in self._iter(with_final=False): + Xt = transform.transform(Xt, **routed_params[name].transform) + return self.steps[-1][1].score( + Xt, y, **routed_params[self.steps[-1][0]].score + ) + + @property + def classes_(self): + """The classes labels. Only exist if the last step is a classifier.""" + return self.steps[-1][1].classes_ + + def __sklearn_tags__(self): + tags = super().__sklearn_tags__() + + if not self.steps: + return tags + + try: + if self.steps[0][1] is not None and self.steps[0][1] != "passthrough": + tags.input_tags.pairwise = get_tags( + self.steps[0][1] + ).input_tags.pairwise + # WARNING: the sparse tag can be incorrect. + # Some Pipelines accepting sparse data are wrongly tagged sparse=False. + # For example Pipeline([PCA(), estimator]) accepts sparse data + # even if the estimator doesn't as PCA outputs a dense array. + tags.input_tags.sparse = all( + get_tags(step).input_tags.sparse + for name, step in self.steps + if step is not None and step != "passthrough" + ) + except (ValueError, AttributeError, TypeError): + # This happens when the `steps` is not a list of (name, estimator) + # tuples and `fit` is not called yet to validate the steps. + pass + + try: + if self.steps[-1][1] is not None and self.steps[-1][1] != "passthrough": + last_step_tags = get_tags(self.steps[-1][1]) + tags.estimator_type = last_step_tags.estimator_type + tags.target_tags.multi_output = last_step_tags.target_tags.multi_output + tags.classifier_tags = deepcopy(last_step_tags.classifier_tags) + tags.regressor_tags = deepcopy(last_step_tags.regressor_tags) + tags.transformer_tags = deepcopy(last_step_tags.transformer_tags) + except (ValueError, AttributeError, TypeError): + # This happens when the `steps` is not a list of (name, estimator) + # tuples and `fit` is not called yet to validate the steps. + pass + + return tags + + def get_feature_names_out(self, input_features=None): + """Get output feature names for transformation. + + Transform input features using the pipeline. + + Parameters + ---------- + input_features : array-like of str or None, default=None + Input features. + + Returns + ------- + feature_names_out : ndarray of str objects + Transformed feature names. + """ + feature_names_out = input_features + for _, name, transform in self._iter(): + if not hasattr(transform, "get_feature_names_out"): + raise AttributeError( + "Estimator {} does not provide get_feature_names_out. " + "Did you mean to call pipeline[:-1].get_feature_names_out" + "()?".format(name) + ) + feature_names_out = transform.get_feature_names_out(feature_names_out) + return feature_names_out + + @property + def n_features_in_(self): + """Number of features seen during first step `fit` method.""" + # delegate to first step (which will call check_is_fitted) + return self.steps[0][1].n_features_in_ + + @property + def feature_names_in_(self): + """Names of features seen during first step `fit` method.""" + # delegate to first step (which will call check_is_fitted) + return self.steps[0][1].feature_names_in_ + + def __sklearn_is_fitted__(self): + """Indicate whether pipeline has been fit. + + This is done by checking whether the last non-`passthrough` step of the + pipeline is fitted. + + An empty pipeline is considered fitted. + """ + # First find the last step that is not 'passthrough' + last_step = None + for _, estimator in reversed(self.steps): + if estimator != "passthrough": + last_step = estimator + break + + if last_step is None: + # All steps are 'passthrough', so the pipeline is considered fitted + return True + + try: + # check if the last step of the pipeline is fitted + # we only check the last step since if the last step is fit, it + # means the previous steps should also be fit. This is faster than + # checking if every step of the pipeline is fit. + check_is_fitted(last_step) + return True + except NotFittedError: + return False + + def _sk_visual_block_(self): + _, estimators = zip(*self.steps) + + def _get_name(name, est): + if est is None or est == "passthrough": + return f"{name}: passthrough" + # Is an estimator + return f"{name}: {est.__class__.__name__}" + + names = [_get_name(name, est) for name, est in self.steps] + name_details = [str(est) for est in estimators] + return _VisualBlock( + "serial", + estimators, + names=names, + name_details=name_details, + dash_wrapped=False, + ) + + def get_metadata_routing(self): + """Get metadata routing of this object. + + Please check :ref:`User Guide ` on how the routing + mechanism works. + + Returns + ------- + routing : MetadataRouter + A :class:`~sklearn.utils.metadata_routing.MetadataRouter` encapsulating + routing information. + """ + router = MetadataRouter(owner=self.__class__.__name__) + + # first we add all steps except the last one + for _, name, trans in self._iter(with_final=False, filter_passthrough=True): + method_mapping = MethodMapping() + # fit, fit_predict, and fit_transform call fit_transform if it + # exists, or else fit and transform + if hasattr(trans, "fit_transform"): + ( + method_mapping.add(caller="fit", callee="fit_transform") + .add(caller="fit_transform", callee="fit_transform") + .add(caller="fit_predict", callee="fit_transform") + ) + else: + ( + method_mapping.add(caller="fit", callee="fit") + .add(caller="fit", callee="transform") + .add(caller="fit_transform", callee="fit") + .add(caller="fit_transform", callee="transform") + .add(caller="fit_predict", callee="fit") + .add(caller="fit_predict", callee="transform") + ) + + ( + method_mapping.add(caller="predict", callee="transform") + .add(caller="predict", callee="transform") + .add(caller="predict_proba", callee="transform") + .add(caller="decision_function", callee="transform") + .add(caller="predict_log_proba", callee="transform") + .add(caller="transform", callee="transform") + .add(caller="inverse_transform", callee="inverse_transform") + .add(caller="score", callee="transform") + ) + + router.add(method_mapping=method_mapping, **{name: trans}) + + final_name, final_est = self.steps[-1] + if final_est is None or final_est == "passthrough": + return router + + # then we add the last step + method_mapping = MethodMapping() + if hasattr(final_est, "fit_transform"): + method_mapping.add(caller="fit_transform", callee="fit_transform") + else: + method_mapping.add(caller="fit", callee="fit").add( + caller="fit", callee="transform" + ) + ( + method_mapping.add(caller="fit", callee="fit") + .add(caller="predict", callee="predict") + .add(caller="fit_predict", callee="fit_predict") + .add(caller="predict_proba", callee="predict_proba") + .add(caller="decision_function", callee="decision_function") + .add(caller="predict_log_proba", callee="predict_log_proba") + .add(caller="transform", callee="transform") + .add(caller="inverse_transform", callee="inverse_transform") + .add(caller="score", callee="score") + ) + + router.add(method_mapping=method_mapping, **{final_name: final_est}) + return router + + +def _name_estimators(estimators): + """Generate names for estimators.""" + + names = [ + estimator if isinstance(estimator, str) else type(estimator).__name__.lower() + for estimator in estimators + ] + namecount = defaultdict(int) + for est, name in zip(estimators, names): + namecount[name] += 1 + + for k, v in list(namecount.items()): + if v == 1: + del namecount[k] + + for i in reversed(range(len(estimators))): + name = names[i] + if name in namecount: + names[i] += "-%d" % namecount[name] + namecount[name] -= 1 + + return list(zip(names, estimators)) + + +def make_pipeline(*steps, memory=None, transform_input=None, verbose=False): + """Construct a :class:`Pipeline` from the given estimators. + + This is a shorthand for the :class:`Pipeline` constructor; it does not + require, and does not permit, naming the estimators. Instead, their names + will be set to the lowercase of their types automatically. + + Parameters + ---------- + *steps : list of Estimator objects + List of the scikit-learn estimators that are chained together. + + memory : str or object with the joblib.Memory interface, default=None + Used to cache the fitted transformers of the pipeline. The last step + will never be cached, even if it is a transformer. By default, no + caching is performed. If a string is given, it is the path to the + caching directory. Enabling caching triggers a clone of the transformers + before fitting. Therefore, the transformer instance given to the + pipeline cannot be inspected directly. Use the attribute ``named_steps`` + or ``steps`` to inspect estimators within the pipeline. Caching the + transformers is advantageous when fitting is time consuming. + + transform_input : list of str, default=None + This enables transforming some input arguments to ``fit`` (other than ``X``) + to be transformed by the steps of the pipeline up to the step which requires + them. Requirement is defined via :ref:`metadata routing `. + This can be used to pass a validation set through the pipeline for instance. + + You can only set this if metadata routing is enabled, which you + can enable using ``sklearn.set_config(enable_metadata_routing=True)``. + + .. versionadded:: 1.6 + + verbose : bool, default=False + If True, the time elapsed while fitting each step will be printed as it + is completed. + + Returns + ------- + p : Pipeline + Returns a scikit-learn :class:`Pipeline` object. + + See Also + -------- + Pipeline : Class for creating a pipeline of transforms with a final + estimator. + + Examples + -------- + >>> from sklearn.naive_bayes import GaussianNB + >>> from sklearn.preprocessing import StandardScaler + >>> from sklearn.pipeline import make_pipeline + >>> make_pipeline(StandardScaler(), GaussianNB(priors=None)) + Pipeline(steps=[('standardscaler', StandardScaler()), + ('gaussiannb', GaussianNB())]) + """ + return Pipeline( + _name_estimators(steps), + transform_input=transform_input, + memory=memory, + verbose=verbose, + ) + + +def _transform_one(transformer, X, y, weight, params): + """Call transform and apply weight to output. + + Parameters + ---------- + transformer : estimator + Estimator to be used for transformation. + + X : {array-like, sparse matrix} of shape (n_samples, n_features) + Input data to be transformed. + + y : ndarray of shape (n_samples,) + Ignored. + + weight : float + Weight to be applied to the output of the transformation. + + params : dict + Parameters to be passed to the transformer's ``transform`` method. + + This should be of the form ``process_routing()["step_name"]``. + """ + res = transformer.transform(X, **params.transform) + # if we have a weight for this transformer, multiply output + if weight is None: + return res + return res * weight + + +def _fit_transform_one( + transformer, X, y, weight, message_clsname="", message=None, params=None +): + """ + Fits ``transformer`` to ``X`` and ``y``. The transformed result is returned + with the fitted transformer. If ``weight`` is not ``None``, the result will + be multiplied by ``weight``. + + ``params`` needs to be of the form ``process_routing()["step_name"]``. + """ + params = params or {} + with _print_elapsed_time(message_clsname, message): + if hasattr(transformer, "fit_transform"): + res = transformer.fit_transform(X, y, **params.get("fit_transform", {})) + else: + res = transformer.fit(X, y, **params.get("fit", {})).transform( + X, **params.get("transform", {}) + ) + + if weight is None: + return res, transformer + return res * weight, transformer + + +def _fit_one(transformer, X, y, weight, message_clsname="", message=None, params=None): + """ + Fits ``transformer`` to ``X`` and ``y``. + """ + with _print_elapsed_time(message_clsname, message): + return transformer.fit(X, y, **params["fit"]) + + +class FeatureUnion(TransformerMixin, _BaseComposition): + """Concatenates results of multiple transformer objects. + + This estimator applies a list of transformer objects in parallel to the + input data, then concatenates the results. This is useful to combine + several feature extraction mechanisms into a single transformer. + + Parameters of the transformers may be set using its name and the parameter + name separated by a '__'. A transformer may be replaced entirely by + setting the parameter with its name to another transformer, removed by + setting to 'drop' or disabled by setting to 'passthrough' (features are + passed without transformation). + + Read more in the :ref:`User Guide `. + + .. versionadded:: 0.13 + + Parameters + ---------- + transformer_list : list of (str, transformer) tuples + List of transformer objects to be applied to the data. The first + half of each tuple is the name of the transformer. The transformer can + be 'drop' for it to be ignored or can be 'passthrough' for features to + be passed unchanged. + + .. versionadded:: 1.1 + Added the option `"passthrough"`. + + .. versionchanged:: 0.22 + Deprecated `None` as a transformer in favor of 'drop'. + + n_jobs : int, default=None + Number of jobs to run in parallel. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. + + .. versionchanged:: v0.20 + `n_jobs` default changed from 1 to None + + transformer_weights : dict, default=None + Multiplicative weights for features per transformer. + Keys are transformer names, values the weights. + Raises ValueError if key not present in ``transformer_list``. + + verbose : bool, default=False + If True, the time elapsed while fitting each transformer will be + printed as it is completed. + + verbose_feature_names_out : bool, default=True + If True, :meth:`get_feature_names_out` will prefix all feature names + with the name of the transformer that generated that feature. + If False, :meth:`get_feature_names_out` will not prefix any feature + names and will error if feature names are not unique. + + .. versionadded:: 1.5 + + Attributes + ---------- + named_transformers : :class:`~sklearn.utils.Bunch` + Dictionary-like object, with the following attributes. + Read-only attribute to access any transformer parameter by user + given name. Keys are transformer names and values are + transformer parameters. + + .. versionadded:: 1.2 + + n_features_in_ : int + Number of features seen during :term:`fit`. Only defined if the + underlying first transformer in `transformer_list` exposes such an + attribute when fit. + + .. versionadded:: 0.24 + + feature_names_in_ : ndarray of shape (`n_features_in_`,) + Names of features seen during :term:`fit`. Defined only when + `X` has feature names that are all strings. + + .. versionadded:: 1.3 + + See Also + -------- + make_union : Convenience function for simplified feature union + construction. + + Examples + -------- + >>> from sklearn.pipeline import FeatureUnion + >>> from sklearn.decomposition import PCA, TruncatedSVD + >>> union = FeatureUnion([("pca", PCA(n_components=1)), + ... ("svd", TruncatedSVD(n_components=2))]) + >>> X = [[0., 1., 3], [2., 2., 5]] + >>> union.fit_transform(X) + array([[-1.5 , 3.04, -0.872], + [ 1.5 , 5.72, 0.463]]) + >>> # An estimator's parameter can be set using '__' syntax + >>> union.set_params(svd__n_components=1).fit_transform(X) + array([[-1.5 , 3.04], + [ 1.5 , 5.72]]) + + For a more detailed example of usage, see + :ref:`sphx_glr_auto_examples_compose_plot_feature_union.py`. + """ + + def __init__( + self, + transformer_list, + *, + n_jobs=None, + transformer_weights=None, + verbose=False, + verbose_feature_names_out=True, + ): + self.transformer_list = transformer_list + self.n_jobs = n_jobs + self.transformer_weights = transformer_weights + self.verbose = verbose + self.verbose_feature_names_out = verbose_feature_names_out + + def set_output(self, *, transform=None): + """Set the output container when `"transform"` and `"fit_transform"` are called. + + `set_output` will set the output of all estimators in `transformer_list`. + + Parameters + ---------- + transform : {"default", "pandas", "polars"}, default=None + Configure output of `transform` and `fit_transform`. + + - `"default"`: Default output format of a transformer + - `"pandas"`: DataFrame output + - `"polars"`: Polars output + - `None`: Transform configuration is unchanged + + Returns + ------- + self : estimator instance + Estimator instance. + """ + super().set_output(transform=transform) + for _, step, _ in self._iter(): + _safe_set_output(step, transform=transform) + return self + + @property + def named_transformers(self): + # Use Bunch object to improve autocomplete + return Bunch(**dict(self.transformer_list)) + + def get_params(self, deep=True): + """Get parameters for this estimator. + + Returns the parameters given in the constructor as well as the + estimators contained within the `transformer_list` of the + `FeatureUnion`. + + Parameters + ---------- + deep : bool, default=True + If True, will return the parameters for this estimator and + contained subobjects that are estimators. + + Returns + ------- + params : mapping of string to any + Parameter names mapped to their values. + """ + return self._get_params("transformer_list", deep=deep) + + def set_params(self, **kwargs): + """Set the parameters of this estimator. + + Valid parameter keys can be listed with ``get_params()``. Note that + you can directly set the parameters of the estimators contained in + `transformer_list`. + + Parameters + ---------- + **kwargs : dict + Parameters of this estimator or parameters of estimators contained + in `transform_list`. Parameters of the transformers may be set + using its name and the parameter name separated by a '__'. + + Returns + ------- + self : object + FeatureUnion class instance. + """ + self._set_params("transformer_list", **kwargs) + return self + + def _validate_transformers(self): + names, transformers = zip(*self.transformer_list) + + # validate names + self._validate_names(names) + + # validate estimators + for t in transformers: + if t in ("drop", "passthrough"): + continue + if not (hasattr(t, "fit") or hasattr(t, "fit_transform")) or not hasattr( + t, "transform" + ): + raise TypeError( + "All estimators should implement fit and " + "transform. '%s' (type %s) doesn't" % (t, type(t)) + ) + + def _validate_transformer_weights(self): + if not self.transformer_weights: + return + + transformer_names = set(name for name, _ in self.transformer_list) + for name in self.transformer_weights: + if name not in transformer_names: + raise ValueError( + f'Attempting to weight transformer "{name}", ' + "but it is not present in transformer_list." + ) + + def _iter(self): + """ + Generate (name, trans, weight) tuples excluding None and + 'drop' transformers. + """ + + get_weight = (self.transformer_weights or {}).get + + for name, trans in self.transformer_list: + if trans == "drop": + continue + if trans == "passthrough": + trans = FunctionTransformer(feature_names_out="one-to-one") + yield (name, trans, get_weight(name)) + + def get_feature_names_out(self, input_features=None): + """Get output feature names for transformation. + + Parameters + ---------- + input_features : array-like of str or None, default=None + Input features. + + Returns + ------- + feature_names_out : ndarray of str objects + Transformed feature names. + """ + # List of tuples (name, feature_names_out) + transformer_with_feature_names_out = [] + for name, trans, _ in self._iter(): + if not hasattr(trans, "get_feature_names_out"): + raise AttributeError( + "Transformer %s (type %s) does not provide get_feature_names_out." + % (str(name), type(trans).__name__) + ) + feature_names_out = trans.get_feature_names_out(input_features) + transformer_with_feature_names_out.append((name, feature_names_out)) + + return self._add_prefix_for_feature_names_out( + transformer_with_feature_names_out + ) + + def _add_prefix_for_feature_names_out(self, transformer_with_feature_names_out): + """Add prefix for feature names out that includes the transformer names. + + Parameters + ---------- + transformer_with_feature_names_out : list of tuples of (str, array-like of str) + The tuple consistent of the transformer's name and its feature names out. + + Returns + ------- + feature_names_out : ndarray of shape (n_features,), dtype=str + Transformed feature names. + """ + if self.verbose_feature_names_out: + # Prefix the feature names out with the transformers name + names = list( + chain.from_iterable( + (f"{name}__{i}" for i in feature_names_out) + for name, feature_names_out in transformer_with_feature_names_out + ) + ) + return np.asarray(names, dtype=object) + + # verbose_feature_names_out is False + # Check that names are all unique without a prefix + feature_names_count = Counter( + chain.from_iterable(s for _, s in transformer_with_feature_names_out) + ) + top_6_overlap = [ + name for name, count in feature_names_count.most_common(6) if count > 1 + ] + top_6_overlap.sort() + if top_6_overlap: + if len(top_6_overlap) == 6: + # There are more than 5 overlapping names, we only show the 5 + # of the feature names + names_repr = str(top_6_overlap[:5])[:-1] + ", ...]" + else: + names_repr = str(top_6_overlap) + raise ValueError( + f"Output feature names: {names_repr} are not unique. Please set " + "verbose_feature_names_out=True to add prefixes to feature names" + ) + + return np.concatenate( + [name for _, name in transformer_with_feature_names_out], + ) + + def fit(self, X, y=None, **fit_params): + """Fit all transformers using X. + + Parameters + ---------- + X : iterable or array-like, depending on transformers + Input data, used to fit transformers. + + y : array-like of shape (n_samples, n_outputs), default=None + Targets for supervised learning. + + **fit_params : dict, default=None + - If `enable_metadata_routing=False` (default): + Parameters directly passed to the `fit` methods of the + sub-transformers. + + - If `enable_metadata_routing=True`: + Parameters safely routed to the `fit` methods of the + sub-transformers. See :ref:`Metadata Routing User Guide + ` for more details. + + .. versionchanged:: 1.5 + `**fit_params` can be routed via metadata routing API. + + Returns + ------- + self : object + FeatureUnion class instance. + """ + if _routing_enabled(): + routed_params = process_routing(self, "fit", **fit_params) + else: + # TODO(SLEP6): remove when metadata routing cannot be disabled. + routed_params = Bunch() + for name, _ in self.transformer_list: + routed_params[name] = Bunch(fit={}) + routed_params[name].fit = fit_params + + transformers = self._parallel_func(X, y, _fit_one, routed_params) + + if not transformers: + # All transformers are None + return self + + self._update_transformer_list(transformers) + return self + + def fit_transform(self, X, y=None, **params): + """Fit all transformers, transform the data and concatenate results. + + Parameters + ---------- + X : iterable or array-like, depending on transformers + Input data to be transformed. + + y : array-like of shape (n_samples, n_outputs), default=None + Targets for supervised learning. + + **params : dict, default=None + - If `enable_metadata_routing=False` (default): + Parameters directly passed to the `fit` methods of the + sub-transformers. + + - If `enable_metadata_routing=True`: + Parameters safely routed to the `fit` methods of the + sub-transformers. See :ref:`Metadata Routing User Guide + ` for more details. + + .. versionchanged:: 1.5 + `**params` can now be routed via metadata routing API. + + Returns + ------- + X_t : array-like or sparse matrix of \ + shape (n_samples, sum_n_components) + The `hstack` of results of transformers. `sum_n_components` is the + sum of `n_components` (output dimension) over transformers. + """ + if _routing_enabled(): + routed_params = process_routing(self, "fit_transform", **params) + else: + # TODO(SLEP6): remove when metadata routing cannot be disabled. + routed_params = Bunch() + for name, obj in self.transformer_list: + if hasattr(obj, "fit_transform"): + routed_params[name] = Bunch(fit_transform={}) + routed_params[name].fit_transform = params + else: + routed_params[name] = Bunch(fit={}) + routed_params[name] = Bunch(transform={}) + routed_params[name].fit = params + + results = self._parallel_func(X, y, _fit_transform_one, routed_params) + if not results: + # All transformers are None + return np.zeros((X.shape[0], 0)) + + Xs, transformers = zip(*results) + self._update_transformer_list(transformers) + + return self._hstack(Xs) + + def _log_message(self, name, idx, total): + if not self.verbose: + return None + return "(step %d of %d) Processing %s" % (idx, total, name) + + def _parallel_func(self, X, y, func, routed_params): + """Runs func in parallel on X and y""" + self.transformer_list = list(self.transformer_list) + self._validate_transformers() + self._validate_transformer_weights() + transformers = list(self._iter()) + + return Parallel(n_jobs=self.n_jobs)( + delayed(func)( + transformer, + X, + y, + weight, + message_clsname="FeatureUnion", + message=self._log_message(name, idx, len(transformers)), + params=routed_params[name], + ) + for idx, (name, transformer, weight) in enumerate(transformers, 1) + ) + + def transform(self, X, **params): + """Transform X separately by each transformer, concatenate results. + + Parameters + ---------- + X : iterable or array-like, depending on transformers + Input data to be transformed. + + **params : dict, default=None + + Parameters routed to the `transform` method of the sub-transformers via the + metadata routing API. See :ref:`Metadata Routing User Guide + ` for more details. + + .. versionadded:: 1.5 + + Returns + ------- + X_t : array-like or sparse matrix of shape (n_samples, sum_n_components) + The `hstack` of results of transformers. `sum_n_components` is the + sum of `n_components` (output dimension) over transformers. + """ + _raise_for_params(params, self, "transform") + + if _routing_enabled(): + routed_params = process_routing(self, "transform", **params) + else: + # TODO(SLEP6): remove when metadata routing cannot be disabled. + routed_params = Bunch() + for name, _ in self.transformer_list: + routed_params[name] = Bunch(transform={}) + + Xs = Parallel(n_jobs=self.n_jobs)( + delayed(_transform_one)(trans, X, None, weight, params=routed_params[name]) + for name, trans, weight in self._iter() + ) + if not Xs: + # All transformers are None + return np.zeros((X.shape[0], 0)) + + return self._hstack(Xs) + + def _hstack(self, Xs): + # Check if Xs dimensions are valid + for X, (name, _) in zip(Xs, self.transformer_list): + if hasattr(X, "shape") and len(X.shape) != 2: + raise ValueError( + f"Transformer '{name}' returned an array or dataframe with " + f"{len(X.shape)} dimensions, but expected 2 dimensions " + "(n_samples, n_features)." + ) + + adapter = _get_container_adapter("transform", self) + if adapter and all(adapter.is_supported_container(X) for X in Xs): + return adapter.hstack(Xs) + + if any(sparse.issparse(f) for f in Xs): + return sparse.hstack(Xs).tocsr() + + return np.hstack(Xs) + + def _update_transformer_list(self, transformers): + transformers = iter(transformers) + self.transformer_list[:] = [ + (name, old if old == "drop" else next(transformers)) + for name, old in self.transformer_list + ] + + @property + def n_features_in_(self): + """Number of features seen during :term:`fit`.""" + + # X is passed to all transformers so we just delegate to the first one + return self.transformer_list[0][1].n_features_in_ + + @property + def feature_names_in_(self): + """Names of features seen during :term:`fit`.""" + # X is passed to all transformers -- delegate to the first one + return self.transformer_list[0][1].feature_names_in_ + + def __sklearn_is_fitted__(self): + # Delegate whether feature union was fitted + for _, transformer, _ in self._iter(): + check_is_fitted(transformer) + return True + + def _sk_visual_block_(self): + names, transformers = zip(*self.transformer_list) + return _VisualBlock("parallel", transformers, names=names) + + def __getitem__(self, name): + """Return transformer with name.""" + if not isinstance(name, str): + raise KeyError("Only string keys are supported") + return self.named_transformers[name] + + def get_metadata_routing(self): + """Get metadata routing of this object. + + Please check :ref:`User Guide ` on how the routing + mechanism works. + + .. versionadded:: 1.5 + + Returns + ------- + routing : MetadataRouter + A :class:`~sklearn.utils.metadata_routing.MetadataRouter` encapsulating + routing information. + """ + router = MetadataRouter(owner=self.__class__.__name__) + + for name, transformer in self.transformer_list: + router.add( + **{name: transformer}, + method_mapping=MethodMapping() + .add(caller="fit", callee="fit") + .add(caller="fit_transform", callee="fit_transform") + .add(caller="fit_transform", callee="fit") + .add(caller="fit_transform", callee="transform") + .add(caller="transform", callee="transform"), + ) + + return router + + def __sklearn_tags__(self): + tags = super().__sklearn_tags__() + try: + tags.input_tags.sparse = all( + get_tags(trans).input_tags.sparse + for name, trans in self.transformer_list + if trans not in {"passthrough", "drop"} + ) + except Exception: + # If `transformer_list` does not comply with our API (list of tuples) + # then it will fail. In this case, we assume that `sparse` is False + # but the parameter validation will raise an error during `fit`. + pass # pragma: no cover + return tags + + +def make_union( + *transformers, n_jobs=None, verbose=False, verbose_feature_names_out=True +): + """Construct a :class:`FeatureUnion` from the given transformers. + + This is a shorthand for the :class:`FeatureUnion` constructor; it does not + require, and does not permit, naming the transformers. Instead, they will + be given names automatically based on their types. It also does not allow + weighting. + + Parameters + ---------- + *transformers : list of estimators + One or more estimators. + + n_jobs : int, default=None + Number of jobs to run in parallel. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. + + .. versionchanged:: v0.20 + `n_jobs` default changed from 1 to None. + + verbose : bool, default=False + If True, the time elapsed while fitting each transformer will be + printed as it is completed. + + verbose_feature_names_out : bool, default=True + If True, the feature names generated by `get_feature_names_out` will + include prefixes derived from the transformer names. + + Returns + ------- + f : FeatureUnion + A :class:`FeatureUnion` object for concatenating the results of multiple + transformer objects. + + See Also + -------- + FeatureUnion : Class for concatenating the results of multiple transformer + objects. + + Examples + -------- + >>> from sklearn.decomposition import PCA, TruncatedSVD + >>> from sklearn.pipeline import make_union + >>> make_union(PCA(), TruncatedSVD()) + FeatureUnion(transformer_list=[('pca', PCA()), + ('truncatedsvd', TruncatedSVD())]) + """ + return FeatureUnion( + _name_estimators(transformers), + n_jobs=n_jobs, + verbose=verbose, + verbose_feature_names_out=verbose_feature_names_out, + ) diff --git a/shared/package-files/06/06f8846a9e982ef773a1d4876ee584f017be8184d1e678bceb3fef1ae8597f98/blob b/shared/package-files/06/06f8846a9e982ef773a1d4876ee584f017be8184d1e678bceb3fef1ae8597f98/blob new file mode 100644 index 0000000000000000000000000000000000000000..2cbee828e4ba91e9dde557b02ef63343b491d5e1 --- /dev/null +++ b/shared/package-files/06/06f8846a9e982ef773a1d4876ee584f017be8184d1e678bceb3fef1ae8597f98/blob @@ -0,0 +1,189 @@ +"""Test for short_panel and panel sandwich + +Created on Fri May 18 13:05:47 2012 + +Author: Josef Perktold + +moved example from main of random_panel +""" + +import numpy as np +import numpy.testing as npt +from numpy.testing import assert_almost_equal + +from statsmodels.regression.linear_model import OLS +import statsmodels.sandbox.panel.correlation_structures as cs +from statsmodels.sandbox.panel.panel_short import ShortPanelGLS, ShortPanelGLS2 +from statsmodels.sandbox.panel.random_panel import PanelSample +from statsmodels.stats.moment_helpers import cov2corr, se_cov +import statsmodels.stats.sandwich_covariance as sw +import statsmodels.tools.eval_measures as em + + +def assert_maxabs(actual, expected, value): + npt.assert_array_less(em.maxabs(actual, expected, None), value) + + +def test_panel_sample_rng_default_is_generator(): + # GH: rng=None used to be pre-converted to a random int before being + # handed to check_random_state(deprecated=True), so the default case + # always produced a legacy RandomState instead of a fresh Generator + # like every other canonical rng-accepting constructor in the + # library. + dgp = PanelSample(20, 2, 4, rng=None) + assert isinstance(dgp.random_state, np.random.Generator) + + +def test_panel_sample_rng_types(): + for rng in (0, np.random.RandomState(0), np.random.default_rng(0)): + dgp = PanelSample(20, 2, 4, rng=rng) + dgp.generate_panel() + + +def test_panel_sample_rng_reproducible(): + dgp1 = PanelSample(20, 2, 4, rng=0) + dgp2 = PanelSample(20, 2, 4, rng=0) + y1 = dgp1.generate_panel() + y2 = dgp2.generate_panel() + assert_almost_equal(y1, y2, decimal=13) + + +def test_short_panel(): + # this checks that some basic statistical properties are satisfied by the + # results, not verified results against other packages + # Note: the ranking of robust bse is different if within=True + # I added within keyword to PanelSample to be able to use old example + # if within is False, then there is no within group variation in exog. + nobs = 100 + nobs_i = 5 + n_groups = nobs // nobs_i + k_vars = 3 + + dgp = PanelSample( + nobs, + k_vars, + n_groups, + corr_structure=cs.corr_arma, + corr_args=( + [1], + [1.0, -0.9], + ), + rng=377769, + within=False, + ) + # print 'rng', dgp.rng + y = dgp.generate_panel() + noise = y - dgp.y_true + + # test dgp + + dgp_cov_e = np.array( + [ + [1.0, 0.9, 0.81, 0.729, 0.6561], + [0.9, 1.0, 0.9, 0.81, 0.729], + [0.81, 0.9, 1.0, 0.9, 0.81], + [0.729, 0.81, 0.9, 1.0, 0.9], + [0.6561, 0.729, 0.81, 0.9, 1.0], + ] + ) + + npt.assert_almost_equal(dgp.cov, dgp_cov_e, 13) + + cov_noise = np.cov(noise.reshape(-1, n_groups, order="F")) + corr_noise = cov2corr(cov_noise) + npt.assert_almost_equal(corr_noise, dgp.cov, 1) + + # estimate panel model + mod2 = ShortPanelGLS(y, dgp.exog, dgp.groups) + res2 = mod2.fit_iterative(2) + + # whitened residual should be uncorrelated + corr_wresid = np.corrcoef(res2.wresid.reshape(-1, n_groups, order="F")) + assert_maxabs(corr_wresid, np.eye(5), 0.1) + + # residual should have same correlation as dgp + corr_resid = np.corrcoef(res2.resid.reshape(-1, n_groups, order="F")) + assert_maxabs(corr_resid, dgp.cov, 0.1) + + assert_almost_equal(res2.resid.std(), 1, decimal=0) + + y_pred = np.dot(mod2.exog, res2.params) + assert_almost_equal(res2.fittedvalues, y_pred, 13) + + # compare with OLS + + res2_ols = mod2._fit_ols() + assert mod2.res_pooled is res2_ols + + res2_ols = mod2.res_pooled # TODO: BUG: requires call to _fit_ols + + # fitting once is the same as OLS + # note: I need to create new instance, otherwise it continuous fitting + mod1 = ShortPanelGLS(y, dgp.exog, dgp.groups) + res1 = mod1.fit_iterative(1) + + assert_almost_equal(res1.params, res2_ols.params, decimal=13) + assert_almost_equal(res1.bse, res2_ols.bse, decimal=13) + + res_ols = OLS(y, dgp.exog).fit() + assert_almost_equal(res1.params, res_ols.params, decimal=13) + assert_almost_equal(res1.bse, res_ols.bse, decimal=13) + + # compare with old version + mod_old = ShortPanelGLS2(y, dgp.exog, dgp.groups) + res_old = mod_old.fit() + + assert_almost_equal(res2.params, res_old.params, decimal=13) + assert_almost_equal(res2.bse, res_old.bse, decimal=13) + + mod5 = ShortPanelGLS(y, dgp.exog, dgp.groups) + res5 = mod5.fit_iterative(5) + + # make sure it's different + # npt.assert_array_less(0.009, em.maxabs(res5.bse, res2.bse)) + + cov_clu = sw.cov_cluster(mod2.res_pooled, dgp.groups.astype(int)) + clubse = se_cov(cov_clu) + pnwbse = se_cov(sw.cov_nw_panel(mod2.res_pooled, 4, mod2.group.groupidx)) + bser = np.vstack((res2.bse, res5.bse, clubse, pnwbse)) + bser_mean = np.mean(bser, axis=0) + + # cov_cluster close to robust and PanelGLS + # is up to 24% larger than mean of bser + # npt.assert_array_less(0, clubse / bser_mean - 1) + npt.assert_array_less(clubse / bser_mean - 1, 0.25) + # cov_nw_panel close to robust and PanelGLS + npt.assert_array_less(pnwbse / bser_mean - 1, 0.1) + # OLS underestimates bse, robust at least 60% larger + npt.assert_array_less(0.6, bser_mean / res_ols.bse - 1) + + # cov_hac_panel with uniform_kernel is the same as cov_cluster for balanced + # panel with full length kernel + # I fixe default correction to be equal + cov_uni = sw.cov_nw_panel( + mod2.res_pooled, + 4, + mod2.group.groupidx, + weights_func=sw.weights_uniform, + use_correction="c", + ) + assert_almost_equal(cov_uni, cov_clu, decimal=13) + + # without correction + cov_clu2 = sw.cov_cluster( + mod2.res_pooled, dgp.groups.astype(int), use_correction=False + ) + cov_uni2 = sw.cov_nw_panel( + mod2.res_pooled, + 4, + mod2.group.groupidx, + weights_func=sw.weights_uniform, + use_correction=False, + ) + assert_almost_equal(cov_uni2, cov_clu2, decimal=13) + + cov_white = sw.cov_white_simple(mod2.res_pooled) + cov_pnw0 = sw.cov_nw_panel( + mod2.res_pooled, 0, mod2.group.groupidx, use_correction="hac" + ) + assert_almost_equal(cov_pnw0, cov_white, decimal=13) diff --git a/shared/package-files/06/06fa9070cf676ade84535bc2fbdb2d80f026a64a0c82c2807bbee2795ac87484/blob b/shared/package-files/06/06fa9070cf676ade84535bc2fbdb2d80f026a64a0c82c2807bbee2795ac87484/blob new file mode 100644 index 0000000000000000000000000000000000000000..82db1f8b6517cb9253dff2f25b13ab8a98d4bfd4 --- /dev/null +++ b/shared/package-files/06/06fa9070cf676ade84535bc2fbdb2d80f026a64a0c82c2807bbee2795ac87484/blob @@ -0,0 +1,527 @@ +#pragma once + +#ifndef AT_PER_OPERATOR_HEADERS +#include +#else +#include +#include +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace at { + +TORCH_API std::vector infer_size(IntArrayRef a, IntArrayRef b); +TORCH_API std::vector infer_size_symint( + SymIntArrayRef a, + SymIntArrayRef b); +TORCH_API DimVector infer_size_dimvector(IntArrayRef a, IntArrayRef b); +TORCH_API SymDimVector +infer_size_symdimvector(SymIntArrayRef a, SymIntArrayRef b); + +// Named type instead of a pair/tuple so that we can be sure to +// construct the vectors in place and get NRVO. +template +struct InferExpandGeometryResult { + Container sizes; + Container strides; + explicit InferExpandGeometryResult(size_t ndim) + : sizes(ndim), strides(ndim) {} + explicit InferExpandGeometryResult(IntArrayRef sizes_, size_t ndim) + : sizes(sizes_.begin(), sizes_.end()), strides(ndim) {} +}; + +TORCH_API std::tuple, std::vector> +inferExpandGeometry( + IntArrayRef tensor_sizes, + IntArrayRef tensor_strides, + IntArrayRef sizes); + +TORCH_API InferExpandGeometryResult inferExpandGeometry_dimvector( + IntArrayRef tensor_sizes, + IntArrayRef tensor_strides, + IntArrayRef sizes); + +TORCH_API std::vector infer_dense_strides( + IntArrayRef tensor_sizes, + IntArrayRef tensor_strides); + +// True if input shapes are expandable +// NOTE: infer_size did a similar check, please keep them sync if change is +// needed +inline bool are_expandable(IntArrayRef shape1, IntArrayRef shape2) { + size_t ndim1 = shape1.size(); + size_t ndim2 = shape2.size(); + size_t ndim = ndim1 < ndim2 ? ndim1 : ndim2; + + for (int64_t i = static_cast(ndim) - 1; i >= 0; --i) { + if (shape1[--ndim1] == shape2[--ndim2] || shape1[ndim1] == 1 || + shape2[ndim2] == 1) { + continue; + } + return false; + } + return true; +} + +// avoid copy-construction of Tensor by using a reference_wrapper. +inline void check_defined( + std::initializer_list> tensors, + const char* api_name) { + for (auto& t : tensors) { + if (!t.get().defined()) { + AT_ERROR(api_name, "(...) called with an undefined Tensor"); + } + } +} + +// NOTE [ ExpandUtils Borrowing ] +// +// Functions in ExpandUtils return `c10::MaybeOwned` because +// expansion may not actually be needed, in which case we can improve +// efficiency by returning +// `c10::MaybeOwned::borrowed(to_expand)`. However, this means +// that you need to be careful: the returned `c10::MaybeOwned` +// must not outlive the original `Tensor` object that `to_expand` +// referred to! The deleted rvalue reference overloads of these +// functions help with this by preventing trivial use of a temporary +// resulting from a function call, but it is still possible to make a +// mistake. + +inline c10::MaybeOwned expand_inplace( + const Tensor& tensor, + const Tensor& to_expand) { + if (tensor.sym_sizes().equals(to_expand.sym_sizes())) { + return c10::MaybeOwned::borrowed(to_expand); + } + return c10::MaybeOwned::owned( + to_expand.expand_symint(tensor.sym_sizes())); +} + +inline c10::MaybeOwned expand_inplace( + const Tensor& tensor, + Tensor&& to_expand) = delete; + +inline c10::MaybeOwned expand_inplace( + const Tensor& tensor, + const Tensor& to_expand, + const char* api_name) { + check_defined({tensor, to_expand}, api_name); + return expand_inplace(tensor, to_expand); +} + +inline c10::MaybeOwned expand_inplace( + const Tensor& tensor, + Tensor&& to_expand, + const char* api_name) = delete; + +inline std::tuple, c10::MaybeOwned> +expand_inplace( + const Tensor& tensor, + const Tensor& to_expand1, + const Tensor& to_expand2) { + if (tensor.sizes().equals(to_expand1.sizes()) && + tensor.sizes().equals((to_expand2.sizes()))) { + return std::make_tuple( + c10::MaybeOwned::borrowed(to_expand1), + c10::MaybeOwned::borrowed(to_expand2)); + } + + return std::make_tuple( + c10::MaybeOwned::owned(to_expand1.expand(tensor.sizes())), + c10::MaybeOwned::owned(to_expand2.expand(tensor.sizes()))); +} + +inline std::tuple, c10::MaybeOwned> +expand_inplace( + const Tensor& tensor, + Tensor&& to_expand1, + const Tensor& to_expand2) = delete; +inline std::tuple, c10::MaybeOwned> +expand_inplace( + const Tensor& tensor, + const Tensor& to_expand1, + Tensor&& to_expand2) = delete; +inline std::tuple, c10::MaybeOwned> +expand_inplace(const Tensor& tensor, Tensor&& to_expand1, Tensor&& to_expand2) = + delete; + +inline std::tuple, c10::MaybeOwned> +expand_inplace( + const Tensor& tensor, + const Tensor& to_expand1, + const Tensor& to_expand2, + const char* api_name) { + check_defined({tensor, to_expand1, to_expand2}, api_name); + return expand_inplace(tensor, to_expand1, to_expand2); +} + +inline std::tuple, c10::MaybeOwned> +expand_inplace( + const Tensor& tensor, + Tensor&& to_expand1, + const Tensor& to_expand2, + const char* api_name) = delete; +inline std::tuple, c10::MaybeOwned> +expand_inplace( + const Tensor& tensor, + const Tensor& to_expand1, + Tensor&& to_expand2, + const char* api_name) = delete; +inline std::tuple, c10::MaybeOwned> +expand_inplace( + const Tensor& tensor, + Tensor&& to_expand1, + Tensor&& to_expand2, + const char* api_name) = delete; + +// See NOTE [ ExpandUtils Borrowing ] above for `MaybeOwned` explanation. +inline std::tuple, c10::MaybeOwned> +expand_outplace(const Tensor& to_expand1, const Tensor& to_expand2) { + auto s1 = to_expand1.sym_sizes(); + auto s2 = to_expand2.sym_sizes(); + if (s1.equals(s2)) { + return std::make_tuple( + c10::MaybeOwned::borrowed(to_expand1), + c10::MaybeOwned::borrowed(to_expand2)); + } + + auto expanded_size = infer_size_symdimvector(s1, s2); + return std::make_tuple( + c10::MaybeOwned::owned(to_expand1.expand_symint(expanded_size)), + c10::MaybeOwned::owned(to_expand2.expand_symint(expanded_size))); +} + +inline std::tuple, c10::MaybeOwned> +expand_outplace(Tensor&& to_expand1, const Tensor& to_expand2) = delete; +inline std::tuple, c10::MaybeOwned> +expand_outplace(const Tensor& to_expand1, Tensor&& to_expand2) = delete; +inline std::tuple, c10::MaybeOwned> +expand_outplace(Tensor&& to_expand1, Tensor&& to_expand2) = delete; + +inline std::tuple, c10::MaybeOwned> +expand_outplace( + const Tensor& to_expand1, + const Tensor& to_expand2, + const char* api_name) { + check_defined({to_expand1, to_expand2}, api_name); + return expand_outplace(to_expand1, to_expand2); +} + +inline std::tuple, c10::MaybeOwned> +expand_outplace( + Tensor&& to_expand1, + const Tensor& to_expand2, + const char* api_name) = delete; +inline std::tuple, c10::MaybeOwned> +expand_outplace( + const Tensor& to_expand1, + Tensor&& to_expand2, + const char* api_name) = delete; +inline std::tuple, c10::MaybeOwned> +expand_outplace( + Tensor&& to_expand1, + Tensor&& to_expand2, + const char* api_name) = delete; + +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + const Tensor& to_expand1, + const Tensor& to_expand2, + const Tensor& to_expand3) { + if (to_expand1.sizes().equals(to_expand2.sizes()) && + to_expand1.sizes().equals(to_expand3.sizes())) { + return std::make_tuple( + c10::MaybeOwned::borrowed(to_expand1), + c10::MaybeOwned::borrowed(to_expand2), + c10::MaybeOwned::borrowed(to_expand3)); + } + + auto expanded_size12 = + infer_size_dimvector(to_expand1.sizes(), to_expand2.sizes()); + auto expanded_size = + infer_size_dimvector(expanded_size12, to_expand3.sizes()); + return std::make_tuple( + c10::MaybeOwned::owned(to_expand1.expand(expanded_size)), + c10::MaybeOwned::owned(to_expand2.expand(expanded_size)), + c10::MaybeOwned::owned(to_expand3.expand(expanded_size))); +} + +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + Tensor&& to_expand1, + const Tensor& to_expand2, + const Tensor& to_expand3) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + const Tensor& to_expand1, + Tensor&& to_expand2, + const Tensor& to_expand3) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + Tensor&& to_expand1, + Tensor&& to_expand2, + const Tensor& to_expand3) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + const Tensor& to_expand1, + const Tensor& to_expand2, + Tensor&& to_expand3) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + Tensor&& to_expand1, + const Tensor& to_expand2, + Tensor&& to_expand3) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + const Tensor& to_expand1, + Tensor&& to_expand2, + Tensor&& to_expand3) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace(Tensor&& to_expand1, Tensor&& to_expand2, Tensor&& to_expand3) = + delete; + +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + const Tensor& to_expand1, + const Tensor& to_expand2, + const Tensor& to_expand3, + const char* api_name) { + check_defined({to_expand1, to_expand2, to_expand3}, api_name); + return expand_outplace(to_expand1, to_expand2, to_expand3); +} + +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + Tensor&& to_expand1, + const Tensor& to_expand2, + const Tensor& to_expand3, + const char* api_name) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + const Tensor& to_expand1, + Tensor&& to_expand2, + const Tensor& to_expand3, + const char* api_name) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + Tensor&& to_expand1, + Tensor&& to_expand2, + const Tensor& to_expand3, + const char* api_name) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + const Tensor& to_expand1, + const Tensor& to_expand2, + Tensor&& to_expand3, + const char* api_name) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + Tensor&& to_expand1, + const Tensor& to_expand2, + Tensor&& to_expand3, + const char* api_name) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + const Tensor& to_expand1, + Tensor&& to_expand2, + Tensor&& to_expand3, + const char* api_name) = delete; +inline std::tuple< + c10::MaybeOwned, + c10::MaybeOwned, + c10::MaybeOwned> +expand_outplace( + Tensor&& to_expand1, + Tensor&& to_expand2, + Tensor&& to_expand3, + const char* api_name) = delete; + +inline c10::MaybeOwned expand_size( + const Tensor& to_expand, + IntArrayRef sizes) { + if (to_expand.sizes().equals(sizes)) { + return c10::MaybeOwned::borrowed(to_expand); + } + + return c10::MaybeOwned::owned(to_expand.expand(sizes)); +} + +inline c10::MaybeOwned expand_size( + Tensor&& to_expand, + IntArrayRef sizes) = delete; + +inline c10::MaybeOwned expand_size( + const Tensor& to_expand, + IntArrayRef sizes, + const char* api_name) { + check_defined({to_expand}, api_name); + return expand_size(to_expand, sizes); +} + +inline c10::MaybeOwned expand_size( + Tensor&& to_expand, + IntArrayRef sizes, + const char* api_name) = delete; + +inline std::vector expand_outplace(TensorList to_expand) { + // expands a list of Tensors; ignores undefined (null) tensors + bool first = true; + DimVector sizes; + for (const auto i : c10::irange(to_expand.size())) { + if (!to_expand[i].defined()) { + continue; + } else if (first) { + sizes = to_expand[i].sizes(); + first = false; + } else { + sizes = infer_size_dimvector(sizes, to_expand[i].sizes()); + } + } + + std::vector result(to_expand.size()); + for (const auto i : c10::irange(to_expand.size())) { + if (!to_expand[i].defined()) { + continue; + } else if (to_expand[i].sizes().equals(sizes)) { + result[i] = to_expand[i]; + } else { + result[i] = to_expand[i].expand(sizes); + } + } + return result; +} + +template +inline Tensor _sum_to( + Tensor tensor, + const c10::ArrayRef shape, + bool always_return_non_view = false) { + if (shape.size() == 0) { + return tensor.sum(); + } + + auto sizes = at::symint::sizes(tensor); + c10::SmallVector reduce_dims; + const int64_t leading_dims = sizes.size() - shape.size(); + for (const auto i : c10::irange(leading_dims)) { + reduce_dims.push_back(i); + } + for (int64_t i = leading_dims; i < static_cast(sizes.size()); ++i) { + if (shape[i - leading_dims] == 1 && sizes[i] != 1) { + reduce_dims.push_back(i); + } + } + + if (!reduce_dims.empty()) { + tensor = tensor.sum(reduce_dims, /*keepdim=*/true); + } + + if (always_return_non_view) { + // This is only actually used by the functionalization pass. + // We want to be able to guarantee that this function doesn't return a view + // of the input. + return leading_dims > 0 ? at::symint::view_copy(tensor, shape) + : tensor.clone(); + } else { + return leading_dims > 0 ? at::symint::view(tensor, shape) : tensor; + } +} + +inline Tensor sum_to( + Tensor tensor, + const c10::SymIntArrayRef shape, + bool always_return_non_view = false) { + return _sum_to(std::move(tensor), shape, always_return_non_view); +} + +// Sums `tensor` repeatedly to produce a tensor of shape `shape`. +// Precondition: is_expandable_to(shape, tensor.sizes()) must be true +inline Tensor sum_to( + Tensor tensor, + const IntArrayRef shape, + bool always_return_non_view = false) { + return _sum_to(std::move(tensor), shape, always_return_non_view); +} + +static inline bool is_expandable_to( + SymIntArrayRef shape, + c10::SymIntArrayRef desired) { + size_t ndim = shape.size(); + size_t target_dim = desired.size(); + if (ndim > target_dim) { + return false; + } + for (const auto i : c10::irange(ndim)) { + const auto& size = shape[ndim - i - 1]; + const auto& target = desired[target_dim - i - 1]; + if (size != target && size != 1) { + return false; + } + } + return true; +} + +static inline bool is_expandable_to(IntArrayRef shape, IntArrayRef desired) { + auto sym_shape = c10::SymIntArrayRef( + reinterpret_cast(shape.data()), shape.size()); + auto sym_desired = c10::SymIntArrayRef( + reinterpret_cast(desired.data()), desired.size()); + return is_expandable_to(sym_shape, sym_desired); +} + +} // namespace at diff --git a/shared/package-files/06/06fdaf8c6162d41911403a8a68d81e4e013184a34a9a2bad0bf9db88a934ff89/blob b/shared/package-files/06/06fdaf8c6162d41911403a8a68d81e4e013184a34a9a2bad0bf9db88a934ff89/blob new file mode 100644 index 0000000000000000000000000000000000000000..70ea75de59c7d50e6776d9b677fef950a18046ea Binary files /dev/null and b/shared/package-files/06/06fdaf8c6162d41911403a8a68d81e4e013184a34a9a2bad0bf9db88a934ff89/blob differ diff --git a/shared/package-files/06/06fe4495c90199b465e598eff59efdbb7760c4c763e344e5897e5ca6649767c9/blob b/shared/package-files/06/06fe4495c90199b465e598eff59efdbb7760c4c763e344e5897e5ca6649767c9/blob new file mode 100644 index 0000000000000000000000000000000000000000..ef060e609a57ed744eefa328ecaaa71765aab9fd --- /dev/null +++ b/shared/package-files/06/06fe4495c90199b465e598eff59efdbb7760c4c763e344e5897e5ca6649767c9/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06fe4495c90199b465e598eff59efdbb7760c4c763e344e5897e5ca6649767c9 +size 1025032 diff --git a/shared/package-files/06/06feb038863e48f6227e5eaba30364824da21277ec5163ecd0fd7338533cefd9/blob b/shared/package-files/06/06feb038863e48f6227e5eaba30364824da21277ec5163ecd0fd7338533cefd9/blob new file mode 100644 index 0000000000000000000000000000000000000000..874f8b146d77e2ff2cf921680ef3ee115708924d --- /dev/null +++ b/shared/package-files/06/06feb038863e48f6227e5eaba30364824da21277ec5163ecd0fd7338533cefd9/blob @@ -0,0 +1,91 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::cudnn_convolution_relu(Tensor self, Tensor weight, Tensor? bias, SymInt[] stride, SymInt[] padding, SymInt[] dilation, SymInt groups) -> Tensor +inline at::Tensor cudnn_convolution_relu(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, int64_t groups) { + return at::_ops::cudnn_convolution_relu::call(self, weight, bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation), groups); +} +namespace symint { + template ::value>> + at::Tensor cudnn_convolution_relu(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, int64_t groups) { + return at::_ops::cudnn_convolution_relu::call(self, weight, bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation), groups); + } +} + +// aten::cudnn_convolution_relu(Tensor self, Tensor weight, Tensor? bias, SymInt[] stride, SymInt[] padding, SymInt[] dilation, SymInt groups) -> Tensor +inline at::Tensor cudnn_convolution_relu_symint(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, c10::SymInt groups) { + return at::_ops::cudnn_convolution_relu::call(self, weight, bias, stride, padding, dilation, groups); +} +namespace symint { + template ::value>> + at::Tensor cudnn_convolution_relu(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, c10::SymInt groups) { + return at::_ops::cudnn_convolution_relu::call(self, weight, bias, stride, padding, dilation, groups); + } +} + +// aten::cudnn_convolution_relu.out(Tensor self, Tensor weight, Tensor? bias, SymInt[] stride, SymInt[] padding, SymInt[] dilation, SymInt groups, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & cudnn_convolution_relu_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, int64_t groups) { + return at::_ops::cudnn_convolution_relu_out::call(self, weight, bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation), groups, out); +} +namespace symint { + template ::value>> + at::Tensor & cudnn_convolution_relu_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, int64_t groups) { + return at::_ops::cudnn_convolution_relu_out::call(self, weight, bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation), groups, out); + } +} + +// aten::cudnn_convolution_relu.out(Tensor self, Tensor weight, Tensor? bias, SymInt[] stride, SymInt[] padding, SymInt[] dilation, SymInt groups, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & cudnn_convolution_relu_outf(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, int64_t groups, at::Tensor & out) { + return at::_ops::cudnn_convolution_relu_out::call(self, weight, bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation), groups, out); +} +namespace symint { + template ::value>> + at::Tensor & cudnn_convolution_relu_outf(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, int64_t groups, at::Tensor & out) { + return at::_ops::cudnn_convolution_relu_out::call(self, weight, bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation), groups, out); + } +} + +// aten::cudnn_convolution_relu.out(Tensor self, Tensor weight, Tensor? bias, SymInt[] stride, SymInt[] padding, SymInt[] dilation, SymInt groups, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & cudnn_convolution_relu_symint_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, c10::SymInt groups) { + return at::_ops::cudnn_convolution_relu_out::call(self, weight, bias, stride, padding, dilation, groups, out); +} +namespace symint { + template ::value>> + at::Tensor & cudnn_convolution_relu_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, c10::SymInt groups) { + return at::_ops::cudnn_convolution_relu_out::call(self, weight, bias, stride, padding, dilation, groups, out); + } +} + +// aten::cudnn_convolution_relu.out(Tensor self, Tensor weight, Tensor? bias, SymInt[] stride, SymInt[] padding, SymInt[] dilation, SymInt groups, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & cudnn_convolution_relu_symint_outf(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, c10::SymInt groups, at::Tensor & out) { + return at::_ops::cudnn_convolution_relu_out::call(self, weight, bias, stride, padding, dilation, groups, out); +} +namespace symint { + template ::value>> + at::Tensor & cudnn_convolution_relu_outf(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, c10::SymInt groups, at::Tensor & out) { + return at::_ops::cudnn_convolution_relu_out::call(self, weight, bias, stride, padding, dilation, groups, out); + } +} + +} diff --git a/shared/package-files/07/07031633044f4b177260f711d6871d8b6297a49bc05d17a9933eaf51f6550a67/blob b/shared/package-files/07/07031633044f4b177260f711d6871d8b6297a49bc05d17a9933eaf51f6550a67/blob new file mode 100644 index 0000000000000000000000000000000000000000..d498ac67f7a7da8affacd14aecef9870aaf09e8e --- /dev/null +++ b/shared/package-files/07/07031633044f4b177260f711d6871d8b6297a49bc05d17a9933eaf51f6550a67/blob @@ -0,0 +1,1311 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Data structure for Flight RPC. + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "arrow/buffer.h" +#include "arrow/flight/type_fwd.h" +#include "arrow/flight/visibility.h" +#include "arrow/ipc/options.h" +#include "arrow/ipc/writer.h" +#include "arrow/result.h" +#include "arrow/status.h" + +namespace arrow { + +class RecordBatch; +class Schema; +class Table; + +namespace ipc { +class DictionaryMemo; +struct ReadStats; +} // namespace ipc + +namespace util { +class Uri; +} // namespace util + +namespace flight { + +ARROW_FLIGHT_EXPORT +extern const char* kSchemeGrpc; +ARROW_FLIGHT_EXPORT +extern const char* kSchemeGrpcTcp; +ARROW_FLIGHT_EXPORT +extern const char* kSchemeGrpcUnix; +ARROW_FLIGHT_EXPORT +extern const char* kSchemeGrpcTls; + +class FlightClient; +class FlightServerBase; + +/// \brief A timestamp compatible with Protocol Buffer's +/// google.protobuf.Timestamp: +/// +/// https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp +/// +/// > A Timestamp represents a point in time independent of any time +/// > zone or calendar, represented as seconds and fractions of +/// > seconds at nanosecond resolution in UTC Epoch time. It is +/// > encoded using the Proleptic Gregorian Calendar which extends the +/// > Gregorian calendar backwards to year one. It is encoded assuming +/// > all minutes are 60 seconds long, i.e. leap seconds are "smeared" +/// > so that no leap second table is needed for interpretation. Range +/// > is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. +using Timestamp = + std::chrono::time_point; + +/// \brief A Flight-specific status code. Used to encode some +/// additional status codes into an Arrow Status. +enum class FlightStatusCode : int8_t { + /// An implementation error has occurred. + Internal, + /// A request timed out. + TimedOut, + /// A request was cancelled. + Cancelled, + /// We are not authenticated to the remote service. + Unauthenticated, + /// We do not have permission to make this request. + Unauthorized, + /// The remote service cannot handle this request at the moment. + Unavailable, + /// A request failed for some other reason + Failed +}; + +// Silence warning +// "non dll-interface class RecordBatchReader used as base for dll-interface class" +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable : 4275) +#endif + +/// \brief Flight-specific error information in a Status. +class ARROW_FLIGHT_EXPORT FlightStatusDetail : public arrow::StatusDetail { + public: + explicit FlightStatusDetail(FlightStatusCode code) : code_{code} {} + explicit FlightStatusDetail(FlightStatusCode code, std::string extra_info) + : code_{code}, extra_info_(std::move(extra_info)) {} + const char* type_id() const override; + std::string ToString() const override; + + /// \brief Get the Flight status code. + FlightStatusCode code() const; + /// \brief Get the extra error info + std::string extra_info() const; + /// \brief Get the human-readable name of the status code. + std::string CodeAsString() const; + /// \brief Set the extra error info + void set_extra_info(std::string extra_info); + + /// \brief Try to extract a \a FlightStatusDetail from any Arrow + /// status. + /// + /// \return a \a FlightStatusDetail if it could be unwrapped, \a + /// nullptr otherwise + static std::shared_ptr UnwrapStatus(const arrow::Status& status); + + private: + FlightStatusCode code_; + std::string extra_info_; +}; + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +/// \brief Make an appropriate Arrow status for the given +/// Flight-specific status. +/// +/// \param code The Flight status code. +/// \param message The message for the error. +/// \param extra_info Optional extra binary info for the error (eg protobuf) +ARROW_FLIGHT_EXPORT +Status MakeFlightError(FlightStatusCode code, std::string message, + std::string extra_info = {}); + +/// \brief Headers sent from the client or server. +/// +/// Header values are ordered. +using CallHeaders = std::multimap; + +/// \brief A TLS certificate plus key. +struct ARROW_FLIGHT_EXPORT CertKeyPair { + /// \brief The certificate in PEM format. + std::string pem_cert; + + /// \brief The key in PEM format. + std::string pem_key; +}; + +namespace internal { + +template +struct remove_unique_ptr { + using type = T; +}; + +template +struct remove_unique_ptr> { + using type = T; +}; + +// Base CRTP type +template +struct BaseType { + protected: + using SuperT = BaseType; + using SelfT = typename remove_unique_ptr::type; + + const SelfT& self() const { return static_cast(*this); } + SelfT& self() { return static_cast(*this); } + + public: + BaseType() = default; + + friend bool operator==(const SelfT& left, const SelfT& right) { + return left.Equals(right); + } + friend bool operator!=(const SelfT& left, const SelfT& right) { + return !left.Equals(right); + } + + /// \brief Serialize this message to its wire-format representation. + inline arrow::Result SerializeToString() const { + std::string out; + ARROW_RETURN_NOT_OK(self().SelfT::SerializeToString(&out)); + return out; + } + + inline static arrow::Result Deserialize(std::string_view serialized) { + T out; + ARROW_RETURN_NOT_OK(SelfT::Deserialize(serialized, &out)); + return out; + } + + inline arrow::Result> SerializeToBuffer() const { + std::string out; + ARROW_RETURN_NOT_OK(self().SelfT::SerializeToString(&out)); + return Buffer::FromString(std::move(out)); + } +}; + +} // namespace internal + +//------------------------------------------------------------ +// Wrapper types for Flight RPC protobuf messages + +// A wrapper around arrow.flight.protocol.HandshakeRequest is not defined +// A wrapper around arrow.flight.protocol.HandshakeResponse is not defined + +/// \brief message for simple auth +struct ARROW_FLIGHT_EXPORT BasicAuth : public internal::BaseType { + std::string username; + std::string password; + + BasicAuth() = default; + BasicAuth(std::string username, std::string password) + : username(std::move(username)), password(std::move(password)) {} + + std::string ToString() const; + bool Equals(const BasicAuth& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, BasicAuth* out); +}; + +// A wrapper around arrow.flight.protocol.Empty is not defined + +/// \brief A type of action that can be performed with the DoAction RPC. +struct ARROW_FLIGHT_EXPORT ActionType : public internal::BaseType { + /// \brief The name of the action. + std::string type; + + /// \brief A human-readable description of the action. + std::string description; + + ActionType() = default; + + ActionType(std::string type, std::string description) + : type(std::move(type)), description(std::move(description)) {} + + std::string ToString() const; + bool Equals(const ActionType& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, ActionType* out); + + static const ActionType kCancelFlightInfo; + static const ActionType kRenewFlightEndpoint; + static const ActionType kSetSessionOptions; + static const ActionType kGetSessionOptions; + static const ActionType kCloseSession; +}; + +/// \brief Opaque selection criteria for ListFlights RPC +struct ARROW_FLIGHT_EXPORT Criteria : public internal::BaseType { + /// Opaque criteria expression, dependent on server implementation + std::string expression; + + Criteria() = default; + Criteria(std::string expression) // NOLINT runtime/explicit + : expression(std::move(expression)) {} + + std::string ToString() const; + bool Equals(const Criteria& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, Criteria* out); +}; + +/// \brief An action to perform with the DoAction RPC +struct ARROW_FLIGHT_EXPORT Action : public internal::BaseType { + /// The action type + std::string type; + + /// The action content as a Buffer + std::shared_ptr body; + + Action() = default; + Action(std::string type, std::shared_ptr body) + : type(std::move(type)), body(std::move(body)) {} + + std::string ToString() const; + bool Equals(const Action& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, Action* out); +}; + +/// \brief Opaque result returned after executing an action +struct ARROW_FLIGHT_EXPORT Result : public internal::BaseType { + std::shared_ptr body; + + Result() = default; + Result(std::shared_ptr body) // NOLINT runtime/explicit + : body(std::move(body)) {} + + std::string ToString() const; + bool Equals(const Result& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, Result* out); +}; + +/// \brief Schema result returned after a schema request RPC +struct ARROW_FLIGHT_EXPORT SchemaResult : public internal::BaseType { + public: + SchemaResult() = default; + explicit SchemaResult(std::string schema) : raw_schema_(std::move(schema)) {} + + /// \brief Factory method to construct a SchemaResult. + static arrow::Result> Make(const Schema& schema); + + /// \brief return schema + /// \param[in,out] dictionary_memo for dictionary bookkeeping, will + /// be modified + /// \return Arrow result with the reconstructed Schema + arrow::Result> GetSchema( + ipc::DictionaryMemo* dictionary_memo) const; + + const std::string& serialized_schema() const { return raw_schema_; } + + std::string ToString() const; + bool Equals(const SchemaResult& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, SchemaResult* out); + + private: + std::string raw_schema_; +}; + +/// \brief A request to retrieve or generate a dataset +struct ARROW_FLIGHT_EXPORT FlightDescriptor + : public internal::BaseType { + enum DescriptorType { + UNKNOWN = 0, /// Unused + PATH = 1, /// Named path identifying a dataset + CMD = 2 /// Opaque command to generate a dataset + }; + + /// The descriptor type + DescriptorType type = UNKNOWN; + + /// Opaque value used to express a command. Should only be defined when type + /// is CMD + std::string cmd; + + /// List of strings identifying a particular dataset. Should only be defined + /// when type is PATH + std::vector path; + + FlightDescriptor(); + FlightDescriptor(DescriptorType type, std::string cmd, + std::vector path) noexcept; + ~FlightDescriptor(); + + /// \brief Get a human-readable form of this descriptor. + std::string ToString() const; + bool Equals(const FlightDescriptor& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Get the wire-format representation of this type. + /// + /// Useful when interoperating with non-Flight systems (e.g. REST + /// services) that may want to return Flight types. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Parse the wire-format representation of this type. + /// + /// Useful when interoperating with non-Flight systems (e.g. REST + /// services) that may want to return Flight types. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, FlightDescriptor* out); + + // Convenience factory functions + + static FlightDescriptor Command(std::string cmd) { + return FlightDescriptor{CMD, std::move(cmd), {}}; + } + + static FlightDescriptor Path(std::vector path) { + return FlightDescriptor{PATH, "", std::move(path)}; + } +}; + +/// \brief Data structure providing an opaque identifier or credential to use +/// when requesting a data stream with the DoGet RPC +struct ARROW_FLIGHT_EXPORT Ticket : public internal::BaseType { + std::string ticket; + + Ticket() = default; + Ticket(std::string ticket) // NOLINT runtime/explicit + : ticket(std::move(ticket)) {} + + std::string ToString() const; + bool Equals(const Ticket& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Get the wire-format representation of this type. + /// + /// Useful when interoperating with non-Flight systems (e.g. REST + /// services) that may want to return Flight types. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Parse the wire-format representation of this type. + /// + /// Useful when interoperating with non-Flight systems (e.g. REST + /// services) that may want to return Flight types. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, Ticket* out); +}; + +/// \brief A host location (a URI) +struct ARROW_FLIGHT_EXPORT Location : public internal::BaseType { + public: + /// \brief Initialize a blank location. + Location(); + + ~Location(); + + /// \brief Initialize a location by parsing a URI string + static arrow::Result Parse(const std::string& uri_string); + + /// \brief Get the fallback URI. + /// + /// arrow-flight-reuse-connection://? means that a client may attempt to + /// reuse an existing connection to a Flight service to fetch data instead + /// of creating a new connection to one of the other locations listed in a + /// FlightEndpoint response. + static const Location& ReuseConnection(); + + /// \brief Initialize a location for a non-TLS, gRPC-based Flight + /// service from a host and port + /// \param[in] host The hostname to connect to + /// \param[in] port The port + /// \return Arrow result with the resulting location + static arrow::Result ForGrpcTcp(const std::string& host, const int port); + + /// \brief Initialize a location for a TLS-enabled, gRPC-based Flight + /// service from a host and port + /// \param[in] host The hostname to connect to + /// \param[in] port The port + /// \return Arrow result with the resulting location + static arrow::Result ForGrpcTls(const std::string& host, const int port); + + /// \brief Initialize a location for a domain socket-based Flight + /// service + /// \param[in] path The path to the domain socket + /// \return Arrow result with the resulting location + static arrow::Result ForGrpcUnix(const std::string& path); + + /// \brief Initialize a location based on a URI scheme + static arrow::Result ForScheme(const std::string& scheme, + const std::string& host, const int port); + + /// \brief Get the scheme of this URI. + std::string scheme() const; + + /// \brief Get a representation of this URI as a string. + std::string ToString() const; + bool Equals(const Location& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, Location* out); + + private: + friend class FlightClient; + friend class FlightServerBase; + std::shared_ptr uri_; +}; + +/// \brief A flight ticket and list of locations where the ticket can be +/// redeemed +struct ARROW_FLIGHT_EXPORT FlightEndpoint : public internal::BaseType { + /// Opaque ticket identify; use with DoGet RPC + Ticket ticket; + + /// List of locations where ticket can be redeemed. If the list is empty, the + /// ticket can only be redeemed on the current service where the ticket was + /// generated + std::vector locations; + + /// Expiration time of this stream. If present, clients may assume + /// they can retry DoGet requests. Otherwise, clients should avoid + /// retrying DoGet requests. + std::optional expiration_time; + + /// Opaque Application-defined metadata + std::string app_metadata; + + FlightEndpoint() = default; + FlightEndpoint(Ticket ticket, std::vector locations, + std::optional expiration_time, std::string app_metadata) + : ticket(std::move(ticket)), + locations(std::move(locations)), + expiration_time(expiration_time), + app_metadata(std::move(app_metadata)) {} + + std::string ToString() const; + bool Equals(const FlightEndpoint& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, FlightEndpoint* out); +}; + +/// \brief The access coordinates for retrieval of a dataset, returned by +/// GetFlightInfo +class ARROW_FLIGHT_EXPORT FlightInfo + : public internal::BaseType> { + public: + struct Data { + std::string schema; + FlightDescriptor descriptor; + std::vector endpoints; + int64_t total_records = -1; + int64_t total_bytes = -1; + bool ordered = false; + std::string app_metadata; + }; + + explicit FlightInfo(Data data) : data_(std::move(data)), reconstructed_schema_(false) {} + + /// \brief Factory method to construct a FlightInfo. + static arrow::Result Make(const Schema& schema, + const FlightDescriptor& descriptor, + const std::vector& endpoints, + int64_t total_records, int64_t total_bytes, + bool ordered = false, + std::string app_metadata = ""); + + /// \brief Factory method to construct a FlightInfo. + static arrow::Result Make(const std::shared_ptr& schema, + const FlightDescriptor& descriptor, + const std::vector& endpoints, + int64_t total_records, int64_t total_bytes, + bool ordered = false, + std::string app_metadata = ""); + + /// \brief Deserialize the Arrow schema of the dataset. Populate any + /// dictionary encoded fields into a DictionaryMemo for + /// bookkeeping + /// \param[in,out] dictionary_memo for dictionary bookkeeping, will + /// be modified + /// \return Arrow result with the reconstructed Schema. Note that the schema + /// may be nullptr, as the schema is optional. + arrow::Result> GetSchema( + ipc::DictionaryMemo* dictionary_memo) const; + + const std::string& serialized_schema() const { return data_.schema; } + + /// The descriptor associated with this flight, may not be set + const FlightDescriptor& descriptor() const { return data_.descriptor; } + + /// A list of endpoints associated with the flight (dataset). To consume the + /// whole flight, all endpoints must be consumed + const std::vector& endpoints() const { return data_.endpoints; } + + /// The total number of records (rows) in the dataset. If unknown, set to -1 + int64_t total_records() const { return data_.total_records; } + + /// The total number of bytes in the dataset. If unknown, set to -1 + int64_t total_bytes() const { return data_.total_bytes; } + + /// Whether endpoints are in the same order as the data. + bool ordered() const { return data_.ordered; } + + /// Application-defined opaque metadata + const std::string& app_metadata() const { return data_.app_metadata; } + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Get the wire-format representation of this type. + /// + /// Useful when interoperating with non-Flight systems (e.g. REST + /// services) that may want to return Flight types. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Parse the wire-format representation of this type. + /// + /// Useful when interoperating with non-Flight systems (e.g. REST + /// services) that may want to return Flight types. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, + std::unique_ptr* out); + + std::string ToString() const; + + /// Compare two FlightInfo for equality. This will compare the + /// serialized schema representations, NOT the logical equality of + /// the schemas. + bool Equals(const FlightInfo& other) const; + + private: + Data data_; + mutable std::shared_ptr schema_; + mutable bool reconstructed_schema_; +}; + +/// \brief The information to process a long-running query. +class ARROW_FLIGHT_EXPORT PollInfo + : public internal::BaseType> { + public: + /// The currently available results so far. + std::unique_ptr info = NULLPTR; + /// The descriptor the client should use on the next try. If unset, + /// the query is complete. + std::optional descriptor = std::nullopt; + /// Query progress. Must be in [0.0, 1.0] but need not be + /// monotonic or nondecreasing. If unknown, do not set. + std::optional progress = std::nullopt; + /// Expiration time for this request. After this passes, the server + /// might not accept the poll descriptor anymore (and the query may + /// be cancelled). This may be updated on a call to PollFlightInfo. + std::optional expiration_time = std::nullopt; + + PollInfo() + : info(NULLPTR), + descriptor(std::nullopt), + progress(std::nullopt), + expiration_time(std::nullopt) {} + + PollInfo(std::unique_ptr info, std::optional descriptor, + std::optional progress, std::optional expiration_time) + : info(std::move(info)), + descriptor(std::move(descriptor)), + progress(progress), + expiration_time(expiration_time) {} + + PollInfo(const PollInfo& other) + : info(other.info ? std::make_unique(*other.info) : NULLPTR), + descriptor(other.descriptor), + progress(other.progress), + expiration_time(other.expiration_time) {} + PollInfo(PollInfo&& other) noexcept = default; + ~PollInfo() = default; + PollInfo& operator=(const PollInfo& other) { + info = other.info ? std::make_unique(*other.info) : NULLPTR; + descriptor = other.descriptor; + progress = other.progress; + expiration_time = other.expiration_time; + return *this; + } + PollInfo& operator=(PollInfo&& other) = default; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Get the wire-format representation of this type. + /// + /// Useful when interoperating with non-Flight systems (e.g. REST + /// services) that may want to return Flight types. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Parse the wire-format representation of this type. + /// + /// Useful when interoperating with non-Flight systems (e.g. REST + /// services) that may want to return Flight types. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, + std::unique_ptr* out); + + std::string ToString() const; + + /// Compare two PollInfo for equality. This will compare the + /// serialized schema representations, NOT the logical equality of + /// the schemas. + bool Equals(const PollInfo& other) const; +}; + +/// \brief The request of the CancelFlightInfoRequest action. +struct ARROW_FLIGHT_EXPORT CancelFlightInfoRequest + : public internal::BaseType { + std::unique_ptr info; + + CancelFlightInfoRequest() = default; + CancelFlightInfoRequest(std::unique_ptr info) // NOLINT runtime/explicit + : info(std::move(info)) {} + + std::string ToString() const; + bool Equals(const CancelFlightInfoRequest& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, + CancelFlightInfoRequest* out); +}; + +enum class CancelStatus { + /// The cancellation status is unknown. Servers should avoid using + /// this value (send a kNotCancellable if the requested FlightInfo + /// is not known). Clients can retry the request. + kUnspecified = 0, + /// The cancellation request is complete. Subsequent requests with + /// the same payload may return kCancelled or a kNotCancellable error. + kCancelled = 1, + /// The cancellation request is in progress. The client may retry + /// the cancellation request. + kCancelling = 2, + // The FlightInfo is not cancellable. The client should not retry the + // cancellation request. + kNotCancellable = 3, +}; + +/// \brief The result of the CancelFlightInfo action. +struct ARROW_FLIGHT_EXPORT CancelFlightInfoResult + : public internal::BaseType { + CancelStatus status = CancelStatus::kUnspecified; + + CancelFlightInfoResult() = default; + CancelFlightInfoResult(CancelStatus status) // NOLINT runtime/explicit + : status(status) {} + + std::string ToString() const; + bool Equals(const CancelFlightInfoResult& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, + CancelFlightInfoResult* out); +}; + +ARROW_FLIGHT_EXPORT +std::ostream& operator<<(std::ostream& os, CancelStatus status); + +/// \brief The request of the RenewFlightEndpoint action. +struct ARROW_FLIGHT_EXPORT RenewFlightEndpointRequest + : public internal::BaseType { + FlightEndpoint endpoint; + + RenewFlightEndpointRequest() = default; + explicit RenewFlightEndpointRequest(FlightEndpoint endpoint) + : endpoint(std::move(endpoint)) {} + + std::string ToString() const; + bool Equals(const RenewFlightEndpointRequest& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, + RenewFlightEndpointRequest* out); +}; + +// FlightData in Flight.proto maps to FlightPayload here. + +/// \brief Staging data structure for messages about to be put on the wire +/// +/// This structure corresponds to FlightData in the protocol. +struct ARROW_FLIGHT_EXPORT FlightPayload { + std::shared_ptr descriptor; + std::shared_ptr app_metadata; + ipc::IpcPayload ipc_message; + + FlightPayload() = default; + FlightPayload(std::shared_ptr descriptor, std::shared_ptr app_metadata, + ipc::IpcPayload ipc_message) + : descriptor(std::move(descriptor)), + app_metadata(std::move(app_metadata)), + ipc_message(std::move(ipc_message)) {} + + /// \brief Check that the payload can be written to the wire. + Status Validate() const; +}; + +// A wrapper around arrow.flight.protocol.PutResult is not defined + +// Session management messages + +/// \brief Variant supporting all possible value types for {Set,Get}SessionOptions +/// +/// By convention, an attempt to set a valueless (std::monostate) SessionOptionValue +/// should attempt to unset or clear the named option value on the server. +using SessionOptionValue = std::variant>; +std::ostream& operator<<(std::ostream& os, const SessionOptionValue& v); + +/// \brief A request to set a set of session options by name/value. +struct ARROW_FLIGHT_EXPORT SetSessionOptionsRequest + : public internal::BaseType { + std::map session_options; + + SetSessionOptionsRequest() = default; + explicit SetSessionOptionsRequest( + std::map session_options) + : session_options(std::move(session_options)) {} + + std::string ToString() const; + bool Equals(const SetSessionOptionsRequest& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, + SetSessionOptionsRequest* out); +}; + +/// \brief The result of setting a session option. +enum class SetSessionOptionErrorValue : int8_t { + /// \brief The status of setting the option is unknown. + /// + /// Servers should avoid using this value (send a NOT_FOUND error if the requested + /// session is not known). Clients can retry the request. + kUnspecified, + /// \brief The given session option name is invalid. + kInvalidName, + /// \brief The session option value or type is invalid. + kInvalidValue, + /// \brief The session option cannot be set. + kError +}; +std::string ToString(const SetSessionOptionErrorValue& error_value); +std::ostream& operator<<(std::ostream& os, const SetSessionOptionErrorValue& error_value); + +/// \brief The result(s) of setting session option(s). +struct ARROW_FLIGHT_EXPORT SetSessionOptionsResult + : public internal::BaseType { + struct Error { + SetSessionOptionErrorValue value; + + bool Equals(const Error& other) const { return value == other.value; } + friend bool operator==(const Error& left, const Error& right) { + return left.Equals(right); + } + friend bool operator!=(const Error& left, const Error& right) { + return !(left == right); + } + }; + + std::map errors; + + SetSessionOptionsResult() = default; + SetSessionOptionsResult(std::map errors) // NOLINT runtime/explicit + : errors(std::move(errors)) {} + + std::string ToString() const; + bool Equals(const SetSessionOptionsResult& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, + SetSessionOptionsResult* out); +}; + +/// \brief A request to get current session options. +struct ARROW_FLIGHT_EXPORT GetSessionOptionsRequest + : public internal::BaseType { + GetSessionOptionsRequest() = default; + + std::string ToString() const; + bool Equals(const GetSessionOptionsRequest& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, + GetSessionOptionsRequest* out); +}; + +/// \brief The current session options. +struct ARROW_FLIGHT_EXPORT GetSessionOptionsResult + : public internal::BaseType { + std::map session_options; + + GetSessionOptionsResult() = default; + GetSessionOptionsResult( // NOLINT runtime/explicit + std::map session_options) + : session_options(std::move(session_options)) {} + + std::string ToString() const; + bool Equals(const GetSessionOptionsResult& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, + GetSessionOptionsResult* out); +}; + +/// \brief A request to close the open client session. +struct ARROW_FLIGHT_EXPORT CloseSessionRequest + : public internal::BaseType { + CloseSessionRequest() = default; + + std::string ToString() const; + bool Equals(const CloseSessionRequest& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, CloseSessionRequest* out); +}; + +/// \brief The result of closing a session. +enum class CloseSessionStatus : int8_t { + // \brief The session close status is unknown. + // + // Servers should avoid using this value (send a NOT_FOUND error if the requested + // session is not known). Clients can retry the request. + kUnspecified, + // \brief The session close request is complete. + // + // Subsequent requests with the same session produce a NOT_FOUND error. + kClosed, + // \brief The session close request is in progress. + // + // The client may retry the request. + kClosing, + // \brief The session is not closeable. + // + // The client should not retry the request. + kNotClosable +}; +std::string ToString(const CloseSessionStatus& status); +std::ostream& operator<<(std::ostream& os, const CloseSessionStatus& status); + +/// \brief The result of attempting to close the client session. +struct ARROW_FLIGHT_EXPORT CloseSessionResult + : public internal::BaseType { + CloseSessionStatus status; + + CloseSessionResult() = default; + CloseSessionResult(CloseSessionStatus status) // NOLINT runtime/explicit + : status(status) {} + + std::string ToString() const; + bool Equals(const CloseSessionResult& other) const; + + using SuperT::Deserialize; + using SuperT::SerializeToString; + + /// \brief Serialize this message to its wire-format representation. + /// + /// Use `SerializeToString()` if you want a Result-returning version. + arrow::Status SerializeToString(std::string* out) const; + + /// \brief Deserialize this message from its wire-format representation. + /// + /// Use `Deserialize(serialized)` if you want a Result-returning version. + static arrow::Status Deserialize(std::string_view serialized, CloseSessionResult* out); +}; + +//------------------------------------------------------------ + +/// \brief An iterator to FlightInfo instances returned by ListFlights. +class ARROW_FLIGHT_EXPORT FlightListing { + public: + virtual ~FlightListing() = default; + + /// \brief Retrieve the next FlightInfo from the iterator. + /// \return Arrow result with a single FlightInfo. Set to \a nullptr if there + /// are none left. + virtual arrow::Result> Next() = 0; +}; + +/// \brief An iterator to Result instances returned by DoAction. +class ARROW_FLIGHT_EXPORT ResultStream { + public: + virtual ~ResultStream() = default; + + /// \brief Retrieve the next Result from the iterator. + /// \return Arrow result with a single Result. Set to \a nullptr if there are none left. + virtual arrow::Result> Next() = 0; + + /// \brief Read and drop the remaining messages to get the error (if any) from a server. + /// \return Status OK if this is no error from a server, any other status if a + /// server returns an error. + Status Drain(); +}; + +/// \brief A holder for a RecordBatch with associated Flight metadata. +struct ARROW_FLIGHT_EXPORT FlightStreamChunk { + public: + FlightStreamChunk() noexcept; + ~FlightStreamChunk(); + + std::shared_ptr data; + std::shared_ptr app_metadata; +}; + +/// \brief An interface to read Flight data with metadata. +class ARROW_FLIGHT_EXPORT MetadataRecordBatchReader { + public: + virtual ~MetadataRecordBatchReader() = default; + + /// \brief Get the schema for this stream. + virtual arrow::Result> GetSchema() = 0; + + /// \brief Get the next message from Flight. If the stream is + /// finished, then the members of \a FlightStreamChunk will be + /// nullptr. + virtual arrow::Result Next() = 0; + + /// \brief Consume entire stream as a vector of record batches + virtual arrow::Result>> ToRecordBatches(); + + /// \brief Consume entire stream as a Table + virtual arrow::Result> ToTable(); + + /// \brief Return current read statistics + virtual arrow::ipc::ReadStats stats() const = 0; +}; + +/// \brief Convert a MetadataRecordBatchReader to a regular RecordBatchReader. +ARROW_FLIGHT_EXPORT +arrow::Result> MakeRecordBatchReader( + std::shared_ptr reader); + +/// \brief An interface to write IPC payloads with metadata. +class ARROW_FLIGHT_EXPORT MetadataRecordBatchWriter : public ipc::RecordBatchWriter { + public: + virtual ~MetadataRecordBatchWriter() = default; + /// \brief Begin writing data with the given schema. Only used with \a DoExchange. + virtual Status Begin(const std::shared_ptr& schema, + const ipc::IpcWriteOptions& options) = 0; + virtual Status Begin(const std::shared_ptr& schema); + virtual Status WriteMetadata(std::shared_ptr app_metadata) = 0; + virtual Status WriteWithMetadata(const RecordBatch& batch, + std::shared_ptr app_metadata) = 0; +}; + +/// \brief A FlightListing implementation based on a vector of +/// FlightInfo objects. +/// +/// This can be iterated once, then it is consumed. +class ARROW_FLIGHT_EXPORT SimpleFlightListing : public FlightListing { + public: + explicit SimpleFlightListing(const std::vector& flights); + explicit SimpleFlightListing(std::vector&& flights); + + arrow::Result> Next() override; + + private: + int position_; + std::vector flights_; +}; + +/// \brief A ResultStream implementation based on a vector of +/// Result objects. +/// +/// This can be iterated once, then it is consumed. +class ARROW_FLIGHT_EXPORT SimpleResultStream : public ResultStream { + public: + explicit SimpleResultStream(std::vector&& results); + arrow::Result> Next() override; + + private: + std::vector results_; + size_t position_; +}; + +/// \defgroup flight-error Error Handling +/// Types for handling errors from RPCs. Flight uses a set of status +/// codes standardized across Flight implementations, so these types +/// let applications work directly with those codes instead of having +/// to translate to and from Arrow Status. +/// @{ + +/// \brief Abstract status code for an RPC as per the Flight +/// specification. +enum class TransportStatusCode { + /// \brief No error. + kOk = 0, + /// \brief An unknown error occurred. + kUnknown = 1, + /// \brief An error occurred in the transport implementation, or an + /// error internal to the service implementation occurred. + kInternal = 2, + /// \brief An argument is invalid. + kInvalidArgument = 3, + /// \brief The request timed out. + kTimedOut = 4, + /// \brief An argument is not necessarily invalid, but references + /// some resource that does not exist. Prefer over + /// kInvalidArgument where applicable. + kNotFound = 5, + /// \brief The request attempted to create some resource that does + /// not exist. + kAlreadyExists = 6, + /// \brief The request was explicitly cancelled. + kCancelled = 7, + /// \brief The client is not authenticated. + kUnauthenticated = 8, + /// \brief The client is not authorized to perform this request. + kUnauthorized = 9, + /// \brief The request is not implemented + kUnimplemented = 10, + /// \brief There is a network connectivity error, or some resource + /// is otherwise unavailable. Most likely a temporary condition. + kUnavailable = 11, +}; + +/// \brief Convert a code to a string. +std::string ToString(TransportStatusCode code); + +/// \brief An error from an RPC call, using Flight error codes directly +/// instead of trying to translate to Arrow Status. +/// +/// Currently, only attached to the Status passed to AsyncListener::OnFinish. +class ARROW_FLIGHT_EXPORT TransportStatusDetail : public StatusDetail { + public: + constexpr static const char* kTypeId = "flight::TransportStatusDetail"; + explicit TransportStatusDetail(TransportStatusCode code, std::string message, + std::vector> details) + : code_(code), message_(std::move(message)), details_(std::move(details)) {} + const char* type_id() const override { return kTypeId; } + std::string ToString() const override; + + static std::optional> Unwrap( + const Status& status); + + TransportStatusCode code() const { return code_; } + std::string_view message() const { return message_; } + const std::vector>& details() const { + return details_; + } + + private: + TransportStatusCode code_; + std::string message_; + std::vector> details_; +}; + +/// @} + +} // namespace flight +} // namespace arrow diff --git a/shared/package-files/07/0703b0ae20b9ff75087dc601640ee58f1c2ad6768858ea21a245151da9ba8e4c/blob b/shared/package-files/07/0703b0ae20b9ff75087dc601640ee58f1c2ad6768858ea21a245151da9ba8e4c/blob new file mode 100644 index 0000000000000000000000000000000000000000..872c5a82052e23a802235d1d4c2e3702c71d11c4 Binary files /dev/null and b/shared/package-files/07/0703b0ae20b9ff75087dc601640ee58f1c2ad6768858ea21a245151da9ba8e4c/blob differ diff --git a/shared/package-files/07/07078ebfce57019861c83bcc1b12e5f5e271741a0bd785864f1d40ada178909b/blob b/shared/package-files/07/07078ebfce57019861c83bcc1b12e5f5e271741a0bd785864f1d40ada178909b/blob new file mode 100644 index 0000000000000000000000000000000000000000..7146b858558df2970d88fcf68de6b6a091e74d64 --- /dev/null +++ b/shared/package-files/07/07078ebfce57019861c83bcc1b12e5f5e271741a0bd785864f1d40ada178909b/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API ccol_indices_copy { + using schema = at::Tensor (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::ccol_indices_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "ccol_indices_copy(Tensor self) -> Tensor") + static at::Tensor call(const at::Tensor & self); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self); +}; + +struct TORCH_API ccol_indices_copy_out { + using schema = at::Tensor & (const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::ccol_indices_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "ccol_indices_copy.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/07/07082b03625a61a6621d169fb21a19047898481b24250306fcad85da36d6dbec/blob b/shared/package-files/07/07082b03625a61a6621d169fb21a19047898481b24250306fcad85da36d6dbec/blob new file mode 100644 index 0000000000000000000000000000000000000000..e07ecd370f45b3af0fe67f9a0ac6ea1cee16db3f --- /dev/null +++ b/shared/package-files/07/07082b03625a61a6621d169fb21a19047898481b24250306fcad85da36d6dbec/blob @@ -0,0 +1,29 @@ +import os +import sys + + +# This module must be importable without loading the binding, to avoid +# bootstrapping issues in setup.py. + +def get_library_name(): + """ + Return the name of the llvmlite shared library file. + """ + if os.name == 'posix': + if sys.platform == 'darwin': + return 'libllvmlite.dylib' + else: + return 'libllvmlite.so' + else: + assert os.name == 'nt' + return 'llvmlite.dll' + + +def get_library_files(): + """ + Return the names of shared library files needed for this platform. + """ + files = [get_library_name()] + if os.name == 'nt': + files.extend(['msvcr120.dll', 'msvcp120.dll']) + return files diff --git a/shared/package-files/07/0709bb94c2e29df33ccbc870837ee7bef73ee0d8df96d27bbefd241e7398a3c5/mces_utils.py b/shared/package-files/07/0709bb94c2e29df33ccbc870837ee7bef73ee0d8df96d27bbefd241e7398a3c5/mces_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..8172a053209cd0de071ccab894ca447df1e08614 --- /dev/null +++ b/shared/package-files/07/0709bb94c2e29df33ccbc870837ee7bef73ee0d8df96d27bbefd241e7398a3c5/mces_utils.py @@ -0,0 +1,203 @@ +from typing import Any, Dict, List, Optional, Sequence, Tuple + +import numpy as np + + +_WORKER_MCES_FUNC = None +_WORKER_MCES_SOLVER = None + + +def first_ranked_smiles(entry: Dict[str, Any]) -> Optional[str]: + for key in ("top_1_smiles", "top1_smiles"): + value = entry.get(key) + if isinstance(value, str) and value: + return value + + for key in ("ranked_smiles", "top_smiles"): + value = entry.get(key) + if isinstance(value, (list, tuple)) and value: + first = value[0] + return first if isinstance(first, str) and first else None + return None + + +def load_mces_solver(): + try: + import pulp + from myopic_mces import MCES + except ModuleNotFoundError as exc: + raise RuntimeError( + "MCES requires optional dependencies 'pulp' and 'myopic_mces'. " + "Install them before computing MCES metrics." + ) from exc + + solvers = pulp.listSolvers(onlyAvailable=True) + if len(solvers) == 0: + raise RuntimeError("MCES requires an available pulp solver, but none were found.") + return MCES, solvers[0] + + +def canonical_no_stereo_smiles(smiles: str) -> Optional[str]: + from rdkit import Chem + from ms_pred.common import chem_utils + + mol = Chem.MolFromSmiles(smiles) + if mol is None: + return None + inchi = Chem.MolToInchi(mol) + mol = chem_utils.canonical_mol_from_inchi(inchi) + if mol is None: + return None + Chem.RemoveStereochemistry(mol) + return Chem.MolToSmiles(mol) + + +def compute_mces( + true_smiles: str, + pred_smiles: str, + *, + mces_func=None, + solver=None, + threshold: int = 15, + time_limit: int = 600, +) -> float: + from rdkit import Chem + + true_smi = canonical_no_stereo_smiles(true_smiles) + pred_smi = canonical_no_stereo_smiles(pred_smiles) + if true_smi is None: + raise ValueError(f"Invalid true SMILES for MCES: {true_smiles}") + + true_mol = Chem.MolFromSmiles(true_smi) + true_num_bonds = true_mol.GetNumBonds() + pred_mol = Chem.MolFromSmiles(pred_smi) if pred_smi is not None else None + if pred_smi is None or pred_mol is None: + return float(2 * true_num_bonds) + + if mces_func is None or solver is None: + mces_func, solver = load_mces_solver() + + try: + result = mces_func( + true_smi, + pred_smi, + solver=solver, + threshold=threshold, + always_stronger_bound=True, + solver_options=dict(msg=0, timeLimit=time_limit), + ) + if isinstance(result, (list, tuple)): + result = result[1] + return float(result) + except Exception: + return float(true_num_bonds + pred_mol.GetNumBonds()) + + +def _compute_mces_pair(task: Tuple[Tuple[str, str], int, int]) -> float: + global _WORKER_MCES_FUNC, _WORKER_MCES_SOLVER + if _WORKER_MCES_FUNC is None or _WORKER_MCES_SOLVER is None: + _WORKER_MCES_FUNC, _WORKER_MCES_SOLVER = load_mces_solver() + pair, threshold, time_limit = task + return compute_mces( + pair[0], + pair[1], + mces_func=_WORKER_MCES_FUNC, + solver=_WORKER_MCES_SOLVER, + threshold=threshold, + time_limit=time_limit, + ) + + +def top1_mces_pairs_from_individuals( + individuals: Sequence[Dict[str, Any]], + *, + force: bool = False, +) -> Tuple[List[Tuple[int, str, str]], int, int]: + pairs = [] + missing = 0 + existing = 0 + for entry_idx, entry in enumerate(individuals): + if not force and entry.get("top_1_mces") is not None: + existing += 1 + continue + + true_smiles = ( + entry.get("true_smiles") + or entry.get("smiles") + or entry.get("query_smiles") + ) + pred_smiles = first_ranked_smiles(entry) + if not true_smiles or not pred_smiles: + missing += 1 + continue + pairs.append((entry_idx, str(true_smiles), str(pred_smiles))) + return pairs, missing, existing + + +def compute_top1_mces_for_individuals( + individuals: Sequence[Dict[str, Any]], + *, + mces_func=None, + solver=None, + num_workers: int = 1, + threshold: int = 15, + time_limit: int = 600, + force: bool = False, +) -> Dict[str, Any]: + if num_workers < 1: + raise ValueError("num_workers must be positive.") + if num_workers > 1 and (mces_func is not None or solver is not None): + raise ValueError("Custom MCES functions are only supported with num_workers=1.") + + pairs, missing, existing = top1_mces_pairs_from_individuals( + individuals, + force=force, + ) + + if not pairs: + values = [] + elif num_workers == 1: + if mces_func is None or solver is None: + mces_func, solver = load_mces_solver() + values = [ + compute_mces( + true_smiles, + pred_smiles, + mces_func=mces_func, + solver=solver, + threshold=threshold, + time_limit=time_limit, + ) + for _, true_smiles, pred_smiles in pairs + ] + else: + unique_pairs = list( + dict.fromkeys((true_smi, pred_smi) for _, true_smi, pred_smi in pairs) + ) + from joblib import Parallel, delayed + + unique_values = Parallel(n_jobs=num_workers)( + delayed(_compute_mces_pair)((pair, threshold, time_limit)) + for pair in unique_pairs + ) + value_map = dict(zip(unique_pairs, unique_values)) + values = [value_map[(true_smi, pred_smi)] for _, true_smi, pred_smi in pairs] + + for (entry_idx, _, _), value in zip(pairs, values): + individuals[entry_idx]["top_1_mces"] = float(value) + + samples = [ + float(entry["top_1_mces"]) + for entry in individuals + if entry.get("top_1_mces") is not None + ] + mean = float(np.mean(samples)) if samples else float("nan") + median = float(np.median(samples)) if samples else float("nan") + return { + "computed": len(values), + "existing": existing, + "missing": missing, + "n": len(samples), + "mean": mean, + "median": median, + } diff --git a/shared/package-files/07/070b788db511a6bbd5c3e5d7c4b97acef54977179bb07a61663c6e617a2e4f66/blob b/shared/package-files/07/070b788db511a6bbd5c3e5d7c4b97acef54977179bb07a61663c6e617a2e4f66/blob new file mode 100644 index 0000000000000000000000000000000000000000..ea49324ff4cdd0d4de4f1dc45ec213ef0f4508a9 --- /dev/null +++ b/shared/package-files/07/070b788db511a6bbd5c3e5d7c4b97acef54977179bb07a61663c6e617a2e4f66/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:070b788db511a6bbd5c3e5d7c4b97acef54977179bb07a61663c6e617a2e4f66 +size 178176 diff --git a/shared/package-files/07/071185fac47a2bea52939275e00ce3607bf3db61eb1d69ffadf68a412d80227d/blob b/shared/package-files/07/071185fac47a2bea52939275e00ce3607bf3db61eb1d69ffadf68a412d80227d/blob new file mode 100644 index 0000000000000000000000000000000000000000..ef9808405fa4e5667cd9ae4f8172091931c90a6e --- /dev/null +++ b/shared/package-files/07/071185fac47a2bea52939275e00ce3607bf3db61eb1d69ffadf68a412d80227d/blob @@ -0,0 +1,444 @@ +# -*- coding: utf-8 -*- + +import inspect +import warnings +from contextlib import contextmanager + +from numba.core import config, targetconfig +from numba.core.decorators import jit +from numba.core.descriptors import TargetDescriptor +from numba.core.extending import is_jitted +from numba.core.errors import NumbaDeprecationWarning +from numba.core.options import TargetOptions, include_default_options +from numba.core.registry import cpu_target +from numba.core.target_extension import dispatcher_registry, target_registry +from numba.core import utils, types, serialize, compiler, sigutils +from numba.np.numpy_support import as_dtype +from numba.np.ufunc import _internal +from numba.np.ufunc.sigparse import parse_signature +from numba.np.ufunc.wrappers import build_ufunc_wrapper, build_gufunc_wrapper +from numba.core.caching import FunctionCache, NullCache +from numba.core.compiler_lock import global_compiler_lock + + +_options_mixin = include_default_options( + "nopython", + "forceobj", + "boundscheck", + "fastmath", + "writable_args" +) + + +class UFuncTargetOptions(_options_mixin, TargetOptions): + + def finalize(self, flags, options): + if not flags.is_set("enable_pyobject"): + flags.enable_pyobject = True + + if not flags.is_set("enable_looplift"): + flags.enable_looplift = True + + flags.inherit_if_not_set("nrt", default=True) + + if not flags.is_set("debuginfo"): + flags.debuginfo = config.DEBUGINFO_DEFAULT + + if not flags.is_set("boundscheck"): + flags.boundscheck = flags.debuginfo + + flags.enable_pyobject_looplift = True + + flags.inherit_if_not_set("fastmath") + + +class UFuncTarget(TargetDescriptor): + options = UFuncTargetOptions + + def __init__(self): + super().__init__('ufunc') + + @property + def typing_context(self): + return cpu_target.typing_context + + @property + def target_context(self): + return cpu_target.target_context + + +ufunc_target = UFuncTarget() + + +class UFuncDispatcher(serialize.ReduceMixin): + """ + An object handling compilation of various signatures for a ufunc. + """ + targetdescr = ufunc_target + + def __init__(self, py_func, locals=None, targetoptions=None): + if locals is None: + locals = {} + if targetoptions is None: + targetoptions = {} + self.py_func = py_func + self.overloads = utils.UniqueDict() + self.targetoptions = targetoptions + self.locals = locals + self.cache = NullCache() + + def _reduce_states(self): + """ + NOTE: part of ReduceMixin protocol + """ + return dict( + pyfunc=self.py_func, + locals=self.locals, + targetoptions=self.targetoptions, + ) + + @classmethod + def _rebuild(cls, pyfunc, locals, targetoptions): + """ + NOTE: part of ReduceMixin protocol + """ + return cls(py_func=pyfunc, locals=locals, targetoptions=targetoptions) + + def enable_caching(self): + self.cache = FunctionCache(self.py_func) + + def compile(self, sig, locals=None, **targetoptions): + if locals is None: + locals = {} + locs = self.locals.copy() + locs.update(locals) + + topt = self.targetoptions.copy() + topt.update(targetoptions) + + flags = compiler.Flags() + self.targetdescr.options.parse_as_flags(flags, topt) + + flags.no_cpython_wrapper = True + flags.error_model = "numpy" + # Disable loop lifting + # The feature requires a real + # python function + flags.enable_looplift = False + + return self._compile_core(sig, flags, locals) + + def _compile_core(self, sig, flags, locals): + """ + Trigger the compiler on the core function or load a previously + compiled version from the cache. Returns the CompileResult. + """ + typingctx = self.targetdescr.typing_context + targetctx = self.targetdescr.target_context + + @contextmanager + def store_overloads_on_success(): + # use to ensure overloads are stored on success + try: + yield + except Exception: + raise + else: + exists = self.overloads.get(cres.signature) + if exists is None: + self.overloads[cres.signature] = cres + + # Use cache and compiler in a critical section + with global_compiler_lock: + with targetconfig.ConfigStack().enter(flags.copy()): + with store_overloads_on_success(): + # attempt look up of existing + cres = self.cache.load_overload(sig, targetctx) + if cres is not None: + return cres + + # Compile + args, return_type = sigutils.normalize_signature(sig) + cres = compiler.compile_extra(typingctx, targetctx, + self.py_func, args=args, + return_type=return_type, + flags=flags, locals=locals) + + # cache lookup failed before so safe to save + self.cache.save_overload(sig, cres) + + return cres + + +dispatcher_registry[target_registry['npyufunc']] = UFuncDispatcher + + +# Utility functions + +def _compile_element_wise_function(nb_func, targetoptions, sig): + # Do compilation + # Return CompileResult to test + cres = nb_func.compile(sig, **targetoptions) + args, return_type = sigutils.normalize_signature(sig) + return cres, args, return_type + + +def _finalize_ufunc_signature(cres, args, return_type): + '''Given a compilation result, argument types, and a return type, + build a valid Numba signature after validating that it doesn't + violate the constraints for the compilation mode. + ''' + if return_type is None: + if cres.objectmode: + # Object mode is used and return type is not specified + raise TypeError("return type must be specified for object mode") + else: + return_type = cres.signature.return_type + + assert return_type != types.pyobject + return return_type(*args) + + +def _build_element_wise_ufunc_wrapper(cres, signature): + '''Build a wrapper for the ufunc loop entry point given by the + compilation result object, using the element-wise signature. + ''' + ctx = cres.target_context + library = cres.library + fname = cres.fndesc.llvm_func_name + + with global_compiler_lock: + info = build_ufunc_wrapper(library, ctx, fname, signature, + cres.objectmode, cres) + ptr = info.library.get_pointer_to_function(info.name) + # Get dtypes + dtypenums = [as_dtype(a).num for a in signature.args] + dtypenums.append(as_dtype(signature.return_type).num) + return dtypenums, ptr, cres.environment + + +_identities = { + 0: _internal.PyUFunc_Zero, + 1: _internal.PyUFunc_One, + None: _internal.PyUFunc_None, + "reorderable": _internal.PyUFunc_ReorderableNone, +} + + +def parse_identity(identity): + """ + Parse an identity value and return the corresponding low-level value + for Numpy. + """ + try: + identity = _identities[identity] + except KeyError: + raise ValueError("Invalid identity value %r" % (identity,)) + return identity + + +@contextmanager +def _suppress_deprecation_warning_nopython_not_supplied(): + """This suppresses the NumbaDeprecationWarning that occurs through the use + of `jit` without the `nopython` kwarg. This use of `jit` occurs in a few + places in the `{g,}ufunc` mechanism in Numba, predominantly to wrap the + "kernel" function.""" + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', + category=NumbaDeprecationWarning, + message=(".*The 'nopython' keyword argument " + "was not supplied*"),) + yield + + +# Class definitions + +class _BaseUFuncBuilder(object): + + def add(self, sig=None): + if hasattr(self, 'targetoptions'): + targetoptions = self.targetoptions + else: + targetoptions = self.nb_func.targetoptions + cres, args, return_type = _compile_element_wise_function( + self.nb_func, targetoptions, sig) + sig = self._finalize_signature(cres, args, return_type) + self._sigs.append(sig) + self._cres[sig] = cres + return cres + + def disable_compile(self): + """ + Disable the compilation of new signatures at call time. + """ + # Override this for implementations that support lazy compilation + + +class UFuncBuilder(_BaseUFuncBuilder): + + def __init__(self, py_func, identity=None, cache=False, targetoptions=None): + if targetoptions is None: + targetoptions = {} + if is_jitted(py_func): + py_func = py_func.py_func + self.py_func = py_func + self.identity = parse_identity(identity) + with _suppress_deprecation_warning_nopython_not_supplied(): + self.nb_func = jit(_target='npyufunc', + cache=cache, + **targetoptions)(py_func) + self._sigs = [] + self._cres = {} + + def _finalize_signature(self, cres, args, return_type): + '''Slated for deprecation, use ufuncbuilder._finalize_ufunc_signature() + instead. + ''' + return _finalize_ufunc_signature(cres, args, return_type) + + def build_ufunc(self): + with global_compiler_lock: + dtypelist = [] + ptrlist = [] + if not self.nb_func: + raise TypeError("No definition") + + # Get signature in the order they are added + keepalive = [] + cres = None + for sig in self._sigs: + cres = self._cres[sig] + dtypenums, ptr, env = self.build(cres, sig) + dtypelist.append(dtypenums) + ptrlist.append(int(ptr)) + keepalive.append((cres.library, env)) + + datlist = [None] * len(ptrlist) + + if cres is None: + argspec = inspect.getfullargspec(self.py_func) + inct = len(argspec.args) + else: + inct = len(cres.signature.args) + outct = 1 + + # Becareful that fromfunc does not provide full error checking yet. + # If typenum is out-of-bound, we have nasty memory corruptions. + # For instance, -1 for typenum will cause segfault. + # If elements of type-list (2nd arg) is tuple instead, + # there will also memory corruption. (Seems like code rewrite.) + ufunc = _internal.fromfunc( + self.py_func.__name__, self.py_func.__doc__, + ptrlist, dtypelist, inct, outct, datlist, + keepalive, self.identity, + ) + + return ufunc + + def build(self, cres, signature): + '''Slated for deprecation, use + ufuncbuilder._build_element_wise_ufunc_wrapper(). + ''' + return _build_element_wise_ufunc_wrapper(cres, signature) + + +class GUFuncBuilder(_BaseUFuncBuilder): + + # TODO handle scalar + def __init__(self, py_func, signature, identity=None, cache=False, + targetoptions=None, writable_args=()): + if targetoptions is None: + targetoptions = {} + self.py_func = py_func + self.identity = parse_identity(identity) + with _suppress_deprecation_warning_nopython_not_supplied(): + self.nb_func = jit(_target='npyufunc', cache=cache)(py_func) + self.signature = signature + self.sin, self.sout = parse_signature(signature) + self.targetoptions = targetoptions + self.cache = cache + self._sigs = [] + self._cres = {} + + transform_arg = _get_transform_arg(py_func) + self.writable_args = tuple([transform_arg(a) for a in writable_args]) + + def _finalize_signature(self, cres, args, return_type): + if not cres.objectmode and cres.signature.return_type != types.void: + raise TypeError("gufunc kernel must have void return type") + + if return_type is None: + return_type = types.void + + return return_type(*args) + + @global_compiler_lock + def build_ufunc(self): + type_list = [] + func_list = [] + if not self.nb_func: + raise TypeError("No definition") + + # Get signature in the order they are added + keepalive = [] + for sig in self._sigs: + cres = self._cres[sig] + dtypenums, ptr, env = self.build(cres) + type_list.append(dtypenums) + func_list.append(int(ptr)) + keepalive.append((cres.library, env)) + + datalist = [None] * len(func_list) + + nin = len(self.sin) + nout = len(self.sout) + + # Pass envs to fromfuncsig to bind to the lifetime of the ufunc object + ufunc = _internal.fromfunc( + self.py_func.__name__, self.py_func.__doc__, + func_list, type_list, nin, nout, datalist, + keepalive, self.identity, self.signature, self.writable_args + ) + return ufunc + + def build(self, cres): + """ + Returns (dtype numbers, function ptr, EnvironmentObject) + """ + # Builder wrapper for ufunc entry point + signature = cres.signature + info = build_gufunc_wrapper( + self.py_func, cres, self.sin, self.sout, + cache=self.cache, is_parfors=False, + ) + + env = info.env + ptr = info.library.get_pointer_to_function(info.name) + # Get dtypes + dtypenums = [] + for a in signature.args: + if isinstance(a, types.Array): + ty = a.dtype + else: + ty = a + dtypenums.append(as_dtype(ty).num) + return dtypenums, ptr, env + + +def _get_transform_arg(py_func): + """Return function that transform arg into index""" + args = inspect.getfullargspec(py_func).args + pos_by_arg = {arg: i for i, arg in enumerate(args)} + + def transform_arg(arg): + if isinstance(arg, int): + return arg + + try: + return pos_by_arg[arg] + except KeyError: + msg = (f"Specified writable arg {arg} not found in arg list " + f"{args} for function {py_func.__qualname__}") + raise RuntimeError(msg) + + return transform_arg diff --git a/shared/package-files/07/071290fa85ac5ed0801f6267de5829e9f337a0d956a007d9ef3fcaf35cfd485c/blob b/shared/package-files/07/071290fa85ac5ed0801f6267de5829e9f337a0d956a007d9ef3fcaf35cfd485c/blob new file mode 100644 index 0000000000000000000000000000000000000000..4a863d13dbc7a7bfe138c30e36075250eab6b012 Binary files /dev/null and b/shared/package-files/07/071290fa85ac5ed0801f6267de5829e9f337a0d956a007d9ef3fcaf35cfd485c/blob differ diff --git a/shared/package-files/07/071871908dae582fb2801dc324affe157d933b172ea835075f8b5142a0fd09f5/blob b/shared/package-files/07/071871908dae582fb2801dc324affe157d933b172ea835075f8b5142a0fd09f5/blob new file mode 100644 index 0000000000000000000000000000000000000000..11a51c4700d5c1733e7136909d86d2ea7294dd8e --- /dev/null +++ b/shared/package-files/07/071871908dae582fb2801dc324affe157d933b172ea835075f8b5142a0fd09f5/blob @@ -0,0 +1,46 @@ +""" +Tests for np.foo applied to Series, not necessarily ufuncs. +""" + +import numpy as np +import pytest + +import pandas.util._test_decorators as td + +from pandas import Series +import pandas._testing as tm + + +class TestPtp: + def test_ptp(self): + # GH#21614 + N = 1000 + arr = np.random.default_rng(2).standard_normal(N) + ser = Series(arr) + assert np.ptp(ser) == np.ptp(arr) + + +def test_numpy_unique(datetime_series): + # it works! + np.unique(datetime_series) + + +@pytest.mark.parametrize("index", [["a", "b", "c", "d", "e"], None]) +def test_numpy_argwhere(index): + # GH#35331 + + s = Series(range(5), index=index, dtype=np.int64) + + result = np.argwhere(s > 2).astype(np.int64) + expected = np.array([[3], [4]], dtype=np.int64) + + tm.assert_numpy_array_equal(result, expected) + + +@td.skip_if_no("pyarrow") +def test_log_arrow_backed_missing_value(): + # GH#56285 + ser = Series([1, 2, None], dtype="float64[pyarrow]") + result = np.log(ser) + expected = np.log(Series([1, 2, None], dtype="float64")) + tm.assert_series_equal(result, expected) diff --git a/shared/package-files/07/071a670b4dab1136e35ed16b42ccebb32cc68743dee77fb426976dffa3143d75/blob b/shared/package-files/07/071a670b4dab1136e35ed16b42ccebb32cc68743dee77fb426976dffa3143d75/blob new file mode 100644 index 0000000000000000000000000000000000000000..d55b964faee29b1a7d40a7b257df5d3667a46b60 --- /dev/null +++ b/shared/package-files/07/071a670b4dab1136e35ed16b42ccebb32cc68743dee77fb426976dffa3143d75/blob @@ -0,0 +1,48 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from __future__ import annotations + +import json +from pathlib import Path + +OK_MARK = "✅" +REPORT_TITLE = "\nENVIRONMENT HEALTH REPORT\n" +DETAILED_REPORT_TITLE = "\nDETAILED ENVIRONMENT HEALTH REPORT\n" +MISSING_FILES_SUCCESS_MESSAGE = f"{OK_MARK} There are no packages with missing files.\n" + + +def display_report_heading(prefix: str) -> None: + """Displays our report heading.""" + print("-" * 20) + print(REPORT_TITLE) + print(f"Environment Name: {Path(prefix).name}\n") + + +def find_packages_with_missing_files(prefix: str | Path) -> dict[str, list[str]]: + """Finds packages listed in conda-meta which have missing files.""" + packages_with_missing_files = {} + prefix = Path(prefix) + for file in (prefix / "conda-meta").glob("*.json"): + for file_name in json.loads(file.read_text()).get("files", []): + # Add warnings if json file has missing "files" + if not (prefix / file_name).exists(): + packages_with_missing_files.setdefault(file.stem, []).append(file_name) + return packages_with_missing_files + + +def display_health_checks(prefix: str, verbose: bool) -> None: + """Prints health report.""" + display_report_heading(prefix) + missing_files = find_packages_with_missing_files(prefix) + if missing_files: + print("Missing Files\n") + for file, files in missing_files.items(): + if verbose: + delimiter = "\n " + print(f"{file}:{delimiter}{delimiter.join(files)}\n") + else: + print(f"{file}: {len(files)}") + + print("\n") + else: + print(MISSING_FILES_SUCCESS_MESSAGE) diff --git a/shared/package-files/07/0721ea62acb528ed5177e0a0f9eca71d0127178cbb39a30621e3b8e2497c409c/blob b/shared/package-files/07/0721ea62acb528ed5177e0a0f9eca71d0127178cbb39a30621e3b8e2497c409c/blob new file mode 100644 index 0000000000000000000000000000000000000000..c59d5078d46b4a7061c02aa3c82e0cbb09fb4e89 --- /dev/null +++ b/shared/package-files/07/0721ea62acb528ed5177e0a0f9eca71d0127178cbb39a30621e3b8e2497c409c/blob @@ -0,0 +1,26 @@ +from typing import Any, Dict + +import torch +from torchvision.transforms.v2 import functional as F, Transform + + +class UniformTemporalSubsample(Transform): + """Uniformly subsample ``num_samples`` indices from the temporal dimension of the video. + + Videos are expected to be of shape ``[..., T, C, H, W]`` where ``T`` denotes the temporal dimension. + + When ``num_samples`` is larger than the size of temporal dimension of the video, it + will sample frames based on nearest neighbor interpolation. + + Args: + num_samples (int): The number of equispaced samples to be selected + """ + + _transformed_types = (torch.Tensor,) + + def __init__(self, num_samples: int): + super().__init__() + self.num_samples = num_samples + + def _transform(self, inpt: Any, params: Dict[str, Any]) -> Any: + return self._call_kernel(F.uniform_temporal_subsample, inpt, self.num_samples) diff --git a/shared/package-files/07/0724f3a7c6c6fd1371e4990e517cf983dc19a58d6d2935901ea4172c0486b32d/blob b/shared/package-files/07/0724f3a7c6c6fd1371e4990e517cf983dc19a58d6d2935901ea4172c0486b32d/blob new file mode 100644 index 0000000000000000000000000000000000000000..48875e40a68d111042e21d086cf895b24b6e0474 --- /dev/null +++ b/shared/package-files/07/0724f3a7c6c6fd1371e4990e517cf983dc19a58d6d2935901ea4172c0486b32d/blob @@ -0,0 +1,237 @@ +import functools +from collections import namedtuple + +from typing import Callable, Iterator, Sized, TypeVar, Optional, Union, Any, Dict, List + +from torch.utils.data.datapipes._decorator import functional_datapipe +from torch.utils.data._utils.collate import default_collate +from torch.utils.data.datapipes.dataframe import dataframe_wrapper as df_wrapper +from torch.utils.data.datapipes.datapipe import IterDataPipe +from torch.utils.data.datapipes.utils.common import (_check_unpickable_fn, + validate_input_col) + +__all__ = [ + "CollatorIterDataPipe", + "MapperIterDataPipe", +] + +T_co = TypeVar("T_co", covariant=True) + + +@functional_datapipe("map") +class MapperIterDataPipe(IterDataPipe[T_co]): + r""" + Applies a function over each item from the source DataPipe (functional name: ``map``). + + The function can be any regular Python function or partial object. Lambda + function is not recommended as it is not supported by pickle. + + Args: + datapipe: Source Iterable DataPipe + fn: Function being applied over each item + input_col: Index or indices of data which ``fn`` is applied, such as: + + - ``None`` as default to apply ``fn`` to the data directly. + - Integer(s) is used for list/tuple. + - Key(s) is used for dict. + + output_col: Index of data where result of ``fn`` is placed. ``output_col`` can be specified + only when ``input_col`` is not ``None`` + + - ``None`` as default to replace the index that ``input_col`` specified; For ``input_col`` with + multiple indices, the left-most one is used, and other indices will be removed. + - Integer is used for list/tuple. ``-1`` represents to append result at the end. + - Key is used for dict. New key is acceptable. + + Example: + >>> # xdoctest: +SKIP + >>> from torchdata.datapipes.iter import IterableWrapper, Mapper + >>> def add_one(x): + ... return x + 1 + >>> dp = IterableWrapper(range(10)) + >>> map_dp_1 = dp.map(add_one) # Invocation via functional form is preferred + >>> list(map_dp_1) + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + >>> # We discourage the usage of `lambda` functions as they are not serializable with `pickle` + >>> # Use `functools.partial` or explicitly define the function instead + >>> map_dp_2 = Mapper(dp, lambda x: x + 1) + >>> list(map_dp_2) + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + """ + + datapipe: IterDataPipe + fn: Callable + + def __init__( + self, + datapipe: IterDataPipe, + fn: Callable, + input_col=None, + output_col=None, + ) -> None: + super().__init__() + self.datapipe = datapipe + + _check_unpickable_fn(fn) + self.fn = fn # type: ignore[assignment] + + self.input_col = input_col + if input_col is None and output_col is not None: + raise ValueError("`output_col` must be None when `input_col` is None.") + if isinstance(output_col, (list, tuple)): + if len(output_col) > 1: + raise ValueError("`output_col` must be a single-element list or tuple") + output_col = output_col[0] + self.output_col = output_col + validate_input_col(fn, input_col) + + def _apply_fn(self, data): + if self.input_col is None and self.output_col is None: + return self.fn(data) + + if self.input_col is None: + res = self.fn(data) + elif isinstance(self.input_col, (list, tuple)): + args = tuple(data[col] for col in self.input_col) + res = self.fn(*args) + else: + res = self.fn(data[self.input_col]) + + # Copy tuple to list and run in-place modification because tuple is immutable. + if isinstance(data, tuple): + t_flag = True + data = list(data) + else: + t_flag = False + + if self.output_col is None: + if isinstance(self.input_col, (list, tuple)): + data[self.input_col[0]] = res + for idx in sorted(self.input_col[1:], reverse=True): + del data[idx] + else: + data[self.input_col] = res + else: + if self.output_col == -1: + data.append(res) + else: + data[self.output_col] = res + + # Convert list back to tuple + return tuple(data) if t_flag else data + + def __iter__(self) -> Iterator[T_co]: + for data in self.datapipe: + yield self._apply_fn(data) + + def __len__(self) -> int: + if isinstance(self.datapipe, Sized): + return len(self.datapipe) + raise TypeError( + f"{type(self).__name__} instance doesn't have valid length" + ) + + +def _collate_helper(conversion, item): + # TODO(VitalyFedyunin): Verify that item is any sort of batch + if len(item.items) > 1: + # TODO(VitalyFedyunin): Compact all batch dataframes into one + raise Exception("Only supports one DataFrame per batch") + df = item[0] + columns_name = df_wrapper.get_columns(df) + tuple_names: List = [] + tuple_values: List = [] + + for name in conversion.keys(): + if name not in columns_name: + raise Exception("Conversion keys missmatch") + + for name in columns_name: + if name in conversion: + if not callable(conversion[name]): + raise Exception('Collate (DF)DataPipe requires callable as dict values') + collation_fn = conversion[name] + else: + # TODO(VitalyFedyunin): Add default collation into df_wrapper + try: + import torcharrow.pytorch as tap # type: ignore[import] + collation_fn = tap.rec.Default() + except Exception as e: + raise Exception("unable to import default collation function from the TorchArrow") from e + + tuple_names.append(str(name)) + value = collation_fn(df[name]) + tuple_values.append(value) + + # TODO(VitalyFedyunin): We can dynamically extract types from the tuple_values here + # TODO(VitalyFedyunin): Instead of ignoring mypy error, make sure tuple_names is not empty + tpl_cls = namedtuple("CollateResult", tuple_names) # type: ignore[misc] + tuple = tpl_cls(*tuple_values) + return tuple + + +@functional_datapipe("collate") +class CollatorIterDataPipe(MapperIterDataPipe): + r""" + Collates samples from DataPipe to Tensor(s) by a custom collate function (functional name: ``collate``). + + By default, it uses :func:`torch.utils.data.default_collate`. + + .. note:: + While writing a custom collate function, you can import :func:`torch.utils.data.default_collate` for the + default behavior and `functools.partial` to specify any additional arguments. + + Args: + datapipe: Iterable DataPipe being collated + collate_fn: Customized collate function to collect and combine data or a batch of data. + Default function collates to Tensor(s) based on data type. + + Example: + >>> # xdoctest: +SKIP + >>> # Convert integer data to float Tensor + >>> class MyIterDataPipe(torch.utils.data.IterDataPipe): + ... def __init__(self, start, end): + ... super(MyIterDataPipe).__init__() + ... assert end > start, "this example code only works with end >= start" + ... self.start = start + ... self.end = end + ... + ... def __iter__(self): + ... return iter(range(self.start, self.end)) + ... + ... def __len__(self): + ... return self.end - self.start + ... + >>> ds = MyIterDataPipe(start=3, end=7) + >>> print(list(ds)) + [3, 4, 5, 6] + >>> def collate_fn(batch): + ... return torch.tensor(batch, dtype=torch.float) + ... + >>> collated_ds = CollateIterDataPipe(ds, collate_fn=collate_fn) + >>> print(list(collated_ds)) + [tensor(3.), tensor(4.), tensor(5.), tensor(6.)] + """ + + def __init__( + self, + datapipe: IterDataPipe, + conversion: Optional[ + Union[ + Callable[..., Any], + Dict[Union[str, Any], Union[Callable, Any]], + ] + ] = default_collate, + collate_fn: Optional[Callable] = None, + ) -> None: + # TODO(VitalyFedyunin): Replace `Callable[..., Any]` with `Callable[[IColumn], Any]` + # TODO(VitalyFedyunin): Replace with `Dict[Union[str, IColumn], Union[Callable, Enum]]` + if collate_fn is not None: + super().__init__(datapipe, fn=collate_fn) + else: + if callable(conversion): + super().__init__(datapipe, fn=conversion) + else: + # TODO(VitalyFedyunin): Validate passed dictionary + collate_fn = functools.partial(_collate_helper, conversion) + super().__init__(datapipe, fn=collate_fn) diff --git a/shared/package-files/07/0726e8aeda2a73669fb680d423d24e5ba077780f119ad3673c8f08b30081c3fc/blob b/shared/package-files/07/0726e8aeda2a73669fb680d423d24e5ba077780f119ad3673c8f08b30081c3fc/blob new file mode 100644 index 0000000000000000000000000000000000000000..93dd162423a4a55b36e6dbaaf48391c71fdfd7f5 --- /dev/null +++ b/shared/package-files/07/0726e8aeda2a73669fb680d423d24e5ba077780f119ad3673c8f08b30081c3fc/blob @@ -0,0 +1,31 @@ +from typing import Any + +from django.db.backends.base.base import BaseDatabaseWrapper +from django.db.backends.base.client import BaseDatabaseClient +from django.db.backends.base.creation import BaseDatabaseCreation +from django.db.backends.base.introspection import BaseDatabaseIntrospection +from django.db.backends.base.operations import BaseDatabaseOperations + +def complain(*args: Any, **kwargs: Any) -> Any: ... +def ignore(*args: Any, **kwargs: Any) -> None: ... + +class DatabaseOperations(BaseDatabaseOperations): + quote_name: Any = ... + +class DatabaseClient(BaseDatabaseClient): + runshell: Any = ... + +class DatabaseCreation(BaseDatabaseCreation): + create_test_db: Any = ... + destroy_test_db: Any = ... + +class DatabaseIntrospection(BaseDatabaseIntrospection): + get_table_list: Any = ... + get_table_description: Any = ... + get_relations: Any = ... + get_indexes: Any = ... + get_key_columns: Any = ... + +class DatabaseWrapper(BaseDatabaseWrapper): + operators: Any = ... + ensure_connection: Any = ... diff --git a/shared/package-files/07/0727a5cf97f38ed4f5b465b8c39450f4312d0eee0b76ecd3740c9736fd271f1d/blob b/shared/package-files/07/0727a5cf97f38ed4f5b465b8c39450f4312d0eee0b76ecd3740c9736fd271f1d/blob new file mode 100644 index 0000000000000000000000000000000000000000..66a1ef2ac11aae2f5f2a2b1aaaf0db46d6958ea4 --- /dev/null +++ b/shared/package-files/07/0727a5cf97f38ed4f5b465b8c39450f4312d0eee0b76ecd3740c9736fd271f1d/blob @@ -0,0 +1,144 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from argparse import RawDescriptionHelpFormatter +from os.path import lexists + +from conda.base.context import context, determine_target_prefix +from conda.cli import common +from conda.cli.conda_argparse import add_parser_json, add_parser_prefix +from conda.core.prefix_data import PrefixData +from conda.exceptions import EnvironmentLocationNotFound + +var_description = """ +Interact with environment variables associated with Conda environments +""" + +var_example = """ +examples: + conda env config vars list -n my_env + conda env config vars set MY_VAR=something OTHER_THING=ohhhhya + conda env config vars unset MY_VAR +""" + +list_description = """ +List environment variables for a conda environment +""" + +list_example = """ +examples: + conda env config vars list -n my_env +""" + +set_description = """ +Set environment variables for a conda environment +""" + +set_example = """ +example: + conda env config vars set MY_VAR=weee +""" + +unset_description = """ +Unset environment variables for a conda environment +""" + +unset_example = """ +example: + conda env config vars unset MY_VAR +""" + + +def configure_parser(sub_parsers): + var_parser = sub_parsers.add_parser( + "vars", + formatter_class=RawDescriptionHelpFormatter, + description=var_description, + help=var_description, + epilog=var_example, + ) + var_subparser = var_parser.add_subparsers() + + list_parser = var_subparser.add_parser( + "list", + formatter_class=RawDescriptionHelpFormatter, + description=list_description, + help=list_description, + epilog=list_example, + ) + add_parser_prefix(list_parser) + add_parser_json(list_parser) + list_parser.set_defaults(func=".main_vars.execute_list") + + set_parser = var_subparser.add_parser( + "set", + formatter_class=RawDescriptionHelpFormatter, + description=set_description, + help=set_description, + epilog=set_example, + ) + set_parser.add_argument( + "vars", + action="store", + nargs="*", + help="Environment variables to set in the form = separated by spaces", + ) + add_parser_prefix(set_parser) + set_parser.set_defaults(func=".main_vars.execute_set") + + unset_parser = var_subparser.add_parser( + "unset", + formatter_class=RawDescriptionHelpFormatter, + description=unset_description, + help=unset_description, + epilog=unset_example, + ) + unset_parser.add_argument( + "vars", + action="store", + nargs="*", + help="Environment variables to unset in the form separated by spaces", + ) + add_parser_prefix(unset_parser) + unset_parser.set_defaults(func=".main_vars.execute_unset") + + +def execute_list(args, parser): + prefix = determine_target_prefix(context, args) + if not lexists(prefix): + raise EnvironmentLocationNotFound(prefix) + + pd = PrefixData(prefix) + + env_vars = pd.get_environment_env_vars() + if args.json: + common.stdout_json(env_vars) + else: + for k, v in env_vars.items(): + print(f"{k} = {v}") + + +def execute_set(args, parser): + prefix = determine_target_prefix(context, args) + pd = PrefixData(prefix) + if not lexists(prefix): + raise EnvironmentLocationNotFound(prefix) + + env_vars_to_add = {} + for v in args.vars: + var_def = v.split("=") + env_vars_to_add[var_def[0].strip()] = "=".join(var_def[1:]).strip() + pd.set_environment_env_vars(env_vars_to_add) + if prefix == context.active_prefix: + print("To make your changes take effect please reactivate your environment") + + +def execute_unset(args, parser): + prefix = determine_target_prefix(context, args) + pd = PrefixData(prefix) + if not lexists(prefix): + raise EnvironmentLocationNotFound(prefix) + + vars_to_unset = [_.strip() for _ in args.vars] + pd.unset_environment_env_vars(vars_to_unset) + if prefix == context.active_prefix: + print("To make your changes take effect please reactivate your environment") diff --git a/shared/package-files/07/0728c3aa7413273244c2e5a683a14e258e8332f7ae0e1f64cef3f185ab1e25d4/blob b/shared/package-files/07/0728c3aa7413273244c2e5a683a14e258e8332f7ae0e1f64cef3f185ab1e25d4/blob new file mode 100644 index 0000000000000000000000000000000000000000..bf806fb6079a1472bb4fa891b9e0c052b13ef305 --- /dev/null +++ b/shared/package-files/07/0728c3aa7413273244c2e5a683a14e258e8332f7ae0e1f64cef3f185ab1e25d4/blob @@ -0,0 +1,24 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor flatten(const at::Tensor & self, int64_t start_dim=0, int64_t end_dim=-1); +TORCH_API at::Tensor flatten(const at::Tensor & self, int64_t start_dim, int64_t end_dim, at::Dimname out_dim); +TORCH_API at::Tensor flatten(const at::Tensor & self, at::Dimname start_dim, at::Dimname end_dim, at::Dimname out_dim); +TORCH_API at::Tensor flatten(const at::Tensor & self, at::DimnameList dims, at::Dimname out_dim); +} // namespace native +} // namespace at diff --git a/shared/package-files/07/072ab64323d14932ff67ec5e5092a58dddda9f30e7cbc08dd53129f989aa212c/blob b/shared/package-files/07/072ab64323d14932ff67ec5e5092a58dddda9f30e7cbc08dd53129f989aa212c/blob new file mode 100644 index 0000000000000000000000000000000000000000..2baf1d42a0c29fd654e927c2fe316216ffcc3138 --- /dev/null +++ b/shared/package-files/07/072ab64323d14932ff67ec5e5092a58dddda9f30e7cbc08dd53129f989aa212c/blob @@ -0,0 +1,108 @@ +from .common import SimpleIterableType, SimpleIteratorType +from ..errors import TypingError + + +class RangeType(SimpleIterableType): + + def __init__(self, dtype): + self.dtype = dtype + name = "range_state_%s" % (dtype,) + super(SimpleIterableType, self).__init__(name) + self._iterator_type = RangeIteratorType(self.dtype) + + def unify(self, typingctx, other): + if isinstance(other, RangeType): + dtype = typingctx.unify_pairs(self.dtype, other.dtype) + if dtype is not None: + return RangeType(dtype) + + +class RangeIteratorType(SimpleIteratorType): + + def __init__(self, dtype): + name = "range_iter_%s" % (dtype,) + super(SimpleIteratorType, self).__init__(name) + self._yield_type = dtype + + def unify(self, typingctx, other): + if isinstance(other, RangeIteratorType): + dtype = typingctx.unify_pairs(self.yield_type, other.yield_type) + if dtype is not None: + return RangeIteratorType(dtype) + + +class Generator(SimpleIteratorType): + """ + Type class for Numba-compiled generator objects. + """ + + def __init__(self, gen_func, yield_type, arg_types, state_types, + has_finalizer): + self.gen_func = gen_func + self.arg_types = tuple(arg_types) + self.state_types = tuple(state_types) + self.has_finalizer = has_finalizer + name = "%s generator(func=%s, args=%s, has_finalizer=%s)" % ( + yield_type, self.gen_func, self.arg_types, + self.has_finalizer) + super(Generator, self).__init__(name, yield_type) + + @property + def key(self): + return (self.gen_func, self.arg_types, self.yield_type, + self.has_finalizer, self.state_types) + + +class EnumerateType(SimpleIteratorType): + """ + Type class for `enumerate` objects. + Type instances are parametered with the underlying source type. + """ + + def __init__(self, iterable_type): + from numba.core.types import Tuple, intp + self.source_type = iterable_type.iterator_type + yield_type = Tuple([intp, self.source_type.yield_type]) + name = 'enumerate(%s)' % (self.source_type) + super(EnumerateType, self).__init__(name, yield_type) + + @property + def key(self): + return self.source_type + + +class ZipType(SimpleIteratorType): + """ + Type class for `zip` objects. + Type instances are parametered with the underlying source types. + """ + + def __init__(self, iterable_types): + from numba.core.types import Tuple + self.source_types = tuple(tp.iterator_type for tp in iterable_types) + yield_type = Tuple([tp.yield_type for tp in self.source_types]) + name = 'zip(%s)' % ', '.join(str(tp) for tp in self.source_types) + super(ZipType, self).__init__(name, yield_type) + + @property + def key(self): + return self.source_types + + +class ArrayIterator(SimpleIteratorType): + """ + Type class for iterators of array and buffer objects. + """ + + def __init__(self, array_type): + self.array_type = array_type + name = "iter(%s)" % (self.array_type,) + nd = array_type.ndim + if nd == 0: + raise TypingError("iteration over a 0-d array") + elif nd == 1: + yield_type = array_type.dtype + else: + # iteration semantics leads to A order layout + yield_type = array_type.copy(ndim=array_type.ndim - 1, layout='A') + super(ArrayIterator, self).__init__(name, yield_type) diff --git a/shared/package-files/07/072dd603cbc795cec0861a6fd8b4b3e9a1d6f006a8b00f8a12f976664d6029d8/blob b/shared/package-files/07/072dd603cbc795cec0861a6fd8b4b3e9a1d6f006a8b00f8a12f976664d6029d8/blob new file mode 100644 index 0000000000000000000000000000000000000000..23e69df900759c59343ce13cc01bd8e4f43f6134 Binary files /dev/null and b/shared/package-files/07/072dd603cbc795cec0861a6fd8b4b3e9a1d6f006a8b00f8a12f976664d6029d8/blob differ diff --git a/shared/package-files/07/07317f2e828107fb3dd3080ee831197c8c6d35f87b67cb7c5cb5bb642cec1389/blob b/shared/package-files/07/07317f2e828107fb3dd3080ee831197c8c6d35f87b67cb7c5cb5bb642cec1389/blob new file mode 100644 index 0000000000000000000000000000000000000000..247caa631ab9964c1de8b35294fe4551a9167af4 Binary files /dev/null and b/shared/package-files/07/07317f2e828107fb3dd3080ee831197c8c6d35f87b67cb7c5cb5bb642cec1389/blob differ diff --git a/shared/package-files/07/0732126df8159eb3b7bd8c7e98fdb190baa1f6bde8abae0d34f6c4634dcfeafd/blob b/shared/package-files/07/0732126df8159eb3b7bd8c7e98fdb190baa1f6bde8abae0d34f6c4634dcfeafd/blob new file mode 100644 index 0000000000000000000000000000000000000000..11254e75bd75428117587cce51361d870ceebb9b --- /dev/null +++ b/shared/package-files/07/0732126df8159eb3b7bd8c7e98fdb190baa1f6bde8abae0d34f6c4634dcfeafd/blob @@ -0,0 +1,17 @@ +# This file is not meant for public use and will be removed in SciPy v2.0.0. +# Use the `scipy.io` namespace for importing the functions +# included below. + +from scipy._lib.deprecation import _sub_module_deprecation + +__all__ = ["hb_read", "hb_write"] # noqa: F822 + + +def __dir__(): + return __all__ + + +def __getattr__(name): + return _sub_module_deprecation(sub_package="io", module="harwell_boeing", + private_modules=["_harwell_boeing"], all=__all__, + attribute=name) diff --git a/shared/package-files/07/0737a80b939aafcf3d8a1bf60b63e781979c749337d02b6c216680893f9fffc5/blob b/shared/package-files/07/0737a80b939aafcf3d8a1bf60b63e781979c749337d02b6c216680893f9fffc5/blob new file mode 100644 index 0000000000000000000000000000000000000000..11d1f47cae25491b302f2a387a816c3558130444 --- /dev/null +++ b/shared/package-files/07/0737a80b939aafcf3d8a1bf60b63e781979c749337d02b6c216680893f9fffc5/blob @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 +""" turtle-example-suite: + + tdemo_yinyang.py + +Another drawing suitable as a beginner's +programming example. + +The small circles are drawn by the circle +command. + +""" + +from turtle import * + +def yin(radius, color1, color2): + width(3) + color("black", color1) + begin_fill() + circle(radius/2., 180) + circle(radius, 180) + left(180) + circle(-radius/2., 180) + end_fill() + left(90) + up() + forward(radius*0.35) + right(90) + down() + color(color1, color2) + begin_fill() + circle(radius*0.15) + end_fill() + left(90) + up() + backward(radius*0.35) + down() + left(90) + +def main(): + reset() + yin(200, "black", "white") + yin(200, "white", "black") + ht() + return "Done!" + +if __name__ == '__main__': + main() + mainloop() diff --git a/shared/package-files/07/073d64b373438175cb7d3f13314904dfc46930e4b029146dc14d5edfb635094c/blob b/shared/package-files/07/073d64b373438175cb7d3f13314904dfc46930e4b029146dc14d5edfb635094c/blob new file mode 100644 index 0000000000000000000000000000000000000000..0b7cfa1cb166fd7bf06474e27ae6d80a23edb400 --- /dev/null +++ b/shared/package-files/07/073d64b373438175cb7d3f13314904dfc46930e4b029146dc14d5edfb635094c/blob @@ -0,0 +1,217 @@ +// Vendored from git tag v2021.02.15.00 + +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// @author Bo Hu (bhu@fb.com) +// @author Jordan DeLong (delong.j@fb.com) + +// This file has been modified as part of Apache Arrow to conform to +// Apache Arrow's coding conventions + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +namespace arrow_vendored { +namespace folly { + +// Vendored from folly/Portability.h +namespace { +#if defined(__arm__) +#define FOLLY_ARM 1 +#else +#define FOLLY_ARM 0 +#endif + +#if defined(__s390x__) +#define FOLLY_S390X 1 +#else +#define FOLLY_S390X 0 +#endif + +constexpr bool kIsArchArm = FOLLY_ARM == 1; +constexpr bool kIsArchS390X = FOLLY_S390X == 1; +} // namespace + +// Vendored from folly/lang/Align.h +namespace { + +constexpr std::size_t hardware_destructive_interference_size = + (kIsArchArm || kIsArchS390X) ? 64 : 128; + +} // namespace + +/* + * ProducerConsumerQueue is a one producer and one consumer queue + * without locks. + */ +template +struct ProducerConsumerQueue { + typedef T value_type; + + ProducerConsumerQueue(const ProducerConsumerQueue&) = delete; + ProducerConsumerQueue& operator=(const ProducerConsumerQueue&) = delete; + + // size must be >= 2. + // + // Also, note that the number of usable slots in the queue at any + // given time is actually (size-1), so if you start with an empty queue, + // IsFull() will return true after size-1 insertions. + explicit ProducerConsumerQueue(uint32_t size) + : size_(size), + records_(static_cast(std::malloc(sizeof(T) * size))), + readIndex_(0), + writeIndex_(0) { + assert(size >= 2); + if (!records_) { + throw std::bad_alloc(); + } + } + + ~ProducerConsumerQueue() { + // We need to destruct anything that may still exist in our queue. + // (No real synchronization needed at destructor time: only one + // thread can be doing this.) + if (!std::is_trivially_destructible::value) { + size_t readIndex = readIndex_; + size_t endIndex = writeIndex_; + while (readIndex != endIndex) { + records_[readIndex].~T(); + if (++readIndex == size_) { + readIndex = 0; + } + } + } + + std::free(records_); + } + + template + bool Write(Args&&... recordArgs) { + auto const currentWrite = writeIndex_.load(std::memory_order_relaxed); + auto nextRecord = currentWrite + 1; + if (nextRecord == size_) { + nextRecord = 0; + } + if (nextRecord != readIndex_.load(std::memory_order_acquire)) { + new (&records_[currentWrite]) T(std::forward(recordArgs)...); + writeIndex_.store(nextRecord, std::memory_order_release); + return true; + } + + // queue is full + return false; + } + + // move the value at the front of the queue to given variable + bool Read(T& record) { + auto const currentRead = readIndex_.load(std::memory_order_relaxed); + if (currentRead == writeIndex_.load(std::memory_order_acquire)) { + // queue is empty + return false; + } + + auto nextRecord = currentRead + 1; + if (nextRecord == size_) { + nextRecord = 0; + } + record = std::move(records_[currentRead]); + records_[currentRead].~T(); + readIndex_.store(nextRecord, std::memory_order_release); + return true; + } + + // pointer to the value at the front of the queue (for use in-place) or + // nullptr if empty. + T* FrontPtr() { + auto const currentRead = readIndex_.load(std::memory_order_relaxed); + if (currentRead == writeIndex_.load(std::memory_order_acquire)) { + // queue is empty + return nullptr; + } + return &records_[currentRead]; + } + + // queue must not be empty + void PopFront() { + auto const currentRead = readIndex_.load(std::memory_order_relaxed); + assert(currentRead != writeIndex_.load(std::memory_order_acquire)); + + auto nextRecord = currentRead + 1; + if (nextRecord == size_) { + nextRecord = 0; + } + records_[currentRead].~T(); + readIndex_.store(nextRecord, std::memory_order_release); + } + + bool IsEmpty() const { + return readIndex_.load(std::memory_order_acquire) == + writeIndex_.load(std::memory_order_acquire); + } + + bool IsFull() const { + auto nextRecord = writeIndex_.load(std::memory_order_acquire) + 1; + if (nextRecord == size_) { + nextRecord = 0; + } + if (nextRecord != readIndex_.load(std::memory_order_acquire)) { + return false; + } + // queue is full + return true; + } + + // * If called by consumer, then true size may be more (because producer may + // be adding items concurrently). + // * If called by producer, then true size may be less (because consumer may + // be removing items concurrently). + // * It is undefined to call this from any other thread. + size_t SizeGuess() const { + int ret = writeIndex_.load(std::memory_order_acquire) - + readIndex_.load(std::memory_order_acquire); + if (ret < 0) { + ret += size_; + } + return ret; + } + + // maximum number of items in the queue. + size_t capacity() const { return size_ - 1; } + + private: + using AtomicIndex = std::atomic; + + char pad0_[hardware_destructive_interference_size]; + const uint32_t size_; + T* const records_; + + AtomicIndex readIndex_; + char pad1_[hardware_destructive_interference_size - sizeof(AtomicIndex)]; + AtomicIndex writeIndex_; + + char pad2_[hardware_destructive_interference_size - sizeof(AtomicIndex)]; +}; + +} // namespace folly +} // namespace arrow_vendored diff --git a/shared/package-files/07/073d9772f61d521ad15d5deece5430b60b4e0b02eb246a1e9fd980b767d0b9a5/blob b/shared/package-files/07/073d9772f61d521ad15d5deece5430b60b4e0b02eb246a1e9fd980b767d0b9a5/blob new file mode 100644 index 0000000000000000000000000000000000000000..626d557862802c4a53e40254148353933de34a6e --- /dev/null +++ b/shared/package-files/07/073d9772f61d521ad15d5deece5430b60b4e0b02eb246a1e9fd980b767d0b9a5/blob @@ -0,0 +1,126 @@ +import numpy as np +from numpy.testing import assert_allclose, assert_equal +import pytest + +from statsmodels.tsa.arima.datasets.brockwell_davis_2002 import dowj, lake +from statsmodels.tsa.arima.estimators.burg import burg +from statsmodels.tsa.innovations.arma_innovations import arma_innovations + + +@pytest.mark.low_precision( + "Test against Example 5.1.3 in Brockwell and Davis (2016)" +) +def test_brockwell_davis_example_513(): + # Test against Example 5.1.3 in Brockwell and Davis (2016) + # (low-precision test, since we are testing against values printed in the + # textbook) + + # Difference and demean the series + endog = dowj.diff().iloc[1:] + + # Burg + res = burg(endog, ar_order=1, demean=True).parameters + assert_allclose(res.ar_params, [0.4371], atol=1e-4) + assert_allclose(res.sigma2, 0.1423, atol=1e-4) + + +@pytest.mark.low_precision( + "Test against Example 5.1.4 in Brockwell and Davis (2016)" +) +def test_brockwell_davis_example_514(): + # Test against Example 5.1.4 in Brockwell and Davis (2016) + # (low-precision test, since we are testing against values printed in the + # textbook) + + # Get the lake data + endog = lake.copy() + + # Should have 98 observations + assert_equal(len(endog), 98) + desired = 9.0041 + assert_allclose(endog.mean(), desired, atol=1e-4) + + # Burg + res = burg(endog, ar_order=2, demean=True).parameters + assert_allclose(res.ar_params, [1.0449, -0.2456], atol=1e-4) + assert_allclose(res.sigma2, 0.4706, atol=1e-4) + + +def check_itsmr(lake): + # Test against R itsmr::burg; see results/results_burg.R + res = burg(lake, 10, demean=True).parameters + desired_ar_params = [ + 1.05853631096, + -0.32639150878, + 0.04784765122, + 0.02620476111, + 0.04444511374, + -0.04134010262, + 0.02251178970, + -0.01427524694, + 0.22223486915, + -0.20935524387, + ] + assert_allclose(res.ar_params, desired_ar_params) + + # itsmr always returns the innovations algorithm estimate of sigma2, + # whereas we return Burg's estimate + u, v = arma_innovations( + np.array(lake) - np.mean(lake), ar_params=res.ar_params, sigma2=1 + ) + desired_sigma2 = 0.4458956354 + assert_allclose(np.sum(u**2 / v) / len(u), desired_sigma2) + + +def test_itsmr(): + # Note: apparently itsmr automatically demeans (there is no option to + # control this) + endog = lake.copy() + + check_itsmr(endog) # Pandas series + check_itsmr(endog.values) # Numpy array + check_itsmr(endog.tolist()) # Python list + + +def test_nonstationary_series(): + # Test against R stats::ar.burg; see results/results_burg.R + endog = np.arange(1, 12) * 1.0 + res = burg(endog, 2, demean=False).parameters + + desired_ar_params = [1.9669331547, -0.9892846679] + assert_allclose(res.ar_params, desired_ar_params) + desired_sigma2 = 0.02143066427 + assert_allclose(res.sigma2, desired_sigma2) + + # With var.method = 1, stats::ar.burg also returns something equivalent to + # the innovations algorithm estimate of sigma2 + u, v = arma_innovations(endog, ar_params=res.ar_params, sigma2=1) + desired_sigma2 = 0.02191056906 + assert_allclose(np.sum(u**2 / v) / len(u), desired_sigma2) + + +def test_invalid(): + endog = np.arange(2) * 1.0 + with pytest.raises(ValueError): + burg(endog, ar_order=2) + with pytest.raises(ValueError): + burg(endog, ar_order=-1) + with pytest.raises(ValueError): + burg(endog, ar_order=1.5) + + endog = np.arange(10) * 1.0 + with pytest.raises(ValueError): + burg(endog, ar_order=[1, 3]) + + +def test_misc(): + # Test defaults (order = 0, demean=True) + endog = lake.copy() + res = burg(endog).parameters + assert_allclose(res.params, np.var(endog)) + + # Test that integer input gives the same result as float-coerced input. + endog = np.array([1, 2, 5, 3, -2, 1, -3, 5, 2, 3, -1], dtype=int) + res_int = burg(endog, 2).parameters + res_float = burg(endog * 1.0, 2).parameters + assert_allclose(res_int.params, res_float.params) diff --git a/shared/package-files/07/073e302f8c1409809242b8f85bf4a7e629dda113bced854e2e3f63fa8c5c20ff/blob b/shared/package-files/07/073e302f8c1409809242b8f85bf4a7e629dda113bced854e2e3f63fa8c5c20ff/blob new file mode 100644 index 0000000000000000000000000000000000000000..ef1d8a08156c8b4e3f5e215ce203adaa452110ef --- /dev/null +++ b/shared/package-files/07/073e302f8c1409809242b8f85bf4a7e629dda113bced854e2e3f63fa8c5c20ff/blob @@ -0,0 +1,394 @@ +"""Functions concerning tournament graphs. + +A `tournament graph`_ is a complete oriented graph. In other words, it +is a directed graph in which there is exactly one directed edge joining +each pair of distinct nodes. For each function in this module that +accepts a graph as input, you must provide a tournament graph. The +responsibility is on the caller to ensure that the graph is a tournament +graph. + +To access the functions in this module, you must access them through the +:mod:`networkx.algorithms.tournament` module:: + + >>> from networkx.algorithms import tournament + >>> G = nx.DiGraph([(0, 1), (1, 2), (2, 0)]) + >>> tournament.is_tournament(G) + True + +.. _tournament graph: https://en.wikipedia.org/wiki/Tournament_%28graph_theory%29 + +""" +from itertools import combinations + +import networkx as nx +from networkx.algorithms.simple_paths import is_simple_path as is_path +from networkx.utils import arbitrary_element, not_implemented_for, py_random_state + +__all__ = [ + "hamiltonian_path", + "is_reachable", + "is_strongly_connected", + "is_tournament", + "random_tournament", + "score_sequence", +] + + +def index_satisfying(iterable, condition): + """Returns the index of the first element in `iterable` that + satisfies the given condition. + + If no such element is found (that is, when the iterable is + exhausted), this returns the length of the iterable (that is, one + greater than the last index of the iterable). + + `iterable` must not be empty. If `iterable` is empty, this + function raises :exc:`ValueError`. + + """ + # Pre-condition: iterable must not be empty. + for i, x in enumerate(iterable): + if condition(x): + return i + # If we reach the end of the iterable without finding an element + # that satisfies the condition, return the length of the iterable, + # which is one greater than the index of its last element. If the + # iterable was empty, `i` will not be defined, so we raise an + # exception. + try: + return i + 1 + except NameError as err: + raise ValueError("iterable must be non-empty") from err + + +@nx._dispatch +@not_implemented_for("undirected") +@not_implemented_for("multigraph") +def is_tournament(G): + """Returns True if and only if `G` is a tournament. + + A tournament is a directed graph, with neither self-loops nor + multi-edges, in which there is exactly one directed edge joining + each pair of distinct nodes. + + Parameters + ---------- + G : NetworkX graph + A directed graph representing a tournament. + + Returns + ------- + bool + Whether the given graph is a tournament graph. + + Examples + -------- + >>> from networkx.algorithms import tournament + >>> G = nx.DiGraph([(0, 1), (1, 2), (2, 0)]) + >>> tournament.is_tournament(G) + True + + Notes + ----- + Some definitions require a self-loop on each node, but that is not + the convention used here. + + """ + # In a tournament, there is exactly one directed edge joining each pair. + return ( + all((v in G[u]) ^ (u in G[v]) for u, v in combinations(G, 2)) + and nx.number_of_selfloops(G) == 0 + ) + + +@not_implemented_for("undirected") +@not_implemented_for("multigraph") +def hamiltonian_path(G): + """Returns a Hamiltonian path in the given tournament graph. + + Each tournament has a Hamiltonian path. If furthermore, the + tournament is strongly connected, then the returned Hamiltonian path + is a Hamiltonian cycle (by joining the endpoints of the path). + + Parameters + ---------- + G : NetworkX graph + A directed graph representing a tournament. + + Returns + ------- + path : list + A list of nodes which form a Hamiltonian path in `G`. + + Examples + -------- + >>> from networkx.algorithms import tournament + >>> G = nx.DiGraph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)]) + >>> tournament.hamiltonian_path(G) + [0, 1, 2, 3] + + Notes + ----- + This is a recursive implementation with an asymptotic running time + of $O(n^2)$, ignoring multiplicative polylogarithmic factors, where + $n$ is the number of nodes in the graph. + + """ + if len(G) == 0: + return [] + if len(G) == 1: + return [arbitrary_element(G)] + v = arbitrary_element(G) + hampath = hamiltonian_path(G.subgraph(set(G) - {v})) + # Get the index of the first node in the path that does *not* have + # an edge to `v`, then insert `v` before that node. + index = index_satisfying(hampath, lambda u: v not in G[u]) + hampath.insert(index, v) + return hampath + + +@py_random_state(1) +def random_tournament(n, seed=None): + r"""Returns a random tournament graph on `n` nodes. + + Parameters + ---------- + n : int + The number of nodes in the returned graph. + seed : integer, random_state, or None (default) + Indicator of random number generation state. + See :ref:`Randomness`. + + Returns + ------- + G : DiGraph + A tournament on `n` nodes, with exactly one directed edge joining + each pair of distinct nodes. + + Notes + ----- + This algorithm adds, for each pair of distinct nodes, an edge with + uniformly random orientation. In other words, `\binom{n}{2}` flips + of an unbiased coin decide the orientations of the edges in the + graph. + + """ + # Flip an unbiased coin for each pair of distinct nodes. + coins = (seed.random() for i in range((n * (n - 1)) // 2)) + pairs = combinations(range(n), 2) + edges = ((u, v) if r < 0.5 else (v, u) for (u, v), r in zip(pairs, coins)) + return nx.DiGraph(edges) + + +@nx._dispatch +@not_implemented_for("undirected") +@not_implemented_for("multigraph") +def score_sequence(G): + """Returns the score sequence for the given tournament graph. + + The score sequence is the sorted list of the out-degrees of the + nodes of the graph. + + Parameters + ---------- + G : NetworkX graph + A directed graph representing a tournament. + + Returns + ------- + list + A sorted list of the out-degrees of the nodes of `G`. + + Examples + -------- + >>> from networkx.algorithms import tournament + >>> G = nx.DiGraph([(1, 0), (1, 3), (0, 2), (0, 3), (2, 1), (3, 2)]) + >>> tournament.score_sequence(G) + [1, 1, 2, 2] + + """ + return sorted(d for v, d in G.out_degree()) + + +@nx._dispatch +@not_implemented_for("undirected") +@not_implemented_for("multigraph") +def tournament_matrix(G): + r"""Returns the tournament matrix for the given tournament graph. + + This function requires SciPy. + + The *tournament matrix* of a tournament graph with edge set *E* is + the matrix *T* defined by + + .. math:: + + T_{i j} = + \begin{cases} + +1 & \text{if } (i, j) \in E \\ + -1 & \text{if } (j, i) \in E \\ + 0 & \text{if } i == j. + \end{cases} + + An equivalent definition is `T = A - A^T`, where *A* is the + adjacency matrix of the graph `G`. + + Parameters + ---------- + G : NetworkX graph + A directed graph representing a tournament. + + Returns + ------- + SciPy sparse array + The tournament matrix of the tournament graph `G`. + + Raises + ------ + ImportError + If SciPy is not available. + + """ + A = nx.adjacency_matrix(G) + return A - A.T + + +@not_implemented_for("undirected") +@not_implemented_for("multigraph") +def is_reachable(G, s, t): + """Decides whether there is a path from `s` to `t` in the + tournament. + + This function is more theoretically efficient than the reachability + checks than the shortest path algorithms in + :mod:`networkx.algorithms.shortest_paths`. + + The given graph **must** be a tournament, otherwise this function's + behavior is undefined. + + Parameters + ---------- + G : NetworkX graph + A directed graph representing a tournament. + + s : node + A node in the graph. + + t : node + A node in the graph. + + Returns + ------- + bool + Whether there is a path from `s` to `t` in `G`. + + Examples + -------- + >>> from networkx.algorithms import tournament + >>> G = nx.DiGraph([(1, 0), (1, 3), (1, 2), (2, 3), (2, 0), (3, 0)]) + >>> tournament.is_reachable(G, 1, 3) + True + >>> tournament.is_reachable(G, 3, 2) + False + + Notes + ----- + Although this function is more theoretically efficient than the + generic shortest path functions, a speedup requires the use of + parallelism. Though it may in the future, the current implementation + does not use parallelism, thus you may not see much of a speedup. + + This algorithm comes from [1]. + + References + ---------- + .. [1] Tantau, Till. + "A note on the complexity of the reachability problem for + tournaments." + *Electronic Colloquium on Computational Complexity*. 2001. + + """ + + def two_neighborhood(G, v): + """Returns the set of nodes at distance at most two from `v`. + + `G` must be a graph and `v` a node in that graph. + + The returned set includes the nodes at distance zero (that is, + the node `v` itself), the nodes at distance one (that is, the + out-neighbors of `v`), and the nodes at distance two. + + """ + # TODO This is trivially parallelizable. + return { + x for x in G if x == v or x in G[v] or any(is_path(G, [v, z, x]) for z in G) + } + + def is_closed(G, nodes): + """Decides whether the given set of nodes is closed. + + A set *S* of nodes is *closed* if for each node *u* in the graph + not in *S* and for each node *v* in *S*, there is an edge from + *u* to *v*. + + """ + # TODO This is trivially parallelizable. + return all(v in G[u] for u in set(G) - nodes for v in nodes) + + # TODO This is trivially parallelizable. + neighborhoods = [two_neighborhood(G, v) for v in G] + return all(not (is_closed(G, S) and s in S and t not in S) for S in neighborhoods) + + +@not_implemented_for("undirected") +@not_implemented_for("multigraph") +def is_strongly_connected(G): + """Decides whether the given tournament is strongly connected. + + This function is more theoretically efficient than the + :func:`~networkx.algorithms.components.is_strongly_connected` + function. + + The given graph **must** be a tournament, otherwise this function's + behavior is undefined. + + Parameters + ---------- + G : NetworkX graph + A directed graph representing a tournament. + + Returns + ------- + bool + Whether the tournament is strongly connected. + + Examples + -------- + >>> from networkx.algorithms import tournament + >>> G = nx.DiGraph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3), (3, 0)]) + >>> tournament.is_strongly_connected(G) + True + >>> G.remove_edge(1, 3) + >>> tournament.is_strongly_connected(G) + False + + Notes + ----- + Although this function is more theoretically efficient than the + generic strong connectivity function, a speedup requires the use of + parallelism. Though it may in the future, the current implementation + does not use parallelism, thus you may not see much of a speedup. + + This algorithm comes from [1]. + + References + ---------- + .. [1] Tantau, Till. + "A note on the complexity of the reachability problem for + tournaments." + *Electronic Colloquium on Computational Complexity*. 2001. + + + """ + # TODO This is trivially parallelizable. + return all(is_reachable(G, u, v) for u in G for v in G) diff --git a/shared/package-files/07/073e87ed553b9dcf1c7d3fdcf6cf832d0bf85a949a415f9b0a5b91dfbd63546b/blob b/shared/package-files/07/073e87ed553b9dcf1c7d3fdcf6cf832d0bf85a949a415f9b0a5b91dfbd63546b/blob new file mode 100644 index 0000000000000000000000000000000000000000..4e84aff1cce40d813a7bb94edc1512117eb680e1 --- /dev/null +++ b/shared/package-files/07/073e87ed553b9dcf1c7d3fdcf6cf832d0bf85a949a415f9b0a5b91dfbd63546b/blob @@ -0,0 +1,88 @@ +""" + pygments.styles.rainbow_dash + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + A bright and colorful syntax highlighting `theme`. + + .. _theme: http://sanssecours.github.io/Rainbow-Dash.tmbundle + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Comment, Error, Generic, Name, Number, Operator, \ + String, Text, Whitespace, Keyword + +BLUE_LIGHT = '#0080ff' +BLUE = '#2c5dcd' +GREEN = '#00cc66' +GREEN_LIGHT = '#ccffcc' +GREEN_NEON = '#00cc00' +GREY = '#aaaaaa' +GREY_LIGHT = '#cbcbcb' +GREY_DARK = '#4d4d4d' +PURPLE = '#5918bb' +RED = '#cc0000' +RED_DARK = '#c5060b' +RED_LIGHT = '#ffcccc' +RED_BRIGHT = '#ff0000' +WHITE = '#ffffff' +TURQUOISE = '#318495' +ORANGE = '#ff8000' + + +class RainbowDashStyle(Style): + """ + A bright and colorful syntax highlighting theme. + """ + + background_color = WHITE + + styles = { + Comment: 'italic {}'.format(BLUE_LIGHT), + Comment.Preproc: 'noitalic', + Comment.Special: 'bold', + + Error: 'bg:{} {}'.format(RED, WHITE), + + Generic.Deleted: 'border:{} bg:{}'.format(RED_DARK, RED_LIGHT), + Generic.Emph: 'italic', + Generic.Error: RED_BRIGHT, + Generic.Heading: 'bold {}'.format(BLUE), + Generic.Inserted: 'border:{} bg:{}'.format(GREEN_NEON, GREEN_LIGHT), + Generic.Output: GREY, + Generic.Prompt: 'bold {}'.format(BLUE), + Generic.Strong: 'bold', + Generic.Subheading: 'bold {}'.format(BLUE), + Generic.Traceback: RED_DARK, + + Keyword: 'bold {}'.format(BLUE), + Keyword.Pseudo: 'nobold', + Keyword.Type: PURPLE, + + Name.Attribute: 'italic {}'.format(BLUE), + Name.Builtin: 'bold {}'.format(PURPLE), + Name.Class: 'underline', + Name.Constant: TURQUOISE, + Name.Decorator: 'bold {}'.format(ORANGE), + Name.Entity: 'bold {}'.format(PURPLE), + Name.Exception: 'bold {}'.format(PURPLE), + Name.Function: 'bold {}'.format(ORANGE), + Name.Tag: 'bold {}'.format(BLUE), + + Number: 'bold {}'.format(PURPLE), + + Operator: BLUE, + Operator.Word: 'bold', + + String: GREEN, + String.Doc: 'italic', + String.Escape: 'bold {}'.format(RED_DARK), + String.Other: TURQUOISE, + String.Symbol: 'bold {}'.format(RED_DARK), + + Text: GREY_DARK, + + Whitespace: GREY_LIGHT + } diff --git a/shared/package-files/07/073ff9b4d70d55c63bfe7ac098595036142576da9959df165064361373d6859a/blob b/shared/package-files/07/073ff9b4d70d55c63bfe7ac098595036142576da9959df165064361373d6859a/blob new file mode 100644 index 0000000000000000000000000000000000000000..c5fed4934835300c2e3a2ebac5ac4a73732e52af --- /dev/null +++ b/shared/package-files/07/073ff9b4d70d55c63bfe7ac098595036142576da9959df165064361373d6859a/blob @@ -0,0 +1,22 @@ +class FeatureLibError(Exception): + def __init__(self, message, location=None): + Exception.__init__(self, message) + self.location = location + + def __str__(self): + message = Exception.__str__(self) + if self.location: + return f"{self.location}: {message}" + else: + return message + + +class IncludedFeaNotFound(FeatureLibError): + def __str__(self): + assert self.location is not None + + message = ( + "The following feature file should be included but cannot be found: " + f"{Exception.__str__(self)}" + ) + return f"{self.location}: {message}" diff --git a/shared/package-files/07/074128b7dbcc6e84ddb9427e7b3c6ac61d7eac220783b56cf4722d7e7347e36a/blob b/shared/package-files/07/074128b7dbcc6e84ddb9427e7b3c6ac61d7eac220783b56cf4722d7e7347e36a/blob new file mode 100644 index 0000000000000000000000000000000000000000..292124fa912fd98a6bcab8ef4c771a323f4300b1 --- /dev/null +++ b/shared/package-files/07/074128b7dbcc6e84ddb9427e7b3c6ac61d7eac220783b56cf4722d7e7347e36a/blob @@ -0,0 +1,59 @@ +*** Mon, 25 Jul 2016 13:55:40 *** +PORTMANTEAU TEST (H0:Rh=(r1,...,rh)=0) + +tested order: 16 +test statistic: 48.0815 + p-value: 0.5507 +adjusted test statistic: 53.8138 + p-value: 0.3305 +degrees of freedom: 50.0000 + +*** Mon, 25 Jul 2016 13:55:40 *** +LM-TYPE TEST FOR AUTOCORRELATION with 5 lags + +LM statistic: 23.5983 + p-value: 0.2604 + df: 20.0000 + +*** Mon, 25 Jul 2016 13:55:40 *** +TESTS FOR NONNORMALITY + +Reference: Doornik & Hansen (1994) +joint test statistic: 1.2601 + p-value: 0.8681 +degrees of freedom: 4.0000 +skewness only: 0.2625 + p-value: 0.8770 +kurtosis only: 0.9976 + p-value: 0.6073 + +Reference: Lütkepohl (1993), Introduction to Multiple Time Series Analysis, 2ed, p. 153 +joint test statistic: 1.0210 + p-value: 0.9066 +degrees of freedom: 4.0000 +skewness only: 0.2477 + p-value: 0.8835 +kurtosis only: 0.7733 + p-value: 0.6793 + +*** Mon, 25 Jul 2016 13:55:40 *** +JARQUE-BERA TEST + +variable teststat p-Value(Chi^2) skewness kurtosis +u1 0.5868 0.7457 0.0939 2.6815 +u2 1.1219 0.5707 -0.0883 3.4798 + +*** Mon, 25 Jul 2016 13:55:40 *** +ARCH-LM TEST with 16 lags + +variable teststat p-Value(Chi^2) F stat p-Value(F) +u1 15.5197 0.4870 1.1806 0.3050 +u2 26.9092 0.0425 2.4350 0.0056 + +*** Mon, 25 Jul 2016 13:55:40 *** +MULTIVARIATE ARCH-LM TEST with 5 lags + +VARCHLM test statistic: 73.4831 + p-value(chi^2): 0.0047 + degrees of freedom: 45.0000 + diff --git a/shared/package-files/07/0741a4bbaa883342a53b00b6cd0c9956b344d92b63e09ca59f3850e3e82cc220/blob b/shared/package-files/07/0741a4bbaa883342a53b00b6cd0c9956b344d92b63e09ca59f3850e3e82cc220/blob new file mode 100644 index 0000000000000000000000000000000000000000..768883b38fad339c8736d6686c1b8547316c9df9 --- /dev/null +++ b/shared/package-files/07/0741a4bbaa883342a53b00b6cd0c9956b344d92b63e09ca59f3850e3e82cc220/blob @@ -0,0 +1,33 @@ +from typing import Any, Dict, List, Optional, Tuple, Type + +from django.apps.config import AppConfig +from django.apps.registry import Apps +from django.contrib.contenttypes.models import ContentType +from django.db import migrations +from django.db.backends.sqlite3.schema import DatabaseSchemaEditor +from django.db.migrations.migration import Migration +from django.db.migrations.state import StateApps +from django.db.models.base import Model + +class RenameContentType(migrations.RunPython): + app_label: Any = ... + old_model: Any = ... + new_model: Any = ... + def __init__(self, app_label: str, old_model: str, new_model: str) -> None: ... + def rename_forward(self, apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: ... + def rename_backward(self, apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: ... + +def inject_rename_contenttypes_operations( + plan: List[Tuple[Migration, bool]] = ..., apps: StateApps = ..., using: str = ..., **kwargs: Any +) -> None: ... +def get_contenttypes_and_models( + app_config: AppConfig, using: str, ContentType: Type[ContentType] +) -> Tuple[Dict[str, ContentType], Dict[str, Type[Model]]]: ... +def create_contenttypes( + app_config: AppConfig, + verbosity: int = ..., + interactive: bool = ..., + using: str = ..., + apps: Apps = ..., + **kwargs: Any +) -> None: ... diff --git a/shared/package-files/07/074497b50c43ea57597181591f9893d38fc12a87e95104f5657fc2481f61a23a/blob b/shared/package-files/07/074497b50c43ea57597181591f9893d38fc12a87e95104f5657fc2481f61a23a/blob new file mode 100644 index 0000000000000000000000000000000000000000..189bdf0f0a01c2fb07e436ee4e348ae681b5dd97 Binary files /dev/null and b/shared/package-files/07/074497b50c43ea57597181591f9893d38fc12a87e95104f5657fc2481f61a23a/blob differ diff --git a/shared/package-files/07/074ce037474f72e2fc9945195ed4c16fb5461760294fcf879724257094ee1810/blob b/shared/package-files/07/074ce037474f72e2fc9945195ed4c16fb5461760294fcf879724257094ee1810/blob new file mode 100644 index 0000000000000000000000000000000000000000..591420c9c57718ff458169d00d1d823633f36ddf --- /dev/null +++ b/shared/package-files/07/074ce037474f72e2fc9945195ed4c16fb5461760294fcf879724257094ee1810/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:074ce037474f72e2fc9945195ed4c16fb5461760294fcf879724257094ee1810 +size 147488 diff --git a/shared/package-files/07/074e9029e1518032046e410f072ff3600d47e44d9ec6e8538bb20393357c81fa/blob b/shared/package-files/07/074e9029e1518032046e410f072ff3600d47e44d9ec6e8538bb20393357c81fa/blob new file mode 100644 index 0000000000000000000000000000000000000000..965e547e7c977a755885b5410d198dc912968eef --- /dev/null +++ b/shared/package-files/07/074e9029e1518032046e410f072ff3600d47e44d9ec6e8538bb20393357c81fa/blob @@ -0,0 +1,370 @@ +import sys +import sysconfig +import weakref +from pathlib import Path + +import pytest + +import numpy as np +from numpy.ctypeslib import ndpointer, load_library, as_array +from numpy.testing import assert_, assert_array_equal, assert_raises, assert_equal + +try: + import ctypes +except ImportError: + ctypes = None +else: + cdll = None + test_cdll = None + if hasattr(sys, 'gettotalrefcount'): + try: + cdll = load_library('_multiarray_umath_d', np.core._multiarray_umath.__file__) + except OSError: + pass + try: + test_cdll = load_library('_multiarray_tests', np.core._multiarray_tests.__file__) + except OSError: + pass + if cdll is None: + cdll = load_library('_multiarray_umath', np.core._multiarray_umath.__file__) + if test_cdll is None: + test_cdll = load_library('_multiarray_tests', np.core._multiarray_tests.__file__) + + c_forward_pointer = test_cdll.forward_pointer + + +@pytest.mark.skipif(ctypes is None, + reason="ctypes not available in this python") +@pytest.mark.skipif(sys.platform == 'cygwin', + reason="Known to fail on cygwin") +class TestLoadLibrary: + def test_basic(self): + loader_path = np.core._multiarray_umath.__file__ + + out1 = load_library('_multiarray_umath', loader_path) + out2 = load_library(Path('_multiarray_umath'), loader_path) + out3 = load_library('_multiarray_umath', Path(loader_path)) + out4 = load_library(b'_multiarray_umath', loader_path) + + assert isinstance(out1, ctypes.CDLL) + assert out1 is out2 is out3 is out4 + + def test_basic2(self): + # Regression for #801: load_library with a full library name + # (including extension) does not work. + try: + so_ext = sysconfig.get_config_var('EXT_SUFFIX') + load_library('_multiarray_umath%s' % so_ext, + np.core._multiarray_umath.__file__) + except ImportError as e: + msg = ("ctypes is not available on this python: skipping the test" + " (import error was: %s)" % str(e)) + print(msg) + + +class TestNdpointer: + def test_dtype(self): + dt = np.intc + p = ndpointer(dtype=dt) + assert_(p.from_param(np.array([1], dt))) + dt = 'i4') + p = ndpointer(dtype=dt) + p.from_param(np.array([1], dt)) + assert_raises(TypeError, p.from_param, + np.array([1], dt.newbyteorder('swap'))) + dtnames = ['x', 'y'] + dtformats = [np.intc, np.float64] + dtdescr = {'names': dtnames, 'formats': dtformats} + dt = np.dtype(dtdescr) + p = ndpointer(dtype=dt) + assert_(p.from_param(np.zeros((10,), dt))) + samedt = np.dtype(dtdescr) + p = ndpointer(dtype=samedt) + assert_(p.from_param(np.zeros((10,), dt))) + dt2 = np.dtype(dtdescr, align=True) + if dt.itemsize != dt2.itemsize: + assert_raises(TypeError, p.from_param, np.zeros((10,), dt2)) + else: + assert_(p.from_param(np.zeros((10,), dt2))) + + def test_ndim(self): + p = ndpointer(ndim=0) + assert_(p.from_param(np.array(1))) + assert_raises(TypeError, p.from_param, np.array([1])) + p = ndpointer(ndim=1) + assert_raises(TypeError, p.from_param, np.array(1)) + assert_(p.from_param(np.array([1]))) + p = ndpointer(ndim=2) + assert_(p.from_param(np.array([[1]]))) + + def test_shape(self): + p = ndpointer(shape=(1, 2)) + assert_(p.from_param(np.array([[1, 2]]))) + assert_raises(TypeError, p.from_param, np.array([[1], [2]])) + p = ndpointer(shape=()) + assert_(p.from_param(np.array(1))) + + def test_flags(self): + x = np.array([[1, 2], [3, 4]], order='F') + p = ndpointer(flags='FORTRAN') + assert_(p.from_param(x)) + p = ndpointer(flags='CONTIGUOUS') + assert_raises(TypeError, p.from_param, x) + p = ndpointer(flags=x.flags.num) + assert_(p.from_param(x)) + assert_raises(TypeError, p.from_param, np.array([[1, 2], [3, 4]])) + + def test_cache(self): + assert_(ndpointer(dtype=np.float64) is ndpointer(dtype=np.float64)) + + # shapes are normalized + assert_(ndpointer(shape=2) is ndpointer(shape=(2,))) + + # 1.12 <= v < 1.16 had a bug that made these fail + assert_(ndpointer(shape=2) is not ndpointer(ndim=2)) + assert_(ndpointer(ndim=2) is not ndpointer(shape=2)) + +@pytest.mark.skipif(ctypes is None, + reason="ctypes not available on this python installation") +class TestNdpointerCFunc: + def test_arguments(self): + """ Test that arguments are coerced from arrays """ + c_forward_pointer.restype = ctypes.c_void_p + c_forward_pointer.argtypes = (ndpointer(ndim=2),) + + c_forward_pointer(np.zeros((2, 3))) + # too many dimensions + assert_raises( + ctypes.ArgumentError, c_forward_pointer, np.zeros((2, 3, 4))) + + @pytest.mark.parametrize( + 'dt', [ + float, + np.dtype(dict( + formats=['u2') + ct = np.ctypeslib.as_ctypes_type(dt) + assert_equal(ct, ctypes.c_uint16.__ctype_be__) + + dt = np.dtype('u2') + ct = np.ctypeslib.as_ctypes_type(dt) + assert_equal(ct, ctypes.c_uint16) + + def test_subarray(self): + dt = np.dtype((np.int32, (2, 3))) + ct = np.ctypeslib.as_ctypes_type(dt) + assert_equal(ct, 2 * (3 * ctypes.c_int32)) + + def test_structure(self): + dt = np.dtype([ + ('a', np.uint16), + ('b', np.uint32), + ]) + + ct = np.ctypeslib.as_ctypes_type(dt) + assert_(issubclass(ct, ctypes.Structure)) + assert_equal(ctypes.sizeof(ct), dt.itemsize) + assert_equal(ct._fields_, [ + ('a', ctypes.c_uint16), + ('b', ctypes.c_uint32), + ]) + + def test_structure_aligned(self): + dt = np.dtype([ + ('a', np.uint16), + ('b', np.uint32), + ], align=True) + + ct = np.ctypeslib.as_ctypes_type(dt) + assert_(issubclass(ct, ctypes.Structure)) + assert_equal(ctypes.sizeof(ct), dt.itemsize) + assert_equal(ct._fields_, [ + ('a', ctypes.c_uint16), + ('', ctypes.c_char * 2), # padding + ('b', ctypes.c_uint32), + ]) + + def test_union(self): + dt = np.dtype(dict( + names=['a', 'b'], + offsets=[0, 0], + formats=[np.uint16, np.uint32] + )) + + ct = np.ctypeslib.as_ctypes_type(dt) + assert_(issubclass(ct, ctypes.Union)) + assert_equal(ctypes.sizeof(ct), dt.itemsize) + assert_equal(ct._fields_, [ + ('a', ctypes.c_uint16), + ('b', ctypes.c_uint32), + ]) + + def test_padded_union(self): + dt = np.dtype(dict( + names=['a', 'b'], + offsets=[0, 0], + formats=[np.uint16, np.uint32], + itemsize=5, + )) + + ct = np.ctypeslib.as_ctypes_type(dt) + assert_(issubclass(ct, ctypes.Union)) + assert_equal(ctypes.sizeof(ct), dt.itemsize) + assert_equal(ct._fields_, [ + ('a', ctypes.c_uint16), + ('b', ctypes.c_uint32), + ('', ctypes.c_char * 5), # padding + ]) + + def test_overlapping(self): + dt = np.dtype(dict( + names=['a', 'b'], + offsets=[0, 2], + formats=[np.uint32, np.uint32] + )) + assert_raises(NotImplementedError, np.ctypeslib.as_ctypes_type, dt) diff --git a/shared/package-files/07/074f5c46de1849726b6ad31974692adfc25635d405e0d9c733dc583daa5519e8/blob b/shared/package-files/07/074f5c46de1849726b6ad31974692adfc25635d405e0d9c733dc583daa5519e8/blob new file mode 100644 index 0000000000000000000000000000000000000000..694559e25c5f016b4b006d30098bfde2a40bae47 --- /dev/null +++ b/shared/package-files/07/074f5c46de1849726b6ad31974692adfc25635d405e0d9c733dc583daa5519e8/blob @@ -0,0 +1,8 @@ +from typing import Any + + +def identity(data: Any) -> Any: + """ + Performs the identity/trivial transform of mapping data to itself. + """ + return data diff --git a/shared/package-files/07/0754dc1d3b6ab2b1ffefaebf694bfe1e65ef4f6db251676e7f0f5bad412d8338/blob b/shared/package-files/07/0754dc1d3b6ab2b1ffefaebf694bfe1e65ef4f6db251676e7f0f5bad412d8338/blob new file mode 100644 index 0000000000000000000000000000000000000000..47b1f90e406c5e731737c7a503e492674ff38e25 --- /dev/null +++ b/shared/package-files/07/0754dc1d3b6ab2b1ffefaebf694bfe1e65ef4f6db251676e7f0f5bad412d8338/blob @@ -0,0 +1,23 @@ +from torch._C._distributed_c10d import _DEFAULT_PG_TIMEOUT +from datetime import timedelta +from typing import Optional + +__all__ = ['default_pg_timeout', 'default_pg_nccl_timeout'] + +# Default process group wide timeout, if applicable. +# This only applies to the non-nccl backends +# To make an attempt at backwards compatibility with THD, we use an +# extraordinarily high default timeout, given that THD did not have timeouts. +default_pg_timeout: timedelta = _DEFAULT_PG_TIMEOUT +# Separate timeout for PGNCCL mainly becuase it's always been that way in the C++ layer, but until recently +# there was one default that applied across all backends in the python layer. +# Later, we could consider merging them back together at the c++ layer if we can align on a same value. +# (only if TORCH_NCCL_BLOCKING_WAIT or TORCH_NCCL_ASYNC_ERROR_HANDLING is set to 1). + +try: + from torch._C._distributed_c10d import _DEFAULT_PG_NCCL_TIMEOUT + default_pg_nccl_timeout: Optional[timedelta] = _DEFAULT_PG_NCCL_TIMEOUT +except ImportError: + # if C++ NCCL support is not compiled, we don't have access to the default nccl value. + # if anyone is actually trying to use nccl in this state, it should error. + default_pg_nccl_timeout = None diff --git a/shared/package-files/07/07558dd06c0d7d53032dce3813d36fb5f229a965246b32afd4bbfd30d4a2f65d/blob b/shared/package-files/07/07558dd06c0d7d53032dce3813d36fb5f229a965246b32afd4bbfd30d4a2f65d/blob new file mode 100644 index 0000000000000000000000000000000000000000..b0ec4526a29429a8e0efde52082d51920c8effb2 --- /dev/null +++ b/shared/package-files/07/07558dd06c0d7d53032dce3813d36fb5f229a965246b32afd4bbfd30d4a2f65d/blob @@ -0,0 +1,94 @@ +Metadata-Version: 2.1 +Name: rpds-py +Version: 0.10.6 +Classifier: Development Status :: 3 - Alpha +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Rust +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +License-File: LICENSE +Summary: Python bindings to Rust's persistent data structures (rpds) +Keywords: data structures,rust,persistent +Author: Julian Berman +Author-email: Julian+rpds@GrayVines.com +License: MIT +Requires-Python: >=3.8 +Description-Content-Type: text/x-rst; charset=UTF-8 +Project-URL: Homepage, https://github.com/crate-py/rpds +Project-URL: Issues, https://github.com/crate-py/rpds/issues/ +Project-URL: Funding, https://github.com/sponsors/Julian +Project-URL: Source, https://github.com/crate-py/rpds + +=========== +``rpds.py`` +=========== + +|PyPI| |Pythons| |CI| + +.. |PyPI| image:: https://img.shields.io/pypi/v/rpds-py.svg + :alt: PyPI version + :target: https://pypi.org/project/rpds-py/ + +.. |Pythons| image:: https://img.shields.io/pypi/pyversions/rpds-py.svg + :alt: Supported Python versions + :target: https://pypi.org/project/rpds-py/ + +.. |CI| image:: https://github.com/crate-py/rpds/workflows/CI/badge.svg + :alt: Build status + :target: https://github.com/crate-py/rpds/actions?query=workflow%3ACI + + +Python bindings to the `Rust rpds crate `_ for persistent data structures. + +What's here is quite minimal (in transparency, it was written initially to support replacing ``pyrsistent`` in the `referencing library `_). +If you see something missing (which is very likely), a PR is definitely welcome to add it. + +Installation +------------ + +The distribution on PyPI is named ``rpds.py`` (equivalently ``rpds-py``), and thus can be installed via e.g.: + +.. code:: sh + + $ pip install rpds-py + +Note that if you install ``rpds-py`` from source, you will need a Rust toolchain installed, as it is a build-time dependency. +An example of how to do so in a ``Dockerfile`` can be found `here `_. + +If you believe you are on a common platform which should have wheels built (i.e. and not need to compile from source), feel free to file an issue or pull request modifying the GitHub action used here to build wheels via ``maturin``. + +Usage +----- + +Methods in general are named similarly to their ``rpds`` counterparts (rather than ``pyrsistent``\ 's conventions, though probably a full drop-in ``pyrsistent``\ -compatible wrapper module is a good addition at some point). + +.. code:: python + + >>> from rpds import HashTrieMap, HashTrieSet, List + + >>> m = HashTrieMap({"foo": "bar", "baz": "quux"}) + >>> m.insert("spam", 37) == HashTrieMap({"foo": "bar", "baz": "quux", "spam": 37}) + True + >>> m.remove("foo") == HashTrieMap({"baz": "quux"}) + True + + >>> s = HashTrieSet({"foo", "bar", "baz", "quux"}) + >>> s.insert("spam") == HashTrieSet({"foo", "bar", "baz", "quux", "spam"}) + True + >>> s.remove("foo") == HashTrieSet({"bar", "baz", "quux"}) + True + + >>> L = List([1, 3, 5]) + >>> L.push_front(-1) == List([-1, 1, 3, 5]) + True + >>> L.rest == List([3, 5]) + True + diff --git a/shared/package-files/07/07599adb0f84ca4fe8a082cedcf3f16f62b91ccc9963c599862903201013cd04/blob b/shared/package-files/07/07599adb0f84ca4fe8a082cedcf3f16f62b91ccc9963c599862903201013cd04/blob new file mode 100644 index 0000000000000000000000000000000000000000..0465337eb70062fc004a0973c45d0be07803812a --- /dev/null +++ b/shared/package-files/07/07599adb0f84ca4fe8a082cedcf3f16f62b91ccc9963c599862903201013cd04/blob @@ -0,0 +1,6 @@ +from numba.testing import load_testsuite +import os + + +def load_tests(loader, tests, pattern): + return load_testsuite(loader, os.path.dirname(__file__)) diff --git a/shared/package-files/07/075c26153a91df85be08c02080d16f16067056b80fdafda21552338e70319c0f/blob b/shared/package-files/07/075c26153a91df85be08c02080d16f16067056b80fdafda21552338e70319c0f/blob new file mode 100644 index 0000000000000000000000000000000000000000..867b724fdf449b2e60dd5fbec8a72ce6eb73c22d --- /dev/null +++ b/shared/package-files/07/075c26153a91df85be08c02080d16f16067056b80fdafda21552338e70319c0f/blob @@ -0,0 +1,460 @@ +import numpy as np +from scipy.linalg import solve_banded +from ._rotation import Rotation + + +def _create_skew_matrix(x): + """Create skew-symmetric matrices corresponding to vectors. + + Parameters + ---------- + x : ndarray, shape (n, 3) + Set of vectors. + + Returns + ------- + ndarray, shape (n, 3, 3) + """ + result = np.zeros((len(x), 3, 3)) + result[:, 0, 1] = -x[:, 2] + result[:, 0, 2] = x[:, 1] + result[:, 1, 0] = x[:, 2] + result[:, 1, 2] = -x[:, 0] + result[:, 2, 0] = -x[:, 1] + result[:, 2, 1] = x[:, 0] + return result + + +def _matrix_vector_product_of_stacks(A, b): + """Compute the product of stack of matrices and vectors.""" + return np.einsum("ijk,ik->ij", A, b) + + +def _angular_rate_to_rotvec_dot_matrix(rotvecs): + """Compute matrices to transform angular rates to rot. vector derivatives. + + The matrices depend on the current attitude represented as a rotation + vector. + + Parameters + ---------- + rotvecs : ndarray, shape (n, 3) + Set of rotation vectors. + + Returns + ------- + ndarray, shape (n, 3, 3) + """ + norm = np.linalg.norm(rotvecs, axis=1) + k = np.empty_like(norm) + + mask = norm > 1e-4 + nm = norm[mask] + k[mask] = (1 - 0.5 * nm / np.tan(0.5 * nm)) / nm**2 + mask = ~mask + nm = norm[mask] + k[mask] = 1/12 + 1/720 * nm**2 + + skew = _create_skew_matrix(rotvecs) + + result = np.empty((len(rotvecs), 3, 3)) + result[:] = np.identity(3) + result[:] += 0.5 * skew + result[:] += k[:, None, None] * np.matmul(skew, skew) + + return result + + +def _rotvec_dot_to_angular_rate_matrix(rotvecs): + """Compute matrices to transform rot. vector derivatives to angular rates. + + The matrices depend on the current attitude represented as a rotation + vector. + + Parameters + ---------- + rotvecs : ndarray, shape (n, 3) + Set of rotation vectors. + + Returns + ------- + ndarray, shape (n, 3, 3) + """ + norm = np.linalg.norm(rotvecs, axis=1) + k1 = np.empty_like(norm) + k2 = np.empty_like(norm) + + mask = norm > 1e-4 + nm = norm[mask] + k1[mask] = (1 - np.cos(nm)) / nm ** 2 + k2[mask] = (nm - np.sin(nm)) / nm ** 3 + + mask = ~mask + nm = norm[mask] + k1[mask] = 0.5 - nm ** 2 / 24 + k2[mask] = 1 / 6 - nm ** 2 / 120 + + skew = _create_skew_matrix(rotvecs) + + result = np.empty((len(rotvecs), 3, 3)) + result[:] = np.identity(3) + result[:] -= k1[:, None, None] * skew + result[:] += k2[:, None, None] * np.matmul(skew, skew) + + return result + + +def _angular_acceleration_nonlinear_term(rotvecs, rotvecs_dot): + """Compute the non-linear term in angular acceleration. + + The angular acceleration contains a quadratic term with respect to + the derivative of the rotation vector. This function computes that. + + Parameters + ---------- + rotvecs : ndarray, shape (n, 3) + Set of rotation vectors. + rotvecs_dot : ndarray, shape (n, 3) + Set of rotation vector derivatives. + + Returns + ------- + ndarray, shape (n, 3) + """ + norm = np.linalg.norm(rotvecs, axis=1) + dp = np.sum(rotvecs * rotvecs_dot, axis=1) + cp = np.cross(rotvecs, rotvecs_dot) + ccp = np.cross(rotvecs, cp) + dccp = np.cross(rotvecs_dot, cp) + + k1 = np.empty_like(norm) + k2 = np.empty_like(norm) + k3 = np.empty_like(norm) + + mask = norm > 1e-4 + nm = norm[mask] + k1[mask] = (-nm * np.sin(nm) - 2 * (np.cos(nm) - 1)) / nm ** 4 + k2[mask] = (-2 * nm + 3 * np.sin(nm) - nm * np.cos(nm)) / nm ** 5 + k3[mask] = (nm - np.sin(nm)) / nm ** 3 + + mask = ~mask + nm = norm[mask] + k1[mask] = 1/12 - nm ** 2 / 180 + k2[mask] = -1/60 + nm ** 2 / 12604 + k3[mask] = 1/6 - nm ** 2 / 120 + + dp = dp[:, None] + k1 = k1[:, None] + k2 = k2[:, None] + k3 = k3[:, None] + + return dp * (k1 * cp + k2 * ccp) + k3 * dccp + + +def _compute_angular_rate(rotvecs, rotvecs_dot): + """Compute angular rates given rotation vectors and its derivatives. + + Parameters + ---------- + rotvecs : ndarray, shape (n, 3) + Set of rotation vectors. + rotvecs_dot : ndarray, shape (n, 3) + Set of rotation vector derivatives. + + Returns + ------- + ndarray, shape (n, 3) + """ + return _matrix_vector_product_of_stacks( + _rotvec_dot_to_angular_rate_matrix(rotvecs), rotvecs_dot) + + +def _compute_angular_acceleration(rotvecs, rotvecs_dot, rotvecs_dot_dot): + """Compute angular acceleration given rotation vector and its derivatives. + + Parameters + ---------- + rotvecs : ndarray, shape (n, 3) + Set of rotation vectors. + rotvecs_dot : ndarray, shape (n, 3) + Set of rotation vector derivatives. + rotvecs_dot_dot : ndarray, shape (n, 3) + Set of rotation vector second derivatives. + + Returns + ------- + ndarray, shape (n, 3) + """ + return (_compute_angular_rate(rotvecs, rotvecs_dot_dot) + + _angular_acceleration_nonlinear_term(rotvecs, rotvecs_dot)) + + +def _create_block_3_diagonal_matrix(A, B, d): + """Create a 3-diagonal block matrix as banded. + + The matrix has the following structure: + + DB... + ADB.. + .ADB. + ..ADB + ...AD + + The blocks A, B and D are 3-by-3 matrices. The D matrices has the form + d * I. + + Parameters + ---------- + A : ndarray, shape (n, 3, 3) + Stack of A blocks. + B : ndarray, shape (n, 3, 3) + Stack of B blocks. + d : ndarray, shape (n + 1,) + Values for diagonal blocks. + + Returns + ------- + ndarray, shape (11, 3 * (n + 1)) + Matrix in the banded form as used by `scipy.linalg.solve_banded`. + """ + ind = np.arange(3) + ind_blocks = np.arange(len(A)) + + A_i = np.empty_like(A, dtype=int) + A_i[:] = ind[:, None] + A_i += 3 * (1 + ind_blocks[:, None, None]) + + A_j = np.empty_like(A, dtype=int) + A_j[:] = ind + A_j += 3 * ind_blocks[:, None, None] + + B_i = np.empty_like(B, dtype=int) + B_i[:] = ind[:, None] + B_i += 3 * ind_blocks[:, None, None] + + B_j = np.empty_like(B, dtype=int) + B_j[:] = ind + B_j += 3 * (1 + ind_blocks[:, None, None]) + + diag_i = diag_j = np.arange(3 * len(d)) + i = np.hstack((A_i.ravel(), B_i.ravel(), diag_i)) + j = np.hstack((A_j.ravel(), B_j.ravel(), diag_j)) + values = np.hstack((A.ravel(), B.ravel(), np.repeat(d, 3))) + + u = 5 + l = 5 + result = np.zeros((u + l + 1, 3 * len(d))) + result[u + i - j, j] = values + return result + + +class RotationSpline: + """Interpolate rotations with continuous angular rate and acceleration. + + The rotation vectors between each consecutive orientation are cubic + functions of time and it is guaranteed that angular rate and acceleration + are continuous. Such interpolation are analogous to cubic spline + interpolation. + + Refer to [1]_ for math and implementation details. + + Parameters + ---------- + times : array_like, shape (N,) + Times of the known rotations. At least 2 times must be specified. + rotations : `Rotation` instance + Rotations to perform the interpolation between. Must contain N + rotations. + + Methods + ------- + __call__ + + References + ---------- + .. [1] `Smooth Attitude Interpolation + `_ + + Examples + -------- + >>> from scipy.spatial.transform import Rotation, RotationSpline + >>> import numpy as np + + Define the sequence of times and rotations from the Euler angles: + + >>> times = [0, 10, 20, 40] + >>> angles = [[-10, 20, 30], [0, 15, 40], [-30, 45, 30], [20, 45, 90]] + >>> rotations = Rotation.from_euler('XYZ', angles, degrees=True) + + Create the interpolator object: + + >>> spline = RotationSpline(times, rotations) + + Interpolate the Euler angles, angular rate and acceleration: + + >>> angular_rate = np.rad2deg(spline(times, 1)) + >>> angular_acceleration = np.rad2deg(spline(times, 2)) + >>> times_plot = np.linspace(times[0], times[-1], 100) + >>> angles_plot = spline(times_plot).as_euler('XYZ', degrees=True) + >>> angular_rate_plot = np.rad2deg(spline(times_plot, 1)) + >>> angular_acceleration_plot = np.rad2deg(spline(times_plot, 2)) + + On this plot you see that Euler angles are continuous and smooth: + + >>> import matplotlib.pyplot as plt + >>> plt.plot(times_plot, angles_plot) + >>> plt.plot(times, angles, 'x') + >>> plt.title("Euler angles") + >>> plt.show() + + The angular rate is also smooth: + + >>> plt.plot(times_plot, angular_rate_plot) + >>> plt.plot(times, angular_rate, 'x') + >>> plt.title("Angular rate") + >>> plt.show() + + The angular acceleration is continuous, but not smooth. Also note that + the angular acceleration is not a piecewise-linear function, because + it is different from the second derivative of the rotation vector (which + is a piecewise-linear function as in the cubic spline). + + >>> plt.plot(times_plot, angular_acceleration_plot) + >>> plt.plot(times, angular_acceleration, 'x') + >>> plt.title("Angular acceleration") + >>> plt.show() + """ + # Parameters for the solver for angular rate. + MAX_ITER = 10 + TOL = 1e-9 + + def _solve_for_angular_rates(self, dt, angular_rates, rotvecs): + angular_rate_first = angular_rates[0].copy() + + A = _angular_rate_to_rotvec_dot_matrix(rotvecs) + A_inv = _rotvec_dot_to_angular_rate_matrix(rotvecs) + M = _create_block_3_diagonal_matrix( + 2 * A_inv[1:-1] / dt[1:-1, None, None], + 2 * A[1:-1] / dt[1:-1, None, None], + 4 * (1 / dt[:-1] + 1 / dt[1:])) + + b0 = 6 * (rotvecs[:-1] * dt[:-1, None] ** -2 + + rotvecs[1:] * dt[1:, None] ** -2) + b0[0] -= 2 / dt[0] * A_inv[0].dot(angular_rate_first) + b0[-1] -= 2 / dt[-1] * A[-1].dot(angular_rates[-1]) + + for iteration in range(self.MAX_ITER): + rotvecs_dot = _matrix_vector_product_of_stacks(A, angular_rates) + delta_beta = _angular_acceleration_nonlinear_term( + rotvecs[:-1], rotvecs_dot[:-1]) + b = b0 - delta_beta + angular_rates_new = solve_banded((5, 5), M, b.ravel()) + angular_rates_new = angular_rates_new.reshape((-1, 3)) + + delta = np.abs(angular_rates_new - angular_rates[:-1]) + angular_rates[:-1] = angular_rates_new + if np.all(delta < self.TOL * (1 + np.abs(angular_rates_new))): + break + + rotvecs_dot = _matrix_vector_product_of_stacks(A, angular_rates) + angular_rates = np.vstack((angular_rate_first, angular_rates[:-1])) + + return angular_rates, rotvecs_dot + + def __init__(self, times, rotations): + from scipy.interpolate import PPoly + + if rotations.single: + raise ValueError("`rotations` must be a sequence of rotations.") + + if len(rotations) == 1: + raise ValueError("`rotations` must contain at least 2 rotations.") + + times = np.asarray(times, dtype=float) + if times.ndim != 1: + raise ValueError("`times` must be 1-dimensional.") + + if len(times) != len(rotations): + raise ValueError("Expected number of rotations to be equal to " + "number of timestamps given, " + f"got {len(rotations)} rotations " + f"and {len(times)} timestamps.") + + dt = np.diff(times) + if np.any(dt <= 0): + raise ValueError("Values in `times` must be in a strictly " + "increasing order.") + + rotvecs = (rotations[:-1].inv() * rotations[1:]).as_rotvec() + angular_rates = rotvecs / dt[:, None] + + if len(rotations) == 2: + rotvecs_dot = angular_rates + else: + angular_rates, rotvecs_dot = self._solve_for_angular_rates( + dt, angular_rates, rotvecs) + + dt = dt[:, None] + coeff = np.empty((4, len(times) - 1, 3)) + coeff[0] = (-2 * rotvecs + dt * angular_rates + + dt * rotvecs_dot) / dt ** 3 + coeff[1] = (3 * rotvecs - 2 * dt * angular_rates + - dt * rotvecs_dot) / dt ** 2 + coeff[2] = angular_rates + coeff[3] = 0 + + self.times = times + self.rotations = rotations + self.interpolator = PPoly(coeff, times) + + def __call__(self, times, order=0): + """Compute interpolated values. + + Parameters + ---------- + times : float or array_like + Times of interest. + order : {0, 1, 2}, optional + Order of differentiation: + + * 0 (default) : return Rotation + * 1 : return the angular rate in rad/sec + * 2 : return the angular acceleration in rad/sec/sec + + Returns + ------- + Interpolated Rotation, angular rate or acceleration. + """ + if order not in [0, 1, 2]: + raise ValueError("`order` must be 0, 1 or 2.") + + times = np.asarray(times, dtype=float) + if times.ndim > 1: + raise ValueError("`times` must be at most 1-dimensional.") + + singe_time = times.ndim == 0 + times = np.atleast_1d(times) + + rotvecs = self.interpolator(times) + if order == 0: + index = np.searchsorted(self.times, times, side='right') + index -= 1 + index[index < 0] = 0 + n_segments = len(self.times) - 1 + index[index > n_segments - 1] = n_segments - 1 + result = self.rotations[index] * Rotation.from_rotvec(rotvecs) + elif order == 1: + rotvecs_dot = self.interpolator(times, 1) + result = _compute_angular_rate(rotvecs, rotvecs_dot) + elif order == 2: + rotvecs_dot = self.interpolator(times, 1) + rotvecs_dot_dot = self.interpolator(times, 2) + result = _compute_angular_acceleration(rotvecs, rotvecs_dot, + rotvecs_dot_dot) + else: + assert False + + if singe_time: + result = result[0] + + return result diff --git a/shared/package-files/07/075dbe8a6412ae95d92fcd5656d164ee41ad8c8eb264f216e21cea61d1f70e3b/blob b/shared/package-files/07/075dbe8a6412ae95d92fcd5656d164ee41ad8c8eb264f216e21cea61d1f70e3b/blob new file mode 100644 index 0000000000000000000000000000000000000000..ae490e987a4ff19dd378957ea85fc4bd45737a6b --- /dev/null +++ b/shared/package-files/07/075dbe8a6412ae95d92fcd5656d164ee41ad8c8eb264f216e21cea61d1f70e3b/blob @@ -0,0 +1,75 @@ +# utils is cimported from other subpackages so this is needed for the cimport +# to work +utils_cython_tree = [ + # We add sklearn_root_cython_tree to make sure sklearn/__init__.py is copied + # early in the build + sklearn_root_cython_tree, + fs.copyfile('__init__.py'), + fs.copyfile('_cython_blas.pxd'), + fs.copyfile('_heap.pxd'), + fs.copyfile('_openmp_helpers.pxd'), + fs.copyfile('_random.pxd'), + fs.copyfile('_sorting.pxd'), + fs.copyfile('_typedefs.pxd'), + fs.copyfile('_vector_sentinel.pxd'), +] + +utils_extension_metadata = { + 'sparsefuncs_fast': + {'sources': [cython_gen.process('sparsefuncs_fast.pyx')]}, + '_cython_blas': {'sources': [cython_gen.process('_cython_blas.pyx')]}, + 'arrayfuncs': {'sources': [cython_gen.process('arrayfuncs.pyx')]}, + 'murmurhash': { + 'sources': [cython_gen.process('murmurhash.pyx'), 'src' / 'MurmurHash3.cpp'], + }, + '_fast_dict': + {'sources': [cython_gen_cpp.process('_fast_dict.pyx')]}, + '_openmp_helpers': {'sources': [cython_gen.process('_openmp_helpers.pyx')], 'dependencies': [openmp_dep]}, + '_random': {'sources': [cython_gen.process('_random.pyx')]}, + '_typedefs': {'sources': [cython_gen.process('_typedefs.pyx')]}, + '_heap': {'sources': [cython_gen.process('_heap.pyx')]}, + '_sorting': {'sources': [cython_gen.process('_sorting.pyx')]}, + '_vector_sentinel': + {'sources': [cython_gen_cpp.process('_vector_sentinel.pyx')], + 'dependencies': [np_dep]}, + '_isfinite': {'sources': [cython_gen.process('_isfinite.pyx')]}, +} + +foreach ext_name, ext_dict : utils_extension_metadata + py.extension_module( + ext_name, + [ext_dict.get('sources'), utils_cython_tree], + dependencies: ext_dict.get('dependencies', []), + subdir: 'sklearn/utils', + install: true + ) +endforeach + +util_extension_names = ['_seq_dataset', '_weight_vector'] + +foreach name: util_extension_names + pxd = custom_target( + name + '_pxd', + output: name + '.pxd', + input: name + '.pxd.tp', + command: [tempita, '@INPUT@', '-o', '@OUTDIR@'], + ) + utils_cython_tree += [pxd] + + pyx = custom_target( + name + '_pyx', + output: name + '.pyx', + input: name + '.pyx.tp', + command: [tempita, '@INPUT@', '-o', '@OUTDIR@'], + # TODO in principle this should go in py.exension_module below. This is + # temporary work-around for dependency issue with .pyx.tp files. For more + # details, see https://github.com/mesonbuild/meson/issues/13212 + depends: [pxd, utils_cython_tree], + ) + py.extension_module( + name, + cython_gen.process(pyx), + subdir: 'sklearn/utils', + install: true + ) +endforeach diff --git a/shared/package-files/07/075ef443312538125563ad67559fea23fbcc5d1ceb7be2f51156c669f7a6313d/blob b/shared/package-files/07/075ef443312538125563ad67559fea23fbcc5d1ceb7be2f51156c669f7a6313d/blob new file mode 100644 index 0000000000000000000000000000000000000000..e1d6472d19315b8d5e63453a6de7b349abb58bb8 --- /dev/null +++ b/shared/package-files/07/075ef443312538125563ad67559fea23fbcc5d1ceb7be2f51156c669f7a6313d/blob @@ -0,0 +1,309 @@ +1700 5 +1701 11 +1702 16 +1703 23 +1704 36 +1705 58 +1706 29 +1707 20 +1708 10 +1709 8 +1710 3 +1711 0 +1712 0 +1713 2 +1714 11 +1715 27 +1716 47 +1717 63 +1718 60 +1719 39 +1720 28 +1721 26 +1722 22 +1723 11 +1724 21 +1725 40 +1726 78 +1727 122 +1728 103 +1729 73 +1730 47 +1731 35 +1732 11 +1733 5 +1734 16 +1735 34 +1736 70 +1737 81 +1738 111 +1739 101 +1740 73 +1741 40 +1742 20 +1743 16 +1744 5 +1745 11 +1746 22 +1747 40 +1748 60 +1749 80.9 +1750 83.4 +1751 47.7 +1752 47.8 +1753 30.7 +1754 12.2 +1755 9.6 +1756 10.2 +1757 32.4 +1758 47.6 +1759 54.0 +1760 62.9 +1761 85.9 +1762 61.2 +1763 45.1 +1764 36.4 +1765 20.9 +1766 11.4 +1767 37.8 +1768 69.8 +1769 106.1 +1770 100.8 +1771 81.6 +1772 66.5 +1773 34.8 +1774 30.6 +1775 7.0 +1776 19.8 +1777 92.5 +1778 154.4 +1779 125.9 +1780 84.8 +1781 68.1 +1782 38.5 +1783 22.8 +1784 10.2 +1785 24.1 +1786 82.9 +1787 132.0 +1788 130.9 +1789 118.1 +1790 89.9 +1791 66.6 +1792 60.0 +1793 46.9 +1794 41.0 +1795 21.3 +1796 16.0 +1797 6.4 +1798 4.1 +1799 6.8 +1800 14.5 +1801 34.0 +1802 45.0 +1803 43.1 +1804 47.5 +1805 42.2 +1806 28.1 +1807 10.1 +1808 8.1 +1809 2.5 +1810 0.0 +1811 1.4 +1812 5.0 +1813 12.2 +1814 13.9 +1815 35.4 +1816 45.8 +1817 41.1 +1818 30.1 +1819 23.9 +1820 15.6 +1821 6.6 +1822 4.0 +1823 1.8 +1824 8.5 +1825 16.6 +1826 36.3 +1827 49.6 +1828 64.2 +1829 67.0 +1830 70.9 +1831 47.8 +1832 27.5 +1833 8.5 +1834 13.2 +1835 56.9 +1836 121.5 +1837 138.3 +1838 103.2 +1839 85.7 +1840 64.6 +1841 36.7 +1842 24.2 +1843 10.7 +1844 15.0 +1845 40.1 +1846 61.5 +1847 98.5 +1848 124.7 +1849 96.3 +1850 66.6 +1851 64.5 +1852 54.1 +1853 39.0 +1854 20.6 +1855 6.7 +1856 4.3 +1857 22.7 +1858 54.8 +1859 93.8 +1860 95.8 +1861 77.2 +1862 59.1 +1863 44.0 +1864 47.0 +1865 30.5 +1866 16.3 +1867 7.3 +1868 37.6 +1869 74.0 +1870 139.0 +1871 111.2 +1872 101.6 +1873 66.2 +1874 44.7 +1875 17.0 +1876 11.3 +1877 12.4 +1878 3.4 +1879 6.0 +1880 32.3 +1881 54.3 +1882 59.7 +1883 63.7 +1884 63.5 +1885 52.2 +1886 25.4 +1887 13.1 +1888 6.8 +1889 6.3 +1890 7.1 +1891 35.6 +1892 73.0 +1893 85.1 +1894 78.0 +1895 64.0 +1896 41.8 +1897 26.2 +1898 26.7 +1899 12.1 +1900 9.5 +1901 2.7 +1902 5.0 +1903 24.4 +1904 42.0 +1905 63.5 +1906 53.8 +1907 62.0 +1908 48.5 +1909 43.9 +1910 18.6 +1911 5.7 +1912 3.6 +1913 1.4 +1914 9.6 +1915 47.4 +1916 57.1 +1917 103.9 +1918 80.6 +1919 63.6 +1920 37.6 +1921 26.1 +1922 14.2 +1923 5.8 +1924 16.7 +1925 44.3 +1926 63.9 +1927 69.0 +1928 77.8 +1929 64.9 +1930 35.7 +1931 21.2 +1932 11.1 +1933 5.7 +1934 8.7 +1935 36.1 +1936 79.7 +1937 114.4 +1938 109.6 +1939 88.8 +1940 67.8 +1941 47.5 +1942 30.6 +1943 16.3 +1944 9.6 +1945 33.2 +1946 92.6 +1947 151.6 +1948 136.3 +1949 134.7 +1950 83.9 +1951 69.4 +1952 31.5 +1953 13.9 +1954 4.4 +1955 38.0 +1956 141.7 +1957 190.2 +1958 184.8 +1959 159.0 +1960 112.3 +1961 53.9 +1962 37.6 +1963 27.9 +1964 10.2 +1965 15.1 +1966 47.0 +1967 93.8 +1968 105.9 +1969 105.5 +1970 104.5 +1971 66.6 +1972 68.9 +1973 38.0 +1974 34.5 +1975 15.5 +1976 12.6 +1977 27.5 +1978 92.5 +1979 155.4 +1980 154.6 +1981 140.4 +1982 115.9 +1983 66.6 +1984 45.9 +1985 17.9 +1986 13.4 +1987 29.4 +1988 100.2 +1989 157.6 +1990 142.6 +1991 145.7 +1992 94.3 +1993 54.6 +1994 29.9 +1995 17.5 +1996 8.6 +1997 21.5 +1998 64.3 +1999 93.3 +2000 119.6 +2001 111.0 +2002 104.0 +2003 63.7 +2004 40.4 +2005 29.8 +2006 15.2 +2007 7.5 +2008 2.9 diff --git a/shared/package-files/07/075f4f96188a23c8e180942ae9f2bfd92317b59d7ecaad11c867ba416c0f1e29/blob b/shared/package-files/07/075f4f96188a23c8e180942ae9f2bfd92317b59d7ecaad11c867ba416c0f1e29/blob new file mode 100644 index 0000000000000000000000000000000000000000..a69b0918c23bd9ecdf2e947b84fa64abfc2c7fc1 --- /dev/null +++ b/shared/package-files/07/075f4f96188a23c8e180942ae9f2bfd92317b59d7ecaad11c867ba416c0f1e29/blob @@ -0,0 +1,51 @@ +from typing import Any, Iterable, List, Optional, Sequence, TypeVar, Union + +from django.db.models.expressions import Combinable +from django.db.models.fields import Field, _ErrorMessagesToOverride, _FieldChoices, _ValidatorCallable + +from .mixins import CheckFieldDefaultMixin + +# __set__ value type +_ST = TypeVar("_ST") +# __get__ return type +_GT = TypeVar("_GT") + +class ArrayField(CheckFieldDefaultMixin, Field[_ST, _GT]): + _pyi_private_set_type: Union[Sequence[Any], Combinable] + _pyi_private_get_type: List[Any] + + empty_strings_allowed: bool = ... + default_error_messages: Any = ... + base_field: Any = ... + size: Any = ... + default_validators: Any = ... + from_db_value: Any = ... + def __init__( + self, + base_field: Field, + size: Optional[int] = ..., + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ) -> None: ... + @property + def description(self): ... + def get_transform(self, name: Any): ... diff --git a/shared/package-files/07/076241076fcd44fd36c4ae8309ad4f6bd22ec6b3f0c730f365b8b14246fb53d3/blob b/shared/package-files/07/076241076fcd44fd36c4ae8309ad4f6bd22ec6b3f0c730f365b8b14246fb53d3/blob new file mode 100644 index 0000000000000000000000000000000000000000..fa0b245d279e96724d5610f93bc3b3c8c22ca032 --- /dev/null +++ b/shared/package-files/07/076241076fcd44fd36c4ae8309ad4f6bd22ec6b3f0c730f365b8b14246fb53d3/blob @@ -0,0 +1,397 @@ +""" +Low-level helpers for the SecureTransport bindings. + +These are Python functions that are not directly related to the high-level APIs +but are necessary to get them to work. They include a whole bunch of low-level +CoreFoundation messing about and memory management. The concerns in this module +are almost entirely about trying to avoid memory leaks and providing +appropriate and useful assistance to the higher-level code. +""" +import base64 +import ctypes +import itertools +import os +import re +import ssl +import struct +import tempfile + +from .bindings import CFConst, CoreFoundation, Security + +# This regular expression is used to grab PEM data out of a PEM bundle. +_PEM_CERTS_RE = re.compile( + b"-----BEGIN CERTIFICATE-----\n(.*?)\n-----END CERTIFICATE-----", re.DOTALL +) + + +def _cf_data_from_bytes(bytestring): + """ + Given a bytestring, create a CFData object from it. This CFData object must + be CFReleased by the caller. + """ + return CoreFoundation.CFDataCreate( + CoreFoundation.kCFAllocatorDefault, bytestring, len(bytestring) + ) + + +def _cf_dictionary_from_tuples(tuples): + """ + Given a list of Python tuples, create an associated CFDictionary. + """ + dictionary_size = len(tuples) + + # We need to get the dictionary keys and values out in the same order. + keys = (t[0] for t in tuples) + values = (t[1] for t in tuples) + cf_keys = (CoreFoundation.CFTypeRef * dictionary_size)(*keys) + cf_values = (CoreFoundation.CFTypeRef * dictionary_size)(*values) + + return CoreFoundation.CFDictionaryCreate( + CoreFoundation.kCFAllocatorDefault, + cf_keys, + cf_values, + dictionary_size, + CoreFoundation.kCFTypeDictionaryKeyCallBacks, + CoreFoundation.kCFTypeDictionaryValueCallBacks, + ) + + +def _cfstr(py_bstr): + """ + Given a Python binary data, create a CFString. + The string must be CFReleased by the caller. + """ + c_str = ctypes.c_char_p(py_bstr) + cf_str = CoreFoundation.CFStringCreateWithCString( + CoreFoundation.kCFAllocatorDefault, + c_str, + CFConst.kCFStringEncodingUTF8, + ) + return cf_str + + +def _create_cfstring_array(lst): + """ + Given a list of Python binary data, create an associated CFMutableArray. + The array must be CFReleased by the caller. + + Raises an ssl.SSLError on failure. + """ + cf_arr = None + try: + cf_arr = CoreFoundation.CFArrayCreateMutable( + CoreFoundation.kCFAllocatorDefault, + 0, + ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks), + ) + if not cf_arr: + raise MemoryError("Unable to allocate memory!") + for item in lst: + cf_str = _cfstr(item) + if not cf_str: + raise MemoryError("Unable to allocate memory!") + try: + CoreFoundation.CFArrayAppendValue(cf_arr, cf_str) + finally: + CoreFoundation.CFRelease(cf_str) + except BaseException as e: + if cf_arr: + CoreFoundation.CFRelease(cf_arr) + raise ssl.SSLError("Unable to allocate array: %s" % (e,)) + return cf_arr + + +def _cf_string_to_unicode(value): + """ + Creates a Unicode string from a CFString object. Used entirely for error + reporting. + + Yes, it annoys me quite a lot that this function is this complex. + """ + value_as_void_p = ctypes.cast(value, ctypes.POINTER(ctypes.c_void_p)) + + string = CoreFoundation.CFStringGetCStringPtr( + value_as_void_p, CFConst.kCFStringEncodingUTF8 + ) + if string is None: + buffer = ctypes.create_string_buffer(1024) + result = CoreFoundation.CFStringGetCString( + value_as_void_p, buffer, 1024, CFConst.kCFStringEncodingUTF8 + ) + if not result: + raise OSError("Error copying C string from CFStringRef") + string = buffer.value + if string is not None: + string = string.decode("utf-8") + return string + + +def _assert_no_error(error, exception_class=None): + """ + Checks the return code and throws an exception if there is an error to + report + """ + if error == 0: + return + + cf_error_string = Security.SecCopyErrorMessageString(error, None) + output = _cf_string_to_unicode(cf_error_string) + CoreFoundation.CFRelease(cf_error_string) + + if output is None or output == u"": + output = u"OSStatus %s" % error + + if exception_class is None: + exception_class = ssl.SSLError + + raise exception_class(output) + + +def _cert_array_from_pem(pem_bundle): + """ + Given a bundle of certs in PEM format, turns them into a CFArray of certs + that can be used to validate a cert chain. + """ + # Normalize the PEM bundle's line endings. + pem_bundle = pem_bundle.replace(b"\r\n", b"\n") + + der_certs = [ + base64.b64decode(match.group(1)) for match in _PEM_CERTS_RE.finditer(pem_bundle) + ] + if not der_certs: + raise ssl.SSLError("No root certificates specified") + + cert_array = CoreFoundation.CFArrayCreateMutable( + CoreFoundation.kCFAllocatorDefault, + 0, + ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks), + ) + if not cert_array: + raise ssl.SSLError("Unable to allocate memory!") + + try: + for der_bytes in der_certs: + certdata = _cf_data_from_bytes(der_bytes) + if not certdata: + raise ssl.SSLError("Unable to allocate memory!") + cert = Security.SecCertificateCreateWithData( + CoreFoundation.kCFAllocatorDefault, certdata + ) + CoreFoundation.CFRelease(certdata) + if not cert: + raise ssl.SSLError("Unable to build cert object!") + + CoreFoundation.CFArrayAppendValue(cert_array, cert) + CoreFoundation.CFRelease(cert) + except Exception: + # We need to free the array before the exception bubbles further. + # We only want to do that if an error occurs: otherwise, the caller + # should free. + CoreFoundation.CFRelease(cert_array) + raise + + return cert_array + + +def _is_cert(item): + """ + Returns True if a given CFTypeRef is a certificate. + """ + expected = Security.SecCertificateGetTypeID() + return CoreFoundation.CFGetTypeID(item) == expected + + +def _is_identity(item): + """ + Returns True if a given CFTypeRef is an identity. + """ + expected = Security.SecIdentityGetTypeID() + return CoreFoundation.CFGetTypeID(item) == expected + + +def _temporary_keychain(): + """ + This function creates a temporary Mac keychain that we can use to work with + credentials. This keychain uses a one-time password and a temporary file to + store the data. We expect to have one keychain per socket. The returned + SecKeychainRef must be freed by the caller, including calling + SecKeychainDelete. + + Returns a tuple of the SecKeychainRef and the path to the temporary + directory that contains it. + """ + # Unfortunately, SecKeychainCreate requires a path to a keychain. This + # means we cannot use mkstemp to use a generic temporary file. Instead, + # we're going to create a temporary directory and a filename to use there. + # This filename will be 8 random bytes expanded into base64. We also need + # some random bytes to password-protect the keychain we're creating, so we + # ask for 40 random bytes. + random_bytes = os.urandom(40) + filename = base64.b16encode(random_bytes[:8]).decode("utf-8") + password = base64.b16encode(random_bytes[8:]) # Must be valid UTF-8 + tempdirectory = tempfile.mkdtemp() + + keychain_path = os.path.join(tempdirectory, filename).encode("utf-8") + + # We now want to create the keychain itself. + keychain = Security.SecKeychainRef() + status = Security.SecKeychainCreate( + keychain_path, len(password), password, False, None, ctypes.byref(keychain) + ) + _assert_no_error(status) + + # Having created the keychain, we want to pass it off to the caller. + return keychain, tempdirectory + + +def _load_items_from_file(keychain, path): + """ + Given a single file, loads all the trust objects from it into arrays and + the keychain. + Returns a tuple of lists: the first list is a list of identities, the + second a list of certs. + """ + certificates = [] + identities = [] + result_array = None + + with open(path, "rb") as f: + raw_filedata = f.read() + + try: + filedata = CoreFoundation.CFDataCreate( + CoreFoundation.kCFAllocatorDefault, raw_filedata, len(raw_filedata) + ) + result_array = CoreFoundation.CFArrayRef() + result = Security.SecItemImport( + filedata, # cert data + None, # Filename, leaving it out for now + None, # What the type of the file is, we don't care + None, # what's in the file, we don't care + 0, # import flags + None, # key params, can include passphrase in the future + keychain, # The keychain to insert into + ctypes.byref(result_array), # Results + ) + _assert_no_error(result) + + # A CFArray is not very useful to us as an intermediary + # representation, so we are going to extract the objects we want + # and then free the array. We don't need to keep hold of keys: the + # keychain already has them! + result_count = CoreFoundation.CFArrayGetCount(result_array) + for index in range(result_count): + item = CoreFoundation.CFArrayGetValueAtIndex(result_array, index) + item = ctypes.cast(item, CoreFoundation.CFTypeRef) + + if _is_cert(item): + CoreFoundation.CFRetain(item) + certificates.append(item) + elif _is_identity(item): + CoreFoundation.CFRetain(item) + identities.append(item) + finally: + if result_array: + CoreFoundation.CFRelease(result_array) + + CoreFoundation.CFRelease(filedata) + + return (identities, certificates) + + +def _load_client_cert_chain(keychain, *paths): + """ + Load certificates and maybe keys from a number of files. Has the end goal + of returning a CFArray containing one SecIdentityRef, and then zero or more + SecCertificateRef objects, suitable for use as a client certificate trust + chain. + """ + # Ok, the strategy. + # + # This relies on knowing that macOS will not give you a SecIdentityRef + # unless you have imported a key into a keychain. This is a somewhat + # artificial limitation of macOS (for example, it doesn't necessarily + # affect iOS), but there is nothing inside Security.framework that lets you + # get a SecIdentityRef without having a key in a keychain. + # + # So the policy here is we take all the files and iterate them in order. + # Each one will use SecItemImport to have one or more objects loaded from + # it. We will also point at a keychain that macOS can use to work with the + # private key. + # + # Once we have all the objects, we'll check what we actually have. If we + # already have a SecIdentityRef in hand, fab: we'll use that. Otherwise, + # we'll take the first certificate (which we assume to be our leaf) and + # ask the keychain to give us a SecIdentityRef with that cert's associated + # key. + # + # We'll then return a CFArray containing the trust chain: one + # SecIdentityRef and then zero-or-more SecCertificateRef objects. The + # responsibility for freeing this CFArray will be with the caller. This + # CFArray must remain alive for the entire connection, so in practice it + # will be stored with a single SSLSocket, along with the reference to the + # keychain. + certificates = [] + identities = [] + + # Filter out bad paths. + paths = (path for path in paths if path) + + try: + for file_path in paths: + new_identities, new_certs = _load_items_from_file(keychain, file_path) + identities.extend(new_identities) + certificates.extend(new_certs) + + # Ok, we have everything. The question is: do we have an identity? If + # not, we want to grab one from the first cert we have. + if not identities: + new_identity = Security.SecIdentityRef() + status = Security.SecIdentityCreateWithCertificate( + keychain, certificates[0], ctypes.byref(new_identity) + ) + _assert_no_error(status) + identities.append(new_identity) + + # We now want to release the original certificate, as we no longer + # need it. + CoreFoundation.CFRelease(certificates.pop(0)) + + # We now need to build a new CFArray that holds the trust chain. + trust_chain = CoreFoundation.CFArrayCreateMutable( + CoreFoundation.kCFAllocatorDefault, + 0, + ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks), + ) + for item in itertools.chain(identities, certificates): + # ArrayAppendValue does a CFRetain on the item. That's fine, + # because the finally block will release our other refs to them. + CoreFoundation.CFArrayAppendValue(trust_chain, item) + + return trust_chain + finally: + for obj in itertools.chain(identities, certificates): + CoreFoundation.CFRelease(obj) + + +TLS_PROTOCOL_VERSIONS = { + "SSLv2": (0, 2), + "SSLv3": (3, 0), + "TLSv1": (3, 1), + "TLSv1.1": (3, 2), + "TLSv1.2": (3, 3), +} + + +def _build_tls_unknown_ca_alert(version): + """ + Builds a TLS alert record for an unknown CA. + """ + ver_maj, ver_min = TLS_PROTOCOL_VERSIONS[version] + severity_fatal = 0x02 + description_unknown_ca = 0x30 + msg = struct.pack(">BB", severity_fatal, description_unknown_ca) + msg_len = len(msg) + record_type_alert = 0x15 + record = struct.pack(">BBBH", record_type_alert, ver_maj, ver_min, msg_len) + msg + return record diff --git a/shared/package-files/07/07655545cc2ac093d94312c148a5ebdeda482803aecf2aa3311cb38ac020ed55/blob b/shared/package-files/07/07655545cc2ac093d94312c148a5ebdeda482803aecf2aa3311cb38ac020ed55/blob new file mode 100644 index 0000000000000000000000000000000000000000..2ece5f4bd66c14fcb5d5f765bb6d2e739db43d2b --- /dev/null +++ b/shared/package-files/07/07655545cc2ac093d94312c148a5ebdeda482803aecf2aa3311cb38ac020ed55/blob @@ -0,0 +1,790 @@ +# Copyright (C) 2014 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""This file handles the parsing of feature specifications from files, +ending up with a configuration matrix""" +import os.path +import re +import sys +from collections import OrderedDict +from copy import copy +from functools import lru_cache +from itertools import product + +import yaml + +from .conda_interface import cc_conda_build, subdir +from .utils import ensure_list, get_logger, islist, on_win, trim_empty_keys +from .version import _parse as parse_version + +DEFAULT_VARIANTS = { + "python": f"{sys.version_info.major}.{sys.version_info.minor}", + "numpy": { + # (python): numpy_version, # range of versions built for given python + (3, 8): "1.22", # 1.19-1.24 + (3, 9): "1.22", # 1.19-1.26 + (3, 10): "1.22", # 1.21-1.26 + (3, 11): "1.23", # 1.23-1.26 + (3, 12): "1.26", # 1.26- + }.get(sys.version_info[:2], "1.26"), + # this one actually needs to be pretty specific. The reason is that cpan skeleton uses the + # version to say what's in their standard library. + "perl": "5.26.2", + "lua": "5", + "r_base": "3.4" if on_win else "3.5", + "cpu_optimization_target": "nocona", + "pin_run_as_build": { + "python": {"min_pin": "x.x", "max_pin": "x.x"}, + "r-base": {"min_pin": "x.x", "max_pin": "x.x"}, + }, + "ignore_version": [], + "ignore_build_only_deps": ["python", "numpy"], + "extend_keys": [ + "pin_run_as_build", + "ignore_version", + "ignore_build_only_deps", + "extend_keys", + ], + "cran_mirror": "https://cran.r-project.org", +} + +# map python version to default compiler on windows, to match upstream python +# This mapping only sets the "native" compiler, and can be overridden by specifying a compiler +# in the conda-build variant configuration +DEFAULT_COMPILERS = { + "win": { + "c": { + "2.7": "vs2008", + "3.3": "vs2010", + "3.4": "vs2010", + "3.5": "vs2017", + }, + "cxx": { + "2.7": "vs2008", + "3.3": "vs2010", + "3.4": "vs2010", + "3.5": "vs2017", + }, + "vc": { + "2.7": "9", + "3.3": "10", + "3.4": "10", + "3.5": "14", + }, + "fortran": "gfortran", + }, + "linux": { + "c": "gcc", + "cxx": "gxx", + "fortran": "gfortran", + }, + "osx": { + "c": "clang", + "cxx": "clangxx", + "fortran": "gfortran", + }, +} + +arch_name = subdir.rsplit("-", 1)[-1] + +SUFFIX_MAP = { + "PY": "python", + "NPY": "numpy", + "LUA": "lua", + "PERL": "perl", + "R": "r_base", +} + + +@lru_cache(maxsize=None) +def _get_default_compilers(platform, py_ver): + compilers = DEFAULT_COMPILERS[platform].copy() + if platform == "win": + if parse_version(py_ver) >= parse_version("3.5"): + py_ver = "3.5" + elif parse_version(py_ver) <= parse_version("3.2"): + py_ver = "2.7" + compilers["c"] = compilers["c"][py_ver] + compilers["cxx"] = compilers["cxx"][py_ver] + compilers = { + lang + "_compiler": pkg_name + for lang, pkg_name in compilers.items() + if lang != "vc" + } + # this one comes after, because it's not a _compiler key + if platform == "win": + compilers["vc"] = DEFAULT_COMPILERS[platform]["vc"][py_ver] + return compilers + + +def get_default_variant(config): + base = DEFAULT_VARIANTS.copy() + base["target_platform"] = config.subdir + python = ( + base["python"] + if (not hasattr(config, "variant") or not config.variant.get("python")) + else config.variant["python"] + ) + base.update(_get_default_compilers(config.platform, python)) + return base + + +def parse_config_file(path, config): + from .metadata import get_selectors, select_lines + + with open(path) as f: + contents = f.read() + contents = select_lines(contents, get_selectors(config), variants_in_place=False) + content = yaml.load(contents, Loader=yaml.loader.BaseLoader) or {} + trim_empty_keys(content) + return content + + +def validate_spec(src, spec): + errors = [] + + # check for invalid characters + errors.extend( + f" {k} key contains an invalid character '-'" for k in spec if "-" in k + ) + + # check for properly formatted zip_key + try: + zip_keys = _get_zip_keys(spec) + except ValueError as e: + errors.append(str(e)) + else: + # check if every zip field is defined + errors.extend( + f" zip_key entry {k} in group {zg} does not have any settings" + for zg in zip_keys + for k in zg + # include error if key is not defined in spec + if k not in spec + ) + + # check for duplicate keys + unique = set() + errors.extend( + f" zip_key entry {k} in group {zg} is a duplicate, keys can only occur " + "in one group" + # include error if key has already been seen, otherwise add to unique keys + if k in unique + else unique.add(k) + for zg in zip_keys + for k in zg + ) + + # check that all zip fields within a zip_group are the same length + errors.extend( + f" zip fields in zip_key group {zg} are not all the same length" + for zg in zip_keys + # include error if all zip fields in a zip_group are the same size, + # ignore missing fields + if len( + {len(ensure_list(spec[k])) if k in spec else None for k in zg} - {None} + ) + > 1 + ) + + # filter out None values that were potentially added above + errors = list(filter(None, errors)) + if errors: + raise ValueError( + "Variant configuration errors in {}:\n{}".format(src, "\n".join(errors)) + ) + + +def find_config_files(metadata_or_path, config): + """ + Find config files to load. Config files are stacked in the following order: + 1. exclusive config files (see config.exclusive_config_files) + 2. user config files + (see context.conda_build["config_file"] or ~/conda_build_config.yaml) + 3. cwd config files (see ./conda_build_config.yaml) + 4. recipe config files (see ${RECIPE_DIR}/conda_build_config.yaml) + 5. additional config files (see config.variant_config_files) + + .. note:: + Order determines clobbering with later files clobbering earlier ones. + + :param metadata_or_path: the metadata or path within which to find recipe config files + :type metadata_or_path: + :param config: config object specifying config file settings + (see exclusive_config_files, ignore_system_variants, and variant_config_files) + :type config: :class:`Config` + :return: List of config files + :rtype: `list` of paths (`str`) + """ + resolve = lambda p: os.path.abspath(os.path.expanduser(os.path.expandvars(p))) + + # exclusive configs + files = [resolve(f) for f in ensure_list(config.exclusive_config_files)] + + if not files and not config.ignore_system_variants: + # user config + if cc_conda_build.get("config_file"): + cfg = resolve(cc_conda_build["config_file"]) + else: + cfg = resolve(os.path.join("~", "conda_build_config.yaml")) + if os.path.isfile(cfg): + files.append(cfg) + + cfg = resolve("conda_build_config.yaml") + if os.path.isfile(cfg): + files.append(cfg) + + path = getattr(metadata_or_path, "path", metadata_or_path) + cfg = resolve(os.path.join(path, "conda_build_config.yaml")) + if os.path.isfile(cfg): + files.append(cfg) + + files.extend([resolve(f) for f in ensure_list(config.variant_config_files)]) + + return files + + +def _combine_spec_dictionaries( + specs, extend_keys=None, filter_keys=None, zip_keys=None, log_output=True +): + # each spec is a dictionary. Each subsequent spec replaces the previous one. + # Only the last one with the key stays. + values = {} + keys = ensure_list(filter_keys) + extend_keys = ensure_list(extend_keys) + + for spec_source, spec in specs.items(): + if spec: + if log_output: + log = get_logger(__name__) + log.info(f"Adding in variants from {spec_source}") + for k, v in spec.items(): + if not keys or k in keys: + if k in extend_keys: + # update dictionaries, extend lists + if hasattr(v, "keys"): + if k in values and hasattr(values[k], "keys"): + values[k].update(v) + else: + values[k] = v.copy() + else: + values[k] = ensure_list(values.get(k, [])) + values[k].extend(ensure_list(v)) + # uniquify + values[k] = list(set(values[k])) + elif k == "zip_keys": + v = [subval for subval in v if subval] + if not isinstance(v[0], list) and not isinstance(v[0], tuple): + v = [v] + # should always be a list of lists, but users may specify as just a list + values[k] = values.get(k, []) + values[k].extend(v) + values[k] = list( + list(set_group) + for set_group in {tuple(group) for group in values[k]} + ) + else: + if hasattr(v, "keys"): + values[k] = v.copy() + else: + # default "group" is just this one key. We latch onto other groups if + # they exist + keys_in_group = [k] + if zip_keys: + for group in zip_keys: + if k in group: + keys_in_group = group + break + # in order to clobber, one must replace ALL of the zipped keys. + # or the length must match with the other items in the group + # Otherwise, we filter later. + if all(group_item in spec for group_item in keys_in_group): + for group_item in keys_in_group: + if len(ensure_list(spec[group_item])) != len( + ensure_list(v) + ): + raise ValueError( + "All entries associated by a zip_key " + "field must be the same length. In {}, {} and {} are " + "different ({} and {})".format( + spec_source, + k, + group_item, + len(ensure_list(v)), + len(ensure_list(spec[group_item])), + ) + ) + values[group_item] = ensure_list(spec[group_item]) + elif k in values: + for group_item in keys_in_group: + if group_item in spec and len( + ensure_list(spec[group_item]) + ) != len(ensure_list(v)): + break + if group_item in values and len( + ensure_list(values[group_item]) + ) != len(ensure_list(v)): + break + else: + values[k] = v.copy() + missing_subvalues = [ + subvalue + for subvalue in ensure_list(v) + if subvalue not in values[k] + ] + missing_group_items = [ + group_item + for group_item in keys_in_group + if group_item not in spec + ] + if len(missing_subvalues): + raise ValueError( + "variant config in {} is ambiguous because it\n" + "does not fully implement all zipped keys (To be clear: missing {})\n" + "or specifies a subspace that is not fully implemented (To be clear:\n" + ".. we did not find {} from {} in {}:{}).".format( + spec_source, + missing_group_items, + missing_subvalues, + spec, + k, + values[k], + ) + ) + + return values + + +def combine_specs(specs, log_output=True): + """With arbitrary sets of sources, combine into a single aggregate spec. + + Later specs in the input set have priority and overwrite duplicate entries. + + specs: list of dictionaries. Keys are arbitrary, but correspond to variable + names used in Jinja2 templated recipes. Values can be either single + values (strings or integers), or collections (lists, tuples, sets). + """ + extend_keys = DEFAULT_VARIANTS["extend_keys"][:] + extend_keys.extend( + [ + key + for spec in specs.values() + if spec + for key in ensure_list(spec.get("extend_keys")) + ] + ) + + # first pass gets zip_keys entries from each and merges them. We treat these specially + # below, keeping the size of related fields identical, or else the zipping makes no sense + + zip_keys = _combine_spec_dictionaries( + specs, extend_keys=extend_keys, filter_keys=["zip_keys"], log_output=log_output + ).get("zip_keys", []) + values = _combine_spec_dictionaries( + specs, extend_keys=extend_keys, zip_keys=zip_keys, log_output=log_output + ) + return values + + +def set_language_env_vars(variant): + """Given args passed into conda command, set language env vars to be made available. + + Search terms: CONDA_PY, CONDA_R, CONDA_PERL, CONDA_LUA, CONDA_NPY + """ + inverse_map = {v: k for k, v in SUFFIX_MAP.items()} + env = {} + for variant_name, env_var_name in inverse_map.items(): + if variant_name in variant: + value = str(variant[variant_name]) + # legacy compatibility: python should be just first + if env_var_name == "PY": + value = "".join(value.split(".")[:2]) + env["CONDA_" + env_var_name] = value + return env + + +def _get_zip_keys(spec): + """ + Extracts 'zip_keys' from `spec` and standardizes value into a list of zip_groups + (tuples of keys (string)). + + :param spec: Variants specification + :type spec: dict + :return: Standardized 'zip_keys' value + :rtype: set + :raise ValueError: 'zip_keys' cannot be standardized + """ + zip_keys = spec.get("zip_keys") + if not zip_keys: + return set() + elif islist(zip_keys, uniform=lambda e: isinstance(e, str)): + return {frozenset(zip_keys)} + elif islist( + zip_keys, uniform=lambda e: islist(e, uniform=lambda e: isinstance(e, str)) + ): + return {frozenset(zg) for zg in zip_keys} + + raise ValueError("'zip_keys' expect list of string or list of lists of string") + + +def _get_extend_keys(spec, include_defaults=True): + """ + Extracts 'extend_keys' from `spec`. + + :param spec: Variants specification + :type spec: dict + :param include_defaults: Whether to include default 'extend_keys' + :type include_defaults: bool, optional + :return: Standardized 'extend_keys' value + :rtype: set + """ + extend_keys = {"zip_keys", "extend_keys"} + if include_defaults: + extend_keys.update(DEFAULT_VARIANTS["extend_keys"]) + return extend_keys.union(ensure_list(spec.get("extend_keys"))) + + +def _get_passthru_keys(spec, zip_keys=None, extend_keys=None): + """ + Keys in `spec` that are not exploded and are simply carried over from the `spec` + into the variants without modification. + + :param spec: Variants specification + :type spec: dict + :param zip_keys: Keys defined as 'zip_keys' (see :func:`_get_zip_keys`) + :type zip_keys: set, optional + :param extend_keys: Keys defined as 'extend_keys' (see :func:`_get_extend_keys`) + :type extend_keys: set, optional + :return: Passthru (not exploded) keys defined in `spec` + :rtype: set + """ + if zip_keys is None: + zip_keys = _get_zip_keys(spec) + if extend_keys is None: + extend_keys = _get_extend_keys(spec) + passthru_keys = {"replacements", "extend_keys", "zip_keys"} + return passthru_keys.union(extend_keys).difference(*zip_keys).intersection(spec) + + +def _get_explode_keys(spec, passthru_keys=None, zip_keys=None, extend_keys=None): + """ + Keys in `spec` that are that are exploding into the variants. + + :param spec: Variants specification + :type spec: dict + :param passthru_keys: Passthru (not exploded) keys (see :func:`_get_passthru_keys`) + :type passthru_keys: set, optional + :param zip_keys: Keys defined as 'zip_keys' (see :func:`_get_zip_keys`) and is passed + to :func:`_get_passthru_keys` if `passthru_keys` is undefined + :type zip_keys: set, optional + :param extend_keys: Keys defined as 'extend_keys' (see :func:`_get_extend_keys`) and + is passed to :func:`_get_passthru_keys` if `passthru_keys` is + undefined + :type extend_keys: set, optional + :return: Exploded keys defined in `spec` + :rtype: set + """ + if passthru_keys is None: + passthru_keys = _get_passthru_keys(spec, zip_keys, extend_keys) + return set(spec).difference(passthru_keys) + + +def filter_by_key_value(variants, key, values, source_name): + """variants is the exploded out list of dicts, with one value per key in each dict. + key and values come from subsequent variants before they are exploded out.""" + reduced_variants = [] + if hasattr(values, "keys"): + reduced_variants = variants + else: + # break this out into a full loop so that we can show filtering output + for variant in variants: + if variant.get(key) is not None and variant.get(key) in values: + reduced_variants.append(variant) + else: + log = get_logger(__name__) + log.debug( + f"Filtering variant with key {key} not matching target value(s) " + f"({values}) from {source_name}, actual {variant.get(key)}" + ) + return reduced_variants + + +@lru_cache(maxsize=None) +def _split_str(string, char): + return string.split(char) + + +def explode_variants(spec): + """ + Helper function to explode spec into all of the variants. + + .. code-block:: pycon + >>> spec = { + ... # normal expansions + ... "foo": [2.7, 3.7, 3.8], + ... # zip_keys are the values that need to be exploded as a set + ... "zip_keys": [["bar", "baz"], ["qux", "quux", "quuz"]], + ... "bar": [1, 2, 3], + ... "baz": [2, 4, 6], + ... "qux": [4, 5], + ... "quux": [8, 10], + ... "quuz": [12, 15], + ... # extend_keys are those values which we do not explode + ... "extend_keys": ["corge"], + ... "corge": 42, + ... } + + >>> explode_variants(spec) + [{ + "foo": 2.7, + "bar": 1, "baz": 2, + "qux": 4, "quux": 8, "quuz": 12, + "corge": 42, + "zip_keys": ..., "extend_keys": ..., + }, + { + "foo": 2.7, + "bar": 1, "baz": 2, + "qux": 5, "quux": 10, "quuz": 15, + "corge": 42, + ..., + }, ...] + + :param spec: Specification to explode + :type spec: `dict` + :return: Exploded specification + :rtype: `list` of `dict` + """ + zip_keys = _get_zip_keys(spec) + + # key/values from spec that do not explode + passthru_keys = _get_passthru_keys(spec, zip_keys) + passthru = {k: spec[k] for k in passthru_keys if spec[k] or spec[k] == ""} + + # key/values from spec that do explode + explode_keys = _get_explode_keys(spec, passthru_keys) + explode = { + (k,): [ensure_list(v, include_dict=False) for v in ensure_list(spec[k])] + for k in explode_keys.difference(*zip_keys) + } + explode.update( + {zg: list(zip(*(ensure_list(spec[k]) for k in zg))) for zg in zip_keys} + ) + trim_empty_keys(explode) + + # Cartesian Product of dict of lists + # http://stackoverflow.com/a/5228294/1170370 + # dict.keys() and dict.values() orders are the same even prior to Python 3.6 + variants = [] + for values in product(*explode.values()): + variant = {k: copy(v) for k, v in passthru.items()} + variant.update( + {k: v for zg, zv in zip(explode, values) for k, v in zip(zg, zv)} + ) + variants.append(variant) + return variants + + +# temporary backport for other places in cond_build +dict_of_lists_to_list_of_dicts = explode_variants + + +def list_of_dicts_to_dict_of_lists(list_of_dicts): + """Opposite of dict_of_lists_to_list_of_dicts function. + + Take broken out collection of variants, and squish it into a dict, where each value is a list. + Only squishes string/int values; does "update" for dict keys + """ + if not list_of_dicts: + return + squished = OrderedDict() + all_zip_keys = set() + groups = None + zip_key_groups = ( + list_of_dicts[0]["zip_keys"] + if "zip_keys" in list_of_dicts[0] and list_of_dicts[0]["zip_keys"] + else [] + ) + if zip_key_groups: + if isinstance(list_of_dicts[0]["zip_keys"][0], list) or isinstance( + list_of_dicts[0]["zip_keys"][0], tuple + ): + groups = list_of_dicts[0]["zip_keys"] + else: + groups = [list_of_dicts[0]["zip_keys"]] + for group in groups: + for item in group: + all_zip_keys.add(item) + for variant in list_of_dicts: + for k, v in variant.items(): + if k == "zip_keys": + continue + if hasattr(v, "keys"): + existing_value = squished.get(k, OrderedDict()) + existing_value.update(v) + squished[k] = existing_value + elif isinstance(v, list): + squished[k] = set(squished.get(k, set())) | set(v) + else: + squished[k] = list(squished.get(k, [])) + ensure_list(v) + if k not in all_zip_keys: + squished[k] = list(set(squished[k])) + # reduce the combinatoric space of the zipped keys, too: + if groups: + for group in groups: + values = list(zip(*set(zip(*(squished[key] for key in group))))) + for idx, key in enumerate(group): + squished[key] = values[idx] + squished["zip_keys"] = zip_key_groups + return squished + + +def get_package_combined_spec(recipedir_or_metadata, config=None, variants=None): + # outputs a tuple of (combined_spec_dict_of_lists, used_spec_file_dict) + # + # The output of this function is order preserving, unlike get_package_variants + if hasattr(recipedir_or_metadata, "config"): + config = recipedir_or_metadata.config + if not config: + from .config import Config + + config = Config() + files = find_config_files(recipedir_or_metadata, config) + + specs = OrderedDict(internal_defaults=get_default_variant(config)) + + for f in files: + specs[f] = parse_config_file(f, config) + + # this is the override of the variants from files and args with values from CLI or env vars + if hasattr(config, "variant") and config.variant: + specs["config.variant"] = config.variant + if variants: + specs["argument_variants"] = variants + + for f, spec in specs.items(): + validate_spec(f, spec) + + # this merges each of the specs, providing a debug message when a given setting is overridden + # by a later spec + combined_spec = combine_specs(specs, log_output=config.verbose) + return combined_spec, specs + + +def filter_combined_spec_to_used_keys(combined_spec, specs): + extend_keys = _get_extend_keys(combined_spec) + + # delete the default specs, so that they don't unnecessarily limit the matrix + specs = specs.copy() + del specs["internal_defaults"] + + # TODO: act here? + combined_spec = explode_variants(combined_spec) + # seen_keys makes sure that a setting from a lower-priority spec doesn't clobber + # the same setting that has been redefined in a higher-priority spec. + seen_keys = set() + # The specs are checked from high to low priority order. + for source, source_specs in reversed(specs.items()): + for k, vs in source_specs.items(): + if k not in extend_keys and k not in seen_keys: + # when filtering ends up killing off all variants, we just ignore that. Generally, + # this arises when a later variant config overrides, rather than selects a + # subspace of earlier configs + combined_spec = ( + filter_by_key_value(combined_spec, k, vs, source_name=source) + or combined_spec + ) + seen_keys.add(k) + return combined_spec + + +def get_package_variants(recipedir_or_metadata, config=None, variants=None): + combined_spec, specs = get_package_combined_spec( + recipedir_or_metadata, config=config, variants=variants + ) + return filter_combined_spec_to_used_keys(combined_spec, specs=specs) + + +def get_vars(variants, loop_only=False): + """For purposes of naming/identifying, provide a way of identifying which variables contribute + to the matrix dimensionality""" + special_keys = {"pin_run_as_build", "zip_keys", "ignore_version"} + special_keys.update(set(ensure_list(variants[0].get("extend_keys")))) + loop_vars = [ + k + for k in variants[0] + if k not in special_keys + and ( + not loop_only + or any(variant[k] != variants[0][k] for variant in variants[1:]) + ) + ] + return loop_vars + + +@lru_cache(maxsize=None) +def find_used_variables_in_text(variant, recipe_text, selectors_only=False): + used_variables = set() + recipe_lines = recipe_text.splitlines() + for v in variant: + all_res = [] + target_match = re.match(r"(.*?)_(compiler|stdlib)(_version)?$", v) + if target_match and not selectors_only: + target_lang = target_match.group(1) + target_kind = target_match.group(2) + target_lang_regex = re.escape(target_lang) + target_regex = ( + rf"\{{\s*{target_kind}\([\'\"]{target_lang_regex}[\"\'][^\{{]*?\}}" + ) + all_res.append(target_regex) + variant_lines = [ + line for line in recipe_lines if v in line or target_lang in line + ] + else: + variant_lines = [ + line for line in recipe_lines if v in line.replace("-", "_") + ] + if not variant_lines: + continue + v_regex = re.escape(v) + v_req_regex = "[-_]".join(map(re.escape, v.split("_"))) + variant_regex = r"\{\s*(?:pin_[a-z]+\(\s*?['\"])?%s[^'\"]*?\}\}" % v_regex + selector_regex = r"^[^#\[]*?\#?\s\[[^\]]*?(?!\]]" % v_regex + conditional_regex = ( + r"(?:^|[^\{])\{%\s*(?:el)?if\s*.*" + v_regex + r"\s*(?:[^%]*?)?%\}" + ) + # plain req name, no version spec. Look for end of line after name, or comment or selector + requirement_regex = r"^\s+\-\s+%s\s*(?:\s[\[#]|$)" % v_req_regex + if selectors_only: + all_res.insert(0, selector_regex) + else: + all_res.extend([variant_regex, requirement_regex, conditional_regex]) + # consolidate all re's into one big one for speedup + all_res = r"|".join(all_res) + if any(re.search(all_res, line) for line in variant_lines): + used_variables.add(v) + if v in ("c_stdlib", "c_compiler", "cxx_compiler"): + if "CONDA_BUILD_SYSROOT" in variant: + used_variables.add("CONDA_BUILD_SYSROOT") + return used_variables + + +def find_used_variables_in_shell_script(variant, file_path): + with open(file_path) as f: + text = f.read() + used_variables = set() + for v in variant: + variant_regex = r"(^[^$]*?\$\{?\s*%s\s*[\s|\}])" % v + if re.search(variant_regex, text, flags=re.MULTILINE | re.DOTALL): + used_variables.add(v) + return used_variables + + +def find_used_variables_in_batch_script(variant, file_path): + with open(file_path) as f: + text = f.read() + used_variables = set() + for v in variant: + variant_regex = r"\%" + v + r"\%" + if re.search(variant_regex, text, flags=re.MULTILINE | re.DOTALL): + used_variables.add(v) + return used_variables diff --git a/shared/package-files/07/07684da9f83bb92c2185fcfac38e3fbbd7d24567f2366394c30f9f6f1ebd778a/blob b/shared/package-files/07/07684da9f83bb92c2185fcfac38e3fbbd7d24567f2366394c30f9f6f1ebd778a/blob new file mode 100644 index 0000000000000000000000000000000000000000..b52144d48aa3ac418175cadb781e00f1a0d4ce10 Binary files /dev/null and b/shared/package-files/07/07684da9f83bb92c2185fcfac38e3fbbd7d24567f2366394c30f9f6f1ebd778a/blob differ diff --git a/shared/package-files/07/0768d3ec112cc82499994c47e9162b3fd81519e5cb9f49cb860313f6014e0d6e/blob b/shared/package-files/07/0768d3ec112cc82499994c47e9162b3fd81519e5cb9f49cb860313f6014e0d6e/blob new file mode 100644 index 0000000000000000000000000000000000000000..ad1b005d09dbe7b424a59bd1cd52bb81d9191633 --- /dev/null +++ b/shared/package-files/07/0768d3ec112cc82499994c47e9162b3fd81519e5cb9f49cb860313f6014e0d6e/blob @@ -0,0 +1,590 @@ +""" +Definition of physical dimensions. + +Unit systems will be constructed on top of these dimensions. + +Most of the examples in the doc use MKS system and are presented from the +computer point of view: from a human point, adding length to time is not legal +in MKS but it is in natural system; for a computer in natural system there is +no time dimension (but a velocity dimension instead) - in the basis - so the +question of adding time to length has no meaning. +""" + +from __future__ import annotations + +import collections +from functools import reduce + +from sympy.core.basic import Basic +from sympy.core.containers import (Dict, Tuple) +from sympy.core.singleton import S +from sympy.core.sorting import default_sort_key +from sympy.core.symbol import Symbol +from sympy.core.sympify import sympify +from sympy.matrices.dense import Matrix +from sympy.functions.elementary.trigonometric import TrigonometricFunction +from sympy.core.expr import Expr +from sympy.core.power import Pow + + +class _QuantityMapper: + + _quantity_scale_factors_global: dict[Expr, Expr] = {} + _quantity_dimensional_equivalence_map_global: dict[Expr, Expr] = {} + _quantity_dimension_global: dict[Expr, Expr] = {} + + def __init__(self, *args, **kwargs): + self._quantity_dimension_map = {} + self._quantity_scale_factors = {} + + def set_quantity_dimension(self, quantity, dimension): + """ + Set the dimension for the quantity in a unit system. + + If this relation is valid in every unit system, use + ``quantity.set_global_dimension(dimension)`` instead. + """ + from sympy.physics.units import Quantity + dimension = sympify(dimension) + if not isinstance(dimension, Dimension): + if dimension == 1: + dimension = Dimension(1) + else: + raise ValueError("expected dimension or 1") + elif isinstance(dimension, Quantity): + dimension = self.get_quantity_dimension(dimension) + self._quantity_dimension_map[quantity] = dimension + + def set_quantity_scale_factor(self, quantity, scale_factor): + """ + Set the scale factor of a quantity relative to another quantity. + + It should be used only once per quantity to just one other quantity, + the algorithm will then be able to compute the scale factors to all + other quantities. + + In case the scale factor is valid in every unit system, please use + ``quantity.set_global_relative_scale_factor(scale_factor)`` instead. + """ + from sympy.physics.units import Quantity + from sympy.physics.units.prefixes import Prefix + scale_factor = sympify(scale_factor) + # replace all prefixes by their ratio to canonical units: + scale_factor = scale_factor.replace( + lambda x: isinstance(x, Prefix), + lambda x: x.scale_factor + ) + # replace all quantities by their ratio to canonical units: + scale_factor = scale_factor.replace( + lambda x: isinstance(x, Quantity), + lambda x: self.get_quantity_scale_factor(x) + ) + self._quantity_scale_factors[quantity] = scale_factor + + def get_quantity_dimension(self, unit): + from sympy.physics.units import Quantity + # First look-up the local dimension map, then the global one: + if unit in self._quantity_dimension_map: + return self._quantity_dimension_map[unit] + if unit in self._quantity_dimension_global: + return self._quantity_dimension_global[unit] + if unit in self._quantity_dimensional_equivalence_map_global: + dep_unit = self._quantity_dimensional_equivalence_map_global[unit] + if isinstance(dep_unit, Quantity): + return self.get_quantity_dimension(dep_unit) + else: + return Dimension(self.get_dimensional_expr(dep_unit)) + if isinstance(unit, Quantity): + return Dimension(unit.name) + else: + return Dimension(1) + + def get_quantity_scale_factor(self, unit): + if unit in self._quantity_scale_factors: + return self._quantity_scale_factors[unit] + if unit in self._quantity_scale_factors_global: + mul_factor, other_unit = self._quantity_scale_factors_global[unit] + return mul_factor*self.get_quantity_scale_factor(other_unit) + return S.One + + +class Dimension(Expr): + """ + This class represent the dimension of a physical quantities. + + The ``Dimension`` constructor takes as parameters a name and an optional + symbol. + + For example, in classical mechanics we know that time is different from + temperature and dimensions make this difference (but they do not provide + any measure of these quantites. + + >>> from sympy.physics.units import Dimension + >>> length = Dimension('length') + >>> length + Dimension(length) + >>> time = Dimension('time') + >>> time + Dimension(time) + + Dimensions can be composed using multiplication, division and + exponentiation (by a number) to give new dimensions. Addition and + subtraction is defined only when the two objects are the same dimension. + + >>> velocity = length / time + >>> velocity + Dimension(length/time) + + It is possible to use a dimension system object to get the dimensionsal + dependencies of a dimension, for example the dimension system used by the + SI units convention can be used: + + >>> from sympy.physics.units.systems.si import dimsys_SI + >>> dimsys_SI.get_dimensional_dependencies(velocity) + {Dimension(length, L): 1, Dimension(time, T): -1} + >>> length + length + Dimension(length) + >>> l2 = length**2 + >>> l2 + Dimension(length**2) + >>> dimsys_SI.get_dimensional_dependencies(l2) + {Dimension(length, L): 2} + + """ + + _op_priority = 13.0 + + # XXX: This doesn't seem to be used anywhere... + _dimensional_dependencies = {} # type: ignore + + is_commutative = True + is_number = False + # make sqrt(M**2) --> M + is_positive = True + is_real = True + + def __new__(cls, name, symbol=None): + + if isinstance(name, str): + name = Symbol(name) + else: + name = sympify(name) + + if not isinstance(name, Expr): + raise TypeError("Dimension name needs to be a valid math expression") + + if isinstance(symbol, str): + symbol = Symbol(symbol) + elif symbol is not None: + assert isinstance(symbol, Symbol) + + obj = Expr.__new__(cls, name) + + obj._name = name + obj._symbol = symbol + return obj + + @property + def name(self): + return self._name + + @property + def symbol(self): + return self._symbol + + def __str__(self): + """ + Display the string representation of the dimension. + """ + if self.symbol is None: + return "Dimension(%s)" % (self.name) + else: + return "Dimension(%s, %s)" % (self.name, self.symbol) + + def __repr__(self): + return self.__str__() + + def __neg__(self): + return self + + def __add__(self, other): + from sympy.physics.units.quantities import Quantity + other = sympify(other) + if isinstance(other, Basic): + if other.has(Quantity): + raise TypeError("cannot sum dimension and quantity") + if isinstance(other, Dimension) and self == other: + return self + return super().__add__(other) + return self + + def __radd__(self, other): + return self.__add__(other) + + def __sub__(self, other): + # there is no notion of ordering (or magnitude) among dimension, + # subtraction is equivalent to addition when the operation is legal + return self + other + + def __rsub__(self, other): + # there is no notion of ordering (or magnitude) among dimension, + # subtraction is equivalent to addition when the operation is legal + return self + other + + def __pow__(self, other): + return self._eval_power(other) + + def _eval_power(self, other): + other = sympify(other) + return Dimension(self.name**other) + + def __mul__(self, other): + from sympy.physics.units.quantities import Quantity + if isinstance(other, Basic): + if other.has(Quantity): + raise TypeError("cannot sum dimension and quantity") + if isinstance(other, Dimension): + return Dimension(self.name*other.name) + if not other.free_symbols: # other.is_number cannot be used + return self + return super().__mul__(other) + return self + + def __rmul__(self, other): + return self.__mul__(other) + + def __truediv__(self, other): + return self*Pow(other, -1) + + def __rtruediv__(self, other): + return other * pow(self, -1) + + @classmethod + def _from_dimensional_dependencies(cls, dependencies): + return reduce(lambda x, y: x * y, ( + d**e for d, e in dependencies.items() + ), 1) + + def has_integer_powers(self, dim_sys): + """ + Check if the dimension object has only integer powers. + + All the dimension powers should be integers, but rational powers may + appear in intermediate steps. This method may be used to check that the + final result is well-defined. + """ + + return all(dpow.is_Integer for dpow in dim_sys.get_dimensional_dependencies(self).values()) + + +# Create dimensions according to the base units in MKSA. +# For other unit systems, they can be derived by transforming the base +# dimensional dependency dictionary. + + +class DimensionSystem(Basic, _QuantityMapper): + r""" + DimensionSystem represents a coherent set of dimensions. + + The constructor takes three parameters: + + - base dimensions; + - derived dimensions: these are defined in terms of the base dimensions + (for example velocity is defined from the division of length by time); + - dependency of dimensions: how the derived dimensions depend + on the base dimensions. + + Optionally either the ``derived_dims`` or the ``dimensional_dependencies`` + may be omitted. + """ + + def __new__(cls, base_dims, derived_dims=(), dimensional_dependencies={}): + dimensional_dependencies = dict(dimensional_dependencies) + + def parse_dim(dim): + if isinstance(dim, str): + dim = Dimension(Symbol(dim)) + elif isinstance(dim, Dimension): + pass + elif isinstance(dim, Symbol): + dim = Dimension(dim) + else: + raise TypeError("%s wrong type" % dim) + return dim + + base_dims = [parse_dim(i) for i in base_dims] + derived_dims = [parse_dim(i) for i in derived_dims] + + for dim in base_dims: + if (dim in dimensional_dependencies + and (len(dimensional_dependencies[dim]) != 1 or + dimensional_dependencies[dim].get(dim, None) != 1)): + raise IndexError("Repeated value in base dimensions") + dimensional_dependencies[dim] = Dict({dim: 1}) + + def parse_dim_name(dim): + if isinstance(dim, Dimension): + return dim + elif isinstance(dim, str): + return Dimension(Symbol(dim)) + elif isinstance(dim, Symbol): + return Dimension(dim) + else: + raise TypeError("unrecognized type %s for %s" % (type(dim), dim)) + + for dim in dimensional_dependencies.keys(): + dim = parse_dim(dim) + if (dim not in derived_dims) and (dim not in base_dims): + derived_dims.append(dim) + + def parse_dict(d): + return Dict({parse_dim_name(i): j for i, j in d.items()}) + + # Make sure everything is a SymPy type: + dimensional_dependencies = {parse_dim_name(i): parse_dict(j) for i, j in + dimensional_dependencies.items()} + + for dim in derived_dims: + if dim in base_dims: + raise ValueError("Dimension %s both in base and derived" % dim) + if dim not in dimensional_dependencies: + # TODO: should this raise a warning? + dimensional_dependencies[dim] = Dict({dim: 1}) + + base_dims.sort(key=default_sort_key) + derived_dims.sort(key=default_sort_key) + + base_dims = Tuple(*base_dims) + derived_dims = Tuple(*derived_dims) + dimensional_dependencies = Dict({i: Dict(j) for i, j in dimensional_dependencies.items()}) + obj = Basic.__new__(cls, base_dims, derived_dims, dimensional_dependencies) + return obj + + @property + def base_dims(self): + return self.args[0] + + @property + def derived_dims(self): + return self.args[1] + + @property + def dimensional_dependencies(self): + return self.args[2] + + def _get_dimensional_dependencies_for_name(self, dimension): + if isinstance(dimension, str): + dimension = Dimension(Symbol(dimension)) + elif not isinstance(dimension, Dimension): + dimension = Dimension(dimension) + + if dimension.name.is_Symbol: + # Dimensions not included in the dependencies are considered + # as base dimensions: + return dict(self.dimensional_dependencies.get(dimension, {dimension: 1})) + + if dimension.name.is_number or dimension.name.is_NumberSymbol: + return {} + + get_for_name = self._get_dimensional_dependencies_for_name + + if dimension.name.is_Mul: + ret = collections.defaultdict(int) + dicts = [get_for_name(i) for i in dimension.name.args] + for d in dicts: + for k, v in d.items(): + ret[k] += v + return {k: v for (k, v) in ret.items() if v != 0} + + if dimension.name.is_Add: + dicts = [get_for_name(i) for i in dimension.name.args] + if all(d == dicts[0] for d in dicts[1:]): + return dicts[0] + raise TypeError("Only equivalent dimensions can be added or subtracted.") + + if dimension.name.is_Pow: + dim_base = get_for_name(dimension.name.base) + dim_exp = get_for_name(dimension.name.exp) + if dim_exp == {} or dimension.name.exp.is_Symbol: + return {k: v * dimension.name.exp for (k, v) in dim_base.items()} + else: + raise TypeError("The exponent for the power operator must be a Symbol or dimensionless.") + + if dimension.name.is_Function: + args = (Dimension._from_dimensional_dependencies( + get_for_name(arg)) for arg in dimension.name.args) + result = dimension.name.func(*args) + + dicts = [get_for_name(i) for i in dimension.name.args] + + if isinstance(result, Dimension): + return self.get_dimensional_dependencies(result) + elif result.func == dimension.name.func: + if isinstance(dimension.name, TrigonometricFunction): + if dicts[0] in ({}, {Dimension('angle'): 1}): + return {} + else: + raise TypeError("The input argument for the function {} must be dimensionless or have dimensions of angle.".format(dimension.func)) + else: + if all(item == {} for item in dicts): + return {} + else: + raise TypeError("The input arguments for the function {} must be dimensionless.".format(dimension.func)) + else: + return get_for_name(result) + + raise TypeError("Type {} not implemented for get_dimensional_dependencies".format(type(dimension.name))) + + def get_dimensional_dependencies(self, name, mark_dimensionless=False): + dimdep = self._get_dimensional_dependencies_for_name(name) + if mark_dimensionless and dimdep == {}: + return {Dimension(1): 1} + return {k: v for k, v in dimdep.items()} + + def equivalent_dims(self, dim1, dim2): + deps1 = self.get_dimensional_dependencies(dim1) + deps2 = self.get_dimensional_dependencies(dim2) + return deps1 == deps2 + + def extend(self, new_base_dims, new_derived_dims=(), new_dim_deps=None): + deps = dict(self.dimensional_dependencies) + if new_dim_deps: + deps.update(new_dim_deps) + + new_dim_sys = DimensionSystem( + tuple(self.base_dims) + tuple(new_base_dims), + tuple(self.derived_dims) + tuple(new_derived_dims), + deps + ) + new_dim_sys._quantity_dimension_map.update(self._quantity_dimension_map) + new_dim_sys._quantity_scale_factors.update(self._quantity_scale_factors) + return new_dim_sys + + def is_dimensionless(self, dimension): + """ + Check if the dimension object really has a dimension. + + A dimension should have at least one component with non-zero power. + """ + if dimension.name == 1: + return True + return self.get_dimensional_dependencies(dimension) == {} + + @property + def list_can_dims(self): + """ + Useless method, kept for compatibility with previous versions. + + DO NOT USE. + + List all canonical dimension names. + """ + dimset = set() + for i in self.base_dims: + dimset.update(set(self.get_dimensional_dependencies(i).keys())) + return tuple(sorted(dimset, key=str)) + + @property + def inv_can_transf_matrix(self): + """ + Useless method, kept for compatibility with previous versions. + + DO NOT USE. + + Compute the inverse transformation matrix from the base to the + canonical dimension basis. + + It corresponds to the matrix where columns are the vector of base + dimensions in canonical basis. + + This matrix will almost never be used because dimensions are always + defined with respect to the canonical basis, so no work has to be done + to get them in this basis. Nonetheless if this matrix is not square + (or not invertible) it means that we have chosen a bad basis. + """ + matrix = reduce(lambda x, y: x.row_join(y), + [self.dim_can_vector(d) for d in self.base_dims]) + return matrix + + @property + def can_transf_matrix(self): + """ + Useless method, kept for compatibility with previous versions. + + DO NOT USE. + + Return the canonical transformation matrix from the canonical to the + base dimension basis. + + It is the inverse of the matrix computed with inv_can_transf_matrix(). + """ + + #TODO: the inversion will fail if the system is inconsistent, for + # example if the matrix is not a square + return reduce(lambda x, y: x.row_join(y), + [self.dim_can_vector(d) for d in sorted(self.base_dims, key=str)] + ).inv() + + def dim_can_vector(self, dim): + """ + Useless method, kept for compatibility with previous versions. + + DO NOT USE. + + Dimensional representation in terms of the canonical base dimensions. + """ + + vec = [] + for d in self.list_can_dims: + vec.append(self.get_dimensional_dependencies(dim).get(d, 0)) + return Matrix(vec) + + def dim_vector(self, dim): + """ + Useless method, kept for compatibility with previous versions. + + DO NOT USE. + + + Vector representation in terms of the base dimensions. + """ + return self.can_transf_matrix * Matrix(self.dim_can_vector(dim)) + + def print_dim_base(self, dim): + """ + Give the string expression of a dimension in term of the basis symbols. + """ + dims = self.dim_vector(dim) + symbols = [i.symbol if i.symbol is not None else i.name for i in self.base_dims] + res = S.One + for (s, p) in zip(symbols, dims): + res *= s**p + return res + + @property + def dim(self): + """ + Useless method, kept for compatibility with previous versions. + + DO NOT USE. + + Give the dimension of the system. + + That is return the number of dimensions forming the basis. + """ + return len(self.base_dims) + + @property + def is_consistent(self): + """ + Useless method, kept for compatibility with previous versions. + + DO NOT USE. + + Check if the system is well defined. + """ + + # not enough or too many base dimensions compared to independent + # dimensions + # in vector language: the set of vectors do not form a basis + return self.inv_can_transf_matrix.is_square diff --git a/shared/package-files/07/076ba3ece126ef2224faf452b0edfbfcd0f4b74101be7e01f92bb8de26cde0f8/blob b/shared/package-files/07/076ba3ece126ef2224faf452b0edfbfcd0f4b74101be7e01f92bb8de26cde0f8/blob new file mode 100644 index 0000000000000000000000000000000000000000..2839f4c1feea56dddd54bdc00f0b884c8461d29e --- /dev/null +++ b/shared/package-files/07/076ba3ece126ef2224faf452b0edfbfcd0f4b74101be7e01f92bb8de26cde0f8/blob @@ -0,0 +1,124 @@ +import base64 +import io +import re + +import requests + +import fsspec + + +class JupyterFileSystem(fsspec.AbstractFileSystem): + """View of the files as seen by a Jupyter server (notebook or lab)""" + + protocol = ("jupyter", "jlab") + + def __init__(self, url, tok=None, **kwargs): + """ + + Parameters + ---------- + url : str + Base URL of the server, like "http://127.0.0.1:8888". May include + token in the string, which is given by the process when starting up + tok : str + If the token is obtained separately, can be given here + kwargs + """ + if "?" in url: + if tok is None: + try: + tok = re.findall("token=([a-z0-9]+)", url)[0] + except IndexError as e: + raise ValueError("Could not determine token") from e + url = url.split("?", 1)[0] + self.url = url.rstrip("/") + "/api/contents" + self.session = requests.Session() + if tok: + self.session.headers["Authorization"] = f"token {tok}" + + super().__init__(**kwargs) + + def ls(self, path, detail=True, **kwargs): + path = self._strip_protocol(path) + r = self.session.get(f"{self.url}/{path}") + if r.status_code == 404: + return FileNotFoundError(path) + r.raise_for_status() + out = r.json() + + if out["type"] == "directory": + out = out["content"] + else: + out = [out] + for o in out: + o["name"] = o.pop("path") + o.pop("content") + if o["type"] == "notebook": + o["type"] = "file" + if detail: + return out + return [o["name"] for o in out] + + def cat_file(self, path, start=None, end=None, **kwargs): + path = self._strip_protocol(path) + r = self.session.get(f"{self.url}/{path}") + if r.status_code == 404: + return FileNotFoundError(path) + r.raise_for_status() + out = r.json() + if out["format"] == "text": + # data should be binary + b = out["content"].encode() + else: + b = base64.b64decode(out["content"]) + return b[start:end] + + def pipe_file(self, path, value, **_): + path = self._strip_protocol(path) + json = { + "name": path.rsplit("/", 1)[-1], + "path": path, + "size": len(value), + "content": base64.b64encode(value).decode(), + "format": "base64", + "type": "file", + } + self.session.put(f"{self.url}/{path}", json=json) + + def mkdir(self, path, create_parents=True, **kwargs): + path = self._strip_protocol(path) + if create_parents and "/" in path: + self.mkdir(path.rsplit("/", 1)[0], True) + json = { + "name": path.rsplit("/", 1)[-1], + "path": path, + "size": None, + "content": None, + "type": "directory", + } + self.session.put(f"{self.url}/{path}", json=json) + + def _rm(self, path): + path = self._strip_protocol(path) + self.session.delete(f"{self.url}/{path}") + + def _open(self, path, mode="rb", **kwargs): + path = self._strip_protocol(path) + if mode == "rb": + data = self.cat_file(path) + return io.BytesIO(data) + else: + return SimpleFileWriter(self, path, mode="wb") + + +class SimpleFileWriter(fsspec.spec.AbstractBufferedFile): + def _upload_chunk(self, final=False): + """Never uploads a chunk until file is done + + Not suitable for large files + """ + if final is False: + return False + self.buffer.seek(0) + data = self.buffer.read() + self.fs.pipe_file(self.path, data) diff --git a/shared/package-files/07/076be28e5ef9ce050a5136351c2aa307d0530c57f714cf2e83090a19307cdd70/blob b/shared/package-files/07/076be28e5ef9ce050a5136351c2aa307d0530c57f714cf2e83090a19307cdd70/blob new file mode 100644 index 0000000000000000000000000000000000000000..3e85de8679cda3084f1c263a045f4d8f817bed98 --- /dev/null +++ b/shared/package-files/07/076be28e5ef9ce050a5136351c2aa307d0530c57f714cf2e83090a19307cdd70/blob @@ -0,0 +1,340 @@ +"""Functions for generating interesting polynomials, e.g. for benchmarking. """ + + +from sympy.core import Add, Mul, Symbol, sympify, Dummy, symbols +from sympy.core.containers import Tuple +from sympy.core.singleton import S +from sympy.ntheory import nextprime +from sympy.polys.densearith import ( + dmp_add_term, dmp_neg, dmp_mul, dmp_sqr +) +from sympy.polys.densebasic import ( + dmp_zero, dmp_one, dmp_ground, + dup_from_raw_dict, dmp_raise, dup_random +) +from sympy.polys.domains import ZZ +from sympy.polys.factortools import dup_zz_cyclotomic_poly +from sympy.polys.polyclasses import DMP +from sympy.polys.polytools import Poly, PurePoly +from sympy.polys.polyutils import _analyze_gens +from sympy.utilities import subsets, public, filldedent + + +@public +def swinnerton_dyer_poly(n, x=None, polys=False): + """Generates n-th Swinnerton-Dyer polynomial in `x`. + + Parameters + ---------- + n : int + `n` decides the order of polynomial + x : optional + polys : bool, optional + ``polys=True`` returns an expression, otherwise + (default) returns an expression. + """ + if n <= 0: + raise ValueError( + "Cannot generate Swinnerton-Dyer polynomial of order %s" % n) + + if x is not None: + sympify(x) + else: + x = Dummy('x') + + if n > 3: + from sympy.functions.elementary.miscellaneous import sqrt + from .numberfields import minimal_polynomial + p = 2 + a = [sqrt(2)] + for i in range(2, n + 1): + p = nextprime(p) + a.append(sqrt(p)) + return minimal_polynomial(Add(*a), x, polys=polys) + + if n == 1: + ex = x**2 - 2 + elif n == 2: + ex = x**4 - 10*x**2 + 1 + elif n == 3: + ex = x**8 - 40*x**6 + 352*x**4 - 960*x**2 + 576 + + return PurePoly(ex, x) if polys else ex + + +@public +def cyclotomic_poly(n, x=None, polys=False): + """Generates cyclotomic polynomial of order `n` in `x`. + + Parameters + ---------- + n : int + `n` decides the order of polynomial + x : optional + polys : bool, optional + ``polys=True`` returns an expression, otherwise + (default) returns an expression. + """ + if n <= 0: + raise ValueError( + "Cannot generate cyclotomic polynomial of order %s" % n) + + poly = DMP(dup_zz_cyclotomic_poly(int(n), ZZ), ZZ) + + if x is not None: + poly = Poly.new(poly, x) + else: + poly = PurePoly.new(poly, Dummy('x')) + + return poly if polys else poly.as_expr() + + +@public +def symmetric_poly(n, *gens, polys=False): + """ + Generates symmetric polynomial of order `n`. + + Parameters + ========== + + polys: bool, optional (default: False) + Returns a Poly object when ``polys=True``, otherwise + (default) returns an expression. + """ + gens = _analyze_gens(gens) + + if n < 0 or n > len(gens) or not gens: + raise ValueError("Cannot generate symmetric polynomial of order %s for %s" % (n, gens)) + elif not n: + poly = S.One + else: + poly = Add(*[Mul(*s) for s in subsets(gens, int(n))]) + + return Poly(poly, *gens) if polys else poly + + +@public +def random_poly(x, n, inf, sup, domain=ZZ, polys=False): + """Generates a polynomial of degree ``n`` with coefficients in + ``[inf, sup]``. + + Parameters + ---------- + x + `x` is the independent term of polynomial + n : int + `n` decides the order of polynomial + inf + Lower limit of range in which coefficients lie + sup + Upper limit of range in which coefficients lie + domain : optional + Decides what ring the coefficients are supposed + to belong. Default is set to Integers. + polys : bool, optional + ``polys=True`` returns an expression, otherwise + (default) returns an expression. + """ + poly = Poly(dup_random(n, inf, sup, domain), x, domain=domain) + + return poly if polys else poly.as_expr() + + +@public +def interpolating_poly(n, x, X='x', Y='y'): + """Construct Lagrange interpolating polynomial for ``n`` + data points. If a sequence of values are given for ``X`` and ``Y`` + then the first ``n`` values will be used. + """ + ok = getattr(x, 'free_symbols', None) + + if isinstance(X, str): + X = symbols("%s:%s" % (X, n)) + elif ok and ok & Tuple(*X).free_symbols: + ok = False + + if isinstance(Y, str): + Y = symbols("%s:%s" % (Y, n)) + elif ok and ok & Tuple(*Y).free_symbols: + ok = False + + if not ok: + raise ValueError(filldedent(''' + Expecting symbol for x that does not appear in X or Y. + Use `interpolate(list(zip(X, Y)), x)` instead.''')) + + coeffs = [] + numert = Mul(*[x - X[i] for i in range(n)]) + + for i in range(n): + numer = numert/(x - X[i]) + denom = Mul(*[(X[i] - X[j]) for j in range(n) if i != j]) + coeffs.append(numer/denom) + + return Add(*[coeff*y for coeff, y in zip(coeffs, Y)]) + + +def fateman_poly_F_1(n): + """Fateman's GCD benchmark: trivial GCD """ + Y = [Symbol('y_' + str(i)) for i in range(n + 1)] + + y_0, y_1 = Y[0], Y[1] + + u = y_0 + Add(*Y[1:]) + v = y_0**2 + Add(*[y**2 for y in Y[1:]]) + + F = ((u + 1)*(u + 2)).as_poly(*Y) + G = ((v + 1)*(-3*y_1*y_0**2 + y_1**2 - 1)).as_poly(*Y) + + H = Poly(1, *Y) + + return F, G, H + + +def dmp_fateman_poly_F_1(n, K): + """Fateman's GCD benchmark: trivial GCD """ + u = [K(1), K(0)] + + for i in range(n): + u = [dmp_one(i, K), u] + + v = [K(1), K(0), K(0)] + + for i in range(0, n): + v = [dmp_one(i, K), dmp_zero(i), v] + + m = n - 1 + + U = dmp_add_term(u, dmp_ground(K(1), m), 0, n, K) + V = dmp_add_term(u, dmp_ground(K(2), m), 0, n, K) + + f = [[-K(3), K(0)], [], [K(1), K(0), -K(1)]] + + W = dmp_add_term(v, dmp_ground(K(1), m), 0, n, K) + Y = dmp_raise(f, m, 1, K) + + F = dmp_mul(U, V, n, K) + G = dmp_mul(W, Y, n, K) + + H = dmp_one(n, K) + + return F, G, H + + +def fateman_poly_F_2(n): + """Fateman's GCD benchmark: linearly dense quartic inputs """ + Y = [Symbol('y_' + str(i)) for i in range(n + 1)] + + y_0 = Y[0] + + u = Add(*Y[1:]) + + H = Poly((y_0 + u + 1)**2, *Y) + + F = Poly((y_0 - u - 2)**2, *Y) + G = Poly((y_0 + u + 2)**2, *Y) + + return H*F, H*G, H + + +def dmp_fateman_poly_F_2(n, K): + """Fateman's GCD benchmark: linearly dense quartic inputs """ + u = [K(1), K(0)] + + for i in range(n - 1): + u = [dmp_one(i, K), u] + + m = n - 1 + + v = dmp_add_term(u, dmp_ground(K(2), m - 1), 0, n, K) + + f = dmp_sqr([dmp_one(m, K), dmp_neg(v, m, K)], n, K) + g = dmp_sqr([dmp_one(m, K), v], n, K) + + v = dmp_add_term(u, dmp_one(m - 1, K), 0, n, K) + + h = dmp_sqr([dmp_one(m, K), v], n, K) + + return dmp_mul(f, h, n, K), dmp_mul(g, h, n, K), h + + +def fateman_poly_F_3(n): + """Fateman's GCD benchmark: sparse inputs (deg f ~ vars f) """ + Y = [Symbol('y_' + str(i)) for i in range(n + 1)] + + y_0 = Y[0] + + u = Add(*[y**(n + 1) for y in Y[1:]]) + + H = Poly((y_0**(n + 1) + u + 1)**2, *Y) + + F = Poly((y_0**(n + 1) - u - 2)**2, *Y) + G = Poly((y_0**(n + 1) + u + 2)**2, *Y) + + return H*F, H*G, H + + +def dmp_fateman_poly_F_3(n, K): + """Fateman's GCD benchmark: sparse inputs (deg f ~ vars f) """ + u = dup_from_raw_dict({n + 1: K.one}, K) + + for i in range(0, n - 1): + u = dmp_add_term([u], dmp_one(i, K), n + 1, i + 1, K) + + v = dmp_add_term(u, dmp_ground(K(2), n - 2), 0, n, K) + + f = dmp_sqr( + dmp_add_term([dmp_neg(v, n - 1, K)], dmp_one(n - 1, K), n + 1, n, K), n, K) + g = dmp_sqr(dmp_add_term([v], dmp_one(n - 1, K), n + 1, n, K), n, K) + + v = dmp_add_term(u, dmp_one(n - 2, K), 0, n - 1, K) + + h = dmp_sqr(dmp_add_term([v], dmp_one(n - 1, K), n + 1, n, K), n, K) + + return dmp_mul(f, h, n, K), dmp_mul(g, h, n, K), h + +# A few useful polynomials from Wang's paper ('78). + +from sympy.polys.rings import ring + +def _f_0(): + R, x, y, z = ring("x,y,z", ZZ) + return x**2*y*z**2 + 2*x**2*y*z + 3*x**2*y + 2*x**2 + 3*x + 4*y**2*z**2 + 5*y**2*z + 6*y**2 + y*z**2 + 2*y*z + y + 1 + +def _f_1(): + R, x, y, z = ring("x,y,z", ZZ) + return x**3*y*z + x**2*y**2*z**2 + x**2*y**2 + 20*x**2*y*z + 30*x**2*y + x**2*z**2 + 10*x**2*z + x*y**3*z + 30*x*y**2*z + 20*x*y**2 + x*y*z**3 + 10*x*y*z**2 + x*y*z + 610*x*y + 20*x*z**2 + 230*x*z + 300*x + y**2*z**2 + 10*y**2*z + 30*y*z**2 + 320*y*z + 200*y + 600*z + 6000 + +def _f_2(): + R, x, y, z = ring("x,y,z", ZZ) + return x**5*y**3 + x**5*y**2*z + x**5*y*z**2 + x**5*z**3 + x**3*y**2 + x**3*y*z + 90*x**3*y + 90*x**3*z + x**2*y**2*z - 11*x**2*y**2 + x**2*z**3 - 11*x**2*z**2 + y*z - 11*y + 90*z - 990 + +def _f_3(): + R, x, y, z = ring("x,y,z", ZZ) + return x**5*y**2 + x**4*z**4 + x**4 + x**3*y**3*z + x**3*z + x**2*y**4 + x**2*y**3*z**3 + x**2*y*z**5 + x**2*y*z + x*y**2*z**4 + x*y**2 + x*y*z**7 + x*y*z**3 + x*y*z**2 + y**2*z + y*z**4 + +def _f_4(): + R, x, y, z = ring("x,y,z", ZZ) + return -x**9*y**8*z - x**8*y**5*z**3 - x**7*y**12*z**2 - 5*x**7*y**8 - x**6*y**9*z**4 + x**6*y**7*z**3 + 3*x**6*y**7*z - 5*x**6*y**5*z**2 - x**6*y**4*z**3 + x**5*y**4*z**5 + 3*x**5*y**4*z**3 - x**5*y*z**5 + x**4*y**11*z**4 + 3*x**4*y**11*z**2 - x**4*y**8*z**4 + 5*x**4*y**7*z**2 + 15*x**4*y**7 - 5*x**4*y**4*z**2 + x**3*y**8*z**6 + 3*x**3*y**8*z**4 - x**3*y**5*z**6 + 5*x**3*y**4*z**4 + 15*x**3*y**4*z**2 + x**3*y**3*z**5 + 3*x**3*y**3*z**3 - 5*x**3*y*z**4 + x**2*z**7 + 3*x**2*z**5 + x*y**7*z**6 + 3*x*y**7*z**4 + 5*x*y**3*z**4 + 15*x*y**3*z**2 + y**4*z**8 + 3*y**4*z**6 + 5*z**6 + 15*z**4 + +def _f_5(): + R, x, y, z = ring("x,y,z", ZZ) + return -x**3 - 3*x**2*y + 3*x**2*z - 3*x*y**2 + 6*x*y*z - 3*x*z**2 - y**3 + 3*y**2*z - 3*y*z**2 + z**3 + +def _f_6(): + R, x, y, z, t = ring("x,y,z,t", ZZ) + return 2115*x**4*y + 45*x**3*z**3*t**2 - 45*x**3*t**2 - 423*x*y**4 - 47*x*y**3 + 141*x*y*z**3 + 94*x*y*z*t - 9*y**3*z**3*t**2 + 9*y**3*t**2 - y**2*z**3*t**2 + y**2*t**2 + 3*z**6*t**2 + 2*z**4*t**3 - 3*z**3*t**2 - 2*z*t**3 + +def _w_1(): + R, x, y, z = ring("x,y,z", ZZ) + return 4*x**6*y**4*z**2 + 4*x**6*y**3*z**3 - 4*x**6*y**2*z**4 - 4*x**6*y*z**5 + x**5*y**4*z**3 + 12*x**5*y**3*z - x**5*y**2*z**5 + 12*x**5*y**2*z**2 - 12*x**5*y*z**3 - 12*x**5*z**4 + 8*x**4*y**4 + 6*x**4*y**3*z**2 + 8*x**4*y**3*z - 4*x**4*y**2*z**4 + 4*x**4*y**2*z**3 - 8*x**4*y**2*z**2 - 4*x**4*y*z**5 - 2*x**4*y*z**4 - 8*x**4*y*z**3 + 2*x**3*y**4*z + x**3*y**3*z**3 - x**3*y**2*z**5 - 2*x**3*y**2*z**3 + 9*x**3*y**2*z - 12*x**3*y*z**3 + 12*x**3*y*z**2 - 12*x**3*z**4 + 3*x**3*z**3 + 6*x**2*y**3 - 6*x**2*y**2*z**2 + 8*x**2*y**2*z - 2*x**2*y*z**4 - 8*x**2*y*z**3 + 2*x**2*y*z**2 + 2*x*y**3*z - 2*x*y**2*z**3 - 3*x*y*z + 3*x*z**3 - 2*y**2 + 2*y*z**2 + +def _w_2(): + R, x, y = ring("x,y", ZZ) + return 24*x**8*y**3 + 48*x**8*y**2 + 24*x**7*y**5 - 72*x**7*y**2 + 25*x**6*y**4 + 2*x**6*y**3 + 4*x**6*y + 8*x**6 + x**5*y**6 + x**5*y**3 - 12*x**5 + x**4*y**5 - x**4*y**4 - 2*x**4*y**3 + 292*x**4*y**2 - x**3*y**6 + 3*x**3*y**3 - x**2*y**5 + 12*x**2*y**3 + 48*x**2 - 12*y**3 + +def f_polys(): + return _f_0(), _f_1(), _f_2(), _f_3(), _f_4(), _f_5(), _f_6() + +def w_polys(): + return _w_1(), _w_2() diff --git a/shared/package-files/07/076d7d0c8bd2f06d116c9bbf4e1c0e0f4ab15cc1390657bb93ae1a93c75fc1a9/blob b/shared/package-files/07/076d7d0c8bd2f06d116c9bbf4e1c0e0f4ab15cc1390657bb93ae1a93c75fc1a9/blob new file mode 100644 index 0000000000000000000000000000000000000000..d4b2953d6dfaee20ebc5fcd70560680d10d6665b --- /dev/null +++ b/shared/package-files/07/076d7d0c8bd2f06d116c9bbf4e1c0e0f4ab15cc1390657bb93ae1a93c75fc1a9/blob @@ -0,0 +1,57 @@ +from typing import Any, Pattern + +from markdown.extensions import Extension +from markdown.inlinepatterns import InlineProcessor +from markdown.postprocessors import Postprocessor +from markdown.preprocessors import Preprocessor +from markdown.treeprocessors import Treeprocessor + +FN_BACKLINK_TEXT: Any +NBSP_PLACEHOLDER: Any +DEF_RE: Pattern +TABBED_RE: Pattern +RE_REF_ID: Any + +class FootnoteExtension(Extension): + unique_prefix: int = ... + found_refs: Any + used_refs: Any + def __init__(self, **kwargs) -> None: ... + parser: Any + md: Any + footnotes: Any + def reset(self) -> None: ... + def unique_ref(self, reference, found: bool = ...): ... + def findFootnotesPlaceholder(self, root): ... + def setFootnote(self, id, text) -> None: ... + def get_separator(self): ... + def makeFootnoteId(self, id): ... + def makeFootnoteRefId(self, id, found: bool = ...): ... + def makeFootnotesDiv(self, root): ... + +class FootnotePreprocessor(Preprocessor): + footnotes: Any + def __init__(self, footnotes) -> None: ... + def detectTabbed(self, lines): ... + +class FootnoteInlineProcessor(InlineProcessor): + footnotes: Any + def __init__(self, pattern, footnotes) -> None: ... + +class FootnotePostTreeprocessor(Treeprocessor): + footnotes: Any + def __init__(self, footnotes) -> None: ... + def add_duplicates(self, li, duplicates) -> None: ... + def get_num_duplicates(self, li): ... + def handle_duplicates(self, parent) -> None: ... + offset: int = ... + +class FootnoteTreeprocessor(Treeprocessor): + footnotes: Any + def __init__(self, footnotes) -> None: ... + +class FootnotePostprocessor(Postprocessor): + footnotes: Any + def __init__(self, footnotes) -> None: ... + +def makeExtension(**kwargs): ... diff --git a/shared/package-files/07/07706456b9bdb2f039f305e225ecbe1545c3d59f0706435df707fdb2d1b17aab/blob b/shared/package-files/07/07706456b9bdb2f039f305e225ecbe1545c3d59f0706435df707fdb2d1b17aab/blob new file mode 100644 index 0000000000000000000000000000000000000000..df6e37dcd5c69e122c87629e410ee2ee38b2acec --- /dev/null +++ b/shared/package-files/07/07706456b9bdb2f039f305e225ecbe1545c3d59f0706435df707fdb2d1b17aab/blob @@ -0,0 +1,471 @@ +import pickle +import unittest + +import numpy as np +from numpy.testing import assert_array_equal + +from numba.np.ufunc.ufuncbuilder import GUFuncBuilder +from numba import vectorize, guvectorize +from numba.np.ufunc import PyUFunc_One +from numba.np.ufunc.dufunc import DUFunc as UFuncBuilder +from numba.tests.support import tag, TestCase +from numba.core import config + + +class TestUfuncBuilding(TestCase): + + def test_basic_ufunc(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import add + ufb = UFuncBuilder(add) + cres = ufb.add("int32(int32, int32)") + self.assertFalse(cres.objectmode) + cres = ufb.add("int64(int64, int64)") + self.assertFalse(cres.objectmode) + ufunc = ufb.build_ufunc() + + def check(a): + b = ufunc(a, a) + self.assertPreciseEqual(a + a, b) + self.assertEqual(b.dtype, a.dtype) + + a = np.arange(12, dtype='int32') + check(a) + # Non-contiguous dimension + a = a[::2] + check(a) + a = a.reshape((2, 3)) + check(a) + + # Metadata + self.assertEqual(ufunc.__name__, "add") + self.assertIn("An addition", ufunc.__doc__) + + def test_ufunc_struct(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import add + ufb = UFuncBuilder(add) + cres = ufb.add("complex64(complex64, complex64)") + self.assertFalse(cres.objectmode) + ufunc = ufb.build_ufunc() + + def check(a): + b = ufunc(a, a) + self.assertPreciseEqual(a + a, b) + self.assertEqual(b.dtype, a.dtype) + + a = np.arange(12, dtype='complex64') + 1j + check(a) + # Non-contiguous dimension + a = a[::2] + check(a) + a = a.reshape((2, 3)) + check(a) + + def test_ufunc_forceobj(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import add + ufb = UFuncBuilder(add, targetoptions={'forceobj': True}) + cres = ufb.add("int32(int32, int32)") + self.assertTrue(cres.objectmode) + ufunc = ufb.build_ufunc() + + a = np.arange(10, dtype='int32') + b = ufunc(a, a) + self.assertPreciseEqual(a + a, b) + + def test_nested_call(self): + """ + Check nested call to an implicitly-typed ufunc. + """ + from numba.tests.npyufunc.ufuncbuilding_usecases import outer + builder = UFuncBuilder(outer, + targetoptions={'nopython': True}) + builder.add("(int64, int64)") + ufunc = builder.build_ufunc() + self.assertEqual(ufunc(-1, 3), 2) + + def test_nested_call_explicit(self): + """ + Check nested call to an explicitly-typed ufunc. + """ + from numba.tests.npyufunc.ufuncbuilding_usecases import outer_explicit + builder = UFuncBuilder(outer_explicit, + targetoptions={'nopython': True}) + builder.add("(int64, int64)") + ufunc = builder.build_ufunc() + self.assertEqual(ufunc(-1, 3), 2) + + +class TestUfuncBuildingJitDisabled(TestUfuncBuilding): + + def setUp(self): + self.old_disable_jit = config.DISABLE_JIT + config.DISABLE_JIT = False + + def tearDown(self): + config.DISABLE_JIT = self.old_disable_jit + + +class TestGUfuncBuilding(TestCase): + + def test_basic_gufunc(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import guadd + gufb = GUFuncBuilder(guadd, "(x, y),(x, y)->(x, y)") + cres = gufb.add("void(int32[:,:], int32[:,:], int32[:,:])") + self.assertFalse(cres.objectmode) + ufunc = gufb.build_ufunc() + + a = np.arange(10, dtype="int32").reshape(2, 5) + b = ufunc(a, a) + + self.assertPreciseEqual(a + a, b) + self.assertEqual(b.dtype, np.dtype('int32')) + + # Metadata + self.assertEqual(ufunc.__name__, "guadd") + self.assertIn("A generalized addition", ufunc.__doc__) + + def test_gufunc_struct(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import guadd + gufb = GUFuncBuilder(guadd, "(x, y),(x, y)->(x, y)") + cres = gufb.add("void(complex64[:,:], complex64[:,:], complex64[:,:])") + self.assertFalse(cres.objectmode) + ufunc = gufb.build_ufunc() + + a = np.arange(10, dtype="complex64").reshape(2, 5) + 1j + b = ufunc(a, a) + + self.assertPreciseEqual(a + a, b) + + def test_gufunc_struct_forceobj(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import guadd + gufb = GUFuncBuilder(guadd, "(x, y),(x, y)->(x, y)", + targetoptions=dict(forceobj=True)) + cres = gufb.add("void(complex64[:,:], complex64[:,:], complex64[:," + ":])") + self.assertTrue(cres.objectmode) + ufunc = gufb.build_ufunc() + + a = np.arange(10, dtype="complex64").reshape(2, 5) + 1j + b = ufunc(a, a) + + self.assertPreciseEqual(a + a, b) + + +class TestGUfuncBuildingJitDisabled(TestGUfuncBuilding): + + def setUp(self): + self.old_disable_jit = config.DISABLE_JIT + config.DISABLE_JIT = False + + def tearDown(self): + config.DISABLE_JIT = self.old_disable_jit + + +class TestVectorizeDecor(TestCase): + + _supported_identities = [0, 1, None, "reorderable"] + + def test_vectorize(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import add + ufunc = vectorize(['int32(int32, int32)'])(add) + a = np.arange(10, dtype='int32') + b = ufunc(a, a) + self.assertPreciseEqual(a + a, b) + + def test_vectorize_objmode(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import add + ufunc = vectorize(['int32(int32, int32)'], forceobj=True)(add) + a = np.arange(10, dtype='int32') + b = ufunc(a, a) + self.assertPreciseEqual(a + a, b) + + def test_vectorize_bool_return(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import equals + ufunc = vectorize(['bool_(int32, int32)'])(equals) + a = np.arange(10, dtype='int32') + r = ufunc(a,a) + self.assertPreciseEqual(r, np.ones(r.shape, dtype=np.bool_)) + + def test_vectorize_identity(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import add + sig = 'int32(int32, int32)' + for identity in self._supported_identities: + ufunc = vectorize([sig], identity=identity)(add) + expected = None if identity == 'reorderable' else identity + self.assertEqual(ufunc.identity, expected) + # Default value is None + ufunc = vectorize([sig])(add) + self.assertIs(ufunc.identity, None) + # Invalid values + with self.assertRaises(ValueError): + vectorize([sig], identity='none')(add) + with self.assertRaises(ValueError): + vectorize([sig], identity=2)(add) + + def test_vectorize_no_args(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import add + a = np.linspace(0,1,10) + b = np.linspace(1,2,10) + ufunc = vectorize(add) + self.assertPreciseEqual(ufunc(a,b), a + b) + ufunc2 = vectorize(add) + c = np.empty(10) + ufunc2(a, b, c) + self.assertPreciseEqual(c, a + b) + + def test_vectorize_only_kws(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import mul + a = np.linspace(0,1,10) + b = np.linspace(1,2,10) + ufunc = vectorize(identity=PyUFunc_One, nopython=True)(mul) + self.assertPreciseEqual(ufunc(a,b), a * b) + + def test_vectorize_output_kwarg(self): + """ + Passing the output array as a keyword argument (issue #1867). + """ + def check(ufunc): + a = np.arange(10, 16, dtype='int32') + out = np.zeros_like(a) + got = ufunc(a, a, out=out) + self.assertIs(got, out) + self.assertPreciseEqual(out, a + a) + with self.assertRaises(TypeError): + ufunc(a, a, zzz=out) + + # With explicit sigs + from numba.tests.npyufunc.ufuncbuilding_usecases import add + ufunc = vectorize(['int32(int32, int32)'], nopython=True)(add) + check(ufunc) + # With implicit sig + ufunc = vectorize(nopython=True)(add) + check(ufunc) # compiling + check(ufunc) # after compiling + + def test_guvectorize(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import guadd + ufunc = guvectorize(['(int32[:,:], int32[:,:], int32[:,:])'], + "(x,y),(x,y)->(x,y)")(guadd) + a = np.arange(10, dtype='int32').reshape(2, 5) + b = ufunc(a, a) + self.assertPreciseEqual(a + a, b) + + def test_guvectorize_no_output(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import guadd + ufunc = guvectorize(['(int32[:,:], int32[:,:], int32[:,:])'], + "(x,y),(x,y),(x,y)")(guadd) + a = np.arange(10, dtype='int32').reshape(2, 5) + out = np.zeros_like(a) + ufunc(a, a, out) + self.assertPreciseEqual(a + a, out) + + def test_guvectorize_objectmode(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import guadd_obj + ufunc = guvectorize(['(int32[:,:], int32[:,:], int32[:,:])'], + "(x,y),(x,y)->(x,y)", forceobj=True)(guadd_obj) + a = np.arange(10, dtype='int32').reshape(2, 5) + b = ufunc(a, a) + self.assertPreciseEqual(a + a, b) + + def test_guvectorize_scalar_objectmode(self): + """ + Test passing of scalars to object mode gufuncs. + """ + from numba.tests.npyufunc.ufuncbuilding_usecases import guadd_scalar_obj + ufunc = guvectorize(['(int32[:,:], int32, int32[:,:])'], + "(x,y),()->(x,y)", forceobj=True)(guadd_scalar_obj) + a = np.arange(10, dtype='int32').reshape(2, 5) + b = ufunc(a, 3) + self.assertPreciseEqual(a + 3, b) + + def test_guvectorize_error_in_objectmode(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import guerror, \ + MyException + ufunc = guvectorize(['(int32[:,:], int32[:,:], int32[:,:])'], + "(x,y),(x,y)->(x,y)", forceobj=True)(guerror) + a = np.arange(10, dtype='int32').reshape(2, 5) + with self.assertRaises(MyException): + ufunc(a, a) + + def test_guvectorize_identity(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import add, guadd + args = (['(int32[:,:], int32[:,:], int32[:,:])'], "(x,y),(x,y)->(x,y)") + for identity in self._supported_identities: + ufunc = guvectorize(*args, identity=identity)(guadd) + expected = None if identity == 'reorderable' else identity + self.assertEqual(ufunc.identity, expected) + # Default value is None + ufunc = guvectorize(*args)(guadd) + self.assertIs(ufunc.identity, None) + # Invalid values + with self.assertRaises(ValueError): + guvectorize(*args, identity='none')(add) + with self.assertRaises(ValueError): + guvectorize(*args, identity=2)(add) + + def test_guvectorize_invalid_layout(self): + from numba.tests.npyufunc.ufuncbuilding_usecases import guadd + sigs = ['(int32[:,:], int32[:,:], int32[:,:])'] + # Syntax error + with self.assertRaises(ValueError) as raises: + guvectorize(sigs, ")-:")(guadd) + self.assertIn("bad token in signature", str(raises.exception)) + # Output shape can't be inferred from inputs + with self.assertRaises(NameError) as raises: + guvectorize(sigs, "(x,y),(x,y)->(x,z,v)")(guadd) + self.assertEqual(str(raises.exception), + "undefined output symbols: v,z") + # Arrow but no outputs + with self.assertRaises(ValueError) as raises: + guvectorize(sigs, "(x,y),(x,y),(x,y)->")(guadd) + # (error message depends on Numpy version) + + +class NEP13Array: + """https://numpy.org/neps/nep-0013-ufunc-overrides.html""" + def __init__(self, array): + self.array = array + + def __array__(self): + return self.array + + def tolist(self): + return self.array.tolist() + + def __array_ufunc__(self, ufunc, method, *args, **kwargs): + if method != "__call__": + return NotImplemented + + return NEP13Array(ufunc(*[np.asarray(x) for x in args], **kwargs)) + + +class FakeDaskArray: + """This class defines both the NEP13 protocol and the dask collection protocol + (https://docs.dask.org/en/stable/custom-collections.html). This is a stand-in for + dask array, dask dataframe, and for any wrapper around them (e.g. xarray or pint). + """ + + def __init__(self, array): + self.array = array + + def __array_ufunc__(self, ufunc, method, *args, **kwargs): + if method != "__call__": + return NotImplemented + + # Simulate sending the ufunc over the network and applying it on a remote worker + ufunc = pickle.loads(pickle.dumps(ufunc)) + args = [x.array if isinstance(x, FakeDaskArray) else x for x in args] + return FakeDaskArray(ufunc(*args, **kwargs)) + + def _dask_method(self, *args, **kwargs): + raise AssertionError("called potentially expensive method") + + __array__ = _dask_method + __dask_graph__ = _dask_method + __dask_keys__ = _dask_method + __dask_optimize__ = _dask_method + __dask_postcompute__ = _dask_method + __dask_postpersist__ = _dask_method + __dask_scheduler__ = _dask_method + __dask_tokenize__ = _dask_method + compute = _dask_method + persist = _dask_method + visualize = _dask_method + + +class TestNEP13WithoutSignature(TestCase): + + def test_all(self): + + # note: no signatures specified + @vectorize(nopython=True) + def new_ufunc(hundreds, tens, ones): + return 100*hundreds + 10*tens + ones + + # give it integers + a = np.array([1, 2, 3], dtype=np.int64) + b = np.array([4, 5, 6], dtype=np.int64) + c = np.array([7, 8, 9], dtype=np.int64) + + all_np = new_ufunc(a, b, c) + self.assertIsInstance(all_np, np.ndarray) + self.assertEqual(all_np.tolist(), [147, 258, 369]) + + nep13_1 = new_ufunc(NEP13Array(a), b, c) + self.assertIsInstance(nep13_1, NEP13Array) + self.assertEqual(nep13_1.tolist(), [147, 258, 369]) + + nep13_2 = new_ufunc(a, NEP13Array(b), c) + self.assertIsInstance(nep13_2, NEP13Array) + self.assertEqual(nep13_2.tolist(), [147, 258, 369]) + + nep13_3 = new_ufunc(a, b, NEP13Array(c)) + self.assertIsInstance(nep13_3, NEP13Array) + self.assertEqual(nep13_3.tolist(), [147, 258, 369]) + + # give it floats + a = np.array([1.1, 2.2, 3.3], dtype=np.float64) + b = np.array([4.4, 5.5, 6.6], dtype=np.float64) + c = np.array([7.7, 8.8, 9.9], dtype=np.float64) + + all_np = new_ufunc(a, b, c) + self.assertIsInstance(all_np, np.ndarray) + self.assertEqual(all_np.tolist(), [161.7, 283.8, 405.9]) + + nep13_1 = new_ufunc(NEP13Array(a), b, c) + self.assertIsInstance(nep13_1, NEP13Array) + self.assertEqual(nep13_1.tolist(), [161.7, 283.8, 405.9]) + + nep13_2 = new_ufunc(a, NEP13Array(b), c) + self.assertIsInstance(nep13_2, NEP13Array) + self.assertEqual(nep13_2.tolist(), [161.7, 283.8, 405.9]) + + nep13_3 = new_ufunc(a, b, NEP13Array(c)) + self.assertIsInstance(nep13_3, NEP13Array) + self.assertEqual(nep13_3.tolist(), [161.7, 283.8, 405.9]) + + +class TestDask(unittest.TestCase): + """Test that numba ufuncs are compatible with dask collections and wrappers around + dask (e.g. xarray or pint) and that they can be serialized, sent over the network, + deserialized on a different host and applied remotely. + """ + + def test_dask_array(self): + a = FakeDaskArray(np.arange(4, dtype=np.float64)) + expect = np.arange(4, dtype=np.float64) * 2 + + @vectorize(["f8(f8)"]) + def double_static_vectorize(x): + return x * 2 + + @vectorize() + def double_dynamic_vectorize(x): + return x * 2 + + @guvectorize(["f8,f8[:]"], "()->()") + def double_guvectorize(x, out): + out[:] = x * 2 + + for func in ( + double_static_vectorize, + double_dynamic_vectorize, + double_guvectorize, + ): + with self.subTest(func): + b = func(a) + assert isinstance(b, FakeDaskArray) + assert_array_equal(b.array, expect) + + +class TestVectorizeDecorJitDisabled(TestVectorizeDecor): + + def setUp(self): + self.old_disable_jit = config.DISABLE_JIT + config.DISABLE_JIT = False + + def tearDown(self): + config.DISABLE_JIT = self.old_disable_jit + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/07/077113dcf8ec5012505946acc535c210e9a832c2fd10e7dd3530e7a5c864cefc/blob b/shared/package-files/07/077113dcf8ec5012505946acc535c210e9a832c2fd10e7dd3530e7a5c864cefc/blob new file mode 100644 index 0000000000000000000000000000000000000000..549db200b76576ef7e356b8c6291326e45830755 --- /dev/null +++ b/shared/package-files/07/077113dcf8ec5012505946acc535c210e9a832c2fd10e7dd3530e7a5c864cefc/blob @@ -0,0 +1,289 @@ +from datetime import datetime +from typing import ( + Any, + Callable, + Dict, + Iterator, + List, + Mapping, + MutableMapping, + Optional, + Sequence, + Tuple, + Type, + Union, + ClassVar, + Container, + TypeVar, +) +from unittest.mock import MagicMock +from uuid import UUID + +from django.core.files.base import File +from django.db.models.base import Model +from django.db.models.manager import Manager +from django.db.models.query import QuerySet, _BaseQuerySet +from django.db.models.query_utils import Q +from django.forms.fields import CharField, ChoiceField, Field +from django.forms.forms import BaseForm, DeclarativeFieldsMetaclass +from django.forms.formsets import BaseFormSet +from django.forms.utils import ErrorList +from django.forms.widgets import Input, Widget +from typing_extensions import Literal + +from django.db import models +from django.db.models import ForeignKey + +ALL_FIELDS: str + +_Fields = Union[List[Union[Callable, str]], Sequence[str], Literal["__all__"]] +_Labels = Dict[str, str] +_ErrorMessages = Dict[str, Dict[str, str]] + +_M = TypeVar("_M", bound=Model) + +def construct_instance( + form: BaseForm, instance: _M, fields: Optional[Container[str]] = ..., exclude: Optional[Container[str]] = ... +) -> _M: ... +def model_to_dict( + instance: Model, fields: Optional[_Fields] = ..., exclude: Optional[_Fields] = ... +) -> Dict[str, Any]: ... +def fields_for_model( + model: Type[Model], + fields: Optional[_Fields] = ..., + exclude: Optional[_Fields] = ..., + widgets: Optional[Union[Dict[str, Type[Input]], Dict[str, Widget]]] = ..., + formfield_callback: Optional[Union[Callable, str]] = ..., + localized_fields: Optional[Union[Tuple[str], str]] = ..., + labels: Optional[_Labels] = ..., + help_texts: Optional[Dict[str, str]] = ..., + error_messages: Optional[_ErrorMessages] = ..., + field_classes: Optional[Dict[str, Type[CharField]]] = ..., + *, + apply_limit_choices_to: bool = ... +) -> Dict[str, Any]: ... + +class ModelFormOptions: + model: Optional[Type[Model]] = ... + fields: Optional[_Fields] = ... + exclude: Optional[_Fields] = ... + widgets: Optional[Dict[str, Union[Widget, Input]]] = ... + localized_fields: Optional[Union[Tuple[str], str]] = ... + labels: Optional[_Labels] = ... + help_texts: Optional[Dict[str, str]] = ... + error_messages: Optional[_ErrorMessages] = ... + field_classes: Optional[Dict[str, Type[Field]]] = ... + def __init__(self, options: Optional[type] = ...) -> None: ... + +class ModelFormMetaclass(DeclarativeFieldsMetaclass): ... + +class BaseModelForm(BaseForm): + instance: Any = ... + def __init__( + self, + data: Optional[Mapping[str, Any]] = ..., + files: Optional[Mapping[str, File]] = ..., + auto_id: Union[bool, str] = ..., + prefix: Optional[str] = ..., + initial: Optional[Dict[str, Any]] = ..., + error_class: Type[ErrorList] = ..., + label_suffix: Optional[str] = ..., + empty_permitted: bool = ..., + instance: Optional[Model] = ..., + use_required_attribute: Optional[bool] = ..., + renderer: Any = ..., + ) -> None: ... + def validate_unique(self) -> None: ... + save_m2m: Any = ... + def save(self, commit: bool = ...) -> Any: ... + +class ModelForm(BaseModelForm, metaclass=ModelFormMetaclass): + base_fields: ClassVar[Dict[str, Field]] = ... + +def modelform_factory( + model: Type[Model], + form: Type[ModelForm] = ..., + fields: Optional[_Fields] = ..., + exclude: Optional[_Fields] = ..., + formfield_callback: Optional[Union[str, Callable[[models.Field], Field]]] = ..., + widgets: Optional[MutableMapping[str, Widget]] = ..., + localized_fields: Optional[Sequence[str]] = ..., + labels: Optional[MutableMapping[str, str]] = ..., + help_texts: Optional[MutableMapping[str, str]] = ..., + error_messages: Optional[MutableMapping[str, Dict[str, Any]]] = ..., + field_classes: Optional[MutableMapping[str, Type[Field]]] = ..., +) -> Type[ModelForm]: ... + +class BaseModelFormSet(BaseFormSet): + model: Any = ... + unique_fields: Any = ... + queryset: Any = ... + initial_extra: Any = ... + def __init__( + self, + data: Optional[Any] = ..., + files: Optional[Any] = ..., + auto_id: str = ..., + prefix: Optional[Any] = ..., + queryset: Optional[Any] = ..., + *, + initial: Optional[Any] = ..., + **kwargs: Any + ) -> None: ... + def initial_form_count(self): ... + def get_queryset(self): ... + def save_new(self, form: Any, commit: bool = ...): ... + def save_existing(self, form: Any, instance: Any, commit: bool = ...): ... + def delete_existing(self, obj: Any, commit: bool = ...) -> None: ... + saved_forms: Any = ... + save_m2m: Any = ... + def save(self, commit: bool = ...): ... + def clean(self) -> None: ... + def validate_unique(self) -> None: ... + def get_unique_error_message(self, unique_check: Any): ... + def get_date_error_message(self, date_check: Any): ... + def get_form_error(self): ... + changed_objects: Any = ... + deleted_objects: Any = ... + def save_existing_objects(self, commit: bool = ...): ... + new_objects: Any = ... + def save_new_objects(self, commit: bool = ...): ... + def add_fields(self, form: Any, index: Any): ... + +def modelformset_factory( + model: Type[Model], + form: Type[ModelForm] = ..., + formfield_callback: Optional[Callable] = ..., + formset: Type[BaseModelFormSet] = ..., + extra: int = ..., + can_delete: bool = ..., + can_order: bool = ..., + min_num: Optional[int] = ..., + max_num: Optional[int] = ..., + fields: Optional[_Fields] = ..., + exclude: Optional[_Fields] = ..., + widgets: Optional[Dict[str, Any]] = ..., + validate_max: bool = ..., + localized_fields: Optional[Sequence[str]] = ..., + labels: Optional[Dict[str, str]] = ..., + help_texts: Optional[Dict[str, str]] = ..., + error_messages: Optional[Dict[str, Dict[str, str]]] = ..., + validate_min: bool = ..., + field_classes: Optional[Dict[str, Type[Field]]] = ..., +) -> Type[BaseModelFormSet]: ... + +class BaseInlineFormSet(BaseModelFormSet): + instance: Any = ... + save_as_new: Any = ... + unique_fields: Any = ... + def __init__( + self, + data: Optional[Any] = ..., + files: Optional[Any] = ..., + instance: Optional[Any] = ..., + save_as_new: bool = ..., + prefix: Optional[Any] = ..., + queryset: Optional[Any] = ..., + **kwargs: Any + ) -> None: ... + def initial_form_count(self): ... + @classmethod + def get_default_prefix(cls): ... + def save_new(self, form: Any, commit: bool = ...): ... + def add_fields(self, form: Any, index: Any) -> None: ... + def get_unique_error_message(self, unique_check: Any): ... + +def inlineformset_factory( + parent_model: Type[Model], + model: Type[Model], + form: Type[ModelForm] = ..., + formset: Type[BaseInlineFormSet] = ..., + fk_name: Optional[str] = ..., + fields: Optional[_Fields] = ..., + exclude: Optional[_Fields] = ..., + extra: int = ..., + can_order: bool = ..., + can_delete: bool = ..., + max_num: Optional[int] = ..., + formfield_callback: Optional[Callable] = ..., + widgets: Optional[Dict[str, Any]] = ..., + validate_max: bool = ..., + localized_fields: Optional[Sequence[str]] = ..., + labels: Optional[Dict[str, str]] = ..., + help_texts: Optional[Dict[str, str]] = ..., + error_messages: Optional[Dict[str, Dict[str, str]]] = ..., + min_num: Optional[int] = ..., + validate_min: bool = ..., + field_classes: Optional[Dict[str, Any]] = ..., +) -> Type[BaseInlineFormSet]: ... + +class InlineForeignKeyField(Field): + disabled: bool + help_text: str + required: bool + show_hidden_initial: bool + widget: Any = ... + default_error_messages: Any = ... + parent_instance: Model = ... + pk_field: bool = ... + to_field: Optional[str] = ... + def __init__( + self, parent_instance: Model, *args: Any, pk_field: bool = ..., to_field: Optional[Any] = ..., **kwargs: Any + ) -> None: ... + +class ModelChoiceIterator: + field: ModelChoiceField = ... + queryset: Optional[QuerySet] = ... + def __init__(self, field: ModelChoiceField) -> None: ... + def __iter__(self) -> Iterator[Tuple[Union[int, str], str]]: ... + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... + def choice(self, obj: Model) -> Tuple[int, str]: ... + +class ModelChoiceField(ChoiceField): + disabled: bool + error_messages: Dict[str, str] + help_text: str + required: bool + show_hidden_initial: bool + validators: List[Any] + default_error_messages: Any = ... + iterator: Any = ... + empty_label: Optional[str] = ... + queryset: Any = ... + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ... + to_field_name: None = ... + def __init__( + self, + queryset: Optional[Union[Manager, QuerySet]], + *, + empty_label: Optional[str] = ..., + required: bool = ..., + widget: Optional[Any] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + to_field_name: Optional[Any] = ..., + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ..., + **kwargs: Any + ) -> None: ... + def get_limit_choices_to(self) -> Optional[Union[Dict[str, datetime], Q, MagicMock]]: ... + def label_from_instance(self, obj: Model) -> str: ... + choices: Any = ... + def validate(self, value: Optional[Model]) -> None: ... + def has_changed(self, initial: Optional[Union[Model, int, str, UUID]], data: Optional[Union[int, str]]) -> bool: ... + +class ModelMultipleChoiceField(ModelChoiceField): + disabled: bool + empty_label: None + help_text: str + required: bool + show_hidden_initial: bool + widget: Any = ... + hidden_widget: Any = ... + default_error_messages: Any = ... + def __init__(self, queryset: _BaseQuerySet, **kwargs: Any) -> None: ... + +def _get_foreign_key( + parent_model: Type[Model], model: Type[Model], fk_name: Optional[str] = ..., can_fail: bool = ... +) -> ForeignKey: ... diff --git a/shared/package-files/07/077727f6fceaf28ba6144fccf7529cc8b9d36fba24e2389f973647509001b611/blob b/shared/package-files/07/077727f6fceaf28ba6144fccf7529cc8b9d36fba24e2389f973647509001b611/blob new file mode 100644 index 0000000000000000000000000000000000000000..49c94168d203e45ceed73009cb1a2f79d2ad8114 --- /dev/null +++ b/shared/package-files/07/077727f6fceaf28ba6144fccf7529cc8b9d36fba24e2389f973647509001b611/blob @@ -0,0 +1,470 @@ +from copy import deepcopy + +import numpy as np +import pytest + +from pandas.errors import PerformanceWarning + +import pandas as pd +from pandas import ( + DataFrame, + Index, + MultiIndex, + Series, + concat, +) +import pandas._testing as tm + + +class TestIndexConcat: + def test_concat_ignore_index(self, sort): + frame1 = DataFrame( + {"test1": ["a", "b", "c"], "test2": [1, 2, 3], "test3": [4.5, 3.2, 1.2]} + ) + frame2 = DataFrame({"test3": [5.2, 2.2, 4.3]}) + frame1.index = Index(["x", "y", "z"]) + frame2.index = Index(["x", "y", "q"]) + + v1 = concat([frame1, frame2], axis=1, ignore_index=True, sort=sort) + + nan = np.nan + expected = DataFrame( + [ + [nan, nan, nan, 4.3], + ["a", 1, 4.5, 5.2], + ["b", 2, 3.2, 2.2], + ["c", 3, 1.2, nan], + ], + index=Index(["q", "x", "y", "z"]), + ) + if not sort: + expected = expected.loc[["x", "y", "z", "q"]] + + tm.assert_frame_equal(v1, expected) + + @pytest.mark.parametrize( + "name_in1,name_in2,name_in3,name_out", + [ + ("idx", "idx", "idx", "idx"), + ("idx", "idx", None, None), + ("idx", None, None, None), + ("idx1", "idx2", None, None), + ("idx1", "idx1", "idx2", None), + ("idx1", "idx2", "idx3", None), + (None, None, None, None), + ], + ) + def test_concat_same_index_names(self, name_in1, name_in2, name_in3, name_out): + # GH13475 + indices = [ + Index(["a", "b", "c"], name=name_in1), + Index(["b", "c", "d"], name=name_in2), + Index(["c", "d", "e"], name=name_in3), + ] + frames = [ + DataFrame({c: [0, 1, 2]}, index=i) for i, c in zip(indices, ["x", "y", "z"]) + ] + result = concat(frames, axis=1) + + exp_ind = Index(["a", "b", "c", "d", "e"], name=name_out) + expected = DataFrame( + { + "x": [0, 1, 2, np.nan, np.nan], + "y": [np.nan, 0, 1, 2, np.nan], + "z": [np.nan, np.nan, 0, 1, 2], + }, + index=exp_ind, + ) + + tm.assert_frame_equal(result, expected) + + def test_concat_rename_index(self): + a = DataFrame( + np.random.default_rng(2).random((3, 3)), + columns=list("ABC"), + index=Index(list("abc"), name="index_a"), + ) + b = DataFrame( + np.random.default_rng(2).random((3, 3)), + columns=list("ABC"), + index=Index(list("abc"), name="index_b"), + ) + + result = concat([a, b], keys=["key0", "key1"], names=["lvl0", "lvl1"]) + + exp = concat([a, b], keys=["key0", "key1"], names=["lvl0"]) + names = list(exp.index.names) + names[1] = "lvl1" + exp.index.set_names(names, inplace=True) + + tm.assert_frame_equal(result, exp) + assert result.index.names == exp.index.names + + def test_concat_copy_index_series(self, axis, using_copy_on_write): + # GH 29879 + ser = Series([1, 2]) + comb = concat([ser, ser], axis=axis, copy=True) + if not using_copy_on_write or axis in [0, "index"]: + assert comb.index is not ser.index + else: + assert comb.index is ser.index + + def test_concat_copy_index_frame(self, axis, using_copy_on_write): + # GH 29879 + df = DataFrame([[1, 2], [3, 4]], columns=["a", "b"]) + comb = concat([df, df], axis=axis, copy=True) + if not using_copy_on_write: + assert not comb.index.is_(df.index) + assert not comb.columns.is_(df.columns) + elif axis in [0, "index"]: + assert not comb.index.is_(df.index) + assert comb.columns.is_(df.columns) + elif axis in [1, "columns"]: + assert comb.index.is_(df.index) + assert not comb.columns.is_(df.columns) + + def test_default_index(self): + # is_series and ignore_index + s1 = Series([1, 2, 3], name="x") + s2 = Series([4, 5, 6], name="y") + res = concat([s1, s2], axis=1, ignore_index=True) + assert isinstance(res.columns, pd.RangeIndex) + exp = DataFrame([[1, 4], [2, 5], [3, 6]]) + # use check_index_type=True to check the result have + # RangeIndex (default index) + tm.assert_frame_equal(res, exp, check_index_type=True, check_column_type=True) + + # is_series and all inputs have no names + s1 = Series([1, 2, 3]) + s2 = Series([4, 5, 6]) + res = concat([s1, s2], axis=1, ignore_index=False) + assert isinstance(res.columns, pd.RangeIndex) + exp = DataFrame([[1, 4], [2, 5], [3, 6]]) + exp.columns = pd.RangeIndex(2) + tm.assert_frame_equal(res, exp, check_index_type=True, check_column_type=True) + + # is_dataframe and ignore_index + df1 = DataFrame({"A": [1, 2], "B": [5, 6]}) + df2 = DataFrame({"A": [3, 4], "B": [7, 8]}) + + res = concat([df1, df2], axis=0, ignore_index=True) + exp = DataFrame([[1, 5], [2, 6], [3, 7], [4, 8]], columns=["A", "B"]) + tm.assert_frame_equal(res, exp, check_index_type=True, check_column_type=True) + + res = concat([df1, df2], axis=1, ignore_index=True) + exp = DataFrame([[1, 5, 3, 7], [2, 6, 4, 8]]) + tm.assert_frame_equal(res, exp, check_index_type=True, check_column_type=True) + + def test_dups_index(self): + # GH 4771 + + # single dtypes + df = DataFrame( + np.random.default_rng(2).integers(0, 10, size=40).reshape(10, 4), + columns=["A", "A", "C", "C"], + ) + + result = concat([df, df], axis=1) + tm.assert_frame_equal(result.iloc[:, :4], df) + tm.assert_frame_equal(result.iloc[:, 4:], df) + + result = concat([df, df], axis=0) + tm.assert_frame_equal(result.iloc[:10], df) + tm.assert_frame_equal(result.iloc[10:], df) + + # multi dtypes + df = concat( + [ + DataFrame( + np.random.default_rng(2).standard_normal((10, 4)), + columns=["A", "A", "B", "B"], + ), + DataFrame( + np.random.default_rng(2).integers(0, 10, size=20).reshape(10, 2), + columns=["A", "C"], + ), + ], + axis=1, + ) + + result = concat([df, df], axis=1) + tm.assert_frame_equal(result.iloc[:, :6], df) + tm.assert_frame_equal(result.iloc[:, 6:], df) + + result = concat([df, df], axis=0) + tm.assert_frame_equal(result.iloc[:10], df) + tm.assert_frame_equal(result.iloc[10:], df) + + # append + result = df.iloc[0:8, :]._append(df.iloc[8:]) + tm.assert_frame_equal(result, df) + + result = df.iloc[0:8, :]._append(df.iloc[8:9])._append(df.iloc[9:10]) + tm.assert_frame_equal(result, df) + + expected = concat([df, df], axis=0) + result = df._append(df) + tm.assert_frame_equal(result, expected) + + +class TestMultiIndexConcat: + def test_concat_multiindex_with_keys(self, multiindex_dataframe_random_data): + frame = multiindex_dataframe_random_data + index = frame.index + result = concat([frame, frame], keys=[0, 1], names=["iteration"]) + + assert result.index.names == ("iteration",) + index.names + tm.assert_frame_equal(result.loc[0], frame) + tm.assert_frame_equal(result.loc[1], frame) + assert result.index.nlevels == 3 + + def test_concat_multiindex_with_none_in_index_names(self): + # GH 15787 + index = MultiIndex.from_product([[1], range(5)], names=["level1", None]) + df = DataFrame({"col": range(5)}, index=index, dtype=np.int32) + + result = concat([df, df], keys=[1, 2], names=["level2"]) + index = MultiIndex.from_product( + [[1, 2], [1], range(5)], names=["level2", "level1", None] + ) + expected = DataFrame({"col": list(range(5)) * 2}, index=index, dtype=np.int32) + tm.assert_frame_equal(result, expected) + + result = concat([df, df[:2]], keys=[1, 2], names=["level2"]) + level2 = [1] * 5 + [2] * 2 + level1 = [1] * 7 + no_name = list(range(5)) + list(range(2)) + tuples = list(zip(level2, level1, no_name)) + index = MultiIndex.from_tuples(tuples, names=["level2", "level1", None]) + expected = DataFrame({"col": no_name}, index=index, dtype=np.int32) + tm.assert_frame_equal(result, expected) + + def test_concat_multiindex_rangeindex(self): + # GH13542 + # when multi-index levels are RangeIndex objects + # there is a bug in concat with objects of len 1 + + df = DataFrame(np.random.default_rng(2).standard_normal((9, 2))) + df.index = MultiIndex( + levels=[pd.RangeIndex(3), pd.RangeIndex(3)], + codes=[np.repeat(np.arange(3), 3), np.tile(np.arange(3), 3)], + ) + + res = concat([df.iloc[[2, 3, 4], :], df.iloc[[5], :]]) + exp = df.iloc[[2, 3, 4, 5], :] + tm.assert_frame_equal(res, exp) + + def test_concat_multiindex_dfs_with_deepcopy(self): + # GH 9967 + example_multiindex1 = MultiIndex.from_product([["a"], ["b"]]) + example_dataframe1 = DataFrame([0], index=example_multiindex1) + + example_multiindex2 = MultiIndex.from_product([["a"], ["c"]]) + example_dataframe2 = DataFrame([1], index=example_multiindex2) + + example_dict = {"s1": example_dataframe1, "s2": example_dataframe2} + expected_index = MultiIndex( + levels=[["s1", "s2"], ["a"], ["b", "c"]], + codes=[[0, 1], [0, 0], [0, 1]], + names=["testname", None, None], + ) + expected = DataFrame([[0], [1]], index=expected_index) + result_copy = concat(deepcopy(example_dict), names=["testname"]) + tm.assert_frame_equal(result_copy, expected) + result_no_copy = concat(example_dict, names=["testname"]) + tm.assert_frame_equal(result_no_copy, expected) + + @pytest.mark.parametrize( + "mi1_list", + [ + [["a"], range(2)], + [["b"], np.arange(2.0, 4.0)], + [["c"], ["A", "B"]], + [["d"], pd.date_range(start="2017", end="2018", periods=2)], + ], + ) + @pytest.mark.parametrize( + "mi2_list", + [ + [["a"], range(2)], + [["b"], np.arange(2.0, 4.0)], + [["c"], ["A", "B"]], + [["d"], pd.date_range(start="2017", end="2018", periods=2)], + ], + ) + def test_concat_with_various_multiindex_dtypes( + self, mi1_list: list, mi2_list: list + ): + # GitHub #23478 + mi1 = MultiIndex.from_product(mi1_list) + mi2 = MultiIndex.from_product(mi2_list) + + df1 = DataFrame(np.zeros((1, len(mi1))), columns=mi1) + df2 = DataFrame(np.zeros((1, len(mi2))), columns=mi2) + + if mi1_list[0] == mi2_list[0]: + expected_mi = MultiIndex( + levels=[mi1_list[0], list(mi1_list[1])], + codes=[[0, 0, 0, 0], [0, 1, 0, 1]], + ) + else: + expected_mi = MultiIndex( + levels=[ + mi1_list[0] + mi2_list[0], + list(mi1_list[1]) + list(mi2_list[1]), + ], + codes=[[0, 0, 1, 1], [0, 1, 2, 3]], + ) + + expected_df = DataFrame(np.zeros((1, len(expected_mi))), columns=expected_mi) + + with tm.assert_produces_warning(None): + result_df = concat((df1, df2), axis=1) + + tm.assert_frame_equal(expected_df, result_df) + + def test_concat_multiindex_(self): + # GitHub #44786 + df = DataFrame({"col": ["a", "b", "c"]}, index=["1", "2", "2"]) + df = concat([df], keys=["X"]) + + iterables = [["X"], ["1", "2", "2"]] + result_index = df.index + expected_index = MultiIndex.from_product(iterables) + + tm.assert_index_equal(result_index, expected_index) + + result_df = df + expected_df = DataFrame( + {"col": ["a", "b", "c"]}, index=MultiIndex.from_product(iterables) + ) + tm.assert_frame_equal(result_df, expected_df) + + def test_concat_with_key_not_unique(self): + # GitHub #46519 + df1 = DataFrame({"name": [1]}) + df2 = DataFrame({"name": [2]}) + df3 = DataFrame({"name": [3]}) + df_a = concat([df1, df2, df3], keys=["x", "y", "x"]) + # the warning is caused by indexing unsorted multi-index + with tm.assert_produces_warning( + PerformanceWarning, match="indexing past lexsort depth" + ): + out_a = df_a.loc[("x", 0), :] + + df_b = DataFrame( + {"name": [1, 2, 3]}, index=Index([("x", 0), ("y", 0), ("x", 0)]) + ) + with tm.assert_produces_warning( + PerformanceWarning, match="indexing past lexsort depth" + ): + out_b = df_b.loc[("x", 0)] + + tm.assert_frame_equal(out_a, out_b) + + df1 = DataFrame({"name": ["a", "a", "b"]}) + df2 = DataFrame({"name": ["a", "b"]}) + df3 = DataFrame({"name": ["c", "d"]}) + df_a = concat([df1, df2, df3], keys=["x", "y", "x"]) + with tm.assert_produces_warning( + PerformanceWarning, match="indexing past lexsort depth" + ): + out_a = df_a.loc[("x", 0), :] + + df_b = DataFrame( + { + "a": ["x", "x", "x", "y", "y", "x", "x"], + "b": [0, 1, 2, 0, 1, 0, 1], + "name": list("aababcd"), + } + ).set_index(["a", "b"]) + df_b.index.names = [None, None] + with tm.assert_produces_warning( + PerformanceWarning, match="indexing past lexsort depth" + ): + out_b = df_b.loc[("x", 0), :] + + tm.assert_frame_equal(out_a, out_b) + + def test_concat_with_duplicated_levels(self): + # keyword levels should be unique + df1 = DataFrame({"A": [1]}, index=["x"]) + df2 = DataFrame({"A": [1]}, index=["y"]) + msg = r"Level values not unique: \['x', 'y', 'y'\]" + with pytest.raises(ValueError, match=msg): + concat([df1, df2], keys=["x", "y"], levels=[["x", "y", "y"]]) + + @pytest.mark.parametrize("levels", [[["x", "y"]], [["x", "y", "y"]]]) + def test_concat_with_levels_with_none_keys(self, levels): + df1 = DataFrame({"A": [1]}, index=["x"]) + df2 = DataFrame({"A": [1]}, index=["y"]) + msg = "levels supported only when keys is not None" + with pytest.raises(ValueError, match=msg): + concat([df1, df2], levels=levels) + + def test_concat_range_index_result(self): + # GH#47501 + df1 = DataFrame({"a": [1, 2]}) + df2 = DataFrame({"b": [1, 2]}) + + result = concat([df1, df2], sort=True, axis=1) + expected = DataFrame({"a": [1, 2], "b": [1, 2]}) + tm.assert_frame_equal(result, expected) + expected_index = pd.RangeIndex(0, 2) + tm.assert_index_equal(result.index, expected_index, exact=True) + + def test_concat_index_keep_dtype(self): + # GH#47329 + df1 = DataFrame([[0, 1, 1]], columns=Index([1, 2, 3], dtype="object")) + df2 = DataFrame([[0, 1]], columns=Index([1, 2], dtype="object")) + result = concat([df1, df2], ignore_index=True, join="outer", sort=True) + expected = DataFrame( + [[0, 1, 1.0], [0, 1, np.nan]], columns=Index([1, 2, 3], dtype="object") + ) + tm.assert_frame_equal(result, expected) + + def test_concat_index_keep_dtype_ea_numeric(self, any_numeric_ea_dtype): + # GH#47329 + df1 = DataFrame( + [[0, 1, 1]], columns=Index([1, 2, 3], dtype=any_numeric_ea_dtype) + ) + df2 = DataFrame([[0, 1]], columns=Index([1, 2], dtype=any_numeric_ea_dtype)) + result = concat([df1, df2], ignore_index=True, join="outer", sort=True) + expected = DataFrame( + [[0, 1, 1.0], [0, 1, np.nan]], + columns=Index([1, 2, 3], dtype=any_numeric_ea_dtype), + ) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize("dtype", ["Int8", "Int16", "Int32"]) + def test_concat_index_find_common(self, dtype): + # GH#47329 + df1 = DataFrame([[0, 1, 1]], columns=Index([1, 2, 3], dtype=dtype)) + df2 = DataFrame([[0, 1]], columns=Index([1, 2], dtype="Int32")) + result = concat([df1, df2], ignore_index=True, join="outer", sort=True) + expected = DataFrame( + [[0, 1, 1.0], [0, 1, np.nan]], columns=Index([1, 2, 3], dtype="Int32") + ) + tm.assert_frame_equal(result, expected) + + def test_concat_axis_1_sort_false_rangeindex(self, using_infer_string): + # GH 46675 + s1 = Series(["a", "b", "c"]) + s2 = Series(["a", "b"]) + s3 = Series(["a", "b", "c", "d"]) + s4 = Series([], dtype=object if not using_infer_string else "str") + result = concat( + [s1, s2, s3, s4], sort=False, join="outer", ignore_index=False, axis=1 + ) + expected = DataFrame( + [ + ["a"] * 3 + [np.nan], + ["b"] * 3 + [np.nan], + ["c", np.nan] * 2, + [np.nan] * 2 + ["d"] + [np.nan], + ], + dtype=object if not using_infer_string else "str", + ) + tm.assert_frame_equal( + result, expected, check_index_type=True, check_column_type=True + ) diff --git a/shared/package-files/07/077ac2dd46027897aed759e570fdf7bec83c3bf83abb3732206ac4e24d954d8b/README.md b/shared/package-files/07/077ac2dd46027897aed759e570fdf7bec83c3bf83abb3732206ac4e24d954d8b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..74538ba3e50b8b779da37bc34257c63c325199f3 --- /dev/null +++ b/shared/package-files/07/077ac2dd46027897aed759e570fdf7bec83c3bf83abb3732206ac4e24d954d8b/README.md @@ -0,0 +1,3 @@ +# Molecular retrieval research package + +E016: equal-weight ensemble of ten-peak and 64-peak transformers with fragment/neutral-loss bin embeddings and fine mass-defect Fourier features, trained from random initialization on MassSpecGym v1.5 train fold plus supplied held-out-clean ICEBERG simulations (2,333,477 nonempty spectra). Morgan fingerprint predictions rank supplied molecular candidates by training-frequency-weighted cosine plus a train-fitted mixture of Cauchy precursor-mass error densities; candidate exact masses derive from supplied SMILES and no true query formula is used. All adducts and instrument conditions use the same trained model. Selected by full-validation retrieval Hit@1; validation results do not establish improvement over the external test reference. Run infer.sh INPUT_ROOT OUTPUT_ROOT. Runtime: supplied /opt/glacier/bin/python, one GPU, 4 CPU workers. No external data or cache is needed. diff --git a/shared/package-files/07/077c812f39fdcb97f9c34fa677d175c21bf3e7a97b234ef38e5ecbda52c0b6c9/blob b/shared/package-files/07/077c812f39fdcb97f9c34fa677d175c21bf3e7a97b234ef38e5ecbda52c0b6c9/blob new file mode 100644 index 0000000000000000000000000000000000000000..c8dfdb52e9c8f121e3f052d813781dd1ea4eeffb --- /dev/null +++ b/shared/package-files/07/077c812f39fdcb97f9c34fa677d175c21bf3e7a97b234ef38e5ecbda52c0b6c9/blob @@ -0,0 +1,49 @@ + +source("M:\\josef_new\\eclipse_ws\\statsmodels\\statsmodels_py34_pr\\tools\\R2nparray\\R\\R2nparray.R") +library('mgcv') +library('gamair') +d = data(mpg) + +#gam_a = gam(city.mpg ~ fuel + drive + s(weight,bs="cc",k=7) + s(hp,bs="cc",k=6), data = mpg, +# sp = c(6.46225497484073, 0.81532465890585)) + + +#gam_a = gam(city.mpg ~ fuel + drive + s(weight,bs="bs",k=7) + s(hp,bs="bs",k=6), data = mpg) + +sm_knots_w = c(1488., 1488., 1488., 1488., 1953.22222222, 2118.77777778, 2275., 2383.88888889, 2515.55555556, 2757.33333333, 3016.44444444, 3208.11111111, 4066., 4066., 4066., 4066.) +sm_knots_hp = c(48.0, 48.0, 48.0, 48.0, 68.0, 73.0, 88.0, 101.0, 116.0, 152.28571428571428, 288.0, 288.0, 288.0, 288.0) + +knots_w <- data.frame(weight=sm_knots_w) +knots_h <- data.frame(hp=sm_knots_hp) +gam_a = gam(city.mpg ~ fuel + drive + s(weight,bs="bs",k=12) + s(hp,bs="bs",k=10), data = mpg, knots=c(knots_w, knots_h), family=poisson) + + +pls = gam_a + +fname = "results_mpg_bs_poisson.py" +append = FALSE #TRUE + +#redirect output to file +sink(file=fname, append=append) +write_header() +mod_name = "mpg_bs_poisson." +cat("\nmpg_bs_poisson = Bunch()\n") +cat(paste("\n", mod_name, "smooth0 = Bunch()\n", sep="")) + +sm1 <- gam_a$smooth[[1]] +cat_items(sm1, prefix=paste(mod_name, "smooth0.", sep="")) +#, blacklist=c()) +cat("\n") +cat(convert.numeric(pls$smooth[[1]]$S[[1]], name=paste(mod_name, "smooth0.S", sep=""))) +cat("\n") +cat_items(pls, prefix=mod_name, blacklist=c("eq", "control")) +cat("\n") +pls_summ = summary(pls) +cat_items(pls_summ, prefix=mod_name, blacklist=c("eq", "control")) + +params = coef(pls) +cat("\n") +cat(convert.numeric(params, name=paste(mod_name, "params", sep=""))) + +# stop redirecting output +sink() diff --git a/shared/package-files/07/077daa5474aed22ce8959007f373d80719cbbc96c242ab83f9f75f8fc136739e/blob b/shared/package-files/07/077daa5474aed22ce8959007f373d80719cbbc96c242ab83f9f75f8fc136739e/blob new file mode 100644 index 0000000000000000000000000000000000000000..2d66e8b04e5db132e860f74d59aad7a4b8ff4106 --- /dev/null +++ b/shared/package-files/07/077daa5474aed22ce8959007f373d80719cbbc96c242ab83f9f75f8fc136739e/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor fbgemm_linear_int8_weight_fp32_activation(const at::Tensor & input, const at::Tensor & weight, const at::Tensor & packed, const at::Tensor & col_offsets, const at::Scalar & weight_scale, const at::Scalar & weight_zero_point, const at::Tensor & bias); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/07/077ff6396f442bebbf507cfdbe30a1c033533d91b54eb44b3287986301b3f96a/blob b/shared/package-files/07/077ff6396f442bebbf507cfdbe30a1c033533d91b54eb44b3287986301b3f96a/blob new file mode 100644 index 0000000000000000000000000000000000000000..3c83e0642b9d541c516ced555fa5664d864d401d --- /dev/null +++ b/shared/package-files/07/077ff6396f442bebbf507cfdbe30a1c033533d91b54eb44b3287986301b3f96a/blob @@ -0,0 +1,861 @@ +"""Generate graphs with a given degree sequence or expected degree sequence. +""" + +import heapq +import math +from itertools import chain, combinations, zip_longest +from operator import itemgetter + +import networkx as nx +from networkx.utils import py_random_state, random_weighted_sample + +__all__ = [ + "configuration_model", + "directed_configuration_model", + "expected_degree_graph", + "havel_hakimi_graph", + "directed_havel_hakimi_graph", + "degree_sequence_tree", + "random_degree_sequence_graph", +] + +chaini = chain.from_iterable + + +def _to_stublist(degree_sequence): + """Returns a list of degree-repeated node numbers. + + ``degree_sequence`` is a list of nonnegative integers representing + the degrees of nodes in a graph. + + This function returns a list of node numbers with multiplicities + according to the given degree sequence. For example, if the first + element of ``degree_sequence`` is ``3``, then the first node number, + ``0``, will appear at the head of the returned list three times. The + node numbers are assumed to be the numbers zero through + ``len(degree_sequence) - 1``. + + Examples + -------- + + >>> degree_sequence = [1, 2, 3] + >>> _to_stublist(degree_sequence) + [0, 1, 1, 2, 2, 2] + + If a zero appears in the sequence, that means the node exists but + has degree zero, so that number will be skipped in the returned + list:: + + >>> degree_sequence = [2, 0, 1] + >>> _to_stublist(degree_sequence) + [0, 0, 2] + + """ + return list(chaini([n] * d for n, d in enumerate(degree_sequence))) + + +def _configuration_model( + deg_sequence, create_using, directed=False, in_deg_sequence=None, seed=None +): + """Helper function for generating either undirected or directed + configuration model graphs. + + ``deg_sequence`` is a list of nonnegative integers representing the + degree of the node whose label is the index of the list element. + + ``create_using`` see :func:`~networkx.empty_graph`. + + ``directed`` and ``in_deg_sequence`` are required if you want the + returned graph to be generated using the directed configuration + model algorithm. If ``directed`` is ``False``, then ``deg_sequence`` + is interpreted as the degree sequence of an undirected graph and + ``in_deg_sequence`` is ignored. Otherwise, if ``directed`` is + ``True``, then ``deg_sequence`` is interpreted as the out-degree + sequence and ``in_deg_sequence`` as the in-degree sequence of a + directed graph. + + .. note:: + + ``deg_sequence`` and ``in_deg_sequence`` need not be the same + length. + + ``seed`` is a random.Random or numpy.random.RandomState instance + + This function returns a graph, directed if and only if ``directed`` + is ``True``, generated according to the configuration model + algorithm. For more information on the algorithm, see the + :func:`configuration_model` or :func:`directed_configuration_model` + functions. + + """ + n = len(deg_sequence) + G = nx.empty_graph(n, create_using) + # If empty, return the null graph immediately. + if n == 0: + return G + # Build a list of available degree-repeated nodes. For example, + # for degree sequence [3, 2, 1, 1, 1], the "stub list" is + # initially [0, 0, 0, 1, 1, 2, 3, 4], that is, node 0 has degree + # 3 and thus is repeated 3 times, etc. + # + # Also, shuffle the stub list in order to get a random sequence of + # node pairs. + if directed: + pairs = zip_longest(deg_sequence, in_deg_sequence, fillvalue=0) + # Unzip the list of pairs into a pair of lists. + out_deg, in_deg = zip(*pairs) + + out_stublist = _to_stublist(out_deg) + in_stublist = _to_stublist(in_deg) + + seed.shuffle(out_stublist) + seed.shuffle(in_stublist) + else: + stublist = _to_stublist(deg_sequence) + # Choose a random balanced bipartition of the stublist, which + # gives a random pairing of nodes. In this implementation, we + # shuffle the list and then split it in half. + n = len(stublist) + half = n // 2 + seed.shuffle(stublist) + out_stublist, in_stublist = stublist[:half], stublist[half:] + G.add_edges_from(zip(out_stublist, in_stublist)) + return G + + +@py_random_state(2) +def configuration_model(deg_sequence, create_using=None, seed=None): + """Returns a random graph with the given degree sequence. + + The configuration model generates a random pseudograph (graph with + parallel edges and self loops) by randomly assigning edges to + match the given degree sequence. + + Parameters + ---------- + deg_sequence : list of nonnegative integers + Each list entry corresponds to the degree of a node. + create_using : NetworkX graph constructor, optional (default MultiGraph) + Graph type to create. If graph instance, then cleared before populated. + seed : integer, random_state, or None (default) + Indicator of random number generation state. + See :ref:`Randomness`. + + Returns + ------- + G : MultiGraph + A graph with the specified degree sequence. + Nodes are labeled starting at 0 with an index + corresponding to the position in deg_sequence. + + Raises + ------ + NetworkXError + If the degree sequence does not have an even sum. + + See Also + -------- + is_graphical + + Notes + ----- + As described by Newman [1]_. + + A non-graphical degree sequence (not realizable by some simple + graph) is allowed since this function returns graphs with self + loops and parallel edges. An exception is raised if the degree + sequence does not have an even sum. + + This configuration model construction process can lead to + duplicate edges and loops. You can remove the self-loops and + parallel edges (see below) which will likely result in a graph + that doesn't have the exact degree sequence specified. + + The density of self-loops and parallel edges tends to decrease as + the number of nodes increases. However, typically the number of + self-loops will approach a Poisson distribution with a nonzero mean, + and similarly for the number of parallel edges. Consider a node + with *k* stubs. The probability of being joined to another stub of + the same node is basically (*k* - *1*) / *N*, where *k* is the + degree and *N* is the number of nodes. So the probability of a + self-loop scales like *c* / *N* for some constant *c*. As *N* grows, + this means we expect *c* self-loops. Similarly for parallel edges. + + References + ---------- + .. [1] M.E.J. Newman, "The structure and function of complex networks", + SIAM REVIEW 45-2, pp 167-256, 2003. + + Examples + -------- + You can create a degree sequence following a particular distribution + by using the one of the distribution functions in + :mod:`~networkx.utils.random_sequence` (or one of your own). For + example, to create an undirected multigraph on one hundred nodes + with degree sequence chosen from the power law distribution: + + >>> sequence = nx.random_powerlaw_tree_sequence(100, tries=5000) + >>> G = nx.configuration_model(sequence) + >>> len(G) + 100 + >>> actual_degrees = [d for v, d in G.degree()] + >>> actual_degrees == sequence + True + + The returned graph is a multigraph, which may have parallel + edges. To remove any parallel edges from the returned graph: + + >>> G = nx.Graph(G) + + Similarly, to remove self-loops: + + >>> G.remove_edges_from(nx.selfloop_edges(G)) + + """ + if sum(deg_sequence) % 2 != 0: + msg = "Invalid degree sequence: sum of degrees must be even, not odd" + raise nx.NetworkXError(msg) + + G = nx.empty_graph(0, create_using, default=nx.MultiGraph) + if G.is_directed(): + raise nx.NetworkXNotImplemented("not implemented for directed graphs") + + G = _configuration_model(deg_sequence, G, seed=seed) + + return G + + +@py_random_state(3) +def directed_configuration_model( + in_degree_sequence, out_degree_sequence, create_using=None, seed=None +): + """Returns a directed_random graph with the given degree sequences. + + The configuration model generates a random directed pseudograph + (graph with parallel edges and self loops) by randomly assigning + edges to match the given degree sequences. + + Parameters + ---------- + in_degree_sequence : list of nonnegative integers + Each list entry corresponds to the in-degree of a node. + out_degree_sequence : list of nonnegative integers + Each list entry corresponds to the out-degree of a node. + create_using : NetworkX graph constructor, optional (default MultiDiGraph) + Graph type to create. If graph instance, then cleared before populated. + seed : integer, random_state, or None (default) + Indicator of random number generation state. + See :ref:`Randomness`. + + Returns + ------- + G : MultiDiGraph + A graph with the specified degree sequences. + Nodes are labeled starting at 0 with an index + corresponding to the position in deg_sequence. + + Raises + ------ + NetworkXError + If the degree sequences do not have the same sum. + + See Also + -------- + configuration_model + + Notes + ----- + Algorithm as described by Newman [1]_. + + A non-graphical degree sequence (not realizable by some simple + graph) is allowed since this function returns graphs with self + loops and parallel edges. An exception is raised if the degree + sequences does not have the same sum. + + This configuration model construction process can lead to + duplicate edges and loops. You can remove the self-loops and + parallel edges (see below) which will likely result in a graph + that doesn't have the exact degree sequence specified. This + "finite-size effect" decreases as the size of the graph increases. + + References + ---------- + .. [1] Newman, M. E. J. and Strogatz, S. H. and Watts, D. J. + Random graphs with arbitrary degree distributions and their applications + Phys. Rev. E, 64, 026118 (2001) + + Examples + -------- + One can modify the in- and out-degree sequences from an existing + directed graph in order to create a new directed graph. For example, + here we modify the directed path graph: + + >>> D = nx.DiGraph([(0, 1), (1, 2), (2, 3)]) + >>> din = list(d for n, d in D.in_degree()) + >>> dout = list(d for n, d in D.out_degree()) + >>> din.append(1) + >>> dout[0] = 2 + >>> # We now expect an edge from node 0 to a new node, node 3. + ... D = nx.directed_configuration_model(din, dout) + + The returned graph is a directed multigraph, which may have parallel + edges. To remove any parallel edges from the returned graph: + + >>> D = nx.DiGraph(D) + + Similarly, to remove self-loops: + + >>> D.remove_edges_from(nx.selfloop_edges(D)) + + """ + if sum(in_degree_sequence) != sum(out_degree_sequence): + msg = "Invalid degree sequences: sequences must have equal sums" + raise nx.NetworkXError(msg) + + if create_using is None: + create_using = nx.MultiDiGraph + + G = _configuration_model( + out_degree_sequence, + create_using, + directed=True, + in_deg_sequence=in_degree_sequence, + seed=seed, + ) + + name = "directed configuration_model {} nodes {} edges" + return G + + +@py_random_state(1) +def expected_degree_graph(w, seed=None, selfloops=True): + r"""Returns a random graph with given expected degrees. + + Given a sequence of expected degrees $W=(w_0,w_1,\ldots,w_{n-1})$ + of length $n$ this algorithm assigns an edge between node $u$ and + node $v$ with probability + + .. math:: + + p_{uv} = \frac{w_u w_v}{\sum_k w_k} . + + Parameters + ---------- + w : list + The list of expected degrees. + selfloops: bool (default=True) + Set to False to remove the possibility of self-loop edges. + seed : integer, random_state, or None (default) + Indicator of random number generation state. + See :ref:`Randomness`. + + Returns + ------- + Graph + + Examples + -------- + >>> z = [10 for i in range(100)] + >>> G = nx.expected_degree_graph(z) + + Notes + ----- + The nodes have integer labels corresponding to index of expected degrees + input sequence. + + The complexity of this algorithm is $\mathcal{O}(n+m)$ where $n$ is the + number of nodes and $m$ is the expected number of edges. + + The model in [1]_ includes the possibility of self-loop edges. + Set selfloops=False to produce a graph without self loops. + + For finite graphs this model doesn't produce exactly the given + expected degree sequence. Instead the expected degrees are as + follows. + + For the case without self loops (selfloops=False), + + .. math:: + + E[deg(u)] = \sum_{v \ne u} p_{uv} + = w_u \left( 1 - \frac{w_u}{\sum_k w_k} \right) . + + + NetworkX uses the standard convention that a self-loop edge counts 2 + in the degree of a node, so with self loops (selfloops=True), + + .. math:: + + E[deg(u)] = \sum_{v \ne u} p_{uv} + 2 p_{uu} + = w_u \left( 1 + \frac{w_u}{\sum_k w_k} \right) . + + References + ---------- + .. [1] Fan Chung and L. Lu, Connected components in random graphs with + given expected degree sequences, Ann. Combinatorics, 6, + pp. 125-145, 2002. + .. [2] Joel Miller and Aric Hagberg, + Efficient generation of networks with given expected degrees, + in Algorithms and Models for the Web-Graph (WAW 2011), + Alan Frieze, Paul Horn, and Paweł Prałat (Eds), LNCS 6732, + pp. 115-126, 2011. + """ + n = len(w) + G = nx.empty_graph(n) + + # If there are no nodes are no edges in the graph, return the empty graph. + if n == 0 or max(w) == 0: + return G + + rho = 1 / sum(w) + # Sort the weights in decreasing order. The original order of the + # weights dictates the order of the (integer) node labels, so we + # need to remember the permutation applied in the sorting. + order = sorted(enumerate(w), key=itemgetter(1), reverse=True) + mapping = {c: u for c, (u, v) in enumerate(order)} + seq = [v for u, v in order] + last = n + if not selfloops: + last -= 1 + for u in range(last): + v = u + if not selfloops: + v += 1 + factor = seq[u] * rho + p = min(seq[v] * factor, 1) + while v < n and p > 0: + if p != 1: + r = seed.random() + v += math.floor(math.log(r, 1 - p)) + if v < n: + q = min(seq[v] * factor, 1) + if seed.random() < q / p: + G.add_edge(mapping[u], mapping[v]) + v += 1 + p = q + return G + + +def havel_hakimi_graph(deg_sequence, create_using=None): + """Returns a simple graph with given degree sequence constructed + using the Havel-Hakimi algorithm. + + Parameters + ---------- + deg_sequence: list of integers + Each integer corresponds to the degree of a node (need not be sorted). + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + Directed graphs are not allowed. + + Raises + ------ + NetworkXException + For a non-graphical degree sequence (i.e. one + not realizable by some simple graph). + + Notes + ----- + The Havel-Hakimi algorithm constructs a simple graph by + successively connecting the node of highest degree to other nodes + of highest degree, resorting remaining nodes by degree, and + repeating the process. The resulting graph has a high + degree-associativity. Nodes are labeled 1,.., len(deg_sequence), + corresponding to their position in deg_sequence. + + The basic algorithm is from Hakimi [1]_ and was generalized by + Kleitman and Wang [2]_. + + References + ---------- + .. [1] Hakimi S., On Realizability of a Set of Integers as + Degrees of the Vertices of a Linear Graph. I, + Journal of SIAM, 10(3), pp. 496-506 (1962) + .. [2] Kleitman D.J. and Wang D.L. + Algorithms for Constructing Graphs and Digraphs with Given Valences + and Factors Discrete Mathematics, 6(1), pp. 79-88 (1973) + """ + if not nx.is_graphical(deg_sequence): + raise nx.NetworkXError("Invalid degree sequence") + + p = len(deg_sequence) + G = nx.empty_graph(p, create_using) + if G.is_directed(): + raise nx.NetworkXError("Directed graphs are not supported") + num_degs = [[] for i in range(p)] + dmax, dsum, n = 0, 0, 0 + for d in deg_sequence: + # Process only the non-zero integers + if d > 0: + num_degs[d].append(n) + dmax, dsum, n = max(dmax, d), dsum + d, n + 1 + # Return graph if no edges + if n == 0: + return G + + modstubs = [(0, 0)] * (dmax + 1) + # Successively reduce degree sequence by removing the maximum degree + while n > 0: + # Retrieve the maximum degree in the sequence + while len(num_degs[dmax]) == 0: + dmax -= 1 + # If there are not enough stubs to connect to, then the sequence is + # not graphical + if dmax > n - 1: + raise nx.NetworkXError("Non-graphical integer sequence") + + # Remove largest stub in list + source = num_degs[dmax].pop() + n -= 1 + # Reduce the next dmax largest stubs + mslen = 0 + k = dmax + for i in range(dmax): + while len(num_degs[k]) == 0: + k -= 1 + target = num_degs[k].pop() + G.add_edge(source, target) + n -= 1 + if k > 1: + modstubs[mslen] = (k - 1, target) + mslen += 1 + # Add back to the list any nonzero stubs that were removed + for i in range(mslen): + (stubval, stubtarget) = modstubs[i] + num_degs[stubval].append(stubtarget) + n += 1 + + return G + + +def directed_havel_hakimi_graph(in_deg_sequence, out_deg_sequence, create_using=None): + """Returns a directed graph with the given degree sequences. + + Parameters + ---------- + in_deg_sequence : list of integers + Each list entry corresponds to the in-degree of a node. + out_deg_sequence : list of integers + Each list entry corresponds to the out-degree of a node. + create_using : NetworkX graph constructor, optional (default DiGraph) + Graph type to create. If graph instance, then cleared before populated. + + Returns + ------- + G : DiGraph + A graph with the specified degree sequences. + Nodes are labeled starting at 0 with an index + corresponding to the position in deg_sequence + + Raises + ------ + NetworkXError + If the degree sequences are not digraphical. + + See Also + -------- + configuration_model + + Notes + ----- + Algorithm as described by Kleitman and Wang [1]_. + + References + ---------- + .. [1] D.J. Kleitman and D.L. Wang + Algorithms for Constructing Graphs and Digraphs with Given Valences + and Factors Discrete Mathematics, 6(1), pp. 79-88 (1973) + """ + in_deg_sequence = nx.utils.make_list_of_ints(in_deg_sequence) + out_deg_sequence = nx.utils.make_list_of_ints(out_deg_sequence) + + # Process the sequences and form two heaps to store degree pairs with + # either zero or nonzero out degrees + sumin, sumout = 0, 0 + nin, nout = len(in_deg_sequence), len(out_deg_sequence) + maxn = max(nin, nout) + G = nx.empty_graph(maxn, create_using, default=nx.DiGraph) + if maxn == 0: + return G + maxin = 0 + stubheap, zeroheap = [], [] + for n in range(maxn): + in_deg, out_deg = 0, 0 + if n < nout: + out_deg = out_deg_sequence[n] + if n < nin: + in_deg = in_deg_sequence[n] + if in_deg < 0 or out_deg < 0: + raise nx.NetworkXError( + "Invalid degree sequences. Sequence values must be positive." + ) + sumin, sumout, maxin = sumin + in_deg, sumout + out_deg, max(maxin, in_deg) + if in_deg > 0: + stubheap.append((-1 * out_deg, -1 * in_deg, n)) + elif out_deg > 0: + zeroheap.append((-1 * out_deg, n)) + if sumin != sumout: + raise nx.NetworkXError( + "Invalid degree sequences. Sequences must have equal sums." + ) + heapq.heapify(stubheap) + heapq.heapify(zeroheap) + + modstubs = [(0, 0, 0)] * (maxin + 1) + # Successively reduce degree sequence by removing the maximum + while stubheap: + # Remove first value in the sequence with a non-zero in degree + (freeout, freein, target) = heapq.heappop(stubheap) + freein *= -1 + if freein > len(stubheap) + len(zeroheap): + raise nx.NetworkXError("Non-digraphical integer sequence") + + # Attach arcs from the nodes with the most stubs + mslen = 0 + for i in range(freein): + if zeroheap and (not stubheap or stubheap[0][0] > zeroheap[0][0]): + (stubout, stubsource) = heapq.heappop(zeroheap) + stubin = 0 + else: + (stubout, stubin, stubsource) = heapq.heappop(stubheap) + if stubout == 0: + raise nx.NetworkXError("Non-digraphical integer sequence") + G.add_edge(stubsource, target) + # Check if source is now totally connected + if stubout + 1 < 0 or stubin < 0: + modstubs[mslen] = (stubout + 1, stubin, stubsource) + mslen += 1 + + # Add the nodes back to the heaps that still have available stubs + for i in range(mslen): + stub = modstubs[i] + if stub[1] < 0: + heapq.heappush(stubheap, stub) + else: + heapq.heappush(zeroheap, (stub[0], stub[2])) + if freeout < 0: + heapq.heappush(zeroheap, (freeout, target)) + + return G + + +def degree_sequence_tree(deg_sequence, create_using=None): + """Make a tree for the given degree sequence. + + A tree has #nodes-#edges=1 so + the degree sequence must have + len(deg_sequence)-sum(deg_sequence)/2=1 + """ + # The sum of the degree sequence must be even (for any undirected graph). + degree_sum = sum(deg_sequence) + if degree_sum % 2 != 0: + msg = "Invalid degree sequence: sum of degrees must be even, not odd" + raise nx.NetworkXError(msg) + if len(deg_sequence) - degree_sum // 2 != 1: + msg = ( + "Invalid degree sequence: tree must have number of nodes equal" + " to one less than the number of edges" + ) + raise nx.NetworkXError(msg) + G = nx.empty_graph(0, create_using) + if G.is_directed(): + raise nx.NetworkXError("Directed Graph not supported") + + # Sort all degrees greater than 1 in decreasing order. + # + # TODO Does this need to be sorted in reverse order? + deg = sorted((s for s in deg_sequence if s > 1), reverse=True) + + # make path graph as backbone + n = len(deg) + 2 + nx.add_path(G, range(n)) + last = n + + # add the leaves + for source in range(1, n - 1): + nedges = deg.pop() - 2 + for target in range(last, last + nedges): + G.add_edge(source, target) + last += nedges + + # in case we added one too many + if len(G) > len(deg_sequence): + G.remove_node(0) + return G + + +@py_random_state(1) +def random_degree_sequence_graph(sequence, seed=None, tries=10): + r"""Returns a simple random graph with the given degree sequence. + + If the maximum degree $d_m$ in the sequence is $O(m^{1/4})$ then the + algorithm produces almost uniform random graphs in $O(m d_m)$ time + where $m$ is the number of edges. + + Parameters + ---------- + sequence : list of integers + Sequence of degrees + seed : integer, random_state, or None (default) + Indicator of random number generation state. + See :ref:`Randomness`. + tries : int, optional + Maximum number of tries to create a graph + + Returns + ------- + G : Graph + A graph with the specified degree sequence. + Nodes are labeled starting at 0 with an index + corresponding to the position in the sequence. + + Raises + ------ + NetworkXUnfeasible + If the degree sequence is not graphical. + NetworkXError + If a graph is not produced in specified number of tries + + See Also + -------- + is_graphical, configuration_model + + Notes + ----- + The generator algorithm [1]_ is not guaranteed to produce a graph. + + References + ---------- + .. [1] Moshen Bayati, Jeong Han Kim, and Amin Saberi, + A sequential algorithm for generating random graphs. + Algorithmica, Volume 58, Number 4, 860-910, + DOI: 10.1007/s00453-009-9340-1 + + Examples + -------- + >>> sequence = [1, 2, 2, 3] + >>> G = nx.random_degree_sequence_graph(sequence, seed=42) + >>> sorted(d for n, d in G.degree()) + [1, 2, 2, 3] + """ + DSRG = DegreeSequenceRandomGraph(sequence, seed) + for try_n in range(tries): + try: + return DSRG.generate() + except nx.NetworkXUnfeasible: + pass + raise nx.NetworkXError(f"failed to generate graph in {tries} tries") + + +class DegreeSequenceRandomGraph: + # class to generate random graphs with a given degree sequence + # use random_degree_sequence_graph() + def __init__(self, degree, rng): + if not nx.is_graphical(degree): + raise nx.NetworkXUnfeasible("degree sequence is not graphical") + self.rng = rng + self.degree = list(degree) + # node labels are integers 0,...,n-1 + self.m = sum(self.degree) / 2.0 # number of edges + try: + self.dmax = max(self.degree) # maximum degree + except ValueError: + self.dmax = 0 + + def generate(self): + # remaining_degree is mapping from int->remaining degree + self.remaining_degree = dict(enumerate(self.degree)) + # add all nodes to make sure we get isolated nodes + self.graph = nx.Graph() + self.graph.add_nodes_from(self.remaining_degree) + # remove zero degree nodes + for n, d in list(self.remaining_degree.items()): + if d == 0: + del self.remaining_degree[n] + if len(self.remaining_degree) > 0: + # build graph in three phases according to how many unmatched edges + self.phase1() + self.phase2() + self.phase3() + return self.graph + + def update_remaining(self, u, v, aux_graph=None): + # decrement remaining nodes, modify auxiliary graph if in phase3 + if aux_graph is not None: + # remove edges from auxiliary graph + aux_graph.remove_edge(u, v) + if self.remaining_degree[u] == 1: + del self.remaining_degree[u] + if aux_graph is not None: + aux_graph.remove_node(u) + else: + self.remaining_degree[u] -= 1 + if self.remaining_degree[v] == 1: + del self.remaining_degree[v] + if aux_graph is not None: + aux_graph.remove_node(v) + else: + self.remaining_degree[v] -= 1 + + def p(self, u, v): + # degree probability + return 1 - self.degree[u] * self.degree[v] / (4.0 * self.m) + + def q(self, u, v): + # remaining degree probability + norm = max(self.remaining_degree.values()) ** 2 + return self.remaining_degree[u] * self.remaining_degree[v] / norm + + def suitable_edge(self): + """Returns True if and only if an arbitrary remaining node can + potentially be joined with some other remaining node. + + """ + nodes = iter(self.remaining_degree) + u = next(nodes) + return any(v not in self.graph[u] for v in nodes) + + def phase1(self): + # choose node pairs from (degree) weighted distribution + rem_deg = self.remaining_degree + while sum(rem_deg.values()) >= 2 * self.dmax**2: + u, v = sorted(random_weighted_sample(rem_deg, 2, self.rng)) + if self.graph.has_edge(u, v): + continue + if self.rng.random() < self.p(u, v): # accept edge + self.graph.add_edge(u, v) + self.update_remaining(u, v) + + def phase2(self): + # choose remaining nodes uniformly at random and use rejection sampling + remaining_deg = self.remaining_degree + rng = self.rng + while len(remaining_deg) >= 2 * self.dmax: + while True: + u, v = sorted(rng.sample(list(remaining_deg.keys()), 2)) + if self.graph.has_edge(u, v): + continue + if rng.random() < self.q(u, v): + break + if rng.random() < self.p(u, v): # accept edge + self.graph.add_edge(u, v) + self.update_remaining(u, v) + + def phase3(self): + # build potential remaining edges and choose with rejection sampling + potential_edges = combinations(self.remaining_degree, 2) + # build auxiliary graph of potential edges not already in graph + H = nx.Graph( + [(u, v) for (u, v) in potential_edges if not self.graph.has_edge(u, v)] + ) + rng = self.rng + while self.remaining_degree: + if not self.suitable_edge(): + raise nx.NetworkXUnfeasible("no suitable edges left") + while True: + u, v = sorted(rng.choice(list(H.edges()))) + if rng.random() < self.q(u, v): + break + if rng.random() < self.p(u, v): # accept edge + self.graph.add_edge(u, v) + self.update_remaining(u, v, aux_graph=H) diff --git a/shared/package-files/07/0780d8811fad6ed5b324ab30d3955a27d6a49d7a4ef8df68679fbe86c13a732c/blob b/shared/package-files/07/0780d8811fad6ed5b324ab30d3955a27d6a49d7a4ef8df68679fbe86c13a732c/blob new file mode 100644 index 0000000000000000000000000000000000000000..0198b53093a79c15d2fd644956cb0d2862ca92a2 --- /dev/null +++ b/shared/package-files/07/0780d8811fad6ed5b324ab30d3955a27d6a49d7a4ef8df68679fbe86c13a732c/blob @@ -0,0 +1,732 @@ +# mypy: disable-error-code="attr-defined" +import pytest +import numpy as np +from numpy.testing import assert_equal, assert_almost_equal, assert_allclose +from hypothesis import given +import hypothesis.strategies as st +import hypothesis.extra.numpy as hyp_num + +from scipy.integrate import (romb, newton_cotes, + cumulative_trapezoid, trapezoid, + quad, simpson, fixed_quad, + qmc_quad, cumulative_simpson) +from scipy.integrate._quadrature import _cumulative_simpson_unequal_intervals + +from scipy import stats, special, integrate +from scipy.conftest import array_api_compatible, skip_xp_invalid_arg +from scipy._lib._array_api_no_0d import xp_assert_close + +skip_xp_backends = pytest.mark.skip_xp_backends + + +class TestFixedQuad: + def test_scalar(self): + n = 4 + expected = 1/(2*n) + got, _ = fixed_quad(lambda x: x**(2*n - 1), 0, 1, n=n) + # quadrature exact for this input + assert_allclose(got, expected, rtol=1e-12) + + def test_vector(self): + n = 4 + p = np.arange(1, 2*n) + expected = 1/(p + 1) + got, _ = fixed_quad(lambda x: x**p[:, None], 0, 1, n=n) + assert_allclose(got, expected, rtol=1e-12) + + +class TestQuadrature: + def quad(self, x, a, b, args): + raise NotImplementedError + + def test_romb(self): + assert_equal(romb(np.arange(17)), 128) + + def test_romb_gh_3731(self): + # Check that romb makes maximal use of data points + x = np.arange(2**4+1) + y = np.cos(0.2*x) + val = romb(y) + val2, err = quad(lambda x: np.cos(0.2*x), x.min(), x.max()) + assert_allclose(val, val2, rtol=1e-8, atol=0) + + def test_newton_cotes(self): + """Test the first few degrees, for evenly spaced points.""" + n = 1 + wts, errcoff = newton_cotes(n, 1) + assert_equal(wts, n*np.array([0.5, 0.5])) + assert_almost_equal(errcoff, -n**3/12.0) + + n = 2 + wts, errcoff = newton_cotes(n, 1) + assert_almost_equal(wts, n*np.array([1.0, 4.0, 1.0])/6.0) + assert_almost_equal(errcoff, -n**5/2880.0) + + n = 3 + wts, errcoff = newton_cotes(n, 1) + assert_almost_equal(wts, n*np.array([1.0, 3.0, 3.0, 1.0])/8.0) + assert_almost_equal(errcoff, -n**5/6480.0) + + n = 4 + wts, errcoff = newton_cotes(n, 1) + assert_almost_equal(wts, n*np.array([7.0, 32.0, 12.0, 32.0, 7.0])/90.0) + assert_almost_equal(errcoff, -n**7/1935360.0) + + def test_newton_cotes2(self): + """Test newton_cotes with points that are not evenly spaced.""" + + x = np.array([0.0, 1.5, 2.0]) + y = x**2 + wts, errcoff = newton_cotes(x) + exact_integral = 8.0/3 + numeric_integral = np.dot(wts, y) + assert_almost_equal(numeric_integral, exact_integral) + + x = np.array([0.0, 1.4, 2.1, 3.0]) + y = x**2 + wts, errcoff = newton_cotes(x) + exact_integral = 9.0 + numeric_integral = np.dot(wts, y) + assert_almost_equal(numeric_integral, exact_integral) + + def test_simpson(self): + y = np.arange(17) + assert_equal(simpson(y), 128) + assert_equal(simpson(y, dx=0.5), 64) + assert_equal(simpson(y, x=np.linspace(0, 4, 17)), 32) + + # integral should be exactly 21 + x = np.linspace(1, 4, 4) + def f(x): + return x**2 + + assert_allclose(simpson(f(x), x=x), 21.0) + + # integral should be exactly 114 + x = np.linspace(1, 7, 4) + assert_allclose(simpson(f(x), dx=2.0), 114) + + # test multi-axis behaviour + a = np.arange(16).reshape(4, 4) + x = np.arange(64.).reshape(4, 4, 4) + y = f(x) + for i in range(3): + r = simpson(y, x=x, axis=i) + it = np.nditer(a, flags=['multi_index']) + for _ in it: + idx = list(it.multi_index) + idx.insert(i, slice(None)) + integral = x[tuple(idx)][-1]**3 / 3 - x[tuple(idx)][0]**3 / 3 + assert_allclose(r[it.multi_index], integral) + + # test when integration axis only has two points + x = np.arange(16).reshape(8, 2) + y = f(x) + r = simpson(y, x=x, axis=-1) + + integral = 0.5 * (y[:, 1] + y[:, 0]) * (x[:, 1] - x[:, 0]) + assert_allclose(r, integral) + + # odd points, test multi-axis behaviour + a = np.arange(25).reshape(5, 5) + x = np.arange(125).reshape(5, 5, 5) + y = f(x) + for i in range(3): + r = simpson(y, x=x, axis=i) + it = np.nditer(a, flags=['multi_index']) + for _ in it: + idx = list(it.multi_index) + idx.insert(i, slice(None)) + integral = x[tuple(idx)][-1]**3 / 3 - x[tuple(idx)][0]**3 / 3 + assert_allclose(r[it.multi_index], integral) + + # Tests for checking base case + x = np.array([3]) + y = np.power(x, 2) + assert_allclose(simpson(y, x=x, axis=0), 0.0) + assert_allclose(simpson(y, x=x, axis=-1), 0.0) + + x = np.array([3, 3, 3, 3]) + y = np.power(x, 2) + assert_allclose(simpson(y, x=x, axis=0), 0.0) + assert_allclose(simpson(y, x=x, axis=-1), 0.0) + + x = np.array([[1, 2, 4, 8], [1, 2, 4, 8], [1, 2, 4, 8]]) + y = np.power(x, 2) + zero_axis = [0.0, 0.0, 0.0, 0.0] + default_axis = [170 + 1/3] * 3 # 8**3 / 3 - 1/3 + assert_allclose(simpson(y, x=x, axis=0), zero_axis) + # the following should be exact + assert_allclose(simpson(y, x=x, axis=-1), default_axis) + + x = np.array([[1, 2, 4, 8], [1, 2, 4, 8], [1, 8, 16, 32]]) + y = np.power(x, 2) + zero_axis = [0.0, 136.0, 1088.0, 8704.0] + default_axis = [170 + 1/3, 170 + 1/3, 32**3 / 3 - 1/3] + assert_allclose(simpson(y, x=x, axis=0), zero_axis) + assert_allclose(simpson(y, x=x, axis=-1), default_axis) + + + @pytest.mark.parametrize('droplast', [False, True]) + def test_simpson_2d_integer_no_x(self, droplast): + # The inputs are 2d integer arrays. The results should be + # identical to the results when the inputs are floating point. + y = np.array([[2, 2, 4, 4, 8, 8, -4, 5], + [4, 4, 2, -4, 10, 22, -2, 10]]) + if droplast: + y = y[:, :-1] + result = simpson(y, axis=-1) + expected = simpson(np.array(y, dtype=np.float64), axis=-1) + assert_equal(result, expected) + + +class TestCumulative_trapezoid: + def test_1d(self): + x = np.linspace(-2, 2, num=5) + y = x + y_int = cumulative_trapezoid(y, x, initial=0) + y_expected = [0., -1.5, -2., -1.5, 0.] + assert_allclose(y_int, y_expected) + + y_int = cumulative_trapezoid(y, x, initial=None) + assert_allclose(y_int, y_expected[1:]) + + def test_y_nd_x_nd(self): + x = np.arange(3 * 2 * 4).reshape(3, 2, 4) + y = x + y_int = cumulative_trapezoid(y, x, initial=0) + y_expected = np.array([[[0., 0.5, 2., 4.5], + [0., 4.5, 10., 16.5]], + [[0., 8.5, 18., 28.5], + [0., 12.5, 26., 40.5]], + [[0., 16.5, 34., 52.5], + [0., 20.5, 42., 64.5]]]) + + assert_allclose(y_int, y_expected) + + # Try with all axes + shapes = [(2, 2, 4), (3, 1, 4), (3, 2, 3)] + for axis, shape in zip([0, 1, 2], shapes): + y_int = cumulative_trapezoid(y, x, initial=0, axis=axis) + assert_equal(y_int.shape, (3, 2, 4)) + y_int = cumulative_trapezoid(y, x, initial=None, axis=axis) + assert_equal(y_int.shape, shape) + + def test_y_nd_x_1d(self): + y = np.arange(3 * 2 * 4).reshape(3, 2, 4) + x = np.arange(4)**2 + # Try with all axes + ys_expected = ( + np.array([[[4., 5., 6., 7.], + [8., 9., 10., 11.]], + [[40., 44., 48., 52.], + [56., 60., 64., 68.]]]), + np.array([[[2., 3., 4., 5.]], + [[10., 11., 12., 13.]], + [[18., 19., 20., 21.]]]), + np.array([[[0.5, 5., 17.5], + [4.5, 21., 53.5]], + [[8.5, 37., 89.5], + [12.5, 53., 125.5]], + [[16.5, 69., 161.5], + [20.5, 85., 197.5]]])) + + for axis, y_expected in zip([0, 1, 2], ys_expected): + y_int = cumulative_trapezoid(y, x=x[:y.shape[axis]], axis=axis, + initial=None) + assert_allclose(y_int, y_expected) + + def test_x_none(self): + y = np.linspace(-2, 2, num=5) + + y_int = cumulative_trapezoid(y) + y_expected = [-1.5, -2., -1.5, 0.] + assert_allclose(y_int, y_expected) + + y_int = cumulative_trapezoid(y, initial=0) + y_expected = [0, -1.5, -2., -1.5, 0.] + assert_allclose(y_int, y_expected) + + y_int = cumulative_trapezoid(y, dx=3) + y_expected = [-4.5, -6., -4.5, 0.] + assert_allclose(y_int, y_expected) + + y_int = cumulative_trapezoid(y, dx=3, initial=0) + y_expected = [0, -4.5, -6., -4.5, 0.] + assert_allclose(y_int, y_expected) + + @pytest.mark.parametrize( + "initial", [1, 0.5] + ) + def test_initial_error(self, initial): + """If initial is not None or 0, a ValueError is raised.""" + y = np.linspace(0, 10, num=10) + with pytest.raises(ValueError, match="`initial`"): + cumulative_trapezoid(y, initial=initial) + + def test_zero_len_y(self): + with pytest.raises(ValueError, match="At least one point is required"): + cumulative_trapezoid(y=[]) + + +@array_api_compatible +class TestTrapezoid: + def test_simple(self, xp): + x = xp.arange(-10, 10, .1) + r = trapezoid(xp.exp(-.5 * x ** 2) / xp.sqrt(2 * xp.asarray(xp.pi)), dx=0.1) + # check integral of normal equals 1 + xp_assert_close(r, xp.asarray(1.0)) + + @skip_xp_backends('jax.numpy', + reasons=["JAX arrays do not support item assignment"]) + @pytest.mark.usefixtures("skip_xp_backends") + def test_ndim(self, xp): + x = xp.linspace(0, 1, 3) + y = xp.linspace(0, 2, 8) + z = xp.linspace(0, 3, 13) + + wx = xp.ones_like(x) * (x[1] - x[0]) + wx[0] /= 2 + wx[-1] /= 2 + wy = xp.ones_like(y) * (y[1] - y[0]) + wy[0] /= 2 + wy[-1] /= 2 + wz = xp.ones_like(z) * (z[1] - z[0]) + wz[0] /= 2 + wz[-1] /= 2 + + q = x[:, None, None] + y[None,:, None] + z[None, None,:] + + qx = xp.sum(q * wx[:, None, None], axis=0) + qy = xp.sum(q * wy[None, :, None], axis=1) + qz = xp.sum(q * wz[None, None, :], axis=2) + + # n-d `x` + r = trapezoid(q, x=x[:, None, None], axis=0) + xp_assert_close(r, qx) + r = trapezoid(q, x=y[None,:, None], axis=1) + xp_assert_close(r, qy) + r = trapezoid(q, x=z[None, None,:], axis=2) + xp_assert_close(r, qz) + + # 1-d `x` + r = trapezoid(q, x=x, axis=0) + xp_assert_close(r, qx) + r = trapezoid(q, x=y, axis=1) + xp_assert_close(r, qy) + r = trapezoid(q, x=z, axis=2) + xp_assert_close(r, qz) + + @skip_xp_backends('jax.numpy', + reasons=["JAX arrays do not support item assignment"]) + @pytest.mark.usefixtures("skip_xp_backends") + def test_gh21908(self, xp): + # extended testing for n-dim arrays + x = xp.reshape(xp.linspace(0, 29, 30), (3, 10)) + y = xp.reshape(xp.linspace(0, 29, 30), (3, 10)) + + out0 = xp.linspace(200, 380, 10) + xp_assert_close(trapezoid(y, x=x, axis=0), out0) + xp_assert_close(trapezoid(y, x=xp.asarray([0, 10., 20.]), axis=0), out0) + # x needs to be broadcastable against y + xp_assert_close( + trapezoid(y, x=xp.asarray([0, 10., 20.])[:, None], axis=0), + out0 + ) + with pytest.raises(Exception): + # x is not broadcastable against y + trapezoid(y, x=xp.asarray([0, 10., 20.])[None, :], axis=0) + + out1 = xp.asarray([ 40.5, 130.5, 220.5]) + xp_assert_close(trapezoid(y, x=x, axis=1), out1) + xp_assert_close( + trapezoid(y, x=xp.linspace(0, 9, 10), axis=1), + out1 + ) + + @skip_xp_invalid_arg + def test_masked(self, xp): + # Testing that masked arrays behave as if the function is 0 where + # masked + x = np.arange(5) + y = x * x + mask = x == 2 + ym = np.ma.array(y, mask=mask) + r = 13.0 # sum(0.5 * (0 + 1) * 1.0 + 0.5 * (9 + 16)) + assert_allclose(trapezoid(ym, x), r) + + xm = np.ma.array(x, mask=mask) + assert_allclose(trapezoid(ym, xm), r) + + xm = np.ma.array(x, mask=mask) + assert_allclose(trapezoid(y, xm), r) + + @skip_xp_backends(np_only=True, + reasons=['array-likes only supported for NumPy backend']) + @pytest.mark.usefixtures("skip_xp_backends") + def test_array_like(self, xp): + x = list(range(5)) + y = [t * t for t in x] + xarr = xp.asarray(x, dtype=xp.float64) + yarr = xp.asarray(y, dtype=xp.float64) + res = trapezoid(y, x) + resarr = trapezoid(yarr, xarr) + xp_assert_close(res, resarr) + + +class TestQMCQuad: + @pytest.mark.thread_unsafe + def test_input_validation(self): + message = "`func` must be callable." + with pytest.raises(TypeError, match=message): + qmc_quad("a duck", [0, 0], [1, 1]) + + message = "`func` must evaluate the integrand at points..." + with pytest.raises(ValueError, match=message): + qmc_quad(lambda: 1, [0, 0], [1, 1]) + + def func(x): + assert x.ndim == 1 + return np.sum(x) + message = "Exception encountered when attempting vectorized call..." + with pytest.warns(UserWarning, match=message): + qmc_quad(func, [0, 0], [1, 1]) + + message = "`n_points` must be an integer." + with pytest.raises(TypeError, match=message): + qmc_quad(lambda x: 1, [0, 0], [1, 1], n_points=1024.5) + + message = "`n_estimates` must be an integer." + with pytest.raises(TypeError, match=message): + qmc_quad(lambda x: 1, [0, 0], [1, 1], n_estimates=8.5) + + message = "`qrng` must be an instance of scipy.stats.qmc.QMCEngine." + with pytest.raises(TypeError, match=message): + qmc_quad(lambda x: 1, [0, 0], [1, 1], qrng="a duck") + + message = "`qrng` must be initialized with dimensionality equal to " + with pytest.raises(ValueError, match=message): + qmc_quad(lambda x: 1, [0, 0], [1, 1], qrng=stats.qmc.Sobol(1)) + + message = r"`log` must be boolean \(`True` or `False`\)." + with pytest.raises(TypeError, match=message): + qmc_quad(lambda x: 1, [0, 0], [1, 1], log=10) + + def basic_test(self, n_points=2**8, n_estimates=8, signs=None): + if signs is None: + signs = np.ones(2) + ndim = 2 + mean = np.zeros(ndim) + cov = np.eye(ndim) + + def func(x): + return stats.multivariate_normal.pdf(x.T, mean, cov) + + rng = np.random.default_rng(2879434385674690281) + qrng = stats.qmc.Sobol(ndim, seed=rng) + a = np.zeros(ndim) + b = np.ones(ndim) * signs + res = qmc_quad(func, a, b, n_points=n_points, + n_estimates=n_estimates, qrng=qrng) + ref = stats.multivariate_normal.cdf(b, mean, cov, lower_limit=a) + atol = special.stdtrit(n_estimates-1, 0.995) * res.standard_error # 99% CI + assert_allclose(res.integral, ref, atol=atol) + assert np.prod(signs)*res.integral > 0 + + rng = np.random.default_rng(2879434385674690281) + qrng = stats.qmc.Sobol(ndim, seed=rng) + logres = qmc_quad(lambda *args: np.log(func(*args)), a, b, + n_points=n_points, n_estimates=n_estimates, + log=True, qrng=qrng) + assert_allclose(np.exp(logres.integral), res.integral, rtol=1e-14) + assert np.imag(logres.integral) == (np.pi if np.prod(signs) < 0 else 0) + assert_allclose(np.exp(logres.standard_error), + res.standard_error, rtol=1e-14, atol=1e-16) + + @pytest.mark.parametrize("n_points", [2**8, 2**12]) + @pytest.mark.parametrize("n_estimates", [8, 16]) + def test_basic(self, n_points, n_estimates): + self.basic_test(n_points, n_estimates) + + @pytest.mark.parametrize("signs", [[1, 1], [-1, -1], [-1, 1], [1, -1]]) + def test_sign(self, signs): + self.basic_test(signs=signs) + + @pytest.mark.thread_unsafe + @pytest.mark.parametrize("log", [False, True]) + def test_zero(self, log): + message = "A lower limit was equal to an upper limit, so" + with pytest.warns(UserWarning, match=message): + res = qmc_quad(lambda x: 1, [0, 0], [0, 1], log=log) + assert res.integral == (-np.inf if log else 0) + assert res.standard_error == 0 + + def test_flexible_input(self): + # check that qrng is not required + # also checks that for 1d problems, a and b can be scalars + def func(x): + return stats.norm.pdf(x, scale=2) + + res = qmc_quad(func, 0, 1) + ref = stats.norm.cdf(1, scale=2) - stats.norm.cdf(0, scale=2) + assert_allclose(res.integral, ref, 1e-2) + + +def cumulative_simpson_nd_reference(y, *, x=None, dx=None, initial=None, axis=-1): + # Use cumulative_trapezoid if length of y < 3 + if y.shape[axis] < 3: + if initial is None: + return cumulative_trapezoid(y, x=x, dx=dx, axis=axis, initial=None) + else: + return initial + cumulative_trapezoid(y, x=x, dx=dx, axis=axis, initial=0) + + # Ensure that working axis is last axis + y = np.moveaxis(y, axis, -1) + x = np.moveaxis(x, axis, -1) if np.ndim(x) > 1 else x + dx = np.moveaxis(dx, axis, -1) if np.ndim(dx) > 1 else dx + initial = np.moveaxis(initial, axis, -1) if np.ndim(initial) > 1 else initial + + # If `x` is not present, create it from `dx` + n = y.shape[-1] + x = dx * np.arange(n) if dx is not None else x + # Similarly, if `initial` is not present, set it to 0 + initial_was_none = initial is None + initial = 0 if initial_was_none else initial + + # `np.apply_along_axis` accepts only one array, so concatenate arguments + x = np.broadcast_to(x, y.shape) + initial = np.broadcast_to(initial, y.shape[:-1] + (1,)) + z = np.concatenate((y, x, initial), axis=-1) + + # Use `np.apply_along_axis` to compute result + def f(z): + return cumulative_simpson(z[:n], x=z[n:2*n], initial=z[2*n:]) + res = np.apply_along_axis(f, -1, z) + + # Remove `initial` and undo axis move as needed + res = res[..., 1:] if initial_was_none else res + res = np.moveaxis(res, -1, axis) + return res + + +class TestCumulativeSimpson: + x0 = np.arange(4) + y0 = x0**2 + + @pytest.mark.parametrize('use_dx', (False, True)) + @pytest.mark.parametrize('use_initial', (False, True)) + def test_1d(self, use_dx, use_initial): + # Test for exact agreement with polynomial of highest + # possible order (3 if `dx` is constant, 2 otherwise). + rng = np.random.default_rng(82456839535679456794) + n = 10 + + # Generate random polynomials and ground truth + # integral of appropriate order + order = 3 if use_dx else 2 + dx = rng.random() + x = (np.sort(rng.random(n)) if order == 2 + else np.arange(n)*dx + rng.random()) + i = np.arange(order + 1)[:, np.newaxis] + c = rng.random(order + 1)[:, np.newaxis] + y = np.sum(c*x**i, axis=0) + Y = np.sum(c*x**(i + 1)/(i + 1), axis=0) + ref = Y if use_initial else (Y-Y[0])[1:] + + # Integrate with `cumulative_simpson` + initial = Y[0] if use_initial else None + kwarg = {'dx': dx} if use_dx else {'x': x} + res = cumulative_simpson(y, **kwarg, initial=initial) + + # Compare result against reference + if not use_dx: + assert_allclose(res, ref, rtol=2e-15) + else: + i0 = 0 if use_initial else 1 + # all terms are "close" + assert_allclose(res, ref, rtol=0.0025) + # only even-interval terms are "exact" + assert_allclose(res[i0::2], ref[i0::2], rtol=2e-15) + + @pytest.mark.parametrize('axis', np.arange(-3, 3)) + @pytest.mark.parametrize('x_ndim', (1, 3)) + @pytest.mark.parametrize('x_len', (1, 2, 7)) + @pytest.mark.parametrize('i_ndim', (None, 0, 3,)) + @pytest.mark.parametrize('dx', (None, True)) + def test_nd(self, axis, x_ndim, x_len, i_ndim, dx): + # Test behavior of `cumulative_simpson` with N-D `y` + rng = np.random.default_rng(82456839535679456794) + + # determine shapes + shape = [5, 6, x_len] + shape[axis], shape[-1] = shape[-1], shape[axis] + shape_len_1 = shape.copy() + shape_len_1[axis] = 1 + i_shape = shape_len_1 if i_ndim == 3 else () + + # initialize arguments + y = rng.random(size=shape) + x, dx = None, None + if dx: + dx = rng.random(size=shape_len_1) if x_ndim > 1 else rng.random() + else: + x = (np.sort(rng.random(size=shape), axis=axis) if x_ndim > 1 + else np.sort(rng.random(size=shape[axis]))) + initial = None if i_ndim is None else rng.random(size=i_shape) + + # compare results + res = cumulative_simpson(y, x=x, dx=dx, initial=initial, axis=axis) + ref = cumulative_simpson_nd_reference(y, x=x, dx=dx, initial=initial, axis=axis) + np.testing.assert_allclose(res, ref, rtol=1e-15) + + @pytest.mark.parametrize(('message', 'kwarg_update'), [ + ("x must be strictly increasing", dict(x=[2, 2, 3, 4])), + ("x must be strictly increasing", dict(x=[x0, [2, 2, 4, 8]], y=[y0, y0])), + ("x must be strictly increasing", dict(x=[x0, x0, x0], y=[y0, y0, y0], axis=0)), + ("At least one point is required", dict(x=[], y=[])), + ("`axis=4` is not valid for `y` with `y.ndim=1`", dict(axis=4)), + ("shape of `x` must be the same as `y` or 1-D", dict(x=np.arange(5))), + ("`initial` must either be a scalar or...", dict(initial=np.arange(5))), + ("`dx` must either be a scalar or...", dict(x=None, dx=np.arange(5))), + ]) + def test_simpson_exceptions(self, message, kwarg_update): + kwargs0 = dict(y=self.y0, x=self.x0, dx=None, initial=None, axis=-1) + with pytest.raises(ValueError, match=message): + cumulative_simpson(**dict(kwargs0, **kwarg_update)) + + def test_special_cases(self): + # Test special cases not checked elsewhere + rng = np.random.default_rng(82456839535679456794) + y = rng.random(size=10) + res = cumulative_simpson(y, dx=0) + assert_equal(res, 0) + + # Should add tests of: + # - all elements of `x` identical + # These should work as they do for `simpson` + + def _get_theoretical_diff_between_simps_and_cum_simps(self, y, x): + """`cumulative_simpson` and `simpson` can be tested against other to verify + they give consistent results. `simpson` will iteratively be called with + successively higher upper limits of integration. This function calculates + the theoretical correction required to `simpson` at even intervals to match + with `cumulative_simpson`. + """ + d = np.diff(x, axis=-1) + sub_integrals_h1 = _cumulative_simpson_unequal_intervals(y, d) + sub_integrals_h2 = _cumulative_simpson_unequal_intervals( + y[..., ::-1], d[..., ::-1] + )[..., ::-1] + + # Concatenate to build difference array + zeros_shape = (*y.shape[:-1], 1) + theoretical_difference = np.concatenate( + [ + np.zeros(zeros_shape), + (sub_integrals_h1[..., 1:] - sub_integrals_h2[..., :-1]), + np.zeros(zeros_shape), + ], + axis=-1, + ) + # Differences only expected at even intervals. Odd intervals will + # match exactly so there is no correction + theoretical_difference[..., 1::2] = 0.0 + # Note: the first interval will not match from this correction as + # `simpson` uses the trapezoidal rule + return theoretical_difference + + @pytest.mark.thread_unsafe + @pytest.mark.slow + @given( + y=hyp_num.arrays( + np.float64, + hyp_num.array_shapes(max_dims=4, min_side=3, max_side=10), + elements=st.floats(-10, 10, allow_nan=False).filter(lambda x: abs(x) > 1e-7) + ) + ) + def test_cumulative_simpson_against_simpson_with_default_dx( + self, y + ): + """Theoretically, the output of `cumulative_simpson` will be identical + to `simpson` at all even indices and in the last index. The first index + will not match as `simpson` uses the trapezoidal rule when there are only two + data points. Odd indices after the first index are shown to match with + a mathematically-derived correction.""" + def simpson_reference(y): + return np.stack( + [simpson(y[..., :i], dx=1.0) for i in range(2, y.shape[-1]+1)], axis=-1, + ) + + res = cumulative_simpson(y, dx=1.0) + ref = simpson_reference(y) + theoretical_difference = self._get_theoretical_diff_between_simps_and_cum_simps( + y, x=np.arange(y.shape[-1]) + ) + np.testing.assert_allclose( + res[..., 1:], ref[..., 1:] + theoretical_difference[..., 1:], atol=1e-16 + ) + + @pytest.mark.thread_unsafe + @pytest.mark.slow + @given( + y=hyp_num.arrays( + np.float64, + hyp_num.array_shapes(max_dims=4, min_side=3, max_side=10), + elements=st.floats(-10, 10, allow_nan=False).filter(lambda x: abs(x) > 1e-7) + ) + ) + def test_cumulative_simpson_against_simpson( + self, y + ): + """Theoretically, the output of `cumulative_simpson` will be identical + to `simpson` at all even indices and in the last index. The first index + will not match as `simpson` uses the trapezoidal rule when there are only two + data points. Odd indices after the first index are shown to match with + a mathematically-derived correction.""" + interval = 10/(y.shape[-1] - 1) + x = np.linspace(0, 10, num=y.shape[-1]) + x[1:] = x[1:] + 0.2*interval*np.random.uniform(-1, 1, len(x) - 1) + + def simpson_reference(y, x): + return np.stack( + [simpson(y[..., :i], x=x[..., :i]) for i in range(2, y.shape[-1]+1)], + axis=-1, + ) + + res = cumulative_simpson(y, x=x) + ref = simpson_reference(y, x) + theoretical_difference = self._get_theoretical_diff_between_simps_and_cum_simps( + y, x + ) + np.testing.assert_allclose( + res[..., 1:], ref[..., 1:] + theoretical_difference[..., 1:] + ) + +class TestLebedev: + def test_input_validation(self): + # only certain rules are available + message = "Order n=-1 not available..." + with pytest.raises(NotImplementedError, match=message): + integrate.lebedev_rule(-1) + + def test_quadrature(self): + # Test points/weights to integrate an example function + + def f(x): + return np.exp(x[0]) + + x, w = integrate.lebedev_rule(15) + res = w @ f(x) + ref = 14.7680137457653 # lebedev_rule reference [3] + assert_allclose(res, ref, rtol=1e-14) + assert_allclose(np.sum(w), 4 * np.pi) + + @pytest.mark.parametrize('order', list(range(3, 32, 2)) + list(range(35, 132, 6))) + def test_properties(self, order): + x, w = integrate.lebedev_rule(order) + # dispersion should be maximal; no clear spherical mean + with np.errstate(divide='ignore', invalid='ignore'): + res = stats.directional_stats(x.T, axis=0) + assert_allclose(res.mean_resultant_length, 0, atol=1e-15) + # weights should sum to 4*pi (surface area of unit sphere) + assert_allclose(np.sum(w), 4*np.pi) diff --git a/shared/package-files/07/07817149811f67fd63ff3f46ba540d67504dacfad4be5537c9bc704e4ac8c632/blob b/shared/package-files/07/07817149811f67fd63ff3f46ba540d67504dacfad4be5537c9bc704e4ac8c632/blob new file mode 100644 index 0000000000000000000000000000000000000000..009365e047614f892aa783876f79eeb46bb00551 --- /dev/null +++ b/shared/package-files/07/07817149811f67fd63ff3f46ba540d67504dacfad4be5537c9bc704e4ac8c632/blob @@ -0,0 +1,1568 @@ +#!/usr/bin/env python3 +""" + +Rules for building C/API module with f2py2e. + +Here is a skeleton of a new wrapper function (13Dec2001): + +wrapper_function(args) + declarations + get_python_arguments, say, `a' and `b' + + get_a_from_python + if (successful) { + + get_b_from_python + if (successful) { + + callfortran + if (successful) { + + put_a_to_python + if (successful) { + + put_b_to_python + if (successful) { + + buildvalue = ... + + } + + } + + } + + } + cleanup_b + + } + cleanup_a + + return buildvalue + +Copyright 1999 -- 2011 Pearu Peterson all rights reserved. +Copyright 2011 -- present NumPy Developers. +Permission to use, modify, and distribute this software is given under the +terms of the NumPy License. + +NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. +""" +import os, sys +import time +import copy +from pathlib import Path + +# __version__.version is now the same as the NumPy version +from . import __version__ + +from .auxfuncs import ( + applyrules, debugcapi, dictappend, errmess, gentitle, getargs2, + hascallstatement, hasexternals, hasinitvalue, hasnote, + hasresultnote, isarray, isarrayofstrings, ischaracter, + ischaracterarray, ischaracter_or_characterarray, iscomplex, + iscomplexarray, iscomplexfunction, iscomplexfunction_warn, + isdummyroutine, isexternal, isfunction, isfunction_wrap, isint1, + isint1array, isintent_aux, isintent_c, isintent_callback, + isintent_copy, isintent_hide, isintent_inout, isintent_nothide, + isintent_out, isintent_overwrite, islogical, islong_complex, + islong_double, islong_doublefunction, islong_long, + islong_longfunction, ismoduleroutine, isoptional, isrequired, + isscalar, issigned_long_longarray, isstring, isstringarray, + isstringfunction, issubroutine, isattr_value, + issubroutine_wrap, isthreadsafe, isunsigned, isunsigned_char, + isunsigned_chararray, isunsigned_long_long, + isunsigned_long_longarray, isunsigned_short, isunsigned_shortarray, + l_and, l_not, l_or, outmess, replace, stripcomma, requiresf90wrapper +) + +from . import capi_maps +from . import cfuncs +from . import common_rules +from . import use_rules +from . import f90mod_rules +from . import func2subr + +f2py_version = __version__.version +numpy_version = __version__.version + +options = {} +sepdict = {} +# for k in ['need_cfuncs']: sepdict[k]=',' +for k in ['decl', + 'frompyobj', + 'cleanupfrompyobj', + 'topyarr', 'method', + 'pyobjfrom', 'closepyobjfrom', + 'freemem', + 'userincludes', + 'includes0', 'includes', 'typedefs', 'typedefs_generated', + 'cppmacros', 'cfuncs', 'callbacks', + 'latexdoc', + 'restdoc', + 'routine_defs', 'externroutines', + 'initf2pywraphooks', + 'commonhooks', 'initcommonhooks', + 'f90modhooks', 'initf90modhooks']: + sepdict[k] = '\n' + +#################### Rules for C/API module ################# + +generationtime = int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) +module_rules = { + 'modulebody': """\ +/* File: #modulename#module.c + * This file is auto-generated with f2py (version:#f2py_version#). + * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, + * written by Pearu Peterson . + * Generation date: """ + time.asctime(time.gmtime(generationtime)) + """ + * Do not edit this file directly unless you know what you are doing!!! + */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ + +/* Unconditionally included */ +#include +#include + +""" + gentitle("See f2py2e/cfuncs.py: includes") + """ +#includes# +#includes0# + +""" + gentitle("See f2py2e/rules.py: mod_rules['modulebody']") + """ +static PyObject *#modulename#_error; +static PyObject *#modulename#_module; + +""" + gentitle("See f2py2e/cfuncs.py: typedefs") + """ +#typedefs# + +""" + gentitle("See f2py2e/cfuncs.py: typedefs_generated") + """ +#typedefs_generated# + +""" + gentitle("See f2py2e/cfuncs.py: cppmacros") + """ +#cppmacros# + +""" + gentitle("See f2py2e/cfuncs.py: cfuncs") + """ +#cfuncs# + +""" + gentitle("See f2py2e/cfuncs.py: userincludes") + """ +#userincludes# + +""" + gentitle("See f2py2e/capi_rules.py: usercode") + """ +#usercode# + +/* See f2py2e/rules.py */ +#externroutines# + +""" + gentitle("See f2py2e/capi_rules.py: usercode1") + """ +#usercode1# + +""" + gentitle("See f2py2e/cb_rules.py: buildcallback") + """ +#callbacks# + +""" + gentitle("See f2py2e/rules.py: buildapi") + """ +#body# + +""" + gentitle("See f2py2e/f90mod_rules.py: buildhooks") + """ +#f90modhooks# + +""" + gentitle("See f2py2e/rules.py: module_rules['modulebody']") + """ + +""" + gentitle("See f2py2e/common_rules.py: buildhooks") + """ +#commonhooks# + +""" + gentitle("See f2py2e/rules.py") + """ + +static FortranDataDef f2py_routine_defs[] = { +#routine_defs# + {NULL} +}; + +static PyMethodDef f2py_module_methods[] = { +#pymethoddef# + {NULL,NULL} +}; + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "#modulename#", + NULL, + -1, + f2py_module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC PyInit_#modulename#(void) { + int i; + PyObject *m,*d, *s, *tmp; + m = #modulename#_module = PyModule_Create(&moduledef); + Py_SET_TYPE(&PyFortran_Type, &PyType_Type); + import_array(); + if (PyErr_Occurred()) + {PyErr_SetString(PyExc_ImportError, \"can't initialize module #modulename# (failed to import numpy)\"); return m;} + d = PyModule_GetDict(m); + s = PyUnicode_FromString(\"#f2py_version#\"); + PyDict_SetItemString(d, \"__version__\", s); + Py_DECREF(s); + s = PyUnicode_FromString( + \"This module '#modulename#' is auto-generated with f2py (version:#f2py_version#).\\nFunctions:\\n\"\n#docs#\".\"); + PyDict_SetItemString(d, \"__doc__\", s); + Py_DECREF(s); + s = PyUnicode_FromString(\"""" + numpy_version + """\"); + PyDict_SetItemString(d, \"__f2py_numpy_version__\", s); + Py_DECREF(s); + #modulename#_error = PyErr_NewException (\"#modulename#.error\", NULL, NULL); + /* + * Store the error object inside the dict, so that it could get deallocated. + * (in practice, this is a module, so it likely will not and cannot.) + */ + PyDict_SetItemString(d, \"_#modulename#_error\", #modulename#_error); + Py_DECREF(#modulename#_error); + for(i=0;f2py_routine_defs[i].name!=NULL;i++) { + tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); + PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); + Py_DECREF(tmp); + } +#initf2pywraphooks# +#initf90modhooks# +#initcommonhooks# +#interface_usercode# + +#ifdef F2PY_REPORT_ATEXIT + if (! PyErr_Occurred()) + on_exit(f2py_report_on_exit,(void*)\"#modulename#\"); +#endif + return m; +} +#ifdef __cplusplus +} +#endif +""", + 'separatorsfor': {'latexdoc': '\n\n', + 'restdoc': '\n\n'}, + 'latexdoc': ['\\section{Module \\texttt{#texmodulename#}}\n', + '#modnote#\n', + '#latexdoc#'], + 'restdoc': ['Module #modulename#\n' + '=' * 80, + '\n#restdoc#'] +} + +defmod_rules = [ + {'body': '/*eof body*/', + 'method': '/*eof method*/', + 'externroutines': '/*eof externroutines*/', + 'routine_defs': '/*eof routine_defs*/', + 'initf90modhooks': '/*eof initf90modhooks*/', + 'initf2pywraphooks': '/*eof initf2pywraphooks*/', + 'initcommonhooks': '/*eof initcommonhooks*/', + 'latexdoc': '', + 'restdoc': '', + 'modnote': {hasnote: '#note#', l_not(hasnote): ''}, + } +] + +routine_rules = { + 'separatorsfor': sepdict, + 'body': """ +#begintitle# +static char doc_#apiname#[] = \"\\\n#docreturn##name#(#docsignatureshort#)\\n\\nWrapper for ``#name#``.\\\n\\n#docstrsigns#\"; +/* #declfortranroutine# */ +static PyObject *#apiname#(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + #functype# (*f2py_func)(#callprotoargument#)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +#decl# + static char *capi_kwlist[] = {#kwlist##kwlistopt##kwlistxa#NULL}; +#usercode# +#routdebugenter# +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\\ + \"#argformat#|#keyformat##xaformat#:#pyname#\",\\ + capi_kwlist#args_capi##keys_capi##keys_xa#))\n return NULL; +#frompyobj# +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +#callfortranroutine# +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +#pyobjfrom# +/*end of pyobjfrom*/ + CFUNCSMESS(\"Building return value.\\n\"); + capi_buildvalue = Py_BuildValue(\"#returnformat#\"#return#); +/*closepyobjfrom*/ +#closepyobjfrom# + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ +#cleanupfrompyobj# + if (capi_buildvalue == NULL) { +#routdebugfailure# + } else { +#routdebugleave# + } + CFUNCSMESS(\"Freeing memory.\\n\"); +#freemem# +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +#endtitle# +""", + 'routine_defs': '#routine_def#', + 'initf2pywraphooks': '#initf2pywraphook#', + 'externroutines': '#declfortranroutine#', + 'doc': '#docreturn##name#(#docsignature#)', + 'docshort': '#docreturn##name#(#docsignatureshort#)', + 'docs': '" #docreturn##name#(#docsignature#)\\n"\n', + 'need': ['arrayobject.h', 'CFUNCSMESS', 'MINMAX'], + 'cppmacros': {debugcapi: '#define DEBUGCFUNCS'}, + 'latexdoc': ['\\subsection{Wrapper function \\texttt{#texname#}}\n', + """ +\\noindent{{}\\verb@#docreturn##name#@{}}\\texttt{(#latexdocsignatureshort#)} +#routnote# + +#latexdocstrsigns# +"""], + 'restdoc': ['Wrapped function ``#name#``\n' + '-' * 80, + + ] +} + +################## Rules for C/API function ############## + +rout_rules = [ + { # Init + 'separatorsfor': {'callfortranroutine': '\n', 'routdebugenter': '\n', 'decl': '\n', + 'routdebugleave': '\n', 'routdebugfailure': '\n', + 'setjmpbuf': ' || ', + 'docstrreq': '\n', 'docstropt': '\n', 'docstrout': '\n', + 'docstrcbs': '\n', 'docstrsigns': '\\n"\n"', + 'latexdocstrsigns': '\n', + 'latexdocstrreq': '\n', 'latexdocstropt': '\n', + 'latexdocstrout': '\n', 'latexdocstrcbs': '\n', + }, + 'kwlist': '', 'kwlistopt': '', 'callfortran': '', 'callfortranappend': '', + 'docsign': '', 'docsignopt': '', 'decl': '/*decl*/', + 'freemem': '/*freemem*/', + 'docsignshort': '', 'docsignoptshort': '', + 'docstrsigns': '', 'latexdocstrsigns': '', + 'docstrreq': '\\nParameters\\n----------', + 'docstropt': '\\nOther Parameters\\n----------------', + 'docstrout': '\\nReturns\\n-------', + 'docstrcbs': '\\nNotes\\n-----\\nCall-back functions::\\n', + 'latexdocstrreq': '\\noindent Required arguments:', + 'latexdocstropt': '\\noindent Optional arguments:', + 'latexdocstrout': '\\noindent Return objects:', + 'latexdocstrcbs': '\\noindent Call-back functions:', + 'args_capi': '', 'keys_capi': '', 'functype': '', + 'frompyobj': '/*frompyobj*/', + # this list will be reversed + 'cleanupfrompyobj': ['/*end of cleanupfrompyobj*/'], + 'pyobjfrom': '/*pyobjfrom*/', + # this list will be reversed + 'closepyobjfrom': ['/*end of closepyobjfrom*/'], + 'topyarr': '/*topyarr*/', 'routdebugleave': '/*routdebugleave*/', + 'routdebugenter': '/*routdebugenter*/', + 'routdebugfailure': '/*routdebugfailure*/', + 'callfortranroutine': '/*callfortranroutine*/', + 'argformat': '', 'keyformat': '', 'need_cfuncs': '', + 'docreturn': '', 'return': '', 'returnformat': '', 'rformat': '', + 'kwlistxa': '', 'keys_xa': '', 'xaformat': '', 'docsignxa': '', 'docsignxashort': '', + 'initf2pywraphook': '', + 'routnote': {hasnote: '--- #note#', l_not(hasnote): ''}, + }, { + 'apiname': 'f2py_rout_#modulename#_#name#', + 'pyname': '#modulename#.#name#', + 'decl': '', + '_check': l_not(ismoduleroutine) + }, { + 'apiname': 'f2py_rout_#modulename#_#f90modulename#_#name#', + 'pyname': '#modulename#.#f90modulename#.#name#', + 'decl': '', + '_check': ismoduleroutine + }, { # Subroutine + 'functype': 'void', + 'declfortranroutine': {l_and(l_not(l_or(ismoduleroutine, isintent_c)), l_not(isdummyroutine)): 'extern void #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);', + l_and(l_not(ismoduleroutine), isintent_c, l_not(isdummyroutine)): 'extern void #fortranname#(#callprotoargument#);', + ismoduleroutine: '', + isdummyroutine: '' + }, + 'routine_def': { + l_not(l_or(ismoduleroutine, isintent_c, isdummyroutine)): + ' {\"#name#\",-1,{{-1}},0,0,(char *)' + ' #F_FUNC#(#fortranname#,#FORTRANNAME#),' + ' (f2py_init_func)#apiname#,doc_#apiname#},', + l_and(l_not(ismoduleroutine), isintent_c, l_not(isdummyroutine)): + ' {\"#name#\",-1,{{-1}},0,0,(char *)#fortranname#,' + ' (f2py_init_func)#apiname#,doc_#apiname#},', + l_and(l_not(ismoduleroutine), isdummyroutine): + ' {\"#name#\",-1,{{-1}},0,0,NULL,' + ' (f2py_init_func)#apiname#,doc_#apiname#},', + }, + 'need': {l_and(l_not(l_or(ismoduleroutine, isintent_c)), l_not(isdummyroutine)): 'F_FUNC'}, + 'callfortranroutine': [ + {debugcapi: [ + """ fprintf(stderr,\"debug-capi:Fortran subroutine `#fortranname#(#callfortran#)\'\\n\");"""]}, + {hasexternals: """\ + if (#setjmpbuf#) { + f2py_success = 0; + } else {"""}, + {isthreadsafe: ' Py_BEGIN_ALLOW_THREADS'}, + {hascallstatement: ''' #callstatement#; + /*(*f2py_func)(#callfortran#);*/'''}, + {l_not(l_or(hascallstatement, isdummyroutine)) + : ' (*f2py_func)(#callfortran#);'}, + {isthreadsafe: ' Py_END_ALLOW_THREADS'}, + {hasexternals: """ }"""} + ], + '_check': l_and(issubroutine, l_not(issubroutine_wrap)), + }, { # Wrapped function + 'functype': 'void', + 'declfortranroutine': {l_not(l_or(ismoduleroutine, isdummyroutine)): 'extern void #F_WRAPPEDFUNC#(#name_lower#,#NAME#)(#callprotoargument#);', + isdummyroutine: '', + }, + + 'routine_def': { + l_not(l_or(ismoduleroutine, isdummyroutine)): + ' {\"#name#\",-1,{{-1}},0,0,(char *)' + ' #F_WRAPPEDFUNC#(#name_lower#,#NAME#),' + ' (f2py_init_func)#apiname#,doc_#apiname#},', + isdummyroutine: + ' {\"#name#\",-1,{{-1}},0,0,NULL,' + ' (f2py_init_func)#apiname#,doc_#apiname#},', + }, + 'initf2pywraphook': {l_not(l_or(ismoduleroutine, isdummyroutine)): ''' + { + extern #ctype# #F_FUNC#(#name_lower#,#NAME#)(void); + PyObject* o = PyDict_GetItemString(d,"#name#"); + tmp = F2PyCapsule_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL); + PyObject_SetAttrString(o,"_cpointer", tmp); + Py_DECREF(tmp); + s = PyUnicode_FromString("#name#"); + PyObject_SetAttrString(o,"__name__", s); + Py_DECREF(s); + } + '''}, + 'need': {l_not(l_or(ismoduleroutine, isdummyroutine)): ['F_WRAPPEDFUNC', 'F_FUNC']}, + 'callfortranroutine': [ + {debugcapi: [ + """ fprintf(stderr,\"debug-capi:Fortran subroutine `f2pywrap#name_lower#(#callfortran#)\'\\n\");"""]}, + {hasexternals: """\ + if (#setjmpbuf#) { + f2py_success = 0; + } else {"""}, + {isthreadsafe: ' Py_BEGIN_ALLOW_THREADS'}, + {l_not(l_or(hascallstatement, isdummyroutine)) + : ' (*f2py_func)(#callfortran#);'}, + {hascallstatement: + ' #callstatement#;\n /*(*f2py_func)(#callfortran#);*/'}, + {isthreadsafe: ' Py_END_ALLOW_THREADS'}, + {hasexternals: ' }'} + ], + '_check': isfunction_wrap, + }, { # Wrapped subroutine + 'functype': 'void', + 'declfortranroutine': {l_not(l_or(ismoduleroutine, isdummyroutine)): 'extern void #F_WRAPPEDFUNC#(#name_lower#,#NAME#)(#callprotoargument#);', + isdummyroutine: '', + }, + + 'routine_def': { + l_not(l_or(ismoduleroutine, isdummyroutine)): + ' {\"#name#\",-1,{{-1}},0,0,(char *)' + ' #F_WRAPPEDFUNC#(#name_lower#,#NAME#),' + ' (f2py_init_func)#apiname#,doc_#apiname#},', + isdummyroutine: + ' {\"#name#\",-1,{{-1}},0,0,NULL,' + ' (f2py_init_func)#apiname#,doc_#apiname#},', + }, + 'initf2pywraphook': {l_not(l_or(ismoduleroutine, isdummyroutine)): ''' + { + extern void #F_FUNC#(#name_lower#,#NAME#)(void); + PyObject* o = PyDict_GetItemString(d,"#name#"); + tmp = F2PyCapsule_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL); + PyObject_SetAttrString(o,"_cpointer", tmp); + Py_DECREF(tmp); + s = PyUnicode_FromString("#name#"); + PyObject_SetAttrString(o,"__name__", s); + Py_DECREF(s); + } + '''}, + 'need': {l_not(l_or(ismoduleroutine, isdummyroutine)): ['F_WRAPPEDFUNC', 'F_FUNC']}, + 'callfortranroutine': [ + {debugcapi: [ + """ fprintf(stderr,\"debug-capi:Fortran subroutine `f2pywrap#name_lower#(#callfortran#)\'\\n\");"""]}, + {hasexternals: """\ + if (#setjmpbuf#) { + f2py_success = 0; + } else {"""}, + {isthreadsafe: ' Py_BEGIN_ALLOW_THREADS'}, + {l_not(l_or(hascallstatement, isdummyroutine)) + : ' (*f2py_func)(#callfortran#);'}, + {hascallstatement: + ' #callstatement#;\n /*(*f2py_func)(#callfortran#);*/'}, + {isthreadsafe: ' Py_END_ALLOW_THREADS'}, + {hasexternals: ' }'} + ], + '_check': issubroutine_wrap, + }, { # Function + 'functype': '#ctype#', + 'docreturn': {l_not(isintent_hide): '#rname#,'}, + 'docstrout': '#pydocsignout#', + 'latexdocstrout': ['\\item[]{{}\\verb@#pydocsignout#@{}}', + {hasresultnote: '--- #resultnote#'}], + 'callfortranroutine': [{l_and(debugcapi, isstringfunction): """\ +#ifdef USESCOMPAQFORTRAN + fprintf(stderr,\"debug-capi:Fortran function #ctype# #fortranname#(#callcompaqfortran#)\\n\"); +#else + fprintf(stderr,\"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\\n\"); +#endif +"""}, + {l_and(debugcapi, l_not(isstringfunction)): """\ + fprintf(stderr,\"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\\n\"); +"""} + ], + '_check': l_and(isfunction, l_not(isfunction_wrap)) + }, { # Scalar function + 'declfortranroutine': {l_and(l_not(l_or(ismoduleroutine, isintent_c)), l_not(isdummyroutine)): 'extern #ctype# #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);', + l_and(l_not(ismoduleroutine), isintent_c, l_not(isdummyroutine)): 'extern #ctype# #fortranname#(#callprotoargument#);', + isdummyroutine: '' + }, + 'routine_def': { + l_and(l_not(l_or(ismoduleroutine, isintent_c)), + l_not(isdummyroutine)): + (' {\"#name#\",-1,{{-1}},0,0,(char *)' + ' #F_FUNC#(#fortranname#,#FORTRANNAME#),' + ' (f2py_init_func)#apiname#,doc_#apiname#},'), + l_and(l_not(ismoduleroutine), isintent_c, l_not(isdummyroutine)): + (' {\"#name#\",-1,{{-1}},0,0,(char *)#fortranname#,' + ' (f2py_init_func)#apiname#,doc_#apiname#},'), + isdummyroutine: + ' {\"#name#\",-1,{{-1}},0,0,NULL,' + '(f2py_init_func)#apiname#,doc_#apiname#},', + }, + 'decl': [{iscomplexfunction_warn: ' #ctype# #name#_return_value={0,0};', + l_not(iscomplexfunction): ' #ctype# #name#_return_value=0;'}, + {iscomplexfunction: + ' PyObject *#name#_return_value_capi = Py_None;'} + ], + 'callfortranroutine': [ + {hasexternals: """\ + if (#setjmpbuf#) { + f2py_success = 0; + } else {"""}, + {isthreadsafe: ' Py_BEGIN_ALLOW_THREADS'}, + {hascallstatement: ''' #callstatement#; +/* #name#_return_value = (*f2py_func)(#callfortran#);*/ +'''}, + {l_not(l_or(hascallstatement, isdummyroutine)) + : ' #name#_return_value = (*f2py_func)(#callfortran#);'}, + {isthreadsafe: ' Py_END_ALLOW_THREADS'}, + {hasexternals: ' }'}, + {l_and(debugcapi, iscomplexfunction) + : ' fprintf(stderr,"#routdebugshowvalue#\\n",#name#_return_value.r,#name#_return_value.i);'}, + {l_and(debugcapi, l_not(iscomplexfunction)): ' fprintf(stderr,"#routdebugshowvalue#\\n",#name#_return_value);'}], + 'pyobjfrom': {iscomplexfunction: ' #name#_return_value_capi = pyobj_from_#ctype#1(#name#_return_value);'}, + 'need': [{l_not(isdummyroutine): 'F_FUNC'}, + {iscomplexfunction: 'pyobj_from_#ctype#1'}, + {islong_longfunction: 'long_long'}, + {islong_doublefunction: 'long_double'}], + 'returnformat': {l_not(isintent_hide): '#rformat#'}, + 'return': {iscomplexfunction: ',#name#_return_value_capi', + l_not(l_or(iscomplexfunction, isintent_hide)): ',#name#_return_value'}, + '_check': l_and(isfunction, l_not(isstringfunction), l_not(isfunction_wrap)) + }, { # String function # in use for --no-wrap + 'declfortranroutine': 'extern void #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);', + 'routine_def': {l_not(l_or(ismoduleroutine, isintent_c)): + ' {\"#name#\",-1,{{-1}},0,0,(char *)#F_FUNC#(#fortranname#,#FORTRANNAME#),(f2py_init_func)#apiname#,doc_#apiname#},', + l_and(l_not(ismoduleroutine), isintent_c): + ' {\"#name#\",-1,{{-1}},0,0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},' + }, + 'decl': [' #ctype# #name#_return_value = NULL;', + ' int #name#_return_value_len = 0;'], + 'callfortran':'#name#_return_value,#name#_return_value_len,', + 'callfortranroutine':[' #name#_return_value_len = #rlength#;', + ' if ((#name#_return_value = (string)malloc(' + + '#name#_return_value_len+1) == NULL) {', + ' PyErr_SetString(PyExc_MemoryError, \"out of memory\");', + ' f2py_success = 0;', + ' } else {', + " (#name#_return_value)[#name#_return_value_len] = '\\0';", + ' }', + ' if (f2py_success) {', + {hasexternals: """\ + if (#setjmpbuf#) { + f2py_success = 0; + } else {"""}, + {isthreadsafe: ' Py_BEGIN_ALLOW_THREADS'}, + """\ +#ifdef USESCOMPAQFORTRAN + (*f2py_func)(#callcompaqfortran#); +#else + (*f2py_func)(#callfortran#); +#endif +""", + {isthreadsafe: ' Py_END_ALLOW_THREADS'}, + {hasexternals: ' }'}, + {debugcapi: + ' fprintf(stderr,"#routdebugshowvalue#\\n",#name#_return_value_len,#name#_return_value);'}, + ' } /* if (f2py_success) after (string)malloc */', + ], + 'returnformat': '#rformat#', + 'return': ',#name#_return_value', + 'freemem': ' STRINGFREE(#name#_return_value);', + 'need': ['F_FUNC', '#ctype#', 'STRINGFREE'], + '_check':l_and(isstringfunction, l_not(isfunction_wrap)) # ???obsolete + }, + { # Debugging + 'routdebugenter': ' fprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#(#docsignature#)\\n");', + 'routdebugleave': ' fprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#: successful.\\n");', + 'routdebugfailure': ' fprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#: failure.\\n");', + '_check': debugcapi + } +] + +################ Rules for arguments ################## + +typedef_need_dict = {islong_long: 'long_long', + islong_double: 'long_double', + islong_complex: 'complex_long_double', + isunsigned_char: 'unsigned_char', + isunsigned_short: 'unsigned_short', + isunsigned: 'unsigned', + isunsigned_long_long: 'unsigned_long_long', + isunsigned_chararray: 'unsigned_char', + isunsigned_shortarray: 'unsigned_short', + isunsigned_long_longarray: 'unsigned_long_long', + issigned_long_longarray: 'long_long', + isint1: 'signed_char', + ischaracter_or_characterarray: 'character', + } + +aux_rules = [ + { + 'separatorsfor': sepdict + }, + { # Common + 'frompyobj': [' /* Processing auxiliary variable #varname# */', + {debugcapi: ' fprintf(stderr,"#vardebuginfo#\\n");'}, ], + 'cleanupfrompyobj': ' /* End of cleaning variable #varname# */', + 'need': typedef_need_dict, + }, + # Scalars (not complex) + { # Common + 'decl': ' #ctype# #varname# = 0;', + 'need': {hasinitvalue: 'math.h'}, + 'frompyobj': {hasinitvalue: ' #varname# = #init#;'}, + '_check': l_and(isscalar, l_not(iscomplex)), + }, + { + 'return': ',#varname#', + 'docstrout': '#pydocsignout#', + 'docreturn': '#outvarname#,', + 'returnformat': '#varrformat#', + '_check': l_and(isscalar, l_not(iscomplex), isintent_out), + }, + # Complex scalars + { # Common + 'decl': ' #ctype# #varname#;', + 'frompyobj': {hasinitvalue: ' #varname#.r = #init.r#, #varname#.i = #init.i#;'}, + '_check': iscomplex + }, + # String + { # Common + 'decl': [' #ctype# #varname# = NULL;', + ' int slen(#varname#);', + ], + 'need':['len..'], + '_check':isstring + }, + # Array + { # Common + 'decl': [' #ctype# *#varname# = NULL;', + ' npy_intp #varname#_Dims[#rank#] = {#rank*[-1]#};', + ' const int #varname#_Rank = #rank#;', + ], + 'need':['len..', {hasinitvalue: 'forcomb'}, {hasinitvalue: 'CFUNCSMESS'}], + '_check': isarray + }, + # Scalararray + { # Common + '_check': l_and(isarray, l_not(iscomplexarray)) + }, { # Not hidden + '_check': l_and(isarray, l_not(iscomplexarray), isintent_nothide) + }, + # Integer*1 array + {'need': '#ctype#', + '_check': isint1array, + '_depend': '' + }, + # Integer*-1 array + {'need': '#ctype#', + '_check': l_or(isunsigned_chararray, isunsigned_char), + '_depend': '' + }, + # Integer*-2 array + {'need': '#ctype#', + '_check': isunsigned_shortarray, + '_depend': '' + }, + # Integer*-8 array + {'need': '#ctype#', + '_check': isunsigned_long_longarray, + '_depend': '' + }, + # Complexarray + {'need': '#ctype#', + '_check': iscomplexarray, + '_depend': '' + }, + # Stringarray + { + 'callfortranappend': {isarrayofstrings: 'flen(#varname#),'}, + 'need': 'string', + '_check': isstringarray + } +] + +arg_rules = [ + { + 'separatorsfor': sepdict + }, + { # Common + 'frompyobj': [' /* Processing variable #varname# */', + {debugcapi: ' fprintf(stderr,"#vardebuginfo#\\n");'}, ], + 'cleanupfrompyobj': ' /* End of cleaning variable #varname# */', + '_depend': '', + 'need': typedef_need_dict, + }, + # Doc signatures + { + 'docstropt': {l_and(isoptional, isintent_nothide): '#pydocsign#'}, + 'docstrreq': {l_and(isrequired, isintent_nothide): '#pydocsign#'}, + 'docstrout': {isintent_out: '#pydocsignout#'}, + 'latexdocstropt': {l_and(isoptional, isintent_nothide): ['\\item[]{{}\\verb@#pydocsign#@{}}', + {hasnote: '--- #note#'}]}, + 'latexdocstrreq': {l_and(isrequired, isintent_nothide): ['\\item[]{{}\\verb@#pydocsign#@{}}', + {hasnote: '--- #note#'}]}, + 'latexdocstrout': {isintent_out: ['\\item[]{{}\\verb@#pydocsignout#@{}}', + {l_and(hasnote, isintent_hide): '--- #note#', + l_and(hasnote, isintent_nothide): '--- See above.'}]}, + 'depend': '' + }, + # Required/Optional arguments + { + 'kwlist': '"#varname#",', + 'docsign': '#varname#,', + '_check': l_and(isintent_nothide, l_not(isoptional)) + }, + { + 'kwlistopt': '"#varname#",', + 'docsignopt': '#varname#=#showinit#,', + 'docsignoptshort': '#varname#,', + '_check': l_and(isintent_nothide, isoptional) + }, + # Docstring/BuildValue + { + 'docreturn': '#outvarname#,', + 'returnformat': '#varrformat#', + '_check': isintent_out + }, + # Externals (call-back functions) + { # Common + 'docsignxa': {isintent_nothide: '#varname#_extra_args=(),'}, + 'docsignxashort': {isintent_nothide: '#varname#_extra_args,'}, + 'docstropt': {isintent_nothide: '#varname#_extra_args : input tuple, optional\\n Default: ()'}, + 'docstrcbs': '#cbdocstr#', + 'latexdocstrcbs': '\\item[] #cblatexdocstr#', + 'latexdocstropt': {isintent_nothide: '\\item[]{{}\\verb@#varname#_extra_args := () input tuple@{}} --- Extra arguments for call-back function {{}\\verb@#varname#@{}}.'}, + 'decl': [' #cbname#_t #varname#_cb = { Py_None, NULL, 0 };', + ' #cbname#_t *#varname#_cb_ptr = &#varname#_cb;', + ' PyTupleObject *#varname#_xa_capi = NULL;', + {l_not(isintent_callback): + ' #cbname#_typedef #varname#_cptr;'} + ], + 'kwlistxa': {isintent_nothide: '"#varname#_extra_args",'}, + 'argformat': {isrequired: 'O'}, + 'keyformat': {isoptional: 'O'}, + 'xaformat': {isintent_nothide: 'O!'}, + 'args_capi': {isrequired: ',&#varname#_cb.capi'}, + 'keys_capi': {isoptional: ',&#varname#_cb.capi'}, + 'keys_xa': ',&PyTuple_Type,&#varname#_xa_capi', + 'setjmpbuf': '(setjmp(#varname#_cb.jmpbuf))', + 'callfortran': {l_not(isintent_callback): '#varname#_cptr,'}, + 'need': ['#cbname#', 'setjmp.h'], + '_check':isexternal + }, + { + 'frompyobj': [{l_not(isintent_callback): """\ +if(F2PyCapsule_Check(#varname#_cb.capi)) { + #varname#_cptr = F2PyCapsule_AsVoidPtr(#varname#_cb.capi); +} else { + #varname#_cptr = #cbname#; +} +"""}, {isintent_callback: """\ +if (#varname#_cb.capi==Py_None) { + #varname#_cb.capi = PyObject_GetAttrString(#modulename#_module,\"#varname#\"); + if (#varname#_cb.capi) { + if (#varname#_xa_capi==NULL) { + if (PyObject_HasAttrString(#modulename#_module,\"#varname#_extra_args\")) { + PyObject* capi_tmp = PyObject_GetAttrString(#modulename#_module,\"#varname#_extra_args\"); + if (capi_tmp) { + #varname#_xa_capi = (PyTupleObject *)PySequence_Tuple(capi_tmp); + Py_DECREF(capi_tmp); + } + else { + #varname#_xa_capi = (PyTupleObject *)Py_BuildValue(\"()\"); + } + if (#varname#_xa_capi==NULL) { + PyErr_SetString(#modulename#_error,\"Failed to convert #modulename#.#varname#_extra_args to tuple.\\n\"); + return NULL; + } + } + } + } + if (#varname#_cb.capi==NULL) { + PyErr_SetString(#modulename#_error,\"Callback #varname# not defined (as an argument or module #modulename# attribute).\\n\"); + return NULL; + } +} +"""}, + """\ + if (create_cb_arglist(#varname#_cb.capi,#varname#_xa_capi,#maxnofargs#,#nofoptargs#,&#varname#_cb.nofargs,&#varname#_cb.args_capi,\"failed in processing argument list for call-back #varname#.\")) { +""", + {debugcapi: ["""\ + fprintf(stderr,\"debug-capi:Assuming %d arguments; at most #maxnofargs#(-#nofoptargs#) is expected.\\n\",#varname#_cb.nofargs); + CFUNCSMESSPY(\"for #varname#=\",#varname#_cb.capi);""", + {l_not(isintent_callback): """ fprintf(stderr,\"#vardebugshowvalue# (call-back in C).\\n\",#cbname#);"""}]}, + """\ + CFUNCSMESS(\"Saving callback variables for `#varname#`.\\n\"); + #varname#_cb_ptr = swap_active_#cbname#(#varname#_cb_ptr);""", + ], + 'cleanupfrompyobj': + """\ + CFUNCSMESS(\"Restoring callback variables for `#varname#`.\\n\"); + #varname#_cb_ptr = swap_active_#cbname#(#varname#_cb_ptr); + Py_DECREF(#varname#_cb.args_capi); + }""", + 'need': ['SWAP', 'create_cb_arglist'], + '_check':isexternal, + '_depend':'' + }, + # Scalars (not complex) + { # Common + 'decl': ' #ctype# #varname# = 0;', + 'pyobjfrom': {debugcapi: ' fprintf(stderr,"#vardebugshowvalue#\\n",#varname#);'}, + 'callfortran': {l_or(isintent_c, isattr_value): '#varname#,', l_not(l_or(isintent_c, isattr_value)): '&#varname#,'}, + 'return': {isintent_out: ',#varname#'}, + '_check': l_and(isscalar, l_not(iscomplex)) + }, { + 'need': {hasinitvalue: 'math.h'}, + '_check': l_and(isscalar, l_not(iscomplex)), + }, { # Not hidden + 'decl': ' PyObject *#varname#_capi = Py_None;', + 'argformat': {isrequired: 'O'}, + 'keyformat': {isoptional: 'O'}, + 'args_capi': {isrequired: ',&#varname#_capi'}, + 'keys_capi': {isoptional: ',&#varname#_capi'}, + 'pyobjfrom': {isintent_inout: """\ + f2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#); + if (f2py_success) {"""}, + 'closepyobjfrom': {isintent_inout: " } /*if (f2py_success) of #varname# pyobjfrom*/"}, + 'need': {isintent_inout: 'try_pyarr_from_#ctype#'}, + '_check': l_and(isscalar, l_not(iscomplex), l_not(isstring), + isintent_nothide) + }, { + 'frompyobj': [ + # hasinitvalue... + # if pyobj is None: + # varname = init + # else + # from_pyobj(varname) + # + # isoptional and noinitvalue... + # if pyobj is not None: + # from_pyobj(varname) + # else: + # varname is uninitialized + # + # ... + # from_pyobj(varname) + # + {hasinitvalue: ' if (#varname#_capi == Py_None) #varname# = #init#; else', + '_depend': ''}, + {l_and(isoptional, l_not(hasinitvalue)): ' if (#varname#_capi != Py_None)', + '_depend': ''}, + {l_not(islogical): '''\ + f2py_success = #ctype#_from_pyobj(&#varname#,#varname#_capi,"#pyname#() #nth# (#varname#) can\'t be converted to #ctype#"); + if (f2py_success) {'''}, + {islogical: '''\ + #varname# = (#ctype#)PyObject_IsTrue(#varname#_capi); + f2py_success = 1; + if (f2py_success) {'''}, + ], + 'cleanupfrompyobj': ' } /*if (f2py_success) of #varname#*/', + 'need': {l_not(islogical): '#ctype#_from_pyobj'}, + '_check': l_and(isscalar, l_not(iscomplex), isintent_nothide), + '_depend': '' + }, { # Hidden + 'frompyobj': {hasinitvalue: ' #varname# = #init#;'}, + 'need': typedef_need_dict, + '_check': l_and(isscalar, l_not(iscomplex), isintent_hide), + '_depend': '' + }, { # Common + 'frompyobj': {debugcapi: ' fprintf(stderr,"#vardebugshowvalue#\\n",#varname#);'}, + '_check': l_and(isscalar, l_not(iscomplex)), + '_depend': '' + }, + # Complex scalars + { # Common + 'decl': ' #ctype# #varname#;', + 'callfortran': {isintent_c: '#varname#,', l_not(isintent_c): '&#varname#,'}, + 'pyobjfrom': {debugcapi: ' fprintf(stderr,"#vardebugshowvalue#\\n",#varname#.r,#varname#.i);'}, + 'return': {isintent_out: ',#varname#_capi'}, + '_check': iscomplex + }, { # Not hidden + 'decl': ' PyObject *#varname#_capi = Py_None;', + 'argformat': {isrequired: 'O'}, + 'keyformat': {isoptional: 'O'}, + 'args_capi': {isrequired: ',&#varname#_capi'}, + 'keys_capi': {isoptional: ',&#varname#_capi'}, + 'need': {isintent_inout: 'try_pyarr_from_#ctype#'}, + 'pyobjfrom': {isintent_inout: """\ + f2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#); + if (f2py_success) {"""}, + 'closepyobjfrom': {isintent_inout: " } /*if (f2py_success) of #varname# pyobjfrom*/"}, + '_check': l_and(iscomplex, isintent_nothide) + }, { + 'frompyobj': [{hasinitvalue: ' if (#varname#_capi==Py_None) {#varname#.r = #init.r#, #varname#.i = #init.i#;} else'}, + {l_and(isoptional, l_not(hasinitvalue)) + : ' if (#varname#_capi != Py_None)'}, + ' f2py_success = #ctype#_from_pyobj(&#varname#,#varname#_capi,"#pyname#() #nth# (#varname#) can\'t be converted to #ctype#");' + '\n if (f2py_success) {'], + 'cleanupfrompyobj': ' } /*if (f2py_success) of #varname# frompyobj*/', + 'need': ['#ctype#_from_pyobj'], + '_check': l_and(iscomplex, isintent_nothide), + '_depend': '' + }, { # Hidden + 'decl': {isintent_out: ' PyObject *#varname#_capi = Py_None;'}, + '_check': l_and(iscomplex, isintent_hide) + }, { + 'frompyobj': {hasinitvalue: ' #varname#.r = #init.r#, #varname#.i = #init.i#;'}, + '_check': l_and(iscomplex, isintent_hide), + '_depend': '' + }, { # Common + 'pyobjfrom': {isintent_out: ' #varname#_capi = pyobj_from_#ctype#1(#varname#);'}, + 'need': ['pyobj_from_#ctype#1'], + '_check': iscomplex + }, { + 'frompyobj': {debugcapi: ' fprintf(stderr,"#vardebugshowvalue#\\n",#varname#.r,#varname#.i);'}, + '_check': iscomplex, + '_depend': '' + }, + # String + { # Common + 'decl': [' #ctype# #varname# = NULL;', + ' int slen(#varname#);', + ' PyObject *#varname#_capi = Py_None;'], + 'callfortran':'#varname#,', + 'callfortranappend':'slen(#varname#),', + 'pyobjfrom':[ + {debugcapi: + ' fprintf(stderr,' + '"#vardebugshowvalue#\\n",slen(#varname#),#varname#);'}, + # The trailing null value for Fortran is blank. + {l_and(isintent_out, l_not(isintent_c)): + " STRINGPADN(#varname#, slen(#varname#), ' ', '\\0');"}, + ], + 'return': {isintent_out: ',#varname#'}, + 'need': ['len..', + {l_and(isintent_out, l_not(isintent_c)): 'STRINGPADN'}], + '_check': isstring + }, { # Common + 'frompyobj': [ + """\ + slen(#varname#) = #elsize#; + f2py_success = #ctype#_from_pyobj(&#varname#,&slen(#varname#),#init#,""" +"""#varname#_capi,\"#ctype#_from_pyobj failed in converting #nth#""" +"""`#varname#\' of #pyname# to C #ctype#\"); + if (f2py_success) {""", + # The trailing null value for Fortran is blank. + {l_not(isintent_c): + " STRINGPADN(#varname#, slen(#varname#), '\\0', ' ');"}, + ], + 'cleanupfrompyobj': """\ + STRINGFREE(#varname#); + } /*if (f2py_success) of #varname#*/""", + 'need': ['#ctype#_from_pyobj', 'len..', 'STRINGFREE', + {l_not(isintent_c): 'STRINGPADN'}], + '_check':isstring, + '_depend':'' + }, { # Not hidden + 'argformat': {isrequired: 'O'}, + 'keyformat': {isoptional: 'O'}, + 'args_capi': {isrequired: ',&#varname#_capi'}, + 'keys_capi': {isoptional: ',&#varname#_capi'}, + 'pyobjfrom': [ + {l_and(isintent_inout, l_not(isintent_c)): + " STRINGPADN(#varname#, slen(#varname#), ' ', '\\0');"}, + {isintent_inout: '''\ + f2py_success = try_pyarr_from_#ctype#(#varname#_capi, #varname#, + slen(#varname#)); + if (f2py_success) {'''}], + 'closepyobjfrom': {isintent_inout: ' } /*if (f2py_success) of #varname# pyobjfrom*/'}, + 'need': {isintent_inout: 'try_pyarr_from_#ctype#', + l_and(isintent_inout, l_not(isintent_c)): 'STRINGPADN'}, + '_check': l_and(isstring, isintent_nothide) + }, { # Hidden + '_check': l_and(isstring, isintent_hide) + }, { + 'frompyobj': {debugcapi: ' fprintf(stderr,"#vardebugshowvalue#\\n",slen(#varname#),#varname#);'}, + '_check': isstring, + '_depend': '' + }, + # Array + { # Common + 'decl': [' #ctype# *#varname# = NULL;', + ' npy_intp #varname#_Dims[#rank#] = {#rank*[-1]#};', + ' const int #varname#_Rank = #rank#;', + ' PyArrayObject *capi_#varname#_as_array = NULL;', + ' int capi_#varname#_intent = 0;', + {isstringarray: ' int slen(#varname#) = 0;'}, + ], + 'callfortran':'#varname#,', + 'callfortranappend': {isstringarray: 'slen(#varname#),'}, + 'return': {isintent_out: ',capi_#varname#_as_array'}, + 'need': 'len..', + '_check': isarray + }, { # intent(overwrite) array + 'decl': ' int capi_overwrite_#varname# = 1;', + 'kwlistxa': '"overwrite_#varname#",', + 'xaformat': 'i', + 'keys_xa': ',&capi_overwrite_#varname#', + 'docsignxa': 'overwrite_#varname#=1,', + 'docsignxashort': 'overwrite_#varname#,', + 'docstropt': 'overwrite_#varname# : input int, optional\\n Default: 1', + '_check': l_and(isarray, isintent_overwrite), + }, { + 'frompyobj': ' capi_#varname#_intent |= (capi_overwrite_#varname#?0:F2PY_INTENT_COPY);', + '_check': l_and(isarray, isintent_overwrite), + '_depend': '', + }, + { # intent(copy) array + 'decl': ' int capi_overwrite_#varname# = 0;', + 'kwlistxa': '"overwrite_#varname#",', + 'xaformat': 'i', + 'keys_xa': ',&capi_overwrite_#varname#', + 'docsignxa': 'overwrite_#varname#=0,', + 'docsignxashort': 'overwrite_#varname#,', + 'docstropt': 'overwrite_#varname# : input int, optional\\n Default: 0', + '_check': l_and(isarray, isintent_copy), + }, { + 'frompyobj': ' capi_#varname#_intent |= (capi_overwrite_#varname#?0:F2PY_INTENT_COPY);', + '_check': l_and(isarray, isintent_copy), + '_depend': '', + }, { + 'need': [{hasinitvalue: 'forcomb'}, {hasinitvalue: 'CFUNCSMESS'}], + '_check': isarray, + '_depend': '' + }, { # Not hidden + 'decl': ' PyObject *#varname#_capi = Py_None;', + 'argformat': {isrequired: 'O'}, + 'keyformat': {isoptional: 'O'}, + 'args_capi': {isrequired: ',&#varname#_capi'}, + 'keys_capi': {isoptional: ',&#varname#_capi'}, + '_check': l_and(isarray, isintent_nothide) + }, { + 'frompyobj': [ + ' #setdims#;', + ' capi_#varname#_intent |= #intent#;', + (' const char * capi_errmess = "#modulename#.#pyname#:' + ' failed to create array from the #nth# `#varname#`";'), + {isintent_hide: + ' capi_#varname#_as_array = ndarray_from_pyobj(' + ' #atype#,#elsize#,#varname#_Dims,#varname#_Rank,' + ' capi_#varname#_intent,Py_None,capi_errmess);'}, + {isintent_nothide: + ' capi_#varname#_as_array = ndarray_from_pyobj(' + ' #atype#,#elsize#,#varname#_Dims,#varname#_Rank,' + ' capi_#varname#_intent,#varname#_capi,capi_errmess);'}, + """\ + if (capi_#varname#_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = #modulename#_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + #varname# = (#ctype# *)(PyArray_DATA(capi_#varname#_as_array)); +""", + {isstringarray: + ' slen(#varname#) = f2py_itemsize(#varname#);'}, + {hasinitvalue: [ + {isintent_nothide: + ' if (#varname#_capi == Py_None) {'}, + {isintent_hide: ' {'}, + {iscomplexarray: ' #ctype# capi_c;'}, + """\ + int *_i,capi_i=0; + CFUNCSMESS(\"#name#: Initializing #varname#=#init#\\n\"); + if (initforcomb(PyArray_DIMS(capi_#varname#_as_array), + PyArray_NDIM(capi_#varname#_as_array),1)) { + while ((_i = nextforcomb())) + #varname#[capi_i++] = #init#; /* fortran way */ + } else { + PyObject *exc, *val, *tb; + PyErr_Fetch(&exc, &val, &tb); + PyErr_SetString(exc ? exc : #modulename#_error, + \"Initialization of #nth# #varname# failed (initforcomb).\"); + npy_PyErr_ChainExceptionsCause(exc, val, tb); + f2py_success = 0; + } + } + if (f2py_success) {"""]}, + ], + 'cleanupfrompyobj': [ # note that this list will be reversed + ' } ' + '/* if (capi_#varname#_as_array == NULL) ... else of #varname# */', + {l_not(l_or(isintent_out, isintent_hide)): """\ + if((PyObject *)capi_#varname#_as_array!=#varname#_capi) { + Py_XDECREF(capi_#varname#_as_array); }"""}, + {l_and(isintent_hide, l_not(isintent_out)) + : """ Py_XDECREF(capi_#varname#_as_array);"""}, + {hasinitvalue: ' } /*if (f2py_success) of #varname# init*/'}, + ], + '_check': isarray, + '_depend': '' + }, + # Scalararray + { # Common + '_check': l_and(isarray, l_not(iscomplexarray)) + }, { # Not hidden + '_check': l_and(isarray, l_not(iscomplexarray), isintent_nothide) + }, + # Integer*1 array + {'need': '#ctype#', + '_check': isint1array, + '_depend': '' + }, + # Integer*-1 array + {'need': '#ctype#', + '_check': isunsigned_chararray, + '_depend': '' + }, + # Integer*-2 array + {'need': '#ctype#', + '_check': isunsigned_shortarray, + '_depend': '' + }, + # Integer*-8 array + {'need': '#ctype#', + '_check': isunsigned_long_longarray, + '_depend': '' + }, + # Complexarray + {'need': '#ctype#', + '_check': iscomplexarray, + '_depend': '' + }, + # Character + { + 'need': 'string', + '_check': ischaracter, + }, + # Character array + { + 'need': 'string', + '_check': ischaracterarray, + }, + # Stringarray + { + 'callfortranappend': {isarrayofstrings: 'flen(#varname#),'}, + 'need': 'string', + '_check': isstringarray + } +] + +################# Rules for checking ############### + +check_rules = [ + { + 'frompyobj': {debugcapi: ' fprintf(stderr,\"debug-capi:Checking `#check#\'\\n\");'}, + 'need': 'len..' + }, { + 'frompyobj': ' CHECKSCALAR(#check#,\"#check#\",\"#nth# #varname#\",\"#varshowvalue#\",#varname#) {', + 'cleanupfrompyobj': ' } /*CHECKSCALAR(#check#)*/', + 'need': 'CHECKSCALAR', + '_check': l_and(isscalar, l_not(iscomplex)), + '_break': '' + }, { + 'frompyobj': ' CHECKSTRING(#check#,\"#check#\",\"#nth# #varname#\",\"#varshowvalue#\",#varname#) {', + 'cleanupfrompyobj': ' } /*CHECKSTRING(#check#)*/', + 'need': 'CHECKSTRING', + '_check': isstring, + '_break': '' + }, { + 'need': 'CHECKARRAY', + 'frompyobj': ' CHECKARRAY(#check#,\"#check#\",\"#nth# #varname#\") {', + 'cleanupfrompyobj': ' } /*CHECKARRAY(#check#)*/', + '_check': isarray, + '_break': '' + }, { + 'need': 'CHECKGENERIC', + 'frompyobj': ' CHECKGENERIC(#check#,\"#check#\",\"#nth# #varname#\") {', + 'cleanupfrompyobj': ' } /*CHECKGENERIC(#check#)*/', + } +] + +########## Applying the rules. No need to modify what follows ############# + +#################### Build C/API module ####################### + + +def buildmodule(m, um): + """ + Return + """ + outmess(' Building module "%s"...\n' % (m['name'])) + ret = {} + mod_rules = defmod_rules[:] + vrd = capi_maps.modsign2map(m) + rd = dictappend({'f2py_version': f2py_version}, vrd) + funcwrappers = [] + funcwrappers2 = [] # F90 codes + for n in m['interfaced']: + nb = None + for bi in m['body']: + if bi['block'] not in ['interface', 'abstract interface']: + errmess('buildmodule: Expected interface block. Skipping.\n') + continue + for b in bi['body']: + if b['name'] == n: + nb = b + break + + if not nb: + print( + 'buildmodule: Could not find the body of interfaced routine "%s". Skipping.\n' % (n), file=sys.stderr) + continue + nb_list = [nb] + if 'entry' in nb: + for k, a in nb['entry'].items(): + nb1 = copy.deepcopy(nb) + del nb1['entry'] + nb1['name'] = k + nb1['args'] = a + nb_list.append(nb1) + for nb in nb_list: + # requiresf90wrapper must be called before buildapi as it + # rewrites assumed shape arrays as automatic arrays. + isf90 = requiresf90wrapper(nb) + # options is in scope here + if options['emptygen']: + b_path = options['buildpath'] + m_name = vrd['modulename'] + outmess(' Generating possibly empty wrappers"\n') + Path(f"{b_path}/{vrd['coutput']}").touch() + if isf90: + # f77 + f90 wrappers + outmess(f' Maybe empty "{m_name}-f2pywrappers2.f90"\n') + Path(f'{b_path}/{m_name}-f2pywrappers2.f90').touch() + outmess(f' Maybe empty "{m_name}-f2pywrappers.f"\n') + Path(f'{b_path}/{m_name}-f2pywrappers.f').touch() + else: + # only f77 wrappers + outmess(f' Maybe empty "{m_name}-f2pywrappers.f"\n') + Path(f'{b_path}/{m_name}-f2pywrappers.f').touch() + api, wrap = buildapi(nb) + if wrap: + if isf90: + funcwrappers2.append(wrap) + else: + funcwrappers.append(wrap) + ar = applyrules(api, vrd) + rd = dictappend(rd, ar) + + # Construct COMMON block support + cr, wrap = common_rules.buildhooks(m) + if wrap: + funcwrappers.append(wrap) + ar = applyrules(cr, vrd) + rd = dictappend(rd, ar) + + # Construct F90 module support + mr, wrap = f90mod_rules.buildhooks(m) + if wrap: + funcwrappers2.append(wrap) + ar = applyrules(mr, vrd) + rd = dictappend(rd, ar) + + for u in um: + ar = use_rules.buildusevars(u, m['use'][u['name']]) + rd = dictappend(rd, ar) + + needs = cfuncs.get_needs() + # Add mapped definitions + needs['typedefs'] += [cvar for cvar in capi_maps.f2cmap_mapped # + if cvar in typedef_need_dict.values()] + code = {} + for n in needs.keys(): + code[n] = [] + for k in needs[n]: + c = '' + if k in cfuncs.includes0: + c = cfuncs.includes0[k] + elif k in cfuncs.includes: + c = cfuncs.includes[k] + elif k in cfuncs.userincludes: + c = cfuncs.userincludes[k] + elif k in cfuncs.typedefs: + c = cfuncs.typedefs[k] + elif k in cfuncs.typedefs_generated: + c = cfuncs.typedefs_generated[k] + elif k in cfuncs.cppmacros: + c = cfuncs.cppmacros[k] + elif k in cfuncs.cfuncs: + c = cfuncs.cfuncs[k] + elif k in cfuncs.callbacks: + c = cfuncs.callbacks[k] + elif k in cfuncs.f90modhooks: + c = cfuncs.f90modhooks[k] + elif k in cfuncs.commonhooks: + c = cfuncs.commonhooks[k] + else: + errmess('buildmodule: unknown need %s.\n' % (repr(k))) + continue + code[n].append(c) + mod_rules.append(code) + for r in mod_rules: + if ('_check' in r and r['_check'](m)) or ('_check' not in r): + ar = applyrules(r, vrd, m) + rd = dictappend(rd, ar) + ar = applyrules(module_rules, rd) + + fn = os.path.join(options['buildpath'], vrd['coutput']) + ret['csrc'] = fn + with open(fn, 'w') as f: + f.write(ar['modulebody'].replace('\t', 2 * ' ')) + outmess(' Wrote C/API module "%s" to file "%s"\n' % (m['name'], fn)) + + if options['dorestdoc']: + fn = os.path.join( + options['buildpath'], vrd['modulename'] + 'module.rest') + with open(fn, 'w') as f: + f.write('.. -*- rest -*-\n') + f.write('\n'.join(ar['restdoc'])) + outmess(' ReST Documentation is saved to file "%s/%smodule.rest"\n' % + (options['buildpath'], vrd['modulename'])) + if options['dolatexdoc']: + fn = os.path.join( + options['buildpath'], vrd['modulename'] + 'module.tex') + ret['ltx'] = fn + with open(fn, 'w') as f: + f.write( + '%% This file is auto-generated with f2py (version:%s)\n' % (f2py_version)) + if 'shortlatex' not in options: + f.write( + '\\documentclass{article}\n\\usepackage{a4wide}\n\\begin{document}\n\\tableofcontents\n\n') + f.write('\n'.join(ar['latexdoc'])) + if 'shortlatex' not in options: + f.write('\\end{document}') + outmess(' Documentation is saved to file "%s/%smodule.tex"\n' % + (options['buildpath'], vrd['modulename'])) + if funcwrappers: + wn = os.path.join(options['buildpath'], vrd['f2py_wrapper_output']) + ret['fsrc'] = wn + with open(wn, 'w') as f: + f.write('C -*- fortran -*-\n') + f.write( + 'C This file is autogenerated with f2py (version:%s)\n' % (f2py_version)) + f.write( + 'C It contains Fortran 77 wrappers to fortran functions.\n') + lines = [] + for l in ('\n\n'.join(funcwrappers) + '\n').split('\n'): + if 0 <= l.find('!') < 66: + # don't split comment lines + lines.append(l + '\n') + elif l and l[0] == ' ': + while len(l) >= 66: + lines.append(l[:66] + '\n &') + l = l[66:] + lines.append(l + '\n') + else: + lines.append(l + '\n') + lines = ''.join(lines).replace('\n &\n', '\n') + f.write(lines) + outmess(' Fortran 77 wrappers are saved to "%s"\n' % (wn)) + if funcwrappers2: + wn = os.path.join( + options['buildpath'], '%s-f2pywrappers2.f90' % (vrd['modulename'])) + ret['fsrc'] = wn + with open(wn, 'w') as f: + f.write('! -*- f90 -*-\n') + f.write( + '! This file is autogenerated with f2py (version:%s)\n' % (f2py_version)) + f.write( + '! It contains Fortran 90 wrappers to fortran functions.\n') + lines = [] + for l in ('\n\n'.join(funcwrappers2) + '\n').split('\n'): + if 0 <= l.find('!') < 72: + # don't split comment lines + lines.append(l + '\n') + elif len(l) > 72 and l[0] == ' ': + lines.append(l[:72] + '&\n &') + l = l[72:] + while len(l) > 66: + lines.append(l[:66] + '&\n &') + l = l[66:] + lines.append(l + '\n') + else: + lines.append(l + '\n') + lines = ''.join(lines).replace('\n &\n', '\n') + f.write(lines) + outmess(' Fortran 90 wrappers are saved to "%s"\n' % (wn)) + return ret + +################## Build C/API function ############# + +stnd = {1: 'st', 2: 'nd', 3: 'rd', 4: 'th', 5: 'th', + 6: 'th', 7: 'th', 8: 'th', 9: 'th', 0: 'th'} + + +def buildapi(rout): + rout, wrap = func2subr.assubr(rout) + args, depargs = getargs2(rout) + capi_maps.depargs = depargs + var = rout['vars'] + + if ismoduleroutine(rout): + outmess(' Constructing wrapper function "%s.%s"...\n' % + (rout['modulename'], rout['name'])) + else: + outmess(' Constructing wrapper function "%s"...\n' % (rout['name'])) + # Routine + vrd = capi_maps.routsign2map(rout) + rd = dictappend({}, vrd) + for r in rout_rules: + if ('_check' in r and r['_check'](rout)) or ('_check' not in r): + ar = applyrules(r, vrd, rout) + rd = dictappend(rd, ar) + + # Args + nth, nthk = 0, 0 + savevrd = {} + for a in args: + vrd = capi_maps.sign2map(a, var[a]) + if isintent_aux(var[a]): + _rules = aux_rules + else: + _rules = arg_rules + if not isintent_hide(var[a]): + if not isoptional(var[a]): + nth = nth + 1 + vrd['nth'] = repr(nth) + stnd[nth % 10] + ' argument' + else: + nthk = nthk + 1 + vrd['nth'] = repr(nthk) + stnd[nthk % 10] + ' keyword' + else: + vrd['nth'] = 'hidden' + savevrd[a] = vrd + for r in _rules: + if '_depend' in r: + continue + if ('_check' in r and r['_check'](var[a])) or ('_check' not in r): + ar = applyrules(r, vrd, var[a]) + rd = dictappend(rd, ar) + if '_break' in r: + break + for a in depargs: + if isintent_aux(var[a]): + _rules = aux_rules + else: + _rules = arg_rules + vrd = savevrd[a] + for r in _rules: + if '_depend' not in r: + continue + if ('_check' in r and r['_check'](var[a])) or ('_check' not in r): + ar = applyrules(r, vrd, var[a]) + rd = dictappend(rd, ar) + if '_break' in r: + break + if 'check' in var[a]: + for c in var[a]['check']: + vrd['check'] = c + ar = applyrules(check_rules, vrd, var[a]) + rd = dictappend(rd, ar) + if isinstance(rd['cleanupfrompyobj'], list): + rd['cleanupfrompyobj'].reverse() + if isinstance(rd['closepyobjfrom'], list): + rd['closepyobjfrom'].reverse() + rd['docsignature'] = stripcomma(replace('#docsign##docsignopt##docsignxa#', + {'docsign': rd['docsign'], + 'docsignopt': rd['docsignopt'], + 'docsignxa': rd['docsignxa']})) + optargs = stripcomma(replace('#docsignopt##docsignxa#', + {'docsignxa': rd['docsignxashort'], + 'docsignopt': rd['docsignoptshort']} + )) + if optargs == '': + rd['docsignatureshort'] = stripcomma( + replace('#docsign#', {'docsign': rd['docsign']})) + else: + rd['docsignatureshort'] = replace('#docsign#[#docsignopt#]', + {'docsign': rd['docsign'], + 'docsignopt': optargs, + }) + rd['latexdocsignatureshort'] = rd['docsignatureshort'].replace('_', '\\_') + rd['latexdocsignatureshort'] = rd[ + 'latexdocsignatureshort'].replace(',', ', ') + cfs = stripcomma(replace('#callfortran##callfortranappend#', { + 'callfortran': rd['callfortran'], 'callfortranappend': rd['callfortranappend']})) + if len(rd['callfortranappend']) > 1: + rd['callcompaqfortran'] = stripcomma(replace('#callfortran# 0,#callfortranappend#', { + 'callfortran': rd['callfortran'], 'callfortranappend': rd['callfortranappend']})) + else: + rd['callcompaqfortran'] = cfs + rd['callfortran'] = cfs + if isinstance(rd['docreturn'], list): + rd['docreturn'] = stripcomma( + replace('#docreturn#', {'docreturn': rd['docreturn']})) + ' = ' + rd['docstrsigns'] = [] + rd['latexdocstrsigns'] = [] + for k in ['docstrreq', 'docstropt', 'docstrout', 'docstrcbs']: + if k in rd and isinstance(rd[k], list): + rd['docstrsigns'] = rd['docstrsigns'] + rd[k] + k = 'latex' + k + if k in rd and isinstance(rd[k], list): + rd['latexdocstrsigns'] = rd['latexdocstrsigns'] + rd[k][0:1] +\ + ['\\begin{description}'] + rd[k][1:] +\ + ['\\end{description}'] + + ar = applyrules(routine_rules, rd) + if ismoduleroutine(rout): + outmess(' %s\n' % (ar['docshort'])) + else: + outmess(' %s\n' % (ar['docshort'])) + return ar, wrap + + +#################### EOF rules.py ####################### diff --git a/shared/package-files/07/0783854f52c33ada6b6d2a5d867662f0ae8e15238d2fce7b9ada4f4d319eb466/blob b/shared/package-files/07/0783854f52c33ada6b6d2a5d867662f0ae8e15238d2fce7b9ada4f4d319eb466/blob new file mode 100644 index 0000000000000000000000000000000000000000..5f4ebcb7f9789c4ecda13ac66c2e768851113004 Binary files /dev/null and b/shared/package-files/07/0783854f52c33ada6b6d2a5d867662f0ae8e15238d2fce7b9ada4f4d319eb466/blob differ diff --git a/shared/package-files/07/078642ed906b483e880904f8ebcacecbec6b3a0403b9e72c1dad3325eb007981/blob b/shared/package-files/07/078642ed906b483e880904f8ebcacecbec6b3a0403b9e72c1dad3325eb007981/blob new file mode 100644 index 0000000000000000000000000000000000000000..d65417945449ed8b62d2547215d8908f84820a9b --- /dev/null +++ b/shared/package-files/07/078642ed906b483e880904f8ebcacecbec6b3a0403b9e72c1dad3325eb007981/blob @@ -0,0 +1,105 @@ +from functools import singledispatch + +from sympy.external import import_module +from sympy.stats.crv_types import BetaDistribution, ChiSquaredDistribution, ExponentialDistribution, GammaDistribution, \ + LogNormalDistribution, NormalDistribution, ParetoDistribution, UniformDistribution, FDistributionDistribution, GumbelDistribution, LaplaceDistribution, \ + LogisticDistribution, RayleighDistribution, TriangularDistribution +from sympy.stats.drv_types import GeometricDistribution, PoissonDistribution, ZetaDistribution +from sympy.stats.frv_types import BinomialDistribution, HypergeometricDistribution + + +numpy = import_module('numpy') + + +@singledispatch +def do_sample_numpy(dist, size, rand_state): + return None + + +# CRV: + +@do_sample_numpy.register(BetaDistribution) +def _(dist: BetaDistribution, size, rand_state): + return rand_state.beta(a=float(dist.alpha), b=float(dist.beta), size=size) + + +@do_sample_numpy.register(ChiSquaredDistribution) +def _(dist: ChiSquaredDistribution, size, rand_state): + return rand_state.chisquare(df=float(dist.k), size=size) + + +@do_sample_numpy.register(ExponentialDistribution) +def _(dist: ExponentialDistribution, size, rand_state): + return rand_state.exponential(1 / float(dist.rate), size=size) + +@do_sample_numpy.register(FDistributionDistribution) +def _(dist: FDistributionDistribution, size, rand_state): + return rand_state.f(dfnum = float(dist.d1), dfden = float(dist.d2), size=size) + +@do_sample_numpy.register(GammaDistribution) +def _(dist: GammaDistribution, size, rand_state): + return rand_state.gamma(shape = float(dist.k), scale = float(dist.theta), size=size) + +@do_sample_numpy.register(GumbelDistribution) +def _(dist: GumbelDistribution, size, rand_state): + return rand_state.gumbel(loc = float(dist.mu), scale = float(dist.beta), size=size) + +@do_sample_numpy.register(LaplaceDistribution) +def _(dist: LaplaceDistribution, size, rand_state): + return rand_state.laplace(loc = float(dist.mu), scale = float(dist.b), size=size) + +@do_sample_numpy.register(LogisticDistribution) +def _(dist: LogisticDistribution, size, rand_state): + return rand_state.logistic(loc = float(dist.mu), scale = float(dist.s), size=size) + +@do_sample_numpy.register(LogNormalDistribution) +def _(dist: LogNormalDistribution, size, rand_state): + return rand_state.lognormal(mean = float(dist.mean), sigma = float(dist.std), size=size) + +@do_sample_numpy.register(NormalDistribution) +def _(dist: NormalDistribution, size, rand_state): + return rand_state.normal(loc = float(dist.mean), scale = float(dist.std), size=size) + +@do_sample_numpy.register(RayleighDistribution) +def _(dist: RayleighDistribution, size, rand_state): + return rand_state.rayleigh(scale = float(dist.sigma), size=size) + +@do_sample_numpy.register(ParetoDistribution) +def _(dist: ParetoDistribution, size, rand_state): + return (numpy.random.pareto(a=float(dist.alpha), size=size) + 1) * float(dist.xm) + +@do_sample_numpy.register(TriangularDistribution) +def _(dist: TriangularDistribution, size, rand_state): + return rand_state.triangular(left = float(dist.a), mode = float(dist.b), right = float(dist.c), size=size) + +@do_sample_numpy.register(UniformDistribution) +def _(dist: UniformDistribution, size, rand_state): + return rand_state.uniform(low=float(dist.left), high=float(dist.right), size=size) + + +# DRV: + +@do_sample_numpy.register(GeometricDistribution) +def _(dist: GeometricDistribution, size, rand_state): + return rand_state.geometric(p=float(dist.p), size=size) + + +@do_sample_numpy.register(PoissonDistribution) +def _(dist: PoissonDistribution, size, rand_state): + return rand_state.poisson(lam=float(dist.lamda), size=size) + + +@do_sample_numpy.register(ZetaDistribution) +def _(dist: ZetaDistribution, size, rand_state): + return rand_state.zipf(a=float(dist.s), size=size) + + +# FRV: + +@do_sample_numpy.register(BinomialDistribution) +def _(dist: BinomialDistribution, size, rand_state): + return rand_state.binomial(n=int(dist.n), p=float(dist.p), size=size) + +@do_sample_numpy.register(HypergeometricDistribution) +def _(dist: HypergeometricDistribution, size, rand_state): + return rand_state.hypergeometric(ngood = int(dist.N), nbad = int(dist.m), nsample = int(dist.n), size=size) diff --git a/shared/package-files/07/0786c145c753a3ced41ad35c98de14526762160bf687169c5677be79a248ccb8/blob b/shared/package-files/07/0786c145c753a3ced41ad35c98de14526762160bf687169c5677be79a248ccb8/blob new file mode 100644 index 0000000000000000000000000000000000000000..d000a337230a757c7b1cc1ddc80b477d986af8bd --- /dev/null +++ b/shared/package-files/07/0786c145c753a3ced41ad35c98de14526762160bf687169c5677be79a248ccb8/blob @@ -0,0 +1,117 @@ +""" + pygments.styles.material + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Mimic the Material theme color scheme. + + https://github.com/material-theme/vsc-material-theme + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Escape, \ + Error, Text, Number, Operator, Generic, Punctuation, Literal + +class MaterialStyle(Style): + """ + This style mimics the Material Theme color scheme. + """ + dark_teal = '#263238' + white= '#FFFFFF' + black= '#000000' + red= '#FF5370' + orange= '#F78C6C' + yellow= '#FFCB6B' + green= '#C3E88D' + cyan= '#89DDFF' + blue= '#82AAFF' + paleblue= '#B2CCD6' + purple= '#C792EA' + brown= '#C17E70' + pink= '#F07178' + violet= '#BB80B3' + foreground = '#EEFFFF' + faded = '#546E7A' + + background_color = dark_teal + highlight_color = '#2C3B41' + line_number_color = '#37474F' + line_number_background_color = dark_teal + line_number_special_color = '#607A86' + line_number_special_background_color = dark_teal + + styles = { + Text: foreground, + Escape: cyan, + Error: red, + + Keyword: violet, + Keyword.Constant: cyan, + Keyword.Declaration: violet, + Keyword.Namespace: 'italic ' + cyan, + Keyword.Pseudo: cyan, + Keyword.Type: violet, + + Name: foreground, + Name.Attribute: violet, + Name.Builtin: blue, + Name.Builtin.Pseudo: cyan, + Name.Class: yellow, + Name.Constant: foreground, + Name.Decorator: blue, + Name.Entity: cyan, + Name.Exception: yellow, + Name.Function: blue, + Name.Function.Magic: blue, + Name.Label: blue, + Name.Property: yellow, + Name.Namespace: yellow, + Name.Other: foreground, + Name.Tag: red, + Name.Variable: cyan, + Name.Variable.Class: cyan, + Name.Variable.Global: cyan, + Name.Variable.Instance: cyan, + Name.Variable.Magic: blue, + + Literal: green, + Literal.Date: green, + + String: green, + String.Affix: violet, + String.Backtick: green, + String.Char: green, + String.Delimiter: foreground, + String.Doc: 'italic ' + faded, + String.Double: green, + String.Escape: foreground, + String.Heredoc: green, + String.Interpol: cyan, + String.Other: green, + String.Regex: cyan, + String.Single: green, + String.Symbol: cyan, + + Number: orange, + + Operator: cyan, + Operator.Word: 'italic ' + cyan, + + Punctuation: cyan, + + Comment: 'italic ' + faded, + + Generic: foreground, + Generic.Deleted: red, + Generic.Emph: cyan, + Generic.Error: red, + Generic.Heading: green, + Generic.Inserted: green, + Generic.Output: faded, + Generic.Prompt: yellow, + Generic.Strong: red, + Generic.Subheading: cyan, + Generic.Traceback: red, + } diff --git a/shared/package-files/07/078760b37116226f2a2aea10327e8535a1867ffa809bf1009b89765f77070cc3/blob b/shared/package-files/07/078760b37116226f2a2aea10327e8535a1867ffa809bf1009b89765f77070cc3/blob new file mode 100644 index 0000000000000000000000000000000000000000..021107724bef73d998191d65b55fb29848fc8b9a --- /dev/null +++ b/shared/package-files/07/078760b37116226f2a2aea10327e8535a1867ffa809bf1009b89765f77070cc3/blob @@ -0,0 +1,530 @@ +""" +These test the method maybe_promote from core/dtypes/cast.py +""" + +import datetime +from decimal import Decimal + +import numpy as np +import pytest + +from pandas._libs.tslibs import NaT + +from pandas.core.dtypes.cast import maybe_promote +from pandas.core.dtypes.common import is_scalar +from pandas.core.dtypes.dtypes import DatetimeTZDtype +from pandas.core.dtypes.missing import isna + +import pandas as pd + + +def _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar=None): + """ + Auxiliary function to unify testing of scalar/array promotion. + + Parameters + ---------- + dtype : dtype + The value to pass on as the first argument to maybe_promote. + fill_value : scalar + The value to pass on as the second argument to maybe_promote as + a scalar. + expected_dtype : dtype + The expected dtype returned by maybe_promote (by design this is the + same regardless of whether fill_value was passed as a scalar or in an + array!). + exp_val_for_scalar : scalar + The expected value for the (potentially upcast) fill_value returned by + maybe_promote. + """ + assert is_scalar(fill_value) + + # here, we pass on fill_value as a scalar directly; the expected value + # returned from maybe_promote is fill_value, potentially upcast to the + # returned dtype. + result_dtype, result_fill_value = maybe_promote(dtype, fill_value) + expected_fill_value = exp_val_for_scalar + + assert result_dtype == expected_dtype + _assert_match(result_fill_value, expected_fill_value) + + +def _assert_match(result_fill_value, expected_fill_value): + # GH#23982/25425 require the same type in addition to equality/NA-ness + res_type = type(result_fill_value) + ex_type = type(expected_fill_value) + + if hasattr(result_fill_value, "dtype"): + # Compare types in a way that is robust to platform-specific + # idiosyncrasies where e.g. sometimes we get "ulonglong" as an alias + # for "uint64" or "intc" as an alias for "int32" + assert result_fill_value.dtype.kind == expected_fill_value.dtype.kind + assert result_fill_value.dtype.itemsize == expected_fill_value.dtype.itemsize + else: + # On some builds, type comparison fails, e.g. np.int32 != np.int32 + assert res_type == ex_type or res_type.__name__ == ex_type.__name__ + + match_value = result_fill_value == expected_fill_value + if match_value is pd.NA: + match_value = False + + # Note: type check above ensures that we have the _same_ NA value + # for missing values, None == None (which is checked + # through match_value above), but np.nan != np.nan and pd.NaT != pd.NaT + match_missing = isna(result_fill_value) and isna(expected_fill_value) + + assert match_value or match_missing + + +@pytest.mark.parametrize( + "dtype, fill_value, expected_dtype", + [ + # size 8 + ("int8", 1, "int8"), + ("int8", np.iinfo("int8").max + 1, "int16"), + ("int8", np.iinfo("int16").max + 1, "int32"), + ("int8", np.iinfo("int32").max + 1, "int64"), + ("int8", np.iinfo("int64").max + 1, "object"), + ("int8", -1, "int8"), + ("int8", np.iinfo("int8").min - 1, "int16"), + ("int8", np.iinfo("int16").min - 1, "int32"), + ("int8", np.iinfo("int32").min - 1, "int64"), + ("int8", np.iinfo("int64").min - 1, "object"), + # keep signed-ness as long as possible + ("uint8", 1, "uint8"), + ("uint8", np.iinfo("int8").max + 1, "uint8"), + ("uint8", np.iinfo("uint8").max + 1, "uint16"), + ("uint8", np.iinfo("int16").max + 1, "uint16"), + ("uint8", np.iinfo("uint16").max + 1, "uint32"), + ("uint8", np.iinfo("int32").max + 1, "uint32"), + ("uint8", np.iinfo("uint32").max + 1, "uint64"), + ("uint8", np.iinfo("int64").max + 1, "uint64"), + ("uint8", np.iinfo("uint64").max + 1, "object"), + # max of uint8 cannot be contained in int8 + ("uint8", -1, "int16"), + ("uint8", np.iinfo("int8").min - 1, "int16"), + ("uint8", np.iinfo("int16").min - 1, "int32"), + ("uint8", np.iinfo("int32").min - 1, "int64"), + ("uint8", np.iinfo("int64").min - 1, "object"), + # size 16 + ("int16", 1, "int16"), + ("int16", np.iinfo("int8").max + 1, "int16"), + ("int16", np.iinfo("int16").max + 1, "int32"), + ("int16", np.iinfo("int32").max + 1, "int64"), + ("int16", np.iinfo("int64").max + 1, "object"), + ("int16", -1, "int16"), + ("int16", np.iinfo("int8").min - 1, "int16"), + ("int16", np.iinfo("int16").min - 1, "int32"), + ("int16", np.iinfo("int32").min - 1, "int64"), + ("int16", np.iinfo("int64").min - 1, "object"), + ("uint16", 1, "uint16"), + ("uint16", np.iinfo("int8").max + 1, "uint16"), + ("uint16", np.iinfo("uint8").max + 1, "uint16"), + ("uint16", np.iinfo("int16").max + 1, "uint16"), + ("uint16", np.iinfo("uint16").max + 1, "uint32"), + ("uint16", np.iinfo("int32").max + 1, "uint32"), + ("uint16", np.iinfo("uint32").max + 1, "uint64"), + ("uint16", np.iinfo("int64").max + 1, "uint64"), + ("uint16", np.iinfo("uint64").max + 1, "object"), + ("uint16", -1, "int32"), + ("uint16", np.iinfo("int8").min - 1, "int32"), + ("uint16", np.iinfo("int16").min - 1, "int32"), + ("uint16", np.iinfo("int32").min - 1, "int64"), + ("uint16", np.iinfo("int64").min - 1, "object"), + # size 32 + ("int32", 1, "int32"), + ("int32", np.iinfo("int8").max + 1, "int32"), + ("int32", np.iinfo("int16").max + 1, "int32"), + ("int32", np.iinfo("int32").max + 1, "int64"), + ("int32", np.iinfo("int64").max + 1, "object"), + ("int32", -1, "int32"), + ("int32", np.iinfo("int8").min - 1, "int32"), + ("int32", np.iinfo("int16").min - 1, "int32"), + ("int32", np.iinfo("int32").min - 1, "int64"), + ("int32", np.iinfo("int64").min - 1, "object"), + ("uint32", 1, "uint32"), + ("uint32", np.iinfo("int8").max + 1, "uint32"), + ("uint32", np.iinfo("uint8").max + 1, "uint32"), + ("uint32", np.iinfo("int16").max + 1, "uint32"), + ("uint32", np.iinfo("uint16").max + 1, "uint32"), + ("uint32", np.iinfo("int32").max + 1, "uint32"), + ("uint32", np.iinfo("uint32").max + 1, "uint64"), + ("uint32", np.iinfo("int64").max + 1, "uint64"), + ("uint32", np.iinfo("uint64").max + 1, "object"), + ("uint32", -1, "int64"), + ("uint32", np.iinfo("int8").min - 1, "int64"), + ("uint32", np.iinfo("int16").min - 1, "int64"), + ("uint32", np.iinfo("int32").min - 1, "int64"), + ("uint32", np.iinfo("int64").min - 1, "object"), + # size 64 + ("int64", 1, "int64"), + ("int64", np.iinfo("int8").max + 1, "int64"), + ("int64", np.iinfo("int16").max + 1, "int64"), + ("int64", np.iinfo("int32").max + 1, "int64"), + ("int64", np.iinfo("int64").max + 1, "object"), + ("int64", -1, "int64"), + ("int64", np.iinfo("int8").min - 1, "int64"), + ("int64", np.iinfo("int16").min - 1, "int64"), + ("int64", np.iinfo("int32").min - 1, "int64"), + ("int64", np.iinfo("int64").min - 1, "object"), + ("uint64", 1, "uint64"), + ("uint64", np.iinfo("int8").max + 1, "uint64"), + ("uint64", np.iinfo("uint8").max + 1, "uint64"), + ("uint64", np.iinfo("int16").max + 1, "uint64"), + ("uint64", np.iinfo("uint16").max + 1, "uint64"), + ("uint64", np.iinfo("int32").max + 1, "uint64"), + ("uint64", np.iinfo("uint32").max + 1, "uint64"), + ("uint64", np.iinfo("int64").max + 1, "uint64"), + ("uint64", np.iinfo("uint64").max + 1, "object"), + ("uint64", -1, "object"), + ("uint64", np.iinfo("int8").min - 1, "object"), + ("uint64", np.iinfo("int16").min - 1, "object"), + ("uint64", np.iinfo("int32").min - 1, "object"), + ("uint64", np.iinfo("int64").min - 1, "object"), + ], +) +def test_maybe_promote_int_with_int(dtype, fill_value, expected_dtype): + dtype = np.dtype(dtype) + expected_dtype = np.dtype(expected_dtype) + + # output is not a generic int, but corresponds to expected_dtype + exp_val_for_scalar = np.array([fill_value], dtype=expected_dtype)[0] + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_int_with_float(any_int_numpy_dtype, float_numpy_dtype): + dtype = np.dtype(any_int_numpy_dtype) + fill_dtype = np.dtype(float_numpy_dtype) + + # create array of given dtype; casts "1" to correct dtype + fill_value = np.array([1], dtype=fill_dtype)[0] + + # filling int with float always upcasts to float64 + expected_dtype = np.float64 + # fill_value can be different float type + exp_val_for_scalar = np.float64(fill_value) + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_float_with_int(float_numpy_dtype, any_int_numpy_dtype): + dtype = np.dtype(float_numpy_dtype) + fill_dtype = np.dtype(any_int_numpy_dtype) + + # create array of given dtype; casts "1" to correct dtype + fill_value = np.array([1], dtype=fill_dtype)[0] + + # filling float with int always keeps float dtype + # because: np.finfo('float32').max > np.iinfo('uint64').max + expected_dtype = dtype + # output is not a generic float, but corresponds to expected_dtype + exp_val_for_scalar = np.array([fill_value], dtype=expected_dtype)[0] + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +@pytest.mark.parametrize( + "dtype, fill_value, expected_dtype", + [ + # float filled with float + ("float32", 1, "float32"), + ("float32", float(np.finfo("float32").max) * 1.1, "float64"), + ("float64", 1, "float64"), + ("float64", float(np.finfo("float32").max) * 1.1, "float64"), + # complex filled with float + ("complex64", 1, "complex64"), + ("complex64", float(np.finfo("float32").max) * 1.1, "complex128"), + ("complex128", 1, "complex128"), + ("complex128", float(np.finfo("float32").max) * 1.1, "complex128"), + # float filled with complex + ("float32", 1 + 1j, "complex64"), + ("float32", float(np.finfo("float32").max) * (1.1 + 1j), "complex128"), + ("float64", 1 + 1j, "complex128"), + ("float64", float(np.finfo("float32").max) * (1.1 + 1j), "complex128"), + # complex filled with complex + ("complex64", 1 + 1j, "complex64"), + ("complex64", float(np.finfo("float32").max) * (1.1 + 1j), "complex128"), + ("complex128", 1 + 1j, "complex128"), + ("complex128", float(np.finfo("float32").max) * (1.1 + 1j), "complex128"), + ], +) +def test_maybe_promote_float_with_float(dtype, fill_value, expected_dtype): + dtype = np.dtype(dtype) + expected_dtype = np.dtype(expected_dtype) + + # output is not a generic float, but corresponds to expected_dtype + exp_val_for_scalar = np.array([fill_value], dtype=expected_dtype)[0] + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_bool_with_any(any_numpy_dtype): + dtype = np.dtype(bool) + fill_dtype = np.dtype(any_numpy_dtype) + + # create array of given dtype; casts "1" to correct dtype + fill_value = np.array([1], dtype=fill_dtype)[0] + + # filling bool with anything but bool casts to object + expected_dtype = np.dtype(object) if fill_dtype != bool else fill_dtype + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_any_with_bool(any_numpy_dtype): + dtype = np.dtype(any_numpy_dtype) + fill_value = True + + # filling anything but bool with bool casts to object + expected_dtype = np.dtype(object) if dtype != bool else dtype + # output is not a generic bool, but corresponds to expected_dtype + exp_val_for_scalar = np.array([fill_value], dtype=expected_dtype)[0] + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_bytes_with_any(bytes_dtype, any_numpy_dtype): + dtype = np.dtype(bytes_dtype) + fill_dtype = np.dtype(any_numpy_dtype) + + # create array of given dtype; casts "1" to correct dtype + fill_value = np.array([1], dtype=fill_dtype)[0] + + # we never use bytes dtype internally, always promote to object + expected_dtype = np.dtype(np.object_) + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_any_with_bytes(any_numpy_dtype): + dtype = np.dtype(any_numpy_dtype) + + # create array of given dtype + fill_value = b"abc" + + # we never use bytes dtype internally, always promote to object + expected_dtype = np.dtype(np.object_) + # output is not a generic bytes, but corresponds to expected_dtype + exp_val_for_scalar = np.array([fill_value], dtype=expected_dtype)[0] + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_datetime64_with_any(datetime64_dtype, any_numpy_dtype): + dtype = np.dtype(datetime64_dtype) + fill_dtype = np.dtype(any_numpy_dtype) + + # create array of given dtype; casts "1" to correct dtype + fill_value = np.array([1], dtype=fill_dtype)[0] + + # filling datetime with anything but datetime casts to object + if fill_dtype.kind == "M": + expected_dtype = dtype + # for datetime dtypes, scalar values get cast to to_datetime64 + exp_val_for_scalar = pd.Timestamp(fill_value).to_datetime64() + else: + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +@pytest.mark.parametrize( + "fill_value", + [ + pd.Timestamp("now"), + np.datetime64("now"), + datetime.datetime.now(), + datetime.date.today(), + ], + ids=["pd.Timestamp", "np.datetime64", "datetime.datetime", "datetime.date"], +) +def test_maybe_promote_any_with_datetime64(any_numpy_dtype, fill_value): + dtype = np.dtype(any_numpy_dtype) + + # filling datetime with anything but datetime casts to object + if dtype.kind == "M": + expected_dtype = dtype + # for datetime dtypes, scalar values get cast to pd.Timestamp.value + exp_val_for_scalar = pd.Timestamp(fill_value).to_datetime64() + else: + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + + if type(fill_value) is datetime.date and dtype.kind == "M": + # Casting date to dt64 is deprecated, in 2.0 enforced to cast to object + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +@pytest.mark.parametrize( + "fill_value", + [ + pd.Timestamp(2023, 1, 1), + np.datetime64("2023-01-01"), + datetime.datetime(2023, 1, 1), + datetime.date(2023, 1, 1), + ], + ids=["pd.Timestamp", "np.datetime64", "datetime.datetime", "datetime.date"], +) +def test_maybe_promote_any_numpy_dtype_with_datetimetz( + any_numpy_dtype, tz_aware_fixture, fill_value +): + dtype = np.dtype(any_numpy_dtype) + fill_dtype = DatetimeTZDtype(tz=tz_aware_fixture) + + fill_value = pd.Series([fill_value], dtype=fill_dtype)[0] + + # filling any numpy dtype with datetimetz casts to object + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_timedelta64_with_any(timedelta64_dtype, any_numpy_dtype): + dtype = np.dtype(timedelta64_dtype) + fill_dtype = np.dtype(any_numpy_dtype) + + # create array of given dtype; casts "1" to correct dtype + fill_value = np.array([1], dtype=fill_dtype)[0] + + # filling timedelta with anything but timedelta casts to object + if fill_dtype.kind == "m": + expected_dtype = dtype + # for timedelta dtypes, scalar values get cast to pd.Timedelta.value + exp_val_for_scalar = pd.Timedelta(fill_value).to_timedelta64() + else: + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +@pytest.mark.parametrize( + "fill_value", + [pd.Timedelta(days=1), np.timedelta64(24, "h"), datetime.timedelta(1)], + ids=["pd.Timedelta", "np.timedelta64", "datetime.timedelta"], +) +def test_maybe_promote_any_with_timedelta64(any_numpy_dtype, fill_value): + dtype = np.dtype(any_numpy_dtype) + + # filling anything but timedelta with timedelta casts to object + if dtype.kind == "m": + expected_dtype = dtype + # for timedelta dtypes, scalar values get cast to pd.Timedelta.value + exp_val_for_scalar = pd.Timedelta(fill_value).to_timedelta64() + else: + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_string_with_any(string_dtype, any_numpy_dtype): + dtype = np.dtype(string_dtype) + fill_dtype = np.dtype(any_numpy_dtype) + + # create array of given dtype; casts "1" to correct dtype + fill_value = np.array([1], dtype=fill_dtype)[0] + + # filling string with anything casts to object + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_any_with_string(any_numpy_dtype): + dtype = np.dtype(any_numpy_dtype) + + # create array of given dtype + fill_value = "abc" + + # filling anything with a string casts to object + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_object_with_any(object_dtype, any_numpy_dtype): + dtype = np.dtype(object_dtype) + fill_dtype = np.dtype(any_numpy_dtype) + + # create array of given dtype; casts "1" to correct dtype + fill_value = np.array([1], dtype=fill_dtype)[0] + + # filling object with anything stays object + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_any_with_object(any_numpy_dtype): + dtype = np.dtype(any_numpy_dtype) + + # create array of object dtype from a scalar value (i.e. passing + # dtypes.common.is_scalar), which can however not be cast to int/float etc. + fill_value = pd.DateOffset(1) + + # filling object with anything stays object + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) + + +def test_maybe_promote_any_numpy_dtype_with_na(any_numpy_dtype, nulls_fixture): + fill_value = nulls_fixture + dtype = np.dtype(any_numpy_dtype) + + if isinstance(fill_value, Decimal): + # Subject to change, but ATM (When Decimal(NAN) is being added to nulls_fixture) + # this is the existing behavior in maybe_promote, + # hinges on is_valid_na_for_dtype + if dtype.kind in "iufc": + if dtype.kind in "iu": + expected_dtype = np.dtype(np.float64) + else: + expected_dtype = dtype + exp_val_for_scalar = np.nan + else: + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + elif dtype.kind in "iu" and fill_value is not NaT: + # integer + other missing value (np.nan / None) casts to float + expected_dtype = np.float64 + exp_val_for_scalar = np.nan + elif dtype == object and fill_value is NaT: + # inserting into object does not cast the value + # but *does* cast None to np.nan + expected_dtype = np.dtype(object) + exp_val_for_scalar = fill_value + elif dtype.kind in "mM": + # datetime / timedelta cast all missing values to dtyped-NaT + expected_dtype = dtype + exp_val_for_scalar = dtype.type("NaT", "ns") + elif fill_value is NaT: + # NaT upcasts everything that's not datetime/timedelta to object + expected_dtype = np.dtype(object) + exp_val_for_scalar = NaT + elif dtype.kind in "fc": + # float / complex + missing value (!= NaT) stays the same + expected_dtype = dtype + exp_val_for_scalar = np.nan + else: + # all other cases cast to object, and use np.nan as missing value + expected_dtype = np.dtype(object) + if fill_value is pd.NA: + exp_val_for_scalar = pd.NA + else: + exp_val_for_scalar = np.nan + + _check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar) diff --git a/shared/package-files/07/078bbe4401a4716779321a0f7983a5992ed2bc641a42b562d12c2b11c38a1423/blob b/shared/package-files/07/078bbe4401a4716779321a0f7983a5992ed2bc641a42b562d12c2b11c38a1423/blob new file mode 100644 index 0000000000000000000000000000000000000000..6597c946b57d8044caeb94ef199a8b7a030da380 --- /dev/null +++ b/shared/package-files/07/078bbe4401a4716779321a0f7983a5992ed2bc641a42b562d12c2b11c38a1423/blob @@ -0,0 +1,20 @@ +from IPython.core.error import TryNext +from IPython.lib.clipboard import ClipboardEmpty +from IPython.testing.decorators import skip_if_no_x11 + + +@skip_if_no_x11 +def test_clipboard_get(): + # Smoketest for clipboard access - we can't easily guarantee that the + # clipboard is accessible and has something on it, but this tries to + # exercise the relevant code anyway. + try: + a = get_ipython().hooks.clipboard_get() + except ClipboardEmpty: + # Nothing in clipboard to get + pass + except TryNext: + # No clipboard access API available + pass + else: + assert isinstance(a, str) diff --git a/shared/package-files/07/078c6634721d62555dac52359f98e2d7fa9961d55caff4967005fa0a4fd9367b/blob b/shared/package-files/07/078c6634721d62555dac52359f98e2d7fa9961d55caff4967005fa0a4fd9367b/blob new file mode 100644 index 0000000000000000000000000000000000000000..44b3eb64523c9cda2e94d71dfb5e37d2333047ad --- /dev/null +++ b/shared/package-files/07/078c6634721d62555dac52359f98e2d7fa9961d55caff4967005fa0a4fd9367b/blob @@ -0,0 +1,355 @@ +from __future__ import annotations + +import warnings +from dataclasses import dataclass, field + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + + +@dataclass(slots=True) +class InputTags: + """Tags for the input data. + + Parameters + ---------- + one_d_array : bool, default=False + Whether the input can be a 1D array. + + two_d_array : bool, default=True + Whether the input can be a 2D array. Note that most common + tests currently run only if this flag is set to ``True``. + + three_d_array : bool, default=False + Whether the input can be a 3D array. + + sparse : bool, default=False + Whether the input can be a sparse matrix. + + categorical : bool, default=False + Whether the input can be categorical. + + string : bool, default=False + Whether the input can be an array-like of strings. + + dict : bool, default=False + Whether the input can be a dictionary. + + positive_only : bool, default=False + Whether the estimator requires positive X. + + allow_nan : bool, default=False + Whether the estimator supports data with missing values encoded as `np.nan`. + + pairwise : bool, default=False + This boolean attribute indicates whether the data (`X`), + :term:`fit` and similar methods consists of pairwise measures + over samples rather than a feature representation for each + sample. It is usually `True` where an estimator has a + `metric` or `affinity` or `kernel` parameter with value + 'precomputed'. Its primary purpose is to support a + :term:`meta-estimator` or a cross validation procedure that + extracts a sub-sample of data intended for a pairwise + estimator, where the data needs to be indexed on both axes. + Specifically, this tag is used by + `sklearn.utils.metaestimators._safe_split` to slice rows and + columns. + + Note that if setting this tag to ``True`` means the estimator can take only + positive values, the `positive_only` tag must reflect it and also be set to + ``True``. + """ + + one_d_array: bool = False + two_d_array: bool = True + three_d_array: bool = False + sparse: bool = False + categorical: bool = False + string: bool = False + dict: bool = False + positive_only: bool = False + allow_nan: bool = False + pairwise: bool = False + + +@dataclass(slots=True) +class TargetTags: + """Tags for the target data. + + Parameters + ---------- + required : bool + Whether the estimator requires y to be passed to `fit`, + `fit_predict` or `fit_transform` methods. The tag is ``True`` + for estimators inheriting from `~sklearn.base.RegressorMixin` + and `~sklearn.base.ClassifierMixin`. + + one_d_labels : bool, default=False + Whether the input is a 1D labels (y). + + two_d_labels : bool, default=False + Whether the input is a 2D labels (y). + + positive_only : bool, default=False + Whether the estimator requires a positive y (only applicable + for regression). + + multi_output : bool, default=False + Whether a regressor supports multi-target outputs or a classifier supports + multi-class multi-output. + + See :term:`multi-output` in the glossary. + + single_output : bool, default=True + Whether the target can be single-output. This can be ``False`` if the + estimator supports only multi-output cases. + """ + + required: bool + one_d_labels: bool = False + two_d_labels: bool = False + positive_only: bool = False + multi_output: bool = False + single_output: bool = True + + +@dataclass(slots=True) +class TransformerTags: + """Tags for the transformer. + + Parameters + ---------- + preserves_dtype : list[str], default=["float64"] + Applies only on transformers. It corresponds to the data types + which will be preserved such that `X_trans.dtype` is the same + as `X.dtype` after calling `transformer.transform(X)`. If this + list is empty, then the transformer is not expected to + preserve the data type. The first value in the list is + considered as the default data type, corresponding to the data + type of the output when the input data type is not going to be + preserved. + """ + + preserves_dtype: list[str] = field(default_factory=lambda: ["float64"]) + + +@dataclass(slots=True) +class ClassifierTags: + """Tags for the classifier. + + Parameters + ---------- + poor_score : bool, default=False + Whether the estimator fails to provide a "reasonable" test-set + score, which currently for classification is an accuracy of + 0.83 on ``make_blobs(n_samples=300, random_state=0)``. The + datasets and values are based on current estimators in scikit-learn + and might be replaced by something more systematic. + + multi_class : bool, default=True + Whether the classifier can handle multi-class + classification. Note that all classifiers support binary + classification. Therefore this flag indicates whether the + classifier is a binary-classifier-only or not. + + See :term:`multi-class` in the glossary. + + multi_label : bool, default=False + Whether the classifier supports multi-label output: a data point can + be predicted to belong to a variable number of classes. + + See :term:`multi-label` in the glossary. + """ + + poor_score: bool = False + multi_class: bool = True + multi_label: bool = False + + +@dataclass(slots=True) +class RegressorTags: + """Tags for the regressor. + + Parameters + ---------- + poor_score : bool, default=False + Whether the estimator fails to provide a "reasonable" test-set + score, which currently for regression is an R2 of 0.5 on + ``make_regression(n_samples=200, n_features=10, + n_informative=1, bias=5.0, noise=20, random_state=42)``. The + dataset and values are based on current estimators in scikit-learn + and might be replaced by something more systematic. + """ + + poor_score: bool = False + + +@dataclass(slots=True) +class Tags: + """Tags for the estimator. + + See :ref:`estimator_tags` for more information. + + Parameters + ---------- + estimator_type : str or None + The type of the estimator. Can be one of: + - "classifier" + - "regressor" + - "transformer" + - "clusterer" + - "outlier_detector" + - "density_estimator" + + target_tags : :class:`TargetTags` + The target(y) tags. + + transformer_tags : :class:`TransformerTags` or None + The transformer tags. + + classifier_tags : :class:`ClassifierTags` or None + The classifier tags. + + regressor_tags : :class:`RegressorTags` or None + The regressor tags. + + array_api_support : bool, default=False + Whether the estimator supports Array API compatible inputs. + + no_validation : bool, default=False + Whether the estimator skips input-validation. This is only meant for + stateless and dummy transformers! + + non_deterministic : bool, default=False + Whether the estimator is not deterministic given a fixed ``random_state``. + + requires_fit : bool, default=True + Whether the estimator requires to be fitted before calling one of + `transform`, `predict`, `predict_proba`, or `decision_function`. + + _skip_test : bool, default=False + Whether to skip common tests entirely. Don't use this unless + you have a *very good* reason. + + input_tags : :class:`InputTags` + The input data(X) tags. + """ + + estimator_type: str | None + target_tags: TargetTags + transformer_tags: TransformerTags | None = None + classifier_tags: ClassifierTags | None = None + regressor_tags: RegressorTags | None = None + array_api_support: bool = False + no_validation: bool = False + non_deterministic: bool = False + requires_fit: bool = True + _skip_test: bool = False + input_tags: InputTags = field(default_factory=InputTags) + + +# TODO(1.8): Remove this function +def default_tags(estimator) -> Tags: + """Get the default tags for an estimator. + + This ignores any ``__sklearn_tags__`` method that the estimator may have. + + If the estimator is a classifier or a regressor, ``target_tags.required`` + will be set to ``True``, otherwise it will be set to ``False``. + + ``transformer_tags`` will be set to :class:`~.sklearn.utils. TransformerTags` if the + estimator has a ``transform`` or ``fit_transform`` method, otherwise it will be set + to ``None``. + + ``classifier_tags`` will be set to :class:`~.sklearn.utils.ClassifierTags` if the + estimator is a classifier, otherwise it will be set to ``None``. + a classifier, otherwise it will be set to ``None``. + + ``regressor_tags`` will be set to :class:`~.sklearn.utils.RegressorTags` if the + estimator is a regressor, otherwise it will be set to ``None``. + + Parameters + ---------- + estimator : estimator object + The estimator for which to get the default tags. + + Returns + ------- + tags : Tags + The default tags for the estimator. + """ + est_is_classifier = getattr(estimator, "_estimator_type", None) == "classifier" + est_is_regressor = getattr(estimator, "_estimator_type", None) == "regressor" + target_required = est_is_classifier or est_is_regressor + + return Tags( + estimator_type=getattr(estimator, "_estimator_type", None), + target_tags=TargetTags(required=target_required), + transformer_tags=( + TransformerTags() + if hasattr(estimator, "transform") or hasattr(estimator, "fit_transform") + else None + ), + classifier_tags=ClassifierTags() if est_is_classifier else None, + regressor_tags=RegressorTags() if est_is_regressor else None, + ) + + +def get_tags(estimator) -> Tags: + """Get estimator tags. + + :class:`~sklearn.BaseEstimator` provides the estimator tags machinery. + However, if an estimator does not inherit from this base class, we should + fall-back to the default tags. + + For scikit-learn built-in estimators, we should still rely on + `self.__sklearn_tags__()`. `get_tags(est)` should be used when we + are not sure where `est` comes from: typically + `get_tags(self.estimator)` where `self` is a meta-estimator, or in + the common checks. + + .. versionadded:: 1.6 + + Parameters + ---------- + estimator : estimator object + The estimator from which to get the tag. + + Returns + ------- + tags : :class:`~.sklearn.utils.Tags` + The estimator tags. + """ + + try: + tags = estimator.__sklearn_tags__() + except AttributeError as exc: + # TODO(1.8): turn the warning into an error + if "object has no attribute '__sklearn_tags__'" in str(exc): + # Fall back to the default tags if the estimator does not + # implement __sklearn_tags__. + # In particular, workaround the regression reported in + # https://github.com/scikit-learn/scikit-learn/issues/30479 + # `__sklearn_tags__` is implemented by calling + # `super().__sklearn_tags__()` but there is no `__sklearn_tags__` + # method in the base class. Typically happens when only inheriting + # from Mixins. + + warnings.warn( + f"The following error was raised: {exc}. It seems that " + "there are no classes that implement `__sklearn_tags__` " + "in the MRO and/or all classes in the MRO call " + "`super().__sklearn_tags__()`. Make sure to inherit from " + "`BaseEstimator` which implements `__sklearn_tags__` (or " + "alternatively define `__sklearn_tags__` but we don't recommend " + "this approach). Note that `BaseEstimator` needs to be on the " + "right side of other Mixins in the inheritance order. The " + "default are now used instead since retrieving tags failed. " + "This warning will be replaced by an error in 1.8.", + category=DeprecationWarning, + ) + tags = default_tags(estimator) + else: + raise + + return tags diff --git a/shared/package-files/07/078cdbfea9732a0099d240929ffd1f1fa0fd25e4280cee75335d9500e3cb275c/blob b/shared/package-files/07/078cdbfea9732a0099d240929ffd1f1fa0fd25e4280cee75335d9500e3cb275c/blob new file mode 100644 index 0000000000000000000000000000000000000000..6cc719c973ec0d2d3e9a38e95f79548da8caef34 --- /dev/null +++ b/shared/package-files/07/078cdbfea9732a0099d240929ffd1f1fa0fd25e4280cee75335d9500e3cb275c/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API multilabel_margin_loss_backward_grad_input { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, const at::Tensor &, int64_t, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::multilabel_margin_loss_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "grad_input") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "multilabel_margin_loss_backward.grad_input(Tensor grad_output, Tensor self, Tensor target, int reduction, Tensor is_target, *, Tensor(a!) grad_input) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, const at::Tensor & is_target, at::Tensor & grad_input); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, const at::Tensor & is_target, at::Tensor & grad_input); +}; + +struct TORCH_API multilabel_margin_loss_backward { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Tensor &, int64_t, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::multilabel_margin_loss_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "multilabel_margin_loss_backward(Tensor grad_output, Tensor self, Tensor target, int reduction, Tensor is_target) -> Tensor") + static at::Tensor call(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, const at::Tensor & is_target); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, const at::Tensor & is_target); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/07/078d414c65ea5f34da905b290d32d9a4da4656f16cb7b22282795120b7d8b039/blob b/shared/package-files/07/078d414c65ea5f34da905b290d32d9a4da4656f16cb7b22282795120b7d8b039/blob new file mode 100644 index 0000000000000000000000000000000000000000..e8275063e038266cf3893c83ba2a552de2723c8c --- /dev/null +++ b/shared/package-files/07/078d414c65ea5f34da905b290d32d9a4da4656f16cb7b22282795120b7d8b039/blob @@ -0,0 +1,209 @@ +from typing import List, Optional, Tuple + +from torch.distributed._shard.metadata import ShardMetadata + + +def _check_shard_metadata_pair_overlap(shard1: ShardMetadata, shard2: ShardMetadata): + """ + Checks if two shards overlap. + """ + + # For each dim of each shard, check if one shard resides on the other + # end of second shard with respect to that dim. As an example for a 2D + # shard, we would check if one shard is above or on the left of the + # other shard. + ndims = len(shard1.shard_offsets) + for i in range(ndims): + if shard1.shard_offsets[i] >= shard2.shard_offsets[i] + shard2.shard_sizes[i]: + return False + if shard2.shard_offsets[i] >= shard1.shard_offsets[i] + shard1.shard_sizes[i]: + return False + + return True + + +def _find_nd_overlapping_shards( + shards: List[ShardMetadata], sharded_dims: List[int] +) -> Optional[Tuple[int, int]]: + # Each rank has len(sharded_dims) tuples. Each tuple represent the + # [begin, end] (inclusive) pair of that dimension. + shard_intervals = [ + [ + (s.shard_offsets[dim], s.shard_offsets[dim] + s.shard_sizes[dim] - 1) + for dim in sharded_dims + ] + for s in shards + ] + + for i in range(len(shards)): + shard_i = shard_intervals[i] + for j in range(i + 1, len(shards)): + shard_j = shard_intervals[j] + # For each dim of each shard, check if one shard resides on the other + # end of second shard with respect to that dim. As an example for a 2D + # shard, we would check if one shard is above or on the left of the + # other shard. + overlap = True + for interval_i, interval_j in zip(shard_i, shard_j): + if interval_i[0] > interval_j[1] or interval_j[0] > interval_i[1]: + overlap = False + break + if overlap: + return (i, j) + return None + + +def _find_1d_overlapping_shards( + shards: List[ShardMetadata], dim: int +) -> Optional[Tuple[int, int]]: + # (begin, end, index_in_shards). Begin and end are inclusive. + intervals = [ + (s.shard_offsets[dim], s.shard_offsets[dim] + s.shard_sizes[dim] - 1, i) + for i, s in enumerate(shards) + ] + intervals.sort() + for i in range(len(shards) - 1): + if intervals[i][1] >= intervals[i + 1][0]: + return (intervals[i][2], intervals[i + 1][2]) + return None + + +def validate_non_overlapping_shards_metadata(shards: List[ShardMetadata]): + """ + Ensures none of the shards overlap with each other. + + Args: + shards(List[ShardMetadata]): List of :class:`ShardMetadata` objects representing + each shard. + Raises: + ``ValueError`` if there's overlap in any two shards. + """ + if not shards or len(shards) == 1: + return + + sharded_dims: List[int] = [] + for dim in range(len(shards[0].shard_offsets)): + for i in range(1, len(shards)): + if ( + shards[i].shard_offsets[dim] != shards[0].shard_offsets[dim] or + shards[i].shard_sizes[dim] != shards[0].shard_sizes[dim] + ): + sharded_dims.append(dim) + break + + pair: Optional[Tuple[int, int]] = None + if len(sharded_dims) == 0: + # All shards are the same, all dims are not partitioned. Choose any 2. + pair = (0, 1) + elif len(sharded_dims) == 1: + # Shards are partitioned over only one dimension. Overlap can be found + # using a O(nlogn) overlapping interval algorithm. + pair = _find_1d_overlapping_shards(shards, sharded_dims[0]) + else: + # Shards are partitioned over more than one dimension. Fall back to + # pair-wise check. Even though O(nlogn) algorithms (line sweep) exist + # for 2D overlap, the implementation is not trivial and may not justify + # the time saving in most cases. + pair = _find_nd_overlapping_shards(shards, sharded_dims) + + if pair: + raise ValueError(f'Shards {shards[pair[0]]} and {shards[pair[1]]} overlap') + + +def check_tensor(shards_metadata, tensor_dims) -> None: + """ + Checks if the shards_metadata is compatible with the provided tensor dims. + + Args: + shards_metadata(List[ShardMetadata]): List of :class:`ShardMetadata` + objects representing each shard of the tensor. + tensor_dims(Sequence of int): Dimensions of tensor to verify + Raises: + ``ValueError`` if not compatible. + """ + + # If the tensor's volume matches the total volume of all shards and + # all shard boundaries are within tensor dims, we have a compatible + # sharding spec for this tensor. Note that we have already verified + # we don't have overlapping shards. + tensor_rank = len(tensor_dims) + shards_rank = len(shards_metadata[0].shard_offsets) + if tensor_rank != shards_rank: + raise ValueError(f'Rank of tensor is {tensor_rank}, but shards rank is {shards_rank}') + + total_shard_volume = 0 + for shard in shards_metadata: + shard_volume = 1 + for i, shard_length in enumerate(shard.shard_sizes): + shard_volume *= shard_length + if shard.shard_offsets[i] + shard.shard_sizes[i] > tensor_dims[i]: + raise ValueError( + f'Shard offset {shard.shard_offsets[i]} and length ' + f'{shard.shard_sizes[i]} exceeds tensor dim: {tensor_dims[i]} for shard {shard}') + total_shard_volume += shard_volume + + tensor_volume = 1 + for size in tensor_dims: + tensor_volume *= size + + if total_shard_volume != tensor_volume: + # TODO: Can we improve this error message to point out the gaps? + raise ValueError( + f'Total volume of shards: {total_shard_volume} ' + f'does not match tensor volume: {tensor_volume}, in other words ' + f'all the individual shards do not cover the entire tensor') + +def get_split_size(dim_size, chunks): + """ + Computes the split size inline with ``torch.chunk`` + + Args: + dim_size(int): Size of the dimension being chunked. + chunks(int): Number of chunks to create for ``dim_size``. + + Returns: + An int indicating the split size to use. + """ + return (dim_size + chunks - 1) // chunks + +def get_chunked_dim_size(dim_size, split_size, idx): + """ + Computes the dim size of the chunk for provided ``idx`` given ``dim_size`` + and ``split_size``. + + Args: + dim_size(int): Size of the dimension being chunked. + split_size(int): The chunk size for each chunk of ``dim_size``. + idx(int): The index of chunk whose dim size is being requested. + + Returns: + An int indicating the dim size of the chunk. + """ + return max(min(dim_size, split_size * (idx + 1)) - split_size * idx, 0) + +def get_chunk_sharding_params(sharding_dim_size, world_size, spec, rank): + """ + Generate the start pos and offset length for the current rank for + chunk sharding. + + Args: + sharding_dim_size(int): The dimension length which we shard on. + world_size(int): number of ranks. + spec (:class:`torch.distributed._shard.sharding_spec.ChunkShardingSpec`): + sharding spec. + rank(int): # of cuda process. + + Returns: + start_pos(int): start position of sharded tensor on the given rank. + chunk_size(int): chunk size of sharded tensor on the given rank. + """ + split_size = get_split_size(sharding_dim_size, world_size) + current_offsets = 0 + start_pos = current_offsets + for idx, placement in enumerate(spec.placements): + chunk_size = get_chunked_dim_size(sharding_dim_size, split_size, idx) + if rank == placement.rank(): + start_pos = current_offsets + break + current_offsets += chunk_size + return start_pos, chunk_size # type: ignore[possibly-undefined] diff --git a/shared/package-files/07/079195655f54c4a78e99be25cc91c39105d16d64222cb0fbc3b65edec0eb5874/blob b/shared/package-files/07/079195655f54c4a78e99be25cc91c39105d16d64222cb0fbc3b65edec0eb5874/blob new file mode 100644 index 0000000000000000000000000000000000000000..a8428d4faf7cecea3cb8900b9cb0af09ddc0e336 --- /dev/null +++ b/shared/package-files/07/079195655f54c4a78e99be25cc91c39105d16d64222cb0fbc3b65edec0eb5874/blob @@ -0,0 +1,347 @@ +from sympy.concrete.summations import Sum +from sympy.core.mod import Mod +from sympy.core.relational import (Equality, Unequality) +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.functions.elementary.piecewise import Piecewise +from sympy.matrices.expressions.blockmatrix import BlockMatrix +from sympy.matrices.expressions.matexpr import MatrixSymbol +from sympy.matrices.expressions.special import Identity +from sympy.utilities.lambdify import lambdify + +from sympy.abc import x, i, j, a, b, c, d +from sympy.core import Pow +from sympy.codegen.matrix_nodes import MatrixSolve +from sympy.codegen.numpy_nodes import logaddexp, logaddexp2 +from sympy.codegen.cfunctions import log1p, expm1, hypot, log10, exp2, log2, Sqrt +from sympy.tensor.array import Array +from sympy.tensor.array.expressions.array_expressions import ArrayTensorProduct, ArrayAdd, \ + PermuteDims, ArrayDiagonal +from sympy.printing.numpy import JaxPrinter, _jax_known_constants, _jax_known_functions +from sympy.tensor.array.expressions.from_matrix_to_array import convert_matrix_to_array + +from sympy.testing.pytest import skip, raises +from sympy.external import import_module + +# Unlike NumPy which will aggressively promote operands to double precision, +# jax always uses single precision. Double precision in jax can be +# configured before the call to `import jax`, however this must be explicitly +# configured and is not fully supported. Thus, the tests here have been modified +# from the tests in test_numpy.py, only in the fact that they assert lambdify +# function accuracy to only single precision accuracy. +# https://jax.readthedocs.io/en/latest/notebooks/Common_Gotchas_in_JAX.html#double-64bit-precision + +jax = import_module('jax') + +if jax: + deafult_float_info = jax.numpy.finfo(jax.numpy.array([]).dtype) + JAX_DEFAULT_EPSILON = deafult_float_info.eps + +def test_jax_piecewise_regression(): + """ + NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid + breaking compatibility with numpy 1.8. This is not necessary in numpy 1.9+. + See gh-9747 and gh-9749 for details. + """ + printer = JaxPrinter() + p = Piecewise((1, x < 0), (0, True)) + assert printer.doprint(p) == \ + 'jax.numpy.select([jax.numpy.less(x, 0),True], [1,0], default=jax.numpy.nan)' + assert printer.module_imports == {'jax.numpy': {'select', 'less', 'nan'}} + + +def test_jax_logaddexp(): + lae = logaddexp(a, b) + assert JaxPrinter().doprint(lae) == 'jax.numpy.logaddexp(a, b)' + lae2 = logaddexp2(a, b) + assert JaxPrinter().doprint(lae2) == 'jax.numpy.logaddexp2(a, b)' + + +def test_jax_sum(): + if not jax: + skip("JAX not installed") + + s = Sum(x ** i, (i, a, b)) + f = lambdify((a, b, x), s, 'jax') + + a_, b_ = 0, 10 + x_ = jax.numpy.linspace(-1, +1, 10) + assert jax.numpy.allclose(f(a_, b_, x_), sum(x_ ** i_ for i_ in range(a_, b_ + 1))) + + s = Sum(i * x, (i, a, b)) + f = lambdify((a, b, x), s, 'jax') + + a_, b_ = 0, 10 + x_ = jax.numpy.linspace(-1, +1, 10) + assert jax.numpy.allclose(f(a_, b_, x_), sum(i_ * x_ for i_ in range(a_, b_ + 1))) + + +def test_jax_multiple_sums(): + if not jax: + skip("JAX not installed") + + s = Sum((x + j) * i, (i, a, b), (j, c, d)) + f = lambdify((a, b, c, d, x), s, 'jax') + + a_, b_ = 0, 10 + c_, d_ = 11, 21 + x_ = jax.numpy.linspace(-1, +1, 10) + assert jax.numpy.allclose(f(a_, b_, c_, d_, x_), + sum((x_ + j_) * i_ for i_ in range(a_, b_ + 1) for j_ in range(c_, d_ + 1))) + + +def test_jax_codegen_einsum(): + if not jax: + skip("JAX not installed") + + M = MatrixSymbol("M", 2, 2) + N = MatrixSymbol("N", 2, 2) + + cg = convert_matrix_to_array(M * N) + f = lambdify((M, N), cg, 'jax') + + ma = jax.numpy.array([[1, 2], [3, 4]]) + mb = jax.numpy.array([[1,-2], [-1, 3]]) + assert (f(ma, mb) == jax.numpy.matmul(ma, mb)).all() + + +def test_jax_codegen_extra(): + if not jax: + skip("JAX not installed") + + M = MatrixSymbol("M", 2, 2) + N = MatrixSymbol("N", 2, 2) + P = MatrixSymbol("P", 2, 2) + Q = MatrixSymbol("Q", 2, 2) + ma = jax.numpy.array([[1, 2], [3, 4]]) + mb = jax.numpy.array([[1,-2], [-1, 3]]) + mc = jax.numpy.array([[2, 0], [1, 2]]) + md = jax.numpy.array([[1,-1], [4, 7]]) + + cg = ArrayTensorProduct(M, N) + f = lambdify((M, N), cg, 'jax') + assert (f(ma, mb) == jax.numpy.einsum(ma, [0, 1], mb, [2, 3])).all() + + cg = ArrayAdd(M, N) + f = lambdify((M, N), cg, 'jax') + assert (f(ma, mb) == ma+mb).all() + + cg = ArrayAdd(M, N, P) + f = lambdify((M, N, P), cg, 'jax') + assert (f(ma, mb, mc) == ma+mb+mc).all() + + cg = ArrayAdd(M, N, P, Q) + f = lambdify((M, N, P, Q), cg, 'jax') + assert (f(ma, mb, mc, md) == ma+mb+mc+md).all() + + cg = PermuteDims(M, [1, 0]) + f = lambdify((M,), cg, 'jax') + assert (f(ma) == ma.T).all() + + cg = PermuteDims(ArrayTensorProduct(M, N), [1, 2, 3, 0]) + f = lambdify((M, N), cg, 'jax') + assert (f(ma, mb) == jax.numpy.transpose(jax.numpy.einsum(ma, [0, 1], mb, [2, 3]), (1, 2, 3, 0))).all() + + cg = ArrayDiagonal(ArrayTensorProduct(M, N), (1, 2)) + f = lambdify((M, N), cg, 'jax') + assert (f(ma, mb) == jax.numpy.diagonal(jax.numpy.einsum(ma, [0, 1], mb, [2, 3]), axis1=1, axis2=2)).all() + + +def test_jax_relational(): + if not jax: + skip("JAX not installed") + + e = Equality(x, 1) + + f = lambdify((x,), e, 'jax') + x_ = jax.numpy.array([0, 1, 2]) + assert jax.numpy.array_equal(f(x_), [False, True, False]) + + e = Unequality(x, 1) + + f = lambdify((x,), e, 'jax') + x_ = jax.numpy.array([0, 1, 2]) + assert jax.numpy.array_equal(f(x_), [True, False, True]) + + e = (x < 1) + + f = lambdify((x,), e, 'jax') + x_ = jax.numpy.array([0, 1, 2]) + assert jax.numpy.array_equal(f(x_), [True, False, False]) + + e = (x <= 1) + + f = lambdify((x,), e, 'jax') + x_ = jax.numpy.array([0, 1, 2]) + assert jax.numpy.array_equal(f(x_), [True, True, False]) + + e = (x > 1) + + f = lambdify((x,), e, 'jax') + x_ = jax.numpy.array([0, 1, 2]) + assert jax.numpy.array_equal(f(x_), [False, False, True]) + + e = (x >= 1) + + f = lambdify((x,), e, 'jax') + x_ = jax.numpy.array([0, 1, 2]) + assert jax.numpy.array_equal(f(x_), [False, True, True]) + + # Multi-condition expressions + e = (x >= 1) & (x < 2) + f = lambdify((x,), e, 'jax') + x_ = jax.numpy.array([0, 1, 2]) + assert jax.numpy.array_equal(f(x_), [False, True, False]) + + e = (x >= 1) | (x < 2) + f = lambdify((x,), e, 'jax') + x_ = jax.numpy.array([0, 1, 2]) + assert jax.numpy.array_equal(f(x_), [True, True, True]) + +def test_jax_mod(): + if not jax: + skip("JAX not installed") + + e = Mod(a, b) + f = lambdify((a, b), e, 'jax') + + a_ = jax.numpy.array([0, 1, 2, 3]) + b_ = 2 + assert jax.numpy.array_equal(f(a_, b_), [0, 1, 0, 1]) + + a_ = jax.numpy.array([0, 1, 2, 3]) + b_ = jax.numpy.array([2, 2, 2, 2]) + assert jax.numpy.array_equal(f(a_, b_), [0, 1, 0, 1]) + + a_ = jax.numpy.array([2, 3, 4, 5]) + b_ = jax.numpy.array([2, 3, 4, 5]) + assert jax.numpy.array_equal(f(a_, b_), [0, 0, 0, 0]) + + +def test_jax_pow(): + if not jax: + skip('JAX not installed') + + expr = Pow(2, -1, evaluate=False) + f = lambdify([], expr, 'jax') + assert f() == 0.5 + + +def test_jax_expm1(): + if not jax: + skip("JAX not installed") + + f = lambdify((a,), expm1(a), 'jax') + assert abs(f(1e-10) - 1e-10 - 5e-21) <= 1e-10 * JAX_DEFAULT_EPSILON + + +def test_jax_log1p(): + if not jax: + skip("JAX not installed") + + f = lambdify((a,), log1p(a), 'jax') + assert abs(f(1e-99) - 1e-99) <= 1e-99 * JAX_DEFAULT_EPSILON + +def test_jax_hypot(): + if not jax: + skip("JAX not installed") + assert abs(lambdify((a, b), hypot(a, b), 'jax')(3, 4) - 5) <= JAX_DEFAULT_EPSILON + +def test_jax_log10(): + if not jax: + skip("JAX not installed") + + assert abs(lambdify((a,), log10(a), 'jax')(100) - 2) <= JAX_DEFAULT_EPSILON + + +def test_jax_exp2(): + if not jax: + skip("JAX not installed") + assert abs(lambdify((a,), exp2(a), 'jax')(5) - 32) <= JAX_DEFAULT_EPSILON + + +def test_jax_log2(): + if not jax: + skip("JAX not installed") + assert abs(lambdify((a,), log2(a), 'jax')(256) - 8) <= JAX_DEFAULT_EPSILON + + +def test_jax_Sqrt(): + if not jax: + skip("JAX not installed") + assert abs(lambdify((a,), Sqrt(a), 'jax')(4) - 2) <= JAX_DEFAULT_EPSILON + + +def test_jax_sqrt(): + if not jax: + skip("JAX not installed") + assert abs(lambdify((a,), sqrt(a), 'jax')(4) - 2) <= JAX_DEFAULT_EPSILON + + +def test_jax_matsolve(): + if not jax: + skip("JAX not installed") + + M = MatrixSymbol("M", 3, 3) + x = MatrixSymbol("x", 3, 1) + + expr = M**(-1) * x + x + matsolve_expr = MatrixSolve(M, x) + x + + f = lambdify((M, x), expr, 'jax') + f_matsolve = lambdify((M, x), matsolve_expr, 'jax') + + m0 = jax.numpy.array([[1, 2, 3], [3, 2, 5], [5, 6, 7]]) + assert jax.numpy.linalg.matrix_rank(m0) == 3 + + x0 = jax.numpy.array([3, 4, 5]) + + assert jax.numpy.allclose(f_matsolve(m0, x0), f(m0, x0)) + + +def test_16857(): + if not jax: + skip("JAX not installed") + + a_1 = MatrixSymbol('a_1', 10, 3) + a_2 = MatrixSymbol('a_2', 10, 3) + a_3 = MatrixSymbol('a_3', 10, 3) + a_4 = MatrixSymbol('a_4', 10, 3) + A = BlockMatrix([[a_1, a_2], [a_3, a_4]]) + assert A.shape == (20, 6) + + printer = JaxPrinter() + assert printer.doprint(A) == 'jax.numpy.block([[a_1, a_2], [a_3, a_4]])' + + +def test_issue_17006(): + if not jax: + skip("JAX not installed") + + M = MatrixSymbol("M", 2, 2) + + f = lambdify(M, M + Identity(2), 'jax') + ma = jax.numpy.array([[1, 2], [3, 4]]) + mr = jax.numpy.array([[2, 2], [3, 5]]) + + assert (f(ma) == mr).all() + + from sympy.core.symbol import symbols + n = symbols('n', integer=True) + N = MatrixSymbol("M", n, n) + raises(NotImplementedError, lambda: lambdify(N, N + Identity(n), 'jax')) + +def test_jax_array(): + assert JaxPrinter().doprint(Array(((1, 2), (3, 5)))) == 'jax.numpy.array([[1, 2], [3, 5]])' + assert JaxPrinter().doprint(Array((1, 2))) == 'jax.numpy.array((1, 2))' + +def test_jax_known_funcs_consts(): + assert _jax_known_constants['NaN'] == 'jax.numpy.nan' + assert _jax_known_constants['EulerGamma'] == 'jax.numpy.euler_gamma' + + assert _jax_known_functions['acos'] == 'jax.numpy.arccos' + assert _jax_known_functions['log'] == 'jax.numpy.log' + +def test_jax_print_methods(): + prntr = JaxPrinter() + assert hasattr(prntr, '_print_acos') + assert hasattr(prntr, '_print_log') diff --git a/shared/package-files/07/07941919f128364a001b9119c47936f0c6759f64351afc75d6472f4d0e8de57f/blob b/shared/package-files/07/07941919f128364a001b9119c47936f0c6759f64351afc75d6472f4d0e8de57f/blob new file mode 100644 index 0000000000000000000000000000000000000000..fad3b79d9e222097e63b895baaaf0a1c17bcbcfd --- /dev/null +++ b/shared/package-files/07/07941919f128364a001b9119c47936f0c6759f64351afc75d6472f4d0e8de57f/blob @@ -0,0 +1,124 @@ +""" + pygments.lexers.zig + ~~~~~~~~~~~~~~~~~~~ + + Lexers for Zig. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, words +from pygments.token import Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace + +__all__ = ['ZigLexer'] + + +class ZigLexer(RegexLexer): + """ + Lexer for the Zig language. + + grammar: https://ziglang.org/documentation/master/#Grammar + """ + name = 'Zig' + url = 'http://www.ziglang.org' + aliases = ['zig'] + filenames = ['*.zig'] + mimetypes = ['text/zig'] + + type_keywords = ( + words(('bool', 'f16', 'f32', 'f64', 'f128', 'void', 'noreturn', 'type', + 'anyerror', 'promise', 'i0', 'u0', 'isize', 'usize', 'comptime_int', + 'comptime_float', 'c_short', 'c_ushort', 'c_int', 'c_uint', 'c_long', + 'c_ulong', 'c_longlong', 'c_ulonglong', 'c_longdouble', 'c_void' + 'i8', 'u8', 'i16', 'u16', 'i32', 'u32', 'i64', 'u64', 'i128', + 'u128'), suffix=r'\b'), + Keyword.Type) + + storage_keywords = ( + words(('const', 'var', 'extern', 'packed', 'export', 'pub', 'noalias', + 'inline', 'comptime', 'nakedcc', 'stdcallcc', 'volatile', 'allowzero', + 'align', 'linksection', 'threadlocal'), suffix=r'\b'), + Keyword.Reserved) + + structure_keywords = ( + words(('struct', 'enum', 'union', 'error'), suffix=r'\b'), + Keyword) + + statement_keywords = ( + words(('break', 'return', 'continue', 'asm', 'defer', 'errdefer', + 'unreachable', 'try', 'catch', 'async', 'await', 'suspend', + 'resume', 'cancel'), suffix=r'\b'), + Keyword) + + conditional_keywords = ( + words(('if', 'else', 'switch', 'and', 'or', 'orelse'), suffix=r'\b'), + Keyword) + + repeat_keywords = ( + words(('while', 'for'), suffix=r'\b'), + Keyword) + + other_keywords = ( + words(('fn', 'usingnamespace', 'test'), suffix=r'\b'), + Keyword) + + constant_keywords = ( + words(('true', 'false', 'null', 'undefined'), suffix=r'\b'), + Keyword.Constant) + + tokens = { + 'root': [ + (r'\n', Whitespace), + (r'\s+', Whitespace), + (r'//.*?\n', Comment.Single), + + # Keywords + statement_keywords, + storage_keywords, + structure_keywords, + repeat_keywords, + type_keywords, + constant_keywords, + conditional_keywords, + other_keywords, + + # Floats + (r'0x[0-9a-fA-F]+\.[0-9a-fA-F]+([pP][\-+]?[0-9a-fA-F]+)?', Number.Float), + (r'0x[0-9a-fA-F]+\.?[pP][\-+]?[0-9a-fA-F]+', Number.Float), + (r'[0-9]+\.[0-9]+([eE][-+]?[0-9]+)?', Number.Float), + (r'[0-9]+\.?[eE][-+]?[0-9]+', Number.Float), + + # Integers + (r'0b[01]+', Number.Bin), + (r'0o[0-7]+', Number.Oct), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'[0-9]+', Number.Integer), + + # Identifier + (r'@[a-zA-Z_]\w*', Name.Builtin), + (r'[a-zA-Z_]\w*', Name), + + # Characters + (r'\'\\\'\'', String.Escape), + (r'\'\\(x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{6}|[nr\\t\'"])\'', + String.Escape), + (r'\'[^\\\']\'', String), + + # Strings + (r'\\\\[^\n]*', String.Heredoc), + (r'c\\\\[^\n]*', String.Heredoc), + (r'c?"', String, 'string'), + + # Operators, Punctuation + (r'[+%=><|^!?/\-*&~:]', Operator), + (r'[{}()\[\],.;]', Punctuation) + ], + 'string': [ + (r'\\(x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{6}|[nr\\t\'"])', + String.Escape), + (r'[^\\"\n]+', String), + (r'"', String, '#pop') + ] + } diff --git a/shared/package-files/07/0794e3c3e376cc4c3776bd973d53212f0c6a56276539f8762aa46b150f53e9f7/blob b/shared/package-files/07/0794e3c3e376cc4c3776bd973d53212f0c6a56276539f8762aa46b150f53e9f7/blob new file mode 100644 index 0000000000000000000000000000000000000000..ddf8c0e090d048086e370ef848747bac5bbc84aa --- /dev/null +++ b/shared/package-files/07/0794e3c3e376cc4c3776bd973d53212f0c6a56276539f8762aa46b150f53e9f7/blob @@ -0,0 +1,1185 @@ +# This file is part of Hypothesis, which may be found at +# https://github.com/HypothesisWorks/hypothesis/ +# +# Copyright the Hypothesis Authors. +# Individual contributors are listed in AUTHORS.rst and the git log. +# +# This Source Code Form is subject to the terms of the Mozilla Public License, +# v. 2.0. If a copy of the MPL was not distributed with this file, You can +# obtain one at https://mozilla.org/MPL/2.0/. + +import importlib +import math +import time +from collections import defaultdict +from contextlib import contextmanager +from datetime import timedelta +from enum import Enum +from random import Random, getrandbits +from typing import Union + +import attr + +from hypothesis import HealthCheck, Phase, Verbosity, settings as Settings +from hypothesis._settings import local_settings +from hypothesis.errors import InvalidArgument, StopTest +from hypothesis.internal.cache import LRUReusedCache +from hypothesis.internal.compat import ceil, int_from_bytes +from hypothesis.internal.conjecture.data import ( + AVAILABLE_PROVIDERS, + ConjectureData, + ConjectureResult, + DataObserver, + HypothesisProvider, + Overrun, + PrimitiveProvider, + Status, +) +from hypothesis.internal.conjecture.datatree import DataTree, PreviouslyUnseenBehaviour +from hypothesis.internal.conjecture.junkdrawer import clamp, ensure_free_stackframes +from hypothesis.internal.conjecture.pareto import NO_SCORE, ParetoFront, ParetoOptimiser +from hypothesis.internal.conjecture.shrinker import Shrinker, sort_key +from hypothesis.internal.healthcheck import fail_health_check +from hypothesis.reporting import base_report, report + +MAX_SHRINKS = 500 +CACHE_SIZE = 10000 +MUTATION_POOL_SIZE = 100 +MIN_TEST_CALLS = 10 +BUFFER_SIZE = 8 * 1024 + +# If the shrinking phase takes more than five minutes, abort it early and print +# a warning. Many CI systems will kill a build after around ten minutes with +# no output, and appearing to hang isn't great for interactive use either - +# showing partially-shrunk examples is better than quitting with no examples! +# (but make it monkeypatchable, for the rare users who need to keep on shrinking) +MAX_SHRINKING_SECONDS = 300 + + +@attr.s +class HealthCheckState: + valid_examples: int = attr.ib(default=0) + invalid_examples: int = attr.ib(default=0) + overrun_examples: int = attr.ib(default=0) + draw_times: "defaultdict[str, list[float]]" = attr.ib( + factory=lambda: defaultdict(list) + ) + + @property + def total_draw_time(self): + return math.fsum(sum(self.draw_times.values(), start=[])) + + def timing_report(self): + """Return a terminal report describing what was slow.""" + if not self.draw_times: + return "" + width = max(len(k[len("generate:") :].strip(": ")) for k in self.draw_times) + out = [f"\n {'':^{width}} count | fraction | slowest draws (seconds)"] + args_in_order = sorted(self.draw_times.items(), key=lambda kv: -sum(kv[1])) + for i, (argname, times) in enumerate(args_in_order): # pragma: no branch + # If we have very many unique keys, which can happen due to interactive + # draws with computed labels, we'll skip uninformative rows. + if ( + 5 <= i < (len(self.draw_times) - 2) + and math.fsum(times) * 20 < self.total_draw_time + ): + out.append(f" (skipped {len(self.draw_times) - i} rows of fast draws)") + break + # Compute the row to report, omitting times <1ms to focus on slow draws + reprs = [f"{t:>6.3f}," for t in sorted(times)[-5:] if t > 5e-4] + desc = " ".join(([" -- "] * 5 + reprs)[-5:]).rstrip(",") + arg = argname[len("generate:") :].strip(": ") # removeprefix in py3.9 + out.append( + f" {arg:^{width}} | {len(times):>4} | " + f"{math.fsum(times)/self.total_draw_time:>7.0%} | {desc}" + ) + return "\n".join(out) + + +class ExitReason(Enum): + max_examples = "settings.max_examples={s.max_examples}" + max_iterations = ( + "settings.max_examples={s.max_examples}, " + "but < 10% of examples satisfied assumptions" + ) + max_shrinks = f"shrunk example {MAX_SHRINKS} times" + finished = "nothing left to do" + flaky = "test was flaky" + very_slow_shrinking = "shrinking was very slow" + + def describe(self, settings): + return self.value.format(s=settings) + + +class RunIsComplete(Exception): + pass + + +def _get_provider(backend: str) -> Union[type, PrimitiveProvider]: + mname, cname = AVAILABLE_PROVIDERS[backend].rsplit(".", 1) + provider_cls = getattr(importlib.import_module(mname), cname) + if provider_cls.lifetime == "test_function": + return provider_cls(None) + elif provider_cls.lifetime == "test_case": + return provider_cls + else: + raise InvalidArgument( + f"invalid lifetime {provider_cls.lifetime} for provider {provider_cls.__name__}. " + "Expected one of 'test_function', 'test_case'." + ) + + +class ConjectureRunner: + def __init__( + self, + test_function, + *, + settings=None, + random=None, + database_key=None, + ignore_limits=False, + ): + self._test_function = test_function + self.settings = settings or Settings() + self.shrinks = 0 + self.finish_shrinking_deadline = None + self.call_count = 0 + self.valid_examples = 0 + self.random = random or Random(getrandbits(128)) + self.database_key = database_key + self.ignore_limits = ignore_limits + + # Global dict of per-phase statistics, and a list of per-call stats + # which transfer to the global dict at the end of each phase. + self._current_phase = "(not a phase)" + self.statistics = {} + self.stats_per_test_case = [] + + self.interesting_examples = {} + # We use call_count because there may be few possible valid_examples. + self.first_bug_found_at = None + self.last_bug_found_at = None + + self.shrunk_examples = set() + + self.health_check_state = None + + self.tree = DataTree() + + self.provider = _get_provider(self.settings.backend) + + self.best_observed_targets = defaultdict(lambda: NO_SCORE) + self.best_examples_of_observed_targets = {} + + # We keep the pareto front in the example database if we have one. This + # is only marginally useful at present, but speeds up local development + # because it means that large targets will be quickly surfaced in your + # testing. + if self.database_key is not None and self.settings.database is not None: + self.pareto_front = ParetoFront(self.random) + self.pareto_front.on_evict(self.on_pareto_evict) + else: + self.pareto_front = None + + # We want to be able to get the ConjectureData object that results + # from running a buffer without recalculating, especially during + # shrinking where we need to know about the structure of the + # executed test case. + self.__data_cache = LRUReusedCache(CACHE_SIZE) + + self.__pending_call_explanation = None + self._switch_to_hypothesis_provider = False + + def explain_next_call_as(self, explanation): + self.__pending_call_explanation = explanation + + def clear_call_explanation(self): + self.__pending_call_explanation = None + + @contextmanager + def _log_phase_statistics(self, phase): + self.stats_per_test_case.clear() + start_time = time.perf_counter() + try: + self._current_phase = phase + yield + finally: + self.statistics[phase + "-phase"] = { + "duration-seconds": time.perf_counter() - start_time, + "test-cases": list(self.stats_per_test_case), + "distinct-failures": len(self.interesting_examples), + "shrinks-successful": self.shrinks, + } + + @property + def should_optimise(self): + return Phase.target in self.settings.phases + + def __tree_is_exhausted(self): + return self.tree.is_exhausted and self.settings.backend == "hypothesis" + + def __stoppable_test_function(self, data): + """Run ``self._test_function``, but convert a ``StopTest`` exception + into a normal return and avoid raising Flaky for RecursionErrors. + """ + # We ensure that the test has this much stack space remaining, no + # matter the size of the stack when called, to de-flake RecursionErrors + # (#2494, #3671). + with ensure_free_stackframes(): + try: + self._test_function(data) + except StopTest as e: + if e.testcounter == data.testcounter: + # This StopTest has successfully stopped its test, and can now + # be discarded. + pass + else: + # This StopTest was raised by a different ConjectureData. We + # need to re-raise it so that it will eventually reach the + # correct engine. + raise + + def ir_tree_to_data(self, ir_tree_nodes): + data = ConjectureData.for_ir_tree(ir_tree_nodes) + self.__stoppable_test_function(data) + return data + + def test_function(self, data): + if self.__pending_call_explanation is not None: + self.debug(self.__pending_call_explanation) + self.__pending_call_explanation = None + + self.call_count += 1 + + interrupted = False + try: + self.__stoppable_test_function(data) + except KeyboardInterrupt: + interrupted = True + raise + except BaseException: + self.save_buffer(data.buffer) + raise + finally: + # No branch, because if we're interrupted we always raise + # the KeyboardInterrupt, never continue to the code below. + if not interrupted: # pragma: no branch + data.freeze() + call_stats = { + "status": data.status.name.lower(), + "runtime": data.finish_time - data.start_time, + "drawtime": math.fsum(data.draw_times.values()), + "events": sorted( + k if v == "" else f"{k}: {v}" for k, v in data.events.items() + ), + } + self.stats_per_test_case.append(call_stats) + self.__data_cache[data.buffer] = data.as_result() + + self.debug_data(data) + + if ( + data.target_observations + and self.pareto_front is not None + and self.pareto_front.add(data.as_result()) + ): + self.save_buffer(data.buffer, sub_key=b"pareto") + + assert len(data.buffer) <= BUFFER_SIZE + + if data.status >= Status.VALID: + for k, v in data.target_observations.items(): + self.best_observed_targets[k] = max(self.best_observed_targets[k], v) + + if k not in self.best_examples_of_observed_targets: + self.best_examples_of_observed_targets[k] = data.as_result() + continue + + existing_example = self.best_examples_of_observed_targets[k] + existing_score = existing_example.target_observations[k] + + if v < existing_score: + continue + + if v > existing_score or sort_key(data.buffer) < sort_key( + existing_example.buffer + ): + self.best_examples_of_observed_targets[k] = data.as_result() + + if data.status == Status.VALID: + self.valid_examples += 1 + + if data.status == Status.INTERESTING: + if self.settings.backend != "hypothesis": + for node in data.examples.ir_tree_nodes: + value = data.provider.post_test_case_hook(node.value) + # require providers to return something valid here. + assert ( + value is not None + ), "providers must return a non-null value from post_test_case_hook" + node.value = value + + # drive the ir tree through the test function to convert it + # to a buffer + data = self.ir_tree_to_data(data.examples.ir_tree_nodes) + self.__data_cache[data.buffer] = data.as_result() + + key = data.interesting_origin + changed = False + try: + existing = self.interesting_examples[key] + except KeyError: + changed = True + self.last_bug_found_at = self.call_count + if self.first_bug_found_at is None: + self.first_bug_found_at = self.call_count + else: + if sort_key(data.buffer) < sort_key(existing.buffer): + self.shrinks += 1 + self.downgrade_buffer(existing.buffer) + self.__data_cache.unpin(existing.buffer) + changed = True + + if changed: + self.save_buffer(data.buffer) + self.interesting_examples[key] = data.as_result() + self.__data_cache.pin(data.buffer) + self.shrunk_examples.discard(key) + + if self.shrinks >= MAX_SHRINKS: + self.exit_with(ExitReason.max_shrinks) + + if ( + not self.ignore_limits + and self.finish_shrinking_deadline is not None + and self.finish_shrinking_deadline < time.perf_counter() + ): + # See https://github.com/HypothesisWorks/hypothesis/issues/2340 + report( + "WARNING: Hypothesis has spent more than five minutes working to shrink" + " a failing example, and stopped because it is making very slow" + " progress. When you re-run your tests, shrinking will resume and may" + " take this long before aborting again.\nPLEASE REPORT THIS if you can" + " provide a reproducing example, so that we can improve shrinking" + " performance for everyone." + ) + self.exit_with(ExitReason.very_slow_shrinking) + + if not self.interesting_examples: + # Note that this logic is reproduced to end the generation phase when + # we have interesting examples. Update that too if you change this! + # (The doubled implementation is because here we exit the engine entirely, + # while in the other case below we just want to move on to shrinking.) + if self.valid_examples >= self.settings.max_examples: + self.exit_with(ExitReason.max_examples) + if self.call_count >= max( + self.settings.max_examples * 10, + # We have a high-ish default max iterations, so that tests + # don't become flaky when max_examples is too low. + 1000, + ): + self.exit_with(ExitReason.max_iterations) + + if self.__tree_is_exhausted(): + self.exit_with(ExitReason.finished) + + self.record_for_health_check(data) + + def on_pareto_evict(self, data): + self.settings.database.delete(self.pareto_key, data.buffer) + + def generate_novel_prefix(self): + """Uses the tree to proactively generate a starting sequence of bytes + that we haven't explored yet for this test. + + When this method is called, we assume that there must be at + least one novel prefix left to find. If there were not, then the + test run should have already stopped due to tree exhaustion. + """ + return self.tree.generate_novel_prefix(self.random) + + def record_for_health_check(self, data): + # Once we've actually found a bug, there's no point in trying to run + # health checks - they'll just mask the actually important information. + if data.status == Status.INTERESTING: + self.health_check_state = None + + state = self.health_check_state + + if state is None: + return + + for k, v in data.draw_times.items(): + state.draw_times[k].append(v) + + if data.status == Status.VALID: + state.valid_examples += 1 + elif data.status == Status.INVALID: + state.invalid_examples += 1 + else: + assert data.status == Status.OVERRUN + state.overrun_examples += 1 + + max_valid_draws = 10 + max_invalid_draws = 50 + max_overrun_draws = 20 + + assert state.valid_examples <= max_valid_draws + + if state.valid_examples == max_valid_draws: + self.health_check_state = None + return + + if state.overrun_examples == max_overrun_draws: + fail_health_check( + self.settings, + "Examples routinely exceeded the max allowable size. " + f"({state.overrun_examples} examples overran while generating " + f"{state.valid_examples} valid ones). Generating examples this large " + "will usually lead to bad results. You could try setting max_size " + "parameters on your collections and turning max_leaves down on " + "recursive() calls.", + HealthCheck.data_too_large, + ) + if state.invalid_examples == max_invalid_draws: + fail_health_check( + self.settings, + "It looks like your strategy is filtering out a lot of data. Health " + f"check found {state.invalid_examples} filtered examples but only " + f"{state.valid_examples} good ones. This will make your tests much " + "slower, and also will probably distort the data generation quite a " + "lot. You should adapt your strategy to filter less. This can also " + "be caused by a low max_leaves parameter in recursive() calls", + HealthCheck.filter_too_much, + ) + + draw_time = state.total_draw_time + + # Allow at least the greater of one second or 5x the deadline. If deadline + # is None, allow 30s - the user can disable the healthcheck too if desired. + draw_time_limit = 5 * (self.settings.deadline or timedelta(seconds=6)) + if draw_time > max(1.0, draw_time_limit.total_seconds()): + fail_health_check( + self.settings, + "Data generation is extremely slow: Only produced " + f"{state.valid_examples} valid examples in {draw_time:.2f} seconds " + f"({state.invalid_examples} invalid ones and {state.overrun_examples} " + "exceeded maximum size). Try decreasing size of the data you're " + "generating (with e.g. max_size or max_leaves parameters)." + + state.timing_report(), + HealthCheck.too_slow, + ) + + def save_buffer(self, buffer, sub_key=None): + if self.settings.database is not None: + key = self.sub_key(sub_key) + if key is None: + return + self.settings.database.save(key, bytes(buffer)) + + def downgrade_buffer(self, buffer): + if self.settings.database is not None and self.database_key is not None: + self.settings.database.move(self.database_key, self.secondary_key, buffer) + + def sub_key(self, sub_key): + if self.database_key is None: + return None + if sub_key is None: + return self.database_key + return b".".join((self.database_key, sub_key)) + + @property + def secondary_key(self): + return self.sub_key(b"secondary") + + @property + def pareto_key(self): + return self.sub_key(b"pareto") + + def debug(self, message): + if self.settings.verbosity >= Verbosity.debug: + base_report(message) + + @property + def report_debug_info(self): + return self.settings.verbosity >= Verbosity.debug + + def debug_data(self, data): + if not self.report_debug_info: + return + + stack = [[]] + + def go(ex): + if ex.length == 0: + return + if len(ex.children) == 0: + stack[-1].append(int_from_bytes(data.buffer[ex.start : ex.end])) + else: + node = [] + stack.append(node) + + for v in ex.children: + go(v) + stack.pop() + if len(node) == 1: + stack[-1].extend(node) + else: + stack[-1].append(node) + + go(data.examples[0]) + assert len(stack) == 1 + + status = repr(data.status) + + if data.status == Status.INTERESTING: + status = f"{status} ({data.interesting_origin!r})" + + self.debug(f"{data.index} bytes {stack[0]!r} -> {status}, {data.output}") + + def run(self): + with local_settings(self.settings): + try: + self._run() + except RunIsComplete: + pass + for v in self.interesting_examples.values(): + self.debug_data(v) + self.debug( + "Run complete after %d examples (%d valid) and %d shrinks" + % (self.call_count, self.valid_examples, self.shrinks) + ) + + @property + def database(self): + if self.database_key is None: + return None + return self.settings.database + + def has_existing_examples(self): + return self.database is not None and Phase.reuse in self.settings.phases + + def reuse_existing_examples(self): + """If appropriate (we have a database and have been told to use it), + try to reload existing examples from the database. + + If there are a lot we don't try all of them. We always try the + smallest example in the database (which is guaranteed to be the + last failure) and the largest (which is usually the seed example + which the last failure came from but we don't enforce that). We + then take a random sampling of the remainder and try those. Any + examples that are no longer interesting are cleared out. + """ + if self.has_existing_examples(): + self.debug("Reusing examples from database") + # We have to do some careful juggling here. We have two database + # corpora: The primary and secondary. The primary corpus is a + # small set of minimized examples each of which has at one point + # demonstrated a distinct bug. We want to retry all of these. + + # We also have a secondary corpus of examples that have at some + # point demonstrated interestingness (currently only ones that + # were previously non-minimal examples of a bug, but this will + # likely expand in future). These are a good source of potentially + # interesting examples, but there are a lot of them, so we down + # sample the secondary corpus to a more manageable size. + + corpus = sorted( + self.settings.database.fetch(self.database_key), key=sort_key + ) + factor = 0.1 if (Phase.generate in self.settings.phases) else 1 + desired_size = max(2, ceil(factor * self.settings.max_examples)) + + if len(corpus) < desired_size: + extra_corpus = list(self.settings.database.fetch(self.secondary_key)) + + shortfall = desired_size - len(corpus) + + if len(extra_corpus) <= shortfall: + extra = extra_corpus + else: + extra = self.random.sample(extra_corpus, shortfall) + extra.sort(key=sort_key) + corpus.extend(extra) + + for existing in corpus: + data = self.cached_test_function(existing, extend=BUFFER_SIZE) + if data.status != Status.INTERESTING: + self.settings.database.delete(self.database_key, existing) + self.settings.database.delete(self.secondary_key, existing) + + # If we've not found any interesting examples so far we try some of + # the pareto front from the last run. + if len(corpus) < desired_size and not self.interesting_examples: + desired_extra = desired_size - len(corpus) + pareto_corpus = list(self.settings.database.fetch(self.pareto_key)) + if len(pareto_corpus) > desired_extra: + pareto_corpus = self.random.sample(pareto_corpus, desired_extra) + pareto_corpus.sort(key=sort_key) + + for existing in pareto_corpus: + data = self.cached_test_function(existing, extend=BUFFER_SIZE) + if data not in self.pareto_front: + self.settings.database.delete(self.pareto_key, existing) + if data.status == Status.INTERESTING: + break + + def exit_with(self, reason): + if self.ignore_limits: + return + self.statistics["stopped-because"] = reason.describe(self.settings) + if self.best_observed_targets: + self.statistics["targets"] = dict(self.best_observed_targets) + self.debug(f"exit_with({reason.name})") + self.exit_reason = reason + raise RunIsComplete + + def should_generate_more(self): + # End the generation phase where we would have ended it if no bugs had + # been found. This reproduces the exit logic in `self.test_function`, + # but with the important distinction that this clause will move on to + # the shrinking phase having found one or more bugs, while the other + # will exit having found zero bugs. + if self.valid_examples >= self.settings.max_examples or self.call_count >= max( + self.settings.max_examples * 10, 1000 + ): # pragma: no cover + return False + + # If we haven't found a bug, keep looking - if we hit any limits on + # the number of tests to run that will raise an exception and stop + # the run. + if not self.interesting_examples: + return True + # Users who disable shrinking probably want to exit as fast as possible. + # If we've found a bug and won't report more than one, stop looking. + elif ( + Phase.shrink not in self.settings.phases + or not self.settings.report_multiple_bugs + ): + return False + assert self.first_bug_found_at <= self.last_bug_found_at <= self.call_count + # Otherwise, keep searching for between ten and 'a heuristic' calls. + # We cap 'calls after first bug' so errors are reported reasonably + # soon even for tests that are allowed to run for a very long time, + # or sooner if the latest half of our test effort has been fruitless. + return self.call_count < MIN_TEST_CALLS or self.call_count < min( + self.first_bug_found_at + 1000, self.last_bug_found_at * 2 + ) + + def generate_new_examples(self): + if Phase.generate not in self.settings.phases: + return + if self.interesting_examples: + # The example database has failing examples from a previous run, + # so we'd rather report that they're still failing ASAP than take + # the time to look for additional failures. + return + + self.debug("Generating new examples") + + assert self.should_generate_more() + zero_data = self.cached_test_function(bytes(BUFFER_SIZE)) + if zero_data.status > Status.OVERRUN: + self.__data_cache.pin(zero_data.buffer) + + if zero_data.status == Status.OVERRUN or ( + zero_data.status == Status.VALID and len(zero_data.buffer) * 2 > BUFFER_SIZE + ): + fail_health_check( + self.settings, + "The smallest natural example for your test is extremely " + "large. This makes it difficult for Hypothesis to generate " + "good examples, especially when trying to reduce failing ones " + "at the end. Consider reducing the size of your data if it is " + "of a fixed size. You could also fix this by improving how " + "your data shrinks (see https://hypothesis.readthedocs.io/en/" + "latest/data.html#shrinking for details), or by introducing " + "default values inside your strategy. e.g. could you replace " + "some arguments with their defaults by using " + "one_of(none(), some_complex_strategy)?", + HealthCheck.large_base_example, + ) + + self.health_check_state = HealthCheckState() + + # We attempt to use the size of the minimal generated test case starting + # from a given novel prefix as a guideline to generate smaller test + # cases for an initial period, by restriscting ourselves to test cases + # that are not much larger than it. + # + # Calculating the actual minimal generated test case is hard, so we + # take a best guess that zero extending a prefix produces the minimal + # test case starting with that prefix (this is true for our built in + # strategies). This is only a reasonable thing to do if the resulting + # test case is valid. If we regularly run into situations where it is + # not valid then this strategy is a waste of time, so we want to + # abandon it early. In order to do this we track how many times in a + # row it has failed to work, and abort small test case generation when + # it has failed too many times in a row. + consecutive_zero_extend_is_invalid = 0 + + # We control growth during initial example generation, for two + # reasons: + # + # * It gives us an opportunity to find small examples early, which + # gives us a fast path for easy to find bugs. + # * It avoids low probability events where we might end up + # generating very large examples during health checks, which + # on slower machines can trigger HealthCheck.too_slow. + # + # The heuristic we use is that we attempt to estimate the smallest + # extension of this prefix, and limit the size to no more than + # an order of magnitude larger than that. If we fail to estimate + # the size accurately, we skip over this prefix and try again. + # + # We need to tune the example size based on the initial prefix, + # because any fixed size might be too small, and any size based + # on the strategy in general can fall afoul of strategies that + # have very different sizes for different prefixes. + small_example_cap = clamp(10, self.settings.max_examples // 10, 50) + + optimise_at = max(self.settings.max_examples // 2, small_example_cap + 1) + ran_optimisations = False + + while self.should_generate_more(): + # Unfortunately generate_novel_prefix still operates in terms of + # a buffer and uses HypothesisProvider as its backing provider, + # not whatever is specified by the backend. We can improve this + # once more things are on the ir. + if self.settings.backend != "hypothesis": + data = self.new_conjecture_data(prefix=b"", max_length=BUFFER_SIZE) + self.test_function(data) + continue + + self._current_phase = "generate" + prefix = self.generate_novel_prefix() + assert len(prefix) <= BUFFER_SIZE + if ( + self.valid_examples <= small_example_cap + and self.call_count <= 5 * small_example_cap + and not self.interesting_examples + and consecutive_zero_extend_is_invalid < 5 + ): + minimal_example = self.cached_test_function( + prefix + bytes(BUFFER_SIZE - len(prefix)) + ) + + if minimal_example.status < Status.VALID: + consecutive_zero_extend_is_invalid += 1 + continue + + consecutive_zero_extend_is_invalid = 0 + + minimal_extension = len(minimal_example.buffer) - len(prefix) + + max_length = min(len(prefix) + minimal_extension * 10, BUFFER_SIZE) + + # We could end up in a situation where even though the prefix was + # novel when we generated it, because we've now tried zero extending + # it not all possible continuations of it will be novel. In order to + # avoid making redundant test calls, we rerun it in simulation mode + # first. If this has a predictable result, then we don't bother + # running the test function for real here. If however we encounter + # some novel behaviour, we try again with the real test function, + # starting from the new novel prefix that has discovered. + try: + trial_data = self.new_conjecture_data( + prefix=prefix, max_length=max_length + ) + self.tree.simulate_test_function(trial_data) + continue + except PreviouslyUnseenBehaviour: + pass + + # If the simulation entered part of the tree that has been killed, + # we don't want to run this. + if trial_data.observer.killed: + continue + + # We might have hit the cap on number of examples we should + # run when calculating the minimal example. + if not self.should_generate_more(): + break + + prefix = trial_data.buffer + else: + max_length = BUFFER_SIZE + + data = self.new_conjecture_data(prefix=prefix, max_length=max_length) + + self.test_function(data) + + if ( + data.status == Status.OVERRUN + and max_length < BUFFER_SIZE + and "invalid because" not in data.events + ): + data.events["invalid because"] = ( + "reduced max size for early examples (avoids flaky health checks)" + ) + + self.generate_mutations_from(data) + + # Although the optimisations are logically a distinct phase, we + # actually normally run them as part of example generation. The + # reason for this is that we cannot guarantee that optimisation + # actually exhausts our budget: It might finish running and we + # discover that actually we still could run a bunch more test cases + # if we want. + if ( + self.valid_examples >= max(small_example_cap, optimise_at) + and not ran_optimisations + ): + ran_optimisations = True + self._current_phase = "target" + self.optimise_targets() + + def generate_mutations_from(self, data): + # A thing that is often useful but rarely happens by accident is + # to generate the same value at multiple different points in the + # test case. + # + # Rather than make this the responsibility of individual strategies + # we implement a small mutator that just takes parts of the test + # case with the same label and tries replacing one of them with a + # copy of the other and tries running it. If we've made a good + # guess about what to put where, this will run a similar generated + # test case with more duplication. + if ( + # An OVERRUN doesn't have enough information about the test + # case to mutate, so we just skip those. + data.status >= Status.INVALID + # This has a tendency to trigger some weird edge cases during + # generation so we don't let it run until we're done with the + # health checks. + and self.health_check_state is None + ): + initial_calls = self.call_count + failed_mutations = 0 + + while ( + self.should_generate_more() + # We implement fairly conservative checks for how long we + # we should run mutation for, as it's generally not obvious + # how helpful it is for any given test case. + and self.call_count <= initial_calls + 5 + and failed_mutations <= 5 + ): + groups = data.examples.mutator_groups + if not groups: + break + + group = self.random.choice(groups) + + ex1, ex2 = ( + data.examples[i] for i in sorted(self.random.sample(group, 2)) + ) + assert ex1.end <= ex2.start + + e = self.random.choice([ex1, ex2]) + replacement = data.buffer[e.start : e.end] + + try: + # We attempt to replace both the the examples with + # whichever choice we made. Note that this might end + # up messing up and getting the example boundaries + # wrong - labels matching are only a best guess as to + # whether the two are equivalent - but it doesn't + # really matter. It may not achieve the desired result + # but it's still a perfectly acceptable choice sequence + # to try. + new_data = self.cached_test_function( + data.buffer[: ex1.start] + + replacement + + data.buffer[ex1.end : ex2.start] + + replacement + + data.buffer[ex2.end :], + # We set error_on_discard so that we don't end up + # entering parts of the tree we consider redundant + # and not worth exploring. + error_on_discard=True, + extend=BUFFER_SIZE, + ) + except ContainsDiscard: + failed_mutations += 1 + continue + + if ( + new_data.status >= data.status + and data.buffer != new_data.buffer + and all( + k in new_data.target_observations + and new_data.target_observations[k] >= v + for k, v in data.target_observations.items() + ) + ): + data = new_data + failed_mutations = 0 + else: + failed_mutations += 1 + + def optimise_targets(self): + """If any target observations have been made, attempt to optimise them + all.""" + if not self.should_optimise: + return + from hypothesis.internal.conjecture.optimiser import Optimiser + + # We want to avoid running the optimiser for too long in case we hit + # an unbounded target score. We start this off fairly conservatively + # in case interesting examples are easy to find and then ramp it up + # on an exponential schedule so we don't hamper the optimiser too much + # if it needs a long time to find good enough improvements. + max_improvements = 10 + while True: + prev_calls = self.call_count + + any_improvements = False + + for target, data in list(self.best_examples_of_observed_targets.items()): + optimiser = Optimiser( + self, data, target, max_improvements=max_improvements + ) + optimiser.run() + if optimiser.improvements > 0: + any_improvements = True + + if self.interesting_examples: + break + + max_improvements *= 2 + + if any_improvements: + continue + + if self.best_observed_targets: + self.pareto_optimise() + + if prev_calls == self.call_count: + break + + def pareto_optimise(self): + if self.pareto_front is not None: + ParetoOptimiser(self).run() + + def _run(self): + # have to use the primitive provider to interpret database bits... + self._switch_to_hypothesis_provider = True + with self._log_phase_statistics("reuse"): + self.reuse_existing_examples() + # ...but we should use the supplied provider when generating... + self._switch_to_hypothesis_provider = False + with self._log_phase_statistics("generate"): + self.generate_new_examples() + # We normally run the targeting phase mixed in with the generate phase, + # but if we've been asked to run it but not generation then we have to + # run it explicitly on its own here. + if Phase.generate not in self.settings.phases: + self._current_phase = "target" + self.optimise_targets() + # ...and back to the primitive provider when shrinking. + self._switch_to_hypothesis_provider = True + with self._log_phase_statistics("shrink"): + self.shrink_interesting_examples() + self.exit_with(ExitReason.finished) + + def new_conjecture_data(self, prefix, max_length=BUFFER_SIZE, observer=None): + provider = ( + HypothesisProvider if self._switch_to_hypothesis_provider else self.provider + ) + observer = observer or self.tree.new_observer() + if self.settings.backend != "hypothesis": + observer = DataObserver() + + return ConjectureData( + prefix=prefix, + max_length=max_length, + random=self.random, + observer=observer, + provider=provider, + ) + + def new_conjecture_data_for_buffer(self, buffer): + return self.new_conjecture_data(buffer, max_length=len(buffer)) + + def shrink_interesting_examples(self): + """If we've found interesting examples, try to replace each of them + with a minimal interesting example with the same interesting_origin. + + We may find one or more examples with a new interesting_origin + during the shrink process. If so we shrink these too. + """ + if Phase.shrink not in self.settings.phases or not self.interesting_examples: + return + + self.debug("Shrinking interesting examples") + self.finish_shrinking_deadline = time.perf_counter() + MAX_SHRINKING_SECONDS + + for prev_data in sorted( + self.interesting_examples.values(), key=lambda d: sort_key(d.buffer) + ): + assert prev_data.status == Status.INTERESTING + data = self.new_conjecture_data_for_buffer(prev_data.buffer) + self.test_function(data) + if data.status != Status.INTERESTING: + self.exit_with(ExitReason.flaky) + + self.clear_secondary_key() + + while len(self.shrunk_examples) < len(self.interesting_examples): + target, example = min( + ( + (k, v) + for k, v in self.interesting_examples.items() + if k not in self.shrunk_examples + ), + key=lambda kv: (sort_key(kv[1].buffer), sort_key(repr(kv[0]))), + ) + self.debug(f"Shrinking {target!r}") + + if not self.settings.report_multiple_bugs: + # If multi-bug reporting is disabled, we shrink our currently-minimal + # failure, allowing 'slips' to any bug with a smaller minimal example. + self.shrink(example, lambda d: d.status == Status.INTERESTING) + return + + def predicate(d): + if d.status < Status.INTERESTING: + return False + return d.interesting_origin == target + + self.shrink(example, predicate) + + self.shrunk_examples.add(target) + + def clear_secondary_key(self): + if self.has_existing_examples(): + # If we have any smaller examples in the secondary corpus, now is + # a good time to try them to see if they work as shrinks. They + # probably won't, but it's worth a shot and gives us a good + # opportunity to clear out the database. + + # It's not worth trying the primary corpus because we already + # tried all of those in the initial phase. + corpus = sorted( + self.settings.database.fetch(self.secondary_key), key=sort_key + ) + for c in corpus: + primary = {v.buffer for v in self.interesting_examples.values()} + + cap = max(map(sort_key, primary)) + + if sort_key(c) > cap: + break + else: + self.cached_test_function(c) + # We unconditionally remove c from the secondary key as it + # is either now primary or worse than our primary example + # of this reason for interestingness. + self.settings.database.delete(self.secondary_key, c) + + def shrink(self, example, predicate=None, allow_transition=None): + s = self.new_shrinker(example, predicate, allow_transition) + s.shrink() + return s.shrink_target + + def new_shrinker(self, example, predicate=None, allow_transition=None): + return Shrinker( + self, + example, + predicate, + allow_transition=allow_transition, + explain=Phase.explain in self.settings.phases, + in_target_phase=self._current_phase == "target", + ) + + def cached_test_function(self, buffer, *, error_on_discard=False, extend=0): + """Checks the tree to see if we've tested this buffer, and returns the + previous result if we have. + + Otherwise we call through to ``test_function``, and return a + fresh result. + + If ``error_on_discard`` is set to True this will raise ``ContainsDiscard`` + in preference to running the actual test function. This is to allow us + to skip test cases we expect to be redundant in some cases. Note that + it may be the case that we don't raise ``ContainsDiscard`` even if the + result has discards if we cannot determine from previous runs whether + it will have a discard. + """ + buffer = bytes(buffer)[:BUFFER_SIZE] + + max_length = min(BUFFER_SIZE, len(buffer) + extend) + + def check_result(result): + assert result is Overrun or ( + isinstance(result, ConjectureResult) and result.status != Status.OVERRUN + ) + return result + + try: + cached = check_result(self.__data_cache[buffer]) + if cached.status > Status.OVERRUN or extend == 0: + return cached + except KeyError: + pass + + if error_on_discard: + + class DiscardObserver(DataObserver): + def kill_branch(self): + raise ContainsDiscard + + observer = DiscardObserver() + else: + observer = DataObserver() + + dummy_data = self.new_conjecture_data( + prefix=buffer, max_length=max_length, observer=observer + ) + + if self.settings.backend == "hypothesis": + try: + self.tree.simulate_test_function(dummy_data) + except PreviouslyUnseenBehaviour: + pass + else: + if dummy_data.status > Status.OVERRUN: + dummy_data.freeze() + try: + return self.__data_cache[dummy_data.buffer] + except KeyError: + pass + else: + self.__data_cache[buffer] = Overrun + return Overrun + + # We didn't find a match in the tree, so we need to run the test + # function normally. Note that test_function will automatically + # add this to the tree so we don't need to update the cache. + + result = None + + data = self.new_conjecture_data( + prefix=max((buffer, dummy_data.buffer), key=len), max_length=max_length + ) + self.test_function(data) + result = check_result(data.as_result()) + if extend == 0 or (result is not Overrun and len(result.buffer) <= len(buffer)): + self.__data_cache[buffer] = result + return result + + def passing_buffers(self, prefix=b""): + """Return a collection of bytestrings which cause the test to pass. + + Optionally restrict this by a certain prefix, which is useful for explain mode. + """ + return frozenset( + buf + for buf in self.__data_cache + if buf.startswith(prefix) and self.__data_cache[buf].status == Status.VALID + ) + + +class ContainsDiscard(Exception): + pass diff --git a/shared/package-files/07/079892cc250401ae5a2e69f1270c888801444ce91e5246109d9d0a212c8f9404/blob b/shared/package-files/07/079892cc250401ae5a2e69f1270c888801444ce91e5246109d9d0a212c8f9404/blob new file mode 100644 index 0000000000000000000000000000000000000000..c9f7561dca17d9b1e28c4f875648231b10ea3532 --- /dev/null +++ b/shared/package-files/07/079892cc250401ae5a2e69f1270c888801444ce91e5246109d9d0a212c8f9404/blob @@ -0,0 +1,334 @@ +# Generates ViewFuncs.h/cpp +# +# NOTE: If any changes are being made to the ViewFunc codegen please also check +# if updates are needed in torch/csrc/autograd/autograd_not_implemented_fallback.cpp +# The fallback is expected to mimic this codegen, so we should keep the two in sync. + +from typing import List, Tuple + +import torchgen.api.dispatcher as dispatcher +from torchgen.api.autograd import NativeFunctionWithDifferentiabilityInfo +from torchgen.api.translate import translate +from torchgen.api.types import ( + BaseCType, + Binding, + NamedCType, + SymIntT, + tensorT, + VectorCType, +) +from torchgen.code_template import CodeTemplate +from torchgen.model import Argument, NativeFunction, OptionalType +from torchgen.utils import FileManager + +from .gen_inplace_or_view_type import ( + CALL_DISPATCH, + extract_bindings, + get_view_info, + modifies_arguments, + use_derived, +) + +FUNCTION_DECLARATION = CodeTemplate( + """\ +#define ${uppercase_op}_AVAILABLE +struct ${op} : public ${superclass} { + ${op}(${constructor_args}) ${initializer_list} + {}; + virtual ~${op}() override {}; + virtual std::vector get_symints() const override; + virtual size_t num_symints() const override; + virtual std::vector get_tensors() const override; + virtual size_t num_tensors() const override; + virtual at::Tensor operator()(const at::Tensor&) const override; + virtual std::unique_ptr clone_and_set( + std::optional> = c10::nullopt, + std::optional> = c10::nullopt) const override; + +protected: + virtual void set_symints(std::vector) override; + virtual void set_tensors(std::vector) override; + +private: + ${state} +}; + +""" +) + +FUNCTION_DEFINITION = CodeTemplate( + """\ +std::vector ${op}::get_symints() const { + ${get_symints} +} + +size_t ${op}::num_symints() const { + return static_cast(${num_symints}); +} + +void ${op}::set_symints(std::vector ${symints_vec}) { + TORCH_INTERNAL_ASSERT(${symints_vec}.size() == num_symints()); + ${set_symints} +} + +std::vector ${op}::get_tensors() const { + ${get_tensors} +} + +size_t ${op}::num_tensors() const { + return static_cast(${num_tensors}); +} + +void ${op}::set_tensors(std::vector ${tensors_vec}) { + TORCH_INTERNAL_ASSERT(${tensors_vec}.size() == num_tensors()); + ${set_tensors} +} + +at::Tensor ${op}::operator()(const at::Tensor& ${call_input_name}) const { + return ${op_call}; +} + +std::unique_ptr ${op}::clone_and_set( + std::optional> ${symints_vec}, + std::optional> ${tensors_vec}) const { + auto output = std::make_unique<${op}>(${clone_args}); + if (${symints_vec}.has_value()) { + output->set_symints(std::move(*(${symints_vec}))); + } + if (${tensors_vec}.has_value()) { + output->set_tensors(std::move(*(${tensors_vec}))); + } + return output; +} + +""" +) + + +# e.g. as_strided -> AsStridedViewFunc for camel case or +# as_strided_view_func otherwise +def view_func_name( + f: NativeFunction, include_namespace: bool = False, camel_case: bool = True +) -> str: + name = f.func.name.unambiguous_name() + view_func_name = f"{name.replace('.', '_')}_view_func" + if camel_case: + is_private = view_func_name.startswith("_") + view_func_name = "".join( + [p.title() for p in view_func_name.replace(".", "_").split("_")] + ) + if is_private: + # put the leading underscore back in + view_func_name = f"_{view_func_name}" + namespace = "torch::autograd::generated::" if include_namespace else "" + return f"{namespace}{view_func_name}" + + +def is_symint_or_tensor(arg: Argument) -> bool: + return arg.type.is_tensor_like() or arg.type.is_symint_like() + + +def remove_const_ref(binding: Binding) -> Binding: + return Binding( + name=binding.name, + nctype=binding.nctype.remove_const_ref(), + argument=binding.argument, + default=binding.default, + ) + + +def returns_multi_tensor(fn: NativeFunction) -> bool: + returns = fn.func.returns + assert len(returns) == 1 + returns_list_like = returns[0].type.is_list_like() is not None + returns_tensor_like = returns[0].type.is_tensor_like() + return returns_list_like and returns_tensor_like + + +# Generates strings with logic for getting / setting state of a particular type. +# +# Args: +# bindings (list): List of state bindings of interest (may be empty) +# state_vec_type (NamedCType): Type of vector to either return or copy from +# +# Returns: +# tuple: (list of getter logic strings, list of setter logic strings, string +# with num items expression) +def generate_state_getter_setter( + bindings: List[Binding], + state_vec_type: NamedCType, +) -> Tuple[List[str], List[str], str]: + getter_logic = [] + setter_logic = [] + + state_vec = state_vec_type.name + getter_logic.append(f"{state_vec_type.cpp_type()} {state_vec};") + if len(bindings) > 0: + setter_logic.append("auto i = 0;") + + num_exprs = [] + for i, b in enumerate(bindings): + assert isinstance(b.argument, Argument) + if b.argument.type.is_list_like(): + # Handle list-likes. + num_expr = f"{b.name}.size()" + num_exprs.append(num_expr) + getter = f"{state_vec}.insert({state_vec}.end(), {b.name}.begin(), {b.name}.end());" + setter = f"std::copy({state_vec}.begin() + i, {state_vec}.begin() + i + {b.name}.size(), {b.name}.begin());" + elif isinstance(b.argument.type, OptionalType): + # Handle optionals. + num_expr = f"({b.name}.has_value() ? 1 : 0)" + num_exprs.append(num_expr) + conditional = f"if({b.name}.has_value())" + getter = ( + f"{conditional} {state_vec}.insert({state_vec}.end(), *({b.name}));" + ) + setter = f"{conditional} {b.name} = {state_vec}[i];" + else: + num_expr = "1" + num_exprs.append(num_expr) + getter = f"{state_vec}.push_back({b.name});" + setter = f"{b.name} = {state_vec}[i];" + + getter_logic.append(getter) + setter_logic.append(setter) + if i < len(bindings) - 1: + setter_logic.append(f"i += {num_expr};") + + # Reserve / assert based on the total number of items expression. + num_items = "0" if len(num_exprs) == 0 else " + ".join(num_exprs) + if len(bindings) > 0: + getter_logic.insert(1, f"{state_vec}.reserve({num_items});") + + getter_logic.append(f"return {state_vec};") + + return getter_logic, setter_logic, num_items + + +def process_function(fn: NativeFunction, template: CodeTemplate) -> str: + bindings = extract_bindings(fn) + non_self_bindings = [b for b in bindings if b.name != "self"] + + non_self_args = fn.func.arguments.flat_all[1:] + non_self_value_bindings = [ + dispatcher.argument(a, remove_non_owning_ref_types=True) for a in non_self_args + ] + + # Generate constructor / clone args for the generated struct. + constructor_args = [b.defn() for b in non_self_bindings] + clone_args = [b.name for b in non_self_bindings] + + # Generate state variable declarations for the generated struct. + state_variables = [ + f"{remove_const_ref(b).defn()};" for b in non_self_value_bindings + ] + + # Generate initializer list expressions for the generated struct. + # allow_expensive_conversions=True because we need to store e.g. SymIntArrayRefs as + # vectors. + init_exprs = translate( + non_self_bindings, non_self_value_bindings, allow_expensive_conversions=True + ) + initializers = [] + for b, init_expr in zip(non_self_bindings, init_exprs): + name = b.nctype.name + assert isinstance(name, str) + initializers.append(f"{name}({init_expr.expr})") + + # Generate call to underlying view op + call_input_name = "input_base" + op_call_args = [call_input_name, *(b.name for b in non_self_bindings)] + op_call = CALL_DISPATCH.substitute( + unambiguous_name=fn.func.name.unambiguous_name(), + unpacked_args=op_call_args, + ) + + # Multi-output views additionally require a view_idx for disambiguation. + if returns_multi_tensor(fn): + view_idx_name = "view_idx" + view_idx_typename = "int64_t" + view_idx_decl = f"{view_idx_typename} {view_idx_name}" + constructor_args.append(view_idx_decl) + clone_args.append(view_idx_name) + state_variables.append(f"{view_idx_decl};") + initializers.append(f"{view_idx_name}({view_idx_name})") + op_call += f"[{view_idx_name}]" + + # Generate initializer list for the generated struct. + initializer_list = f": {', '.join(initializers)}" if len(initializers) > 0 else "" + + # Generate getter / setter logic for any symints. + symint_bindings = [ + b + for b in non_self_bindings + if isinstance(b.argument, Argument) and b.argument.type.is_symint_like() + ] + symints_vec_type = NamedCType("symints", VectorCType(BaseCType(SymIntT))) + get_symints, set_symints, num_symints = generate_state_getter_setter( + symint_bindings, symints_vec_type + ) + + # Generate getter / setter logic for any tensors. + tensor_bindings = [ + b + for b in non_self_bindings + if isinstance(b.argument, Argument) and b.argument.type.is_tensor_like() + ] + tensors_vec_type = NamedCType("tensors", VectorCType(BaseCType(tensorT))) + get_tensors, set_tensors, num_tensors = generate_state_getter_setter( + tensor_bindings, tensors_vec_type + ) + + return template.substitute( + op=view_func_name(fn), + uppercase_op=view_func_name(fn, camel_case=False).upper(), + superclass="torch::autograd::ViewFunc", + initializer_list=initializer_list, + state=state_variables, + constructor_args=constructor_args, + clone_args=clone_args, + symints_vec=symints_vec_type.name, + get_symints=get_symints, + set_symints=set_symints, + num_symints=num_symints, + tensors_vec=tensors_vec_type.name, + get_tensors=get_tensors, + set_tensors=set_tensors, + num_tensors=num_tensors, + call_input_name=call_input_name, + op_call=op_call, + ) + + +def gen_view_funcs( + out: str, + fns_with_infos: List[NativeFunctionWithDifferentiabilityInfo], + template_path: str, +) -> None: + # don't need the info parts, just the function + fns = [fn.func for fn in fns_with_infos if use_derived(fn)] + # only want out-of-place views + view_fns = [ + fn for fn in fns if get_view_info(fn) is not None and not modifies_arguments(fn) + ] + + declarations = [process_function(fn, FUNCTION_DECLARATION) for fn in view_fns] + definitions = [process_function(fn, FUNCTION_DEFINITION) for fn in view_fns] + ops_headers = [f"#include " for fn in view_fns] + + file_basename = "ViewFuncs" + fm = FileManager(install_dir=out, template_dir=template_path, dry_run=False) + for suffix in [".h", ".cpp"]: + fname = file_basename + suffix + fm.write_with_template( + fname, + fname, + lambda: { + "generated_comment": "@" + + f"generated from {fm.template_dir_for_comments()}/" + + fname, + "view_func_declarations": declarations, + "view_func_definitions": definitions, + "ops_headers": ops_headers, + }, + ) diff --git a/shared/package-files/07/079a53e755e1b9197940996f01c837443d3e369009e0aa4019915fa23362c5d6/blob b/shared/package-files/07/079a53e755e1b9197940996f01c837443d3e369009e0aa4019915fa23362c5d6/blob new file mode 100644 index 0000000000000000000000000000000000000000..f46c163524b85cb8bee09228b36659b0b90f6803 Binary files /dev/null and b/shared/package-files/07/079a53e755e1b9197940996f01c837443d3e369009e0aa4019915fa23362c5d6/blob differ diff --git a/shared/package-files/07/079acd395f0bc2364bd3c521f19a2e821faed3361a19681d7e7177e306845375/blob b/shared/package-files/07/079acd395f0bc2364bd3c521f19a2e821faed3361a19681d7e7177e306845375/blob new file mode 100644 index 0000000000000000000000000000000000000000..6d699c8486cd20daa8f0b906089e61978cf61ade --- /dev/null +++ b/shared/package-files/07/079acd395f0bc2364bd3c521f19a2e821faed3361a19681d7e7177e306845375/blob @@ -0,0 +1,294 @@ +# Common utility functions used by various script execution tests +# e.g. test_cmd_line, test_cmd_line_script and test_runpy + +import collections +import importlib +import sys +import os +import os.path +import subprocess +import py_compile +import zipfile + +from importlib.util import source_from_cache +from test import support +from test.support.import_helper import make_legacy_pyc + + +# Cached result of the expensive test performed in the function below. +__cached_interp_requires_environment = None + + +def interpreter_requires_environment(): + """ + Returns True if our sys.executable interpreter requires environment + variables in order to be able to run at all. + + This is designed to be used with @unittest.skipIf() to annotate tests + that need to use an assert_python*() function to launch an isolated + mode (-I) or no environment mode (-E) sub-interpreter process. + + A normal build & test does not run into this situation but it can happen + when trying to run the standard library test suite from an interpreter that + doesn't have an obvious home with Python's current home finding logic. + + Setting PYTHONHOME is one way to get most of the testsuite to run in that + situation. PYTHONPATH or PYTHONUSERSITE are other common environment + variables that might impact whether or not the interpreter can start. + """ + global __cached_interp_requires_environment + if __cached_interp_requires_environment is None: + # If PYTHONHOME is set, assume that we need it + if 'PYTHONHOME' in os.environ: + __cached_interp_requires_environment = True + return True + + # Try running an interpreter with -E to see if it works or not. + try: + subprocess.check_call([sys.executable, '-E', + '-c', 'import sys; sys.exit(0)']) + except subprocess.CalledProcessError: + __cached_interp_requires_environment = True + else: + __cached_interp_requires_environment = False + + return __cached_interp_requires_environment + + +class _PythonRunResult(collections.namedtuple("_PythonRunResult", + ("rc", "out", "err"))): + """Helper for reporting Python subprocess run results""" + def fail(self, cmd_line): + """Provide helpful details about failed subcommand runs""" + # Limit to 80 lines to ASCII characters + maxlen = 80 * 100 + out, err = self.out, self.err + if len(out) > maxlen: + out = b'(... truncated stdout ...)' + out[-maxlen:] + if len(err) > maxlen: + err = b'(... truncated stderr ...)' + err[-maxlen:] + out = out.decode('ascii', 'replace').rstrip() + err = err.decode('ascii', 'replace').rstrip() + raise AssertionError("Process return code is %d\n" + "command line: %r\n" + "\n" + "stdout:\n" + "---\n" + "%s\n" + "---\n" + "\n" + "stderr:\n" + "---\n" + "%s\n" + "---" + % (self.rc, cmd_line, + out, + err)) + + +# Executing the interpreter in a subprocess +def run_python_until_end(*args, **env_vars): + env_required = interpreter_requires_environment() + cwd = env_vars.pop('__cwd', None) + if '__isolated' in env_vars: + isolated = env_vars.pop('__isolated') + else: + isolated = not env_vars and not env_required + cmd_line = [sys.executable, '-X', 'faulthandler'] + if isolated: + # isolated mode: ignore Python environment variables, ignore user + # site-packages, and don't add the current directory to sys.path + cmd_line.append('-I') + elif not env_vars and not env_required: + # ignore Python environment variables + cmd_line.append('-E') + + # But a special flag that can be set to override -- in this case, the + # caller is responsible to pass the full environment. + if env_vars.pop('__cleanenv', None): + env = {} + if sys.platform == 'win32': + # Windows requires at least the SYSTEMROOT environment variable to + # start Python. + env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] + + # Other interesting environment variables, not copied currently: + # COMSPEC, HOME, PATH, TEMP, TMPDIR, TMP. + else: + # Need to preserve the original environment, for in-place testing of + # shared library builds. + env = os.environ.copy() + + # set TERM='' unless the TERM environment variable is passed explicitly + # see issues #11390 and #18300 + if 'TERM' not in env_vars: + env['TERM'] = '' + + env.update(env_vars) + cmd_line.extend(args) + proc = subprocess.Popen(cmd_line, stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + env=env, cwd=cwd) + with proc: + try: + out, err = proc.communicate() + finally: + proc.kill() + subprocess._cleanup() + rc = proc.returncode + return _PythonRunResult(rc, out, err), cmd_line + + +def _assert_python(expected_success, /, *args, **env_vars): + res, cmd_line = run_python_until_end(*args, **env_vars) + if (res.rc and expected_success) or (not res.rc and not expected_success): + res.fail(cmd_line) + return res + + +def assert_python_ok(*args, **env_vars): + """ + Assert that running the interpreter with `args` and optional environment + variables `env_vars` succeeds (rc == 0) and return a (return code, stdout, + stderr) tuple. + + If the __cleanenv keyword is set, env_vars is used as a fresh environment. + + Python is started in isolated mode (command line option -I), + except if the __isolated keyword is set to False. + """ + return _assert_python(True, *args, **env_vars) + + +def assert_python_failure(*args, **env_vars): + """ + Assert that running the interpreter with `args` and optional environment + variables `env_vars` fails (rc != 0) and return a (return code, stdout, + stderr) tuple. + + See assert_python_ok() for more options. + """ + return _assert_python(False, *args, **env_vars) + + +def spawn_python(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw): + """Run a Python subprocess with the given arguments. + + kw is extra keyword args to pass to subprocess.Popen. Returns a Popen + object. + """ + cmd_line = [sys.executable] + if not interpreter_requires_environment(): + cmd_line.append('-E') + cmd_line.extend(args) + # Under Fedora (?), GNU readline can output junk on stderr when initialized, + # depending on the TERM setting. Setting TERM=vt100 is supposed to disable + # that. References: + # - http://reinout.vanrees.org/weblog/2009/08/14/readline-invisible-character-hack.html + # - http://stackoverflow.com/questions/15760712/python-readline-module-prints-escape-character-during-import + # - http://lists.gnu.org/archive/html/bug-readline/2007-08/msg00004.html + env = kw.setdefault('env', dict(os.environ)) + env['TERM'] = 'vt100' + return subprocess.Popen(cmd_line, stdin=subprocess.PIPE, + stdout=stdout, stderr=stderr, + **kw) + + +def kill_python(p): + """Run the given Popen process until completion and return stdout.""" + p.stdin.close() + data = p.stdout.read() + p.stdout.close() + # try to cleanup the child so we don't appear to leak when running + # with regrtest -R. + p.wait() + subprocess._cleanup() + return data + + +def make_script(script_dir, script_basename, source, omit_suffix=False): + script_filename = script_basename + if not omit_suffix: + script_filename += os.extsep + 'py' + script_name = os.path.join(script_dir, script_filename) + # The script should be encoded to UTF-8, the default string encoding + with open(script_name, 'w', encoding='utf-8') as script_file: + script_file.write(source) + importlib.invalidate_caches() + return script_name + + +def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None): + zip_filename = zip_basename+os.extsep+'zip' + zip_name = os.path.join(zip_dir, zip_filename) + with zipfile.ZipFile(zip_name, 'w') as zip_file: + if name_in_zip is None: + parts = script_name.split(os.sep) + if len(parts) >= 2 and parts[-2] == '__pycache__': + legacy_pyc = make_legacy_pyc(source_from_cache(script_name)) + name_in_zip = os.path.basename(legacy_pyc) + script_name = legacy_pyc + else: + name_in_zip = os.path.basename(script_name) + zip_file.write(script_name, name_in_zip) + #if test.support.verbose: + # with zipfile.ZipFile(zip_name, 'r') as zip_file: + # print 'Contents of %r:' % zip_name + # zip_file.printdir() + return zip_name, os.path.join(zip_name, name_in_zip) + + +def make_pkg(pkg_dir, init_source=''): + os.mkdir(pkg_dir) + make_script(pkg_dir, '__init__', init_source) + + +def make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename, + source, depth=1, compiled=False): + unlink = [] + init_name = make_script(zip_dir, '__init__', '') + unlink.append(init_name) + init_basename = os.path.basename(init_name) + script_name = make_script(zip_dir, script_basename, source) + unlink.append(script_name) + if compiled: + init_name = py_compile.compile(init_name, doraise=True) + script_name = py_compile.compile(script_name, doraise=True) + unlink.extend((init_name, script_name)) + pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)] + script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name)) + zip_filename = zip_basename+os.extsep+'zip' + zip_name = os.path.join(zip_dir, zip_filename) + with zipfile.ZipFile(zip_name, 'w') as zip_file: + for name in pkg_names: + init_name_in_zip = os.path.join(name, init_basename) + zip_file.write(init_name, init_name_in_zip) + zip_file.write(script_name, script_name_in_zip) + for name in unlink: + os.unlink(name) + #if test.support.verbose: + # with zipfile.ZipFile(zip_name, 'r') as zip_file: + # print 'Contents of %r:' % zip_name + # zip_file.printdir() + return zip_name, os.path.join(zip_name, script_name_in_zip) + + +def run_test_script(script): + # use -u to try to get the full output if the test hangs or crash + if support.verbose: + def title(text): + return f"===== {text} ======" + + name = f"script {os.path.basename(script)}" + print() + print(title(name), flush=True) + # In verbose mode, the child process inherit stdout and stdout, + # to see output in realtime and reduce the risk of losing output. + args = [sys.executable, "-E", "-X", "faulthandler", "-u", script, "-v"] + proc = subprocess.run(args) + print(title(f"{name} completed: exit code {proc.returncode}"), + flush=True) + if proc.returncode: + raise AssertionError(f"{name} failed") + else: + assert_python_ok("-u", script, "-v") diff --git a/shared/package-files/07/079c3711962ff08177d6851af6de157d6353461185f7aef7227d5ee8272b5b16/blob b/shared/package-files/07/079c3711962ff08177d6851af6de157d6353461185f7aef7227d5ee8272b5b16/blob new file mode 100644 index 0000000000000000000000000000000000000000..b78eea11b9f8901379626fc9ec13a1522a39f4e0 --- /dev/null +++ b/shared/package-files/07/079c3711962ff08177d6851af6de157d6353461185f7aef7227d5ee8272b5b16/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:079c3711962ff08177d6851af6de157d6353461185f7aef7227d5ee8272b5b16 +size 386600 diff --git a/shared/package-files/07/079d8be918d4e69bd3effa36026a1e5764ebd6e3c99a197e03abc63ba609cbc2/blob b/shared/package-files/07/079d8be918d4e69bd3effa36026a1e5764ebd6e3c99a197e03abc63ba609cbc2/blob new file mode 100644 index 0000000000000000000000000000000000000000..2beb5d4909a924031945afb9aafe7f0fc0d2bf93 --- /dev/null +++ b/shared/package-files/07/079d8be918d4e69bd3effa36026a1e5764ebd6e3c99a197e03abc63ba609cbc2/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:079d8be918d4e69bd3effa36026a1e5764ebd6e3c99a197e03abc63ba609cbc2 +size 104024 diff --git a/shared/package-files/07/079ef11920a5c9e475f7c18e1e491eaa05018f1bad22b1cf906a720a7d3897e0/blob b/shared/package-files/07/079ef11920a5c9e475f7c18e1e491eaa05018f1bad22b1cf906a720a7d3897e0/blob new file mode 100644 index 0000000000000000000000000000000000000000..4038b5277cc6c92ed3e989f7f9624d232d5fb001 --- /dev/null +++ b/shared/package-files/07/079ef11920a5c9e475f7c18e1e491eaa05018f1bad22b1cf906a720a7d3897e0/blob @@ -0,0 +1,188 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.0 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.3") + message(FATAL_ERROR "CMake >= 2.8.3 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.3...3.24) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS c10_cuda c10 torch_cpu torch_cpu_library torch_cuda torch_cuda_library torch torch_library) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target c10_cuda +add_library(c10_cuda SHARED IMPORTED) + +set_target_properties(c10_cuda PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "c10;torch::cudart" +) + +# Create imported target c10 +add_library(c10 SHARED IMPORTED) + +set_target_properties(c10 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +# Create imported target torch_cpu +add_library(torch_cpu SHARED IMPORTED) + +set_target_properties(torch_cpu PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "USE_DISTRIBUTED;USE_C10D_GLOO;USE_RPC;USE_TENSORPIPE" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "protobuf::libprotobuf;c10;caffe2::mkl" +) + +# Create imported target torch_cpu_library +add_library(torch_cpu_library INTERFACE IMPORTED) + +set_target_properties(torch_cpu_library PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "\$" + INTERFACE_COMPILE_OPTIONS "\$" + INTERFACE_INCLUDE_DIRECTORIES "\$" + INTERFACE_LINK_LIBRARIES "-Wl,--no-as-needed,\"\$\" -Wl,--as-needed;\$" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "\$" +) + +# Create imported target torch_cuda +add_library(torch_cuda SHARED IMPORTED) + +set_target_properties(torch_cuda PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "USE_C10D_NCCL" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "torch::cudart;c10_cuda;torch::nvtoolsext;torch_cpu_library" +) + +# Create imported target torch_cuda_library +add_library(torch_cuda_library INTERFACE IMPORTED) + +set_target_properties(torch_cuda_library PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "\$" + INTERFACE_COMPILE_OPTIONS "\$" + INTERFACE_INCLUDE_DIRECTORIES "\$" + INTERFACE_LINK_LIBRARIES "-Wl,--no-as-needed,\"\$\" -Wl,--as-needed;\$" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "\$" +) + +# Create imported target torch +add_library(torch SHARED IMPORTED) + +set_target_properties(torch PROPERTIES + INTERFACE_LINK_LIBRARIES "torch_cpu_library;torch_cuda_library" +) + +# Create imported target torch_library +add_library(torch_library INTERFACE IMPORTED) + +set_target_properties(torch_library PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "\$" + INTERFACE_COMPILE_OPTIONS "\$" + INTERFACE_INCLUDE_DIRECTORIES "\$" + INTERFACE_LINK_LIBRARIES "-Wl,--no-as-needed,\"\$\" -Wl,--as-needed;\$" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "\$" +) + +if(CMAKE_VERSION VERSION_LESS 3.0.0) + message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.") +endif() + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/Caffe2Targets-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# Make sure the targets which have been exported in some other +# export set exist. +unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets) +foreach(_target "protobuf::libprotobuf" ) + if(NOT TARGET "${_target}" ) + set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets "${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets} ${_target}") + endif() +endforeach() + +if(DEFINED ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets) + if(CMAKE_FIND_PACKAGE_NAME) + set( ${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE) + set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "The following imported targets are referenced, but are missing: ${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}") + else() + message(FATAL_ERROR "The following imported targets are referenced, but are missing: ${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}") + endif() +endif() +unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/shared/package-files/07/079ef68725ab5161be4c00005eb34d013e00832500989e25be0a703240f3ba79/blob b/shared/package-files/07/079ef68725ab5161be4c00005eb34d013e00832500989e25be0a703240f3ba79/blob new file mode 100644 index 0000000000000000000000000000000000000000..1c82c99b686e2be8e34a1b6bc45dacce15532082 --- /dev/null +++ b/shared/package-files/07/079ef68725ab5161be4c00005eb34d013e00832500989e25be0a703240f3ba79/blob @@ -0,0 +1,17 @@ +__all__: list[str] + +class NumpyVersion: + vstring: str + version: str + major: int + minor: int + bugfix: int + pre_release: str + is_devversion: bool + def __init__(self, vstring: str) -> None: ... + def __lt__(self, other: str | NumpyVersion) -> bool: ... + def __le__(self, other: str | NumpyVersion) -> bool: ... + def __eq__(self, other: str | NumpyVersion) -> bool: ... # type: ignore[override] + def __ne__(self, other: str | NumpyVersion) -> bool: ... # type: ignore[override] + def __gt__(self, other: str | NumpyVersion) -> bool: ... + def __ge__(self, other: str | NumpyVersion) -> bool: ... diff --git a/shared/package-files/07/07a1b40f53cb36d67af1f47749fce9d7658da519ae7448c134984386441b6e4c/blob b/shared/package-files/07/07a1b40f53cb36d67af1f47749fce9d7658da519ae7448c134984386441b6e4c/blob new file mode 100644 index 0000000000000000000000000000000000000000..666f2ea3f067496a58a7d0c5c7bdc9ad6f7432d8 --- /dev/null +++ b/shared/package-files/07/07a1b40f53cb36d67af1f47749fce9d7658da519ae7448c134984386441b6e4c/blob @@ -0,0 +1,29 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_log1p_out : public at::meta::structured_log1p { +void impl(const at::Tensor & self, const at::Tensor & out); +}; +TORCH_API at::Tensor log1p_sparse(const at::Tensor & self); +TORCH_API at::Tensor & log1p_sparse_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & log1p_sparse_(at::Tensor & self); +TORCH_API at::Tensor log1p_sparse_csr(const at::Tensor & self); +TORCH_API at::Tensor & log1p_sparse_csr_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & log1p_sparse_csr_(at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/07/07a20f36f715a450cfba2f04e465cdf7178051d629f9249ae58b414fedce289d/blob b/shared/package-files/07/07a20f36f715a450cfba2f04e465cdf7178051d629f9249ae58b414fedce289d/blob new file mode 100644 index 0000000000000000000000000000000000000000..c13461b594917d8764a6e17abe694c3994f64af9 --- /dev/null +++ b/shared/package-files/07/07a20f36f715a450cfba2f04e465cdf7178051d629f9249ae58b414fedce289d/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API native_dropout { + using schema = ::std::tuple (const at::Tensor &, double, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::native_dropout") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "native_dropout(Tensor input, float p, bool? train) -> (Tensor, Tensor)") + static ::std::tuple call(const at::Tensor & input, double p, c10::optional train); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & input, double p, c10::optional train); +}; + +struct TORCH_API native_dropout_out { + using schema = ::std::tuple (const at::Tensor &, double, c10::optional, at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::native_dropout") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "native_dropout.out(Tensor input, float p, bool? train, *, Tensor(a!) out0, Tensor(b!) out1) -> (Tensor(a!), Tensor(b!))") + static ::std::tuple call(const at::Tensor & input, double p, c10::optional train, at::Tensor & out0, at::Tensor & out1); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & input, double p, c10::optional train, at::Tensor & out0, at::Tensor & out1); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/07/07a5e9819f727b4986ad2829c7a29a6320d42575f720eb24d71b7fef573a0286/blob b/shared/package-files/07/07a5e9819f727b4986ad2829c7a29a6320d42575f720eb24d71b7fef573a0286/blob new file mode 100644 index 0000000000000000000000000000000000000000..0744f229d697ca3ed1b1b257bfdb70e3eecf0b9e --- /dev/null +++ b/shared/package-files/07/07a5e9819f727b4986ad2829c7a29a6320d42575f720eb24d71b7fef573a0286/blob @@ -0,0 +1,153 @@ +Copyright (c) 2006-2023 SymPy Development Team + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + a. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + b. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + c. Neither the name of SymPy nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +-------------------------------------------------------------------------------- + +Patches that were taken from the Diofant project (https://github.com/diofant/diofant) +are licensed as: + +Copyright (c) 2006-2018 SymPy Development Team, + 2013-2023 Sergey B Kirpichev + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + a. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + b. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + c. Neither the name of Diofant or SymPy nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +-------------------------------------------------------------------------------- + +Submodules taken from the multipledispatch project (https://github.com/mrocklin/multipledispatch) +are licensed as: + +Copyright (c) 2014 Matthew Rocklin + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + a. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + b. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + c. Neither the name of multipledispatch nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +-------------------------------------------------------------------------------- + +The files under the directory sympy/parsing/autolev/tests/pydy-example-repo +are directly copied from PyDy project and are licensed as: + +Copyright (c) 2009-2023, PyDy Authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of this project nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL PYDY AUTHORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------------------- + +The files under the directory sympy/parsing/latex +are directly copied from latex2sympy project and are licensed as: + +Copyright 2016, latex2sympy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/shared/package-files/07/07a60a6bf5b0ae455f4d4cb1df5be25ded300842e428a03bb690ab5a0567c013/blob b/shared/package-files/07/07a60a6bf5b0ae455f4d4cb1df5be25ded300842e428a03bb690ab5a0567c013/blob new file mode 100644 index 0000000000000000000000000000000000000000..9abe41e999f2aea734b1da21d597087852eed869 --- /dev/null +++ b/shared/package-files/07/07a60a6bf5b0ae455f4d4cb1df5be25ded300842e428a03bb690ab5a0567c013/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07a60a6bf5b0ae455f4d4cb1df5be25ded300842e428a03bb690ab5a0567c013 +size 1035738 diff --git a/shared/package-files/07/07a624ecafa8bb237e5415f2703255e2c398acfc857fc6bf43e62dc7bbead66a/blob b/shared/package-files/07/07a624ecafa8bb237e5415f2703255e2c398acfc857fc6bf43e62dc7bbead66a/blob new file mode 100644 index 0000000000000000000000000000000000000000..e12edd925f22d77d2fdba7ec7e9b6a037e03eff4 --- /dev/null +++ b/shared/package-files/07/07a624ecafa8bb237e5415f2703255e2c398acfc857fc6bf43e62dc7bbead66a/blob @@ -0,0 +1,379 @@ +from sympy.physics.vector import dynamicsymbols, Point, ReferenceFrame +from sympy.testing.pytest import raises, ignore_warnings +import warnings + +def test_point_v1pt_theorys(): + q, q2 = dynamicsymbols('q q2') + qd, q2d = dynamicsymbols('q q2', 1) + qdd, q2dd = dynamicsymbols('q q2', 2) + N = ReferenceFrame('N') + B = ReferenceFrame('B') + B.set_ang_vel(N, qd * B.z) + O = Point('O') + P = O.locatenew('P', B.x) + P.set_vel(B, 0) + O.set_vel(N, 0) + assert P.v1pt_theory(O, N, B) == qd * B.y + O.set_vel(N, N.x) + assert P.v1pt_theory(O, N, B) == N.x + qd * B.y + P.set_vel(B, B.z) + assert P.v1pt_theory(O, N, B) == B.z + N.x + qd * B.y + + +def test_point_a1pt_theorys(): + q, q2 = dynamicsymbols('q q2') + qd, q2d = dynamicsymbols('q q2', 1) + qdd, q2dd = dynamicsymbols('q q2', 2) + N = ReferenceFrame('N') + B = ReferenceFrame('B') + B.set_ang_vel(N, qd * B.z) + O = Point('O') + P = O.locatenew('P', B.x) + P.set_vel(B, 0) + O.set_vel(N, 0) + assert P.a1pt_theory(O, N, B) == -(qd**2) * B.x + qdd * B.y + P.set_vel(B, q2d * B.z) + assert P.a1pt_theory(O, N, B) == -(qd**2) * B.x + qdd * B.y + q2dd * B.z + O.set_vel(N, q2d * B.x) + assert P.a1pt_theory(O, N, B) == ((q2dd - qd**2) * B.x + (q2d * qd + qdd) * B.y + + q2dd * B.z) + + +def test_point_v2pt_theorys(): + q = dynamicsymbols('q') + qd = dynamicsymbols('q', 1) + N = ReferenceFrame('N') + B = N.orientnew('B', 'Axis', [q, N.z]) + O = Point('O') + P = O.locatenew('P', 0) + O.set_vel(N, 0) + assert P.v2pt_theory(O, N, B) == 0 + P = O.locatenew('P', B.x) + assert P.v2pt_theory(O, N, B) == (qd * B.z ^ B.x) + O.set_vel(N, N.x) + assert P.v2pt_theory(O, N, B) == N.x + qd * B.y + + +def test_point_a2pt_theorys(): + q = dynamicsymbols('q') + qd = dynamicsymbols('q', 1) + qdd = dynamicsymbols('q', 2) + N = ReferenceFrame('N') + B = N.orientnew('B', 'Axis', [q, N.z]) + O = Point('O') + P = O.locatenew('P', 0) + O.set_vel(N, 0) + assert P.a2pt_theory(O, N, B) == 0 + P.set_pos(O, B.x) + assert P.a2pt_theory(O, N, B) == (-qd**2) * B.x + (qdd) * B.y + + +def test_point_funcs(): + q, q2 = dynamicsymbols('q q2') + qd, q2d = dynamicsymbols('q q2', 1) + qdd, q2dd = dynamicsymbols('q q2', 2) + N = ReferenceFrame('N') + B = ReferenceFrame('B') + B.set_ang_vel(N, 5 * B.y) + O = Point('O') + P = O.locatenew('P', q * B.x) + assert P.pos_from(O) == q * B.x + P.set_vel(B, qd * B.x + q2d * B.y) + assert P.vel(B) == qd * B.x + q2d * B.y + O.set_vel(N, 0) + assert O.vel(N) == 0 + assert P.a1pt_theory(O, N, B) == ((-25 * q + qdd) * B.x + (q2dd) * B.y + + (-10 * qd) * B.z) + + B = N.orientnew('B', 'Axis', [q, N.z]) + O = Point('O') + P = O.locatenew('P', 10 * B.x) + O.set_vel(N, 5 * N.x) + assert O.vel(N) == 5 * N.x + assert P.a2pt_theory(O, N, B) == (-10 * qd**2) * B.x + (10 * qdd) * B.y + + B.set_ang_vel(N, 5 * B.y) + O = Point('O') + P = O.locatenew('P', q * B.x) + P.set_vel(B, qd * B.x + q2d * B.y) + O.set_vel(N, 0) + assert P.v1pt_theory(O, N, B) == qd * B.x + q2d * B.y - 5 * q * B.z + + +def test_point_pos(): + q = dynamicsymbols('q') + N = ReferenceFrame('N') + B = N.orientnew('B', 'Axis', [q, N.z]) + O = Point('O') + P = O.locatenew('P', 10 * N.x + 5 * B.x) + assert P.pos_from(O) == 10 * N.x + 5 * B.x + Q = P.locatenew('Q', 10 * N.y + 5 * B.y) + assert Q.pos_from(P) == 10 * N.y + 5 * B.y + assert Q.pos_from(O) == 10 * N.x + 10 * N.y + 5 * B.x + 5 * B.y + assert O.pos_from(Q) == -10 * N.x - 10 * N.y - 5 * B.x - 5 * B.y + +def test_point_partial_velocity(): + + N = ReferenceFrame('N') + A = ReferenceFrame('A') + + p = Point('p') + + u1, u2 = dynamicsymbols('u1, u2') + + p.set_vel(N, u1 * A.x + u2 * N.y) + + assert p.partial_velocity(N, u1) == A.x + assert p.partial_velocity(N, u1, u2) == (A.x, N.y) + raises(ValueError, lambda: p.partial_velocity(A, u1)) + +def test_point_vel(): #Basic functionality + q1, q2 = dynamicsymbols('q1 q2') + N = ReferenceFrame('N') + B = ReferenceFrame('B') + Q = Point('Q') + O = Point('O') + Q.set_pos(O, q1 * N.x) + raises(ValueError , lambda: Q.vel(N)) # Velocity of O in N is not defined + O.set_vel(N, q2 * N.y) + assert O.vel(N) == q2 * N.y + raises(ValueError , lambda : O.vel(B)) #Velocity of O is not defined in B + +def test_auto_point_vel(): + t = dynamicsymbols._t + q1, q2 = dynamicsymbols('q1 q2') + N = ReferenceFrame('N') + B = ReferenceFrame('B') + O = Point('O') + Q = Point('Q') + Q.set_pos(O, q1 * N.x) + O.set_vel(N, q2 * N.y) + assert Q.vel(N) == q1.diff(t) * N.x + q2 * N.y # Velocity of Q using O + P1 = Point('P1') + P1.set_pos(O, q1 * B.x) + P2 = Point('P2') + P2.set_pos(P1, q2 * B.z) + raises(ValueError, lambda : P2.vel(B)) # O's velocity is defined in different frame, and no + #point in between has its velocity defined + raises(ValueError, lambda: P2.vel(N)) # Velocity of O not defined in N + +def test_auto_point_vel_multiple_point_path(): + t = dynamicsymbols._t + q1, q2 = dynamicsymbols('q1 q2') + B = ReferenceFrame('B') + P = Point('P') + P.set_vel(B, q1 * B.x) + P1 = Point('P1') + P1.set_pos(P, q2 * B.y) + P1.set_vel(B, q1 * B.z) + P2 = Point('P2') + P2.set_pos(P1, q1 * B.z) + P3 = Point('P3') + P3.set_pos(P2, 10 * q1 * B.y) + assert P3.vel(B) == 10 * q1.diff(t) * B.y + (q1 + q1.diff(t)) * B.z + +def test_auto_vel_dont_overwrite(): + t = dynamicsymbols._t + q1, q2, u1 = dynamicsymbols('q1, q2, u1') + N = ReferenceFrame('N') + P = Point('P1') + P.set_vel(N, u1 * N.x) + P1 = Point('P1') + P1.set_pos(P, q2 * N.y) + assert P1.vel(N) == q2.diff(t) * N.y + u1 * N.x + assert P.vel(N) == u1 * N.x + P1.set_vel(N, u1 * N.z) + assert P1.vel(N) == u1 * N.z + +def test_auto_point_vel_if_tree_has_vel_but_inappropriate_pos_vector(): + q1, q2 = dynamicsymbols('q1 q2') + B = ReferenceFrame('B') + S = ReferenceFrame('S') + P = Point('P') + P.set_vel(B, q1 * B.x) + P1 = Point('P1') + P1.set_pos(P, S.y) + raises(ValueError, lambda : P1.vel(B)) # P1.pos_from(P) can't be expressed in B + raises(ValueError, lambda : P1.vel(S)) # P.vel(S) not defined + +def test_auto_point_vel_shortest_path(): + t = dynamicsymbols._t + q1, q2, u1, u2 = dynamicsymbols('q1 q2 u1 u2') + B = ReferenceFrame('B') + P = Point('P') + P.set_vel(B, u1 * B.x) + P1 = Point('P1') + P1.set_pos(P, q2 * B.y) + P1.set_vel(B, q1 * B.z) + P2 = Point('P2') + P2.set_pos(P1, q1 * B.z) + P3 = Point('P3') + P3.set_pos(P2, 10 * q1 * B.y) + P4 = Point('P4') + P4.set_pos(P3, q1 * B.x) + O = Point('O') + O.set_vel(B, u2 * B.y) + O1 = Point('O1') + O1.set_pos(O, q2 * B.z) + P4.set_pos(O1, q1 * B.x + q2 * B.z) + with warnings.catch_warnings(): #There are two possible paths in this point tree, thus a warning is raised + warnings.simplefilter('error') + with ignore_warnings(UserWarning): + assert P4.vel(B) == q1.diff(t) * B.x + u2 * B.y + 2 * q2.diff(t) * B.z + +def test_auto_point_vel_connected_frames(): + t = dynamicsymbols._t + q, q1, q2, u = dynamicsymbols('q q1 q2 u') + N = ReferenceFrame('N') + B = ReferenceFrame('B') + O = Point('O') + O.set_vel(N, u * N.x) + P = Point('P') + P.set_pos(O, q1 * N.x + q2 * B.y) + raises(ValueError, lambda: P.vel(N)) + N.orient(B, 'Axis', (q, B.x)) + assert P.vel(N) == (u + q1.diff(t)) * N.x + q2.diff(t) * B.y - q2 * q.diff(t) * B.z + +def test_auto_point_vel_multiple_paths_warning_arises(): + q, u = dynamicsymbols('q u') + N = ReferenceFrame('N') + O = Point('O') + P = Point('P') + Q = Point('Q') + R = Point('R') + P.set_vel(N, u * N.x) + Q.set_vel(N, u *N.y) + R.set_vel(N, u * N.z) + O.set_pos(P, q * N.z) + O.set_pos(Q, q * N.y) + O.set_pos(R, q * N.x) + with warnings.catch_warnings(): #There are two possible paths in this point tree, thus a warning is raised + warnings.simplefilter("error") + raises(UserWarning ,lambda: O.vel(N)) + +def test_auto_vel_cyclic_warning_arises(): + P = Point('P') + P1 = Point('P1') + P2 = Point('P2') + P3 = Point('P3') + N = ReferenceFrame('N') + P.set_vel(N, N.x) + P1.set_pos(P, N.x) + P2.set_pos(P1, N.y) + P3.set_pos(P2, N.z) + P1.set_pos(P3, N.x + N.y) + with warnings.catch_warnings(): #The path is cyclic at P1, thus a warning is raised + warnings.simplefilter("error") + raises(UserWarning ,lambda: P2.vel(N)) + +def test_auto_vel_cyclic_warning_msg(): + P = Point('P') + P1 = Point('P1') + P2 = Point('P2') + P3 = Point('P3') + N = ReferenceFrame('N') + P.set_vel(N, N.x) + P1.set_pos(P, N.x) + P2.set_pos(P1, N.y) + P3.set_pos(P2, N.z) + P1.set_pos(P3, N.x + N.y) + with warnings.catch_warnings(record = True) as w: #The path is cyclic at P1, thus a warning is raised + warnings.simplefilter("always") + P2.vel(N) + assert issubclass(w[-1].category, UserWarning) + assert 'Kinematic loops are defined among the positions of points. This is likely not desired and may cause errors in your calculations.' in str(w[-1].message) + +def test_auto_vel_multiple_path_warning_msg(): + N = ReferenceFrame('N') + O = Point('O') + P = Point('P') + Q = Point('Q') + P.set_vel(N, N.x) + Q.set_vel(N, N.y) + O.set_pos(P, N.z) + O.set_pos(Q, N.y) + with warnings.catch_warnings(record = True) as w: #There are two possible paths in this point tree, thus a warning is raised + warnings.simplefilter("always") + O.vel(N) + assert issubclass(w[-1].category, UserWarning) + assert 'Velocity automatically calculated based on point' in str(w[-1].message) + assert 'Velocities from these points are not necessarily the same. This may cause errors in your calculations.' in str(w[-1].message) + +def test_auto_vel_derivative(): + q1, q2 = dynamicsymbols('q1:3') + u1, u2 = dynamicsymbols('u1:3', 1) + A = ReferenceFrame('A') + B = ReferenceFrame('B') + C = ReferenceFrame('C') + B.orient_axis(A, A.z, q1) + B.set_ang_vel(A, u1 * A.z) + C.orient_axis(B, B.z, q2) + C.set_ang_vel(B, u2 * B.z) + + Am = Point('Am') + Am.set_vel(A, 0) + Bm = Point('Bm') + Bm.set_pos(Am, B.x) + Bm.set_vel(B, 0) + Bm.set_vel(C, 0) + Cm = Point('Cm') + Cm.set_pos(Bm, C.x) + Cm.set_vel(C, 0) + temp = Cm._vel_dict.copy() + assert Cm.vel(A) == (u1 * B.y + (u1 + u2) * C.y) + Cm._vel_dict = temp + Cm.v2pt_theory(Bm, B, C) + assert Cm.vel(A) == (u1 * B.y + (u1 + u2) * C.y) + +def test_auto_point_acc_zero_vel(): + N = ReferenceFrame('N') + O = Point('O') + O.set_vel(N, 0) + assert O.acc(N) == 0 * N.x + +def test_auto_point_acc_compute_vel(): + t = dynamicsymbols._t + q1 = dynamicsymbols('q1') + N = ReferenceFrame('N') + A = ReferenceFrame('A') + A.orient_axis(N, N.z, q1) + + O = Point('O') + O.set_vel(N, 0) + P = Point('P') + P.set_pos(O, A.x) + assert P.acc(N) == -q1.diff(t) ** 2 * A.x + q1.diff(t, 2) * A.y + +def test_auto_acc_derivative(): + # Tests whether the Point.acc method gives the correct acceleration of the + # end point of two linkages in series, while getting minimal information. + q1, q2 = dynamicsymbols('q1:3') + u1, u2 = dynamicsymbols('q1:3', 1) + v1, v2 = dynamicsymbols('q1:3', 2) + A = ReferenceFrame('A') + B = ReferenceFrame('B') + C = ReferenceFrame('C') + B.orient_axis(A, A.z, q1) + C.orient_axis(B, B.z, q2) + + Am = Point('Am') + Am.set_vel(A, 0) + Bm = Point('Bm') + Bm.set_pos(Am, B.x) + Bm.set_vel(B, 0) + Bm.set_vel(C, 0) + Cm = Point('Cm') + Cm.set_pos(Bm, C.x) + Cm.set_vel(C, 0) + + # Copy dictionaries to later check the calculation using the 2pt_theories + Bm_vel_dict, Cm_vel_dict = Bm._vel_dict.copy(), Cm._vel_dict.copy() + Bm_acc_dict, Cm_acc_dict = Bm._acc_dict.copy(), Cm._acc_dict.copy() + check = -u1 ** 2 * B.x + v1 * B.y - (u1 + u2) ** 2 * C.x + (v1 + v2) * C.y + assert Cm.acc(A) == check + Bm._vel_dict, Cm._vel_dict = Bm_vel_dict, Cm_vel_dict + Bm._acc_dict, Cm._acc_dict = Bm_acc_dict, Cm_acc_dict + Bm.v2pt_theory(Am, A, B) + Cm.v2pt_theory(Bm, A, C) + Bm.a2pt_theory(Am, A, B) + assert Cm.a2pt_theory(Bm, A, C) == check diff --git a/shared/package-files/07/07a6969f72d88a5425c284dc4fd347e62c71b51d64c04fa21b08a701fb6d7708/blob b/shared/package-files/07/07a6969f72d88a5425c284dc4fd347e62c71b51d64c04fa21b08a701fb6d7708/blob new file mode 100644 index 0000000000000000000000000000000000000000..59e32c2727a24dce40a1a1e8bb1413593c0c36ad --- /dev/null +++ b/shared/package-files/07/07a6969f72d88a5425c284dc4fd347e62c71b51d64c04fa21b08a701fb6d7708/blob @@ -0,0 +1,6 @@ +0.01644943736,0.01188992929 +0.04268678754,0.03459950431 +0.1009079989,0.0893985118 +0.02284120863,0.02330930405 +0.06341353897,0.06461046015 +0.02303538662,0.02247966933 diff --git a/shared/package-files/07/07a73fc7db37391c062c97192569d730bfb241ca1016985fc38ca80b1ea60f28/blob b/shared/package-files/07/07a73fc7db37391c062c97192569d730bfb241ca1016985fc38ca80b1ea60f28/blob new file mode 100644 index 0000000000000000000000000000000000000000..775f364d7b4cdd0d3a16ae1b47915a22919262cb --- /dev/null +++ b/shared/package-files/07/07a73fc7db37391c062c97192569d730bfb241ca1016985fc38ca80b1ea60f28/blob @@ -0,0 +1,28 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor upsample_bilinear2d(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt); +TORCH_API at::Tensor upsample_bilinear2d_symint(const at::Tensor & self, c10::SymIntArrayRef output_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt); +TORCH_API at::Tensor & upsample_bilinear2d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt); +TORCH_API at::Tensor & upsample_bilinear2d_outf(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional scales_h, c10::optional scales_w, at::Tensor & out); +TORCH_API at::Tensor & upsample_bilinear2d_symint_out(at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef output_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt); +TORCH_API at::Tensor & upsample_bilinear2d_symint_outf(const at::Tensor & self, c10::SymIntArrayRef output_size, bool align_corners, c10::optional scales_h, c10::optional scales_w, at::Tensor & out); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/07/07a76b312b2eeed12243ac30759d10c542c5bcfc2efed400995b04bbea3f571f/blob b/shared/package-files/07/07a76b312b2eeed12243ac30759d10c542c5bcfc2efed400995b04bbea3f571f/blob new file mode 100644 index 0000000000000000000000000000000000000000..7463a8608291c9e9f580a3afe8a774a1b3f7e665 --- /dev/null +++ b/shared/package-files/07/07a76b312b2eeed12243ac30759d10c542c5bcfc2efed400995b04bbea3f571f/blob @@ -0,0 +1,665 @@ +import warnings + +import numpy as np +import pytest +import scipy.sparse as sp + +from sklearn import clone +from sklearn.preprocessing import KBinsDiscretizer, OneHotEncoder +from sklearn.utils._testing import ( + assert_allclose, + assert_allclose_dense_sparse, + assert_array_almost_equal, + assert_array_equal, + ignore_warnings, +) + +X = [[-2, 1.5, -4, -1], [-1, 2.5, -3, -0.5], [0, 3.5, -2, 0.5], [1, 4.5, -1, 2]] + + +@pytest.mark.parametrize( + "strategy, quantile_method, expected, sample_weight", + [ + ( + "uniform", + "warn", # default, will not warn when strategy != "quantile" + [[0, 0, 0, 0], [1, 1, 1, 0], [2, 2, 2, 1], [2, 2, 2, 2]], + None, + ), + ( + "kmeans", + "warn", # default, will not warn when strategy != "quantile" + [[0, 0, 0, 0], [0, 0, 0, 0], [1, 1, 1, 1], [2, 2, 2, 2]], + None, + ), + ( + "quantile", + "averaged_inverted_cdf", + [[0, 0, 0, 0], [1, 1, 1, 1], [2, 2, 2, 2], [2, 2, 2, 2]], + None, + ), + ( + "uniform", + "warn", # default, will not warn when strategy != "quantile" + [[0, 0, 0, 0], [1, 1, 1, 0], [2, 2, 2, 1], [2, 2, 2, 2]], + [1, 1, 2, 1], + ), + ( + "uniform", + "warn", # default, will not warn when strategy != "quantile" + [[0, 0, 0, 0], [1, 1, 1, 0], [2, 2, 2, 1], [2, 2, 2, 2]], + [1, 1, 1, 1], + ), + ( + "quantile", + "averaged_inverted_cdf", + [[0, 0, 0, 0], [1, 1, 1, 1], [2, 2, 2, 2], [2, 2, 2, 2]], + [1, 1, 2, 1], + ), + ( + "quantile", + "averaged_inverted_cdf", + [[0, 0, 0, 0], [1, 1, 1, 1], [2, 2, 2, 2], [2, 2, 2, 2]], + [1, 1, 1, 1], + ), + ( + "quantile", + "averaged_inverted_cdf", + [[0, 0, 0, 0], [0, 0, 0, 0], [1, 1, 1, 1], [2, 2, 2, 2]], + [0, 1, 1, 1], + ), + ( + "kmeans", + "warn", # default, will not warn when strategy != "quantile" + [[0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 1], [2, 2, 2, 2]], + [1, 0, 3, 1], + ), + ( + "kmeans", + "warn", # default, will not warn when strategy != "quantile" + [[0, 0, 0, 0], [0, 0, 0, 0], [1, 1, 1, 1], [2, 2, 2, 2]], + [1, 1, 1, 1], + ), + ], +) +def test_fit_transform(strategy, quantile_method, expected, sample_weight): + est = KBinsDiscretizer( + n_bins=3, encode="ordinal", strategy=strategy, quantile_method=quantile_method + ) + with ignore_warnings(category=UserWarning): + # Ignore the warning on removed small bins. + est.fit(X, sample_weight=sample_weight) + assert_array_equal(est.transform(X), expected) + + +def test_valid_n_bins(): + KBinsDiscretizer(n_bins=2, quantile_method="averaged_inverted_cdf").fit_transform(X) + KBinsDiscretizer( + n_bins=np.array([2])[0], quantile_method="averaged_inverted_cdf" + ).fit_transform(X) + assert KBinsDiscretizer(n_bins=2, quantile_method="averaged_inverted_cdf").fit( + X + ).n_bins_.dtype == np.dtype(int) + + +def test_invalid_n_bins_array(): + # Bad shape + n_bins = np.full((2, 4), 2.0) + est = KBinsDiscretizer(n_bins=n_bins, quantile_method="averaged_inverted_cdf") + err_msg = r"n_bins must be a scalar or array of shape \(n_features,\)." + with pytest.raises(ValueError, match=err_msg): + est.fit_transform(X) + + # Incorrect number of features + n_bins = [1, 2, 2] + est = KBinsDiscretizer(n_bins=n_bins, quantile_method="averaged_inverted_cdf") + err_msg = r"n_bins must be a scalar or array of shape \(n_features,\)." + with pytest.raises(ValueError, match=err_msg): + est.fit_transform(X) + + # Bad bin values + n_bins = [1, 2, 2, 1] + est = KBinsDiscretizer(n_bins=n_bins, quantile_method="averaged_inverted_cdf") + err_msg = ( + "KBinsDiscretizer received an invalid number of bins " + "at indices 0, 3. Number of bins must be at least 2, " + "and must be an int." + ) + with pytest.raises(ValueError, match=err_msg): + est.fit_transform(X) + + # Float bin values + n_bins = [2.1, 2, 2.1, 2] + est = KBinsDiscretizer(n_bins=n_bins, quantile_method="averaged_inverted_cdf") + err_msg = ( + "KBinsDiscretizer received an invalid number of bins " + "at indices 0, 2. Number of bins must be at least 2, " + "and must be an int." + ) + with pytest.raises(ValueError, match=err_msg): + est.fit_transform(X) + + +@pytest.mark.parametrize( + "strategy, quantile_method, expected, sample_weight", + [ + ( + "uniform", + "warn", # default, will not warn when strategy != "quantile" + [[0, 0, 0, 0], [0, 1, 1, 0], [1, 2, 2, 1], [1, 2, 2, 2]], + None, + ), + ( + "kmeans", + "warn", # default, will not warn when strategy != "quantile" + [[0, 0, 0, 0], [0, 0, 0, 0], [1, 1, 1, 1], [1, 2, 2, 2]], + None, + ), + ( + "quantile", + "linear", + [[0, 0, 0, 0], [0, 1, 1, 1], [1, 2, 2, 2], [1, 2, 2, 2]], + None, + ), + ( + "quantile", + "averaged_inverted_cdf", + [[0, 0, 0, 0], [0, 1, 1, 1], [1, 2, 2, 2], [1, 2, 2, 2]], + None, + ), + ( + "quantile", + "averaged_inverted_cdf", + [[0, 0, 0, 0], [0, 1, 1, 1], [1, 2, 2, 2], [1, 2, 2, 2]], + [1, 1, 1, 1], + ), + ( + "quantile", + "averaged_inverted_cdf", + [[0, 0, 0, 0], [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 1]], + [0, 1, 3, 1], + ), + ( + "quantile", + "averaged_inverted_cdf", + [[0, 0, 0, 0], [0, 0, 0, 0], [1, 2, 2, 2], [1, 2, 2, 2]], + [1, 1, 3, 1], + ), + ( + "kmeans", + "warn", # default, will not warn when strategy != "quantile" + [[0, 0, 0, 0], [0, 1, 1, 0], [1, 1, 1, 1], [1, 2, 2, 2]], + [1, 0, 3, 1], + ), + ], +) +def test_fit_transform_n_bins_array(strategy, quantile_method, expected, sample_weight): + est = KBinsDiscretizer( + n_bins=[2, 3, 3, 3], + encode="ordinal", + strategy=strategy, + quantile_method=quantile_method, + ).fit(X, sample_weight=sample_weight) + assert_array_equal(est.transform(X), expected) + + # test the shape of bin_edges_ + n_features = np.array(X).shape[1] + assert est.bin_edges_.shape == (n_features,) + for bin_edges, n_bins in zip(est.bin_edges_, est.n_bins_): + assert bin_edges.shape == (n_bins + 1,) + + +@pytest.mark.filterwarnings("ignore: Bins whose width are too small") +def test_kbinsdiscretizer_effect_sample_weight(): + """Check the impact of `sample_weight` one computed quantiles.""" + X = np.array([[-2], [-1], [1], [3], [500], [1000]]) + # add a large number of bins such that each sample with a non-null weight + # will be used as bin edge + est = KBinsDiscretizer( + n_bins=10, + encode="ordinal", + strategy="quantile", + quantile_method="averaged_inverted_cdf", + ) + est.fit(X, sample_weight=[1, 1, 1, 1, 0, 0]) + assert_allclose(est.bin_edges_[0], [-2, -1, 0, 1, 3]) + assert_allclose(est.transform(X), [[0.0], [1.0], [3.0], [3.0], [3.0], [3.0]]) + + +@pytest.mark.parametrize("strategy", ["kmeans", "quantile"]) +def test_kbinsdiscretizer_no_mutating_sample_weight(strategy): + """Make sure that `sample_weight` is not changed in place.""" + + if strategy == "quantile": + est = KBinsDiscretizer( + n_bins=3, + encode="ordinal", + strategy=strategy, + quantile_method="averaged_inverted_cdf", + ) + else: + est = KBinsDiscretizer(n_bins=3, encode="ordinal", strategy=strategy) + sample_weight = np.array([1, 3, 1, 2], dtype=np.float64) + sample_weight_copy = np.copy(sample_weight) + est.fit(X, sample_weight=sample_weight) + assert_allclose(sample_weight, sample_weight_copy) + + +@pytest.mark.parametrize("strategy", ["uniform", "kmeans", "quantile"]) +def test_same_min_max(strategy): + warnings.simplefilter("always") + X = np.array([[1, -2], [1, -1], [1, 0], [1, 1]]) + if strategy == "quantile": + est = KBinsDiscretizer( + strategy=strategy, + n_bins=3, + encode="ordinal", + quantile_method="averaged_inverted_cdf", + ) + else: + est = KBinsDiscretizer(strategy=strategy, n_bins=3, encode="ordinal") + warning_message = "Feature 0 is constant and will be replaced with 0." + with pytest.warns(UserWarning, match=warning_message): + est.fit(X) + assert est.n_bins_[0] == 1 + # replace the feature with zeros + Xt = est.transform(X) + assert_array_equal(Xt[:, 0], np.zeros(X.shape[0])) + + +def test_transform_1d_behavior(): + X = np.arange(4) + est = KBinsDiscretizer(n_bins=2, quantile_method="averaged_inverted_cdf") + with pytest.raises(ValueError): + est.fit(X) + + est = KBinsDiscretizer(n_bins=2, quantile_method="averaged_inverted_cdf") + est.fit(X.reshape(-1, 1)) + with pytest.raises(ValueError): + est.transform(X) + + +@pytest.mark.parametrize("i", range(1, 9)) +def test_numeric_stability(i): + X_init = np.array([2.0, 4.0, 6.0, 8.0, 10.0]).reshape(-1, 1) + Xt_expected = np.array([0, 0, 1, 1, 1]).reshape(-1, 1) + + # Test up to discretizing nano units + X = X_init / 10**i + Xt = KBinsDiscretizer( + n_bins=2, encode="ordinal", quantile_method="averaged_inverted_cdf" + ).fit_transform(X) + assert_array_equal(Xt_expected, Xt) + + +def test_encode_options(): + est = KBinsDiscretizer( + n_bins=[2, 3, 3, 3], encode="ordinal", quantile_method="averaged_inverted_cdf" + ).fit(X) + Xt_1 = est.transform(X) + est = KBinsDiscretizer( + n_bins=[2, 3, 3, 3], + encode="onehot-dense", + quantile_method="averaged_inverted_cdf", + ).fit(X) + Xt_2 = est.transform(X) + assert not sp.issparse(Xt_2) + assert_array_equal( + OneHotEncoder( + categories=[np.arange(i) for i in [2, 3, 3, 3]], sparse_output=False + ).fit_transform(Xt_1), + Xt_2, + ) + est = KBinsDiscretizer( + n_bins=[2, 3, 3, 3], encode="onehot", quantile_method="averaged_inverted_cdf" + ).fit(X) + Xt_3 = est.transform(X) + assert sp.issparse(Xt_3) + assert_array_equal( + OneHotEncoder( + categories=[np.arange(i) for i in [2, 3, 3, 3]], sparse_output=True + ) + .fit_transform(Xt_1) + .toarray(), + Xt_3.toarray(), + ) + + +@pytest.mark.parametrize( + "strategy, quantile_method, expected_2bins, expected_3bins, expected_5bins", + [ + ("uniform", "warn", [0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 2, 2], [0, 0, 1, 1, 4, 4]), + ("kmeans", "warn", [0, 0, 0, 0, 1, 1], [0, 0, 1, 1, 2, 2], [0, 0, 1, 2, 3, 4]), + ( + "quantile", + "averaged_inverted_cdf", + [0, 0, 0, 1, 1, 1], + [0, 0, 1, 1, 2, 2], + [0, 1, 2, 3, 4, 4], + ), + ], +) +def test_nonuniform_strategies( + strategy, quantile_method, expected_2bins, expected_3bins, expected_5bins +): + X = np.array([0, 0.5, 2, 3, 9, 10]).reshape(-1, 1) + + # with 2 bins + est = KBinsDiscretizer( + n_bins=2, strategy=strategy, quantile_method=quantile_method, encode="ordinal" + ) + Xt = est.fit_transform(X) + assert_array_equal(expected_2bins, Xt.ravel()) + + # with 3 bins + est = KBinsDiscretizer( + n_bins=3, strategy=strategy, quantile_method=quantile_method, encode="ordinal" + ) + Xt = est.fit_transform(X) + assert_array_equal(expected_3bins, Xt.ravel()) + + # with 5 bins + est = KBinsDiscretizer( + n_bins=5, strategy=strategy, quantile_method=quantile_method, encode="ordinal" + ) + Xt = est.fit_transform(X) + assert_array_equal(expected_5bins, Xt.ravel()) + + +@pytest.mark.parametrize( + "strategy, expected_inv,quantile_method", + [ + ( + "uniform", + [ + [-1.5, 2.0, -3.5, -0.5], + [-0.5, 3.0, -2.5, -0.5], + [0.5, 4.0, -1.5, 0.5], + [0.5, 4.0, -1.5, 1.5], + ], + "warn", # default, will not warn when strategy != "quantile" + ), + ( + "kmeans", + [ + [-1.375, 2.125, -3.375, -0.5625], + [-1.375, 2.125, -3.375, -0.5625], + [-0.125, 3.375, -2.125, 0.5625], + [0.75, 4.25, -1.25, 1.625], + ], + "warn", # default, will not warn when strategy != "quantile" + ), + ( + "quantile", + [ + [-1.5, 2.0, -3.5, -0.75], + [-0.5, 3.0, -2.5, 0.0], + [0.5, 4.0, -1.5, 1.25], + [0.5, 4.0, -1.5, 1.25], + ], + "averaged_inverted_cdf", + ), + ], +) +@pytest.mark.parametrize("encode", ["ordinal", "onehot", "onehot-dense"]) +def test_inverse_transform(strategy, encode, expected_inv, quantile_method): + kbd = KBinsDiscretizer( + n_bins=3, strategy=strategy, quantile_method=quantile_method, encode=encode + ) + Xt = kbd.fit_transform(X) + Xinv = kbd.inverse_transform(Xt) + assert_array_almost_equal(expected_inv, Xinv) + + +@pytest.mark.parametrize("strategy", ["uniform", "kmeans", "quantile"]) +def test_transform_outside_fit_range(strategy): + X = np.array([0, 1, 2, 3])[:, None] + + if strategy == "quantile": + kbd = KBinsDiscretizer( + n_bins=4, + strategy=strategy, + encode="ordinal", + quantile_method="averaged_inverted_cdf", + ) + else: + kbd = KBinsDiscretizer(n_bins=4, strategy=strategy, encode="ordinal") + kbd.fit(X) + + X2 = np.array([-2, 5])[:, None] + X2t = kbd.transform(X2) + assert_array_equal(X2t.max(axis=0) + 1, kbd.n_bins_) + assert_array_equal(X2t.min(axis=0), [0]) + + +def test_overwrite(): + X = np.array([0, 1, 2, 3])[:, None] + X_before = X.copy() + + est = KBinsDiscretizer( + n_bins=3, quantile_method="averaged_inverted_cdf", encode="ordinal" + ) + Xt = est.fit_transform(X) + assert_array_equal(X, X_before) + + Xt_before = Xt.copy() + Xinv = est.inverse_transform(Xt) + assert_array_equal(Xt, Xt_before) + assert_array_equal(Xinv, np.array([[0.5], [1.5], [2.5], [2.5]])) + + +@pytest.mark.parametrize( + "strategy, expected_bin_edges, quantile_method", + [ + ("quantile", [0, 1.5, 3], "averaged_inverted_cdf"), + ("kmeans", [0, 1.5, 3], "warn"), + ], +) +def test_redundant_bins(strategy, expected_bin_edges, quantile_method): + X = [[0], [0], [0], [0], [3], [3]] + kbd = KBinsDiscretizer( + n_bins=3, strategy=strategy, quantile_method=quantile_method, subsample=None + ) + warning_message = "Consider decreasing the number of bins." + with pytest.warns(UserWarning, match=warning_message): + kbd.fit(X) + + assert_array_almost_equal(kbd.bin_edges_[0], expected_bin_edges) + + +def test_percentile_numeric_stability(): + X = np.array([0.05, 0.05, 0.95]).reshape(-1, 1) + bin_edges = np.array([0.05, 0.23, 0.41, 0.59, 0.77, 0.95]) + Xt = np.array([0, 0, 4]).reshape(-1, 1) + kbd = KBinsDiscretizer( + n_bins=10, + encode="ordinal", + strategy="quantile", + quantile_method="linear", + ) + ## TODO: change to averaged inverted cdf, but that means we only get bin + ## edges of 0.05 and 0.95 and nothing in between + + warning_message = "Consider decreasing the number of bins." + with pytest.warns(UserWarning, match=warning_message): + kbd.fit(X) + + assert_array_almost_equal(kbd.bin_edges_[0], bin_edges) + assert_array_almost_equal(kbd.transform(X), Xt) + + +@pytest.mark.parametrize("in_dtype", [np.float16, np.float32, np.float64]) +@pytest.mark.parametrize("out_dtype", [None, np.float32, np.float64]) +@pytest.mark.parametrize("encode", ["ordinal", "onehot", "onehot-dense"]) +def test_consistent_dtype(in_dtype, out_dtype, encode): + X_input = np.array(X, dtype=in_dtype) + kbd = KBinsDiscretizer( + n_bins=3, + encode=encode, + quantile_method="averaged_inverted_cdf", + dtype=out_dtype, + ) + kbd.fit(X_input) + + # test output dtype + if out_dtype is not None: + expected_dtype = out_dtype + elif out_dtype is None and X_input.dtype == np.float16: + # wrong numeric input dtype are cast in np.float64 + expected_dtype = np.float64 + else: + expected_dtype = X_input.dtype + Xt = kbd.transform(X_input) + assert Xt.dtype == expected_dtype + + +@pytest.mark.parametrize("input_dtype", [np.float16, np.float32, np.float64]) +@pytest.mark.parametrize("encode", ["ordinal", "onehot", "onehot-dense"]) +def test_32_equal_64(input_dtype, encode): + # TODO this check is redundant with common checks and can be removed + # once #16290 is merged + X_input = np.array(X, dtype=input_dtype) + + # 32 bit output + kbd_32 = KBinsDiscretizer( + n_bins=3, + encode=encode, + quantile_method="averaged_inverted_cdf", + dtype=np.float32, + ) + kbd_32.fit(X_input) + Xt_32 = kbd_32.transform(X_input) + + # 64 bit output + kbd_64 = KBinsDiscretizer( + n_bins=3, + encode=encode, + quantile_method="averaged_inverted_cdf", + dtype=np.float64, + ) + kbd_64.fit(X_input) + Xt_64 = kbd_64.transform(X_input) + + assert_allclose_dense_sparse(Xt_32, Xt_64) + + +def test_kbinsdiscretizer_subsample_default(): + # Since the size of X is small (< 2e5), subsampling will not take place. + X = np.array([-2, 1.5, -4, -1]).reshape(-1, 1) + kbd_default = KBinsDiscretizer( + n_bins=10, + encode="ordinal", + strategy="quantile", + quantile_method="averaged_inverted_cdf", + ) + kbd_default.fit(X) + + kbd_without_subsampling = clone(kbd_default) + kbd_without_subsampling.set_params(subsample=None) + kbd_without_subsampling.fit(X) + + for bin_kbd_default, bin_kbd_with_subsampling in zip( + kbd_default.bin_edges_[0], kbd_without_subsampling.bin_edges_[0] + ): + np.testing.assert_allclose(bin_kbd_default, bin_kbd_with_subsampling) + assert kbd_default.bin_edges_.shape == kbd_without_subsampling.bin_edges_.shape + + +@pytest.mark.parametrize( + "encode, expected_names", + [ + ( + "onehot", + [ + f"feat{col_id}_{float(bin_id)}" + for col_id in range(3) + for bin_id in range(4) + ], + ), + ( + "onehot-dense", + [ + f"feat{col_id}_{float(bin_id)}" + for col_id in range(3) + for bin_id in range(4) + ], + ), + ("ordinal", [f"feat{col_id}" for col_id in range(3)]), + ], +) +def test_kbinsdiscrtizer_get_feature_names_out(encode, expected_names): + """Check get_feature_names_out for different settings. + Non-regression test for #22731 + """ + X = [[-2, 1, -4], [-1, 2, -3], [0, 3, -2], [1, 4, -1]] + + kbd = KBinsDiscretizer( + n_bins=4, encode=encode, quantile_method="averaged_inverted_cdf" + ).fit(X) + Xt = kbd.transform(X) + + input_features = [f"feat{i}" for i in range(3)] + output_names = kbd.get_feature_names_out(input_features) + assert Xt.shape[1] == output_names.shape[0] + + assert_array_equal(output_names, expected_names) + + +@pytest.mark.parametrize("strategy", ["uniform", "kmeans", "quantile"]) +def test_kbinsdiscretizer_subsample(strategy, global_random_seed): + # Check that the bin edges are almost the same when subsampling is used. + X = np.random.RandomState(global_random_seed).random_sample((100000, 1)) + 1 + + if strategy == "quantile": + kbd_subsampling = KBinsDiscretizer( + strategy=strategy, + subsample=50000, + random_state=global_random_seed, + quantile_method="averaged_inverted_cdf", + ) + else: + kbd_subsampling = KBinsDiscretizer( + strategy=strategy, subsample=50000, random_state=global_random_seed + ) + kbd_subsampling.fit(X) + + kbd_no_subsampling = clone(kbd_subsampling) + kbd_no_subsampling.set_params(subsample=None) + kbd_no_subsampling.fit(X) + + # We use a large tolerance because we can't expect the bin edges to be exactly the + # same when subsampling is used. + assert_allclose( + kbd_subsampling.bin_edges_[0], kbd_no_subsampling.bin_edges_[0], rtol=1e-2 + ) + + +def test_quantile_method_future_warnings(): + X = [[-2, 1, -4], [-1, 2, -3], [0, 3, -2], [1, 4, -1]] + with pytest.warns( + FutureWarning, + match="The current default behavior, quantile_method='linear', will be " + "changed to quantile_method='averaged_inverted_cdf' in " + "scikit-learn version 1.9 to naturally support sample weight " + "equivalence properties by default. Pass " + "quantile_method='averaged_inverted_cdf' explicitly to silence this " + "warning.", + ): + KBinsDiscretizer(strategy="quantile").fit(X) + + +def test_invalid_quantile_method_with_sample_weight(): + X = [[-2, 1, -4], [-1, 2, -3], [0, 3, -2], [1, 4, -1]] + expected_msg = ( + "When fitting with strategy='quantile' and sample weights, " + "quantile_method should either be set to 'averaged_inverted_cdf' or " + "'inverted_cdf', got quantile_method='linear' instead." + ) + with pytest.raises( + ValueError, + match=expected_msg, + ): + KBinsDiscretizer(strategy="quantile", quantile_method="linear").fit( + X, + sample_weight=[1, 1, 2, 2], + ) diff --git a/shared/package-files/07/07a7c28b9fbc98b543154663de4ac8e67028fa62a9d5d1ffa886afc88c85ac9b/blob b/shared/package-files/07/07a7c28b9fbc98b543154663de4ac8e67028fa62a9d5d1ffa886afc88c85ac9b/blob new file mode 100644 index 0000000000000000000000000000000000000000..aa460d3eda50fbb174623a1b5bbca54645fd588a --- /dev/null +++ b/shared/package-files/07/07a7c28b9fbc98b543154663de4ac8e67028fa62a9d5d1ffa886afc88c85ac9b/blob @@ -0,0 +1,68 @@ +import re +import textwrap +import email.message + +from ._text import FoldedCase + + +class Message(email.message.Message): + multiple_use_keys = set( + map( + FoldedCase, + [ + 'Classifier', + 'Obsoletes-Dist', + 'Platform', + 'Project-URL', + 'Provides-Dist', + 'Provides-Extra', + 'Requires-Dist', + 'Requires-External', + 'Supported-Platform', + 'Dynamic', + ], + ) + ) + """ + Keys that may be indicated multiple times per PEP 566. + """ + + def __new__(cls, orig: email.message.Message): + res = super().__new__(cls) + vars(res).update(vars(orig)) + return res + + def __init__(self, *args, **kwargs): + self._headers = self._repair_headers() + + # suppress spurious error from mypy + def __iter__(self): + return super().__iter__() + + def _repair_headers(self): + def redent(value): + "Correct for RFC822 indentation" + if not value or '\n' not in value: + return value + return textwrap.dedent(' ' * 8 + value) + + headers = [(key, redent(value)) for key, value in vars(self)['_headers']] + if self._payload: + headers.append(('Description', self.get_payload())) + return headers + + @property + def json(self): + """ + Convert PackageMetadata to a JSON-compatible format + per PEP 0566. + """ + + def transform(key): + value = self.get_all(key) if key in self.multiple_use_keys else self[key] + if key == 'Keywords': + value = re.split(r'\s+', value) + tk = key.lower().replace('-', '_') + return tk, value + + return dict(map(transform, map(FoldedCase, self))) diff --git a/shared/package-files/07/07a965fdfde0f6c98eca139947c8512c971cf3dd72db2af9eca3d255061bd4f2/blob b/shared/package-files/07/07a965fdfde0f6c98eca139947c8512c971cf3dd72db2af9eca3d255061bd4f2/blob new file mode 100644 index 0000000000000000000000000000000000000000..14bc3f38a5f2ce1994bcfaff2257db64eb8b8148 --- /dev/null +++ b/shared/package-files/07/07a965fdfde0f6c98eca139947c8512c971cf3dd72db2af9eca3d255061bd4f2/blob @@ -0,0 +1,196 @@ +from abc import ABCMeta, abstractmethod +from typing import Any, Optional, Union + +from cryptography.hazmat.primitives.asymmetric.dh import ( + DHParameterNumbers, + DHParameters, + DHPrivateKey, + DHPrivateNumbers, + DHPublicKey, + DHPublicNumbers, +) +from cryptography.hazmat.primitives.asymmetric.dsa import ( + DSAParameterNumbers, + DSAParameters, + DSAPrivateKey, + DSAPrivateNumbers, + DSAPublicKey, + DSAPublicNumbers, +) +from cryptography.hazmat.primitives.asymmetric.ec import ( + EllipticCurve, + EllipticCurvePrivateKey, + EllipticCurvePrivateNumbers, + EllipticCurvePublicKey, + EllipticCurvePublicNumbers, + EllipticCurveSignatureAlgorithm, +) +from cryptography.hazmat.primitives.asymmetric.padding import AsymmetricPadding +from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPrivateNumbers, RSAPublicKey, RSAPublicNumbers +from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm, CipherAlgorithm, CipherContext +from cryptography.hazmat.primitives.ciphers.modes import Mode +from cryptography.hazmat.primitives.hashes import HashAlgorithm, HashContext +from cryptography.x509 import ( + Certificate, + CertificateBuilder, + CertificateRevocationList, + CertificateRevocationListBuilder, + CertificateSigningRequest, + CertificateSigningRequestBuilder, + Name, + RevokedCertificate, + RevokedCertificateBuilder, +) + +class CipherBackend(metaclass=ABCMeta): + @abstractmethod + def cipher_supported(self, cipher: CipherAlgorithm, mode: Mode) -> bool: ... + @abstractmethod + def create_symmetric_encryption_ctx(self, cipher: CipherAlgorithm, mode: Mode) -> CipherContext: ... + @abstractmethod + def create_symmetric_decryption_ctx(self, cipher: CipherAlgorithm, mode: Mode) -> CipherContext: ... + +class CMACBackend(metaclass=ABCMeta): + @abstractmethod + def cmac_algorithm_supported(self, algorithm: BlockCipherAlgorithm) -> bool: ... + @abstractmethod + def create_cmac_ctx(self, algorithm: BlockCipherAlgorithm) -> Any: ... + +class DERSerializationBackend(metaclass=ABCMeta): + @abstractmethod + def load_der_parameters(self, data: bytes) -> Any: ... + @abstractmethod + def load_der_private_key(self, data: bytes, password: Optional[bytes]) -> Any: ... + @abstractmethod + def load_der_public_key(self, data: bytes) -> Any: ... + +class DHBackend(metaclass=ABCMeta): + @abstractmethod + def dh_parameters_supported(self, p: int, g: int, q: Optional[int]) -> bool: ... + @abstractmethod + def dh_x942_serialization_supported(self) -> bool: ... + @abstractmethod + def generate_dh_parameters(self, generator: int, key_size: int) -> DHParameters: ... + @abstractmethod + def generate_dh_private_key(self, parameters: DHParameters) -> DHPrivateKey: ... + @abstractmethod + def generate_dh_private_key_and_parameters(self, generator: int, key_size: int) -> DHPrivateKey: ... + @abstractmethod + def load_dh_parameter_numbers(self, numbers: DHParameterNumbers) -> DHParameters: ... + @abstractmethod + def load_dh_private_numbers(self, numbers: DHPrivateNumbers) -> DHPrivateKey: ... + @abstractmethod + def load_dh_public_numbers(self, numbers: DHPublicNumbers) -> DHPublicKey: ... + +class DSABackend(metaclass=ABCMeta): + @abstractmethod + def dsa_hash_supported(self, algorithm: HashAlgorithm) -> bool: ... + @abstractmethod + def dsa_parameters_supported(self, p: int, q: int, g: int) -> bool: ... + @abstractmethod + def generate_dsa_parameters(self, key_size: int) -> DSAParameters: ... + @abstractmethod + def generate_dsa_private_key(self, parameters: DSAParameters) -> DSAPrivateKey: ... + @abstractmethod + def generate_dsa_private_key_and_parameters(self, key_size: int) -> DSAPrivateKey: ... + @abstractmethod + def load_dsa_parameter_numbers(self, numbers: DSAParameterNumbers) -> DSAParameters: ... + @abstractmethod + def load_dsa_private_numbers(self, numbers: DSAPrivateNumbers) -> DSAPrivateKey: ... + @abstractmethod + def load_dsa_public_numbers(self, numbers: DSAPublicNumbers) -> DSAPublicKey: ... + +class EllipticCurveBackend(metaclass=ABCMeta): + @abstractmethod + def derive_elliptic_curve_private_key(self, private_value: int, curve: EllipticCurve) -> EllipticCurvePrivateKey: ... + @abstractmethod + def elliptic_curve_signature_algorithm_supported( + self, signature_algorithm: EllipticCurveSignatureAlgorithm, curve: EllipticCurve + ) -> bool: ... + @abstractmethod + def elliptic_curve_supported(self, curve: EllipticCurve) -> bool: ... + @abstractmethod + def generate_elliptic_curve_private_key(self, curve: EllipticCurve) -> EllipticCurvePrivateKey: ... + @abstractmethod + def load_elliptic_curve_private_numbers(self, numbers: EllipticCurvePrivateNumbers) -> EllipticCurvePrivateKey: ... + @abstractmethod + def load_elliptic_curve_public_numbers(self, numbers: EllipticCurvePublicNumbers) -> EllipticCurvePublicKey: ... + +class HMACBackend(metaclass=ABCMeta): + @abstractmethod + def create_hmac_ctx(self, key: bytes, algorithm: HashAlgorithm) -> HashContext: ... + @abstractmethod + def cmac_algorithm_supported(self, algorithm: HashAlgorithm) -> bool: ... + +class HashBackend(metaclass=ABCMeta): + @abstractmethod + def create_hash_ctx(self, algorithm: HashAlgorithm) -> HashContext: ... + @abstractmethod + def hash_supported(self, algorithm: HashAlgorithm) -> bool: ... + +class PBKDF2HMACBackend(metaclass=ABCMeta): + @abstractmethod + def derive_pbkdf2_hmac( + self, algorithm: HashAlgorithm, length: int, salt: bytes, iterations: int, key_material: bytes + ) -> bytes: ... + @abstractmethod + def pbkdf2_hmac_supported(self, algorithm: HashAlgorithm) -> bool: ... + +class PEMSerializationBackend(metaclass=ABCMeta): + @abstractmethod + def load_pem_parameters(self, data: bytes) -> Any: ... + @abstractmethod + def load_pem_private_key(self, data: bytes, password: Optional[bytes]) -> Any: ... + @abstractmethod + def load_pem_public_key(self, data: bytes) -> Any: ... + +class RSABackend(metaclass=ABCMeta): + @abstractmethod + def generate_rsa_parameters_supported(self, public_exponent: int, key_size: int) -> bool: ... + @abstractmethod + def generate_rsa_private_key(self, public_exponent: int, key_size: int) -> RSAPrivateKey: ... + @abstractmethod + def load_rsa_public_numbers(self, numbers: RSAPublicNumbers) -> RSAPublicKey: ... + @abstractmethod + def load_rsa_private_numbers(self, numbers: RSAPrivateNumbers) -> RSAPrivateKey: ... + @abstractmethod + def rsa_padding_supported(self, padding: AsymmetricPadding) -> bool: ... + +class ScryptBackend(metaclass=ABCMeta): + @abstractmethod + def derive_scrypt(self, key_material: bytes, salt: bytes, length: int, n: int, r: int, p: int) -> bytes: ... + +class X509Backend(metaclass=ABCMeta): + @abstractmethod + def create_x509_certificate( + self, + builder: CertificateBuilder, + private_key: Union[DSAPrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], + algorithm: HashAlgorithm, + ) -> Certificate: ... + @abstractmethod + def create_x509_crl( + self, + builder: CertificateRevocationListBuilder, + private_key: Union[DSAPrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], + algorithm: HashAlgorithm, + ) -> CertificateRevocationList: ... + @abstractmethod + def create_x509_csr( + self, + builder: CertificateSigningRequestBuilder, + private_key: Union[DSAPrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], + algorithm: HashAlgorithm, + ) -> CertificateSigningRequest: ... + @abstractmethod + def create_x509_revoked_certificate(self, builder: RevokedCertificateBuilder) -> RevokedCertificate: ... + @abstractmethod + def load_der_x509_certificate(self, data: bytes) -> Certificate: ... + @abstractmethod + def load_der_x509_csr(self, data: bytes) -> CertificateSigningRequest: ... + @abstractmethod + def load_pem_x509_certificate(self, data: bytes) -> Certificate: ... + @abstractmethod + def load_pem_x509_csr(self, data: bytes) -> CertificateSigningRequest: ... + @abstractmethod + def x509_name_bytes(self, name: Name) -> bytes: ... diff --git a/shared/package-files/07/07acbdf2249901740f912b47ca94a9b3786fa73ab878199f60beae3320588f81/blob b/shared/package-files/07/07acbdf2249901740f912b47ca94a9b3786fa73ab878199f60beae3320588f81/blob new file mode 100644 index 0000000000000000000000000000000000000000..0b5ccbf05f657bf8e6be679a5dfe9d2fb204697a --- /dev/null +++ b/shared/package-files/07/07acbdf2249901740f912b47ca94a9b3786fa73ab878199f60beae3320588f81/blob @@ -0,0 +1,132 @@ +import os +import sys +from _typeshed import AnyPath, BytesPath, StrPath +from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, Union, overload + +if sys.version_info < (3, 8): + _T = TypeVar("_T") + + if sys.version_info >= (3, 6): + from builtins import _PathLike + + # ----- os.path variables ----- + supports_unicode_filenames: bool + # aliases (also in os) + curdir: str + pardir: str + sep: str + altsep: Optional[str] + extsep: str + pathsep: str + defpath: str + devnull: str + + # ----- os.path function stubs ----- + if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(s: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(s: AnyStr) -> AnyStr: ... + @overload + def dirname(s: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(s: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(s: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(s: AnyStr) -> AnyStr: ... + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(s: AnyStr) -> AnyStr: ... + def dirname(s: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(s: AnyStr) -> AnyStr: ... + def realpath(path: AnyStr) -> AnyStr: ... + # NOTE: Empty lists results in '' (str) regardless of contained type. + # Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes + # So, fall back to Any + def commonprefix(m: Sequence[AnyPath]) -> Any: ... + if sys.version_info >= (3, 3): + def exists(path: Union[AnyPath, int]) -> bool: ... + else: + def exists(path: AnyPath) -> bool: ... + def lexists(path: AnyPath) -> bool: ... + # These return float if os.stat_float_times() == True, + # but int is a subclass of float. + def getatime(filename: AnyPath) -> float: ... + def getmtime(filename: AnyPath) -> float: ... + def getctime(filename: AnyPath) -> float: ... + def getsize(filename: AnyPath) -> int: ... + def isabs(s: AnyPath) -> bool: ... + def isfile(path: AnyPath) -> bool: ... + def isdir(s: AnyPath) -> bool: ... + def islink(s: AnyPath) -> bool: ... + def ismount(s: AnyPath) -> bool: ... + if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ... + @overload + def join(__p1: Text, *p: AnyPath) -> Text: ... + elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap, but things seem to behave correctly anyway. + @overload + def join(s: StrPath, *paths: StrPath) -> Text: ... + @overload + def join(s: BytesPath, *paths: BytesPath) -> bytes: ... + else: + def join(s: AnyStr, *paths: AnyStr) -> AnyStr: ... + def samefile(f1: AnyPath, f2: AnyPath) -> bool: ... + def sameopenfile(fp1: int, fp2: int) -> bool: ... + def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... + if sys.version_info >= (3, 6): + @overload + def split(s: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(s: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + else: + def split(s: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/shared/package-files/07/07af8a5bf78195cef635a75fa3433feb88e8e33565eefeb66d330ac02260fd45/blob b/shared/package-files/07/07af8a5bf78195cef635a75fa3433feb88e8e33565eefeb66d330ac02260fd45/blob new file mode 100644 index 0000000000000000000000000000000000000000..16d011fd9ee6e749d7e72333b8456e14b7753c38 --- /dev/null +++ b/shared/package-files/07/07af8a5bf78195cef635a75fa3433feb88e8e33565eefeb66d330ac02260fd45/blob @@ -0,0 +1,41 @@ +"""Test suite for distutils. + +This test suite consists of a collection of test modules in the +distutils.tests package. Each test module has a name starting with +'test' and contains a function test_suite(). The function is expected +to return an initialized unittest.TestSuite instance. + +Tests for the command classes in the distutils.command package are +included in distutils.tests as well, instead of using a separate +distutils.command.tests package, since command identification is done +by import rather than matching pre-defined names. + +""" + +import os +import sys +import unittest +from test.support import run_unittest +from test.support.warnings_helper import save_restore_warnings_filters + + +here = os.path.dirname(__file__) or os.curdir + + +def test_suite(): + suite = unittest.TestSuite() + for fn in os.listdir(here): + if fn.startswith("test") and fn.endswith(".py"): + modname = "distutils.tests." + fn[:-3] + # bpo-40055: Save/restore warnings filters to leave them unchanged. + # Importing tests imports docutils which imports pkg_resources + # which adds a warnings filter. + with save_restore_warnings_filters(): + __import__(modname) + module = sys.modules[modname] + suite.addTest(module.test_suite()) + return suite + + +if __name__ == "__main__": + run_unittest(test_suite()) diff --git a/shared/package-files/07/07b097fed0f61185a9964571955bc8540901285269128b0f00d034f57d4a446f/blob b/shared/package-files/07/07b097fed0f61185a9964571955bc8540901285269128b0f00d034f57d4a446f/blob new file mode 100644 index 0000000000000000000000000000000000000000..b607e83c528a8f5eada4b0aa043a6674866f75b1 --- /dev/null +++ b/shared/package-files/07/07b097fed0f61185a9964571955bc8540901285269128b0f00d034f57d4a446f/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor _conj(const at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/07/07b1fec5e91a61a3d812b5191af929143b62ceddb08a148c1a898b8c6b2d3e9f/blob b/shared/package-files/07/07b1fec5e91a61a3d812b5191af929143b62ceddb08a148c1a898b8c6b2d3e9f/blob new file mode 100644 index 0000000000000000000000000000000000000000..9f358a7b26e0856092dc14ceb84cd934cb1a6338 Binary files /dev/null and b/shared/package-files/07/07b1fec5e91a61a3d812b5191af929143b62ceddb08a148c1a898b8c6b2d3e9f/blob differ diff --git a/shared/package-files/07/07b24ee709df1b95d0897a9642658986f548ab96be09fe8e3f1c8fec1c749979/blob b/shared/package-files/07/07b24ee709df1b95d0897a9642658986f548ab96be09fe8e3f1c8fec1c749979/blob new file mode 100644 index 0000000000000000000000000000000000000000..b222c81e1889eab05871979aa6a8f2195b00f127 --- /dev/null +++ b/shared/package-files/07/07b24ee709df1b95d0897a9642658986f548ab96be09fe8e3f1c8fec1c749979/blob @@ -0,0 +1,5 @@ +import sys +from fontTools.varLib import main + +if __name__ == "__main__": + sys.exit(main()) diff --git a/shared/package-files/07/07b3393f2e186d070916067da0294064db5d633c6e08de832dac59ae3951e504/blob b/shared/package-files/07/07b3393f2e186d070916067da0294064db5d633c6e08de832dac59ae3951e504/blob new file mode 100644 index 0000000000000000000000000000000000000000..dbf0d2ba2dc46399b6b1ebde69a732905149f892 --- /dev/null +++ b/shared/package-files/07/07b3393f2e186d070916067da0294064db5d633c6e08de832dac59ae3951e504/blob @@ -0,0 +1,386 @@ +""" +Created on Sun Apr 20 17:12:53 2014 + +author: Josef Perktold + +""" + +import numpy as np +from numpy.testing import assert_allclose, assert_equal +import pandas as pd +import pytest + +from statsmodels.regression._prediction import get_prediction +from statsmodels.regression.linear_model import OLS, WLS +from statsmodels.sandbox.regression.predstd import wls_prediction_std + + +def test_predict_se(): + # this test does not use reference values + # checks conistency across options, and compares to direct calculation + + # generate dataset + nsample = 50 + x1 = np.linspace(0, 20, nsample) + x = np.c_[x1, (x1 - 5) ** 2, np.ones(nsample)] + rs = np.random.RandomState(0) # 9876789) #9876543) + beta = [0.5, -0.01, 5.0] + y_true2 = np.dot(x, beta) + w = np.ones(nsample) + w[int(nsample * 6.0 / 10) :] = 3 + sig = 0.5 + y2 = y_true2 + sig * w * rs.normal(size=nsample) + x2 = x[:, [0, 2]] + + # estimate OLS + res2 = OLS(y2, x2).fit() + + # direct calculation + covb = res2.cov_params() + predvar = res2.mse_resid + (x2 * np.dot(covb, x2.T).T).sum(1) + predstd = np.sqrt(predvar) + + prstd, iv_l, iv_u = wls_prediction_std(res2) + np.testing.assert_almost_equal(prstd, predstd, 15) + + # stats.t.isf(0.05/2., 50 - 2) + q = 2.0106347546964458 + ci_half = q * predstd + np.testing.assert_allclose(iv_u, res2.fittedvalues + ci_half, rtol=1e-9) + np.testing.assert_allclose(iv_l, res2.fittedvalues - ci_half, rtol=1e-9) + + prstd, iv_l, iv_u = wls_prediction_std(res2, x2[:3, :]) + np.testing.assert_equal(prstd, prstd[:3]) + np.testing.assert_allclose(iv_u, res2.fittedvalues[:3] + ci_half[:3], rtol=1e-9) + np.testing.assert_allclose(iv_l, res2.fittedvalues[:3] - ci_half[:3], rtol=1e-9) + + # check WLS + res3 = WLS(y2, x2, 1.0 / w).fit() + + # direct calculation + covb = res3.cov_params() + predvar = res3.mse_resid * w + (x2 * np.dot(covb, x2.T).T).sum(1) + predstd = np.sqrt(predvar) + + prstd, iv_l, iv_u = wls_prediction_std(res3) + np.testing.assert_almost_equal(prstd, predstd, 15) + + # stats.t.isf(0.05/2., 50 - 2) + q = 2.0106347546964458 + ci_half = q * predstd + np.testing.assert_allclose(iv_u, res3.fittedvalues + ci_half, rtol=1e-9) + np.testing.assert_allclose(iv_l, res3.fittedvalues - ci_half, rtol=1e-9) + + # testing shapes of exog + prstd, iv_l, iv_u = wls_prediction_std(res3, x2[-1:, :], weights=3.0) + np.testing.assert_equal(prstd, prstd[-1]) + prstd, iv_l, iv_u = wls_prediction_std(res3, x2[-1, :], weights=3.0) + np.testing.assert_equal(prstd, prstd[-1]) + + prstd, iv_l, iv_u = wls_prediction_std(res3, x2[-2:, :], weights=3.0) + np.testing.assert_equal(prstd, prstd[-2:]) + + prstd, iv_l, iv_u = wls_prediction_std(res3, x2[-2:, :], weights=[3, 3]) + np.testing.assert_equal(prstd, prstd[-2:]) + + prstd, iv_l, iv_u = wls_prediction_std(res3, x2[:3, :]) + np.testing.assert_equal(prstd, prstd[:3]) + np.testing.assert_allclose(iv_u, res3.fittedvalues[:3] + ci_half[:3], rtol=1e-9) + np.testing.assert_allclose(iv_l, res3.fittedvalues[:3] - ci_half[:3], rtol=1e-9) + + # use wrong size for exog + # prstd, iv_l, iv_u = wls_prediction_std(res3, x2[-1,0], weights=3.) + with pytest.raises(ValueError): + wls_prediction_std(res3, x2[-1, 0], weights=3.0) + + # check some weight values + sew1 = wls_prediction_std(res3, x2[-3:, :])[0] ** 2 + for wv in np.linspace(0.5, 3, 5): + + sew = wls_prediction_std(res3, x2[-3:, :], weights=1.0 / wv)[0] ** 2 + np.testing.assert_allclose(sew, sew1 + res3.scale * (wv - 1)) + + +class TestWLSPrediction: + + @classmethod + def setup_class(cls): + + # from example wls.py + rs = np.random.RandomState(3237219) + nsample = 50 + x = np.linspace(0, 20, nsample) + X = np.column_stack((x, (x - 5) ** 2)) + from statsmodels.tools.tools import add_constant + + X = add_constant(X) + beta = [5.0, 0.5, -0.01] + sig = 0.5 + w = np.ones(nsample) + w[int(nsample * 6.0 / 10) :] = 3 + y_true = np.dot(X, beta) + e = rs.normal(size=nsample) + y = y_true + sig * w * e + X = X[:, [0, 1]] + + # # WLS knowing the true variance ratio of heteroscedasticity + + mod_wls = WLS(y, X, weights=1.0 / w) + cls.res_wls = mod_wls.fit() + + def test_ci(self): + res_wls = self.res_wls + prstd, iv_l, iv_u = wls_prediction_std(res_wls) + pred_res = get_prediction(res_wls) + ci = pred_res.conf_int(obs=True) + + assert_allclose(pred_res.se_obs, prstd, rtol=1e-13) + assert_allclose(ci, np.column_stack((iv_l, iv_u)), rtol=1e-13) + + sf = pred_res.summary_frame() + + col_names = [ + "mean", + "mean_se", + "mean_ci_lower", + "mean_ci_upper", + "obs_ci_lower", + "obs_ci_upper", + ] + assert_equal(sf.columns.tolist(), col_names) + + pred_res2 = res_wls.get_prediction() + ci2 = pred_res2.conf_int(obs=True) + + assert_allclose(pred_res2.se_obs, prstd, rtol=1e-13) + assert_allclose(ci2, np.column_stack((iv_l, iv_u)), rtol=1e-13) + + sf2 = pred_res2.summary_frame() + assert_equal(sf2.columns.tolist(), col_names) + + # check that list works, issue 4437 + x = res_wls.model.exog.mean(0) + pred_res3 = res_wls.get_prediction([x]) + ci3 = pred_res3.conf_int(obs=True) + pred_res3b = res_wls.get_prediction(x.tolist()) + ci3b = pred_res3b.conf_int(obs=True) + assert_allclose(pred_res3b.se_obs, pred_res3.se_obs, rtol=1e-13) + assert_allclose(ci3b, ci3, rtol=1e-13) + res_df = pred_res3b.summary_frame() + assert_equal(res_df.index.values, [0]) + + x = res_wls.model.exog[-2:] + pred_res3 = res_wls.get_prediction(x) + ci3 = pred_res3.conf_int(obs=True) + pred_res3b = res_wls.get_prediction(x.tolist()) + ci3b = pred_res3b.conf_int(obs=True) + assert_allclose(pred_res3b.se_obs, pred_res3.se_obs, rtol=1e-13) + assert_allclose(ci3b, ci3, rtol=1e-13) + res_df = pred_res3b.summary_frame() + assert_equal(res_df.index.values, [0, 1]) + + def test_glm(self): + # prelimnimary, getting started with basic test for GLM.get_prediction + from statsmodels.genmod.generalized_linear_model import GLM + + res_wls = self.res_wls + mod_wls = res_wls.model + y, X, wi = mod_wls.endog, mod_wls.exog, mod_wls.weights + + w_sqrt = np.sqrt(wi) # notation wi is weights, `w` is var + mod_glm = GLM(y * w_sqrt, X * w_sqrt[:, None]) + + # compare using t distribution + res_glm = mod_glm.fit(use_t=True) + pred_glm = res_glm.get_prediction() + sf_glm = pred_glm.summary_frame() + + pred_res_wls = res_wls.get_prediction() + sf_wls = pred_res_wls.summary_frame() + n_compare = 30 # in glm with predict wendog + assert_allclose(sf_glm.values[:n_compare], sf_wls.values[:n_compare, :4]) + + # compare using normal distribution + + res_glm = mod_glm.fit() # default use_t=False + pred_glm = res_glm.get_prediction() + sf_glm = pred_glm.summary_frame() + + res_wls = mod_wls.fit(use_t=False) + pred_res_wls = res_wls.get_prediction() + sf_wls = pred_res_wls.summary_frame() + assert_allclose(sf_glm.values[:n_compare], sf_wls.values[:n_compare, :4]) + + # function for parameter transformation + # should be separate test method + from statsmodels.base._prediction_inference import params_transform_univariate + + rates = params_transform_univariate(res_glm.params, res_glm.cov_params()) + + rates2 = np.column_stack( + ( + np.exp(res_glm.params), + res_glm.bse * np.exp(res_glm.params), + np.exp(res_glm.conf_int()), + ) + ) + assert_allclose(rates.summary_frame().values, rates2, rtol=1e-13) + + from statsmodels.genmod.families import links + + # with identity transform + pt = params_transform_univariate( + res_glm.params, res_glm.cov_params(), link=links.Identity() + ) + + assert_allclose(pt.tvalues, res_glm.tvalues, rtol=1e-13) + assert_allclose(pt.se_mean, res_glm.bse, rtol=1e-13) + ptt = pt.t_test() + assert_allclose(ptt[0], res_glm.tvalues, rtol=1e-13) + assert_allclose(ptt[1], res_glm.pvalues, rtol=1e-13) + + # prediction with exog and no weights does not error + res_glm = mod_glm.fit() + pred_glm = res_glm.get_prediction(X) + + # check that list works, issue 4437 + x = res_glm.model.exog.mean(0) + pred_res3 = res_glm.get_prediction(x) + ci3 = pred_res3.conf_int() + pred_res3b = res_glm.get_prediction(x.tolist()) + ci3b = pred_res3b.conf_int() + assert_allclose(pred_res3b.se_mean, pred_res3.se_mean, rtol=1e-13) + assert_allclose(ci3b, ci3, rtol=1e-13) + res_df = pred_res3b.summary_frame() + assert_equal(res_df.index.values, [0]) + + x = res_glm.model.exog[-2:] + pred_res3 = res_glm.get_prediction(x) + ci3 = pred_res3.conf_int() + pred_res3b = res_glm.get_prediction(x.tolist()) + ci3b = pred_res3b.conf_int() + assert_allclose(pred_res3b.se_mean, pred_res3.se_mean, rtol=1e-13) + assert_allclose(ci3b, ci3, rtol=1e-13) + res_df = pred_res3b.summary_frame() + assert_equal(res_df.index.values, [0, 1]) + + +def test_predict_remove_data(): + # GH6887 + rs = np.random.RandomState(3821010) + endog = [i + rs.normal(scale=0.1) for i in range(100)] + exog = list(range(100)) + model = WLS(endog, exog, weights=[1 for _ in range(100)]).fit() + # we need to compute scale before we remove wendog, wexog + assert isinstance(model.scale, float) + model.remove_data() + scalar = model.get_prediction(1).predicted_mean + pred = model.get_prediction([1]) + one_d = pred.predicted_mean + assert_allclose(scalar, one_d) + # smoke test for inferenctial part + pred.summary_frame() + + series = model.get_prediction(pd.Series([1])).predicted_mean + assert_allclose(scalar, series) + + +def test_prediction_results_t_test(): + from scipy import stats as sp_stats + + from statsmodels.genmod.generalized_linear_model import GLM + + rs = np.random.RandomState(918273) + n = 40 + exog = np.column_stack([np.ones(n), rs.standard_normal((n, 2))]) + endog = exog @ [1.0, 0.5, -0.5] + rs.standard_normal(n) + # GLM.get_prediction returns PredictionResultsMean, the class that + # actually implements t_test; OLS's get_prediction is a different, + # unrelated PredictionResults class of the same name. + res = GLM(endog, exog).fit() + pred = res.get_prediction() + + stat, pvalue = pred.t_test(value=0, alternative="two-sided") + expected_stat = pred.predicted / pred.se + assert_allclose(stat, expected_stat) + assert_allclose(pvalue, pred.dist.sf(np.abs(expected_stat), *pred.dist_args) * 2) + + stat_l, pvalue_l = pred.t_test(value=1.0, alternative="larger") + expected_stat_l = (pred.predicted - 1.0) / pred.se + assert_allclose(stat_l, expected_stat_l) + assert_allclose(pvalue_l, pred.dist.sf(expected_stat_l, *pred.dist_args)) + + stat_s, pvalue_s = pred.t_test(value=1.0, alternative="smaller") + assert_allclose(stat_s, expected_stat_l) + assert_allclose(pvalue_s, pred.dist.cdf(expected_stat_l, *pred.dist_args)) + + # smaller-side p-value is 1 minus the larger-side p-value for the same + # statistic, by definition + assert_allclose(pvalue_s, 1 - pvalue_l, atol=1e-10) + + with pytest.raises(ValueError, match="alternative must be one of"): + pred.t_test(alternative="not-a-real-option") + + # undocumented short forms still work but warn, and are equivalent to + # spelling out the documented alternative + for alias, canonical in [("2s", "two-sided"), ("l", "larger"), ("s", "smaller")]: + with pytest.warns(FutureWarning, match="is a deprecated alias"): + alias_result = pred.t_test(value=1.0, alternative=alias) + canonical_result = pred.t_test(value=1.0, alternative=canonical) + assert_allclose(alias_result, canonical_result) + + # GLM defaults to use_t=False -> normal reference distribution + assert pred.dist is sp_stats.norm + assert pred.dist_args == () + + res_t = GLM(endog, exog).fit(use_t=True) + pred_t = res_t.get_prediction() + assert pred_t.dist is sp_stats.t + assert pred_t.dist_args == (pred_t.df,) + + +def test_prediction_results_mean_conf_int_invalid_method(): + from statsmodels.genmod.generalized_linear_model import GLM + + rs = np.random.RandomState(918273) + n = 40 + exog = np.column_stack([np.ones(n), rs.standard_normal((n, 2))]) + endog = exog @ [1.0, 0.5, -0.5] + rs.standard_normal(n) + res = GLM(endog, exog).fit() + pred = res.get_prediction() + + assert pred.conf_int(method="endpoint") is not None + assert pred.conf_int(method="delta") is not None + with pytest.raises(ValueError, match="method"): + pred.conf_int(method="not-a-method") + + +def test_prediction_results_mean_var_pred_mean(): + # PredictionResultsMean.var_pred_mean had no test coverage -- existing + # tests only ever access the related se_mean (== sqrt(self.var_pred)), + # which reads self.var_pred directly rather than going through the + # var_pred_mean property, so var_pred_mean's own body never ran. + # + # Use a Gaussian-family, identity-link GLM (numerically equivalent to + # OLS) so the get_prediction_glm formula + # var_pred_mean = link_deriv**2 * (exog*cov_params@exog.T).sum(1) + # reduces to the textbook mean-prediction variance x0 @ cov_params @ x0 + # for each row x0, which can be computed by hand independently. + from statsmodels.genmod.generalized_linear_model import GLM + + rng = np.random.default_rng(918273) + n = 40 + exog = np.column_stack([np.ones(n), rng.standard_normal((n, 2))]) + endog = exog @ [1.0, 0.5, -0.5] + rng.standard_normal(n) + res = GLM(endog, exog).fit() + + exog0 = np.column_stack([np.ones(5), rng.standard_normal((5, 2))]) + pred = res.get_prediction(exog0) + + covb = res.cov_params() + expected = np.array([x0 @ covb @ x0 for x0 in exog0]) + assert_allclose(pred.var_pred_mean, expected, rtol=1e-10) + + # it is documented as a backwards-compatibility alias for var_pred + assert pred.var_pred_mean is pred.var_pred + assert_allclose(pred.var_pred_mean, pred.se_mean**2, rtol=1e-10) diff --git a/shared/package-files/07/07b395e4a69af89b41c5fa0722f00fb2a985ea29bb1d598fa8dff57b6876a01b/blob b/shared/package-files/07/07b395e4a69af89b41c5fa0722f00fb2a985ea29bb1d598fa8dff57b6876a01b/blob new file mode 100644 index 0000000000000000000000000000000000000000..c93da9b82d72ec728aa031e4985b6a6231c30475 --- /dev/null +++ b/shared/package-files/07/07b395e4a69af89b41c5fa0722f00fb2a985ea29bb1d598fa8dff57b6876a01b/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API ::std::tuple _native_multi_head_attention_out(at::Tensor & out0, at::Tensor & out1, const at::Tensor & query, const at::Tensor & key, const at::Tensor & value, int64_t embed_dim, int64_t num_head, const at::Tensor & qkv_weight, const at::Tensor & qkv_bias, const at::Tensor & proj_weight, const at::Tensor & proj_bias, const c10::optional & mask={}, bool need_weights=true, bool average_attn_weights=true, c10::optional mask_type=c10::nullopt); +TORCH_API ::std::tuple _native_multi_head_attention_outf(const at::Tensor & query, const at::Tensor & key, const at::Tensor & value, int64_t embed_dim, int64_t num_head, const at::Tensor & qkv_weight, const at::Tensor & qkv_bias, const at::Tensor & proj_weight, const at::Tensor & proj_bias, const c10::optional & mask, bool need_weights, bool average_attn_weights, c10::optional mask_type, at::Tensor & out0, at::Tensor & out1); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/07/07b4920d8f43f8a49477d01d9ac8c856daf9cd6ba5332a722e68fb9bda4b82ab/blob b/shared/package-files/07/07b4920d8f43f8a49477d01d9ac8c856daf9cd6ba5332a722e68fb9bda4b82ab/blob new file mode 100644 index 0000000000000000000000000000000000000000..66179e5ea3aba3940ce445a82baa4c0fc77e0134 --- /dev/null +++ b/shared/package-files/07/07b4920d8f43f8a49477d01d9ac8c856daf9cd6ba5332a722e68fb9bda4b82ab/blob @@ -0,0 +1,122 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +from ..utils._array_api import ( + _find_matching_floating_dtype, + get_namespace_and_device, +) + + +def _weighted_percentile(array, sample_weight, percentile_rank=50, xp=None): + """Compute the weighted percentile with method 'inverted_cdf'. + + When the percentile lies between two data points of `array`, the function returns + the lower value. + + If `array` is a 2D array, the `values` are selected along axis 0. + + `NaN` values are ignored by setting their weights to 0. If `array` is 2D, this + is done in a column-isolated manner: a `NaN` in the second column, does not impact + the percentile computed for the first column even if `sample_weight` is 1D. + + .. versionchanged:: 0.24 + Accepts 2D `array`. + + .. versionchanged:: 1.7 + Supports handling of `NaN` values. + + Parameters + ---------- + array : 1D or 2D array + Values to take the weighted percentile of. + + sample_weight: 1D or 2D array + Weights for each value in `array`. Must be same shape as `array` or of shape + `(array.shape[0],)`. + + percentile_rank: int or float, default=50 + The probability level of the percentile to compute, in percent. Must be between + 0 and 100. + + xp : array_namespace, default=None + The standard-compatible namespace for `array`. Default: infer. + + Returns + ------- + percentile : scalar or 0D array if `array` 1D (or 0D), array if `array` 2D + Weighted percentile at the requested probability level. + """ + xp, _, device = get_namespace_and_device(array) + # `sample_weight` should follow `array` for dtypes + floating_dtype = _find_matching_floating_dtype(array, xp=xp) + array = xp.asarray(array, dtype=floating_dtype, device=device) + sample_weight = xp.asarray(sample_weight, dtype=floating_dtype, device=device) + + n_dim = array.ndim + if n_dim == 0: + return array + if array.ndim == 1: + array = xp.reshape(array, (-1, 1)) + # When sample_weight 1D, repeat for each array.shape[1] + if array.shape != sample_weight.shape and array.shape[0] == sample_weight.shape[0]: + sample_weight = xp.tile(sample_weight, (array.shape[1], 1)).T + # Sort `array` and `sample_weight` along axis=0: + sorted_idx = xp.argsort(array, axis=0) + sorted_weights = xp.take_along_axis(sample_weight, sorted_idx, axis=0) + + # Set NaN values in `sample_weight` to 0. Only perform this operation if NaN + # values present to avoid temporary allocations of size `(n_samples, n_features)`. + n_features = array.shape[1] + largest_value_per_column = array[ + sorted_idx[-1, ...], xp.arange(n_features, device=device) + ] + # NaN values get sorted to end (largest value) + if xp.any(xp.isnan(largest_value_per_column)): + sorted_nan_mask = xp.take_along_axis(xp.isnan(array), sorted_idx, axis=0) + sorted_weights[sorted_nan_mask] = 0 + + # Compute the weighted cumulative distribution function (CDF) based on + # `sample_weight` and scale `percentile_rank` along it. + # + # Note: we call `xp.cumulative_sum` on the transposed `sorted_weights` to + # ensure that the result is of shape `(n_features, n_samples)` so + # `xp.searchsorted` calls take contiguous inputs as a result (for + # performance reasons). + weight_cdf = xp.cumulative_sum(sorted_weights.T, axis=1) + adjusted_percentile_rank = percentile_rank / 100 * weight_cdf[..., -1] + + # Ignore leading `sample_weight=0` observations when `percentile_rank=0` (#20528) + mask = adjusted_percentile_rank == 0 + adjusted_percentile_rank[mask] = xp.nextafter( + adjusted_percentile_rank[mask], adjusted_percentile_rank[mask] + 1 + ) + # For each feature with index j, find sample index i of the scalar value + # `adjusted_percentile_rank[j]` in 1D array `weight_cdf[j]`, such that: + # weight_cdf[j, i-1] < adjusted_percentile_rank[j] <= weight_cdf[j, i]. + percentile_indices = xp.stack( + [ + xp.searchsorted( + weight_cdf[feature_idx, ...], adjusted_percentile_rank[feature_idx] + ) + for feature_idx in range(weight_cdf.shape[0]) + ], + ) + # In rare cases, `percentile_indices` equals to `sorted_idx.shape[0]` + max_idx = sorted_idx.shape[0] - 1 + percentile_indices = xp.clip(percentile_indices, 0, max_idx) + + col_indices = xp.arange(array.shape[1], device=device) + percentile_in_sorted = sorted_idx[percentile_indices, col_indices] + + result = array[percentile_in_sorted, col_indices] + + return result[0] if n_dim == 1 else result + + +# TODO: refactor to do the symmetrisation inside _weighted_percentile to avoid +# sorting the input array twice. +def _averaged_weighted_percentile(array, sample_weight, percentile_rank=50, xp=None): + return ( + _weighted_percentile(array, sample_weight, percentile_rank, xp=xp) + - _weighted_percentile(-array, sample_weight, 100 - percentile_rank, xp=xp) + ) / 2 diff --git a/shared/package-files/07/07b5111f546dc4a434583d163e38bdd937ce57c1ae02004f7e0da3abecfd1b7c/blob b/shared/package-files/07/07b5111f546dc4a434583d163e38bdd937ce57c1ae02004f7e0da3abecfd1b7c/blob new file mode 100644 index 0000000000000000000000000000000000000000..9eb1da761f943803b625a50859cfb04aaee036e0 --- /dev/null +++ b/shared/package-files/07/07b5111f546dc4a434583d163e38bdd937ce57c1ae02004f7e0da3abecfd1b7c/blob @@ -0,0 +1,23 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_sigmoid_backward_out : public at::meta::structured_sigmoid_backward { +void impl(const at::Tensor & grad_output, const at::Tensor & output, const at::Tensor & grad_input); +}; +} // namespace native +} // namespace at diff --git a/shared/package-files/07/07b8a3cde5459b43e352f71f3717033aa8be72c80b371006e73ab6fe4755fd71/blob b/shared/package-files/07/07b8a3cde5459b43e352f71f3717033aa8be72c80b371006e73ab6fe4755fd71/blob new file mode 100644 index 0000000000000000000000000000000000000000..581ff66fa6d7ee43ad46e49e2d069179e3d47de2 --- /dev/null +++ b/shared/package-files/07/07b8a3cde5459b43e352f71f3717033aa8be72c80b371006e73ab6fe4755fd71/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_special_shifted_chebyshev_polynomial_w_out : public at::meta::structured_special_shifted_chebyshev_polynomial_w { +void impl(const at::Tensor & x, const at::Tensor & n, const at::Tensor & out); +}; +TORCH_API at::Tensor special_shifted_chebyshev_polynomial_w(const at::Scalar & x, const at::Tensor & n); +TORCH_API at::Tensor & special_shifted_chebyshev_polynomial_w_out(const at::Scalar & x, const at::Tensor & n, at::Tensor & out); +TORCH_API at::Tensor special_shifted_chebyshev_polynomial_w(const at::Tensor & x, const at::Scalar & n); +TORCH_API at::Tensor & special_shifted_chebyshev_polynomial_w_out(const at::Tensor & x, const at::Scalar & n, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/07/07b9c150752c0c372752d6f58ebe298b9f701222ad92ce379b6f9c5d1f4892b1/blob b/shared/package-files/07/07b9c150752c0c372752d6f58ebe298b9f701222ad92ce379b6f9c5d1f4892b1/blob new file mode 100644 index 0000000000000000000000000000000000000000..68289ac992566d0667fabdd16ae19930494f2862 --- /dev/null +++ b/shared/package-files/07/07b9c150752c0c372752d6f58ebe298b9f701222ad92ce379b6f9c5d1f4892b1/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor logical_and(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & logical_and_(at::Tensor & self, const at::Tensor & other); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/07/07bd5127ffd49c79b912fd2765b81d2af8ab1a016010deaea93be31a169215bd/blob b/shared/package-files/07/07bd5127ffd49c79b912fd2765b81d2af8ab1a016010deaea93be31a169215bd/blob new file mode 100644 index 0000000000000000000000000000000000000000..3290d6e7ce7cb2d5204f05716e9bb9369728a585 --- /dev/null +++ b/shared/package-files/07/07bd5127ffd49c79b912fd2765b81d2af8ab1a016010deaea93be31a169215bd/blob @@ -0,0 +1,79 @@ +import numpy as np +import pandas as pd + +from .._explainer import Explainer + +try: + import lime + import lime.lime_tabular +except ImportError: + pass + + +class LimeTabular(Explainer): + """Simply wrap of lime.lime_tabular.LimeTabularExplainer into the common shap interface. + + Parameters + ---------- + model : function or iml.Model + User supplied function that takes a matrix of samples (# samples x # features) and + computes the output of the model for those samples. The output can be a vector + (# samples) or a matrix (# samples x # model outputs). + + data : numpy.array + The background dataset. + + mode : "classification" or "regression" + Control the mode of LIME tabular. + + """ + + def __init__(self, model, data, mode="classification"): + self.model = model + if mode not in ["classification", "regression"]: + emsg = f"Invalid mode {mode!r}, must be one of 'classification' or 'regression'" + raise ValueError(emsg) + self.mode = mode + + if isinstance(data, pd.DataFrame): + data = data.values + self.data = data + self.explainer = lime.lime_tabular.LimeTabularExplainer(data, mode=mode) + + out = self.model(data[0:1]) + if len(out.shape) == 1: + self.out_dim = 1 + self.flat_out = True + if mode == "classification": + + def pred(X): # assume that 1d outputs are probabilities + preds = self.model(X).reshape(-1, 1) + p0 = 1 - preds + return np.hstack((p0, preds)) + + self.model = pred + else: + self.out_dim = self.model(data[0:1]).shape[1] + self.flat_out = False + + def attributions(self, X, nsamples=5000, num_features=None): + num_features = X.shape[1] if num_features is None else num_features + + if isinstance(X, pd.DataFrame): + X = X.values + + out = [np.zeros(X.shape) for j in range(self.out_dim)] + for i in range(X.shape[0]): + exp = self.explainer.explain_instance( + X[i], self.model, labels=range(self.out_dim), num_features=num_features + ) + for j in range(self.out_dim): + for k, v in exp.local_exp[j]: + out[j][i, k] = v + + # because it output two results even for only one model output, and they are negated from what we expect + if self.mode == "regression": + for i in range(len(out)): + out[i] = -out[i] + + return out[0] if self.flat_out else out diff --git a/shared/package-files/07/07bdf1fff20e4121ba61cfb64ea3c404d54ac56b053475a3a105907f48685210/blob b/shared/package-files/07/07bdf1fff20e4121ba61cfb64ea3c404d54ac56b053475a3a105907f48685210/blob new file mode 100644 index 0000000000000000000000000000000000000000..348dc471f4c3d44af8cd984fc5d08b1d2072f30b --- /dev/null +++ b/shared/package-files/07/07bdf1fff20e4121ba61cfb64ea3c404d54ac56b053475a3a105907f48685210/blob @@ -0,0 +1,95 @@ +""" +Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's +Smalltalk testing framework (used with permission). + +This module contains the core framework classes that form the basis of +specific test cases and suites (TestCase, TestSuite etc.), and also a +text-based utility class for running the tests and reporting the results + (TextTestRunner). + +Simple usage: + + import unittest + + class IntegerArithmeticTestCase(unittest.TestCase): + def testAdd(self): # test method names begin with 'test' + self.assertEqual((1 + 2), 3) + self.assertEqual(0 + 1, 1) + def testMultiply(self): + self.assertEqual((0 * 10), 0) + self.assertEqual((5 * 8), 40) + + if __name__ == '__main__': + unittest.main() + +Further information is available in the bundled documentation, and from + + http://docs.python.org/library/unittest.html + +Copyright (c) 1999-2003 Steve Purcell +Copyright (c) 2003-2010 Python Software Foundation +This module is free software, and you may redistribute it and/or modify +it under the same terms as Python itself, so long as this copyright message +and disclaimer are retained in their original form. + +IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, +SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF +THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, +AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, +SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +""" + +__all__ = ['TestResult', 'TestCase', 'IsolatedAsyncioTestCase', 'TestSuite', + 'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main', + 'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless', + 'expectedFailure', 'TextTestResult', 'installHandler', + 'registerResult', 'removeResult', 'removeHandler', + 'addModuleCleanup'] + +# Expose obsolete functions for backwards compatibility +__all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases']) + +__unittest = True + +from .result import TestResult +from .case import (addModuleCleanup, TestCase, FunctionTestCase, SkipTest, skip, + skipIf, skipUnless, expectedFailure) +from .suite import BaseTestSuite, TestSuite +from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames, + findTestCases) +from .main import TestProgram, main +from .runner import TextTestRunner, TextTestResult +from .signals import installHandler, registerResult, removeResult, removeHandler +# IsolatedAsyncioTestCase will be imported lazily. + +# deprecated +_TextTestResult = TextTestResult + +# There are no tests here, so don't try to run anything discovered from +# introspecting the symbols (e.g. FunctionTestCase). Instead, all our +# tests come from within unittest.test. +def load_tests(loader, tests, pattern): + import os.path + # top level directory cached on loader instance + this_dir = os.path.dirname(__file__) + return loader.discover(start_dir=this_dir, pattern=pattern) + + +# Lazy import of IsolatedAsyncioTestCase from .async_case +# It imports asyncio, which is relatively heavy, but most tests +# do not need it. + +def __dir__(): + return globals().keys() | {'IsolatedAsyncioTestCase'} + +def __getattr__(name): + if name == 'IsolatedAsyncioTestCase': + global IsolatedAsyncioTestCase + from .async_case import IsolatedAsyncioTestCase + return IsolatedAsyncioTestCase + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/shared/package-files/07/07c0ecb2b415c82e26c2f4853fbf1c18bd2f0a76605610da01b644fa3b172d48/blob b/shared/package-files/07/07c0ecb2b415c82e26c2f4853fbf1c18bd2f0a76605610da01b644fa3b172d48/blob new file mode 100644 index 0000000000000000000000000000000000000000..23065379f58193ae2f240d7bff44aaf70f8a8dca --- /dev/null +++ b/shared/package-files/07/07c0ecb2b415c82e26c2f4853fbf1c18bd2f0a76605610da01b644fa3b172d48/blob @@ -0,0 +1,85 @@ +"""UnitDblConverter module containing class UnitDblConverter.""" + +import numpy as np + +from matplotlib import cbook, units +import matplotlib.projections.polar as polar + +__all__ = ['UnitDblConverter'] + + +# A special function for use with the matplotlib FuncFormatter class +# for formatting axes with radian units. +# This was copied from matplotlib example code. +def rad_fn(x, pos=None): + """Radian function formatter.""" + n = int((x / np.pi) * 2.0 + 0.25) + if n == 0: + return str(x) + elif n == 1: + return r'$\pi/2$' + elif n == 2: + return r'$\pi$' + elif n % 2 == 0: + return fr'${n//2}\pi$' + else: + return fr'${n}\pi/2$' + + +class UnitDblConverter(units.ConversionInterface): + """ + Provides Matplotlib conversion functionality for the Monte UnitDbl class. + """ + # default for plotting + defaults = { + "distance": 'km', + "angle": 'deg', + "time": 'sec', + } + + @staticmethod + def axisinfo(unit, axis): + # docstring inherited + + # Delay-load due to circular dependencies. + import matplotlib.testing.jpl_units as U + + # Check to see if the value used for units is a string unit value + # or an actual instance of a UnitDbl so that we can use the unit + # value for the default axis label value. + if unit: + label = unit if isinstance(unit, str) else unit.label() + else: + label = None + + if label == "deg" and isinstance(axis.axes, polar.PolarAxes): + # If we want degrees for a polar plot, use the PolarPlotFormatter + majfmt = polar.PolarAxes.ThetaFormatter() + else: + majfmt = U.UnitDblFormatter(useOffset=False) + + return units.AxisInfo(majfmt=majfmt, label=label) + + @staticmethod + def convert(value, unit, axis): + # docstring inherited + if not cbook.is_scalar_or_string(value): + return [UnitDblConverter.convert(x, unit, axis) for x in value] + # If no units were specified, then get the default units to use. + if unit is None: + unit = UnitDblConverter.default_units(value, axis) + # Convert the incoming UnitDbl value/values to float/floats + if isinstance(axis.axes, polar.PolarAxes) and value.type() == "angle": + # Guarantee that units are radians for polar plots. + return value.convert("rad") + return value.convert(unit) + + @staticmethod + def default_units(value, axis): + # docstring inherited + # Determine the default units based on the user preferences set for + # default units when printing a UnitDbl. + if cbook.is_scalar_or_string(value): + return UnitDblConverter.defaults[value.type()] + else: + return UnitDblConverter.default_units(value[0], axis) diff --git a/shared/package-files/07/07c36da17bef8e3f295b47f24105f0b0527b8fb8f70e56b1831b97c18e18e75e/blob b/shared/package-files/07/07c36da17bef8e3f295b47f24105f0b0527b8fb8f70e56b1831b97c18e18e75e/blob new file mode 100644 index 0000000000000000000000000000000000000000..05c033adf0e2a01df005385e1aaf5ccf49511e5f --- /dev/null +++ b/shared/package-files/07/07c36da17bef8e3f295b47f24105f0b0527b8fb8f70e56b1831b97c18e18e75e/blob @@ -0,0 +1,39 @@ +from typing import Any, Optional, Union +from uuid import UUID + +from django.contrib.contenttypes.models import ContentType +from django.db.models.base import Model + +from django.db import models + +ADDITION: int +CHANGE: int +DELETION: int +ACTION_FLAG_CHOICES: Any + +class LogEntryManager(models.Manager["LogEntry"]): + def log_action( + self, + user_id: int, + content_type_id: int, + object_id: Union[int, str, UUID], + object_repr: str, + action_flag: int, + change_message: Any = ..., + ) -> LogEntry: ... + +class LogEntry(models.Model): + action_time: models.DateTimeField = ... + user: models.ForeignKey = ... + content_type: models.ForeignKey = models.ForeignKey(ContentType, on_delete=models.CASCADE) + object_id: models.TextField = ... + object_repr: models.CharField = ... + action_flag: models.PositiveSmallIntegerField = ... + change_message: models.TextField = ... + objects: LogEntryManager = ... + def is_addition(self) -> bool: ... + def is_change(self) -> bool: ... + def is_deletion(self) -> bool: ... + def get_change_message(self) -> str: ... + def get_edited_object(self) -> Model: ... + def get_admin_url(self) -> Optional[str]: ... diff --git a/shared/package-files/07/07c7e64848fea041bf31109603fb80c1bd24acf2e4583fee2e6061e5bbaf5463/blob b/shared/package-files/07/07c7e64848fea041bf31109603fb80c1bd24acf2e4583fee2e6061e5bbaf5463/blob new file mode 100644 index 0000000000000000000000000000000000000000..88ebb929b373d1afb0658238b6f9ee4470757b43 --- /dev/null +++ b/shared/package-files/07/07c7e64848fea041bf31109603fb80c1bd24acf2e4583fee2e6061e5bbaf5463/blob @@ -0,0 +1,98 @@ +""" +Created on Thu Jan 6 13:55:50 2022 + +Author: Josef Perktod +License: BSD-3 +""" + +import numpy as np + +from statsmodels.tools.testing import Holder + +hurdle_poisson = Holder() +# r library pscl, docvis data +# > mod = hurdle( docvis ~ aget + totchr, data=dt, zero.dist = "poisson") +hurdle_poisson.method = "BFGS" +hurdle_poisson.n = 3629 +hurdle_poisson.df_null = 3627 +hurdle_poisson.df_residual = 3623 +hurdle_poisson.loglik = -13612.9091771797 +hurdle_poisson.aic = 27237.81835436 +hurdle_poisson.bic = 27274.9986288 +hurdle_poisson.vcov = np.array([ + 0.000239404800324688, -4.59559682721834e-05, -4.59865258972631e-05, 0, 0, + 0, -4.59559682721834e-05, 2.54346275490526e-05, -1.20164687288645e-06, 0, + 0, 0, -4.59865258972631e-05, -1.20164687288644e-06, 2.01936456643824e-05, + 0, 0, 0, 0, 0, 0, 0.00241829560973498, -0.000548499729173446, + -0.000636055275016966, 0, 0, 0, -0.000548499729173446, + 0.000351548196602719, -6.30088654100178e-05, 0, 0, 0, + -0.000636055275016966, -6.30088654100178e-05, 0.000562508220544602 + ]).reshape(6, 6, order="F") + +hurdle_poisson.count = np.array([ + 1.54175599063303, 0.0122763123129474, 0.209943725275436, + 0.0154727114729348, 0.00504327547820388, 0.00449373404468738, + 99.6435559035596, 2.43419427830254, 46.719214619218, 0, + 0.0149249819228085, 0 + ]).reshape(3, 4, order="F") + +hurdle_poisson.zero = np.array([ + 0.216740121452838, 0.0189277243223132, 0.386748883124962, + 0.0491761691242311, 0.0187496185721929, 0.0237172557549267, + 4.40742183282514, 1.00949916657955, 16.3066455546664, + 1.04608334100715e-05, 0.312735301122465, 8.85224303880408e-60 + ]).reshape(3, 4, order="F") + +hurdle_poisson.params_table = np.concatenate((hurdle_poisson.zero, + hurdle_poisson.count), axis=0) + +# > dfm = data.frame(t(as.matrix(dtm))) # at means +# > predict(mod, dfm) +hurdle_poisson.predict_mean = 6.530525236464 +# > predict(mod, dfm, type="prob", at=c(0, 1, 2, 3)) +hurdle_poisson.predict_prob = np.array([ + 0.07266312350019, 0.005744258908698, 0.02020842274659, 0.04739576870239, + ]) +# > predict(mod, dfm, type="count") +hurdle_poisson.predict_mean_main = 7.036041748046 +# > predict(mod, dfm, type="zero") +hurdle_poisson.predict_zero = 0.9281532813926 + +hurdle_l1 = Holder() +""" +# R pscl does not allow regularized fits, so we have to rely on internally +# generated benchmarks. +# Created on Mon Nov 24, 2025 with: +from statsmodels.discrete.truncated_model import HurdleCountModel +from statsmodels.sandbox.regression.tests.test_gmm_poisson import DATA + +endog = DATA["docvis"] +exog_names = ["aget", "totchr", "const"] +exog = DATA[exog_names] + +hurdle = HurdleCountModel(endog=endog, exog=exog, dist="poisson", zerodist="poisson") +hurdle_result = hurdle.fit_regularized(method="l1", alpha=1) + +# bse and conf_int regenerated after the standard errors were switched from +# the two component fits to the joint covariance. The earlier values had a +# nan for x1, whose standard error came from a component fit that trimmed it +# even though the reported params, taken from the joint refit, did not. +# params, nnz_params, aic and bic are unaffected by that change. +""" +hurdle_l1.params = [ + 0.01919266, 0.38688315, 0.21549933, 0.01229817, 0.20997089, 1.54160776 +] +hurdle_l1.conf_int = [ + [-0.01755772, 0.05594304], + [0.34039722, 0.43336909], + [0.11909105, 0.31190761], + [0.00241333, 0.02218300], + [0.20116318, 0.21877859], + [1.51128059, 1.57193492], +] +hurdle_l1.bse = [ + 0.01875054, 0.02371775, 0.04918880, 0.00504338, 0.00449381, 0.01547333 +] +hurdle_l1.nnz_params = 6 +hurdle_l1.aic = 27237.819293111268 +hurdle_l1.bic = 27274.999567554547 diff --git a/shared/package-files/07/07cb5e5f1353b71d987ed9459569ef609cfc370dd025545bdb61999ac9045a7a/blob b/shared/package-files/07/07cb5e5f1353b71d987ed9459569ef609cfc370dd025545bdb61999ac9045a7a/blob new file mode 100644 index 0000000000000000000000000000000000000000..1728013043da66604f808b08dc921f5ca5afc218 --- /dev/null +++ b/shared/package-files/07/07cb5e5f1353b71d987ed9459569ef609cfc370dd025545bdb61999ac9045a7a/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API ::std::tuple linalg_lu(const at::Tensor & A, bool pivot=true); +TORCH_API ::std::tuple linalg_lu_out(at::Tensor & P, at::Tensor & L, at::Tensor & U, const at::Tensor & A, bool pivot=true); +TORCH_API ::std::tuple linalg_lu_outf(const at::Tensor & A, bool pivot, at::Tensor & P, at::Tensor & L, at::Tensor & U); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/07/07cb78a01a0eefe4fbf9c7a2588bb03478e021b8a2bf719bc672d3ded711b805/blob b/shared/package-files/07/07cb78a01a0eefe4fbf9c7a2588bb03478e021b8a2bf719bc672d3ded711b805/blob new file mode 100644 index 0000000000000000000000000000000000000000..dead21aa93e4f955b7f82ffd79c684f820be7670 --- /dev/null +++ b/shared/package-files/07/07cb78a01a0eefe4fbf9c7a2588bb03478e021b8a2bf719bc672d3ded711b805/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API ::std::tuple _scaled_dot_product_efficient_attention_backward_cuda(const at::Tensor & grad_out_, const at::Tensor & query, const at::Tensor & key, const at::Tensor & value, const at::Tensor & attn_bias, const at::Tensor & out, const at::Tensor & logsumexp, const at::Tensor & philox_seed, const at::Tensor & philox_offset, double dropout_p, ::std::array grad_input_mask, bool is_causal=false, c10::optional scale=c10::nullopt); +} // namespace native +} // namespace at diff --git a/shared/package-files/07/07ce201506d0c98fdafbf601794b4648c8bf593d8dd7ccb723725d146cd4c785/blob b/shared/package-files/07/07ce201506d0c98fdafbf601794b4648c8bf593d8dd7ccb723725d146cd4c785/blob new file mode 100644 index 0000000000000000000000000000000000000000..572e5117d224bbcdc8d0b056a7dd7b1cb8274acd --- /dev/null +++ b/shared/package-files/07/07ce201506d0c98fdafbf601794b4648c8bf593d8dd7ccb723725d146cd4c785/blob @@ -0,0 +1,29 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_frac_out : public at::meta::structured_frac { +void impl(const at::Tensor & self, const at::Tensor & out); +}; +TORCH_API at::Tensor frac_sparse(const at::Tensor & self); +TORCH_API at::Tensor & frac_sparse_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & frac_sparse_(at::Tensor & self); +TORCH_API at::Tensor frac_sparse_csr(const at::Tensor & self); +TORCH_API at::Tensor & frac_sparse_csr_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & frac_sparse_csr_(at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/07/07ce3d138bdfef6b6c5afd7535f8b1254eaf8d7d20a4c972bc744a4819345754/blob b/shared/package-files/07/07ce3d138bdfef6b6c5afd7535f8b1254eaf8d7d20a4c972bc744a4819345754/blob new file mode 100644 index 0000000000000000000000000000000000000000..49d756cf32d34306fbb4eb3525f1c5b70d5f155c --- /dev/null +++ b/shared/package-files/07/07ce3d138bdfef6b6c5afd7535f8b1254eaf8d7d20a4c972bc744a4819345754/blob @@ -0,0 +1,184 @@ +import numpy as np +import pytest + +from pandas import ( + DataFrame, + Index, + Series, +) +import pandas._testing as tm +from pandas.tests.copy_view.util import get_array + + +def index_view(index_data=[1, 2]): + df = DataFrame({"a": index_data, "b": 1.5}) + view = df[:] + df = df.set_index("a", drop=True) + idx = df.index + # df = None + return idx, view + + +def test_set_index_update_column(using_copy_on_write, warn_copy_on_write): + df = DataFrame({"a": [1, 2], "b": 1}) + df = df.set_index("a", drop=False) + expected = df.index.copy(deep=True) + with tm.assert_cow_warning(warn_copy_on_write): + df.iloc[0, 0] = 100 + if using_copy_on_write: + tm.assert_index_equal(df.index, expected) + else: + tm.assert_index_equal(df.index, Index([100, 2], name="a")) + + +def test_set_index_drop_update_column(using_copy_on_write): + df = DataFrame({"a": [1, 2], "b": 1.5}) + view = df[:] + df = df.set_index("a", drop=True) + expected = df.index.copy(deep=True) + view.iloc[0, 0] = 100 + tm.assert_index_equal(df.index, expected) + + +def test_set_index_series(using_copy_on_write, warn_copy_on_write): + df = DataFrame({"a": [1, 2], "b": 1.5}) + ser = Series([10, 11]) + df = df.set_index(ser) + expected = df.index.copy(deep=True) + with tm.assert_cow_warning(warn_copy_on_write): + ser.iloc[0] = 100 + if using_copy_on_write: + tm.assert_index_equal(df.index, expected) + else: + tm.assert_index_equal(df.index, Index([100, 11])) + + +def test_assign_index_as_series(using_copy_on_write, warn_copy_on_write): + df = DataFrame({"a": [1, 2], "b": 1.5}) + ser = Series([10, 11]) + df.index = ser + expected = df.index.copy(deep=True) + with tm.assert_cow_warning(warn_copy_on_write): + ser.iloc[0] = 100 + if using_copy_on_write: + tm.assert_index_equal(df.index, expected) + else: + tm.assert_index_equal(df.index, Index([100, 11])) + + +def test_assign_index_as_index(using_copy_on_write, warn_copy_on_write): + df = DataFrame({"a": [1, 2], "b": 1.5}) + ser = Series([10, 11]) + rhs_index = Index(ser) + df.index = rhs_index + rhs_index = None # overwrite to clear reference + expected = df.index.copy(deep=True) + with tm.assert_cow_warning(warn_copy_on_write): + ser.iloc[0] = 100 + if using_copy_on_write: + tm.assert_index_equal(df.index, expected) + else: + tm.assert_index_equal(df.index, Index([100, 11])) + + +def test_index_from_series(using_copy_on_write, warn_copy_on_write): + ser = Series([1, 2]) + idx = Index(ser) + expected = idx.copy(deep=True) + with tm.assert_cow_warning(warn_copy_on_write): + ser.iloc[0] = 100 + if using_copy_on_write: + tm.assert_index_equal(idx, expected) + else: + tm.assert_index_equal(idx, Index([100, 2])) + + +def test_index_from_series_copy(using_copy_on_write): + ser = Series([1, 2]) + idx = Index(ser, copy=True) # noqa: F841 + arr = get_array(ser) + ser.iloc[0] = 100 + assert np.shares_memory(get_array(ser), arr) + + +def test_index_from_index(using_copy_on_write, warn_copy_on_write): + ser = Series([1, 2]) + idx = Index(ser) + idx = Index(idx) + expected = idx.copy(deep=True) + with tm.assert_cow_warning(warn_copy_on_write): + ser.iloc[0] = 100 + if using_copy_on_write: + tm.assert_index_equal(idx, expected) + else: + tm.assert_index_equal(idx, Index([100, 2])) + + +@pytest.mark.parametrize( + "func", + [ + lambda x: x._shallow_copy(x._values), + lambda x: x.view(), + lambda x: x.take([0, 1]), + lambda x: x.repeat([1, 1]), + lambda x: x[slice(0, 2)], + lambda x: x[[0, 1]], + lambda x: x._getitem_slice(slice(0, 2)), + lambda x: x.delete([]), + lambda x: x.rename("b"), + lambda x: x.astype("Int64", copy=False), + ], + ids=[ + "_shallow_copy", + "view", + "take", + "repeat", + "getitem_slice", + "getitem_list", + "_getitem_slice", + "delete", + "rename", + "astype", + ], +) +def test_index_ops(using_copy_on_write, func, request): + idx, view_ = index_view() + expected = idx.copy(deep=True) + if "astype" in request.node.callspec.id: + expected = expected.astype("Int64") + idx = func(idx) + view_.iloc[0, 0] = 100 + if using_copy_on_write: + tm.assert_index_equal(idx, expected, check_names=False) + + +def test_infer_objects(using_copy_on_write): + idx, view_ = index_view(["a", "b"]) + expected = idx.copy(deep=True) + idx = idx.infer_objects(copy=False) + view_.iloc[0, 0] = "aaaa" + if using_copy_on_write: + tm.assert_index_equal(idx, expected, check_names=False) + + +def test_index_to_frame(using_copy_on_write): + idx = Index([1, 2, 3], name="a") + expected = idx.copy(deep=True) + df = idx.to_frame() + if using_copy_on_write: + assert np.shares_memory(get_array(df, "a"), idx._values) + assert not df._mgr._has_no_reference(0) + else: + assert not np.shares_memory(get_array(df, "a"), idx._values) + + df.iloc[0, 0] = 100 + tm.assert_index_equal(idx, expected) + + +def test_index_values(using_copy_on_write): + idx = Index([1, 2, 3]) + result = idx.values + if using_copy_on_write: + assert result.flags.writeable is False + else: + assert result.flags.writeable is True diff --git a/shared/package-files/07/07d21d692b326f4c318f26321ce8ff1833b495a01e5831098681210bdc5d9b51/blob b/shared/package-files/07/07d21d692b326f4c318f26321ce8ff1833b495a01e5831098681210bdc5d9b51/blob new file mode 100644 index 0000000000000000000000000000000000000000..11afb412056ad803f0d8ac1d9dcb188d42285fdf Binary files /dev/null and b/shared/package-files/07/07d21d692b326f4c318f26321ce8ff1833b495a01e5831098681210bdc5d9b51/blob differ diff --git a/shared/package-files/07/07d224301cba312fa0697bff9cd5a4bb4f778a90629632091b3f4ae874d89af5/blob b/shared/package-files/07/07d224301cba312fa0697bff9cd5a4bb4f778a90629632091b3f4ae874d89af5/blob new file mode 100644 index 0000000000000000000000000000000000000000..1c450c6fcbe3b62b2247c2fb25a8112f6abca6f6 --- /dev/null +++ b/shared/package-files/07/07d224301cba312fa0697bff9cd5a4bb4f778a90629632091b3f4ae874d89af5/blob @@ -0,0 +1,1681 @@ +"""A powerful, extensible, and easy-to-use option parser. + +By Greg Ward + +Originally distributed as Optik. + +For support, use the optik-users@lists.sourceforge.net mailing list +(http://lists.sourceforge.net/lists/listinfo/optik-users). + +Simple usage example: + + from optparse import OptionParser + + parser = OptionParser() + parser.add_option("-f", "--file", dest="filename", + help="write report to FILE", metavar="FILE") + parser.add_option("-q", "--quiet", + action="store_false", dest="verbose", default=True, + help="don't print status messages to stdout") + + (options, args) = parser.parse_args() +""" + +__version__ = "1.5.3" + +__all__ = ['Option', + 'make_option', + 'SUPPRESS_HELP', + 'SUPPRESS_USAGE', + 'Values', + 'OptionContainer', + 'OptionGroup', + 'OptionParser', + 'HelpFormatter', + 'IndentedHelpFormatter', + 'TitledHelpFormatter', + 'OptParseError', + 'OptionError', + 'OptionConflictError', + 'OptionValueError', + 'BadOptionError', + 'check_choice'] + +__copyright__ = """ +Copyright (c) 2001-2006 Gregory P. Ward. All rights reserved. +Copyright (c) 2002-2006 Python Software Foundation. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the author nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + +import sys, os +import textwrap + +def _repr(self): + return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self) + + +# This file was generated from: +# Id: option_parser.py 527 2006-07-23 15:21:30Z greg +# Id: option.py 522 2006-06-11 16:22:03Z gward +# Id: help.py 527 2006-07-23 15:21:30Z greg +# Id: errors.py 509 2006-04-20 00:58:24Z gward + +try: + from gettext import gettext, ngettext +except ImportError: + def gettext(message): + return message + + def ngettext(singular, plural, n): + if n == 1: + return singular + return plural + +_ = gettext + + +class OptParseError (Exception): + def __init__(self, msg): + self.msg = msg + + def __str__(self): + return self.msg + + +class OptionError (OptParseError): + """ + Raised if an Option instance is created with invalid or + inconsistent arguments. + """ + + def __init__(self, msg, option): + self.msg = msg + self.option_id = str(option) + + def __str__(self): + if self.option_id: + return "option %s: %s" % (self.option_id, self.msg) + else: + return self.msg + +class OptionConflictError (OptionError): + """ + Raised if conflicting options are added to an OptionParser. + """ + +class OptionValueError (OptParseError): + """ + Raised if an invalid option value is encountered on the command + line. + """ + +class BadOptionError (OptParseError): + """ + Raised if an invalid option is seen on the command line. + """ + def __init__(self, opt_str): + self.opt_str = opt_str + + def __str__(self): + return _("no such option: %s") % self.opt_str + +class AmbiguousOptionError (BadOptionError): + """ + Raised if an ambiguous option is seen on the command line. + """ + def __init__(self, opt_str, possibilities): + BadOptionError.__init__(self, opt_str) + self.possibilities = possibilities + + def __str__(self): + return (_("ambiguous option: %s (%s?)") + % (self.opt_str, ", ".join(self.possibilities))) + + +class HelpFormatter: + + """ + Abstract base class for formatting option help. OptionParser + instances should use one of the HelpFormatter subclasses for + formatting help; by default IndentedHelpFormatter is used. + + Instance attributes: + parser : OptionParser + the controlling OptionParser instance + indent_increment : int + the number of columns to indent per nesting level + max_help_position : int + the maximum starting column for option help text + help_position : int + the calculated starting column for option help text; + initially the same as the maximum + width : int + total number of columns for output (pass None to constructor for + this value to be taken from the $COLUMNS environment variable) + level : int + current indentation level + current_indent : int + current indentation level (in columns) + help_width : int + number of columns available for option help text (calculated) + default_tag : str + text to replace with each option's default value, "%default" + by default. Set to false value to disable default value expansion. + option_strings : { Option : str } + maps Option instances to the snippet of help text explaining + the syntax of that option, e.g. "-h, --help" or + "-fFILE, --file=FILE" + _short_opt_fmt : str + format string controlling how short options with values are + printed in help text. Must be either "%s%s" ("-fFILE") or + "%s %s" ("-f FILE"), because those are the two syntaxes that + Optik supports. + _long_opt_fmt : str + similar but for long options; must be either "%s %s" ("--file FILE") + or "%s=%s" ("--file=FILE"). + """ + + NO_DEFAULT_VALUE = "none" + + def __init__(self, + indent_increment, + max_help_position, + width, + short_first): + self.parser = None + self.indent_increment = indent_increment + if width is None: + try: + width = int(os.environ['COLUMNS']) + except (KeyError, ValueError): + width = 80 + width -= 2 + self.width = width + self.help_position = self.max_help_position = \ + min(max_help_position, max(width - 20, indent_increment * 2)) + self.current_indent = 0 + self.level = 0 + self.help_width = None # computed later + self.short_first = short_first + self.default_tag = "%default" + self.option_strings = {} + self._short_opt_fmt = "%s %s" + self._long_opt_fmt = "%s=%s" + + def set_parser(self, parser): + self.parser = parser + + def set_short_opt_delimiter(self, delim): + if delim not in ("", " "): + raise ValueError( + "invalid metavar delimiter for short options: %r" % delim) + self._short_opt_fmt = "%s" + delim + "%s" + + def set_long_opt_delimiter(self, delim): + if delim not in ("=", " "): + raise ValueError( + "invalid metavar delimiter for long options: %r" % delim) + self._long_opt_fmt = "%s" + delim + "%s" + + def indent(self): + self.current_indent += self.indent_increment + self.level += 1 + + def dedent(self): + self.current_indent -= self.indent_increment + assert self.current_indent >= 0, "Indent decreased below 0." + self.level -= 1 + + def format_usage(self, usage): + raise NotImplementedError("subclasses must implement") + + def format_heading(self, heading): + raise NotImplementedError("subclasses must implement") + + def _format_text(self, text): + """ + Format a paragraph of free-form text for inclusion in the + help output at the current indentation level. + """ + text_width = max(self.width - self.current_indent, 11) + indent = " "*self.current_indent + return textwrap.fill(text, + text_width, + initial_indent=indent, + subsequent_indent=indent) + + def format_description(self, description): + if description: + return self._format_text(description) + "\n" + else: + return "" + + def format_epilog(self, epilog): + if epilog: + return "\n" + self._format_text(epilog) + "\n" + else: + return "" + + + def expand_default(self, option): + if self.parser is None or not self.default_tag: + return option.help + + default_value = self.parser.defaults.get(option.dest) + if default_value is NO_DEFAULT or default_value is None: + default_value = self.NO_DEFAULT_VALUE + + return option.help.replace(self.default_tag, str(default_value)) + + def format_option(self, option): + # The help for each option consists of two parts: + # * the opt strings and metavars + # eg. ("-x", or "-fFILENAME, --file=FILENAME") + # * the user-supplied help string + # eg. ("turn on expert mode", "read data from FILENAME") + # + # If possible, we write both of these on the same line: + # -x turn on expert mode + # + # But if the opt string list is too long, we put the help + # string on a second line, indented to the same column it would + # start in if it fit on the first line. + # -fFILENAME, --file=FILENAME + # read data from FILENAME + result = [] + opts = self.option_strings[option] + opt_width = self.help_position - self.current_indent - 2 + if len(opts) > opt_width: + opts = "%*s%s\n" % (self.current_indent, "", opts) + indent_first = self.help_position + else: # start help on same line as opts + opts = "%*s%-*s " % (self.current_indent, "", opt_width, opts) + indent_first = 0 + result.append(opts) + if option.help: + help_text = self.expand_default(option) + help_lines = textwrap.wrap(help_text, self.help_width) + result.append("%*s%s\n" % (indent_first, "", help_lines[0])) + result.extend(["%*s%s\n" % (self.help_position, "", line) + for line in help_lines[1:]]) + elif opts[-1] != "\n": + result.append("\n") + return "".join(result) + + def store_option_strings(self, parser): + self.indent() + max_len = 0 + for opt in parser.option_list: + strings = self.format_option_strings(opt) + self.option_strings[opt] = strings + max_len = max(max_len, len(strings) + self.current_indent) + self.indent() + for group in parser.option_groups: + for opt in group.option_list: + strings = self.format_option_strings(opt) + self.option_strings[opt] = strings + max_len = max(max_len, len(strings) + self.current_indent) + self.dedent() + self.dedent() + self.help_position = min(max_len + 2, self.max_help_position) + self.help_width = max(self.width - self.help_position, 11) + + def format_option_strings(self, option): + """Return a comma-separated list of option strings & metavariables.""" + if option.takes_value(): + metavar = option.metavar or option.dest.upper() + short_opts = [self._short_opt_fmt % (sopt, metavar) + for sopt in option._short_opts] + long_opts = [self._long_opt_fmt % (lopt, metavar) + for lopt in option._long_opts] + else: + short_opts = option._short_opts + long_opts = option._long_opts + + if self.short_first: + opts = short_opts + long_opts + else: + opts = long_opts + short_opts + + return ", ".join(opts) + +class IndentedHelpFormatter (HelpFormatter): + """Format help with indented section bodies. + """ + + def __init__(self, + indent_increment=2, + max_help_position=24, + width=None, + short_first=1): + HelpFormatter.__init__( + self, indent_increment, max_help_position, width, short_first) + + def format_usage(self, usage): + return _("Usage: %s\n") % usage + + def format_heading(self, heading): + return "%*s%s:\n" % (self.current_indent, "", heading) + + +class TitledHelpFormatter (HelpFormatter): + """Format help with underlined section headers. + """ + + def __init__(self, + indent_increment=0, + max_help_position=24, + width=None, + short_first=0): + HelpFormatter.__init__ ( + self, indent_increment, max_help_position, width, short_first) + + def format_usage(self, usage): + return "%s %s\n" % (self.format_heading(_("Usage")), usage) + + def format_heading(self, heading): + return "%s\n%s\n" % (heading, "=-"[self.level] * len(heading)) + + +def _parse_num(val, type): + if val[:2].lower() == "0x": # hexadecimal + radix = 16 + elif val[:2].lower() == "0b": # binary + radix = 2 + val = val[2:] or "0" # have to remove "0b" prefix + elif val[:1] == "0": # octal + radix = 8 + else: # decimal + radix = 10 + + return type(val, radix) + +def _parse_int(val): + return _parse_num(val, int) + +_builtin_cvt = { "int" : (_parse_int, _("integer")), + "long" : (_parse_int, _("integer")), + "float" : (float, _("floating-point")), + "complex" : (complex, _("complex")) } + +def check_builtin(option, opt, value): + (cvt, what) = _builtin_cvt[option.type] + try: + return cvt(value) + except ValueError: + raise OptionValueError( + _("option %s: invalid %s value: %r") % (opt, what, value)) + +def check_choice(option, opt, value): + if value in option.choices: + return value + else: + choices = ", ".join(map(repr, option.choices)) + raise OptionValueError( + _("option %s: invalid choice: %r (choose from %s)") + % (opt, value, choices)) + +# Not supplying a default is different from a default of None, +# so we need an explicit "not supplied" value. +NO_DEFAULT = ("NO", "DEFAULT") + + +class Option: + """ + Instance attributes: + _short_opts : [string] + _long_opts : [string] + + action : string + type : string + dest : string + default : any + nargs : int + const : any + choices : [string] + callback : function + callback_args : (any*) + callback_kwargs : { string : any } + help : string + metavar : string + """ + + # The list of instance attributes that may be set through + # keyword args to the constructor. + ATTRS = ['action', + 'type', + 'dest', + 'default', + 'nargs', + 'const', + 'choices', + 'callback', + 'callback_args', + 'callback_kwargs', + 'help', + 'metavar'] + + # The set of actions allowed by option parsers. Explicitly listed + # here so the constructor can validate its arguments. + ACTIONS = ("store", + "store_const", + "store_true", + "store_false", + "append", + "append_const", + "count", + "callback", + "help", + "version") + + # The set of actions that involve storing a value somewhere; + # also listed just for constructor argument validation. (If + # the action is one of these, there must be a destination.) + STORE_ACTIONS = ("store", + "store_const", + "store_true", + "store_false", + "append", + "append_const", + "count") + + # The set of actions for which it makes sense to supply a value + # type, ie. which may consume an argument from the command line. + TYPED_ACTIONS = ("store", + "append", + "callback") + + # The set of actions which *require* a value type, ie. that + # always consume an argument from the command line. + ALWAYS_TYPED_ACTIONS = ("store", + "append") + + # The set of actions which take a 'const' attribute. + CONST_ACTIONS = ("store_const", + "append_const") + + # The set of known types for option parsers. Again, listed here for + # constructor argument validation. + TYPES = ("string", "int", "long", "float", "complex", "choice") + + # Dictionary of argument checking functions, which convert and + # validate option arguments according to the option type. + # + # Signature of checking functions is: + # check(option : Option, opt : string, value : string) -> any + # where + # option is the Option instance calling the checker + # opt is the actual option seen on the command-line + # (eg. "-a", "--file") + # value is the option argument seen on the command-line + # + # The return value should be in the appropriate Python type + # for option.type -- eg. an integer if option.type == "int". + # + # If no checker is defined for a type, arguments will be + # unchecked and remain strings. + TYPE_CHECKER = { "int" : check_builtin, + "long" : check_builtin, + "float" : check_builtin, + "complex": check_builtin, + "choice" : check_choice, + } + + + # CHECK_METHODS is a list of unbound method objects; they are called + # by the constructor, in order, after all attributes are + # initialized. The list is created and filled in later, after all + # the methods are actually defined. (I just put it here because I + # like to define and document all class attributes in the same + # place.) Subclasses that add another _check_*() method should + # define their own CHECK_METHODS list that adds their check method + # to those from this class. + CHECK_METHODS = None + + + # -- Constructor/initialization methods ---------------------------- + + def __init__(self, *opts, **attrs): + # Set _short_opts, _long_opts attrs from 'opts' tuple. + # Have to be set now, in case no option strings are supplied. + self._short_opts = [] + self._long_opts = [] + opts = self._check_opt_strings(opts) + self._set_opt_strings(opts) + + # Set all other attrs (action, type, etc.) from 'attrs' dict + self._set_attrs(attrs) + + # Check all the attributes we just set. There are lots of + # complicated interdependencies, but luckily they can be farmed + # out to the _check_*() methods listed in CHECK_METHODS -- which + # could be handy for subclasses! The one thing these all share + # is that they raise OptionError if they discover a problem. + for checker in self.CHECK_METHODS: + checker(self) + + def _check_opt_strings(self, opts): + # Filter out None because early versions of Optik had exactly + # one short option and one long option, either of which + # could be None. + opts = [opt for opt in opts if opt] + if not opts: + raise TypeError("at least one option string must be supplied") + return opts + + def _set_opt_strings(self, opts): + for opt in opts: + if len(opt) < 2: + raise OptionError( + "invalid option string %r: " + "must be at least two characters long" % opt, self) + elif len(opt) == 2: + if not (opt[0] == "-" and opt[1] != "-"): + raise OptionError( + "invalid short option string %r: " + "must be of the form -x, (x any non-dash char)" % opt, + self) + self._short_opts.append(opt) + else: + if not (opt[0:2] == "--" and opt[2] != "-"): + raise OptionError( + "invalid long option string %r: " + "must start with --, followed by non-dash" % opt, + self) + self._long_opts.append(opt) + + def _set_attrs(self, attrs): + for attr in self.ATTRS: + if attr in attrs: + setattr(self, attr, attrs[attr]) + del attrs[attr] + else: + if attr == 'default': + setattr(self, attr, NO_DEFAULT) + else: + setattr(self, attr, None) + if attrs: + attrs = sorted(attrs.keys()) + raise OptionError( + "invalid keyword arguments: %s" % ", ".join(attrs), + self) + + + # -- Constructor validation methods -------------------------------- + + def _check_action(self): + if self.action is None: + self.action = "store" + elif self.action not in self.ACTIONS: + raise OptionError("invalid action: %r" % self.action, self) + + def _check_type(self): + if self.type is None: + if self.action in self.ALWAYS_TYPED_ACTIONS: + if self.choices is not None: + # The "choices" attribute implies "choice" type. + self.type = "choice" + else: + # No type given? "string" is the most sensible default. + self.type = "string" + else: + # Allow type objects or builtin type conversion functions + # (int, str, etc.) as an alternative to their names. + if isinstance(self.type, type): + self.type = self.type.__name__ + + if self.type == "str": + self.type = "string" + + if self.type not in self.TYPES: + raise OptionError("invalid option type: %r" % self.type, self) + if self.action not in self.TYPED_ACTIONS: + raise OptionError( + "must not supply a type for action %r" % self.action, self) + + def _check_choice(self): + if self.type == "choice": + if self.choices is None: + raise OptionError( + "must supply a list of choices for type 'choice'", self) + elif not isinstance(self.choices, (tuple, list)): + raise OptionError( + "choices must be a list of strings ('%s' supplied)" + % str(type(self.choices)).split("'")[1], self) + elif self.choices is not None: + raise OptionError( + "must not supply choices for type %r" % self.type, self) + + def _check_dest(self): + # No destination given, and we need one for this action. The + # self.type check is for callbacks that take a value. + takes_value = (self.action in self.STORE_ACTIONS or + self.type is not None) + if self.dest is None and takes_value: + + # Glean a destination from the first long option string, + # or from the first short option string if no long options. + if self._long_opts: + # eg. "--foo-bar" -> "foo_bar" + self.dest = self._long_opts[0][2:].replace('-', '_') + else: + self.dest = self._short_opts[0][1] + + def _check_const(self): + if self.action not in self.CONST_ACTIONS and self.const is not None: + raise OptionError( + "'const' must not be supplied for action %r" % self.action, + self) + + def _check_nargs(self): + if self.action in self.TYPED_ACTIONS: + if self.nargs is None: + self.nargs = 1 + elif self.nargs is not None: + raise OptionError( + "'nargs' must not be supplied for action %r" % self.action, + self) + + def _check_callback(self): + if self.action == "callback": + if not callable(self.callback): + raise OptionError( + "callback not callable: %r" % self.callback, self) + if (self.callback_args is not None and + not isinstance(self.callback_args, tuple)): + raise OptionError( + "callback_args, if supplied, must be a tuple: not %r" + % self.callback_args, self) + if (self.callback_kwargs is not None and + not isinstance(self.callback_kwargs, dict)): + raise OptionError( + "callback_kwargs, if supplied, must be a dict: not %r" + % self.callback_kwargs, self) + else: + if self.callback is not None: + raise OptionError( + "callback supplied (%r) for non-callback option" + % self.callback, self) + if self.callback_args is not None: + raise OptionError( + "callback_args supplied for non-callback option", self) + if self.callback_kwargs is not None: + raise OptionError( + "callback_kwargs supplied for non-callback option", self) + + + CHECK_METHODS = [_check_action, + _check_type, + _check_choice, + _check_dest, + _check_const, + _check_nargs, + _check_callback] + + + # -- Miscellaneous methods ----------------------------------------- + + def __str__(self): + return "/".join(self._short_opts + self._long_opts) + + __repr__ = _repr + + def takes_value(self): + return self.type is not None + + def get_opt_string(self): + if self._long_opts: + return self._long_opts[0] + else: + return self._short_opts[0] + + + # -- Processing methods -------------------------------------------- + + def check_value(self, opt, value): + checker = self.TYPE_CHECKER.get(self.type) + if checker is None: + return value + else: + return checker(self, opt, value) + + def convert_value(self, opt, value): + if value is not None: + if self.nargs == 1: + return self.check_value(opt, value) + else: + return tuple([self.check_value(opt, v) for v in value]) + + def process(self, opt, value, values, parser): + + # First, convert the value(s) to the right type. Howl if any + # value(s) are bogus. + value = self.convert_value(opt, value) + + # And then take whatever action is expected of us. + # This is a separate method to make life easier for + # subclasses to add new actions. + return self.take_action( + self.action, self.dest, opt, value, values, parser) + + def take_action(self, action, dest, opt, value, values, parser): + if action == "store": + setattr(values, dest, value) + elif action == "store_const": + setattr(values, dest, self.const) + elif action == "store_true": + setattr(values, dest, True) + elif action == "store_false": + setattr(values, dest, False) + elif action == "append": + values.ensure_value(dest, []).append(value) + elif action == "append_const": + values.ensure_value(dest, []).append(self.const) + elif action == "count": + setattr(values, dest, values.ensure_value(dest, 0) + 1) + elif action == "callback": + args = self.callback_args or () + kwargs = self.callback_kwargs or {} + self.callback(self, opt, value, parser, *args, **kwargs) + elif action == "help": + parser.print_help() + parser.exit() + elif action == "version": + parser.print_version() + parser.exit() + else: + raise ValueError("unknown action %r" % self.action) + + return 1 + +# class Option + + +SUPPRESS_HELP = "SUPPRESS"+"HELP" +SUPPRESS_USAGE = "SUPPRESS"+"USAGE" + +class Values: + + def __init__(self, defaults=None): + if defaults: + for (attr, val) in defaults.items(): + setattr(self, attr, val) + + def __str__(self): + return str(self.__dict__) + + __repr__ = _repr + + def __eq__(self, other): + if isinstance(other, Values): + return self.__dict__ == other.__dict__ + elif isinstance(other, dict): + return self.__dict__ == other + else: + return NotImplemented + + def _update_careful(self, dict): + """ + Update the option values from an arbitrary dictionary, but only + use keys from dict that already have a corresponding attribute + in self. Any keys in dict without a corresponding attribute + are silently ignored. + """ + for attr in dir(self): + if attr in dict: + dval = dict[attr] + if dval is not None: + setattr(self, attr, dval) + + def _update_loose(self, dict): + """ + Update the option values from an arbitrary dictionary, + using all keys from the dictionary regardless of whether + they have a corresponding attribute in self or not. + """ + self.__dict__.update(dict) + + def _update(self, dict, mode): + if mode == "careful": + self._update_careful(dict) + elif mode == "loose": + self._update_loose(dict) + else: + raise ValueError("invalid update mode: %r" % mode) + + def read_module(self, modname, mode="careful"): + __import__(modname) + mod = sys.modules[modname] + self._update(vars(mod), mode) + + def read_file(self, filename, mode="careful"): + vars = {} + exec(open(filename).read(), vars) + self._update(vars, mode) + + def ensure_value(self, attr, value): + if not hasattr(self, attr) or getattr(self, attr) is None: + setattr(self, attr, value) + return getattr(self, attr) + + +class OptionContainer: + + """ + Abstract base class. + + Class attributes: + standard_option_list : [Option] + list of standard options that will be accepted by all instances + of this parser class (intended to be overridden by subclasses). + + Instance attributes: + option_list : [Option] + the list of Option objects contained by this OptionContainer + _short_opt : { string : Option } + dictionary mapping short option strings, eg. "-f" or "-X", + to the Option instances that implement them. If an Option + has multiple short option strings, it will appear in this + dictionary multiple times. [1] + _long_opt : { string : Option } + dictionary mapping long option strings, eg. "--file" or + "--exclude", to the Option instances that implement them. + Again, a given Option can occur multiple times in this + dictionary. [1] + defaults : { string : any } + dictionary mapping option destination names to default + values for each destination [1] + + [1] These mappings are common to (shared by) all components of the + controlling OptionParser, where they are initially created. + + """ + + def __init__(self, option_class, conflict_handler, description): + # Initialize the option list and related data structures. + # This method must be provided by subclasses, and it must + # initialize at least the following instance attributes: + # option_list, _short_opt, _long_opt, defaults. + self._create_option_list() + + self.option_class = option_class + self.set_conflict_handler(conflict_handler) + self.set_description(description) + + def _create_option_mappings(self): + # For use by OptionParser constructor -- create the main + # option mappings used by this OptionParser and all + # OptionGroups that it owns. + self._short_opt = {} # single letter -> Option instance + self._long_opt = {} # long option -> Option instance + self.defaults = {} # maps option dest -> default value + + + def _share_option_mappings(self, parser): + # For use by OptionGroup constructor -- use shared option + # mappings from the OptionParser that owns this OptionGroup. + self._short_opt = parser._short_opt + self._long_opt = parser._long_opt + self.defaults = parser.defaults + + def set_conflict_handler(self, handler): + if handler not in ("error", "resolve"): + raise ValueError("invalid conflict_resolution value %r" % handler) + self.conflict_handler = handler + + def set_description(self, description): + self.description = description + + def get_description(self): + return self.description + + + def destroy(self): + """see OptionParser.destroy().""" + del self._short_opt + del self._long_opt + del self.defaults + + + # -- Option-adding methods ----------------------------------------- + + def _check_conflict(self, option): + conflict_opts = [] + for opt in option._short_opts: + if opt in self._short_opt: + conflict_opts.append((opt, self._short_opt[opt])) + for opt in option._long_opts: + if opt in self._long_opt: + conflict_opts.append((opt, self._long_opt[opt])) + + if conflict_opts: + handler = self.conflict_handler + if handler == "error": + raise OptionConflictError( + "conflicting option string(s): %s" + % ", ".join([co[0] for co in conflict_opts]), + option) + elif handler == "resolve": + for (opt, c_option) in conflict_opts: + if opt.startswith("--"): + c_option._long_opts.remove(opt) + del self._long_opt[opt] + else: + c_option._short_opts.remove(opt) + del self._short_opt[opt] + if not (c_option._short_opts or c_option._long_opts): + c_option.container.option_list.remove(c_option) + + def add_option(self, *args, **kwargs): + """add_option(Option) + add_option(opt_str, ..., kwarg=val, ...) + """ + if isinstance(args[0], str): + option = self.option_class(*args, **kwargs) + elif len(args) == 1 and not kwargs: + option = args[0] + if not isinstance(option, Option): + raise TypeError("not an Option instance: %r" % option) + else: + raise TypeError("invalid arguments") + + self._check_conflict(option) + + self.option_list.append(option) + option.container = self + for opt in option._short_opts: + self._short_opt[opt] = option + for opt in option._long_opts: + self._long_opt[opt] = option + + if option.dest is not None: # option has a dest, we need a default + if option.default is not NO_DEFAULT: + self.defaults[option.dest] = option.default + elif option.dest not in self.defaults: + self.defaults[option.dest] = None + + return option + + def add_options(self, option_list): + for option in option_list: + self.add_option(option) + + # -- Option query/removal methods ---------------------------------- + + def get_option(self, opt_str): + return (self._short_opt.get(opt_str) or + self._long_opt.get(opt_str)) + + def has_option(self, opt_str): + return (opt_str in self._short_opt or + opt_str in self._long_opt) + + def remove_option(self, opt_str): + option = self._short_opt.get(opt_str) + if option is None: + option = self._long_opt.get(opt_str) + if option is None: + raise ValueError("no such option %r" % opt_str) + + for opt in option._short_opts: + del self._short_opt[opt] + for opt in option._long_opts: + del self._long_opt[opt] + option.container.option_list.remove(option) + + + # -- Help-formatting methods --------------------------------------- + + def format_option_help(self, formatter): + if not self.option_list: + return "" + result = [] + for option in self.option_list: + if not option.help is SUPPRESS_HELP: + result.append(formatter.format_option(option)) + return "".join(result) + + def format_description(self, formatter): + return formatter.format_description(self.get_description()) + + def format_help(self, formatter): + result = [] + if self.description: + result.append(self.format_description(formatter)) + if self.option_list: + result.append(self.format_option_help(formatter)) + return "\n".join(result) + + +class OptionGroup (OptionContainer): + + def __init__(self, parser, title, description=None): + self.parser = parser + OptionContainer.__init__( + self, parser.option_class, parser.conflict_handler, description) + self.title = title + + def _create_option_list(self): + self.option_list = [] + self._share_option_mappings(self.parser) + + def set_title(self, title): + self.title = title + + def destroy(self): + """see OptionParser.destroy().""" + OptionContainer.destroy(self) + del self.option_list + + # -- Help-formatting methods --------------------------------------- + + def format_help(self, formatter): + result = formatter.format_heading(self.title) + formatter.indent() + result += OptionContainer.format_help(self, formatter) + formatter.dedent() + return result + + +class OptionParser (OptionContainer): + + """ + Class attributes: + standard_option_list : [Option] + list of standard options that will be accepted by all instances + of this parser class (intended to be overridden by subclasses). + + Instance attributes: + usage : string + a usage string for your program. Before it is displayed + to the user, "%prog" will be expanded to the name of + your program (self.prog or os.path.basename(sys.argv[0])). + prog : string + the name of the current program (to override + os.path.basename(sys.argv[0])). + description : string + A paragraph of text giving a brief overview of your program. + optparse reformats this paragraph to fit the current terminal + width and prints it when the user requests help (after usage, + but before the list of options). + epilog : string + paragraph of help text to print after option help + + option_groups : [OptionGroup] + list of option groups in this parser (option groups are + irrelevant for parsing the command-line, but very useful + for generating help) + + allow_interspersed_args : bool = true + if true, positional arguments may be interspersed with options. + Assuming -a and -b each take a single argument, the command-line + -ablah foo bar -bboo baz + will be interpreted the same as + -ablah -bboo -- foo bar baz + If this flag were false, that command line would be interpreted as + -ablah -- foo bar -bboo baz + -- ie. we stop processing options as soon as we see the first + non-option argument. (This is the tradition followed by + Python's getopt module, Perl's Getopt::Std, and other argument- + parsing libraries, but it is generally annoying to users.) + + process_default_values : bool = true + if true, option default values are processed similarly to option + values from the command line: that is, they are passed to the + type-checking function for the option's type (as long as the + default value is a string). (This really only matters if you + have defined custom types; see SF bug #955889.) Set it to false + to restore the behaviour of Optik 1.4.1 and earlier. + + rargs : [string] + the argument list currently being parsed. Only set when + parse_args() is active, and continually trimmed down as + we consume arguments. Mainly there for the benefit of + callback options. + largs : [string] + the list of leftover arguments that we have skipped while + parsing options. If allow_interspersed_args is false, this + list is always empty. + values : Values + the set of option values currently being accumulated. Only + set when parse_args() is active. Also mainly for callbacks. + + Because of the 'rargs', 'largs', and 'values' attributes, + OptionParser is not thread-safe. If, for some perverse reason, you + need to parse command-line arguments simultaneously in different + threads, use different OptionParser instances. + + """ + + standard_option_list = [] + + def __init__(self, + usage=None, + option_list=None, + option_class=Option, + version=None, + conflict_handler="error", + description=None, + formatter=None, + add_help_option=True, + prog=None, + epilog=None): + OptionContainer.__init__( + self, option_class, conflict_handler, description) + self.set_usage(usage) + self.prog = prog + self.version = version + self.allow_interspersed_args = True + self.process_default_values = True + if formatter is None: + formatter = IndentedHelpFormatter() + self.formatter = formatter + self.formatter.set_parser(self) + self.epilog = epilog + + # Populate the option list; initial sources are the + # standard_option_list class attribute, the 'option_list' + # argument, and (if applicable) the _add_version_option() and + # _add_help_option() methods. + self._populate_option_list(option_list, + add_help=add_help_option) + + self._init_parsing_state() + + + def destroy(self): + """ + Declare that you are done with this OptionParser. This cleans up + reference cycles so the OptionParser (and all objects referenced by + it) can be garbage-collected promptly. After calling destroy(), the + OptionParser is unusable. + """ + OptionContainer.destroy(self) + for group in self.option_groups: + group.destroy() + del self.option_list + del self.option_groups + del self.formatter + + + # -- Private methods ----------------------------------------------- + # (used by our or OptionContainer's constructor) + + def _create_option_list(self): + self.option_list = [] + self.option_groups = [] + self._create_option_mappings() + + def _add_help_option(self): + self.add_option("-h", "--help", + action="help", + help=_("show this help message and exit")) + + def _add_version_option(self): + self.add_option("--version", + action="version", + help=_("show program's version number and exit")) + + def _populate_option_list(self, option_list, add_help=True): + if self.standard_option_list: + self.add_options(self.standard_option_list) + if option_list: + self.add_options(option_list) + if self.version: + self._add_version_option() + if add_help: + self._add_help_option() + + def _init_parsing_state(self): + # These are set in parse_args() for the convenience of callbacks. + self.rargs = None + self.largs = None + self.values = None + + + # -- Simple modifier methods --------------------------------------- + + def set_usage(self, usage): + if usage is None: + self.usage = _("%prog [options]") + elif usage is SUPPRESS_USAGE: + self.usage = None + # For backwards compatibility with Optik 1.3 and earlier. + elif usage.lower().startswith("usage: "): + self.usage = usage[7:] + else: + self.usage = usage + + def enable_interspersed_args(self): + """Set parsing to not stop on the first non-option, allowing + interspersing switches with command arguments. This is the + default behavior. See also disable_interspersed_args() and the + class documentation description of the attribute + allow_interspersed_args.""" + self.allow_interspersed_args = True + + def disable_interspersed_args(self): + """Set parsing to stop on the first non-option. Use this if + you have a command processor which runs another command that + has options of its own and you want to make sure these options + don't get confused. + """ + self.allow_interspersed_args = False + + def set_process_default_values(self, process): + self.process_default_values = process + + def set_default(self, dest, value): + self.defaults[dest] = value + + def set_defaults(self, **kwargs): + self.defaults.update(kwargs) + + def _get_all_options(self): + options = self.option_list[:] + for group in self.option_groups: + options.extend(group.option_list) + return options + + def get_default_values(self): + if not self.process_default_values: + # Old, pre-Optik 1.5 behaviour. + return Values(self.defaults) + + defaults = self.defaults.copy() + for option in self._get_all_options(): + default = defaults.get(option.dest) + if isinstance(default, str): + opt_str = option.get_opt_string() + defaults[option.dest] = option.check_value(opt_str, default) + + return Values(defaults) + + + # -- OptionGroup methods ------------------------------------------- + + def add_option_group(self, *args, **kwargs): + # XXX lots of overlap with OptionContainer.add_option() + if isinstance(args[0], str): + group = OptionGroup(self, *args, **kwargs) + elif len(args) == 1 and not kwargs: + group = args[0] + if not isinstance(group, OptionGroup): + raise TypeError("not an OptionGroup instance: %r" % group) + if group.parser is not self: + raise ValueError("invalid OptionGroup (wrong parser)") + else: + raise TypeError("invalid arguments") + + self.option_groups.append(group) + return group + + def get_option_group(self, opt_str): + option = (self._short_opt.get(opt_str) or + self._long_opt.get(opt_str)) + if option and option.container is not self: + return option.container + return None + + + # -- Option-parsing methods ---------------------------------------- + + def _get_args(self, args): + if args is None: + return sys.argv[1:] + else: + return args[:] # don't modify caller's list + + def parse_args(self, args=None, values=None): + """ + parse_args(args : [string] = sys.argv[1:], + values : Values = None) + -> (values : Values, args : [string]) + + Parse the command-line options found in 'args' (default: + sys.argv[1:]). Any errors result in a call to 'error()', which + by default prints the usage message to stderr and calls + sys.exit() with an error message. On success returns a pair + (values, args) where 'values' is a Values instance (with all + your option values) and 'args' is the list of arguments left + over after parsing options. + """ + rargs = self._get_args(args) + if values is None: + values = self.get_default_values() + + # Store the halves of the argument list as attributes for the + # convenience of callbacks: + # rargs + # the rest of the command-line (the "r" stands for + # "remaining" or "right-hand") + # largs + # the leftover arguments -- ie. what's left after removing + # options and their arguments (the "l" stands for "leftover" + # or "left-hand") + self.rargs = rargs + self.largs = largs = [] + self.values = values + + try: + stop = self._process_args(largs, rargs, values) + except (BadOptionError, OptionValueError) as err: + self.error(str(err)) + + args = largs + rargs + return self.check_values(values, args) + + def check_values(self, values, args): + """ + check_values(values : Values, args : [string]) + -> (values : Values, args : [string]) + + Check that the supplied option values and leftover arguments are + valid. Returns the option values and leftover arguments + (possibly adjusted, possibly completely new -- whatever you + like). Default implementation just returns the passed-in + values; subclasses may override as desired. + """ + return (values, args) + + def _process_args(self, largs, rargs, values): + """_process_args(largs : [string], + rargs : [string], + values : Values) + + Process command-line arguments and populate 'values', consuming + options and arguments from 'rargs'. If 'allow_interspersed_args' is + false, stop at the first non-option argument. If true, accumulate any + interspersed non-option arguments in 'largs'. + """ + while rargs: + arg = rargs[0] + # We handle bare "--" explicitly, and bare "-" is handled by the + # standard arg handler since the short arg case ensures that the + # len of the opt string is greater than 1. + if arg == "--": + del rargs[0] + return + elif arg[0:2] == "--": + # process a single long option (possibly with value(s)) + self._process_long_opt(rargs, values) + elif arg[:1] == "-" and len(arg) > 1: + # process a cluster of short options (possibly with + # value(s) for the last one only) + self._process_short_opts(rargs, values) + elif self.allow_interspersed_args: + largs.append(arg) + del rargs[0] + else: + return # stop now, leave this arg in rargs + + # Say this is the original argument list: + # [arg0, arg1, ..., arg(i-1), arg(i), arg(i+1), ..., arg(N-1)] + # ^ + # (we are about to process arg(i)). + # + # Then rargs is [arg(i), ..., arg(N-1)] and largs is a *subset* of + # [arg0, ..., arg(i-1)] (any options and their arguments will have + # been removed from largs). + # + # The while loop will usually consume 1 or more arguments per pass. + # If it consumes 1 (eg. arg is an option that takes no arguments), + # then after _process_arg() is done the situation is: + # + # largs = subset of [arg0, ..., arg(i)] + # rargs = [arg(i+1), ..., arg(N-1)] + # + # If allow_interspersed_args is false, largs will always be + # *empty* -- still a subset of [arg0, ..., arg(i-1)], but + # not a very interesting subset! + + def _match_long_opt(self, opt): + """_match_long_opt(opt : string) -> string + + Determine which long option string 'opt' matches, ie. which one + it is an unambiguous abbreviation for. Raises BadOptionError if + 'opt' doesn't unambiguously match any long option string. + """ + return _match_abbrev(opt, self._long_opt) + + def _process_long_opt(self, rargs, values): + arg = rargs.pop(0) + + # Value explicitly attached to arg? Pretend it's the next + # argument. + if "=" in arg: + (opt, next_arg) = arg.split("=", 1) + rargs.insert(0, next_arg) + had_explicit_value = True + else: + opt = arg + had_explicit_value = False + + opt = self._match_long_opt(opt) + option = self._long_opt[opt] + if option.takes_value(): + nargs = option.nargs + if len(rargs) < nargs: + self.error(ngettext( + "%(option)s option requires %(number)d argument", + "%(option)s option requires %(number)d arguments", + nargs) % {"option": opt, "number": nargs}) + elif nargs == 1: + value = rargs.pop(0) + else: + value = tuple(rargs[0:nargs]) + del rargs[0:nargs] + + elif had_explicit_value: + self.error(_("%s option does not take a value") % opt) + + else: + value = None + + option.process(opt, value, values, self) + + def _process_short_opts(self, rargs, values): + arg = rargs.pop(0) + stop = False + i = 1 + for ch in arg[1:]: + opt = "-" + ch + option = self._short_opt.get(opt) + i += 1 # we have consumed a character + + if not option: + raise BadOptionError(opt) + if option.takes_value(): + # Any characters left in arg? Pretend they're the + # next arg, and stop consuming characters of arg. + if i < len(arg): + rargs.insert(0, arg[i:]) + stop = True + + nargs = option.nargs + if len(rargs) < nargs: + self.error(ngettext( + "%(option)s option requires %(number)d argument", + "%(option)s option requires %(number)d arguments", + nargs) % {"option": opt, "number": nargs}) + elif nargs == 1: + value = rargs.pop(0) + else: + value = tuple(rargs[0:nargs]) + del rargs[0:nargs] + + else: # option doesn't take a value + value = None + + option.process(opt, value, values, self) + + if stop: + break + + + # -- Feedback methods ---------------------------------------------- + + def get_prog_name(self): + if self.prog is None: + return os.path.basename(sys.argv[0]) + else: + return self.prog + + def expand_prog_name(self, s): + return s.replace("%prog", self.get_prog_name()) + + def get_description(self): + return self.expand_prog_name(self.description) + + def exit(self, status=0, msg=None): + if msg: + sys.stderr.write(msg) + sys.exit(status) + + def error(self, msg): + """error(msg : string) + + Print a usage message incorporating 'msg' to stderr and exit. + If you override this in a subclass, it should not return -- it + should either exit or raise an exception. + """ + self.print_usage(sys.stderr) + self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) + + def get_usage(self): + if self.usage: + return self.formatter.format_usage( + self.expand_prog_name(self.usage)) + else: + return "" + + def print_usage(self, file=None): + """print_usage(file : file = stdout) + + Print the usage message for the current program (self.usage) to + 'file' (default stdout). Any occurrence of the string "%prog" in + self.usage is replaced with the name of the current program + (basename of sys.argv[0]). Does nothing if self.usage is empty + or not defined. + """ + if self.usage: + print(self.get_usage(), file=file) + + def get_version(self): + if self.version: + return self.expand_prog_name(self.version) + else: + return "" + + def print_version(self, file=None): + """print_version(file : file = stdout) + + Print the version message for this program (self.version) to + 'file' (default stdout). As with print_usage(), any occurrence + of "%prog" in self.version is replaced by the current program's + name. Does nothing if self.version is empty or undefined. + """ + if self.version: + print(self.get_version(), file=file) + + def format_option_help(self, formatter=None): + if formatter is None: + formatter = self.formatter + formatter.store_option_strings(self) + result = [] + result.append(formatter.format_heading(_("Options"))) + formatter.indent() + if self.option_list: + result.append(OptionContainer.format_option_help(self, formatter)) + result.append("\n") + for group in self.option_groups: + result.append(group.format_help(formatter)) + result.append("\n") + formatter.dedent() + # Drop the last "\n", or the header if no options or option groups: + return "".join(result[:-1]) + + def format_epilog(self, formatter): + return formatter.format_epilog(self.epilog) + + def format_help(self, formatter=None): + if formatter is None: + formatter = self.formatter + result = [] + if self.usage: + result.append(self.get_usage() + "\n") + if self.description: + result.append(self.format_description(formatter) + "\n") + result.append(self.format_option_help(formatter)) + result.append(self.format_epilog(formatter)) + return "".join(result) + + def print_help(self, file=None): + """print_help(file : file = stdout) + + Print an extended help message, listing all options and any + help text provided with them, to 'file' (default stdout). + """ + if file is None: + file = sys.stdout + file.write(self.format_help()) + +# class OptionParser + + +def _match_abbrev(s, wordmap): + """_match_abbrev(s : string, wordmap : {string : Option}) -> string + + Return the string key in 'wordmap' for which 's' is an unambiguous + abbreviation. If 's' is found to be ambiguous or doesn't match any of + 'words', raise BadOptionError. + """ + # Is there an exact match? + if s in wordmap: + return s + else: + # Isolate all words with s as a prefix. + possibilities = [word for word in wordmap.keys() + if word.startswith(s)] + # No exact match, so there had better be just one possibility. + if len(possibilities) == 1: + return possibilities[0] + elif not possibilities: + raise BadOptionError(s) + else: + # More than one possible completion: ambiguous prefix. + possibilities.sort() + raise AmbiguousOptionError(s, possibilities) + + +# Some day, there might be many Option classes. As of Optik 1.3, the +# preferred way to instantiate Options is indirectly, via make_option(), +# which will become a factory function when there are many Option +# classes. +make_option = Option diff --git a/shared/package-files/07/07d27b806393e92fbd5176fe96d660e45392be87ec2660f956b10038acfc9877/blob b/shared/package-files/07/07d27b806393e92fbd5176fe96d660e45392be87ec2660f956b10038acfc9877/blob new file mode 100644 index 0000000000000000000000000000000000000000..aafb442eafb6f5e1b1e506c06627e9e9a03a5eed --- /dev/null +++ b/shared/package-files/07/07d27b806393e92fbd5176fe96d660e45392be87ec2660f956b10038acfc9877/blob @@ -0,0 +1,37 @@ +#pragma once + +#include + +namespace torch { +namespace jit { + +TORCH_API bool canFuseOnCPULegacy(); +TORCH_API void overrideCanFuseOnCPULegacy(bool value); + +// NB: Be sure to run DCE before fusion, because dead instructions +// can prevent fusion opportunities from being exploited. +// On Windows will noop, NYI +TORCH_API void FuseGraph( + std::shared_ptr& graph, + bool strict_fuser_check = false); + +// \brief Custom fusion pass using a node-level callback to +// determine the inclusion of nodes in a subgraph. +// +// This helper omits aliased inputs and fusion across control flow +// boundaries. +// +// \arg graph The graph to be modified in-place +// \arg is_fusable A callback run on each fusable node in the graph. +// \arg kind The label given to the resultant fused subgraph +// \arg arg_limit The maximum number of args the resultant fused subgraph +// should have. Note: This will likely develop into a general +// post condition on the fused subgraph. +TORCH_API void CustomFuseGraph( + std::shared_ptr& graph, + const std::function& is_fusable, + Symbol kind, + size_t arg_limit = std::numeric_limits::max()); + +} // namespace jit +} // namespace torch diff --git a/shared/package-files/07/07d2ce6f8aa64bde56f54adfd150396e351a05995bd1eb1a630374a81040ecab/blob b/shared/package-files/07/07d2ce6f8aa64bde56f54adfd150396e351a05995bd1eb1a630374a81040ecab/blob new file mode 100644 index 0000000000000000000000000000000000000000..68999ca91b5a31a02c9e547038f32256ff571024 --- /dev/null +++ b/shared/package-files/07/07d2ce6f8aa64bde56f54adfd150396e351a05995bd1eb1a630374a81040ecab/blob @@ -0,0 +1,113 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_empty_per_channel_affine_quantized(SymInt[] size, *, Tensor scales, Tensor zero_points, int axis, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=contiguous_format) -> Tensor +inline at::Tensor _empty_per_channel_affine_quantized(at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, at::TensorOptions options={}, c10::optional memory_format=MemoryFormat::Contiguous) { + return at::_ops::_empty_per_channel_affine_quantized::call(c10::fromIntArrayRefSlow(size), scales, zero_points, axis, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format)); +} +namespace symint { + template ::value>> + at::Tensor _empty_per_channel_affine_quantized(at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, at::TensorOptions options={}, c10::optional memory_format=MemoryFormat::Contiguous) { + return at::_ops::_empty_per_channel_affine_quantized::call(c10::fromIntArrayRefSlow(size), scales, zero_points, axis, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format)); + } +} + +// aten::_empty_per_channel_affine_quantized(SymInt[] size, *, Tensor scales, Tensor zero_points, int axis, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=contiguous_format) -> Tensor +inline at::Tensor _empty_per_channel_affine_quantized(at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory, c10::optional memory_format) { + return at::_ops::_empty_per_channel_affine_quantized::call(c10::fromIntArrayRefSlow(size), scales, zero_points, axis, dtype, layout, device, pin_memory, memory_format); +} +namespace symint { + template ::value>> + at::Tensor _empty_per_channel_affine_quantized(at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory, c10::optional memory_format) { + return at::_ops::_empty_per_channel_affine_quantized::call(c10::fromIntArrayRefSlow(size), scales, zero_points, axis, dtype, layout, device, pin_memory, memory_format); + } +} + +// aten::_empty_per_channel_affine_quantized(SymInt[] size, *, Tensor scales, Tensor zero_points, int axis, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=contiguous_format) -> Tensor +inline at::Tensor _empty_per_channel_affine_quantized_symint(c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, at::TensorOptions options={}, c10::optional memory_format=MemoryFormat::Contiguous) { + return at::_ops::_empty_per_channel_affine_quantized::call(size, scales, zero_points, axis, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format)); +} +namespace symint { + template ::value>> + at::Tensor _empty_per_channel_affine_quantized(c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, at::TensorOptions options={}, c10::optional memory_format=MemoryFormat::Contiguous) { + return at::_ops::_empty_per_channel_affine_quantized::call(size, scales, zero_points, axis, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format)); + } +} + +// aten::_empty_per_channel_affine_quantized(SymInt[] size, *, Tensor scales, Tensor zero_points, int axis, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=contiguous_format) -> Tensor +inline at::Tensor _empty_per_channel_affine_quantized_symint(c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory, c10::optional memory_format) { + return at::_ops::_empty_per_channel_affine_quantized::call(size, scales, zero_points, axis, dtype, layout, device, pin_memory, memory_format); +} +namespace symint { + template ::value>> + at::Tensor _empty_per_channel_affine_quantized(c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory, c10::optional memory_format) { + return at::_ops::_empty_per_channel_affine_quantized::call(size, scales, zero_points, axis, dtype, layout, device, pin_memory, memory_format); + } +} + +// aten::_empty_per_channel_affine_quantized.out(SymInt[] size, *, Tensor scales, Tensor zero_points, int axis, MemoryFormat? memory_format=contiguous_format, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _empty_per_channel_affine_quantized_out(at::Tensor & out, at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional memory_format=MemoryFormat::Contiguous) { + return at::_ops::_empty_per_channel_affine_quantized_out::call(c10::fromIntArrayRefSlow(size), scales, zero_points, axis, memory_format, out); +} +namespace symint { + template ::value>> + at::Tensor & _empty_per_channel_affine_quantized_out(at::Tensor & out, at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional memory_format=MemoryFormat::Contiguous) { + return at::_ops::_empty_per_channel_affine_quantized_out::call(c10::fromIntArrayRefSlow(size), scales, zero_points, axis, memory_format, out); + } +} + +// aten::_empty_per_channel_affine_quantized.out(SymInt[] size, *, Tensor scales, Tensor zero_points, int axis, MemoryFormat? memory_format=contiguous_format, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _empty_per_channel_affine_quantized_outf(at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional memory_format, at::Tensor & out) { + return at::_ops::_empty_per_channel_affine_quantized_out::call(c10::fromIntArrayRefSlow(size), scales, zero_points, axis, memory_format, out); +} +namespace symint { + template ::value>> + at::Tensor & _empty_per_channel_affine_quantized_outf(at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional memory_format, at::Tensor & out) { + return at::_ops::_empty_per_channel_affine_quantized_out::call(c10::fromIntArrayRefSlow(size), scales, zero_points, axis, memory_format, out); + } +} + +// aten::_empty_per_channel_affine_quantized.out(SymInt[] size, *, Tensor scales, Tensor zero_points, int axis, MemoryFormat? memory_format=contiguous_format, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _empty_per_channel_affine_quantized_symint_out(at::Tensor & out, c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional memory_format=MemoryFormat::Contiguous) { + return at::_ops::_empty_per_channel_affine_quantized_out::call(size, scales, zero_points, axis, memory_format, out); +} +namespace symint { + template ::value>> + at::Tensor & _empty_per_channel_affine_quantized_out(at::Tensor & out, c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional memory_format=MemoryFormat::Contiguous) { + return at::_ops::_empty_per_channel_affine_quantized_out::call(size, scales, zero_points, axis, memory_format, out); + } +} + +// aten::_empty_per_channel_affine_quantized.out(SymInt[] size, *, Tensor scales, Tensor zero_points, int axis, MemoryFormat? memory_format=contiguous_format, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _empty_per_channel_affine_quantized_symint_outf(c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional memory_format, at::Tensor & out) { + return at::_ops::_empty_per_channel_affine_quantized_out::call(size, scales, zero_points, axis, memory_format, out); +} +namespace symint { + template ::value>> + at::Tensor & _empty_per_channel_affine_quantized_outf(c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional memory_format, at::Tensor & out) { + return at::_ops::_empty_per_channel_affine_quantized_out::call(size, scales, zero_points, axis, memory_format, out); + } +} + +} diff --git a/shared/package-files/07/07d395536cdc4d37842311f1a3d398d89ea9929a27c365add7bd8fc8b45915b8/blob b/shared/package-files/07/07d395536cdc4d37842311f1a3d398d89ea9929a27c365add7bd8fc8b45915b8/blob new file mode 100644 index 0000000000000000000000000000000000000000..7007c116d12b01b366451debdc02b8d3dbcb8e40 --- /dev/null +++ b/shared/package-files/07/07d395536cdc4d37842311f1a3d398d89ea9929a27c365add7bd8fc8b45915b8/blob @@ -0,0 +1,9265 @@ +0.950300,2,4.43400,3.787121 +0.613586,75,149.1170,4.974391 +0.8372366,53,501.2317,5.193843 +0.9023396,58,546.2543,5.495572 +0.9061918,96,424.4232,5.856011 +0.7911643,8,200.5667,3.511362 +0.5360133,7,806.1763,2.722873 +0.6327574,56,56.17163,4.84627 +0.7634097,28,996.1946,4.506239 +0.5940891,78,56.14756,5.015406 +0.7991432,12,157.4574,3.92541 +0.6599134,72,944.1173,4.99709 +0.6845088,98,268.675,5.280095 +0.6883003,80,632.1445,5.128627 +0.787793,90,178.9085,5.466432 +0.5937039,11,637.886,3.312434 +0.6812908,31,477.9169,4.407207 +0.6260902,30,145.0597,4.289132 +0.5198778,20,172.1525,3.732414 +0.551296,21,539.7639,3.826797 +0.9473277,43,364.0211,5.573688 +0.6470059,32,446.2837,4.363963 +0.7304492,69,854.5265,5.104756 +0.8461879,49,341.8976,5.17709 +0.6998816,32,420.9467,4.473319 +0.7708307,73,782.7106,5.234264 +0.8517651,65,50.74249,5.601281 +0.7680614,23,782.7298,4.362934 +0.6772532,10,62.75346,3.446085 +0.8061568,53,941.9258,5.094457 +0.535348,87,579.7095,4.927541 +0.7317784,8,760.4088,3.322854 +0.647424,35,973.2097,4.430608 +0.7205917,62,451.4614,5.016029 +0.8310729,46,867.2378,5.064711 +0.7092925,93,252.9435,5.294547 +0.7614025,42,18.29759,5.194786 +0.768294,92,443.8754,5.398033 +0.611393,96,660.7554,5.120007 +0.5584655,9,544.9949,3.037984 +0.5757473,27,207.4046,4.096346 +0.7165018,66,868.694,5.044124 +0.8916566,90,891.3335,5.730434 +0.930496,81,680.2784,5.855139 +0.9493338,21,814.3338,5.058685 +0.8789807,96,958.6534,5.722715 +0.6453387,99,32.75148,5.368509 +0.9432753,88,44.19807,6.429427 +0.7734237,11,481.0691,3.747131 +0.9275644,15,31.61525,4.961554 +0.8814721,68,452.8735,5.521471 +0.5684593,38,359.6916,4.35714 +0.7915564,34,395.8539,4.741082 +0.6212993,97,578.4411,5.14523 +0.786856,89,643.049,5.411403 +0.5872209,30,947.6958,4.193762 +0.863228,58,644.4567,5.336585 +0.6852954,2,650.4337,1.422949 +0.8156778,80,626.9999,5.412793 +0.7758632,40,146.7813,4.857534 +0.6193542,63,757.0062,4.82912 +0.698619,62,144.0496,5.004096 +0.924634,5,682.612,3.647421 +0.6921237,49,433.7529,4.784743 +0.6682577,12,709.6476,3.557659 +0.7406304,98,958.277,5.368286 +0.5085852,22,433.0734,3.789960 +0.8567905,78,869.9651,5.511207 +0.6796293,27,770.1198,4.288455 +0.8970843,7,914.6475,3.798629 +0.8490929,46,340.834,5.141464 +0.609374,71,516.113,4.902681 +0.8709478,20,759.5428,4.57836 +0.720285,94,205.1919,5.332692 +0.7809733,3,290.1928,2.359907 +0.6695694,62,545.2842,4.911675 +0.6835529,2,482.5781,1.418211 +0.8061166,2,952.5813,1.83861 +0.5194726,41,996.1952,4.328192 +0.8214913,51,699.2729,5.113396 +0.7761068,36,304.3256,4.749856 +0.7338799,63,84.29842,5.132537 +0.5905524,53,981.4905,4.648476 +0.9062086,43,145.8958,5.377721 +0.6504464,84,494.4505,5.096346 +0.8689327,93,276.0934,5.706336 +0.5645257,7,580.0792,2.785004 +0.650522,63,428.5393,4.890803 +0.839554,48,209.0835,5.161268 +0.6790368,57,874.8717,4.863635 +0.8461706,95,497.4795,5.621337 +0.9483254,95,113.4526,6.237262 +0.6620466,71,782.7844,4.992363 +0.6950035,72,745.4756,5.064967 +0.6869721,9,119.0430,3.344547 +0.6628797,22,627.2988,4.08501 +0.658888,51,74.652,4.809383 +0.830574,75,794.5755,5.406187 +0.6937293,17,435.4039,3.933864 +0.7577239,24,225.9839,4.390343 +0.7776778,92,830.089,5.408262 +0.764957,95,124.2182,5.472132 +0.9206389,17,727.5881,4.694345 +0.898351,70,950.8781,5.591991 +0.7973998,11,220.2692,3.831447 +0.7214944,95,380.3205,5.322659 +0.9238978,77,787.5278,5.781355 +0.9244872,91,512.0104,5.905293 +0.8909669,68,452.4798,5.559568 +0.7084065,65,626.041,5.02022 +0.6307753,75,215.9268,4.995051 +0.8594055,84,115.6110,5.675496 +0.6989477,97,849.4333,5.279922 +0.5869843,18,815.1642,3.756967 +0.8016823,64,250.8206,5.246913 +0.551895,33,760.6953,4.20931 +0.81746,45,312.4948,5.029417 +0.8709936,16,101.5497,4.468421 +0.937709,65,792.7134,5.753211 +0.7804762,54,582.7179,5.048146 +0.9183745,25,969.7477,4.970277 +0.5937925,3,661.8292,1.812094 +0.6098205,49,786.0637,4.623535 +0.8903852,67,28.15358,6.025434 +0.6488511,78,214.1912,5.057178 +0.7700727,11,126.2421,3.76314 +0.7121162,3,981.2008,2.131666 +0.9040377,61,285.9408,5.56359 +0.8668537,67,443.4215,5.457901 +0.5564086,54,254.5303,4.614918 +0.627594,59,711.7653,4.795566 +0.6236158,61,657.5285,4.813821 +0.7054692,26,43.02735,4.42352 +0.7985678,9,555.6648,3.635557 +0.6175037,12,67.01567,3.478781 +0.6436729,69,202.2135,4.959957 +0.7975962,58,778.9944,5.138275 +0.8657938,40,971.3195,5.077273 +0.6125781,39,258.3901,4.462404 +0.9230684,25,77.91052,5.146124 +0.7718941,5,182.3003,2.958140 +0.7183858,72,772.0861,5.111052 +0.685252,40,419.2469,4.616958 +0.6817711,87,990.548,5.170921 +0.5134425,24,350.7156,3.875863 +0.94244,4,786.998,3.564546 +0.7367939,90,898.815,5.302826 +0.6982901,53,512.9667,4.853358 +0.8511483,81,141.8637,5.598955 +0.7122271,3,821.5797,2.132261 +0.6902148,100,284.2936,5.303542 +0.752643,43,13.40143,5.308534 +0.5762477,9,569.3049,3.075412 +0.7480166,44,857.6439,4.816408 +0.6270913,97,676.256,5.153524 +0.5805739,80,18.0991,5.136321 +0.7211723,72,132.8565,5.167092 +0.5795756,63,76.89864,4.807039 +0.5234776,36,451.4553,4.233053 +0.7375684,80,172.0776,5.265248 +0.8239995,55,480.0646,5.181428 +0.6456712,25,129.3303,4.181064 +0.9413013,18,492.3785,4.887695 +0.6400262,92,689.0314,5.138445 +0.6229059,57,874.2567,4.760222 +0.7065448,88,183.0431,5.262541 +0.6663917,13,565.7418,3.629029 +0.9066384,27,931.4407,4.964972 +0.8259662,60,730.302,5.240379 +0.509955,83,559.9251,4.853519 +0.6687699,6,160.4952,2.867927 +0.9091107,22,363.1985,4.843181 +0.5648102,29,715.7917,4.126072 +0.6017205,67,510.1983,4.847094 +0.7983275,36,631.9508,4.794933 +0.6861993,33,619.5893,4.46455 +0.5205803,3,373.5958,1.636966 +0.941117,7,165.7246,4.136368 +0.5513367,39,537.9881,4.344938 +0.7491319,33,712.8302,4.602413 +0.6254723,36,240.1404,4.424605 +0.8193866,70,553.8917,5.333919 +0.5924001,50,346.2979,4.615012 +0.5575877,27,865.5236,4.052604 +0.5018944,78,13.42953,4.940013 +0.6858643,54,573.8197,4.840953 +0.7754497,98,760.7202,5.447041 +0.9309805,15,106.4171,4.749156 +0.7597726,5,164.1182,2.92082 +0.8578071,63,712.2652,5.373159 +0.911167,28,868.7552,5.015934 +0.5224571,94,120.4146,4.983536 +0.6644315,34,415.3146,4.447791 +0.5462101,7,624.7674,2.745171 +0.7798522,66,174.2775,5.229032 +0.569931,57,455.0914,4.67309 +0.8878053,56,651.2573,5.404565 +0.7848387,81,320.6422,5.359167 +0.5205078,17,452.1213,3.580051 +0.5922637,73,327.3382,4.898999 +0.5512022,47,533.1254,4.49198 +0.6539785,40,392.5646,4.555385 +0.9167344,99,214.5807,5.970447 +0.9447369,70,653.8565,5.854829 +0.5827263,45,704.0173,4.510883 +0.7946362,93,162.5867,5.513278 +0.5436138,22,855.6748,3.851738 +0.755334,35,556.5636,4.665327 +0.9268,54,869.746,5.561617 +0.6648528,47,433.7503,4.699148 +0.7485304,40,104.7193,4.806957 +0.5944208,40,929.1871,4.438083 +0.63304,45,547.4467,4.603049 +0.9118431,61,722.6399,5.567566 +0.720652,41,136.0821,4.743472 +0.6774275,99,188.8005,5.285412 +0.831584,82,642.8835,5.473357 +0.5817278,35,948.0573,4.309129 +0.6321327,22,784.3597,4.020958 +0.5431548,6,33.4411,2.598251 +0.8314369,16,942.1906,4.250072 +0.5546019,19,383.3337,3.746123 +0.6336268,3,975.2953,1.913129 +0.6703074,56,212.3536,4.855753 +0.5791341,44,55.41561,4.543996 +0.832449,19,179.6793,4.428198 +0.7833847,6,281.2441,3.188186 +0.5525693,6,92.11777,2.598153 +0.7141683,7,921.7208,3.139066 +0.7843614,9,264.1729,3.599121 +0.606754,87,726.8536,5.041784 +0.6120415,55,113.5644,4.749394 +0.9244803,99,99.19521,6.1186 +0.7773096,72,404.2429,5.252044 +0.7321032,86,700.6788,5.264721 +0.6722015,41,789.2637,4.603417 +0.7958672,62,244.6047,5.209776 +0.8295918,10,6.976075,4.622355 +0.5160006,84,417.1381,4.873595 +0.6063104,73,665.1216,4.915447 +0.830313,83,11.62979,6.405052 +0.8513132,3,935.2863,2.641412 +0.9099108,3,417.3052,2.976535 +0.605142,74,990.551,4.920812 +0.7359311,83,209.5253,5.278422 +0.8584674,99,694.433,5.678823 +0.7176196,55,310.9431,4.929912 +0.5039214,7,637.0151,2.655203 +0.6650235,7,252.5402,3.020462 +0.7516747,70,917.9605,5.159777 +0.6465379,20,966.2776,3.967723 +0.6117417,88,75.03909,5.120178 +0.864727,75,289.4869,5.544036 +0.5883802,42,988.5053,4.465431 +0.6207718,23,879.597,4.03577 +0.6597833,68,606.3898,4.959428 +0.5598158,21,627.1537,3.842139 +0.8209666,67,874.9125,5.300291 +0.754866,31,387.6171,4.575651 +0.5617583,19,723.7774,3.756965 +0.9393174,42,25.75119,6.090044 +0.7692625,64,621.2697,5.141441 +0.830146,95,408.8041,5.579854 +0.5445154,48,780.368,4.495197 +0.6460441,59,973.451,4.826685 +0.7571193,45,550.3283,4.859351 +0.6482274,10,910.6333,3.336849 +0.6453257,21,545.4061,4.010011 +0.944077,78,659.1318,5.919355 +0.8283513,63,232.6015,5.315383 +0.6238383,11,967.5066,3.375429 +0.920555,46,867.953,5.417839 +0.6191617,46,776.0902,4.591981 +0.7967018,6,238.7104,3.234803 +0.5562811,39,286.7352,4.35847 +0.8249085,18,661.9321,4.329062 +0.7856145,93,373.0646,5.451036 +0.8761004,93,841.654,5.69398 +0.5903102,88,126.7508,5.053856 +0.562227,36,81.24771,4.330475 +0.8585568,35,110.9485,5.03868 +0.658002,20,873.0264,3.991925 +0.9010046,10,545.304,4.148382 +0.8207666,30,220.0453,4.746643 +0.6796628,32,559.4068,4.427563 +0.8855762,26,447.3963,4.851362 +0.7611639,21,45.28665,4.390651 +0.7989508,51,821.7299,5.04934 +0.5588384,4,680.0978,2.114002 +0.7111297,6,488.6605,2.970037 +0.9003013,54,250.8912,5.46936 +0.8809515,64,917.479,5.462105 +0.6448157,6,759.0248,2.799152 +0.7000096,37,44.38138,4.700476 +0.6277596,84,826.4453,5.051443 +0.7988169,74,951.265,5.309046 +0.9424629,74,662.1041,5.874126 +0.866492,13,842.4465,4.206892 +0.7708649,62,183.6289,5.158482 +0.80865,86,481.3468,5.449073 +0.5991751,43,384.7992,4.509275 +0.6546014,67,499.3364,4.941333 +0.7256747,90,25.19916,5.582922 +0.6444263,84,142.5535,5.116413 +0.8193781,12,485.8926,3.968518 +0.547869,51,404.5397,4.551553 +0.7970432,38,154.9913,4.873851 +0.7669612,19,557.0404,4.206081 +0.8033985,57,968.377,5.138517 +0.894136,13,536.4957,4.337067 +0.7043946,38,739.0528,4.61108 +0.7234408,68,913.6276,5.079187 +0.622099,91,584.9706,5.101498 +0.7255545,27,418.1564,4.395093 +0.738156,19,58.73154,4.209344 +0.6241422,12,365.6692,3.463702 +0.5562845,19,350.9198,3.749867 +0.7281854,18,287.1144,4.070209 +0.5441473,59,121.4531,4.674919 +0.8905086,2,729.1572,2.266193 +0.8592729,21,186.6340,4.60649 +0.7442184,57,795.9408,4.998402 +0.7555524,76,809.0712,5.227268 +0.877916,38,349.5582,5.107913 +0.5961259,95,272.5336,5.098577 +0.5287142,89,965.3442,4.931151 +0.7706853,29,189.9224,4.581958 +0.6129344,78,816.0259,4.973186 +0.6940203,55,531.936,4.871643 +0.803978,85,113.2280,5.506545 +0.6513668,25,526.0979,4.16961 +0.7241574,24,810.4252,4.289929 +0.8009436,45,635.4232,4.967361 +0.6470061,54,599.8603,4.766273 +0.7905274,64,819.1808,5.189099 +0.8141194,57,112.7480,5.249975 +0.720669,93,890.1649,5.292697 +0.614216,4,26.84620,2.288507 +0.5201955,22,549.9339,3.810220 +0.7562491,23,75.20277,4.404095 +0.571583,2,591.1712,1.120692 +0.59512,24,925.6549,4.022300 +0.8498783,51,746.2723,5.199169 +0.720653,78,121.3126,5.229377 +0.8377182,30,618.6129,4.774599 +0.762667,56,190.1399,5.062476 +0.6654569,8,794.2568,3.154298 +0.8495638,39,68.62068,5.144765 +0.8259046,98,385.4926,5.590565 +0.8993462,79,421.6472,5.698037 +0.6378225,65,660.0563,4.88584 +0.7901517,41,131.5250,4.921998 +0.7735304,58,618.8744,5.081568 +0.6989816,14,925.2804,3.769055 +0.9247961,57,654.44,5.592775 +0.6678873,93,282.5398,5.210545 +0.7042879,9,3.896124,4.158098 +0.9381184,66,860.4778,5.763955 +0.7818833,6,78.19807,3.212809 +0.736335,99,79.06835,5.473526 +0.8725626,54,313.8057,5.342032 +0.8541985,68,528.8019,5.419967 +0.6945799,38,362.9406,4.598808 +0.6583852,51,933.405,4.741364 +0.9193304,23,292.4528,4.942313 +0.6527448,47,170.3905,4.694595 +0.6754736,48,306.507,4.741562 +0.5866164,62,608.678,4.762358 +0.8885043,92,137.4909,5.833394 +0.5866438,56,51.31247,4.754496 +0.6316082,56,327.2022,4.772503 +0.5772445,42,369.953,4.451939 +0.6347414,69,600.227,4.924792 +0.8806151,58,225.7173,5.440272 +0.6856101,98,415.3002,5.271872 +0.6636807,38,29.98377,4.680520 +0.5607791,7,385.8438,2.778012 +0.8966284,69,454.385,5.59322 +0.7196528,5,498.2873,2.791415 +0.643225,6,481.3396,2.796659 +0.7213205,36,550.7978,4.608818 +0.592653,34,996.0012,4.305271 +0.6135537,26,494.7108,4.127973 +0.8180465,5,587.1134,3.108012 +0.925586,34,608.966,5.243092 +0.712478,75,373.8838,5.139195 +0.8216724,78,524.4142,5.415784 +0.5777971,21,464.5309,3.877573 +0.7139551,73,652.4754,5.113785 +0.7583686,100,864.008,5.420804 +0.8995945,37,254.1523,5.196644 +0.6556193,50,675.7596,4.723593 +0.7279657,66,13.24369,5.578575 +0.7057946,67,68.34087,5.130584 +0.7979024,86,781.665,5.412042 +0.9401606,51,916.6018,5.606526 +0.6162031,43,280.8828,4.544513 +0.6506508,76,152.7170,5.053203 +0.9455006,37,84.7852,5.604932 +0.8825633,98,499.5796,5.765177 +0.7146368,73,172.6922,5.149105 +0.643779,66,744.6761,4.906691 +0.9246844,91,656.3491,5.897993 +0.6049427,97,825.6836,5.114873 +0.5431938,26,882.958,3.994681 +0.8126032,69,46.41403,5.517239 +0.7602118,7,182.2327,3.282168 +0.6820787,80,35.74084,5.289847 +0.7242503,71,633.399,5.115542 +0.762124,52,96.81844,5.048513 +0.5761674,27,795.3923,4.086751 +0.7674945,87,355.5641,5.363731 +0.6893945,89,848.0137,5.202317 +0.8342704,10,681.8076,3.853672 +0.9307401,34,270.5869,5.305084 +0.6917751,39,822.0006,4.604009 +0.7267107,23,680.2972,4.262292 +0.6354322,62,181.5393,4.868494 +0.7580115,57,501.0876,5.03591 +0.6178196,55,128.1938,4.756006 +0.6396423,44,624.3828,4.596975 +0.7626689,42,438.5162,4.824863 +0.5867045,63,103.1721,4.807943 +0.8525572,83,884.146,5.538926 +0.5375346,27,843.32,4.016654 +0.938737,8,476.519,4.204282 +0.8598953,30,895.0064,4.845791 +0.618619,26,310.2046,4.142067 +0.751289,85,971.0602,5.293395 +0.6007665,85,280.1201,5.02653 +0.8931311,96,661.1837,5.784881 +0.9477872,55,349.5601,5.745697 +0.8263472,25,868.1811,4.593935 +0.8971962,28,813.1129,4.94798 +0.917756,88,391.7887,5.859333 +0.5736361,12,298.5713,3.358818 +0.5923442,20,777.4425,3.860573 +0.9331808,56,926.266,5.622917 +0.5385511,27,131.7780,4.033215 +0.709832,64,184.5100,5.040587 +0.9305012,44,455.3916,5.46184 +0.7267914,59,697.8118,4.987088 +0.6695136,8,20.46508,3.278592 +0.636107,14,417.5571,3.632827 +0.662663,31,216.0035,4.380913 +0.6268085,67,388.1516,4.894231 +0.8478138,40,927.3398,5.015686 +0.8939183,49,127.1164,5.425592 +0.8187445,56,58.74734,5.334734 +0.6800727,54,652.806,4.828237 +0.7508679,55,478.8554,4.994428 +0.5247278,90,108.2003,4.958619 +0.5126827,83,367.0263,4.860525 +0.9360829,43,793.5388,5.466748 +0.5427037,17,355.0012,3.623390 +0.6746653,7,93.02982,3.059764 +0.6865374,83,642.7987,5.15102 +0.7966882,75,784.4196,5.31541 +0.9464101,14,331.0489,4.746153 +0.8584512,13,404.4904,4.183346 +0.8647911,39,852.2727,5.05704 +0.6417288,7,478.1858,2.960385 +0.8371056,85,444.343,5.522884 +0.8774682,24,836.418,4.745429 +0.7276132,95,91.43983,5.408513 +0.681911,83,834.1965,5.139621 +0.8320037,7,698.0064,3.507781 +0.7311164,15,910.4249,3.908022 +0.5453493,29,846.9758,4.090611 +0.5034893,15,962.7001,3.429684 +0.7765618,78,78.25059,5.408551 +0.6889326,30,700.1291,4.393576 +0.6663355,7,650.8927,3.018401 +0.903647,71,181.4400,5.697455 +0.8294555,53,483.8067,5.171024 +0.6864851,47,77.10473,4.805211 +0.8332093,64,638.4873,5.308758 +0.6178623,91,609.0503,5.093896 +0.9483832,42,134.5668,5.648304 +0.601083,21,988.283,3.919131 +0.8363535,13,264.5484,4.108176 +0.6232332,60,379.2178,4.806633 +0.6716989,82,134.4818,5.155346 +0.7271332,63,619.8103,5.036546 +0.716362,89,574.5563,5.25926 +0.7035438,46,185.5708,4.780743 +0.9094733,58,800.8275,5.519981 +0.7970491,86,899.1467,5.407964 +0.6710653,59,324.7219,4.885989 +0.7732243,82,267.0323,5.345934 +0.7177664,52,252.1324,4.894166 +0.5975854,54,403.198,4.68114 +0.7574227,82,848.186,5.283512 +0.61548,57,185.7698,4.767464 +0.856129,63,357.1877,5.385709 +0.7315266,85,348.6383,5.268519 +0.6396882,61,36.83948,4.971445 +0.8693308,81,553.7231,5.588287 +0.5279291,8,565.4334,2.850686 +0.653696,18,983.7102,3.891188 +0.5345938,27,865.7832,4.011338 +0.7072539,48,209.3058,4.817037 +0.9119935,63,136.3686,5.686828 +0.612377,99,792.52,5.141792 +0.9320222,42,279.1492,5.46138 +0.518647,98,812.767,4.985492 +0.8503986,49,813.2923,5.171308 +0.7017593,2,926.9244,1.471911 +0.928796,74,201.9075,5.851777 +0.572696,27,46.75606,4.135588 +0.7032733,46,360.8426,4.763264 +0.8491637,25,595.2798,4.674148 +0.7662437,46,696.0155,4.894196 +0.7282377,14,297.2000,3.849405 +0.875547,99,203.8363,5.792346 +0.8080239,83,931.4812,5.411267 +0.6885786,33,956.5435,4.466412 +0.7831086,97,837.6102,5.456536 +0.9459541,43,198.5099,5.60273 +0.5396256,39,300.1694,4.328677 +0.8436808,63,945.8707,5.323334 +0.6760259,83,752.4728,5.129654 +0.794726,30,289.6138,4.660757 +0.8699908,10,465.4956,3.999971 +0.6201105,11,823.6584,3.367809 +0.8532556,19,316.4788,4.484371 +0.8204,6,290.9876,3.316586 +0.8684488,30,453.036,4.888899 +0.9351581,85,438.0463,5.930551 +0.5873355,44,787.4419,4.500897 +0.5668142,2,706.7757,1.109026 +0.8327513,38,482.0475,4.940103 +0.8554855,59,795.2226,5.318344 +0.7925683,78,596.6343,5.336552 +0.8354968,58,736.0778,5.244615 +0.7509,85,198.9852,5.331186 +0.6546461,93,239.3210,5.190297 +0.5231616,72,35.3501,4.838751 +0.7953823,61,991.2709,5.165394 +0.6118757,13,108.9576,3.529129 +0.6601847,18,911.6591,3.905212 +0.6335368,63,919.9916,4.852865 +0.5913542,54,335.8841,4.672278 +0.7957373,32,452.8137,4.703563 +0.8788325,82,823.1708,5.62168 +0.6757324,48,310.3905,4.741838 +0.9181646,61,518.8919,5.608716 +0.650593,63,345.7281,4.894228 +0.688562,76,536.1067,5.094923 +0.7157119,65,283.2976,5.050122 +0.8862314,20,402.8624,4.654271 +0.7751035,59,526.9975,5.100229 +0.852668,40,456.2137,5.044085 +0.6919508,13,305.6826,3.693041 +0.9479584,79,364.8523,5.981857 +0.531493,27,907.4513,4.0057 +0.8479793,87,212.9312,5.605534 +0.9373602,77,881.6762,5.858075 +0.794942,84,288.0566,5.413612 +0.7529769,8,974.1157,3.380804 +0.8806292,10,838.2374,4.041734 +0.9071702,71,976.974,5.640227 +0.5128439,84,113.3925,4.886223 +0.508224,97,353.1583,4.966884 +0.6519604,55,435.3711,4.792745 +0.5119386,85,606.7859,4.873612 +0.9132375,11,377.7748,4.306664 +0.6261143,28,92.34715,4.246723 +0.5091433,83,896.1872,4.850326 +0.7412793,27,978.2313,4.423764 +0.8408322,7,227.3483,3.555352 +0.7672435,9,520.7616,3.540014 +0.5301034,3,137.9902,1.662143 +0.6913752,99,368.8408,5.292307 +0.5038832,80,961.1678,4.814971 +0.6810352,58,798.4374,4.880977 +0.912606,95,39.98357,6.282317 +0.8752428,87,634.5903,5.653246 +0.5952158,2,215.9915,1.180506 +0.7718479,48,745.4419,4.938152 +0.6458358,11,277.5476,3.430429 +0.5988926,47,477.9302,4.575699 +0.8380053,85,626.8053,5.516798 +0.7103821,69,536.2279,5.069106 +0.8866979,37,457.5733,5.116669 +0.7517034,20,398.4081,4.213259 +0.9147898,46,560.4219,5.396691 +0.9484228,17,738.7124,4.894374 +0.8846891,40,963.2052,5.150066 +0.9426123,27,772.5522,5.187897 +0.8692356,26,67.72579,4.906808 +0.8589243,45,178.4913,5.190465 +0.7328168,62,788.4979,5.034291 +0.623517,64,359.9294,4.855704 +0.8780984,91,355.0138,5.712913 +0.77191,38,768.8696,4.764597 +0.6181754,100,993.8187,5.156927 +0.8559087,43,211.7474,5.136296 +0.5625674,51,284.2133,4.580255 +0.7974567,4,236.5961,2.785214 +0.8577004,44,559.3555,5.12577 +0.9458263,71,286.2064,5.911821 +0.7599092,84,920.8071,5.304669 +0.7314819,15,749.6491,3.909982 +0.7849763,59,195.8903,5.155483 +0.6070717,33,678.3757,4.309346 +0.5852736,62,260.5681,4.769412 +0.6049603,85,602.8164,5.023711 +0.7056618,14,68.68933,3.836551 +0.7184723,93,2.506099,7.900124 +0.907464,25,868.7431,4.912952 +0.8818385,76,441.2289,5.598673 +0.904677,35,205.0632,5.193281 +0.8232554,27,47.38136,4.807151 +0.9188763,93,90.43636,6.059958 +0.6166306,48,24.47130,4.779987 +0.8503245,59,652.8947,5.304897 +0.8644836,93,696.1033,5.657553 +0.7398192,73,382.7746,5.177192 +0.5050311,88,83.43626,4.91444 +0.8900678,93,351.7667,5.774332 +0.7577198,5,355.05,2.906072 +0.5459648,5,673.3102,2.360118 +0.7315915,52,154.3075,4.943453 +0.7092939,43,819.5333,4.714818 +0.7618465,85,876.8257,5.317655 +0.7262858,83,700.0127,5.228118 +0.7737173,91,178.424,5.438783 +0.6358564,78,102.2227,5.061739 +0.6601463,78,880.9956,5.055251 +0.8248714,64,240.081,5.314529 +0.7785174,87,770.9972,5.373263 +0.8429175,76,725.753,5.453214 +0.5951001,72,385.1136,4.891615 +0.891007,96,479.0816,5.786144 +0.7736853,89,857.986,5.376108 +0.918299,100,390.0396,5.944879 +0.7906417,9,287.6082,3.617527 +0.6402875,74,647.4198,4.984587 +0.7765883,93,620.9507,5.417569 +0.6578024,10,85.02536,3.386581 +0.5627766,31,309.6647,4.18284 +0.6243535,79,396.6058,5.009259 +0.6200636,53,208.0446,4.718187 +0.7096096,74,775.759,5.112731 +0.83082,79,246.7897,5.477539 +0.8123965,6,153.8754,3.298421 +0.8382691,12,142.3883,4.064761 +0.705515,61,282.4126,4.982704 +0.7580165,37,324.4754,4.723757 +0.9096753,83,169.1843,5.839802 +0.949019,20,64.8373,5.213973 +0.8169494,70,896.4021,5.319118 +0.7710959,10,770.646,3.648601 +0.8901521,6,442.8634,3.61866 +0.5415315,33,652.749,4.191687 +0.5416192,18,662.6916,3.670651 +0.7902908,48,447.7559,4.992453 +0.5299773,43,16.22008,4.520329 +0.9289499,30,225.6202,5.213176 +0.8344856,14,91.72327,4.211774 +0.5235518,40,394.8788,4.319086 +0.8744765,40,442.6723,5.12431 +0.9026988,5,750.8111,3.500929 +0.5675176,40,151.6294,4.408606 +0.6096033,63,605.3651,4.813785 +0.5135856,71,670.9206,4.743154 +0.5918367,76,814.6443,4.918962 +0.6342168,53,534.5466,4.729815 +0.5325372,99,960.3788,5.013452 +0.741656,65,78.99525,5.181359 +0.6935803,36,51.64724,4.645036 +0.8542952,10,48.5374,4.044326 +0.7463491,12,615.9147,3.749647 +0.6943899,78,260.7352,5.139563 +0.889562,12,398.4491,4.25206 +0.8491757,82,60.51142,5.723753 +0.8016692,83,7.73509,6.604698 +0.8924879,21,262.3629,4.734577 +0.7525104,80,107.3612,5.331661 +0.7081317,21,92.81737,4.187879 +0.8065809,43,210.9749,4.979122 +0.5169801,35,395.1261,4.199522 +0.6757979,76,910.9608,5.065197 +0.7677337,77,365.431,5.278845 +0.8090006,93,842.7086,5.491836 +0.7051984,38,488.1513,4.617047 +0.7468627,45,45.37075,4.982465 +0.5568271,45,484.7282,4.468249 +0.7837019,32,851.0998,4.663072 +0.7612952,32,479.0075,4.612813 +0.733612,91,72.76688,5.415899 +0.8864325,62,547.5789,5.472746 +0.7578537,40,421.5965,4.777266 +0.6717871,60,709.5815,4.889155 +0.6287574,52,620.978,4.704199 +0.6445166,78,400.8385,5.035814 +0.8931823,45,485.385,5.282556 +0.7727532,28,379.5074,4.541311 +0.5352619,2,212.1915,1.035757 +0.7081157,3,139.0256,2.127859 +0.6033971,22,594.7747,3.965754 +0.9075128,51,414.4177,5.440742 +0.8494736,76,149.5367,5.544112 +0.7879249,79,855.974,5.328293 +0.5783671,12,636.4271,3.365007 +0.7535224,48,537.166,4.899041 +0.716179,45,136.7055,4.804574 +0.7744747,97,885.4469,5.435816 +0.841277,85,245.2894,5.559938 +0.544991,50,880.931,4.527181 +0.9347753,97,101.0668,6.16939 +0.7641154,88,752.9195,5.348427 +0.6819447,17,322.7949,3.910315 +0.8632081,52,916.537,5.254725 +0.868709,64,376.5412,5.438657 +0.7571078,21,676.9291,4.261664 +0.6838573,59,341.2879,4.910124 +0.8295345,17,71.70596,4.383508 +0.8079979,57,160.2103,5.204845 +0.8102735,76,371.9556,5.376022 +0.9184764,54,527.7015,5.527673 +0.6461691,60,121.8660,4.879243 +0.860307,61,699.5002,5.359746 +0.663215,21,508.4091,4.047775 +0.7294957,59,655.0106,4.99358 +0.8406354,61,281.0507,5.321951 +0.5139149,86,262.1952,4.891583 +0.7905041,86,300.4609,5.416914 +0.8456873,14,481.5299,4.194904 +0.5098909,5,19.22275,2.322491 +0.6678912,81,393.9353,5.105909 +0.830644,38,124.9105,4.991291 +0.8262549,83,261.9533,5.495006 +0.6959497,69,655.3541,5.03778 +0.8008555,69,289.2386,5.292137 +0.8117482,100,446.218,5.56089 +0.5293518,81,772.3581,4.864649 +0.6090772,49,221.2100,4.636553 +0.7506375,89,543.5856,5.33163 +0.6183604,77,479.8493,4.977886 +0.7233891,4,568.0821,2.538969 +0.7745052,56,225.0964,5.084653 +0.6148174,56,278.9049,4.744436 +0.5664338,3,26.61995,1.771754 +0.7387753,66,902.254,5.090323 +0.6776956,91,945.66,5.195144 +0.8217946,12,254.1228,3.987356 +0.9459525,96,623.9948,6.065962 +0.8649597,21,641.7817,4.595264 +0.7425515,77,617.3263,5.211645 +0.8400273,16,413.1986,4.289296 +0.6770476,40,220.3779,4.612167 +0.6674166,42,588.7063,4.614908 +0.6428335,10,133.642,3.340386 +0.8646097,77,855.3629,5.528825 +0.5891536,2,14.00990,1.198849 +0.8098053,40,872.5492,4.901222 +0.809758,42,176.2297,4.979482 +0.7928953,70,722.8662,5.259338 +0.797324,31,971.6011,4.6741 +0.5771383,99,69.68891,5.142041 +0.7773082,50,285.3107,5.000541 +0.5495215,54,160.6643,4.61034 +0.7773526,24,561.2561,4.424951 +0.8622123,25,101.0384,4.798824 +0.6110196,60,778.7585,4.778251 +0.7854684,34,708.4522,4.715879 +0.5639518,21,225.5089,3.856821 +0.8967337,96,316.8322,5.82831 +0.6992566,52,999.291,4.834764 +0.614064,23,555.4065,4.024895 +0.6308871,18,159.6431,3.860586 +0.9232963,5,100.3030,3.686886 +0.7375896,41,961.0838,4.738977 +0.8605606,28,672.7911,4.799961 +0.7257157,45,878.2304,4.783404 +0.5813184,27,289.4119,4.102855 +0.7107086,89,267.5164,5.264923 +0.9413629,10,369.3205,4.424309 +0.8740505,68,769.1524,5.480379 +0.6051843,61,386.9700,4.786589 +0.827576,66,678.199,5.312512 +0.900977,31,18.41794,5.674096 +0.7688614,69,257.3158,5.215556 +0.8761198,56,677.8171,5.357956 +0.5646782,6,382.0181,2.615419 +0.518497,3,378.3279,1.632089 +0.582818,59,70.65949,4.767608 +0.8276893,56,107.9941,5.283863 +0.7168767,59,470.4204,4.971592 +0.662991,93,701.3547,5.186381 +0.8005013,43,960.6649,4.927929 +0.5331211,96,445.2623,4.996752 +0.7771595,45,986.4243,4.901005 +0.7080667,37,156.1174,4.628933 +0.9328946,89,677.8293,5.929755 +0.6320658,2,87.63947,1.279896 +0.6080188,65,589.0781,4.83435 +0.6301288,6,705.1481,2.764101 +0.5133827,81,995.4598,4.838737 +0.719066,97,752.0547,5.320292 +0.6186295,22,683.8413,3.994817 +0.8119921,41,708.591,4.928048 +0.5609343,88,10.50586,5.267972 +0.6724697,14,202.2301,3.721339 +0.573703,9,450.9772,3.070775 +0.8628512,57,640.9474,5.323342 +0.868195,94,649.7503,5.678757 +0.6743816,62,90.98017,4.978108 +0.8300029,19,250.6289,4.408213 +0.6457565,46,410.854,4.646782 +0.6287419,57,793.6064,4.771207 +0.9050638,91,883.7435,5.794317 +0.9116619,5,213.3576,3.574827 +0.9284593,16,108.4316,4.781968 +0.6050885,93,391.021,5.09282 +0.7973473,30,814.708,4.650565 +0.5764903,49,359.3575,4.571037 +0.5405271,48,288.3529,4.494993 +0.6495582,79,511.0006,5.050636 +0.6367823,59,822.7776,4.810997 +0.8513049,77,870.4478,5.484962 +0.9267168,35,561.7305,5.272438 +0.8221376,19,437.5601,4.369938 +0.5401428,57,19.55145,4.751766 +0.6786695,16,669.9876,3.843398 +0.6102902,51,332.7534,4.662691 +0.8363006,90,474.4249,5.556992 +0.6663403,99,437.2999,5.242262 +0.8085966,14,251.4224,4.079578 +0.9347172,77,837.7067,5.842615 +0.7344155,54,536.4091,4.942499 +0.9004107,96,208.1096,5.873226 +0.6433048,62,254.7092,4.874714 +0.8065827,89,583.4963,5.462501 +0.5564002,28,326.8198,4.086037 +0.5880839,69,181.2231,4.86122 +0.9407387,28,778.9392,5.199814 +0.9369049,53,886.1674,5.610943 +0.8998097,99,34.78137,6.290163 +0.6223383,90,941.7874,5.090228 +0.7911574,82,281.1704,5.388264 +0.8075953,32,504.956,4.735014 +0.5975587,94,219.1553,5.098065 +0.7839761,62,455.6021,5.160191 +0.5952474,66,666.0851,4.822761 +0.8705345,83,759.6216,5.601404 +0.6809573,45,228.4825,4.710120 +0.6019187,11,386.5556,3.331947 +0.7658947,15,814.1042,3.998861 +0.813091,40,904.633,4.910092 +0.918683,83,480.8551,5.81735 +0.8389258,98,57.99856,5.822399 +0.8472037,79,450.0731,5.503936 +0.8081241,100,215.4546,5.58131 +0.6612245,51,610.5578,4.749989 +0.6165932,26,887.3631,4.130658 +0.596875,9,13.68237,3.251298 +0.8972038,34,965.9676,5.087532 +0.8693963,35,513.7941,5.004048 +0.7674038,73,459.8307,5.235216 +0.5901292,64,250.1572,4.802326 +0.7296133,61,208.4754,5.043975 +0.8878144,91,896.558,5.722354 +0.5677198,38,365.4184,4.355683 +0.7190616,81,515.5016,5.200799 +0.7814752,60,50.94589,5.290408 +0.8198621,34,977.1663,4.808182 +0.6872518,25,721.45,4.242103 +0.5930279,60,325.3461,4.755136 +0.5059111,32,55.22956,4.135281 +0.8121109,76,17.48439,5.939912 +0.7529022,66,799.6337,5.122457 +0.6601005,18,329.2555,3.912098 +0.6066048,10,102.3450,3.263182 +0.8305692,4,528.8944,2.906320 +0.7135519,56,984.7976,4.918357 +0.6207566,9,387.2948,3.173807 +0.8736776,16,980.3776,4.408145 +0.5024343,85,554.2605,4.859215 +0.9368968,98,732.1767,6.012956 +0.7485144,9,525.2917,3.486522 +0.6679124,29,918.2333,4.321213 +0.7410865,33,374.1743,4.591967 +0.890034,22,97.48476,4.824609 +0.6235045,3,163.2022,1.891596 +0.8788184,31,854.3159,4.942984 +0.5733564,37,896.6874,4.339044 +0.5235723,75,313.9326,4.804836 +0.9031916,32,943.1994,5.072061 +0.9249485,3,634.5567,3.085764 +0.7795184,67,493.5099,5.202364 +0.5442364,42,260.3850,4.397356 +0.7538088,62,784.0382,5.080281 +0.8714196,21,519.4405,4.624195 +0.6037611,95,392.9248,5.105584 +0.605645,60,388.6159,4.775016 +0.7262467,62,451.3037,5.027994 +0.7070611,87,613.337,5.224093 +0.7124193,55,764.3051,4.905012 +0.7101894,24,335.7709,4.267068 +0.6363921,82,912.7779,5.048506 +0.5928241,59,575.4637,4.736328 +0.5114741,93,76.76653,4.969051 +0.6220136,86,987.4373,5.057191 +0.7778587,16,566.4055,4.090325 +0.7682783,65,739.0363,5.147656 +0.5197742,14,43.77784,3.428288 +0.80071,35,263.5616,4.799034 +0.848174,59,953.4341,5.291993 +0.6336437,40,504.9083,4.513693 +0.8964462,29,426.0757,4.983478 +0.9333257,71,108.4557,5.932473 +0.7945195,27,445.6889,4.56859 +0.6805711,44,975.6775,4.672505 +0.6033443,84,673.2954,5.011609 +0.6296885,53,838.786,4.718106 +0.5823181,56,649.965,4.678212 +0.5828971,59,375.5552,4.723169 +0.511142,14,841.3459,3.379117 +0.8984646,69,992.3174,5.582221 +0.6265228,50,935.0175,4.667815 +0.8357867,25,882.2828,4.624052 +0.7292072,38,532.7761,4.668328 +0.7758697,47,696.2516,4.9334 +0.7132152,32,841.5131,4.495411 +0.9086833,78,30.63744,6.228538 +0.840099,80,492.2464,5.488013 +0.6170762,97,396.9618,5.142746 +0.704527,39,249.5485,4.647633 +0.5579608,9,817.2322,3.035987 +0.770093,62,954.7968,5.115551 +0.8798565,66,727.0262,5.482889 +0.7694484,46,751.1275,4.901031 +0.7374544,32,581.615,4.553228 +0.8999201,99,999.735,5.823784 +0.8503247,87,92.39913,5.69636 +0.9096688,76,50.36219,6.011044 +0.8427042,4,121.9022,2.976982 +0.7524447,6,660.8017,3.085734 +0.6241854,30,577.2345,4.265333 +0.8464372,99,474.021,5.650894 +0.7979247,35,697.1621,4.771349 +0.6554351,97,127.8194,5.24562 +0.9227335,37,278.5272,5.314402 +0.558691,20,388.7766,3.799387 +0.7875231,58,927.0415,5.110648 +0.8474654,11,318.4969,3.998567 +0.9199452,89,804.1497,5.853293 +0.755178,11,781.259,3.692196 +0.7501978,79,962.4833,5.24055 +0.5877117,66,66.11904,4.866375 +0.6082031,24,295.8402,4.054799 +0.9181698,39,877.5183,5.290326 +0.9190084,52,291.3868,5.529388 +0.908331,53,983.4375,5.449875 +0.7157437,47,555.3253,4.799205 +0.8001084,12,932.2304,3.901024 +0.7591904,99,164.9959,5.466765 +0.8684237,69,677.5477,5.472583 +0.7669572,55,622.1829,5.02765 +0.6282833,69,112.7529,4.951761 +0.8508472,18,856.9338,4.415786 +0.7813152,12,19.93834,4.079094 +0.8131596,67,917.1183,5.278312 +0.5229803,43,226.2008,4.380527 +0.760018,94,554.3343,5.38929 +0.6581901,58,114.3732,4.880992 +0.7050023,6,156.9929,2.963535 +0.6388137,26,345.2279,4.180866 +0.7703802,21,302.4435,4.307283 +0.7719865,73,825.9207,5.236278 +0.647917,91,504.8866,5.148101 +0.6770831,48,72.47072,4.804889 +0.6447003,35,175.7579,4.446625 +0.757191,94,476.659,5.386077 +0.8901368,78,382.6649,5.654444 +0.6815508,93,131.4914,5.266452 +0.5256458,36,822.9934,4.234394 +0.6296011,17,2.528912,4.934265 +0.677469,30,227.9974,4.3843 +0.7770068,41,10.56137,5.51524 +0.5165083,4,88.90173,2.023952 +0.7099214,6,708.6837,2.965266 +0.5776249,27,653.449,4.090242 +0.8385866,70,867.0004,5.381325 +0.653134,58,24.65445,5.028615 +0.5222114,38,940.511,4.271954 +0.52211,12,456.7922,3.253085 +0.8821391,25,431.2503,4.807591 +0.5107624,24,234.9617,3.87355 +0.791372,43,414.8101,4.916052 +0.5539438,31,842.9205,4.161233 +0.5333754,25,497.1534,3.945494 +0.9296186,54,416.9209,5.599508 +0.9344575,72,846.4138,5.797461 +0.7615936,10,617.3528,3.622655 +0.6086307,79,751.1954,4.975634 +0.6602143,34,809.9639,4.433619 +0.6904942,82,678.079,5.149386 +0.8644522,3,242.6071,2.713617 +0.7364714,20,489.1806,4.172711 +0.9352433,59,409.2411,5.695107 +0.8090254,95,529.3272,5.514943 +0.9187024,40,553.3839,5.320665 +0.841718,5,350.1257,3.205612 +0.6405692,52,765.612,4.72416 +0.8836825,33,897.9677,5.008132 +0.7230816,45,914.3267,4.777408 +0.5582674,44,268.5147,4.458432 +0.6244152,33,841.241,4.340628 +0.898817,19,297.5451,4.682202 +0.6923485,67,335.8841,5.020066 +0.8147905,97,528.7302,5.544107 +0.8768643,70,439.8828,5.524466 +0.690254,56,430.0983,4.880391 +0.612166,40,830.4586,4.470533 +0.6082176,75,78.70042,4.992784 +0.7485141,81,814.3725,5.256056 +0.6398987,7,971.5611,2.953990 +0.8322966,81,541.9221,5.470873 +0.7008189,28,314.5543,4.372912 +0.7927534,27,363.9284,4.56741 +0.69938,38,360.3372,4.609066 +0.6438937,97,270.8365,5.19707 +0.7341373,38,96.0892,4.736542 +0.8522399,52,668.3805,5.222469 +0.6801307,19,284.4478,4.004812 +0.831692,24,117.5902,4.639136 +0.9476048,10,240.9065,4.493684 +0.551496,94,993.1748,5.005831 +0.8230653,98,922.7676,5.56258 +0.8699226,40,900.2922,5.093391 +0.6854477,63,963.481,4.948333 +0.8432787,96,923.4997,5.606291 +0.8451935,36,623.6866,4.935431 +0.577007,25,887.985,4.023107 +0.8109441,94,56.21722,5.700043 +0.8529192,29,157.5588,4.845897 +0.817715,65,427.0795,5.283968 +0.7494217,5,122.7565,2.893578 +0.6925452,99,647.7264,5.284948 +0.8609249,36,630.441,4.989459 +0.9247448,93,182.9758,5.989076 +0.5416671,42,787.1045,4.385566 +0.8597668,42,692.5763,5.095625 +0.6654662,58,58.45632,4.942707 +0.9231077,77,432.3362,5.7963 +0.7628278,27,841.1814,4.477327 +0.8122138,17,380.4142,4.248607 +0.8622663,3,760.8548,2.695047 +0.5892135,2,65.48377,1.170696 +0.781671,3,592.567,2.359244 +0.5845937,10,856.3625,3.198467 +0.9229792,35,726.8734,5.244499 +0.8207156,75,72.31391,5.524492 +0.7980214,78,612.9044,5.349749 +0.8412272,11,464.5139,3.968972 +0.7087537,57,490.1565,4.928935 +0.7510459,66,987.4297,5.11618 +0.6339613,70,59.09847,5.014612 +0.7524349,95,349.5906,5.390574 +0.5876294,35,50.53542,4.381489 +0.7986364,13,537.1481,3.971551 +0.8415225,100,344.543,5.653898 +0.6416455,79,734.274,5.032779 +0.9383721,7,402.2937,4.084501 +0.6881057,86,328.5769,5.190362 +0.8396862,77,935.2592,5.448255 +0.932392,48,446.9599,5.534071 +0.8366197,48,323.8904,5.133291 +0.5522438,21,518.9197,3.828737 +0.824058,98,930.1329,5.565161 +0.6301056,95,90.10231,5.200541 +0.5108554,90,370.9280,4.916536 +0.6094796,21,341.6719,3.941419 +0.7173496,44,414.3781,4.757312 +0.5826613,8,428.8542,2.968118 +0.65258,38,239.701,4.520544 +0.6426234,93,185.9158,5.175764 +0.6141543,82,993.7445,5.009928 +0.656938,56,195.7736,4.831684 +0.8172469,30,518.1036,4.713522 +0.6019059,53,676.9374,4.670159 +0.6549961,6,547.4558,2.824931 +0.7232873,17,174.1364,4.019165 +0.7805223,32,50.51764,4.792173 +0.9196643,5,314.0752,3.621295 +0.7813478,83,469.8973,5.356797 +0.6547584,83,195.7537,5.115725 +0.9284674,32,394.5050,5.230222 +0.5197441,14,926.1198,3.395476 +0.6899643,72,802.6675,5.054524 +0.5053075,6,791.7115,2.484155 +0.5424734,15,289.0827,3.508554 +0.7931831,19,435.9833,4.281749 +0.5941135,78,221.3831,4.957422 +0.865215,28,291.7503,4.836752 +0.5424058,3,487.1848,1.687881 +0.7056974,65,740.978,5.012886 +0.9368825,35,14.76310,6.35053 +0.57561,45,291.1745,4.505737 +0.7682693,51,192.9438,5.006944 +0.6337592,36,428.2575,4.432639 +0.8266066,64,115.1584,5.371109 +0.5875868,6,201.9519,2.670309 +0.8789958,31,49.8531,5.149625 +0.7118476,13,884.6736,3.732919 +0.5739909,14,394.6366,3.504593 +0.7322612,47,187.8178,4.860688 +0.714794,50,630.2739,4.841745 +0.8901368,76,5.784143,8.037162 +0.7201633,26,820.6769,4.345689 +0.9010186,37,424.7176,5.182914 +0.6013714,59,541.621,4.751601 +0.7908577,46,997.1488,4.951546 +0.6927482,71,702.3211,5.051229 +0.5590977,11,594.2949,3.241059 +0.7164781,42,963.2049,4.711018 +0.9163904,43,502.9438,5.361358 +0.6612428,83,623.4967,5.104527 +0.6425414,87,862.6899,5.101567 +0.8213658,65,322.2208,5.303021 +0.7373462,89,551.5728,5.302949 +0.5986439,55,478.4257,4.695178 +0.7244378,30,347.0494,4.479614 +0.6218237,50,636.3346,4.661784 +0.725282,28,856.954,4.416502 +0.8487246,16,101.9375,4.375022 +0.7496028,57,605.1464,5.013753 +0.6803173,56,902.4544,4.85285 +0.7951882,70,583.4215,5.26867 +0.9259178,22,242.7018,4.957652 +0.7516096,36,551.4496,4.67813 +0.8295028,71,780.4252,5.365977 +0.8778276,15,475.6616,4.381838 +0.8194508,74,613.7646,5.370245 +0.8235226,30,845.348,4.726012 +0.7537613,69,934.379,5.15409 +0.6151436,20,976.8233,3.904389 +0.9386936,32,705.0091,5.281983 +0.6032401,27,860.4168,4.136792 +0.8156953,34,5.919545,6.147653 +0.8026528,42,280.3825,4.939681 +0.7619484,60,59.23093,5.209588 +0.876842,90,23.85571,6.264086 +0.6835586,12,487.0681,3.595008 +0.7693461,43,703.687,4.851691 +0.6153242,91,590.2577,5.089901 +0.5938335,2,361.9556,1.176101 +0.9398924,30,127.9098,5.339887 +0.6309711,19,744.1419,3.892506 +0.6674976,82,87.71144,5.172374 +0.7843308,32,890.146,4.664321 +0.8866003,55,245.5037,5.422817 +0.9174256,47,799.3804,5.417252 +0.7856124,89,946.9574,5.402764 +0.7332223,76,519.9381,5.185325 +0.5741031,45,596.0796,4.496812 +0.7555969,51,664.927,4.945389 +0.8515928,2,433.3597,2.047442 +0.573079,57,530.3749,4.677239 +0.8753101,72,65.81185,5.720728 +0.6491346,55,79.26238,4.842491 +0.794759,21,705.0873,4.362667 +0.9401834,16,505.0417,4.787617 +0.5122126,23,163.9715,3.842354 +0.8804487,55,7.418967,7.01951 +0.5310158,12,338.4504,3.271906 +0.9143952,2,334.7572,2.43831 +0.609437,49,766.6815,4.622999 +0.743276,29,559.6721,4.489996 +0.750802,43,906.3193,4.805193 +0.7028861,82,570.4726,5.175535 +0.7121867,61,670.229,4.981277 +0.5660296,84,38.86039,5.04032 +0.5041909,21,216.9332,3.744519 +0.5551879,50,348.8803,4.550023 +0.8878471,6,35.24714,3.745212 +0.892262,73,973.6806,5.593922 +0.696367,40,784.4907,4.633238 +0.6421879,87,282.2655,5.116123 +0.6215205,34,360.9796,4.365564 +0.789945,12,293.5746,3.88169 +0.640508,21,401.1258,4.002517 +0.7915758,10,797.9483,3.70977 +0.9387423,22,411.4235,5.024741 +0.5622273,54,898.4625,4.614994 +0.5953253,60,914.328,4.750301 +0.6392777,35,251.4834,4.428198 +0.8932596,42,377.1065,5.241942 +0.7364436,36,696.4678,4.64023 +0.5885521,10,365.018,3.20982 +0.829681,93,746.4872,5.549487 +0.5057063,93,958.7418,4.927446 +0.9257312,56,223.3139,5.636041 +0.6316418,80,73.15034,5.092505 +0.7197106,31,975.8304,4.483773 +0.7869882,29,766.9128,4.596767 +0.6074108,62,445.4765,4.800981 +0.8286439,26,784.7253,4.632707 +0.5689967,25,798.7926,4.008652 +0.8410289,5,870.3467,3.196519 +0.5227112,90,450.7685,4.933785 +0.6375155,4,668.4885,2.304924 +0.6896833,91,347.8749,5.231752 +0.7352017,52,438.1424,4.919824 +0.6386533,77,988.0837,5.007016 +0.9461375,49,491.345,5.64017 +0.654627,97,832.8996,5.199254 +0.5894615,29,60.51807,4.218363 +0.5269488,2,862.4869,1.015177 +0.9331138,87,461.2927,5.930507 +0.8665317,70,329.2841,5.497526 +0.9175936,89,572.3668,5.85077 +0.8128998,75,662.1277,5.36021 +0.765531,25,766.4274,4.423686 +0.8934914,39,80.10902,5.31473 +0.7163465,12,523.9966,3.673615 +0.7988134,17,41.4153,4.338415 +0.5451061,29,90.2829,4.114404 +0.9189236,10,718.424,4.249735 +0.5857667,34,673.6846,4.294493 +0.7549478,35,321.5195,4.673801 +0.7943498,5,543.3669,3.023187 +0.7016415,74,252.3303,5.117568 +0.559157,97,22.49902,5.190322 +0.8614353,89,59.39922,5.836828 +0.6084914,11,930.5192,3.342619 +0.9059065,52,830.8472,5.428208 +0.8895644,9,909.9186,3.990418 +0.9077405,66,367.3664,5.62232 +0.7912619,4,954.7676,2.755165 +0.6900781,79,4.370944,6.382217 +0.682151,37,498.7817,4.548054 +0.8415262,15,847.1698,4.231924 +0.8512212,81,70.99263,5.691611 +0.5211151,5,136.4987,2.309817 +0.8838984,23,530.1152,4.746854 +0.6994729,78,678.329,5.131444 +0.51668,42,187.2642,4.352938 +0.9481614,48,182.5941,5.705067 +0.9236594,4,668.0228,3.406841 +0.6312497,22,566.5117,4.020927 +0.7943789,17,577.5567,4.188866 +0.8626302,11,527.8644,4.051431 +0.6705389,50,89.56081,4.807473 +0.5516966,49,16.48661,4.683886 +0.8668004,29,971.0603,4.845009 +0.8014657,14,739.804,4.042122 +0.9053415,70,69.74634,5.837114 +0.6831015,69,194.3605,5.037981 +0.8789359,53,415.8494,5.343093 +0.9289235,69,568.3182,5.747231 +0.7899977,78,938.5117,5.323466 +0.9479518,39,874.7101,5.484147 +0.6049941,13,631.9339,3.496114 +0.9011545,67,390.2548,5.599185 +0.7040379,5,153.3049,2.757018 +0.6679361,76,271.9522,5.068211 +0.6960151,71,476.9279,5.062621 +0.8435223,54,164.3906,5.274298 +0.8736423,16,89.53738,4.491120 +0.59024,59,791.2283,4.72982 +0.9295583,4,208.2342,3.470088 +0.5965512,55,241.4432,4.700357 +0.6738523,47,545.3299,4.714014 +0.5366376,40,704.4424,4.338593 +0.8379685,43,361.8964,5.054343 +0.8422289,25,45.08528,4.825735 +0.717953,38,625.8311,4.641661 +0.5679036,27,216.3701,4.080988 +0.7799007,22,500.1768,4.36294 +0.9302193,42,778.122,5.413554 +0.782723,100,474.8462,5.486657 +0.8622244,25,578.762,4.722007 +0.940699,5,331.4978,3.788291 +0.6665559,91,293.6174,5.19182 +0.7849823,12,886.944,3.855518 +0.6102746,45,795.5418,4.558929 +0.5301608,34,410.1793,4.198522 +0.7874662,64,876.8466,5.180669 +0.7584281,61,372.7229,5.091763 +0.883191,19,283.4864,4.609797 +0.8593794,58,94.39034,5.436929 +0.9007119,90,606.605,5.777169 +0.7826633,84,414.7848,5.371269 +0.8178446,35,453.0215,4.834728 +0.5831485,51,648.3131,4.608569 +0.7011728,80,491.1916,5.157069 +0.577471,34,341.6812,4.284249 +0.8422745,3,247.0640,2.607015 +0.5670756,52,252.8716,4.604588 +0.8654929,46,553.3708,5.185306 +0.555244,43,568.0426,4.428859 +0.8185472,61,153.0966,5.287868 +0.6000175,94,396.2763,5.091671 +0.9250674,4,959.921,3.415297 +0.519015,23,407.4622,3.848192 +0.9100592,26,412.1465,4.97078 +0.5725889,11,752.5595,3.268075 +0.7735475,80,13.28211,5.94689 +0.6812585,61,742.4313,4.918926 +0.8009573,91,495.3601,5.466766 +0.8496011,36,14.80379,5.591567 +0.8966086,24,326.1461,4.849813 +0.6029698,77,911.9371,4.946375 +0.5789911,33,268.6701,4.265316 +0.9015798,74,379.2924,5.668898 +0.8378741,59,176.2669,5.314487 +0.5142631,13,875.7704,3.314014 +0.6618115,90,361.3256,5.170771 +0.618478,79,498.9765,4.996128 +0.589535,53,843.2393,4.647428 +0.5709581,19,283.5134,3.779699 +0.934535,53,136.1736,5.70354 +0.9176517,68,662.3776,5.671203 +0.8882659,49,385.4667,5.328562 +0.7906314,62,227.6577,5.19901 +0.8331562,33,189.6048,4.866175 +0.8592519,5,199.5106,3.29058 +0.8631095,5,586.7871,3.295034 +0.7715704,95,393.3997,5.430589 +0.7810495,18,892.4912,4.195172 +0.6263919,51,861.9839,4.683013 +0.726559,66,379.8912,5.077005 +0.584635,16,816.7968,3.646219 +0.7622277,99,441.9479,5.434317 +0.544085,4,913.6733,2.079431 +0.8988398,92,782.1835,5.776936 +0.7965645,46,648.4351,4.97143 +0.5655758,39,916.2638,4.367322 +0.5597001,40,481.4167,4.380355 +0.6119028,43,619.7148,4.528215 +0.5059835,35,910.8695,4.177567 +0.888591,3,379.9952,2.841126 +0.8923276,39,532.5778,5.174923 +0.9391946,88,295.5114,6.001715 +0.8329471,5,561.5299,3.165962 +0.807254,49,471.086,5.051749 +0.6779844,72,546.0019,5.035882 +0.7169698,39,519.4347,4.661549 +0.6063137,89,822.5501,5.056334 +0.8338426,46,400.1937,5.087515 +0.9038509,24,381.7342,4.880606 +0.8799192,61,668.0104,5.431366 +0.7922678,53,992.3444,5.057599 +0.6221619,74,577.9326,4.953811 +0.7974794,6,983.7875,3.226665 +0.5508857,7,651.114,2.755166 +0.5805972,47,369.621,4.545734 +0.7430752,51,665.0276,4.916948 +0.889692,77,94.36406,5.767793 +0.8952883,43,895.1652,5.247112 +0.9065478,17,242.677,4.641579 +0.8725372,82,83.33613,5.757366 +0.6905845,95,765.2116,5.250851 +0.5161306,2,751.7912,0.9905717 +0.6449158,76,438.4860,5.016555 +0.850453,76,108.6052,5.580327 +0.6725742,2,480.4059,1.386370 +0.6161149,76,295.3912,4.971517 +0.7963333,93,957.2727,5.458221 +0.8256374,92,764.9899,5.530569 +0.8711578,4,954.592,3.086392 +0.7021267,58,94.03852,4.987058 +0.6045699,15,764.2379,3.627434 +0.8155154,53,809.7748,5.121834 +0.8537439,97,361.4350,5.66994 +0.6076632,42,300.3761,4.50934 +0.6164641,90,997.455,5.079993 +0.6679983,77,914.1822,5.060077 +0.8267494,47,758.4837,5.069028 +0.889724,88,814.6457,5.709872 +0.5710028,58,572.7667,4.686314 +0.7476734,66,752.3688,5.111589 +0.8446393,16,688.6557,4.298853 +0.6105829,77,741.3553,4.960555 +0.6288055,99,627.1944,5.171451 +0.8747276,74,936.3155,5.536257 +0.8663237,60,476.5183,5.378106 +0.6572653,50,279.4464,4.738406 +0.818589,2,408.8505,1.893213 +0.5529693,48,363.1589,4.51419 +0.8066909,59,384.7873,5.188151 +0.799528,20,910.703,4.334523 +0.8265927,61,476.6806,5.262121 +0.9341984,38,883.2063,5.367274 +0.805301,37,72.53905,4.940323 +0.565158,56,547.6801,4.65019 +0.5359521,6,879.5133,2.550337 +0.7844629,81,944.9339,5.335886 +0.7571667,9,95.5825,3.542732 +0.9163885,78,973.905,5.746129 +0.5834059,92,85.6609,5.08992 +0.7239388,81,538.4948,5.210062 +0.7697425,2,525.1054,1.698599 +0.663207,98,479.0765,5.228057 +0.9052223,45,320.5551,5.352677 +0.5567801,53,341.8657,4.597828 +0.8841526,26,887.5597,4.833461 +0.9384,63,439.3002,5.75641 +0.838798,92,83.15308,5.710527 +0.6815254,15,309.6898,3.798653 +0.5857514,42,476.6759,4.464864 +0.8293977,80,31.63208,5.801698 +0.842452,34,184.5945,4.92152 +0.8692851,97,633.1602,5.703721 +0.7267881,31,137.6431,4.537449 +0.7356832,56,658.8381,4.969012 +0.7227652,91,554.936,5.288082 +0.8580446,92,162.8874,5.697804 +0.9311096,57,330.0965,5.656089 +0.87975,61,740.2764,5.428649 +0.5778756,23,14.93272,4.118634 +0.7842306,30,313.8244,4.629866 +0.6270722,33,779.2002,4.346039 +0.7057705,79,302.6537,5.167424 +0.5971569,35,33.86121,4.433412 +0.9313556,92,31.7865,6.522864 +0.9145324,22,844.1247,4.855005 +0.5121691,72,610.6148,4.751727 +0.7191218,46,152.6025,4.822954 +0.6811826,4,294.6595,2.422272 +0.6025292,48,964.4258,4.593841 +0.8007709,18,992.2387,4.250902 +0.9168472,47,961.849,5.410959 +0.9089293,79,416.9533,5.742267 +0.8455079,57,263.6889,5.292637 +0.8230542,30,80.5108,4.821179 +0.5176877,25,849.4768,3.915583 +0.559614,30,68.57347,4.180268 +0.8706231,16,203.46,4.426949 +0.7886635,87,614.8048,5.401131 +0.5709352,53,489.2911,4.618905 +0.6175398,45,82.33716,4.618999 +0.9273795,83,849.5728,5.847243 +0.6616265,64,464.1305,4.921935 +0.9092348,35,43.38426,5.454607 +0.6639229,9,488.635,3.271458 +0.7123701,24,645.2518,4.264661 +0.5971812,71,323.3251,4.887295 +0.9040199,58,302.4310,5.526017 +0.891341,3,853.512,2.85285 +0.8327472,46,999.0827,5.068139 +0.538213,77,36.63778,4.919466 +0.9343277,60,798.6898,5.678839 +0.5291167,96,940.8475,4.986283 +0.5365506,2,905.9114,1.037311 +0.5783818,67,519.9423,4.807253 +0.6017498,70,535.2365,4.878864 +0.5621818,55,61.71024,4.679536 +0.631023,85,936.9508,5.064591 +0.6173371,18,425.883,3.820447 +0.5176463,23,673.073,3.843871 +0.7944634,58,930.0162,5.12811 +0.5406991,33,242.3118,4.196870 +0.6967938,23,300.9028,4.203233 +0.902891,90,637.2883,5.785307 +0.8088856,26,119.2594,4.627547 +0.5780078,51,584.8612,4.600362 +0.7028602,54,774.6654,4.871879 +0.6738062,30,613.2607,4.363156 +0.5541092,10,650.902,3.135661 +0.9457014,54,949.3188,5.683393 +0.8972022,46,406.4764,5.321292 +0.8667156,11,684.8948,4.065692 +0.9310755,76,645.1775,5.818983 +0.5542021,24,646.2454,3.947356 +0.5404606,42,196.7277,4.394176 +0.686979,56,163.9087,4.898354 +0.7025409,41,410.7730,4.67216 +0.8317294,53,419.5157,5.181381 +0.9424831,76,426.1901,5.908399 +0.7372916,44,485.0423,4.798806 +0.6709233,84,331.3589,5.140749 +0.6746366,12,859.704,3.571476 +0.8216683,34,540.0916,4.821108 +0.643978,57,272.3593,4.812046 +0.5520607,53,60.71588,4.631438 +0.7007719,42,765.4727,4.67977 +0.9199158,12,441.8452,4.417682 +0.7121463,56,636.3291,4.919563 +0.7334962,37,720.3002,4.65424 +0.7212483,71,372.2988,5.118448 +0.8790645,22,142.9078,4.741032 +0.9044781,59,215.2122,5.560589 +0.5302091,33,553.2379,4.172572 +0.9233759,72,269.3898,5.778901 +0.6341785,99,731.2685,5.179165 +0.8801704,15,991.0715,4.383208 +0.6209372,66,531.3332,4.869074 +0.7938349,97,125.7036,5.560664 +0.7822507,53,943.604,5.032947 +0.7205718,37,352.3203,4.634869 +0.8427076,42,572.6246,5.04161 +0.7351081,7,70.82834,3.233934 +0.5523457,19,653.4837,3.739476 +0.9089972,81,543.5491,5.749272 +0.7323391,50,895.3925,4.87574 +0.521568,82,214.5986,4.871706 +0.713984,22,361.0807,4.202606 +0.7087699,71,76.13513,5.170263 +0.7970846,85,246.2059,5.433973 +0.9484904,23,924.6415,5.115985 +0.695886,39,421.1168,4.619389 +0.5020152,34,437.4275,4.149307 +0.9410206,71,688.0979,5.836372 +0.887759,11,259.6189,4.178223 +0.7860928,52,439.7041,5.040212 +0.6178195,77,148.7578,5.001551 +0.6259203,98,944.3424,5.156093 +0.7109561,51,193.5400,4.873273 +0.7578351,95,481.2859,5.394517 +0.7206983,24,140.5904,4.313175 +0.8106681,17,827.8169,4.234558 +0.8989231,38,423.3858,5.192314 +0.7481471,23,39.30671,4.449383 +0.5809042,43,147.3237,4.491469 +0.7851278,29,506.1053,4.596806 +0.7531022,27,360.8266,4.463365 +0.8690282,88,68.67441,5.829221 +0.7360276,14,836.9838,3.859787 +0.6293365,7,300.9803,2.933594 +0.6489233,37,151.2782,4.503674 +0.7898306,59,323.5039,5.148535 +0.6523805,84,815.1856,5.094532 +0.5320332,29,993.8974,4.066623 +0.9269118,36,547.8584,5.294179 +0.8070126,24,620.2786,4.506701 +0.6693941,42,17.37505,4.888551 +0.5038683,85,633.7558,4.860832 +0.8940935,26,757.7715,4.87946 +0.8346877,92,575.5123,5.561954 +0.9175068,83,713.3788,5.798848 +0.9257833,54,283.4987,5.595522 +0.9184304,74,780.53,5.726756 +0.8686702,7,355.3133,3.666443 +0.5827008,35,998.6566,4.310686 +0.7970785,87,304.8774,5.441025 +0.9382596,25,548.312,5.107429 +0.8953957,59,306.9858,5.497621 +0.5908737,18,574.3097,3.765925 +0.5266771,30,920.222,4.085747 +0.5057869,11,132.1592,3.141296 +0.6763682,66,533.283,4.970388 +0.5986894,27,175.3026,4.143136 +0.8778105,11,320.0037,4.125823 +0.6886012,37,602.0783,4.559364 +0.8813419,12,330.9027,4.21685 +0.7192435,42,460.7729,4.724577 +0.5545486,56,15.70768,4.807326 +0.9325303,38,346.1985,5.383635 +0.669051,56,640.025,4.834118 +0.6583283,86,996.489,5.1202 +0.6057796,77,325.1724,4.961303 +0.7796517,90,571.285,5.404014 +0.5056907,17,266.7461,3.554489 +0.7515106,11,303.1314,3.690423 +0.7039952,48,202.1302,4.811129 +0.809957,79,66.13782,5.541357 +0.9224645,6,619.0758,3.812107 +0.5094466,88,898.6833,4.893397 +0.9477443,73,129.9485,6.031339 +0.5485121,7,9.254338,2.885109 +0.9305325,22,684.9766,4.95488 +0.7119204,89,910.6426,5.244861 +0.7536868,36,162.9004,4.713997 +0.8250412,54,148.9539,5.221541 +0.687851,59,864.5388,4.906065 +0.918532,97,597.2784,5.909369 +0.5595147,41,544.9091,4.398864 +0.9004672,85,239.2722,5.78195 +0.59365,54,878.0916,4.668481 +0.8783227,10,896.2678,4.030569 +0.8133267,96,370.0175,5.54357 +0.8671705,60,64.87276,5.5537 +0.883281,74,645.421,5.575454 +0.5804001,84,84.52473,5.018588 +0.8266129,54,200.4741,5.207821 +0.6836131,20,664.69,4.04816 +0.6035206,9,628.5172,3.133810 +0.6702452,69,849.1852,4.986271 +0.6364704,48,883.8399,4.655244 +0.5671835,9,546.4393,3.056326 +0.5690553,3,236.2613,1.753378 +0.8756632,64,780.2536,5.444975 +0.7153843,63,838.4182,5.008798 +0.804762,33,609.6379,4.747504 +0.6179514,73,488.8654,4.938339 +0.8194816,96,853.4875,5.540392 +0.7588645,2,152.7610,1.664141 +0.7981592,57,334.5773,5.144643 +0.9490692,85,556.0761,6.016835 +0.5867042,70,990.4885,4.849403 +0.6007492,12,694.5446,3.410986 +0.736716,84,601.6296,5.260216 +0.6323489,2,774.0551,1.274785 +0.738871,58,355.3918,5.011991 +0.8140275,34,702.4303,4.794691 +0.7255078,34,647.2084,4.572123 +0.864685,28,838.2934,4.812339 +0.7486541,3,207.2905,2.251476 +0.7494737,2,623.8884,1.626546 +0.6653869,13,954.9271,3.624499 +0.537772,95,186.5677,5.007723 +0.6538231,71,568.5899,4.980417 +0.9414375,88,510.526,5.987133 +0.5479147,54,51.48266,4.646137 +0.557724,48,903.0369,4.516893 +0.9386544,56,857.2707,5.659779 +0.5940301,94,253.2258,5.088894 +0.6501443,64,959.9111,4.893937 +0.6067973,54,908.6455,4.691129 +0.654507,59,52.07229,4.941878 +0.8192652,79,340.7329,5.43031 +0.939037,64,876.5141,5.74957 +0.6135284,81,459.9465,5.006509 +0.7110579,18,878.6845,4.01835 +0.814323,78,780.191,5.388123 +0.8908215,43,392.1403,5.246676 +0.53005,80,518.9931,4.85878 +0.6253301,33,718.2566,4.343194 +0.9362074,50,393.0591,5.591873 +0.7219975,87,541.2979,5.255803 +0.9459326,15,316.912,4.798087 +0.930335,80,807.2895,5.841721 +0.5681464,16,378.3508,3.61698 +0.9499151,14,420.992,4.770063 +0.7182865,68,375.8024,5.081201 +0.7794312,9,96.4755,3.610739 +0.5496585,34,351.8712,4.233967 +0.8552836,83,358.2531,5.571118 +0.7258398,66,132.6162,5.114452 +0.6802115,50,625.1914,4.771628 +0.7970908,68,216.5083,5.284177 +0.7856198,32,35.54217,4.868538 +0.6896799,53,619.3499,4.833827 +0.5405124,11,709.2976,3.202944 +0.5931073,58,181.7167,4.740144 +0.9296065,57,274.144,5.657511 +0.8894637,99,230.9085,5.83801 +0.7269455,94,416.5431,5.324466 +0.5054073,6,366.2931,2.485701 +0.5939675,62,223.0338,4.787509 +0.9279325,87,412.7045,5.904856 +0.874619,38,700.4562,5.077989 +0.773303,85,519.679,5.351931 +0.6715655,4,828.7634,2.39306 +0.9316947,6,611.5014,3.880666 +0.7816273,64,883.5622,5.166293 +0.7616447,35,490.4985,4.682418 +0.6307362,20,816.8543,3.93619 +0.7790853,60,134.1737,5.174301 +0.7120402,8,831.7674,3.270146 +0.6111881,54,420.4505,4.704805 +0.5667839,65,250.6678,4.773346 +0.7412546,31,604.9042,4.536834 +0.761954,86,590.23,5.331604 +0.8147305,97,669.9403,5.538824 +0.921257,12,598.9547,4.420777 +0.8579846,9,796.0635,3.848182 +0.6420126,59,390.8569,4.82794 +0.6954217,94,744.5522,5.25295 +0.9495565,16,861.5791,4.855693 +0.6113444,54,989.5619,4.69867 +0.8328882,19,203.3542,4.424911 +0.8856367,28,696.2317,4.898714 +0.640194,2,117.6311,1.300124 +0.6474485,52,427.2151,4.742487 +0.5670605,59,541.7196,4.692942 +0.8488514,30,185.5357,4.848086 +0.7165594,73,490.8832,5.123192 +0.6623204,53,298.4773,4.790835 +0.5074262,23,273.8531,3.829228 +0.6352413,49,967.0568,4.668145 +0.5649781,62,178.2758,4.740777 +0.7498571,20,583.6562,4.204169 +0.5835476,56,123.3513,4.706382 +0.7550705,79,316.9494,5.271653 +0.7218668,75,330.5023,5.16151 +0.5017672,84,382.8786,4.85166 +0.630573,36,709.534,4.422514 +0.935681,96,964.6872,5.985507 +0.8554879,34,145.4236,4.982775 +0.7229327,81,378.9831,5.214754 +0.8577544,42,999.5687,5.083548 +0.9432636,89,833.7002,5.990668 +0.7666204,57,493.171,5.056368 +0.6362688,29,762.5893,4.259337 +0.8958883,67,622.4665,5.560987 +0.8283473,13,847.803,4.063877 +0.7218571,74,269.1406,5.157658 +0.8416842,15,260.8999,4.25085 +0.8848287,95,302.4653,5.775057 +0.8140273,82,303.3425,5.4457 +0.7295315,70,835.9745,5.11325 +0.5807518,51,702.8305,4.603968 +0.6501605,82,199.395,5.09776 +0.8406729,11,74.10512,4.033798 +0.903668,100,908.3707,5.848135 +0.7548947,70,466.2839,5.176738 +0.8195727,43,868.5602,4.982021 +0.5663267,78,102.8917,4.929645 +0.9173868,2,983.7003,2.457186 +0.628796,87,665.3164,5.079912 +0.8091684,35,694.259,4.802692 +0.7323985,53,860.108,4.918963 +0.7742748,5,320.925,2.959510 +0.6931249,34,890.3259,4.49974 +0.5241701,19,878.5768,3.686026 +0.8520986,31,769.1417,4.844574 +0.589649,22,718.8403,3.938434 +0.5274364,77,522.0673,4.826529 +0.6014354,43,831.8862,4.507671 +0.7802544,69,375.5549,5.23125 +0.6449134,2,891.3265,1.308500 +0.8130707,32,796.61,4.744624 +0.573831,8,728.1806,2.947466 +0.9301646,10,393.0404,4.335678 +0.8982183,99,279.571,5.862206 +0.5661488,79,75.63719,4.951629 +0.6237751,59,588.3647,4.790296 +0.6550018,40,711.4487,4.551573 +0.8109876,28,456.1428,4.643873 +0.6988211,2,699.4621,1.463250 +0.5704728,50,793.2397,4.570573 +0.5820357,46,923.769,4.525452 +0.6473964,75,769.8616,5.005384 +0.9244471,96,835.5283,5.924331 +0.6504812,57,542.7684,4.81398 +0.867966,74,895.898,5.512985 +0.9418494,16,774.1639,4.7926 +0.6489154,2,96.85372,1.325131 +0.5085422,15,625.4407,3.440078 +0.6989324,82,629.8381,5.166497 +0.9183082,48,186.7327,5.499822 +0.7709177,56,8.400555,5.942506 +0.6682601,40,867.857,4.576017 +0.89172,55,165.8517,5.472501 +0.6924027,21,631.6706,4.109167 +0.7003671,80,747.3869,5.149938 +0.6623735,22,971.5073,4.081657 +0.6241618,66,884.9327,4.870709 +0.5252733,96,722.093,4.981467 +0.6021912,33,411.8979,4.303828 +0.7934302,15,539.9897,4.080298 +0.8792068,41,204.9749,5.19277 +0.8198524,55,154.0691,5.216557 +0.928111,67,748.7546,5.715469 +0.5133573,38,246.1858,4.263624 +0.6884071,37,674.5355,4.55795 +0.7461944,64,473.5671,5.093302 +0.6532605,97,185.9989,5.225389 +0.5501679,27,628.1183,4.040324 +0.7534715,27,19.90830,4.748168 +0.7025255,31,938.235,4.446551 +0.8893203,50,492.9179,5.339381 +0.7325881,3,16.04148,2.286298 +0.8471792,46,99.03947,5.214267 +0.8558435,14,925.2775,4.2263 +0.9016918,25,899.1608,4.883661 +0.9413817,37,697.0876,5.402966 +0.9225349,82,561.812,5.82426 +0.5003238,9,688.7228,2.917672 +0.8512868,20,559.2459,4.507173 +0.8284532,44,595.7483,5.03024 +0.846141,66,653.0226,5.36898 +0.748223,39,755.2171,4.727535 +0.7368554,26,749.7013,4.384982 +0.7189159,3,647.6345,2.152868 +0.7414169,15,94.89577,3.977394 +0.8153508,24,211.3473,4.55558 +0.6970842,31,797.3713,4.435984 +0.8025622,50,6.803501,6.268036 +0.9030182,26,381.8899,4.936831 +0.6419183,16,749.4674,3.763236 +0.9327713,20,151.1507,4.961371 +0.8798308,24,400.5564,4.768297 +0.5138711,3,821.1119,1.620491 +0.53179,14,989.895,3.418602 +0.8421581,75,887.0516,5.438645 +0.8565368,86,552.1805,5.585046 +0.6598265,16,685.9115,3.801888 +0.9419386,65,314.7918,5.818752 +0.7884257,93,434.97,5.453545 +0.5809332,37,839.5907,4.352714 +0.5207864,44,85.54216,4.4121 +0.5672738,25,628.4949,4.006396 +0.6546446,54,218.9772,4.796863 +0.5339421,34,842.3085,4.202027 +0.5361476,42,825.7257,4.37603 +0.6629262,81,171.9478,5.118468 +0.5759406,36,173.0157,4.336918 +0.547108,31,106.1333,4.170199 +0.507479,78,627.4027,4.803467 +0.6631738,75,844.3643,5.033109 +0.5277626,29,585.636,4.060688 +0.5617955,64,210.7296,4.755963 +0.5835145,5,64.48203,2.462699 +0.882635,82,746.709,5.637861 +0.7425467,87,934.1737,5.291144 +0.7768254,52,92.34035,5.092246 +0.7278219,39,573.6261,4.684182 +0.8767195,34,706.6265,5.005221 +0.850523,73,99.0534,5.563408 +0.8754488,82,583.1682,5.616972 +0.6626895,42,438.3507,4.608795 +0.9348684,26,225.5050,5.147867 +0.9416782,45,132.6854,5.644021 +0.7208806,81,6.229939,6.237515 +0.5405073,7,75.27229,2.747032 +0.784138,27,888.8104,4.532014 +0.7047413,26,397.4317,4.317997 +0.8364552,75,366.4362,5.442106 +0.8720677,78,507.4042,5.575244 +0.8908936,64,713.2027,5.506109 +0.8166285,51,517.321,5.104816 +0.6565045,49,602.2967,4.711042 +0.7925262,27,43.26737,4.713331 +0.9016432,46,142.4901,5.405597 +0.8237432,37,112.9364,4.956212 +0.6777052,50,249.6319,4.781308 +0.9397628,44,116.4927,5.630913 +0.7341784,62,94.20431,5.111798 +0.6929476,61,14.01006,5.350054 +0.740762,86,974.9146,5.278999 +0.5808794,14,388.2787,3.518560 +0.7912621,63,532.4759,5.186615 +0.6266644,36,71.63259,4.466956 +0.6721112,45,252.2225,4.689743 +0.5568319,33,234.6669,4.226382 +0.7115908,38,835.0688,4.625388 +0.5007294,8,713.4759,2.793781 +0.9356461,65,800.8346,5.739674 +0.6431681,51,275.0588,4.726642 +0.6418362,30,783.4145,4.297577 +0.7584736,61,857.6538,5.078252 +0.9400944,68,808.2146,5.797917 +0.8150239,16,259.8427,4.214301 +0.5928511,25,884.6633,4.0527 +0.8235666,23,772.7027,4.52082 +0.7966892,100,173.8055,5.564043 +0.8403294,71,787.3465,5.397731 +0.6412425,45,936.1094,4.614527 +0.7763971,33,111.9587,4.725915 +0.6629552,67,97.09423,5.007628 +0.9173387,6,707.2925,3.775694 +0.7671331,5,428.4920,2.934431 +0.7318255,51,691.8642,4.891703 +0.9348959,48,464.1825,5.548811 +0.9217564,53,973.5796,5.518674 +0.6395493,32,814.8357,4.344956 +0.6595887,36,217.8564,4.494006 +0.7371668,79,601.646,5.218455 +0.8302437,87,993.3104,5.502131 +0.8564486,24,420.4169,4.674961 +0.7701998,76,656.015,5.263296 +0.6874573,47,608.4487,4.739844 +0.7121946,5,762.8256,2.769008 +0.7101067,68,554.8536,5.057617 +0.6214585,46,858.065,4.595565 +0.8607614,90,841.2433,5.61987 +0.6583589,22,568.094,4.076247 +0.6248519,16,359.5323,3.731892 +0.9475922,7,553.6634,4.161477 +0.9259968,89,677.8597,5.890037 +0.7219641,93,444.3312,5.305514 +0.866721,78,530.8345,5.555063 +0.895877,58,924.2145,5.455649 +0.7745198,83,239.1456,5.362005 +0.7279426,30,685.3133,4.479054 +0.6292672,5,652.6662,2.554493 +0.8621705,12,924.5616,4.119954 +0.7819186,96,730.1539,5.448783 +0.885565,90,730.3173,5.710649 +0.8552883,76,899.2516,5.488386 +0.6654058,86,486.6332,5.140343 +0.5998509,42,991.0918,4.485726 +0.8327136,54,536.8069,5.191774 +0.7425117,53,378.7974,4.952954 +0.7964822,75,952.3056,5.31239 +0.8088025,15,44.39403,4.251033 +0.6742135,36,860.2365,4.506043 +0.884635,39,389.9112,5.150668 +0.5918631,14,48.27244,3.582336 +0.9172598,17,29.02950,5.022216 +0.7190332,42,50.17895,4.837464 +0.5797433,60,961.7418,4.723679 +0.8932167,67,682.0348,5.54753 +0.6988684,85,423.5009,5.197771 +0.6357016,16,836.6406,3.749755 +0.6890077,32,461.3887,4.449031 +0.7588667,42,280.3290,4.825713 +0.5494846,55,47.56121,4.668146 +0.6874588,49,659.3741,4.770332 +0.6365405,66,737.9129,4.893803 +0.8233614,36,157.4156,4.91091 +0.5840611,60,124.7446,4.759483 +0.7339906,37,716.2325,4.655409 +0.7774252,44,334.844,4.901962 +0.6193005,9,940.9317,3.167399 +0.696985,26,88.31102,4.3444 +0.940315,59,700.5253,5.710277 +0.7377039,14,668.2784,3.865379 +0.913119,91,783.4478,5.83421 +0.5370352,14,440.6516,3.430929 +0.5327774,36,123.0329,4.263722 +0.648229,17,177.8754,3.844856 +0.6401825,64,575.8182,4.87999 +0.9480667,62,240.2785,5.85306 +0.8221232,31,667.1766,4.749486 +0.574851,16,771.9699,3.627125 +0.6598773,3,94.76652,1.993306 +0.7800032,26,714.9019,4.493196 +0.697495,32,653.2019,4.463514 +0.5867579,21,435.1138,3.895165 +0.6375613,18,609.9121,3.859645 +0.7611845,76,715.156,5.241431 +0.7984868,79,989.688,5.352595 +0.7752109,34,671.7063,4.689988 +0.8994018,22,624.0138,4.781058 +0.8005305,13,626.9485,3.975938 +0.6398316,55,286.0043,4.776561 +0.9424745,25,999.8135,5.127177 +0.5227684,13,699.9421,3.330973 +0.8779214,80,450.7731,5.617354 +0.917571,9,710.7334,4.149813 +0.8569605,99,590.8516,5.677787 +0.6843676,89,603.5044,5.196629 +0.733581,22,490.3643,4.245027 +0.8672448,26,182.8215,4.807842 +0.7397184,87,120.0428,5.35191 +0.5527422,23,235.8245,3.914409 +0.5820121,72,811.4327,4.863264 +0.9103458,29,548.7671,5.045708 +0.7945998,61,593.8792,5.170347 +0.5124122,96,562.5626,4.962827 +0.623792,51,197.2819,4.697112 +0.5217335,90,721.5645,4.929546 +0.8997264,24,919.2028,4.843187 +0.8411916,70,41.51056,5.664744 +0.7871999,5,232.2797,3.005849 +0.6698947,20,983.0028,4.016535 +0.7529359,84,25.78049,5.614619 +0.7208476,100,677.1795,5.346025 +0.5955761,18,635.3268,3.774734 +0.5967151,41,8.097904,4.849405 +0.7051689,44,680.4017,4.725193 +0.8043721,26,425.092,4.567816 +0.6045699,12,444.4552,3.420835 +0.9499069,68,96.17027,6.056731 +0.7528673,65,118.8346,5.174443 +0.5454412,32,666.9706,4.173194 +0.6051781,68,38.05244,4.970321 +0.9332288,77,568.6311,5.844464 +0.7542108,15,693.6439,3.968683 +0.7988791,42,207.1542,4.94052 +0.7200135,38,599.6341,4.646607 +0.6721438,49,389.8183,4.746427 +0.8592696,70,425.4091,5.462841 +0.7293571,43,247.9677,4.777638 +0.8784906,57,573.1369,5.382846 +0.8872626,60,518.9786,5.45521 +0.8542287,41,141.3212,5.121138 +0.8359833,60,26.23134,5.672828 +0.8527313,17,920.5974,4.37559 +0.5880137,61,823.1405,4.750736 +0.5841701,73,17.39604,5.082933 +0.61481,21,96.121,3.975453 +0.529416,91,166.0006,4.964893 +0.6913516,51,590.0996,4.809118 +0.8012878,63,291.3125,5.228858 +0.5019232,19,857.4837,3.645079 +0.8200012,68,28.59088,5.670121 +0.8115694,52,648.0865,5.100523 +0.9250571,51,160.3951,5.596079 +0.5669754,2,513.2984,1.109653 +0.6057292,64,150.8608,4.842164 +0.5911127,49,342.9278,4.597324 +0.8676585,14,558.4217,4.278688 +0.6736706,57,691.9278,4.855279 +0.897761,99,813.2623,5.818812 +0.8267767,46,228.8463,5.085301 +0.6035152,68,846.6566,4.85725 +0.7582057,20,242.3354,4.23916 +0.6485803,73,851.7446,4.987295 +0.5070576,79,756.7226,4.811436 +0.5045091,25,103.9773,3.906777 +0.6615933,25,756.1777,4.188058 +0.6169842,59,584.731,4.778306 +0.755264,82,2.038796,9.136763 +0.7341297,14,955.4349,3.854338 +0.7110796,100,249.6301,5.349031 +0.739534,90,239.7671,5.337524 +0.8744877,23,767.341,4.701607 +0.5994343,47,866.2662,4.572732 +0.5812632,27,242.8247,4.10473 +0.8300101,97,539.0103,5.585397 +0.7644073,77,93.01882,5.347438 +0.7088963,47,66.22171,4.870752 +0.761716,26,537.1646,4.448955 +0.8267095,51,146.2974,5.186344 +0.920754,6,883.9607,3.797106 +0.5645494,25,607.3827,4.001519 +0.7991966,61,233.9742,5.208985 +0.9370318,13,884.9198,4.590025 +0.9296204,16,614.5821,4.707096 +0.7483718,19,893.7514,4.154285 +0.87035,16,740.2796,4.396994 +0.6614598,3,704.9057,1.987768 +0.5755732,25,332.8273,4.025758 +0.8172683,22,533.8112,4.47024 +0.7023444,65,294.7561,5.02131 +0.8701465,78,502.7068,5.568647 +0.6377123,80,469.6564,5.039544 +0.8404908,72,49.64911,5.637678 +0.8580997,35,485.0983,4.96374 +0.8447534,84,954.432,5.521624 +0.8791155,26,796.0717,4.813707 +0.5021335,82,631.2578,4.83185 +0.864138,46,627.4507,5.17786 +0.6829586,100,381.9724,5.282529 +0.6399337,92,15.78762,5.45512 +0.892801,77,966.1946,5.631521 +0.7112448,93,557.9093,5.279971 +0.9059195,89,635.9542,5.79166 +0.6766005,45,865.898,4.682495 +0.8078958,82,484.666,5.414492 +0.9209267,5,709.386,3.620243 +0.5019439,34,358.7489,4.150157 +0.796657,22,698.0417,4.405835 +0.666716,67,518.8367,4.963378 +0.5832934,67,428.1866,4.817323 +0.6353169,50,160.2554,4.70964 +0.808612,24,875.6253,4.507879 +0.5622533,55,857.164,4.6292 +0.7769792,50,48.44318,5.144435 +0.7508037,18,215.6834,4.133351 +0.8904394,24,92.84264,4.901687 +0.7551548,8,796.5009,3.387813 +0.7183715,89,264.4048,5.28108 +0.7258366,88,963.9777,5.264218 +0.7143347,99,726.5095,5.32536 +0.8406081,83,836.4688,5.503172 +0.8187647,25,938.3164,4.569789 +0.8672593,46,313.6396,5.208531 +0.7980852,36,675.2051,4.793406 +0.8890563,58,892.8864,5.42769 +0.5277273,12,994.4026,3.26243 +0.5989106,60,404.3719,4.762745 +0.5224652,4,367.6047,2.031144 +0.9332694,15,366.5174,4.693619 +0.8910453,17,532.0215,4.541773 +0.742809,13,415.2074,3.816228 +0.6804219,49,587.299,4.75754 +0.6776288,11,547.1345,3.498423 +0.6405099,11,157.8323,3.42548 +0.7646327,30,314.6165,4.578473 +0.6431464,49,41.3123,4.794521 +0.6625404,21,192.0381,4.059123 +0.6285435,63,806.1845,4.844859 +0.5573989,47,505.8864,4.502889 +0.805001,40,903.4414,4.887536 +0.6460129,98,943.8153,5.190381 +0.8322745,30,99.25623,4.832698 +0.6887781,13,941.4417,3.677867 +0.9206663,47,952.5114,5.431576 +0.5918448,45,2.249338,5.900957 +0.7669543,39,634.4666,4.774106 +0.5947878,40,650.6587,4.440511 +0.6610799,98,738.0277,5.218904 +0.8867663,81,920.1037,5.641652 +0.6770999,41,660.3415,4.614517 +0.5231052,15,935.7127,3.467006 +0.9195054,66,973.0122,5.652802 +0.9458154,25,135.1134,5.245808 +0.6825682,18,518.101,3.957023 +0.7202741,31,954.2325,4.485164 +0.6372724,84,919.9869,5.067105 +0.6639058,94,535.0358,5.198697 +0.5768879,76,126.4520,4.922606 +0.6014787,98,379.4988,5.124203 +0.843094,26,599.521,4.683426 +0.745788,45,676.9461,4.830438 +0.8906488,91,755.4079,5.73699 +0.6100992,51,501.9635,4.657766 +0.8425603,61,661.1285,5.303181 +0.7462918,5,387.18,2.870519 +0.5925678,48,820.1916,4.577148 +0.6827127,75,374.9527,5.080066 +0.7781868,89,890.89,5.38604 +0.5066091,94,951.6413,4.936563 +0.7372862,90,806.7184,5.305063 +0.719858,71,201.6342,5.133828 +0.6634803,26,830.8077,4.223751 +0.6532852,63,685.4556,4.890671 +0.8625157,38,534.4332,5.037837 +0.9113472,60,437.6948,5.568579 +0.5088646,38,321.167,4.253789 +0.7771815,76,39.75654,5.505239 +0.8329044,62,524.4686,5.289855 +0.5650291,62,74.44416,4.768244 +0.8036751,73,829.7145,5.313832 +0.8067298,57,713.1123,5.151231 +0.8660429,3,628.0595,2.714821 +0.6403124,8,167.818,3.105184 +0.5834719,5,25.55454,2.491245 +0.5572141,15,912.192,3.532799 +0.6488088,16,908.6736,3.777065 +0.7077434,53,773.6298,4.868082 +0.5422179,92,392.5441,4.981776 +0.9266149,24,283.4202,5.020614 +0.934397,36,558.1984,5.341096 +0.7949,27,155.1294,4.600911 +0.7424595,23,666.7898,4.300019 +0.8616935,5,890.3192,3.286170 +0.6884716,12,873.8338,3.603543 +0.5995778,52,668.5873,4.651719 +0.8508779,54,410.018,5.255892 +0.6660627,75,879.4836,5.038071 +0.6070051,26,267.511,4.121184 +0.9190156,63,258.2150,5.667737 +0.7015881,80,761.3171,5.152116 +0.5142113,20,188.6005,3.720824 +0.6813229,93,817.4621,5.218213 +0.5267363,21,495.4859,3.781604 +0.7904401,18,243.0097,4.239977 +0.7043728,80,941.1215,5.155511 +0.7330856,28,214.5299,4.455344 +0.771847,40,761.3398,4.803051 +0.8222126,10,122.1747,3.845657 +0.6519614,52,676.2551,4.746188 +0.6944437,36,204.5020,4.568574 +0.8187647,9,639.2002,3.701892 +0.7374063,32,35.85045,4.713835 +0.643858,77,241.4941,5.035362 +0.7042147,28,781.8938,4.370234 +0.6143113,98,315.3997,5.149002 +0.944967,80,332.0912,5.973127 +0.7394078,37,842.948,4.666253 +0.8836379,73,903.33,5.560995 +0.6131344,14,725.1093,3.581661 +0.7558923,50,587.989,4.933226 +0.9276066,11,222.4321,4.416174 +0.6907774,97,309.7564,5.281169 +0.858821,20,501.4091,4.536867 +0.5517754,94,559.6398,5.009473 +0.7344678,31,542.87,4.522231 +0.6010437,2,644.5435,1.193663 +0.6390766,76,371.5618,5.008526 +0.6255595,8,534.3747,3.062646 +0.9056744,72,223.5716,5.699772 +0.8890962,72,173.6807,5.644737 +0.9489493,64,703.9186,5.826285 +0.8001742,28,105.0511,4.668771 +0.8885515,90,246.1473,5.766628 +0.9104312,68,907.543,5.628369 +0.7987321,11,748.0737,3.819856 +0.710524,91,97.95307,5.332649 +0.7085246,40,240.5481,4.676803 +0.5066204,29,770.7431,4.022715 +0.8146826,24,45.95264,4.681249 +0.7602707,76,8.387661,6.158087 +0.5249838,19,959.5517,3.687356 +0.8816273,38,889.53,5.102017 +0.6058824,83,365.8123,5.013899 +0.7755455,39,358.9888,4.805197 +0.803905,19,248.2879,4.324838 +0.7786487,74,795.3093,5.261867 +0.5892645,56,824.3645,4.688727 +0.7503843,59,146.3536,5.084155 +0.8878726,45,829.1219,5.248587 +0.7215956,45,586.8566,4.778501 +0.6683625,75,916.5796,5.041976 +0.8200763,11,655.7469,3.8903 +0.9290939,47,171.2948,5.557564 +0.8664462,49,687.7418,5.229077 +0.6709497,80,972.34,5.092141 +0.662782,11,260.5764,3.469753 +0.856763,68,72.66898,5.582224 +0.9451141,84,73.09254,6.229147 +0.5442873,34,625.0037,4.221118 +0.5587434,8,246.4427,2.919025 +0.6964054,7,884.3078,3.09278 +0.8280353,79,445.1356,5.446695 +0.9319106,83,83.3915,6.083346 +0.9094553,33,299.5859,5.154842 +0.7082671,94,916.572,5.275416 +0.5393918,46,441.9737,4.456249 +0.9006434,37,600.3707,5.172166 +0.7570982,51,3.471025,6.915447 +0.7251017,19,79.5184,4.152646 +0.7056264,15,538.5481,3.84945 +0.6071612,50,917.938,4.633409 +0.7963605,77,742.4764,5.333493 +0.6792351,15,444.376,3.789908 +0.8117668,31,414.1619,4.726513 +0.7630922,38,325.9708,4.756469 +0.8835082,57,859.4473,5.39423 +0.7853005,3,877.1259,2.371308 +0.5823137,32,137.8372,4.257573 +0.8698176,36,404.6398,5.032198 +0.6466369,3,76.42683,1.959759 +0.8688753,39,247.9359,5.105039 +0.911857,30,291.4432,5.098902 +0.7783195,55,21.39750,5.432208 +0.7999033,19,560.2088,4.298088 +0.8507938,89,975.0028,5.578287 +0.8241017,100,629.8307,5.585552 +0.5436256,22,376.0586,3.855056 +0.6320413,11,418.4698,3.396621 +0.7373736,92,27.8193,5.610314 +0.7955,46,330.8586,4.98233 +0.8829698,38,998.1991,5.105958 +0.8849295,63,727.0993,5.471034 +0.838828,86,77.1965,5.67457 +0.8527707,86,300.0162,5.594421 +0.5038315,70,206.4996,4.725505 +0.7296358,19,49.6474,4.200878 +0.6307941,34,957.3206,4.37594 +0.6606051,52,535.1912,4.764698 +0.5302261,42,398.8626,4.36944 +0.5320133,34,655.6624,4.199522 +0.717173,53,213.497,4.912165 +0.7287862,29,414.4081,4.459878 +0.8519769,40,395.7273,5.045371 +0.8458813,37,851.0596,4.953455 +0.5080707,21,542.4744,3.747078 +0.8051663,27,488.0093,4.597385 +0.7183791,64,716.7317,5.027853 +0.74227,54,722.8267,4.955939 +0.8676867,91,430.0528,5.667708 +0.7718417,16,637.8888,4.07256 +0.6280025,55,917.1669,4.742335 +0.8805145,73,291.5224,5.583936 +0.9136214,61,624.4414,5.579953 +0.6406982,39,63.4406,4.569391 +0.7158347,60,583.5661,4.978497 +0.8338452,90,533.1334,5.546689 +0.6402985,25,74.77586,4.190889 +0.8342987,15,943.0546,4.20576 +0.6310646,10,661.5494,3.299443 +0.8832602,16,427.1417,4.460933 +0.8367622,75,996.2516,5.420939 +0.7869439,40,632.3436,4.843514 +0.7270005,31,420.2332,4.508401 +0.7344772,37,232.4106,4.676147 +0.748638,28,576.1854,4.474753 +0.7833058,29,203.2394,4.613577 +0.9264593,94,401.6628,5.94759 +0.517303,5,91.09677,2.304455 +0.8696138,3,616.2727,2.733279 +0.6337402,96,20.0967,5.407003 +0.6865132,80,684.3764,5.124317 +0.8716307,34,857.9636,4.982612 +0.8256833,36,80.41628,4.974381 +0.7768496,100,922.0373,5.461231 +0.9348923,47,185.3694,5.588766 +0.9213014,59,715.2368,5.594296 +0.637975,47,960.5189,4.641537 +0.7403673,62,260.0004,5.072181 +0.888522,24,799.4427,4.793178 +0.7292344,81,333.3577,5.231112 +0.5112314,96,867.6153,4.959088 +0.6606651,48,740.136,4.701648 +0.8307073,18,575.5492,4.349796 +0.8462718,35,58.98953,5.070533 +0.9425635,4,623.8769,3.567630 +0.7125992,51,356.6673,4.860408 +0.719433,51,698.7236,4.865044 +0.8117532,67,123.0728,5.352249 +0.51242,13,494.2803,3.311685 +0.8207607,22,87.44027,4.552963 +0.7436482,32,212.3617,4.587393 +0.857994,15,814.849,4.293433 +0.8876703,25,357.3681,4.836751 +0.9342724,5,124.0048,3.764013 +0.8253175,2,505.8184,1.922227 +0.5419264,37,468.7642,4.287065 +0.8352296,49,595.4923,5.128307 +0.7760867,32,128.3048,4.69243 +0.5874936,17,628.5572,3.707673 +0.8402649,72,948.8077,5.404287 +0.8161572,35,549.248,4.826251 +0.5657067,75,14.10146,5.09065 +0.7584987,9,751.2792,3.512529 +0.8671165,44,395.8337,5.168171 +0.6058399,72,563.812,4.905976 +0.8298326,21,873.2819,4.467329 +0.7459137,2,764.5082,1.614097 +0.795002,100,483.403,5.515984 +0.5110326,35,590.3715,4.187442 +0.5340734,44,951.0518,4.408872 +0.7296615,4,321.1628,2.560116 +0.6477494,81,326.3393,5.072265 +0.7893775,51,766.0078,5.025427 +0.8201982,99,760.9333,5.56464 +0.8019888,56,156.5017,5.176328 +0.6829048,86,804.1223,5.166731 +0.6811957,80,395.5219,5.122117 +0.5937907,90,292.4034,5.054806 +0.6994597,75,591.3511,5.105359 +0.7505089,77,420.6277,5.236085 +0.7389941,70,134.9801,5.186518 +0.7474006,68,380.0116,5.143788 +0.9283534,65,871.1195,5.693591 +0.8853698,54,781.4963,5.36612 +0.6727283,50,98.73228,4.806432 +0.9024598,58,288.6449,5.52108 +0.9422723,48,601.0573,5.59093 +0.8320503,77,451.9414,5.44044 +0.7462295,52,463.9862,4.94351 +0.6709326,14,603.4235,3.706814 +0.7027618,56,633.9876,4.900411 +0.8641877,26,399.6143,4.767001 +0.9291702,100,940.3461,5.973414 +0.8258535,14,672.2688,4.121168 +0.813817,78,424.6809,5.399575 +0.8729098,22,278.2921,4.682318 +0.8000553,48,633.6019,5.012 +0.7571338,99,132.9017,5.47651 +0.585785,55,746.6153,4.669697 +0.5801946,49,803.9324,4.571639 +0.8304912,39,984.3345,4.941709 +0.9205222,49,108.9491,5.58668 +0.753516,41,940.5831,4.775568 +0.658206,12,818.7406,3.534411 +0.7980743,76,100.0541,5.42265 +0.8053866,43,924.0142,4.941535 +0.6634431,67,454.244,4.95901 +0.6276517,99,378.1968,5.176032 +0.9353756,16,152.446,4.803419 +0.7972733,24,216.8124,4.500071 +0.7848158,26,324.9694,4.517971 +0.924885,68,424.4133,5.725171 +0.8978605,35,36.21963,5.43976 +0.893118,59,16.27533,6.286604 +0.6643898,43,137.3643,4.656881 +0.5086009,31,757.6005,4.08214 +0.5289369,3,46.10701,1.668507 +0.6662625,100,811.5261,5.241232 +0.6849102,6,759.6397,2.899159 +0.6902612,59,737.0007,4.912149 +0.7061771,45,647.2657,4.74473 +0.667381,51,277.129,4.773309 +0.7089084,90,950.5108,5.24631 +0.726764,5,33.05932,2.874905 +0.932936,49,645.2856,5.539989 +0.8955401,36,128.7913,5.205502 +0.7664723,97,60.16786,5.574492 +0.6150861,41,680.7598,4.496292 +0.674237,67,329.4989,4.984961 +0.5336574,13,108.5183,3.364797 +0.760271,48,587.2861,4.913527 +0.7475153,29,444.9428,4.503107 +0.6400046,64,908.336,4.876023 +0.6650242,43,16.14885,4.913769 +0.6937891,80,561.2694,5.140687 +0.887406,83,32.14545,6.114019 +0.904731,2,377.119,2.365172 +0.8471754,19,624.3107,4.449655 +0.5666982,16,39.5771,3.662043 +0.9328277,11,480.6788,4.431356 +0.7922494,87,443.7334,5.417071 +0.8112987,95,226.9083,5.552231 +0.6133779,10,491.8312,3.261789 +0.6110203,68,785.7354,4.870548 +0.8970352,34,271.7124,5.11961 +0.8785843,67,798.9047,5.486443 +0.6724811,89,781.2876,5.171774 +0.6222045,16,807.4755,3.721919 +0.8502613,74,862.1943,5.455025 +0.5398314,29,411.4463,4.083856 +0.6792529,56,759.8733,4.852141 +0.6765828,24,468.7599,4.189076 +0.713825,69,830.8558,5.070837 +0.9256529,49,299.9408,5.524863 +0.5631582,20,253.5615,3.81113 +0.6424909,83,198.6384,5.092229 +0.7386519,76,21.18628,5.548556 +0.6851306,39,706.3514,4.591613 +0.7202942,62,387.4803,5.018255 +0.8902591,33,797.2625,5.037685 +0.5598123,7,790.0233,2.774130 +0.759497,10,520.5702,3.617932 +0.8977739,69,917.4554,5.580563 +0.729828,36,97.78912,4.682077 +0.5290516,15,958.4097,3.478331 +0.9282293,79,384.0795,5.847463 +0.8311524,21,158.7927,4.51141 +0.6868337,35,99.9053,4.557294 +0.6279094,49,79.26277,4.708953 +0.9039485,84,445.2753,5.756844 +0.898548,62,490.6054,5.526963 +0.8490779,40,810.5851,5.021547 +0.7652964,32,334.021,4.629276 +0.8686192,25,956.7512,4.739846 +0.6570135,70,142.3589,5.008457 +0.6120404,22,960.5204,3.980529 +0.6727586,61,732.1227,4.902816 +0.9390417,70,978.3288,5.805469 +0.6322727,65,42.49298,4.986196 +0.8420094,59,579.1828,5.28088 +0.8502256,57,885.6972,5.275624 +0.7768617,27,619.6548,4.516229 +0.5832149,72,206.8745,4.881147 +0.844921,63,888.1342,5.328041 +0.6436299,6,915.0828,2.795881 +0.7765341,94,958.9544,5.418364 +0.500027,83,214.0714,4.845321 +0.9493338,66,46.71093,6.250622 +0.5066988,9,639.482,2.930763 +0.7462216,11,396.7089,3.672843 +0.567244,52,520.2303,4.59758 +0.8421211,98,83.80207,5.765354 +0.8875776,32,428.5642,5.016232 +0.6608919,71,969.344,4.988638 +0.8039491,24,203.3197,4.522054 +0.8620975,8,511.9531,3.760100 +0.864312,6,502.6081,3.490271 +0.6693177,67,461.6307,4.969838 +0.5074913,77,596.7396,4.794191 +0.7032736,67,357.7343,5.0407 +0.8214841,35,854.0057,4.836031 +0.7366083,19,375.6881,4.133019 +0.6330116,85,361.0845,5.07839 +0.8963766,68,497.6582,5.579325 +0.9159304,52,604.829,5.484746 +0.6595075,7,986.7414,3.000678 +0.5753076,17,578.6994,3.68411 +0.5580612,50,856.1792,4.54921 +0.6553601,85,61.36344,5.201974 +0.900686,15,133.0886,4.539378 +0.6829527,86,544.1058,5.171349 +0.8457578,22,128.4829,4.613213 +0.9212189,71,304.4749,5.749921 +0.8918972,83,346.32,5.707472 +0.5864152,95,2.099936,6.718664 +0.5686968,50,82.45168,4.604964 +0.899514,11,82.5313,4.303197 +0.795062,72,482.2151,5.291828 +0.6483403,79,628.6701,5.046107 +0.7940012,97,252.8391,5.515253 +0.8008343,49,305.2234,5.045411 +0.8463603,89,591.3357,5.574033 +0.7679076,88,765.9055,5.356732 +0.6129822,86,190.9238,5.065058 +0.794287,74,65.87518,5.445131 +0.595042,22,736.6731,3.948656 +0.7492896,12,957.5914,3.755035 +0.5575823,16,953.6576,3.592982 +0.891035,34,198.4613,5.108404 +0.8700615,67,735.4535,5.456826 +0.6102607,74,615.7466,4.932702 +0.6442439,42,85.62474,4.617894 +0.9296985,6,933.5528,3.861461 +0.7083424,3,806.3799,2.120714 +0.8107343,46,923.9881,5.005333 +0.6170151,30,866.2096,4.249458 +0.5470541,19,480.3602,3.730668 +0.8595827,78,627.839,5.526631 +0.6772016,44,234.3043,4.684579 +0.6110317,58,695.5628,4.753752 +0.8653476,54,880.023,5.289088 +0.7431905,78,428.9381,5.228603 +0.8290363,76,533.6956,5.418502 +0.5193487,26,855.5284,3.952156 +0.8672889,90,488.9548,5.654752 +0.5127307,25,169.0594,3.915601 +0.7821378,91,451.9449,5.422582 +0.765217,30,465.913,4.572756 +0.821991,76,505.045,5.399814 +0.7502065,50,227.0218,4.941853 +0.5465306,12,906.6364,3.299862 +0.8074795,41,46.12214,5.096338 +0.7318816,61,239.4124,5.044108 +0.7379262,36,455.7286,4.648779 +0.7981295,71,324.1441,5.300941 +0.5761634,55,982.1628,4.652028 +0.5827038,70,810.1251,4.843766 +0.6060221,9,645.4407,3.139188 +0.929337,65,933.377,5.697937 +0.5944697,42,333.9487,4.483901 +0.5904768,42,39.00159,4.555614 +0.6237111,24,826.2296,4.077733 +0.7321938,99,546.025,5.365483 +0.8092262,24,113.7361,4.56686 +0.7384458,72,680.5146,5.154358 +0.7702537,12,562.1573,3.815985 +0.6441926,88,98.59672,5.168001 +0.7592311,29,482.56,4.530664 +0.5798336,5,606.1835,2.437498 +0.6674997,33,177.1550,4.446129 +0.7564904,24,553.4765,4.37112 +0.8303686,26,783.7082,4.638198 +0.7687771,99,716.0814,5.439636 +0.8210636,58,516.3427,5.208918 +0.8839874,13,236.9632,4.306785 +0.8675836,88,9.0463,7.04867 +0.5933452,12,885.4963,3.394909 +0.6987614,97,167.3294,5.31902 +0.6083984,32,348.0146,4.292166 +0.781873,49,182.8657,5.014807 +0.6179727,64,338.0714,4.846711 +0.5738579,28,887.2536,4.112514 +0.8718374,74,916.9767,5.52622 +0.695573,57,619.4104,4.899196 +0.7813837,45,763.106,4.914116 +0.7587202,56,243.6302,5.042987 +0.8526122,69,335.588,5.439119 +0.679438,25,3.925323,5.244888 +0.9018107,28,796.7149,4.970157 +0.9031522,60,560.215,5.521575 +0.620925,60,188.3965,4.815776 +0.5398193,23,962.0695,3.883163 +0.8001978,86,444.2741,5.429201 +0.8743729,85,382.2575,5.650717 +0.583254,25,654.4453,4.035908 +0.6820578,83,600.6018,5.143397 +0.7261496,39,706.9857,4.67826 +0.5349857,96,677.6188,4.996885 +0.8780665,26,145.6244,4.866995 +0.5110006,22,347.6669,3.795356 +0.9457965,31,497.3779,5.321787 +0.7104668,42,449.4024,4.706034 +0.926931,2,582.9908,2.539423 +0.6842416,48,820.8916,4.746617 +0.8984944,7,297.3639,3.820169 +0.5931354,16,962.1802,3.662621 +0.6215017,70,110.3659,4.950248 +0.5249559,9,451.851,2.968919 +0.6870519,78,313.5085,5.120267 +0.6895417,68,32.65226,5.201474 +0.6604548,62,818.0275,4.890735 +0.7258901,81,356.6513,5.222353 +0.8189167,84,452.3966,5.462345 +0.780193,75,79.63504,5.388074 +0.6710222,48,327.2395,4.731501 +0.8660183,76,809.9751,5.525832 +0.9385447,71,319.9745,5.852341 +0.8408653,45,476.6827,5.089412 +0.8506329,22,976.784,4.573917 +0.6274595,24,889.7172,4.084769 +0.7895091,91,31.23733,5.747325 +0.6720448,26,258.3145,4.253512 +0.6572791,76,163.3674,5.063448 +0.7308232,24,755.801,4.305953 +0.6334011,72,716.3932,4.951746 +0.875161,23,122.4376,4.770516 +0.6127634,92,978.5912,5.089453 +0.5246284,89,713.353,4.926033 +0.895216,15,353.697,4.469064 +0.7840556,2,170.7737,1.756434 +0.8611382,86,410.3382,5.609362 +0.5039933,89,312.2973,4.898963 +0.7011006,71,974.6255,5.064487 +0.7574644,99,511.3727,5.420484 +0.7464697,8,351.1746,3.36846 +0.9243401,74,892.4622,5.755217 +0.6147572,43,770.8194,4.532012 +0.9229638,52,813.2275,5.51579 +0.8206974,12,636.0771,3.9702 +0.7576767,21,246.3065,4.278102 +0.5283881,4,684.9849,2.043687 +0.6583222,39,346.022,4.54592 +0.6346257,96,211.0651,5.17961 +0.5608158,37,735.7256,4.317794 +0.7522666,60,914.4428,5.051786 +0.5487665,10,500.9638,3.125392 +0.6703224,94,579.5087,5.209303 +0.7221054,69,316.5972,5.103682 +0.8728384,10,63.56726,4.100998 +0.5574435,57,43.56925,4.718101 +0.8063746,62,131.3486,5.275156 +0.8943675,97,182.5163,5.864757 +0.6457493,5,430.6312,2.596322 +0.5910911,27,686.4856,4.114989 +0.659809,33,223.4219,4.424611 +0.5089013,37,85.17943,4.24973 +0.9337569,65,640.6944,5.733591 +0.8916446,68,81.18035,5.714367 +0.726869,88,469.9061,5.276224 +0.7227274,45,508.542,4.782788 +0.7008706,50,413.0376,4.818512 +0.5846127,3,629.5136,1.789435 +0.9457911,23,494.1918,5.106915 +0.7482145,76,977.4924,5.209178 +0.6433126,87,417.9693,5.110869 +0.5793081,29,982.1014,4.151251 +0.6934788,68,501.5589,5.025896 +0.6311162,48,915.3363,4.645259 +0.9031826,38,518.1569,5.206703 +0.856174,57,907.4092,5.294779 +0.6691795,35,226.9216,4.490414 +0.80142,93,697.1788,5.475566 +0.7584387,40,965.8347,4.768409 +0.8248351,38,591.9851,4.912069 +0.9428126,94,66.87335,6.314711 +0.7393929,32,643.1309,4.556659 +0.7509817,18,128.0423,4.150378 +0.944607,42,636.6847,5.51609 +0.6878091,82,735.6016,5.143399 +0.7364006,18,549.7353,4.082325 +0.5965991,73,703.3531,4.898591 +0.8115628,62,803.0491,5.221745 +0.6576455,82,477.9923,5.092711 +0.7706121,59,846.8496,5.082764 +0.6448159,65,988.0204,4.895462 +0.5759028,54,17.82405,4.816721 +0.5813438,49,489.6304,4.576707 +0.5037404,91,487.9228,4.911552 +0.8824765,13,813.0392,4.276511 +0.62344,75,81.9528,5.020752 +0.5867614,68,342.1725,4.836769 +0.8069038,68,679.784,5.276183 +0.8602681,89,264.0901,5.649063 +0.5375624,44,553.4245,4.416887 +0.5863542,75,189.5063,4.918604 +0.6014319,30,163.3551,4.237540 +0.734196,84,993.4357,5.248882 +0.6280806,44,466.1447,4.578057 +0.7870008,62,371.5928,5.172704 +0.5063825,14,845.189,3.369992 +0.7141679,39,317.1110,4.663328 +0.7700549,50,816.0496,4.962596 +0.7781668,81,587.8302,5.327848 +0.7701106,54,583.5682,5.022871 +0.8517387,17,358.7311,4.384958 +0.6512473,77,787.2048,5.030932 +0.6597704,41,623.5281,4.580925 +0.6045337,33,783.7763,4.303910 +0.6747628,65,275.5721,4.967814 +0.5754901,25,392.8563,4.02431 +0.5645206,4,78.64738,2.137807 +0.7526943,52,137.1844,5.000037 +0.8789649,41,763.2992,5.148074 +0.796924,51,58.16972,5.192775 +0.7044938,38,503.8397,4.615158 +0.5710955,43,426.3761,4.458341 +0.6121272,21,713.5597,3.941871 +0.8788232,25,983.937,4.780319 +0.9148775,11,63.67191,4.427849 +0.7441963,25,541.7408,4.373999 +0.8315873,82,310.8302,5.494771 +0.6930633,68,175.8612,5.051427 +0.6677114,31,610.1527,4.377058 +0.6290873,53,949.2253,4.716316 +0.7083651,67,177.3641,5.072448 +0.9437557,90,488.9657,6.019301 +0.8221788,6,101.5286,3.347645 +0.8082465,80,859.3798,5.387913 +0.8956217,31,760.4856,5.016639 +0.7809016,95,449.3862,5.44901 +0.6812002,17,164.7530,3.920066 +0.6770415,47,62.6635,4.800145 +0.6956216,54,702.0819,4.858225 +0.5366549,97,248.0049,5.016196 +0.8522364,42,803.0165,5.067515 +0.9384832,56,347.3381,5.689679 +0.8922538,100,325.7634,5.834656 +0.6228205,60,166.9741,4.822661 +0.7344996,76,784.5329,5.182257 +0.8145633,87,443.7463,5.474821 +0.5531538,26,108.4227,4.032707 +0.7911365,68,662.1342,5.236089 +0.8146687,46,745.2562,5.018899 +0.5045028,66,874.9952,4.67314 +0.640851,76,904.7578,5.002078 +0.8506346,21,911.0278,4.537878 +0.7239757,93,350.5313,5.315068 +0.6127368,28,218.7057,4.197065 +0.7262992,77,994.1657,5.172035 +0.8306157,30,895.4145,4.747346 +0.5229464,87,706.9792,4.906993 +0.6674732,91,347.1094,5.189795 +0.6238308,43,127.4031,4.577679 +0.7578883,49,72.34529,5.019715 +0.78206,64,247.9061,5.196063 +0.7060626,53,793.0226,4.86442 +0.6372835,15,378.8189,3.699193 +0.6513043,34,564.4485,4.41867 +0.9269004,43,806.0094,5.409004 +0.9135508,18,809.8735,4.696129 +0.5798318,49,812.5945,4.570963 +0.864919,17,580.5689,4.427441 +0.8151598,69,756.3115,5.306729 +0.7001978,67,902.1454,5.021915 +0.8482526,13,89.97161,4.201033 +0.6041064,73,262.3566,4.923191 +0.5754905,36,946.9922,4.320669 +0.8850153,77,726.441,5.60595 +0.8623828,64,202.0986,5.44658 +0.6556572,97,77.84997,5.277824 +0.751576,94,661.5748,5.367792 +0.7555403,99,118.5165,5.481632 +0.5605083,11,765.1715,3.243285 +0.545633,12,486.515,3.299668 +0.5149418,46,119.3487,4.42927 +0.7158448,21,82.71454,4.213274 +0.87695,16,805.7746,4.423861 +0.5104682,85,685.208,4.870765 +0.7702164,39,788.6638,4.779683 +0.5417859,11,694.7184,3.205555 +0.6259542,62,558.4269,4.831414 +0.7254502,8,903.2036,3.305184 +0.5322428,19,448.2684,3.703109 +0.8516168,21,844.6598,4.542132 +0.7967247,81,216.2363,5.405972 +0.6988626,80,398.184,5.156267 +0.833163,24,220.3202,4.611781 +0.9120844,14,544.9784,4.493611 +0.502613,89,313.4999,4.896737 +0.6447795,52,7.163189,5.317785 +0.9164835,25,225.1239,5.001143 +0.7750148,50,358.1708,4.988486 +0.9164688,86,323.5733,5.847662 +0.8563804,73,91.323,5.596053 +0.8697922,42,991.5779,5.126615 +0.9432807,64,453.3479,5.799377 +0.9311001,80,103.5973,6.007708 +0.84446,67,251.8546,5.404865 +0.6635903,20,436.5115,4.008136 +0.8023665,15,670.167,4.105092 +0.7924662,79,943.1383,5.338195 +0.8786404,44,880.9335,5.194768 +0.9433458,72,847.0615,5.856031 +0.6966925,84,899.6899,5.175258 +0.6961606,77,572.1535,5.118006 +0.6924574,16,650.4595,3.874692 +0.9265463,25,661.6503,5.024829 +0.6437473,13,478.7481,3.579849 +0.5920152,35,370.9993,4.333462 +0.7307583,80,895.2044,5.208895 +0.6856924,81,303.132,5.145253 +0.8606019,57,188.5887,5.363111 +0.6598683,22,774.669,4.077506 +0.8261763,32,297.7024,4.802724 +0.8439954,7,778.95,3.553677 +0.8775046,82,465.4186,5.631184 +0.766783,81,881.4362,5.295545 +0.7614452,2,817.9402,1.668020 +0.8634684,70,977.549,5.45882 +0.6649203,92,541.7072,5.18534 +0.8888453,31,648.309,4.989178 +0.9191742,96,278.8759,5.942768 +0.6181284,38,673.0179,4.442334 +0.5762689,58,465.1237,4.696843 +0.8854675,82,929.2616,5.644522 +0.5881515,8,892.8005,2.978079 +0.5335778,10,528.7554,3.094167 +0.6367293,77,205.4550,5.026452 +0.6616144,75,799.0715,5.030716 +0.6048582,38,636.1787,4.418348 +0.8995238,30,970.224,5.007292 +0.6125322,42,38.40748,4.607011 +0.891409,32,725.0784,5.021755 +0.5125611,13,124.2224,3.320415 +0.8535288,71,96.49186,5.557986 +0.8477504,10,847.9913,3.902614 +0.6988878,32,432.6877,4.470823 +0.6028712,81,661.689,4.984862 +0.6450516,6,527.1702,2.800764 +0.5884289,64,623.1206,4.788881 +0.8519591,94,654.6818,5.625326 +0.5619964,37,966.9962,4.31885 +0.5579332,41,643.9374,4.395229 +0.6932872,91,407.4764,5.235375 +0.8612836,67,490.0358,5.435572 +0.5966854,73,474.3225,4.902069 +0.704552,51,421.4517,4.840551 +0.8476425,22,486.5986,4.572071 +0.7455392,38,414.5594,4.709415 +0.8924924,54,406.7609,5.41228 +0.8657634,48,108.6856,5.306214 +0.8560119,72,307.5698,5.483292 +0.838315,27,158.7666,4.737385 +0.7618864,59,65.95942,5.182572 +0.7062403,37,541.1921,4.597449 +0.5729077,11,26.03542,3.336355 +0.6253862,5,929.4751,2.544401 +0.919899,84,661.6104,5.820895 +0.701458,50,923.4494,4.810711 +0.601871,15,289.9652,3.627385 +0.7481714,48,373.6807,4.893143 +0.7421667,60,804.6881,5.030723 +0.9165294,21,968.5381,4.829235 +0.7708394,93,859.6188,5.399452 +0.6857544,59,108.6902,4.954433 +0.8683556,16,234.4982,4.412145 +0.5154821,4,609.3116,2.01444 +0.8063035,44,448.0451,4.971776 +0.7653335,48,548.0994,4.92658 +0.800019,87,625.9536,5.428938 +0.6377652,28,644.537,4.234561 +0.7187339,44,338.4984,4.763994 +0.6851251,32,243.1097,4.451062 +0.6022412,49,916.9572,4.609347 +0.6934007,23,519.9725,4.189089 +0.6338835,8,207.3362,3.087767 +0.8626223,18,979.8857,4.45892 +0.6755484,73,703.2272,5.038301 +0.8819856,100,183.9347,5.83262 +0.7952068,13,281.5281,3.970075 +0.7492558,34,689.2815,4.626091 +0.689057,83,75.17532,5.240701 +0.7983914,96,711.9366,5.48896 +0.8984775,14,973.5494,4.413143 +0.8141442,39,231.5305,4.924353 +0.927646,55,854.625,5.57916 +0.5626983,30,684.469,4.150555 +0.7940533,28,398.7971,4.597789 +0.8263922,74,727.1975,5.38656 +0.9274736,27,920.6118,5.081359 +0.7471762,63,895.0358,5.07554 +0.7025308,49,451.5482,4.805477 +0.5272053,18,164.8201,3.651766 +0.8319172,40,758.38,4.967654 +0.8407389,92,280.317,5.604963 +0.6721226,40,6.242629,5.294283 +0.6011962,76,675.616,4.935894 +0.5040908,82,219.5354,4.842745 +0.5521607,6,234.1007,2.589530 +0.7266228,24,46.95129,4.402272 +0.8604109,36,333.7737,5.002898 +0.8973122,66,524.181,5.561721 +0.5554781,48,787.1215,4.513639 +0.6098639,53,319.3389,4.691742 +0.8863365,83,519.4829,5.669461 +0.8581715,96,536.0489,5.664068 +0.7726931,98,199.6556,5.481125 +0.7523195,40,783.0637,4.755842 +0.5606664,45,776.2248,4.472297 +0.7087404,100,453.8624,5.328639 +0.7956351,55,504.8159,5.102364 +0.816261,67,773.2044,5.289053 +0.8999163,92,420.2012,5.800766 +0.6197997,3,506.0942,1.878208 +0.6030411,33,786.2126,4.301144 +0.833885,85,995.8172,5.496898 +0.9029965,88,937.1946,5.762388 +0.8393617,64,63.50675,5.494906 +0.9094628,41,121.4946,5.379464 +0.8082,49,983.7319,5.043322 +0.8964454,46,638.3635,5.305559 +0.5779769,61,192.9905,4.749822 +0.8953077,99,750.7118,5.810478 +0.581519,22,535.7868,3.924285 +0.9164601,24,945.2403,4.929528 +0.8705304,55,339.1753,5.344138 +0.7342698,10,61.29176,3.600732 +0.7701855,63,524.8687,5.135257 +0.863639,18,860.5287,4.46405 +0.8513909,79,921.4234,5.501578 +0.9324593,18,963.6303,4.811038 +0.9403725,92,512.2976,6.008025 +0.7510038,16,726.3639,4.016014 +0.6960944,78,175.0947,5.157011 +0.6724534,82,183.5058,5.143424 +0.8803488,29,765.2642,4.901266 +0.9448258,94,209.1915,6.114054 +0.8993888,13,662.1018,4.360755 +0.7814681,54,156.3016,5.093745 +0.740741,3,390.4553,2.222361 +0.6476472,99,141.3868,5.240183 +0.6141115,21,526.9791,3.947356 +0.6393056,31,909.5848,4.318396 +0.8372989,9,87.88783,3.819755 +0.8913588,42,525.3397,5.223824 +0.7460777,97,749.0455,5.375651 +0.5112242,26,501.4006,3.939324 +0.7577458,4,659.9605,2.643840 +0.5752648,35,388.7491,4.302567 +0.69794,61,652.5404,4.95284 +0.9204288,8,829.281,4.062277 +0.8043629,61,921.2296,5.189422 +0.9433404,98,119.9997,6.206997 +0.8913393,73,235.3741,5.64058 +0.5868418,24,200.3035,4.018163 +0.6991804,42,813.9534,4.675992 +0.8727032,28,115.8981,4.919729 +0.9020416,21,939.1495,4.752712 +0.830164,78,445.4839,5.444142 +0.8304871,63,98.00515,5.389406 +0.8657783,67,686.2381,5.443104 +0.870506,51,183.5218,5.322739 +0.8817822,40,470.2017,5.15173 +0.5152709,11,504.1909,3.153231 +0.6023214,34,410.1415,4.328208 +0.708448,17,340.4375,3.970749 +0.9284348,78,900.37,5.811991 +0.8747284,41,79.9742,5.264772 +0.7587422,93,879.5506,5.37222 +0.81904,34,973.761,4.805789 +0.8129114,37,59.32467,4.991653 +0.6677408,14,262.6832,3.706778 +0.5907886,29,692.5856,4.173685 +0.6851459,68,326.6066,5.01713 +0.7346132,39,449.1581,4.702737 +0.6277834,44,188.2139,4.592086 +0.857076,79,228.5752,5.565726 +0.7489966,44,331.7083,4.83284 +0.6398296,58,686.1311,4.805169 +0.7281883,54,245.0005,4.945851 +0.61747,83,262.5449,5.039826 +0.6492152,56,272.5927,4.808709 +0.9269381,25,711.9383,5.025897 +0.7535203,74,871.2197,5.203336 +0.8108911,38,654.9283,4.869824 +0.8137289,82,277.0395,5.448624 +0.8100311,4,870.7871,2.823736 +0.9225277,79,451.9067,5.808043 +0.8175055,83,875.792,5.43713 +0.6985237,65,263.3531,5.016426 +0.8551307,66,156.4809,5.461053 +0.5031995,86,7.001363,5.14592 +0.7062228,81,695.2352,5.170916 +0.9492496,81,170.2286,6.075235 +0.6817957,56,515.211,4.861132 +0.6240201,92,331.1661,5.120305 +0.8650343,61,935.077,5.371217 +0.6146213,88,46.13228,5.165465 +0.9255326,43,735.5249,5.402824 +0.8170676,83,930.0177,5.435128 +0.5741391,5,645.2055,2.424253 +0.6910738,64,560.4809,4.975904 +0.5667899,3,781.4491,1.745705 +0.6861743,41,934.9234,4.630133 +0.8817557,85,164.7456,5.732311 +0.6339924,22,542.5813,4.026713 +0.6946548,5,854.4328,2.720764 +0.7252389,25,47.75734,4.431607 +0.7248704,81,953.853,5.204872 +0.6368351,80,951.1507,5.031408 +0.780265,18,810.2112,4.193673 +0.6341829,34,150.5378,4.406329 +0.9303506,5,552.1346,3.693135 +0.8295861,30,611.3115,4.748776 +0.800437,23,167.5824,4.484621 +0.5951078,87,539.6616,5.024872 +0.6653801,20,549.5701,4.010106 +0.6656014,22,913.4959,4.088659 +0.9053822,25,937.0722,4.901416 +0.8449916,30,823.8114,4.794852 +0.6178617,24,945.78,4.065802 +0.5110322,72,569.7987,4.750247 +0.6529969,92,117.9059,5.207349 +0.9252288,41,941.357,5.363595 +0.9405128,87,402.2649,5.984612 +0.9123847,3,119.6966,3.015796 +0.610349,94,444.4629,5.107595 +0.6394546,96,102.4159,5.218884 +0.706229,86,170.1007,5.248948 +0.7921645,3,803.7297,2.396599 +0.9096007,88,482.1117,5.810334 +0.8948665,73,65.74187,5.824915 +0.931119,68,116.2202,5.876182 +0.9165443,50,655.079,5.459218 +0.6190295,22,607.6026,3.996217 +0.9054205,97,967.335,5.835145 +0.8613796,80,361.8505,5.56635 +0.6320835,95,473.5218,5.151439 +0.6012724,51,913.223,4.638169 +0.5516284,74,14.16722,5.037012 +0.8876435,44,426.4689,5.246741 +0.8209103,26,568.8558,4.612582 +0.7733602,28,610.5125,4.535907 +0.5438819,12,284.5485,3.298577 +0.6699824,89,343.1282,5.179079 +0.7670792,75,877.652,5.243034 +0.856828,73,514.2097,5.477684 +0.6147122,17,344.4332,3.765827 +0.5102219,13,897.3323,3.306147 +0.8687245,52,85.07123,5.408425 +0.6356558,41,655.0069,4.534577 +0.607294,78,252.4761,4.977811 +0.6605997,68,380.34,4.967165 +0.6970468,99,412.926,5.300827 +0.7371676,20,761.8237,4.170572 +0.8613029,48,949.6652,5.191448 +0.7518092,57,25.86171,5.303964 +0.8428192,94,605.0885,5.599075 +0.7754938,22,904.471,4.345341 +0.5720353,82,105.3506,4.975982 +0.8558049,75,827.7432,5.482474 +0.8848964,64,442.2547,5.494559 +0.7725104,63,300.7922,5.154277 +0.6358212,60,676.6013,4.823146 +0.8280062,92,957.2909,5.533657 +0.5019211,18,683.6793,3.596421 +0.7994588,97,325.9287,5.518704 +0.6258279,10,352.8465,3.290894 +0.7595384,81,112.2573,5.354279 +0.898181,89,697.1813,5.755352 +0.5527367,6,865.4217,2.587159 +0.6229918,43,282.1226,4.557137 +0.5935787,90,214.6085,5.060573 +0.8400638,36,883.338,4.91393 +0.7590297,81,421.8259,5.290432 +0.8063303,11,98.57122,3.888847 +0.9430843,5,19.57140,4.149973 +0.6029501,27,792.172,4.136586 +0.5844242,64,290.7809,4.789975 +0.8108061,15,392.7209,4.137662 +0.5286417,14,965.8804,3.412557 +0.5333612,94,692.2099,4.97916 +0.7492556,69,983.1755,5.143672 +0.926265,15,476.2882,4.638733 +0.901209,6,680.2512,3.675874 +0.5610927,42,669.7171,4.419549 +0.5780818,48,396.2899,4.556932 +0.761414,30,31.87208,4.754897 +0.7238886,52,252.8219,4.907474 +0.8668956,6,686.2334,3.499596 +0.6828703,56,660.588,4.86045 +0.930659,17,121.4522,4.836156 +0.503826,12,823.3895,3.215834 +0.7849627,85,525.2481,5.379389 +0.8966239,84,598.0863,5.715069 +0.5897803,74,21.46131,5.072482 +0.5022443,68,429.8997,4.69497 +0.798633,54,655.1404,5.092552 +0.7352211,86,161.5042,5.314463 +0.6972101,3,406.9489,2.089562 +0.7888295,34,949.8539,4.721846 +0.7582605,77,560.0893,5.247737 +0.6223786,75,389.7527,4.968524 +0.6780707,67,432.9265,4.987482 +0.8433638,46,590.8193,5.108756 +0.8183657,29,757.525,4.685691 +0.8324944,20,900.0447,4.436677 +0.7936328,36,495.8806,4.785875 +0.7604421,8,317.4111,3.409744 +0.722952,51,47.86064,5.007258 +0.7312193,80,784.4329,5.211266 +0.7637257,45,218.7267,4.897432 +0.7031336,65,577.7302,5.010621 +0.886668,9,434.1708,3.983958 +0.939302,13,614.371,4.612743 +0.8505232,65,935.7227,5.366438 +0.8110883,48,767.812,5.039261 +0.6221106,48,331.0559,4.638021 +0.9313041,23,79.16897,5.136056 +0.632553,99,572.1408,5.178838 +0.6117593,62,895.7685,4.803032 +0.8212386,84,405.0264,5.471996 +0.5869189,65,147.9002,4.819915 +0.7997307,32,334.5291,4.721025 +0.6555177,53,274.5379,4.77934 +0.5538914,26,130.3128,4.030347 +0.7199913,91,864.055,5.276691 +0.9277619,75,665.7905,5.790155 +0.9266476,91,118.5833,6.043288 +0.8831789,55,14.28143,6.25009 +0.6372527,89,74.82464,5.18037 +0.75038,75,634.4639,5.209853 +0.8406942,28,641.8783,4.731309 +0.8768606,37,974.1806,5.062729 +0.7979076,28,565.2656,4.60292 +0.8365606,35,939.8184,4.881241 +0.7960196,84,160.4486,5.44722 +0.8787808,17,712.3158,4.482225 +0.5333636,32,338.1081,4.155507 +0.647125,32,484.6652,4.363403 +0.8641002,5,411.5565,3.302591 +0.7868153,30,324.2991,4.636093 +0.7962481,54,56.46181,5.23915 +0.8145667,10,880.2147,3.783172 +0.5658414,58,782.1528,4.675848 +0.9341618,51,552.7404,5.579226 +0.6841805,57,138.5348,4.912799 +0.9119638,53,161.4325,5.547657 +0.5188456,27,33.57959,4.037935 +0.757641,73,730.3337,5.205093 +0.9349815,18,982.9337,4.828403 +0.5066024,6,485.5756,2.487666 +0.5979052,67,867.3325,4.836706 +0.8607715,41,775.3904,5.08006 +0.7254145,87,609.8498,5.260913 +0.7255659,100,961.0768,5.351339 +0.5150924,99,445.5918,4.990515 +0.5446147,28,289.2843,4.065534 +0.9469407,99,475.0219,6.103677 +0.7343403,80,926.2906,5.215986 +0.5975759,29,512.1599,4.188007 +0.837378,9,599.9462,3.769414 +0.9442889,59,495.7354,5.749563 +0.8250957,97,715.8522,5.565506 +0.6550313,90,432.9978,5.15527 +0.7075834,9,212.4720,3.386328 +0.7454893,24,390.3709,4.348304 +0.695866,36,249.5993,4.56663 +0.60671,22,336.0653,3.976246 +0.8412084,9,965.9642,3.780548 +0.6861445,46,171.8996,4.746207 +0.9261788,43,673.9801,5.40854 +0.861084,90,308.0283,5.651429 +0.7909505,83,304.5175,5.3931 +0.5625539,3,679.3792,1.735618 +0.647025,10,605.1443,3.335524 +0.921531,93,231.2533,5.948928 +0.9164885,67,188.4395,5.720053 +0.7676392,83,989.0182,5.31298 +0.5940685,10,497.944,3.220156 +0.8676697,32,789.5488,4.924061 +0.7076742,29,67.17613,4.479062 +0.6318245,52,265.5441,4.720642 +0.571069,65,8.232299,5.137 +0.7430801,81,823.1498,5.244276 +0.7164226,8,284.3927,3.288375 +0.5729531,38,622.0593,4.361272 +0.5541727,55,264.4454,4.62462 +0.948875,15,670.5908,4.803963 +0.768947,100,119.684,5.521015 +0.921052,46,131.9058,5.519767 +0.568908,55,421.9705,4.64489 +0.5640359,47,556.3127,4.513669 +0.6904132,68,801.1595,5.014499 +0.6086555,12,922.6924,3.426733 +0.6123029,39,873.346,4.450664 +0.5088076,91,517.9313,4.919105 +0.87053,35,798.1675,5.000599 +0.8372315,14,616.9215,4.161282 +0.8365753,44,889.9804,5.049199 +0.6835763,100,733.1015,5.273686 +0.7802409,41,47.49915,5.001162 +0.7647672,98,640.1398,5.425595 +0.9454551,71,637.387,5.869999 +0.8679253,35,22.26791,5.454062 +0.7313009,100,178.5980,5.40588 +0.6704843,23,444.0414,4.141148 +0.659972,35,880.514,4.455541 +0.7058613,44,697.5712,4.726399 +0.762979,66,935.1429,5.143505 +0.7887987,58,50.98269,5.287288 +0.8073858,99,622.5568,5.534763 +0.6100832,79,867.3335,4.977132 +0.544471,3,459.738,1.692861 +0.8465874,95,196.6390,5.666055 +0.683948,55,459.1472,4.853582 +0.9185709,49,650.7622,5.456321 +0.5765227,5,679.4412,2.429649 +0.6383592,62,148.6722,4.880552 +0.6025905,56,325.3961,4.720113 +0.8848486,97,97.54827,5.90136 +0.7362832,26,218.8576,4.402630 +0.5784452,59,492.3637,4.71295 +0.6147081,36,333.0535,4.399336 +0.6825984,7,352.4882,3.06174 +0.9282963,26,169.3765,5.122438 +0.7680785,6,227.9232,3.141793 +0.5355871,43,347.3572,4.398321 +0.6693587,54,436.3146,4.812174 +0.773232,92,549.7613,5.404733 +0.6195498,69,980.2326,4.894582 +0.8400778,99,893.5253,5.617641 +0.9255642,70,761.4745,5.729276 +0.9080847,82,792.9793,5.742875 +0.522612,6,565.2858,2.521984 +0.6417358,47,183.7160,4.670733 +0.7013078,51,383.2288,4.83544 +0.7069545,56,436.4764,4.914058 +0.8542498,80,547.3648,5.529451 +0.509647,4,174.7376,2.004169 +0.934806,45,835.8438,5.488301 +0.7056071,4,688.9132,2.487025 +0.5115704,38,343.0629,4.258021 +0.8745496,20,267.9963,4.615004 +0.7428874,92,849.7082,5.331239 +0.624939,92,874.5263,5.110626 +0.8117291,78,619.3193,5.385168 +0.7642174,66,806.5085,5.147957 +0.5821417,25,235.8559,4.041735 +0.8256269,52,266.7959,5.164253 +0.882332,73,784.2244,5.558549 +0.6688183,56,96.3575,4.885902 +0.708993,92,537.4415,5.268645 +0.8660636,24,719.5138,4.701973 +0.5982325,52,796.4927,4.648324 +0.7785366,68,250.1605,5.229993 +0.8040057,6,204.6433,3.262558 +0.7114325,15,137.4441,3.885444 +0.918715,91,280.5756,5.905105 +0.77819,59,306.9236,5.120643 +0.7177611,89,459.1009,5.265906 +0.8641408,80,883.2309,5.552217 +0.5843685,24,252.8853,4.010388 +0.8850618,47,743.1372,5.269393 +0.5108136,14,170.1100,3.385231 +0.6256445,95,433.2858,5.141522 +0.8231917,79,441.6427,5.433135 +0.640841,20,919.4517,3.956233 +0.7994082,23,379.5856,4.457961 +0.8731463,64,95.10218,5.562394 +0.6484933,79,495.9768,5.049098 +0.5221934,40,259.5452,4.319939 +0.8810941,68,133.8570,5.596386 +0.5679002,35,538.902,4.287083 +0.8011864,2,146.2337,1.825452 +0.7634377,45,64.61275,4.981885 +0.9138625,24,81.08869,5.048115 +0.8308868,100,747.8617,5.600978 +0.9327479,50,626.0069,5.553264 +0.93067,33,997.0507,5.243978 +0.7921992,82,626.1785,5.369069 +0.6689989,8,817.166,3.162716 +0.8045147,78,872.6406,5.360772 +0.9334461,16,676.6,4.731911 +0.5758246,17,405.8145,3.686859 +0.9492571,89,128.8834,6.178498 +0.7000412,73,409.276,5.09306 +0.7811956,82,837.8587,5.33799 +0.6075243,33,233.9159,4.320678 +0.6513116,24,423.5256,4.137315 +0.7313515,14,853.3903,3.847889 +0.8564085,22,693.0677,4.598462 +0.7045416,63,136.4036,5.031386 +0.8711795,30,532.752,4.895991 +0.8020238,93,548.076,5.481821 +0.7703214,78,15.85805,5.814334 +0.6343191,27,128.4217,4.22205 +0.5738696,66,728.534,4.786255 +0.5966273,62,174.4677,4.797729 +0.6545792,88,954.4501,5.130017 +0.9350415,76,378.4156,5.864486 +0.8698155,88,643.2018,5.641198 +0.7418213,57,397.9183,5.003477 +0.6666204,16,693.6469,3.816609 +0.939269,32,410.4561,5.301479 +0.9056354,75,338.3497,5.70178 +0.7204378,96,104.8828,5.387561 +0.7352106,34,780.4859,4.592326 +0.604017,95,810.4942,5.098799 +0.5039632,100,229.6094,4.986289 +0.6678024,57,352.7455,4.852644 +0.6667347,61,620.592,4.892999 +0.7025512,35,866.2715,4.542347 +0.5823673,29,788.9539,4.157619 +0.7236481,100,242.7644,5.375992 +0.5487022,92,974.0744,4.986154 +0.5448123,5,572.2373,2.357788 +0.731591,73,525.9038,5.153309 +0.7486298,69,940.0264,5.142729 +0.8496939,32,712.1147,4.861084 +0.6722585,5,501.8601,2.663167 +0.5801296,69,207.4424,4.844236 +0.7432576,62,787.7531,5.056841 +0.6214598,33,23.85876,4.484477 +0.7875473,58,213.6908,5.145776 +0.642812,29,521.653,4.274674 +0.5335032,4,930.6728,2.055084 +0.7630798,81,908.8545,5.286844 +0.7369504,28,922.611,4.442898 +0.6428282,27,484.1696,4.216783 +0.6357108,74,283.3895,4.988065 +0.7164243,78,447.3305,5.171399 +0.7709437,55,372.3491,5.046897 +0.6852679,28,335.7585,4.338118 +0.808534,58,340.6183,5.184588 +0.7136241,62,718.4628,4.995206 +0.8177113,80,915.472,5.412148 +0.8319302,87,626.84,5.514708 +0.7422361,93,405.5656,5.349856 +0.6930993,81,146.8204,5.185964 +0.8682528,58,844.0453,5.349434 +0.7270226,100,424.7374,5.366699 +0.7914932,61,688.2172,5.160086 +0.5900729,27,767.5824,4.112602 +0.7003193,89,642.763,5.226167 +0.6651674,74,857.3294,5.027037 +0.7184364,63,284.3633,5.033157 +0.8324358,41,342.2922,5.003632 +0.5031346,67,438.8357,4.685145 +0.5825579,41,785.6322,4.437242 +0.7942139,23,211.6097,4.457539 +0.845134,6,783.0932,3.404465 +0.6857612,48,137.6217,4.786544 +0.7278745,10,717.0041,3.530233 +0.5885082,82,145.7116,4.994707 +0.6388615,30,770.114,4.291878 +0.926036,14,461.9188,4.58259 +0.6847766,27,422.8900,4.304487 +0.752521,85,811.802,5.298064 +0.7488061,63,189.1322,5.115276 +0.6599034,73,59.11036,5.103032 +0.6267682,35,710.3962,4.392984 +0.932423,92,361.4332,5.974252 +0.5922226,21,432.1012,3.905775 +0.8041683,90,853.5206,5.457261 +0.8005206,44,587.8442,4.950966 +0.927466,9,107.028,4.281798 +0.8202604,62,634.5662,5.249415 +0.803947,75,605.6371,5.33821 +0.6912899,47,671.1496,4.746582 +0.8335924,21,559.5399,4.484684 +0.5509898,3,283.7228,1.709308 +0.8715196,51,212.7831,5.317158 +0.6696205,18,518.5567,3.928592 +0.5242603,30,218.4836,4.089194 +0.609197,84,56.53437,5.101272 +0.7185949,92,848.8469,5.281629 +0.7343257,73,626.3547,5.156428 +0.865474,56,506.3368,5.32564 +0.5027801,93,974.2632,4.922927 +0.7855868,21,950.671,4.334514 +0.6107691,81,541.3309,5.000013 +0.5547765,49,494.3407,4.53091 +0.7692043,88,362.1617,5.375039 +0.9403376,49,752.7243,5.585192 +0.829064,60,478.2757,5.257702 +0.8601706,25,166.6052,4.754331 +0.6196904,43,304.0243,4.549829 +0.5717478,25,858.482,4.013487 +0.693023,20,335.4159,4.075407 +0.8598185,31,330.6993,4.889496 +0.6915085,37,69.03833,4.636358 +0.8468429,85,300.6356,5.567331 +0.5777309,21,91.25657,3.900269 +0.5987378,42,114.1785,4.513828 +0.564499,18,18.32179,3.827946 +0.628622,71,219.1825,4.950753 +0.9445081,23,707.8417,5.088072 +0.9388601,19,386.5834,4.917079 +0.8643879,47,592.6865,5.195143 +0.7737825,21,473.8053,4.309089 +0.7264336,9,615.857,3.425729 +0.9412087,84,400.5238,5.967095 +0.7427203,48,997.1332,4.867639 +0.7715587,85,657.4747,5.343616 +0.6399763,7,534.5213,2.955814 +0.6063786,26,711.9156,4.112105 +0.7256356,78,949.8124,5.18012 +0.6477573,47,895.3827,4.66007 +0.7986201,31,18.21264,5.083396 +0.750134,88,414.8571,5.328381 +0.5923543,14,92.57298,3.560902 +0.6832271,73,685.9445,5.053047 +0.7574562,43,151.873,4.863263 +0.677596,100,414.4082,5.270896 +0.6682776,89,907.168,5.162828 +0.9330502,96,284.6103,6.02071 +0.5842748,51,469.3508,4.612856 +0.8787779,81,401.5259,5.633028 +0.7580647,77,669.1351,5.244463 +0.8872826,87,650.057,5.6979 +0.8779282,62,661.6712,5.435085 +0.8914228,41,453.3747,5.2109 +0.9347915,49,936.5544,5.543634 +0.6613053,84,493.9254,5.116008 +0.5915268,55,993.0702,4.678128 +0.8180775,53,480.8366,5.137994 +0.558241,47,382.5659,4.506435 +0.682103,52,725.278,4.803213 +0.6710785,10,970.0457,3.389202 +0.5560348,45,16.90907,4.62216 +0.9401617,69,134.6376,5.927962 +0.9492752,16,819.697,4.853928 +0.8111686,82,99.48363,5.516021 +0.6539134,70,355.3463,4.976903 +0.6973646,87,273.2096,5.221455 +0.584519,33,907.0917,4.266788 +0.661414,45,753.884,4.653987 +0.691314,98,431.7889,5.281952 +0.9053537,70,284.3603,5.663525 +0.878904,92,177.3085,5.767757 +0.940425,74,634.511,5.861479 +0.6773772,9,36.89003,3.370417 +0.938145,71,9.568438,7.736828 +0.7049552,62,308.9711,4.991195 +0.768903,88,218.1471,5.393243 +0.8924252,18,442.2652,4.597484 +0.5605281,42,973.999,4.41706 +0.5675563,35,394.8235,4.288579 +0.9314867,64,990.4558,5.699404 +0.854969,56,221.3102,5.320816 +0.6154144,90,419.8957,5.08615 +0.5046474,5,929.2128,2.267940 +0.8938657,91,747.1564,5.750207 +0.5461269,34,592.0258,4.224583 +0.7374015,33,34.94556,4.743901 +0.7812415,44,585.6939,4.900668 +0.5854985,20,73.7051,3.879755 +0.8041685,56,485.833,5.138593 +0.6455867,67,134.8849,4.95596 +0.8334194,32,323.5623,4.823296 +0.6835554,33,248.6061,4.471775 +0.9274518,41,204.8720,5.435482 +0.7580894,12,390.4757,3.785481 +0.8234953,30,705.3142,4.727986 +0.5803942,47,998.7147,4.538939 +0.6302062,50,22.45701,4.863313 +0.7932594,59,29.19641,5.444473 +0.5677228,11,340.1472,3.260991 +0.5143458,70,301.0236,4.738882 +0.8996777,5,36.72852,3.613945 +0.6948788,20,59.8754,4.139033 +0.801904,3,17.53048,2.547548 +0.825884,3,362.6367,2.532459 +0.5641203,41,378.8667,4.409494 +0.6206331,82,59.89471,5.102902 +0.9020196,82,488.3076,5.728979 +0.5772379,11,192.7502,3.284991 +0.7854763,15,719.8687,4.054453 +0.5661362,5,326.2423,2.407589 +0.855098,90,987.4242,5.598997 +0.9094228,17,314.8952,4.647975 +0.9105804,14,822.2919,4.479334 +0.6425095,19,776.2866,3.915952 +0.5800772,23,751.0009,3.958348 +0.8283034,40,306.9341,4.975931 +0.8694394,12,63.79335,4.252581 +0.9487476,13,927.253,4.68589 +0.8891563,27,416.9288,4.897393 +0.6400752,35,650.9308,4.418827 +0.930565,77,427.6444,5.839496 +0.6607416,84,480.9301,5.115355 +0.7374158,21,360.8883,4.219661 +0.7214416,90,627.8624,5.275888 +0.6634831,52,242.9271,4.783196 +0.633519,51,832.0138,4.696118 +0.867209,15,101.3933,4.396753 +0.7320115,44,304.3464,4.795765 +0.8916781,51,853.781,5.351103 +0.6815065,32,698.7288,4.429519 +0.7062608,20,411.6185,4.103026 +0.6216569,94,854.663,5.120379 +0.7749632,17,886.286,4.130346 +0.7489943,51,669.2371,4.930199 +0.8960939,30,605.3457,4.998742 +0.541271,5,803.5865,2.349337 +0.883344,83,878.3484,5.645366 +0.6615822,19,616.9031,3.957096 +0.8645687,14,451.1396,4.269158 +0.8197885,44,745.7335,5.001257 +0.9105769,22,975.8806,4.831691 +0.8194167,33,518.502,4.792544 +0.8237274,11,263.2219,3.915241 +0.8786824,38,564.1758,5.09802 +0.9028904,65,866.5719,5.564251 +0.7634663,45,909.7111,4.868551 +0.9061444,11,340.5835,4.267836 +0.727566,31,405.0189,4.510243 +0.5869022,53,742.01,4.643569 +0.6267716,82,756.8724,5.033235 +0.6941218,49,674.2737,4.783475 +0.6440676,72,403.9489,4.977191 +0.7643208,80,940.397,5.28069 +0.8215134,91,962.321,5.508477 +0.7344723,70,929.2222,5.122587 +0.6420764,9,405.7842,3.221721 +0.9224962,33,907.7449,5.196097 +0.92215,42,604.9682,5.371616 +0.9473083,16,808.4234,4.83695 +0.6679534,10,297.2999,3.388319 +0.8085884,87,391.1016,5.462548 +0.7428786,94,208.0541,5.381112 +0.7319898,77,842.6398,5.18538 +0.8264745,54,333.4286,5.185714 +0.8906358,42,879.7977,5.210706 +0.7497273,88,757.6578,5.316739 +0.9363728,93,740.3891,5.97637 +0.5203183,4,5.041769,2.183347 +0.648732,17,203.3104,3.843603 +0.5029027,20,757.0614,3.693276 +0.8637881,78,296.9534,5.566156 +0.9129572,14,146.4340,4.545495 +0.6906615,40,257.9211,4.636827 +0.8834442,74,793.7916,5.571652 +0.7800757,21,4.930221,5.522151 +0.867441,17,116.9928,4.49343 +0.6881186,70,684.5632,5.032408 +0.5881212,52,243.6473,4.642358 +0.8899165,62,666.8032,5.482087 +0.7845255,90,713.7938,5.411659 +0.6786644,72,575.786,5.036507 +0.7749491,79,740.7498,5.299343 +0.6163517,50,402.6808,4.656188 +0.7617745,100,408.036,5.442128 +0.9361814,46,508.8477,5.525133 +0.7015941,74,770.7665,5.096961 +0.7794969,72,594.9117,5.249219 +0.642179,74,748.8859,4.986675 +0.5983462,52,171.4239,4.667948 +0.6005191,47,615.7238,4.576628 +0.8843986,22,501.1241,4.715799 +0.7008892,25,449.2083,4.275913 +0.52497,38,860.323,4.276883 +0.622708,53,19.02061,4.92084 +0.5727642,77,157.0283,4.918638 +0.7725483,86,575.0621,5.356232 +0.6069527,16,346.6407,3.695274 +0.7587479,48,168.0675,4.944474 +0.7360718,62,721.5008,5.04224 +0.8545806,40,658.2835,5.043252 +0.8961155,80,809.8722,5.67364 +0.6650538,14,150.3996,3.709953 +0.939034,30,475.0172,5.248813 +0.6833314,42,302.3655,4.655899 +0.6175995,45,685.2173,4.573027 +0.6677279,28,314.8646,4.302073 +0.7154529,21,892.7738,4.15897 +0.6333697,2,961.5814,1.277359 +0.5898549,7,320.5183,2.842989 +0.6582885,95,405.8774,5.200164 +0.510954,70,611.108,4.728801 +0.9055901,74,428.1937,5.68225 +0.8400673,54,58.62375,5.384523 +0.734939,62,260.0854,5.060028 +0.52751,44,515.2361,4.400222 +0.5424423,48,149.0962,4.507725 +0.7204047,77,301.1897,5.179545 +0.9272841,13,550.2231,4.527436 +0.6945376,15,446.9727,3.824939 +0.5553579,44,411.7695,4.449252 +0.7173361,87,997.4134,5.238975 +0.6202049,47,794.0686,4.610215 +0.8752933,3,974.2505,2.761596 +0.8339996,63,286.8030,5.323071 +0.6327848,42,810.0312,4.546531 +0.6340459,45,269.9277,4.613969 +0.866857,19,677.0124,4.522703 +0.7734467,59,643.4308,5.093006 +0.8982833,96,211.7656,5.862206 +0.6749493,21,304.4563,4.078275 +0.7511355,60,202.4649,5.082362 +0.742047,77,48.54489,5.371515 +0.6776796,63,789.4974,4.935029 +0.855732,27,571.1547,4.757314 +0.8018288,57,777.9217,5.137002 +0.7331972,22,51.23239,4.336138 +0.6569014,73,102.1165,5.055507 +0.7537886,29,154.4731,4.546038 +0.8012184,81,740.0648,5.38049 +0.8549478,54,546.232,5.262064 +0.8976285,61,231.4609,5.546494 +0.8834517,6,628.3206,3.580245 +0.6746422,89,548.0865,5.179786 +0.8358614,9,451.8896,3.766575 +0.8406225,57,762.0856,5.247538 +0.9481807,28,293.3038,5.290238 +0.5388981,3,598.9741,1.679330 +0.9480118,73,445.4003,5.920966 +0.8536345,98,30.87349,6.077053 +0.8899995,11,376.5903,4.180464 +0.9368585,82,236.7299,5.957222 +0.9390339,94,494.9168,6.014249 +0.5705278,3,303.2342,1.756266 +0.8376015,31,126.5897,4.857314 +0.5003688,16,621.8171,3.485094 +0.6873293,59,652.178,4.907611 +0.6599451,24,221.4411,4.164048 +0.9088598,39,815.7084,5.243244 +0.8031311,5,669.6773,3.052888 +0.9491043,10,996.9979,4.475921 +0.9290567,72,727.5371,5.768695 +0.7602706,12,188.8118,3.803644 +0.8416336,15,220.5798,4.255509 +0.9339155,19,4.776814,7.721867 +0.7953252,3,625.1871,2.409029 +0.7715417,90,690.4963,5.381861 +0.7641226,14,915.3901,3.933091 +0.5798988,52,903.444,4.616092 +0.8216424,11,951.3616,3.893048 +0.5785521,6,71.00523,2.661841 +0.8724881,87,714.1226,5.640678 +0.8948278,35,337.652,5.121659 +0.7871695,53,50.68324,5.213849 +0.7097965,5,905.984,2.761924 +0.9192579,88,4.904059,9.408779 +0.8199713,94,854.027,5.527674 +0.9406058,18,479.2811,4.882971 +0.893909,87,899.2716,5.717317 +0.650764,81,712.7453,5.067031 +0.5889707,18,383.5385,3.764445 +0.8529372,77,924.1236,5.489221 +0.609893,96,440.4276,5.12181 +0.531659,100,637.8155,5.021182 +0.7622855,12,853.1681,3.790901 +0.5062748,27,854.2535,3.961283 +0.6536989,51,892.0227,4.732863 +0.5918758,87,181.1760,5.037371 +0.8949669,90,866.063,5.744409 +0.7391464,22,531.6416,4.257614 +0.6058422,56,816.772,4.717399 +0.6916805,84,483.5835,5.173199 +0.7928663,65,677.2386,5.208507 +0.799502,84,632.8621,5.403581 +0.647877,88,237.0035,5.138919 +0.6310709,41,682.083,4.525733 +0.7535243,52,206.0863,4.982394 +0.842538,27,105.2609,4.78065 +0.9368387,36,790.4721,5.349369 +0.7363599,16,303.7005,3.987744 +0.6187289,6,904.779,2.736695 +0.7830982,75,54.84483,5.450532 +0.7057671,57,511.7964,4.922182 +0.8533923,24,698.5605,4.655287 +0.5684159,6,224.2865,2.626111 +0.6368277,55,697.6601,4.760043 +0.8902097,96,699.0142,5.771775 +0.73018,27,826.1295,4.398932 +0.7229493,27,810.7536,4.382487 +0.5890476,3,9.206372,1.889919 +0.6626262,57,311.4022,4.84493 +0.8247307,39,750.575,4.927463 +0.862285,61,599.7255,5.369646 +0.8596518,72,146.6928,5.543895 +0.6842161,72,170.3721,5.076099 +0.6330123,41,248.7231,4.54117 +0.7745,49,151.7156,5.005232 +0.5936884,35,572.1413,4.333129 +0.8357376,16,500.1788,4.271279 +0.51271,7,73.56993,2.686149 +0.6896422,15,463.5934,3.813312 +0.7443422,66,119.7634,5.164269 +0.8847271,62,525.1662,5.467059 +0.8533142,83,457.8641,5.556159 +0.9428908,31,915.307,5.28519 +0.7709193,41,914.0045,4.817427 +0.8091848,52,419.4211,5.102556 +0.7552535,16,49.63281,4.120643 +0.8687983,67,938.1444,5.44823 +0.7432566,33,646.8512,4.589547 +0.8600137,50,840.1946,5.217403 +0.7541783,34,157.5049,4.672121 +0.689819,8,177.5935,3.225273 +0.7587453,60,558.5484,5.07267 +0.9248554,40,357.1488,5.370525 +0.6697601,13,584.2735,3.636448 +0.6823748,8,271.6928,3.201521 +0.6981148,18,939.7967,3.988303 +0.889497,85,990.792,5.682722 +0.7092462,16,209.8601,3.92723 +0.6301518,51,804.4977,4.690217 +0.5037445,11,289.3195,3.132128 +0.8170627,88,197.9134,5.523932 +0.5186405,43,333.365,4.369594 +0.7309547,4,567.6746,2.561449 +0.8606785,93,217.5858,5.691876 +0.8870742,2,740.502,2.244443 +0.8995338,84,34.00486,6.173225 +0.7740336,48,913.8893,4.941309 +0.8933359,37,627.4083,5.138033 +0.7583827,18,540.0579,4.138342 +0.6642341,11,250.0934,3.473574 +0.6526306,21,904.9387,4.022325 +0.9433407,25,150.4380,5.214132 +0.7412913,88,924.085,5.296476 +0.8818567,65,24.57030,6.015878 +0.748409,24,914.8858,4.346754 +0.8659564,86,474.0914,5.620953 +0.6847987,20,913.508,4.049003 +0.8728599,58,771.6419,5.367578 +0.8868516,87,574.9383,5.69949 +0.6116315,82,41.29352,5.117752 +0.9496053,60,998.339,5.781189 +0.9210157,5,880.3966,3.619327 +0.7488685,100,154.2452,5.453751 +0.792422,57,997.3951,5.10985 +0.7057241,20,909.2889,4.095626 +0.9060405,48,457.6723,5.388283 +0.8020144,14,799.7226,4.043229 +0.9114372,53,694.1402,5.471555 +0.6164202,10,699.8877,3.267098 +0.8557893,32,968.0013,4.878456 +0.6859665,62,220.2631,4.961493 +0.8556446,79,460.6411,5.530325 +0.7087365,37,18.42120,4.892413 +0.6066091,48,832.439,4.601762 +0.737552,90,976.363,5.303552 +0.8328863,79,368.9973,5.466714 +0.5687865,60,950.4368,4.705405 +0.9128557,79,511.2905,5.753497 +0.7816981,19,371.8202,4.251545 +0.7339682,93,749.6793,5.321598 +0.9017031,93,407.8017,5.816921 +0.5868505,36,739.4715,4.341942 +0.8923477,82,594.2587,5.681646 +0.8414654,14,493.1889,4.179133 +0.8589573,18,553.6746,4.451215 +0.7069543,76,343.5581,5.139243 +0.5513179,37,41.46768,4.362217 +0.7954259,47,799.2324,4.981373 +0.9280813,3,747.2373,3.110425 +0.6391395,31,156.1447,4.340451 +0.508044,68,273.9174,4.707716 +0.6902827,52,682.7568,4.819914 +0.6414225,32,371.048,4.354987 +0.8544067,47,613.95,5.159753 +0.6471667,27,614.637,4.223626 +0.879826,52,65.41423,5.501719 +0.7318367,9,756.8057,3.439061 +0.6710358,99,823.9917,5.242706 +0.6586583,79,203.5998,5.08643 +0.9153481,65,145.8204,5.718992 +0.9045708,39,518.867,5.231822 +0.9182237,4,293.8663,3.375961 +0.6201512,91,958.31,5.094233 +0.531135,5,679.083,2.326895 +0.6544671,79,801.718,5.054843 +0.5949144,18,452.2243,3.775143 +0.7362622,80,828.845,5.22116 +0.7638218,92,458.6902,5.387075 +0.9012236,87,312.5676,5.784071 +0.7628684,94,537.0887,5.396255 +0.7550078,19,982.6065,4.170556 +0.6672037,77,32.73787,5.236582 +0.805925,75,779.1546,5.339145 +0.5541851,23,465.4516,3.912125 +0.7172208,65,536.8639,5.040288 +0.7138174,61,829.1607,4.982435 +0.6165516,36,703.632,4.396356 +0.7870262,30,985.7532,4.620939 +0.7912173,9,89.4149,3.652351 +0.6588602,81,851.9986,5.080004 +0.8534626,15,235.5219,4.298059 +0.5417177,97,37.93112,5.095782 +0.7268279,98,840.1265,5.341517 +0.8217522,99,139.2584,5.644923 +0.6615135,73,271.7089,5.027002 +0.8379693,14,933.443,4.160273 +0.6898353,78,174.3968,5.144343 +0.9456171,63,372.4586,5.81557 +0.9227115,69,630.8074,5.708987 +0.6673543,62,413.4679,4.911183 +0.7727943,24,809.3736,4.409296 +0.6507278,29,359.3616,4.294149 +0.6849543,82,693.828,5.13863 +0.5105532,4,978.4382,2.002822 +0.8235352,74,327.0553,5.398906 +0.5910593,46,855.208,4.541509 +0.6297961,8,967.5094,3.0706 +0.607688,8,471.5654,3.022891 +0.7571063,34,70.40006,4.733643 +0.791352,77,404.1305,5.333374 +0.9173874,79,271.0829,5.807408 +0.6797923,28,496.1202,4.321795 +0.7953507,57,596.6884,5.124088 +0.850552,70,335.183,5.442296 +0.7431803,94,839.5868,5.346693 +0.6440024,15,983.9204,3.708547 +0.7837544,62,560.4449,5.155577 +0.836111,68,626.0255,5.359618 +0.5484813,12,157.0824,3.312683 +0.7455065,23,808.4312,4.305929 +0.7591955,36,486.1776,4.698127 +0.8779367,58,330.3594,5.410352 +0.593193,36,840.8998,4.352766 +0.6269665,44,889.8402,4.57122 +0.8868482,77,174.344,5.680853 +0.752801,62,114.1809,5.142559 +0.8743457,45,570.4405,5.201879 +0.7211467,83,22.77365,5.534706 +0.6912285,50,179.5001,4.818787 +0.6746614,56,25.13000,5.057343 +0.8218585,18,350.1895,4.328555 +0.5137584,21,501.476,3.757731 +0.740062,100,295.5024,5.403938 +0.5987175,12,829.5367,3.406227 +0.6969432,24,777.029,4.229027 +0.8577518,90,243.7531,5.652591 +0.8004673,42,774.9877,4.912852 +0.7565447,100,561.181,5.423456 +0.5786212,70,75.22302,4.885775 +0.6195509,93,718.8692,5.110625 +0.788771,62,282.489,5.185677 +0.843245,44,575.6044,5.076896 +0.8157837,54,697.1208,5.137986 +0.8604531,98,792.4643,5.675903 +0.6037213,44,714.739,4.530425 +0.851184,33,819.7258,4.887258 +0.8473872,72,448.4953,5.441543 +0.5858104,70,778.5424,4.849169 +0.9012477,98,237.0837,5.880302 +0.6218494,86,359.1172,5.067211 +0.8382145,40,276.6088,5.01096 +0.7575617,45,487.4906,4.862268 +0.93472,74,982.2397,5.813632 +0.787328,48,72.26743,5.087387 +0.8512459,29,552.8546,4.79632 +0.719967,9,908.876,3.407101 +0.5877352,78,208.0282,4.947623 +0.8423043,79,600.2308,5.481344 +0.8392067,94,731.9999,5.584333 +0.5623799,49,16.30969,4.714975 +0.647799,9,46.71102,3.279418 +0.5288595,42,715.873,4.364200 +0.789742,2,784.4931,1.773259 +0.756642,43,649.7852,4.822198 +0.7764437,50,46.35313,5.150306 +0.6674194,85,991.1572,5.128339 +0.906969,11,130.1505,4.311036 +0.7518938,70,334.027,5.177749 +0.528787,18,255.6916,3.650907 +0.8252282,19,343.1041,4.384494 +0.6891648,17,884.256,3.918804 +0.8468115,2,649.4154,2.022372 +0.7624286,95,693.2675,5.398028 +0.7566833,68,228.3779,5.180752 +0.606168,29,811.7703,4.20159 +0.7548573,73,552.7757,5.203042 +0.820666,22,518.8606,4.481232 +0.6412007,32,405.3414,4.353561 +0.6027521,20,49.8559,3.934375 +0.734133,2,519.9769,1.575193 +0.7532216,43,924.8756,4.810621 +0.6853911,8,475.9357,3.204962 +0.9023783,19,398.6669,4.691687 +0.6758605,20,864.8661,4.029875 +0.7751433,11,661.0047,3.749591 +0.9425368,54,73.00199,5.890914 +0.8177478,11,295.5029,3.892388 +0.9261527,6,245.4474,3.854764 +0.8882492,35,651.1299,5.075141 +0.7468783,15,779.9176,3.948789 +0.5808538,17,480.0077,3.695823 +0.646268,20,723.2668,3.968426 +0.8976664,49,352.3127,5.372937 +0.7144762,39,539.7912,4.655678 +0.6694488,42,295.7246,4.628144 +0.7095104,34,871.5172,4.534577 +0.7675866,27,495.3648,4.49496 +0.6749292,82,737.8624,5.11927 +0.6683889,73,588.4477,5.026845 +0.5178061,22,718.1896,3.805074 +0.8245529,83,284.1121,5.48635 +0.6444938,35,864.6639,4.425571 +0.8060923,99,924.1675,5.52485 +0.7776994,25,816.9563,4.454753 +0.828381,4,362.6857,2.899921 +0.5356391,36,859.755,4.251434 +0.8132802,64,617.6336,5.252743 +0.5805669,32,734.2547,4.235485 +0.9149193,84,749.9509,5.792419 +0.6743994,95,277.3819,5.238203 +0.6252865,70,618.6787,4.918297 +0.803131,72,856.4609,5.302494 +0.6792797,28,90.66852,4.363507 +0.6178848,99,391.6746,5.158681 +0.6664492,99,552.1533,5.238936 +0.8704619,81,12.83819,6.593567 +0.9337554,76,194.8326,5.904346 +0.8441718,83,870.5995,5.51324 +0.7154217,49,367.0998,4.836076 +0.6672896,69,241.8273,5.000109 +0.6678378,94,974.4227,5.199604 +0.9408869,5,481.7649,3.783829 +0.6264312,10,93.73413,3.310071 +0.8699315,11,891.6617,4.077148 +0.6533887,78,550.6135,5.047538 +0.6871648,79,37.89538,5.28403 +0.8278326,41,55.32326,5.136375 +0.9007479,44,384.0775,5.308271 +0.9045541,84,87.16014,5.916201 +0.8465129,89,655.0107,5.572192 +0.6095092,56,275.0738,4.735062 +0.9337829,54,80.79501,5.798131 +0.5302162,22,841.8739,3.827253 +0.5068682,95,214.3008,4.954852 +0.6540878,49,531.6365,4.70768 +0.6909439,5,327.8551,2.714410 +0.9104148,32,848.5844,5.109452 +0.8152395,98,935.9499,5.541505 +0.6585675,64,568.535,4.913769 +0.8293236,13,607.8378,4.070081 +0.5164619,89,81.7367,4.943977 +0.6309601,3,53.40032,1.923181 +0.799725,79,833.1201,5.357887 +0.7794195,24,916.7622,4.425833 +0.8949443,27,301.5564,4.934083 +0.6930091,17,21.62224,4.103417 +0.6977771,22,386.8469,4.16481 +0.5475462,18,802.1444,3.681317 +0.5114595,92,272.2015,4.93625 +0.931486,73,945.969,5.78597 +0.7490772,68,791.3002,5.135225 +0.6596451,64,343.5261,4.922892 +0.8957032,94,16.72671,6.692282 +0.6923005,77,120.6771,5.158418 +0.9456358,24,780.0273,5.126279 +0.9438894,21,83.76159,5.157231 +0.7175115,80,626.8248,5.186013 +0.5829018,31,361.2286,4.218319 +0.5901643,22,676.4985,3.93967 +0.8064658,90,648.7313,5.467642 +0.6136763,38,743.9136,4.433546 +0.7821613,16,550.7289,4.102733 +0.8085253,86,214.4748,5.479572 +0.505325,97,299.8038,4.963743 +0.8778521,73,575.0015,5.548593 +0.6573341,79,166.5853,5.09082 +0.7532538,17,719.9617,4.073974 +0.8126741,98,959.151,5.534472 +0.617485,78,992.0062,4.979724 +0.7294307,42,842.8008,4.740066 +0.8311411,11,255.2206,3.942211 +0.7310049,3,64.00663,2.210547 +0.9218966,22,24.38936,5.372905 +0.6959823,13,281.8103,3.703621 +0.872274,7,286.046,3.68672 +0.8091158,6,714.5453,3.268219 +0.7140248,28,426.8686,4.397771 +0.7445735,34,30.09128,4.818709 +0.7104637,86,508.2352,5.2256 +0.7407903,73,839.1437,5.166587 +0.9153352,65,522.6144,5.636264 +0.688166,29,238.4367,4.378873 +0.6463528,11,613.1541,3.426388 +0.7123388,62,470.368,4.998166 +0.8895104,85,770.6312,5.687503 +0.5782297,59,402.029,4.714427 +0.829497,28,701.8173,4.693881 +0.5709144,36,853.1903,4.312955 +0.7069504,70,685.5334,5.069301 +0.8335032,53,856.0943,5.173089 +0.5544132,8,676.0023,2.906102 +0.8651928,24,406.7348,4.708713 +0.8610366,68,384.947,5.452404 +0.8713612,35,373.6557,5.019745 +0.5738918,29,452.9196,4.144968 +0.5240998,92,545.6718,4.950569 +0.7527017,64,163.9493,5.142884 +0.6616936,31,958.384,4.362104 +0.8629395,77,651.0979,5.528421 +0.783235,41,700.8783,4.851017 +0.8394277,29,67.74892,4.873075 +0.7977615,5,190.0469,3.04529 +0.5940232,54,580.2972,4.671643 +0.9218088,64,88.74913,5.819851 +0.8127387,47,991.2968,5.025708 +0.7963492,66,680.6744,5.227959 +0.5904958,55,863.2755,4.677009 +0.8075735,17,983.1247,4.22383 +0.7415049,43,793.1585,4.785166 +0.8843514,74,597.5391,5.581504 +0.7021487,6,873.4177,2.943845 +0.8391883,12,753.545,4.033319 +0.7921166,46,52.22621,5.114419 +0.5554143,69,76.81138,4.829512 +0.6042065,76,151.4294,4.966379 +0.8627017,3,525.6119,2.698795 +0.865755,2,376.8642,2.122449 +0.8279171,10,836.8117,3.82942 +0.822342,5,962.3499,3.122065 +0.6597195,71,21.51946,5.235428 +0.776297,41,967.7869,4.830209 +0.8637549,79,871.2532,5.542754 +0.6396458,39,743.7715,4.502273 +0.826949,97,36.28713,5.892425 +0.7012445,40,177.4653,4.669936 +0.5738541,55,864.6037,4.648669 +0.6926033,57,906.083,4.889783 +0.8142208,4,830.517,2.839772 +0.6244411,9,13.95435,3.327233 +0.5999928,84,440.6816,5.010063 +0.7107244,9,545.9235,3.385588 +0.6170333,66,398.5188,4.865456 +0.5432562,27,214.7615,4.035203 +0.891457,61,156.3249,5.549498 +0.8364938,75,499.4986,5.432955 +0.7364336,82,899.3403,5.23781 +0.6345384,51,661.4909,4.699565 +0.6238511,79,467.3019,5.006217 +0.6425458,54,541.773,4.759007 +0.8062015,98,279.2243,5.549434 +0.8942245,27,820.441,4.907142 +0.8293175,65,18.86648,5.856884 +0.5543704,15,907.1906,3.527276 +0.9427969,14,973.7963,4.692983 +0.5635837,55,917.0542,4.631148 +0.7863883,50,976.9138,5.000909 +0.6690678,71,936.7323,5.003891 +0.8103885,89,852.7451,5.465744 +0.5853477,7,566.7827,2.830862 +0.9155325,74,929.784,5.708425 +0.652931,90,849.3441,5.143776 +0.63539,94,112.5092,5.190783 +0.9347237,32,425.9525,5.268364 +0.5908132,32,193.1982,4.267024 +0.882015,92,412.4952,5.728643 +0.8953683,41,852.7085,5.214666 +0.5202744,78,282.4543,4.829493 +0.9373646,28,29.90516,5.635022 +0.9139742,35,175.8116,5.253379 +0.8243774,47,623.3277,5.06504 +0.7781752,71,674.4035,5.234271 +0.6977277,38,68.90478,4.672658 +0.6985117,56,139.0387,4.92994 +0.6405636,70,422.2165,4.949769 +0.7322623,34,302.2471,4.598792 +0.7356788,36,466.6663,4.643266 +0.5179625,98,422.796,4.988105 +0.920347,32,632.1662,5.168424 +0.8147306,22,655.7655,4.459846 +0.7213689,76,963.051,5.153094 +0.6786994,68,743.6589,4.99277 +0.6729528,21,82.73629,4.109708 +0.7944516,48,324.7937,5.01126 +0.7986539,8,300.5525,3.529152 +0.7704706,5,377.2322,2.945948 +0.8876776,97,425.3873,5.784077 +0.813792,43,990.8892,4.964142 +0.7389332,47,246.4452,4.866744 +0.6142692,4,950.8356,2.246285 +0.8333757,88,852.0517,5.520895 +0.918038,30,73.33338,5.266524 +0.5201918,42,149.4735,4.362267 +0.6865426,59,135.1505,4.944673 +0.818865,51,850.2187,5.103217 +0.7665226,28,317.5260,4.528706 +0.6878656,90,351.7311,5.220275 +0.6233782,24,686.0332,4.077961 +0.9079201,61,12.53428,6.715454 +0.7354724,37,866.4194,4.657101 +0.5748367,73,233.9909,4.874421 +0.9424346,27,604.6585,5.191774 +0.8052077,13,247.9588,4.004018 +0.5808156,22,55.97113,3.965451 +0.9059417,97,546.7074,5.851985 +0.7972078,82,324.6242,5.398432 +0.7553583,34,564.3914,4.642926 +0.5211904,43,59.69222,4.405759 +0.864604,94,383.3898,5.682846 +0.5628405,7,198.0784,2.785847 +0.8635089,89,179.457,5.68645 +0.8361038,4,631.6255,2.928310 +0.64402,42,762.8189,4.567911 +0.8099644,30,282.0744,4.705383 +0.5957105,10,675.4588,3.222615 +0.5611832,61,305.9021,4.713422 +0.7609862,75,581.0989,5.234911 +0.5861211,27,210.4605,4.115875 +0.681802,62,284.2667,4.946358 +0.9380357,22,163.5759,5.067801 +0.6476278,98,954.5236,5.193096 +0.6062827,71,570.621,4.896424 +0.8513,59,850.3103,5.303609 +0.6439583,33,685.2893,4.379145 +0.7549672,14,176.0377,3.930083 +0.5101834,28,353.0459,4.00226 +0.8534954,47,580.775,5.157762 +0.6642175,69,96.3145,5.032567 +0.7822325,20,464.9794,4.292241 +0.7222924,70,56.91364,5.224726 +0.7835733,92,11.13638,6.236578 +0.5127269,25,339.0517,3.910086 +0.9060686,81,300.5539,5.761269 +0.6473291,84,570.9105,5.08901 +0.7251075,34,842.6479,4.568951 +0.7233545,95,952.1911,5.311982 +0.8594078,44,426.2245,5.138217 +0.6228143,7,340.9586,2.917697 +0.6639282,60,579.4312,4.8763 +0.9111373,73,651.4216,5.685933 +0.850889,36,998.6415,4.948251 +0.5315727,20,452.9032,3.747659 +0.6490442,51,37.34832,4.852106 +0.715606,77,990.784,5.150418 +0.6712978,65,10.80619,5.424427 +0.8133968,100,891.5813,5.550796 +0.629085,96,415.4077,5.155445 +0.6325968,35,932.5289,4.402526 +0.7542193,78,229.4509,5.272169 +0.7610267,94,468.5767,5.394991 +0.9484245,24,661.5359,5.152519 +0.9051988,61,163.1016,5.61021 +0.642105,83,745.0839,5.068648 +0.6062096,71,29.42007,5.036339 +0.6614198,65,200.6846,4.95034 +0.9436293,20,906.2777,4.973695 +0.8892711,88,553.833,5.717634 +0.7912716,10,982.8139,3.707757 +0.8327392,90,923.7582,5.532846 +0.9494778,9,763.3662,4.394199 +0.837189,30,724.2563,4.770703 +0.764757,37,643.5556,4.728776 +0.6391173,62,732.9576,4.852631 +0.7116352,16,68.62962,3.974066 +0.926587,99,271.3453,6.005482 +0.7328461,22,375.7878,4.246613 +0.8062737,37,507.2412,4.840897 +0.7764293,97,522.9307,5.44909 +0.7452551,64,983.958,5.08166 +0.770722,96,122.8487,5.494829 +0.5441333,32,720.3908,4.170598 +0.663517,39,953.2992,4.546605 +0.5923693,90,235.0514,5.056502 +0.8482554,46,791.917,5.119762 +0.7808265,91,374.5348,5.424516 +0.9152311,40,974.5258,5.290716 +0.5714776,12,131.6730,3.362543 +0.5317691,42,633.3877,4.36961 +0.6123794,99,490.6901,5.14633 +0.5745781,8,645.4138,2.949351 +0.6082275,13,630.1471,3.502851 +0.6593624,89,215.2926,5.171144 +0.5644257,3,643.3973,1.740192 +0.920627,78,189.0088,5.84536 +0.5520711,51,623.7519,4.55584 +0.6121508,39,542.8347,4.453281 +0.7584429,21,187.2622,4.287515 +0.7916381,51,71.86452,5.147185 +0.8850048,16,997.5153,4.457286 +0.5391017,87,770.6265,4.931917 +0.7404479,7,323.7681,3.216882 +0.5623543,26,911.3213,4.02928 +0.5508669,96,484.6114,5.024189 +0.7931613,6,685.8204,3.213631 +0.9356591,55,520.1105,5.641592 +0.8191694,21,28.07199,4.681511 +0.7404314,76,362.3436,5.208253 +0.6132023,26,501.4922,4.1272 +0.898138,17,898.733,4.568876 +0.7149017,32,821.3167,4.499275 +0.6468989,98,799.4402,5.193233 +0.7843833,49,106.0027,5.056439 +0.78089,2,975.3173,1.739043 +0.7499181,33,292.2228,4.618129 +0.89562,3,215.3275,2.890152 +0.6734657,94,106.2031,5.270171 +0.5022134,82,435.0182,4.833872 +0.5035799,89,220.3418,4.901841 +0.6358235,5,732.8527,2.570277 +0.9185566,67,955.7941,5.65809 +0.8146047,77,848.0447,5.378849 +0.8849036,25,130.1811,4.875341 +0.666657,10,398.2127,3.382943 +0.866368,78,746.573,5.54593 +0.5504938,39,246.9974,4.349845 +0.712021,69,528.3399,5.072651 +0.5030071,65,637.7599,4.66033 +0.6105752,44,545.6989,4.544589 +0.6943772,65,979.1696,4.98809 +0.9203392,86,787.3725,5.833822 +0.5749371,12,488.0013,3.358939 +0.6378194,89,196.0952,5.133906 +0.5113716,66,593.8107,4.68551 +0.7412499,84,512.8562,5.272521 +0.6851877,28,589.8577,4.331579 +0.6870601,19,735.5807,4.011283 +0.7750765,15,479.3753,4.028658 +0.6845788,23,882.8073,4.166264 +0.7811759,64,597.6869,5.17059 +0.7607091,15,713.1093,3.985755 +0.5275841,3,320.7793,1.653622 +0.8151376,100,49.26603,5.78751 +0.5074881,77,757.4622,4.793207 +0.5229785,23,989.7796,3.852577 +0.7105007,28,31.24485,4.54415 +0.6215799,38,598.2167,4.449521 +0.8470756,49,10.20824,6.161224 +0.6472299,24,401.3113,4.129491 +0.9120567,60,41.54376,5.913973 +0.5377769,2,866.9126,1.040179 +0.7185213,18,930.2816,4.035555 +0.8158044,14,239.9823,4.104134 +0.770996,94,609.5532,5.412268 +0.7024562,43,650.9803,4.702584 +0.7775713,10,624.1942,3.668905 +0.8395731,24,386.586,4.617139 +0.6114049,91,218.1425,5.099238 +0.8950336,18,349.9376,4.6157 +0.5847385,92,22.30507,5.218627 +0.5681137,57,798.3608,4.666418 +0.8210785,93,933.207,5.522232 +0.5785641,83,4.989308,5.603602 +0.8157943,15,818.011,4.14539 +0.7407279,92,440.1779,5.337324 +0.733181,3,238.6378,2.200755 +0.7579886,42,635.1882,4.808085 +0.7311025,3,905.908,2.189757 +0.7900159,27,812.1494,4.548644 +0.760292,94,327.8632,5.402854 +0.6519805,77,849.4438,5.031642 +0.7062998,74,750.08,5.106512 +0.5844447,3,59.48537,1.801098 +0.6614328,90,460.961,5.165895 +0.881871,94,392.0773,5.744282 +0.8199697,65,654.326,5.280985 +0.898322,9,64.69922,4.13647 +0.7556982,59,152.5194,5.094736 +0.5939186,47,662.8237,4.564495 +0.8520484,84,444.9234,5.561018 +0.7401846,95,846.4764,5.347553 +0.6162178,30,412.4358,4.252757 +0.6134665,86,748.6544,5.044603 +0.6820989,3,169.3379,2.050289 +0.6442013,54,996.0875,4.757449 +0.5227555,12,294.5265,3.256112 +0.5621612,43,374.3188,4.443781 +0.6707198,14,582.3504,3.706538 +0.5717505,2,974.4778,1.120795 +0.714165,63,987.752,5.00491 +0.8463978,49,741.222,5.159691 +0.5952204,26,68.97992,4.131567 +0.5451793,20,707.1649,3.771381 +0.8645775,43,292.8327,5.152765 +0.9404841,4,51.03454,3.651606 +0.7179487,74,160.1517,5.169636 +0.6143455,31,974.3184,4.270616 +0.7752132,3,809.1733,2.335569 +0.7934382,59,504.3798,5.146776 +0.711908,86,888.908,5.221289 +0.6450752,84,229.6891,5.101429 +0.7590779,59,150.5668,5.10375 +0.9205524,29,818.9596,5.093759 +0.9360283,7,419.8364,4.064352 +0.5325355,85,266.1838,4.913121 +0.8768197,77,973.5951,5.569731 +0.7097386,99,643.0035,5.317974 +0.5718427,37,402.8701,4.340854 +0.5143585,41,440.6985,4.322562 +0.7406938,15,237.9263,3.946416 +0.7049336,96,920.0897,5.283441 +0.8494004,93,369.2301,5.627208 +0.6261061,45,662.1646,4.588758 +0.5064255,14,899.5559,3.369974 +0.7677488,79,651.7408,5.284578 +0.789773,59,296.7103,5.151136 +0.8435455,59,16.99554,5.912123 +0.6753605,53,791.7065,4.803538 +0.7715955,98,324.6493,5.457671 +0.8750405,21,577.243,4.637225 +0.8568845,79,527.212,5.53056 +0.6046421,54,708.383,4.688786 +0.7191854,53,919.355,4.890299 +0.6643493,97,347.9793,5.228687 +0.6956105,97,939.5987,5.272661 +0.6148152,27,557.7433,4.160999 +0.6576454,4,901.5362,2.356199 +0.8151161,36,74.71088,4.94727 +0.9228209,15,523.9028,4.61454 +0.6219353,32,922.2687,4.310781 +0.7883107,26,640.8576,4.516704 +0.6018958,97,34.22611,5.241195 +0.5793979,40,689.8196,4.412834 +0.6947763,5,26.97463,2.791473 +0.58931,35,138.7347,4.344029 +0.8847147,38,602.2617,5.121166 +0.7561305,49,523.4307,4.920687 +0.6925183,79,142.5949,5.168269 +0.6681708,46,193.5548,4.705324 +0.8585283,12,899.6494,4.105485 +0.6536122,66,584.4786,4.926772 +0.5651187,13,713.7666,3.414500 +0.88514,23,769.917,4.746323 +0.8002839,9,109.5764,3.673678 +0.9097735,4,111.6067,3.342624 +0.6178355,96,195.9049,5.151568 +0.7949732,57,597.5724,5.123088 +0.7527053,83,524.3268,5.288674 +0.8950565,49,72.84066,5.511047 +0.7359179,51,151.2464,4.939979 +0.8420705,7,564.432,3.548268 +0.7573152,83,299.6074,5.313 +0.9454348,87,942.5041,5.988617 +0.871066,18,952.1216,4.492747 +0.6274554,60,761.309,4.8073 +0.557569,10,423.8319,3.144131 +0.9005163,26,705.4903,4.910763 +0.8800185,65,730.4365,5.473082 +0.8613206,13,617.5602,4.188885 +0.8168853,17,650.0818,4.256188 +0.5328003,51,162.6084,4.53643 +0.6839809,84,377.3296,5.162864 +0.9303211,54,819.7178,5.583603 +0.6478824,71,990.3996,4.965008 +0.8349335,45,815.2025,5.061425 +0.769149,21,563.5817,4.294681 +0.6393773,87,829.238,5.09636 +0.8186378,40,399.7204,4.939388 +0.5060255,15,772.43,3.434855 +0.6399204,65,148.2399,4.91882 +0.5302873,41,873.3826,4.346774 +0.9489945,87,566.708,6.030224 +0.7902835,92,176.1944,5.489031 +0.935949,9,578.918,4.281535 +0.7065377,68,39.88104,5.213108 +0.6605787,74,199.7206,5.043517 +0.8500532,52,350.5747,5.231401 +0.5795111,43,185.7723,4.483979 +0.7721705,86,761.0165,5.350834 +0.8356097,31,587.8281,4.793397 +0.6543654,68,444.2728,4.953204 +0.745387,66,509.2115,5.112169 +0.6572928,32,453.2728,4.384213 +0.6103028,43,415.225,4.528702 +0.507783,24,459.682,3.864417 +0.7601003,75,316.1002,5.246828 +0.7714567,72,648.4202,5.228758 +0.6691248,74,148.5592,5.071301 +0.8532127,26,732.108,4.715798 +0.5091557,91,916.2237,4.917172 +0.6682798,23,442.3025,4.136524 +0.7504898,68,937.2238,5.136544 +0.9161427,30,880.0924,5.092573 +0.8091194,79,887.4123,5.381188 +0.7126703,51,412.3825,4.857893 +0.7594662,98,373.6597,5.425589 +0.5785451,27,661.7546,4.091882 +0.6655602,28,627.9785,4.290333 +0.5991819,54,216.0390,4.693234 +0.7969112,63,834.7526,5.193941 +0.8450834,25,649.1481,4.658746 +0.6193873,24,470.0091,4.072489 +0.9168002,2,62.04817,2.490147 +0.8613054,74,422.8139,5.507761 +0.62517,18,255.6169,3.841263 +0.6717216,30,248.8529,4.370396 +0.5892554,31,385.8409,4.229486 +0.8929538,34,581.5536,5.076849 +0.8155344,77,46.48784,5.609731 +0.5550282,19,784.9772,3.743976 +0.6795031,4,474.3498,2.415745 +0.6040601,66,200.2149,4.854484 +0.8937049,13,769.184,4.330309 +0.562713,48,40.01588,4.599981 +0.8443962,12,606.4958,4.054479 +0.5217481,98,304.271,4.997033 +0.6211519,73,460.562,4.944608 +0.801454,60,78.90437,5.287386 +0.7147738,91,760.2828,5.267743 +0.5293705,7,730.8396,2.708855 +0.6295258,25,288.2368,4.13171 +0.5811409,63,106.5195,4.796319 +0.7467691,83,303.5143,5.288863 +0.5357094,26,273.6827,3.986927 +0.8270343,25,75.21921,4.694638 +0.6370267,23,931.2065,4.067684 +0.5991126,3,463.7693,1.825909 +0.7526954,72,426.7363,5.193497 +0.8253992,93,330.6865,5.559655 +0.9159743,42,103.2218,5.454755 +0.8004575,92,11.91416,6.284229 +0.8738953,25,674.0253,4.764974 +0.8571217,38,390.5402,5.026141 +0.7039517,18,937.9678,4.001619 +0.7890745,34,410.5091,4.733657 +0.66447,39,688.1216,4.550597 +0.5939275,77,453.4037,4.93669 +0.7696701,100,856.4333,5.445882 +0.9277054,13,125.0380,4.591452 +0.9389669,99,787.151,6.030433 +0.8225612,91,994.0805,5.510888 +0.7342594,6,582.8713,3.033424 +0.8865646,57,5.988118,7.562239 +0.9154522,23,477.7697,4.904231 +0.5691102,7,96.046,2.807195 +0.6801258,9,342.9826,3.312514 +0.8502952,75,727.0152,5.467112 +0.5583243,47,911.0722,4.501544 +0.5236635,86,719.7257,4.899644 +0.5711945,61,904.3542,4.722019 +0.6034479,52,393.2907,4.663141 +0.8363296,65,490.6389,5.334549 +0.7217736,98,369.6968,5.345336 +0.7711621,71,24.62962,5.562754 +0.8946396,44,38.31367,5.588078 +0.8681217,34,730.2276,4.971574 +0.5378834,38,299.3967,4.304748 +0.7991737,58,345.0896,5.158856 +0.5592553,7,31.06375,2.814127 +0.9303648,2,961.1783,2.568641 +0.789962,48,667.3871,4.984806 +0.6122609,64,698.6285,4.828939 +0.5443432,21,316.0429,3.816686 +0.538685,4,822.2305,2.067093 +0.5826739,46,360.8801,4.532958 +0.6856244,17,109.1460,3.942286 +0.7513881,91,881.5027,5.341419 +0.6010855,16,407.8654,3.682199 +0.8463225,9,124.5201,3.838152 +0.899949,82,799.3413,5.706383 +0.9073209,28,842.0504,4.996587 +0.9469542,10,444.7476,4.468635 +0.8801998,100,651.3778,5.761765 +0.6018282,24,692.391,4.03621 +0.8014853,20,251.665,4.359587 +0.9432018,43,430.8335,5.534503 +0.9384274,100,25.18134,6.820565 +0.6923582,72,998.4995,5.057304 +0.5801159,42,782.1964,4.451911 +0.6414567,82,306.897,5.070821 +0.6720437,62,514.3452,4.91709 +0.7724809,57,339.2014,5.078844 +0.9028858,76,604.6113,5.676169 +0.9497646,65,64.40338,6.126636 +0.8328937,59,235.9650,5.282141 +0.7836799,77,586.6602,5.30615 +0.8561,32,898.7267,4.880362 +0.715531,15,130.4621,3.897282 +0.9006471,71,529.8968,5.624916 +0.6128581,49,414.7223,4.634115 +0.8566043,5,295.1873,3.272094 +0.7551571,36,54.301,4.802694 +0.6504977,38,414.6663,4.507891 +0.691055,88,229.4573,5.222388 +0.6377646,46,92.32049,4.671924 +0.7257486,47,581.0358,4.820107 +0.7063136,96,616.4358,5.290743 +0.8650301,40,943.64,5.074856 +0.6272809,41,135.1876,4.545061 +0.6924068,12,308.8051,3.619891 +0.6531557,13,949.6057,3.597409 +0.8044704,93,633.929,5.485044 +0.8368844,43,487.7978,5.043371 +0.8397715,74,513.7228,5.432954 +0.5198061,32,197.0448,4.13612 +0.5460146,42,882.3461,4.392564 +0.6740923,35,657.371,4.485618 +0.6792326,40,648.0051,4.599951 +0.8405607,53,811.9904,5.195353 +0.5946238,5,169.7788,2.477280 +0.8982927,26,848.3721,4.89743 +0.9365957,28,407.9059,5.186799 +0.7668708,53,178.9098,5.035299 +0.6584784,76,890.6541,5.033633 +0.5389569,12,497.2326,3.286257 +0.6999825,24,456.0215,4.240168 +0.9096133,31,747.363,5.084439 +0.8289016,2,283.8486,1.940521 +0.6901096,87,214.8528,5.214694 +0.6694101,78,530.8827,5.077346 +0.6567067,73,317.1940,5.014601 +0.679931,95,191.9584,5.260732 +0.5387921,23,10.62070,4.063064 +0.756781,59,405.9484,5.062023 +0.5842175,30,292.6955,4.195843 +0.6076509,77,417.3091,4.961052 +0.6543601,92,829.3172,5.161897 +0.5755779,49,196.0489,4.577904 +0.5450119,38,102.0792,4.334683 +0.9404626,51,345.8694,5.64067 +0.7038778,74,55.63226,5.222917 +0.8082828,86,120.1308,5.521448 +0.7313073,93,923.7832,5.313754 +0.5285032,3,618.0018,1.654841 +0.9024613,17,854.2145,4.591173 +0.6862795,37,30.83803,4.714655 +0.7354094,8,867.1883,3.332226 +0.9007964,29,611.6991,4.995666 +0.6588533,49,769.275,4.713477 +0.8563857,26,675.1622,4.728254 +0.8872304,87,328.7089,5.722146 +0.9268127,69,847.4352,5.724473 +0.6875418,60,935.4085,4.917128 +0.891503,19,974.8925,4.624085 +0.6769115,96,834.304,5.231948 +0.7652566,25,969.8592,4.421208 +0.6201267,12,685.9498,3.451914 +0.6599803,63,784.9818,4.901872 +0.6964509,81,667.3963,5.152364 +0.6965717,35,935.8557,4.529274 +0.6360838,51,280.4093,4.7129 +0.8371735,88,757.6325,5.533856 +0.6208766,74,120.8144,4.986134 +0.6598676,62,270.1187,4.904797 +0.8525584,26,247.1739,4.738222 +0.7263877,70,427.1566,5.116298 +0.7346672,31,453.3599,4.52499 +0.8395507,14,95.145,4.228401 +0.7380277,4,15.21835,2.710866 +0.5857433,63,4.982476,5.40675 +0.8829485,78,53.84525,5.862786 +0.6057832,60,87.74786,4.814740 +0.7225465,21,738.9869,4.176617 +0.6532181,99,770.4294,5.211655 +0.8260238,21,471.1853,4.462461 +0.7465538,91,348.1825,5.348179 +0.8766148,72,320.0464,5.555052 +0.6860644,88,913.9462,5.187536 +0.8306096,62,184.0549,5.32403 +0.6324524,63,799.4854,4.851846 +0.5364287,49,30.90720,4.577945 +0.6288004,24,822.3586,4.08774 +0.9113013,43,150.4739,5.401755 +0.6569249,22,476.9137,4.074598 +0.804286,26,90.7052,4.632987 +0.8768176,18,824.244,4.518036 +0.6579506,44,270.2119,4.642845 +0.7120674,45,417.2141,4.762816 +0.6624692,2,355.9182,1.358141 +0.7997539,59,516.3986,5.162715 +0.9064637,37,727.8032,5.196172 +0.8220323,7,432.6814,3.474522 +0.75176,55,861.221,4.988624 +0.6098563,56,461.1784,4.728862 +0.661423,93,384.5225,5.191923 +0.8380577,45,787.3014,5.07156 +0.5475543,54,151.5863,4.608017 +0.9364163,89,550.0236,5.958449 +0.8345188,33,715.9277,4.83412 +0.9300926,24,417.0907,5.028721 +0.715501,56,100.0091,4.987019 +0.9396052,60,513.9873,5.726164 +0.5227287,97,513.9972,4.986833 +0.8565892,7,304.42,3.615298 +0.9116222,74,986.7343,5.688216 +0.8512815,45,27.81513,5.487517 +0.9298235,83,989.083,5.857929 +0.626031,73,643.8244,4.949713 +0.8482173,91,457.0946,5.601593 +0.5709514,32,457.7069,4.220686 +0.6943745,92,242.0755,5.258453 +0.8606947,39,318.7593,5.064335 +0.840107,80,678.4295,5.48065 +0.5747926,29,651.5253,4.144597 +0.8357058,7,666.7798,3.522195 +0.869957,81,855.4466,5.580992 +0.670602,54,101.5262,4.85908 +0.8043425,81,708.5911,5.389184 +0.7803241,71,259.3759,5.26357 +0.7343555,43,335.7706,4.781522 +0.6297029,47,719.406,4.628093 +0.6101721,45,104.9270,4.593527 +0.5134342,15,925.1843,3.448606 +0.8411402,71,917.1132,5.397877 +0.7914293,83,136.8519,5.438173 +0.6139731,77,618.7109,4.967776 +0.5357605,24,862.5706,3.912846 +0.5025054,26,595.9775,3.923262 +0.89996,57,532.7505,5.473657 +0.7650395,53,698.8342,4.994776 +0.7758476,20,845.1518,4.268804 +0.769896,71,98.302,5.297764 +0.6660289,82,968.9507,5.100656 +0.9441867,10,37.19494,4.689927 +0.8946557,52,995.2553,5.374756 +0.7667594,71,705.5376,5.206838 +0.5014517,77,871.1445,4.783311 +0.5965555,7,819.4321,2.854995 +0.8659944,2,758.1844,2.121457 +0.6069824,22,158.3323,3.987152 +0.6479568,94,353.0358,5.176647 +0.5823552,65,489.6782,4.792003 +0.8344934,16,260.4225,4.279719 +0.914692,65,954.2295,5.618436 +0.7871276,33,206.7722,4.724443 +0.6903965,76,163.2536,5.12962 +0.6344172,37,484.5121,4.454353 +0.6875203,61,231.6496,4.951199 +0.7422141,52,591.7167,4.930737 +0.7599737,31,281.7283,4.594985 +0.6880801,23,810.4523,4.174274 +0.81849,54,857.3539,5.1427 +0.8148196,72,388.4852,5.349729 +0.8212496,76,979.5797,5.386053 +0.6091061,50,602.2909,4.639421 +0.8067955,63,27.98457,5.562519 +0.9042222,97,672.1885,5.838087 +0.6244393,47,2.131261,6.358538 +0.5254594,98,625.0347,4.997252 +0.8791726,34,862.3985,5.01207 +0.746068,56,620.111,4.992682 +0.8306618,24,473.0823,4.583617 +0.7019251,90,179.0329,5.269792 +0.820721,3,27.40536,2.585711 +0.6277612,95,375.2626,5.147359 +0.760516,77,973.8867,5.245349 +0.7752467,87,718.0702,5.366682 +0.7374634,28,778.2432,4.445331 +0.7285804,45,770.6425,4.790764 +0.8101368,99,420.6396,5.551649 +0.8354864,2,752.3351,1.967745 +0.9366795,96,934.8403,5.99238 +0.7295988,2,854.2223,1.559671 +0.902451,16,637.7424,4.546596 +0.6556947,67,88.20184,4.998451 +0.8541205,74,192.7775,5.521679 +0.9460709,29,695.1937,5.267903 +0.636149,84,870.8137,5.06554 +0.6345869,49,321.4711,4.677389 +0.8826033,54,110.8286,5.460166 +0.8048285,100,344.4542,5.551093 +0.760377,54,437.62,5.004792 +0.5793991,27,765.2235,4.092846 +0.6896911,15,676.624,3.810868 +0.660633,69,60.04597,5.061003 +0.5156361,16,606.4331,3.513952 +0.893971,53,914.421,5.386176 +0.9322795,45,194.9015,5.536317 +0.9217502,47,148.8462,5.526009 +0.7223354,41,354.2265,4.717427 +0.7254239,21,944.9461,4.181863 +0.708828,75,461.7057,5.127708 +0.7022857,28,137.4031,4.397661 +0.9036889,27,341.8465,4.972055 +0.8784777,44,937.2588,5.193275 +0.6917807,29,917.8933,4.370685 +0.8760101,23,943.734,4.705450 +0.9430376,66,524.9752,5.811901 +0.5017794,92,151.7466,4.928244 +0.8888717,89,367.2177,5.738572 +0.6703306,14,535.2485,3.706171 +0.672854,26,944.1592,4.242406 +0.6472046,80,827.924,5.0506 +0.8772473,5,160.6619,3.382955 +0.8926035,81,187.3492,5.733713 +0.6786785,93,663.5972,5.215532 +0.7578081,65,667.543,5.124931 +0.7833775,55,329.4239,5.081013 +0.7000353,43,82.3758,4.762278 +0.888855,70,652.9058,5.560005 +0.6924933,87,478.0858,5.199561 +0.840106,52,313.4649,5.202915 +0.5399748,25,364.0615,3.959138 +0.902836,16,403.3234,4.557186 +0.6867339,26,969.5584,4.271392 +0.8742233,37,480.4238,5.064757 +0.7599474,67,993.2258,5.14663 +0.883177,65,310.0843,5.512333 +0.6960705,31,389.7709,4.440958 +0.7739131,71,67.05128,5.352244 +0.7563553,22,940.1603,4.295526 +0.8219649,40,352.6679,4.952488 +0.9108295,14,658.4179,4.483537 +0.9498709,73,859.1367,5.912762 +0.8252522,84,979.9907,5.46482 +0.7923822,95,142.433,5.531805 +0.5749987,39,896.3604,4.383877 +0.8141943,10,294.8625,3.793207 +0.5594338,52,69.15462,4.625047 +0.932766,68,273.3,5.796079 +0.6501828,67,958.8537,4.927372 +0.6199984,91,910.7417,5.0943 +0.9105013,61,86.3416,5.723355 +0.6500351,13,101.7401,3.61627 +0.9173677,4,921.6633,3.358811 +0.7483216,56,811.9803,4.994524 +0.6619459,6,672.351,2.841462 +0.7787717,50,588.649,4.988066 +0.6915036,64,334.7062,4.985228 +0.8969362,5,505.469,3.470211 +0.8492126,3,306.2505,2.637068 +0.6736042,74,738.814,5.043914 +0.8280637,68,39.91354,5.600346 +0.9255473,6,906.1636,3.830839 +0.595304,14,217.5326,3.552682 +0.8425488,84,901.4002,5.515823 +0.7499038,4,308.2265,2.622547 +0.7292323,64,240.871,5.072892 +0.5156149,32,761.0943,4.120675 +0.9342052,76,325.2375,5.867557 +0.7430211,54,869.715,4.955698 +0.5554406,32,914.998,4.189741 +0.703071,36,997.2677,4.564418 +0.6830719,69,89.59823,5.077642 +0.6347344,13,419.0303,3.561125 +0.678805,77,456.5152,5.087955 +0.6484101,26,166.0909,4.212926 +0.5956851,21,718.855,3.909814 +0.6716819,49,506.3922,4.742036 +0.880219,4,437.3379,3.137609 +0.6992864,21,926.1055,4.122149 +0.7350454,17,803.2935,4.027239 +0.924039,65,518.5967,5.682937 +0.7097215,47,189.0405,4.809879 +0.820387,6,275.5597,3.317263 +0.9255068,81,23.14098,6.576327 +0.55869,9,627.6641,3.038083 +0.6046422,57,853.3931,4.728344 +0.744582,23,563.4014,4.306778 +0.6502728,57,30.85893,4.969265 +0.7468517,32,992.2413,4.570483 +0.6578665,20,675.1416,3.992919 +0.5214619,89,909.4671,4.920113 +0.8465362,44,158.5620,5.137696 +0.6626981,19,212.1094,3.971124 +0.8807791,42,327.2020,5.194205 +0.7866526,79,760.59,5.326811 +0.7779337,73,365.5488,5.26587 +0.9119104,46,26.67773,5.894684 +0.5792652,7,547.2527,2.817491 +0.5369576,36,356.6722,4.257976 +0.883138,81,393.9469,5.650472 +0.5432084,71,55.75745,4.842559 +0.895006,86,614.9657,5.72293 +0.768465,50,513.2161,4.965069 +0.9327656,92,794.7848,5.945621 +0.7523386,50,317.4484,4.936806 +0.741749,56,496.2921,4.986378 +0.7054378,77,244.3444,5.154722 +0.8930161,52,269.8881,5.405983 +0.8259867,30,446.4984,4.742886 +0.9428722,78,646.6361,5.911485 +0.587867,69,311.0502,4.850746 +0.7552073,27,941.9401,4.457584 +0.7985361,86,716.3606,5.414992 +0.7237573,8,175.6068,3.314545 +0.6685535,57,696.2688,4.845468 +0.5013911,23,945.8882,3.813899 +0.6523594,99,24.28822,5.442461 +0.7394495,49,881.9684,4.876581 +0.854433,28,707.679,4.777123 +0.8204082,83,605.3809,5.451369 +0.79852,86,288.334,5.438983 +0.7310523,85,717.5282,5.25414 +0.9195674,81,107.4469,5.937123 +0.6529936,19,20.64329,4.099437 +0.6067644,22,388.9285,3.975088 +0.8650076,38,466.122,5.050008 +0.6128448,67,98.0593,4.906338 +0.752887,51,922.446,4.935679 +0.6460481,27,814.8709,4.219734 +0.6936537,45,245.3472,4.734685 +0.784517,60,421.8168,5.13995 +0.6001813,61,686.6315,4.772608 +0.9319204,62,696.6375,5.688879 +0.922267,71,823.7056,5.718688 +0.6002578,9,503.0087,3.127464 +0.6310301,6,138.3597,2.776067 +0.8483663,18,189.1734,4.438687 +0.70115,88,191.8286,5.2494 +0.8561147,97,22.70583,6.228308 +0.667727,56,494.8825,4.834405 +0.6542349,9,824.6264,3.246751 +0.5206833,7,729.2577,2.690404 +0.658784,87,246.0525,5.150044 +0.5953643,23,366.7405,3.991525 +0.6766511,91,414.3638,5.203471 +0.825277,42,851.569,4.981794 +0.6250303,58,23.19250,4.962958 +0.8423589,99,93.69587,5.756519 +0.8063293,31,264.1642,4.722025 +0.620299,64,122.1244,4.876939 +0.7893993,47,877.3323,4.96473 +0.6962783,83,146.4735,5.210165 +0.5332282,41,131.3166,4.368617 +0.6765526,53,138.7834,4.842043 +0.8702945,27,497.7323,4.814542 +0.7776173,82,76.84477,5.449936 +0.8220009,15,216.7689,4.187112 +0.924437,7,953.394,3.967118 +0.8349073,25,895.0206,4.621042 +0.5263872,22,348.8703,3.823587 +0.6831776,52,279.0269,4.81924 +0.8806107,92,969.464,5.700816 +0.7174212,95,820.0121,5.301742 +0.6907261,79,551.123,5.12615 +0.6847294,89,759.6159,5.194662 +0.5568725,20,625.1609,3.793706 +0.6078584,10,146.1385,3.259882 +0.7378435,47,589.1384,4.846525 +0.9052463,80,710.1403,5.716327 +0.7568209,43,98.5796,4.888557 +0.5767346,61,609.2453,4.733473 +0.8850829,8,556.3335,3.865227 +0.6507976,72,844.7777,4.981404 +0.7150611,77,310.9208,5.167565 +0.8717278,21,382.6469,4.631755 +0.6029478,52,730.9699,4.657059 +0.8668438,61,542.8423,5.387924 +0.9472293,42,932.0925,5.527578 +0.8546157,31,560.8847,4.858193 +0.6580792,33,540.6646,4.408665 +0.6077477,11,744.3783,3.341634 +0.7560453,46,377.6593,4.879772 +0.5934148,59,364.4261,4.741766 +0.6420253,87,671.283,5.102801 +0.5611765,38,346.1592,4.344532 +0.939425,28,247.0993,5.230175 +0.6246716,11,705.8324,3.378152 +0.5071962,93,202.9717,4.940695 +0.6177509,44,86.61081,4.599245 +0.6201071,90,284.9948,5.100697 +0.7943832,4,651.253,2.767431 +0.5547687,14,92.42605,3.481923 +0.6008824,81,964.5551,4.979063 +0.8629902,95,927.3415,5.661068 +0.5217671,20,910.9093,3.727425 +0.7689205,71,179.86,5.252005 +0.6822136,93,682.3452,5.221752 +0.6892221,24,467.665,4.216273 +0.9466872,49,883.4082,5.627904 +0.782297,14,837.0868,3.984421 +0.6690006,34,806.0445,4.451114 +0.8822465,16,302.8304,4.464571 +0.814535,72,793.6759,5.333641 +0.780475,65,104.4416,5.256237 +0.6682725,41,54.42584,4.684022 +0.8818546,92,241.0917,5.755743 +0.5129674,89,518.6905,4.909487 +0.6083917,7,195.1739,2.888261 +0.8140826,93,353.8889,5.525755 +0.6558119,59,593.6033,4.848487 +0.5921442,53,938.0159,4.651416 +0.6950022,92,367.6952,5.248443 +0.8418083,45,53.97386,5.266512 +0.8581418,9,996.44,3.847388 +0.906525,76,919.7202,5.683072 +0.7922269,86,262.6776,5.426634 +0.8804859,57,874.4561,5.382196 +0.6551834,55,992.6632,4.791359 +0.6348819,63,68.21945,4.925976 +0.539279,2,999.5265,1.043612 +0.5769965,8,480.9133,2.955411 +0.7496352,5,952.3615,2.876907 +0.6318387,42,714.5921,4.545552 +0.8323459,12,329.8476,4.019001 +0.898379,75,202.0454,5.701038 +0.8675291,19,141.8562,4.573326 +0.5642187,34,590.5545,4.256547 +0.8223834,83,86.52396,5.576896 +0.8367909,82,911.1915,5.482459 +0.5391946,30,341.9927,4.112239 +0.7218873,64,588.085,5.037551 +0.712584,25,774.5507,4.297156 +0.6410482,70,466.223,4.94933 +0.9427801,78,553.2906,5.916202 +0.7313513,22,109.2037,4.277424 +0.6818153,96,512.4702,5.246855 +0.5512217,98,992.8429,5.035079 +0.7812837,89,618.1023,5.398797 +0.7540433,88,544.6624,5.331273 +0.7513365,43,739.7543,4.808344 +0.6869057,45,887.4778,4.702743 +0.7466107,87,160.8096,5.348803 +0.6327194,74,213.3965,4.989166 +0.799753,98,822.153,5.503853 +0.5081392,76,11.12948,4.967705 +0.5695873,58,148.3262,4.702562 +0.8698363,93,582.4204,5.680172 +0.7370043,53,83.27543,5.011579 +0.5155987,2,810.935,0.9893308 +0.9243925,64,607.5746,5.669679 +0.5951338,40,455.03,4.443665 +0.9100938,9,241.3229,4.124432 +0.5649921,47,58.03952,4.565033 +0.8871607,49,163.9309,5.37103 +0.6987442,58,873.9467,4.914947 +0.7717202,56,295.2688,5.068172 +0.8971835,26,322.9148,4.913746 +0.7098414,26,138.5701,4.354089 +0.5980129,75,381.2143,4.926538 +0.7466993,8,939.951,3.363184 +0.5817556,27,166.0144,4.111321 +0.6169866,9,789.4504,3.162706 +0.8773756,90,872.0359,5.676485 +0.9487774,19,620.3235,4.984752 +0.6012269,72,648.6574,4.896949 +0.8874921,70,590.1976,5.557023 +0.689685,87,78.50793,5.272388 +0.5055174,93,963.2988,4.927143 +0.6047475,64,893.5502,4.814436 +0.7766777,50,368.8056,4.991917 +0.5686279,25,323.1676,4.012975 +0.7818071,83,226.9735,5.3823 +0.8170889,12,153.6800,3.985706 +0.7977554,29,770.1328,4.626086 +0.7852365,46,989.7344,4.93727 +0.7927683,74,356.9458,5.312917 +0.7867968,6,399.7946,3.195968 +0.8733431,12,935.9138,4.166780 +0.8796833,70,934.9437,5.517356 +0.636514,68,971.9312,4.913639 +0.6808005,20,430.3306,4.045446 +0.6048896,85,981.4121,5.020153 +0.8654105,89,720.428,5.630987 +0.6864552,67,602.496,4.999139 +0.6300466,96,289.0463,5.163596 +0.817489,75,211.2414,5.410742 +0.8400478,92,679.8478,5.573994 +0.5698388,8,300.8922,2.941856 +0.582194,5,504.4376,2.443357 +0.5349201,22,127.5678,3.849569 +0.6187668,22,951.209,3.993716 +0.8008588,62,233.6063,5.225165 +0.5965371,94,40.45694,5.187102 +0.8151207,32,756.864,4.751175 +0.7769006,27,223.2838,4.536306 +0.7174666,8,396.4691,3.288214 +0.7976062,11,776.9354,3.816095 +0.518612,40,443.6649,4.309965 +0.804459,24,381.0473,4.506709 +0.6998635,62,207.0057,4.992047 +0.5738755,63,649.407,4.752359 +0.5914398,66,114.7394,4.847805 +0.7516815,54,737.3794,4.9768 +0.8206513,74,838.3675,5.368303 +0.6892161,22,248.1324,4.152309 +0.7557864,96,773.9158,5.388975 +0.7424069,8,419.5075,3.355515 +0.64102,31,125.2648,4.350865 +0.8755487,29,531.1229,4.887958 +0.8220866,64,95.23995,5.376784 +0.7298066,84,988.9888,5.239885 +0.6498086,59,777.8337,4.835051 +0.5952051,16,43.86029,3.720629 +0.5406545,28,730.805,4.053318 +0.8730058,94,570.9119,5.698879 +0.7848164,39,595.9421,4.819905 +0.5056704,85,235.6726,4.870872 +0.7503822,93,40.40904,5.569652 +0.7623385,77,656.6282,5.254356 +0.9050834,28,639.3919,4.989896 +0.5792019,63,720.7618,4.76066 +0.9365765,81,741.2498,5.889811 +0.5170495,36,709.0156,4.220138 +0.7579033,50,215.9502,4.962113 +0.7261358,35,950.1155,4.592818 +0.867949,61,174.7179,5.443687 +0.8219999,91,90.11405,5.635406 +0.7344778,6,768.4564,3.032963 +0.6391056,66,344.9348,4.907219 +0.715629,5,461.1896,2.780410 +0.9456008,14,125.8034,4.795929 +0.7781412,93,949.9423,5.414954 +0.9017116,9,294.1608,4.070416 +0.7990502,54,177.7193,5.134096 +0.5764074,30,277.9910,4.181882 +0.868876,87,530.6085,5.635381 +0.838551,3,655.3641,2.584304 +0.8733335,81,169.8654,5.663368 +0.8009454,37,421.7654,4.829536 +0.6619069,3,358.1408,1.990475 +0.936464,46,82.03691,5.698119 +0.8662996,15,787.2326,4.326679 +0.6319756,60,396.6261,4.821835 +0.8327794,21,356.1523,4.489936 +0.697243,14,426.6443,3.769716 +0.9422893,39,798.8793,5.442873 +0.8401464,40,876.4566,4.99153 +0.7271848,14,801.7663,3.837801 +0.9366602,79,839.1458,5.871191 +0.8654798,86,219.8499,5.655314 +0.601478,40,521.7851,4.454044 +0.8159394,76,844.3883,5.373576 +0.877629,12,263.1835,4.205521 +0.6199173,63,541.6174,4.832829 +0.8350693,96,494.7244,5.595292 +0.9331142,30,310.2021,5.223768 +0.5971522,26,294.0387,4.101062 +0.7050427,85,799.8672,5.200766 +0.8245875,85,519.8425,5.482495 +0.8156111,40,282.1250,4.940373 +0.5562086,50,914.5773,4.545837 +0.7945503,56,509.8487,5.11224 +0.9002302,48,657.2615,5.351519 +0.7408247,9,582.8542,3.464661 +0.7706727,10,123.3315,3.675843 +0.8233978,87,586.6883,5.492068 +0.6780417,86,613.6269,5.160592 +0.7555267,27,593.3262,4.462403 +0.8589791,98,210.522,5.72345 +0.8564374,49,475.0287,5.201909 +0.6455064,10,888.3926,3.330776 +0.6118692,22,225.4656,3.991082 +0.7097182,9,955.9376,3.380605 +0.8303001,97,751.4643,5.579085 +0.8857616,77,819.6227,5.606405 +0.9371744,94,581.324,5.995916 +0.904798,16,844.1146,4.555205 +0.8052004,76,937.64,5.343849 +0.6413274,76,156.2456,5.034433 +0.5005335,20,619.3793,3.689414 +0.6843155,95,944.576,5.237186 +0.5974006,85,681.7894,5.010067 +0.5821853,27,280.7281,4.104808 +0.8953317,29,409.1469,4.979421 +0.817542,38,884.406,4.885221 +0.6230185,10,126.0652,3.296125 +0.8992164,64,214.1892,5.59214 +0.8508804,86,21.84537,6.12389 +0.6022805,78,638.9464,4.956948 +0.8040262,95,829.4797,5.493623 +0.9077964,51,521.2882,5.434688 +0.7534537,25,426.964,4.399786 +0.9285945,35,190.0018,5.335034 +0.6491223,5,588.7468,2.603757 +0.8181373,96,574.1935,5.544206 +0.7787446,23,373.9165,4.400276 +0.670359,31,124.0375,4.413313 +0.6786379,88,957.521,5.173391 +0.5888266,74,550.2265,4.897334 +0.6085072,66,639.6363,4.845776 +0.6478314,71,985.1027,4.964951 +0.7657263,6,179.6602,3.137958 +0.8456286,68,404.8321,5.399875 +0.5364791,22,998.3107,3.8383 +0.6038707,50,164.2271,4.64913 +0.857209,77,795.551,5.505422 +0.5249804,39,328.439,4.302451 +0.7442277,42,966.5417,4.772024 +0.7201957,47,475.412,4.810843 +0.5699931,24,869.3557,3.975455 +0.6989484,70,816.274,5.051683 +0.7812828,44,2.135128,8.591494 +0.5219076,100,237.0052,5.014755 +0.6106303,98,854.5144,5.13124 +0.5026807,86,224.5775,4.875127 +0.8198123,71,575.1678,5.3441 +0.6138242,71,745.7467,4.907245 +0.6805838,55,638.4604,4.843034 +0.9290318,35,257.3453,5.317635 +0.6470365,22,696.273,4.051653 +0.6337309,97,363.7865,5.172954 +0.7886795,17,643.3402,4.171278 +0.8254145,5,582.7275,3.136136 +0.8516908,52,803.336,5.217638 +0.9166178,8,577.6604,4.041351 +0.8968548,98,527.179,5.820264 +0.5722818,24,793.7203,3.979998 +0.6032017,23,788.499,4.00212 +0.5075828,33,519.9306,4.133535 +0.8657794,62,58.56733,5.593048 +0.6514194,9,397.1311,3.243381 +0.740069,89,621.0678,5.306752 +0.9482056,56,275.5806,5.77576 +0.8230623,9,52.053,3.803464 +0.6082217,53,915.879,4.679475 +0.6464528,5,119.4947,2.607668 +0.8350917,7,226.1173,3.532820 +0.6178383,61,243.0198,4.816592 +0.7782553,77,374.1483,5.303223 +0.8656266,98,739.3553,5.694418 +0.6165961,45,754.2097,4.570610 +0.7231948,97,951.436,5.325928 +0.7702777,54,307.4097,5.037028 +0.7941128,83,842.361,5.377428 +0.9480839,73,274.8127,5.950433 +0.87857,68,853.7356,5.495204 +0.8815007,47,334.6438,5.276524 +0.5020565,73,127.3073,4.761097 +0.8132388,17,766.5308,4.243171 +0.6349836,72,217.501,4.97288 +0.7345042,45,446.8198,4.810678 +0.6324589,56,695.5116,4.765614 +0.6766945,65,682.7241,4.957177 +0.8384446,45,50.39085,5.266822 +0.8292134,96,840.1522,5.567259 +0.6719539,48,656.1994,4.724372 +0.809623,95,56.85168,5.701083 +0.7498366,17,364.4239,4.072086 +0.619014,13,707.4429,3.525017 +0.6811455,74,605.4795,5.060201 +0.882381,46,958.455,5.239598 +0.7015142,82,476.2719,5.175633 +0.5299216,16,494.2751,3.541732 +0.6607211,14,884.8854,3.6824 +0.6563658,76,473.8497,5.036273 +0.9086148,20,348.7688,4.768237 +0.5317627,83,431.7357,4.889704 +0.825882,54,6.723105,6.564159 +0.7910776,83,855.6105,5.369767 +0.5434787,31,396.3381,4.146151 +0.7552404,20,230.9523,4.232531 +0.9128294,2,948.336,2.421541 +0.8734858,3,943.6312,2.752039 +0.7619628,13,46.50071,3.95599 +0.530564,21,589.0549,3.788025 +0.8672307,32,385.6643,4.936566 +0.5758073,16,507.0537,3.630556 +0.9346337,28,207.8552,5.206275 +0.6086858,100,427.5916,5.148903 +0.8526955,60,625.6103,5.325112 +0.7807349,97,208.4894,5.491468 +0.6613672,24,666.5108,4.154454 +0.7868165,30,481.2405,4.628475 +0.9346749,13,889.5627,4.572415 +0.9328514,7,828.8279,4.030245 +0.5606693,6,261.8499,2.607946 +0.8161636,17,780.7351,4.252196 +0.6558015,79,528.6601,5.061497 +0.831897,81,635.7404,5.466197 +0.915886,22,853.311,4.862409 +0.5913286,72,60.15915,4.945122 +0.8646249,33,264.7087,4.962252 +0.8321677,72,908.4424,5.380992 +0.6962891,65,110.6920,5.048255 +0.6304735,72,218.5794,4.964444 +0.6745612,29,459.785,4.34005 +0.9232729,26,918.3574,5.02832 +0.8580391,47,854.3836,5.166712 +0.5624958,56,846.6226,4.643342 +0.7873887,36,127.6685,4.816235 +0.5135421,82,424.3989,4.85195 +0.814808,97,115.9282,5.628076 +0.8753602,40,178.0754,5.167777 +0.6118576,23,147.7502,4.036733 +0.6847514,43,587.8533,4.667379 +0.6061571,47,758.2529,4.585328 +0.5858277,36,416.5601,4.343773 +0.8739752,83,707.7928,5.61507 +0.8375114,6,982.8637,3.372709 +0.9003886,58,173.6305,5.545955 +0.5981954,71,128.2512,4.910756 +0.7455954,57,286.4944,5.020046 +0.7812342,42,253.2611,4.88518 +0.730042,91,961.7669,5.295857 +0.7136859,65,302.7885,5.044119 +0.693914,50,633.6842,4.798753 +0.7007014,9,755.1023,3.35871 +0.5536581,56,347.3614,4.634456 +0.5760761,33,840.6948,4.25189 +0.5446971,18,518.0001,3.677323 +0.843379,13,993.9418,4.115953 +0.787686,66,606.3317,5.208036 +0.824503,100,349.7422,5.603655 +0.8745048,52,832.2114,5.296925 +0.5533256,6,456.3044,2.589675 +0.9002027,32,78.98477,5.199832 +0.7572682,69,955.2467,5.161683 +0.9110095,86,223.9173,5.844839 +0.815023,94,299.6559,5.541953 +0.8908233,97,786.267,5.778197 +0.5329625,8,44.15612,2.887261 +0.5134662,39,538.1438,4.279916 +0.5981097,30,227.5569,4.225254 +0.7171263,75,704.7456,5.138373 +0.930335,42,353.6559,5.438617 +0.8124237,87,3.898780,7.969198 +0.9411632,55,725.4331,5.668858 +0.8050018,42,440.056,4.934311 +0.7530192,22,622.1026,4.290333 +0.8170806,84,470.7614,5.456249 +0.93525,14,386.908,4.651497 +0.7166343,60,104.1422,5.038449 +0.917954,87,868.0088,5.826831 +0.8879323,89,923.3232,5.70781 +0.8616931,37,534.479,5.0154 +0.6735284,59,446.7707,4.885447 +0.7125385,71,553.2622,5.093403 +0.7026195,75,235.6866,5.131304 +0.5473121,3,51.68421,1.711303 +0.6607179,73,43.87053,5.137546 +0.9180171,76,942.4687,5.738086 +0.7645448,19,49.50595,4.30261 +0.733274,29,65.80698,4.546218 +0.7325852,69,130.5952,5.163234 +0.8181913,32,208.0369,4.790727 +0.8948076,14,251.6971,4.419942 +0.6873142,66,993.6974,4.985319 +0.7436848,83,858.6368,5.261985 +0.6818223,2,192.871,1.415344 +0.8277169,97,240.0575,5.609687 +0.5514969,34,543.0716,4.23445 +0.6439629,72,103.1574,5.01859 +0.6550325,8,781.9898,3.12958 +0.6659297,19,936.6371,3.964243 +0.5612373,26,409.1167,4.030819 +0.7397453,2,391.9286,1.594413 +0.6857085,21,758.4541,4.093299 +0.9099568,5,498.0438,3.549488 +0.6577822,82,897.6692,5.086357 +0.500702,72,793.448,4.732607 +0.6754568,15,469.036,3.780968 +0.8649758,48,711.3555,5.208689 +0.9421843,99,391.6264,6.079699 +0.5887436,41,416.7053,4.452386 +0.6453773,33,118.3290,4.412801 +0.5258648,2,717.5804,1.012781 +0.8994016,91,624.9795,5.777852 +0.9174562,84,784.1775,5.804003 +0.6026578,45,320.371,4.553099 +0.7835312,95,79.15228,5.568083 +0.8392914,9,942.9991,3.773431 +0.5477099,23,308.0442,3.902671 +0.6494744,58,864.7787,4.82106 +0.7872531,43,741.0002,4.895919 +0.7405713,93,631.6467,5.337746 +0.5555238,3,66.43276,1.728283 +0.8471521,97,209.7429,5.67748 +0.6715602,45,588.2055,4.675771 +0.7405694,92,749.2553,5.327916 +0.8410912,54,457.7499,5.221268 +0.8757793,69,65.46372,5.692853 +0.7991129,56,816.1179,5.11671 +0.7858377,48,416.5169,4.982474 +0.5952346,45,733.9624,4.532618 +0.6598747,90,74.41126,5.236416 +0.6534484,33,614.6466,4.398455 +0.8005183,24,76.41495,4.570226 +0.8149166,73,807.8775,5.343885 +0.6109188,96,881.563,5.117026 +0.5833846,73,947.8851,4.874815 +0.8332582,88,968.2539,5.518672 +0.6754794,51,86.20849,4.835891 +0.8493183,44,524.7134,5.098639 +0.8793586,56,342.3730,5.390078 +0.9408401,71,467.3872,5.848698 +0.8204796,62,735.2938,5.247582 +0.5961426,44,397.1915,4.521413 +0.9433597,94,329.7532,6.065443 +0.7392313,68,959.699,5.111895 +0.7280047,44,253.7937,4.791354 +0.9357452,29,118.6147,5.291764 +0.5828571,12,498.9039,3.375103 +0.854744,96,453.3386,5.65804 +0.6149968,12,355.3678,3.444266 +0.7638173,54,969.4548,5.001912 +0.7476226,28,43.02059,4.604015 +0.850204,8,125.8630,3.741361 +0.9339542,93,395.239,5.985747 +0.7262818,57,318.2872,4.97424 +0.8771483,94,12.71455,6.793142 +0.8665523,10,839.1073,3.979023 +0.5291674,79,823.083,4.845809 +0.8461989,59,832.332,5.287621 +0.777691,78,744.0216,5.296929 +0.9102575,62,170.4963,5.642964 +0.8246145,85,441.5772,5.486911 +0.7071098,60,820.3086,4.956934 +0.764151,61,333.7483,5.108028 +0.5108066,80,644.122,4.827203 +0.7611696,16,294.2634,4.053159 +0.8603075,85,563.544,5.58912 +0.8424507,6,611.1168,3.395027 +0.6682346,29,18.91631,4.544126 +0.8095137,51,364.8527,5.093099 +0.7633285,38,899.6544,4.74209 +0.7597025,69,397.2478,5.181009 +0.5636095,68,83.49942,4.830507 +0.6316091,93,477.1815,5.135545 +0.6936116,17,552.0311,3.931617 +0.6651088,22,472.8825,4.091816 +0.6405015,26,806.6532,4.177675 +0.7669137,26,886.3107,4.457322 +0.5879523,43,646.7016,4.485114 +0.6280889,46,774.7226,4.608213 +0.5473221,16,613.2056,3.574369 +0.7583959,54,624.1828,4.994282 +0.7935764,27,411.9446,4.567327 +0.6500053,78,147.9928,5.072065 +0.7342936,74,691.8988,5.164618 +0.6859192,72,91.85724,5.113456 +0.8017832,38,38.24381,5.052178 +0.7350069,90,887.2783,5.299267 +0.5002206,82,194.0412,4.837904 +0.7533237,28,614.7288,4.48545 +0.6214808,73,677.9877,4.941362 +0.6034381,66,904.2544,4.834818 +0.6045959,2,877.1838,1.202471 +0.9191417,39,669.9381,5.300754 +0.6090986,15,6.147124,4.030793 +0.728691,100,992.5201,5.357287 +0.5803494,68,749.7505,4.818952 +0.918249,54,720.6098,5.51828 +0.5866335,42,368.2729,4.46873 +0.6226366,31,350.1711,4.293452 +0.7953375,27,164.7003,4.599415 +0.9233556,20,545.3525,4.841628 +0.693924,97,812.52,5.270879 +0.937212,74,26.53409,6.523377 +0.6805653,66,47.1862,5.100028 +0.7598593,85,643.3909,5.317449 +0.8058038,66,761.6447,5.250769 +0.8822559,54,532.8792,5.361971 +0.614166,33,678.061,4.322546 +0.5167548,13,344.9084,3.321401 +0.737005,56,5.424758,6.144477 +0.629088,3,598.6654,1.901919 +0.7769968,90,932.9398,5.390308 +0.6373748,34,936.7224,4.388537 +0.6587434,3,926.8075,1.980018 +0.5993432,94,95.931,5.129989 +0.5982387,29,182.5984,4.201114 +0.751724,11,552.4189,3.684922 +0.9073577,62,482.2382,5.567918 +0.8150025,43,122.7201,5.036162 +0.9243253,80,255.6612,5.857814 +0.6357316,58,495.1672,4.800787 +0.6556389,55,670.6358,4.795017 +0.5861568,55,27.15277,4.798386 +0.5978707,90,24.57173,5.221317 +0.6896733,96,195.3440,5.286647 +0.7350595,10,527.6045,3.550931 +0.6093675,12,663.3941,3.429223 +0.9398014,83,857.6633,5.922471 +0.7034168,87,443.1984,5.22213 +0.8345302,96,179.5248,5.641706 +0.5045654,19,171.2933,3.657253 +0.620858,27,380.0845,4.17572 +0.7262354,41,629.6416,4.717633 +0.7868302,46,629.6635,4.946523 +0.5429665,45,958.0298,4.441479 +0.8342748,98,286.7754,5.626783 +0.8041123,3,250.152,2.447191 +0.9403823,19,121.3608,4.999848 +0.7703869,74,891.5093,5.241131 +0.6782789,68,560.84,4.994993 +0.7609106,83,106.6299,5.379529 +0.7128542,66,300.9281,5.053566 +0.7754385,59,752.3254,5.095663 +0.6046017,21,642.2645,3.927618 +0.8529898,27,139.1238,4.798382 +0.636852,89,561.0196,5.111686 +0.9056183,86,387.1032,5.785767 +0.8224681,98,77.91344,5.710191 +0.5523867,13,804.8892,3.388849 +0.8291812,27,953.4762,4.661662 +0.8177408,34,269.3261,4.826065 +0.7287865,84,327.9159,5.25608 +0.8268878,29,43.29403,4.896835 +0.8671857,63,838.8865,5.402451 +0.8206525,53,195.2608,5.177668 +0.885049,98,626.2624,5.76788 +0.8990428,17,665.0439,4.577079 +0.6184093,100,463.2699,5.16428 +0.6138274,89,98.59672,5.11673 +0.8989895,91,652.5609,5.774916 +0.9167108,2,451.0968,2.454734 +0.6440376,3,173.423,1.945308 +0.5069269,8,320.9178,2.808423 +0.8790291,26,308.1264,4.833917 +0.817952,64,604.5596,5.266006 +0.7055887,5,673.2377,2.751103 +0.5783787,47,488.5517,4.539385 +0.6382853,9,577.6296,3.211400 +0.7494703,97,843.769,5.381327 +0.928212,21,92.71302,5.017997 +0.8945758,52,541.9428,5.386425 +0.9273533,29,110.0864,5.241252 +0.8712363,22,733.1957,4.654638 +0.681578,15,609.8606,3.792997 +0.9367158,23,38.28047,5.357522 +0.6860431,23,526.7873,4.172916 +0.946944,59,935.9354,5.751069 +0.8369122,62,745.5164,5.295105 +0.6243354,12,113.3691,3.479315 +0.6961065,17,401.2276,3.940114 +0.7622478,63,32.24591,5.361083 +0.6641784,83,513.3596,5.112256 +0.8703236,94,373.651,5.703827 +0.804767,42,894.5125,4.922929 +0.9440183,8,589.8074,4.246075 +0.6568347,90,353.4818,5.162083 +0.6973254,49,536.6094,4.792459 +0.6027091,22,107.0788,3.987613 +0.8687902,8,406.4523,3.792343 +0.6808716,68,779.8336,4.996458 +0.8583502,77,543.5237,5.51734 +0.9003844,71,810.7064,5.613159 +0.6359577,39,653.3212,4.496185 +0.7515497,45,191.9571,4.87259 +0.8712656,28,769.8281,4.838561 +0.6389448,85,906.1354,5.078503 +0.8614109,75,455.1657,5.51486 +0.5651436,48,913.2336,4.529435 +0.7610586,36,14.70605,5.143973 +0.8849197,17,692.9311,4.509625 +0.5267559,97,238.4357,5.000668 +0.8903445,65,446.8721,5.526908 +0.8770817,38,611.0206,5.090063 +0.8014531,67,382.1654,5.264014 +0.8535349,37,465.0802,4.989573 +0.5623505,16,46.12436,3.645094 +0.5837253,64,787.677,4.779464 +0.723658,50,863.5468,4.857386 +0.8564433,31,155.9212,4.911108 +0.9016261,37,59.11041,5.373747 +0.7303029,86,781.0103,5.259658 +0.7005043,98,556.3923,5.295225 +0.7180099,50,367.8436,4.856627 +0.9047978,22,993.9773,4.801455 +0.9126542,43,635.5784,5.335726 +0.7540421,2,224.3753,1.645104 +0.6360051,35,219.6251,4.424294 +0.8953461,53,753.7426,5.395435 +0.6365136,59,401.6807,4.817458 +0.928798,33,286.4699,5.268117 +0.9313734,89,13.00577,7.330162 +0.6127697,76,716.6624,4.955088 +0.7783512,32,544.107,4.654195 +0.8174788,20,838.73,4.389137 +0.8821462,49,274.2839,5.317271 +0.8402305,17,112.4692,4.387457 +0.7712608,36,101.398,4.78705 +0.71034,76,598.5716,5.136129 +0.5360852,35,592.9235,4.230668 +0.6590919,31,385.5477,4.36415 +0.9290205,86,167.1354,5.972936 +0.764866,11,895.893,3.718443 +0.8687183,76,210.8759,5.585765 +0.5457105,93,738.9931,4.990496 +0.5768204,27,113.9398,4.109705 +0.6897985,28,949.4001,4.338094 +0.7089148,99,806.9645,5.313572 +0.8057506,75,85.7964,5.453375 +0.8763766,4,506.4466,3.116303 +0.7624966,17,586.6706,4.099870 +0.939108,20,231.2577,4.979989 +0.5127664,27,809.2373,3.972834 +0.8927624,97,938.547,5.78237 +0.932796,100,77.90402,6.235576 +0.8703162,49,4.716565,7.690852 +0.8896408,5,86.81217,3.474228 +0.9108773,32,432.7296,5.126532 +0.6567976,82,872.5033,5.084811 +0.7518393,44,331.6293,4.839539 +0.5124162,27,275.0050,3.97686 +0.8612289,60,830.469,5.348553 +0.6776792,99,277.8799,5.27316 +0.8132378,86,368.4492,5.46904 +0.8724424,21,273.9887,4.644203 +0.6566044,64,86.6614,4.967259 +0.7538613,57,913.709,5.018571 +0.7935557,91,850.0482,5.438334 +0.5375645,19,508.9865,3.712566 +0.661665,75,580.1227,5.033955 +0.7219753,29,630.5849,4.439406 +0.5929547,38,192.0488,4.410132 +0.5711968,33,901.1568,4.242911 +0.9488055,89,921.9764,6.028084 +0.525361,88,201.8421,4.930438 +0.6649385,20,472.2082,4.010333 +0.5811662,13,152.8478,3.457696 +0.6499022,49,988.2758,4.695065 +0.677492,61,96.13616,4.969053 +0.590887,55,668.5633,4.679121 +0.759376,56,66.90409,5.134457 +0.5629632,4,81.52404,2.133665 +0.9168937,2,602.7444,2.454823 +0.5553233,47,641.6247,4.497973 +0.8793849,54,14.76064,6.1751 +0.8370545,23,53.10852,4.706975 +0.9032895,80,243.7683,5.753165 +0.664133,13,472.0562,3.625055 +0.7629233,86,414.7802,5.341122 +0.8270712,100,770.9533,5.589796 +0.6800086,13,53.56172,3.715934 +0.7511743,14,774.9862,3.899366 +0.7024368,27,108.2775,4.378215 +0.6683634,88,632.6104,5.158543 +0.8007708,35,679.7018,4.779465 +0.748455,68,74.26819,5.238721 +0.7580406,40,830.2967,4.768767 +0.6867868,16,479.4874,3.863907 +0.6345033,24,263.9350,4.108572 +0.9007885,20,503.914,4.718357 +0.7528125,81,679.4688,5.26777 +0.722395,70,318.6385,5.114427 +0.6747357,84,329.5006,5.148071 +0.5546724,16,689.949,3.588185 +0.765431,96,635.3626,5.413237 +0.5213844,28,166.1044,4.028827 +0.9055309,60,129.6213,5.624808 +0.5553817,35,980.6865,4.262468 +0.7184163,69,195.7097,5.111313 +0.5517323,18,802.4538,3.689246 +0.8142866,16,192.9957,4.220405 +0.8211981,3,258.9440,2.515333 +0.7878401,40,134.0559,4.89549 +0.8678996,45,140.8237,5.2421 +0.8137556,53,902.648,5.115614 +0.8358842,84,525.9433,5.506658 +0.6276921,2,695.4127,1.262518 +0.5544768,23,608.4648,3.911448 +0.7520554,22,888.8863,4.285105 +0.8799472,80,81.06966,5.776644 +0.8867459,71,192.9068,5.616458 +0.7170759,68,781.6296,5.06764 +0.614698,86,809.9607,5.046108 +0.582755,27,459.0978,4.101695 +0.615332,92,544.057,5.098476 +0.6483776,30,593.08,4.312197 +0.5182611,100,523.3287,5.001569 +0.7584443,98,146.7554,5.465532 +0.5973876,44,322.7757,4.525969 +0.6765142,38,715.8464,4.554027 +0.858699,64,971.8032,5.381975 +0.8657619,41,119.6429,5.179392 +0.8041556,5,304.7493,3.062042 +0.8865578,21,170.7769,4.726991 +0.6362995,16,81.66367,3.784736 +0.8037017,23,319.2337,4.474112 +0.935349,58,92.10311,5.834605 +0.6449784,75,534.9246,5.004607 +0.933069,77,135.6208,5.9515 +0.6285273,30,718.4376,4.272305 +0.7745992,51,646.361,4.990833 +0.9437443,28,201.3896,5.2771 +0.5553825,35,84.21426,4.292884 +0.691553,44,561.0249,4.699133 +0.7143561,74,606.226,5.125183 +0.9150011,64,868.6043,5.61144 +0.8900851,64,962.8469,5.497329 +0.7627361,89,839.356,5.35164 +0.5916001,19,553.8613,3.815483 +0.9347603,73,40.74093,6.246896 +0.611588,53,781.641,4.686268 +0.8381018,12,577.5503,4.031852 +0.7502626,8,508.3221,3.376268 +0.9077881,81,485.243,5.747453 +0.6604791,57,138.3778,4.864026 +0.5258188,88,750.15,4.919488 +0.7342328,75,540.5984,5.177501 +0.8287273,9,225.8167,3.751461 +0.9260355,9,459.3007,4.212197 +0.6270818,49,708.4415,4.655174 +0.5232657,73,949.5204,4.777819 +0.7676596,92,877.2513,5.384683 +0.8505276,37,776.581,4.970133 +0.9067703,50,944.0097,5.403308 +0.6516737,4,969.1537,2.340581 +0.5532437,8,799.1578,2.9033 +0.6457954,35,483.9951,4.432293 +0.6798643,19,401.1541,4.00008 +0.8913252,67,246.9467,5.579023 +0.8724801,71,237.0759,5.545666 +0.611114,8,908.8348,3.028642 +0.6440464,100,711.3521,5.203401 +0.5185833,39,497.3006,4.288981 +0.5987208,71,553.9285,4.883768 +0.8946845,33,764.2923,5.057894 +0.7702922,34,891.2136,4.674803 +0.8601194,27,672.5945,4.770744 +0.899896,38,752.2178,5.183315 +0.705802,48,362.9667,4.800478 +0.9295424,13,589.0369,4.541681 +0.6700632,91,571.293,5.186371 +0.7856916,3,348.2827,2.375896 +0.5164215,12,683.4326,3.24084 +0.5999788,60,659.1165,4.760225 +0.7430723,82,309.4263,5.271649 +0.6201451,87,102.5936,5.110393 +0.7364097,8,993.3758,3.334495 +0.889546,33,426.7778,5.047535 +0.7509362,51,760.6958,4.93314 +0.9496297,54,579.4342,5.726496 +0.7411664,9,999.2333,3.463098 +0.7252757,38,63.7578,4.747703 +0.8886869,59,85.71176,5.588225 +0.6316102,77,617.5745,4.99833 +0.6470583,23,802.9517,4.088519 +0.7556348,18,182.8062,4.150528 +0.6398546,83,429.5057,5.070863 +0.8742836,47,71.49425,5.384054 +0.9243806,69,251.6256,5.760898 +0.8849305,76,462.3092,5.609127 +0.6190392,89,919.5525,5.076913 +0.7086243,74,75.11446,5.201722 +0.611401,100,285.8263,5.160096 +0.5438444,40,553.223,4.352044 +0.6381758,74,417.0031,4.985918 +0.5709375,60,606.9691,4.711341 +0.6656767,8,591.2158,3.155852 +0.6668269,77,838.8434,5.058611 +0.6259845,41,256.3687,4.527205 +0.6382646,92,531.2887,5.138163 +0.5790715,42,133.6754,4.471822 +0.5505636,44,53.26842,4.487644 +0.7873557,18,109.4958,4.261192 +0.9278928,34,803.4808,5.25132 +0.6506427,40,322.5025,4.55164 +0.636289,14,439.4037,3.632874 +0.5138037,17,541.6375,3.566823 +0.7490946,24,208.8606,4.370446 +0.5264396,24,176.6778,3.905171 +0.5862563,42,460.3187,4.46604 +0.8596417,57,917.1627,5.306278 +0.5490575,43,659.7477,4.417489 +0.8022336,2,611.0282,1.823408 +0.62453,71,712.8487,4.926108 +0.9447033,25,993.19,5.144499 +0.6984111,12,901.4631,3.626986 +0.8310141,56,298.2470,5.229228 +0.7551605,74,724.2943,5.209182 +0.9028476,48,179.1977,5.421774 +0.5226023,80,250.3484,4.853282 +0.6273796,15,284.8897,3.680715 +0.5101388,9,799.4037,2.937410 +0.8970192,84,201.2089,5.771734 +0.7243075,13,98.06574,3.799825 +0.6452252,9,875.8479,3.225854 +0.6703307,76,359.7317,5.066694 +0.7062982,29,334.3508,4.412282 +0.9362348,36,821.206,5.344544 +0.7755292,52,741.3775,5.005386 +0.7115857,52,936.8725,4.860348 +0.6793413,30,229.3854,4.388151 +0.6130655,31,660.8805,4.270066 +0.7027686,53,625.6065,4.860058 +0.6274324,12,824.7647,3.466937 +0.7963726,5,994.202,3.027711 +0.8681058,60,90.89657,5.501354 +0.6015066,36,175.3427,4.384748 +0.6447442,38,735.3686,4.491722 +0.6795336,70,721.4585,5.015486 +0.7723539,75,896.9785,5.254934 +0.9078405,81,367.5354,5.759166 +0.6164017,8,73.57849,3.064286 +0.8370671,27,296.2669,4.70746 +0.797849,35,873.8625,4.76869 +0.7180328,33,339.4326,4.540756 +0.6986307,40,390.1059,4.645778 +0.8793415,2,188.5154,2.204849 +0.7290775,37,189.5800,4.669984 +0.888677,11,590.1095,4.166872 +0.7031697,39,530.7594,4.631734 +0.6527077,20,552.1618,3.98336 +0.6907402,65,105.7456,5.039006 +0.8501955,84,714.7776,5.543259 +0.6880136,85,948.7286,5.166637 +0.9312943,36,281.7262,5.347377 +0.7972013,66,878.5866,5.226604 +0.8539718,31,911.604,4.849066 +0.705903,64,72.05808,5.091427 +0.6510286,57,730.2199,4.812274 +0.5237086,8,359.0167,2.843074 +0.8376964,23,287.2865,4.58462 +0.9112111,65,439.1747,5.621653 +0.7693145,21,654.116,4.293623 +0.7690674,6,60.02425,3.182115 +0.8479559,89,46.64795,5.840863 +0.7676322,73,254.1046,5.252961 +0.8763505,43,33.84927,5.508428 +0.6333285,91,779.6607,5.118105 +0.5761417,16,363.9524,3.632995 +0.5943329,67,953.5303,4.830177 +0.886703,87,255.9935,5.733959 +0.7707937,56,995.4612,5.044243 +0.8661679,83,71.95059,5.766113 +0.6604832,48,823.6246,4.70053 +0.6021952,66,988.3845,4.832242 +0.8521975,100,10.07298,6.88639 +0.9453367,53,680.6012,5.676072 +0.8578552,45,555.8434,5.142528 +0.7095984,97,328.0429,5.316697 +0.7875645,82,318.109,5.374691 +0.7601498,37,449.384,4.7226 +0.8680032,78,332.5949,5.575869 +0.8951179,40,810.7306,5.196888 +0.7677873,36,646.9899,4.715364 +0.6233557,40,133.7175,4.51815 +0.6236224,31,282.5713,4.298041 +0.7886229,45,889.8385,4.930839 +0.9113417,13,704.8534,4.424861 +0.8048366,83,912.4802,5.403325 +0.8876121,73,97.97675,5.714737 +0.6566803,93,847.2992,5.173379 +0.7361686,23,484.196,4.288003 +0.6405429,27,119.6107,4.237244 +0.8265951,70,771.4504,5.348116 +0.9063825,83,216.2709,5.801286 +0.7329975,51,823.1752,4.892481 +0.707735,32,819.8191,4.483689 +0.8063754,92,985.24,5.475727 +0.5671987,36,8.130045,4.622987 +0.5949391,74,888.767,4.904264 +0.8925676,86,470.7429,5.72116 +0.9111893,86,206.8652,5.852285 +0.868771,39,701.3807,5.074553 +0.6581741,57,851.498,4.824371 +0.7124499,5,309.5104,2.773728 +0.6160275,3,927.5913,1.867738 +0.9077186,87,515.2092,5.791704 +0.6809903,100,251.1352,5.289401 +0.8249242,51,644.1882,5.124642 +0.5007189,63,489.9313,4.634174 +0.5823059,34,995.1942,4.286632 +0.8764704,96,332.826,5.745166 +0.9279742,62,399.9774,5.684188 +0.6058798,51,161.1977,4.668592 +0.6692909,73,918.8406,5.024354 +0.8575137,59,187.4093,5.376903 +0.7945395,21,115.6826,4.410157 +0.5041056,70,246.2471,4.72404 +0.6811694,74,584.603,5.06067 +0.5047193,32,918.3743,4.101420 +0.62641,45,241.3786,4.601556 +0.9231728,95,684.2123,5.916083 +0.8906883,62,79.7124,5.646251 +0.6451526,81,823.5166,5.055857 +0.5843882,2,572.7973,1.152088 +0.9415851,71,805.8501,5.836022 +0.5650946,58,264.105,4.683902 +0.6622129,74,503.0527,5.02709 +0.5227259,6,595.5645,2.522141 +0.7577065,89,300.0612,5.362241 +0.6885727,58,634.3311,4.897823 +0.6582183,24,597.0416,4.148695 +0.7621428,54,4.677027,6.505218 +0.6300545,61,732.2958,4.824428 +0.717593,81,639.7483,5.194602 +0.8089698,37,624.8774,4.84518 +0.8819809,71,110.4756,5.653277 +0.6684123,12,487.6716,3.55997 +0.731306,31,689.6599,4.512494 +0.7449809,77,364.2442,5.22728 +0.8060204,30,394.1408,4.685581 +0.7902367,72,962.9857,5.268578 +0.6622077,91,992.0186,5.166785 +0.9423636,49,688.1545,5.601706 +0.6138338,28,490.9497,4.190094 +0.6153132,49,371.723,4.639831 +0.5919034,26,88.76052,4.115030 +0.6712624,15,954.8967,3.767796 +0.7370935,16,271.2719,3.991453 +0.8260105,53,607.0709,5.156222 +0.7039847,34,370.7429,4.531785 +0.6835765,63,263.0202,4.963496 +0.6792575,13,78.47224,3.694629 +0.6581926,70,940.6411,4.97371 +0.6659625,74,701.9212,5.030244 +0.943103,48,552.5686,5.599539 +0.8172628,97,241.8532,5.579464 +0.6088576,48,431.5509,4.610688 +0.9066039,89,915.7831,5.786188 +0.8887035,57,401.5979,5.434053 +0.6746067,59,188.1885,4.906911 +0.6599387,2,803.0654,1.350025 +0.9274535,2,764.3575,2.542979 +0.5526748,73,4.931036,5.369283 +0.685566,91,873.84,5.210347 +0.9252521,76,580.645,5.788709 +0.624663,50,56.6223,4.739905 +0.8917172,14,592.4602,4.385331 +0.8361517,93,147.1155,5.641347 +0.855131,5,697.6645,3.25786 +0.616702,63,697.7248,4.82506 +0.7131682,24,436.9471,4.270307 +0.5582717,56,141.712,4.656545 +0.8133165,99,914.7708,5.543544 +0.7850109,35,122.0806,4.790481 +0.6573884,93,362.8063,5.185657 +0.6709559,81,324.0598,5.115466 +0.675296,3,276.5954,2.028428 +0.744242,41,77.85827,4.838235 +0.8627685,88,504.0866,5.623501 +0.823486,31,633.4859,4.754332 +0.9152854,22,663.1988,4.862911 +0.889191,25,632.754,4.830601 +0.5320597,23,522.3386,3.870895 +0.8348069,4,353.5423,2.926616 +0.5506804,92,605.5381,4.991792 +0.7402406,91,248.1225,5.345439 +0.6606832,91,199.1307,5.191928 +0.6876065,25,697.7802,4.243088 +0.8396906,17,69.82845,4.424644 +0.8303857,99,915.3883,5.589564 +0.670205,52,201.1685,4.801504 +0.5688656,16,839.9051,3.615185 +0.6059302,57,884.9344,4.730385 +0.625943,13,421.1995,3.542213 +0.579431,11,698.7441,3.282398 +0.5107836,30,521.7842,4.059707 +0.7034076,59,806.1451,4.937422 +0.5348029,85,608.8314,4.909535 +0.8178558,52,767.8403,5.115544 +0.8021263,97,609.5435,5.508143 +0.6139589,32,718.7935,4.297009 +0.6199155,18,820.2245,3.822254 +0.8459365,22,737.9467,4.560176 +0.7804563,6,534.7507,3.173321 +0.5024161,35,483.8863,4.173427 +0.8757202,43,105.3846,5.269118 +0.5523042,3,511.2241,1.711368 +0.710674,44,138.0479,4.774404 +0.8872324,57,781.0616,5.410725 +0.6919563,13,743.3296,3.686274 +0.5287773,88,847.8963,4.923581 +0.6964034,68,916.3211,5.024973 +0.6097059,34,425.8519,4.341618 +0.6914693,5,342.4144,2.715573 +0.6908814,75,600.6959,5.088477 +0.7843654,22,908.377,4.369244 +0.6641371,52,390.4209,4.775486 +0.7738185,93,701.611,5.409122 +0.8668095,75,18.17850,6.218107 +0.8612623,84,728.9866,5.578543 +0.7244234,31,540.4559,4.499312 +0.8197609,4,359.5769,2.865559 +0.7343252,8,199.2936,3.341473 +0.6836545,55,307.1725,4.859945 +0.8095471,62,373.0194,5.23192 +0.7809187,81,376.8042,5.344588 +0.7497668,97,103.3747,5.465082 +0.9281159,54,946.8552,5.567694 +0.7009217,95,200.3139,5.300944 +0.5690716,17,188.3412,3.680089 +0.7616844,55,650.7446,5.014634 +0.7634251,52,850.2973,4.974944 +0.6935619,21,385.6687,4.116289 +0.570187,27,798.2554,4.075779 +0.8573198,35,201.5977,4.991557 +0.9254133,3,227.7771,3.100818 +0.6926173,80,169.8465,5.169298 +0.7957502,80,579.6955,5.362447 +0.8909846,60,580.5683,5.467522 +0.6101913,7,739.8612,2.885962 +0.9292679,60,774.9304,5.648684 +0.6020853,83,329.8084,5.008931 +0.8730834,90,975.1034,5.659242 +0.615229,29,780.1903,4.218847 +0.6368305,62,272.5524,4.861233 +0.785301,88,625.0687,5.400485 +0.7612865,62,271.0423,5.119176 +0.6491867,8,449.3793,3.117950 +0.7028936,21,964.8851,4.130015 +0.7351485,36,435.3573,4.643088 +0.5901236,54,682.5866,4.66379 +0.8711818,7,971.5228,3.668632 +0.7885463,27,710.0058,4.545948 +0.8615259,27,922.5975,4.772005 +0.9423586,100,857.2488,6.056786 +0.5641551,45,95.40686,4.508179 +0.5478364,32,717.8125,4.177136 +0.9463165,16,838.3264,4.827952 +0.6402324,83,670.1578,5.066309 +0.8372235,89,450.2324,5.553761 +0.9247225,92,559.3225,5.910356 +0.8252188,14,982.6037,4.116096 +0.7574355,58,76.46756,5.140588 +0.641243,6,230.5134,2.795860 +0.5718324,66,218.8287,4.79571 +0.8140738,93,464.7936,5.51726 +0.9040285,7,963.9252,3.83736 +0.9163233,29,109.8488,5.171177 +0.8748685,10,834.4159,4.015456 +0.879919,59,813.5775,5.404823 +0.7757908,51,24.82199,5.310636 +0.7253728,87,268.653,5.279343 +0.7804497,47,914.5564,4.941718 +0.8855489,99,398.2152,5.791743 +0.6244977,39,690.1232,4.47439 +0.7809398,7,858.4253,3.331407 +0.9274042,80,869.2504,5.823213 +0.6230907,68,340.9755,4.900364 +0.7848126,79,316.7394,5.342187 +0.8068917,87,468.6103,5.45299 +0.8530915,95,969.5945,5.628566 +0.7027934,73,539.2994,5.093997 +0.8731742,84,621.7372,5.623118 +0.7634371,11,181.9686,3.733192 +0.6286905,42,288.0719,4.549231 +0.8355486,81,770.2646,5.473221 +0.7263397,96,641.287,5.329899 +0.7291552,22,869.557,4.22971 +0.7014426,13,170.1686,3.725237 +0.568906,9,932.683,3.058732 +0.6805077,21,636.6685,4.083097 +0.8519636,19,719.8393,4.465273 +0.5840272,10,293.2955,3.201459 +0.9297056,42,307.3728,5.441351 +0.8996739,11,116.8909,4.276207 +0.7365314,67,154.0723,5.141475 +0.763537,20,855.483,4.236114 +0.9162934,13,583.4637,4.456551 +0.7383305,87,578.0058,5.288548 +0.6220495,76,653.0012,4.971777 +0.6959088,17,204.1746,3.949512 +0.9408439,64,526.8199,5.776257 +0.9072844,39,816.4094,5.235457 +0.614806,36,866.7964,4.392034 +0.8616143,15,538.4074,4.31235 +0.5916647,82,276.8439,4.985187 +0.6381437,56,308.9643,4.785542 +0.6102399,84,288.0863,5.033928 +0.881096,65,423.3302,5.491607 +0.8805683,77,63.34668,5.801957 +0.8317284,24,465.7188,4.587363 +0.938735,16,346.6328,4.786943 +0.7878217,76,601.5734,5.306758 +0.8145564,100,76.89838,5.701038 +0.8641405,21,465.8502,4.597313 +0.9193547,50,890.4468,5.467787 +0.7352061,62,621.5478,5.042233 +0.875424,97,663.1315,5.724161 +0.5947927,15,437.6885,3.610047 +0.9293856,42,154.1849,5.489918 +0.8981893,100,195.0101,5.895842 +0.7722383,39,397.162,4.794676 +0.9468243,2,427.845,2.741961 +0.7672563,5,64.92349,2.969334 +0.753621,75,98.68655,5.295252 +0.7196577,37,662.6364,4.62432 +0.6445426,69,400.8762,4.947273 +0.621717,58,797.6387,4.77164 +0.754107,15,637.9203,3.969023 +0.7000804,99,874.8527,5.295806 +0.6727205,31,348.9427,4.393295 +0.7419021,51,307.5882,4.928106 +0.9111804,26,953.7102,4.960184 +0.6518057,68,78.44112,5.009199 +0.7369495,90,950.977,5.302565 +0.5943179,38,567.3262,4.399971 +0.9148237,17,146.5165,4.716318 +0.5039681,13,962.0642,3.293958 +0.8940384,66,260.9585,5.577167 +0.6596946,18,58.33929,3.961345 +0.7745604,80,873.7772,5.304947 +0.5579154,44,577.4417,4.451439 +0.6792655,79,305.888,5.114813 +0.7721706,74,725.1806,5.247874 +0.8730904,27,452.3935,4.827657 +0.8668253,43,479.2732,5.145368 +0.9243933,68,715.7662,5.70527 +0.8697712,45,759.5009,5.179335 +0.5704939,24,771.9525,3.976776 +0.849549,21,171.7464,4.57335 +0.7153914,68,756.1855,5.064555 +0.7469934,89,37.00684,5.545569 +0.8980766,93,735.0168,5.782137 +0.6740698,15,908.684,3.774217 +0.7262363,18,196.8211,4.073023 +0.7726955,93,825.9488,5.404193 +0.7877387,57,83.19955,5.202352 +0.5402169,35,836.5996,4.236559 +0.647406,92,696.285,5.15123 +0.6369996,43,600.33,4.574637 +0.5011999,34,536.5494,4.147083 +0.5253697,34,959.3483,4.186866 +0.6654399,10,953.6924,3.376122 +0.5754832,59,82.33117,4.746022 +0.6149122,12,758.6291,3.44049 +0.7273927,5,827.2032,2.811743 +0.765783,4,480.0208,2.671068 +0.8026067,20,628.1018,4.346873 +0.6688459,16,552.1669,3.822802 +0.654652,65,429.9494,4.921309 +0.5930605,54,299.062,4.676825 +0.91803,98,475.8612,5.921616 +0.8586014,94,822.9594,5.641858 +0.8724855,40,320.3798,5.126823 +0.9115961,67,663.3112,5.630971 +0.6378116,67,41.66062,5.02444 +0.783027,17,444.7541,4.159232 +0.8044376,26,517.2797,4.564801 +0.884418,84,946.382,5.656019 +0.9450776,82,74.40857,6.2069 +0.922469,81,659.5106,5.811031 +0.7723949,73,576.8139,5.242505 +0.914753,7,951.6982,3.902467 +0.808698,53,628.3094,5.106761 +0.785287,4,458.7135,2.737001 +0.6806215,13,703.8973,3.660244 +0.8762955,72,590.0658,5.53288 +0.8162853,79,92.18472,5.514161 +0.5399384,14,760.7746,3.434936 +0.724187,81,366.0025,5.218172 +0.5878947,23,272.8676,3.979876 +0.6592433,83,684.7305,5.099926 +0.886695,15,846.1366,4.414048 +0.7518114,65,513.9724,5.11545 +0.9269379,97,254.9159,5.999051 +0.7133172,82,926.9479,5.190505 +0.7594595,8,51.29232,3.464126 +0.8804678,52,914.019,5.318195 +0.5581051,54,949.4543,4.607886 +0.7872128,50,176.9121,5.045582 +0.7148681,29,874.4857,4.420948 +0.5074475,99,315.6612,4.981299 +0.6011498,70,222.744,4.89042 +0.8461398,49,937.784,5.155603 +0.9156136,74,311.1483,5.746345 +0.8033553,5,645.5019,3.053856 +0.6536788,98,629.0644,5.207469 +0.6301262,28,942.7225,4.217727 +0.871035,28,588.5174,4.841785 +0.9431953,11,805.0258,4.504676 +0.7250134,37,667.4511,4.636032 +0.8318205,86,759.111,5.502966 +0.7024738,45,490.5817,4.740243 +0.8091045,40,202.2661,4.934256 +0.6403498,12,429.5813,3.497927 +0.9449746,23,50.44319,5.349677 +0.851621,98,259.8235,5.685683 +0.9016514,15,42.46861,4.69127 +0.5920015,28,439.8243,4.149594 +0.6072063,3,576.5894,1.845912 +0.9052984,24,276.0850,4.899321 +0.6634726,92,703.5221,5.179664 +0.7561353,16,380.4236,4.035749 +0.8122183,94,804.0761,5.508063 +0.8418656,60,978.833,5.283574 +0.6981374,5,387.5784,2.732931 +0.5241897,21,733.9929,3.775666 +0.6772153,90,38.5611,5.353059 +0.6846175,9,523.6271,3.320686 +0.8614306,19,100.2818,4.57258 +0.9212194,65,524.0826,5.667082 +0.736799,48,376.7794,4.867054 +0.775878,51,470.2745,4.999156 +0.94356,27,448.0736,5.20886 +0.5971862,18,325.373,3.781982 +0.8788234,2,197.9009,2.201285 +0.7207136,56,182.7896,4.966495 +0.8813179,57,305.8846,5.41493 +0.6516088,44,977.5808,4.616521 +0.9432949,83,632.2853,5.954806 +0.8991265,89,533.6602,5.76696 +0.8716255,37,648.0715,5.048531 +0.5811219,78,61.75932,4.982568 +0.8066535,63,375.9281,5.235102 +0.6826185,95,692.657,5.2371 +0.9434476,75,200.0213,5.960525 +0.9371716,19,309.1242,4.912451 +0.6332529,77,912.1464,4.998099 +0.8121484,83,763.5391,5.42491 +0.8215588,72,196.3495,5.398243 +0.8692113,67,150.1000,5.527059 +0.9309966,66,598.433,5.728737 +0.8617159,3,323.4457,2.697052 +0.9094263,53,69.54,5.657197 +0.627946,100,53.37154,5.273825 +0.5469653,9,801.0173,3.013104 +0.9056166,76,348.6382,5.709042 +0.9144018,46,166.2865,5.457833 +0.7024664,26,991.9227,4.305153 +0.5906725,59,693.7827,4.731336 +0.9257523,32,898.1296,5.193483 +0.65419,10,994.8087,3.350149 +0.573937,57,11.15804,4.950549 +0.8722816,12,834.003,4.163117 +0.6104388,69,857.7779,4.879681 +0.7395572,22,625.7083,4.257045 +0.9465412,34,400.3912,5.400517 +0.889617,20,67.53875,4.789287 +0.6603941,62,557.3134,4.894162 +0.6572997,72,275.2044,5.008766 +0.6317894,61,893.6425,4.82618 +0.8166771,23,925.1903,4.497861 +0.7286248,2,555.7641,1.557043 +0.5152166,94,960.7927,4.949714 +0.9101605,61,986.4156,5.553379 +0.6866718,89,327.3256,5.211781 +0.8399551,77,168.6181,5.511889 +0.6353491,11,670.0163,3.401654 +0.853916,50,636.4847,5.201295 +0.8817695,88,767.3826,5.680463 +0.7185712,51,241.4021,4.882724 +0.770894,12,679.0355,3.816384 +0.9098048,72,985.2333,5.661611 +0.7218967,37,816.4549,4.627383 +0.7243346,61,997.2886,5.002563 +0.6719135,71,854.4393,5.009869 +0.8973335,85,484.1437,5.732463 +0.7554376,48,525.1413,4.903844 +0.9430205,70,144.7852,5.949187 +0.5493725,55,24.62404,4.720334 +0.5971568,6,909.9559,2.686758 +0.5690979,11,348.2237,3.263709 +0.7511994,95,182.5334,5.413766 +0.7210895,57,765.5559,4.949078 +0.8161127,3,732.3479,2.489221 +0.8336693,15,791.3677,4.204955 +0.8948794,18,254.5316,4.625170 +0.6632123,98,92.93594,5.287683 +0.8910968,56,3.694522,9.14612 +0.6376692,36,989.8612,4.434143 +0.80947,80,114.0895,5.478967 +0.82957,24,224.7908,4.599062 +0.8977277,50,151.2525,5.440728 +0.8022287,100,632.9642,5.528033 +0.7857295,10,423.1267,3.696796 +0.7545248,86,527.6158,5.317099 +0.6009039,81,487.6485,4.984334 +0.6896002,59,438.7283,4.917154 +0.6974143,13,814.5804,3.698697 +0.7301658,70,278.3712,5.134808 +0.6591984,4,657.8318,2.360831 +0.7862776,80,954.3117,5.331615 +0.8580173,76,922.4202,5.496869 +0.7225116,83,660.0493,5.22118 +0.6513679,23,295.4721,4.105703 +0.8454044,52,928.4528,5.195344 +0.7959045,85,906.7124,5.397084 +0.731706,80,590.0431,5.216045 +0.7256962,76,36.67469,5.365805 +0.6209987,91,219.8982,5.116044 +0.7788926,92,471.59,5.421277 +0.9395612,67,773.8309,5.785787 +0.5712265,40,617.832,4.399043 +0.8177507,36,918.277,4.845297 +0.5308056,7,784.1608,2.711805 +0.9239735,91,592.1715,5.897353 +0.6734823,5,703.1057,2.665332 +0.552545,50,9.700298,4.805741 +0.8571885,61,401.3484,5.362952 +0.8276853,100,722.3954,5.592684 +0.78248,79,226.7434,5.349608 +0.7540784,70,289.0356,5.186986 +0.679809,84,328.1678,5.157819 +0.5346721,5,321.7632,2.336343 +0.5046181,10,800.9464,3.034873 +0.6086207,41,363.4659,4.489845 +0.9056507,51,45.66387,5.714624 +0.757739,92,34.72594,5.618443 +0.7988586,13,563.46,3.971763 +0.6246819,98,911.8113,5.154245 +0.9473038,50,313.7374,5.683982 +0.8610659,43,569.1981,5.120719 +0.9211183,50,72.18092,5.677973 +0.6910641,44,79.55915,4.761997 +0.8947933,94,199.2544,5.837905 +0.6185201,93,777.6178,5.108263 +0.943615,39,746.2719,5.454103 +0.7002987,96,988.1737,5.273948 +0.7553033,39,915.4639,4.742379 +0.7679916,50,737.3042,4.958796 +0.6890029,94,907.0683,5.238912 +0.6199692,74,986.7426,4.946051 +0.6411281,94,818.5881,5.153933 +0.8464514,65,70.51132,5.514609 +0.6060643,92,352.4973,5.088319 +0.5031575,80,710.7902,4.814834 +0.5938577,14,609.6362,3.542741 +0.5328757,73,26.24858,4.894656 +0.865526,20,873.1708,4.555331 +0.7964953,62,272.376,5.207187 +0.7383672,76,876.4028,5.189204 +0.7729914,15,22.17502,4.243482 +0.9011562,48,287.6424,5.383655 +0.8172952,52,437.9903,5.124289 +0.5405907,22,802.478,3.846356 +0.6312621,7,216.3909,2.94054 +0.8226957,52,804.0583,5.128694 +0.885333,73,13.19686,6.600686 +0.7457342,60,609.2144,5.041968 +0.6578178,44,288.0032,4.641378 +0.83535,98,131.3518,5.685504 +0.8930805,88,976.9815,5.719899 +0.9396818,36,611.7228,5.374934 +0.777755,41,954.446,4.833966 +0.7981147,97,369.9938,5.510893 +0.944999,93,954.528,6.027065 +0.6157446,41,907.7825,4.495908 +0.7380916,76,861.9726,5.188795 +0.839211,68,23.80187,5.830786 +0.8532856,89,262.6102,5.625921 +0.6775974,17,292.3724,3.901788 +0.5828361,39,703.1539,4.39878 +0.8850796,24,198.9660,4.816882 +0.5914885,3,181.9281,1.809612 +0.5142923,5,830.6914,2.289293 +0.6603836,44,766.019,4.634749 +0.7912155,30,894.1168,4.632969 +0.7526184,71,153.6191,5.221186 +0.9332683,65,964.548,5.720877 +0.8309404,85,873.4239,5.490343 +0.625892,74,27.07511,5.129885 +0.5828644,56,693.3597,4.678749 +0.5136066,79,925.8308,4.820971 +0.8330586,80,19.34037,6.035081 +0.7008366,51,404.9684,4.833525 +0.8843272,91,152.3932,5.796872 +0.9225516,25,667.9643,5.000335 +0.8791967,66,828.0534,5.477954 +0.5186196,24,709.4802,3.882467 +0.751543,9,311.5484,3.49974 +0.7436109,27,477.438,4.435924 +0.6807055,87,495.5713,5.176597 +0.7510662,82,965.3252,5.268203 +0.7277244,57,502.561,4.968428 +0.9410907,91,166.2730,6.091714 +0.6792364,33,490.5878,4.452396 +0.7848101,10,12.64165,4.03457 +0.942731,30,198.6954,5.320442 +0.7519409,59,846.5128,5.039781 +0.5020636,78,693.9159,4.794566 +0.7176895,90,868.5585,5.264436 +0.5767474,15,14.59399,3.713746 +0.5775503,39,391.2338,4.393338 +0.6690003,27,870.2484,4.265722 +0.7235208,94,69.99504,5.418828 +0.8928368,32,934.5482,5.024385 +0.6799028,62,244.2493,4.946376 +0.5802962,44,262.7254,4.497853 +0.5605126,43,595.6193,4.437684 +0.9367013,51,894.6887,5.583736 +0.5337638,21,15.99230,3.907597 +0.5574367,40,687.904,4.374468 +0.8259194,30,937.608,4.73232 +0.8714596,38,471.542,5.07393 +0.6665597,49,399.8029,4.735126 +0.8192291,35,93.40303,4.915221 +0.8688831,56,259.5373,5.362454 +0.6838603,98,570.7892,5.263374 +0.6465024,93,946.6553,5.154663 +0.8457297,5,633.2096,3.217746 +0.6922344,70,457.7957,5.045673 +0.7149555,84,650.9649,5.214478 +0.6031059,75,638.7035,4.929953 +0.7407085,80,553.5425,5.236097 +0.5007247,9,785.852,2.918291 +0.5881926,2,575.2952,1.161514 +0.6842944,85,56.74425,5.275968 +0.6365547,8,593.1905,3.087423 +0.5593403,10,597.9742,3.146675 +0.6665544,2,261.012,1.370363 +0.5226974,14,860.4175,3.401291 +0.9373338,70,166.3507,5.890187 +0.5455807,16,558.8445,3.571325 +0.6551681,51,253.6940,4.751319 +0.5161405,19,33.30902,3.718792 +0.9238053,84,580.7067,5.845623 +0.86948,94,90.00178,5.827859 +0.6780455,11,784.5237,3.497723 +0.9178672,99,456.9874,5.928964 +0.767568,71,23.22718,5.569045 +0.7954395,72,365.8755,5.299927 +0.8839859,79,733.2088,5.618772 +0.7608575,89,448.5921,5.358179 +0.8567473,65,858.2716,5.387898 +0.8996104,56,643.5015,5.455172 +0.7666284,12,47.31088,3.893322 +0.6470064,93,699.9194,5.158058 +0.5875236,53,926.724,4.643525 +0.8953835,74,992.946,5.615506 +0.9201886,9,970.5459,4.163660 +0.601927,10,259.6253,3.240734 +0.647429,76,942.9703,5.013432 +0.8213445,33,641.5921,4.794998 +0.5490222,33,105.5942,4.225879 +0.5776677,67,403.6322,4.808392 +0.8079034,87,427.1954,5.458135 +0.6253146,65,887.0287,4.861523 +0.6817373,76,748.7887,5.078027 +0.7258991,74,732.7329,5.146395 +0.9250114,9,157.7767,4.239061 +0.8528482,35,754.1407,4.937605 +0.8636093,24,789.116,4.691449 +0.6416303,18,107.3528,3.893581 +0.938607,30,188.2054,5.293022 +0.6183642,98,784.5568,5.144735 +0.626452,49,708.409,4.654031 +0.5033137,90,364.6996,4.904766 +0.6416498,69,686.6995,4.935888 +0.9439444,30,16.76117,6.17131 +0.6769998,61,91.14787,4.971445 +0.6099088,33,292.5247,4.322005 +0.8562472,61,175.4549,5.400586 +0.6554333,26,733.8006,4.208067 +0.6010223,16,940.5603,3.678439 +0.7840678,73,110.2884,5.345153 +0.8568647,97,348.6922,5.681597 +0.8782813,11,752.7111,4.115416 +0.865477,47,912.7237,5.191814 +0.7104252,95,328.1609,5.303922 +0.6518729,99,406.2813,5.21742 +0.8136264,40,904.949,4.911606 +0.6043372,47,902.7367,4.581187 +0.8121081,67,7.538333,6.513966 +0.6552225,23,532.8514,4.107702 +0.7357522,22,482.9446,4.250429 +0.5070191,82,821.2403,4.838449 +0.5782021,65,832.5791,4.781427 +0.6097488,47,86.14851,4.635193 +0.7171686,97,668.8119,5.318037 +0.644155,46,660.5386,4.63903 +0.7727673,44,22.80839,5.203142 +0.7922387,75,505.9924,5.311956 +0.664713,98,532.7728,5.229238 +0.5679516,46,992.4062,4.500924 +0.825774,10,281.0117,3.834293 +0.6083309,41,597.429,4.484862 +0.7737187,21,467.6578,4.309089 +0.7249439,60,598.5867,4.997216 +0.9095895,37,8.365455,6.77549 +0.5130474,48,40.46562,4.494295 +0.6051408,80,447.1557,4.983537 +0.8676191,75,629.6436,5.527589 +0.9364891,57,469.2977,5.674607 +0.6506647,93,569.1126,5.166729 +0.5027852,74,545.2522,4.757751 +0.5031346,98,162.6768,4.975135 +0.767055,50,183.3676,4.991531 +0.6801705,23,719.5443,4.157980 +0.9061154,72,553.1563,5.657693 +0.8591993,97,490.7379,5.676845 +0.6889985,44,681.4208,4.692018 +0.7125659,97,200.8339,5.33931 +0.6351567,29,301.1039,4.265337 +0.6566573,52,440.792,4.759479 +0.8159221,94,986.9704,5.514844 +0.6077678,22,101.6926,3.999549 +0.7839771,64,576.8159,5.178063 +0.6734601,31,395.1654,4.393173 +0.6060289,28,3.081892,5.121582 +0.6789768,96,181.166,5.268511 +0.787318,16,775.1314,4.11447 +0.9073888,41,497.7243,5.282086 +0.7638307,87,131.2056,5.403349 +0.6463511,71,445.6236,4.969812 +0.6726806,25,761.584,4.210960 +0.7649493,53,632.2372,4.995885 +0.683377,75,176.2011,5.102595 +0.890173,53,383.1089,5.39159 +0.5778118,60,604.8159,4.722957 +0.6290806,81,835.3322,5.027719 +0.709206,75,365.1975,5.133035 +0.7821182,50,921.8328,4.990793 +0.8249756,33,449.9177,4.812041 +0.9164308,22,483.9926,4.875823 +0.5126529,7,69.3751,2.686872 +0.7279297,76,849.3809,5.167721 +0.6243633,81,425.4841,5.026262 +0.6822903,74,903.373,5.058437 +0.7674061,16,381.5476,4.066042 +0.8044243,45,994.9932,4.971361 +0.8797448,14,812.4009,4.326156 +0.5983747,64,350.2122,4.811645 +0.8931191,100,605.8303,5.813613 +0.7759804,25,990.4158,4.44877 +0.933721,48,125.8175,5.638129 +0.567207,39,158.5426,4.386867 +0.6834433,24,595.2227,4.201662 +0.5842774,83,144.4095,4.996242 +0.6096163,44,3.666158,5.442746 +0.5520212,33,788.1983,4.209405 +0.8487187,75,775.0258,5.461002 +0.6442834,59,384.4282,4.832377 +0.8525898,44,852.7334,5.101296 +0.6793526,5,544.8316,2.681385 +0.7896053,57,702.1907,5.106904 +0.6347688,37,207.1742,4.467327 +0.9105013,73,298.8515,5.713738 +0.5801921,61,194.1294,4.753626 +0.5398654,14,623.2005,3.435302 +0.5295864,36,825.9626,4.241144 +0.6955647,90,532.2933,5.227428 +0.8752002,7,34.37197,3.840195 +0.5065717,86,99.36485,4.895701 +0.6540707,91,816.5146,5.153864 +0.7494457,27,333.2309,4.455773 +0.6942405,34,378.8255,4.510573 +0.6192505,85,514.0551,5.049568 +0.76549,25,642.7535,4.425212 +0.7574782,64,469.1908,5.118944 +0.5830214,21,552.903,3.886642 +0.8790609,79,159.6307,5.674371 +0.7176675,58,884.7081,4.953248 +0.6629143,8,245.0644,3.154845 +0.8564256,41,392.7764,5.078983 +0.5191748,37,388.5444,4.248730 +0.5063773,82,608.4596,4.838639 +0.6187086,74,342.2091,4.954258 +0.9265214,49,19.84399,6.272573 +0.7227158,30,941.4727,4.464846 +0.5720824,44,88.08165,4.508306 +0.7417212,36,856.798,4.650463 +0.6945709,16,973.5857,3.877503 +0.6787784,67,199.1884,5.00703 +0.6079792,2,14.28654,1.248295 +0.8160534,87,902.7546,5.464555 +0.903873,43,596.1851,5.293944 +0.726878,20,652.6108,4.146919 +0.6090511,26,822.7786,4.116546 +0.7854577,6,632.6326,3.188597 +0.6051804,75,622.2571,4.933685 +0.7918214,37,643.5305,4.797766 +0.5232566,75,325.5463,4.80398 +0.590876,66,73.06404,4.867022 +0.5937229,27,42.58453,4.187347 +0.8824875,45,931.0037,5.224986 +0.7059692,52,659.4332,4.851961 +0.6663572,11,289.1740,3.476953 +0.6661134,75,418.1281,5.046652 +0.810046,78,319.3538,5.398473 +0.5153034,94,370.1154,4.955019 +0.6629067,75,76.91591,5.107002 +0.7524684,35,669.101,4.656308 +0.8711363,64,313.9587,5.454808 +0.6956076,29,55.13885,4.465562 +0.7708426,83,192.2650,5.363472 +0.5723024,29,745.2273,4.139486 +0.9359758,76,180.2033,5.927152 +0.937121,95,945.2132,5.988315 +0.7236621,84,584.52,5.233591 +0.5644985,54,327.6738,4.625826 +0.830407,38,621.8328,4.928221 +0.7119581,31,183.4619,4.492153 +0.77285,82,784.9956,5.319325 +0.8722319,85,500.9015,5.633511 +0.6801105,92,42.34472,5.362335 +0.7211597,80,755.886,5.191064 +0.7343016,17,662.3988,4.026676 +0.6084402,33,173.8741,4.327899 +0.6186405,40,577.6662,4.484631 +0.703274,15,875.0299,3.841051 +0.9385632,22,803.663,5.007829 +0.5536499,6,140.929,2.596166 +0.5189601,36,365.0004,4.226444 +0.7964722,33,112.4292,4.783128 +0.8923196,89,282.4267,5.766261 +0.8477578,57,813.3298,5.268937 +0.7376255,52,39.59667,5.092456 +0.586504,72,325.709,4.879086 +0.9245973,96,220.5104,5.990943 +0.5904537,70,650.9535,4.858109 +0.6962348,91,53.84608,5.360867 +0.6472336,86,286.8350,5.116716 +0.5478403,45,891.3937,4.449943 +0.5916281,49,112.7873,4.621543 +0.9236192,10,256.5085,4.30158 +0.701771,76,931.1325,5.114423 +0.6455423,9,114.6123,3.244296 +0.629923,96,926.7514,5.148559 +0.9445545,39,672.0967,5.463624 +0.6736415,85,449.6175,5.148535 +0.6858955,81,783.2148,5.130515 +0.566487,9,551.4185,3.054829 +0.9085593,35,254.0737,5.200862 +0.6143065,90,329.5405,5.087921 +0.6999386,19,490.2705,4.043115 +0.6395809,8,600.4834,3.094362 +0.9093209,36,853.3224,5.188147 +0.894677,100,848.318,5.811673 +0.6063929,85,898.3364,5.023168 +0.6523595,50,416.7666,4.722509 +0.942245,14,171.8807,4.742298 +0.783326,95,113.6980,5.527098 +0.752282,7,408.8336,3.248984 +0.7136485,15,471.0845,3.869695 +0.6320827,32,848.5555,4.330415 +0.59958,93,236.7872,5.092203 +0.7906985,82,470.0474,5.37129 +0.7225906,97,847.8583,5.325918 +0.5733982,37,779.5725,4.339675 +0.9068659,11,322.7737,4.273226 +0.9381555,37,206.4804,5.433981 +0.534364,36,896.7656,4.249114 +0.6322029,54,652.9157,4.738431 +0.5673037,32,607.234,4.212482 +0.5158305,29,241.0641,4.044624 +0.782321,41,343.6444,4.861221 +0.8978933,55,113.9618,5.540612 +0.7566181,71,803.6087,5.182157 +0.945313,93,760.1445,6.035159 +0.7764446,66,690.4359,5.178624 +0.5382854,44,937.8568,4.415998 +0.780881,21,808.7842,4.322801 +0.7872955,43,753.639,4.895828 +0.8437686,53,714.1587,5.207365 +0.6116142,97,820.0253,5.125958 +0.531347,2,33.00914,1.036805 +0.7165558,8,633.2616,3.283039 +0.705623,19,384.8555,4.058654 +0.8560466,41,376.2472,5.078905 +0.6344361,85,632.7684,5.073645 +0.5901747,22,282.6403,3.945618 +0.56803,53,73.53232,4.653907 +0.8146113,27,671.1104,4.620696 +0.9163909,73,747.9496,5.708432 +0.6061526,14,542.7819,3.568411 +0.9093413,95,335.4416,5.875304 +0.6494762,46,759.3723,4.647989 +0.5640401,44,632.509,4.461494 +0.5354444,34,836.2228,4.204653 +0.5299268,77,846.4679,4.828092 +0.741827,22,130.2941,4.296245 +0.5115407,87,295.344,4.894967 +0.5978896,76,131.5230,4.959506 +0.8912814,18,205.5997,4.616479 +0.5576322,43,383.5691,4.435671 +0.8717212,40,583.6276,5.107255 +0.9161417,8,499.1547,4.040285 +0.6521386,11,822.9779,3.438228 +0.7737015,17,762.6271,4.127920 +0.892949,87,399.3925,5.736645 +0.5966038,55,689.611,4.688806 +0.6431161,52,447.0586,4.733828 +0.8306688,44,702.1389,5.034286 +0.6649262,57,359.9672,4.846758 +0.9363835,85,887.7069,5.914833 +0.7510024,81,339.8045,5.277932 +0.7902674,15,705.98,4.068516 +0.7636627,56,448.0598,5.038424 +0.8669564,5,680.0533,3.31205 +0.8059546,75,503.0968,5.3473 +0.6403063,92,962.566,5.136234 +0.504068,3,617.9877,1.598052 +0.9186635,36,724.4784,5.240142 +0.5795384,56,545.9165,4.67465 +0.8195587,78,414.402,5.416073 +0.7491724,3,281.5133,2.251189 +0.7093393,13,665.9633,3.728246 +0.9406897,81,43.65671,6.348394 +0.8862442,15,820.4643,4.412285 +0.9183536,71,279.5010,5.739535 +0.7329661,45,293.7233,4.8157 +0.9149706,82,822.9326,5.774923 +0.6399313,75,173.1958,5.018545 +0.631958,78,704.475,5.007022 +0.9347626,82,427.1829,5.906078 +0.9193079,36,111.4287,5.350532 +0.7909542,49,249.1747,5.025715 +0.7143558,60,471.2938,4.978527 +0.929284,32,846.1144,5.216052 +0.8400567,98,342.8071,5.636219 +0.5706936,59,468.7645,4.700182 +0.6783719,48,140.5919,4.769985 +0.7694423,73,842.9439,5.230134 +0.5215988,17,298.5005,3.584042 +0.7042262,23,46.45078,4.306447 +0.6135268,61,104.5767,4.834267 +0.852132,17,683.1779,4.376271 +0.6286326,72,801.0265,4.94254 +0.9114498,70,413.9069,5.674662 +0.505581,30,934.0287,4.048985 +0.619673,54,249.2989,4.727874 +0.9039804,73,662.0442,5.652103 +0.9322274,75,826.7649,5.810783 +0.591522,17,550.8919,3.716205 +0.5615105,9,563.2861,3.044287 +0.8861427,77,612.0575,5.614371 +0.9227275,36,804.7779,5.261032 +0.5201386,6,563.5901,2.516629 +0.5150667,4,153.7693,2.017103 +0.858887,88,335.1279,5.625131 +0.865161,91,507.115,5.653645 +0.866841,28,569.142,4.826175 +0.5914268,73,731.0933,4.889649 +0.7301672,3,171.8421,2.193633 +0.8695504,46,972.9767,5.190517 +0.8743281,94,423.1992,5.713268 +0.7259997,71,57.63515,5.243207 +0.8552598,42,51.79937,5.275407 +0.7262848,91,622.4001,5.293459 +0.5421301,43,124.8007,4.423924 +0.764653,64,923.3807,5.125733 +0.8748403,73,247.373,5.571079 +0.7803132,31,380.4862,4.640732 +0.6482601,87,772.2889,5.112482 +0.7241264,43,272.1837,4.76339 +0.7953848,44,365.2316,4.946676 +0.6285879,91,448.7414,5.11578 +0.6652861,50,710.149,4.741542 +0.6856344,64,916.419,4.960469 +0.7254825,75,709.546,5.155371 +0.6569148,90,891.1667,5.150444 +0.9032712,56,578.0589,5.474436 +0.8196123,55,916.5202,5.158029 +0.8457452,68,948.5464,5.382074 +0.7056631,3,931.2039,2.112567 +0.8282234,89,748.6638,5.515993 +0.87756,69,756.8942,5.503454 +0.5580487,53,79.27887,4.631497 +0.8726777,84,865.3341,5.614437 +0.6403862,31,668.2423,4.322197 +0.8492341,73,141.7500,5.519904 +0.5361932,8,651.2265,2.867713 +0.7613272,82,428.129,5.303809 +0.8569944,82,709.8302,5.548995 +0.8017937,16,509.0666,4.161160 +0.6910281,42,458.1705,4.665068 +0.9100806,53,834.6907,5.461124 +0.8269713,11,110.7436,3.955719 +0.7171317,89,540.2364,5.261772 +0.851661,82,487.6866,5.540841 +0.7891677,30,331.5015,4.642001 +0.734028,16,122.0367,4.004476 +0.5187802,87,429.9464,4.903341 +0.5150383,16,718.979,3.512412 +0.785768,69,194.4107,5.270155 +0.8033854,47,199.0244,5.038606 +0.830575,35,729.6996,4.865471 +0.8736411,70,28.33166,5.956989 +0.8876228,62,56.37586,5.704145 +0.7772246,81,880.699,5.319602 +0.8581031,86,744.6876,5.583367 +0.7385866,56,814.1746,4.972997 +0.7709235,35,958.7655,4.697881 +0.7025145,38,608.5902,4.608887 +0.6822772,59,741.9122,4.896537 +0.7546338,39,377.0911,4.752481 +0.7098272,6,688.9395,2.965107 +0.8007708,68,664.4748,5.260526 +0.5081478,97,957.1152,4.961489 +0.8871281,80,610.9077,5.64364 +0.83781,29,404.5329,4.756917 +0.8565457,33,929.6463,4.904385 +0.7858467,76,614.8492,5.301542 +0.7393295,48,304.2518,4.877567 +0.6288801,56,575.7861,4.760722 +0.5747567,36,525.0601,4.322172 +0.7241387,4,744.9875,2.540414 +0.5838607,84,98.96394,5.017925 +0.9088057,30,939.4672,5.053044 +0.8893571,65,764.4263,5.508868 +0.7718164,92,629.6235,5.398965 +0.7592003,69,639.9231,5.170893 +0.5349374,43,16.79663,4.529065 +0.8402495,32,594.5056,4.832209 +0.5243549,21,561.1883,3.776770 +0.7070809,73,203.5126,5.126286 +0.7444766,45,996.601,4.823829 +0.9452716,51,968.5641,5.64201 +0.8834646,43,410.5079,5.214212 +0.5125273,8,554.2188,2.818634 +0.7855098,34,142.7244,4.760065 +0.857309,8,134.2902,3.76904 +0.850575,12,800.5671,4.075296 +0.7062366,30,828.565,4.429344 +0.5672662,6,703.8213,2.619697 +0.6565083,83,495.8813,5.098745 +0.7695762,23,429.8266,4.373533 +0.8751504,83,411.2986,5.634882 +0.660651,31,384.3733,4.367338 +0.6552163,71,410.1236,4.987248 +0.5242741,35,810.4681,4.209141 +0.5429164,41,657.2765,4.369296 +0.5608511,52,487.3664,4.58715 +0.8849192,18,747.3227,4.554355 +0.6341058,77,491.0945,5.00518 +0.5528817,5,483.2663,2.376328 +0.7755186,45,909.177,4.897701 +0.7080204,18,922.128,4.011066 +0.5753103,67,379.1132,4.80507 +0.8938414,45,276.1014,5.306521 +0.9153011,100,561.4111,5.914729 +0.9400833,71,244.9699,5.881615 +0.5751929,57,696.4602,4.679055 +0.8627746,66,751.1318,5.420788 +0.7402069,86,120.3373,5.34467 +0.6009191,52,934.1773,4.652193 +0.5917567,18,435.2733,3.769131 +0.7928228,18,282.6634,4.243414 +0.7406228,67,601.0171,5.109815 +0.949789,27,680.853,5.248154 +0.7617935,81,297.537,5.306533 +0.8564567,77,376.8077,5.522382 +0.6577059,74,182.6144,5.040919 +0.9413392,90,90.77082,6.190444 +0.7485857,60,824.7695,5.044612 +0.8942623,86,116.7217,5.83402 +0.6324165,69,534.8945,4.921818 +0.8736767,78,480.7874,5.582686 +0.809562,7,161.7137,3.445533 +0.655178,80,209.5545,5.087967 +0.8126558,75,553.6373,5.363033 +0.587771,54,741.3041,4.659252 +0.7304708,43,140.2912,4.801626 +0.6784025,99,485.646,5.262685 +0.8679588,83,685.2886,5.594575 +0.8094056,2,901.409,1.852349 +0.6667788,32,766.4673,4.398906 +0.9003594,34,264.8389,5.13664 +0.5131864,4,594.7674,2.009264 +0.5324579,58,79.92974,4.652622 +0.6300037,79,10.07310,5.450494 +0.6228218,30,902.6635,4.260279 +0.513834,87,502.2924,4.89453 +0.7645673,2,991.632,1.678955 +0.936889,47,418.9952,5.551662 +0.8618376,87,241.7598,5.644262 +0.9409066,51,286.3327,5.654553 +0.8910533,13,177.1792,4.35247 +0.7814179,48,452.7033,4.969485 +0.7402419,49,378.8289,4.890003 +0.7814724,91,598.634,5.41494 +0.5207353,33,137.6379,4.16805 +0.8606041,76,509.892,5.517765 +0.8672457,46,857.1114,5.183842 +0.8916283,3,191.1671,2.867489 +0.9291234,61,362.7399,5.68471 +0.6128671,21,493.3128,3.945307 +0.9130023,44,433.433,5.364272 +0.5526918,40,501.2452,4.367895 +0.7100667,58,626.435,4.941089 +0.9485433,61,902.1765,5.78576 +0.7375008,100,552.7585,5.383109 +0.8843444,69,535.1516,5.537504 +0.7355137,24,294.9474,4.32874 +0.5849977,63,918.668,4.769115 +0.8148579,32,288.1865,4.769015 +0.6047379,95,20.06207,5.315901 +0.9387293,65,47.6271,6.128658 +0.6730278,29,226.6681,4.347534 +0.8536057,86,299.622,5.597219 +0.7039593,5,717.411,2.746449 +0.554576,51,501.231,4.561373 +0.5985519,33,49.17765,4.357975 +0.6332506,60,222.0821,4.834659 +0.5311171,3,505.9751,1.661199 +0.6073137,63,391.6986,4.814172 +0.6546051,47,328.4854,4.683347 +0.8600348,35,942.1334,4.959945 +0.6736388,16,170.3470,3.848083 +0.5197377,42,528.5444,4.350034 +0.5483864,2,8.982135,1.112816 +0.8866457,91,968.5747,5.716457 +0.9170833,95,720.5013,5.883273 +0.7270387,21,628.9166,4.188418 +0.812512,16,938.998,4.188589 +0.8316781,20,444.9295,4.442617 +0.9298217,20,866.0785,4.874826 +0.6134887,60,964.2135,4.78133 +0.7366226,7,319.7519,3.206178 +0.8077966,41,974.1164,4.9127 +0.6130327,56,385.8269,4.736513 +0.6378037,37,850.088,4.456746 +0.7848023,55,823.8128,5.067312 +0.936098,52,897.3047,5.592718 +0.5120613,27,467.5221,3.973342 +0.9193753,5,709.4038,3.609307 +0.8621582,83,262.4155,5.608882 +0.5685211,52,168.9039,4.614078 +0.6970322,80,225.7021,5.167406 +0.8347935,100,76.00698,5.769876 +0.8225406,8,344.3646,3.609568 +0.6941333,43,435.8167,4.690098 +0.7356296,30,710.7536,4.496393 +0.8811275,6,103.0200,3.609537 +0.6109929,48,400.577,4.615333 +0.596709,60,363.4187,4.760152 +0.6572946,5,962.1019,2.623233 +0.6103808,55,631.1443,4.713493 +0.668965,96,892.3117,5.21696 +0.7999518,32,495.2423,4.713714 +0.8338344,48,908.905,5.102972 +0.8567186,7,846.6076,3.605534 +0.7154963,95,187.0719,5.334038 +0.7108011,96,628.3475,5.29923 +0.6893275,25,734.6108,4.246437 +0.5740601,11,364.6629,3.273750 +0.8039917,73,244.864,5.346882 +0.8573021,48,634.51,5.183936 +0.8183101,23,760.4014,4.504651 +0.8641757,94,978.3002,5.657207 +0.6303905,70,604.3785,4.927486 +0.8699731,79,863.8185,5.564262 +0.915676,8,143.355,4.073357 +0.601142,35,441.2769,4.348688 +0.87388,28,333.7200,4.866511 +0.9196098,2,325.7931,2.48037 +0.7254358,13,522.0907,3.769571 +0.9131236,70,356.7704,5.689551 +0.7061301,40,507.9874,4.657943 +0.916107,7,935.9404,3.911256 +0.6185521,24,139.8068,4.088015 +0.6262447,20,876.2364,3.926877 +0.6291963,78,148.0490,5.032363 +0.632995,91,192.7662,5.141416 +0.5512401,96,922.5635,5.020761 +0.8395904,21,948.335,4.49903 +0.7737163,35,381.1151,4.717049 +0.5824825,67,367.2437,4.817619 +0.5647798,46,202.662,4.508791 +0.8834567,23,404.0992,4.750842 +0.5374452,15,541.5736,3.495868 +0.879485,45,87.82374,5.342633 +0.7248722,19,681.9091,4.098538 +0.911358,10,43.89693,4.374565 +0.7451762,77,521.6592,5.220066 +0.723452,87,31.2523,5.495526 +0.7343267,78,979.8097,5.197778 +0.8797457,62,689.5224,5.441123 +0.9355938,9,8.536315,5.395588 +0.8081898,70,899.6859,5.295606 +0.779309,60,532.5658,5.122267 +0.9343759,90,800.8648,5.941199 +0.9125067,53,544.4229,5.483064 +0.7631274,89,498.3332,5.361002 +0.7271626,57,193.7866,4.991599 +0.5656534,45,542.3173,4.482748 +0.7439162,33,548.8423,4.592949 +0.6730048,71,419.1757,5.0202 +0.8488092,75,929.485,5.458401 +0.7990472,58,914.4833,5.140082 +0.7150551,60,300.436,4.989065 +0.7738144,47,841.0965,4.926207 +0.8007912,20,803.401,4.339192 +0.551277,78,16.59874,5.049359 +0.8536064,53,5.278028,7.26772 +0.6086101,22,656.6184,3.975391 +0.7950185,92,725.3911,5.451677 +0.7759385,24,724.6639,4.418522 +0.7436127,80,136.5426,5.292482 +0.7023383,78,583.6222,5.138942 +0.7387789,13,893.3477,3.800216 +0.5355073,87,367.4723,4.931304 +0.5799598,32,907.9728,4.233542 +0.7931919,23,580.6845,4.433776 +0.9020383,59,611.7858,5.502789 +0.8865545,52,26.28821,5.827225 +0.9361958,74,762.0372,5.828598 +0.582067,75,54.81664,4.963057 +0.8257129,4,567.6277,2.886287 +0.8633863,3,134.8775,2.717133 +0.7562748,93,860.8626,5.367093 +0.5468247,52,13.37389,4.752502 +0.5236045,76,758.5776,4.808922 +0.8087347,55,532.2803,5.136258 +0.7106333,92,111.2063,5.331034 +0.814428,41,509.0671,4.940242 +0.9088012,9,841.348,4.094842 +0.8740427,76,824.9096,5.553729 +0.8074883,69,252.8868,5.315484 +0.7213603,5,948.5723,2.794196 +0.6841834,28,313.8684,4.336824 +0.8791684,31,739.6711,4.946414 +0.8447433,53,223.9424,5.246248 +0.6077613,19,337.0328,3.850726 +0.6291898,19,882.2599,3.8882 +0.5982278,57,129.2187,4.745759 +0.8181028,71,778.5106,5.334016 +0.9189918,46,312.8849,5.440689 +0.6311825,5,906.8284,2.558528 +0.6925712,35,572.9342,4.524774 +0.7704907,37,621.4804,4.743354 +0.9046787,92,802.2702,5.801703 +0.6019258,60,991.2124,4.76121 +0.5629309,51,344.3215,4.578758 +0.8558432,38,589.3368,5.012244 +0.819681,32,977.2155,4.762014 +0.8277987,87,394.2501,5.51517 +0.5027483,24,314.9769,3.857077 +0.8158908,45,652.2671,5.008327 +0.8676783,82,104.2660,5.703369 +0.8946515,67,165.1998,5.624106 +0.8481332,95,468.5812,5.62917 +0.9427243,60,768.3167,5.735723 +0.8323833,26,398,4.655196 +0.8430963,33,469.1627,4.869046 +0.7642166,66,682.7124,5.150084 +0.8620012,43,557.2209,5.12448 +0.8747079,70,562.6493,5.509243 +0.6204153,14,15.61338,3.757389 +0.8136883,92,594.1941,5.503064 +0.7890769,21,960.2178,4.34413 +0.6135467,97,95.7961,5.179695 +0.6646005,79,102.7502,5.128727 +0.7282539,70,201.1261,5.142028 +0.6060018,16,13.12709,3.877434 +0.6576292,18,846.5295,3.900090 +0.9218128,19,225.0802,4.822128 +0.6956397,58,828.7143,4.909221 +0.5778678,53,305.8120,4.63554 +0.7409067,99,574.9399,5.382695 +0.6894707,35,474.0742,4.520339 +0.8547311,29,9.140069,5.801376 +0.9443449,36,740.9564,5.40459 +0.5030257,16,327.6132,3.492181 +0.7115186,14,705.3257,3.800159 +0.9499585,45,305.1216,5.635737 +0.6742548,79,184.8126,5.119984 +0.7671734,3,113.5515,2.320534 +0.743683,74,902.1817,5.181569 +0.9003837,6,700.1,3.670878 +0.818022,38,669.9273,4.890023 +0.5886032,2,378.721,1.162975 +0.804402,77,237.4354,5.38663 +0.6920335,58,268.8176,4.919222 +0.5761434,69,242.3807,4.834436 +0.7279316,32,213.1663,4.549817 +0.7118987,38,408.9461,4.633905 +0.7176286,33,133.8739,4.566852 +0.638278,76,13.88720,5.337516 +0.8056624,79,618.3595,5.377935 +0.9184175,52,114.7676,5.609458 +0.8495399,67,528.1128,5.39474 +0.9345234,11,795.6603,4.436122 +0.9183741,71,595.8968,5.706353 +0.6894078,63,32.08419,5.14501 +0.6199956,7,947.1682,2.907827 +0.7804436,39,746.3122,4.805868 +0.5348798,22,555.1823,3.837054 +0.770588,24,148.8212,4.438917 +0.5758073,32,768.8216,4.226697 +0.7512398,43,850.633,4.806761 +0.8007302,93,127.8680,5.548864 +0.9014866,25,678.9343,4.886736 +0.6555334,6,378.8423,2.827782 +0.9277143,52,953.2782,5.53991 +0.5545398,24,816.5394,3.947181 +0.781483,46,164.8824,4.971961 +0.5651579,54,238.7493,4.631017 +0.8015807,37,983.0817,4.819457 +0.6465967,100,23.79223,5.43803 +0.7298902,6,404.3406,3.022995 +0.5268403,15,595.9964,3.475157 +0.8249902,50,417.7287,5.119674 +0.7174687,44,28.92964,4.958069 +0.9220132,47,837.619,5.44125 +0.9163917,42,184.3981,5.395217 +0.6503536,32,85.93141,4.412043 +0.910666,8,312.4043,4.01467 +0.7578302,34,394.5199,4.654374 +0.7812384,5,798.26,2.977237 +0.5178476,35,456.0489,4.200271 +0.6632408,88,229.8003,5.168476 +0.8390662,31,835.2151,4.799856 +0.9352528,27,898.2456,5.132372 +0.8057271,58,350.117,5.176067 +0.610425,86,72.80154,5.102728 +0.9204428,22,964.564,4.886985 +0.8329993,95,981.9353,5.568629 +0.6198768,92,169.4371,5.129408 +0.6226202,84,898.3718,5.042082 +0.6418981,84,542.0965,5.079978 +0.6675953,95,291.8509,5.22411 +0.9360013,66,551.7465,5.762516 +0.8745606,88,678.362,5.656737 +0.5279922,5,832.993,2.319646 +0.818075,79,469.9906,5.417217 +0.8262758,2,645.9986,1.925928 +0.5706311,21,503.1586,3.863504 +0.7682838,39,861.4102,4.774088 +0.7245813,33,359.1662,4.55453 +0.6995345,46,293.3065,4.759532 +0.8709355,57,922.7088,5.345742 +0.8373729,60,504.0928,5.281386 +0.7081338,75,289.2888,5.136525 +0.7901496,5,5.439199,3.588918 +0.5290842,81,696.4208,4.864699 +0.7137549,27,77.53818,4.424457 +0.5482691,44,15.99154,4.590674 +0.8808748,18,22.94479,4.911921 +0.8147249,77,293.5421,5.405631 +0.6046856,2,878.4859,1.202698 +0.5329508,13,63.85672,3.373561 +0.6332334,22,704.2761,4.023677 +0.546437,8,890.3324,2.888729 +0.6326386,5,754.358,2.562415 +0.8817755,44,278.2696,5.238411 +0.8368096,19,138.9115,4.455741 +0.5355686,91,204.9948,4.971374 +0.7235912,8,344.4877,3.305657 +0.5048621,34,346.1112,4.155419 +0.5931924,60,160.0218,4.76904 +0.5299145,31,594.7286,4.120086 +0.6017189,87,369.6473,5.04039 +0.7418517,50,5.327944,6.087411 +0.8483486,64,305.071,5.376896 +0.6756182,4,862.6502,2.403836 +0.7777819,49,430.4768,4.976453 +0.9113989,60,362.3921,5.576478 +0.7407845,99,928.5576,5.375836 +0.7685601,49,344.4184,4.958712 +0.7725601,96,578.2455,5.4311 +0.6653655,50,945.6597,4.739644 +0.9468507,13,816.8829,4.670724 +0.5251872,29,804.5675,4.055112 +0.56988,7,438.1736,2.797492 +0.8973808,60,30.05556,5.950758 +0.9487586,11,261.4730,4.580859 +0.6696307,82,650.6464,5.110804 +0.8888442,27,907.014,4.881785 +0.7401928,22,558.9628,4.25965 +0.6110303,38,401.6077,4.433361 +0.7925204,16,439.8231,4.135301 +0.702094,9,504.9842,3.36415 +0.853108,33,35.07958,5.163423 +0.9353926,67,223.8085,5.818331 +0.6520575,24,758.8386,4.134634 +0.66278,81,118.4723,5.135034 +0.7340894,39,501.0299,4.699954 +0.8870821,53,874.5811,5.358251 +0.8916662,94,154.8354,5.848344 +0.83859,33,798.9093,4.845743 +0.9192628,35,969.539,5.218617 +0.8449602,89,174.3100,5.625377 +0.8755261,67,784.9093,5.475399 +0.7064768,8,992.3402,3.255223 +0.6243083,58,371.844,4.783567 +0.5539676,95,17.05929,5.202136 +0.6063726,90,191.1312,5.085874 +0.8869105,35,510.8736,5.074511 +0.8790183,42,885.0375,5.163212 +0.5933805,60,296.2700,4.75707 +0.6551459,30,24.56066,4.487992 +0.5723375,37,274.4002,4.345513 +0.6443248,33,836.795,4.378666 +0.735258,17,324.4626,4.036611 +0.8457457,86,740.4636,5.544534 +0.8943911,5,851.5544,3.451821 +0.838857,4,107.2173,2.963602 +0.856727,20,491.6441,4.529308 +0.6224996,72,30.61014,5.081849 +0.7584831,7,374.16,3.267944 +0.747176,10,637.9571,3.582344 +0.7691169,10,641.088,3.643957 +0.6950572,2,274.5504,1.453546 +0.6725931,29,665.696,4.332746 +0.7588209,56,4.689692,6.509686 +0.9223835,6,761.912,3.809601 +0.7851749,45,443.8975,4.932058 +0.7397743,40,2.279709,7.45333 +0.522246,20,346.4404,3.731591 +0.5984001,75,200.1283,4.938596 +0.8460583,10,705.9169,3.897459 +0.6427525,41,106.1142,4.585355 +0.8209742,37,392.5236,4.888823 +0.925232,81,785.0064,5.821471 +0.5509883,15,578.9168,3.521915 +0.7231179,48,606.5707,4.829564 +0.7479964,56,978.1678,4.992034 +0.8560428,89,172.6031,5.663342 +0.7445964,19,934.2746,4.14458 +0.8146255,5,297.5732,3.100598 +0.8801215,12,414.1117,4.206742 +0.5379769,19,896.2387,3.711643 +0.5590387,7,148.3427,2.779745 +0.7562362,2,126.4085,1.656177 +0.8628862,83,9.887536,6.832619 +0.6339987,49,957.1054,4.665933 +0.7959348,43,970.3764,4.915685 +0.9469303,27,894.7433,5.219109 +0.7474149,36,128.4815,4.709715 +0.6833293,17,967.5529,3.905373 +0.8428125,89,603.4397,5.562762 +0.9246594,88,878.4903,5.868944 +0.6135251,98,186.0699,5.160008 +0.5697204,97,4.151751,5.806717 +0.8312094,82,169.7990,5.527478 +0.910185,87,105.4579,5.936619 +0.693803,31,27.54992,4.604856 +0.8607749,20,951.5826,4.536226 +0.5555341,42,660.3545,4.410026 +0.7611825,68,533.4381,5.168059 +0.6107306,70,323.2711,4.90054 +0.6746679,35,374.4120,4.492795 +0.9177906,75,313.8561,5.766134 +0.7678125,96,441.6935,5.426057 +0.9169907,14,736.4204,4.517798 +0.7433266,56,989.043,4.9816 +0.9015917,98,391.5603,5.852269 +0.7285088,100,452.3493,5.368393 +0.5379222,32,316.8145,4.164098 +0.7352325,49,251.5620,4.888791 +0.8506556,14,172.2805,4.239404 +0.7878528,86,47.18904,5.595067 +0.7940741,14,709.88,4.020078 +0.6541361,31,382.5369,4.354275 +0.8305676,56,384.7685,5.21937 +0.899311,87,765.7054,5.743174 +0.669143,21,357.551,4.063729 +0.6986659,4,783.4702,2.467174 +0.8068675,98,264.7227,5.553613 +0.7591054,85,289.1455,5.33484 +0.7327918,54,51.85563,5.067093 +0.6006468,11,304.5714,3.330731 +0.7975916,41,464.2589,4.895099 +0.8373671,65,922.02,5.325994 +0.797545,27,324.2303,4.583439 +0.7110869,22,140.0273,4.217343 +0.6424185,65,367.1264,4.901086 +0.5556619,47,305.7816,4.504104 +0.772002,48,528.8508,4.943287 +0.6721145,5,79.38062,2.681564 +0.7806843,10,434.8125,3.681225 +0.6894094,28,566.1086,4.34089 +0.733033,7,71.62944,3.227396 +0.648652,51,326.0771,4.734045 +0.5223443,28,140.3916,4.032858 +0.6840796,52,532.834,4.810271 +0.5635255,5,600.5627,2.400079 +0.8416008,45,600.0655,5.087043 +0.799596,79,715.0368,5.359828 +0.8057718,12,815.9436,3.919591 +0.585966,58,812.5367,4.709579 +0.7304825,39,452.6062,4.693294 +0.7611653,14,301.6993,3.935817 +0.6647046,37,76.24282,4.567979 +0.6523098,91,841.6372,5.150504 +0.788072,2,838.2777,1.766685 +0.7445851,25,39.74841,4.50943 +0.7385261,53,652.0979,4.935246 +0.7808228,28,515.9685,4.557599 +0.888269,82,840.605,5.657258 +0.6899828,10,374.1941,3.439050 +0.6410592,61,875.8026,4.842899 +0.6451181,16,944.335,3.769109 +0.5841919,43,684.492,4.478166 +0.5010752,25,285.6268,3.890052 +0.8291245,8,368.9152,3.632677 +0.5235197,92,301.6914,4.954483 +0.7078635,85,642.3808,5.208843 +0.5116872,98,379.1896,4.979117 +0.6257265,10,875.562,3.286811 +0.6592452,35,250.9212,4.468037 +0.7221302,20,187.6121,4.154374 +0.7956171,54,451.887,5.091446 +0.6838694,20,473.7403,4.051287 +0.8295577,78,784.4418,5.430121 +0.9478423,68,488.6432,5.86968 +0.6691414,83,921.919,5.115242 +0.9224753,22,184.6860,4.951371 +0.8983257,48,267.843,5.374096 +0.8998352,79,766.9935,5.682365 +0.7091498,33,343.9942,4.520809 +0.6004464,14,410.7908,3.558120 +0.9099504,95,636.2874,5.852287 +0.7956578,56,548.764,5.113729 +0.7704919,32,462.0465,4.636439 +0.5645864,39,905.9903,4.36564 +0.77087,22,454.319,4.339972 +0.7042887,51,355.528,4.843002 +0.8015738,14,377.1564,4.049835 +0.8583845,39,860.9546,5.034111 +0.9179805,65,763.6357,5.639616 +0.7802,38,746.6791,4.785765 +0.7479871,15,385.239,3.957906 +0.7396997,41,142.9188,4.786167 +0.8558819,21,49.9631,4.717325 +0.7794685,8,6.951015,4.020868 +0.7423384,76,914.6567,5.197205 +0.8278342,88,835.197,5.50552 +0.7116068,57,448.2181,4.936231 +0.8406779,65,790.6183,5.338226 +0.602327,41,504.0098,4.475247 +0.8409111,57,538.369,5.254911 +0.8656233,44,69.18179,5.301835 +0.5141587,85,791.0469,4.875926 +0.5417386,7,141.6497,2.742201 +0.5982695,23,414.601,3.996176 +0.514064,83,421.916,4.861692 +0.602719,48,560.3881,4.597395 +0.6230789,83,319.8326,5.045922 +0.5042455,25,173.947,3.899675 +0.8705254,16,459.7512,4.404386 +0.6383081,73,827.3477,4.969256 +0.7887536,13,621.2912,3.940368 +0.5171924,95,261.1531,4.96909 +0.6338395,21,712.4886,3.985088 +0.886364,31,489.4844,4.984223 +0.6076696,82,823.9758,5.000153 +0.5168341,19,858.6781,3.672510 +0.6961416,22,412.6158,4.160402 +0.801484,65,553.8453,5.234128 +0.7856216,69,112.5570,5.306969 +0.9263677,52,276.0557,5.574726 +0.7135692,32,209.0116,4.517289 +0.8410421,88,738.9076,5.545727 +0.8297371,93,990.6756,5.545205 +0.741467,22,177.8167,4.284039 +0.7635628,64,581.6729,5.129171 +0.5543599,13,124.4985,3.405149 +0.815754,80,445.7278,5.420853 +0.9187836,79,491.0139,5.784896 +0.6401774,26,569.7998,4.179082 +0.6696699,57,670.915,4.847928 +0.8378535,11,43.21189,4.078821 +0.559829,57,982.0274,4.651717 +0.7326061,3,730.2683,2.194841 +0.6143365,4,658.2037,2.246992 +0.9091326,58,130.0204,5.619253 +0.7299739,46,905.6522,4.808786 +0.9438849,65,51.04049,6.149484 +0.6383169,34,143.9447,4.415962 +0.6008252,38,863.7329,4.409409 +0.7914155,67,926.258,5.221909 +0.5824244,3,889.5783,1.783688 +0.5264587,92,418.4913,4.956136 +0.9393047,42,118.5326,5.591449 +0.8931902,37,63.91318,5.311936 +0.6691642,25,686.5356,4.204276 +0.655101,78,714.8446,5.047903 +0.9385995,37,316.4599,5.410553 +0.6542483,12,294.8234,3.531808 +0.7505392,67,863.9093,5.127012 +0.8010309,17,441.6191,4.211893 +0.5404961,36,29.51087,4.338949 +0.8481581,77,556.2782,5.483866 +0.8356528,31,908.498,4.787953 +0.8227231,52,216.2118,5.164859 +0.905388,97,83.37888,6.029684 +0.7548435,56,900.9445,5.008181 +0.6031258,10,727.9192,3.238254 +0.6346565,82,77.91511,5.112419 +0.766229,28,344.5748,4.52627 +0.5894321,72,904.7874,4.875008 +0.6093439,35,782.5465,4.36002 +0.7497125,68,993.3388,5.134286 +0.5022351,80,492.7455,4.815045 +0.7511856,74,421.0537,5.209693 +0.5176743,42,230.2803,4.352358 +0.7387836,54,3.121385,6.995114 +0.761282,21,475.0687,4.276069 +0.8406623,40,402.1961,5.007226 +0.882509,85,381.4973,5.681394 +0.9286038,79,467.4862,5.840803 +0.5992355,79,835.7454,4.959146 +0.890761,24,666.5893,4.805821 +0.7234082,33,730.644,4.543084 +0.5505608,19,213.1412,3.742900 +0.8660476,47,939.6582,5.193467 +0.940598,45,349.6406,5.555837 +0.6006444,93,572.2021,5.080988 +0.5091824,3,983.6616,1.609518 +0.5216768,85,920.905,4.887062 +0.7967704,68,721.9357,5.248968 +0.59216,27,542.8038,4.11822 +0.7599046,18,528.9801,4.142539 +0.8651707,43,113.2006,5.218027 +0.5924965,83,143.1471,5.011246 +0.6820487,51,444.4327,4.794115 +0.7621458,85,451.2133,5.329308 +0.7125131,58,478.2222,4.94979 +0.785969,56,85.08017,5.18163 +0.8220104,61,561.3661,5.245318 +0.690745,82,96.57742,5.21521 +0.9415946,30,858.3626,5.253486 +0.6013633,26,154.6332,4.119098 +0.7275541,9,771.9723,3.427606 +0.7001641,36,248.4740,4.576007 +0.9099395,46,101.5428,5.489313 +0.5301535,12,15.86398,3.358847 +0.7246674,48,676.6038,4.831669 +0.6494136,86,336.4217,5.117376 +0.9117588,55,622.8621,5.500896 +0.8806666,16,913.2533,4.438764 +0.7748915,95,491.9472,5.432733 +0.8041172,31,736.1958,4.695681 +0.5250454,34,398.9952,4.189739 +0.8903168,45,496.8165,5.269568 +0.7864003,98,133.7617,5.54255 +0.672163,88,317.5607,5.176894 +0.5214742,38,623.1296,4.272 +0.73013,3,664.3804,2.187303 +0.8370519,57,483.929,5.245438 +0.905355,22,937.9329,4.804942 +0.5186103,86,984.7663,4.890574 +0.6401834,92,341.8974,5.14821 +0.6548418,31,841.7306,4.349167 +0.9211253,56,37.49689,5.965554 +0.847424,59,751.2014,5.293101 +0.5670823,36,487.3625,4.308973 +0.7570442,69,619.3497,5.166504 +0.7855974,78,226.0553,5.348713 +0.8519632,30,497.0498,4.826449 +0.7275984,28,953.4355,4.421089 +0.6861582,97,713.1176,5.257759 +0.6299306,62,779.7347,4.835759 +0.9084661,52,577.6044,5.448431 +0.8757678,77,722.9621,5.571258 +0.7955783,5,476.438,3.028203 +0.5515631,30,159.7,4.143206 +0.6687658,48,181.5406,4.740979 +0.7556932,67,214.9520,5.170283 +0.7495992,45,738.3258,4.838205 +0.8802353,4,359.4933,3.139567 +0.6101071,37,124.4847,4.432152 +0.7072711,82,990.3553,5.178028 +0.6836548,28,264.0952,4.338638 +0.602489,95,388.3661,5.103602 +0.9298973,78,22.56973,6.608796 +0.7459731,22,161.8984,4.298588 +0.8078601,21,62.63728,4.502277 +0.746816,30,345.1936,4.532392 +0.7855065,12,843.9162,3.85735 +0.875513,94,267.9591,5.739195 +0.5442306,69,11.17396,5.006721 +0.699071,94,19.41204,5.605957 +0.7866223,48,680.867,4.975987 +0.5264621,48,13.63537,4.625036 +0.9174577,35,495.3558,5.222406 +0.8724126,62,914.5348,5.408832 +0.865643,65,408.7572,5.435482 +0.6987177,16,736.9757,3.888351 +0.9262,47,655.252,5.470375 +0.5707421,49,653.633,4.556472 +0.8033052,7,200.0670,3.419037 +0.607467,16,681.1006,3.692504 +0.9112384,40,313.9323,5.300553 +0.727744,87,338.0306,5.277563 +0.5696553,77,73.57855,4.940687 +0.5205544,28,161.0509,4.027688 +0.7081532,90,462.7116,5.254306 +0.7741767,14,205.8534,3.980006 +0.7166292,16,373.7093,3.936160 +0.5436275,6,821.2211,2.567207 +0.8027656,11,680.4826,3.833235 +0.8254717,83,922.7415,5.458177 +0.932488,58,866.6913,5.643221 +0.8418702,45,569.1373,5.088895 +0.689414,32,417.8379,4.451095 +0.7923089,93,146.7568,5.51455 +0.8078084,24,657.6303,4.508357 +0.8114387,36,717.209,4.829867 +0.6953754,45,165.5859,4.750391 +0.5427887,13,667.9623,3.370327 +0.6278709,87,742.4106,5.077376 +0.719019,47,575.633,4.805737 +0.8485726,22,182.7487,4.60427 +0.8952204,13,134.3489,4.388571 +0.5808132,14,174.6743,3.525328 +0.8973759,90,853.2268,5.754695 +0.6880474,54,500.3682,4.846951 +0.677843,39,845.5148,4.575613 +0.7658533,68,863.7593,5.171952 +0.938231,54,944.06,5.630914 +0.8791004,66,866.3697,5.476817 +0.8274844,59,926.6531,5.229684 +0.9470333,18,209.7032,4.969697 +0.6802575,29,3.550959,5.529664 +0.5066382,24,740.083,3.860899 +0.8874296,23,712.4559,4.757439 +0.8624187,68,610.8993,5.444066 +0.7703005,49,791.0794,4.948802 +0.8037844,67,242.3122,5.286526 +0.912851,95,88.46587,6.044068 +0.8034184,93,912.2758,5.47648 +0.6455281,86,2.359885,7.036967 +0.6580722,80,904.2982,5.069314 +0.8415494,70,145.7251,5.462051 +0.90707,53,996.3983,5.443663 +0.8247734,79,285.8116,5.452874 +0.7215811,8,61.89573,3.339986 +0.6220738,26,908.8918,4.141114 +0.6506316,97,846.5834,5.192115 +0.7313284,38,93.45492,4.731484 +0.8823698,27,966.4982,4.853321 +0.7490274,52,386.2727,4.953415 +0.6805436,33,651.8731,4.452449 +0.7764903,39,280.9689,4.81385 +0.9432227,84,752.5136,5.9566 +0.8667044,76,394.4018,5.546927 +0.5788225,14,258.0226,3.517233 +0.8875073,89,733.1099,5.710791 +0.5351773,44,262.4027,4.418358 +0.6488808,73,949.2446,4.987076 +0.9236432,13,125.3093,4.562865 +0.8962864,58,309.9517,5.489335 +0.7281808,13,587.0542,3.775624 +0.5180642,77,354.9852,4.814268 +0.6902971,2,939.4611,1.4374 +0.7647461,99,548.2068,5.435252 +0.5776067,30,913.6733,4.176379 +0.8657476,6,795.0982,3.493412 +0.897945,32,541.3933,5.056966 +0.6598413,5,171.2253,2.637734 +0.893147,56,292.6846,5.454062 +0.6640957,61,271.5816,4.900817 +0.8715021,23,764.0064,4.689651 +0.8385217,13,201.9563,4.123507 +0.7627245,32,714.4778,4.611452 +0.8619162,40,977.3098,5.063287 +0.9254046,89,777.3225,5.883097 +0.6706702,18,700.07,3.928967 +0.6348828,16,987.2555,3.747484 +0.6960192,27,182.7434,4.344458 +0.8773171,90,39.94803,6.032864 +0.5626677,16,956.1505,3.602819 +0.5537715,46,444.1438,4.48079 +0.6688064,80,897.1477,5.08883 +0.6897467,86,601.8464,5.182841 +0.871555,50,638.7892,5.263301 +0.5150773,31,193.1971,4.101366 +0.8863904,75,97.00325,5.72981 +0.7150527,26,488.4888,4.338653 +0.7805498,31,186.7901,4.661684 +0.6060921,49,36.88978,4.719998 +0.8752972,75,59.6561,5.772133 +0.5284842,20,752.361,3.740229 +0.911607,12,123.6005,4.417916 +0.912127,75,577.6007,5.711903 +0.6424525,21,968.2822,4.001205 +0.9467245,29,44.99821,5.59281 +0.6967225,72,493.199,5.073494 +0.926016,23,473.5198,4.967169 +0.9147218,44,564.3584,5.365337 +0.6036511,88,221.1464,5.061308 +0.6954212,98,549.93,5.285678 +0.6096702,33,74.86955,4.357886 +0.6447025,8,297.3146,3.109925 +0.5721982,13,116.7042,3.443134 +0.8261254,82,283.0360,5.482771 +0.6414976,75,908.1127,4.993686 +0.814776,62,968.177,5.22812 +0.7715264,30,209.3643,4.607552 +0.5268074,37,739.2855,4.258942 +0.8995444,14,970.326,4.418598 +0.6672158,22,380.9123,4.098374 +0.5621144,53,377.9919,4.605991 +0.6793161,41,81.38955,4.678239 +0.6916072,85,566.663,5.179 +0.5736763,66,941.3328,4.784641 +0.9219027,6,886.3211,3.805059 +0.5896647,7,858.1352,2.839533 +0.9074126,10,93.07447,4.253267 +0.66789,51,629.9087,4.762436 +0.877229,69,750.5044,5.502388 +0.9137808,60,799.3949,5.563941 +0.9041558,14,184.6966,4.481808 +0.7500885,43,328.5007,4.818373 +0.8837174,63,472.7422,5.47702 +0.7709719,40,827.9627,4.800039 +0.5613473,21,753.5284,3.844366 +0.8607043,71,90.77541,5.593585 +0.894365,26,912.2157,4.878227 +0.6289452,15,394.0313,3.681227 +0.6738608,51,931.1405,4.770833 +0.612593,9,844.2056,3.152861 +0.7328856,51,999.851,4.890585 +0.9286233,28,415.55,5.132799 +0.6607356,51,361.9293,4.755496 +0.6956952,58,683.2114,4.911127 +0.8438404,59,179.9122,5.332682 +0.5322143,85,18.54251,5.046697 +0.6755007,15,829.881,3.777777 +0.5618366,62,92.26922,4.753428 +0.5100895,36,103.1916,4.225376 +0.6867955,29,328.8595,4.370096 +0.6402259,56,200.4614,4.798722 +0.9200455,96,727.2613,5.904703 +0.7006108,77,978.7424,5.12098 +0.6415493,27,808.732,4.210867 +0.7054206,38,983.0683,4.611176 +0.8708127,17,924.364,4.445982 +0.6735938,90,59.16235,5.288341 +0.893749,31,274.5217,5.035676 +0.811464,78,482.6777,5.38987 +0.5329308,98,757.2869,5.007849 +0.7138424,36,177.7422,4.61582 +0.8361404,44,14.41229,5.711417 +0.8358981,58,234.4316,5.279698 +0.7662827,45,166.0394,4.91555 +0.5136097,15,968.2607,3.448866 +0.9202818,12,400.6707,4.422114 +0.901509,80,856.068,5.695603 +0.8459219,12,243.37,4.075717 +0.895828,99,675.6542,5.815219 +0.9483792,2,505.0198,2.758998 +0.6077581,78,46.8255,5.059373 +0.8990502,28,440.9378,4.968781 +0.7994523,58,128.8626,5.208285 +0.7051844,87,246.3544,5.240367 +0.609106,82,627.9874,5.004618 +0.7393058,16,102.7798,4.025542 +0.7529953,85,445.276,5.309107 +0.731806,33,628.1298,4.56342 +0.880604,33,539.6335,5.00397 +0.5836496,19,496.0396,3.800555 +0.8817114,24,71.55129,4.891774 +0.9257038,29,832.7737,5.123804 +0.5565546,17,825.7594,3.646683 +0.814996,90,970.7049,5.483541 +0.7525624,43,709.3263,4.811639 +0.5808193,57,768.9612,4.688041 +0.6070652,30,126.9498,4.254673 +0.6703728,62,509.1423,4.914036 +0.8503237,98,835.3743,5.642843 +0.8517253,48,19.13650,5.712755 +0.5168282,49,49.78515,4.508736 +0.832432,60,758.4743,5.258661 +0.8950984,34,458.0435,5.092172 +0.5167257,90,269.1065,4.928903 +0.8812985,45,501.8186,5.232066 +0.8884966,4,959.577,3.17786 +0.5751634,23,179.3001,3.960573 +0.9069385,42,747.0547,5.287428 +0.8875317,19,296.2533,4.628104 +0.596398,71,686.8049,4.87814 +0.918342,86,300.7095,5.86174 +0.8740808,85,72.80344,5.814391 +0.5438677,37,944.3981,4.287476 +0.7976671,40,476.4478,4.876465 +0.9018208,52,461.4554,5.423492 +0.7830676,65,791.2986,5.182023 +0.8163788,46,515.612,5.029737 +0.6272917,35,201.1602,4.408986 +0.5440327,17,510.8568,3.624252 +0.7540332,56,198.2257,5.039744 +0.9448444,91,142.8565,6.14086 +0.6085111,30,756.2686,4.234089 +0.8094153,21,564.3328,4.408084 +0.5010243,17,944.5477,3.541730 +0.9293139,46,666.201,5.473828 +0.6923277,12,741.6548,3.613324 +0.914651,100,317.0432,5.9377 +0.8499166,92,470.4283,5.613306 +0.5807449,11,980.1108,3.284324 +0.8983226,6,733.9231,3.658757 +0.8945144,72,158.2759,5.677252 +0.5103657,33,903.8698,4.136651 +0.534177,22,375.0012,3.83756 +0.6324964,8,567.16,3.07826 +0.613885,56,13.62238,5.01518 +0.851725,27,382.9489,4.751082 +0.8799537,49,153.7527,5.345505 +0.7592371,18,819.073,4.137142 +0.9212617,38,678.4613,5.294067 +0.5598017,78,26.99321,5.006114 +0.6814634,42,681.3903,4.641436 +0.8606673,20,783.8055,4.537746 +0.6084816,4,685.7197,2.232538 +0.6399375,45,593.7783,4.615192 +0.6103587,22,351.3694,3.983024 +0.9266782,92,14.14941,7.182278 +0.9188638,49,253.6643,5.495489 +0.687522,2,884.6993,1.429223 +0.5745827,58,144.1793,4.712286 +0.6408255,43,72.38769,4.638984 +0.5272403,12,389.2443,3.26381 +0.7431113,18,929.1973,4.095248 +0.5755574,58,755.1514,4.692339 +0.7362868,26,668.128,4.384603 +0.8476235,80,459.8383,5.513119 +0.531841,26,521.0744,3.976064 +0.8565164,12,373.0101,4.10788 +0.7162138,73,845.4122,5.115485 +0.6513347,73,279.6416,5.00723 +0.550517,93,804.8208,4.997617 +0.553736,7,449.5708,2.762216 +0.8000883,90,715.2746,5.449685 +0.7449889,41,357.5293,4.76865 +0.7050233,5,928.9357,2.748723 +0.811888,92,684.0569,5.49554 +0.5949598,39,782.7147,4.419858 +0.6980153,37,617.763,4.578678 +0.6513668,46,966.251,4.650048 +0.6346104,43,623.7619,4.569875 +0.6049259,50,348.3189,4.637309 +0.8538904,93,555.5724,5.628339 +0.7127893,36,798.1527,4.586658 +0.9133792,28,404.7592,5.044139 +0.8015495,82,612.701,5.392967 +0.7103518,76,782.9977,5.13295 +0.8044765,10,496.2737,3.754206 +0.8711564,8,949.4938,3.795038 +0.850426,44,424.9812,5.107353 +0.7427764,31,531.0962,4.541912 +0.7833918,13,436.4556,3.928051 +0.5161939,9,153.1221,2.956119 +0.542656,22,466.4729,3.852124 +0.7050307,42,581.7667,4.691265 +0.9394027,90,696.7951,5.976785 +0.6877143,77,409.0994,5.106878 +0.6642221,79,415.6036,5.080381 +0.8659564,28,995.0667,4.815222 +0.6232415,99,540.7747,5.16357 +0.5393753,21,977.4539,3.802869 +0.6286016,33,708.3299,4.349475 +0.9232921,23,752.7533,4.940747 +0.6183734,92,523.36,5.104062 +0.9043008,92,200.5048,5.866232 +0.6344774,89,236.9535,5.122502 +0.8628253,13,701.8662,4.19359 +0.9023469,36,694.6135,5.157649 +0.920216,96,481.1691,5.919217 +0.7553396,30,291.5915,4.556811 +0.7868298,37,22.24995,5.117885 +0.5297635,90,7.767314,5.255495 +0.7545318,90,983.2014,5.339463 +0.624568,77,498.1715,4.988259 +0.6753779,93,882.7993,5.206611 +0.6985417,92,379.6412,5.25464 +0.7701595,40,774.3157,4.798714 +0.8281533,13,974.1746,4.062279 +0.5118858,97,242.9545,4.976425 +0.7758689,65,513.8558,5.171371 +0.7374977,95,351.8510,5.357994 +0.6412336,53,703.0254,4.740301 +0.9063756,100,900.0661,5.860283 +0.8418323,25,35.81261,4.872203 +0.7665503,31,927.7007,4.59406 +0.9219692,74,591.2485,5.752762 +0.6358764,88,928.0914,5.097556 +0.9315368,16,528.4209,4.723142 +0.8100316,75,250.0677,5.381272 +0.6597449,67,687.8693,4.947374 +0.7521641,51,428.6216,4.944315 +0.8862515,96,909.08,5.750776 +0.8434805,37,450.0125,4.956334 +0.6248698,79,847.8975,5.002474 +0.9387935,27,351.9824,5.181689 +0.7219279,32,688.6867,4.516232 +0.7028832,4,115.2441,2.491463 +0.943075,85,51.73854,6.33496 +0.5073794,44,17.59787,4.470998 +0.8603101,42,103.5809,5.19063 +0.5362855,41,957.9404,4.356659 +0.7562751,71,135.6305,5.237723 +0.8609146,54,509.9657,5.284062 +0.8023684,6,203.2283,3.256929 +0.8707021,16,28.49927,4.670428 +0.6753105,14,677.1358,3.71605 +0.8213447,86,969.6892,5.470054 +0.7359973,89,538.931,5.300517 +0.5872538,45,607.1356,4.519681 +0.8535855,45,984.2838,5.118899 +0.744609,72,340.6154,5.180845 +0.695795,60,691.346,4.935945 +0.9209901,19,839.272,4.780656 +0.9332112,25,274.9751,5.096345 +0.7586022,23,707.0266,4.339541 +0.8356929,73,491.7684,5.412498 +0.9449564,100,217.8314,6.150777 +0.769811,4,500.2968,2.684143 +0.8468755,81,842.382,5.505682 +0.8751426,29,595.5288,4.884167 +0.7680948,18,56.2383,4.252435 +0.6820803,50,727.2103,4.773905 +0.8127874,55,255.6038,5.168734 +0.8462327,43,101.6337,5.157443 +0.800735,61,891.4924,5.180328 +0.9404126,52,486.4209,5.63849 +0.5839157,12,165.2641,3.385607 +0.935952,24,741.7999,5.054673 +0.9156533,41,319.3794,5.340692 +0.8196525,59,989.9556,5.206648 +0.6757751,83,725.6698,5.12955 +0.648204,48,961.4014,4.676463 +0.765033,78,93.1138,5.358278 +0.7678091,93,854.3995,5.392688 +0.5783231,29,170.5511,4.164157 +0.8802704,69,471.1699,5.525453 +0.5391529,36,214.6134,4.266653 +0.8768197,92,684.0415,5.693874 +0.8024528,19,389.2881,4.310811 +0.8102137,25,543.2757,4.550161 +0.5723951,34,177.1517,4.28349 +0.7918926,15,860.9835,4.07184 +0.9097192,26,440.2916,4.967131 +0.8408364,34,993.8379,4.872849 +0.7611193,10,193.7934,3.635555 +0.6503083,44,663.8255,4.616585 +0.7713632,22,182.8751,4.361633 +0.9257941,9,785.8253,4.203124 +0.8617674,10,87.37827,4.022113 +0.6977722,24,710.5994,4.231432 +0.5354379,8,618.6639,2.866230 +0.7276367,78,194.4265,5.219456 +0.927455,28,165.6871,5.174257 +0.9348588,94,166.7061,6.069519 +0.5434083,10,335.4119,3.115874 +0.6687663,15,727.9403,3.763405 +0.54875,94,3.577831,5.762369 +0.6946637,95,57.15825,5.380881 +0.8181467,88,282.4998,5.508351 +0.702337,22,39.24263,4.280552 +0.6295064,62,309.4151,4.845432 +0.8923052,9,895.7956,4.004396 +0.6035331,60,645.0201,4.766525 +0.8836149,97,409.5161,5.769774 +0.6316577,69,864.4558,4.916431 +0.8140471,93,972.8971,5.502959 +0.924153,67,537.857,5.702411 +0.6059753,59,130.9093,4.786022 +0.7303484,97,704.4985,5.343819 +0.9404786,43,546.2941,5.50638 +0.9363265,74,825.2387,5.827465 +0.7937029,90,872.1234,5.430884 +0.6887033,72,160.8189,5.087694 +0.8896025,96,720.0252,5.768666 +0.6226318,65,479.5238,4.861916 +0.9318561,21,212.6343,4.969043 +0.6530969,44,196.4965,4.640452 +0.5156705,27,422.6076,3.980209 +0.5506686,44,778.192,4.43762 +0.941927,45,202.6295,5.601233 +0.6978838,48,9.815825,5.319749 +0.7202505,8,944.3096,3.29123 +0.7825415,92,833.0413,5.41958 +0.8102026,31,475.4885,4.719315 +0.704962,3,742.0467,2.110853 +0.868628,49,797.4157,5.234452 +0.662415,36,122.3492,4.517269 +0.5685591,11,841.5693,3.259537 +0.5324882,84,611.4716,4.897254 +0.9195188,45,979.4784,5.395093 +0.924014,24,307.1492,5.000818 +0.7681578,9,254.8762,3.550494 +0.938885,33,967.0505,5.299149 +0.5058739,76,580.4191,4.782108 +0.7195724,42,493.8713,4.724312 +0.6590689,26,844.7261,4.214671 +0.8727227,80,634.8739,5.588596 +0.8332684,74,364.154,5.423553 +0.5644423,15,487.3337,3.548919 +0.5277456,46,305.2887,4.4392 +0.6731391,95,41.32865,5.372164 +0.8058712,32,449.7839,4.73212 +0.7805167,82,459.6353,5.346971 +0.6403517,29,324.7766,4.274653 +0.6894963,50,183.9768,4.814299 +0.840274,56,528.483,5.240915 +0.7802236,81,713.9484,5.329507 +0.6491817,91,183.0804,5.1731 +0.8662118,26,236.4739,4.791629 +0.8121542,56,879.6062,5.150578 +0.9429012,75,153.1888,5.987243 +0.944928,66,743.2445,5.814485 +0.5885454,71,468.0117,4.868063 +0.6490172,97,725.429,5.190661 +0.5939193,24,571.1581,4.022086 +0.5846302,29,702.0651,4.162268 +0.7266355,97,453.0783,5.343648 +0.7995213,35,300.3975,4.791758 +0.8849358,46,862.011,5.251369 +0.7821957,19,512.0406,4.248446 +0.6250475,20,955.2649,3.924167 +0.5438873,29,18.50624,4.206306 +0.6162852,40,191.5103,4.494984 +0.9380071,43,949.3993,5.476223 +0.6859009,82,401.6121,5.148329 +0.867299,43,321.3514,5.159297 +0.5054768,16,301.6068,3.497222 +0.8004985,45,897.7953,4.961837 +0.5992018,50,781.0341,4.620266 +0.7640982,43,68.31587,4.941959 +0.6466677,29,209.8136,4.294416 +0.5161559,100,304.6677,5.002615 +0.7669,24,402.9333,4.401981 +0.6212073,12,879.2709,3.453426 +0.8967,91,814.1106,5.760005 +0.756986,58,258.9546,5.062312 +0.6706516,11,896.8628,3.480077 +0.7702406,14,247.8120,3.964634 +0.9408331,3,59.2535,3.297193 +0.611694,79,157.4412,5.007073 +0.9133146,49,888.8744,5.422573 +0.7713459,60,989.9753,5.094866 +0.782709,8,864.2783,3.469534 +0.8122757,28,791.8693,4.640118 +0.9426235,44,832.2008,5.526677 +0.5151007,39,486.6782,4.283144 +0.9192788,97,80.94583,6.115433 +0.5547035,16,464.9022,3.589676 +0.8503518,58,999.2576,5.286516 +0.6912052,37,2.840297,6.232477 +0.6996373,20,398.5893,4.088258 +0.6826364,12,164.8152,3.605829 +0.7570145,59,136.6271,5.10443 +0.7892998,71,606.7073,5.263065 +0.693803,13,137.5442,3.711556 +0.5734344,42,847.0786,4.439896 +0.5256841,75,807.9073,4.802194 +0.8720609,44,196.4655,5.217903 +0.849763,58,113.6172,5.37946 +0.883915,86,606.7208,5.679039 +0.6986861,45,724.167,4.72818 +0.7730728,85,237.2305,5.375397 +0.6843036,37,881.977,4.547593 +0.8880187,90,652.6476,5.722867 +0.5066843,68,230.6495,4.707207 +0.8091692,37,685.1842,4.844475 +0.5834305,21,865.753,3.885641 +0.7739443,5,774.2294,2.953505 +0.782279,30,254.5893,4.630117 +0.840519,26,279.9131,4.691499 +0.5002118,84,350.2359,4.84983 +0.5737223,22,703.2993,3.908331 +0.6703492,20,616.1641,4.019935 +0.7475401,98,548.261,5.39069 +0.7815499,8,816.3322,3.466209 +0.7417556,23,517.3739,4.300781 +0.8445668,36,822.2591,4.929407 +0.7967811,31,707.4966,4.675692 +0.6796176,28,661.9581,4.318972 +0.8140635,80,911.781,5.402426 +0.6108495,96,245.8480,5.13348 +0.7784848,82,990.4747,5.329618 +0.6128227,6,414.9884,2.724943 +0.7579412,74,153.5898,5.263626 +0.6994303,53,631.9404,4.853168 +0.5234492,78,297.832,4.834109 +0.8478319,59,693.8864,5.295759 +0.6780007,82,653.9778,5.126247 +0.9499825,77,248.3936,6.008599 +0.7981417,17,519.4062,4.201151 +0.7752259,42,311.8138,4.863517 +0.826048,33,864.1303,4.805565 +0.667351,98,974.1075,5.227651 +0.6381593,62,681.9012,4.851483 +0.798938,4,711.222,2.783472 +0.5879505,42,369.4315,4.471059 +0.8196174,54,180.369,5.192559 +0.6100542,90,444.2154,5.076279 +0.6362786,23,233.5411,4.077975 +0.750284,26,116.5786,4.461778 +0.9369969,5,178.8826,3.771926 +0.5257318,9,706.6695,2.969496 +0.7478378,42,643.4664,4.784185 +0.9030148,45,524.4915,5.324933 +0.6976315,19,264.6202,4.045463 +0.9357426,73,645.4213,5.821537 +0.7157091,12,958.8152,3.668812 +0.7272343,13,369.1633,3.777322 +0.5502546,48,959.5066,4.504085 +0.9253864,96,765.634,5.93158 +0.9491976,69,528.1747,5.886513 +0.5999067,35,714.8857,4.343182 +0.6613981,43,778.2886,4.619001 +0.879046,30,112.4804,5.003622 +0.9058213,5,695.0025,3.520497 +0.8086484,19,697.3336,4.321889 +0.9370875,92,947.153,5.967871 +0.8467592,85,885.2863,5.53676 +0.7995316,96,972.5823,5.487207 +0.5848051,35,458.6017,4.318515 +0.7358364,58,597.9595,4.996038 +0.6540596,48,143.7583,4.719058 +0.5006105,81,662.1652,4.82027 +0.8346951,48,14.25703,5.788726 +0.7329782,6,43.70629,3.085010 +0.9066034,2,823.6592,2.375442 +0.7878482,13,906.5229,3.935062 +0.7943929,65,946.3048,5.207958 +0.632154,21,257.8158,3.990246 +0.8313863,47,269.2579,5.108403 +0.5335781,33,642.3327,4.177841 +0.7919937,90,737.0373,5.429159 +0.7023364,84,296.3370,5.204418 +0.8558765,53,630.4518,5.249077 +0.7163529,46,152.1295,4.816822 +0.8768499,33,273.0424,5.009091 +0.8699501,77,859.3091,5.547184 +0.6634953,75,282.3771,5.04935 +0.5972464,3,744.7833,1.820563 +0.5361586,7,933.6834,2.722984 +0.9211899,78,470.3899,5.790909 +0.7581645,23,977.301,4.336052 +0.8797704,57,184.4853,5.438209 +0.7138117,74,2.634701,7.444284 +0.6939382,2,41.70306,1.465464 +0.7119747,36,351.9855,4.594677 +0.809572,22,557.5994,4.4462 +0.6464639,71,906.9329,4.963047 +0.8569028,7,617.3857,3.608468 +0.5721191,61,902.19,4.723571 +0.7498904,45,663.3189,4.840069 +0.6409147,57,531.118,4.796568 +0.7570784,76,460.3876,5.239693 +0.655966,100,186.1752,5.251874 +0.6083228,89,915.9558,5.05899 +0.8398448,35,487.5325,4.901501 +0.5304431,41,517.3377,4.34911 +0.7651443,26,709.3049,4.454686 +0.7308961,66,9.157054,5.800235 +0.6492565,27,835.3336,4.225992 +0.8777307,91,212.3944,5.741262 +0.7739295,81,861.2667,5.312202 +0.8367624,47,515.6989,5.106047 +0.7151403,58,933.0991,4.94759 +0.8882203,46,972.1538,5.263063 +0.828799,27,232.0475,4.688259 +0.8518334,56,420.6314,5.283884 +0.790318,16,171.5772,4.149405 +0.5580039,26,502.0283,4.023696 +0.6352824,22,475.6875,4.030243 +0.8705968,29,851.155,4.861 +0.6465768,33,538.81,4.386032 +0.7590183,69,73.19668,5.279012 +0.6525166,3,888.6056,1.963260 +0.7502,67,678.8216,5.12912 +0.5088592,89,461.3315,4.903761 +0.7982266,76,366.1689,5.344668 +0.6969608,66,241.728,5.02676 +0.6023179,78,363.5392,4.963039 +0.6775685,40,714.0139,4.595814 +0.66376,7,908.377,3.011174 +0.8134477,16,708.8301,4.193725 +0.5391178,46,835.6779,4.452678 +0.8838125,15,159.1018,4.443479 +0.672796,93,961.0114,5.201217 +0.5799419,50,484.976,4.589876 +0.5265862,41,490.8695,4.342801 +0.7029529,64,386.5903,5.005399 +0.9227982,85,515.2134,5.851962 +0.7224784,87,964.932,5.249543 +0.7436994,23,694.6903,4.30269 +0.5867254,76,376.4596,4.91713 +0.920802,42,540.3073,5.36702 +0.9338496,64,748.9049,5.719828 +0.838145,37,289.8473,4.951242 +0.5418479,91,779.7418,4.968562 +0.7017749,25,780.5221,4.27309 +0.5447994,43,683.9666,4.410061 +0.871518,51,778.878,5.273395 +0.8858706,40,121.4736,5.244512 +0.5150946,91,202.8316,4.937838 +0.6716517,84,745.3948,5.130122 +0.7249413,9,340.9548,3.426074 +0.7069959,61,733.6144,4.969756 +0.9488083,68,720.232,5.863705 +0.615935,17,160.8070,3.77786 +0.7771524,10,561.6105,3.66843 +0.6106939,75,556.1777,4.944092 +0.6134752,24,374.4686,4.062762 +0.5894027,51,207.9282,4.632573 +0.8338988,49,547.5659,5.125847 +0.7043978,22,531.6043,4.17634 +0.7000624,42,531.8091,4.681899 +0.6362798,6,823.059,2.778423 +0.7907857,89,825.5564,5.416972 +0.9223966,58,656.838,5.590938 +0.7182263,84,915.3776,5.217181 +0.86109,81,997.8343,5.548408 +0.8848985,89,869.6922,5.697209 +0.651742,22,614.38,4.062032 +0.6605856,3,98.09387,1.994872 +0.882514,63,711.0102,5.462032 +0.7547409,29,689.7354,4.515432 +0.9344155,10,400.5296,4.366817 +0.8368518,60,859.1815,5.270026 +0.7531741,56,901.1335,5.004396 +0.755553,9,359.4564,3.509542 +0.5549631,38,47.68359,4.383727 +0.9452977,2,460.798,2.723966 +0.7122327,55,485.7671,4.910092 +0.8996243,27,993.7618,4.929864 +0.7124914,43,538.1343,4.725792 +0.660462,99,233.3052,5.245786 +0.9464191,54,778.8559,5.693103 +0.8299546,74,141.3385,5.46646 +0.8861815,93,564.7782,5.741055 +0.5689354,11,962.0052,3.260038 +0.5572705,4,974.416,2.109944 +0.7668345,75,828.1217,5.243156 +0.7570055,26,791.2877,4.433298 +0.8012525,50,338.7716,5.058115 +0.6085329,61,566.1486,4.788552 +0.7073712,23,921.3009,4.216015 +0.613116,99,362.8237,5.151726 +0.8869052,28,692.1336,4.904267 +0.693029,29,395.8174,4.380828 +0.8763198,16,419.0561,4.430672 +0.6236438,13,929.845,3.533911 +0.631617,99,172.1357,5.202372 +0.8453343,29,491.5275,4.778079 +0.7733883,46,643.9964,4.912519 +0.8837153,93,751.4323,5.724347 +0.5842343,8,245.8035,2.974394 +0.7813733,56,967.567,5.070012 +0.7918319,86,426.1061,5.409196 +0.5988063,89,374.8896,5.051499 +0.8410293,7,502.7104,3.545143 +0.7985893,44,518.6063,4.94787 +0.8933352,77,730.5682,5.6391 +0.5008204,19,263.4858,3.647075 +0.7042678,68,759.1042,5.042159 +0.5722501,47,515.0346,4.528346 +0.6796555,73,455.8959,5.05149 +0.826039,84,33.03012,5.8104 +0.7891293,33,519.956,4.706889 +0.6771388,83,646.286,5.133324 +0.7841508,5,513.7669,2.988859 +0.8459404,6,305.2934,3.416229 +0.8240553,7,432.4855,3.481931 +0.6144259,22,963.728,3.985171 +0.793283,22,23.60787,4.664766 +0.7154832,80,681.36,5.180846 +0.9356364,98,61.58024,6.31134 +0.6426233,21,114.6117,4.029196 +0.7534234,5,194.0182,2.898595 +0.6921663,53,686.5312,4.837731 +0.612162,76,666.1722,4.954618 +0.653742,59,619.762,4.844223 +0.63553,59,731.1882,4.809578 +0.6200705,89,378.8527,5.087704 +0.6739772,18,445.6196,3.939308 +0.9462715,68,524.3853,5.854955 +0.7380447,41,375.4509,4.751645 +0.523857,78,851.987,4.827968 +0.5059004,81,653.6981,4.828579 +0.7512636,98,220.7087,5.42606 +0.6992854,16,132.8526,3.914488 +0.8227314,72,30.54506,5.703733 +0.9484554,86,735.9275,6.009947 +0.6075916,30,535.5072,4.234346 +0.8852776,38,952.3645,5.115993 +0.5918882,6,400.8994,2.676709 +0.6517169,8,804.8244,3.121701 +0.6898073,77,688.0591,5.103501 +0.9030026,67,11.96135,6.805333 +0.7437836,28,699.2324,4.461164 +0.875612,18,962.0697,4.511439 +0.5997572,86,864.9031,5.020716 +0.7092418,23,309.4445,4.230975 +0.6523984,83,734.0368,5.086989 +0.5312756,4,851.336,2.050064 +0.6282366,20,929.0183,3.93066 +0.5370415,23,451.2979,3.880654 +0.8735109,63,350.2037,5.448246 +0.8351599,24,859.1465,4.59044 +0.9494263,72,211.5009,5.974775 +0.6140805,16,844.5632,3.705149 +0.7450794,4,714.8403,2.603754 +0.7300385,70,851.1554,5.114127 +0.5096593,78,938.8038,4.805399 +0.8180738,76,614.2184,5.384708 +0.7153642,97,572.9604,5.316716 +0.8078966,7,338.2535,3.42692 +0.6904116,91,286.7615,5.237953 +0.8160172,70,553.6183,5.324621 +0.6299202,51,455.703,4.694567 +0.7084219,4,257.4866,2.499209 +0.9497703,50,348.7214,5.697982 +0.8508624,78,645.7308,5.497724 +0.6742178,82,677.2921,5.118834 +0.8821952,94,356.1011,5.74971 +0.5468056,2,705.1514,1.061390 +0.6789854,45,410.6719,4.69475 +0.8280198,79,810.9767,5.433856 +0.6221906,86,539.6919,5.062418 +0.8026975,15,852.9501,4.104213 +0.8222019,21,824.7458,4.443411 +0.5803124,37,138.2354,4.371959 +0.6882381,48,926.1536,4.753676 +0.8179348,66,203.1527,5.324453 +0.5960629,43,262.2780,4.508414 +0.6974869,88,196.3518,5.240979 +0.823517,91,940.689,5.514238 +0.8117326,13,280.8571,4.022421 +0.9262007,64,178.3617,5.74963 +0.678415,15,464.139,3.78771 +0.806295,18,643.1348,4.27097 +0.6671483,35,754.7018,4.470686 +0.6650073,14,21.80781,3.833526 +0.5473471,40,56.81366,4.401174 +0.9026884,52,113.4952,5.524751 +0.799699,58,557.2425,5.148982 +0.6020433,59,817.6421,4.749881 +0.7945232,47,44.2495,5.16844 +0.9197076,74,211.6517,5.794805 +0.859864,54,580.0636,5.277453 +0.7954953,68,945.6234,5.242217 +0.6905937,86,716.3957,5.182364 +0.6441292,74,974.002,4.988236 +0.5752189,16,88.31872,3.650503 +0.7610879,100,405.8932,5.440726 +0.7511553,49,522.1999,4.90919 +0.8332004,35,975.6917,4.870302 +0.7003797,94,765.2736,5.262087 +0.5723759,36,250.6977,4.324629 +0.6185644,29,946.417,4.224327 +0.8220523,19,398.2014,4.371275 +0.8655022,88,16.47093,6.414553 +0.903933,34,975.2979,5.118896 +0.6888455,27,885.4896,4.307053 +0.8945567,50,805.753,5.350675 +0.6323121,54,180.8512,4.758951 +0.5020541,89,814.6319,4.890543 +0.9150541,54,356.8162,5.524083 +0.8965727,76,253.6532,5.685681 +0.6544637,24,615.9503,4.140782 +0.6635601,41,573.3519,4.589051 +0.6201682,46,998.2747,4.592474 +0.8774226,67,135.0859,5.569834 +0.890321,35,201.3599,5.125744 +0.9028605,30,676.057,5.028651 +0.7226537,96,9.642385,6.045286 +0.8471953,3,809.2317,2.622658 +0.8198636,89,693.7546,5.494297 +0.6348555,43,912.2159,4.567892 +0.6425137,75,606.9982,4.998836 +0.873109,75,309.51,5.571157 +0.5760752,33,224.8230,4.262233 +0.7945425,30,828.5185,4.642699 +0.8734823,23,934.1412,4.695301 +0.8686912,61,513.1925,5.395958 +0.6471778,44,937.891,4.608398 +0.5882846,29,724.5066,4.168854 +0.942896,29,366.4086,5.262554 +0.5419351,3,237.3975,1.688196 +0.7674567,2,77.04476,1.701728 +0.8917366,74,66.67197,5.815672 +0.6472711,97,597.1157,5.189636 +0.8479221,21,807.45,4.529399 +0.5589803,43,80.83193,4.467882 +0.5077531,37,732.3927,4.226506 +0.7923223,50,849.2879,5.017456 +0.670393,84,831.423,5.126814 +0.7826879,75,302.5934,5.302287 +0.9387543,94,401.9712,6.022296 +0.8283552,65,534.5723,5.30889 +0.7227295,49,63.70136,4.94129 +0.5687914,34,455.7122,4.266248 +0.5752718,73,98.7667,4.898616 +0.88616,3,302.6824,2.828999 +0.6065566,78,693.4897,4.963533 +0.9167606,89,568.2099,5.8468 +0.6724503,5,574.031,2.663222 +0.784313,83,235.2819,5.386913 +0.940857,31,414.4548,5.290129 +0.9325461,21,901.5054,4.929178 +0.6883665,36,742.762,4.53579 +0.9292036,61,757.2979,5.659778 +0.9008816,96,76.9742,6.01577 +0.761467,48,742.2594,4.913388 +0.8365658,18,440.6055,4.373552 +0.6552103,64,556.7721,4.907782 +0.8254065,34,223.5664,4.856578 +0.8217355,94,426.2313,5.547764 +0.8287026,66,565.9248,5.319255 +0.7975493,62,454.1757,5.194802 +0.6771793,98,812.32,5.246957 +0.6177541,60,35.37344,4.911115 +0.79438,33,936.6395,4.71411 +0.6183924,60,960.2377,4.789908 +0.8887941,93,403.5623,5.763103 +0.7753973,24,56.94756,4.521837 +0.6653419,33,43.18045,4.522211 +0.8109106,48,550.3599,5.043916 +0.613164,39,613.6455,4.454258 +0.9059224,96,93.82517,6.002161 +0.8163602,62,753.2386,5.235758 +0.7707746,66,330.8447,5.180342 +0.5982049,30,835.1149,4.214452 +0.872359,22,767.238,4.658577 +0.84028,65,577.014,5.342823 +0.826224,92,556.121,5.538669 +0.6703941,45,160.551,4.69885 +0.8316669,41,568.3738,4.989419 +0.672689,88,603.938,5.167016 +0.584872,45,537.5861,4.516311 +0.6643863,80,971.6719,5.080185 +0.719142,69,552.564,5.086569 +0.8751901,66,19.89127,6.10715 +0.6868238,12,614.6998,3.60127 +0.891284,10,336.6336,4.105752 +0.7381764,63,855.624,5.056398 +0.6877144,40,834.2985,4.61508 +0.8837561,100,155.7344,5.855813 +0.7723711,50,92.417,5.050388 +0.7447593,38,89.42705,4.768572 +0.8722185,44,412.1780,5.186088 +0.5126045,33,58.81312,4.172292 +0.6937582,85,587.4888,5.182627 +0.7911117,22,194.6301,4.415096 +0.5921802,31,24.67419,4.352036 +0.5053348,33,938.2297,4.127942 +0.8214973,89,376.6808,5.514248 +0.7951828,18,93.5989,4.294712 +0.6450288,86,64.36293,5.183766 +0.8471788,39,480.3094,5.005853 +0.5958538,18,899.7957,3.774029 +0.9010773,94,338.4129,5.829971 +0.6502918,91,432.7548,5.154538 +0.5670526,37,415.3917,4.332074 +0.9350157,40,645.5472,5.414702 +0.9044,14,99.43052,4.524826 +0.8317929,39,303.3309,4.968462 +0.6933141,21,939.7346,4.108837 +0.845593,30,813.2998,4.797022 +0.7186427,16,188.2066,3.952521 +0.859615,24,155.5391,4.723889 +0.7278887,22,52.30448,4.31952 +0.7061932,83,761.9076,5.186903 +0.9022402,64,824.017,5.551911 +0.6490087,66,217.7326,4.93539 +0.6943846,36,516.58,4.551637 +0.5684814,26,286.0778,4.047090 +0.6554544,18,448.8217,3.899225 +0.795269,35,839.412,4.762103 +0.6238327,24,757.4391,4.078363 +0.550766,30,447.5801,4.131244 +0.8800597,2,410.1339,2.203728 +0.6440965,28,63.0589,4.304735 +0.9043739,22,208.8758,4.840424 +0.6648802,53,571.521,4.786388 +0.5320439,20,588.0347,3.747539 +0.6128809,55,149.5538,4.741544 +0.5747402,66,978.2475,4.786235 +0.80501,14,784.1936,4.052608 +0.8099135,50,652.5404,5.067729 +0.7363827,31,749.4184,4.523436 +0.6852816,3,659.303,2.054130 +0.7694083,78,255.168,5.303633 +0.8575165,30,626.4122,4.842038 +0.7631899,27,940.2408,4.4774 +0.8203281,20,645.0849,4.400649 +0.6073138,40,473.9538,4.465438 +0.8104157,69,324.3091,5.313832 +0.7241617,4,471.6251,2.541906 +0.8205727,60,901.444,5.222101 +0.9149799,19,811.2267,4.746086 +0.835535,84,701.7006,5.499324 +0.7527543,44,242.7408,4.850217 +0.6686033,40,773.8855,4.577449 +0.9312872,47,190.7668,5.56208 +0.9144552,24,263.1231,4.950928 +0.8733462,47,566.8382,5.228998 +0.5232224,36,412.0128,4.233111 +0.718345,76,351.4148,5.16206 +0.9048545,86,630.1111,5.764843 +0.5196135,16,225.0018,3.526032 +0.7626791,99,791.2467,5.4246 +0.9192357,20,362.8843,4.827192 +0.7492633,94,650.9407,5.363063 +0.8498713,36,704.8396,4.949172 +0.9369925,27,874.8804,5.144813 +0.5837224,69,712.8748,4.83564 +0.7980785,21,88.03727,4.439118 +0.8667148,44,538.502,5.158677 +0.6073327,29,183.8453,4.218646 +0.7684573,90,986.2768,5.370184 +0.6936724,33,581.2125,4.480758 +0.687191,79,669.1087,5.116968 +0.8340377,99,903.1325,5.600063 +0.6832922,53,18.68955,5.108172 +0.5332718,13,806.5033,3.351198 +0.5237699,4,241.6940,2.035217 +0.9088265,97,84.6489,6.045124 +0.8294818,21,586.6442,4.470498 +0.791115,50,282.425,5.036552 +0.91856,95,725.4959,5.890514 +0.7135054,55,753.2236,4.907396 +0.860862,65,102.1001,5.515011 +0.84523,54,972.6275,5.220716 +0.8560852,74,754.1516,5.475962 +0.7238725,20,874.4928,4.13784 +0.9034313,16,194.8503,4.585412 +0.7031215,54,115.2008,4.9226 +0.7868186,17,274.4223,4.178258 +0.7080042,99,931.5809,5.310344 +0.582401,66,842.4972,4.799686 +0.9021958,53,930.0976,5.422111 +0.6511199,13,567.0518,3.595049 +0.8124542,90,259.2000,5.511839 +0.934324,66,273.5482,5.78612 +0.7660926,76,925.8054,5.249383 +0.748764,56,26.35096,5.274348 +0.7552357,89,102.7598,5.418272 +0.9286532,27,123.1344,5.182816 +0.7288266,2,328.6701,1.558771 +0.5496063,48,543.8712,4.505532 +0.7565857,88,985.629,5.328539 +0.5106877,35,381.159,4.188819 +0.7752931,36,442.6338,4.739741 +0.7177923,33,98.16995,4.583176 +0.7972243,10,377.3643,3.733916 +0.9295137,91,103.3631,6.085717 +0.7990287,68,939.0697,5.251259 +0.75437,67,721.0245,5.137621 +0.7973704,25,326.4377,4.52186 +0.6784953,44,958.7787,4.668511 +0.6956036,28,483.9274,4.355713 +0.659538,96,855.451,5.200489 +0.944546,31,637.6513,5.305119 +0.8469256,34,975.7063,4.893041 +0.6674808,49,435.8748,4.735723 +0.936232,20,52.79911,5.141708 +0.7975782,81,159.8681,5.42625 +0.903022,28,861.7582,4.974912 +0.8505326,35,125.4830,4.997666 +0.6403539,54,775.8325,4.751972 +0.8043825,29,409.8449,4.653847 +0.5183124,16,839.732,3.518277 +0.6213446,22,726.9033,3.99988 +0.5936926,37,32.76075,4.474718 +0.809751,64,986.4935,5.236491 +0.94077,53,544.5571,5.649796 +0.6905449,97,811.6854,5.264553 +0.7754784,19,389.0463,4.233604 +0.6515826,21,845.3145,4.020459 +0.8438344,94,511.9097,5.606381 +0.6452673,84,667.1204,5.083721 +0.849467,44,324.1082,5.112301 +0.7666643,28,291.3787,4.530994 +0.8586009,22,708.908,4.606299 +0.9265102,15,175.7067,4.677897 +0.5242165,59,7.200673,4.92003 +0.5045844,79,930.6226,4.806901 +0.7911816,76,301.5211,5.332991 +0.9307524,57,860.0465,5.621265 +0.8383404,37,672.318,4.932198 +0.8236633,34,770.2948,4.822038 +0.763047,99,153.1683,5.480739 +0.6548154,65,926.9123,4.913963 +0.7707323,17,527.2263,4.123076 +0.8738404,61,301.1623,5.433622 +0.8657663,48,554.2702,5.216425 +0.6843261,94,947.1752,5.229856 +0.6344909,62,841.2254,4.843361 +0.8845142,23,681.4296,4.745308 +0.8838358,36,498.6873,5.082622 +0.9302862,56,39.67869,6.015003 +0.8695975,51,255.0341,5.299941 +0.9011584,3,704.5094,2.914552 +0.6071735,24,272.4455,4.053728 +0.5175375,67,5.328416,5.096529 +0.5891973,3,210.3449,1.803305 +0.5194459,34,179.9309,4.186702 +0.6079837,87,952.0759,5.042047 +0.7140844,81,408.8203,5.194953 +0.8013718,68,190.4623,5.302434 +0.6591662,100,340.2262,5.240922 +0.6670773,12,331.8724,3.559844 +0.9341007,58,957.1275,5.651292 +0.723373,63,932.6138,5.024305 +0.5604985,59,224.9405,4.691283 +0.6705802,22,879.1055,4.099297 +0.7786912,75,271.8816,5.29626 +0.6685635,39,810.294,4.55748 +0.6490457,99,592.4233,5.207065 +0.6931737,6,418.268,2.922958 +0.8710123,31,718.8835,4.914593 +0.5736931,61,229.3061,4.739087 +0.6210157,25,266.6708,4.115779 +0.8493002,81,67.53119,5.693514 +0.7759961,77,213.7897,5.318234 +0.9185508,71,282.1866,5.739998 +0.8265519,63,476.959,5.284545 +0.6687311,37,717.4073,4.517729 +0.6494729,44,908.6333,4.612895 +0.6121188,49,703.1177,4.628304 +0.816316,40,418.4573,4.931516 +0.7798099,96,142.9824,5.505915 +0.586697,41,549.3181,4.446578 +0.7764464,83,647.4829,5.338891 +0.6998719,31,659.3081,4.443376 +0.7472036,65,694.0377,5.100702 +0.703049,69,89.38273,5.122236 +0.703443,6,842.3088,2.947383 +0.5989944,20,546.0432,3.875062 +0.7512451,14,663.2664,3.900565 +0.5872646,12,212.4875,3.389856 +0.949173,20,168.1584,5.08552 +0.9155182,25,239.3825,4.992388 +0.5755633,51,90.36437,4.630002 +0.5876624,7,960.5489,2.834894 +0.7044702,68,543.0481,5.046567 +0.79438,30,52.91661,4.776874 +0.7362505,42,945.8348,4.754237 +0.7126581,24,443.559,4.268968 +0.787679,25,648.4927,4.48379 +0.7151991,13,409.3209,3.746174 +0.8669045,95,523.904,5.687001 +0.7202985,54,207.1601,4.933934 +0.7311327,91,113.9181,5.367735 +0.6618435,59,377.5652,4.865612 +0.9116986,72,495.8482,5.687799 +0.7557157,12,567.5894,3.775468 +0.9163235,57,713.0014,5.544914 +0.8607126,20,925.3333,4.536246 +0.9231666,88,805.9913,5.862893 +0.6026225,75,581.2631,4.929917 +0.8698394,12,428.8574,4.160611 +0.6368494,11,272.8854,3.410454 +0.7667054,61,836.1898,5.097482 +0.8000152,97,106.0452,5.59455 +0.672968,73,419.9799,5.040077 +0.7445197,21,292.8912,4.240783 +0.6600486,20,419.2918,4.000971 +0.9095673,11,770.5601,4.273962 +0.6372859,29,931.7848,4.260334 +0.7531992,49,307.2706,4.924747 +0.8082588,93,104.2067,5.590879 +0.801224,59,699.5637,5.161321 +0.8842195,63,245.3876,5.507366 +0.8049434,29,661.9891,4.648005 +0.7825961,100,809.3402,5.476277 +0.888974,23,292.7039,4.785021 +0.7712366,64,203.9149,5.177267 +0.9101844,93,789.2389,5.834102 +0.5827066,16,736.1206,3.642731 +0.7353298,50,545.3903,4.887766 +0.9000253,29,878.5962,4.986079 +0.5437368,40,302.523,4.356087 +0.8315908,96,929.6324,5.572368 +0.8205049,52,953.6965,5.12034 +0.6426717,16,342.5943,3.769862 +0.5522754,46,775.7081,4.475167 +0.8128539,74,26.48869,5.734373 +0.5600869,20,573.3304,3.800104 +0.5674171,55,762.024,4.638407 +0.537677,28,997.0594,4.047145 +0.5726309,37,957.9053,4.337529 +0.7954047,66,127.4570,5.291504 +0.7471518,61,324.2084,5.069361 +0.5223553,32,951.6902,4.131766 +0.7520169,41,74.86224,4.862345 +0.7027413,11,484.6241,3.559348 +0.7187845,61,725.0286,4.993993 +0.7299217,16,873.775,3.961720 +0.7115777,4,604.7973,2.504418 +0.9172477,38,439.2534,5.283334 +0.6639819,89,337.2648,5.168281 +0.8368359,63,611.6161,5.30952 +0.7896925,94,298.3923,5.476009 +0.8271702,44,666.0247,5.024567 +0.8040352,44,843.4855,4.955639 +0.949263,7,389.1023,4.184174 +0.8328376,85,646.6266,5.501056 +0.526783,100,325.3328,5.018803 +0.6688105,77,836.735,5.06227 +0.8282477,67,108.7778,5.415125 +0.7113153,9,856.2697,3.385048 +0.589003,20,91.5303,3.880131 +0.7194362,14,611.8864,3.820276 +0.7537761,56,591.2144,5.010757 +0.6846757,99,320.4645,5.282772 +0.8769688,38,910.5023,5.083227 +0.7869178,90,830.2127,5.415139 +0.807645,26,61.79666,4.682424 +0.9448865,18,321.8201,4.930096 +0.7294469,49,573.7421,4.859254 +0.9085438,27,658.597,4.980016 +0.9300719,42,317.518,5.442027 +0.5834533,3,827.8777,1.786282 +0.6734082,82,171.4136,5.147934 +0.7569421,51,123.9995,5.002314 +0.7239631,76,233.7967,5.185775 +0.6186872,47,424.2941,4.61253 +0.6766206,44,508.0513,4.670198 +0.932699,90,275.5164,5.979196 +0.6464799,84,803.1497,5.084213 +0.9442864,16,521.2168,4.819767 +0.7918385,42,154.5967,4.935284 +0.7414237,35,819.7154,4.628522 +0.6115499,43,488.3118,4.529439 +0.8058953,40,515.7696,4.897627 +0.614234,59,903.9223,4.770477 +0.9121058,10,464.811,4.213932 +0.8476603,79,582.6491,5.498521 +0.7929727,77,169.8307,5.374357 +0.6338905,7,485.1146,2.94188 +0.7834596,30,327.6489,4.626784 +0.8774419,17,442.962,4.483792 +0.5609554,32,68.48343,4.237052 +0.7647811,68,827.2835,5.169981 +0.832964,23,5.440919,5.976688 +0.5741506,26,547.8397,4.052964 +0.9304252,17,468.5578,4.765566 +0.68403,28,184.1941,4.347467 +0.8176484,32,766.89,4.758464 +0.9411109,59,779.2206,5.713063 +0.926516,84,836.5033,5.850456 +0.8412952,78,932.087,5.461819 +0.6364015,99,162.6142,5.213254 +0.7070626,89,175.7054,5.273428 +0.6629175,76,40.89244,5.182355 +0.9395931,56,864.6944,5.665923 +0.8185325,98,199.7678,5.601049 +0.8494492,2,715.3348,2.035239 +0.8009258,81,434.5775,5.390702 +0.6815484,13,673.4679,3.662592 +0.80715,99,144.2072,5.599653 +0.6203594,100,943.6284,5.160893 +0.9240174,8,951.9496,4.08529 +0.8159787,65,519.9843,5.274393 +0.5230194,12,905.3269,3.253303 +0.7412851,52,267.3375,4.944869 +0.8801484,85,647.5159,5.655434 +0.802909,57,781.1324,5.139793 +0.8999761,9,456.1147,4.052302 +0.8341594,10,5.503232,4.891732 +0.8345882,67,930.7735,5.338458 +0.7542815,50,129.2632,4.978182 +0.7412981,23,855.8213,4.295311 +0.9113762,38,889.0846,5.236185 +0.8416925,29,982.5072,4.756377 +0.5095571,82,905.1603,4.842070 +0.9491786,4,917.2897,3.631085 +0.8049138,63,970.9605,5.212878 +0.6334493,6,736.2926,2.771905 +0.8973752,100,631.2114,5.829958 +0.5115773,7,521.9071,2.671702 +0.7581456,73,83.04014,5.304008 +0.7434194,84,267.1309,5.294006 +0.7207906,74,704.4638,5.136362 +0.9040117,8,47.05634,4.098636 +0.6233847,99,815.7837,5.159965 +0.7571528,90,298.5627,5.368868 +0.7701096,14,493.4289,3.954212 +0.6898053,44,472.0429,4.697632 +0.6360893,97,800.1676,5.167418 +0.8561774,36,21.78472,5.422449 +0.5753474,3,428.5272,1.767289 +0.9458913,41,28.3417,6.084906 +0.6731936,92,64.30473,5.294787 +0.8784051,40,304.3885,5.152199 +0.6835589,12,757.9798,3.592619 +0.7425327,83,284.7888,5.281525 +0.5474802,43,565.8282,4.415549 +0.679627,18,61.24071,4.006403 +0.6870299,89,382.3318,5.209086 +0.6341744,67,603.614,4.902287 +0.9344777,56,755.1912,5.63539 +0.8766567,45,511.7271,5.213287 +0.6304936,7,695.3798,2.932777 +0.6135839,38,197.7654,4.448517 +0.5532043,11,73.55859,3.248804 +0.9467684,81,424.0672,5.980747 +0.7369565,18,801.3018,4.080849 +0.8355981,45,249.5172,5.093117 +0.6856068,45,969.7303,4.699566 +0.7299538,98,466.1102,5.356919 +0.875668,44,958.7983,5.182152 +0.8005378,79,956.557,5.358165 +0.513656,88,766.3824,4.900481 +0.725377,62,531.5351,5.023478 +0.845314,12,201.7055,4.078737 +0.9495224,2,585.7786,2.771761 +0.7933197,64,651.044,5.199389 +0.535197,9,945.569,2.988493 +0.5272532,4,170.3757,2.044560 +0.6848626,100,69.06699,5.373987 +0.6996583,15,376.6187,3.838532 +0.888774,54,949.0652,5.376733 +0.5558322,15,641.6645,3.531028 +0.6628907,48,285.8969,4.717985 +0.7657242,43,421.0658,4.850639 +0.569207,28,54.71352,4.151142 +0.9085392,17,229.6301,4.654862 +0.5070748,64,13.36672,4.802679 +0.61338,40,504.4076,4.476023 +0.8674259,67,317.9034,5.472228 +0.616898,58,124.3922,4.795652 +0.7760441,72,511.691,5.243743 +0.744249,49,410.2558,4.897526 +0.5424169,40,275.7656,4.354667 +0.9030827,70,471.7542,5.630173 +0.9166235,43,743.5866,5.353063 +0.6056715,24,951.203,4.042294 +0.6035406,50,904.2237,4.627114 +0.8029719,27,449.0773,4.592429 +0.7518686,77,868.1552,5.227454 +0.8557797,13,260.3399,4.182154 +0.8567424,70,330.3319,5.463428 +0.9108702,96,134.5617,5.970751 +0.8152673,70,468.8401,5.326343 +0.511748,8,144.1443,2.822673 +0.7473972,98,741.933,5.385549 +0.6116945,33,651.738,4.318166 +0.7951198,99,863.7611,5.498526 +0.6094803,70,518.7182,4.892452 +0.6264041,91,783.8267,5.106219 +0.5996085,38,81.17409,4.448564 +0.6727878,39,768.5118,4.566196 +0.9323841,9,7.531608,5.509384 +0.6817553,18,528.9048,3.955063 +0.5344935,17,440.8971,3.606659 +0.8520906,66,498.9145,5.394094 +0.7163306,87,35.37812,5.448221 +0.5705777,10,80.44106,3.188661 +0.8051647,3,193.439,2.453639 +0.5721151,55,154.0183,4.66567 +0.6572475,72,965.465,4.992097 +0.910285,63,813.4502,5.579033 +0.9048497,9,219.7808,4.096486 +0.7566543,6,747.506,3.097807 +0.7815772,22,683.9203,4.36401 +0.5786503,50,369.4688,4.59009 +0.7074791,12,192.057,3.663563 +0.6707687,5,195.6387,2.664786 +0.6535881,74,599.2874,5.009229 +0.9449619,73,454.6559,5.897153 +0.5999044,66,80.468,4.879648 +0.9103132,3,745.8394,2.975553 +0.798354,82,620.4156,5.384614 +0.7068981,63,534.5147,4.996694 +0.7926765,97,170.8177,5.533752 +0.5030747,66,276.78,4.676993 +0.6412308,91,198.3963,5.155648 +0.5837347,28,12.83706,4.340776 +0.6307461,77,501.6002,4.999005 +0.5892319,22,613.943,3.938322 +0.9173725,82,327.6299,5.820418 +0.8466205,52,964.144,5.198747 +0.7778326,20,118.1721,4.318618 +0.6377339,39,145.3060,4.52407 +0.8973141,53,65.21878,5.603597 +0.680635,95,961.3994,5.230268 +0.802825,70,272.1754,5.309848 +0.7659804,79,673.3793,5.280033 +0.8782393,26,629.0036,4.813546 +0.8774979,9,139.6891,3.970449 +0.525396,43,253.7263,4.383524 +0.8223621,89,773.2267,5.499203 +0.681816,15,451.6343,3.795628 +0.9253184,59,524.5041,5.625282 +0.534124,3,580.5324,1.668108 +0.7524038,24,900.835,4.356676 +0.8326032,81,585.9235,5.469971 +0.8192468,59,568.3666,5.213842 +0.604393,44,288.0690,4.540236 +0.5586066,12,147.7344,3.334218 +0.8883083,73,995.3096,5.577656 +0.6432519,61,561.362,4.850509 +0.5102173,65,972.368,4.670415 +0.7003389,16,957.4265,3.890828 +0.5521129,11,4.547047,3.579797 +0.59708,31,140.4593,4.259507 +0.8134452,29,902.408,4.669319 +0.9260697,59,51.65915,5.924638 +0.8265399,16,547.1571,4.238842 +0.832042,17,312.8203,4.31748 +0.6216659,61,817.8548,4.808829 +0.7283849,92,389.5894,5.314127 +0.5672065,11,610.8746,3.257575 +0.5323523,44,361.2781,4.410664 +0.59117,55,655.6214,4.679735 +0.6095431,19,307.1752,3.855151 +0.6091849,51,227.8409,4.666844 +0.7753224,78,517.2963,5.297495 +0.7268435,83,747.4984,5.22845 +0.730585,72,890.9116,5.134721 +0.6442031,8,887.0963,3.103915 +0.8302386,72,521.1991,5.385542 +0.7942507,67,324.7722,5.250096 +0.5806502,20,278.2976,3.844107 +0.8981183,13,968.5417,4.350224 +0.5357593,27,599.0527,4.0146 +0.7095182,34,629.3844,4.537233 +0.9377532,42,526.5726,5.472395 +0.7851188,86,644.761,5.383838 +0.7201651,86,630.1342,5.241761 +0.9102288,83,621.2721,5.766953 +0.6411688,68,830.1142,4.922934 +0.6090806,15,180.3769,3.647734 +0.5787879,36,718.225,4.327657 +0.814151,100,408.9423,5.569888 +0.6659953,86,37.7504,5.29409 +0.7499388,33,212.7551,4.626876 +0.8165642,69,474.2051,5.319668 +0.7661147,22,176.09,4.34867 +0.7600815,72,879.7484,5.198689 +0.5405304,20,170.2612,3.771913 +0.8303233,39,62.11989,5.087436 +0.5649674,54,939.8396,4.619411 +0.5468609,19,890.826,3.728276 +0.5018868,20,172.1611,3.698457 +0.5700143,57,62.23176,4.722349 +0.5904414,29,332.7185,4.178141 +0.6844848,44,537.8669,4.685287 +0.8536574,32,840.1896,4.872602 +0.6186735,82,923.3346,5.018009 +0.6855065,93,374.6255,5.237324 +0.9478164,43,546.3272,5.561435 +0.9324406,18,441.5948,4.825239 +0.6415473,32,767.5264,4.349149 +0.8552597,68,165.8796,5.477813 +0.9283917,62,763.6844,5.665571 +0.5535796,10,278.4392,3.137836 +0.7494807,64,396.153,5.104272 +0.7287479,23,147.1992,4.295707 +0.8010544,7,249.5940,3.407520 +0.7245908,52,658.1033,4.890957 +0.5780999,8,736.3381,2.956657 +0.8479071,13,535.5617,4.138403 +0.910282,88,706.6015,5.801665 +0.8260243,44,5.778081,6.569068 +0.7756616,12,68.24743,3.89199 +0.6779172,29,865.7203,4.34203 +0.7121331,60,51.67999,5.094517 +0.7587412,53,351.5271,4.992108 +0.7138279,6,622.5837,2.976316 +0.936066,61,493.9761,5.71497 +0.8927102,6,980.146,3.625845 +0.6222097,66,180.9405,4.890236 +0.7076899,93,746.9903,5.269072 +0.5555804,37,640.2992,4.309252 +0.7877178,36,777.8668,4.764064 +0.5842511,62,164.657,4.776821 +0.7328623,93,816.8986,5.318279 +0.6259894,52,479.0156,4.701554 +0.7226905,10,468.7935,3.519339 +0.5265653,19,997.8564,3.690211 +0.7318997,64,207.9046,5.084091 +0.9192412,69,667.0859,5.68892 +0.6231767,50,43.20987,4.759639 +0.6972005,80,845.1849,5.142585 +0.7779439,85,932.2534,5.353608 +0.9107332,100,582.1592,5.891565 +0.5050257,84,446.7605,4.855801 +0.637655,47,47.76077,4.734205 +0.785115,35,964.5286,4.73395 +0.690956,54,62.90913,4.940018 +0.719769,35,634.1213,4.582082 +0.5616795,56,915.7953,4.641653 +0.7737041,3,910.5499,2.330052 +0.8643882,91,65.94819,5.842094 +0.561113,19,13.89679,3.905443 +0.9246243,97,84.66878,6.138777 +0.8416577,64,208.3890,5.37398 +0.8823102,83,392.9894,5.663599 +0.816154,2,264.6879,1.884422 +0.6025324,62,199.5932,4.80521 +0.6947627,64,531.0227,4.983875 +0.6520982,2,38.59697,1.343845 +0.878029,87,501.3924,5.669977 +0.528619,6,922.9151,2.534323 +0.8532033,32,661.1688,4.874277 +0.5825841,85,19.02259,5.179472 +0.6906217,45,412.6579,4.718226 +0.668097,19,51.25001,4.03855 +0.8786804,92,948.0557,5.694116 +0.8551716,39,424.7596,5.036045 +0.8539307,28,756.1924,4.774472 +0.6223484,35,342.108,4.390973 +0.6102817,42,571.9411,4.507539 +0.7181276,87,831.6475,5.242309 +0.6940214,57,492.6249,4.898956 +0.8179872,85,77.64156,5.595095 +0.6283061,33,563.8613,4.350425 +0.6075136,55,379.0673,4.713306 +0.9265058,36,445.4369,5.297881 +0.6868859,8,470.9334,3.208735 +0.7996129,99,964.0103,5.508082 +0.5830702,24,774.4583,4.000224 +0.5702618,68,64.00718,4.856072 +0.5789566,43,972.203,4.467412 +0.5874349,36,916.7149,4.342063 +0.5833758,65,258.9836,4.801495 +0.8635545,49,458.9639,5.227687 +0.5935735,79,119.1572,4.983546 +0.8131558,84,845.3671,5.434132 +0.7309313,34,65.37927,4.670561 +0.5603136,54,231.8187,4.623004 +0.5756098,18,173.3843,3.745856 +0.8461455,71,301.1804,5.442179 +0.5327761,26,841.531,3.976124 +0.6493861,11,935.9827,3.431666 +0.8630635,100,888.5135,5.695541 +0.851174,47,429.4618,5.156982 +0.5861503,12,716.7889,3.380622 +0.921095,23,15.19805,5.710247 +0.5782739,5,942.0811,2.433206 +0.6693196,90,622.6583,5.176223 +0.5364548,35,405.8181,4.233303 +0.809616,81,687.281,5.40342 +0.9149833,46,412.5279,5.407319 +0.7445979,62,793.9484,5.059691 +0.8165355,8,394.0338,3.586587 +0.7509344,69,859.8796,5.148696 +0.6117458,55,682.8256,4.715332 +0.5845061,74,151.8629,4.91113 +0.7070729,49,328.4277,4.820550 +0.7195724,98,110.8851,5.395834 +0.6141301,77,832.5952,4.96579 +0.9010887,75,502.8683,5.664959 +0.8695804,75,635.2031,5.534273 +0.6162468,36,706.3104,4.395769 +0.9283751,95,975.9121,5.935814 +0.8729349,86,442.2792,5.64784 +0.8494098,3,32.31192,2.708795 +0.9168347,42,714.2314,5.338657 +0.5352037,24,911.7365,3.911702 +0.9059443,87,965.2333,5.767539 +0.7047665,61,370.0491,4.975073 +0.8152647,77,323.5922,5.403395 +0.8688586,64,478.9834,5.431414 +0.751632,9,470.4753,3.496043 +0.8244728,7,309.2294,3.487371 +0.8102466,79,903.5838,5.383902 +0.7057721,86,629.8928,5.213153 +0.5553194,60,33.40271,4.773593 +0.881195,60,621.9124,5.426565 +0.8358636,77,901.8299,5.437479 +0.696193,55,164.4135,4.904172 +0.932106,71,607.8688,5.782766 +0.6710505,44,631.6179,4.656993 +0.6212366,63,562.5125,4.834803 +0.8203601,4,27.23376,2.964745 +0.8001745,56,274.3495,5.143934 +0.9013971,27,296.505,4.965852 +0.9069266,82,392.5688,5.759936 +0.9232269,57,276.2901,5.61906 +0.9367268,68,482.8852,5.791665 +0.8689248,13,356.4507,4.228787 +0.702432,42,188.5659,4.708193 +0.5472108,23,207.8573,3.905311 +0.9229038,25,823.9425,4.998866 +0.5444981,28,772.9021,4.059997 +0.6736287,48,818.3279,4.725838 +0.7463483,76,478.1093,5.215087 +0.85102,55,389.6101,5.270833 +0.5619721,54,332.6585,4.621322 +0.664734,55,579.3978,4.813541 +0.8474316,71,106.0218,5.524184 +0.8554368,14,396.4834,4.234974 +0.865614,95,693.5883,5.675409 +0.5348477,17,295.1280,3.609408 +0.6671405,93,634.2797,5.194961 +0.9346352,15,200.4010,4.728396 +0.7714221,20,840.6805,4.256987 +0.7079719,52,749.5469,4.854797 +0.6277378,26,988.1618,4.151760 +0.6268555,98,629.3872,5.160994 +0.9238709,95,758.1687,5.917006 +0.6475484,68,21.38955,5.16726 +0.6446082,93,997.1099,5.151013 +0.7764024,4,247.0520,2.71087 +0.7230928,84,946.2879,5.226642 +0.8371537,38,946.4194,4.9437 +0.8428408,68,709.7673,5.377647 +0.5555994,10,563.73,3.139113 +0.7219313,99,561.1249,5.344151 +0.937448,23,28.74689,5.480904 +0.7335617,91,970.2005,5.302966 +0.8613441,6,176.6877,3.493646 +0.6869626,85,244.9659,5.187716 +0.9275152,86,83.32556,6.077996 +0.7939986,46,732.5617,4.963035 +0.7970223,30,882.1072,4.648926 +0.7209646,54,924.5706,4.907675 +0.8306365,96,607.961,5.577427 +0.6464567,14,9.694352,3.942865 +0.6340444,37,736.7627,4.450466 +0.8069274,40,95.86887,4.977036 +0.8013634,42,503.7897,4.921649 +0.9055047,42,118.7202,5.378602 +0.6954729,47,821.6369,4.753285 +0.6674997,44,239.8386,4.66436 +0.5699985,53,317.533,4.621385 +0.5287525,36,637.5462,4.240597 +0.6176084,4,475.3884,2.25576 +0.6085563,96,649.2288,5.115429 +0.671319,81,817.5754,5.102995 +0.9359667,37,92.84325,5.510533 +0.9292207,27,886.3095,5.092884 +0.941389,89,885.4375,5.976429 +0.5803328,53,74.98485,4.677075 +0.8983655,32,703.0716,5.05373 +0.6437962,43,460.7536,4.589923 +0.5086535,74,187.668,4.776272 +0.7736891,71,449.2642,5.231069 +0.8452449,32,304.0644,4.864419 +0.6696278,45,583.9474,4.672059 +0.6992343,65,438.3437,5.006878 +0.660791,31,961.1734,4.36029 +0.6564748,41,22.05504,4.776298 +0.665124,24,850.8597,4.16084 +0.8835836,27,965.2559,4.858438 +0.8815548,25,387.4771,4.807794 +0.6965337,31,975.1651,4.433565 +0.7860235,6,178.6597,3.203474 +0.8831334,48,57.10986,5.485092 +0.7900111,31,162.321,4.694016 +0.80504,90,989.0279,5.457521 +0.7779963,47,888.8225,4.935917 +0.8709396,21,6.076414,6.109931 +0.8758326,43,504.5797,5.178094 +0.8322847,18,610.0355,4.354371 +0.9086776,17,153.3854,4.677248 +0.788782,68,615.4611,5.231419 +0.5539504,2,984.5186,1.078088 +0.7439927,12,872.5737,3.741407 +0.8164331,71,103.7183,5.424622 +0.6064425,6,33.65510,2.751554 +0.8815675,16,550.0871,4.448882 +0.7435157,46,251.4903,4.860642 +0.94865,6,343.7878,4.039293 +0.9017165,65,280.3346,5.597134 +0.870245,56,159.3285,5.399134 +0.5617548,18,212.3836,3.716077 +0.8854695,56,81.97713,5.542365 +0.5792403,52,556.462,4.617672 +0.5890797,51,387.0378,4.623079 +0.6885989,98,502.3955,5.274165 +0.851565,71,129.9867,5.516691 +0.7055726,26,324.1496,4.322812 +0.5700456,55,957.5553,4.641816 +0.6144216,45,450.7585,4.570643 +0.7825922,22,521.1032,4.369765 +0.5166394,83,138.0069,4.879737 +0.6137133,51,713.3682,4.661488 +0.5643472,39,355.1127,4.370699 +0.6369376,93,324.8522,5.15104 +0.6506586,36,605.8106,4.46205 +0.8290645,55,544.3193,5.19356 +0.7932623,73,960.7906,5.285625 +0.8382057,96,207.4720,5.64295 +0.732158,41,137.2255,4.770089 +0.9480985,16,313.3048,4.867939 +0.6386916,99,589.2802,5.189086 +0.9390022,23,957.4552,5.041156 +0.5697346,38,17.83553,4.510244 +0.7913318,66,293.3076,5.235361 +0.6868162,4,387.668,2.43642 +0.6463822,54,750.9945,4.763262 +0.9371176,47,313.4571,5.566868 +0.50428,99,824.273,4.970733 +0.5946511,64,346.1248,4.805316 +0.8709878,57,759.798,5.34904 +0.6831977,45,11.36341,5.134924 +0.6508286,62,148.9947,4.90477 +0.9287122,60,801.24,5.644665 +0.6910198,69,990.3954,5.024397 +0.8440781,9,525.8345,3.796168 +0.8004705,72,489.8934,5.305356 +0.6084492,69,224.9862,4.892618 +0.8184517,82,935.883,5.430576 +0.7762058,75,950.8389,5.263271 +0.5760073,8,894.4134,2.951756 +0.8086744,7,174.8679,3.440552 +0.9261343,84,946.4264,5.845667 +0.7364095,79,848.88,5.212448 +0.8509722,25,417.1328,4.687007 +0.6892558,24,104.9072,4.250703 +0.8036012,61,102.1672,5.277396 +0.6162426,79,656.3961,4.989624 +0.5791517,72,467.3013,4.862522 +0.5149917,94,378.281,4.954349 +0.9379776,25,464.946,5.109888 +0.9067495,32,38.34473,5.403331 +0.5240937,28,961.5862,4.023214 +0.5280742,24,311.7771,3.903208 +0.6576594,4,689.7833,2.356709 +0.6781805,10,757.1474,3.406736 +0.5971721,63,324.5377,4.798868 +0.5290827,34,770.204,4.193887 +0.9037198,90,293.7151,5.821269 +0.6534974,48,190.0638,4.709046 +0.6981573,26,853.1525,4.296611 +0.6468021,48,748.4224,4.675426 +0.9040386,68,838.5664,5.60011 +0.7857422,38,481.7715,4.806148 +0.607947,42,201.8933,4.516507 +0.5071259,76,937.1517,4.782286 +0.5427897,92,431.5726,4.981826 +0.9072125,95,154.3396,5.92806 +0.9484,99,33.92708,6.716453 +0.8050603,87,9.65729,6.442394 +0.8860068,5,388.8540,3.412397 +0.6358902,52,845.1992,4.714964 +0.9361354,17,750.0811,4.796561 +0.8008013,49,565.2006,5.030775 +0.926761,26,575.6264,5.057938 +0.8576906,60,272.9478,5.368179 +0.7202081,22,979.6327,4.208136 +0.5819503,76,205.3432,4.918833 +0.6698566,12,945.551,3.560221 +0.6418892,55,64.02962,4.841915 +0.5271493,33,949.0254,4.165456 +0.8930948,23,24.1638,5.197677 +0.8822868,39,737.3787,5.126144 +0.6887659,6,343.5825,2.912568 +0.8297944,98,341.6935,5.606095 +0.6721322,46,193.0996,4.713452 +0.5849796,45,355.7672,4.520102 +0.6888258,5,729.3948,2.705554 +0.5311742,29,272.9869,4.071185 +0.8957202,49,516.2053,5.351545 +0.7909933,13,650.5345,3.946661 +0.6261204,51,142.9204,4.710608 +0.9168821,37,77.57931,5.410771 +0.8331488,69,43.80345,5.607263 +0.64225,94,956.1799,5.154705 +0.7601495,91,920.2586,5.359983 +0.7892926,96,349.8586,5.483655 +0.6306155,33,967.1055,4.351705 +0.6726184,80,51.44195,5.215103 +0.7116622,19,546.5421,4.069148 +0.6864173,18,182.2196,3.980004 +0.863477,91,543.1546,5.645966 +0.5452934,24,641.5907,3.931072 +0.7300484,91,650.1359,5.300523 +0.6697613,89,881.9166,5.165746 +0.5722327,44,356.5360,4.479965 +0.6642942,46,79.42196,4.736867 +0.6101755,69,492.5268,4.883647 +0.8585281,14,237.7073,4.259236 +0.9097088,71,482.4178,5.669828 +0.6898688,62,411.6998,4.954969 +0.810742,62,578.5291,5.224823 +0.8362431,75,527.7266,5.430838 +0.9416213,63,511.2204,5.772444 +0.7244791,7,610.4706,3.168309 +0.7757211,83,876.2432,5.332888 +0.7827547,64,120.3467,5.239134 +0.6797277,86,489.6258,5.166825 +0.756696,81,778.559,5.27448 +0.8787565,70,506.207,5.527242 +0.8407648,43,624.1819,5.050881 +0.812129,63,378.47,5.249874 +0.7311311,100,545.6201,5.370173 +0.6494214,71,989.3894,4.967769 +0.5589163,3,407.2068,1.727566 +0.7051075,21,910.3279,4.135289 +0.9440894,27,128.4959,5.29461 +0.6493793,36,815.854,4.457538 +0.5269008,22,20.1956,3.909876 +0.7765532,69,131.1495,5.270598 +0.8623126,59,805.8516,5.341169 +0.7862556,15,445.9598,4.061422 +0.7984945,11,16.42409,4.112416 +0.7628009,94,335.4126,5.40785 +0.5707517,4,754.9215,2.141816 +0.8307415,59,259.4171,5.271136 +0.9261452,91,879.6235,5.898394 +0.5931118,19,412.5692,3.820128 +0.7341011,30,290.3247,4.5055 +0.6307421,94,480.651,5.141479 +0.6214507,52,761.9476,4.689565 +0.6122929,51,391.2011,4.66427 +0.6126767,22,965.1558,3.981753 +0.6781432,82,529.8376,5.129141 +0.7212714,68,628.3364,5.078783 +0.8463072,52,414.1375,5.213921 +0.5499381,48,128.7722,4.524313 +0.8552063,45,983.869,5.124362 +0.7168726,54,76.57087,4.98376 +0.5863685,28,436.8953,4.139119 +0.6002564,4,212.4021,2.216034 +0.6476712,27,567.834,4.225193 +0.5111378,12,230.9686,3.234319 +0.8874011,31,699.3229,4.981643 +0.6029039,21,853.7822,3.923142 +0.844009,100,494.6368,5.648871 +0.6724859,33,871.8237,4.434046 +0.6211092,3,206.0795,1.884215 +0.8536017,100,339.2334,5.692342 +0.9383143,76,126.6032,5.989349 +0.5257438,86,212.6910,4.913543 +0.6733605,100,893.5537,5.253112 +0.6432021,12,786.3207,3.501315 +0.6230217,88,173.8344,5.102506 +0.6406076,51,392.1265,4.716152 +0.8299653,74,144.4691,5.464652 +0.711774,49,720.2103,4.819034 +0.6283814,10,413.4422,3.295601 +0.5821459,59,999.1213,4.714968 +0.6715785,20,695.5452,4.021824 +0.8592576,52,916.6212,5.241093 +0.542849,42,279.0223,4.3942 +0.537032,81,618.1086,4.877919 +0.8894632,38,737.5884,5.137352 +0.6570416,51,953.9288,4.738709 +0.9168326,47,24.62193,5.997725 +0.8971111,17,803.4249,4.565065 +0.5770282,56,547.2414,4.670345 +0.9473995,62,535.2846,5.802564 +0.5455282,93,714.1213,4.990395 +0.5863393,45,768.3091,4.516744 +0.7665414,16,849.9519,4.056045 +0.734118,54,776.0034,4.937319 +0.7203634,64,274.5625,5.04965 +0.659862,45,748.1406,4.651066 +0.6805168,34,603.1331,4.476605 +0.8645582,64,484.6595,5.415833 +0.8906369,26,384.7536,4.877756 +0.9474115,20,416.8705,5.021933 +0.6411807,57,330.5903,4.80329 +0.5703219,58,514.8321,4.685923 +0.7626901,30,75.8481,4.641237 +0.8855596,42,839.1963,5.190222 +0.9174876,27,572.5325,5.030947 +0.5043899,20,700.1571,3.696164 +0.5387181,100,214.0170,5.043657 +0.889451,94,411.1439,5.771975 +0.6211653,61,929.5267,4.807188 +0.726502,69,816.1978,5.096984 +0.9034006,27,188.2023,4.99858 +0.8471982,47,921.634,5.129633 +0.6937758,9,797.0683,3.341297 +0.5347142,19,938.8299,3.705463 +0.7464367,95,284.5240,5.383845 +0.5356522,31,119.4054,4.146077 +0.7287865,54,105.8386,4.986942 +0.7582195,10,393.5145,3.616798 +0.7883883,16,759.7446,4.117701 +0.580503,34,116.2226,4.308078 +0.5592169,53,86.60802,4.630375 +0.8841168,35,720.886,5.055972 +0.787728,8,431.0659,3.489781 +0.7440935,96,462.1459,5.37265 +0.547159,28,549.1209,4.066083 +0.6133399,7,31.53534,2.94565 +0.502118,22,858.4678,3.77632 +0.9333538,38,609.3464,5.369694 +0.6024722,75,638.6493,4.92888 +0.9074494,32,541.4686,5.102969 +0.6300227,79,159.6278,5.040472 +0.7318348,24,317.7376,4.318522 +0.741385,49,607.519,4.884875 +0.7133042,90,534.2835,5.262046 +0.7731119,64,555.0199,5.152396 +0.7659718,64,902.1246,5.129016 +0.692532,54,15.18751,5.217929 +0.7237324,40,311.8354,4.70425 +0.7820585,92,123.1948,5.494088 +0.8127579,20,389.9402,4.384254 +0.7185323,50,966.4689,4.845642 +0.7159182,54,783.1741,4.898585 +0.5016469,14,892.8262,3.360851 +0.6591599,72,400.8591,5.005014 +0.838539,89,620.7018,5.549374 +0.7455755,65,625.0824,5.098517 +0.9332795,27,755.9687,5.121938 +0.6061578,88,852.1542,5.047813 +0.6962892,84,664.6649,5.177628 +0.5947195,17,875.5658,3.72079 +0.6775777,53,539.8698,4.811517 +0.779415,80,754.9234,5.318238 +0.6246729,36,474.7039,4.414399 +0.8229145,91,413.4531,5.530172 +0.6903401,99,874.5921,5.277501 +0.5398703,51,286.4902,4.541068 +0.74952,4,502.8889,2.618777 +0.8640506,33,6.8444,6.388552 +0.9202534,49,339.0399,5.487683 +0.6719591,58,852.3847,4.86309 +0.9207745,32,368.0822,5.186344 +0.8846664,81,528.0204,5.646296 +0.6523939,96,646.4013,5.190536 +0.8606456,24,470.2877,4.688268 +0.6330717,34,113.3899,4.413138 +0.7145774,68,95.60072,5.132608 +0.7099229,38,220.1979,4.642589 +0.7290925,15,20.12214,4.110961 +0.9385502,61,264.7995,5.763972 +0.5603532,7,885.8671,2.775121 +0.7057838,42,68.22778,4.772341 +0.658553,20,643.2781,3.994641 +0.8370777,33,279.929,4.863052 +0.5989733,21,486.2542,3.918143 +0.6681295,12,829.0133,3.556748 +0.6356377,43,817.5014,4.569956 +0.6267693,93,462.5766,5.12758 +0.8400407,30,840.948,4.778211 +0.778122,92,63.86752,5.560302 +0.8315789,86,180.0045,5.557248 +0.5899593,72,82.99947,4.923858 +0.6298938,6,324.3013,2.766343 +0.8650625,45,810.102,5.161229 +0.7166938,77,519.5638,5.160264 +0.6128868,83,494.4236,5.022079 +0.7190987,63,988.826,5.014988 +0.8141917,54,62.45263,5.281654 +0.6892226,77,604.2335,5.1039 +0.7579322,39,483.3476,4.756018 +0.774113,12,376.1970,3.831128 +0.888773,9,193.2689,4.013519 +0.9433137,19,225.0416,4.975592 +0.668966,35,323.5154,4.483325 +0.5799831,32,858.7687,4.233789 +0.6964942,57,265.0989,4.915871 +0.7890881,19,622.6752,4.265669 +0.7703855,61,666.6304,5.108969 +0.7360461,100,156.7199,5.423589 +0.8626526,80,916.5676,5.546618 +0.8052394,59,234.3321,5.201593 +0.9434135,16,488.0507,4.814165 +0.675481,11,447.5658,3.494619 +0.7456587,71,858.7813,5.157294 +0.6115988,44,621.5159,4.545473 +0.7125888,13,903.394,3.734631 +0.564883,12,911.3827,3.336676 +0.8422981,35,737.8664,4.902571 +0.6269619,22,962.1986,4.009839 +0.7464384,89,917.6661,5.31518 +0.8062435,86,203.6891,5.476226 +0.6016839,63,164.1402,4.82052 +0.7231435,90,183.1313,5.313472 +0.9296296,69,712.086,5.744837 +0.7964493,18,372.9885,4.248754 +0.9082465,11,729.5307,4.267029 +0.7954384,80,890.9846,5.354851 +0.69333,30,549.6491,4.404942 +0.888512,38,226.2884,5.171376 +0.5163259,79,965.7332,4.825084 +0.8625625,40,270.5909,5.095962 +0.7878012,75,456.2498,5.303224 +0.7169962,38,24.90004,4.866604 +0.7119138,31,136.3598,4.502702 +0.9016313,80,625.8683,5.703408 +0.6697849,64,819.8403,4.931256 +0.6393241,36,822.4557,4.438223 +0.6457774,22,286.3792,4.056812 +0.6075175,5,507.1766,2.502779 +0.5790579,35,891.444,4.304589 +0.6785852,97,632.1274,5.245173 +0.9260163,27,785.0145,5.07486 +0.624276,100,624.4551,5.170826 +0.514745,99,233.9589,4.996166 +0.7554237,90,27.37145,5.658256 +0.8304656,20,75.88332,4.520449 +0.9465676,54,175.3672,5.777202 +0.9349736,67,373.3616,5.78206 +0.862613,34,248.4125,4.979623 +0.9212936,13,780.8202,4.483226 +0.7610356,13,216.7360,3.875411 +0.901645,33,163.7603,5.150118 +0.938008,100,475.4582,6.04847 +0.7903692,73,374.8208,5.295927 +0.9234672,71,793.222,5.726025 +0.8868499,22,658.971,4.721847 +0.9136649,96,313.9001,5.906933 +0.6772373,5,825.3243,2.674723 +0.7484092,30,211.6643,4.54816 +0.5736467,50,354.4955,4.581787 +0.8963927,40,739.9752,5.204105 +0.6797554,77,357.669,5.094093 +0.6830636,48,373.3237,4.753272 +0.6249168,59,358.1955,4.797946 +0.6989866,36,742.6241,4.557865 +0.720914,97,799.1175,5.323244 +0.8050567,78,401.0264,5.377754 +0.8354936,89,886.472,5.533914 +0.8940905,3,516.5265,2.87191 +0.7170255,57,97.04115,5.005992 +0.6894167,8,999.7774,3.212098 +0.8153368,83,640.4252,5.436478 +0.7875185,40,748.8123,4.842901 +0.5928658,38,222.8933,4.407356 +0.9368355,59,283.7960,5.725235 +0.8439394,88,743.0444,5.554312 +0.8655847,61,746.2011,5.376758 +0.615964,7,492.0405,2.900309 +0.708786,23,250.7864,4.233693 +0.928492,77,249.3429,5.858765 +0.9213118,70,240.5459,5.756381 +0.9447196,4,134.7652,3.622836 +0.6752938,92,700.4954,5.201173 +0.5822097,34,944.6738,4.286641 +0.7442257,37,780.9363,4.677971 +0.8501248,92,391.9927,5.620045 +0.7890855,31,26.29981,4.924178 +0.5417501,38,367.9578,4.309845 +0.6465953,76,816.0229,5.012992 +0.7753691,45,187.8045,4.933162 +0.8752703,95,937.9589,5.702937 +0.8304852,46,534.5124,5.070549 +0.9297963,95,821.1949,5.947772 +0.8118207,51,614.6753,5.088175 +0.6761814,68,77.04726,5.06311 +0.5594347,47,273.4567,4.511935 +0.6285156,17,791.629,3.789238 +0.8079738,6,552.786,3.265653 +0.6450331,64,620.8037,4.888043 +0.6683616,5,26.13905,2.716723 +0.6130411,71,577.7337,4.907943 +0.6039205,88,393.0017,5.051451 +0.6873019,33,507.5798,4.46876 +0.6871983,44,93.05181,4.742836 +0.8249064,40,27.54897,5.271431 +0.5337277,97,414.0519,5.005735 +0.7879977,47,203.7387,4.995218 +0.7460476,54,352.9217,4.976224 +0.9483304,14,817.392,4.74218 +0.6113758,86,287.5114,5.052821 +0.7624152,86,140.1357,5.386984 +0.9068276,76,127.8796,5.79775 +0.6900965,97,905.93,5.262664 +0.8448191,85,43.09855,5.815616 +0.8802071,31,137.8266,5.016079 +0.8578306,19,642.5522,4.48844 +0.7929309,82,623.4676,5.370958 +0.8476168,18,453.467,4.412116 +0.6834483,43,918.7422,4.661125 +0.7405542,80,56.81287,5.371752 +0.9219944,50,332.3488,5.512329 +0.7261745,44,701.9999,4.769600 +0.7007646,53,383.2142,4.862903 +0.6057453,72,986.2047,4.901948 +0.9261545,59,353.8751,5.64591 +0.771516,19,609.2304,4.217364 +0.7029976,85,168.6136,5.234305 +0.8446972,27,723.5938,4.715313 +0.5885027,57,335.832,4.708225 +0.6491714,64,861.9075,4.892884 +0.6330873,24,654.814,4.097357 +0.7772637,100,678.8785,5.466614 +0.8096222,38,244.029,4.889534 +0.584761,62,94.44627,4.795691 +0.700675,82,658.6258,5.169326 +0.848954,53,601.8697,5.227078 +0.8253134,71,66.77659,5.512754 +0.5726026,39,366.2374,4.385096 +0.889443,40,431.9839,5.186106 +0.9409584,20,611.2568,4.959802 +0.7115514,90,793.238,5.25328 +0.7011985,35,200.5195,4.561698 +0.5771735,40,98.96083,4.438054 +0.8109071,76,518.7619,5.368861 +0.8176633,37,18.97150,5.311783 +0.7706448,80,46.71877,5.489751 +0.5891102,78,840.1204,4.933083 +0.7720898,79,189.6653,5.332601 +0.7299095,48,298.656,4.85679 +0.6956586,32,739.8781,4.458631 +0.6287844,35,862.2396,4.395717 +0.8391402,38,300.8604,4.973045 +0.510979,99,235.7683,4.990011 +0.508311,83,427.9368,4.852489 +0.6374083,53,722.2017,4.733101 +0.8431894,21,933.971,4.51148 +0.6286747,89,648.9947,5.096027 +0.9137417,88,684.3439,5.819049 +0.7000148,65,253.8147,5.020509 +0.9283806,36,485.4688,5.30663 +0.5502186,97,901.5118,5.026643 +0.6794158,92,491.8415,5.2134 +0.5004906,9,369.889,2.919374 +0.8813509,4,156.3115,3.159320 +0.5316867,79,888.0104,4.849485 +0.7776448,23,552.1755,4.391651 +0.6669258,42,541.5799,4.614754 diff --git a/shared/package-files/07/07d8fe7f15b10c81dfaff873c41fac712408d46c33d480c7c5b40e61d086a551/blob b/shared/package-files/07/07d8fe7f15b10c81dfaff873c41fac712408d46c33d480c7c5b40e61d086a551/blob new file mode 100644 index 0000000000000000000000000000000000000000..0e61fe94dc223775eee56c7d9d69250e5197ebce Binary files /dev/null and b/shared/package-files/07/07d8fe7f15b10c81dfaff873c41fac712408d46c33d480c7c5b40e61d086a551/blob differ diff --git a/shared/package-files/07/07da6dfef3b1aca7884b3f8c63afea64186734ab6b8b1b381ad500efdd9bec6d/blob b/shared/package-files/07/07da6dfef3b1aca7884b3f8c63afea64186734ab6b8b1b381ad500efdd9bec6d/blob new file mode 100644 index 0000000000000000000000000000000000000000..3984a063885907141b56bdd2c6e8cc730c592cbb --- /dev/null +++ b/shared/package-files/07/07da6dfef3b1aca7884b3f8c63afea64186734ab6b8b1b381ad500efdd9bec6d/blob @@ -0,0 +1,77 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +import torch + +from . import _Tensor, Tensor +from .reference import _dims, _enable_layers, llist, ltuple + + +class DelayedMulTensor(_Tensor): + def __init__(self, lhs, rhs): + self._lhs, self._rhs = lhs, rhs + self._data = None + self._levels_data = None + self._has_device = lhs._has_device or rhs._has_device + self._batchtensor_data = None + self._tensor_data = None + + @property + def _levels(self): + if self._levels_data is None: + levels = llist(self._lhs._levels) + for l in self._rhs._levels: + if l not in levels: + levels.append(l) + self._levels_data = ltuple(levels) + return self._levels_data + + @property + def _batchtensor(self): + if self._batchtensor_data is None: + with _enable_layers(self._levels): + print("bt multiply fallback") + self._batchtensor_data = self._lhs._batchtensor * self._rhs._batchtensor + return self._batchtensor_data + + @property + def _tensor(self): + if self._tensor_data is None: + self._tensor_data = Tensor.from_batched( + self._batchtensor, self._has_device + )._tensor + return self._tensor_data + + @property + def ndim(self): + return self._batchtensor.ndim + + @property + def dims(self): + return ltuple(super().dims) + + def sum(self, dim): + dims = _dims(dim, 0, False, False) + n = ord("a") + all_levels = self._levels + + def to_char(d): + return chr(n + all_levels.index(d)) + + plhs, levelslhs = self._lhs._tensor, self._lhs._levels + prhs, levelsrhs = self._rhs._tensor, self._rhs._levels + new_dims = tuple(d for d in self.dims if d not in dims) + new_levels = [l for l in self._levels if l not in dims] + fmt = "".join( + [ + *(to_char(d) for d in levelslhs), + ",", + *(to_char(d) for d in levelsrhs), + "->", + *(to_char(d) for d in new_levels), + ] + ) + result_data = torch.einsum(fmt, (plhs, prhs)) + return Tensor.from_positional(result_data, new_levels, True) diff --git a/shared/package-files/07/07dc51a4abcd74b2db970f82e4222375166dba5d7a0da0dbba711b1c6bf98452/blob b/shared/package-files/07/07dc51a4abcd74b2db970f82e4222375166dba5d7a0da0dbba711b1c6bf98452/blob new file mode 100644 index 0000000000000000000000000000000000000000..6178f74f803a509c00019b98d7fb746d32f327c0 --- /dev/null +++ b/shared/package-files/07/07dc51a4abcd74b2db970f82e4222375166dba5d7a0da0dbba711b1c6bf98452/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_max_pool2d_with_indices : public at::impl::MetaBase { + + + void meta(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/07/07dcfc13957a82485bdfce44aecffba72e7977595966d118b81f162cb827e381/blob b/shared/package-files/07/07dcfc13957a82485bdfce44aecffba72e7977595966d118b81f162cb827e381/blob new file mode 100644 index 0000000000000000000000000000000000000000..b977c36cf29a0bbb0a75553bcf51263faf0c5942 --- /dev/null +++ b/shared/package-files/07/07dcfc13957a82485bdfce44aecffba72e7977595966d118b81f162cb827e381/blob @@ -0,0 +1,38 @@ +.. _diabetes_dataset: + +Diabetes dataset +---------------- + +Ten baseline variables, age, sex, body mass index, average blood +pressure, and six blood serum measurements were obtained for each of n = +442 diabetes patients, as well as the response of interest, a +quantitative measure of disease progression one year after baseline. + +**Data Set Characteristics:** + +:Number of Instances: 442 + +:Number of Attributes: First 10 columns are numeric predictive values + +:Target: Column 11 is a quantitative measure of disease progression one year after baseline + +:Attribute Information: + - age age in years + - sex + - bmi body mass index + - bp average blood pressure + - s1 tc, total serum cholesterol + - s2 ldl, low-density lipoproteins + - s3 hdl, high-density lipoproteins + - s4 tch, total cholesterol / HDL + - s5 ltg, possibly log of serum triglycerides level + - s6 glu, blood sugar level + +Note: Each of these 10 feature variables have been mean centered and scaled by the standard deviation times the square root of `n_samples` (i.e. the sum of squares of each column totals 1). + +Source URL: +https://www4.stat.ncsu.edu/~boos/var.select/diabetes.html + +For more information see: +Bradley Efron, Trevor Hastie, Iain Johnstone and Robert Tibshirani (2004) "Least Angle Regression," Annals of Statistics (with discussion), 407-499. +(https://web.stanford.edu/~hastie/Papers/LARS/LeastAngle_2002.pdf) diff --git a/shared/package-files/07/07dd207e97c509ee04aac1a6f6156228cd8db6778d61fb31651d8f1bc8e8847a/blob b/shared/package-files/07/07dd207e97c509ee04aac1a6f6156228cd8db6778d61fb31651d8f1bc8e8847a/blob new file mode 100644 index 0000000000000000000000000000000000000000..0aaec38f06ba72a8bcd984d91b596e98eb3bbc54 --- /dev/null +++ b/shared/package-files/07/07dd207e97c509ee04aac1a6f6156228cd8db6778d61fb31651d8f1bc8e8847a/blob @@ -0,0 +1,288 @@ +# Code adapted from "upfirdn" python library with permission: +# +# Copyright (c) 2009, Motorola, Inc +# +# All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the name of Motorola nor the names of its contributors may be +# used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +import numpy as np +from itertools import product + +from scipy._lib._array_api import xp_assert_close +from pytest import raises as assert_raises +import pytest + +from scipy.signal import upfirdn, firwin +from scipy.signal._upfirdn import _output_len, _upfirdn_modes +from scipy.signal._upfirdn_apply import _pad_test + + +def upfirdn_naive(x, h, up=1, down=1): + """Naive upfirdn processing in Python. + + Note: arg order (x, h) differs to facilitate apply_along_axis use. + """ + h = np.asarray(h) + out = np.zeros(len(x) * up, x.dtype) + out[::up] = x + out = np.convolve(h, out)[::down][:_output_len(len(h), len(x), up, down)] + return out + + +class UpFIRDnCase: + """Test _UpFIRDn object""" + def __init__(self, up, down, h, x_dtype): + self.up = up + self.down = down + self.h = np.atleast_1d(h) + self.x_dtype = x_dtype + self.rng = np.random.RandomState(17) + + def __call__(self): + # tiny signal + self.scrub(np.ones(1, self.x_dtype)) + # ones + self.scrub(np.ones(10, self.x_dtype)) # ones + # randn + x = self.rng.randn(10).astype(self.x_dtype) + if self.x_dtype in (np.complex64, np.complex128): + x += 1j * self.rng.randn(10) + self.scrub(x) + # ramp + self.scrub(np.arange(10).astype(self.x_dtype)) + # 3D, random + size = (2, 3, 5) + x = self.rng.randn(*size).astype(self.x_dtype) + if self.x_dtype in (np.complex64, np.complex128): + x += 1j * self.rng.randn(*size) + for axis in range(len(size)): + self.scrub(x, axis=axis) + x = x[:, ::2, 1::3].T + for axis in range(len(size)): + self.scrub(x, axis=axis) + + def scrub(self, x, axis=-1): + yr = np.apply_along_axis(upfirdn_naive, axis, x, + self.h, self.up, self.down) + want_len = _output_len(len(self.h), x.shape[axis], self.up, self.down) + assert yr.shape[axis] == want_len + y = upfirdn(self.h, x, self.up, self.down, axis=axis) + assert y.shape[axis] == want_len + assert y.shape == yr.shape + dtypes = (self.h.dtype, x.dtype) + if all(d == np.complex64 for d in dtypes): + assert y.dtype == np.complex64 + elif np.complex64 in dtypes and np.float32 in dtypes: + assert y.dtype == np.complex64 + elif all(d == np.float32 for d in dtypes): + assert y.dtype == np.float32 + elif np.complex128 in dtypes or np.complex64 in dtypes: + assert y.dtype == np.complex128 + else: + assert y.dtype == np.float64 + xp_assert_close(yr.astype(y.dtype), y) + + +_UPFIRDN_TYPES = (int, np.float32, np.complex64, float, complex) + + +class TestUpfirdn: + + def test_valid_input(self): + assert_raises(ValueError, upfirdn, [1], [1], 1, 0) # up or down < 1 + assert_raises(ValueError, upfirdn, [], [1], 1, 1) # h.ndim != 1 + assert_raises(ValueError, upfirdn, [[1]], [1], 1, 1) + + @pytest.mark.parametrize('len_h', [1, 2, 3, 4, 5]) + @pytest.mark.parametrize('len_x', [1, 2, 3, 4, 5]) + def test_singleton(self, len_h, len_x): + # gh-9844: lengths producing expected outputs + h = np.zeros(len_h) + h[len_h // 2] = 1. # make h a delta + x = np.ones(len_x) + y = upfirdn(h, x, 1, 1) + want = np.pad(x, (len_h // 2, (len_h - 1) // 2), 'constant') + xp_assert_close(y, want) + + def test_shift_x(self): + # gh-9844: shifted x can change values? + y = upfirdn([1, 1], [1.], 1, 1) + xp_assert_close(y, np.asarray([1.0, 1.0])) # was [0, 1] in the issue + y = upfirdn([1, 1], [0., 1.], 1, 1) + xp_assert_close(y, np.asarray([0.0, 1.0, 1.0])) + + # A bunch of lengths/factors chosen because they exposed differences + # between the "old way" and new way of computing length, and then + # got `expected` from MATLAB + @pytest.mark.parametrize('len_h, len_x, up, down, expected', [ + (2, 2, 5, 2, [1, 0, 0, 0]), + (2, 3, 6, 3, [1, 0, 1, 0, 1]), + (2, 4, 4, 3, [1, 0, 0, 0, 1]), + (3, 2, 6, 2, [1, 0, 0, 1, 0]), + (4, 11, 3, 5, [1, 0, 0, 1, 0, 0, 1]), + ]) + def test_length_factors(self, len_h, len_x, up, down, expected): + # gh-9844: weird factors + h = np.zeros(len_h) + h[0] = 1. + x = np.ones(len_x) + y = upfirdn(h, x, up, down) + expected = np.asarray(expected, dtype=np.float64) + xp_assert_close(y, expected) + + @pytest.mark.parametrize('down, want_len', [ # lengths from MATLAB + (2, 5015), + (11, 912), + (79, 127), + ]) + def test_vs_convolve(self, down, want_len): + # Check that up=1.0 gives same answer as convolve + slicing + random_state = np.random.RandomState(17) + try_types = (int, np.float32, np.complex64, float, complex) + size = 10000 + + for dtype in try_types: + x = random_state.randn(size).astype(dtype) + if dtype in (np.complex64, np.complex128): + x += 1j * random_state.randn(size) + + h = firwin(31, 1. / down, window='hamming') + yl = upfirdn_naive(x, h, 1, down) + y = upfirdn(h, x, up=1, down=down) + assert y.shape == (want_len,) + assert yl.shape[0] == y.shape[0] + xp_assert_close(yl, y, atol=1e-7, rtol=1e-7) + + @pytest.mark.parametrize('x_dtype', _UPFIRDN_TYPES) + @pytest.mark.parametrize('h', (1., 1j)) + @pytest.mark.parametrize('up, down', [(1, 1), (2, 2), (3, 2), (2, 3)]) + def test_vs_naive_delta(self, x_dtype, h, up, down): + UpFIRDnCase(up, down, h, x_dtype)() + + @pytest.mark.parametrize('x_dtype', _UPFIRDN_TYPES) + @pytest.mark.parametrize('h_dtype', _UPFIRDN_TYPES) + @pytest.mark.parametrize('p_max, q_max', + list(product((10, 100), (10, 100)))) + def test_vs_naive(self, x_dtype, h_dtype, p_max, q_max): + tests = self._random_factors(p_max, q_max, h_dtype, x_dtype) + for test in tests: + test() + + def _random_factors(self, p_max, q_max, h_dtype, x_dtype): + n_rep = 3 + longest_h = 25 + random_state = np.random.RandomState(17) + tests = [] + + for _ in range(n_rep): + # Randomize the up/down factors somewhat + p_add = q_max if p_max > q_max else 1 + q_add = p_max if q_max > p_max else 1 + p = random_state.randint(p_max) + p_add + q = random_state.randint(q_max) + q_add + + # Generate random FIR coefficients + len_h = random_state.randint(longest_h) + 1 + h = np.atleast_1d(random_state.randint(len_h)) + h = h.astype(h_dtype) + if h_dtype is complex: + h += 1j * random_state.randint(len_h) + + tests.append(UpFIRDnCase(p, q, h, x_dtype)) + + return tests + + @pytest.mark.parametrize('mode', _upfirdn_modes) + def test_extensions(self, mode): + """Test vs. manually computed results for modes not in numpy's pad.""" + x = np.array([1, 2, 3, 1], dtype=float) + npre, npost = 6, 6 + y = _pad_test(x, npre=npre, npost=npost, mode=mode) + if mode == 'antisymmetric': + y_expected = np.asarray( + [3.0, 1, -1, -3, -2, -1, 1, 2, 3, 1, -1, -3, -2, -1, 1, 2]) + elif mode == 'antireflect': + y_expected = np.asarray( + [1.0, 2, 3, 1, -1, 0, 1, 2, 3, 1, -1, 0, 1, 2, 3, 1]) + elif mode == 'smooth': + y_expected = np.asarray( + [-5.0, -4, -3, -2, -1, 0, 1, 2, 3, 1, -1, -3, -5, -7, -9, -11]) + elif mode == "line": + lin_slope = (x[-1] - x[0]) / (len(x) - 1) + left = x[0] + np.arange(-npre, 0, 1) * lin_slope + right = x[-1] + np.arange(1, npost + 1) * lin_slope + y_expected = np.concatenate((left, x, right)) + else: + y_expected = np.pad(x, (npre, npost), mode=mode) + xp_assert_close(y, y_expected) + + @pytest.mark.parametrize( + 'size, h_len, mode, dtype', + product( + [8], + [4, 5, 26], # include cases with h_len > 2*size + _upfirdn_modes, + [np.float32, np.float64, np.complex64, np.complex128], + ) + ) + def test_modes(self, size, h_len, mode, dtype): + random_state = np.random.RandomState(5) + x = random_state.randn(size).astype(dtype) + if dtype in (np.complex64, np.complex128): + x += 1j * random_state.randn(size) + h = np.arange(1, 1 + h_len, dtype=x.real.dtype) + + y = upfirdn(h, x, up=1, down=1, mode=mode) + # expected result: pad the input, filter with zero padding, then crop + npad = h_len - 1 + if mode in ['antisymmetric', 'antireflect', 'smooth', 'line']: + # use _pad_test test function for modes not supported by np.pad. + xpad = _pad_test(x, npre=npad, npost=npad, mode=mode) + else: + xpad = np.pad(x, npad, mode=mode) + ypad = upfirdn(h, xpad, up=1, down=1, mode='constant') + y_expected = ypad[npad:-npad] + + atol = rtol = np.finfo(dtype).eps * 1e2 + xp_assert_close(y, y_expected, atol=atol, rtol=rtol) + + +def test_output_len_long_input(): + # Regression test for gh-17375. On Windows, a large enough input + # that should have been well within the capabilities of 64 bit integers + # would result in a 32 bit overflow because of a bug in Cython 0.29.32. + len_h = 1001 + in_len = 10**8 + up = 320 + down = 441 + out_len = _output_len(len_h, in_len, up, down) + # The expected value was computed "by hand" from the formula + # (((in_len - 1) * up + len_h) - 1) // down + 1 + assert out_len == 72562360 diff --git a/shared/package-files/07/07e3b51fe1bb8b2922dd87bf9c96154a4c181448e1a11730d088c2f5e1c279d6/blob b/shared/package-files/07/07e3b51fe1bb8b2922dd87bf9c96154a4c181448e1a11730d088c2f5e1c279d6/blob new file mode 100644 index 0000000000000000000000000000000000000000..8bb60ebef9e9d6a1c5e945d5965a5bcdb7777a6f --- /dev/null +++ b/shared/package-files/07/07e3b51fe1bb8b2922dd87bf9c96154a4c181448e1a11730d088c2f5e1c279d6/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor grid_sampler(const at::Tensor & input, const at::Tensor & grid, int64_t interpolation_mode, int64_t padding_mode, bool align_corners); +} // namespace native +} // namespace at diff --git a/shared/package-files/07/07e5b3fb5b6a92d9fada833a085e6dcfe200f130c91bedc5bdd792d27c5e1e11/blob b/shared/package-files/07/07e5b3fb5b6a92d9fada833a085e6dcfe200f130c91bedc5bdd792d27c5e1e11/blob new file mode 100644 index 0000000000000000000000000000000000000000..c1ee1036ba6f8097546cfbb9c5076b59183981d9 --- /dev/null +++ b/shared/package-files/07/07e5b3fb5b6a92d9fada833a085e6dcfe200f130c91bedc5bdd792d27c5e1e11/blob @@ -0,0 +1,1549 @@ +from __future__ import annotations # remove after python 3.11 + +from functools import wraps +from typing import List, Optional, Sequence, Tuple, TypeVar + +from .._C.libtriton.triton import ir +from ..common.build import is_hip +from . import core as tl + +T = TypeVar('T') + + +class IncompatibleTypeErrorImpl(Exception): + + def __init__(self, type_a, type_b): + self.type_a = type_a + self.type_b = type_b + self.message = "invalid operands of type " + self.type_a.__repr__() + " and " + self.type_b.__repr__() + super(IncompatibleTypeErrorImpl, self).__init__(self.message) + + +# ===----------------------------------------------------------------------===## +# Programming Model +# ===----------------------------------------------------------------------===## + + +def program_id(axis: int, builder: ir.builder) -> tl.tensor: + if axis not in (0, 1, 2): + raise ValueError(f"program_id axis must be 0, 1, or 2 but got {axis}") + return tl.tensor(builder.create_get_program_id(axis), tl.int32) + + +def num_programs(axis: int, builder: ir.builder) -> tl.tensor: + if axis not in (0, 1, 2): + raise ValueError(f"num_programs axis must be 0, 1, or 2 but got {axis}") + return tl.tensor(builder.create_get_num_programs(axis), tl.int32) + + +# ===----------------------------------------------------------------------===// +# Implicit Casting Utilities +# ===----------------------------------------------------------------------===// + + +def integer_promote_impl(a_ty: tl.dtype, b_ty: tl.dtype) -> tl.dtype: + a_rank = a_ty.int_bitwidth + b_rank = b_ty.int_bitwidth + a_sn = a_ty.int_signedness + b_sn = b_ty.int_signedness + # Rules for signedness taken from "Usual arithmetic conversions" on + # https://en.cppreference.com/w/c/language/conversion. + if a_sn == b_sn: + return a_ty if a_rank > b_rank else b_ty + elif a_sn == tl.dtype.SIGNEDNESS.UNSIGNED: + return a_ty if a_rank >= b_rank else b_ty + elif b_sn == tl.dtype.SIGNEDNESS.UNSIGNED: + return b_ty if b_rank >= a_rank else a_ty + assert False + + +def computation_type_impl(a_ty: tl.dtype, b_ty: tl.dtype, div_or_mod: bool) -> tl.dtype: + # 1) if one operand is double, the other is implicitly + # converted to double + if a_ty.is_fp64() or b_ty.is_fp64(): + return tl.float64 + # 2) if one operand is float, the other is implicitly + # converted to float + if a_ty.is_fp32() or b_ty.is_fp32(): + return tl.float32 + # 3 ) if one operand is half, the other is implicitly converted to half + # unless we're doing / or %, which do not exist natively in PTX for fp16. + # Supported PTX op: add, sub, mul, fma, neg, abs, min, max, tanh, ex2, setp + if a_ty.is_fp16() or b_ty.is_fp16(): + if div_or_mod: + return tl.float32 + else: + return tl.float16 + # 4) return bf16 only if both operands are of bf16 + if a_ty.is_bf16() or b_ty.is_bf16(): + if div_or_mod: + return tl.float32 + if a_ty.is_bf16() and b_ty.is_bf16(): + return tl.bfloat16 + return tl.float32 + if not a_ty.is_int() or not b_ty.is_int(): + assert False + # 5 ) both operands are integer and undergo + # integer promotion + if div_or_mod and a_ty.int_signedness != b_ty.int_signedness: + raise ValueError("Cannot use /, #, or % with " + a_ty.__repr__() + " and " + b_ty.__repr__() + + " because they have different signedness;" + "this is unlikely to result in a useful answer. Cast them to the same signedness.") + return integer_promote_impl(a_ty, b_ty) + + +# ===----------------------------------------------------------------------===// +# Binary Operators +# ===----------------------------------------------------------------------===// + + +def check_ptr_type_impl(type_a: tl.dtype, type_b: tl.dtype, allow_ptr_a: bool) -> None: + if type_a.is_ptr(): + if not allow_ptr_a: + raise IncompatibleTypeErrorImpl(type_a, type_b) + # T* + U* with T != U + if type_b.is_ptr() and (type_a != type_b): + raise IncompatibleTypeErrorImpl(type_a, type_b) + # T* + float + if type_b.is_floating(): + raise IncompatibleTypeErrorImpl(type_a, type_b) + + +def binary_op_type_checking_impl(lhs: tl.tensor, rhs: tl.tensor, builder: ir.builder, allow_lhs_ptr=False, + allow_rhs_ptr=False, arithmetic_check=True, + div_or_mod=False) -> Tuple[tl.tensor, tl.tensor]: + # implicit broadcasting + lhs, rhs = broadcast_impl_value(lhs, rhs, builder) + # implicit typecasting + lhs_sca_ty = lhs.type.scalar + rhs_sca_ty = rhs.type.scalar + check_ptr_type_impl(lhs_sca_ty, rhs_sca_ty, allow_lhs_ptr) + check_ptr_type_impl(rhs_sca_ty, lhs_sca_ty, allow_rhs_ptr) + if arithmetic_check and not lhs_sca_ty.is_ptr() and not rhs_sca_ty.is_ptr(): + ret_sca_ty = computation_type_impl(lhs_sca_ty, rhs_sca_ty, div_or_mod) + lhs = cast(lhs, ret_sca_ty, builder) + rhs = cast(rhs, ret_sca_ty, builder) + return lhs, rhs + + +def add(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder, True, True) + input_scalar_ty = input.type.scalar + other_scalar_ty = other.type.scalar + if input_scalar_ty.is_ptr() and other_scalar_ty.is_ptr(): + raise ValueError("cannot add pointers together") + + # offset + ptr + # ptr + offset + if other_scalar_ty.is_ptr() and not input_scalar_ty.is_ptr(): + input, other = other, input + input_scalar_ty = input.type.scalar + other_scalar_ty = other.type.scalar + if input_scalar_ty.is_ptr(): + return tl.tensor(builder.create_addptr(input.handle, other.handle), input.type) + # float + float + elif input_scalar_ty.is_floating(): + return tl.tensor(builder.create_fadd(input.handle, other.handle), input.type) + # int + int + elif input_scalar_ty.is_int(): + return tl.tensor(builder.create_add(input.handle, other.handle), input.type) + assert False + + +def sub(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder, True, False) + scalar_ty = input.type.scalar + # ptr - offset + if scalar_ty.is_ptr(): + return tl.tensor(builder.create_addptr(input.handle, minus(other, builder).handle), input.type) + # float - float + if scalar_ty.is_floating(): + return tl.tensor(builder.create_fsub(input.handle, other.handle), input.type) + # int - int + elif scalar_ty.is_int(): + return tl.tensor(builder.create_sub(input.handle, other.handle), input.type) + assert False + + +def mul(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder) + scalar_ty = input.type.scalar + # float * float + if scalar_ty.is_floating(): + return tl.tensor(builder.create_fmul(input.handle, other.handle), input.type) + # * int + elif scalar_ty.is_int(): + return tl.tensor(builder.create_mul(input.handle, other.handle), input.type) + assert False + + +def truediv(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder, False, False, True, True) + input_scalar_ty = input.type.scalar + other_scalar_ty = other.type.scalar + # float / int + if input_scalar_ty.is_floating() and other_scalar_ty.is_int(): + other = cast(other, input_scalar_ty, builder) + # int / float + elif input_scalar_ty.is_int() and other_scalar_ty.is_floating(): + input = cast(input, other_scalar_ty, builder) + # int / int (cast to tl.float32) + elif input_scalar_ty.is_int() and other_scalar_ty.is_int(): + input = cast(input, tl.float32, builder) + other = cast(other, tl.float32, builder) + # float / float (cast to the highest exponent type) + elif input_scalar_ty.is_floating() and other_scalar_ty.is_floating(): + if input_scalar_ty.fp_mantissa_width > other_scalar_ty.fp_mantissa_width: + other = cast(other, input_scalar_ty, builder) + else: + input = cast(input, other_scalar_ty, builder) + # unreachable + else: + assert False + return tl.tensor(builder.create_fdiv(input.handle, other.handle), input.type) + + +def floordiv(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder, False, False, True, True) + input_scalar_ty = input.type.scalar + other_scalar_ty = other.type.scalar + if input_scalar_ty.is_int() and other_scalar_ty.is_int(): + ret_ty = integer_promote_impl(input_scalar_ty, other_scalar_ty) + input = cast(input, ret_ty, builder) + other = cast(other, ret_ty, builder) + if ret_ty.is_int_signed(): + return tl.tensor(builder.create_sdiv(input.handle, other.handle), input.type) + else: + return tl.tensor(builder.create_udiv(input.handle, other.handle), input.type) + assert False + + +def fdiv(input: tl.tensor, other: tl.tensor, ieee_rounding: bool, builder: ir.builder) -> tl.tensor: + input_scalar_ty = input.type.scalar + other_scalar_ty = other.type.scalar + if not input_scalar_ty.is_floating() or not other_scalar_ty.is_floating(): + raise ValueError("both operands of fdiv must have floating scalar type") + input, other = binary_op_type_checking_impl(input, other, builder, False, False, False, True) + ret = builder.create_fdiv(input.handle, other.handle) + return tl.tensor(ret, input.type) + + +def mod(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder, False, False, True, True) + scalar_ty = input.type.scalar + other_scalar_ty = other.type.scalar + # float % float + if scalar_ty.is_floating(): + # input - input.div(other, rounding_mode="floor") * other + ret = sub(input, mul(floor(fdiv(input, other, False, builder), builder), other, builder), builder) + return ret + # % int + elif scalar_ty.is_int(): + if scalar_ty.int_signedness != other_scalar_ty.int_signedness: + raise ValueError("Cannot mod " + scalar_ty.__repr__() + " by " + other_scalar_ty.__repr__() + " " + "because they have different signedness;" + "this is unlikely to result in a useful answer. Cast them to the same signedness.") + if scalar_ty.is_int_signed(): + return tl.tensor(builder.create_srem(input.handle, other.handle), input.type) + else: + return tl.tensor(builder.create_urem(input.handle, other.handle), input.type) + assert False + + +############## +# bitwise ops +############## + + +def bitwise_op_type_checking_impl(input: tl.tensor, other: tl.tensor, + builder: ir.builder) -> Tuple[tl.tensor, tl.tensor]: + input, other = binary_op_type_checking_impl(input, other, builder, False, False, False) + input_sca_ty = input.type.scalar + other_sca_ty = other.type.scalar + if not input_sca_ty.is_int() or not other_sca_ty.is_int(): + raise IncompatibleTypeErrorImpl(input_sca_ty, other_sca_ty) + ret_sca_ty = integer_promote_impl(input_sca_ty, other_sca_ty) + if ret_sca_ty != input_sca_ty: + input = cast(input, ret_sca_ty, builder) + if ret_sca_ty != other_sca_ty: + other = cast(other, ret_sca_ty, builder) + return input, other + + +def and_(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = bitwise_op_type_checking_impl(input, other, builder) + return tl.tensor(builder.create_and(input.handle, other.handle), input.type) + + +def or_(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = bitwise_op_type_checking_impl(input, other, builder) + return tl.tensor(builder.create_or(input.handle, other.handle), input.type) + + +def xor_(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = bitwise_op_type_checking_impl(input, other, builder) + return tl.tensor(builder.create_xor(input.handle, other.handle), input.type) + + +def logical_and(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + if not input.type.is_int1(): + input = bitcast(input, tl.dtype("int1"), builder) + if not other.type.is_int1(): + other = bitcast(other, tl.dtype("int1"), builder) + return and_(input, other, builder) + + +def logical_or(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + if not input.type.is_int1(): + input = bitcast(input, tl.dtype("int1"), builder) + if not other.type.is_int1(): + other = bitcast(other, tl.dtype("int1"), builder) + return or_(input, other, builder) + + +def not_(input: tl.tensor, builder: ir.builder): + if not input.type.is_int1(): + input = bitcast(input, tl.dtype("int1"), builder) + return invert(input, builder) + + +def lshr(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = bitwise_op_type_checking_impl(input, other, builder) + return tl.tensor(builder.create_lshr(input.handle, other.handle), input.type) + + +def ashr(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = bitwise_op_type_checking_impl(input, other, builder) + return tl.tensor(builder.create_ashr(input.handle, other.handle), input.type) + + +def shl(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = bitwise_op_type_checking_impl(input, other, builder) + return tl.tensor(builder.create_shl(input.handle, other.handle), input.type) + + +# ===----------------------------------------------------------------------===// +# Unary Operators +# ===----------------------------------------------------------------------===// + + +def plus(input: tl.tensor) -> tl.tensor: + return input + + +def minus(input: tl.tensor, builder: ir.builder) -> tl.tensor: + input_sca_ty = input.type.scalar + if input_sca_ty.is_ptr(): + raise ValueError("wrong type argument to unary minus (" + input_sca_ty.__repr__() + ")") + _0 = tl.tensor(builder.get_null_value(input_sca_ty.to_ir(builder)), input_sca_ty) + return sub(_0, input, builder) + + +def invert(input: tl.tensor, builder: tl.tensor) -> tl.tensor: + input_sca_ty = input.type.scalar + if input_sca_ty.is_ptr() or input_sca_ty.is_floating(): + raise ValueError("wrong type argument to unary invert (" + input_sca_ty.__repr__() + ")") + _1 = tl.tensor(builder.get_all_ones_value(input_sca_ty.to_ir(builder)), input_sca_ty) + return xor_(input, _1, builder) + + +# ===----------------------------------------------------------------------===// +# Comparison Operators +# ===----------------------------------------------------------------------===// +def _bool_like(v: tl.tensor) -> tl.block_type: + if not v.type.is_block(): + return tl.int1 + shape = v.type.shape + return tl.block_type(tl.int1, shape) + + +def greater_than(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder) + scalar_ty = input.type.scalar + # float > float + if scalar_ty.is_floating(): + return tl.tensor(builder.create_fcmpOGT(input.handle, other.handle), _bool_like(input)) + # > int + elif scalar_ty.is_int(): + if scalar_ty.is_int_signed(): + return tl.tensor(builder.create_icmpSGT(input.handle, other.handle), _bool_like(input)) + else: + return tl.tensor(builder.create_icmpUGT(input.handle, other.handle), _bool_like(input)) + assert False + + +def greater_equal(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder) + scalar_ty = input.type.scalar + # float >= float + if scalar_ty.is_floating(): + return tl.tensor(builder.create_fcmpOGE(input.handle, other.handle), _bool_like(input)) + # >= int + elif scalar_ty.is_int(): + if scalar_ty.is_int_signed(): + return tl.tensor(builder.create_icmpSGE(input.handle, other.handle), _bool_like(input)) + else: + return tl.tensor(builder.create_icmpUGE(input.handle, other.handle), _bool_like(input)) + assert False + + +def less_than(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder) + scalar_ty = input.type.scalar + # float < float + if scalar_ty.is_floating(): + return tl.tensor(builder.create_fcmpOLT(input.handle, other.handle), _bool_like(input)) + # < int + elif scalar_ty.is_int(): + if scalar_ty.is_int_signed(): + return tl.tensor(builder.create_icmpSLT(input.handle, other.handle), _bool_like(input)) + else: + return tl.tensor(builder.create_icmpULT(input.handle, other.handle), _bool_like(input)) + assert False + + +def less_equal(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder) + scalar_ty = input.type.scalar + # float < float + if scalar_ty.is_floating(): + return tl.tensor(builder.create_fcmpOLE(input.handle, other.handle), _bool_like(input)) + # < int + elif scalar_ty.is_int(): + if scalar_ty.is_int_signed(): + return tl.tensor(builder.create_icmpSLE(input.handle, other.handle), _bool_like(input)) + else: + return tl.tensor(builder.create_icmpULE(input.handle, other.handle), _bool_like(input)) + assert False + + +def equal(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder) + scalar_ty = input.type.scalar + # float == float + if scalar_ty.is_floating(): + return tl.tensor(builder.create_fcmpOEQ(input.handle, other.handle), _bool_like(input)) + # == int + elif scalar_ty.is_int(): + return tl.tensor(builder.create_icmpEQ(input.handle, other.handle), _bool_like(input)) + assert False + + +def not_equal(input: tl.tensor, other: tl.tensor, builder: ir.builder) -> tl.tensor: + input, other = binary_op_type_checking_impl(input, other, builder) + scalar_ty = input.type.scalar + # float == float + if scalar_ty.is_floating(): + return tl.tensor(builder.create_fcmpUNE(input.handle, other.handle), _bool_like(input)) + # == int + elif scalar_ty.is_int(): + return tl.tensor(builder.create_icmpNE(input.handle, other.handle), _bool_like(input)) + assert False + + +# ===----------------------------------------------------------------------===// +# Block Creation +# ===----------------------------------------------------------------------===// + + +def arange(start: int, end: int, builder: ir.builder) -> tl.tensor: + if not isinstance(start, int) or not isinstance(end, int): + raise ValueError("arange's arguments must be of type tl.constexpr") + is_start_int64 = bool(start >> 32) + is_end_int64 = bool(end >> 32) + if is_start_int64 or is_end_int64: + raise ValueError("arange must fit in int32") + if end <= start: + raise ValueError("arange's end argument must be greater than the start argument") + + shape = [end - start] + ret_ty = tl.block_type(tl.int32, shape) + return tl.tensor(builder.create_make_range(start, end), ret_ty) + + +def full(shape: List[int], value, dtype: tl.dtype, builder: ir.builder) -> tl.tensor: + if isinstance(value, tl.tensor): + assert value.numel.value == 1, "only accepts size-1 tensor" + value = cast(value, dtype, builder) + else: + # scalar + if dtype is None: + raise ValueError("dtype must be specified when value is not a tensor") + if value == 0: + value = builder.get_null_value(dtype.to_ir(builder)) + else: + get_value_fn = getattr(builder, f"get_{dtype.name}") + value = get_value_fn(value) + value = tl.tensor(value, dtype) + + return splat(value, shape, builder) + + +# ===----------------------------------------------------------------------===// +# Shape Manipulation +# ===----------------------------------------------------------------------===// + + +def splat(value: tl.tensor, shape: List[int], builder: ir.builder) -> tl.tensor: + assert not value.type.is_block(), "Cannot splat a block tensor" + if len(shape) == 0: + return value + ret_ty = tl.block_type(value.dtype, shape) + return tl.tensor(builder.create_splat(value.handle, shape), ret_ty) + + +def view(input: tl.tensor, dst_shape: List[int], builder: ir.builder) -> tl.tensor: + numel = 1 + for s in dst_shape: + numel *= s + if input.type.numel != numel: + raise ValueError("cannot view block of different shape") + ret_ty = tl.block_type(input.type.scalar, dst_shape) + return tl.tensor(builder.create_reshape(input.handle, dst_shape, True), ret_ty) + + +def reshape(input: tl.tensor, dst_shape: List[int], builder: ir.builder) -> tl.tensor: + ret_ty = tl.block_type(input.type.scalar, dst_shape) + return tl.tensor(builder.create_reshape(input.handle, dst_shape, False), ret_ty) + + +def expand_dims(input: tl.tensor, axis: int, builder: ir.builder) -> tl.tensor: + dst_shape = [tl._constexpr_to_value(x) for x in input.shape] + dst_shape.insert(axis, 1) + + if not input.type.is_block(): + return splat(input, shape=dst_shape, builder=builder) + + ret_ty = tl.block_type(input.type.scalar, dst_shape) + return tl.tensor(builder.create_expand_dims(input.handle, axis), ret_ty) + + +def cat(lhs: tl.tensor, rhs: tl.tensor, can_reorder: bool, builder: ir.builder) -> tl.tensor: + assert can_reorder, "current implementation of `cat` always may reorder elements" + assert len(lhs.shape) == 1 + ret_type = tl.block_type(lhs.type.scalar, [lhs.shape[0] + rhs.shape[0]]) + return tl.tensor(builder.create_cat(lhs.handle, rhs.handle), ret_type) + + +def trans(input: tl.tensor, builder: ir.builder) -> tl.tensor: + if len(input.shape) != 2: + raise ValueError("Only 2D tensors can be transposed") + ret_type = tl.block_type(input.type.scalar, [input.shape[1], input.shape[0]]) + return tl.tensor(builder.create_trans(input.handle), ret_type) + + +def broadcast_impl_shape(input: tl.tensor, shape: List[int], builder: ir.builder) -> tl.tensor: + if not input.type.is_block(): + ret_ty = tl.block_type(input.type, shape) + return tl.tensor(builder.create_splat(input.handle, shape), ret_ty) + src_shape = input.type.get_block_shapes() + if len(src_shape) != len(shape): + raise ValueError(f"Cannot broadcast, rank mismatch: {src_shape}, {shape}") + if shape == src_shape: + return input + for i, item in enumerate(src_shape): + if shape[i] != item and item != 1: + raise ValueError(f"Cannot broadcast, the expanded size of the tensor ({shape[i]})" + f" must match the existing size ({item}) at non-singleton dimension" + f" {i}: {src_shape}, {shape}") + ret_ty = tl.block_type(input.type.scalar, shape) + return tl.tensor(builder.create_broadcast(input.handle, shape), ret_ty) + + +def broadcast_impl_value(lhs: tl.tensor, rhs: tl.tensor, builder: ir.builder) -> tl.tensor: + lhs_ty = lhs.type + rhs_ty = rhs.type + + # make_shape_compatible(block, scalar) + if lhs_ty.is_block() and not rhs_ty.is_block(): + rhs_ty = tl.block_type(rhs_ty.scalar, lhs_ty.shape) + rhs = tl.tensor(builder.create_splat(rhs.handle, lhs_ty.get_block_shapes()), rhs_ty) + # make_shape_compatible(scalar, block) + elif not lhs_ty.is_block() and rhs_ty.is_block(): + lhs_ty = tl.block_type(lhs_ty.scalar, rhs_ty.shape) + lhs = tl.tensor(builder.create_splat(lhs.handle, rhs_ty.get_block_shapes()), lhs_ty) + # make_shape_compatible(block, block) + elif lhs_ty.is_block() and rhs_ty.is_block(): + lhs_shape = lhs_ty.get_block_shapes() + rhs_shape = rhs_ty.get_block_shapes() + + if len(lhs_shape) < len(rhs_shape): + # Add new axes to lhs + for dim in range(len(lhs_shape), len(rhs_shape)): + lhs = tl.tensor(builder.create_expand_dims(lhs.handle, 0), + tl.block_type(lhs_ty.scalar, [1] + lhs_shape)) + lhs_ty = lhs.type + lhs_shape = lhs_ty.get_block_shapes() + elif len(rhs_shape) < len(lhs_shape): + # Add new axes to rhs + for dim in range(len(rhs_shape), len(lhs_shape)): + rhs = tl.tensor(builder.create_expand_dims(rhs.handle, 0), + tl.block_type(rhs_ty.scalar, [1] + rhs_shape)) + rhs_ty = rhs.type + rhs_shape = rhs_ty.get_block_shapes() + assert len(rhs_shape) == len(lhs_shape) + + ret_shape = [] + for i, left in enumerate(lhs_shape): + right = rhs_shape[i] + if left == 1: + ret_shape.append(right) + elif right == 1: + ret_shape.append(left) + elif left == right: + ret_shape.append(left) + else: + raise ValueError("Cannot make_shape_compatible: incompatible dimensions " + "at index " + str(i) + ": " + str(left) + " and " + str(right)) + if lhs_shape != ret_shape: + ret_ty = tl.block_type(lhs_ty.scalar, ret_shape) + lhs = tl.tensor(builder.create_broadcast(lhs.handle, ret_shape), ret_ty) + if rhs_shape != ret_shape: + ret_ty = tl.block_type(rhs_ty.scalar, ret_shape) + rhs = tl.tensor(builder.create_broadcast(rhs.handle, ret_shape), ret_ty) + # (scalar, scalar) => returns original blocks + return lhs, rhs + + +####### +# cast +####### + + +def bitcast(input: tl.tensor, dst_ty: tl.dtype, builder: ir.builder) -> tl.tensor: + src_ty = input.type + if src_ty.is_block(): + dst_ty = tl.block_type(dst_ty.scalar, input.type.get_block_shapes()) + if src_ty == dst_ty: + return input + src_sca_ty = src_ty.scalar + dst_sca_ty = dst_ty.scalar + if src_sca_ty.is_ptr() or dst_sca_ty.is_ptr(): + return cast(input, dst_ty, builder) + # Bitcast + src_bits = src_sca_ty.primitive_bitwidth + dst_bits = dst_sca_ty.primitive_bitwidth + if src_bits != dst_bits: + raise ValueError("Cannot bitcast data-type of size " + str(src_bits) + " to " + "data-type of size " + str(dst_bits)) + return tl.tensor(builder.create_bitcast(input.handle, dst_ty.to_ir(builder)), dst_ty) + + +def cast(input: tl.tensor, dst_ty: tl.dtype, builder: ir.builder) -> tl.tensor: + src_ty = input.type + if isinstance(dst_ty, tl.constexpr): + dst_ty = dst_ty.value + if src_ty.is_block(): + dst_ty = tl.block_type(dst_ty.scalar, input.type.get_block_shapes()) + if src_ty == dst_ty: + return input + + src_sca_ty = src_ty.scalar + dst_sca_ty = dst_ty.scalar + + if (src_sca_ty.is_fp8e4nv() or dst_sca_ty.is_fp8e4nv()): + assert builder.options.allow_fp8e4nv, "fp8e4nv data type is not supported on CUDA arch < 89" + + # Casting with customized floating types involved: fp8 <=> bf16, fp16, fp32, fp64 + if (src_sca_ty.is_fp8() and dst_sca_ty.is_floating()) or \ + (src_sca_ty.is_floating() and dst_sca_ty.is_fp8()): + return tl.tensor(builder.create_fp_to_fp(input.handle, dst_ty.to_ir(builder)), dst_ty) + + # bf16 <=> (not fp32) + if (src_sca_ty.is_fp16() and not dst_sca_ty.is_fp32()) or \ + (src_sca_ty.is_bf16() and not dst_sca_ty.is_fp32()): + return cast(cast(input, tl.float32, builder), dst_sca_ty, builder) + + # Standard floating types' casting: truncation + # fp64 => fp32, fp16, bf16 + # fp32 => fp16, bf16 + truncate_fp = src_sca_ty.is_floating() and \ + dst_sca_ty.is_floating() and \ + src_sca_ty.primitive_bitwidth > dst_sca_ty.primitive_bitwidth + if truncate_fp: + return tl.tensor(builder.create_fp_trunc(input.handle, dst_ty.to_ir(builder)), dst_ty) + + # Standard floating types' casting: extension + # fp32 => fp64 + # fp16 => fp32, fp64 + # bf16 => fp32, fp64 + ext_fp = src_sca_ty.is_floating() and \ + dst_sca_ty.is_floating() and \ + src_sca_ty.primitive_bitwidth < dst_sca_ty.primitive_bitwidth + if ext_fp: + return tl.tensor(builder.create_fp_ext(input.handle, dst_ty.to_ir(builder)), dst_ty) + + # Casting between integer types + if src_sca_ty.is_int() and dst_sca_ty.is_int() and \ + (src_sca_ty.int_bitwidth != dst_sca_ty.int_bitwidth or src_sca_ty.int_signedness != dst_sca_ty.int_signedness): + sign_extend = src_sca_ty.is_int_signed() and not src_sca_ty.is_bool() + if dst_sca_ty.is_bool(): + ty = input.dtype.to_ir(builder) + _0 = tl.tensor(builder.get_null_value(ty), input.dtype) + return not_equal(input, _0, builder) + else: + return tl.tensor(builder.create_int_cast(input.handle, dst_ty.to_ir(builder), sign_extend), dst_ty) + + # Casting standard floating types to integer types + if src_sca_ty.is_standard_floating() and dst_sca_ty.is_int(): + if dst_sca_ty.is_bool(): + ty = input.dtype.to_ir(builder) + _0 = tl.tensor(builder.get_null_value(ty), input.dtype) + return not_equal(input, _0, builder) + elif dst_sca_ty.is_int_signed(): + return tl.tensor(builder.create_fp_to_si(input.handle, dst_ty.to_ir(builder)), dst_ty) + else: + return tl.tensor(builder.create_fp_to_ui(input.handle, dst_ty.to_ir(builder)), dst_ty) + + # Casting integer types to standard floating types + if src_sca_ty.is_int() and dst_sca_ty.is_standard_floating(): + if src_sca_ty.is_bool() or not src_sca_ty.is_int_signed(): + return tl.tensor(builder.create_ui_to_fp(input.handle, dst_ty.to_ir(builder)), dst_ty) + else: + return tl.tensor(builder.create_si_to_fp(input.handle, dst_ty.to_ir(builder)), dst_ty) + + # Casting pointer types to integer types + if src_sca_ty.is_ptr() and dst_sca_ty.is_int(): + bitwidth = dst_sca_ty.int_bitwidth + if bitwidth == 64: + return tl.tensor(builder.create_ptr_to_int(input.handle, dst_ty.to_ir(builder)), dst_ty) + if bitwidth == 1: + return not_equal(cast(input, tl.int64, builder), tl.tensor(builder.get_int64(0), tl.int64), builder) + + # Casting integer types to pointer types + if src_sca_ty.is_int() and dst_sca_ty.is_ptr(): + return tl.tensor(builder.create_int_to_ptr(input.handle, dst_ty.to_ir(builder)), dst_ty) + + # Casting pointer types to pointer types + if src_sca_ty.is_ptr() and dst_sca_ty.is_ptr(): + return tl.tensor(builder.create_bitcast(input.handle, dst_ty.to_ir(builder)), dst_ty) + + assert False, f'cannot cast {input} to {dst_ty}' + + +# ===----------------------------------------------------------------------===// +# Memory Operators +# ===----------------------------------------------------------------------===// + + +def _str_to_load_cache_modifier(cache_modifier): + cache = ir.CACHE_MODIFIER.NONE # default + if cache_modifier: + if cache_modifier == ".ca": + cache = ir.CACHE_MODIFIER.CA + elif cache_modifier == ".cg": + cache = ir.CACHE_MODIFIER.CG + else: + raise ValueError(f"Cache modifier {cache_modifier} not supported") + return cache + + +def _str_to_store_cache_modifier(cache_modifier): + cache = ir.CACHE_MODIFIER.NONE # default + if cache_modifier: + if cache_modifier == ".wb": + cache = ir.CACHE_MODIFIER.WB + elif cache_modifier == ".cg": + cache = ir.CACHE_MODIFIER.CG + elif cache_modifier == ".cs": + cache = ir.CACHE_MODIFIER.CS + elif cache_modifier == ".wt": + cache = ir.CACHE_MODIFIER.WT + else: + raise ValueError(f"Cache modifier {cache_modifier} not supported") + return cache + + +def _str_to_eviction_policy(eviction_policy): + eviction = ir.EVICTION_POLICY.NORMAL # default + if eviction_policy: + if eviction_policy == "evict_last": + eviction = ir.EVICTION_POLICY.EVICT_LAST + elif eviction_policy == "evict_first": + eviction = ir.EVICTION_POLICY.EVICT_FIRST + else: + raise ValueError(f"Eviction policy {eviction_policy} not supported") + return eviction + + +def _str_to_padding_option(padding_option): + padding = None # default + if padding_option: + if padding_option == "zero": + padding = ir.PADDING_OPTION.PAD_ZERO + elif padding_option == "nan": + padding = ir.PADDING_OPTION.PAD_NAN + else: + raise ValueError(f"Padding option {padding_option} not supported") + return padding + + +def _str_to_sem(sem_option): + sem = ir.MEM_SEMANTIC.ACQUIRE_RELEASE + if sem_option: + if sem_option == "acquire": + sem = ir.MEM_SEMANTIC.ACQUIRE + elif sem_option == "release": + sem = ir.MEM_SEMANTIC.RELEASE + elif sem_option == "acq_rel": + sem = ir.MEM_SEMANTIC.ACQUIRE_RELEASE + elif sem_option == "relaxed": + sem = ir.MEM_SEMANTIC.RELAXED + else: + raise ValueError(f"Memory semantic {sem_option} not supported") + return sem + + +def _str_to_scope(scope_option): + scope = ir.MEM_SYNC_SCOPE.GPU + if scope_option: + if scope_option == "gpu": + scope = ir.MEM_SYNC_SCOPE.GPU + elif scope_option == "cta": + scope = ir.MEM_SYNC_SCOPE.CTA + elif scope_option == "sys": + scope = ir.MEM_SYNC_SCOPE.SYSTEM + else: + raise ValueError(f"Memory semantic {scope_option} not supported") + return scope + + +def _canonicalize_boundary_check(boundary_check, block_shape): + if boundary_check: + if not hasattr(boundary_check, "__iter__"): + boundary_check = [boundary_check] + boundary_check = [elem.value if isinstance(elem, tl.constexpr) else elem for elem in boundary_check] + for dim in boundary_check: + assert isinstance(dim, int) and 0 <= dim < len(block_shape) + assert len(boundary_check) > 0 + assert len(boundary_check) == len(set(boundary_check)), "Duplicate dimension in `boundary_check`" + return sorted(boundary_check) + return tuple() + + +def _load_block_pointer(ptr, mask, other, boundary_check, padding, cache, eviction, is_volatile, builder): + # Load by a block pointer: `pointer_type>` + # Block pointer can not have `mask` and `other` arguments + if mask or other: + raise ValueError("`mask` and `other` arguments cannot be specified for loading block pointers") + + elt_ty = ptr.type.element_ty.element_ty + assert elt_ty != tl.int1, "`tl.int1` should be rewrited in `tl.make_block_ptr`" + if elt_ty.is_int() and padding == ir.PADDING_OPTION.PAD_NAN: + raise ValueError("Padding option `nan` is not supported for integer block pointers") + + # `dst_ty` is de-referenced type of the pointer type + dst_ty = ptr.type.element_ty + + # Check `boundary_check` argument + boundary_check = _canonicalize_boundary_check(boundary_check, dst_ty.get_block_shapes()) + + # Build IR + return tl.tensor( + builder.create_tensor_pointer_load(ptr.handle, boundary_check, padding, cache, eviction, is_volatile), dst_ty) + + +def _load_legacy(ptr, mask, other, boundary_check, padding, cache, eviction, is_volatile, builder): + # Load by a tensor of pointers or a pointer of scalar: `block_type>` or `pointer_type<>` + if not ptr.type.scalar.is_ptr(): + raise ValueError(f"Unsupported ptr type {ptr.type.__repr__()} in `tl.load`") + + # Check `mask`, `other`, `boundary_check`, and `padding` arguments + if not mask and other: + raise ValueError("`other` cannot be provided without `mask`") + if padding or boundary_check: + raise ValueError("`padding_option` or `boundary_check` argument is not supported for loading a tensor of" + "pointers or loading a scalar. Because the compiler does not know the boundary; please " + "use block pointers (defined by `make_block_ptr`) instead") + + # For a pointer of scalar, check the type of `mask` and `other` + if not ptr.type.is_block(): + if mask and mask.type.is_block(): + raise ValueError("Mask argument cannot be block type if pointer argument is not a block") + if other and other.type.is_block(): + raise ValueError("Other argument cannot be block type if pointer argument is not a block") + + # Make `mask` and `other` into the same shape as `ptr` + if ptr.type.is_block(): + if mask: + mask = broadcast_impl_shape(mask, ptr.type.get_block_shapes(), builder) + if other: + other = broadcast_impl_shape(other, ptr.type.get_block_shapes(), builder) + + # Get `pointer_type` and `elt_ty` + ptr_ty = ptr.type.scalar + elt_ty = ptr_ty.element_ty + + # Treat `pointer_type` as `pointer_type` + if elt_ty == tl.int1: + elt_ty = tl.int8 + ptr_ty = tl.pointer_type(elt_ty, ptr_ty.address_space) + ptr = cast(ptr, ptr_ty, builder) + + # Cast `other` into `ele_ty` type + if other: + other = cast(other, elt_ty, builder) + + # Create loaded result type `dst_ty` + if ptr.type.is_block(): + shape = ptr.type.get_block_shapes() + dst_ty = tl.block_type(elt_ty, shape) + else: + # Load by de-referencing the pointer of scalar + dst_ty = elt_ty + + # Build IR + if not mask: + return tl.tensor(builder.create_load(ptr.handle, cache, eviction, is_volatile), dst_ty) + else: + return tl.tensor( + builder.create_masked_load(ptr.handle, mask.handle, other.handle if other else None, cache, eviction, + is_volatile), dst_ty) + + +def load(ptr: tl.tensor, mask: Optional[tl.tensor], other: Optional[tl.tensor], boundary_check, padding_option: str, + cache_modifier: str, eviction_policy: str, is_volatile: bool, builder: ir.builder) -> tl.tensor: + # Cache, eviction and padding options + cache = _str_to_load_cache_modifier(cache_modifier) + eviction = _str_to_eviction_policy(eviction_policy) + padding = _str_to_padding_option(padding_option) + + if ptr.type.is_ptr() and ptr.type.element_ty.is_block(): + # Load by a block pointer: `pointer_type>` + return _load_block_pointer(ptr, mask, other, boundary_check, padding, cache, eviction, is_volatile, builder) + else: + # Load by a tensor of pointers or a pointer of scalar: `block_type>` or `pointer_type<>` + return _load_legacy(ptr, mask, other, boundary_check, padding, cache, eviction, is_volatile, builder) + + +def _store_block_pointer(ptr, val, mask, boundary_check, cache, eviction, builder): + # Store by a block pointer: `pointer_type>` + # Block pointers can not have the `mask` argument + if mask: + raise ValueError("`mask` and `other` arguments cannot be specified for loading block pointers") + + # Check same shape and element type + block_shape = ptr.type.element_ty.get_block_shapes() + if not val.type.is_block(): + val = broadcast_impl_shape(val, block_shape, builder) + assert val.type.is_block(), "Value argument must be block type or a scalar" + assert block_shape == val.type.get_block_shapes( + ), f"Block shape({block_shape}) and value shape({val.type.get_block_shapes()}) mismatch" + assert ptr.type.element_ty.element_ty == val.type.element_ty, f"Block element type({ptr.type.element_ty.element_ty}) and value element type({val.type.element_ty}) mismatch" + + elt_ty = ptr.type.element_ty.element_ty + assert elt_ty != tl.int1, "`tl.int1` should be rewrited in `tl.make_block_ptr`" + + # Check `boundary_check` argument + boundary_check = _canonicalize_boundary_check(boundary_check, block_shape) + + # Build IR + return tl.tensor(builder.create_tensor_pointer_store(ptr.handle, val.handle, boundary_check, cache, eviction), + tl.void) + + +def _store_legacy(ptr, val, mask, boundary_check, cache, eviction, builder): + # Store by a tensor of pointers or a pointer of scalar: `block_type>` or `pointer_type<>` + if not ptr.type.scalar.is_ptr(): + raise ValueError(f"Unsupported ptr type {ptr.type.__repr__()} in `tl.store`") + + # Check `boundary_check` argument + if boundary_check: + raise ValueError("`boundary_check` argument is not supported for storing a tensor of pointers or storing a " + "scalar. Because the compiler does not know the boundary; please use block pointers " + "(defined by `make_block_ptr`) instead") + + # For a pointer of scalar, check the type of `val` and `mask` + if not ptr.type.is_block(): + if val.type.is_block(): + raise ValueError("Value argument cannot be block type if pointer argument is not a block") + if mask and mask.type.is_block(): + raise ValueError("Mask argument cannot be block type if pointer argument is not a block") + + # Make `mask` and `val` into the same shape as `ptr` + if ptr.type.is_block(): + val = broadcast_impl_shape(val, ptr.type.get_block_shapes(), builder) + if mask: + mask = broadcast_impl_shape(mask, ptr.type.get_block_shapes(), builder) + + ptr_ty = ptr.type.scalar + elt_ty = ptr_ty.element_ty + + # Treat `pointer_type` as `pointer_type` + if elt_ty == tl.int1: + elt_ty = tl.int8 + ptr_ty = tl.pointer_type(elt_ty, ptr_ty.address_space) + ptr = cast(ptr, ptr_ty, builder) + + # Cast to target data type + val = cast(val, elt_ty, builder) + + # Build IR + if not mask: + return tl.tensor(builder.create_store(ptr.handle, val.handle, cache, eviction), tl.void) + if not mask.type.scalar.is_bool(): + raise ValueError("Mask must have boolean scalar type") + return tl.tensor(builder.create_masked_store(ptr.handle, val.handle, mask.handle, cache, eviction), tl.void) + + +def store(ptr: tl.tensor, val: tl.tensor, mask: Optional[tl.tensor], boundary_check, cache_modifier: str, + eviction_policy: str, builder: ir.builder) -> tl.tensor: + # Cache and eviction options + cache = _str_to_store_cache_modifier(cache_modifier) + eviction = _str_to_eviction_policy(eviction_policy) + + if ptr.type.is_ptr() and ptr.type.element_ty.is_block(): + # Store by a block pointer: `pointer_type>` + return _store_block_pointer(ptr, val, mask, boundary_check, cache, eviction, builder) + else: + # Store by a tensor of pointers or a pointer of scalar: `block_type>` or `pointer_type<>` + return _store_legacy(ptr, val, mask, boundary_check, cache, eviction, builder) + + +######### +# atomic +######### + + +def atomic_cas(ptr: tl.tensor, cmp: tl.tensor, val: tl.tensor, sem: str, scope: str, builder: ir.builder) -> tl.tensor: + sem = _str_to_sem(sem) + scope = _str_to_scope(scope) + element_ty = ptr.type.scalar.element_ty + if element_ty.primitive_bitwidth not in [16, 32, 64]: + raise ValueError("atomic_cas only supports elements with width {16, 32, 64}") + return tl.tensor(builder.create_atomic_cas(ptr.handle, cmp.handle, val.handle, sem, scope), val.type) + + +def atom_red_typechecking_impl(ptr: tl.tensor, val: tl.tensor, mask: tl.tensor, op: str, + builder: ir.builder) -> Tuple[tl.tensor, tl.tensor, tl.tensor]: + if not ptr.type.scalar.is_ptr(): + raise ValueError("Pointer argument of store instruction is " + ptr.type.__repr__()) + element_ty = ptr.type.scalar.element_ty + if element_ty is tl.float16 and op != 'add': + raise ValueError("atomic_" + op + " does not support fp16") + if element_ty in [tl.int1, tl.int8, tl.int16, tl.bfloat16]: + raise ValueError("atomic_" + op + " does not support " + str(element_ty)) + if ptr.type.is_block(): + if mask: + mask = broadcast_impl_shape(mask, ptr.type.get_block_shapes(), builder) + if val: + val = broadcast_impl_shape(val, ptr.type.get_block_shapes(), builder) + val = cast(val, ptr.type.scalar.element_ty, builder) + if not mask: + mask_ir = builder.get_int1(True) + mask_ty = tl.int1 + if ptr.type.is_block(): + mask_ir = builder.create_splat(mask_ir, ptr.type.get_block_shapes()) + mask_ty = tl.block_type(tl.int1, ptr.type.get_block_shapes()) + mask = tl.tensor(mask_ir, mask_ty) + return ptr, val, mask + + +def atomic_max(ptr: tl.tensor, val: tl.tensor, mask: tl.tensor, sem: str, scope: str, builder: ir.builder) -> tl.tensor: + ptr, val, mask = atom_red_typechecking_impl(ptr, val, mask, 'max', builder) + sem = _str_to_sem(sem) + scope = _str_to_scope(scope) + sca_ty = val.type.scalar + # direct call to atomic_max for integers + if sca_ty.is_int(): + if sca_ty.is_int_signed(): + return tl.tensor( + builder.create_atomic_rmw(ir.ATOMIC_OP.MAX, ptr.handle, val.handle, mask.handle, sem, scope), val.type) + else: + return tl.tensor( + builder.create_atomic_rmw(ir.ATOMIC_OP.UMAX, ptr.handle, val.handle, mask.handle, sem, scope), val.type) + # for float + # return atomic_smax(i_ptr, i_val) if val >= 0 + # return atomic_umin(i_ptr, i_val) if val < 0 + if sca_ty not in {tl.float32, tl.float64}: + raise TypeError(f"atomic_max not supported for dtype {sca_ty}") + + itype = tl.int32 if sca_ty == tl.float32 else tl.float64 + zero = full([], 0.0, sca_ty, builder) + + i_val = bitcast(val, itype, builder) + i_ptr = bitcast(ptr, tl.pointer_type(itype, 1), builder) + pos = greater_equal(val, zero, builder) + neg = less_than(val, zero, builder) + pos_ret = tl.tensor( + builder.create_atomic_rmw(ir.ATOMIC_OP.MAX, i_ptr.handle, i_val.handle, + and_(mask, pos, builder).handle, sem, scope), i_val.type) + neg_ret = tl.tensor( + builder.create_atomic_rmw(ir.ATOMIC_OP.UMIN, i_ptr.handle, i_val.handle, + and_(mask, neg, builder).handle, sem, scope), i_val.type) + ret = where(pos, pos_ret, neg_ret, builder) + return bitcast(ret, sca_ty, builder) + + +def atomic_min(ptr: tl.tensor, val: tl.tensor, mask: tl.tensor, sem: str, scope: str, builder: ir.builder) -> tl.tensor: + ptr, val, mask = atom_red_typechecking_impl(ptr, val, mask, 'min', builder) + sem = _str_to_sem(sem) + scope = _str_to_scope(scope) + sca_ty = val.type.scalar + # direct call to atomic_min for integers + if sca_ty.is_int(): + if sca_ty.is_int_signed(): + return tl.tensor( + builder.create_atomic_rmw(ir.ATOMIC_OP.MIN, ptr.handle, val.handle, mask.handle, sem, scope), val.type) + else: + return tl.tensor( + builder.create_atomic_rmw(ir.ATOMIC_OP.UMIN, ptr.handle, val.handle, mask.handle, sem, scope), val.type) + # for float + # return atomic_smin(i_ptr, i_val) if val >= 0 + # return atomic_umax(i_ptr, i_val) if val < 0 + if sca_ty not in {tl.float32, tl.float64}: + raise TypeError(f"atomic_min not supported for dtype {sca_ty}") + + itype = tl.int32 if sca_ty == tl.float32 else tl.float64 + zero = full([], 0.0, sca_ty, builder) + + i_val = bitcast(val, itype, builder) + i_ptr = bitcast(ptr, tl.pointer_type(itype, 1), builder) + pos = greater_equal(val, zero, builder) + neg = less_than(val, zero, builder) + pos_ret = tl.tensor( + builder.create_atomic_rmw(ir.ATOMIC_OP.MIN, i_ptr.handle, i_val.handle, + and_(mask, pos, builder).handle, sem, scope), i_val.type) + neg_ret = tl.tensor( + builder.create_atomic_rmw(ir.ATOMIC_OP.UMAX, i_ptr.handle, i_val.handle, + and_(mask, neg, builder).handle, sem, scope), i_val.type) + ret = where(pos, pos_ret, neg_ret, builder) + return bitcast(ret, sca_ty, builder) + + +def atomic_add(ptr: tl.tensor, val: tl.tensor, mask: tl.tensor, sem: str, scope: str, builder: ir.builder) -> tl.tensor: + ptr, val, mask = atom_red_typechecking_impl(ptr, val, mask, 'add', builder) + sem = _str_to_sem(sem) + scope = _str_to_scope(scope) + sca_ty = val.type.scalar + op = ir.ATOMIC_OP.FADD if sca_ty.is_floating() else ir.ATOMIC_OP.ADD + return tl.tensor(builder.create_atomic_rmw(op, ptr.handle, val.handle, mask.handle, sem, scope), val.type) + + +def atomic_and(ptr: tl.tensor, val: tl.tensor, mask: tl.tensor, sem: str, scope: str, builder: ir.builder) -> tl.tensor: + ptr, val, mask = atom_red_typechecking_impl(ptr, val, mask, 'and', builder) + sem = _str_to_sem(sem) + scope = _str_to_scope(scope) + return tl.tensor(builder.create_atomic_rmw(ir.ATOMIC_OP.AND, ptr.handle, val.handle, mask.handle, sem, scope), + val.type) + + +def atomic_or(ptr: tl.tensor, val: tl.tensor, mask: tl.tensor, sem: str, scope: str, builder: ir.builder) -> tl.tensor: + ptr, val, mask = atom_red_typechecking_impl(ptr, val, mask, 'or', builder) + sem = _str_to_sem(sem) + scope = _str_to_scope(scope) + return tl.tensor(builder.create_atomic_rmw(ir.ATOMIC_OP.OR, ptr.handle, val.handle, mask.handle, sem, scope), + val.type) + + +def atomic_xor(ptr: tl.tensor, val: tl.tensor, mask: tl.tensor, sem: str, scope: str, builder: ir.builder) -> tl.tensor: + ptr, val, mask = atom_red_typechecking_impl(ptr, val, mask, 'xor', builder) + sem = _str_to_sem(sem) + scope = _str_to_scope(scope) + return tl.tensor(builder.create_atomic_rmw(ir.ATOMIC_OP.XOR, ptr.handle, val.handle, mask.handle, sem, scope), + val.type) + + +def atomic_xchg(ptr: tl.tensor, val: tl.tensor, mask: tl.tensor, sem: str, scope: str, + builder: ir.builder) -> tl.tensor: + ptr, val, mask = atom_red_typechecking_impl(ptr, val, mask, 'xchg', builder) + sem = _str_to_sem(sem) + scope = _str_to_scope(scope) + return tl.tensor(builder.create_atomic_rmw(ir.ATOMIC_OP.XCHG, ptr.handle, val.handle, mask.handle, sem, scope), + val.type) + + +# ===----------------------------------------------------------------------===// +# Linear Algebra +# ===----------------------------------------------------------------------===// + + +def gpu_has_mfma() -> bool: + if not is_hip(): + return False + return True # mfma supported in ['gfx908', 'gfx90a'] + + +def mfma_supported(M, N, K, allow_tf32, ret_scalar_ty) -> bool: + if not gpu_has_mfma(): + return False + # TODO: Add check for configurations and types. + return True + + +def dot(lhs: tl.tensor, rhs: tl.tensor, acc: tl.tensor, allow_tf32: bool, max_num_imprecise_acc: int, + out_dtype: tl.dtype, builder: ir.builder) -> tl.tensor: + + def assert_dtypes_valid(lhs_dtype, rhs_dtype, options): + if not options.allow_fp8e4nv: + assert not lhs_dtype.is_fp8e4nv() and not rhs_dtype.is_fp8e4nv( + ), "Dot op does not support fp8e4nv on CUDA arch < 90" + if lhs_dtype.is_fp8() and rhs_dtype.is_fp8(): + return + assert lhs_dtype == rhs_dtype, f"First input ({lhs_dtype}) and second input ({rhs_dtype}) must have the same dtype!" + else: + assert not lhs_dtype.is_fp8e4b15() and not rhs_dtype.is_fp8e4b15( + ), "Dot op does not support fp8e4b15 on CUDA arch >= 90" + assert not lhs_dtype.is_fp8e4b15x4() and not rhs_dtype.is_fp8e4b15x4( + ), "Dot op does not support fp8e4b15x4 on CUDA arch >= 90" + if lhs_dtype.is_int() or rhs_dtype.is_int(): + assert lhs_dtype == rhs_dtype, f"Both operands must be same type. First operand ({lhs_dtype}) and second operand ({rhs_dtype})" + assert lhs_dtype.is_int8() or lhs_dtype.is_uint8( + ), f"Both operands must be either int8 or uint8. Operand type ({lhs_dtype})" + elif lhs_dtype.is_fp8() or rhs_dtype.is_fp8(): + assert lhs_dtype.is_fp8e4nv() or lhs_dtype.is_fp8e5( + ), f"Only supports fp8e4nv or fp8e5. First operand ({lhs_dtype})" + assert rhs_dtype.is_fp8e4nv() or rhs_dtype.is_fp8e5( + ), f"Only supports fp8e4nv or fp8e5. Second operand ({rhs_dtype})" + else: + assert lhs_dtype.is_fp16() or lhs_dtype.is_bf16() or lhs_dtype.is_fp32() or lhs_dtype.is_int1( + ), f"Unsupported dtype {lhs_dtype}" + assert rhs_dtype.is_fp16() or rhs_dtype.is_bf16() or rhs_dtype.is_fp32() or rhs_dtype.is_int1( + ), f"Unsupported dtype {rhs_dtype}" + assert lhs_dtype == rhs_dtype, f"First input ({lhs_dtype}) and second input ({rhs_dtype}) must have the same dtype!" + + assert lhs.type.is_block() and rhs.type.is_block() + + assert_dtypes_valid(lhs.dtype, rhs.dtype, builder.options) + + assert len(lhs.shape) == 2, f"First input shape ({lhs.shape}) is not two dimensional!" + assert len(rhs.shape) == 2, f"Second input shape ({rhs.shape}) is not two dimensional!" + assert lhs.shape[1].value == rhs.shape[ + 0].value, f"First input shape ({lhs.shape}) and second input shape {rhs.shape} are not compatible for matmul (second index of first shape ({lhs.shape[1].value}) must be equal to first index of second shape ({rhs.shape[0].value})" + assert lhs.shape[0].value >= 16 and lhs.shape[1].value >= 16 \ + and rhs.shape[1].value >= 16, \ + f"All values in both first input shape ({lhs.shape}) and second input shape ({rhs.shape}) must be >= 16!" + if lhs.type.scalar.is_int(): + assert lhs.type.scalar == tl.int8, "only int8 supported!" + # TODO: This is CUDA specific, check if ROCm has the same limitation + assert lhs.shape[1].value >= 32, "small blocks not supported!" + _0 = builder.get_int32(0) + ret_scalar_ty = tl.int32 + elif out_dtype.is_bf16(): + raise ValueError( + "out_dtype=bfloat16 is unsupported. Please use out_dtype=float32/float16 and cast with `.to(tl.bfloat16)`") + elif lhs.type.scalar.is_fp32() or lhs.type.scalar.is_bf16(): + _0 = builder.get_fp32(0) + ret_scalar_ty = tl.float32 + else: + _0 = builder.get_fp16(0) if out_dtype.is_fp16() else builder.get_fp32(0) + ret_scalar_ty = out_dtype + + M = lhs.type.shape[0] + N = rhs.type.shape[1] + + # Cast operands of types f16 and i8 for configurations where FMA only supported. + if is_hip() and not mfma_supported(M, N, lhs.type.shape[1], allow_tf32, ret_scalar_ty): + ret_cast_scalar_ty = tl.float32 if lhs.type.scalar.is_int() else ret_scalar_ty + lhs = cast(lhs, ret_cast_scalar_ty, builder) + rhs = cast(rhs, ret_cast_scalar_ty, builder) + if ret_cast_scalar_ty == tl.float16: + _0 = builder.create_splat(builder.get_fp16(0), [M, N]) + else: + _0 = builder.create_splat(builder.get_fp32(0), [M, N]) + ret_ty = tl.block_type(ret_cast_scalar_ty, [M, N]) + ret = tl.tensor(builder.create_dot(lhs.handle, rhs.handle, _0, allow_tf32), ret_ty) + return cast(ret, ret_scalar_ty, builder) + if is_hip() and mfma_supported(M, N, lhs.type.shape[1], allow_tf32, + ret_scalar_ty) and ret_scalar_ty.primitive_bitwidth < 32: + if lhs.type.scalar.is_int(): + ret_dot_scalar_ty = tl.int32 + _0 = builder.create_splat(builder.get_int32(0), [M, N]) + else: + ret_dot_scalar_ty = tl.float32 + _0 = builder.create_splat(builder.get_fp32(0), [M, N]) + ret_ty = tl.block_type(ret_dot_scalar_ty, [M, N]) + ret = tl.tensor(builder.create_dot(lhs.handle, rhs.handle, _0, allow_tf32), ret_ty) + return cast(ret, ret_scalar_ty, builder) + ret_ty = tl.block_type(ret_scalar_ty, [M, N]) + if acc is None: + acc_handle = builder.create_splat(_0, [M, N]) + else: + acc_handle = acc.handle + assert acc.type == ret_ty + + # max_num_imprecise_acc only applies to fp8 -> fp32 dot on sm_90 + max_num_imprecise_acc = 0 + if lhs.dtype.is_fp8() and rhs.dtype.is_fp8(): + max_num_imprecise_acc = builder.options.max_num_imprecise_acc_default + if max_num_imprecise_acc is None: + max_num_imprecise_acc = 2**30 + + return tl.tensor(builder.create_dot(lhs.handle, rhs.handle, acc_handle, allow_tf32, max_num_imprecise_acc), ret_ty) + + +# ===----------------------------------------------------------------------===// +# Indexing +# ===----------------------------------------------------------------------===// + + +def where(condition: tl.tensor, x: tl.tensor, y: tl.tensor, builder: ir.builder) -> tl.tensor: + condition = cast(condition, tl.int1, builder) + if condition.type.is_block(): + condition, x = broadcast_impl_value(condition, x, builder) + x, y = broadcast_impl_value(x, y, builder) + condition, x = broadcast_impl_value(condition, x, builder) + + x, y = binary_op_type_checking_impl(x, y, builder, True, True) + if not condition.type.is_block(): + condition, _ = broadcast_impl_value(condition, x, builder) + ret_ty = x.type + return tl.tensor(builder.create_select(condition.handle, x.handle, y.handle), ret_ty) + + +# ===----------------------------------------------------------------------===// +# Reduction +# ===----------------------------------------------------------------------=== + + +def reduction(inputs: Sequence[tl.tensor], axis: int, region_builder_fn, builder: ir.builder) -> Tuple[tl.tensor, ...]: + if axis is None: + new_inputs = [] + for i in range(len(inputs)): + new_shape = [inputs[i].numel.value] + new_inputs.append(view(inputs[i], new_shape, builder)) + inputs = tuple(new_inputs) + axis = 0 + # get result shape + shape = inputs[0].type.shape + ret_shape = [s for i, s in enumerate(shape) if i != axis] + for t in inputs: + assert t.type.shape == shape + + def wrap_tensor(x, scalar_ty): + if ret_shape: + res_ty = tl.block_type(scalar_ty, ret_shape) + else: + # 0d-tensor -> scalar + res_ty = scalar_ty + return tl.tensor(x, res_ty) + + reduce_op = builder.create_reduce([t.handle for t in inputs], axis) + region_builder_fn(reduce_op) + reduce_op.verify() + + return tuple(wrap_tensor(reduce_op.get_result(i), inputs[i].type.scalar) for i in range(len(inputs))) + + +# ===----------------------------------------------------------------------=== +# Associative Scan +# ===----------------------------------------------------------------------=== + + +def associative_scan(inputs: Sequence[tl.tensor], axis: int, region_builder_fn, + builder: ir.builder) -> Tuple[tl.tensor, ...]: + if len(inputs) != 1: + raise ValueError("Current implementation only support single tensor input") + shape = inputs[0].type.shape + + def wrap_tensor(x, scalar_ty): + res_ty = tl.block_type(scalar_ty, shape) + return tl.tensor(x, res_ty) + + scan_op = builder.create_scan([t.handle for t in inputs], axis) + region_builder_fn(scan_op) + scan_op.verify() + + return tuple(wrap_tensor(scan_op.get_result(i), inputs[i].type.scalar) for i in range(len(inputs))) + + +# ===----------------------------------------------------------------------=== +# Math +# ===----------------------------------------------------------------------=== + + +def _check_dtype(dtypes: List[str]) -> T: + """ + We're following libdevice's convention to check accepted data types for math functions. + It is not a good practice to support all data types as accelerators/GPUs don't support + many float16 and bfloat16 math operations. + We should let the users know that they are using and invoke explicit cast to convert + the data type to the supported one. + """ + + def wrapper(fn): + + @wraps(fn) + def check(*args, **kwargs): + # concatenate args and kwargs + all_args = list(args) + list(kwargs.values()) + for arg in [a for a in all_args if isinstance(a, tl.tensor)]: + if arg.type.scalar.name not in dtypes: + raise ValueError(f"Expected dtype {dtypes} but got {arg.type.scalar.name}") + return fn(*args, **kwargs) + + return check + + return wrapper + + +def umulhi(x: tl.tensor, y: tl.tensor, builder: ir.builder) -> tl.tensor: + x, y = binary_op_type_checking_impl(x, y, builder) + # FIXME(Keren): not portable, should be fixed + from . import math + return math.mulhi(x, y, _builder=builder) + + +@_check_dtype(dtypes=["fp32", "fp64"]) +def floor(x: tl.tensor, builder: ir.builder) -> tl.tensor: + # FIXME(Keren): not portable, should be fixed + from . import math + return math.floor(x, _builder=builder) + + +@_check_dtype(dtypes=["fp32", "fp64"]) +def exp(x: tl.tensor, builder: ir.builder) -> tl.tensor: + return tl.tensor(builder.create_exp(x.handle), x.type) + + +@_check_dtype(dtypes=["fp32", "fp64"]) +def log(x: tl.tensor, builder: ir.builder) -> tl.tensor: + return tl.tensor(builder.create_log(x.handle), x.type) + + +@_check_dtype(dtypes=["fp32", "fp64"]) +def cos(x: tl.tensor, builder: ir.builder) -> tl.tensor: + return tl.tensor(builder.create_cos(x.handle), x.type) + + +@_check_dtype(dtypes=["fp32", "fp64"]) +def sin(x: tl.tensor, builder: ir.builder) -> tl.tensor: + return tl.tensor(builder.create_sin(x.handle), x.type) + + +@_check_dtype(dtypes=["fp32", "fp64"]) +def sqrt(x: tl.tensor, builder: ir.builder) -> tl.tensor: + return tl.tensor(builder.create_sqrt(x.handle), x.type) + + +def abs(x: tl.tensor, builder: ir.builder) -> tl.tensor: + dtype = x.dtype + if dtype.is_floating(): + return tl.tensor(builder.create_fabs(x.handle), x.type) + elif dtype.is_int_signed(): + return tl.tensor(builder.create_iabs(x.handle), x.type) + elif dtype.is_int_unsigned(): + return x # no-op + else: + assert False, f"Unexpected dtype {dtype}" + + +## + + +def multiple_of(x: tl.tensor, values: List[int]) -> tl.tensor: + if max(1, len(x.shape)) != len(values): + raise ValueError("Shape of input to multiple_of does not match the length of values") + x.handle.set_attr("tt.divisibility", ir.make_attr(values, x.handle.get_context())) + return x + + +def max_contiguous(x: tl.tensor, values: List[int]) -> tl.tensor: + if len(x.shape) != len(values): + raise ValueError("Shape of input to max_contiguous does not match the length of values") + x.handle.set_attr("tt.contiguity", ir.make_attr(values, x.handle.get_context())) + return x + + +def max_constancy(x: tl.tensor, values: List[int]) -> tl.tensor: + if len(x.shape) != len(values): + raise ValueError("Shape of input to max_constancy does not match the length of values") + x.handle.set_attr("tt.constancy", ir.make_attr(values, x.handle.get_context())) + return x + + +def debug_barrier(builder: ir.builder) -> tl.tensor: + return tl.tensor(builder.create_barrier(), tl.void) + + +def device_print(prefix: str, args: List[tl.tensor], builder: ir.builder) -> tl.tensor: + # It makes sense visually for prefix to end in ": "; make it so. Also, + # non-empty prefixes should start with " ". + if not prefix.endswith(" ") and args: + prefix += " " + if not prefix.endswith(": ") and args: + prefix = prefix[:-1] + ": " + if len(prefix) > 2 and not prefix.startswith(" "): + prefix = " " + prefix + + new_args = [] + for arg in args: + new_args.append(arg.handle) + return tl.tensor(builder.create_print(prefix, new_args), tl.void) + + +def device_assert(cond: tl.tensor, msg: str, file_name: str, func_name, lineno: int, builder: ir.builder) -> tl.tensor: + cond_ty = cond.type + if not cond_ty.is_block(): + cond_ty = tl.block_type(cond_ty.scalar, (1, )) + cond = tl.tensor(builder.create_splat(cond.handle, (1, )), cond_ty) + return tl.tensor(builder.create_assert(cond.handle, msg, file_name, func_name, lineno), tl.void) + + +def _convert_elem_to_ir_value(builder, elem, require_i64): + if isinstance(elem, int): + elem = tl.constexpr(elem) + if isinstance(elem, tl.constexpr): + return builder.get_int64(elem.value) if require_i64 else builder.get_int32(elem.value) + elif isinstance(elem, tl.tensor): + assert elem.numel.value == 1, "Expected a scalar in shape/strides/offsets" + assert elem.dtype.is_int(), "Expected an integer scalar type in shape/strides/offsets" + if elem.dtype != tl.int64 and require_i64: + return builder.create_int_cast(elem.handle, builder.get_int64_ty(), elem.dtype.is_int_signed()) + elif elem.dtype != tl.int32: + return builder.create_int_cast(elem.handle, builder.get_int32_ty(), elem.dtype.is_int_signed()) + return elem.handle + assert False, f"Unsupported element type in shape/strides/offsets: {type(elem)}" + + +def _convert_to_ir_values(builder, list_like, require_i64=True): + if hasattr(list_like, "__iter__"): + return [_convert_elem_to_ir_value(builder, elem, require_i64) for elem in list_like] + return [_convert_elem_to_ir_value(builder, list_like, require_i64)] + + +def make_block_ptr(base: tl.tensor, shape, strides, offsets, block_shape, order, builder: ir.builder) -> tl.tensor: + # Convert dynamic arguments to IR values + # NOTES(Chenggang): current `shape/strides` are `int64_t`, while `offsets/block_shape` are `int32_t` + shape = _convert_to_ir_values(builder, shape) + strides = _convert_to_ir_values(builder, strides) + offsets = _convert_to_ir_values(builder, offsets, require_i64=False) + + # Check `base` type + if not base.type.is_ptr() or base.type.element_ty.is_block(): + raise ValueError("Expected `base` to be a pointer type (but not a block pointer type or others)") + + # Treat `pointer_type` as `pointer_type` + if base.type.element_ty == tl.int1: + base = cast(base, tl.pointer_type(tl.int8, base.type.address_space), builder) + + # Check whether `block_shape` is static + if not hasattr(block_shape, "__iter__"): + block_shape = [block_shape] + block_shape = [elem.value if isinstance(elem, tl.constexpr) else elem for elem in block_shape] + assert all([isinstance(elem, int) and -2**31 <= elem < 2**31 for elem in block_shape]), \ + "Expected a list of constant integers (`int32_t` range) in `block_shape`" + + # Check `order` + if not hasattr(order, "__iter__"): + order = [order] + order = [elem.value if isinstance(elem, tl.constexpr) else elem for elem in order] + assert sorted(order) == list(range(len(order))), "Expected a permutation of (0, 1, ..., len(order)-1) in order" + + # Must have same length + assert all([len(block_shape) == len(list_like) for list_like in [shape, strides, offsets, order]]), \ + "Expected shape/strides/offsets/block_shape to have the same length" + + # Build value, the type is: + # `pointer_type>` in Python + # `tt.ptr>` in MLIR + handle = builder.create_make_block_ptr(base.handle, shape, strides, offsets, block_shape, order) + return tl.tensor(handle, tl.pointer_type(tl.block_type(base.type.element_ty, block_shape))) + + +def advance(base: tl.tensor, offsets, builder: ir.builder) -> tl.tensor: + # Convert dynamic offsets to IR values + offsets = _convert_to_ir_values(builder, offsets, require_i64=False) + + # Advanced block pointer type is the same as before + return tl.tensor(builder.create_advance(base.handle, offsets), base.type) diff --git a/shared/package-files/07/07ebc7c52f195f037ed4dff87b34ba7779a311e0b94f593ab95f7e8e61109970/blob b/shared/package-files/07/07ebc7c52f195f037ed4dff87b34ba7779a311e0b94f593ab95f7e8e61109970/blob new file mode 100644 index 0000000000000000000000000000000000000000..be16557cff8fd0851c24f30373c2e93e15316c5a --- /dev/null +++ b/shared/package-files/07/07ebc7c52f195f037ed4dff87b34ba7779a311e0b94f593ab95f7e8e61109970/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07ebc7c52f195f037ed4dff87b34ba7779a311e0b94f593ab95f7e8e61109970 +size 415194 diff --git a/shared/package-files/07/07ec62e718c772cda488c50484de7e6b005ffe671567dbe6421685e6874be75d/blob b/shared/package-files/07/07ec62e718c772cda488c50484de7e6b005ffe671567dbe6421685e6874be75d/blob new file mode 100644 index 0000000000000000000000000000000000000000..85f67ed4baabae7cf2b9b29a04e44b79af225f68 --- /dev/null +++ b/shared/package-files/07/07ec62e718c772cda488c50484de7e6b005ffe671567dbe6421685e6874be75d/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07ec62e718c772cda488c50484de7e6b005ffe671567dbe6421685e6874be75d +size 278896 diff --git a/shared/package-files/07/07ed3c3fcd2b91e6c00aea5fac011f0b7f49434fe46005acd949d75733213792/blob b/shared/package-files/07/07ed3c3fcd2b91e6c00aea5fac011f0b7f49434fe46005acd949d75733213792/blob new file mode 100644 index 0000000000000000000000000000000000000000..0eaab77d4432b63669b9b5978db278689643f0fb --- /dev/null +++ b/shared/package-files/07/07ed3c3fcd2b91e6c00aea5fac011f0b7f49434fe46005acd949d75733213792/blob @@ -0,0 +1,13 @@ +*** Mon, 25 Jul 2016 13:49:28 *** +TEST FOR GRANGER-CAUSALITY: +H0: "R" do not Granger-cause "Dp" + +Test statistic l = 3.5314 +pval-F( l; 4, 176) = 0.0084 + +TEST FOR INSTANTANEOUS CAUSALITY: +H0: No instantaneous causality between "R" and "Dp" + +Test statistic: c = 0.4071 +pval-Chi( c; 1) = 0.5235 + diff --git a/shared/package-files/07/07ef1813ead2323a5d07e06ca003411d9419a568ff76c9ab5deea0defd894b61/blob b/shared/package-files/07/07ef1813ead2323a5d07e06ca003411d9419a568ff76c9ab5deea0defd894b61/blob new file mode 100644 index 0000000000000000000000000000000000000000..42d32533953bc965fa11589d039bc4632257ecd5 --- /dev/null +++ b/shared/package-files/07/07ef1813ead2323a5d07e06ca003411d9419a568ff76c9ab5deea0defd894b61/blob @@ -0,0 +1,248 @@ +import csv +import os +import time +import urllib +from functools import partial +from multiprocessing import Pool +from os import path +from pathlib import Path +from typing import Any, Callable, Dict, Optional, Tuple, Union + +from torch import Tensor + +from .folder import find_classes, make_dataset +from .utils import check_integrity, download_and_extract_archive, download_url, verify_str_arg +from .video_utils import VideoClips +from .vision import VisionDataset + + +def _dl_wrap(tarpath: str, videopath: str, line: str) -> None: + download_and_extract_archive(line, tarpath, videopath) + + +class Kinetics(VisionDataset): + """`Generic Kinetics `_ + dataset. + + Kinetics-400/600/700 are action recognition video datasets. + This dataset consider every video as a collection of video clips of fixed size, specified + by ``frames_per_clip``, where the step in frames between each clip is given by + ``step_between_clips``. + + To give an example, for 2 videos with 10 and 15 frames respectively, if ``frames_per_clip=5`` + and ``step_between_clips=5``, the dataset size will be (2 + 3) = 5, where the first two + elements will come from video 1, and the next three elements from video 2. + Note that we drop clips which do not have exactly ``frames_per_clip`` elements, so not all + frames in a video might be present. + + Args: + root (str or ``pathlib.Path``): Root directory of the Kinetics Dataset. + Directory should be structured as follows: + .. code:: + + root/ + ├── split + │ ├── class1 + │ │ ├── vid1.mp4 + │ │ ├── vid2.mp4 + │ │ ├── vid3.mp4 + │ │ ├── ... + │ ├── class2 + │ │ ├── vidx.mp4 + │ │ └── ... + + Note: split is appended automatically using the split argument. + frames_per_clip (int): number of frames in a clip + num_classes (int): select between Kinetics-400 (default), Kinetics-600, and Kinetics-700 + split (str): split of the dataset to consider; supports ``"train"`` (default) ``"val"`` ``"test"`` + frame_rate (float): If omitted, interpolate different frame rate for each clip. + step_between_clips (int): number of frames between each clip + transform (callable, optional): A function/transform that takes in a TxHxWxC video + and returns a transformed version. + download (bool): Download the official version of the dataset to root folder. + num_workers (int): Use multiple workers for VideoClips creation + num_download_workers (int): Use multiprocessing in order to speed up download. + output_format (str, optional): The format of the output video tensors (before transforms). + Can be either "THWC" or "TCHW" (default). + Note that in most other utils and datasets, the default is actually "THWC". + + Returns: + tuple: A 3-tuple with the following entries: + + - video (Tensor[T, C, H, W] or Tensor[T, H, W, C]): the `T` video frames in torch.uint8 tensor + - audio(Tensor[K, L]): the audio frames, where `K` is the number of channels + and `L` is the number of points in torch.float tensor + - label (int): class of the video clip + + Raises: + RuntimeError: If ``download is True`` and the video archives are already extracted. + """ + + _TAR_URLS = { + "400": "https://s3.amazonaws.com/kinetics/400/{split}/k400_{split}_path.txt", + "600": "https://s3.amazonaws.com/kinetics/600/{split}/k600_{split}_path.txt", + "700": "https://s3.amazonaws.com/kinetics/700_2020/{split}/k700_2020_{split}_path.txt", + } + _ANNOTATION_URLS = { + "400": "https://s3.amazonaws.com/kinetics/400/annotations/{split}.csv", + "600": "https://s3.amazonaws.com/kinetics/600/annotations/{split}.csv", + "700": "https://s3.amazonaws.com/kinetics/700_2020/annotations/{split}.csv", + } + + def __init__( + self, + root: Union[str, Path], + frames_per_clip: int, + num_classes: str = "400", + split: str = "train", + frame_rate: Optional[int] = None, + step_between_clips: int = 1, + transform: Optional[Callable] = None, + extensions: Tuple[str, ...] = ("avi", "mp4"), + download: bool = False, + num_download_workers: int = 1, + num_workers: int = 1, + _precomputed_metadata: Optional[Dict[str, Any]] = None, + _video_width: int = 0, + _video_height: int = 0, + _video_min_dimension: int = 0, + _audio_samples: int = 0, + _audio_channels: int = 0, + _legacy: bool = False, + output_format: str = "TCHW", + ) -> None: + + # TODO: support test + self.num_classes = verify_str_arg(num_classes, arg="num_classes", valid_values=["400", "600", "700"]) + self.extensions = extensions + self.num_download_workers = num_download_workers + + self.root = root + self._legacy = _legacy + + if _legacy: + print("Using legacy structure") + self.split_folder = root + self.split = "unknown" + output_format = "THWC" + if download: + raise ValueError("Cannot download the videos using legacy_structure.") + else: + self.split_folder = path.join(root, split) + self.split = verify_str_arg(split, arg="split", valid_values=["train", "val", "test"]) + + if download: + self.download_and_process_videos() + + super().__init__(self.root) + + self.classes, class_to_idx = find_classes(self.split_folder) + self.samples = make_dataset(self.split_folder, class_to_idx, extensions, is_valid_file=None) + video_list = [x[0] for x in self.samples] + self.video_clips = VideoClips( + video_list, + frames_per_clip, + step_between_clips, + frame_rate, + _precomputed_metadata, + num_workers=num_workers, + _video_width=_video_width, + _video_height=_video_height, + _video_min_dimension=_video_min_dimension, + _audio_samples=_audio_samples, + _audio_channels=_audio_channels, + output_format=output_format, + ) + self.transform = transform + + def download_and_process_videos(self) -> None: + """Downloads all the videos to the _root_ folder in the expected format.""" + tic = time.time() + self._download_videos() + toc = time.time() + print("Elapsed time for downloading in mins ", (toc - tic) / 60) + self._make_ds_structure() + toc2 = time.time() + print("Elapsed time for processing in mins ", (toc2 - toc) / 60) + print("Elapsed time overall in mins ", (toc2 - tic) / 60) + + def _download_videos(self) -> None: + """download tarballs containing the video to "tars" folder and extract them into the _split_ folder where + split is one of the official dataset splits. + + Raises: + RuntimeError: if download folder exists, break to prevent downloading entire dataset again. + """ + if path.exists(self.split_folder): + raise RuntimeError( + f"The directory {self.split_folder} already exists. " + f"If you want to re-download or re-extract the images, delete the directory." + ) + tar_path = path.join(self.root, "tars") + file_list_path = path.join(self.root, "files") + + split_url = self._TAR_URLS[self.num_classes].format(split=self.split) + split_url_filepath = path.join(file_list_path, path.basename(split_url)) + if not check_integrity(split_url_filepath): + download_url(split_url, file_list_path) + with open(split_url_filepath) as file: + list_video_urls = [urllib.parse.quote(line, safe="/,:") for line in file.read().splitlines()] + + if self.num_download_workers == 1: + for line in list_video_urls: + download_and_extract_archive(line, tar_path, self.split_folder) + else: + part = partial(_dl_wrap, tar_path, self.split_folder) + poolproc = Pool(self.num_download_workers) + poolproc.map(part, list_video_urls) + + def _make_ds_structure(self) -> None: + """move videos from + split_folder/ + ├── clip1.avi + ├── clip2.avi + + to the correct format as described below: + split_folder/ + ├── class1 + │ ├── clip1.avi + + """ + annotation_path = path.join(self.root, "annotations") + if not check_integrity(path.join(annotation_path, f"{self.split}.csv")): + download_url(self._ANNOTATION_URLS[self.num_classes].format(split=self.split), annotation_path) + annotations = path.join(annotation_path, f"{self.split}.csv") + + file_fmtstr = "{ytid}_{start:06}_{end:06}.mp4" + with open(annotations) as csvfile: + reader = csv.DictReader(csvfile) + for row in reader: + f = file_fmtstr.format( + ytid=row["youtube_id"], + start=int(row["time_start"]), + end=int(row["time_end"]), + ) + label = row["label"].replace(" ", "_").replace("'", "").replace("(", "").replace(")", "") + os.makedirs(path.join(self.split_folder, label), exist_ok=True) + downloaded_file = path.join(self.split_folder, f) + if path.isfile(downloaded_file): + os.replace( + downloaded_file, + path.join(self.split_folder, label, f), + ) + + @property + def metadata(self) -> Dict[str, Any]: + return self.video_clips.metadata + + def __len__(self) -> int: + return self.video_clips.num_clips() + + def __getitem__(self, idx: int) -> Tuple[Tensor, Tensor, int]: + video, audio, info, video_idx = self.video_clips.get_clip(idx) + label = self.samples[video_idx][1] + + if self.transform is not None: + video = self.transform(video) + + return video, audio, label diff --git a/shared/package-files/07/07f252dbe141e9293475af60487d0d9e17140a4a776f0d26d7ea2030e1e699c1/blob b/shared/package-files/07/07f252dbe141e9293475af60487d0d9e17140a4a776f0d26d7ea2030e1e699c1/blob new file mode 100644 index 0000000000000000000000000000000000000000..c131fb816e3461088643b4d79797e75c96129b65 --- /dev/null +++ b/shared/package-files/07/07f252dbe141e9293475af60487d0d9e17140a4a776f0d26d7ea2030e1e699c1/blob @@ -0,0 +1,118 @@ +from __future__ import annotations + +import sys + +assert sys.platform != "win32" + +import os +from contextlib import contextmanager +from typing import ContextManager, Iterator, TextIO, cast + +from ..utils import DummyContext +from .base import PipeInput +from .vt100 import Vt100Input + +__all__ = [ + "PosixPipeInput", +] + + +class _Pipe: + "Wrapper around os.pipe, that ensures we don't double close any end." + + def __init__(self) -> None: + self.read_fd, self.write_fd = os.pipe() + self._read_closed = False + self._write_closed = False + + def close_read(self) -> None: + "Close read-end if not yet closed." + if self._read_closed: + return + + os.close(self.read_fd) + self._read_closed = True + + def close_write(self) -> None: + "Close write-end if not yet closed." + if self._write_closed: + return + + os.close(self.write_fd) + self._write_closed = True + + def close(self) -> None: + "Close both read and write ends." + self.close_read() + self.close_write() + + +class PosixPipeInput(Vt100Input, PipeInput): + """ + Input that is send through a pipe. + This is useful if we want to send the input programmatically into the + application. Mostly useful for unit testing. + + Usage:: + + with PosixPipeInput.create() as input: + input.send_text('inputdata') + """ + + _id = 0 + + def __init__(self, _pipe: _Pipe, _text: str = "") -> None: + # Private constructor. Users should use the public `.create()` method. + self.pipe = _pipe + + class Stdin: + encoding = "utf-8" + + def isatty(stdin) -> bool: + return True + + def fileno(stdin) -> int: + return self.pipe.read_fd + + super().__init__(cast(TextIO, Stdin())) + self.send_text(_text) + + # Identifier for every PipeInput for the hash. + self.__class__._id += 1 + self._id = self.__class__._id + + @classmethod + @contextmanager + def create(cls, text: str = "") -> Iterator[PosixPipeInput]: + pipe = _Pipe() + try: + yield PosixPipeInput(_pipe=pipe, _text=text) + finally: + pipe.close() + + def send_bytes(self, data: bytes) -> None: + os.write(self.pipe.write_fd, data) + + def send_text(self, data: str) -> None: + "Send text to the input." + os.write(self.pipe.write_fd, data.encode("utf-8")) + + def raw_mode(self) -> ContextManager[None]: + return DummyContext() + + def cooked_mode(self) -> ContextManager[None]: + return DummyContext() + + def close(self) -> None: + "Close pipe fds." + # Only close the write-end of the pipe. This will unblock the reader + # callback (in vt100.py > _attached_input), which eventually will raise + # `EOFError`. If we'd also close the read-end, then the event loop + # won't wake up the corresponding callback because of this. + self.pipe.close_write() + + def typeahead_hash(self) -> str: + """ + This needs to be unique for every `PipeInput`. + """ + return f"pipe-input-{self._id}" diff --git a/shared/package-files/07/07f3689f83d0063c0d5630a7052ce390b0612fb91289362ac43974717ad2dce0/blob b/shared/package-files/07/07f3689f83d0063c0d5630a7052ce390b0612fb91289362ac43974717ad2dce0/blob new file mode 100644 index 0000000000000000000000000000000000000000..0fb44960ffe0c43902505fbd024edae34c4dcd8c --- /dev/null +++ b/shared/package-files/07/07f3689f83d0063c0d5630a7052ce390b0612fb91289362ac43974717ad2dce0/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07f3689f83d0063c0d5630a7052ce390b0612fb91289362ac43974717ad2dce0 +size 2071644 diff --git a/shared/package-files/07/07f3d6f00dacd6dace45b9d50f3282b6a773b25cd66f30ecafdbca59ecb7a6a6/blob b/shared/package-files/07/07f3d6f00dacd6dace45b9d50f3282b6a773b25cd66f30ecafdbca59ecb7a6a6/blob new file mode 100644 index 0000000000000000000000000000000000000000..ff82c35f682b04a250f6a86721312f860b3fe7cb --- /dev/null +++ b/shared/package-files/07/07f3d6f00dacd6dace45b9d50f3282b6a773b25cd66f30ecafdbca59ecb7a6a6/blob @@ -0,0 +1,313 @@ +/* Translated into C++ by SciPy developers in 2024. + * Original header with Copyright information appears below. + */ + +/* + * (C) Copyright John Maddock 2006. + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) + */ +#pragma once + +#include "../config.h" +#include "../error.h" + +#include "const.h" +#include "gamma.h" +#include "igam.h" +#include "polevl.h" + +namespace xsf { +namespace cephes { + + namespace detail { + + XSF_HOST_DEVICE double find_inverse_s(double p, double q) { + /* + * Computation of the Incomplete Gamma Function Ratios and their Inverse + * ARMIDO R. DIDONATO and ALFRED H. MORRIS, JR. + * ACM Transactions on Mathematical Software, Vol. 12, No. 4, + * December 1986, Pages 377-393. + * + * See equation 32. + */ + double s, t; + constexpr double a[4] = {0.213623493715853, 4.28342155967104, 11.6616720288968, 3.31125922108741}; + constexpr double b[5] = {0.3611708101884203e-1, 1.27364489782223, 6.40691597760039, 6.61053765625462, 1}; + + if (p < 0.5) { + t = std::sqrt(-2 * std::log(p)); + } else { + t = std::sqrt(-2 * std::log(q)); + } + s = t - polevl(t, a, 3) / polevl(t, b, 4); + if (p < 0.5) + s = -s; + return s; + } + + XSF_HOST_DEVICE inline double didonato_SN(double a, double x, unsigned N, double tolerance) { + /* + * Computation of the Incomplete Gamma Function Ratios and their Inverse + * ARMIDO R. DIDONATO and ALFRED H. MORRIS, JR. + * ACM Transactions on Mathematical Software, Vol. 12, No. 4, + * December 1986, Pages 377-393. + * + * See equation 34. + */ + double sum = 1.0; + + if (N >= 1) { + unsigned i; + double partial = x / (a + 1); + + sum += partial; + for (i = 2; i <= N; ++i) { + partial *= x / (a + i); + sum += partial; + if (partial < tolerance) { + break; + } + } + } + return sum; + } + + XSF_HOST_DEVICE inline double find_inverse_gamma(double a, double p, double q) { + /* + * In order to understand what's going on here, you will + * need to refer to: + * + * Computation of the Incomplete Gamma Function Ratios and their Inverse + * ARMIDO R. DIDONATO and ALFRED H. MORRIS, JR. + * ACM Transactions on Mathematical Software, Vol. 12, No. 4, + * December 1986, Pages 377-393. + */ + double result; + + if (a == 1) { + if (q > 0.9) { + result = -std::log1p(-p); + } else { + result = -std::log(q); + } + } else if (a < 1) { + double g = xsf::cephes::Gamma(a); + double b = q * g; + + if ((b > 0.6) || ((b >= 0.45) && (a >= 0.3))) { + /* DiDonato & Morris Eq 21: + * + * There is a slight variation from DiDonato and Morris here: + * the first form given here is unstable when p is close to 1, + * making it impossible to compute the inverse of Q(a,x) for small + * q. Fortunately the second form works perfectly well in this case. + */ + double u; + if ((b * q > 1e-8) && (q > 1e-5)) { + u = std::pow(p * g * a, 1 / a); + } else { + u = std::exp((-q / a) - SCIPY_EULER); + } + result = u / (1 - (u / (a + 1))); + } else if ((a < 0.3) && (b >= 0.35)) { + /* DiDonato & Morris Eq 22: */ + double t = std::exp(-SCIPY_EULER - b); + double u = t * std::exp(t); + result = t * std::exp(u); + } else if ((b > 0.15) || (a >= 0.3)) { + /* DiDonato & Morris Eq 23: */ + double y = -std::log(b); + double u = y - (1 - a) * std::log(y); + result = y - (1 - a) * std::log(u) - std::log(1 + (1 - a) / (1 + u)); + } else if (b > 0.1) { + /* DiDonato & Morris Eq 24: */ + double y = -std::log(b); + double u = y - (1 - a) * std::log(y); + result = y - (1 - a) * std::log(u) - + std::log((u * u + 2 * (3 - a) * u + (2 - a) * (3 - a)) / (u * u + (5 - a) * u + 2)); + } else { + /* DiDonato & Morris Eq 25: */ + double y = -std::log(b); + double c1 = (a - 1) * std::log(y); + double c1_2 = c1 * c1; + double c1_3 = c1_2 * c1; + double c1_4 = c1_2 * c1_2; + double a_2 = a * a; + double a_3 = a_2 * a; + + double c2 = (a - 1) * (1 + c1); + double c3 = (a - 1) * (-(c1_2 / 2) + (a - 2) * c1 + (3 * a - 5) / 2); + double c4 = (a - 1) * ((c1_3 / 3) - (3 * a - 5) * c1_2 / 2 + (a_2 - 6 * a + 7) * c1 + + (11 * a_2 - 46 * a + 47) / 6); + double c5 = (a - 1) * (-(c1_4 / 4) + (11 * a - 17) * c1_3 / 6 + (-3 * a_2 + 13 * a - 13) * c1_2 + + (2 * a_3 - 25 * a_2 + 72 * a - 61) * c1 / 2 + + (25 * a_3 - 195 * a_2 + 477 * a - 379) / 12); + + double y_2 = y * y; + double y_3 = y_2 * y; + double y_4 = y_2 * y_2; + result = y + c1 + (c2 / y) + (c3 / y_2) + (c4 / y_3) + (c5 / y_4); + } + } else { + /* DiDonato and Morris Eq 31: */ + double s = find_inverse_s(p, q); + + double s_2 = s * s; + double s_3 = s_2 * s; + double s_4 = s_2 * s_2; + double s_5 = s_4 * s; + double ra = std::sqrt(a); + + double w = a + s * ra + (s_2 - 1) / 3; + w += (s_3 - 7 * s) / (36 * ra); + w -= (3 * s_4 + 7 * s_2 - 16) / (810 * a); + w += (9 * s_5 + 256 * s_3 - 433 * s) / (38880 * a * ra); + + if ((a >= 500) && (std::abs(1 - w / a) < 1e-6)) { + result = w; + } else if (p > 0.5) { + if (w < 3 * a) { + result = w; + } else { + double D = std::fmax(2, a * (a - 1)); + double lg = xsf::cephes::lgam(a); + double lb = std::log(q) + lg; + if (lb < -D * 2.3) { + /* DiDonato and Morris Eq 25: */ + double y = -lb; + double c1 = (a - 1) * std::log(y); + double c1_2 = c1 * c1; + double c1_3 = c1_2 * c1; + double c1_4 = c1_2 * c1_2; + double a_2 = a * a; + double a_3 = a_2 * a; + + double c2 = (a - 1) * (1 + c1); + double c3 = (a - 1) * (-(c1_2 / 2) + (a - 2) * c1 + (3 * a - 5) / 2); + double c4 = (a - 1) * ((c1_3 / 3) - (3 * a - 5) * c1_2 / 2 + (a_2 - 6 * a + 7) * c1 + + (11 * a_2 - 46 * a + 47) / 6); + double c5 = + (a - 1) * (-(c1_4 / 4) + (11 * a - 17) * c1_3 / 6 + (-3 * a_2 + 13 * a - 13) * c1_2 + + (2 * a_3 - 25 * a_2 + 72 * a - 61) * c1 / 2 + + (25 * a_3 - 195 * a_2 + 477 * a - 379) / 12); + + double y_2 = y * y; + double y_3 = y_2 * y; + double y_4 = y_2 * y_2; + result = y + c1 + (c2 / y) + (c3 / y_2) + (c4 / y_3) + (c5 / y_4); + } else { + /* DiDonato and Morris Eq 33: */ + double u = -lb + (a - 1) * std::log(w) - std::log(1 + (1 - a) / (1 + w)); + result = -lb + (a - 1) * std::log(u) - std::log(1 + (1 - a) / (1 + u)); + } + } + } else { + double z = w; + double ap1 = a + 1; + double ap2 = a + 2; + if (w < 0.15 * ap1) { + /* DiDonato and Morris Eq 35: */ + double v = std::log(p) + xsf::cephes::lgam(ap1); + z = std::exp((v + w) / a); + s = std::log1p(z / ap1 * (1 + z / ap2)); + z = std::exp((v + z - s) / a); + s = std::log1p(z / ap1 * (1 + z / ap2)); + z = std::exp((v + z - s) / a); + s = std::log1p(z / ap1 * (1 + z / ap2 * (1 + z / (a + 3)))); + z = std::exp((v + z - s) / a); + } + + if ((z <= 0.01 * ap1) || (z > 0.7 * ap1)) { + result = z; + } else { + /* DiDonato and Morris Eq 36: */ + double ls = std::log(didonato_SN(a, z, 100, 1e-4)); + double v = std::log(p) + xsf::cephes::lgam(ap1); + z = std::exp((v + z - ls) / a); + result = z * (1 - (a * std::log(z) - z - v + ls) / (a - z)); + } + } + } + return result; + } + + } // namespace detail + + XSF_HOST_DEVICE inline double igamci(double a, double q); + + XSF_HOST_DEVICE inline double igami(double a, double p) { + int i; + double x, fac, f_fp, fpp_fp; + + if (std::isnan(a) || std::isnan(p)) { + return std::numeric_limits::quiet_NaN(); + ; + } else if ((a < 0) || (p < 0) || (p > 1)) { + set_error("gammaincinv", SF_ERROR_DOMAIN, NULL); + } else if (p == 0.0) { + return 0.0; + } else if (p == 1.0) { + return std::numeric_limits::infinity(); + } else if (p > 0.9) { + return igamci(a, 1 - p); + } + + x = detail::find_inverse_gamma(a, p, 1 - p); + /* Halley's method */ + for (i = 0; i < 3; i++) { + fac = detail::igam_fac(a, x); + if (fac == 0.0) { + return x; + } + f_fp = (igam(a, x) - p) * x / fac; + /* The ratio of the first and second derivatives simplifies */ + fpp_fp = -1.0 + (a - 1) / x; + if (std::isinf(fpp_fp)) { + /* Resort to Newton's method in the case of overflow */ + x = x - f_fp; + } else { + x = x - f_fp / (1.0 - 0.5 * f_fp * fpp_fp); + } + } + + return x; + } + + XSF_HOST_DEVICE inline double igamci(double a, double q) { + int i; + double x, fac, f_fp, fpp_fp; + + if (std::isnan(a) || std::isnan(q)) { + return std::numeric_limits::quiet_NaN(); + } else if ((a < 0.0) || (q < 0.0) || (q > 1.0)) { + set_error("gammainccinv", SF_ERROR_DOMAIN, NULL); + } else if (q == 0.0) { + return std::numeric_limits::infinity(); + } else if (q == 1.0) { + return 0.0; + } else if (q > 0.9) { + return igami(a, 1 - q); + } + + x = detail::find_inverse_gamma(a, 1 - q, q); + for (i = 0; i < 3; i++) { + fac = detail::igam_fac(a, x); + if (fac == 0.0) { + return x; + } + f_fp = (igamc(a, x) - q) * x / (-fac); + fpp_fp = -1.0 + (a - 1) / x; + if (std::isinf(fpp_fp)) { + x = x - f_fp; + } else { + x = x - f_fp / (1.0 - 0.5 * f_fp * fpp_fp); + } + } + + return x; + } + +} // namespace cephes +} // namespace xsf diff --git a/shared/package-files/07/07f4bab912dd708d332084d971a91d9ab6d7eb4ee9343835dfe1785e260c130b/blob b/shared/package-files/07/07f4bab912dd708d332084d971a91d9ab6d7eb4ee9343835dfe1785e260c130b/blob new file mode 100644 index 0000000000000000000000000000000000000000..d6067159fa3d3dd1d9c320bca4f5f37ad947cd2d --- /dev/null +++ b/shared/package-files/07/07f4bab912dd708d332084d971a91d9ab6d7eb4ee9343835dfe1785e260c130b/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & _nested_get_values_copy_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor _nested_get_values_copy(const at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/07/07f7fa24cbeb1147d75f94fb69c6aacd4da05d1d3e56c536ff7fd307cac49c32/blob b/shared/package-files/07/07f7fa24cbeb1147d75f94fb69c6aacd4da05d1d3e56c536ff7fd307cac49c32/blob new file mode 100644 index 0000000000000000000000000000000000000000..f9de15fdf912b47635b2cb1388001750eec50959 --- /dev/null +++ b/shared/package-files/07/07f7fa24cbeb1147d75f94fb69c6aacd4da05d1d3e56c536ff7fd307cac49c32/blob @@ -0,0 +1,459 @@ +#pragma once +#include +#include +#include +#include + +#include +#include +#include + +namespace at { +namespace native { + +template +constexpr inline integer ceil_div(integer n, integer m) { + return (n + m - 1) / m; +} + +template +constexpr inline integer get_log_num_threads_x_inner_scan(integer num_rows, integer row_size) { + integer log_num_threads_x = 0; + integer log_num_threads_y = 0; + while (((integer)1 << log_num_threads_x) < row_size) { + ++log_num_threads_x; + } + while (((integer)1 << log_num_threads_y) < num_rows) { + ++log_num_threads_y; + } + // we want to keep the ratio between the x-threads and y-threads about the same as + // the ratio between the row_size and num_rows, but the total number of threads in + // a block should be about 512 + integer diff = log_num_threads_x - log_num_threads_y; + // 9 is from log2(512) + log_num_threads_x = ((integer)9 + diff) / (integer)2; + // I found that in having larger log_num_threads_x can give significant speed up in some cases, + // but detrimental in another case, so just keep the lower bound to be log2(16) == 4 to make it + // similar to the previous implementation + // Keeping the upper bound to be log2(512) == 9 as the maximum number of threads in a block. + log_num_threads_x = std::min(std::max((integer)4, log_num_threads_x), (integer)9); + return log_num_threads_x; +} + +template +__device__ void binary_op_update(const scalar_t lhs, scalar_t& rhs, const idx_t lhs_idx, idx_t& rhs_idx, BinaryOperation binary_op) { + if(!at::_isnan(rhs) && (at::_isnan(lhs) || !binary_op(rhs, lhs))) { + rhs = lhs; + rhs_idx = lhs_idx; + } +} +/* Perform an inclusive scan along the innermost dimension of a tensor. + * + * - num_rows is the size of the flattened outer dimensions; + * - row_size is the size of the innermost dimension; + * + * The outer dimensions of the tensor are considered as a single dimension, i.e. the tensor is + * considered as having 'num_rows' rows of size 'row_size'. + * Each thread block processes one or more sets of contiguous rows (processing multiple rows + * per thread block is quicker than processing a single row, especially for short rows). + */ +template +__global__ void tensor_kernel_scan_innermost_dim_with_indices(const scalar_t *self_, scalar_t *values_, int64_t *indices_, + int num_rows, int row_size, + const uint32_t num_threads, const uint32_t log_num_threads_x, + scalar_t init, BinaryFunction binary_op) { + // dynamic memory allocation for vbuf and ibuf + alignas(sizeof(double)) extern __shared__ char buf[]; + scalar_t* vbuf = reinterpret_cast(buf); // the size is num_threads * 2 + int64_t* ibuf = reinterpret_cast(vbuf + num_threads * 2); + const uint32_t num_threads_x = 1 << log_num_threads_x; + scalar_t* row_buf = vbuf + 2 * num_threads_x * threadIdx.y; + int64_t* row_idx_buf = ibuf + 2 * num_threads_x * threadIdx.y; + + for (int block_row = blockIdx.x * blockDim.y; + block_row < num_rows; + block_row += blockDim.y * gridDim.x) { + int row = block_row + threadIdx.y; + const scalar_t *row_self = self_ + row * row_size; + scalar_t *row_values = values_ + row * row_size; + int64_t *row_indices = indices_ + row * row_size; + scalar_t block_total = init; + int64_t block_idx_final = 0; + const bool row_exists = row < num_rows; + // Perform scan on one block at a time, keeping track of the total value of + // all blocks processed so far. + for (int block_col = 0; block_col < row_size; block_col += 2 * num_threads_x) { + // Load data into shared memory (two values per thread). + int col1 = block_col + threadIdx.x; + int col2 = block_col + num_threads_x + threadIdx.x; + if (row_exists) { + if (col1 < row_size) { + row_buf[threadIdx.x] = c10::load(&row_self[col1]); + row_idx_buf[threadIdx.x] = col1; + } else { + row_buf[threadIdx.x] = init; + // No need to set the index here as the value in init will never be selected + } + + if (col2 < row_size) { + row_buf[num_threads_x + threadIdx.x] = c10::load(&row_self[col2]); + row_idx_buf[num_threads_x + threadIdx.x] = col2; + } else { + row_buf[num_threads_x + threadIdx.x] = init; + // No need to set the index here as the value in init will never be selected + } + + // Add the total value of all previous blocks to the first value of this block. + if (threadIdx.x == 0) { + binary_op_update(block_total, row_buf[0], block_idx_final, row_idx_buf[0], binary_op); + } + } + __syncthreads(); + + // Parallel reduction with Sklansky method. The diagram can be seen on this paper: + // https://research.nvidia.com/publication/single-pass-parallel-prefix-scan-decoupled-look-back + for (uint32_t s = 1; s <= num_threads_x; s <<= 1) { + if (row_exists) { + uint32_t a = (threadIdx.x / s) * (2 * s) + s; + uint32_t ti = a + (threadIdx.x % s); + uint32_t si = a - 1; + binary_op_update(row_buf[si], row_buf[ti], row_idx_buf[si], row_idx_buf[ti], binary_op); + } + __syncthreads(); + } + + // Write back to output. + if (row_exists) { + if (col1 < row_size){ + row_values[col1] = row_buf[threadIdx.x]; + row_indices[col1] = row_idx_buf[threadIdx.x]; + } + if (col2 < row_size) { + row_values[col2] = row_buf[num_threads_x + threadIdx.x]; + row_indices[col2] = row_idx_buf[num_threads_x + threadIdx.x]; + } + } + block_total = row_buf[2 * num_threads_x - 1]; + block_idx_final = row_idx_buf[2 * num_threads_x - 1]; + __syncthreads(); + } + } +} + +/* Perform an inclusive scan along an outer dimension of a tensor. + * + * - num_orows is the size of the flattened outer dimensions; + * - num_irows is the size of the flattened inner dimensions; + * - row_size is the size of the dimension along which to compute the variance; + * + * The dimensions to the outside and inside of the specified dimension are considered as flattened. + * Thread blocks with the same blockIdx.y process an "outer row" (i.e. an element of the flattened + * outer dimensions, which contains several "inner rows"). + * Each thread processes a single inner row at a time. + */ +template +__global__ void tensor_kernel_scan_outer_dim_with_indices(const scalar_t *self_, scalar_t *values_, int64_t *indices_, + const uint32_t num_orows, const uint32_t num_irows, const uint32_t row_size, scalar_t init, BinaryFunction binary_op) { + for (uint32_t orow = blockIdx.x; orow < num_orows; orow += gridDim.x) { + for (uint32_t irow = blockIdx.y * blockDim.x + threadIdx.x; irow < num_irows; irow += gridDim.y * blockDim.x) { + const scalar_t *self = self_ + orow * row_size * num_irows + irow; + scalar_t *values = values_ + orow * row_size * num_irows + irow; + int64_t *indices = indices_ + orow * row_size * num_irows + irow; + scalar_t out = init; + int64_t out_idx = 0; + + for (auto col = decltype(row_size){0}; col < row_size; ++col) { + const auto val = c10::load(self); + if(at::_isnan(val) || (!at::_isnan(out) && binary_op(val, out))) { + out = val; + out_idx = col; + } + *values = out; + *indices = out_idx; + self += num_irows; + values += num_irows; + indices += num_irows; + } + } + } +} + +inline void check_fits_in_unsigned(int64_t val, const char* name) { + constexpr auto umax = std::numeric_limits::max(); + TORCH_CHECK( + val >= 0 && val <= umax, name, " must fit in a 32-bit uint32_t value"); +} + + +template +__host__ void scan_outer_dim_with_indices( + const TensorBase& self, const TensorBase& values, const TensorBase& indices, + int dim, scalar_t init, BinaryFunction binary_op) { + int64_t row_size = self.size(dim); + auto sizes = self.sizes(); + + // Treat all outer dimensions (i.e. dim_ < dim) as one. + const int64_t num_orows = c10::multiply_integers(sizes.begin(), sizes.begin() + dim); + + // Treat all inner dimensions (i.e. dim > dimension) as one. + const int64_t num_irows = c10::multiply_integers(sizes.begin() + dim + 1, sizes.end()); + //for performance reasons, cuda kernels use uint32_t for loops over irows, orows and row, + //make sure that input is not bigger than supported by uint32_t + check_fits_in_unsigned(num_irows, "num_irows"); + check_fits_in_unsigned(num_orows, "num_orows"); + check_fits_in_unsigned(row_size, "row_size"); + + + dim3 threads(std::min(512, int(num_irows))); + int64_t maxGridDim = at::cuda::getCurrentDeviceProperties()->maxGridSize[1]; + dim3 grid(std::min(maxGridDim, num_orows), std::min(maxGridDim, ceil_div(num_irows, int64_t{threads.x}))); + tensor_kernel_scan_outer_dim_with_indices<<>>( + self.const_data_ptr(), values.mutable_data_ptr(), indices.mutable_data_ptr(), + num_orows, num_irows, row_size, init, binary_op); + C10_CUDA_KERNEL_LAUNCH_CHECK(); +} + +template +__host__ void scan_innermost_dim_with_indices( + const TensorBase& self, const TensorBase& values, const TensorBase& indices, + scalar_t init, BinaryFunction binary_op) { + int ndim = self.dim(); + // Treat all outer dimensions as a single dimension. + int row_size = self.size(ndim - 1); + int num_rows = self.numel() / row_size; + + // assuming max_num_threads per block is 512 + const uint32_t num_threads = 512; + const uint32_t log_num_threads_x = get_log_num_threads_x_inner_scan(num_rows, row_size); + const uint32_t num_threads_x = (1 << log_num_threads_x); + const uint32_t num_threads_y = num_threads / num_threads_x; + dim3 threads(num_threads_x, num_threads_y); + dim3 grid(std::min(at::cuda::getCurrentDeviceProperties()->maxGridSize[0], ceil_div(num_rows, int(threads.y)))); + + const uint32_t mem_size = 2 * num_threads * (sizeof(scalar_t) + sizeof(int64_t)); + tensor_kernel_scan_innermost_dim_with_indices<<>>( + self.const_data_ptr(), values.mutable_data_ptr(), indices.mutable_data_ptr(), + num_rows, row_size, num_threads, log_num_threads_x, init, binary_op); + C10_CUDA_KERNEL_LAUNCH_CHECK(); +} + +template +void scan_dim_with_indices(const TensorBase& self, const TensorBase& values, const TensorBase& indices, //int64_t dim) { + int64_t dim, scalar_t init, BinaryFunction binary_op) { + int ndim = self.dim(); + auto self_ = self.expect_contiguous(); + TORCH_INTERNAL_ASSERT(values.is_contiguous() && indices.is_contiguous()); + if (dim == ndim - 1) { + scan_innermost_dim_with_indices(*self_, values, indices, init, binary_op); + } else { + scan_outer_dim_with_indices(*self_, values, indices, dim, init, binary_op); + } +} + +// TODO: The implementation of `tensor_kernel_scan_outer_dim` and +// `tensor_kernel_scan_innermost_dim` is similar to +// `tensor_kernel_scan_outer_dim_with_indices` +// `tensor_kernel_scan_outer_dim_with_indices` and should be refactored to +// remove the duplication. + +/* Perform an inclusive scan along an outer dimension of a tensor. + * + * - num_orows is the size of the flattened outer dimensions; + * - num_irows is the size of the flattened inner dimensions; + * - row_size is the size of the dimension along which to scan; + * + * The dimensions to the outside and inside of the specified dimension are considered as flattened. + * Thread blocks with the same blockIdx.y process an "outer row" (i.e. an element of the flattened + * outer dimensions, which contains several "inner rows"). + * Each thread processes a single inner row at a time. + */ +template +__global__ void tensor_kernel_scan_outer_dim(scalar_t *tgt_, const scalar_t *src_, + const uint32_t num_orows, const uint32_t num_irows, const uint32_t row_size, + const scalar_t init, BinaryOp binary_op) +{ + for (uint32_t orow = blockIdx.x; orow < num_orows; orow += gridDim.x) { + for (uint32_t irow = blockIdx.y * blockDim.x + threadIdx.x; irow < num_irows; irow += gridDim.y * blockDim.x) { + const scalar_t *src = src_ + orow * row_size * num_irows + irow; + scalar_t *tgt = tgt_ + orow * row_size * num_irows + irow; + scalar_t acc = init; + + for (uint32_t col = 0; col < row_size; ++col) { + acc = binary_op(acc, c10::load(src)); + *tgt = acc; + + src += num_irows; + tgt += num_irows; + } + } + } +} + +/* Perform an inclusive scan along the innermost dimension of a tensor. + * + * - num_rows is the size of the flattened outer dimensions; + * - row_size is the size of the innermost dimension; + * + * The outer dimensions of the tensor are considered as a single dimension, i.e. the tensor is + * considered as having 'num_rows' rows of size 'row_size'. + * Each thread block processes one or more sets of contiguous rows (processing multiple rows + * per thread block is quicker than processing a single row, especially for short rows). + */ +template +__device__ void tensor_kernel_scan_innermost_dim_impl(T* row_buf, T *tgt_, const T *src_, + const uint32_t num_rows, const uint32_t row_size, + const uint32_t log_num_threads_x, + T init, BinaryFunction binary_op){ + const uint32_t num_threads_x = 1 << log_num_threads_x; + for (uint32_t block_row = blockIdx.x * blockDim.y; + block_row < num_rows; + block_row += blockDim.y * gridDim.x) { + uint32_t row = block_row + threadIdx.y; + T block_total = init; + + const T *row_src = src_ + row * row_size; + T *row_tgt = tgt_ + row * row_size; + const bool row_exists = row < num_rows; + + // Perform scan on one block at a time, keeping track of the total value of + // all blocks processed so far. + for (uint32_t block_col = 0; block_col < row_size; block_col += 2 * num_threads_x) { + // Load data into shared memory (two values per thread). + uint32_t col1 = block_col + threadIdx.x; + uint32_t col2 = block_col + num_threads_x + threadIdx.x; + if (row_exists) { + if (col1 < row_size) { + row_buf[threadIdx.x] = row_src[col1]; + } else { + row_buf[threadIdx.x] = init; + } + + if (col2 < row_size) { + row_buf[num_threads_x + threadIdx.x] = row_src[col2]; + } else { + row_buf[num_threads_x + threadIdx.x] = init; + } + + // Add the total value of all previous blocks to the first value of this block. + if (threadIdx.x == 0) { + row_buf[0] = binary_op(row_buf[0], block_total); + } + } + __syncthreads(); + + // Parallel reduction with Sklansky method. The diagram can be seen on this paper: + // https://research.nvidia.com/publication/single-pass-parallel-prefix-scan-decoupled-look-back + for (uint32_t m = 0; m <= log_num_threads_x; ++m) { + if (row_exists) { + uint32_t s = 1 << m; // s = 2 ^ m + uint32_t a = ((threadIdx.x >> m) << (m + 1)) | s; // a = (threadIdx.x / s) * (2 * s) + s + uint32_t ti = a + (threadIdx.x % s); + uint32_t si = a - 1; + row_buf[ti] = binary_op(row_buf[ti], row_buf[si]); + } + __syncthreads(); + } + + // Write back to output. + if (row_exists) { + if (col1 < row_size) row_tgt[col1] = row_buf[threadIdx.x]; + if (col2 < row_size) row_tgt[col2] = row_buf[num_threads_x + threadIdx.x]; + } + block_total = row_buf[2 * num_threads_x - 1]; + __syncthreads(); + } + } +} + +template < + typename T, + class BinaryFunction> +__global__ void tensor_kernel_scan_innermost_dim( + T* tgt_, + const T* src_, + const uint32_t num_rows, + const uint32_t row_size, + const uint32_t log_num_threads_x, + T init, + BinaryFunction binary_op) { + alignas(sizeof(double)) extern __shared__ char sbuf[]; + T* sbuf2 = reinterpret_cast(sbuf); + const uint32_t num_threads_x = 1 << log_num_threads_x; + T* row_buf = reinterpret_cast(sbuf2 + num_threads_x * 2 * threadIdx.y); + + tensor_kernel_scan_innermost_dim_impl( + row_buf, tgt_, src_, num_rows, row_size, log_num_threads_x, init, binary_op); +} + + +template +__host__ void scan_outer_dim(const TensorBase& self, const TensorBase& result, + int dim, scalar_t init, BinaryFunction binary_op) { + const int64_t row_size = self.size(dim); + auto sizes = self.sizes(); + + // Treat all outer dimensions (i.e. dim_ < dim) as one. + const int64_t num_orows = c10::multiply_integers(sizes.begin(), sizes.begin() + dim); + + // Treat all inner dimensions (i.e. dim > dimension) as one. + const int64_t num_irows = c10::multiply_integers(sizes.begin() + dim + 1, sizes.end()); + + dim3 threads(std::min(512, int(num_irows))); + int64_t maxGridDim = at::cuda::getCurrentDeviceProperties()->maxGridSize[1]; + dim3 grid(std::min(maxGridDim, num_orows), std::min(maxGridDim, ceil_div(num_irows, int64_t{threads.x}))); + + check_fits_in_unsigned(num_irows, "num_irows"); + check_fits_in_unsigned(num_orows, "num_orows"); + check_fits_in_unsigned(row_size, "row_size"); + + tensor_kernel_scan_outer_dim<<>>( + result.mutable_data_ptr(), self.const_data_ptr(), + num_orows, num_irows, row_size, init, binary_op); + C10_CUDA_KERNEL_LAUNCH_CHECK(); +} + +template +void scan_innermost_dim(const TensorBase& self, const TensorBase& result, + scalar_t init, BinaryFunction binary_op) { + int64_t ndim = self.dim(); + // Treat all outer dimensions as a single dimension. + int64_t row_size = self.size(ndim - 1); + int64_t num_rows = self.numel() / row_size; + + // assuming max_num_threads per block is 512 + const uint32_t num_threads = 512; + const uint32_t log_num_threads_x = get_log_num_threads_x_inner_scan(num_rows, row_size); + const uint32_t num_threads_x = (1 << log_num_threads_x); + const uint32_t num_threads_y = num_threads / num_threads_x; + dim3 threads(num_threads_x, num_threads_y); + int64_t maxGridDim = at::cuda::getCurrentDeviceProperties()->maxGridSize[0]; + dim3 grid(std::min(maxGridDim, ceil_div(num_rows, int64_t{threads.y}))); + + check_fits_in_unsigned(num_rows, "Number of rows (self.numel()/self.size(self.dim()-1))"); + check_fits_in_unsigned(row_size, "row_size"); + + tensor_kernel_scan_innermost_dim<<>>( + result.mutable_data_ptr(), self.const_data_ptr(), + num_rows, row_size, log_num_threads_x, init, binary_op); + C10_CUDA_KERNEL_LAUNCH_CHECK(); +} + +template +void scan_dim(const TensorBase& self, const TensorBase& result, + int64_t dim, scalar_t init, BinaryFunction binary_op) { + int ndim = self.dim(); + auto self_ = self.expect_contiguous(); + TORCH_INTERNAL_ASSERT(result.is_contiguous()); + + if (self.numel() == self.size(dim)) { + cuda::cub::inclusive_scan(self_->const_data_ptr(), result.mutable_data_ptr(), binary_op, self.numel()); + } else if (dim == ndim - 1) { + scan_innermost_dim(*self_, result, init, binary_op); + } else { + scan_outer_dim(*self_, result, dim, init, binary_op); + } +} + +}} // namespace at::native diff --git a/shared/package-files/07/07f9686ba2e1e2ac6dc19d87e5ce2a37547b7ac85b6ab19498988e54f65c1143/blob b/shared/package-files/07/07f9686ba2e1e2ac6dc19d87e5ce2a37547b7ac85b6ab19498988e54f65c1143/blob new file mode 100644 index 0000000000000000000000000000000000000000..4f4b1c290687e0c8eebb5f918b5107559c5bfca7 --- /dev/null +++ b/shared/package-files/07/07f9686ba2e1e2ac6dc19d87e5ce2a37547b7ac85b6ab19498988e54f65c1143/blob @@ -0,0 +1,238 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""macOS specific tests.""" + +import re +import time + +import psutil +from psutil import MACOS +from psutil import POSIX +from psutil.tests import HAS_BATTERY +from psutil.tests import TOLERANCE_DISK_USAGE +from psutil.tests import TOLERANCE_SYS_MEM +from psutil.tests import PsutilTestCase +from psutil.tests import retry_on_failure +from psutil.tests import sh +from psutil.tests import spawn_testproc +from psutil.tests import terminate +from psutil.tests import unittest + + +if POSIX: + from psutil._psutil_posix import getpagesize + + +def sysctl(cmdline): + """Expects a sysctl command with an argument and parse the result + returning only the value of interest. + """ + out = sh(cmdline) + result = out.split()[1] + try: + return int(result) + except ValueError: + return result + + +def vm_stat(field): + """Wrapper around 'vm_stat' cmdline utility.""" + out = sh('vm_stat') + for line in out.split('\n'): + if field in line: + break + else: + raise ValueError("line not found") + return int(re.search(r'\d+', line).group(0)) * getpagesize() + + +# http://code.activestate.com/recipes/578019/ +def human2bytes(s): + SYMBOLS = { + 'customary': ('B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'), + } + init = s + num = "" + while s and s[0:1].isdigit() or s[0:1] == '.': + num += s[0] + s = s[1:] + num = float(num) + letter = s.strip() + for name, sset in SYMBOLS.items(): + if letter in sset: + break + else: + if letter == 'k': + sset = SYMBOLS['customary'] + letter = letter.upper() + else: + raise ValueError("can't interpret %r" % init) + prefix = {sset[0]: 1} + for i, s in enumerate(sset[1:]): + prefix[s] = 1 << (i + 1) * 10 + return int(num * prefix[letter]) + + +@unittest.skipIf(not MACOS, "MACOS only") +class TestProcess(PsutilTestCase): + + @classmethod + def setUpClass(cls): + cls.pid = spawn_testproc().pid + + @classmethod + def tearDownClass(cls): + terminate(cls.pid) + + def test_process_create_time(self): + output = sh("ps -o lstart -p %s" % self.pid) + start_ps = output.replace('STARTED', '').strip() + hhmmss = start_ps.split(' ')[-2] + year = start_ps.split(' ')[-1] + start_psutil = psutil.Process(self.pid).create_time() + self.assertEqual( + hhmmss, + time.strftime("%H:%M:%S", time.localtime(start_psutil))) + self.assertEqual( + year, + time.strftime("%Y", time.localtime(start_psutil))) + + +@unittest.skipIf(not MACOS, "MACOS only") +class TestSystemAPIs(PsutilTestCase): + + # --- disk + + @retry_on_failure() + def test_disks(self): + # test psutil.disk_usage() and psutil.disk_partitions() + # against "df -a" + def df(path): + out = sh('df -k "%s"' % path).strip() + lines = out.split('\n') + lines.pop(0) + line = lines.pop(0) + dev, total, used, free = line.split()[:4] + if dev == 'none': + dev = '' + total = int(total) * 1024 + used = int(used) * 1024 + free = int(free) * 1024 + return dev, total, used, free + + for part in psutil.disk_partitions(all=False): + usage = psutil.disk_usage(part.mountpoint) + dev, total, used, free = df(part.mountpoint) + self.assertEqual(part.device, dev) + self.assertEqual(usage.total, total) + self.assertAlmostEqual(usage.free, free, + delta=TOLERANCE_DISK_USAGE) + self.assertAlmostEqual(usage.used, used, + delta=TOLERANCE_DISK_USAGE) + + # --- cpu + + def test_cpu_count_logical(self): + num = sysctl("sysctl hw.logicalcpu") + self.assertEqual(num, psutil.cpu_count(logical=True)) + + def test_cpu_count_cores(self): + num = sysctl("sysctl hw.physicalcpu") + self.assertEqual(num, psutil.cpu_count(logical=False)) + + def test_cpu_freq(self): + freq = psutil.cpu_freq() + self.assertEqual( + freq.current * 1000 * 1000, sysctl("sysctl hw.cpufrequency")) + self.assertEqual( + freq.min * 1000 * 1000, sysctl("sysctl hw.cpufrequency_min")) + self.assertEqual( + freq.max * 1000 * 1000, sysctl("sysctl hw.cpufrequency_max")) + + # --- virtual mem + + def test_vmem_total(self): + sysctl_hwphymem = sysctl('sysctl hw.memsize') + self.assertEqual(sysctl_hwphymem, psutil.virtual_memory().total) + + @retry_on_failure() + def test_vmem_free(self): + vmstat_val = vm_stat("free") + psutil_val = psutil.virtual_memory().free + self.assertAlmostEqual(psutil_val, vmstat_val, delta=TOLERANCE_SYS_MEM) + + @retry_on_failure() + def test_vmem_active(self): + vmstat_val = vm_stat("active") + psutil_val = psutil.virtual_memory().active + self.assertAlmostEqual(psutil_val, vmstat_val, delta=TOLERANCE_SYS_MEM) + + @retry_on_failure() + def test_vmem_inactive(self): + vmstat_val = vm_stat("inactive") + psutil_val = psutil.virtual_memory().inactive + self.assertAlmostEqual(psutil_val, vmstat_val, delta=TOLERANCE_SYS_MEM) + + @retry_on_failure() + def test_vmem_wired(self): + vmstat_val = vm_stat("wired") + psutil_val = psutil.virtual_memory().wired + self.assertAlmostEqual(psutil_val, vmstat_val, delta=TOLERANCE_SYS_MEM) + + # --- swap mem + + @retry_on_failure() + def test_swapmem_sin(self): + vmstat_val = vm_stat("Pageins") + psutil_val = psutil.swap_memory().sin + self.assertEqual(psutil_val, vmstat_val) + + @retry_on_failure() + def test_swapmem_sout(self): + vmstat_val = vm_stat("Pageout") + psutil_val = psutil.swap_memory().sout + self.assertEqual(psutil_val, vmstat_val) + + # Not very reliable. + # def test_swapmem_total(self): + # out = sh('sysctl vm.swapusage') + # out = out.replace('vm.swapusage: ', '') + # total, used, free = re.findall('\d+.\d+\w', out) + # psutil_smem = psutil.swap_memory() + # self.assertEqual(psutil_smem.total, human2bytes(total)) + # self.assertEqual(psutil_smem.used, human2bytes(used)) + # self.assertEqual(psutil_smem.free, human2bytes(free)) + + # --- network + + def test_net_if_stats(self): + for name, stats in psutil.net_if_stats().items(): + try: + out = sh("ifconfig %s" % name) + except RuntimeError: + pass + else: + self.assertEqual(stats.isup, 'RUNNING' in out, msg=out) + self.assertEqual(stats.mtu, + int(re.findall(r'mtu (\d+)', out)[0])) + + # --- sensors_battery + + @unittest.skipIf(not HAS_BATTERY, "no battery") + def test_sensors_battery(self): + out = sh("pmset -g batt") + percent = re.search(r"(\d+)%", out).group(1) + drawing_from = re.search("Now drawing from '([^']+)'", out).group(1) + power_plugged = drawing_from == "AC Power" + psutil_result = psutil.sensors_battery() + self.assertEqual(psutil_result.power_plugged, power_plugged) + self.assertEqual(psutil_result.percent, int(percent)) + + +if __name__ == '__main__': + from psutil.tests.runner import run_from_name + run_from_name(__file__) diff --git a/shared/package-files/07/07fbafb8a5370c5442c63a644fcaa71a864146e91326eb8acbbbfe789b85da05/blob b/shared/package-files/07/07fbafb8a5370c5442c63a644fcaa71a864146e91326eb8acbbbfe789b85da05/blob new file mode 100644 index 0000000000000000000000000000000000000000..8a00740618fe20ea073354ac1ee433cd86810bd0 --- /dev/null +++ b/shared/package-files/07/07fbafb8a5370c5442c63a644fcaa71a864146e91326eb8acbbbfe789b85da05/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _propagate_xla_data { + using schema = void (const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_propagate_xla_data") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_propagate_xla_data(Tensor input, Tensor output) -> ()") + static void call(const at::Tensor & input, const at::Tensor & output); + static void redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & input, const at::Tensor & output); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/07/07fd46e5e47e968aaaf1d459679dc8d19d0407c5ff7060e48f23d6012d6f0349/blob b/shared/package-files/07/07fd46e5e47e968aaaf1d459679dc8d19d0407c5ff7060e48f23d6012d6f0349/blob new file mode 100644 index 0000000000000000000000000000000000000000..aa6b989719311c1d4eb73cc538e20e7ce798f219 --- /dev/null +++ b/shared/package-files/07/07fd46e5e47e968aaaf1d459679dc8d19d0407c5ff7060e48f23d6012d6f0349/blob @@ -0,0 +1,469 @@ +SCHWERTSP500 +15.66 +15.43 +15.17 +14.58 +14.45 +15.21 +15.76 +15.32 +15.11 +15.43 +14.99 +15.3 +14.69 +14 +15.08 +15.48 +16.69 +16.74 +15.85 +15.97 +15.49 +16.54 +14.75 +15.2 +15.22 +14.62 +15.06 +14.74 +14.19 +14.16 +15.04 +15.22 +15.58 +16.04 +16.06 +16.76 +17.05 +17.22 +17.29 +18.07 +18.78 +17.69 +17.84 +18.42 +19.45 +19.53 +19.51 +20.41 +21.66 +21.8 +21.4 +22.43 +21.52 +20.96 +22.4 +23.28 +23.26 +22.94 +22.88 +23.77 +24.14 +23.26 +24.37 +23.32 +23.86 +24.96 +25.4 +25.03 +24.54 +24.52 +25.66 +26.57 +26.38 +25.9 +25.29 +24.62 +24.54 +24.14 +24.75 +23.32 +23.35 +24.54 +24.76 +24.81 +26.08 +26.15 +26.94 +28.26 +29.19 +29.21 +30.88 +29.83 +32.31 +31.68 +34.24 +35.98 +36.63 +36.76 +36.58 +37.96 +37.91 +41.03 +43.52 +43.18 +43.67 +42.34 +45.51 +45.48 +43.82 +45.34 +48.48 +48.38 +45.2 +46.97 +49.39 +47.51 +45.35 +45.58 +45.08 +46.67 +44.72 +43.26 +44.11 +45.74 +47.43 +47.37 +47.91 +45.22 +42.42 +41.06 +41.72 +39.99 +41.7 +40.84 +42.1 +43.44 +44.09 +45.24 +47.19 +47.75 +50.06 +51.33 +52.48 +55.21 +55.42 +55.41 +55.44 +57.59 +58.68 +58.47 +60.51 +59.6 +56.88 +57.52 +58.28 +59.89 +55.61 +56.12 +55.34 +54.37 +55.83 +56.92 +55.51 +56.96 +53.52 +53.39 +55.54 +58.11 +61.78 +63.44 +65.06 +65.31 +66.56 +64.64 +66.76 +68.07 +66.73 +68.62 +71.32 +71.55 +68.84 +69.96 +69.55 +65.24 +59.63 +54.75 +58.23 +59.12 +56.27 +56.52 +62.26 +63.1 +66.2 +64.29 +66.57 +69.8 +70.8 +69.37 +69.13 +72.5 +71.7 +74.01 +73.23 +75.02 +77.04 +77.8 +78.98 +79.46 +80.37 +81.69 +83.18 +81.83 +84.18 +84.86 +84.42 +84.75 +87.56 +87.43 +86.16 +89.11 +88.42 +84.12 +85.25 +87.17 +89.96 +92.42 +91.61 +92.43 +92.88 +91.22 +89.23 +91.06 +86.13 +84.74 +83.6 +77.1 +76.56 +80.2 +80.45 +80.33 +86.61 +86.78 +90.2 +94.01 +89.08 +90.64 +94.75 +93.64 +96.71 +93.9 +94 +96.47 +92.24 +89.36 +90.2 +97.59 +98.68 +99.58 +97.74 +98.86 +102.67 +103.41 +108.37 +103.86 +103.01 +98.13 +101.51 +103.69 +103.46 +97.71 +91.83 +95.51 +93.12 +97.24 +93.81 +92.06 +85.02 +89.5 +89.63 +81.52 +76.55 +72.72 +78.05 +81.52 +84.21 +83.25 +87.2 +92.15 +95.88 +96.75 +100.31 +103.95 +99.63 +99.7 +95.58 +99.03 +98.34 +94.23 +93.99 +102.09 +103.94 +106.57 +107.2 +107.67 +109.53 +107.14 +107.39 +111.09 +110.55 +111.58 +116.67 +118.05 +116.03 +111.68 +111.52 +106.97 +104.95 +104.26 +108.22 +104.25 +108.43 +108.29 +95.96 +97.55 +96.57 +96.22 +93.98 +90.31 +87.28 +86 +79.31 +72.15 +63.54 +73.9 +69.97 +68.56 +76.98 +81.59 +83.36 +87.3 +91.15 +95.19 +88.75 +86.88 +83.87 +89.04 +91.24 +90.19 +100.86 +99.71 +102.77 +101.64 +100.18 +104.28 +103.44 +102.91 +105.24 +102.9 +102.1 +107.46 +102.03 +99.82 +98.42 +98.44 +96.12 +100.48 +98.85 +96.77 +96.53 +92.34 +94.83 +95.1 +89.25 +87.04 +89.21 +96.83 +97.24 +95.53 +100.68 +103.29 +102.54 +93.15 +94.7 +96.11 +99.93 +96.28 +101.59 +101.76 +99.08 +102.91 +103.81 +109.32 +109.32 +101.82 +106.16 +107.94 +114.16 +113.66 +102.09 +106.29 +111.24 +114.24 +121.67 +122.38 +125.46 +127.47 +140.52 +135.76 +129.55 +131.27 +136 +132.81 +132.59 +131.21 +130.92 +122.79 +116.18 +121.89 +126.35 +122.55 +120.4 +113.11 +111.96 +116.44 +111.88 +109.61 +107.09 +119.51 +120.42 +133.71 +138.54 +140.64 +145.3 +148.06 +152.96 +164.42 +162.39 +168.11 +162.56 +164.4 +166.07 +163.55 +166.4 +164.93 +163.41 +157.06 +159.18 +160.05 +150.55 +153.18 +150.66 +166.68 +166.1 +166.09 +163.58 +167.24 +179.63 +181.18 +180.66 +179.83 +189.55 +191.85 +190.92 +188.63 +182.08 +189.82 +202.17 +211.28 diff --git a/shared/package-files/07/07fe7eac4bcda380db95289f2e875fdce55511cddb4c6b0862aa9a41d53fe13c/blob b/shared/package-files/07/07fe7eac4bcda380db95289f2e875fdce55511cddb4c6b0862aa9a41d53fe13c/blob new file mode 100644 index 0000000000000000000000000000000000000000..8fcce3e5d63ba727efc2cdd18d8a8565b974bac2 --- /dev/null +++ b/shared/package-files/07/07fe7eac4bcda380db95289f2e875fdce55511cddb4c6b0862aa9a41d53fe13c/blob @@ -0,0 +1,102 @@ +from matplotlib import cbook, colorbar, colors, artist + +from typing import overload +import numpy as np +from numpy.typing import ArrayLike + + +class Colorizer: + colorbar: colorbar.Colorbar | None + callbacks: cbook.CallbackRegistry + def __init__( + self, + cmap: str | colors.Colormap | None = ..., + norm: str | colors.Normalize | None = ..., + ) -> None: ... + @property + def norm(self) -> colors.Normalize: ... + @norm.setter + def norm(self, norm: colors.Normalize | str | None) -> None: ... + def to_rgba( + self, + x: np.ndarray, + alpha: float | ArrayLike | None = ..., + bytes: bool = ..., + norm: bool = ..., + ) -> np.ndarray: ... + def autoscale(self, A: ArrayLike) -> None: ... + def autoscale_None(self, A: ArrayLike) -> None: ... + @property + def cmap(self) -> colors.Colormap: ... + @cmap.setter + def cmap(self, cmap: colors.Colormap | str | None) -> None: ... + def get_clim(self) -> tuple[float, float]: ... + def set_clim(self, vmin: float | tuple[float, float] | None = ..., vmax: float | None = ...) -> None: ... + def changed(self) -> None: ... + @property + def vmin(self) -> float | None: ... + @vmin.setter + def vmin(self, value: float | None) -> None: ... + @property + def vmax(self) -> float | None: ... + @vmax.setter + def vmax(self, value: float | None) -> None: ... + @property + def clip(self) -> bool: ... + @clip.setter + def clip(self, value: bool) -> None: ... + + +class _ColorizerInterface: + cmap: colors.Colormap + colorbar: colorbar.Colorbar | None + callbacks: cbook.CallbackRegistry + def to_rgba( + self, + x: np.ndarray, + alpha: float | ArrayLike | None = ..., + bytes: bool = ..., + norm: bool = ..., + ) -> np.ndarray: ... + def get_clim(self) -> tuple[float, float]: ... + def set_clim(self, vmin: float | tuple[float, float] | None = ..., vmax: float | None = ...) -> None: ... + def get_alpha(self) -> float | None: ... + def get_cmap(self) -> colors.Colormap: ... + def set_cmap(self, cmap: str | colors.Colormap) -> None: ... + @property + def norm(self) -> colors.Normalize: ... + @norm.setter + def norm(self, norm: colors.Normalize | str | None) -> None: ... + def set_norm(self, norm: colors.Normalize | str | None) -> None: ... + def autoscale(self) -> None: ... + def autoscale_None(self) -> None: ... + + +class _ScalarMappable(_ColorizerInterface): + def __init__( + self, + norm: colors.Normalize | None = ..., + cmap: str | colors.Colormap | None = ..., + *, + colorizer: Colorizer | None = ..., + **kwargs + ) -> None: ... + def set_array(self, A: ArrayLike | None) -> None: ... + def get_array(self) -> np.ndarray | None: ... + def changed(self) -> None: ... + + +class ColorizingArtist(_ScalarMappable, artist.Artist): + callbacks: cbook.CallbackRegistry + def __init__( + self, + colorizer: Colorizer, + **kwargs + ) -> None: ... + def set_array(self, A: ArrayLike | None) -> None: ... + def get_array(self) -> np.ndarray | None: ... + def changed(self) -> None: ... + @property + def colorizer(self) -> Colorizer: ... + @colorizer.setter + def colorizer(self, cl: Colorizer) -> None: ... diff --git a/shared/package-files/08/0802392a2a1c49abdd877f290daf0f0f7ed8670051c793672ff8e3dd167c860d/blob b/shared/package-files/08/0802392a2a1c49abdd877f290daf0f0f7ed8670051c793672ff8e3dd167c860d/blob new file mode 100644 index 0000000000000000000000000000000000000000..be8e79e8d780c2e3a5e63639831f83c54620018d --- /dev/null +++ b/shared/package-files/08/0802392a2a1c49abdd877f290daf0f0f7ed8670051c793672ff8e3dd167c860d/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & _sparse_softmax_out(at::Tensor & out, const at::Tensor & self, int64_t dim, bool half_to_float); +TORCH_API at::Tensor & _sparse_softmax_outf(const at::Tensor & self, int64_t dim, bool half_to_float, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/08/0804f97f44e90cf73c86fa4f1e86e3db2fb8d71b900e393777574d99d8937828/blob b/shared/package-files/08/0804f97f44e90cf73c86fa4f1e86e3db2fb8d71b900e393777574d99d8937828/blob new file mode 100644 index 0000000000000000000000000000000000000000..ebfb01d12e3acbbb31d79a3a0573f39884cac6bb --- /dev/null +++ b/shared/package-files/08/0804f97f44e90cf73c86fa4f1e86e3db2fb8d71b900e393777574d99d8937828/blob @@ -0,0 +1,563 @@ +""" +Testing for Neighborhood Component Analysis module (sklearn.neighbors.nca) +""" + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +import re + +import numpy as np +import pytest +from numpy.testing import assert_array_almost_equal, assert_array_equal +from scipy.optimize import check_grad + +from sklearn import clone +from sklearn.datasets import load_iris, make_blobs, make_classification +from sklearn.exceptions import ConvergenceWarning +from sklearn.metrics import pairwise_distances +from sklearn.neighbors import NeighborhoodComponentsAnalysis +from sklearn.preprocessing import LabelEncoder +from sklearn.utils import check_random_state +from sklearn.utils.validation import validate_data + +rng = check_random_state(0) +# Load and shuffle the iris dataset. +iris = load_iris() +perm = rng.permutation(iris.target.size) +iris_data = iris.data[perm] +iris_target = iris.target[perm] +# Avoid having test data introducing dependencies between tests. +iris_data.flags.writeable = False +iris_target.flags.writeable = False +EPS = np.finfo(float).eps + + +def test_simple_example(): + """Test on a simple example. + + Puts four points in the input space where the opposite labels points are + next to each other. After transform the samples from the same class + should be next to each other. + + """ + X = np.array([[0, 0], [0, 1], [2, 0], [2, 1]]) + y = np.array([1, 0, 1, 0]) + nca = NeighborhoodComponentsAnalysis( + n_components=2, init="identity", random_state=42 + ) + nca.fit(X, y) + X_t = nca.transform(X) + assert_array_equal(pairwise_distances(X_t).argsort()[:, 1], np.array([2, 3, 0, 1])) + + +def test_toy_example_collapse_points(): + """Test on a toy example of three points that should collapse + + We build a simple example: two points from the same class and a point from + a different class in the middle of them. On this simple example, the new + (transformed) points should all collapse into one single point. Indeed, the + objective is 2/(1 + exp(d/2)), with d the euclidean distance between the + two samples from the same class. This is maximized for d=0 (because d>=0), + with an objective equal to 1 (loss=-1.). + + """ + rng = np.random.RandomState(42) + input_dim = 5 + two_points = rng.randn(2, input_dim) + X = np.vstack([two_points, two_points.mean(axis=0)[np.newaxis, :]]) + y = [0, 0, 1] + + class LossStorer: + def __init__(self, X, y): + self.loss = np.inf # initialize the loss to very high + # Initialize a fake NCA and variables needed to compute the loss: + self.fake_nca = NeighborhoodComponentsAnalysis() + self.fake_nca.n_iter_ = np.inf + self.X, y = validate_data(self.fake_nca, X, y, ensure_min_samples=2) + y = LabelEncoder().fit_transform(y) + self.same_class_mask = y[:, np.newaxis] == y[np.newaxis, :] + + def callback(self, transformation, n_iter): + """Stores the last value of the loss function""" + self.loss, _ = self.fake_nca._loss_grad_lbfgs( + transformation, self.X, self.same_class_mask, -1.0 + ) + + loss_storer = LossStorer(X, y) + nca = NeighborhoodComponentsAnalysis(random_state=42, callback=loss_storer.callback) + X_t = nca.fit_transform(X, y) + print(X_t) + # test that points are collapsed into one point + assert_array_almost_equal(X_t - X_t[0], 0.0) + assert abs(loss_storer.loss + 1) < 1e-10 + + +def test_finite_differences(global_random_seed): + """Test gradient of loss function + + Assert that the gradient is almost equal to its finite differences + approximation. + """ + # Initialize the transformation `M`, as well as `X` and `y` and `NCA` + rng = np.random.RandomState(global_random_seed) + X, y = make_classification(random_state=global_random_seed) + M = rng.randn(rng.randint(1, X.shape[1] + 1), X.shape[1]) + nca = NeighborhoodComponentsAnalysis() + nca.n_iter_ = 0 + mask = y[:, np.newaxis] == y[np.newaxis, :] + + def fun(M): + return nca._loss_grad_lbfgs(M, X, mask)[0] + + def grad(M): + return nca._loss_grad_lbfgs(M, X, mask)[1] + + # compare the gradient to a finite difference approximation + diff = check_grad(fun, grad, M.ravel()) + assert diff == pytest.approx(0.0, abs=1e-4) + + +def test_params_validation(): + # Test that invalid parameters raise value error + X = np.arange(12).reshape(4, 3) + y = [1, 1, 2, 2] + NCA = NeighborhoodComponentsAnalysis + rng = np.random.RandomState(42) + + init = rng.rand(5, 3) + msg = ( + f"The output dimensionality ({init.shape[0]}) " + "of the given linear transformation `init` cannot be " + f"greater than its input dimensionality ({init.shape[1]})." + ) + with pytest.raises(ValueError, match=re.escape(msg)): + NCA(init=init).fit(X, y) + n_components = 10 + msg = ( + "The preferred dimensionality of the projected space " + f"`n_components` ({n_components}) cannot be greater " + f"than the given data dimensionality ({X.shape[1]})!" + ) + with pytest.raises(ValueError, match=re.escape(msg)): + NCA(n_components=n_components).fit(X, y) + + +def test_transformation_dimensions(): + X = np.arange(12).reshape(4, 3) + y = [1, 1, 2, 2] + + # Fail if transformation input dimension does not match inputs dimensions + transformation = np.array([[1, 2], [3, 4]]) + with pytest.raises(ValueError): + NeighborhoodComponentsAnalysis(init=transformation).fit(X, y) + + # Fail if transformation output dimension is larger than + # transformation input dimension + transformation = np.array([[1, 2], [3, 4], [5, 6]]) + # len(transformation) > len(transformation[0]) + with pytest.raises(ValueError): + NeighborhoodComponentsAnalysis(init=transformation).fit(X, y) + + # Pass otherwise + transformation = np.arange(9).reshape(3, 3) + NeighborhoodComponentsAnalysis(init=transformation).fit(X, y) + + +def test_n_components(): + rng = np.random.RandomState(42) + X = np.arange(12).reshape(4, 3) + y = [1, 1, 2, 2] + + init = rng.rand(X.shape[1] - 1, 3) + + # n_components = X.shape[1] != transformation.shape[0] + n_components = X.shape[1] + nca = NeighborhoodComponentsAnalysis(init=init, n_components=n_components) + msg = ( + "The preferred dimensionality of the projected space " + f"`n_components` ({n_components}) does not match the output " + "dimensionality of the given linear transformation " + f"`init` ({init.shape[0]})!" + ) + with pytest.raises(ValueError, match=re.escape(msg)): + nca.fit(X, y) + + # n_components > X.shape[1] + n_components = X.shape[1] + 2 + nca = NeighborhoodComponentsAnalysis(init=init, n_components=n_components) + msg = ( + "The preferred dimensionality of the projected space " + f"`n_components` ({n_components}) cannot be greater than " + f"the given data dimensionality ({X.shape[1]})!" + ) + with pytest.raises(ValueError, match=re.escape(msg)): + nca.fit(X, y) + + # n_components < X.shape[1] + nca = NeighborhoodComponentsAnalysis(n_components=2, init="identity") + nca.fit(X, y) + + +def test_init_transformation(): + rng = np.random.RandomState(42) + X, y = make_blobs(n_samples=30, centers=6, n_features=5, random_state=0) + + # Start learning from scratch + nca = NeighborhoodComponentsAnalysis(init="identity") + nca.fit(X, y) + + # Initialize with random + nca_random = NeighborhoodComponentsAnalysis(init="random") + nca_random.fit(X, y) + + # Initialize with auto + nca_auto = NeighborhoodComponentsAnalysis(init="auto") + nca_auto.fit(X, y) + + # Initialize with PCA + nca_pca = NeighborhoodComponentsAnalysis(init="pca") + nca_pca.fit(X, y) + + # Initialize with LDA + nca_lda = NeighborhoodComponentsAnalysis(init="lda") + nca_lda.fit(X, y) + + init = rng.rand(X.shape[1], X.shape[1]) + nca = NeighborhoodComponentsAnalysis(init=init) + nca.fit(X, y) + + # init.shape[1] must match X.shape[1] + init = rng.rand(X.shape[1], X.shape[1] + 1) + nca = NeighborhoodComponentsAnalysis(init=init) + msg = ( + f"The input dimensionality ({init.shape[1]}) of the given " + "linear transformation `init` must match the " + f"dimensionality of the given inputs `X` ({X.shape[1]})." + ) + with pytest.raises(ValueError, match=re.escape(msg)): + nca.fit(X, y) + + # init.shape[0] must be <= init.shape[1] + init = rng.rand(X.shape[1] + 1, X.shape[1]) + nca = NeighborhoodComponentsAnalysis(init=init) + msg = ( + f"The output dimensionality ({init.shape[0]}) of the given " + "linear transformation `init` cannot be " + f"greater than its input dimensionality ({init.shape[1]})." + ) + with pytest.raises(ValueError, match=re.escape(msg)): + nca.fit(X, y) + + # init.shape[0] must match n_components + init = rng.rand(X.shape[1], X.shape[1]) + n_components = X.shape[1] - 2 + nca = NeighborhoodComponentsAnalysis(init=init, n_components=n_components) + msg = ( + "The preferred dimensionality of the " + f"projected space `n_components` ({n_components}) " + "does not match the output dimensionality of the given " + f"linear transformation `init` ({init.shape[0]})!" + ) + with pytest.raises(ValueError, match=re.escape(msg)): + nca.fit(X, y) + + +@pytest.mark.parametrize("n_samples", [3, 5, 7, 11]) +@pytest.mark.parametrize("n_features", [3, 5, 7, 11]) +@pytest.mark.parametrize("n_classes", [5, 7, 11]) +@pytest.mark.parametrize("n_components", [3, 5, 7, 11]) +def test_auto_init(n_samples, n_features, n_classes, n_components): + # Test that auto choose the init as expected with every configuration + # of order of n_samples, n_features, n_classes and n_components. + rng = np.random.RandomState(42) + nca_base = NeighborhoodComponentsAnalysis( + init="auto", n_components=n_components, max_iter=1, random_state=rng + ) + if n_classes >= n_samples: + pass + # n_classes > n_samples is impossible, and n_classes == n_samples + # throws an error from lda but is an absurd case + else: + X = rng.randn(n_samples, n_features) + y = np.tile(range(n_classes), n_samples // n_classes + 1)[:n_samples] + if n_components > n_features: + # this would return a ValueError, which is already tested in + # test_params_validation + pass + else: + nca = clone(nca_base) + nca.fit(X, y) + if n_components <= min(n_classes - 1, n_features): + nca_other = clone(nca_base).set_params(init="lda") + elif n_components < min(n_features, n_samples): + nca_other = clone(nca_base).set_params(init="pca") + else: + nca_other = clone(nca_base).set_params(init="identity") + nca_other.fit(X, y) + assert_array_almost_equal(nca.components_, nca_other.components_) + + +def test_warm_start_validation(): + X, y = make_classification( + n_samples=30, + n_features=5, + n_classes=4, + n_redundant=0, + n_informative=5, + random_state=0, + ) + + nca = NeighborhoodComponentsAnalysis(warm_start=True, max_iter=5) + nca.fit(X, y) + + X_less_features, y = make_classification( + n_samples=30, + n_features=4, + n_classes=4, + n_redundant=0, + n_informative=4, + random_state=0, + ) + msg = ( + f"The new inputs dimensionality ({X_less_features.shape[1]}) " + "does not match the input dimensionality of the previously learned " + f"transformation ({nca.components_.shape[1]})." + ) + with pytest.raises(ValueError, match=re.escape(msg)): + nca.fit(X_less_features, y) + + +def test_warm_start_effectiveness(): + # A 1-iteration second fit on same data should give almost same result + # with warm starting, and quite different result without warm starting. + + nca_warm = NeighborhoodComponentsAnalysis(warm_start=True, random_state=0) + nca_warm.fit(iris_data, iris_target) + transformation_warm = nca_warm.components_ + nca_warm.max_iter = 1 + nca_warm.fit(iris_data, iris_target) + transformation_warm_plus_one = nca_warm.components_ + + nca_cold = NeighborhoodComponentsAnalysis(warm_start=False, random_state=0) + nca_cold.fit(iris_data, iris_target) + transformation_cold = nca_cold.components_ + nca_cold.max_iter = 1 + nca_cold.fit(iris_data, iris_target) + transformation_cold_plus_one = nca_cold.components_ + + diff_warm = np.sum(np.abs(transformation_warm_plus_one - transformation_warm)) + diff_cold = np.sum(np.abs(transformation_cold_plus_one - transformation_cold)) + assert diff_warm < 3.0, ( + "Transformer changed significantly after one " + "iteration even though it was warm-started." + ) + + assert diff_cold > diff_warm, ( + "Cold-started transformer changed less " + "significantly than warm-started " + "transformer after one iteration." + ) + + +@pytest.mark.parametrize( + "init_name", ["pca", "lda", "identity", "random", "precomputed"] +) +def test_verbose(init_name, capsys): + # assert there is proper output when verbose = 1, for every initialization + # except auto because auto will call one of the others + rng = np.random.RandomState(42) + X, y = make_blobs(n_samples=30, centers=6, n_features=5, random_state=0) + regexp_init = r"... done in \ *\d+\.\d{2}s" + msgs = { + "pca": "Finding principal components" + regexp_init, + "lda": "Finding most discriminative components" + regexp_init, + } + if init_name == "precomputed": + init = rng.randn(X.shape[1], X.shape[1]) + else: + init = init_name + nca = NeighborhoodComponentsAnalysis(verbose=1, init=init) + nca.fit(X, y) + out, _ = capsys.readouterr() + + # check output + lines = re.split("\n+", out) + # if pca or lda init, an additional line is printed, so we test + # it and remove it to test the rest equally among initializations + if init_name in ["pca", "lda"]: + assert re.match(msgs[init_name], lines[0]) + lines = lines[1:] + assert lines[0] == "[NeighborhoodComponentsAnalysis]" + header = "{:>10} {:>20} {:>10}".format("Iteration", "Objective Value", "Time(s)") + assert lines[1] == "[NeighborhoodComponentsAnalysis] {}".format(header) + assert lines[2] == "[NeighborhoodComponentsAnalysis] {}".format("-" * len(header)) + for line in lines[3:-2]: + # The following regex will match for instance: + # '[NeighborhoodComponentsAnalysis] 0 6.988936e+01 0.01' + assert re.match( + r"\[NeighborhoodComponentsAnalysis\] *\d+ *\d\.\d{6}e" + r"[+|-]\d+\ *\d+\.\d{2}", + line, + ) + assert re.match( + r"\[NeighborhoodComponentsAnalysis\] Training took\ *\d+\.\d{2}s\.", + lines[-2], + ) + assert lines[-1] == "" + + +def test_no_verbose(capsys): + # assert by default there is no output (verbose=0) + nca = NeighborhoodComponentsAnalysis() + nca.fit(iris_data, iris_target) + out, _ = capsys.readouterr() + # check output + assert out == "" + + +def test_singleton_class(): + X = iris_data.copy() + y = iris_target.copy() + + # one singleton class + singleton_class = 1 + (ind_singleton,) = np.where(y == singleton_class) + y[ind_singleton] = 2 + y[ind_singleton[0]] = singleton_class + + nca = NeighborhoodComponentsAnalysis(max_iter=30) + nca.fit(X, y) + + # One non-singleton class + (ind_1,) = np.where(y == 1) + (ind_2,) = np.where(y == 2) + y[ind_1] = 0 + y[ind_1[0]] = 1 + y[ind_2] = 0 + y[ind_2[0]] = 2 + + nca = NeighborhoodComponentsAnalysis(max_iter=30) + nca.fit(X, y) + + # Only singleton classes + (ind_0,) = np.where(y == 0) + (ind_1,) = np.where(y == 1) + (ind_2,) = np.where(y == 2) + X = X[[ind_0[0], ind_1[0], ind_2[0]]] + y = y[[ind_0[0], ind_1[0], ind_2[0]]] + + nca = NeighborhoodComponentsAnalysis(init="identity", max_iter=30) + nca.fit(X, y) + assert_array_equal(X, nca.transform(X)) + + +def test_one_class(): + X = iris_data[iris_target == 0] + y = iris_target[iris_target == 0] + + nca = NeighborhoodComponentsAnalysis( + max_iter=30, n_components=X.shape[1], init="identity" + ) + nca.fit(X, y) + assert_array_equal(X, nca.transform(X)) + + +def test_callback(capsys): + max_iter = 10 + + def my_cb(transformation, n_iter): + assert transformation.shape == (iris_data.shape[1] ** 2,) + rem_iter = max_iter - n_iter + print("{} iterations remaining...".format(rem_iter)) + + # assert that my_cb is called + nca = NeighborhoodComponentsAnalysis(max_iter=max_iter, callback=my_cb, verbose=1) + nca.fit(iris_data, iris_target) + out, _ = capsys.readouterr() + + # check output + assert "{} iterations remaining...".format(max_iter - 1) in out + + +def test_expected_transformation_shape(): + """Test that the transformation has the expected shape.""" + X = iris_data + y = iris_target + + class TransformationStorer: + def __init__(self, X, y): + # Initialize a fake NCA and variables needed to call the loss + # function: + self.fake_nca = NeighborhoodComponentsAnalysis() + self.fake_nca.n_iter_ = np.inf + self.X, y = validate_data(self.fake_nca, X, y, ensure_min_samples=2) + y = LabelEncoder().fit_transform(y) + self.same_class_mask = y[:, np.newaxis] == y[np.newaxis, :] + + def callback(self, transformation, n_iter): + """Stores the last value of the transformation taken as input by + the optimizer""" + self.transformation = transformation + + transformation_storer = TransformationStorer(X, y) + cb = transformation_storer.callback + nca = NeighborhoodComponentsAnalysis(max_iter=5, callback=cb) + nca.fit(X, y) + assert transformation_storer.transformation.size == X.shape[1] ** 2 + + +def test_convergence_warning(): + nca = NeighborhoodComponentsAnalysis(max_iter=2, verbose=1) + cls_name = nca.__class__.__name__ + msg = "[{}] NCA did not converge".format(cls_name) + with pytest.warns(ConvergenceWarning, match=re.escape(msg)): + nca.fit(iris_data, iris_target) + + +@pytest.mark.parametrize( + "param, value", + [ + ("n_components", np.int32(3)), + ("max_iter", np.int32(100)), + ("tol", np.float32(0.0001)), + ], +) +def test_parameters_valid_types(param, value): + # check that no error is raised when parameters have numpy integer or + # floating types. + nca = NeighborhoodComponentsAnalysis(**{param: value}) + + X = iris_data + y = iris_target + + nca.fit(X, y) + + +@pytest.mark.parametrize("n_components", [None, 2]) +def test_nca_feature_names_out(n_components): + """Check `get_feature_names_out` for `NeighborhoodComponentsAnalysis`. + + Non-regression test for: + https://github.com/scikit-learn/scikit-learn/issues/28293 + """ + + X = iris_data + y = iris_target + + est = NeighborhoodComponentsAnalysis(n_components=n_components).fit(X, y) + names_out = est.get_feature_names_out() + + class_name_lower = est.__class__.__name__.lower() + + if n_components is not None: + expected_n_features = n_components + else: + expected_n_features = X.shape[1] + + expected_names_out = np.array( + [f"{class_name_lower}{i}" for i in range(expected_n_features)], + dtype=object, + ) + + assert_array_equal(names_out, expected_names_out) diff --git a/shared/package-files/08/080568ed7a3da54d12410ffe081a28a8b6cc6948e0aae82daaf4145c07262eb3/blob b/shared/package-files/08/080568ed7a3da54d12410ffe081a28a8b6cc6948e0aae82daaf4145c07262eb3/blob new file mode 100644 index 0000000000000000000000000000000000000000..385c35d723cc7b97c07f7fadf827817b287165f5 --- /dev/null +++ b/shared/package-files/08/080568ed7a3da54d12410ffe081a28a8b6cc6948e0aae82daaf4145c07262eb3/blob @@ -0,0 +1,21 @@ +from typing import Any, Optional, Tuple, Type + +from django.http.request import HttpRequest + +from django.db import models + +SITE_CACHE: Any + +class SiteManager(models.Manager["Site"]): + def get_current(self, request: Optional[HttpRequest] = ...) -> Site: ... + def clear_cache(self) -> None: ... + def get_by_natural_key(self, domain: str) -> Site: ... + +class Site(models.Model): + objects: SiteManager + + domain = models.CharField(max_length=100) + name = models.CharField(max_length=50) + def natural_key(self) -> Tuple[str]: ... + +def clear_site_cache(sender: Type[Site], **kwargs: Any) -> None: ... diff --git a/shared/package-files/08/0806ef3662b840225106c5f6e7fca2d887bd241dfbc600ec6219a67b2dfe11ff/blob b/shared/package-files/08/0806ef3662b840225106c5f6e7fca2d887bd241dfbc600ec6219a67b2dfe11ff/blob new file mode 100644 index 0000000000000000000000000000000000000000..d47bb8a2978f8b2f435852fb98dbcba65bfe1a16 --- /dev/null +++ b/shared/package-files/08/0806ef3662b840225106c5f6e7fca2d887bd241dfbc600ec6219a67b2dfe11ff/blob @@ -0,0 +1,26 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & quantize_per_tensor_out(const at::Tensor & self, double scale, int64_t zero_point, at::ScalarType dtype, at::Tensor & out); +TORCH_API at::Tensor quantize_per_tensor(const at::Tensor & self, double scale, int64_t zero_point, at::ScalarType dtype); +TORCH_API at::Tensor & quantize_per_tensor_tensor_qparams_out(const at::Tensor & self, const at::Tensor & scale, const at::Tensor & zero_point, at::ScalarType dtype, at::Tensor & out); +TORCH_API at::Tensor quantize_per_tensor_tensor_qparams(const at::Tensor & self, const at::Tensor & scale, const at::Tensor & zero_point, at::ScalarType dtype); +TORCH_API void quantize_per_tensor_tensors_out(at::TensorList tensors, const at::Tensor & scales, const at::Tensor & zero_points, at::ScalarType dtype, at::TensorList out); +TORCH_API ::std::vector quantize_per_tensor_list_cpu(at::TensorList tensors, const at::Tensor & scales, const at::Tensor & zero_points, at::ScalarType dtype); +} // namespace native +} // namespace at diff --git a/shared/package-files/08/08126fe94f6d4f4073615ae61019404416523310704ec5f792b00202700f7c78/blob b/shared/package-files/08/08126fe94f6d4f4073615ae61019404416523310704ec5f792b00202700f7c78/blob new file mode 100644 index 0000000000000000000000000000000000000000..c1c45ece998cd15831d904ccefb393a3dde8aeab --- /dev/null +++ b/shared/package-files/08/08126fe94f6d4f4073615ae61019404416523310704ec5f792b00202700f7c78/blob @@ -0,0 +1,274 @@ +import math + +import pytest + +import networkx as nx +from networkx.algorithms.planar_drawing import triangulate_embedding + + +def test_graph1(): + embedding_data = {0: [1, 2, 3], 1: [2, 0], 2: [3, 0, 1], 3: [2, 0]} + check_embedding_data(embedding_data) + + +def test_graph2(): + embedding_data = { + 0: [8, 6], + 1: [2, 6, 9], + 2: [8, 1, 7, 9, 6, 4], + 3: [9], + 4: [2], + 5: [6, 8], + 6: [9, 1, 0, 5, 2], + 7: [9, 2], + 8: [0, 2, 5], + 9: [1, 6, 2, 7, 3], + } + check_embedding_data(embedding_data) + + +def test_circle_graph(): + embedding_data = { + 0: [1, 9], + 1: [0, 2], + 2: [1, 3], + 3: [2, 4], + 4: [3, 5], + 5: [4, 6], + 6: [5, 7], + 7: [6, 8], + 8: [7, 9], + 9: [8, 0], + } + check_embedding_data(embedding_data) + + +def test_grid_graph(): + embedding_data = { + (0, 1): [(0, 0), (1, 1), (0, 2)], + (1, 2): [(1, 1), (2, 2), (0, 2)], + (0, 0): [(0, 1), (1, 0)], + (2, 1): [(2, 0), (2, 2), (1, 1)], + (1, 1): [(2, 1), (1, 2), (0, 1), (1, 0)], + (2, 0): [(1, 0), (2, 1)], + (2, 2): [(1, 2), (2, 1)], + (1, 0): [(0, 0), (2, 0), (1, 1)], + (0, 2): [(1, 2), (0, 1)], + } + check_embedding_data(embedding_data) + + +def test_one_node_graph(): + embedding_data = {0: []} + check_embedding_data(embedding_data) + + +def test_two_node_graph(): + embedding_data = {0: [1], 1: [0]} + check_embedding_data(embedding_data) + + +def test_three_node_graph(): + embedding_data = {0: [1, 2], 1: [0, 2], 2: [0, 1]} + check_embedding_data(embedding_data) + + +def test_multiple_component_graph1(): + embedding_data = {0: [], 1: []} + check_embedding_data(embedding_data) + + +def test_multiple_component_graph2(): + embedding_data = {0: [1, 2], 1: [0, 2], 2: [0, 1], 3: [4, 5], 4: [3, 5], 5: [3, 4]} + check_embedding_data(embedding_data) + + +def test_invalid_half_edge(): + with pytest.raises(nx.NetworkXException): + embedding_data = {1: [2, 3, 4], 2: [1, 3, 4], 3: [1, 2, 4], 4: [1, 2, 3]} + embedding = nx.PlanarEmbedding() + embedding.set_data(embedding_data) + nx.combinatorial_embedding_to_pos(embedding) + + +def test_triangulate_embedding1(): + embedding = nx.PlanarEmbedding() + embedding.add_node(1) + expected_embedding = {1: []} + check_triangulation(embedding, expected_embedding) + + +def test_triangulate_embedding2(): + embedding = nx.PlanarEmbedding() + embedding.connect_components(1, 2) + expected_embedding = {1: [2], 2: [1]} + check_triangulation(embedding, expected_embedding) + + +def check_triangulation(embedding, expected_embedding): + res_embedding, _ = triangulate_embedding(embedding, True) + assert ( + res_embedding.get_data() == expected_embedding + ), "Expected embedding incorrect" + res_embedding, _ = triangulate_embedding(embedding, False) + assert ( + res_embedding.get_data() == expected_embedding + ), "Expected embedding incorrect" + + +def check_embedding_data(embedding_data): + """Checks that the planar embedding of the input is correct""" + embedding = nx.PlanarEmbedding() + embedding.set_data(embedding_data) + pos_fully = nx.combinatorial_embedding_to_pos(embedding, False) + msg = "Planar drawing does not conform to the embedding (fully " "triangulation)" + assert planar_drawing_conforms_to_embedding(embedding, pos_fully), msg + check_edge_intersections(embedding, pos_fully) + pos_internally = nx.combinatorial_embedding_to_pos(embedding, True) + msg = "Planar drawing does not conform to the embedding (internal " "triangulation)" + assert planar_drawing_conforms_to_embedding(embedding, pos_internally), msg + check_edge_intersections(embedding, pos_internally) + + +def is_close(a, b, rel_tol=1e-09, abs_tol=0.0): + # Check if float numbers are basically equal, for python >=3.5 there is + # function for that in the standard library + return abs(a - b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) + + +def point_in_between(a, b, p): + # checks if p is on the line between a and b + x1, y1 = a + x2, y2 = b + px, py = p + dist_1_2 = math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2) + dist_1_p = math.sqrt((x1 - px) ** 2 + (y1 - py) ** 2) + dist_2_p = math.sqrt((x2 - px) ** 2 + (y2 - py) ** 2) + return is_close(dist_1_p + dist_2_p, dist_1_2) + + +def check_edge_intersections(G, pos): + """Check all edges in G for intersections. + + Raises an exception if an intersection is found. + + Parameters + ---------- + G : NetworkX graph + pos : dict + Maps every node to a tuple (x, y) representing its position + + """ + for a, b in G.edges(): + for c, d in G.edges(): + # Check if end points are different + if a != c and b != d and b != c and a != d: + x1, y1 = pos[a] + x2, y2 = pos[b] + x3, y3 = pos[c] + x4, y4 = pos[d] + determinant = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4) + if determinant != 0: # the lines are not parallel + # calculate intersection point, see: + # https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection + px = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * ( + x3 * y4 - y3 * x4 + ) / determinant + py = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * ( + x3 * y4 - y3 * x4 + ) / determinant + + # Check if intersection lies between the points + if point_in_between(pos[a], pos[b], (px, py)) and point_in_between( + pos[c], pos[d], (px, py) + ): + msg = f"There is an intersection at {px},{py}" + raise nx.NetworkXException(msg) + + # Check overlap + msg = "A node lies on a edge connecting two other nodes" + if ( + point_in_between(pos[a], pos[b], pos[c]) + or point_in_between(pos[a], pos[b], pos[d]) + or point_in_between(pos[c], pos[d], pos[a]) + or point_in_between(pos[c], pos[d], pos[b]) + ): + raise nx.NetworkXException(msg) + # No edge intersection found + + +class Vector: + """Compare vectors by their angle without loss of precision + + All vectors in direction [0, 1] are the smallest. + The vectors grow in clockwise direction. + """ + + __slots__ = ["x", "y", "node", "quadrant"] + + def __init__(self, x, y, node): + self.x = x + self.y = y + self.node = node + if self.x >= 0 and self.y > 0: + self.quadrant = 1 + elif self.x > 0 and self.y <= 0: + self.quadrant = 2 + elif self.x <= 0 and self.y < 0: + self.quadrant = 3 + else: + self.quadrant = 4 + + def __eq__(self, other): + return self.quadrant == other.quadrant and self.x * other.y == self.y * other.x + + def __lt__(self, other): + if self.quadrant < other.quadrant: + return True + elif self.quadrant > other.quadrant: + return False + else: + return self.x * other.y < self.y * other.x + + def __ne__(self, other): + return self != other + + def __le__(self, other): + return not other < self + + def __gt__(self, other): + return other < self + + def __ge__(self, other): + return not self < other + + +def planar_drawing_conforms_to_embedding(embedding, pos): + """Checks if pos conforms to the planar embedding + + Returns true iff the neighbors are actually oriented in the orientation + specified of the embedding + """ + for v in embedding: + nbr_vectors = [] + v_pos = pos[v] + for nbr in embedding[v]: + new_vector = Vector(pos[nbr][0] - v_pos[0], pos[nbr][1] - v_pos[1], nbr) + nbr_vectors.append(new_vector) + # Sort neighbors according to their phi angle + nbr_vectors.sort() + for idx, nbr_vector in enumerate(nbr_vectors): + cw_vector = nbr_vectors[(idx + 1) % len(nbr_vectors)] + ccw_vector = nbr_vectors[idx - 1] + if ( + embedding[v][nbr_vector.node]["cw"] != cw_vector.node + or embedding[v][nbr_vector.node]["ccw"] != ccw_vector.node + ): + return False + if cw_vector.node != nbr_vector.node and cw_vector == nbr_vector: + # Lines overlap + return False + if ccw_vector.node != nbr_vector.node and ccw_vector == nbr_vector: + # Lines overlap + return False + return True diff --git a/shared/package-files/08/08146f64b67e8288b74c1beb401aed94839ea71a797639b9a0325dea9a423dba/blob b/shared/package-files/08/08146f64b67e8288b74c1beb401aed94839ea71a797639b9a0325dea9a423dba/blob new file mode 100644 index 0000000000000000000000000000000000000000..4304737fd4e5385df209e9d0748a0b8456e56a94 --- /dev/null +++ b/shared/package-files/08/08146f64b67e8288b74c1beb401aed94839ea71a797639b9a0325dea9a423dba/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_nll_loss_forward : public at::impl::MetaBase { + + + void meta(const at::Tensor & self, const at::Tensor & target, at::OptionalTensorRef weight, int64_t reduction, int64_t ignore_index); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/08/0815923fdb5ded6a54d6f8bc7b65e2b8ca9aba15f3bc71e75d824a676dbee7a5/blob b/shared/package-files/08/0815923fdb5ded6a54d6f8bc7b65e2b8ca9aba15f3bc71e75d824a676dbee7a5/blob new file mode 100644 index 0000000000000000000000000000000000000000..81e8183c6722e82f8556591e005b388e61f66ef6 --- /dev/null +++ b/shared/package-files/08/0815923fdb5ded6a54d6f8bc7b65e2b8ca9aba15f3bc71e75d824a676dbee7a5/blob @@ -0,0 +1,744 @@ +import re +from collections import defaultdict +from functools import partial + +import numpy as np +import pytest +import scipy.sparse as sp + +from sklearn.datasets import ( + make_biclusters, + make_blobs, + make_checkerboard, + make_circles, + make_classification, + make_friedman1, + make_friedman2, + make_friedman3, + make_hastie_10_2, + make_low_rank_matrix, + make_moons, + make_multilabel_classification, + make_regression, + make_s_curve, + make_sparse_coded_signal, + make_sparse_spd_matrix, + make_sparse_uncorrelated, + make_spd_matrix, + make_swiss_roll, +) +from sklearn.utils._testing import ( + assert_allclose, + assert_allclose_dense_sparse, + assert_almost_equal, + assert_array_almost_equal, + assert_array_equal, +) +from sklearn.utils.validation import assert_all_finite + + +def test_make_classification(): + weights = [0.1, 0.25] + X, y = make_classification( + n_samples=100, + n_features=20, + n_informative=5, + n_redundant=1, + n_repeated=1, + n_classes=3, + n_clusters_per_class=1, + hypercube=False, + shift=None, + scale=None, + weights=weights, + random_state=0, + ) + + assert weights == [0.1, 0.25] + assert X.shape == (100, 20), "X shape mismatch" + assert y.shape == (100,), "y shape mismatch" + assert np.unique(y).shape == (3,), "Unexpected number of classes" + assert sum(y == 0) == 10, "Unexpected number of samples in class #0" + assert sum(y == 1) == 25, "Unexpected number of samples in class #1" + assert sum(y == 2) == 65, "Unexpected number of samples in class #2" + + # Test for n_features > 30 + X, y = make_classification( + n_samples=2000, + n_features=31, + n_informative=31, + n_redundant=0, + n_repeated=0, + hypercube=True, + scale=0.5, + random_state=0, + ) + + assert X.shape == (2000, 31), "X shape mismatch" + assert y.shape == (2000,), "y shape mismatch" + assert ( + np.unique(X.view([("", X.dtype)] * X.shape[1])) + .view(X.dtype) + .reshape(-1, X.shape[1]) + .shape[0] + == 2000 + ), "Unexpected number of unique rows" + + +def test_make_classification_informative_features(): + """Test the construction of informative features in make_classification + + Also tests `n_clusters_per_class`, `n_classes`, `hypercube` and + fully-specified `weights`. + """ + # Create very separate clusters; check that vertices are unique and + # correspond to classes + class_sep = 1e6 + make = partial( + make_classification, + class_sep=class_sep, + n_redundant=0, + n_repeated=0, + flip_y=0, + shift=0, + scale=1, + shuffle=False, + ) + + for n_informative, weights, n_clusters_per_class in [ + (2, [1], 1), + (2, [1 / 3] * 3, 1), + (2, [1 / 4] * 4, 1), + (2, [1 / 2] * 2, 2), + (2, [3 / 4, 1 / 4], 2), + (10, [1 / 3] * 3, 10), + (64, [1], 1), + ]: + n_classes = len(weights) + n_clusters = n_classes * n_clusters_per_class + n_samples = n_clusters * 50 + + for hypercube in (False, True): + X, y = make( + n_samples=n_samples, + n_classes=n_classes, + weights=weights, + n_features=n_informative, + n_informative=n_informative, + n_clusters_per_class=n_clusters_per_class, + hypercube=hypercube, + random_state=0, + ) + + assert X.shape == (n_samples, n_informative) + assert y.shape == (n_samples,) + + # Cluster by sign, viewed as strings to allow uniquing + signs = np.sign(X) + signs = signs.view(dtype="|S{0}".format(signs.strides[0])).ravel() + unique_signs, cluster_index = np.unique(signs, return_inverse=True) + + assert len(unique_signs) == n_clusters, ( + "Wrong number of clusters, or not in distinct quadrants" + ) + + clusters_by_class = defaultdict(set) + for cluster, cls in zip(cluster_index, y): + clusters_by_class[cls].add(cluster) + for clusters in clusters_by_class.values(): + assert len(clusters) == n_clusters_per_class, ( + "Wrong number of clusters per class" + ) + assert len(clusters_by_class) == n_classes, "Wrong number of classes" + + assert_array_almost_equal( + np.bincount(y) / len(y) // weights, + [1] * n_classes, + err_msg="Wrong number of samples per class", + ) + + # Ensure on vertices of hypercube + for cluster in range(len(unique_signs)): + centroid = X[cluster_index == cluster].mean(axis=0) + if hypercube: + assert_array_almost_equal( + np.abs(centroid) / class_sep, + np.ones(n_informative), + decimal=5, + err_msg="Clusters are not centered on hypercube vertices", + ) + else: + with pytest.raises(AssertionError): + assert_array_almost_equal( + np.abs(centroid) / class_sep, + np.ones(n_informative), + decimal=5, + err_msg=( + "Clusters should not be centered on hypercube vertices" + ), + ) + + with pytest.raises(ValueError): + make(n_features=2, n_informative=2, n_classes=5, n_clusters_per_class=1) + with pytest.raises(ValueError): + make(n_features=2, n_informative=2, n_classes=3, n_clusters_per_class=2) + + +def test_make_classification_return_x_y(): + """ + Test that make_classification returns a Bunch when return_X_y is False. + + Also that bunch.X is the same as X + """ + + kwargs = { + "n_samples": 100, + "n_features": 20, + "n_informative": 5, + "n_redundant": 1, + "n_repeated": 1, + "n_classes": 3, + "n_clusters_per_class": 2, + "weights": None, + "flip_y": 0.01, + "class_sep": 1.0, + "hypercube": True, + "shift": 0.0, + "scale": 1.0, + "shuffle": True, + "random_state": 42, + "return_X_y": True, + } + + X, y = make_classification(**kwargs) + + kwargs["return_X_y"] = False + bunch = make_classification(**kwargs) + + assert ( + hasattr(bunch, "DESCR") + and hasattr(bunch, "parameters") + and hasattr(bunch, "feature_info") + and hasattr(bunch, "X") + and hasattr(bunch, "y") + ) + + def count(str_): + return bunch.feature_info.count(str_) + + assert np.array_equal(X, bunch.X) + assert np.array_equal(y, bunch.y) + assert bunch.DESCR == make_classification.__doc__ + assert bunch.parameters == kwargs + assert count("informative") == kwargs["n_informative"] + assert count("redundant") == kwargs["n_redundant"] + assert count("repeated") == kwargs["n_repeated"] + + +@pytest.mark.parametrize( + "weights, err_type, err_msg", + [ + ([], ValueError, "Weights specified but incompatible with number of classes."), + ( + [0.25, 0.75, 0.1], + ValueError, + "Weights specified but incompatible with number of classes.", + ), + ( + np.array([]), + ValueError, + "Weights specified but incompatible with number of classes.", + ), + ( + np.array([0.25, 0.75, 0.1]), + ValueError, + "Weights specified but incompatible with number of classes.", + ), + ( + np.random.random(3), + ValueError, + "Weights specified but incompatible with number of classes.", + ), + ], +) +def test_make_classification_weights_type(weights, err_type, err_msg): + with pytest.raises(err_type, match=err_msg): + make_classification(weights=weights) + + +@pytest.mark.parametrize("kwargs", [{}, {"n_classes": 3, "n_informative": 3}]) +def test_make_classification_weights_array_or_list_ok(kwargs): + X1, y1 = make_classification(weights=[0.1, 0.9], random_state=0, **kwargs) + X2, y2 = make_classification(weights=np.array([0.1, 0.9]), random_state=0, **kwargs) + assert_almost_equal(X1, X2) + assert_almost_equal(y1, y2) + + +def test_make_multilabel_classification_return_sequences(): + for allow_unlabeled, min_length in zip((True, False), (0, 1)): + X, Y = make_multilabel_classification( + n_samples=100, + n_features=20, + n_classes=3, + random_state=0, + return_indicator=False, + allow_unlabeled=allow_unlabeled, + ) + assert X.shape == (100, 20), "X shape mismatch" + if not allow_unlabeled: + assert max([max(y) for y in Y]) == 2 + assert min([len(y) for y in Y]) == min_length + assert max([len(y) for y in Y]) <= 3 + + +def test_make_multilabel_classification_return_indicator(): + for allow_unlabeled, min_length in zip((True, False), (0, 1)): + X, Y = make_multilabel_classification( + n_samples=25, + n_features=20, + n_classes=3, + random_state=0, + allow_unlabeled=allow_unlabeled, + ) + assert X.shape == (25, 20), "X shape mismatch" + assert Y.shape == (25, 3), "Y shape mismatch" + assert np.all(np.sum(Y, axis=0) > min_length) + + # Also test return_distributions and return_indicator with True + X2, Y2, p_c, p_w_c = make_multilabel_classification( + n_samples=25, + n_features=20, + n_classes=3, + random_state=0, + allow_unlabeled=allow_unlabeled, + return_distributions=True, + ) + + assert_array_almost_equal(X, X2) + assert_array_equal(Y, Y2) + assert p_c.shape == (3,) + assert_almost_equal(p_c.sum(), 1) + assert p_w_c.shape == (20, 3) + assert_almost_equal(p_w_c.sum(axis=0), [1] * 3) + + +def test_make_multilabel_classification_return_indicator_sparse(): + for allow_unlabeled, min_length in zip((True, False), (0, 1)): + X, Y = make_multilabel_classification( + n_samples=25, + n_features=20, + n_classes=3, + random_state=0, + return_indicator="sparse", + allow_unlabeled=allow_unlabeled, + ) + assert X.shape == (25, 20), "X shape mismatch" + assert Y.shape == (25, 3), "Y shape mismatch" + assert sp.issparse(Y) + + +def test_make_hastie_10_2(): + X, y = make_hastie_10_2(n_samples=100, random_state=0) + assert X.shape == (100, 10), "X shape mismatch" + assert y.shape == (100,), "y shape mismatch" + assert np.unique(y).shape == (2,), "Unexpected number of classes" + + +def test_make_regression(global_random_seed): + X, y, c = make_regression( + n_samples=200, + n_features=10, + n_informative=3, + effective_rank=5, + coef=True, + bias=0.0, + noise=1.0, + random_state=global_random_seed, + ) + + assert X.shape == (200, 10), "X shape mismatch" + assert y.shape == (200,), "y shape mismatch" + assert c.shape == (10,), "coef shape mismatch" + assert sum(c != 0.0) == 3, "Unexpected number of informative features" + + # Test that y ~= np.dot(X, c) + bias + N(0, 1.0). + assert_almost_equal(np.std(y - np.dot(X, c)), 1.0, decimal=1) + + # Test with small number of features. + X, y = make_regression(n_samples=100, n_features=1) # n_informative=3 + assert X.shape == (100, 1) + + +def test_make_regression_multitarget(global_random_seed): + X, y, c = make_regression( + n_samples=100, + n_features=10, + n_informative=3, + n_targets=3, + coef=True, + noise=1.0, + random_state=global_random_seed, + ) + + assert X.shape == (100, 10), "X shape mismatch" + assert y.shape == (100, 3), "y shape mismatch" + assert c.shape == (10, 3), "coef shape mismatch" + assert_array_equal(sum(c != 0.0), 3, "Unexpected number of informative features") + + # Test that y ~= np.dot(X, c) + bias + N(0, 1.0) + assert_almost_equal(np.std(y - np.dot(X, c)), 1.0, decimal=1) + + +def test_make_blobs(global_random_seed): + cluster_stds = np.array([0.05, 0.2, 0.4]) + cluster_centers = np.array([[0.0, 0.0], [1.0, 1.0], [0.0, 1.0]]) + X, y = make_blobs( + random_state=global_random_seed, + n_samples=50, + n_features=2, + centers=cluster_centers, + cluster_std=cluster_stds, + ) + + assert X.shape == (50, 2), "X shape mismatch" + assert y.shape == (50,), "y shape mismatch" + assert np.unique(y).shape == (3,), "Unexpected number of blobs" + for i, (ctr, std) in enumerate(zip(cluster_centers, cluster_stds)): + assert_almost_equal((X[y == i] - ctr).std(), std, 1, "Unexpected std") + + +def test_make_blobs_n_samples_list(): + n_samples = [50, 30, 20] + X, y = make_blobs(n_samples=n_samples, n_features=2, random_state=0) + + assert X.shape == (sum(n_samples), 2), "X shape mismatch" + assert all(np.bincount(y, minlength=len(n_samples)) == n_samples), ( + "Incorrect number of samples per blob" + ) + + +def test_make_blobs_n_samples_list_with_centers(global_random_seed): + n_samples = [20, 20, 20] + centers = np.array([[0.0, 0.0], [1.0, 1.0], [0.0, 1.0]]) + cluster_stds = np.array([0.05, 0.2, 0.4]) + X, y = make_blobs( + n_samples=n_samples, + centers=centers, + cluster_std=cluster_stds, + random_state=global_random_seed, + ) + + assert X.shape == (sum(n_samples), 2), "X shape mismatch" + assert all(np.bincount(y, minlength=len(n_samples)) == n_samples), ( + "Incorrect number of samples per blob" + ) + for i, (ctr, std) in enumerate(zip(centers, cluster_stds)): + assert_almost_equal((X[y == i] - ctr).std(), std, 1, "Unexpected std") + + +@pytest.mark.parametrize( + "n_samples", [[5, 3, 0], np.array([5, 3, 0]), tuple([5, 3, 0])] +) +def test_make_blobs_n_samples_centers_none(n_samples): + centers = None + X, y = make_blobs(n_samples=n_samples, centers=centers, random_state=0) + + assert X.shape == (sum(n_samples), 2), "X shape mismatch" + assert all(np.bincount(y, minlength=len(n_samples)) == n_samples), ( + "Incorrect number of samples per blob" + ) + + +def test_make_blobs_return_centers(): + n_samples = [10, 20] + n_features = 3 + X, y, centers = make_blobs( + n_samples=n_samples, n_features=n_features, return_centers=True, random_state=0 + ) + + assert centers.shape == (len(n_samples), n_features) + + +def test_make_blobs_error(): + n_samples = [20, 20, 20] + centers = np.array([[0.0, 0.0], [1.0, 1.0], [0.0, 1.0]]) + cluster_stds = np.array([0.05, 0.2, 0.4]) + wrong_centers_msg = re.escape( + "Length of `n_samples` not consistent with number of centers. " + f"Got n_samples = {n_samples} and centers = {centers[:-1]}" + ) + with pytest.raises(ValueError, match=wrong_centers_msg): + make_blobs(n_samples, centers=centers[:-1]) + wrong_std_msg = re.escape( + "Length of `clusters_std` not consistent with number of centers. " + f"Got centers = {centers} and cluster_std = {cluster_stds[:-1]}" + ) + with pytest.raises(ValueError, match=wrong_std_msg): + make_blobs(n_samples, centers=centers, cluster_std=cluster_stds[:-1]) + wrong_type_msg = "Parameter `centers` must be array-like. Got {!r} instead".format( + 3 + ) + with pytest.raises(ValueError, match=wrong_type_msg): + make_blobs(n_samples, centers=3) + + +def test_make_friedman1(global_random_seed): + X, y = make_friedman1( + n_samples=5, n_features=10, noise=0.0, random_state=global_random_seed + ) + + assert X.shape == (5, 10), "X shape mismatch" + assert y.shape == (5,), "y shape mismatch" + + assert_array_almost_equal( + y, + 10 * np.sin(np.pi * X[:, 0] * X[:, 1]) + + 20 * (X[:, 2] - 0.5) ** 2 + + 10 * X[:, 3] + + 5 * X[:, 4], + ) + + +def test_make_friedman2(global_random_seed): + X, y = make_friedman2(n_samples=5, noise=0.0, random_state=global_random_seed) + + assert X.shape == (5, 4), "X shape mismatch" + assert y.shape == (5,), "y shape mismatch" + + assert_array_almost_equal( + y, (X[:, 0] ** 2 + (X[:, 1] * X[:, 2] - 1 / (X[:, 1] * X[:, 3])) ** 2) ** 0.5 + ) + + +def test_make_friedman3(global_random_seed): + X, y = make_friedman3(n_samples=5, noise=0.0, random_state=global_random_seed) + + assert X.shape == (5, 4), "X shape mismatch" + assert y.shape == (5,), "y shape mismatch" + + assert_array_almost_equal( + y, np.arctan((X[:, 1] * X[:, 2] - 1 / (X[:, 1] * X[:, 3])) / X[:, 0]) + ) + + +def test_make_low_rank_matrix(): + X = make_low_rank_matrix( + n_samples=50, + n_features=25, + effective_rank=5, + tail_strength=0.01, + random_state=0, + ) + + assert X.shape == (50, 25), "X shape mismatch" + + from numpy.linalg import svd + + u, s, v = svd(X) + assert sum(s) - 5 < 0.1, "X rank is not approximately 5" + + +def test_make_sparse_coded_signal(global_random_seed): + Y, D, X = make_sparse_coded_signal( + n_samples=5, + n_components=8, + n_features=10, + n_nonzero_coefs=3, + random_state=global_random_seed, + ) + assert Y.shape == (5, 10), "Y shape mismatch" + assert D.shape == (8, 10), "D shape mismatch" + assert X.shape == (5, 8), "X shape mismatch" + for row in X: + assert len(np.flatnonzero(row)) == 3, "Non-zero coefs mismatch" + assert_allclose(Y, X @ D) + assert_allclose(np.sqrt((D**2).sum(axis=1)), np.ones(D.shape[0])) + + +def test_make_sparse_uncorrelated(): + X, y = make_sparse_uncorrelated(n_samples=5, n_features=10, random_state=0) + + assert X.shape == (5, 10), "X shape mismatch" + assert y.shape == (5,), "y shape mismatch" + + +def test_make_spd_matrix(global_random_seed): + X = make_spd_matrix(n_dim=5, random_state=global_random_seed) + + assert X.shape == (5, 5), "X shape mismatch" + assert_array_almost_equal(X, X.T) + + from numpy.linalg import eig + + eigenvalues, _ = eig(X) + assert np.all(eigenvalues > 0), "X is not positive-definite" + + +@pytest.mark.parametrize("norm_diag", [True, False]) +@pytest.mark.parametrize( + "sparse_format", [None, "bsr", "coo", "csc", "csr", "dia", "dok", "lil"] +) +def test_make_sparse_spd_matrix(norm_diag, sparse_format, global_random_seed): + n_dim = 5 + X = make_sparse_spd_matrix( + n_dim=n_dim, + norm_diag=norm_diag, + sparse_format=sparse_format, + random_state=global_random_seed, + ) + + assert X.shape == (n_dim, n_dim), "X shape mismatch" + if sparse_format is None: + assert not sp.issparse(X) + assert_allclose(X, X.T) + Xarr = X + else: + assert sp.issparse(X) and X.format == sparse_format + assert_allclose_dense_sparse(X, X.T) + Xarr = X.toarray() + + from numpy.linalg import eig + + # Do not use scipy.sparse.linalg.eigs because it cannot find all eigenvalues + eigenvalues, _ = eig(Xarr) + assert np.all(eigenvalues > 0), "X is not positive-definite" + + if norm_diag: + # Check that leading diagonal elements are 1 + assert_array_almost_equal(Xarr.diagonal(), np.ones(n_dim)) + + +@pytest.mark.parametrize("hole", [False, True]) +def test_make_swiss_roll(global_random_seed, hole): + X, t = make_swiss_roll( + n_samples=5, noise=0.0, random_state=global_random_seed, hole=hole + ) + + assert X.shape == (5, 3) + assert t.shape == (5,) + assert_array_almost_equal(X[:, 0], t * np.cos(t)) + assert_array_almost_equal(X[:, 2], t * np.sin(t)) + + +def test_make_s_curve(global_random_seed): + X, t = make_s_curve(n_samples=5, noise=0.0, random_state=global_random_seed) + + assert X.shape == (5, 3), "X shape mismatch" + assert t.shape == (5,), "t shape mismatch" + assert_array_almost_equal(X[:, 0], np.sin(t)) + assert_array_almost_equal(X[:, 2], np.sign(t) * (np.cos(t) - 1)) + + +def test_make_biclusters(): + X, rows, cols = make_biclusters( + shape=(100, 100), n_clusters=4, shuffle=True, random_state=0 + ) + assert X.shape == (100, 100), "X shape mismatch" + assert rows.shape == (4, 100), "rows shape mismatch" + assert cols.shape == ( + 4, + 100, + ), "columns shape mismatch" + assert_all_finite(X) + assert_all_finite(rows) + assert_all_finite(cols) + + X2, _, _ = make_biclusters( + shape=(100, 100), n_clusters=4, shuffle=True, random_state=0 + ) + assert_array_almost_equal(X, X2) + + +def test_make_checkerboard(): + X, rows, cols = make_checkerboard( + shape=(100, 100), n_clusters=(20, 5), shuffle=True, random_state=0 + ) + assert X.shape == (100, 100), "X shape mismatch" + assert rows.shape == (100, 100), "rows shape mismatch" + assert cols.shape == ( + 100, + 100, + ), "columns shape mismatch" + + X, rows, cols = make_checkerboard( + shape=(100, 100), n_clusters=2, shuffle=True, random_state=0 + ) + assert_all_finite(X) + assert_all_finite(rows) + assert_all_finite(cols) + + X1, _, _ = make_checkerboard( + shape=(100, 100), n_clusters=2, shuffle=True, random_state=0 + ) + X2, _, _ = make_checkerboard( + shape=(100, 100), n_clusters=2, shuffle=True, random_state=0 + ) + assert_array_almost_equal(X1, X2) + + +def test_make_moons(global_random_seed): + X, y = make_moons(3, shuffle=False, random_state=global_random_seed) + for x, label in zip(X, y): + center = [0.0, 0.0] if label == 0 else [1.0, 0.5] + dist_sqr = ((x - center) ** 2).sum() + assert_almost_equal( + dist_sqr, 1.0, err_msg="Point is not on expected unit circle" + ) + + +def test_make_moons_unbalanced(): + X, y = make_moons(n_samples=(7, 5)) + assert np.sum(y == 0) == 7 and np.sum(y == 1) == 5, ( + "Number of samples in a moon is wrong" + ) + assert X.shape == (12, 2), "X shape mismatch" + assert y.shape == (12,), "y shape mismatch" + + with pytest.raises( + ValueError, + match=r"`n_samples` can be either an int or a two-element tuple.", + ): + make_moons(n_samples=(10,)) + + +def test_make_circles(): + factor = 0.3 + + for n_samples, n_outer, n_inner in [(7, 3, 4), (8, 4, 4)]: + # Testing odd and even case, because in the past make_circles always + # created an even number of samples. + X, y = make_circles(n_samples, shuffle=False, noise=None, factor=factor) + assert X.shape == (n_samples, 2), "X shape mismatch" + assert y.shape == (n_samples,), "y shape mismatch" + center = [0.0, 0.0] + for x, label in zip(X, y): + dist_sqr = ((x - center) ** 2).sum() + dist_exp = 1.0 if label == 0 else factor**2 + dist_exp = 1.0 if label == 0 else factor**2 + assert_almost_equal( + dist_sqr, dist_exp, err_msg="Point is not on expected circle" + ) + + assert X[y == 0].shape == ( + n_outer, + 2, + ), "Samples not correctly distributed across circles." + assert X[y == 1].shape == ( + n_inner, + 2, + ), "Samples not correctly distributed across circles." + + +def test_make_circles_unbalanced(): + X, y = make_circles(n_samples=(2, 8)) + + assert np.sum(y == 0) == 2, "Number of samples in inner circle is wrong" + assert np.sum(y == 1) == 8, "Number of samples in outer circle is wrong" + assert X.shape == (10, 2), "X shape mismatch" + assert y.shape == (10,), "y shape mismatch" + + with pytest.raises( + ValueError, + match="When a tuple, n_samples must have exactly two elements.", + ): + make_circles(n_samples=(10,)) diff --git a/shared/package-files/08/08199dfe00ed822a87d9276841094e05bb4e11ea6b5ad33af18ddfd6c4aa3df2/blob b/shared/package-files/08/08199dfe00ed822a87d9276841094e05bb4e11ea6b5ad33af18ddfd6c4aa3df2/blob new file mode 100644 index 0000000000000000000000000000000000000000..fb6c6d3b2648761e79db93eada59964482d6053a --- /dev/null +++ b/shared/package-files/08/08199dfe00ed822a87d9276841094e05bb4e11ea6b5ad33af18ddfd6c4aa3df2/blob @@ -0,0 +1,456 @@ +# fontchooser.tcl - +# +# A themeable Tk font selection dialog. See TIP #324. +# +# Copyright (C) 2008 Keith Vetter +# Copyright (C) 2008 Pat Thoyts +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +namespace eval ::tk::fontchooser { + variable S + + set S(W) .__tk__fontchooser + set S(fonts) [lsort -dictionary [font families]] + set S(styles) [list \ + [::msgcat::mc "Regular"] \ + [::msgcat::mc "Italic"] \ + [::msgcat::mc "Bold"] \ + [::msgcat::mc "Bold Italic"] \ + ] + + set S(sizes) {8 9 10 11 12 14 16 18 20 22 24 26 28 36 48 72} + set S(strike) 0 + set S(under) 0 + set S(first) 1 + set S(sampletext) [::msgcat::mc "AaBbYyZz01"] + set S(-parent) . + set S(-title) [::msgcat::mc "Font"] + set S(-command) "" + set S(-font) TkDefaultFont +} + +proc ::tk::fontchooser::Setup {} { + variable S + + # Canonical versions of font families, styles, etc. for easier searching + set S(fonts,lcase) {} + foreach font $S(fonts) {lappend S(fonts,lcase) [string tolower $font]} + set S(styles,lcase) {} + foreach style $S(styles) {lappend S(styles,lcase) [string tolower $style]} + set S(sizes,lcase) $S(sizes) + + ::ttk::style layout FontchooserFrame { + Entry.field -sticky news -border true -children { + FontchooserFrame.padding -sticky news + } + } + bind [winfo class .] <> \ + [list +ttk::style layout FontchooserFrame \ + [ttk::style layout FontchooserFrame]] + + namespace ensemble create -map { + show ::tk::fontchooser::Show + hide ::tk::fontchooser::Hide + configure ::tk::fontchooser::Configure + } +} +::tk::fontchooser::Setup + +proc ::tk::fontchooser::Show {} { + variable S + if {![winfo exists $S(W)]} { + Create + wm transient $S(W) [winfo toplevel $S(-parent)] + tk::PlaceWindow $S(W) widget $S(-parent) + } + set S(fonts) [lsort -dictionary [font families]] + set S(fonts,lcase) {} + foreach font $S(fonts) { lappend S(fonts,lcase) [string tolower $font]} + wm deiconify $S(W) +} + +proc ::tk::fontchooser::Hide {} { + variable S + wm withdraw $S(W) +} + +proc ::tk::fontchooser::Configure {args} { + variable S + + set specs { + {-parent "" "" . } + {-title "" "" ""} + {-font "" "" ""} + {-command "" "" ""} + } + + if {[llength $args] == 0} { + set result {} + foreach spec $specs { + foreach {name xx yy default} $spec break + lappend result $name \ + [expr {[info exists S($name)] ? $S($name) : $default}] + } + lappend result -visible \ + [expr {[winfo exists $S(W)] && [winfo ismapped $S(W)]}] + return $result + } + if {[llength $args] == 1} { + set option [lindex $args 0] + if {[string equal $option "-visible"]} { + return [expr {[winfo exists $S(W)] && [winfo ismapped $S(W)]}] + } elseif {[info exists S($option)]} { + return $S($option) + } + return -code error -errorcode [list TK LOOKUP OPTION $option] \ + "bad option \"$option\": must be\ + -command, -font, -parent, -title or -visible" + } + + set cache [dict create -parent $S(-parent) -title $S(-title) \ + -font $S(-font) -command $S(-command)] + set r [tclParseConfigSpec [namespace which -variable S] $specs DONTSETDEFAULTS $args] + if {![winfo exists $S(-parent)]} { + set code [list TK LOOKUP WINDOW $S(-parent)] + set err "bad window path name \"$S(-parent)\"" + array set S $cache + return -code error -errorcode $code $err + } + if {[string trim $S(-title)] eq ""} { + set S(-title) [::msgcat::mc "Font"] + } + if {[winfo exists $S(W)] && ("-font" in $args)} { + Init $S(-font) + event generate $S(-parent) <> + } + return $r +} + +proc ::tk::fontchooser::Create {} { + variable S + set windowName __tk__fontchooser + if {$S(-parent) eq "."} { + set S(W) .$windowName + } else { + set S(W) $S(-parent).$windowName + } + + # Now build the dialog + if {![winfo exists $S(W)]} { + toplevel $S(W) -class TkFontDialog + if {[package provide tcltest] ne {}} {set ::tk_dialog $S(W)} + wm withdraw $S(W) + wm title $S(W) $S(-title) + wm transient $S(W) [winfo toplevel $S(-parent)] + + set scaling [tk scaling] + set sizeWidth [expr {int([string length [::msgcat::mc "&Size:"]] * $scaling)}] + + set outer [::ttk::frame $S(W).outer -padding {10 10}] + ::tk::AmpWidget ::ttk::label $S(W).font -text [::msgcat::mc "&Font:"] + ::tk::AmpWidget ::ttk::label $S(W).style -text [::msgcat::mc "Font st&yle:"] + ::tk::AmpWidget ::ttk::label $S(W).size -text [::msgcat::mc "&Size:"] -width $sizeWidth + ttk::entry $S(W).efont -width 18 \ + -textvariable [namespace which -variable S](font) + ttk::entry $S(W).estyle -width 10 \ + -textvariable [namespace which -variable S](style) + ttk::entry $S(W).esize -textvariable [namespace which -variable S](size) \ + -width 3 -validate key -validatecommand {string is double %P} + + ttk_slistbox $S(W).lfonts -height 7 -exportselection 0 \ + -selectmode browse -activestyle none \ + -listvariable [namespace which -variable S](fonts) + ttk_slistbox $S(W).lstyles -width 5 -height 7 -exportselection 0 \ + -selectmode browse -activestyle none \ + -listvariable [namespace which -variable S](styles) + ttk_slistbox $S(W).lsizes -width 4 -height 7 -exportselection 0 \ + -selectmode browse -activestyle none \ + -listvariable [namespace which -variable S](sizes) + + set WE $S(W).effects + ::ttk::labelframe $WE -text [::msgcat::mc "Effects"] + ::tk::AmpWidget ::ttk::checkbutton $WE.strike \ + -variable [namespace which -variable S](strike) \ + -text [::msgcat::mc "Stri&keout"] \ + -command [namespace code [list Click strike]] + ::tk::AmpWidget ::ttk::checkbutton $WE.under \ + -variable [namespace which -variable S](under) \ + -text [::msgcat::mc "&Underline"] \ + -command [namespace code [list Click under]] + + set bbox [::ttk::frame $S(W).bbox] + ::ttk::button $S(W).ok -text [::msgcat::mc OK] -default active\ + -command [namespace code [list Done 1]] + ::ttk::button $S(W).cancel -text [::msgcat::mc Cancel] \ + -command [namespace code [list Done 0]] + ::tk::AmpWidget ::ttk::button $S(W).apply -text [::msgcat::mc "&Apply"] \ + -command [namespace code [list Apply]] + wm protocol $S(W) WM_DELETE_WINDOW [namespace code [list Done 0]] + + # Calculate minimum sizes + ttk::scrollbar $S(W).tmpvs + set scroll_width [winfo reqwidth $S(W).tmpvs] + destroy $S(W).tmpvs + set minsize(gap) 10 + set minsize(bbox) [winfo reqwidth $S(W).ok] + set minsize(fonts) \ + [expr {[font measure TkDefaultFont "Helvetica"] + $scroll_width}] + set minsize(styles) \ + [expr {[font measure TkDefaultFont "Bold Italic"] + $scroll_width}] + set minsize(sizes) \ + [expr {[font measure TkDefaultFont "-99"] + $scroll_width}] + set min [expr {$minsize(gap) * 4}] + foreach {what width} [array get minsize] {incr min $width} + wm minsize $S(W) $min 260 + + bind $S(W) [namespace code [list Done 1]] + bind $S(W) [namespace code [list Done 0]] + bind $S(W) [namespace code [list Visibility %W 1]] + bind $S(W) [namespace code [list Visibility %W 0]] + bind $S(W) [namespace code [list Visibility %W 0]] + bind $S(W).lfonts.list <> [namespace code [list Click font]] + bind $S(W).lstyles.list <> [namespace code [list Click style]] + bind $S(W).lsizes.list <> [namespace code [list Click size]] + bind $S(W) [list ::tk::AltKeyInDialog $S(W) %A] + bind $S(W).font <> [list ::focus $S(W).efont] + bind $S(W).style <> [list ::focus $S(W).estyle] + bind $S(W).size <> [list ::focus $S(W).esize] + bind $S(W).apply <> [namespace code [list Apply]] + bind $WE.strike <> [list $WE.strike invoke] + bind $WE.under <> [list $WE.under invoke] + + set WS $S(W).sample + ::ttk::labelframe $WS -text [::msgcat::mc "Sample"] + ::ttk::label $WS.sample -relief sunken -anchor center \ + -textvariable [namespace which -variable S](sampletext) + set S(sample) $WS.sample + grid $WS.sample -sticky news -padx 6 -pady 4 + grid rowconfigure $WS 0 -weight 1 + grid columnconfigure $WS 0 -weight 1 + grid propagate $WS 0 + + grid $S(W).ok -in $bbox -sticky new -pady {0 2} + grid $S(W).cancel -in $bbox -sticky new -pady 2 + if {$S(-command) ne ""} { + grid $S(W).apply -in $bbox -sticky new -pady 2 + } + grid columnconfigure $bbox 0 -weight 1 + + grid $WE.strike -sticky w -padx 10 + grid $WE.under -sticky w -padx 10 -pady {0 30} + grid columnconfigure $WE 1 -weight 1 + + grid $S(W).font x $S(W).style x $S(W).size x -in $outer -sticky w + grid $S(W).efont x $S(W).estyle x $S(W).esize x $bbox -in $outer -sticky ew + grid $S(W).lfonts x $S(W).lstyles x $S(W).lsizes x ^ -in $outer -sticky news + grid $WE x $WS - - x ^ -in $outer -sticky news -pady {15 30} + grid configure $bbox -sticky n + grid rowconfigure $outer 2 -weight 1 + grid columnconfigure $outer {1 3 5} -minsize $minsize(gap) + grid columnconfigure $outer {0 2 4} -weight 1 + grid columnconfigure $outer 0 -minsize $minsize(fonts) + grid columnconfigure $outer 2 -minsize $minsize(styles) + grid columnconfigure $outer 4 -minsize $minsize(sizes) + grid columnconfigure $outer 6 -minsize $minsize(bbox) + + grid $outer -sticky news + grid rowconfigure $S(W) 0 -weight 1 + grid columnconfigure $S(W) 0 -weight 1 + + Init $S(-font) + + trace add variable [namespace which -variable S](size) \ + write [namespace code [list Tracer]] + trace add variable [namespace which -variable S](style) \ + write [namespace code [list Tracer]] + trace add variable [namespace which -variable S](font) \ + write [namespace code [list Tracer]] + } else { + Init $S(-font) + } + + return +} + +# ::tk::fontchooser::Done -- +# +# Handles teardown of the dialog, calling -command if needed +# +# Arguments: +# ok true if user pressed OK +# +proc ::tk::fontchooser::Done {ok} { + variable S + + if {! $ok} { + set S(result) "" + } + trace vdelete S(size) w [namespace code [list Tracer]] + trace vdelete S(style) w [namespace code [list Tracer]] + trace vdelete S(font) w [namespace code [list Tracer]] + destroy $S(W) + if {$ok && $S(-command) ne ""} { + uplevel #0 $S(-command) [list $S(result)] + } +} + +# ::tk::fontchooser::Apply -- +# +# Call the -command procedure appending the current font +# Errors are reported via the background error mechanism +# +proc ::tk::fontchooser::Apply {} { + variable S + if {$S(-command) ne ""} { + if {[catch {uplevel #0 $S(-command) [list $S(result)]} err]} { + ::bgerror $err + } + } + event generate $S(-parent) <> +} + +# ::tk::fontchooser::Init -- +# +# Initializes dialog to a default font +# +# Arguments: +# defaultFont font to use as the default +# +proc ::tk::fontchooser::Init {{defaultFont ""}} { + variable S + + if {$S(first) || $defaultFont ne ""} { + if {$defaultFont eq ""} { + set defaultFont [[entry .___e] cget -font] + destroy .___e + } + array set F [font actual $defaultFont] + set S(font) $F(-family) + set S(size) $F(-size) + set S(strike) $F(-overstrike) + set S(under) $F(-underline) + set S(style) [::msgcat::mc "Regular"] + if {$F(-weight) eq "bold" && $F(-slant) eq "italic"} { + set S(style) [::msgcat::mc "Bold Italic"] + } elseif {$F(-weight) eq "bold"} { + set S(style) [::msgcat::mc "Bold"] + } elseif {$F(-slant) eq "italic"} { + set S(style) [::msgcat::mc "Italic"] + } + + set S(first) 0 + } + + Tracer a b c + Update +} + +# ::tk::fontchooser::Click -- +# +# Handles all button clicks, updating the appropriate widgets +# +# Arguments: +# who which widget got pressed +# +proc ::tk::fontchooser::Click {who} { + variable S + + if {$who eq "font"} { + set S(font) [$S(W).lfonts get [$S(W).lfonts curselection]] + } elseif {$who eq "style"} { + set S(style) [$S(W).lstyles get [$S(W).lstyles curselection]] + } elseif {$who eq "size"} { + set S(size) [$S(W).lsizes get [$S(W).lsizes curselection]] + } + Update +} + +# ::tk::fontchooser::Tracer -- +# +# Handles traces on key variables, updating the appropriate widgets +# +# Arguments: +# standard trace arguments (not used) +# +proc ::tk::fontchooser::Tracer {var1 var2 op} { + variable S + + set bad 0 + set nstate normal + # Make selection in each listbox + foreach var {font style size} { + set value [string tolower $S($var)] + $S(W).l${var}s selection clear 0 end + set n [lsearch -exact $S(${var}s,lcase) $value] + $S(W).l${var}s selection set $n + if {$n >= 0} { + set S($var) [lindex $S(${var}s) $n] + $S(W).e$var icursor end + $S(W).e$var selection clear + } else { ;# No match, try prefix + # Size is weird: valid numbers are legal but don't display + # unless in the font size list + set n [lsearch -glob $S(${var}s,lcase) "$value*"] + set bad 1 + if {$var ne "size" || ! [string is double -strict $value]} { + set nstate disabled + } + } + $S(W).l${var}s see $n + } + if {!$bad} {Update} + $S(W).ok configure -state $nstate +} + +# ::tk::fontchooser::Update -- +# +# Shows a sample of the currently selected font +# +proc ::tk::fontchooser::Update {} { + variable S + + set S(result) [list $S(font) $S(size)] + if {$S(style) eq [::msgcat::mc "Bold"]} {lappend S(result) bold} + if {$S(style) eq [::msgcat::mc "Italic"]} {lappend S(result) italic} + if {$S(style) eq [::msgcat::mc "Bold Italic"]} {lappend S(result) bold italic} + if {$S(strike)} {lappend S(result) overstrike} + if {$S(under)} {lappend S(result) underline} + + $S(sample) configure -font $S(result) +} + +# ::tk::fontchooser::Visibility -- +# +# Notify the parent when the dialog visibility changes +# +proc ::tk::fontchooser::Visibility {w visible} { + variable S + if {$w eq $S(W)} { + event generate $S(-parent) <> + } +} + +# ::tk::fontchooser::ttk_listbox -- +# +# Create a properly themed scrolled listbox. +# This is exactly right on XP but may need adjusting on other platforms. +# +proc ::tk::fontchooser::ttk_slistbox {w args} { + set f [ttk::frame $w -style FontchooserFrame -padding 2] + if {[catch { + listbox $f.list -relief flat -highlightthickness 0 -borderwidth 0 {*}$args + ttk::scrollbar $f.vs -command [list $f.list yview] + $f.list configure -yscrollcommand [list $f.vs set] + grid $f.list $f.vs -sticky news + grid rowconfigure $f 0 -weight 1 + grid columnconfigure $f 0 -weight 1 + interp hide {} $w + interp alias {} $w {} $f.list + } err opt]} { + destroy $f + return -options $opt $err + } + return $w +} diff --git a/shared/package-files/08/081ee3b785d24720ac3ab9bbaf7ef597fcb7c9af7e00ddb017b048b575d06825/blob b/shared/package-files/08/081ee3b785d24720ac3ab9bbaf7ef597fcb7c9af7e00ddb017b048b575d06825/blob new file mode 100644 index 0000000000000000000000000000000000000000..65ba52b8bbf609d08d84a142eb6bab19b9cf2d4f --- /dev/null +++ b/shared/package-files/08/081ee3b785d24720ac3ab9bbaf7ef597fcb7c9af7e00ddb017b048b575d06825/blob @@ -0,0 +1,755 @@ +"""Implementation of code management magic functions. +""" +#----------------------------------------------------------------------------- +# Copyright (c) 2012 The IPython Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +# Stdlib +import inspect +import io +import os +import re +import sys +import ast +from itertools import chain +from urllib.request import Request, urlopen +from urllib.parse import urlencode +from pathlib import Path + +# Our own packages +from IPython.core.error import TryNext, StdinNotImplementedError, UsageError +from IPython.core.macro import Macro +from IPython.core.magic import Magics, magics_class, line_magic +from IPython.core.oinspect import find_file, find_source_lines +from IPython.core.release import version +from IPython.testing.skipdoctest import skip_doctest +from IPython.utils.contexts import preserve_keys +from IPython.utils.path import get_py_filename +from warnings import warn +from logging import error +from IPython.utils.text import get_text_list + +#----------------------------------------------------------------------------- +# Magic implementation classes +#----------------------------------------------------------------------------- + +# Used for exception handling in magic_edit +class MacroToEdit(ValueError): pass + +ipython_input_pat = re.compile(r"$") + +# To match, e.g. 8-10 1:5 :10 3- +range_re = re.compile(r""" +(?P\d+)? +((?P[\-:]) + (?P\d+)?)? +$""", re.VERBOSE) + + +def extract_code_ranges(ranges_str): + """Turn a string of range for %%load into 2-tuples of (start, stop) + ready to use as a slice of the content split by lines. + + Examples + -------- + list(extract_input_ranges("5-10 2")) + [(4, 10), (1, 2)] + """ + for range_str in ranges_str.split(): + rmatch = range_re.match(range_str) + if not rmatch: + continue + sep = rmatch.group("sep") + start = rmatch.group("start") + end = rmatch.group("end") + + if sep == '-': + start = int(start) - 1 if start else None + end = int(end) if end else None + elif sep == ':': + start = int(start) - 1 if start else None + end = int(end) - 1 if end else None + else: + end = int(start) + start = int(start) - 1 + yield (start, end) + + +def extract_symbols(code, symbols): + """ + Return a tuple (blocks, not_found) + where ``blocks`` is a list of code fragments + for each symbol parsed from code, and ``not_found`` are + symbols not found in the code. + + For example:: + + In [1]: code = '''a = 10 + ...: def b(): return 42 + ...: class A: pass''' + + In [2]: extract_symbols(code, 'A,b,z') + Out[2]: (['class A: pass\\n', 'def b(): return 42\\n'], ['z']) + """ + symbols = symbols.split(',') + + # this will raise SyntaxError if code isn't valid Python + py_code = ast.parse(code) + + marks = [(getattr(s, 'name', None), s.lineno) for s in py_code.body] + code = code.split('\n') + + symbols_lines = {} + + # we already know the start_lineno of each symbol (marks). + # To find each end_lineno, we traverse in reverse order until each + # non-blank line + end = len(code) + for name, start in reversed(marks): + while not code[end - 1].strip(): + end -= 1 + if name: + symbols_lines[name] = (start - 1, end) + end = start - 1 + + # Now symbols_lines is a map + # {'symbol_name': (start_lineno, end_lineno), ...} + + # fill a list with chunks of codes for each requested symbol + blocks = [] + not_found = [] + for symbol in symbols: + if symbol in symbols_lines: + start, end = symbols_lines[symbol] + blocks.append('\n'.join(code[start:end]) + '\n') + else: + not_found.append(symbol) + + return blocks, not_found + +def strip_initial_indent(lines): + """For %load, strip indent from lines until finding an unindented line. + + https://github.com/ipython/ipython/issues/9775 + """ + indent_re = re.compile(r'\s+') + + it = iter(lines) + first_line = next(it) + indent_match = indent_re.match(first_line) + + if indent_match: + # First line was indented + indent = indent_match.group() + yield first_line[len(indent):] + + for line in it: + if line.startswith(indent): + yield line[len(indent):] + else: + # Less indented than the first line - stop dedenting + yield line + break + else: + yield first_line + + # Pass the remaining lines through without dedenting + for line in it: + yield line + + +class InteractivelyDefined(Exception): + """Exception for interactively defined variable in magic_edit""" + def __init__(self, index): + self.index = index + + +@magics_class +class CodeMagics(Magics): + """Magics related to code management (loading, saving, editing, ...).""" + + def __init__(self, *args, **kwargs): + self._knowntemps = set() + super(CodeMagics, self).__init__(*args, **kwargs) + + @line_magic + def save(self, parameter_s=''): + """Save a set of lines or a macro to a given filename. + + Usage:\\ + %save [options] filename [history] + + Options: + + -r: use 'raw' input. By default, the 'processed' history is used, + so that magics are loaded in their transformed version to valid + Python. If this option is given, the raw input as typed as the + command line is used instead. + + -f: force overwrite. If file exists, %save will prompt for overwrite + unless -f is given. + + -a: append to the file instead of overwriting it. + + The history argument uses the same syntax as %history for input ranges, + then saves the lines to the filename you specify. + + If no ranges are specified, saves history of the current session up to + this point. + + It adds a '.py' extension to the file if you don't do so yourself, and + it asks for confirmation before overwriting existing files. + + If `-r` option is used, the default extension is `.ipy`. + """ + + opts,args = self.parse_options(parameter_s,'fra',mode='list') + if not args: + raise UsageError('Missing filename.') + raw = 'r' in opts + force = 'f' in opts + append = 'a' in opts + mode = 'a' if append else 'w' + ext = '.ipy' if raw else '.py' + fname, codefrom = args[0], " ".join(args[1:]) + if not fname.endswith(('.py','.ipy')): + fname += ext + fname = os.path.expanduser(fname) + file_exists = os.path.isfile(fname) + if file_exists and not force and not append: + try: + overwrite = self.shell.ask_yes_no('File `%s` exists. Overwrite (y/[N])? ' % fname, default='n') + except StdinNotImplementedError: + print("File `%s` exists. Use `%%save -f %s` to force overwrite" % (fname, parameter_s)) + return + if not overwrite : + print('Operation cancelled.') + return + try: + cmds = self.shell.find_user_code(codefrom,raw) + except (TypeError, ValueError) as e: + print(e.args[0]) + return + with io.open(fname, mode, encoding="utf-8") as f: + if not file_exists or not append: + f.write("# coding: utf-8\n") + f.write(cmds) + # make sure we end on a newline + if not cmds.endswith('\n'): + f.write('\n') + print('The following commands were written to file `%s`:' % fname) + print(cmds) + + @line_magic + def pastebin(self, parameter_s=''): + """Upload code to dpaste.com, returning the URL. + + Usage:\\ + %pastebin [-d "Custom description"][-e 24] 1-7 + + The argument can be an input history range, a filename, or the name of a + string or macro. + + If no arguments are given, uploads the history of this session up to + this point. + + Options: + + -d: Pass a custom description. The default will say + "Pasted from IPython". + -e: Pass number of days for the link to be expired. + The default will be 7 days. + """ + opts, args = self.parse_options(parameter_s, "d:e:") + + try: + code = self.shell.find_user_code(args) + except (ValueError, TypeError) as e: + print(e.args[0]) + return + + expiry_days = 7 + try: + expiry_days = int(opts.get("e", 7)) + except ValueError as e: + print(e.args[0].capitalize()) + return + if expiry_days < 1 or expiry_days > 365: + print("Expiry days should be in range of 1 to 365") + return + + post_data = urlencode( + { + "title": opts.get("d", "Pasted from IPython"), + "syntax": "python", + "content": code, + "expiry_days": expiry_days, + } + ).encode("utf-8") + + request = Request( + "https://dpaste.com/api/v2/", + headers={"User-Agent": "IPython v{}".format(version)}, + ) + response = urlopen(request, post_data) + return response.headers.get('Location') + + @line_magic + def loadpy(self, arg_s): + """Alias of `%load` + + `%loadpy` has gained some flexibility and dropped the requirement of a `.py` + extension. So it has been renamed simply into %load. You can look at + `%load`'s docstring for more info. + """ + self.load(arg_s) + + @line_magic + def load(self, arg_s): + """Load code into the current frontend. + + Usage:\\ + %load [options] source + + where source can be a filename, URL, input history range, macro, or + element in the user namespace + + If no arguments are given, loads the history of this session up to this + point. + + Options: + + -r : Specify lines or ranges of lines to load from the source. + Ranges could be specified as x-y (x..y) or in python-style x:y + (x..(y-1)). Both limits x and y can be left blank (meaning the + beginning and end of the file, respectively). + + -s : Specify function or classes to load from python source. + + -y : Don't ask confirmation for loading source above 200 000 characters. + + -n : Include the user's namespace when searching for source code. + + This magic command can either take a local filename, a URL, an history + range (see %history) or a macro as argument, it will prompt for + confirmation before loading source with more than 200 000 characters, unless + -y flag is passed or if the frontend does not support raw_input:: + + %load + %load myscript.py + %load 7-27 + %load myMacro + %load http://www.example.com/myscript.py + %load -r 5-10 myscript.py + %load -r 10-20,30,40: foo.py + %load -s MyClass,wonder_function myscript.py + %load -n MyClass + %load -n my_module.wonder_function + """ + opts,args = self.parse_options(arg_s,'yns:r:') + search_ns = 'n' in opts + contents = self.shell.find_user_code(args, search_ns=search_ns) + + if 's' in opts: + try: + blocks, not_found = extract_symbols(contents, opts['s']) + except SyntaxError: + # non python code + error("Unable to parse the input as valid Python code") + return + + if len(not_found) == 1: + warn('The symbol `%s` was not found' % not_found[0]) + elif len(not_found) > 1: + warn('The symbols %s were not found' % get_text_list(not_found, + wrap_item_with='`') + ) + + contents = '\n'.join(blocks) + + if 'r' in opts: + ranges = opts['r'].replace(',', ' ') + lines = contents.split('\n') + slices = extract_code_ranges(ranges) + contents = [lines[slice(*slc)] for slc in slices] + contents = '\n'.join(strip_initial_indent(chain.from_iterable(contents))) + + l = len(contents) + + # 200 000 is ~ 2500 full 80 character lines + # so in average, more than 5000 lines + if l > 200000 and 'y' not in opts: + try: + ans = self.shell.ask_yes_no(("The text you're trying to load seems pretty big"\ + " (%d characters). Continue (y/[N]) ?" % l), default='n' ) + except StdinNotImplementedError: + #assume yes if raw input not implemented + ans = True + + if ans is False : + print('Operation cancelled.') + return + + contents = "# %load {}\n".format(arg_s) + contents + + self.shell.set_next_input(contents, replace=True) + + @staticmethod + def _find_edit_target(shell, args, opts, last_call): + """Utility method used by magic_edit to find what to edit.""" + + def make_filename(arg): + "Make a filename from the given args" + try: + filename = get_py_filename(arg) + except IOError: + # If it ends with .py but doesn't already exist, assume we want + # a new file. + if arg.endswith('.py'): + filename = arg + else: + filename = None + return filename + + # Set a few locals from the options for convenience: + opts_prev = 'p' in opts + opts_raw = 'r' in opts + + # custom exceptions + class DataIsObject(Exception): pass + + # Default line number value + lineno = opts.get('n',None) + + if opts_prev: + args = '_%s' % last_call[0] + if args not in shell.user_ns: + args = last_call[1] + + # by default this is done with temp files, except when the given + # arg is a filename + use_temp = True + + data = '' + + # First, see if the arguments should be a filename. + filename = make_filename(args) + if filename: + use_temp = False + elif args: + # Mode where user specifies ranges of lines, like in %macro. + data = shell.extract_input_lines(args, opts_raw) + if not data: + try: + # Load the parameter given as a variable. If not a string, + # process it as an object instead (below) + + #print '*** args',args,'type',type(args) # dbg + data = eval(args, shell.user_ns) + if not isinstance(data, str): + raise DataIsObject + + except (NameError,SyntaxError): + # given argument is not a variable, try as a filename + filename = make_filename(args) + if filename is None: + warn("Argument given (%s) can't be found as a variable " + "or as a filename." % args) + return (None, None, None) + use_temp = False + + except DataIsObject as e: + # macros have a special edit function + if isinstance(data, Macro): + raise MacroToEdit(data) from e + + # For objects, try to edit the file where they are defined + filename = find_file(data) + if filename: + if 'fakemodule' in filename.lower() and \ + inspect.isclass(data): + # class created by %edit? Try to find source + # by looking for method definitions instead, the + # __module__ in those classes is FakeModule. + attrs = [getattr(data, aname) for aname in dir(data)] + for attr in attrs: + if not inspect.ismethod(attr): + continue + filename = find_file(attr) + if filename and \ + 'fakemodule' not in filename.lower(): + # change the attribute to be the edit + # target instead + data = attr + break + + m = ipython_input_pat.match(os.path.basename(filename)) + if m: + raise InteractivelyDefined(int(m.groups()[0])) from e + + datafile = 1 + if filename is None: + filename = make_filename(args) + datafile = 1 + if filename is not None: + # only warn about this if we get a real name + warn('Could not find file where `%s` is defined.\n' + 'Opening a file named `%s`' % (args, filename)) + # Now, make sure we can actually read the source (if it was + # in a temp file it's gone by now). + if datafile: + if lineno is None: + lineno = find_source_lines(data) + if lineno is None: + filename = make_filename(args) + if filename is None: + warn('The file where `%s` was defined ' + 'cannot be read or found.' % data) + return (None, None, None) + use_temp = False + + if use_temp: + filename = shell.mktempfile(data) + print('IPython will make a temporary file named:',filename) + + # use last_call to remember the state of the previous call, but don't + # let it be clobbered by successive '-p' calls. + try: + last_call[0] = shell.displayhook.prompt_count + if not opts_prev: + last_call[1] = args + except: + pass + + + return filename, lineno, use_temp + + def _edit_macro(self,mname,macro): + """open an editor with the macro data in a file""" + filename = self.shell.mktempfile(macro.value) + self.shell.hooks.editor(filename) + + # and make a new macro object, to replace the old one + mvalue = Path(filename).read_text(encoding="utf-8") + self.shell.user_ns[mname] = Macro(mvalue) + + @skip_doctest + @line_magic + def edit(self, parameter_s='',last_call=['','']): + """Bring up an editor and execute the resulting code. + + Usage: + %edit [options] [args] + + %edit runs IPython's editor hook. The default version of this hook is + set to call the editor specified by your $EDITOR environment variable. + If this isn't found, it will default to vi under Linux/Unix and to + notepad under Windows. See the end of this docstring for how to change + the editor hook. + + You can also set the value of this editor via the + ``TerminalInteractiveShell.editor`` option in your configuration file. + This is useful if you wish to use a different editor from your typical + default with IPython (and for Windows users who typically don't set + environment variables). + + This command allows you to conveniently edit multi-line code right in + your IPython session. + + If called without arguments, %edit opens up an empty editor with a + temporary file and will execute the contents of this file when you + close it (don't forget to save it!). + + + Options: + + -n : open the editor at a specified line number. By default, + the IPython editor hook uses the unix syntax 'editor +N filename', but + you can configure this by providing your own modified hook if your + favorite editor supports line-number specifications with a different + syntax. + + -p: this will call the editor with the same data as the previous time + it was used, regardless of how long ago (in your current session) it + was. + + -r: use 'raw' input. This option only applies to input taken from the + user's history. By default, the 'processed' history is used, so that + magics are loaded in their transformed version to valid Python. If + this option is given, the raw input as typed as the command line is + used instead. When you exit the editor, it will be executed by + IPython's own processor. + + -x: do not execute the edited code immediately upon exit. This is + mainly useful if you are editing programs which need to be called with + command line arguments, which you can then do using %run. + + + Arguments: + + If arguments are given, the following possibilities exist: + + - If the argument is a filename, IPython will load that into the + editor. It will execute its contents with execfile() when you exit, + loading any code in the file into your interactive namespace. + + - The arguments are ranges of input history, e.g. "7 ~1/4-6". + The syntax is the same as in the %history magic. + + - If the argument is a string variable, its contents are loaded + into the editor. You can thus edit any string which contains + python code (including the result of previous edits). + + - If the argument is the name of an object (other than a string), + IPython will try to locate the file where it was defined and open the + editor at the point where it is defined. You can use `%edit function` + to load an editor exactly at the point where 'function' is defined, + edit it and have the file be executed automatically. + + - If the object is a macro (see %macro for details), this opens up your + specified editor with a temporary file containing the macro's data. + Upon exit, the macro is reloaded with the contents of the file. + + Note: opening at an exact line is only supported under Unix, and some + editors (like kedit and gedit up to Gnome 2.8) do not understand the + '+NUMBER' parameter necessary for this feature. Good editors like + (X)Emacs, vi, jed, pico and joe all do. + + After executing your code, %edit will return as output the code you + typed in the editor (except when it was an existing file). This way + you can reload the code in further invocations of %edit as a variable, + via _ or Out[], where is the prompt number of + the output. + + Note that %edit is also available through the alias %ed. + + This is an example of creating a simple function inside the editor and + then modifying it. First, start up the editor:: + + In [1]: edit + Editing... done. Executing edited code... + Out[1]: 'def foo():\\n print "foo() was defined in an editing + session"\\n' + + We can then call the function foo():: + + In [2]: foo() + foo() was defined in an editing session + + Now we edit foo. IPython automatically loads the editor with the + (temporary) file where foo() was previously defined:: + + In [3]: edit foo + Editing... done. Executing edited code... + + And if we call foo() again we get the modified version:: + + In [4]: foo() + foo() has now been changed! + + Here is an example of how to edit a code snippet successive + times. First we call the editor:: + + In [5]: edit + Editing... done. Executing edited code... + hello + Out[5]: "print 'hello'\\n" + + Now we call it again with the previous output (stored in _):: + + In [6]: edit _ + Editing... done. Executing edited code... + hello world + Out[6]: "print 'hello world'\\n" + + Now we call it with the output #8 (stored in _8, also as Out[8]):: + + In [7]: edit _8 + Editing... done. Executing edited code... + hello again + Out[7]: "print 'hello again'\\n" + + + Changing the default editor hook: + + If you wish to write your own editor hook, you can put it in a + configuration file which you load at startup time. The default hook + is defined in the IPython.core.hooks module, and you can use that as a + starting example for further modifications. That file also has + general instructions on how to set a new hook for use once you've + defined it.""" + opts,args = self.parse_options(parameter_s,'prxn:') + + try: + filename, lineno, is_temp = self._find_edit_target(self.shell, + args, opts, last_call) + except MacroToEdit as e: + self._edit_macro(args, e.args[0]) + return + except InteractivelyDefined as e: + print("Editing In[%i]" % e.index) + args = str(e.index) + filename, lineno, is_temp = self._find_edit_target(self.shell, + args, opts, last_call) + if filename is None: + # nothing was found, warnings have already been issued, + # just give up. + return + + if is_temp: + self._knowntemps.add(filename) + elif (filename in self._knowntemps): + is_temp = True + + + # do actual editing here + print('Editing...', end=' ') + sys.stdout.flush() + filepath = Path(filename) + try: + # Quote filenames that may have spaces in them when opening + # the editor + quoted = filename = str(filepath.absolute()) + if " " in quoted: + quoted = "'%s'" % quoted + self.shell.hooks.editor(quoted, lineno) + except TryNext: + warn('Could not open editor') + return + + # XXX TODO: should this be generalized for all string vars? + # For now, this is special-cased to blocks created by cpaste + if args.strip() == "pasted_block": + self.shell.user_ns["pasted_block"] = filepath.read_text(encoding="utf-8") + + if 'x' in opts: # -x prevents actual execution + print() + else: + print('done. Executing edited code...') + with preserve_keys(self.shell.user_ns, '__file__'): + if not is_temp: + self.shell.user_ns["__file__"] = filename + if "r" in opts: # Untranslated IPython code + source = filepath.read_text(encoding="utf-8") + self.shell.run_cell(source, store_history=False) + else: + self.shell.safe_execfile(filename, self.shell.user_ns, + self.shell.user_ns) + + if is_temp: + try: + return filepath.read_text(encoding="utf-8") + except IOError as msg: + if Path(msg.filename) == filepath: + warn('File not found. Did you forget to save?') + return + else: + self.shell.showtraceback() diff --git a/shared/package-files/08/081ef817a8a64aebd16fb7dfceda03dd5a0884c67a72e8add1416bf9da318a69/blob b/shared/package-files/08/081ef817a8a64aebd16fb7dfceda03dd5a0884c67a72e8add1416bf9da318a69/blob new file mode 100644 index 0000000000000000000000000000000000000000..3aa4e94f3a6ca42685230fba064f004d0f3232a2 --- /dev/null +++ b/shared/package-files/08/081ef817a8a64aebd16fb7dfceda03dd5a0884c67a72e8add1416bf9da318a69/blob @@ -0,0 +1,203 @@ +"Provides for superficial grammar analysis." + +from collections import Counter, defaultdict +from typing import List, Dict, Iterator, FrozenSet, Set + +from ..utils import bfs, fzset, classify +from ..exceptions import GrammarError +from ..grammar import Rule, Terminal, NonTerminal, Symbol +from ..common import ParserConf + + +class RulePtr: + __slots__ = ('rule', 'index') + rule: Rule + index: int + + def __init__(self, rule: Rule, index: int): + assert isinstance(rule, Rule) + assert index <= len(rule.expansion) + self.rule = rule + self.index = index + + def __repr__(self): + before = [x.name for x in self.rule.expansion[:self.index]] + after = [x.name for x in self.rule.expansion[self.index:]] + return '<%s : %s * %s>' % (self.rule.origin.name, ' '.join(before), ' '.join(after)) + + @property + def next(self) -> Symbol: + return self.rule.expansion[self.index] + + def advance(self, sym: Symbol) -> 'RulePtr': + assert self.next == sym + return RulePtr(self.rule, self.index+1) + + @property + def is_satisfied(self) -> bool: + return self.index == len(self.rule.expansion) + + def __eq__(self, other) -> bool: + if not isinstance(other, RulePtr): + return NotImplemented + return self.rule == other.rule and self.index == other.index + + def __hash__(self) -> int: + return hash((self.rule, self.index)) + + +State = FrozenSet[RulePtr] + +# state generation ensures no duplicate LR0ItemSets +class LR0ItemSet: + __slots__ = ('kernel', 'closure', 'transitions', 'lookaheads') + + kernel: State + closure: State + transitions: Dict[Symbol, 'LR0ItemSet'] + lookaheads: Dict[Symbol, Set[Rule]] + + def __init__(self, kernel, closure): + self.kernel = fzset(kernel) + self.closure = fzset(closure) + self.transitions = {} + self.lookaheads = defaultdict(set) + + def __repr__(self): + return '{%s | %s}' % (', '.join([repr(r) for r in self.kernel]), ', '.join([repr(r) for r in self.closure])) + + +def update_set(set1, set2): + if not set2 or set1 > set2: + return False + + copy = set(set1) + set1 |= set2 + return set1 != copy + +def calculate_sets(rules): + """Calculate FOLLOW sets. + + Adapted from: http://lara.epfl.ch/w/cc09:algorithm_for_first_and_follow_sets""" + symbols = {sym for rule in rules for sym in rule.expansion} | {rule.origin for rule in rules} + + # foreach grammar rule X ::= Y(1) ... Y(k) + # if k=0 or {Y(1),...,Y(k)} subset of NULLABLE then + # NULLABLE = NULLABLE union {X} + # for i = 1 to k + # if i=1 or {Y(1),...,Y(i-1)} subset of NULLABLE then + # FIRST(X) = FIRST(X) union FIRST(Y(i)) + # for j = i+1 to k + # if i=k or {Y(i+1),...Y(k)} subset of NULLABLE then + # FOLLOW(Y(i)) = FOLLOW(Y(i)) union FOLLOW(X) + # if i+1=j or {Y(i+1),...,Y(j-1)} subset of NULLABLE then + # FOLLOW(Y(i)) = FOLLOW(Y(i)) union FIRST(Y(j)) + # until none of NULLABLE,FIRST,FOLLOW changed in last iteration + + NULLABLE = set() + FIRST = {} + FOLLOW = {} + for sym in symbols: + FIRST[sym]={sym} if sym.is_term else set() + FOLLOW[sym]=set() + + # Calculate NULLABLE and FIRST + changed = True + while changed: + changed = False + + for rule in rules: + if set(rule.expansion) <= NULLABLE: + if update_set(NULLABLE, {rule.origin}): + changed = True + + for i, sym in enumerate(rule.expansion): + if set(rule.expansion[:i]) <= NULLABLE: + if update_set(FIRST[rule.origin], FIRST[sym]): + changed = True + else: + break + + # Calculate FOLLOW + changed = True + while changed: + changed = False + + for rule in rules: + for i, sym in enumerate(rule.expansion): + if i==len(rule.expansion)-1 or set(rule.expansion[i+1:]) <= NULLABLE: + if update_set(FOLLOW[sym], FOLLOW[rule.origin]): + changed = True + + for j in range(i+1, len(rule.expansion)): + if set(rule.expansion[i+1:j]) <= NULLABLE: + if update_set(FOLLOW[sym], FIRST[rule.expansion[j]]): + changed = True + + return FIRST, FOLLOW, NULLABLE + + +class GrammarAnalyzer: + def __init__(self, parser_conf: ParserConf, debug: bool=False, strict: bool=False): + self.debug = debug + self.strict = strict + + root_rules = {start: Rule(NonTerminal('$root_' + start), [NonTerminal(start), Terminal('$END')]) + for start in parser_conf.start} + + rules = parser_conf.rules + list(root_rules.values()) + self.rules_by_origin: Dict[NonTerminal, List[Rule]] = classify(rules, lambda r: r.origin) + + if len(rules) != len(set(rules)): + duplicates = [item for item, count in Counter(rules).items() if count > 1] + raise GrammarError("Rules defined twice: %s" % ', '.join(str(i) for i in duplicates)) + + for r in rules: + for sym in r.expansion: + if not (sym.is_term or sym in self.rules_by_origin): + raise GrammarError("Using an undefined rule: %s" % sym) + + self.start_states = {start: self.expand_rule(root_rule.origin) + for start, root_rule in root_rules.items()} + + self.end_states = {start: fzset({RulePtr(root_rule, len(root_rule.expansion))}) + for start, root_rule in root_rules.items()} + + lr0_root_rules = {start: Rule(NonTerminal('$root_' + start), [NonTerminal(start)]) + for start in parser_conf.start} + + lr0_rules = parser_conf.rules + list(lr0_root_rules.values()) + assert(len(lr0_rules) == len(set(lr0_rules))) + + self.lr0_rules_by_origin = classify(lr0_rules, lambda r: r.origin) + + # cache RulePtr(r, 0) in r (no duplicate RulePtr objects) + self.lr0_start_states = {start: LR0ItemSet([RulePtr(root_rule, 0)], self.expand_rule(root_rule.origin, self.lr0_rules_by_origin)) + for start, root_rule in lr0_root_rules.items()} + + self.FIRST, self.FOLLOW, self.NULLABLE = calculate_sets(rules) + + def expand_rule(self, source_rule: NonTerminal, rules_by_origin=None) -> State: + "Returns all init_ptrs accessible by rule (recursive)" + + if rules_by_origin is None: + rules_by_origin = self.rules_by_origin + + init_ptrs = set() + def _expand_rule(rule: NonTerminal) -> Iterator[NonTerminal]: + assert not rule.is_term, rule + + for r in rules_by_origin[rule]: + init_ptr = RulePtr(r, 0) + init_ptrs.add(init_ptr) + + if r.expansion: # if not empty rule + new_r = init_ptr.next + if not new_r.is_term: + assert isinstance(new_r, NonTerminal) + yield new_r + + for _ in bfs([source_rule], _expand_rule): + pass + + return fzset(init_ptrs) diff --git a/shared/package-files/08/0824daa4f11e187f7b88ab15b0f4855f441195175d4e353f4b9f31ac72f5f5b4/blob b/shared/package-files/08/0824daa4f11e187f7b88ab15b0f4855f441195175d4e353f4b9f31ac72f5f5b4/blob new file mode 100644 index 0000000000000000000000000000000000000000..956254b39fc10b15f66e17e5cafc5d610963c336 --- /dev/null +++ b/shared/package-files/08/0824daa4f11e187f7b88ab15b0f4855f441195175d4e353f4b9f31ac72f5f5b4/blob @@ -0,0 +1,330 @@ +import platform +from ctypes import (POINTER, c_char_p, c_bool, c_void_p, + c_int, c_uint64, c_size_t, CFUNCTYPE, string_at, cast, + py_object, Structure) + +from llvmlite.binding import ffi, targets, object_file + + +# Just check these weren't optimized out of the DLL. +ffi.lib.LLVMPY_LinkInMCJIT + + +def create_mcjit_compiler(module, target_machine, use_lmm=None): + """ + Create a MCJIT ExecutionEngine from the given *module* and + *target_machine*. + + *lmm* controls whether the llvmlite memory manager is used. If not supplied, + the default choice for the platform will be used (``True`` on 64-bit ARM + systems, ``False`` otherwise). + """ + if use_lmm is None: + use_lmm = platform.machine().lower() in ('arm64', 'aarch64') + + with ffi.OutputString() as outerr: + engine = ffi.lib.LLVMPY_CreateMCJITCompiler( + module, target_machine, use_lmm, outerr) + if not engine: + raise RuntimeError(str(outerr)) + + target_machine._owned = True + return ExecutionEngine(engine, module=module) + + +def check_jit_execution(): + """ + Check the system allows execution of in-memory JITted functions. + An exception is raised otherwise. + """ + errno = ffi.lib.LLVMPY_TryAllocateExecutableMemory() + if errno != 0: + raise OSError(errno, + "cannot allocate executable memory. " + "This may be due to security restrictions on your " + "system, such as SELinux or similar mechanisms." + ) + + +class ExecutionEngine(ffi.ObjectRef): + """An ExecutionEngine owns all Modules associated with it. + Deleting the engine will remove all associated modules. + It is an error to delete the associated modules. + """ + _object_cache = None + + def __init__(self, ptr, module): + """ + Module ownership is transferred to the EE + """ + self._modules = set([module]) + self._td = None + module._owned = True + ffi.ObjectRef.__init__(self, ptr) + + def get_function_address(self, name): + """ + Return the address of the function named *name* as an integer. + + It's a fatal error in LLVM if the symbol of *name* doesn't exist. + """ + return ffi.lib.LLVMPY_GetFunctionAddress(self, name.encode("ascii")) + + def get_global_value_address(self, name): + """ + Return the address of the global value named *name* as an integer. + + It's a fatal error in LLVM if the symbol of *name* doesn't exist. + """ + return ffi.lib.LLVMPY_GetGlobalValueAddress(self, name.encode("ascii")) + + def add_global_mapping(self, gv, addr): + ffi.lib.LLVMPY_AddGlobalMapping(self, gv, addr) + + def add_module(self, module): + """ + Ownership of module is transferred to the execution engine + """ + if module in self._modules: + raise KeyError("module already added to this engine") + ffi.lib.LLVMPY_AddModule(self, module) + module._owned = True + self._modules.add(module) + + def finalize_object(self): + """ + Make sure all modules owned by the execution engine are fully processed + and "usable" for execution. + """ + ffi.lib.LLVMPY_FinalizeObject(self) + + def run_static_constructors(self): + """ + Run static constructors which initialize module-level static objects. + """ + ffi.lib.LLVMPY_RunStaticConstructors(self) + + def run_static_destructors(self): + """ + Run static destructors which perform module-level cleanup of static + resources. + """ + ffi.lib.LLVMPY_RunStaticDestructors(self) + + def remove_module(self, module): + """ + Ownership of module is returned + """ + with ffi.OutputString() as outerr: + if ffi.lib.LLVMPY_RemoveModule(self, module, outerr): + raise RuntimeError(str(outerr)) + self._modules.remove(module) + module._owned = False + + @property + def target_data(self): + """ + The TargetData for this execution engine. + """ + if self._td is not None: + return self._td + ptr = ffi.lib.LLVMPY_GetExecutionEngineTargetData(self) + self._td = targets.TargetData(ptr) + self._td._owned = True + return self._td + + def enable_jit_events(self): + """ + Enable JIT events for profiling of generated code. + Return value indicates whether connection to profiling tool + was successful. + """ + ret = ffi.lib.LLVMPY_EnableJITEvents(self) + return ret + + def _find_module_ptr(self, module_ptr): + """ + Find the ModuleRef corresponding to the given pointer. + """ + ptr = cast(module_ptr, c_void_p).value + for module in self._modules: + if cast(module._ptr, c_void_p).value == ptr: + return module + return None + + def add_object_file(self, obj_file): + """ + Add object file to the jit. object_file can be instance of + :class:ObjectFile or a string representing file system path + """ + if isinstance(obj_file, str): + obj_file = object_file.ObjectFileRef.from_path(obj_file) + + ffi.lib.LLVMPY_MCJITAddObjectFile(self, obj_file) + + def set_object_cache(self, notify_func=None, getbuffer_func=None): + """ + Set the object cache "notifyObjectCompiled" and "getBuffer" + callbacks to the given Python functions. + """ + self._object_cache_notify = notify_func + self._object_cache_getbuffer = getbuffer_func + # Lifetime of the object cache is managed by us. + self._object_cache = _ObjectCacheRef(self) + # Note this doesn't keep a reference to self, to avoid reference + # cycles. + ffi.lib.LLVMPY_SetObjectCache(self, self._object_cache) + + def _raw_object_cache_notify(self, data): + """ + Low-level notify hook. + """ + if self._object_cache_notify is None: + return + module_ptr = data.contents.module_ptr + buf_ptr = data.contents.buf_ptr + buf_len = data.contents.buf_len + buf = string_at(buf_ptr, buf_len) + module = self._find_module_ptr(module_ptr) + if module is None: + # The LLVM EE should only give notifications for modules + # known by us. + raise RuntimeError("object compilation notification " + "for unknown module %s" % (module_ptr,)) + self._object_cache_notify(module, buf) + + def _raw_object_cache_getbuffer(self, data): + """ + Low-level getbuffer hook. + """ + if self._object_cache_getbuffer is None: + return + module_ptr = data.contents.module_ptr + module = self._find_module_ptr(module_ptr) + if module is None: + # The LLVM EE should only give notifications for modules + # known by us. + raise RuntimeError("object compilation notification " + "for unknown module %s" % (module_ptr,)) + + buf = self._object_cache_getbuffer(module) + if buf is not None: + # Create a copy, which will be freed by the caller + data[0].buf_ptr = ffi.lib.LLVMPY_CreateByteString(buf, len(buf)) + data[0].buf_len = len(buf) + + def _dispose(self): + # The modules will be cleaned up by the EE + for mod in self._modules: + mod.detach() + if self._td is not None: + self._td.detach() + self._modules.clear() + self._object_cache = None + self._capi.LLVMPY_DisposeExecutionEngine(self) + + +class _ObjectCacheRef(ffi.ObjectRef): + """ + Internal: an ObjectCache instance for use within an ExecutionEngine. + """ + + def __init__(self, obj): + ptr = ffi.lib.LLVMPY_CreateObjectCache(_notify_c_hook, + _getbuffer_c_hook, + obj) + ffi.ObjectRef.__init__(self, ptr) + + def _dispose(self): + self._capi.LLVMPY_DisposeObjectCache(self) + + +# ============================================================================ +# FFI + + +ffi.lib.LLVMPY_CreateMCJITCompiler.argtypes = [ + ffi.LLVMModuleRef, + ffi.LLVMTargetMachineRef, + c_bool, + POINTER(c_char_p), +] +ffi.lib.LLVMPY_CreateMCJITCompiler.restype = ffi.LLVMExecutionEngineRef + +ffi.lib.LLVMPY_RemoveModule.argtypes = [ + ffi.LLVMExecutionEngineRef, + ffi.LLVMModuleRef, + POINTER(c_char_p), +] +ffi.lib.LLVMPY_RemoveModule.restype = c_bool + +ffi.lib.LLVMPY_AddModule.argtypes = [ + ffi.LLVMExecutionEngineRef, + ffi.LLVMModuleRef +] + +ffi.lib.LLVMPY_AddGlobalMapping.argtypes = [ffi.LLVMExecutionEngineRef, + ffi.LLVMValueRef, + c_void_p] + +ffi.lib.LLVMPY_FinalizeObject.argtypes = [ffi.LLVMExecutionEngineRef] + +ffi.lib.LLVMPY_GetExecutionEngineTargetData.argtypes = [ + ffi.LLVMExecutionEngineRef +] +ffi.lib.LLVMPY_GetExecutionEngineTargetData.restype = ffi.LLVMTargetDataRef + +ffi.lib.LLVMPY_TryAllocateExecutableMemory.argtypes = [] +ffi.lib.LLVMPY_TryAllocateExecutableMemory.restype = c_int + +ffi.lib.LLVMPY_GetFunctionAddress.argtypes = [ + ffi.LLVMExecutionEngineRef, + c_char_p +] +ffi.lib.LLVMPY_GetFunctionAddress.restype = c_uint64 + +ffi.lib.LLVMPY_GetGlobalValueAddress.argtypes = [ + ffi.LLVMExecutionEngineRef, + c_char_p +] +ffi.lib.LLVMPY_GetGlobalValueAddress.restype = c_uint64 + +ffi.lib.LLVMPY_MCJITAddObjectFile.argtypes = [ + ffi.LLVMExecutionEngineRef, + ffi.LLVMObjectFileRef +] + + +class _ObjectCacheData(Structure): + _fields_ = [ + ('module_ptr', ffi.LLVMModuleRef), + ('buf_ptr', c_void_p), + ('buf_len', c_size_t), + ] + + +_ObjectCacheNotifyFunc = CFUNCTYPE(None, py_object, + POINTER(_ObjectCacheData)) +_ObjectCacheGetBufferFunc = CFUNCTYPE(None, py_object, + POINTER(_ObjectCacheData)) + +# XXX The ctypes function wrappers are created at the top-level, otherwise +# there are issues when creating CFUNCTYPEs in child processes on CentOS 5 +# 32 bits. +_notify_c_hook = _ObjectCacheNotifyFunc( + ExecutionEngine._raw_object_cache_notify) +_getbuffer_c_hook = _ObjectCacheGetBufferFunc( + ExecutionEngine._raw_object_cache_getbuffer) + +ffi.lib.LLVMPY_CreateObjectCache.argtypes = [_ObjectCacheNotifyFunc, + _ObjectCacheGetBufferFunc, + py_object] +ffi.lib.LLVMPY_CreateObjectCache.restype = ffi.LLVMObjectCacheRef + +ffi.lib.LLVMPY_DisposeObjectCache.argtypes = [ffi.LLVMObjectCacheRef] + +ffi.lib.LLVMPY_SetObjectCache.argtypes = [ffi.LLVMExecutionEngineRef, + ffi.LLVMObjectCacheRef] + +ffi.lib.LLVMPY_CreateByteString.restype = c_void_p +ffi.lib.LLVMPY_CreateByteString.argtypes = [c_void_p, c_size_t] diff --git a/shared/package-files/08/0824e40a2e60f1757e0c94f1f125c26a2111d250d97d98e672afac7da09a27ec/blob b/shared/package-files/08/0824e40a2e60f1757e0c94f1f125c26a2111d250d97d98e672afac7da09a27ec/blob new file mode 100644 index 0000000000000000000000000000000000000000..ce96b40c3dc3ece19c59c1be2ea5ebaed063678e --- /dev/null +++ b/shared/package-files/08/0824e40a2e60f1757e0c94f1f125c26a2111d250d97d98e672afac7da09a27ec/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor add(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1); +TORCH_API at::Tensor & add_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1); +TORCH_API at::Tensor & add_outf(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha, at::Tensor & out); +TORCH_API at::Tensor & add_(at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/08/0827b1cd3d6592c4c6fd6bc6bc79faf82b9677f657a05be23469c165dfe113b6/blob b/shared/package-files/08/0827b1cd3d6592c4c6fd6bc6bc79faf82b9677f657a05be23469c165dfe113b6/blob new file mode 100644 index 0000000000000000000000000000000000000000..4b9fd0d80a6e05652c5151f5dfece2c5979dbfe5 --- /dev/null +++ b/shared/package-files/08/0827b1cd3d6592c4c6fd6bc6bc79faf82b9677f657a05be23469c165dfe113b6/blob @@ -0,0 +1,172 @@ +import numpy as np +import numpy.ma as ma +import scipy.stats.mstats as ms + +from numpy.testing import (assert_equal, assert_almost_equal, assert_, + assert_allclose) + + +def test_compare_medians_ms(): + x = np.arange(7) + y = x + 10 + assert_almost_equal(ms.compare_medians_ms(x, y), 0) + + y2 = np.linspace(0, 1, num=10) + assert_almost_equal(ms.compare_medians_ms(x, y2), 0.017116406778) + + +def test_hdmedian(): + # 1-D array + x = ma.arange(11) + assert_allclose(ms.hdmedian(x), 5, rtol=1e-14) + x.mask = ma.make_mask(x) + x.mask[:7] = False + assert_allclose(ms.hdmedian(x), 3, rtol=1e-14) + + # Check that `var` keyword returns a value. TODO: check whether returned + # value is actually correct. + assert_(ms.hdmedian(x, var=True).size == 2) + + # 2-D array + x2 = ma.arange(22).reshape((11, 2)) + assert_allclose(ms.hdmedian(x2, axis=0), [10, 11]) + x2.mask = ma.make_mask(x2) + x2.mask[:7, :] = False + assert_allclose(ms.hdmedian(x2, axis=0), [6, 7]) + + +def test_rsh(): + np.random.seed(132345) + x = np.random.randn(100) + res = ms.rsh(x) + # Just a sanity check that the code runs and output shape is correct. + # TODO: check that implementation is correct. + assert_(res.shape == x.shape) + + # Check points keyword + res = ms.rsh(x, points=[0, 1.]) + assert_(res.size == 2) + + +def test_mjci(): + # Tests the Marits-Jarrett estimator + data = ma.array([77, 87, 88,114,151,210,219,246,253,262, + 296,299,306,376,428,515,666,1310,2611]) + assert_almost_equal(ms.mjci(data),[55.76819,45.84028,198.87875],5) + + +def test_trimmed_mean_ci(): + # Tests the confidence intervals of the trimmed mean. + data = ma.array([545,555,558,572,575,576,578,580, + 594,605,635,651,653,661,666]) + assert_almost_equal(ms.trimmed_mean(data,0.2), 596.2, 1) + assert_equal(np.round(ms.trimmed_mean_ci(data,(0.2,0.2)),1), + [561.8, 630.6]) + + +def test_idealfourths(): + # Tests ideal-fourths + test = np.arange(100) + assert_almost_equal(np.asarray(ms.idealfourths(test)), + [24.416667,74.583333],6) + test_2D = test.repeat(3).reshape(-1,3) + assert_almost_equal(ms.idealfourths(test_2D, axis=0), + [[24.416667,24.416667,24.416667], + [74.583333,74.583333,74.583333]],6) + assert_almost_equal(ms.idealfourths(test_2D, axis=1), + test.repeat(2).reshape(-1,2)) + test = [0, 0] + _result = ms.idealfourths(test) + assert_(np.isnan(_result).all()) + + +class TestQuantiles: + data = [0.706560797,0.727229578,0.990399276,0.927065621,0.158953014, + 0.887764025,0.239407086,0.349638551,0.972791145,0.149789972, + 0.936947700,0.132359948,0.046041972,0.641675031,0.945530547, + 0.224218684,0.771450991,0.820257774,0.336458052,0.589113496, + 0.509736129,0.696838829,0.491323573,0.622767425,0.775189248, + 0.641461450,0.118455200,0.773029450,0.319280007,0.752229111, + 0.047841438,0.466295911,0.583850781,0.840581845,0.550086491, + 0.466470062,0.504765074,0.226855960,0.362641207,0.891620942, + 0.127898691,0.490094097,0.044882048,0.041441695,0.317976349, + 0.504135618,0.567353033,0.434617473,0.636243375,0.231803616, + 0.230154113,0.160011327,0.819464108,0.854706985,0.438809221, + 0.487427267,0.786907310,0.408367937,0.405534192,0.250444460, + 0.995309248,0.144389588,0.739947527,0.953543606,0.680051621, + 0.388382017,0.863530727,0.006514031,0.118007779,0.924024803, + 0.384236354,0.893687694,0.626534881,0.473051932,0.750134705, + 0.241843555,0.432947602,0.689538104,0.136934797,0.150206859, + 0.474335206,0.907775349,0.525869295,0.189184225,0.854284286, + 0.831089744,0.251637345,0.587038213,0.254475554,0.237781276, + 0.827928620,0.480283781,0.594514455,0.213641488,0.024194386, + 0.536668589,0.699497811,0.892804071,0.093835427,0.731107772] + + def test_hdquantiles(self): + data = self.data + assert_almost_equal(ms.hdquantiles(data,[0., 1.]), + [0.006514031, 0.995309248]) + hdq = ms.hdquantiles(data,[0.25, 0.5, 0.75]) + assert_almost_equal(hdq, [0.253210762, 0.512847491, 0.762232442,]) + + data = np.array(data).reshape(10,10) + hdq = ms.hdquantiles(data,[0.25,0.5,0.75],axis=0) + assert_almost_equal(hdq[:,0], ms.hdquantiles(data[:,0],[0.25,0.5,0.75])) + assert_almost_equal(hdq[:,-1], ms.hdquantiles(data[:,-1],[0.25,0.5,0.75])) + hdq = ms.hdquantiles(data,[0.25,0.5,0.75],axis=0,var=True) + assert_almost_equal(hdq[...,0], + ms.hdquantiles(data[:,0],[0.25,0.5,0.75],var=True)) + assert_almost_equal(hdq[...,-1], + ms.hdquantiles(data[:,-1],[0.25,0.5,0.75], var=True)) + + def test_hdquantiles_sd(self): + # Standard deviation is a jackknife estimator, so we can check if + # the efficient version (hdquantiles_sd) matches a rudimentary, + # but clear version here. + + hd_std_errs = ms.hdquantiles_sd(self.data) + + # jacknnife standard error, Introduction to the Bootstrap Eq. 11.5 + n = len(self.data) + jdata = np.broadcast_to(self.data, (n, n)) + jselector = np.logical_not(np.eye(n)) # leave out one sample each row + jdata = jdata[jselector].reshape(n, n-1) + jdist = ms.hdquantiles(jdata, axis=1) + jdist_mean = np.mean(jdist, axis=0) + jstd = ((n-1)/n * np.sum((jdist - jdist_mean)**2, axis=0))**.5 + + assert_almost_equal(hd_std_errs, jstd) + # Test actual values for good measure + assert_almost_equal(hd_std_errs, [0.0379258, 0.0380656, 0.0380013]) + + two_data_points = ms.hdquantiles_sd([1, 2]) + assert_almost_equal(two_data_points, [0.5, 0.5, 0.5]) + + def test_mquantiles_cimj(self): + # Only test that code runs, implementation not checked for correctness + ci_lower, ci_upper = ms.mquantiles_cimj(self.data) + assert_(ci_lower.size == ci_upper.size == 3) + + +def test_median_cihs(): + # Basic test against R library EnvStats function `eqnpar`, e.g. + # library(EnvStats) + # options(digits=8) + # x = c(0.88612955, 0.35242375, 0.66240904, 0.94617974, 0.10929913, + # 0.76699506, 0.88550655, 0.62763754, 0.76818588, 0.68506508, + # 0.88043148, 0.03911248, 0.93805564, 0.95326961, 0.25291112, + # 0.16128487, 0.49784577, 0.24588924, 0.6597, 0.92239679) + # eqnpar(x, p=0.5, + # ci.method = "interpolate", approx.conf.level = 0.95, ci = TRUE) + rng = np.random.default_rng(8824288259505800535) + x = rng.random(size=20) + assert_allclose(ms.median_cihs(x), (0.38663198, 0.88431272)) + + # SciPy's 90% CI upper limit doesn't match that of EnvStats eqnpar. SciPy + # doesn't look wrong, and it agrees with a different reference, + # `median_confint_hs` from `hoehleatsu/quantileCI`. + # In (e.g.) Colab with R runtime: + # devtools::install_github("hoehleatsu/quantileCI") + # library(quantileCI) + # median_confint_hs(x=x, conf.level=0.90, interpolate=TRUE) + assert_allclose(ms.median_cihs(x, 0.1), (0.48319773366, 0.88094268050)) diff --git a/shared/package-files/08/08291913035c258ae6872b8156bf782b03058c7b1b2fa98e259d9fe5a19c0115/blob b/shared/package-files/08/08291913035c258ae6872b8156bf782b03058c7b1b2fa98e259d9fe5a19c0115/blob new file mode 100644 index 0000000000000000000000000000000000000000..3c7c3feec9f7add1109e56901bdc9973007384cf --- /dev/null +++ b/shared/package-files/08/08291913035c258ae6872b8156bf782b03058c7b1b2fa98e259d9fe5a19c0115/blob @@ -0,0 +1,2273 @@ +from __future__ import annotations +from typing import Any + +from functools import reduce +from itertools import permutations + +from sympy.combinatorics import Permutation +from sympy.core import ( + Basic, Expr, Function, diff, + Pow, Mul, Add, Lambda, S, Tuple, Dict +) +from sympy.core.cache import cacheit + +from sympy.core.symbol import Symbol, Dummy +from sympy.core.symbol import Str +from sympy.core.sympify import _sympify +from sympy.functions import factorial +from sympy.matrices import ImmutableDenseMatrix as Matrix +from sympy.solvers import solve + +from sympy.utilities.exceptions import (sympy_deprecation_warning, + SymPyDeprecationWarning, + ignore_warnings) + + +# TODO you are a bit excessive in the use of Dummies +# TODO dummy point, literal field +# TODO too often one needs to call doit or simplify on the output, check the +# tests and find out why +from sympy.tensor.array import ImmutableDenseNDimArray + + +class Manifold(Basic): + """ + A mathematical manifold. + + Explanation + =========== + + A manifold is a topological space that locally resembles + Euclidean space near each point [1]. + This class does not provide any means to study the topological + characteristics of the manifold that it represents, though. + + Parameters + ========== + + name : str + The name of the manifold. + + dim : int + The dimension of the manifold. + + Examples + ======== + + >>> from sympy.diffgeom import Manifold + >>> m = Manifold('M', 2) + >>> m + M + >>> m.dim + 2 + + References + ========== + + .. [1] https://en.wikipedia.org/wiki/Manifold + """ + + def __new__(cls, name, dim, **kwargs): + if not isinstance(name, Str): + name = Str(name) + dim = _sympify(dim) + obj = super().__new__(cls, name, dim) + + obj.patches = _deprecated_list( + """ + Manifold.patches is deprecated. The Manifold object is now + immutable. Instead use a separate list to keep track of the + patches. + """, []) + return obj + + @property + def name(self): + return self.args[0] + + @property + def dim(self): + return self.args[1] + + +class Patch(Basic): + """ + A patch on a manifold. + + Explanation + =========== + + Coordinate patch, or patch in short, is a simply-connected open set around + a point in the manifold [1]. On a manifold one can have many patches that + do not always include the whole manifold. On these patches coordinate + charts can be defined that permit the parameterization of any point on the + patch in terms of a tuple of real numbers (the coordinates). + + This class does not provide any means to study the topological + characteristics of the patch that it represents. + + Parameters + ========== + + name : str + The name of the patch. + + manifold : Manifold + The manifold on which the patch is defined. + + Examples + ======== + + >>> from sympy.diffgeom import Manifold, Patch + >>> m = Manifold('M', 2) + >>> p = Patch('P', m) + >>> p + P + >>> p.dim + 2 + + References + ========== + + .. [1] G. Sussman, J. Wisdom, W. Farr, Functional Differential Geometry + (2013) + + """ + def __new__(cls, name, manifold, **kwargs): + if not isinstance(name, Str): + name = Str(name) + obj = super().__new__(cls, name, manifold) + + obj.manifold.patches.append(obj) # deprecated + obj.coord_systems = _deprecated_list( + """ + Patch.coord_systms is deprecated. The Patch class is now + immutable. Instead use a separate list to keep track of coordinate + systems. + """, []) + return obj + + @property + def name(self): + return self.args[0] + + @property + def manifold(self): + return self.args[1] + + @property + def dim(self): + return self.manifold.dim + + +class CoordSystem(Basic): + """ + A coordinate system defined on the patch. + + Explanation + =========== + + Coordinate system is a system that uses one or more coordinates to uniquely + determine the position of the points or other geometric elements on a + manifold [1]. + + By passing ``Symbols`` to *symbols* parameter, user can define the name and + assumptions of coordinate symbols of the coordinate system. If not passed, + these symbols are generated automatically and are assumed to be real valued. + + By passing *relations* parameter, user can define the transform relations of + coordinate systems. Inverse transformation and indirect transformation can + be found automatically. If this parameter is not passed, coordinate + transformation cannot be done. + + Parameters + ========== + + name : str + The name of the coordinate system. + + patch : Patch + The patch where the coordinate system is defined. + + symbols : list of Symbols, optional + Defines the names and assumptions of coordinate symbols. + + relations : dict, optional + Key is a tuple of two strings, who are the names of the systems where + the coordinates transform from and transform to. + Value is a tuple of the symbols before transformation and a tuple of + the expressions after transformation. + + Examples + ======== + + We define two-dimensional Cartesian coordinate system and polar coordinate + system. + + >>> from sympy import symbols, pi, sqrt, atan2, cos, sin + >>> from sympy.diffgeom import Manifold, Patch, CoordSystem + >>> m = Manifold('M', 2) + >>> p = Patch('P', m) + >>> x, y = symbols('x y', real=True) + >>> r, theta = symbols('r theta', nonnegative=True) + >>> relation_dict = { + ... ('Car2D', 'Pol'): [(x, y), (sqrt(x**2 + y**2), atan2(y, x))], + ... ('Pol', 'Car2D'): [(r, theta), (r*cos(theta), r*sin(theta))] + ... } + >>> Car2D = CoordSystem('Car2D', p, (x, y), relation_dict) + >>> Pol = CoordSystem('Pol', p, (r, theta), relation_dict) + + ``symbols`` property returns ``CoordinateSymbol`` instances. These symbols + are not same with the symbols used to construct the coordinate system. + + >>> Car2D + Car2D + >>> Car2D.dim + 2 + >>> Car2D.symbols + (x, y) + >>> _[0].func + + + ``transformation()`` method returns the transformation function from + one coordinate system to another. ``transform()`` method returns the + transformed coordinates. + + >>> Car2D.transformation(Pol) + Lambda((x, y), Matrix([ + [sqrt(x**2 + y**2)], + [ atan2(y, x)]])) + >>> Car2D.transform(Pol) + Matrix([ + [sqrt(x**2 + y**2)], + [ atan2(y, x)]]) + >>> Car2D.transform(Pol, [1, 2]) + Matrix([ + [sqrt(5)], + [atan(2)]]) + + ``jacobian()`` method returns the Jacobian matrix of coordinate + transformation between two systems. ``jacobian_determinant()`` method + returns the Jacobian determinant of coordinate transformation between two + systems. + + >>> Pol.jacobian(Car2D) + Matrix([ + [cos(theta), -r*sin(theta)], + [sin(theta), r*cos(theta)]]) + >>> Pol.jacobian(Car2D, [1, pi/2]) + Matrix([ + [0, -1], + [1, 0]]) + >>> Car2D.jacobian_determinant(Pol) + 1/sqrt(x**2 + y**2) + >>> Car2D.jacobian_determinant(Pol, [1,0]) + 1 + + References + ========== + + .. [1] https://en.wikipedia.org/wiki/Coordinate_system + + """ + def __new__(cls, name, patch, symbols=None, relations={}, **kwargs): + if not isinstance(name, Str): + name = Str(name) + + # canonicallize the symbols + if symbols is None: + names = kwargs.get('names', None) + if names is None: + symbols = Tuple( + *[Symbol('%s_%s' % (name.name, i), real=True) + for i in range(patch.dim)] + ) + else: + sympy_deprecation_warning( + f""" +The 'names' argument to CoordSystem is deprecated. Use 'symbols' instead. That +is, replace + + CoordSystem(..., names={names}) + +with + + CoordSystem(..., symbols=[{', '.join(["Symbol(" + repr(n) + ", real=True)" for n in names])}]) + """, + deprecated_since_version="1.7", + active_deprecations_target="deprecated-diffgeom-mutable", + ) + symbols = Tuple( + *[Symbol(n, real=True) for n in names] + ) + else: + syms = [] + for s in symbols: + if isinstance(s, Symbol): + syms.append(Symbol(s.name, **s._assumptions.generator)) + elif isinstance(s, str): + sympy_deprecation_warning( + f""" + +Passing a string as the coordinate symbol name to CoordSystem is deprecated. +Pass a Symbol with the appropriate name and assumptions instead. + +That is, replace {s} with Symbol({s!r}, real=True). + """, + + deprecated_since_version="1.7", + active_deprecations_target="deprecated-diffgeom-mutable", + ) + syms.append(Symbol(s, real=True)) + symbols = Tuple(*syms) + + # canonicallize the relations + rel_temp = {} + for k,v in relations.items(): + s1, s2 = k + if not isinstance(s1, Str): + s1 = Str(s1) + if not isinstance(s2, Str): + s2 = Str(s2) + key = Tuple(s1, s2) + + # Old version used Lambda as a value. + if isinstance(v, Lambda): + v = (tuple(v.signature), tuple(v.expr)) + else: + v = (tuple(v[0]), tuple(v[1])) + rel_temp[key] = v + relations = Dict(rel_temp) + + # construct the object + obj = super().__new__(cls, name, patch, symbols, relations) + + # Add deprecated attributes + obj.transforms = _deprecated_dict( + """ + CoordSystem.transforms is deprecated. The CoordSystem class is now + immutable. Use the 'relations' keyword argument to the + CoordSystems() constructor to specify relations. + """, {}) + obj._names = [str(n) for n in symbols] + obj.patch.coord_systems.append(obj) # deprecated + obj._dummies = [Dummy(str(n)) for n in symbols] # deprecated + obj._dummy = Dummy() + + return obj + + @property + def name(self): + return self.args[0] + + @property + def patch(self): + return self.args[1] + + @property + def manifold(self): + return self.patch.manifold + + @property + def symbols(self): + return tuple(CoordinateSymbol(self, i, **s._assumptions.generator) + for i,s in enumerate(self.args[2])) + + @property + def relations(self): + return self.args[3] + + @property + def dim(self): + return self.patch.dim + + ########################################################################## + # Finding transformation relation + ########################################################################## + + def transformation(self, sys): + """ + Return coordinate transformation function from *self* to *sys*. + + Parameters + ========== + + sys : CoordSystem + + Returns + ======= + + sympy.Lambda + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2_r, R2_p + >>> R2_r.transformation(R2_p) + Lambda((x, y), Matrix([ + [sqrt(x**2 + y**2)], + [ atan2(y, x)]])) + + """ + signature = self.args[2] + + key = Tuple(self.name, sys.name) + if self == sys: + expr = Matrix(self.symbols) + elif key in self.relations: + expr = Matrix(self.relations[key][1]) + elif key[::-1] in self.relations: + expr = Matrix(self._inverse_transformation(sys, self)) + else: + expr = Matrix(self._indirect_transformation(self, sys)) + return Lambda(signature, expr) + + @staticmethod + def _solve_inverse(sym1, sym2, exprs, sys1_name, sys2_name): + ret = solve( + [t[0] - t[1] for t in zip(sym2, exprs)], + list(sym1), dict=True) + + if len(ret) == 0: + temp = "Cannot solve inverse relation from {} to {}." + raise NotImplementedError(temp.format(sys1_name, sys2_name)) + elif len(ret) > 1: + temp = "Obtained multiple inverse relation from {} to {}." + raise ValueError(temp.format(sys1_name, sys2_name)) + + return ret[0] + + @classmethod + def _inverse_transformation(cls, sys1, sys2): + # Find the transformation relation from sys2 to sys1 + forward = sys1.transform(sys2) + inv_results = cls._solve_inverse(sys1.symbols, sys2.symbols, forward, + sys1.name, sys2.name) + signature = tuple(sys1.symbols) + return [inv_results[s] for s in signature] + + @classmethod + @cacheit + def _indirect_transformation(cls, sys1, sys2): + # Find the transformation relation between two indirectly connected + # coordinate systems + rel = sys1.relations + path = cls._dijkstra(sys1, sys2) + + transforms = [] + for s1, s2 in zip(path, path[1:]): + if (s1, s2) in rel: + transforms.append(rel[(s1, s2)]) + else: + sym2, inv_exprs = rel[(s2, s1)] + sym1 = tuple(Dummy() for i in sym2) + ret = cls._solve_inverse(sym2, sym1, inv_exprs, s2, s1) + ret = tuple(ret[s] for s in sym2) + transforms.append((sym1, ret)) + syms = sys1.args[2] + exprs = syms + for newsyms, newexprs in transforms: + exprs = tuple(e.subs(zip(newsyms, exprs)) for e in newexprs) + return exprs + + @staticmethod + def _dijkstra(sys1, sys2): + # Use Dijkstra algorithm to find the shortest path between two indirectly-connected + # coordinate systems + # return value is the list of the names of the systems. + relations = sys1.relations + graph = {} + for s1, s2 in relations.keys(): + if s1 not in graph: + graph[s1] = {s2} + else: + graph[s1].add(s2) + if s2 not in graph: + graph[s2] = {s1} + else: + graph[s2].add(s1) + + path_dict = {sys:[0, [], 0] for sys in graph} # minimum distance, path, times of visited + + def visit(sys): + path_dict[sys][2] = 1 + for newsys in graph[sys]: + distance = path_dict[sys][0] + 1 + if path_dict[newsys][0] >= distance or not path_dict[newsys][1]: + path_dict[newsys][0] = distance + path_dict[newsys][1] = list(path_dict[sys][1]) + path_dict[newsys][1].append(sys) + + visit(sys1.name) + + while True: + min_distance = max(path_dict.values(), key=lambda x:x[0])[0] + newsys = None + for sys, lst in path_dict.items(): + if 0 < lst[0] <= min_distance and not lst[2]: + min_distance = lst[0] + newsys = sys + if newsys is None: + break + visit(newsys) + + result = path_dict[sys2.name][1] + result.append(sys2.name) + + if result == [sys2.name]: + raise KeyError("Two coordinate systems are not connected.") + return result + + def connect_to(self, to_sys, from_coords, to_exprs, inverse=True, fill_in_gaps=False): + sympy_deprecation_warning( + """ + The CoordSystem.connect_to() method is deprecated. Instead, + generate a new instance of CoordSystem with the 'relations' + keyword argument (CoordSystem classes are now immutable). + """, + deprecated_since_version="1.7", + active_deprecations_target="deprecated-diffgeom-mutable", + ) + + from_coords, to_exprs = dummyfy(from_coords, to_exprs) + self.transforms[to_sys] = Matrix(from_coords), Matrix(to_exprs) + + if inverse: + to_sys.transforms[self] = self._inv_transf(from_coords, to_exprs) + + if fill_in_gaps: + self._fill_gaps_in_transformations() + + @staticmethod + def _inv_transf(from_coords, to_exprs): + # Will be removed when connect_to is removed + inv_from = [i.as_dummy() for i in from_coords] + inv_to = solve( + [t[0] - t[1] for t in zip(inv_from, to_exprs)], + list(from_coords), dict=True)[0] + inv_to = [inv_to[fc] for fc in from_coords] + return Matrix(inv_from), Matrix(inv_to) + + @staticmethod + def _fill_gaps_in_transformations(): + # Will be removed when connect_to is removed + raise NotImplementedError + + ########################################################################## + # Coordinate transformations + ########################################################################## + + def transform(self, sys, coordinates=None): + """ + Return the result of coordinate transformation from *self* to *sys*. + If coordinates are not given, coordinate symbols of *self* are used. + + Parameters + ========== + + sys : CoordSystem + + coordinates : Any iterable, optional. + + Returns + ======= + + sympy.ImmutableDenseMatrix containing CoordinateSymbol + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2_r, R2_p + >>> R2_r.transform(R2_p) + Matrix([ + [sqrt(x**2 + y**2)], + [ atan2(y, x)]]) + >>> R2_r.transform(R2_p, [0, 1]) + Matrix([ + [ 1], + [pi/2]]) + + """ + if coordinates is None: + coordinates = self.symbols + if self != sys: + transf = self.transformation(sys) + coordinates = transf(*coordinates) + else: + coordinates = Matrix(coordinates) + return coordinates + + def coord_tuple_transform_to(self, to_sys, coords): + """Transform ``coords`` to coord system ``to_sys``.""" + sympy_deprecation_warning( + """ + The CoordSystem.coord_tuple_transform_to() method is deprecated. + Use the CoordSystem.transform() method instead. + """, + deprecated_since_version="1.7", + active_deprecations_target="deprecated-diffgeom-mutable", + ) + + coords = Matrix(coords) + if self != to_sys: + with ignore_warnings(SymPyDeprecationWarning): + transf = self.transforms[to_sys] + coords = transf[1].subs(list(zip(transf[0], coords))) + return coords + + def jacobian(self, sys, coordinates=None): + """ + Return the jacobian matrix of a transformation on given coordinates. + If coordinates are not given, coordinate symbols of *self* are used. + + Parameters + ========== + + sys : CoordSystem + + coordinates : Any iterable, optional. + + Returns + ======= + + sympy.ImmutableDenseMatrix + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2_r, R2_p + >>> R2_p.jacobian(R2_r) + Matrix([ + [cos(theta), -rho*sin(theta)], + [sin(theta), rho*cos(theta)]]) + >>> R2_p.jacobian(R2_r, [1, 0]) + Matrix([ + [1, 0], + [0, 1]]) + + """ + result = self.transform(sys).jacobian(self.symbols) + if coordinates is not None: + result = result.subs(list(zip(self.symbols, coordinates))) + return result + jacobian_matrix = jacobian + + def jacobian_determinant(self, sys, coordinates=None): + """ + Return the jacobian determinant of a transformation on given + coordinates. If coordinates are not given, coordinate symbols of *self* + are used. + + Parameters + ========== + + sys : CoordSystem + + coordinates : Any iterable, optional. + + Returns + ======= + + sympy.Expr + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2_r, R2_p + >>> R2_r.jacobian_determinant(R2_p) + 1/sqrt(x**2 + y**2) + >>> R2_r.jacobian_determinant(R2_p, [1, 0]) + 1 + + """ + return self.jacobian(sys, coordinates).det() + + + ########################################################################## + # Points + ########################################################################## + + def point(self, coords): + """Create a ``Point`` with coordinates given in this coord system.""" + return Point(self, coords) + + def point_to_coords(self, point): + """Calculate the coordinates of a point in this coord system.""" + return point.coords(self) + + ########################################################################## + # Base fields. + ########################################################################## + + def base_scalar(self, coord_index): + """Return ``BaseScalarField`` that takes a point and returns one of the coordinates.""" + return BaseScalarField(self, coord_index) + coord_function = base_scalar + + def base_scalars(self): + """Returns a list of all coordinate functions. + For more details see the ``base_scalar`` method of this class.""" + return [self.base_scalar(i) for i in range(self.dim)] + coord_functions = base_scalars + + def base_vector(self, coord_index): + """Return a basis vector field. + The basis vector field for this coordinate system. It is also an + operator on scalar fields.""" + return BaseVectorField(self, coord_index) + + def base_vectors(self): + """Returns a list of all base vectors. + For more details see the ``base_vector`` method of this class.""" + return [self.base_vector(i) for i in range(self.dim)] + + def base_oneform(self, coord_index): + """Return a basis 1-form field. + The basis one-form field for this coordinate system. It is also an + operator on vector fields.""" + return Differential(self.coord_function(coord_index)) + + def base_oneforms(self): + """Returns a list of all base oneforms. + For more details see the ``base_oneform`` method of this class.""" + return [self.base_oneform(i) for i in range(self.dim)] + + +class CoordinateSymbol(Symbol): + """A symbol which denotes an abstract value of i-th coordinate of + the coordinate system with given context. + + Explanation + =========== + + Each coordinates in coordinate system are represented by unique symbol, + such as x, y, z in Cartesian coordinate system. + + You may not construct this class directly. Instead, use `symbols` method + of CoordSystem. + + Parameters + ========== + + coord_sys : CoordSystem + + index : integer + + Examples + ======== + + >>> from sympy import symbols, Lambda, Matrix, sqrt, atan2, cos, sin + >>> from sympy.diffgeom import Manifold, Patch, CoordSystem + >>> m = Manifold('M', 2) + >>> p = Patch('P', m) + >>> x, y = symbols('x y', real=True) + >>> r, theta = symbols('r theta', nonnegative=True) + >>> relation_dict = { + ... ('Car2D', 'Pol'): Lambda((x, y), Matrix([sqrt(x**2 + y**2), atan2(y, x)])), + ... ('Pol', 'Car2D'): Lambda((r, theta), Matrix([r*cos(theta), r*sin(theta)])) + ... } + >>> Car2D = CoordSystem('Car2D', p, [x, y], relation_dict) + >>> Pol = CoordSystem('Pol', p, [r, theta], relation_dict) + >>> x, y = Car2D.symbols + + ``CoordinateSymbol`` contains its coordinate symbol and index. + + >>> x.name + 'x' + >>> x.coord_sys == Car2D + True + >>> x.index + 0 + >>> x.is_real + True + + You can transform ``CoordinateSymbol`` into other coordinate system using + ``rewrite()`` method. + + >>> x.rewrite(Pol) + r*cos(theta) + >>> sqrt(x**2 + y**2).rewrite(Pol).simplify() + r + + """ + def __new__(cls, coord_sys, index, **assumptions): + name = coord_sys.args[2][index].name + obj = super().__new__(cls, name, **assumptions) + obj.coord_sys = coord_sys + obj.index = index + return obj + + def __getnewargs__(self): + return (self.coord_sys, self.index) + + def _hashable_content(self): + return ( + self.coord_sys, self.index + ) + tuple(sorted(self.assumptions0.items())) + + def _eval_rewrite(self, rule, args, **hints): + if isinstance(rule, CoordSystem): + return rule.transform(self.coord_sys)[self.index] + return super()._eval_rewrite(rule, args, **hints) + + +class Point(Basic): + """Point defined in a coordinate system. + + Explanation + =========== + + Mathematically, point is defined in the manifold and does not have any coordinates + by itself. Coordinate system is what imbues the coordinates to the point by coordinate + chart. However, due to the difficulty of realizing such logic, you must supply + a coordinate system and coordinates to define a Point here. + + The usage of this object after its definition is independent of the + coordinate system that was used in order to define it, however due to + limitations in the simplification routines you can arrive at complicated + expressions if you use inappropriate coordinate systems. + + Parameters + ========== + + coord_sys : CoordSystem + + coords : list + The coordinates of the point. + + Examples + ======== + + >>> from sympy import pi + >>> from sympy.diffgeom import Point + >>> from sympy.diffgeom.rn import R2, R2_r, R2_p + >>> rho, theta = R2_p.symbols + + >>> p = Point(R2_p, [rho, 3*pi/4]) + + >>> p.manifold == R2 + True + + >>> p.coords() + Matrix([ + [ rho], + [3*pi/4]]) + >>> p.coords(R2_r) + Matrix([ + [-sqrt(2)*rho/2], + [ sqrt(2)*rho/2]]) + + """ + + def __new__(cls, coord_sys, coords, **kwargs): + coords = Matrix(coords) + obj = super().__new__(cls, coord_sys, coords) + obj._coord_sys = coord_sys + obj._coords = coords + return obj + + @property + def patch(self): + return self._coord_sys.patch + + @property + def manifold(self): + return self._coord_sys.manifold + + @property + def dim(self): + return self.manifold.dim + + def coords(self, sys=None): + """ + Coordinates of the point in given coordinate system. If coordinate system + is not passed, it returns the coordinates in the coordinate system in which + the poin was defined. + """ + if sys is None: + return self._coords + else: + return self._coord_sys.transform(sys, self._coords) + + @property + def free_symbols(self): + return self._coords.free_symbols + + +class BaseScalarField(Expr): + """Base scalar field over a manifold for a given coordinate system. + + Explanation + =========== + + A scalar field takes a point as an argument and returns a scalar. + A base scalar field of a coordinate system takes a point and returns one of + the coordinates of that point in the coordinate system in question. + + To define a scalar field you need to choose the coordinate system and the + index of the coordinate. + + The use of the scalar field after its definition is independent of the + coordinate system in which it was defined, however due to limitations in + the simplification routines you may arrive at more complicated + expression if you use unappropriate coordinate systems. + You can build complicated scalar fields by just building up SymPy + expressions containing ``BaseScalarField`` instances. + + Parameters + ========== + + coord_sys : CoordSystem + + index : integer + + Examples + ======== + + >>> from sympy import Function, pi + >>> from sympy.diffgeom import BaseScalarField + >>> from sympy.diffgeom.rn import R2_r, R2_p + >>> rho, _ = R2_p.symbols + >>> point = R2_p.point([rho, 0]) + >>> fx, fy = R2_r.base_scalars() + >>> ftheta = BaseScalarField(R2_r, 1) + + >>> fx(point) + rho + >>> fy(point) + 0 + + >>> (fx**2+fy**2).rcall(point) + rho**2 + + >>> g = Function('g') + >>> fg = g(ftheta-pi) + >>> fg.rcall(point) + g(-pi) + + """ + + is_commutative = True + + def __new__(cls, coord_sys, index, **kwargs): + index = _sympify(index) + obj = super().__new__(cls, coord_sys, index) + obj._coord_sys = coord_sys + obj._index = index + return obj + + @property + def coord_sys(self): + return self.args[0] + + @property + def index(self): + return self.args[1] + + @property + def patch(self): + return self.coord_sys.patch + + @property + def manifold(self): + return self.coord_sys.manifold + + @property + def dim(self): + return self.manifold.dim + + def __call__(self, *args): + """Evaluating the field at a point or doing nothing. + If the argument is a ``Point`` instance, the field is evaluated at that + point. The field is returned itself if the argument is any other + object. It is so in order to have working recursive calling mechanics + for all fields (check the ``__call__`` method of ``Expr``). + """ + point = args[0] + if len(args) != 1 or not isinstance(point, Point): + return self + coords = point.coords(self._coord_sys) + # XXX Calling doit is necessary with all the Subs expressions + # XXX Calling simplify is necessary with all the trig expressions + return simplify(coords[self._index]).doit() + + # XXX Workaround for limitations on the content of args + free_symbols: set[Any] = set() + + +class BaseVectorField(Expr): + r"""Base vector field over a manifold for a given coordinate system. + + Explanation + =========== + + A vector field is an operator taking a scalar field and returning a + directional derivative (which is also a scalar field). + A base vector field is the same type of operator, however the derivation is + specifically done with respect to a chosen coordinate. + + To define a base vector field you need to choose the coordinate system and + the index of the coordinate. + + The use of the vector field after its definition is independent of the + coordinate system in which it was defined, however due to limitations in the + simplification routines you may arrive at more complicated expression if you + use unappropriate coordinate systems. + + Parameters + ========== + coord_sys : CoordSystem + + index : integer + + Examples + ======== + + >>> from sympy import Function + >>> from sympy.diffgeom.rn import R2_p, R2_r + >>> from sympy.diffgeom import BaseVectorField + >>> from sympy import pprint + + >>> x, y = R2_r.symbols + >>> rho, theta = R2_p.symbols + >>> fx, fy = R2_r.base_scalars() + >>> point_p = R2_p.point([rho, theta]) + >>> point_r = R2_r.point([x, y]) + + >>> g = Function('g') + >>> s_field = g(fx, fy) + + >>> v = BaseVectorField(R2_r, 1) + >>> pprint(v(s_field)) + / d \| + |---(g(x, xi))|| + \dxi /|xi=y + >>> pprint(v(s_field).rcall(point_r).doit()) + d + --(g(x, y)) + dy + >>> pprint(v(s_field).rcall(point_p)) + / d \| + |---(g(rho*cos(theta), xi))|| + \dxi /|xi=rho*sin(theta) + + """ + + is_commutative = False + + def __new__(cls, coord_sys, index, **kwargs): + index = _sympify(index) + obj = super().__new__(cls, coord_sys, index) + obj._coord_sys = coord_sys + obj._index = index + return obj + + @property + def coord_sys(self): + return self.args[0] + + @property + def index(self): + return self.args[1] + + @property + def patch(self): + return self.coord_sys.patch + + @property + def manifold(self): + return self.coord_sys.manifold + + @property + def dim(self): + return self.manifold.dim + + def __call__(self, scalar_field): + """Apply on a scalar field. + The action of a vector field on a scalar field is a directional + differentiation. + If the argument is not a scalar field an error is raised. + """ + if covariant_order(scalar_field) or contravariant_order(scalar_field): + raise ValueError('Only scalar fields can be supplied as arguments to vector fields.') + + if scalar_field is None: + return self + + base_scalars = list(scalar_field.atoms(BaseScalarField)) + + # First step: e_x(x+r**2) -> e_x(x) + 2*r*e_x(r) + d_var = self._coord_sys._dummy + # TODO: you need a real dummy function for the next line + d_funcs = [Function('_#_%s' % i)(d_var) for i, + b in enumerate(base_scalars)] + d_result = scalar_field.subs(list(zip(base_scalars, d_funcs))) + d_result = d_result.diff(d_var) + + # Second step: e_x(x) -> 1 and e_x(r) -> cos(atan2(x, y)) + coords = self._coord_sys.symbols + d_funcs_deriv = [f.diff(d_var) for f in d_funcs] + d_funcs_deriv_sub = [] + for b in base_scalars: + jac = self._coord_sys.jacobian(b._coord_sys, coords) + d_funcs_deriv_sub.append(jac[b._index, self._index]) + d_result = d_result.subs(list(zip(d_funcs_deriv, d_funcs_deriv_sub))) + + # Remove the dummies + result = d_result.subs(list(zip(d_funcs, base_scalars))) + result = result.subs(list(zip(coords, self._coord_sys.coord_functions()))) + return result.doit() + + +def _find_coords(expr): + # Finds CoordinateSystems existing in expr + fields = expr.atoms(BaseScalarField, BaseVectorField) + result = set() + for f in fields: + result.add(f._coord_sys) + return result + + +class Commutator(Expr): + r"""Commutator of two vector fields. + + Explanation + =========== + + The commutator of two vector fields `v_1` and `v_2` is defined as the + vector field `[v_1, v_2]` that evaluated on each scalar field `f` is equal + to `v_1(v_2(f)) - v_2(v_1(f))`. + + Examples + ======== + + + >>> from sympy.diffgeom.rn import R2_p, R2_r + >>> from sympy.diffgeom import Commutator + >>> from sympy import simplify + + >>> fx, fy = R2_r.base_scalars() + >>> e_x, e_y = R2_r.base_vectors() + >>> e_r = R2_p.base_vector(0) + + >>> c_xy = Commutator(e_x, e_y) + >>> c_xr = Commutator(e_x, e_r) + >>> c_xy + 0 + + Unfortunately, the current code is not able to compute everything: + + >>> c_xr + Commutator(e_x, e_rho) + >>> simplify(c_xr(fy**2)) + -2*cos(theta)*y**2/(x**2 + y**2) + + """ + def __new__(cls, v1, v2): + if (covariant_order(v1) or contravariant_order(v1) != 1 + or covariant_order(v2) or contravariant_order(v2) != 1): + raise ValueError( + 'Only commutators of vector fields are supported.') + if v1 == v2: + return S.Zero + coord_sys = set().union(*[_find_coords(v) for v in (v1, v2)]) + if len(coord_sys) == 1: + # Only one coordinate systems is used, hence it is easy enough to + # actually evaluate the commutator. + if all(isinstance(v, BaseVectorField) for v in (v1, v2)): + return S.Zero + bases_1, bases_2 = [list(v.atoms(BaseVectorField)) + for v in (v1, v2)] + coeffs_1 = [v1.expand().coeff(b) for b in bases_1] + coeffs_2 = [v2.expand().coeff(b) for b in bases_2] + res = 0 + for c1, b1 in zip(coeffs_1, bases_1): + for c2, b2 in zip(coeffs_2, bases_2): + res += c1*b1(c2)*b2 - c2*b2(c1)*b1 + return res + else: + obj = super().__new__(cls, v1, v2) + obj._v1 = v1 # deprecated assignment + obj._v2 = v2 # deprecated assignment + return obj + + @property + def v1(self): + return self.args[0] + + @property + def v2(self): + return self.args[1] + + def __call__(self, scalar_field): + """Apply on a scalar field. + If the argument is not a scalar field an error is raised. + """ + return self.v1(self.v2(scalar_field)) - self.v2(self.v1(scalar_field)) + + +class Differential(Expr): + r"""Return the differential (exterior derivative) of a form field. + + Explanation + =========== + + The differential of a form (i.e. the exterior derivative) has a complicated + definition in the general case. + The differential `df` of the 0-form `f` is defined for any vector field `v` + as `df(v) = v(f)`. + + Examples + ======== + + >>> from sympy import Function + >>> from sympy.diffgeom.rn import R2_r + >>> from sympy.diffgeom import Differential + >>> from sympy import pprint + + >>> fx, fy = R2_r.base_scalars() + >>> e_x, e_y = R2_r.base_vectors() + >>> g = Function('g') + >>> s_field = g(fx, fy) + >>> dg = Differential(s_field) + + >>> dg + d(g(x, y)) + >>> pprint(dg(e_x)) + / d \| + |---(g(xi, y))|| + \dxi /|xi=x + >>> pprint(dg(e_y)) + / d \| + |---(g(x, xi))|| + \dxi /|xi=y + + Applying the exterior derivative operator twice always results in: + + >>> Differential(dg) + 0 + """ + + is_commutative = False + + def __new__(cls, form_field): + if contravariant_order(form_field): + raise ValueError( + 'A vector field was supplied as an argument to Differential.') + if isinstance(form_field, Differential): + return S.Zero + else: + obj = super().__new__(cls, form_field) + obj._form_field = form_field # deprecated assignment + return obj + + @property + def form_field(self): + return self.args[0] + + def __call__(self, *vector_fields): + """Apply on a list of vector_fields. + + Explanation + =========== + + If the number of vector fields supplied is not equal to 1 + the order of + the form field inside the differential the result is undefined. + + For 1-forms (i.e. differentials of scalar fields) the evaluation is + done as `df(v)=v(f)`. However if `v` is ``None`` instead of a vector + field, the differential is returned unchanged. This is done in order to + permit partial contractions for higher forms. + + In the general case the evaluation is done by applying the form field + inside the differential on a list with one less elements than the number + of elements in the original list. Lowering the number of vector fields + is achieved through replacing each pair of fields by their + commutator. + + If the arguments are not vectors or ``None``s an error is raised. + """ + if any((contravariant_order(a) != 1 or covariant_order(a)) and a is not None + for a in vector_fields): + raise ValueError('The arguments supplied to Differential should be vector fields or Nones.') + k = len(vector_fields) + if k == 1: + if vector_fields[0]: + return vector_fields[0].rcall(self._form_field) + return self + else: + # For higher form it is more complicated: + # Invariant formula: + # https://en.wikipedia.org/wiki/Exterior_derivative#Invariant_formula + # df(v1, ... vn) = +/- vi(f(v1..no i..vn)) + # +/- f([vi,vj],v1..no i, no j..vn) + f = self._form_field + v = vector_fields + ret = 0 + for i in range(k): + t = v[i].rcall(f.rcall(*v[:i] + v[i + 1:])) + ret += (-1)**i*t + for j in range(i + 1, k): + c = Commutator(v[i], v[j]) + if c: # TODO this is ugly - the Commutator can be Zero and + # this causes the next line to fail + t = f.rcall(*(c,) + v[:i] + v[i + 1:j] + v[j + 1:]) + ret += (-1)**(i + j)*t + return ret + + +class TensorProduct(Expr): + """Tensor product of forms. + + Explanation + =========== + + The tensor product permits the creation of multilinear functionals (i.e. + higher order tensors) out of lower order fields (e.g. 1-forms and vector + fields). However, the higher tensors thus created lack the interesting + features provided by the other type of product, the wedge product, namely + they are not antisymmetric and hence are not form fields. + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2_r + >>> from sympy.diffgeom import TensorProduct + + >>> fx, fy = R2_r.base_scalars() + >>> e_x, e_y = R2_r.base_vectors() + >>> dx, dy = R2_r.base_oneforms() + + >>> TensorProduct(dx, dy)(e_x, e_y) + 1 + >>> TensorProduct(dx, dy)(e_y, e_x) + 0 + >>> TensorProduct(dx, fx*dy)(fx*e_x, e_y) + x**2 + >>> TensorProduct(e_x, e_y)(fx**2, fy**2) + 4*x*y + >>> TensorProduct(e_y, dx)(fy) + dx + + You can nest tensor products. + + >>> tp1 = TensorProduct(dx, dy) + >>> TensorProduct(tp1, dx)(e_x, e_y, e_x) + 1 + + You can make partial contraction for instance when 'raising an index'. + Putting ``None`` in the second argument of ``rcall`` means that the + respective position in the tensor product is left as it is. + + >>> TP = TensorProduct + >>> metric = TP(dx, dx) + 3*TP(dy, dy) + >>> metric.rcall(e_y, None) + 3*dy + + Or automatically pad the args with ``None`` without specifying them. + + >>> metric.rcall(e_y) + 3*dy + + """ + def __new__(cls, *args): + scalar = Mul(*[m for m in args if covariant_order(m) + contravariant_order(m) == 0]) + multifields = [m for m in args if covariant_order(m) + contravariant_order(m)] + if multifields: + if len(multifields) == 1: + return scalar*multifields[0] + return scalar*super().__new__(cls, *multifields) + else: + return scalar + + def __call__(self, *fields): + """Apply on a list of fields. + + If the number of input fields supplied is not equal to the order of + the tensor product field, the list of arguments is padded with ``None``'s. + + The list of arguments is divided in sublists depending on the order of + the forms inside the tensor product. The sublists are provided as + arguments to these forms and the resulting expressions are given to the + constructor of ``TensorProduct``. + + """ + tot_order = covariant_order(self) + contravariant_order(self) + tot_args = len(fields) + if tot_args != tot_order: + fields = list(fields) + [None]*(tot_order - tot_args) + orders = [covariant_order(f) + contravariant_order(f) for f in self._args] + indices = [sum(orders[:i + 1]) for i in range(len(orders) - 1)] + fields = [fields[i:j] for i, j in zip([0] + indices, indices + [None])] + multipliers = [t[0].rcall(*t[1]) for t in zip(self._args, fields)] + return TensorProduct(*multipliers) + + +class WedgeProduct(TensorProduct): + """Wedge product of forms. + + Explanation + =========== + + In the context of integration only completely antisymmetric forms make + sense. The wedge product permits the creation of such forms. + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2_r + >>> from sympy.diffgeom import WedgeProduct + + >>> fx, fy = R2_r.base_scalars() + >>> e_x, e_y = R2_r.base_vectors() + >>> dx, dy = R2_r.base_oneforms() + + >>> WedgeProduct(dx, dy)(e_x, e_y) + 1 + >>> WedgeProduct(dx, dy)(e_y, e_x) + -1 + >>> WedgeProduct(dx, fx*dy)(fx*e_x, e_y) + x**2 + >>> WedgeProduct(e_x, e_y)(fy, None) + -e_x + + You can nest wedge products. + + >>> wp1 = WedgeProduct(dx, dy) + >>> WedgeProduct(wp1, dx)(e_x, e_y, e_x) + 0 + + """ + # TODO the calculation of signatures is slow + # TODO you do not need all these permutations (neither the prefactor) + def __call__(self, *fields): + """Apply on a list of vector_fields. + The expression is rewritten internally in terms of tensor products and evaluated.""" + orders = (covariant_order(e) + contravariant_order(e) for e in self.args) + mul = 1/Mul(*(factorial(o) for o in orders)) + perms = permutations(fields) + perms_par = (Permutation( + p).signature() for p in permutations(range(len(fields)))) + tensor_prod = TensorProduct(*self.args) + return mul*Add(*[tensor_prod(*p[0])*p[1] for p in zip(perms, perms_par)]) + + +class LieDerivative(Expr): + """Lie derivative with respect to a vector field. + + Explanation + =========== + + The transport operator that defines the Lie derivative is the pushforward of + the field to be derived along the integral curve of the field with respect + to which one derives. + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2_r, R2_p + >>> from sympy.diffgeom import (LieDerivative, TensorProduct) + + >>> fx, fy = R2_r.base_scalars() + >>> e_x, e_y = R2_r.base_vectors() + >>> e_rho, e_theta = R2_p.base_vectors() + >>> dx, dy = R2_r.base_oneforms() + + >>> LieDerivative(e_x, fy) + 0 + >>> LieDerivative(e_x, fx) + 1 + >>> LieDerivative(e_x, e_x) + 0 + + The Lie derivative of a tensor field by another tensor field is equal to + their commutator: + + >>> LieDerivative(e_x, e_rho) + Commutator(e_x, e_rho) + >>> LieDerivative(e_x + e_y, fx) + 1 + + >>> tp = TensorProduct(dx, dy) + >>> LieDerivative(e_x, tp) + LieDerivative(e_x, TensorProduct(dx, dy)) + >>> LieDerivative(e_x, tp) + LieDerivative(e_x, TensorProduct(dx, dy)) + + """ + def __new__(cls, v_field, expr): + expr_form_ord = covariant_order(expr) + if contravariant_order(v_field) != 1 or covariant_order(v_field): + raise ValueError('Lie derivatives are defined only with respect to' + ' vector fields. The supplied argument was not a ' + 'vector field.') + if expr_form_ord > 0: + obj = super().__new__(cls, v_field, expr) + # deprecated assignments + obj._v_field = v_field + obj._expr = expr + return obj + if expr.atoms(BaseVectorField): + return Commutator(v_field, expr) + else: + return v_field.rcall(expr) + + @property + def v_field(self): + return self.args[0] + + @property + def expr(self): + return self.args[1] + + def __call__(self, *args): + v = self.v_field + expr = self.expr + lead_term = v(expr(*args)) + rest = Add(*[Mul(*args[:i] + (Commutator(v, args[i]),) + args[i + 1:]) + for i in range(len(args))]) + return lead_term - rest + + +class BaseCovarDerivativeOp(Expr): + """Covariant derivative operator with respect to a base vector. + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2_r + >>> from sympy.diffgeom import BaseCovarDerivativeOp + >>> from sympy.diffgeom import metric_to_Christoffel_2nd, TensorProduct + + >>> TP = TensorProduct + >>> fx, fy = R2_r.base_scalars() + >>> e_x, e_y = R2_r.base_vectors() + >>> dx, dy = R2_r.base_oneforms() + + >>> ch = metric_to_Christoffel_2nd(TP(dx, dx) + TP(dy, dy)) + >>> ch + [[[0, 0], [0, 0]], [[0, 0], [0, 0]]] + >>> cvd = BaseCovarDerivativeOp(R2_r, 0, ch) + >>> cvd(fx) + 1 + >>> cvd(fx*e_x) + e_x + """ + + def __new__(cls, coord_sys, index, christoffel): + index = _sympify(index) + christoffel = ImmutableDenseNDimArray(christoffel) + obj = super().__new__(cls, coord_sys, index, christoffel) + # deprecated assignments + obj._coord_sys = coord_sys + obj._index = index + obj._christoffel = christoffel + return obj + + @property + def coord_sys(self): + return self.args[0] + + @property + def index(self): + return self.args[1] + + @property + def christoffel(self): + return self.args[2] + + def __call__(self, field): + """Apply on a scalar field. + + The action of a vector field on a scalar field is a directional + differentiation. + If the argument is not a scalar field the behaviour is undefined. + """ + if covariant_order(field) != 0: + raise NotImplementedError() + + field = vectors_in_basis(field, self._coord_sys) + + wrt_vector = self._coord_sys.base_vector(self._index) + wrt_scalar = self._coord_sys.coord_function(self._index) + vectors = list(field.atoms(BaseVectorField)) + + # First step: replace all vectors with something susceptible to + # derivation and do the derivation + # TODO: you need a real dummy function for the next line + d_funcs = [Function('_#_%s' % i)(wrt_scalar) for i, + b in enumerate(vectors)] + d_result = field.subs(list(zip(vectors, d_funcs))) + d_result = wrt_vector(d_result) + + # Second step: backsubstitute the vectors in + d_result = d_result.subs(list(zip(d_funcs, vectors))) + + # Third step: evaluate the derivatives of the vectors + derivs = [] + for v in vectors: + d = Add(*[(self._christoffel[k, wrt_vector._index, v._index] + *v._coord_sys.base_vector(k)) + for k in range(v._coord_sys.dim)]) + derivs.append(d) + to_subs = [wrt_vector(d) for d in d_funcs] + # XXX: This substitution can fail when there are Dummy symbols and the + # cache is disabled: https://github.com/sympy/sympy/issues/17794 + result = d_result.subs(list(zip(to_subs, derivs))) + + # Remove the dummies + result = result.subs(list(zip(d_funcs, vectors))) + return result.doit() + + +class CovarDerivativeOp(Expr): + """Covariant derivative operator. + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2_r + >>> from sympy.diffgeom import CovarDerivativeOp + >>> from sympy.diffgeom import metric_to_Christoffel_2nd, TensorProduct + >>> TP = TensorProduct + >>> fx, fy = R2_r.base_scalars() + >>> e_x, e_y = R2_r.base_vectors() + >>> dx, dy = R2_r.base_oneforms() + >>> ch = metric_to_Christoffel_2nd(TP(dx, dx) + TP(dy, dy)) + + >>> ch + [[[0, 0], [0, 0]], [[0, 0], [0, 0]]] + >>> cvd = CovarDerivativeOp(fx*e_x, ch) + >>> cvd(fx) + x + >>> cvd(fx*e_x) + x*e_x + + """ + + def __new__(cls, wrt, christoffel): + if len({v._coord_sys for v in wrt.atoms(BaseVectorField)}) > 1: + raise NotImplementedError() + if contravariant_order(wrt) != 1 or covariant_order(wrt): + raise ValueError('Covariant derivatives are defined only with ' + 'respect to vector fields. The supplied argument ' + 'was not a vector field.') + christoffel = ImmutableDenseNDimArray(christoffel) + obj = super().__new__(cls, wrt, christoffel) + # deprecated assignments + obj._wrt = wrt + obj._christoffel = christoffel + return obj + + @property + def wrt(self): + return self.args[0] + + @property + def christoffel(self): + return self.args[1] + + def __call__(self, field): + vectors = list(self._wrt.atoms(BaseVectorField)) + base_ops = [BaseCovarDerivativeOp(v._coord_sys, v._index, self._christoffel) + for v in vectors] + return self._wrt.subs(list(zip(vectors, base_ops))).rcall(field) + + +############################################################################### +# Integral curves on vector fields +############################################################################### +def intcurve_series(vector_field, param, start_point, n=6, coord_sys=None, coeffs=False): + r"""Return the series expansion for an integral curve of the field. + + Explanation + =========== + + Integral curve is a function `\gamma` taking a parameter in `R` to a point + in the manifold. It verifies the equation: + + `V(f)\big(\gamma(t)\big) = \frac{d}{dt}f\big(\gamma(t)\big)` + + where the given ``vector_field`` is denoted as `V`. This holds for any + value `t` for the parameter and any scalar field `f`. + + This equation can also be decomposed of a basis of coordinate functions + `V(f_i)\big(\gamma(t)\big) = \frac{d}{dt}f_i\big(\gamma(t)\big) \quad \forall i` + + This function returns a series expansion of `\gamma(t)` in terms of the + coordinate system ``coord_sys``. The equations and expansions are necessarily + done in coordinate-system-dependent way as there is no other way to + represent movement between points on the manifold (i.e. there is no such + thing as a difference of points for a general manifold). + + Parameters + ========== + vector_field + the vector field for which an integral curve will be given + + param + the argument of the function `\gamma` from R to the curve + + start_point + the point which corresponds to `\gamma(0)` + + n + the order to which to expand + + coord_sys + the coordinate system in which to expand + coeffs (default False) - if True return a list of elements of the expansion + + Examples + ======== + + Use the predefined R2 manifold: + + >>> from sympy.abc import t, x, y + >>> from sympy.diffgeom.rn import R2_p, R2_r + >>> from sympy.diffgeom import intcurve_series + + Specify a starting point and a vector field: + + >>> start_point = R2_r.point([x, y]) + >>> vector_field = R2_r.e_x + + Calculate the series: + + >>> intcurve_series(vector_field, t, start_point, n=3) + Matrix([ + [t + x], + [ y]]) + + Or get the elements of the expansion in a list: + + >>> series = intcurve_series(vector_field, t, start_point, n=3, coeffs=True) + >>> series[0] + Matrix([ + [x], + [y]]) + >>> series[1] + Matrix([ + [t], + [0]]) + >>> series[2] + Matrix([ + [0], + [0]]) + + The series in the polar coordinate system: + + >>> series = intcurve_series(vector_field, t, start_point, + ... n=3, coord_sys=R2_p, coeffs=True) + >>> series[0] + Matrix([ + [sqrt(x**2 + y**2)], + [ atan2(y, x)]]) + >>> series[1] + Matrix([ + [t*x/sqrt(x**2 + y**2)], + [ -t*y/(x**2 + y**2)]]) + >>> series[2] + Matrix([ + [t**2*(-x**2/(x**2 + y**2)**(3/2) + 1/sqrt(x**2 + y**2))/2], + [ t**2*x*y/(x**2 + y**2)**2]]) + + See Also + ======== + + intcurve_diffequ + + """ + if contravariant_order(vector_field) != 1 or covariant_order(vector_field): + raise ValueError('The supplied field was not a vector field.') + + def iter_vfield(scalar_field, i): + """Return ``vector_field`` called `i` times on ``scalar_field``.""" + return reduce(lambda s, v: v.rcall(s), [vector_field, ]*i, scalar_field) + + def taylor_terms_per_coord(coord_function): + """Return the series for one of the coordinates.""" + return [param**i*iter_vfield(coord_function, i).rcall(start_point)/factorial(i) + for i in range(n)] + coord_sys = coord_sys if coord_sys else start_point._coord_sys + coord_functions = coord_sys.coord_functions() + taylor_terms = [taylor_terms_per_coord(f) for f in coord_functions] + if coeffs: + return [Matrix(t) for t in zip(*taylor_terms)] + else: + return Matrix([sum(c) for c in taylor_terms]) + + +def intcurve_diffequ(vector_field, param, start_point, coord_sys=None): + r"""Return the differential equation for an integral curve of the field. + + Explanation + =========== + + Integral curve is a function `\gamma` taking a parameter in `R` to a point + in the manifold. It verifies the equation: + + `V(f)\big(\gamma(t)\big) = \frac{d}{dt}f\big(\gamma(t)\big)` + + where the given ``vector_field`` is denoted as `V`. This holds for any + value `t` for the parameter and any scalar field `f`. + + This function returns the differential equation of `\gamma(t)` in terms of the + coordinate system ``coord_sys``. The equations and expansions are necessarily + done in coordinate-system-dependent way as there is no other way to + represent movement between points on the manifold (i.e. there is no such + thing as a difference of points for a general manifold). + + Parameters + ========== + + vector_field + the vector field for which an integral curve will be given + + param + the argument of the function `\gamma` from R to the curve + + start_point + the point which corresponds to `\gamma(0)` + + coord_sys + the coordinate system in which to give the equations + + Returns + ======= + + a tuple of (equations, initial conditions) + + Examples + ======== + + Use the predefined R2 manifold: + + >>> from sympy.abc import t + >>> from sympy.diffgeom.rn import R2, R2_p, R2_r + >>> from sympy.diffgeom import intcurve_diffequ + + Specify a starting point and a vector field: + + >>> start_point = R2_r.point([0, 1]) + >>> vector_field = -R2.y*R2.e_x + R2.x*R2.e_y + + Get the equation: + + >>> equations, init_cond = intcurve_diffequ(vector_field, t, start_point) + >>> equations + [f_1(t) + Derivative(f_0(t), t), -f_0(t) + Derivative(f_1(t), t)] + >>> init_cond + [f_0(0), f_1(0) - 1] + + The series in the polar coordinate system: + + >>> equations, init_cond = intcurve_diffequ(vector_field, t, start_point, R2_p) + >>> equations + [Derivative(f_0(t), t), Derivative(f_1(t), t) - 1] + >>> init_cond + [f_0(0) - 1, f_1(0) - pi/2] + + See Also + ======== + + intcurve_series + + """ + if contravariant_order(vector_field) != 1 or covariant_order(vector_field): + raise ValueError('The supplied field was not a vector field.') + coord_sys = coord_sys if coord_sys else start_point._coord_sys + gammas = [Function('f_%d' % i)(param) for i in range( + start_point._coord_sys.dim)] + arbitrary_p = Point(coord_sys, gammas) + coord_functions = coord_sys.coord_functions() + equations = [simplify(diff(cf.rcall(arbitrary_p), param) - vector_field.rcall(cf).rcall(arbitrary_p)) + for cf in coord_functions] + init_cond = [simplify(cf.rcall(arbitrary_p).subs(param, 0) - cf.rcall(start_point)) + for cf in coord_functions] + return equations, init_cond + + +############################################################################### +# Helpers +############################################################################### +def dummyfy(args, exprs): + # TODO Is this a good idea? + d_args = Matrix([s.as_dummy() for s in args]) + reps = dict(zip(args, d_args)) + d_exprs = Matrix([_sympify(expr).subs(reps) for expr in exprs]) + return d_args, d_exprs + +############################################################################### +# Helpers +############################################################################### +def contravariant_order(expr, _strict=False): + """Return the contravariant order of an expression. + + Examples + ======== + + >>> from sympy.diffgeom import contravariant_order + >>> from sympy.diffgeom.rn import R2 + >>> from sympy.abc import a + + >>> contravariant_order(a) + 0 + >>> contravariant_order(a*R2.x + 2) + 0 + >>> contravariant_order(a*R2.x*R2.e_y + R2.e_x) + 1 + + """ + # TODO move some of this to class methods. + # TODO rewrite using the .as_blah_blah methods + if isinstance(expr, Add): + orders = [contravariant_order(e) for e in expr.args] + if len(set(orders)) != 1: + raise ValueError('Misformed expression containing contravariant fields of varying order.') + return orders[0] + elif isinstance(expr, Mul): + orders = [contravariant_order(e) for e in expr.args] + not_zero = [o for o in orders if o != 0] + if len(not_zero) > 1: + raise ValueError('Misformed expression containing multiplication between vectors.') + return 0 if not not_zero else not_zero[0] + elif isinstance(expr, Pow): + if covariant_order(expr.base) or covariant_order(expr.exp): + raise ValueError( + 'Misformed expression containing a power of a vector.') + return 0 + elif isinstance(expr, BaseVectorField): + return 1 + elif isinstance(expr, TensorProduct): + return sum(contravariant_order(a) for a in expr.args) + elif not _strict or expr.atoms(BaseScalarField): + return 0 + else: # If it does not contain anything related to the diffgeom module and it is _strict + return -1 + + +def covariant_order(expr, _strict=False): + """Return the covariant order of an expression. + + Examples + ======== + + >>> from sympy.diffgeom import covariant_order + >>> from sympy.diffgeom.rn import R2 + >>> from sympy.abc import a + + >>> covariant_order(a) + 0 + >>> covariant_order(a*R2.x + 2) + 0 + >>> covariant_order(a*R2.x*R2.dy + R2.dx) + 1 + + """ + # TODO move some of this to class methods. + # TODO rewrite using the .as_blah_blah methods + if isinstance(expr, Add): + orders = [covariant_order(e) for e in expr.args] + if len(set(orders)) != 1: + raise ValueError('Misformed expression containing form fields of varying order.') + return orders[0] + elif isinstance(expr, Mul): + orders = [covariant_order(e) for e in expr.args] + not_zero = [o for o in orders if o != 0] + if len(not_zero) > 1: + raise ValueError('Misformed expression containing multiplication between forms.') + return 0 if not not_zero else not_zero[0] + elif isinstance(expr, Pow): + if covariant_order(expr.base) or covariant_order(expr.exp): + raise ValueError( + 'Misformed expression containing a power of a form.') + return 0 + elif isinstance(expr, Differential): + return covariant_order(*expr.args) + 1 + elif isinstance(expr, TensorProduct): + return sum(covariant_order(a) for a in expr.args) + elif not _strict or expr.atoms(BaseScalarField): + return 0 + else: # If it does not contain anything related to the diffgeom module and it is _strict + return -1 + + +############################################################################### +# Coordinate transformation functions +############################################################################### +def vectors_in_basis(expr, to_sys): + """Transform all base vectors in base vectors of a specified coord basis. + While the new base vectors are in the new coordinate system basis, any + coefficients are kept in the old system. + + Examples + ======== + + >>> from sympy.diffgeom import vectors_in_basis + >>> from sympy.diffgeom.rn import R2_r, R2_p + + >>> vectors_in_basis(R2_r.e_x, R2_p) + -y*e_theta/(x**2 + y**2) + x*e_rho/sqrt(x**2 + y**2) + >>> vectors_in_basis(R2_p.e_r, R2_r) + sin(theta)*e_y + cos(theta)*e_x + + """ + vectors = list(expr.atoms(BaseVectorField)) + new_vectors = [] + for v in vectors: + cs = v._coord_sys + jac = cs.jacobian(to_sys, cs.coord_functions()) + new = (jac.T*Matrix(to_sys.base_vectors()))[v._index] + new_vectors.append(new) + return expr.subs(list(zip(vectors, new_vectors))) + + +############################################################################### +# Coordinate-dependent functions +############################################################################### +def twoform_to_matrix(expr): + """Return the matrix representing the twoform. + + For the twoform `w` return the matrix `M` such that `M[i,j]=w(e_i, e_j)`, + where `e_i` is the i-th base vector field for the coordinate system in + which the expression of `w` is given. + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2 + >>> from sympy.diffgeom import twoform_to_matrix, TensorProduct + >>> TP = TensorProduct + + >>> twoform_to_matrix(TP(R2.dx, R2.dx) + TP(R2.dy, R2.dy)) + Matrix([ + [1, 0], + [0, 1]]) + >>> twoform_to_matrix(R2.x*TP(R2.dx, R2.dx) + TP(R2.dy, R2.dy)) + Matrix([ + [x, 0], + [0, 1]]) + >>> twoform_to_matrix(TP(R2.dx, R2.dx) + TP(R2.dy, R2.dy) - TP(R2.dx, R2.dy)/2) + Matrix([ + [ 1, 0], + [-1/2, 1]]) + + """ + if covariant_order(expr) != 2 or contravariant_order(expr): + raise ValueError('The input expression is not a two-form.') + coord_sys = _find_coords(expr) + if len(coord_sys) != 1: + raise ValueError('The input expression concerns more than one ' + 'coordinate systems, hence there is no unambiguous ' + 'way to choose a coordinate system for the matrix.') + coord_sys = coord_sys.pop() + vectors = coord_sys.base_vectors() + expr = expr.expand() + matrix_content = [[expr.rcall(v1, v2) for v1 in vectors] + for v2 in vectors] + return Matrix(matrix_content) + + +def metric_to_Christoffel_1st(expr): + """Return the nested list of Christoffel symbols for the given metric. + This returns the Christoffel symbol of first kind that represents the + Levi-Civita connection for the given metric. + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2 + >>> from sympy.diffgeom import metric_to_Christoffel_1st, TensorProduct + >>> TP = TensorProduct + + >>> metric_to_Christoffel_1st(TP(R2.dx, R2.dx) + TP(R2.dy, R2.dy)) + [[[0, 0], [0, 0]], [[0, 0], [0, 0]]] + >>> metric_to_Christoffel_1st(R2.x*TP(R2.dx, R2.dx) + TP(R2.dy, R2.dy)) + [[[1/2, 0], [0, 0]], [[0, 0], [0, 0]]] + + """ + matrix = twoform_to_matrix(expr) + if not matrix.is_symmetric(): + raise ValueError( + 'The two-form representing the metric is not symmetric.') + coord_sys = _find_coords(expr).pop() + deriv_matrices = [matrix.applyfunc(d) for d in coord_sys.base_vectors()] + indices = list(range(coord_sys.dim)) + christoffel = [[[(deriv_matrices[k][i, j] + deriv_matrices[j][i, k] - deriv_matrices[i][j, k])/2 + for k in indices] + for j in indices] + for i in indices] + return ImmutableDenseNDimArray(christoffel) + + +def metric_to_Christoffel_2nd(expr): + """Return the nested list of Christoffel symbols for the given metric. + This returns the Christoffel symbol of second kind that represents the + Levi-Civita connection for the given metric. + + Examples + ======== + + >>> from sympy.diffgeom.rn import R2 + >>> from sympy.diffgeom import metric_to_Christoffel_2nd, TensorProduct + >>> TP = TensorProduct + + >>> metric_to_Christoffel_2nd(TP(R2.dx, R2.dx) + TP(R2.dy, R2.dy)) + [[[0, 0], [0, 0]], [[0, 0], [0, 0]]] + >>> metric_to_Christoffel_2nd(R2.x*TP(R2.dx, R2.dx) + TP(R2.dy, R2.dy)) + [[[1/(2*x), 0], [0, 0]], [[0, 0], [0, 0]]] + + """ + ch_1st = metric_to_Christoffel_1st(expr) + coord_sys = _find_coords(expr).pop() + indices = list(range(coord_sys.dim)) + # XXX workaround, inverting a matrix does not work if it contains non + # symbols + #matrix = twoform_to_matrix(expr).inv() + matrix = twoform_to_matrix(expr) + s_fields = set() + for e in matrix: + s_fields.update(e.atoms(BaseScalarField)) + s_fields = list(s_fields) + dums = coord_sys.symbols + matrix = matrix.subs(list(zip(s_fields, dums))).inv().subs(list(zip(dums, s_fields))) + # XXX end of workaround + christoffel = [[[Add(*[matrix[i, l]*ch_1st[l, j, k] for l in indices]) + for k in indices] + for j in indices] + for i in indices] + return ImmutableDenseNDimArray(christoffel) + + +def metric_to_Riemann_components(expr): + """Return the components of the Riemann tensor expressed in a given basis. + + Given a metric it calculates the components of the Riemann tensor in the + canonical basis of the coordinate system in which the metric expression is + given. + + Examples + ======== + + >>> from sympy import exp + >>> from sympy.diffgeom.rn import R2 + >>> from sympy.diffgeom import metric_to_Riemann_components, TensorProduct + >>> TP = TensorProduct + + >>> metric_to_Riemann_components(TP(R2.dx, R2.dx) + TP(R2.dy, R2.dy)) + [[[[0, 0], [0, 0]], [[0, 0], [0, 0]]], [[[0, 0], [0, 0]], [[0, 0], [0, 0]]]] + >>> non_trivial_metric = exp(2*R2.r)*TP(R2.dr, R2.dr) + \ + R2.r**2*TP(R2.dtheta, R2.dtheta) + >>> non_trivial_metric + exp(2*rho)*TensorProduct(drho, drho) + rho**2*TensorProduct(dtheta, dtheta) + >>> riemann = metric_to_Riemann_components(non_trivial_metric) + >>> riemann[0, :, :, :] + [[[0, 0], [0, 0]], [[0, exp(-2*rho)*rho], [-exp(-2*rho)*rho, 0]]] + >>> riemann[1, :, :, :] + [[[0, -1/rho], [1/rho, 0]], [[0, 0], [0, 0]]] + + """ + ch_2nd = metric_to_Christoffel_2nd(expr) + coord_sys = _find_coords(expr).pop() + indices = list(range(coord_sys.dim)) + deriv_ch = [[[[d(ch_2nd[i, j, k]) + for d in coord_sys.base_vectors()] + for k in indices] + for j in indices] + for i in indices] + riemann_a = [[[[deriv_ch[rho][sig][nu][mu] - deriv_ch[rho][sig][mu][nu] + for nu in indices] + for mu in indices] + for sig in indices] + for rho in indices] + riemann_b = [[[[Add(*[ch_2nd[rho, l, mu]*ch_2nd[l, sig, nu] - ch_2nd[rho, l, nu]*ch_2nd[l, sig, mu] for l in indices]) + for nu in indices] + for mu in indices] + for sig in indices] + for rho in indices] + riemann = [[[[riemann_a[rho][sig][mu][nu] + riemann_b[rho][sig][mu][nu] + for nu in indices] + for mu in indices] + for sig in indices] + for rho in indices] + return ImmutableDenseNDimArray(riemann) + + +def metric_to_Ricci_components(expr): + + """Return the components of the Ricci tensor expressed in a given basis. + + Given a metric it calculates the components of the Ricci tensor in the + canonical basis of the coordinate system in which the metric expression is + given. + + Examples + ======== + + >>> from sympy import exp + >>> from sympy.diffgeom.rn import R2 + >>> from sympy.diffgeom import metric_to_Ricci_components, TensorProduct + >>> TP = TensorProduct + + >>> metric_to_Ricci_components(TP(R2.dx, R2.dx) + TP(R2.dy, R2.dy)) + [[0, 0], [0, 0]] + >>> non_trivial_metric = exp(2*R2.r)*TP(R2.dr, R2.dr) + \ + R2.r**2*TP(R2.dtheta, R2.dtheta) + >>> non_trivial_metric + exp(2*rho)*TensorProduct(drho, drho) + rho**2*TensorProduct(dtheta, dtheta) + >>> metric_to_Ricci_components(non_trivial_metric) + [[1/rho, 0], [0, exp(-2*rho)*rho]] + + """ + riemann = metric_to_Riemann_components(expr) + coord_sys = _find_coords(expr).pop() + indices = list(range(coord_sys.dim)) + ricci = [[Add(*[riemann[k, i, k, j] for k in indices]) + for j in indices] + for i in indices] + return ImmutableDenseNDimArray(ricci) + +############################################################################### +# Classes for deprecation +############################################################################### + +class _deprecated_container: + # This class gives deprecation warning. + # When deprecated features are completely deleted, this should be removed as well. + # See https://github.com/sympy/sympy/pull/19368 + def __init__(self, message, data): + super().__init__(data) + self.message = message + + def warn(self): + sympy_deprecation_warning( + self.message, + deprecated_since_version="1.7", + active_deprecations_target="deprecated-diffgeom-mutable", + stacklevel=4 + ) + + def __iter__(self): + self.warn() + return super().__iter__() + + def __getitem__(self, key): + self.warn() + return super().__getitem__(key) + + def __contains__(self, key): + self.warn() + return super().__contains__(key) + + +class _deprecated_list(_deprecated_container, list): + pass + + +class _deprecated_dict(_deprecated_container, dict): + pass + + +# Import at end to avoid cyclic imports +from sympy.simplify.simplify import simplify diff --git a/shared/package-files/08/082c709607208b3639f8588e24b8f992712c1f622b8825e00c3640439bd4794f/blob b/shared/package-files/08/082c709607208b3639f8588e24b8f992712c1f622b8825e00c3640439bd4794f/blob new file mode 100644 index 0000000000000000000000000000000000000000..a1b72c1fdd6eee41be6ca577a0eccbabacacc1e5 --- /dev/null +++ b/shared/package-files/08/082c709607208b3639f8588e24b8f992712c1f622b8825e00c3640439bd4794f/blob @@ -0,0 +1,1219 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +import platform +import re +import sys +import warnings +from collections import namedtuple +from configparser import ConfigParser +from csv import reader as csv_reader +from email.parser import HeaderParser +from errno import ENOENT +from io import StringIO +from itertools import chain +from logging import getLogger +from os import name as os_name +from os import scandir, strerror +from os.path import basename, dirname, isdir, isfile, join, lexists +from posixpath import normpath as posix_normpath + +from conda.common.iterators import groupby_to_dict as groupby + +from ... import CondaError +from ..._vendor.frozendict import frozendict +from ...auxlib.decorators import memoizedproperty +from ..compat import open +from ..path import ( + get_major_minor_version, + get_python_site_packages_short_path, + pyc_path, + win_path_ok, +) + +log = getLogger(__name__) + +# TODO: complete this list +PYPI_TO_CONDA = { + "graphviz": "python-graphviz", +} +# TODO: complete this list +PYPI_CONDA_DEPS = { + "graphviz": ["graphviz"], # What version constraints? +} +# This regex can process requirement including or not including name. +# This is useful for parsing, for example, `Python-Version` +PARTIAL_PYPI_SPEC_PATTERN = re.compile( + r""" + # Text needs to be stripped and all extra spaces replaced by single spaces + (?P^[A-Z0-9][A-Z0-9._-]*)? + \s? + (\[(?P.*)\])? + \s? + (?P\(? \s? ([\w\d<>=!~,\s\.\*+-]*) \s? \)? )? + \s? +""", + re.VERBOSE | re.IGNORECASE, +) +PY_FILE_RE = re.compile(r"^[^\t\n\r\f\v]+/site-packages/[^\t\n\r\f\v]+\.py$") +PySpec = namedtuple("PySpec", ["name", "extras", "constraints", "marker", "url"]) + + +class MetadataWarning(Warning): + pass + + +# Dist classes +# ----------------------------------------------------------------------------- +class PythonDistribution: + """Base object describing a python distribution based on path to anchor file.""" + + MANIFEST_FILES = () # Only one is used, but many names available + REQUIRES_FILES = () # Only one is used, but many names available + MANDATORY_FILES = () + ENTRY_POINTS_FILES = ("entry_points.txt",) + + @staticmethod + def init(prefix_path, anchor_file, python_version): + if anchor_file.endswith(".egg-link"): + return PythonEggLinkDistribution(prefix_path, anchor_file, python_version) + elif ".dist-info" in anchor_file: + return PythonInstalledDistribution(prefix_path, anchor_file, python_version) + elif anchor_file.endswith(".egg-info"): + anchor_full_path = join(prefix_path, win_path_ok(anchor_file)) + sp_reference = basename(anchor_file) + return PythonEggInfoDistribution( + anchor_full_path, python_version, sp_reference + ) + elif ".egg-info" in anchor_file: + anchor_full_path = join(prefix_path, win_path_ok(dirname(anchor_file))) + sp_reference = basename(dirname(anchor_file)) + return PythonEggInfoDistribution( + anchor_full_path, python_version, sp_reference + ) + elif ".egg" in anchor_file: + anchor_full_path = join(prefix_path, win_path_ok(dirname(anchor_file))) + sp_reference = basename(dirname(anchor_file)) + return PythonEggInfoDistribution( + anchor_full_path, python_version, sp_reference + ) + else: + raise NotImplementedError() + + def __init__(self, anchor_full_path, python_version): + # Don't call PythonDistribution directly. Use the init() static method. + self.anchor_full_path = anchor_full_path + self.python_version = python_version + + if anchor_full_path and isfile(anchor_full_path): + self._metadata_dir_full_path = dirname(anchor_full_path) + elif anchor_full_path and isdir(anchor_full_path): + self._metadata_dir_full_path = anchor_full_path + else: + raise RuntimeError("Path not found: %s" % anchor_full_path) + + self._check_files() + self._metadata = PythonDistributionMetadata(anchor_full_path) + self._provides_file_data = () + self._requires_file_data = () + + def _check_files(self): + """Check the existence of mandatory files for a given distribution.""" + for fname in self.MANDATORY_FILES: + if self._metadata_dir_full_path: + fpath = join(self._metadata_dir_full_path, fname) + if not isfile(fpath): + raise OSError(ENOENT, strerror(ENOENT), fpath) + + def _check_path_data(self, path, checksum, size): + """Normalizes record data content and format.""" + if checksum: + assert checksum.startswith("sha256="), ( + self._metadata_dir_full_path, + path, + checksum, + ) + checksum = checksum[7:] + else: + checksum = None + size = int(size) if size else None + + return path, checksum, size + + @staticmethod + def _parse_requires_file_data(data, global_section="__global__"): + # https://setuptools.readthedocs.io/en/latest/formats.html#requires-txt + requires = {} + lines = [line.strip() for line in data.split("\n") if line] + + if lines and not (lines[0].startswith("[") and lines[0].endswith("]")): + # Add dummy section for unsectioned items + lines = [f"[{global_section}]"] + lines + + # Parse sections + for line in lines: + if line.startswith("[") and line.endswith("]"): + section = line.strip()[1:-1] + requires[section] = [] + continue + + if line.strip(): + requires[section].append(line.strip()) + + # Adapt to *standard* requirements (add env markers to requirements) + reqs = [] + extras = [] + for section, values in requires.items(): + if section == global_section: + # This is the global section (same as dist_requires) + reqs.extend(values) + elif section.startswith(":"): + # The section is used as a marker + # Example: ":python_version < '3'" + marker = section.replace(":", "; ") + new_values = [v + marker for v in values] + reqs.extend(new_values) + else: + # The section is an extra, i.e. "docs", or "tests"... + extras.append(section) + marker = f'; extra == "{section}"' + new_values = [v + marker for v in values] + reqs.extend(new_values) + + return frozenset(reqs), extras + + @staticmethod + def _parse_entries_file_data(data): + # https://setuptools.readthedocs.io/en/latest/formats.html#entry-points-txt-entry-point-plugin-metadata + # FIXME: Use pkg_resources which provides API for this? + entries_data = {} + config = ConfigParser() + config.optionxform = lambda x: x # Avoid lowercasing keys + try: + do_read = config.read_file + except AttributeError: + do_read = config.readfp + do_read(StringIO(data)) + for section in config.sections(): + entries_data[section] = dict(config.items(section)) + + return entries_data + + def _load_requires_provides_file(self): + # https://setuptools.readthedocs.io/en/latest/formats.html#requires-txt + # FIXME: Use pkg_resources which provides API for this? + requires, extras = None, None + for fname in self.REQUIRES_FILES: + fpath = join(self._metadata_dir_full_path, fname) + if isfile(fpath): + with open(fpath) as fh: + data = fh.read() + + requires, extras = self._parse_requires_file_data(data) + self._provides_file_data = extras + self._requires_file_data = requires + break + + return requires, extras + + @memoizedproperty + def manifest_full_path(self): + manifest_full_path = None + if self._metadata_dir_full_path: + for fname in self.MANIFEST_FILES: + manifest_full_path = join(self._metadata_dir_full_path, fname) + if isfile(manifest_full_path): + break + return manifest_full_path + + def get_paths(self): + """ + Read the list of installed paths from record or source file. + + Example + ------- + [(u'skdata/__init__.py', u'sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU', 0), + (u'skdata/diabetes.py', None, None), + ... + ] + """ + manifest_full_path = self.manifest_full_path + if manifest_full_path: + python_version = self.python_version + sp_dir = get_python_site_packages_short_path(python_version) + "/" + prepend_metadata_dirname = ( + basename(manifest_full_path) == "installed-files.txt" + ) + if prepend_metadata_dirname: + path_prepender = basename(dirname(manifest_full_path)) + "/" + else: + path_prepender = "" + + def process_csv_row(reader): + seen = [] + records = [] + for row in reader: + cleaned_path = posix_normpath(f"{sp_dir}{path_prepender}{row[0]}") + if len(row) == 3: + checksum, size = row[1:] + if checksum: + assert checksum.startswith("sha256="), ( + self._metadata_dir_full_path, + cleaned_path, + checksum, + ) + checksum = checksum[7:] + else: + checksum = None + size = int(size) if size else None + else: + checksum = size = None + if cleaned_path not in seen and row[0]: + seen.append(cleaned_path) + records.append((cleaned_path, checksum, size)) + return tuple(records) + + csv_delimiter = "," + with open(manifest_full_path) as csvfile: + record_reader = csv_reader(csvfile, delimiter=csv_delimiter) + # format of each record is (path, checksum, size) + records = process_csv_row(record_reader) + files_set = {record[0] for record in records} + + _pyc_path, _py_file_re = pyc_path, PY_FILE_RE + py_ver_mm = get_major_minor_version(python_version, with_dot=False) + missing_pyc_files = ( + ff + for ff in ( + _pyc_path(f, py_ver_mm) for f in files_set if _py_file_re.match(f) + ) + if ff not in files_set + ) + records = sorted( + (*records, *((pf, None, None) for pf in missing_pyc_files)) + ) + return records + + return [] + + def get_dist_requirements(self): + # FIXME: On some packages, requirements are not added to metadata, + # but on a separate requires.txt, see: python setup.py develop for + # anaconda-client. This is setuptools behavior. + # TODO: what is the dependency_links.txt on the same example? + data = self._metadata.get_dist_requirements() + if self._requires_file_data: + data = self._requires_file_data + elif not data: + self._load_requires_provides_file() + data = self._requires_file_data + return data + + def get_python_requirements(self): + return self._metadata.get_python_requirements() + + def get_external_requirements(self): + return self._metadata.get_external_requirements() + + def get_extra_provides(self): + # FIXME: On some packages, requirements are not added to metadata, + # but on a separate requires.txt, see: python setup.py develop for + # anaconda-client. This is setuptools behavior. + data = self._metadata.get_extra_provides() + if self._provides_file_data: + data = self._provides_file_data + elif not data: + self._load_requires_provides_file() + data = self._provides_file_data + + return data + + def get_conda_dependencies(self): + """ + Process metadata fields providing dependency information. + + This includes normalizing fields, and evaluating environment markers. + """ + python_spec = "python %s.*" % ".".join(self.python_version.split(".")[:2]) + + def pyspec_to_norm_req(pyspec): + conda_name = pypi_name_to_conda_name(norm_package_name(pyspec.name)) + return ( + f"{conda_name} {pyspec.constraints}" + if pyspec.constraints + else conda_name + ) + + reqs = self.get_dist_requirements() + pyspecs = tuple(parse_specification(req) for req in reqs) + marker_groups = groupby(lambda ps: ps.marker.split("==", 1)[0].strip(), pyspecs) + depends = {pyspec_to_norm_req(pyspec) for pyspec in marker_groups.pop("", ())} + extras = marker_groups.pop("extra", ()) + execution_context = { + "python_version": self.python_version, + } + depends.update( + pyspec_to_norm_req(pyspec) + for pyspec in chain.from_iterable(marker_groups.values()) + if interpret(pyspec.marker, execution_context) + ) + constrains = { + pyspec_to_norm_req(pyspec) for pyspec in extras if pyspec.constraints + } + depends.add(python_spec) + + return sorted(depends), sorted(constrains) + + def get_optional_dependencies(self): + raise NotImplementedError + + def get_entry_points(self): + # TODO: need to add entry points, "exports," and other files that might + # not be in RECORD + for fname in self.ENTRY_POINTS_FILES: + fpath = join(self._metadata_dir_full_path, fname) + if isfile(fpath): + with open(fpath) as fh: + data = fh.read() + return self._parse_entries_file_data(data) + + @property + def name(self): + return self._metadata.name + + @property + def norm_name(self): + return norm_package_name(self.name) + + @property + def conda_name(self): + return pypi_name_to_conda_name(self.norm_name) + + @property + def version(self): + return self._metadata.version + + +class PythonInstalledDistribution(PythonDistribution): + """ + Python distribution installed via distutils. + + Notes + ----- + - https://www.python.org/dev/peps/pep-0376/ + """ + + MANIFEST_FILES = ("RECORD",) + REQUIRES_FILES = () + MANDATORY_FILES = ("METADATA",) + # FIXME: Do this check? Disabled for tests where only Metadata file is stored + # MANDATORY_FILES = ('METADATA', 'RECORD', 'INSTALLER') + ENTRY_POINTS_FILES = () + + is_manageable = True + + def __init__(self, prefix_path, anchor_file, python_version): + anchor_full_path = join(prefix_path, win_path_ok(dirname(anchor_file))) + super().__init__(anchor_full_path, python_version) + self.sp_reference = basename(dirname(anchor_file)) + + +class PythonEggInfoDistribution(PythonDistribution): + """ + Python distribution installed via setuptools. + + Notes + ----- + - http://peak.telecommunity.com/DevCenter/EggFormats + """ + + MANIFEST_FILES = ("installed-files.txt", "SOURCES", "SOURCES.txt") + REQUIRES_FILES = ("requires.txt", "depends.txt") + MANDATORY_FILES = () + ENTRY_POINTS_FILES = ("entry_points.txt",) + + def __init__(self, anchor_full_path, python_version, sp_reference): + super().__init__(anchor_full_path, python_version) + self.sp_reference = sp_reference + + @property + def is_manageable(self): + return ( + self.manifest_full_path + and basename(self.manifest_full_path) == "installed-files.txt" + ) + + +class PythonEggLinkDistribution(PythonEggInfoDistribution): + is_manageable = False + + def __init__(self, prefix_path, anchor_file, python_version): + anchor_full_path = get_dist_file_from_egg_link(anchor_file, prefix_path) + sp_reference = None # This can be None in case the egg-info is no longer there + super().__init__(anchor_full_path, python_version, sp_reference) + + +# Python distribution/eggs metadata +# ----------------------------------------------------------------------------- + + +class PythonDistributionMetadata: + """ + Object representing the metada of a Python Distribution given by anchor + file (or directory) path. + + This metadata is extracted from a single file. Python distributions might + create additional files that complement this metadata information, but + that is handled at the python distribution level. + + Notes + ----- + - https://packaging.python.org/specifications/core-metadata/ + - Metadata 2.1: https://www.python.org/dev/peps/pep-0566/ + - Metadata 2.0: https://www.python.org/dev/peps/pep-0426/ (Withdrawn) + - Metadata 1.2: https://www.python.org/dev/peps/pep-0345/ + - Metadata 1.1: https://www.python.org/dev/peps/pep-0314/ + - Metadata 1.0: https://www.python.org/dev/peps/pep-0241/ + """ + + FILE_NAMES = ("METADATA", "PKG-INFO") + + # Python Packages Metadata 2.1 + # ----------------------------------------------------------------------------- + SINGLE_USE_KEYS = frozendict( + ( + ("Metadata-Version", "metadata_version"), + ("Name", "name"), + ("Version", "version"), + # ('Summary', 'summary'), + # ('Description', 'description'), + # ('Description-Content-Type', 'description_content_type'), + # ('Keywords', 'keywords'), + # ('Home-page', 'home_page'), + # ('Download-URL', 'download_url'), + # ('Author', 'author'), + # ('Author-email', 'author_email'), + # ('Maintainer', 'maintainer'), + # ('Maintainer-email', 'maintainer_email'), + ("License", "license"), + # # Deprecated + # ('Obsoleted-By', 'obsoleted_by'), # Note: See 2.0 + # ('Private-Version', 'private_version'), # Note: See 2.0 + ) + ) + MULTIPLE_USE_KEYS = frozendict( + ( + ("Platform", "platform"), + ("Supported-Platform", "supported_platform"), + # ('Classifier', 'classifier'), + ("Requires-Dist", "requires_dist"), + ("Requires-External", "requires_external"), + ("Requires-Python", "requires_python"), + # ('Project-URL', 'project_url'), + ("Provides-Extra", "provides_extra"), + # ('Provides-Dist', 'provides_dist'), + # ('Obsoletes-Dist', 'obsoletes_dist'), + # # Deprecated + # ('Extension', 'extension'), # Note: See 2.0 + # ('Obsoletes', 'obsoletes'), + # ('Provides', 'provides'), + ("Requires", "requires"), + # ('Setup-Requires-Dist', 'setup_requires_dist'), # Note: See 2.0 + ) + ) + + def __init__(self, path): + metadata_path = self._process_path(path, self.FILE_NAMES) + self._path = path + self._data = self._read_metadata(metadata_path) + + @staticmethod + def _process_path(path, metadata_filenames): + """Find metadata file inside dist-info folder, or check direct file.""" + metadata_path = None + if path: + if isdir(path): + for fname in metadata_filenames: + fpath = join(path, fname) + if isfile(fpath): + metadata_path = fpath + break + elif isfile(path): + # '.egg-info' file contains metadata directly + filenames = [".egg-info"] + if metadata_filenames: + filenames.extend(metadata_filenames) + assert any(path.endswith(filename) for filename in filenames) + metadata_path = path + else: + # `path` does not exist + warnings.warn("Metadata path not found", MetadataWarning) + else: + warnings.warn("Metadata path not found", MetadataWarning) + + return metadata_path + + @classmethod + def _message_to_dict(cls, message): + """ + Convert the RFC-822 headers data into a dictionary. + + `message` is an email.parser.Message instance. + + The canonical method to transform metadata fields into such a data + structure is as follows: + - The original key-value format should be read with + email.parser.HeaderParser + - All transformed keys should be reduced to lower case. Hyphens + should be replaced with underscores, but otherwise should retain + all other characters + - The transformed value for any field marked with "(Multiple-use") + should be a single list containing all the original values for the + given key + - The Keywords field should be converted to a list by splitting the + original value on whitespace characters + - The message body, if present, should be set to the value of the + description key. + - The result should be stored as a string-keyed dictionary. + """ + new_data = {} + + if message: + for key, value in message.items(): + if key in cls.MULTIPLE_USE_KEYS: + new_key = cls.MULTIPLE_USE_KEYS[key] + if new_key not in new_data: + new_data[new_key] = [value] + else: + new_data[new_key].append(value) + + elif key in cls.SINGLE_USE_KEYS: + new_key = cls.SINGLE_USE_KEYS[key] + new_data[new_key] = value + + # TODO: Handle license later on for convenience + + return new_data + + @classmethod + def _read_metadata(cls, fpath): + """Read the original format which is stored as RFC-822 headers.""" + data = {} + if fpath and isfile(fpath): + parser = HeaderParser() + + # FIXME: Is this a correct assumption for the encoding? + # This was needed due to some errors on windows + with open(fpath) as fp: + data = parser.parse(fp) + + return cls._message_to_dict(data) + + def _get_multiple_data(self, keys): + """ + Helper method to get multiple data values by keys. + + Keys is an iterable including the preferred key in order, to include + values of key that might have been replaced (deprecated), for example + keys can be ['requires_dist', 'requires'], where the key 'requires' is + deprecated and replaced by 'requires_dist'. + """ + data = [] + if self._data: + for key in keys: + raw_data = self._data.get(key, []) + for req in raw_data: + data.append(req.strip()) + + if data: + break + + return frozenset(data) + + def get_dist_requirements(self): + """ + Changed in version 2.1: The field format specification was relaxed to + accept the syntax used by popular publishing tools. + + Each entry contains a string naming some other distutils project + required by this distribution. + + The format of a requirement string contains from one to four parts: + - A project name, in the same format as the Name: field. The only + mandatory part. + - A comma-separated list of ‘extra’ names. These are defined by the + required project, referring to specific features which may need + extra dependencies. + - A version specifier. Tools parsing the format should accept + optional parentheses around this, but tools generating it should + not use parentheses. + - An environment marker after a semicolon. This means that the + requirement is only needed in the specified conditions. + + This field may be followed by an environment marker after a semicolon. + + Example + ------- + frozenset(['pkginfo', 'PasteDeploy', 'zope.interface (>3.5.0)', + 'pywin32 >1.0; sys_platform == "win32"']) + + Return 'Requires' if 'Requires-Dist' is empty. + """ + return self._get_multiple_data(["requires_dist", "requires"]) + + def get_python_requirements(self): + """ + New in version 1.2. + + This field specifies the Python version(s) that the distribution is + guaranteed to be compatible with. Installation tools may look at this + when picking which version of a project to install. + + The value must be in the format specified in Version specifiers. + + This field may be followed by an environment marker after a semicolon. + + Example + ------- + frozenset(['>=3', '>2.6,!=3.0.*,!=3.1.*', '~=2.6', + '>=3; sys_platform == "win32"']) + """ + return self._get_multiple_data(["requires_python"]) + + def get_external_requirements(self): + """ + Changed in version 2.1: The field format specification was relaxed to + accept the syntax used by popular publishing tools. + + Each entry contains a string describing some dependency in the system + that the distribution is to be used. This field is intended to serve + as a hint to downstream project maintainers, and has no semantics + which are meaningful to the distutils distribution. + + The format of a requirement string is a name of an external dependency, + optionally followed by a version declaration within parentheses. + + This field may be followed by an environment marker after a semicolon. + + Because they refer to non-Python software releases, version numbers for + this field are not required to conform to the format specified in PEP + 440: they should correspond to the version scheme used by the external + dependency. + + Notice that there’s is no particular rule on the strings to be used! + + Example + ------- + frozenset(['C', 'libpng (>=1.5)', 'make; sys_platform != "win32"']) + """ + return self._get_multiple_data(["requires_external"]) + + def get_extra_provides(self): + """ + New in version 2.1. + + A string containing the name of an optional feature. Must be a valid + Python identifier. May be used to make a dependency conditional on + hether the optional feature has been requested. + + Example + ------- + frozenset(['pdf', 'doc', 'test']) + """ + return self._get_multiple_data(["provides_extra"]) + + def get_dist_provides(self): + """ + New in version 1.2. + + Changed in version 2.1: The field format specification was relaxed to + accept the syntax used by popular publishing tools. + + Each entry contains a string naming a Distutils project which is + contained within this distribution. This field must include the project + identified in the Name field, followed by the version : Name (Version). + + A distribution may provide additional names, e.g. to indicate that + multiple projects have been bundled together. For instance, source + distributions of the ZODB project have historically included the + transaction project, which is now available as a separate distribution. + Installing such a source distribution satisfies requirements for both + ZODB and transaction. + + A distribution may also provide a “virtual” project name, which does + not correspond to any separately-distributed project: such a name might + be used to indicate an abstract capability which could be supplied by + one of multiple projects. E.g., multiple projects might supply RDBMS + bindings for use by a given ORM: each project might declare that it + provides ORM-bindings, allowing other projects to depend only on having + at most one of them installed. + + A version declaration may be supplied and must follow the rules + described in Version specifiers. The distribution’s version number + will be implied if none is specified. + + This field may be followed by an environment marker after a semicolon. + + Return `Provides` in case `Provides-Dist` is empty. + """ + return self._get_multiple_data(["provides_dist", "provides"]) + + def get_dist_obsolete(self): + """ + New in version 1.2. + + Changed in version 2.1: The field format specification was relaxed to + accept the syntax used by popular publishing tools. + + Each entry contains a string describing a distutils project’s + distribution which this distribution renders obsolete, meaning that + the two projects should not be installed at the same time. + + Version declarations can be supplied. Version numbers must be in the + format specified in Version specifiers [1]. + + The most common use of this field will be in case a project name + changes, e.g. Gorgon 2.3 gets subsumed into Torqued Python 1.0. When + you install Torqued Python, the Gorgon distribution should be removed. + + This field may be followed by an environment marker after a semicolon. + + Return `Obsoletes` in case `Obsoletes-Dist` is empty. + + Example + ------- + frozenset(['Gorgon', "OtherProject (<3.0) ; python_version == '2.7'"]) + + Notes + ----- + - [1] https://packaging.python.org/specifications/version-specifiers/ + """ + return self._get_multiple_data(["obsoletes_dist", "obsoletes"]) + + def get_classifiers(self): + """ + Classifiers are described in PEP 301, and the Python Package Index + publishes a dynamic list of currently defined classifiers. + + This field may be followed by an environment marker after a semicolon. + + Example + ------- + frozenset(['Development Status :: 4 - Beta', + "Environment :: Console (Text Based) ; os_name == "posix"]) + """ + return self._get_multiple_data(["classifier"]) + + @property + def name(self): + return self._data.get("name") # TODO: Check for existence? + + @property + def version(self): + return self._data.get("version") # TODO: Check for existence? + + +# Helper functions +# ----------------------------------------------------------------------------- +def norm_package_name(name): + return name.replace(".", "-").replace("_", "-").lower() if name else "" + + +def pypi_name_to_conda_name(pypi_name): + return PYPI_TO_CONDA.get(pypi_name, pypi_name) if pypi_name else "" + + +def norm_package_version(version): + """Normalize a version by removing extra spaces and parentheses.""" + if version: + version = ",".join(v.strip() for v in version.split(",")).strip() + + if version.startswith("(") and version.endswith(")"): + version = version[1:-1] + + version = "".join(v for v in version if v.strip()) + else: + version = "" + + return version + + +def split_spec(spec, sep): + """Split a spec by separator and return stripped start and end parts.""" + parts = spec.rsplit(sep, 1) + spec_start = parts[0].strip() + spec_end = "" + if len(parts) == 2: + spec_end = parts[-1].strip() + return spec_start, spec_end + + +def parse_specification(spec): + """ + Parse a requirement from a python distribution metadata and return a + namedtuple with name, extras, constraints, marker and url components. + + This method does not enforce strict specifications but extracts the + information which is assumed to be *correct*. As such no errors are raised. + + Example + ------- + PySpec(name='requests', extras=['security'], constraints='>=3.3.0', + marker='foo >= 2.7 or bar == 1', url='']) + """ + name, extras, const = spec, [], "" + + # Remove excess whitespace + spec = " ".join(p for p in spec.split(" ") if p).strip() + + # Extract marker (Assumes that there can only be one ';' inside the spec) + spec, marker = split_spec(spec, ";") + + # Extract url (Assumes that there can only be one '@' inside the spec) + spec, url = split_spec(spec, "@") + + # Find name, extras and constraints + r = PARTIAL_PYPI_SPEC_PATTERN.match(spec) + if r: + # Normalize name + name = r.group("name") + name = norm_package_name(name) # TODO: Do we want this or not? + + # Clean extras + extras = r.group("extras") + extras = [e.strip() for e in extras.split(",") if e] if extras else [] + + # Clean constraints + const = r.group("constraints") + const = "".join(c for c in const.split(" ") if c).strip() + if const.startswith("(") and const.endswith(")"): + # Remove parens + const = const[1:-1] + const = const.replace("-", ".") + + return PySpec(name=name, extras=extras, constraints=const, marker=marker, url=url) + + +def get_site_packages_anchor_files(site_packages_path, site_packages_dir): + """Get all the anchor files for the site packages directory.""" + site_packages_anchor_files = set() + for entry in scandir(site_packages_path): + fname = entry.name + anchor_file = None + if fname.endswith(".dist-info"): + anchor_file = "{}/{}/{}".format(site_packages_dir, fname, "RECORD") + elif fname.endswith(".egg-info"): + if isfile(join(site_packages_path, fname)): + anchor_file = f"{site_packages_dir}/{fname}" + else: + anchor_file = "{}/{}/{}".format(site_packages_dir, fname, "PKG-INFO") + elif fname.endswith(".egg"): + if isdir(join(site_packages_path, fname)): + anchor_file = "{}/{}/{}/{}".format( + site_packages_dir, fname, "EGG-INFO", "PKG-INFO" + ) + # FIXME: If it is a .egg file, we need to unzip the content to be + # able. Do this once and leave the directory, and remove the egg + # (which is a zip file in disguise?) + elif fname.endswith(".egg-link"): + anchor_file = f"{site_packages_dir}/{fname}" + elif fname.endswith(".pth"): + continue + else: + continue + + if anchor_file: + site_packages_anchor_files.add(anchor_file) + + return site_packages_anchor_files + + +def get_dist_file_from_egg_link(egg_link_file, prefix_path): + """Return the egg info file path following an egg link.""" + egg_info_full_path = None + + egg_link_path = join(prefix_path, win_path_ok(egg_link_file)) + try: + with open(egg_link_path) as fh: + # See: https://setuptools.readthedocs.io/en/latest/formats.html#egg-links + # "...Each egg-link file should contain a single file or directory name + # with no newlines..." + egg_link_contents = fh.readlines()[0].strip() + except UnicodeDecodeError: + from locale import getpreferredencoding + + with open(egg_link_path, encoding=getpreferredencoding()) as fh: + egg_link_contents = fh.readlines()[0].strip() + + if lexists(egg_link_contents): + egg_info_fnames = tuple( + name + for name in (entry.name for entry in scandir(egg_link_contents)) + if name[-9:] == ".egg-info" + ) + else: + egg_info_fnames = () + + if egg_info_fnames: + if len(egg_info_fnames) != 1: + raise CondaError( + "Expected exactly one `egg-info` directory in '{}', via egg-link '{}'." + " Instead found: {}. These are often left over from " + "legacy operations that did not clean up correctly. Please " + "remove all but one of these.".format( + egg_link_contents, egg_link_file, egg_info_fnames + ) + ) + + egg_info_full_path = join(egg_link_contents, egg_info_fnames[0]) + + if isdir(egg_info_full_path): + egg_info_full_path = join(egg_info_full_path, "PKG-INFO") + + if egg_info_full_path is None: + raise OSError(ENOENT, strerror(ENOENT), egg_link_contents) + + return egg_info_full_path + + +# See: https://bitbucket.org/pypa/distlib/src/34629e41cdff5c29429c7a4d1569ef5508b56929/distlib/util.py?at=default&fileviewer=file-view-default # NOQA +# ------------------------------------------------------------------------------------------------ +def parse_marker(marker_string): + """ + Parse marker string and return a dictionary containing a marker expression. + + The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in + the expression grammar, or strings. A string contained in quotes is to be + interpreted as a literal string, and a string not contained in quotes is a + variable (such as os_name). + """ + + def marker_var(remaining): + # either identifier, or literal string + m = IDENTIFIER.match(remaining) + if m: + result = m.groups()[0] + remaining = remaining[m.end() :] + elif not remaining: + raise SyntaxError("unexpected end of input") + else: + q = remaining[0] + if q not in "'\"": + raise SyntaxError("invalid expression: %s" % remaining) + oq = "'\"".replace(q, "") + remaining = remaining[1:] + parts = [q] + while remaining: + # either a string chunk, or oq, or q to terminate + if remaining[0] == q: + break + elif remaining[0] == oq: + parts.append(oq) + remaining = remaining[1:] + else: + m = STRING_CHUNK.match(remaining) + if not m: + raise SyntaxError("error in string literal: %s" % remaining) + parts.append(m.groups()[0]) + remaining = remaining[m.end() :] + else: + s = "".join(parts) + raise SyntaxError("unterminated string: %s" % s) + parts.append(q) + result = "".join(parts) + remaining = remaining[1:].lstrip() # skip past closing quote + return result, remaining + + def marker_expr(remaining): + if remaining and remaining[0] == "(": + result, remaining = marker(remaining[1:].lstrip()) + if remaining[0] != ")": + raise SyntaxError("unterminated parenthesis: %s" % remaining) + remaining = remaining[1:].lstrip() + else: + lhs, remaining = marker_var(remaining) + while remaining: + m = MARKER_OP.match(remaining) + if not m: + break + op = m.groups()[0] + remaining = remaining[m.end() :] + rhs, remaining = marker_var(remaining) + lhs = {"op": op, "lhs": lhs, "rhs": rhs} + result = lhs + return result, remaining + + def marker_and(remaining): + lhs, remaining = marker_expr(remaining) + while remaining: + m = AND.match(remaining) + if not m: + break + remaining = remaining[m.end() :] + rhs, remaining = marker_expr(remaining) + lhs = {"op": "and", "lhs": lhs, "rhs": rhs} + return lhs, remaining + + def marker(remaining): + lhs, remaining = marker_and(remaining) + while remaining: + m = OR.match(remaining) + if not m: + break + remaining = remaining[m.end() :] + rhs, remaining = marker_and(remaining) + lhs = {"op": "or", "lhs": lhs, "rhs": rhs} + return lhs, remaining + + return marker(marker_string) + + +# See: +# https://bitbucket.org/pypa/distlib/src/34629e41cdff5c29429c7a4d1569ef5508b56929/distlib/util.py?at=default&fileviewer=file-view-default # NOQA +# https://bitbucket.org/pypa/distlib/src/34629e41cdff5c29429c7a4d1569ef5508b56929/distlib/markers.py?at=default&fileviewer=file-view-default # NOQA +# ------------------------------------------------------------------------------------------------ +# +# Requirement parsing code as per PEP 508 +# +IDENTIFIER = re.compile(r"^([\w\.-]+)\s*") +VERSION_IDENTIFIER = re.compile(r"^([\w\.*+-]+)\s*") +COMPARE_OP = re.compile(r"^(<=?|>=?|={2,3}|[~!]=)\s*") +MARKER_OP = re.compile(r"^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*") +OR = re.compile(r"^or\b\s*") +AND = re.compile(r"^and\b\s*") +NON_SPACE = re.compile(r"(\S+)\s*") +STRING_CHUNK = re.compile(r"([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)") + + +def _is_literal(o): + if not isinstance(o, str) or not o: + return False + return o[0] in "'\"" + + +class Evaluator: + """This class is used to evaluate marker expressions.""" + + operations = { + "==": lambda x, y: x == y, + "===": lambda x, y: x == y, + "~=": lambda x, y: x == y or x > y, + "!=": lambda x, y: x != y, + "<": lambda x, y: x < y, + "<=": lambda x, y: x == y or x < y, + ">": lambda x, y: x > y, + ">=": lambda x, y: x == y or x > y, + "and": lambda x, y: x and y, + "or": lambda x, y: x or y, + "in": lambda x, y: x in y, + "not in": lambda x, y: x not in y, + } + + def evaluate(self, expr, context): + """ + Evaluate a marker expression returned by the :func:`parse_requirement` + function in the specified context. + """ + if isinstance(expr, str): + if expr[0] in "'\"": + result = expr[1:-1] + else: + if expr not in context: + raise SyntaxError("unknown variable: %s" % expr) + result = context[expr] + else: + assert isinstance(expr, dict) + op = expr["op"] + if op not in self.operations: + raise NotImplementedError("op not implemented: %s" % op) + elhs = expr["lhs"] + erhs = expr["rhs"] + if _is_literal(expr["lhs"]) and _is_literal(expr["rhs"]): + raise SyntaxError(f"invalid comparison: {elhs} {op} {erhs}") + + lhs = self.evaluate(elhs, context) + rhs = self.evaluate(erhs, context) + result = self.operations[op](lhs, rhs) + return result + + +# def update_marker_context(python_version): +# """Update default marker context to include environment python version.""" +# updated_context = DEFAULT_MARKER_CONTEXT.copy() +# context = { +# 'python_full_version': python_version, +# 'python_version': '.'.join(python_version.split('.')[:2]), +# 'extra': '', +# } +# updated_context.update(context) +# return updated_context + + +def get_default_marker_context(): + """Return the default context dictionary to use when parsing markers.""" + + def format_full_version(info): + version = f"{info.major}.{info.minor}.{info.micro}" + kind = info.releaselevel + if kind != "final": + version += kind[0] + str(info.serial) + return version + + if hasattr(sys, "implementation"): + implementation_version = format_full_version(sys.implementation.version) + implementation_name = sys.implementation.name + else: + implementation_version = "0" + implementation_name = "" + + # TODO: we can't use this + result = { + # See: https://www.python.org/dev/peps/pep-0508/#environment-markers + "implementation_name": implementation_name, + "implementation_version": implementation_version, + "os_name": os_name, + "platform_machine": platform.machine(), + "platform_python_implementation": platform.python_implementation(), + "platform_release": platform.release(), + "platform_system": platform.system(), + "platform_version": platform.version(), + "python_full_version": platform.python_version(), + "python_version": ".".join(platform.python_version().split(".")[:2]), + "sys_platform": sys.platform, + # See: https://www.python.org/dev/peps/pep-0345/#environment-markers + "os.name": os_name, + "platform.python_implementation": platform.python_implementation(), + "platform.version": platform.version(), + "platform.machine": platform.machine(), + "sys.platform": sys.platform, + "extra": "", + } + return result + + +DEFAULT_MARKER_CONTEXT = get_default_marker_context() +evaluator = Evaluator() + + +# FIXME: Should this raise errors, or fail silently or with a warning? +def interpret(marker, execution_context=None): + """ + Interpret a marker and return a result depending on environment. + + :param marker: The marker to interpret. + :type marker: str + :param execution_context: The context used for name lookup. + :type execution_context: mapping + """ + try: + expr, rest = parse_marker(marker) + except Exception as e: + raise SyntaxError(f"Unable to interpret marker syntax: {marker}: {e}") + + if rest and rest[0] != "#": + raise SyntaxError(f"unexpected trailing data in marker: {marker}: {rest}") + + context = DEFAULT_MARKER_CONTEXT.copy() + if execution_context: + context.update(execution_context) + + return evaluator.evaluate(expr, context) diff --git a/shared/package-files/08/082d0f5f90990495cccbbb1269ecd73e1131c120718920c645863382b276dbcd/blob b/shared/package-files/08/082d0f5f90990495cccbbb1269ecd73e1131c120718920c645863382b276dbcd/blob new file mode 100644 index 0000000000000000000000000000000000000000..fbcf1fb6922e21be00f748951092888ffb8f355a Binary files /dev/null and b/shared/package-files/08/082d0f5f90990495cccbbb1269ecd73e1131c120718920c645863382b276dbcd/blob differ diff --git a/shared/package-files/08/0831778a6e88c5d63732ee9fc114269121019974b79105489d0e29957b285fd7/blob b/shared/package-files/08/0831778a6e88c5d63732ee9fc114269121019974b79105489d0e29957b285fd7/blob new file mode 100644 index 0000000000000000000000000000000000000000..613733fa51675360caf33fd97b0b038c6fb6dfa2 --- /dev/null +++ b/shared/package-files/08/0831778a6e88c5d63732ee9fc114269121019974b79105489d0e29957b285fd7/blob @@ -0,0 +1,704 @@ +"""A file interface for handling local and remote data files. + +The goal of datasource is to abstract some of the file system operations +when dealing with data files so the researcher doesn't have to know all the +low-level details. Through datasource, a researcher can obtain and use a +file with one function call, regardless of location of the file. + +DataSource is meant to augment standard python libraries, not replace them. +It should work seamlessly with standard file IO operations and the os +module. + +DataSource files can originate locally or remotely: + +- local files : '/home/guido/src/local/data.txt' +- URLs (http, ftp, ...) : 'http://www.scipy.org/not/real/data.txt' + +DataSource files can also be compressed or uncompressed. Currently only +gzip, bz2 and xz are supported. + +Example:: + + >>> # Create a DataSource, use os.curdir (default) for local storage. + >>> from numpy import DataSource + >>> ds = DataSource() + >>> + >>> # Open a remote file. + >>> # DataSource downloads the file, stores it locally in: + >>> # './www.google.com/index.html' + >>> # opens the file and returns a file object. + >>> fp = ds.open('http://www.google.com/') # doctest: +SKIP + >>> + >>> # Use the file as you normally would + >>> fp.read() # doctest: +SKIP + >>> fp.close() # doctest: +SKIP + +""" +import os +import io + +from .._utils import set_module + + +_open = open + + +def _check_mode(mode, encoding, newline): + """Check mode and that encoding and newline are compatible. + + Parameters + ---------- + mode : str + File open mode. + encoding : str + File encoding. + newline : str + Newline for text files. + + """ + if "t" in mode: + if "b" in mode: + raise ValueError("Invalid mode: %r" % (mode,)) + else: + if encoding is not None: + raise ValueError("Argument 'encoding' not supported in binary mode") + if newline is not None: + raise ValueError("Argument 'newline' not supported in binary mode") + + +# Using a class instead of a module-level dictionary +# to reduce the initial 'import numpy' overhead by +# deferring the import of lzma, bz2 and gzip until needed + +# TODO: .zip support, .tar support? +class _FileOpeners: + """ + Container for different methods to open (un-)compressed files. + + `_FileOpeners` contains a dictionary that holds one method for each + supported file format. Attribute lookup is implemented in such a way + that an instance of `_FileOpeners` itself can be indexed with the keys + of that dictionary. Currently uncompressed files as well as files + compressed with ``gzip``, ``bz2`` or ``xz`` compression are supported. + + Notes + ----- + `_file_openers`, an instance of `_FileOpeners`, is made available for + use in the `_datasource` module. + + Examples + -------- + >>> import gzip + >>> np.lib._datasource._file_openers.keys() + [None, '.bz2', '.gz', '.xz', '.lzma'] + >>> np.lib._datasource._file_openers['.gz'] is gzip.open + True + + """ + + def __init__(self): + self._loaded = False + self._file_openers = {None: io.open} + + def _load(self): + if self._loaded: + return + + try: + import bz2 + self._file_openers[".bz2"] = bz2.open + except ImportError: + pass + + try: + import gzip + self._file_openers[".gz"] = gzip.open + except ImportError: + pass + + try: + import lzma + self._file_openers[".xz"] = lzma.open + self._file_openers[".lzma"] = lzma.open + except (ImportError, AttributeError): + # There are incompatible backports of lzma that do not have the + # lzma.open attribute, so catch that as well as ImportError. + pass + + self._loaded = True + + def keys(self): + """ + Return the keys of currently supported file openers. + + Parameters + ---------- + None + + Returns + ------- + keys : list + The keys are None for uncompressed files and the file extension + strings (i.e. ``'.gz'``, ``'.xz'``) for supported compression + methods. + + """ + self._load() + return list(self._file_openers.keys()) + + def __getitem__(self, key): + self._load() + return self._file_openers[key] + +_file_openers = _FileOpeners() + +def open(path, mode='r', destpath=os.curdir, encoding=None, newline=None): + """ + Open `path` with `mode` and return the file object. + + If ``path`` is an URL, it will be downloaded, stored in the + `DataSource` `destpath` directory and opened from there. + + Parameters + ---------- + path : str + Local file path or URL to open. + mode : str, optional + Mode to open `path`. Mode 'r' for reading, 'w' for writing, 'a' to + append. Available modes depend on the type of object specified by + path. Default is 'r'. + destpath : str, optional + Path to the directory where the source file gets downloaded to for + use. If `destpath` is None, a temporary directory will be created. + The default path is the current directory. + encoding : {None, str}, optional + Open text file with given encoding. The default encoding will be + what `io.open` uses. + newline : {None, str}, optional + Newline to use when reading text file. + + Returns + ------- + out : file object + The opened file. + + Notes + ----- + This is a convenience function that instantiates a `DataSource` and + returns the file object from ``DataSource.open(path)``. + + """ + + ds = DataSource(destpath) + return ds.open(path, mode, encoding=encoding, newline=newline) + + +@set_module('numpy') +class DataSource: + """ + DataSource(destpath='.') + + A generic data source file (file, http, ftp, ...). + + DataSources can be local files or remote files/URLs. The files may + also be compressed or uncompressed. DataSource hides some of the + low-level details of downloading the file, allowing you to simply pass + in a valid file path (or URL) and obtain a file object. + + Parameters + ---------- + destpath : str or None, optional + Path to the directory where the source file gets downloaded to for + use. If `destpath` is None, a temporary directory will be created. + The default path is the current directory. + + Notes + ----- + URLs require a scheme string (``http://``) to be used, without it they + will fail:: + + >>> repos = np.DataSource() + >>> repos.exists('www.google.com/index.html') + False + >>> repos.exists('http://www.google.com/index.html') + True + + Temporary directories are deleted when the DataSource is deleted. + + Examples + -------- + :: + + >>> ds = np.DataSource('/home/guido') + >>> urlname = 'http://www.google.com/' + >>> gfile = ds.open('http://www.google.com/') + >>> ds.abspath(urlname) + '/home/guido/www.google.com/index.html' + + >>> ds = np.DataSource(None) # use with temporary file + >>> ds.open('/home/guido/foobar.txt') + + >>> ds.abspath('/home/guido/foobar.txt') + '/tmp/.../home/guido/foobar.txt' + + """ + + def __init__(self, destpath=os.curdir): + """Create a DataSource with a local path at destpath.""" + if destpath: + self._destpath = os.path.abspath(destpath) + self._istmpdest = False + else: + import tempfile # deferring import to improve startup time + self._destpath = tempfile.mkdtemp() + self._istmpdest = True + + def __del__(self): + # Remove temp directories + if hasattr(self, '_istmpdest') and self._istmpdest: + import shutil + + shutil.rmtree(self._destpath) + + def _iszip(self, filename): + """Test if the filename is a zip file by looking at the file extension. + + """ + fname, ext = os.path.splitext(filename) + return ext in _file_openers.keys() + + def _iswritemode(self, mode): + """Test if the given mode will open a file for writing.""" + + # Currently only used to test the bz2 files. + _writemodes = ("w", "+") + for c in mode: + if c in _writemodes: + return True + return False + + def _splitzipext(self, filename): + """Split zip extension from filename and return filename. + + Returns + ------- + base, zip_ext : {tuple} + + """ + + if self._iszip(filename): + return os.path.splitext(filename) + else: + return filename, None + + def _possible_names(self, filename): + """Return a tuple containing compressed filename variations.""" + names = [filename] + if not self._iszip(filename): + for zipext in _file_openers.keys(): + if zipext: + names.append(filename+zipext) + return names + + def _isurl(self, path): + """Test if path is a net location. Tests the scheme and netloc.""" + + # We do this here to reduce the 'import numpy' initial import time. + from urllib.parse import urlparse + + # BUG : URLs require a scheme string ('http://') to be used. + # www.google.com will fail. + # Should we prepend the scheme for those that don't have it and + # test that also? Similar to the way we append .gz and test for + # for compressed versions of files. + + scheme, netloc, upath, uparams, uquery, ufrag = urlparse(path) + return bool(scheme and netloc) + + def _cache(self, path): + """Cache the file specified by path. + + Creates a copy of the file in the datasource cache. + + """ + # We import these here because importing them is slow and + # a significant fraction of numpy's total import time. + import shutil + from urllib.request import urlopen + + upath = self.abspath(path) + + # ensure directory exists + if not os.path.exists(os.path.dirname(upath)): + os.makedirs(os.path.dirname(upath)) + + # TODO: Doesn't handle compressed files! + if self._isurl(path): + with urlopen(path) as openedurl: + with _open(upath, 'wb') as f: + shutil.copyfileobj(openedurl, f) + else: + shutil.copyfile(path, upath) + return upath + + def _findfile(self, path): + """Searches for ``path`` and returns full path if found. + + If path is an URL, _findfile will cache a local copy and return the + path to the cached file. If path is a local file, _findfile will + return a path to that local file. + + The search will include possible compressed versions of the file + and return the first occurrence found. + + """ + + # Build list of possible local file paths + if not self._isurl(path): + # Valid local paths + filelist = self._possible_names(path) + # Paths in self._destpath + filelist += self._possible_names(self.abspath(path)) + else: + # Cached URLs in self._destpath + filelist = self._possible_names(self.abspath(path)) + # Remote URLs + filelist = filelist + self._possible_names(path) + + for name in filelist: + if self.exists(name): + if self._isurl(name): + name = self._cache(name) + return name + return None + + def abspath(self, path): + """ + Return absolute path of file in the DataSource directory. + + If `path` is an URL, then `abspath` will return either the location + the file exists locally or the location it would exist when opened + using the `open` method. + + Parameters + ---------- + path : str + Can be a local file or a remote URL. + + Returns + ------- + out : str + Complete path, including the `DataSource` destination directory. + + Notes + ----- + The functionality is based on `os.path.abspath`. + + """ + # We do this here to reduce the 'import numpy' initial import time. + from urllib.parse import urlparse + + # TODO: This should be more robust. Handles case where path includes + # the destpath, but not other sub-paths. Failing case: + # path = /home/guido/datafile.txt + # destpath = /home/alex/ + # upath = self.abspath(path) + # upath == '/home/alex/home/guido/datafile.txt' + + # handle case where path includes self._destpath + splitpath = path.split(self._destpath, 2) + if len(splitpath) > 1: + path = splitpath[1] + scheme, netloc, upath, uparams, uquery, ufrag = urlparse(path) + netloc = self._sanitize_relative_path(netloc) + upath = self._sanitize_relative_path(upath) + return os.path.join(self._destpath, netloc, upath) + + def _sanitize_relative_path(self, path): + """Return a sanitised relative path for which + os.path.abspath(os.path.join(base, path)).startswith(base) + """ + last = None + path = os.path.normpath(path) + while path != last: + last = path + # Note: os.path.join treats '/' as os.sep on Windows + path = path.lstrip(os.sep).lstrip('/') + path = path.lstrip(os.pardir).lstrip('..') + drive, path = os.path.splitdrive(path) # for Windows + return path + + def exists(self, path): + """ + Test if path exists. + + Test if `path` exists as (and in this order): + + - a local file. + - a remote URL that has been downloaded and stored locally in the + `DataSource` directory. + - a remote URL that has not been downloaded, but is valid and + accessible. + + Parameters + ---------- + path : str + Can be a local file or a remote URL. + + Returns + ------- + out : bool + True if `path` exists. + + Notes + ----- + When `path` is an URL, `exists` will return True if it's either + stored locally in the `DataSource` directory, or is a valid remote + URL. `DataSource` does not discriminate between the two, the file + is accessible if it exists in either location. + + """ + + # First test for local path + if os.path.exists(path): + return True + + # We import this here because importing urllib is slow and + # a significant fraction of numpy's total import time. + from urllib.request import urlopen + from urllib.error import URLError + + # Test cached url + upath = self.abspath(path) + if os.path.exists(upath): + return True + + # Test remote url + if self._isurl(path): + try: + netfile = urlopen(path) + netfile.close() + del(netfile) + return True + except URLError: + return False + return False + + def open(self, path, mode='r', encoding=None, newline=None): + """ + Open and return file-like object. + + If `path` is an URL, it will be downloaded, stored in the + `DataSource` directory and opened from there. + + Parameters + ---------- + path : str + Local file path or URL to open. + mode : {'r', 'w', 'a'}, optional + Mode to open `path`. Mode 'r' for reading, 'w' for writing, + 'a' to append. Available modes depend on the type of object + specified by `path`. Default is 'r'. + encoding : {None, str}, optional + Open text file with given encoding. The default encoding will be + what `io.open` uses. + newline : {None, str}, optional + Newline to use when reading text file. + + Returns + ------- + out : file object + File object. + + """ + + # TODO: There is no support for opening a file for writing which + # doesn't exist yet (creating a file). Should there be? + + # TODO: Add a ``subdir`` parameter for specifying the subdirectory + # used to store URLs in self._destpath. + + if self._isurl(path) and self._iswritemode(mode): + raise ValueError("URLs are not writeable") + + # NOTE: _findfile will fail on a new file opened for writing. + found = self._findfile(path) + if found: + _fname, ext = self._splitzipext(found) + if ext == 'bz2': + mode.replace("+", "") + return _file_openers[ext](found, mode=mode, + encoding=encoding, newline=newline) + else: + raise FileNotFoundError(f"{path} not found.") + + +class Repository (DataSource): + """ + Repository(baseurl, destpath='.') + + A data repository where multiple DataSource's share a base + URL/directory. + + `Repository` extends `DataSource` by prepending a base URL (or + directory) to all the files it handles. Use `Repository` when you will + be working with multiple files from one base URL. Initialize + `Repository` with the base URL, then refer to each file by its filename + only. + + Parameters + ---------- + baseurl : str + Path to the local directory or remote location that contains the + data files. + destpath : str or None, optional + Path to the directory where the source file gets downloaded to for + use. If `destpath` is None, a temporary directory will be created. + The default path is the current directory. + + Examples + -------- + To analyze all files in the repository, do something like this + (note: this is not self-contained code):: + + >>> repos = np.lib._datasource.Repository('/home/user/data/dir/') + >>> for filename in filelist: + ... fp = repos.open(filename) + ... fp.analyze() + ... fp.close() + + Similarly you could use a URL for a repository:: + + >>> repos = np.lib._datasource.Repository('http://www.xyz.edu/data') + + """ + + def __init__(self, baseurl, destpath=os.curdir): + """Create a Repository with a shared url or directory of baseurl.""" + DataSource.__init__(self, destpath=destpath) + self._baseurl = baseurl + + def __del__(self): + DataSource.__del__(self) + + def _fullpath(self, path): + """Return complete path for path. Prepends baseurl if necessary.""" + splitpath = path.split(self._baseurl, 2) + if len(splitpath) == 1: + result = os.path.join(self._baseurl, path) + else: + result = path # path contains baseurl already + return result + + def _findfile(self, path): + """Extend DataSource method to prepend baseurl to ``path``.""" + return DataSource._findfile(self, self._fullpath(path)) + + def abspath(self, path): + """ + Return absolute path of file in the Repository directory. + + If `path` is an URL, then `abspath` will return either the location + the file exists locally or the location it would exist when opened + using the `open` method. + + Parameters + ---------- + path : str + Can be a local file or a remote URL. This may, but does not + have to, include the `baseurl` with which the `Repository` was + initialized. + + Returns + ------- + out : str + Complete path, including the `DataSource` destination directory. + + """ + return DataSource.abspath(self, self._fullpath(path)) + + def exists(self, path): + """ + Test if path exists prepending Repository base URL to path. + + Test if `path` exists as (and in this order): + + - a local file. + - a remote URL that has been downloaded and stored locally in the + `DataSource` directory. + - a remote URL that has not been downloaded, but is valid and + accessible. + + Parameters + ---------- + path : str + Can be a local file or a remote URL. This may, but does not + have to, include the `baseurl` with which the `Repository` was + initialized. + + Returns + ------- + out : bool + True if `path` exists. + + Notes + ----- + When `path` is an URL, `exists` will return True if it's either + stored locally in the `DataSource` directory, or is a valid remote + URL. `DataSource` does not discriminate between the two, the file + is accessible if it exists in either location. + + """ + return DataSource.exists(self, self._fullpath(path)) + + def open(self, path, mode='r', encoding=None, newline=None): + """ + Open and return file-like object prepending Repository base URL. + + If `path` is an URL, it will be downloaded, stored in the + DataSource directory and opened from there. + + Parameters + ---------- + path : str + Local file path or URL to open. This may, but does not have to, + include the `baseurl` with which the `Repository` was + initialized. + mode : {'r', 'w', 'a'}, optional + Mode to open `path`. Mode 'r' for reading, 'w' for writing, + 'a' to append. Available modes depend on the type of object + specified by `path`. Default is 'r'. + encoding : {None, str}, optional + Open text file with given encoding. The default encoding will be + what `io.open` uses. + newline : {None, str}, optional + Newline to use when reading text file. + + Returns + ------- + out : file object + File object. + + """ + return DataSource.open(self, self._fullpath(path), mode, + encoding=encoding, newline=newline) + + def listdir(self): + """ + List files in the source Repository. + + Returns + ------- + files : list of str + List of file names (not containing a directory part). + + Notes + ----- + Does not currently work for remote repositories. + + """ + if self._isurl(self._baseurl): + raise NotImplementedError( + "Directory listing of URLs, not supported yet.") + else: + return os.listdir(self._baseurl) diff --git a/shared/package-files/08/08343747764e4a5814262793cf4d652057a7913863c5950d43297e8e1fdac5b6/blob b/shared/package-files/08/08343747764e4a5814262793cf4d652057a7913863c5950d43297e8e1fdac5b6/blob new file mode 100644 index 0000000000000000000000000000000000000000..2f6e056a9ac2399582eaf05985a26acf9161f213 --- /dev/null +++ b/shared/package-files/08/08343747764e4a5814262793cf4d652057a7913863c5950d43297e8e1fdac5b6/blob @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentEncoding": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentSchema": { "$dynamicRef": "#meta" } + } +} diff --git a/shared/package-files/08/08356ef929f04501b2ccaa77effb8f1f36c200703c6a68952f2b86813558c723/blob b/shared/package-files/08/08356ef929f04501b2ccaa77effb8f1f36c200703c6a68952f2b86813558c723/blob new file mode 100644 index 0000000000000000000000000000000000000000..3ed1b42cbe1582f3b974ccbb1befc90637ba18e0 --- /dev/null +++ b/shared/package-files/08/08356ef929f04501b2ccaa77effb8f1f36c200703c6a68952f2b86813558c723/blob @@ -0,0 +1,4 @@ +import torch +if torch.distributed.rpc.is_available(): + from .api.remote_module import RemoteModule +from .functional import * # noqa: F403 diff --git a/shared/package-files/08/08358a652ec2a49cb967f8a7aaee8b2cf0d5a67856a2e216864ef0e3e335c0c3/blob b/shared/package-files/08/08358a652ec2a49cb967f8a7aaee8b2cf0d5a67856a2e216864ef0e3e335c0c3/blob new file mode 100644 index 0000000000000000000000000000000000000000..e10266d07e03f4a38a969c20da7fe923742f0086 --- /dev/null +++ b/shared/package-files/08/08358a652ec2a49cb967f8a7aaee8b2cf0d5a67856a2e216864ef0e3e335c0c3/blob @@ -0,0 +1,38 @@ +# "magictoken" is used for markers as beginning and ending of example text. + +import unittest +import numpy as np +import numba + + +class NumpyGeneratorUsageTest(unittest.TestCase): + + def test_numpy_gen_usage(self): + # magictoken.npgen_usage.begin + x = np.random.default_rng(1) + y = np.random.default_rng(1) + + size = 10 + + @numba.njit + def do_stuff(gen): + return gen.random(size=int(size / 2)) + + original = x.random(size=size) + # [0.51182162 0.9504637 0.14415961 0.94864945 0.31183145 + # 0.42332645 0.82770259 0.40919914 0.54959369 0.02755911] + + numba_func_res = do_stuff(y) + # [0.51182162 0.9504637 0.14415961 0.94864945 0.31183145] + + after_numba = y.random(size=int(size / 2)) + # [0.42332645 0.82770259 0.40919914 0.54959369 0.02755911] + + # magictoken.npgen_usage.end + numba_res = np.concatenate((numba_func_res, after_numba)) + for _np_res, _nb_res in zip(original, numba_res): + self.assertEqual(_np_res, _nb_res) + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/08/083853b6609e1e609b4a6ed178271ec92f73d841a2bdf6ecfe905b34be04ebb2/blob b/shared/package-files/08/083853b6609e1e609b4a6ed178271ec92f73d841a2bdf6ecfe905b34be04ebb2/blob new file mode 100644 index 0000000000000000000000000000000000000000..97744e4cd48ac0f5494c2c197f01d4663d407519 --- /dev/null +++ b/shared/package-files/08/083853b6609e1e609b4a6ed178271ec92f73d841a2bdf6ecfe905b34be04ebb2/blob @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::istft(Tensor self, int n_fft, int? hop_length=None, int? win_length=None, Tensor? window=None, bool center=True, bool normalized=False, bool? onesided=None, int? length=None, bool return_complex=False) -> Tensor +inline at::Tensor istft(const at::Tensor & self, int64_t n_fft, c10::optional hop_length=c10::nullopt, c10::optional win_length=c10::nullopt, const c10::optional & window={}, bool center=true, bool normalized=false, c10::optional onesided=c10::nullopt, c10::optional length=c10::nullopt, bool return_complex=false) { + return at::_ops::istft::call(self, n_fft, hop_length, win_length, window, center, normalized, onesided, length, return_complex); +} + +} diff --git a/shared/package-files/08/083868ebd616dc54ed63229d0c12ba65d11c41834f02554895a5f3750e67712c/blob b/shared/package-files/08/083868ebd616dc54ed63229d0c12ba65d11c41834f02554895a5f3750e67712c/blob new file mode 100644 index 0000000000000000000000000000000000000000..46c8ead12fec7fc986f79aedaae638ce652ecbd3 --- /dev/null +++ b/shared/package-files/08/083868ebd616dc54ed63229d0c12ba65d11c41834f02554895a5f3750e67712c/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:083868ebd616dc54ed63229d0c12ba65d11c41834f02554895a5f3750e67712c +size 516881 diff --git a/shared/package-files/08/083afd847ede83d6e66eb74533613f08ea57e1e3fc22418ea5a41e38d025c9bb/blob b/shared/package-files/08/083afd847ede83d6e66eb74533613f08ea57e1e3fc22418ea5a41e38d025c9bb/blob new file mode 100644 index 0000000000000000000000000000000000000000..1701f1eee08e03b36b45d231d4563ec4a41e91bd --- /dev/null +++ b/shared/package-files/08/083afd847ede83d6e66eb74533613f08ea57e1e3fc22418ea5a41e38d025c9bb/blob @@ -0,0 +1,7 @@ +from .base_data_sparsifier import BaseDataSparsifier +from .data_norm_sparsifier import DataNormSparsifier + +__all__ = [ + "BaseDataSparsifier", + "DataNormSparsifier", +] diff --git a/shared/package-files/08/083b0f08ca6bcba5c114ea8c711154898e90924cce74a97b6af9ba7a71ab1e07/blob b/shared/package-files/08/083b0f08ca6bcba5c114ea8c711154898e90924cce74a97b6af9ba7a71ab1e07/blob new file mode 100644 index 0000000000000000000000000000000000000000..c9c5bfed1b5458a8c43ee2234087f164f2a37a80 --- /dev/null +++ b/shared/package-files/08/083b0f08ca6bcba5c114ea8c711154898e90924cce74a97b6af9ba7a71ab1e07/blob @@ -0,0 +1,921 @@ +import sys +import threading + +import numpy as np +from numpy import array, finfo, arange, eye, all, unique, ones, dot +import numpy.random as random +from numpy.testing import ( + assert_array_almost_equal, assert_almost_equal, + assert_equal, assert_array_equal, assert_, assert_allclose, + assert_warns, suppress_warnings) +import pytest +from pytest import raises as assert_raises + +import scipy.linalg +from scipy.linalg import norm, inv +from scipy.sparse import (dia_array, SparseEfficiencyWarning, csc_array, + csr_array, eye_array, issparse, dok_array, lil_array, bsr_array, kron) +from scipy.sparse.linalg import SuperLU +from scipy.sparse.linalg._dsolve import (spsolve, use_solver, splu, spilu, + MatrixRankWarning, _superlu, spsolve_triangular, factorized, + is_sptriangular, spbandwidth) +import scipy.sparse + +from scipy._lib._testutils import check_free_memory +from scipy._lib._util import ComplexWarning + + +sup_sparse_efficiency = suppress_warnings() +sup_sparse_efficiency.filter(SparseEfficiencyWarning) + +# scikits.umfpack is not a SciPy dependency but it is optionally used in +# dsolve, so check whether it's available +try: + import scikits.umfpack as umfpack + has_umfpack = True +except ImportError: + has_umfpack = False + +def toarray(a): + if issparse(a): + return a.toarray() + else: + return a + + +def setup_bug_8278(): + N = 2 ** 6 + h = 1/N + Ah1D = dia_array(([-1, 2, -1], [-1, 0, 1]), shape=(N-1, N-1))/(h**2) + eyeN = eye_array(N - 1) + A = (kron(eyeN, kron(eyeN, Ah1D)) + + kron(eyeN, kron(Ah1D, eyeN)) + + kron(Ah1D, kron(eyeN, eyeN))) + b = np.random.rand((N-1)**3) + return A, b + + +class TestFactorized: + def setup_method(self): + n = 5 + d = arange(n) + 1 + self.n = n + self.A = dia_array(((d, 2*d, d[::-1]), (-3, 0, 5)), shape=(n,n)).tocsc() + random.seed(1234) + + def _check_singular(self): + A = csc_array((5,5), dtype='d') + b = ones(5) + assert_array_almost_equal(0. * b, factorized(A)(b)) + + def _check_non_singular(self): + # Make a diagonal dominant, to make sure it is not singular + n = 5 + a = csc_array(random.rand(n, n)) + b = ones(n) + + expected = splu(a).solve(b) + assert_array_almost_equal(factorized(a)(b), expected) + + def test_singular_without_umfpack(self): + use_solver(useUmfpack=False) + with assert_raises(RuntimeError, match="Factor is exactly singular"): + self._check_singular() + + @pytest.mark.skipif(not has_umfpack, reason="umfpack not available") + def test_singular_with_umfpack(self): + use_solver(useUmfpack=True) + with suppress_warnings() as sup: + sup.filter(RuntimeWarning, "divide by zero encountered in double_scalars") + assert_warns(umfpack.UmfpackWarning, self._check_singular) + + def test_non_singular_without_umfpack(self): + use_solver(useUmfpack=False) + self._check_non_singular() + + @pytest.mark.skipif(not has_umfpack, reason="umfpack not available") + def test_non_singular_with_umfpack(self): + use_solver(useUmfpack=True) + self._check_non_singular() + + def test_cannot_factorize_nonsquare_matrix_without_umfpack(self): + use_solver(useUmfpack=False) + msg = "can only factor square matrices" + with assert_raises(ValueError, match=msg): + factorized(self.A[:, :4]) + + @pytest.mark.skipif(not has_umfpack, reason="umfpack not available") + def test_factorizes_nonsquare_matrix_with_umfpack(self): + use_solver(useUmfpack=True) + # does not raise + factorized(self.A[:,:4]) + + def test_call_with_incorrectly_sized_matrix_without_umfpack(self): + use_solver(useUmfpack=False) + solve = factorized(self.A) + b = random.rand(4) + B = random.rand(4, 3) + BB = random.rand(self.n, 3, 9) + + with assert_raises(ValueError, match="is of incompatible size"): + solve(b) + with assert_raises(ValueError, match="is of incompatible size"): + solve(B) + with assert_raises(ValueError, + match="object too deep for desired array"): + solve(BB) + + @pytest.mark.skipif(not has_umfpack, reason="umfpack not available") + def test_call_with_incorrectly_sized_matrix_with_umfpack(self): + use_solver(useUmfpack=True) + solve = factorized(self.A) + b = random.rand(4) + B = random.rand(4, 3) + BB = random.rand(self.n, 3, 9) + + # does not raise + solve(b) + msg = "object too deep for desired array" + with assert_raises(ValueError, match=msg): + solve(B) + with assert_raises(ValueError, match=msg): + solve(BB) + + def test_call_with_cast_to_complex_without_umfpack(self): + use_solver(useUmfpack=False) + solve = factorized(self.A) + b = random.rand(4) + for t in [np.complex64, np.complex128]: + with assert_raises(TypeError, match="Cannot cast array data"): + solve(b.astype(t)) + + @pytest.mark.skipif(not has_umfpack, reason="umfpack not available") + def test_call_with_cast_to_complex_with_umfpack(self): + use_solver(useUmfpack=True) + solve = factorized(self.A) + b = random.rand(4) + for t in [np.complex64, np.complex128]: + assert_warns(ComplexWarning, solve, b.astype(t)) + + @pytest.mark.skipif(not has_umfpack, reason="umfpack not available") + def test_assume_sorted_indices_flag(self): + # a sparse matrix with unsorted indices + unsorted_inds = np.array([2, 0, 1, 0]) + data = np.array([10, 16, 5, 0.4]) + indptr = np.array([0, 1, 2, 4]) + A = csc_array((data, unsorted_inds, indptr), (3, 3)) + b = ones(3) + + # should raise when incorrectly assuming indices are sorted + use_solver(useUmfpack=True, assumeSortedIndices=True) + with assert_raises(RuntimeError, + match="UMFPACK_ERROR_invalid_matrix"): + factorized(A) + + # should sort indices and succeed when not assuming indices are sorted + use_solver(useUmfpack=True, assumeSortedIndices=False) + expected = splu(A.copy()).solve(b) + + assert_equal(A.has_sorted_indices, 0) + assert_array_almost_equal(factorized(A)(b), expected) + + @pytest.mark.slow + @pytest.mark.skipif(not has_umfpack, reason="umfpack not available") + def test_bug_8278(self): + check_free_memory(8000) + use_solver(useUmfpack=True) + A, b = setup_bug_8278() + A = A.tocsc() + f = factorized(A) + x = f(b) + assert_array_almost_equal(A @ x, b) + + +class TestLinsolve: + def setup_method(self): + use_solver(useUmfpack=False) + + def test_singular(self): + A = csc_array((5,5), dtype='d') + b = array([1, 2, 3, 4, 5],dtype='d') + with suppress_warnings() as sup: + sup.filter(MatrixRankWarning, "Matrix is exactly singular") + x = spsolve(A, b) + assert_(not np.isfinite(x).any()) + + def test_singular_gh_3312(self): + # "Bad" test case that leads SuperLU to call LAPACK with invalid + # arguments. Check that it fails moderately gracefully. + ij = np.array([(17, 0), (17, 6), (17, 12), (10, 13)], dtype=np.int32) + v = np.array([0.284213, 0.94933781, 0.15767017, 0.38797296]) + A = csc_array((v, ij.T), shape=(20, 20)) + b = np.arange(20) + + try: + # should either raise a runtime error or return value + # appropriate for singular input (which yields the warning) + with suppress_warnings() as sup: + sup.filter(MatrixRankWarning, "Matrix is exactly singular") + x = spsolve(A, b) + assert not np.isfinite(x).any() + except RuntimeError: + pass + + @pytest.mark.parametrize('format', ['csc', 'csr']) + @pytest.mark.parametrize('idx_dtype', [np.int32, np.int64]) + def test_twodiags(self, format: str, idx_dtype: np.dtype): + A = dia_array(([[1, 2, 3, 4, 5], [6, 5, 8, 9, 10]], [0, 1]), + shape=(5, 5)).asformat(format) + b = array([1, 2, 3, 4, 5]) + + # condition number of A + cond_A = norm(A.toarray(), 2) * norm(inv(A.toarray()), 2) + + for t in ['f','d','F','D']: + eps = finfo(t).eps # floating point epsilon + b = b.astype(t) + Asp = A.astype(t) + Asp.indices = Asp.indices.astype(idx_dtype, copy=False) + Asp.indptr = Asp.indptr.astype(idx_dtype, copy=False) + + x = spsolve(Asp, b) + assert_(norm(b - Asp@x) < 10 * cond_A * eps) + + def test_bvector_smoketest(self): + Adense = array([[0., 1., 1.], + [1., 0., 1.], + [0., 0., 1.]]) + As = csc_array(Adense) + random.seed(1234) + x = random.randn(3) + b = As@x + x2 = spsolve(As, b) + + assert_array_almost_equal(x, x2) + + def test_bmatrix_smoketest(self): + Adense = array([[0., 1., 1.], + [1., 0., 1.], + [0., 0., 1.]]) + As = csc_array(Adense) + random.seed(1234) + x = random.randn(3, 4) + Bdense = As.dot(x) + Bs = csc_array(Bdense) + x2 = spsolve(As, Bs) + assert_array_almost_equal(x, x2.toarray()) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + def test_non_square(self): + # A is not square. + A = ones((3, 4)) + b = ones((4, 1)) + assert_raises(ValueError, spsolve, A, b) + # A2 and b2 have incompatible shapes. + A2 = csc_array(eye(3)) + b2 = array([1.0, 2.0]) + assert_raises(ValueError, spsolve, A2, b2) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + def test_example_comparison(self): + row = array([0,0,1,2,2,2]) + col = array([0,2,2,0,1,2]) + data = array([1,2,3,-4,5,6]) + sM = csr_array((data,(row,col)), shape=(3,3), dtype=float) + M = sM.toarray() + + row = array([0,0,1,1,0,0]) + col = array([0,2,1,1,0,0]) + data = array([1,1,1,1,1,1]) + sN = csr_array((data, (row,col)), shape=(3,3), dtype=float) + N = sN.toarray() + + sX = spsolve(sM, sN) + X = scipy.linalg.solve(M, N) + + assert_array_almost_equal(X, sX.toarray()) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + @pytest.mark.skipif(not has_umfpack, reason="umfpack not available") + def test_shape_compatibility(self): + use_solver(useUmfpack=True) + A = csc_array([[1., 0], [0, 2]]) + bs = [ + [1, 6], + array([1, 6]), + [[1], [6]], + array([[1], [6]]), + csc_array([[1], [6]]), + csr_array([[1], [6]]), + dok_array([[1], [6]]), + bsr_array([[1], [6]]), + array([[1., 2., 3.], [6., 8., 10.]]), + csc_array([[1., 2., 3.], [6., 8., 10.]]), + csr_array([[1., 2., 3.], [6., 8., 10.]]), + dok_array([[1., 2., 3.], [6., 8., 10.]]), + bsr_array([[1., 2., 3.], [6., 8., 10.]]), + ] + + for b in bs: + x = np.linalg.solve(A.toarray(), toarray(b)) + for spmattype in [csc_array, csr_array, dok_array, lil_array]: + x1 = spsolve(spmattype(A), b, use_umfpack=True) + x2 = spsolve(spmattype(A), b, use_umfpack=False) + + # check solution + if x.ndim == 2 and x.shape[1] == 1: + # interprets also these as "vectors" + x = x.ravel() + + assert_array_almost_equal(toarray(x1), x, + err_msg=repr((b, spmattype, 1))) + assert_array_almost_equal(toarray(x2), x, + err_msg=repr((b, spmattype, 2))) + + # dense vs. sparse output ("vectors" are always dense) + if issparse(b) and x.ndim > 1: + assert_(issparse(x1), repr((b, spmattype, 1))) + assert_(issparse(x2), repr((b, spmattype, 2))) + else: + assert_(isinstance(x1, np.ndarray), repr((b, spmattype, 1))) + assert_(isinstance(x2, np.ndarray), repr((b, spmattype, 2))) + + # check output shape + if x.ndim == 1: + # "vector" + assert_equal(x1.shape, (A.shape[1],)) + assert_equal(x2.shape, (A.shape[1],)) + else: + # "matrix" + assert_equal(x1.shape, x.shape) + assert_equal(x2.shape, x.shape) + + A = csc_array((3, 3)) + b = csc_array((1, 3)) + assert_raises(ValueError, spsolve, A, b) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + def test_ndarray_support(self): + A = array([[1., 2.], [2., 0.]]) + x = array([[1., 1.], [0.5, -0.5]]) + b = array([[2., 0.], [2., 2.]]) + + assert_array_almost_equal(x, spsolve(A, b)) + + def test_gssv_badinput(self): + N = 10 + d = arange(N) + 1.0 + A = dia_array(((d, 2*d, d[::-1]), (-3, 0, 5)), shape=(N, N)) + + for container in (csc_array, csr_array): + A = container(A) + b = np.arange(N) + + def not_c_contig(x): + return x.repeat(2)[::2] + + def not_1dim(x): + return x[:,None] + + def bad_type(x): + return x.astype(bool) + + def too_short(x): + return x[:-1] + + badops = [not_c_contig, not_1dim, bad_type, too_short] + + for badop in badops: + msg = f"{container!r} {badop!r}" + # Not C-contiguous + assert_raises((ValueError, TypeError), _superlu.gssv, + N, A.nnz, badop(A.data), A.indices, A.indptr, + b, int(A.format == 'csc'), err_msg=msg) + assert_raises((ValueError, TypeError), _superlu.gssv, + N, A.nnz, A.data, badop(A.indices), A.indptr, + b, int(A.format == 'csc'), err_msg=msg) + assert_raises((ValueError, TypeError), _superlu.gssv, + N, A.nnz, A.data, A.indices, badop(A.indptr), + b, int(A.format == 'csc'), err_msg=msg) + + def test_sparsity_preservation(self): + ident = csc_array([ + [1, 0, 0], + [0, 1, 0], + [0, 0, 1]]) + b = csc_array([ + [0, 1], + [1, 0], + [0, 0]]) + x = spsolve(ident, b) + assert_equal(ident.nnz, 3) + assert_equal(b.nnz, 2) + assert_equal(x.nnz, 2) + assert_allclose(x.toarray(), b.toarray(), atol=1e-12, rtol=1e-12) + + def test_dtype_cast(self): + A_real = scipy.sparse.csr_array([[1, 2, 0], + [0, 0, 3], + [4, 0, 5]]) + A_complex = scipy.sparse.csr_array([[1, 2, 0], + [0, 0, 3], + [4, 0, 5 + 1j]]) + b_real = np.array([1,1,1]) + b_complex = np.array([1,1,1]) + 1j*np.array([1,1,1]) + x = spsolve(A_real, b_real) + assert_(np.issubdtype(x.dtype, np.floating)) + x = spsolve(A_real, b_complex) + assert_(np.issubdtype(x.dtype, np.complexfloating)) + x = spsolve(A_complex, b_real) + assert_(np.issubdtype(x.dtype, np.complexfloating)) + x = spsolve(A_complex, b_complex) + assert_(np.issubdtype(x.dtype, np.complexfloating)) + + @pytest.mark.slow + @pytest.mark.skipif(not has_umfpack, reason="umfpack not available") + def test_bug_8278(self): + check_free_memory(8000) + use_solver(useUmfpack=True) + A, b = setup_bug_8278() + x = spsolve(A, b) + assert_array_almost_equal(A @ x, b) + + +class TestSplu: + def setup_method(self): + use_solver(useUmfpack=False) + n = 40 + d = arange(n) + 1 + self.n = n + self.A = dia_array(((d, 2*d, d[::-1]), (-3, 0, 5)), shape=(n, n)).tocsc() + random.seed(1234) + + def _smoketest(self, spxlu, check, dtype, idx_dtype): + if np.issubdtype(dtype, np.complexfloating): + A = self.A + 1j*self.A.T + else: + A = self.A + + A = A.astype(dtype) + A.indices = A.indices.astype(idx_dtype, copy=False) + A.indptr = A.indptr.astype(idx_dtype, copy=False) + lu = spxlu(A) + + rng = random.RandomState(1234) + + # Input shapes + for k in [None, 1, 2, self.n, self.n+2]: + msg = f"k={k!r}" + + if k is None: + b = rng.rand(self.n) + else: + b = rng.rand(self.n, k) + + if np.issubdtype(dtype, np.complexfloating): + b = b + 1j*rng.rand(*b.shape) + b = b.astype(dtype) + + x = lu.solve(b) + check(A, b, x, msg) + + x = lu.solve(b, 'T') + check(A.T, b, x, msg) + + x = lu.solve(b, 'H') + check(A.T.conj(), b, x, msg) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + def test_splu_smoketest(self): + self._internal_test_splu_smoketest() + + def _internal_test_splu_smoketest(self): + # Check that splu works at all + def check(A, b, x, msg=""): + eps = np.finfo(A.dtype).eps + r = A @ x + assert_(abs(r - b).max() < 1e3*eps, msg) + + for dtype in [np.float32, np.float64, np.complex64, np.complex128]: + for idx_dtype in [np.int32, np.int64]: + self._smoketest(splu, check, dtype, idx_dtype) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + def test_spilu_smoketest(self): + self._internal_test_spilu_smoketest() + + def _internal_test_spilu_smoketest(self): + errors = [] + + def check(A, b, x, msg=""): + r = A @ x + err = abs(r - b).max() + assert_(err < 1e-2, msg) + if b.dtype in (np.float64, np.complex128): + errors.append(err) + + for dtype in [np.float32, np.float64, np.complex64, np.complex128]: + for idx_dtype in [np.int32, np.int64]: + self._smoketest(spilu, check, dtype, idx_dtype) + + assert_(max(errors) > 1e-5) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + def test_spilu_drop_rule(self): + # Test passing in the drop_rule argument to spilu. + A = eye_array(2) + + rules = [ + b'basic,area'.decode('ascii'), # unicode + b'basic,area', # ascii + [b'basic', b'area'.decode('ascii')] + ] + for rule in rules: + # Argument should be accepted + assert_(isinstance(spilu(A, drop_rule=rule), SuperLU)) + + def test_splu_nnz0(self): + A = csc_array((5,5), dtype='d') + assert_raises(RuntimeError, splu, A) + + def test_spilu_nnz0(self): + A = csc_array((5,5), dtype='d') + assert_raises(RuntimeError, spilu, A) + + def test_splu_basic(self): + # Test basic splu functionality. + n = 30 + rng = random.RandomState(12) + a = rng.rand(n, n) + a[a < 0.95] = 0 + # First test with a singular matrix + a[:, 0] = 0 + a_ = csc_array(a) + # Matrix is exactly singular + assert_raises(RuntimeError, splu, a_) + + # Make a diagonal dominant, to make sure it is not singular + a += 4*eye(n) + a_ = csc_array(a) + lu = splu(a_) + b = ones(n) + x = lu.solve(b) + assert_almost_equal(dot(a, x), b) + + def test_splu_perm(self): + # Test the permutation vectors exposed by splu. + n = 30 + a = random.random((n, n)) + a[a < 0.95] = 0 + # Make a diagonal dominant, to make sure it is not singular + a += 4*eye(n) + a_ = csc_array(a) + lu = splu(a_) + # Check that the permutation indices do belong to [0, n-1]. + for perm in (lu.perm_r, lu.perm_c): + assert_(all(perm > -1)) + assert_(all(perm < n)) + assert_equal(len(unique(perm)), len(perm)) + + # Now make a symmetric, and test that the two permutation vectors are + # the same + # Note: a += a.T relies on undefined behavior. + a = a + a.T + a_ = csc_array(a) + lu = splu(a_) + assert_array_equal(lu.perm_r, lu.perm_c) + + @pytest.mark.parametrize("splu_fun, rtol", [(splu, 1e-7), (spilu, 1e-1)]) + def test_natural_permc(self, splu_fun, rtol): + # Test that the "NATURAL" permc_spec does not permute the matrix + rng = np.random.RandomState(42) + n = 500 + p = 0.01 + A = scipy.sparse.random(n, n, p, random_state=rng) + x = rng.rand(n) + # Make A diagonal dominant to make sure it is not singular + A += (n+1)*scipy.sparse.eye_array(n) + A_ = csc_array(A) + b = A_ @ x + + # without permc_spec, permutation is not identity + lu = splu_fun(A_) + assert_(np.any(lu.perm_c != np.arange(n))) + + # with permc_spec="NATURAL", permutation is identity + lu = splu_fun(A_, permc_spec="NATURAL") + assert_array_equal(lu.perm_c, np.arange(n)) + + # Also, lu decomposition is valid + x2 = lu.solve(b) + assert_allclose(x, x2, rtol=rtol) + + @pytest.mark.skipif(not hasattr(sys, 'getrefcount'), reason="no sys.getrefcount") + def test_lu_refcount(self): + # Test that we are keeping track of the reference count with splu. + n = 30 + a = random.random((n, n)) + a[a < 0.95] = 0 + # Make a diagonal dominant, to make sure it is not singular + a += 4*eye(n) + a_ = csc_array(a) + lu = splu(a_) + + # And now test that we don't have a refcount bug + rc = sys.getrefcount(lu) + for attr in ('perm_r', 'perm_c'): + perm = getattr(lu, attr) + assert_equal(sys.getrefcount(lu), rc + 1) + del perm + assert_equal(sys.getrefcount(lu), rc) + + def test_bad_inputs(self): + A = self.A.tocsc() + + assert_raises(ValueError, splu, A[:,:4]) + assert_raises(ValueError, spilu, A[:,:4]) + + for lu in [splu(A), spilu(A)]: + b = random.rand(42) + B = random.rand(42, 3) + BB = random.rand(self.n, 3, 9) + assert_raises(ValueError, lu.solve, b) + assert_raises(ValueError, lu.solve, B) + assert_raises(ValueError, lu.solve, BB) + assert_raises(TypeError, lu.solve, + b.astype(np.complex64)) + assert_raises(TypeError, lu.solve, + b.astype(np.complex128)) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + def test_superlu_dlamch_i386_nan(self): + # SuperLU 4.3 calls some functions returning floats without + # declaring them. On i386@linux call convention, this fails to + # clear floating point registers after call. As a result, NaN + # can appear in the next floating point operation made. + # + # Here's a test case that triggered the issue. + n = 8 + d = np.arange(n) + 1 + A = dia_array(((d, 2*d, d[::-1]), (-3, 0, 5)), shape=(n, n)) + A = A.astype(np.float32) + spilu(A) + A = A + 1j*A + B = A.toarray() + assert_(not np.isnan(B).any()) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + def test_lu_attr(self): + + def check(dtype, complex_2=False): + A = self.A.astype(dtype) + + if complex_2: + A = A + 1j*A.T + + n = A.shape[0] + lu = splu(A) + + # Check that the decomposition is as advertised + + Pc = np.zeros((n, n)) + Pc[np.arange(n), lu.perm_c] = 1 + + Pr = np.zeros((n, n)) + Pr[lu.perm_r, np.arange(n)] = 1 + + Ad = A.toarray() + lhs = Pr.dot(Ad).dot(Pc) + rhs = (lu.L @ lu.U).toarray() + + eps = np.finfo(dtype).eps + + assert_allclose(lhs, rhs, atol=100*eps) + + check(np.float32) + check(np.float64) + check(np.complex64) + check(np.complex128) + check(np.complex64, True) + check(np.complex128, True) + + @pytest.mark.thread_unsafe + @pytest.mark.slow + @sup_sparse_efficiency + def test_threads_parallel(self): + oks = [] + + def worker(): + try: + self.test_splu_basic() + self._internal_test_splu_smoketest() + self._internal_test_spilu_smoketest() + oks.append(True) + except Exception: + pass + + threads = [threading.Thread(target=worker) + for k in range(20)] + for t in threads: + t.start() + for t in threads: + t.join() + + assert_equal(len(oks), 20) + + @pytest.mark.thread_unsafe + def test_singular_matrix(self): + # Test that SuperLU does not print to stdout when a singular matrix is + # passed. See gh-20993. + A = eye_array(10, format='csr') + A[-1, -1] = 0 + b = np.zeros(10) + with pytest.warns(MatrixRankWarning): + res = spsolve(A, b) + assert np.isnan(res).all() + + +class TestGstrsErrors: + def setup_method(self): + self.A = array([[1.0,2.0,3.0],[4.0,5.0,6.0],[7.0,8.0,9.0]], dtype=np.float64) + self.b = np.array([[1.0],[2.0],[3.0]], dtype=np.float64) + + def test_trans(self): + L = scipy.sparse.tril(self.A, format='csc') + U = scipy.sparse.triu(self.A, k=1, format='csc') + with assert_raises(ValueError, match="trans must be N, T, or H"): + _superlu.gstrs('X', L.shape[0], L.nnz, L.data, L.indices, L.indptr, + U.shape[0], U.nnz, U.data, U.indices, U.indptr, self.b) + + def test_shape_LU(self): + L = scipy.sparse.tril(self.A[0:2,0:2], format='csc') + U = scipy.sparse.triu(self.A, k=1, format='csc') + with assert_raises(ValueError, match="L and U must have the same dimension"): + _superlu.gstrs('N', L.shape[0], L.nnz, L.data, L.indices, L.indptr, + U.shape[0], U.nnz, U.data, U.indices, U.indptr, self.b) + + def test_shape_b(self): + L = scipy.sparse.tril(self.A, format='csc') + U = scipy.sparse.triu(self.A, k=1, format='csc') + with assert_raises(ValueError, match="right hand side array has invalid shape"): + _superlu.gstrs('N', L.shape[0], L.nnz, L.data, L.indices, L.indptr, + U.shape[0], U.nnz, U.data, U.indices, U.indptr, + self.b[0:2]) + + def test_types_differ(self): + L = scipy.sparse.tril(self.A.astype(np.float32), format='csc') + U = scipy.sparse.triu(self.A, k=1, format='csc') + with assert_raises(TypeError, match="nzvals types of L and U differ"): + _superlu.gstrs('N', L.shape[0], L.nnz, L.data, L.indices, L.indptr, + U.shape[0], U.nnz, U.data, U.indices, U.indptr, self.b) + + def test_types_unsupported(self): + L = scipy.sparse.tril(self.A.astype(np.uint8), format='csc') + U = scipy.sparse.triu(self.A.astype(np.uint8), k=1, format='csc') + with assert_raises(TypeError, match="nzvals is not of a type supported"): + _superlu.gstrs('N', L.shape[0], L.nnz, L.data, L.indices, L.indptr, + U.shape[0], U.nnz, U.data, U.indices, U.indptr, + self.b.astype(np.uint8)) + +class TestSpsolveTriangular: + def setup_method(self): + use_solver(useUmfpack=False) + + @pytest.mark.parametrize("fmt",["csr","csc"]) + def test_zero_diagonal(self,fmt): + n = 5 + rng = np.random.default_rng(43876432987) + A = rng.standard_normal((n, n)) + b = np.arange(n) + A = scipy.sparse.tril(A, k=0, format=fmt) + + x = spsolve_triangular(A, b, unit_diagonal=True, lower=True) + + A.setdiag(1) + assert_allclose(A.dot(x), b) + + # Regression test from gh-15199 + A = np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0]], dtype=np.float64) + b = np.array([1., 2., 3.]) + with suppress_warnings() as sup: + sup.filter(SparseEfficiencyWarning, "CSC or CSR matrix format is") + spsolve_triangular(A, b, unit_diagonal=True) + + @pytest.mark.parametrize("fmt",["csr","csc"]) + def test_singular(self,fmt): + n = 5 + if fmt == "csr": + A = csr_array((n, n)) + else: + A = csc_array((n, n)) + b = np.arange(n) + for lower in (True, False): + assert_raises(scipy.linalg.LinAlgError, + spsolve_triangular, A, b, lower=lower) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + def test_bad_shape(self): + # A is not square. + A = np.zeros((3, 4)) + b = ones((4, 1)) + assert_raises(ValueError, spsolve_triangular, A, b) + # A2 and b2 have incompatible shapes. + A2 = csr_array(eye(3)) + b2 = array([1.0, 2.0]) + assert_raises(ValueError, spsolve_triangular, A2, b2) + + @pytest.mark.thread_unsafe + @sup_sparse_efficiency + def test_input_types(self): + A = array([[1., 0.], [1., 2.]]) + b = array([[2., 0.], [2., 2.]]) + for matrix_type in (array, csc_array, csr_array): + x = spsolve_triangular(matrix_type(A), b, lower=True) + assert_array_almost_equal(A.dot(x), b) + + @pytest.mark.thread_unsafe + @pytest.mark.slow + @sup_sparse_efficiency + @pytest.mark.parametrize("n", [10, 10**2, 10**3]) + @pytest.mark.parametrize("m", [1, 10]) + @pytest.mark.parametrize("lower", [True, False]) + @pytest.mark.parametrize("format", ["csr", "csc"]) + @pytest.mark.parametrize("unit_diagonal", [False, True]) + @pytest.mark.parametrize("choice_of_A", ["real", "complex"]) + @pytest.mark.parametrize("choice_of_b", ["floats", "ints", "complexints"]) + def test_random(self, n, m, lower, format, unit_diagonal, choice_of_A, choice_of_b): + def random_triangle_matrix(n, lower=True, format="csr", choice_of_A="real"): + if choice_of_A == "real": + dtype = np.float64 + elif choice_of_A == "complex": + dtype = np.complex128 + else: + raise ValueError("choice_of_A must be 'real' or 'complex'.") + rng = np.random.default_rng(789002319) + rvs = rng.random + A = scipy.sparse.random(n, n, density=0.1, format='lil', dtype=dtype, + random_state=rng, data_rvs=rvs) + if lower: + A = scipy.sparse.tril(A, format="lil") + else: + A = scipy.sparse.triu(A, format="lil") + for i in range(n): + A[i, i] = np.random.rand() + 1 + if format == "csc": + A = A.tocsc(copy=False) + else: + A = A.tocsr(copy=False) + return A + + np.random.seed(1234) + A = random_triangle_matrix(n, lower=lower) + if choice_of_b == "floats": + b = np.random.rand(n, m) + elif choice_of_b == "ints": + b = np.random.randint(-9, 9, (n, m)) + elif choice_of_b == "complexints": + b = np.random.randint(-9, 9, (n, m)) + np.random.randint(-9, 9, (n, m)) * 1j + else: + raise ValueError( + "choice_of_b must be 'floats', 'ints', or 'complexints'.") + x = spsolve_triangular(A, b, lower=lower, unit_diagonal=unit_diagonal) + if unit_diagonal: + A.setdiag(1) + assert_allclose(A.dot(x), b, atol=1.5e-6) + + +@pytest.mark.thread_unsafe +@sup_sparse_efficiency +@pytest.mark.parametrize("nnz", [10, 10**2, 10**3]) +@pytest.mark.parametrize("fmt", ["csr", "csc", "coo", "dia", "dok", "lil"]) +def test_is_sptriangular_and_spbandwidth(nnz, fmt): + rng = np.random.default_rng(42) + + N = nnz // 2 + dens = 0.1 + A = scipy.sparse.random_array((N, N), density=dens, format="csr", rng=rng) + A[1, 3] = A[3, 1] = 22 # ensure not upper or lower + A = A.asformat(fmt) + AU = scipy.sparse.triu(A, format=fmt) + AL = scipy.sparse.tril(A, format=fmt) + D = 0.1 * scipy.sparse.eye_array(N, format=fmt) + + assert is_sptriangular(A) == (False, False) + assert is_sptriangular(AL) == (True, False) + assert is_sptriangular(AU) == (False, True) + assert is_sptriangular(D) == (True, True) + + assert spbandwidth(A) == scipy.linalg.bandwidth(A.toarray()) + assert spbandwidth(AU) == scipy.linalg.bandwidth(AU.toarray()) + assert spbandwidth(AL) == scipy.linalg.bandwidth(AL.toarray()) + assert spbandwidth(D) == scipy.linalg.bandwidth(D.toarray()) diff --git a/shared/package-files/08/083e8c7f3213c8279ab0b5010c25f3265c911ca7489c234cd04ed01a6017fc56/blob b/shared/package-files/08/083e8c7f3213c8279ab0b5010c25f3265c911ca7489c234cd04ed01a6017fc56/blob new file mode 100644 index 0000000000000000000000000000000000000000..3b4c4f5d5e18220c58c72d8c5b8947d0a9022c8d --- /dev/null +++ b/shared/package-files/08/083e8c7f3213c8279ab0b5010c25f3265c911ca7489c234cd04ed01a6017fc56/blob @@ -0,0 +1,28 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API ::std::tuple topk(const at::Tensor & self, int64_t k, int64_t dim=-1, bool largest=true, bool sorted=true); +TORCH_API ::std::tuple topk_symint(const at::Tensor & self, c10::SymInt k, int64_t dim=-1, bool largest=true, bool sorted=true); +TORCH_API ::std::tuple topk_out(at::Tensor & values, at::Tensor & indices, const at::Tensor & self, int64_t k, int64_t dim=-1, bool largest=true, bool sorted=true); +TORCH_API ::std::tuple topk_outf(const at::Tensor & self, int64_t k, int64_t dim, bool largest, bool sorted, at::Tensor & values, at::Tensor & indices); +TORCH_API ::std::tuple topk_symint_out(at::Tensor & values, at::Tensor & indices, const at::Tensor & self, c10::SymInt k, int64_t dim=-1, bool largest=true, bool sorted=true); +TORCH_API ::std::tuple topk_symint_outf(const at::Tensor & self, c10::SymInt k, int64_t dim, bool largest, bool sorted, at::Tensor & values, at::Tensor & indices); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/08/0841783816f8f9bc8425953ff5e25b67b58d59231b24eedda06037c95c0d0eee/blob b/shared/package-files/08/0841783816f8f9bc8425953ff5e25b67b58d59231b24eedda06037c95c0d0eee/blob new file mode 100644 index 0000000000000000000000000000000000000000..6ca866ee3d8b99dbd4b73b9790845eff995b23e9 --- /dev/null +++ b/shared/package-files/08/0841783816f8f9bc8425953ff5e25b67b58d59231b24eedda06037c95c0d0eee/blob @@ -0,0 +1,94 @@ +from contextlib import contextmanager + +import torch +from torch._C import DispatchKey # @manual +from torch._functorch._aot_autograd.utils import KNOWN_TYPES +from torch._higher_order_ops.utils import autograd_not_implemented +from torch._ops import HigherOrderOperator +from torch._subclasses.fake_tensor import FakeTensorMode +from torch.fx.experimental.proxy_tensor import ProxyTorchDispatchMode, track_tensor_tree +from torch.fx.node import has_side_effect +from torch.utils import _pytree as pytree + +# The call_torchbind operator represents a method invocation on a torchbind +# object. The calling convention is: +# call_torchbind(self: ScriptObject, method_name: str, *method_args, **method_kwargs) +# We do not expect users to write this operator directly. Instead it will be +# emitted by Dynamo when tracing encounters a torchbind object. +call_torchbind = HigherOrderOperator("call_torchbind") + +# Register this operator as side-effectful with FX. +# TODO: this is not really sufficient. While passes (hopefully) check +# Node.is_impure() and make good decisions, we also assume we can execute the +# graph as many times as we want without changing behavior, which is NOT true of +# ops that mutate torchbind object state. +has_side_effect(call_torchbind) + +_orig_scriptmethod_call = torch.ScriptMethod.__call__ + + +def torchbind_method_redispatch(self, *args, **kwargs): + if isinstance(self.raw_owner, torch.ScriptObject): + return call_torchbind(self.raw_owner, self.name, *args, **kwargs) + return _orig_scriptmethod_call(self, *args, **kwargs) + + +@contextmanager +def enable_torchbind_tracing(): + """Context manager that acts as a feature flag to enable torchbind tracing + behavior. Once torchbind tracing has been stabilized, we can remove this and + turn it always on. + """ + try: + KNOWN_TYPES.append(torch.ScriptObject) + torch.ScriptMethod.__call__ = torchbind_method_redispatch # type: ignore[method-assign] + yield + finally: + assert ( + KNOWN_TYPES.pop() is torch.ScriptObject + ), "Someone else messed with KNOWN_TYPES during tracing, exploding." + torch.ScriptMethod.__call__ = _orig_scriptmethod_call # type: ignore[method-assign] + + +@call_torchbind.py_impl(DispatchKey.CompositeExplicitAutograd) +def call_torchbind_impl(obj, method, *args, **kwargs): + return _orig_scriptmethod_call(getattr(obj, method), *args, **kwargs) + + +@call_torchbind.py_impl(ProxyTorchDispatchMode) +def inner(mode, *args, **kwargs): + if mode.enable_tracing: + proxy_args = pytree.tree_map(mode.tracer.unwrap_proxy, args) + proxy_kwargs = pytree.tree_map(mode.tracer.unwrap_proxy, kwargs) + + out_proxy = mode.tracer.create_proxy( + "call_function", + call_torchbind, + proxy_args, + proxy_kwargs, + ) + out = call_torchbind_impl(*args, **kwargs) + + return track_tensor_tree(out, out_proxy, constant=None, tracer=mode.tracer) + else: + return call_torchbind(*args, **kwargs) + + +# TODO: currently we just run the C++ implementation with fake tensors. +# But we should make it possible to register a fake torchbind implementation. +@call_torchbind.py_impl(FakeTensorMode) +def call_torchbind_fake(mode, *args, **kwargs): + with mode: + return call_torchbind_impl(*args, **kwargs) + + +call_torchbind.py_impl(DispatchKey.Autograd)( + autograd_not_implemented(call_torchbind, deferred_error=True) +) + + +@call_torchbind.py_functionalize_impl +def call_torchbind_func(ctx, *args, **kwargs): + args = ctx.unwrap_tensors(args) + with ctx.redispatch_to_next(): + return ctx.wrap_tensors(call_torchbind(*args, **kwargs)) diff --git a/shared/package-files/08/0847db444a04894a6cb0c849c235498b49c8eb1ec6647e28c51abc1ff26e42bd/blob b/shared/package-files/08/0847db444a04894a6cb0c849c235498b49c8eb1ec6647e28c51abc1ff26e42bd/blob new file mode 100644 index 0000000000000000000000000000000000000000..19d57f9b58a9c6cfd4a5e5328cb9419b0976f340 --- /dev/null +++ b/shared/package-files/08/0847db444a04894a6cb0c849c235498b49c8eb1ec6647e28c51abc1ff26e42bd/blob @@ -0,0 +1,491 @@ +#cython: boundscheck=False +#cython: wraparound=False +#cython: cdivision=False +""" +State Space Model Smoother declarations + +Author: Chad Fulton +License: Simplified-BSD +""" + +cdef int SMOOTHER_STATE # Durbin and Koopman (2012), Chapter 4.4.2 +cdef int SMOOTHER_STATE_COV # Durbin and Koopman (2012), Chapter 4.4.3 +cdef int SMOOTHER_DISTURBANCE # Durbin and Koopman (2012), Chapter 4.5 +cdef int SMOOTHER_DISTURBANCE_COV # Durbin and Koopman (2012), Chapter 4.5 +cdef int SMOOTHER_STATE_AUTOCOV # Durbin and Koopman (2012), Chapter 4.7 +cdef int SMOOTHER_ALL + +cdef int SMOOTH_CONVENTIONAL +cdef int SMOOTH_CLASSICAL +cdef int SMOOTH_ALTERNATIVE +cdef int SMOOTH_UNIVARIATE + +# Typical imports + +cimport numpy as np + +from statsmodels.tsa.statespace._kalman_filter cimport ( + cKalmanFilter, + dKalmanFilter, + sKalmanFilter, + zKalmanFilter, +) +from statsmodels.tsa.statespace._representation cimport ( + cStatespace, + dStatespace, + sStatespace, + zStatespace, +) + + +# Single precision +cdef class sKalmanSmoother(object): + # Statespace object + cdef readonly sStatespace model + # Kalman filter + cdef readonly sKalmanFilter kfilter + + cdef readonly int t + cdef readonly int smoother_output + cdef readonly int smooth_method + cdef readonly int _smooth_method + cdef readonly int filter_method + + cdef readonly np.float32_t [::1,:] scaled_smoothed_estimator + cdef readonly np.float32_t [::1,:,:] scaled_smoothed_estimator_cov + cdef readonly np.float32_t [::1,:] smoothing_error + cdef readonly np.float32_t [::1,:] smoothed_state + cdef readonly np.float32_t [::1,:,:] smoothed_state_cov + cdef readonly np.float32_t [::1,:] smoothed_measurement_disturbance + cdef readonly np.float32_t [::1,:] smoothed_state_disturbance + cdef readonly np.float32_t [::1,:,:] smoothed_measurement_disturbance_cov + cdef readonly np.float32_t [::1,:,:] smoothed_state_disturbance_cov + + cdef readonly np.float32_t [::1,:,:] smoothed_state_autocov, innovations_transition + cdef readonly np.float32_t [::1,:] tmp_autocov + + cdef readonly np.float32_t [::1,:] scaled_smoothed_diffuse_estimator + cdef readonly np.float32_t [::1,:,:] scaled_smoothed_diffuse1_estimator_cov + cdef readonly np.float32_t [::1,:,:] scaled_smoothed_diffuse2_estimator_cov + + cdef readonly np.float32_t [:] selected_design + cdef readonly np.float32_t [:] selected_obs_cov + + cdef readonly np.float32_t [::1,:] tmpL, tmpL2, tmp0, tmp00, tmp000 + + # Statespace + # cdef np.float32_t * _design + # cdef np.float32_t * _obs_cov + # cdef np.float32_t * _transition + # cdef np.float32_t * _selection + # cdef np.float32_t * _state_cov + + # Kalman filter + # cdef np.float32_t * _predicted_state + # cdef np.float32_t * _predicted_state_cov + # cdef np.float32_t * _kalman_gain + + # cdef np.float32_t * _tmp1 + # cdef np.float32_t * _tmp2 + # cdef np.float32_t * _tmp3 + # cdef np.float32_t * _tmp4 + + # Kalman smoother + cdef np.float32_t * _input_scaled_smoothed_estimator + cdef np.float32_t * _input_scaled_smoothed_estimator_cov + + cdef np.float32_t * _scaled_smoothed_estimator + cdef np.float32_t * _scaled_smoothed_estimator_cov + cdef np.float32_t * _smoothing_error + cdef np.float32_t * _smoothed_state + cdef np.float32_t * _smoothed_state_cov + cdef np.float32_t * _smoothed_measurement_disturbance + cdef np.float32_t * _smoothed_state_disturbance + cdef np.float32_t * _smoothed_measurement_disturbance_cov + cdef np.float32_t * _smoothed_state_disturbance_cov + + cdef np.float32_t * _innovations_transition + cdef np.float32_t * _smoothed_state_autocov + cdef np.float32_t * _tmp_autocov + + cdef np.float32_t * _input_scaled_smoothed_diffuse_estimator + cdef np.float32_t * _input_scaled_smoothed_diffuse1_estimator_cov + cdef np.float32_t * _input_scaled_smoothed_diffuse2_estimator_cov + cdef np.float32_t * _scaled_smoothed_diffuse_estimator + cdef np.float32_t * _scaled_smoothed_diffuse1_estimator_cov + cdef np.float32_t * _scaled_smoothed_diffuse2_estimator_cov + + # Temporary + cdef np.float32_t * _tmpL + cdef np.float32_t * _tmpL2 + cdef np.float32_t * _tmp0 + cdef np.float32_t * _tmp00 + cdef np.float32_t * _tmp000 + + # Functions + cdef int (*smooth_estimators_measurement)( + sKalmanSmoother, sKalmanFilter, sStatespace + ) except * + cdef int (*smooth_estimators_time)( + sKalmanSmoother, sKalmanFilter, sStatespace + ) + cdef int (*smooth_state)( + sKalmanSmoother, sKalmanFilter, sStatespace + ) + cdef int (*smooth_disturbances)( + sKalmanSmoother, sKalmanFilter, sStatespace + ) + + # cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_posdef2, k_endogstates, k_statesposdef + + cdef allocate_arrays(self) + cdef int check_filter_method_changed(self) + cdef int reset_filter_method(self, int force_reset=*) + cpdef set_smoother_output(self, int smoother_output, int force_reset=*) + cpdef set_smooth_method(self, int smooth_method) + cpdef reset(self, int force_reset=*) + cpdef seek(self, unsigned int t) + cdef void initialize_statespace_object_pointers(self) except * + cdef void initialize_filter_object_pointers(self) + cdef void initialize_smoother_object_pointers(self) except * + cdef void initialize_function_pointers(self) except * + cdef void _initialize_temp_pointers(self) except * + +# Double precision +cdef class dKalmanSmoother(object): + # Statespace object + cdef readonly dStatespace model + # Kalman filter + cdef readonly dKalmanFilter kfilter + + cdef readonly int t + cdef readonly int smoother_output + cdef readonly int smooth_method + cdef readonly int _smooth_method + cdef readonly int filter_method + + cdef readonly np.float64_t [::1,:] scaled_smoothed_estimator + cdef readonly np.float64_t [::1,:,:] scaled_smoothed_estimator_cov + cdef readonly np.float64_t [::1,:] smoothing_error + cdef readonly np.float64_t [::1,:] smoothed_state + cdef readonly np.float64_t [::1,:,:] smoothed_state_cov + cdef readonly np.float64_t [::1,:] smoothed_measurement_disturbance + cdef readonly np.float64_t [::1,:] smoothed_state_disturbance + cdef readonly np.float64_t [::1,:,:] smoothed_measurement_disturbance_cov + cdef readonly np.float64_t [::1,:,:] smoothed_state_disturbance_cov + + cdef readonly np.float64_t [::1,:,:] smoothed_state_autocov, innovations_transition + cdef readonly np.float64_t [::1,:] tmp_autocov + + cdef readonly np.float64_t [::1,:] scaled_smoothed_diffuse_estimator + cdef readonly np.float64_t [::1,:,:] scaled_smoothed_diffuse1_estimator_cov + cdef readonly np.float64_t [::1,:,:] scaled_smoothed_diffuse2_estimator_cov + + cdef readonly np.float64_t [:] selected_design + cdef readonly np.float64_t [:] selected_obs_cov + + cdef readonly np.float64_t [::1,:] tmpL, tmpL2, tmp0, tmp00, tmp000 + + # Statespace + # cdef np.float64_t * _design + # cdef np.float64_t * _obs_cov + # cdef np.float64_t * _transition + # cdef np.float64_t * _selection + # cdef np.float64_t * _state_cov + + # Kalman filter + # cdef np.float64_t * _predicted_state + # cdef np.float64_t * _predicted_state_cov + # cdef np.float64_t * _kalman_gain + + # cdef np.float64_t * _tmp1 + # cdef np.float64_t * _tmp2 + # cdef np.float64_t * _tmp3 + # cdef np.float64_t * _tmp4 + + # Kalman smoother + cdef np.float64_t * _input_scaled_smoothed_estimator + cdef np.float64_t * _input_scaled_smoothed_estimator_cov + + cdef np.float64_t * _scaled_smoothed_estimator + cdef np.float64_t * _scaled_smoothed_estimator_cov + cdef np.float64_t * _smoothing_error + cdef np.float64_t * _smoothed_state + cdef np.float64_t * _smoothed_state_cov + cdef np.float64_t * _smoothed_measurement_disturbance + cdef np.float64_t * _smoothed_state_disturbance + cdef np.float64_t * _smoothed_measurement_disturbance_cov + cdef np.float64_t * _smoothed_state_disturbance_cov + + cdef np.float64_t * _innovations_transition + cdef np.float64_t * _smoothed_state_autocov + cdef np.float64_t * _tmp_autocov + + cdef np.float64_t * _input_scaled_smoothed_diffuse_estimator + cdef np.float64_t * _input_scaled_smoothed_diffuse1_estimator_cov + cdef np.float64_t * _input_scaled_smoothed_diffuse2_estimator_cov + cdef np.float64_t * _scaled_smoothed_diffuse_estimator + cdef np.float64_t * _scaled_smoothed_diffuse1_estimator_cov + cdef np.float64_t * _scaled_smoothed_diffuse2_estimator_cov + + # Temporary + cdef np.float64_t * _tmpL + cdef np.float64_t * _tmpL2 + cdef np.float64_t * _tmp0 + cdef np.float64_t * _tmp00 + cdef np.float64_t * _tmp000 + + # Functions + cdef int (*smooth_estimators_measurement)( + dKalmanSmoother, dKalmanFilter, dStatespace + ) except * + cdef int (*smooth_estimators_time)( + dKalmanSmoother, dKalmanFilter, dStatespace + ) + cdef int (*smooth_state)( + dKalmanSmoother, dKalmanFilter, dStatespace + ) + cdef int (*smooth_disturbances)( + dKalmanSmoother, dKalmanFilter, dStatespace + ) + + # cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_posdef2, k_endogstates, k_statesposdef + + cdef allocate_arrays(self) + cdef int check_filter_method_changed(self) + cdef int reset_filter_method(self, int force_reset=*) + cpdef set_smoother_output(self, int smoother_output, int force_reset=*) + cpdef set_smooth_method(self, int smooth_method) + cpdef reset(self, int force_reset=*) + cpdef seek(self, unsigned int t) + cdef void initialize_statespace_object_pointers(self) except * + cdef void initialize_filter_object_pointers(self) + cdef void initialize_smoother_object_pointers(self) except * + cdef void initialize_function_pointers(self) except * + cdef void _initialize_temp_pointers(self) except * + +# Single precision complex +cdef class cKalmanSmoother(object): + # Statespace object + cdef readonly cStatespace model + # Kalman filter + cdef readonly cKalmanFilter kfilter + + cdef readonly int t + cdef readonly int smoother_output + cdef readonly int smooth_method + cdef readonly int _smooth_method + cdef readonly int filter_method + + cdef readonly np.complex64_t [::1,:] scaled_smoothed_estimator + cdef readonly np.complex64_t [::1,:,:] scaled_smoothed_estimator_cov + cdef readonly np.complex64_t [::1,:] smoothing_error + cdef readonly np.complex64_t [::1,:] smoothed_state + cdef readonly np.complex64_t [::1,:,:] smoothed_state_cov + cdef readonly np.complex64_t [::1,:] smoothed_measurement_disturbance + cdef readonly np.complex64_t [::1,:] smoothed_state_disturbance + cdef readonly np.complex64_t [::1,:,:] smoothed_measurement_disturbance_cov + cdef readonly np.complex64_t [::1,:,:] smoothed_state_disturbance_cov + + cdef readonly np.complex64_t [::1,:,:] smoothed_state_autocov, innovations_transition + cdef readonly np.complex64_t [::1,:] tmp_autocov + + cdef readonly np.complex64_t [::1,:] scaled_smoothed_diffuse_estimator + cdef readonly np.complex64_t [::1,:,:] scaled_smoothed_diffuse1_estimator_cov + cdef readonly np.complex64_t [::1,:,:] scaled_smoothed_diffuse2_estimator_cov + + cdef readonly np.complex64_t [:] selected_design + cdef readonly np.complex64_t [:] selected_obs_cov + + cdef readonly np.complex64_t [::1,:] tmpL, tmpL2, tmp0, tmp00, tmp000 + + # Statespace + # cdef np.complex64_t * _design + # cdef np.complex64_t * _obs_cov + # cdef np.complex64_t * _transition + # cdef np.complex64_t * _selection + # cdef np.complex64_t * _state_cov + + # Kalman filter + # cdef np.complex64_t * _predicted_state + # cdef np.complex64_t * _predicted_state_cov + # cdef np.complex64_t * _kalman_gain + + # cdef np.complex64_t * _tmp1 + # cdef np.complex64_t * _tmp2 + # cdef np.complex64_t * _tmp3 + # cdef np.complex64_t * _tmp4 + + # Kalman smoother + cdef np.complex64_t * _input_scaled_smoothed_estimator + cdef np.complex64_t * _input_scaled_smoothed_estimator_cov + + cdef np.complex64_t * _scaled_smoothed_estimator + cdef np.complex64_t * _scaled_smoothed_estimator_cov + cdef np.complex64_t * _smoothing_error + cdef np.complex64_t * _smoothed_state + cdef np.complex64_t * _smoothed_state_cov + cdef np.complex64_t * _smoothed_measurement_disturbance + cdef np.complex64_t * _smoothed_state_disturbance + cdef np.complex64_t * _smoothed_measurement_disturbance_cov + cdef np.complex64_t * _smoothed_state_disturbance_cov + + cdef np.complex64_t * _innovations_transition + cdef np.complex64_t * _smoothed_state_autocov + cdef np.complex64_t * _tmp_autocov + + cdef np.complex64_t * _input_scaled_smoothed_diffuse_estimator + cdef np.complex64_t * _input_scaled_smoothed_diffuse1_estimator_cov + cdef np.complex64_t * _input_scaled_smoothed_diffuse2_estimator_cov + cdef np.complex64_t * _scaled_smoothed_diffuse_estimator + cdef np.complex64_t * _scaled_smoothed_diffuse1_estimator_cov + cdef np.complex64_t * _scaled_smoothed_diffuse2_estimator_cov + + # Temporary + cdef np.complex64_t * _tmpL + cdef np.complex64_t * _tmpL2 + cdef np.complex64_t * _tmp0 + cdef np.complex64_t * _tmp00 + cdef np.complex64_t * _tmp000 + + # Functions + cdef int (*smooth_estimators_measurement)( + cKalmanSmoother, cKalmanFilter, cStatespace + ) except * + cdef int (*smooth_estimators_time)( + cKalmanSmoother, cKalmanFilter, cStatespace + ) + cdef int (*smooth_state)( + cKalmanSmoother, cKalmanFilter, cStatespace + ) + cdef int (*smooth_disturbances)( + cKalmanSmoother, cKalmanFilter, cStatespace + ) + + # cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_posdef2, k_endogstates, k_statesposdef + + cdef allocate_arrays(self) + cdef int check_filter_method_changed(self) + cdef int reset_filter_method(self, int force_reset=*) + cpdef set_smoother_output(self, int smoother_output, int force_reset=*) + cpdef set_smooth_method(self, int smooth_method) + cpdef reset(self, int force_reset=*) + cpdef seek(self, unsigned int t) + cdef void initialize_statespace_object_pointers(self) except * + cdef void initialize_filter_object_pointers(self) + cdef void initialize_smoother_object_pointers(self) except * + cdef void initialize_function_pointers(self) except * + cdef void _initialize_temp_pointers(self) except * + +# Double precision complex +cdef class zKalmanSmoother(object): + # Statespace object + cdef readonly zStatespace model + # Kalman filter + cdef readonly zKalmanFilter kfilter + + cdef readonly int t + cdef readonly int smoother_output + cdef readonly int smooth_method + cdef readonly int _smooth_method + cdef readonly int filter_method + + cdef readonly np.complex128_t [::1,:] scaled_smoothed_estimator + cdef readonly np.complex128_t [::1,:,:] scaled_smoothed_estimator_cov + cdef readonly np.complex128_t [::1,:] smoothing_error + cdef readonly np.complex128_t [::1,:] smoothed_state + cdef readonly np.complex128_t [::1,:,:] smoothed_state_cov + cdef readonly np.complex128_t [::1,:] smoothed_measurement_disturbance + cdef readonly np.complex128_t [::1,:] smoothed_state_disturbance + cdef readonly np.complex128_t [::1,:,:] smoothed_measurement_disturbance_cov + cdef readonly np.complex128_t [::1,:,:] smoothed_state_disturbance_cov + + cdef readonly np.complex128_t [::1,:,:] smoothed_state_autocov, innovations_transition + cdef readonly np.complex128_t [::1,:] tmp_autocov + + cdef readonly np.complex128_t [::1,:] scaled_smoothed_diffuse_estimator + cdef readonly np.complex128_t [::1,:,:] scaled_smoothed_diffuse1_estimator_cov + cdef readonly np.complex128_t [::1,:,:] scaled_smoothed_diffuse2_estimator_cov + + cdef readonly np.complex128_t [:] selected_design + cdef readonly np.complex128_t [:] selected_obs_cov + + cdef readonly np.complex128_t [::1,:] tmpL, tmpL2, tmp0, tmp00, tmp000 + + # Statespace + # cdef np.complex128_t * _design + # cdef np.complex128_t * _obs_cov + # cdef np.complex128_t * _transition + # cdef np.complex128_t * _selection + # cdef np.complex128_t * _state_cov + + # Kalman filter + # cdef np.complex128_t * _predicted_state + # cdef np.complex128_t * _predicted_state_cov + # cdef np.complex128_t * _kalman_gain + + # cdef np.complex128_t * _tmp1 + # cdef np.complex128_t * _tmp2 + # cdef np.complex128_t * _tmp3 + # cdef np.complex128_t * _tmp4 + + # Kalman smoother + cdef np.complex128_t * _input_scaled_smoothed_estimator + cdef np.complex128_t * _input_scaled_smoothed_estimator_cov + + cdef np.complex128_t * _scaled_smoothed_estimator + cdef np.complex128_t * _scaled_smoothed_estimator_cov + cdef np.complex128_t * _smoothing_error + cdef np.complex128_t * _smoothed_state + cdef np.complex128_t * _smoothed_state_cov + cdef np.complex128_t * _smoothed_measurement_disturbance + cdef np.complex128_t * _smoothed_state_disturbance + cdef np.complex128_t * _smoothed_measurement_disturbance_cov + cdef np.complex128_t * _smoothed_state_disturbance_cov + + cdef np.complex128_t * _innovations_transition + cdef np.complex128_t * _smoothed_state_autocov + cdef np.complex128_t * _tmp_autocov + + cdef np.complex128_t * _input_scaled_smoothed_diffuse_estimator + cdef np.complex128_t * _input_scaled_smoothed_diffuse1_estimator_cov + cdef np.complex128_t * _input_scaled_smoothed_diffuse2_estimator_cov + cdef np.complex128_t * _scaled_smoothed_diffuse_estimator + cdef np.complex128_t * _scaled_smoothed_diffuse1_estimator_cov + cdef np.complex128_t * _scaled_smoothed_diffuse2_estimator_cov + + # Temporary + cdef np.complex128_t * _tmpL + cdef np.complex128_t * _tmpL2 + cdef np.complex128_t * _tmp0 + cdef np.complex128_t * _tmp00 + cdef np.complex128_t * _tmp000 + + # Functions + cdef int (*smooth_estimators_measurement)( + zKalmanSmoother, zKalmanFilter, zStatespace + ) except * + cdef int (*smooth_estimators_time)( + zKalmanSmoother, zKalmanFilter, zStatespace + ) + cdef int (*smooth_state)( + zKalmanSmoother, zKalmanFilter, zStatespace + ) + cdef int (*smooth_disturbances)( + zKalmanSmoother, zKalmanFilter, zStatespace + ) + + # cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_posdef2, k_endogstates, k_statesposdef + + cdef allocate_arrays(self) + cdef int check_filter_method_changed(self) + cdef int reset_filter_method(self, int force_reset=*) + cpdef set_smoother_output(self, int smoother_output, int force_reset=*) + cpdef set_smooth_method(self, int smooth_method) + cpdef reset(self, int force_reset=*) + cpdef seek(self, unsigned int t) + cdef void initialize_statespace_object_pointers(self) except * + cdef void initialize_filter_object_pointers(self) + cdef void initialize_smoother_object_pointers(self) except * + cdef void initialize_function_pointers(self) except * + cdef void _initialize_temp_pointers(self) except * diff --git a/shared/package-files/08/08484acc448fd06109392e7a792b373fce6d495bc4b858285a1aec9e2c37bb85/blob b/shared/package-files/08/08484acc448fd06109392e7a792b373fce6d495bc4b858285a1aec9e2c37bb85/blob new file mode 100644 index 0000000000000000000000000000000000000000..0e2687d234ab32d8963e8b86fda599e8562e4a5c --- /dev/null +++ b/shared/package-files/08/08484acc448fd06109392e7a792b373fce6d495bc4b858285a1aec9e2c37bb85/blob @@ -0,0 +1,35 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::atleast_3d(Tensor self) -> Tensor +inline at::Tensor atleast_3d(const at::Tensor & self) { + return at::_ops::atleast_3d::call(self); +} + +// aten::atleast_3d.Sequence(Tensor[] tensors) -> Tensor[] +inline ::std::vector atleast_3d(at::TensorList tensors) { + return at::_ops::atleast_3d_Sequence::call(tensors); +} + +} diff --git a/shared/package-files/08/0849185e2dcc26e900307add00ed0182cbf3abf3f17a507c472d7f6e73f7d5c2/blob b/shared/package-files/08/0849185e2dcc26e900307add00ed0182cbf3abf3f17a507c472d7f6e73f7d5c2/blob new file mode 100644 index 0000000000000000000000000000000000000000..2ae7cd4b523804f2573824e024a4c934a325e56f Binary files /dev/null and b/shared/package-files/08/0849185e2dcc26e900307add00ed0182cbf3abf3f17a507c472d7f6e73f7d5c2/blob differ diff --git a/shared/package-files/08/084a5c8a445afd8f9267fa05b12695aef9c74b5cfdf58482fed17b56e8ac2d59/blob b/shared/package-files/08/084a5c8a445afd8f9267fa05b12695aef9c74b5cfdf58482fed17b56e8ac2d59/blob new file mode 100644 index 0000000000000000000000000000000000000000..b455bf1a869c9268cd9e45b5d54e85cc97db9164 --- /dev/null +++ b/shared/package-files/08/084a5c8a445afd8f9267fa05b12695aef9c74b5cfdf58482fed17b56e8ac2d59/blob @@ -0,0 +1,141 @@ +r""" +Utilities for Windows Registry manipulation + +Notes: + +winreg.SetValue -> sets _keys_ with default ("") values +winreg.SetValueEx -> sets values with named contents + +This is important when the argument has backslashes. +SetValue will process the backslashes into a path of keys +SetValueEx will create a value with name "path\with\keys" + + +Mnemonic: SetValueEx for "excalars" (scalars, named values) +""" +import winreg +from logging import getLogger + +from ...utils import logged_run + +log = getLogger(__name__) + + +def _reg_exe(*args, check=True): + return logged_run(["reg.exe", *args, "/f"], check=True) + + +def register_file_extension(extension, identifier, command, icon=None, mode="user"): + """ + We want to achieve this. Entries ending in / denote keys; no trailing / means named value. + If the item has a value attached to it, it's written after the : symbol. + + HKEY_*/ # current user or local machine + Software/ + Classes/ + ./ + OpenWithProgids/ + + ... + /: "a description of the file being handled" + DefaultIcon: "path to the app icon" + shell/ + open/ + command/: "the command to be executed when opening a file with this extension" + """ + with winreg.OpenKeyEx( + winreg.HKEY_LOCAL_MACHINE # HKLM + if mode == "system" + else winreg.HKEY_CURRENT_USER, # HKCU + r"Software\Classes", + ) as key: + # First we associate an extension with a handler + winreg.SetValueEx( + winreg.CreateKey(key, fr"{extension}\OpenWithProgids"), + identifier, + 0, + winreg.REG_SZ, + "", # presence of the key is enough + ) + log.debug("Created registry entry for extension '%s'", extension) + + # Now we register the handler + handler_desc = f"{extension} {identifier} handler" + winreg.SetValue(key, identifier, winreg.REG_SZ, handler_desc) + log.debug("Created registry entry for handler '%s'", identifier) + + # and set the 'open' command + subkey = rf"{identifier}\shell\open\command" + # Use SetValue to create subkeys as necessary + winreg.SetValue(key, subkey, winreg.REG_SZ, command) + log.debug("Created registry entry for command '%s'", command) + + if icon: + subkey = winreg.OpenKey(key, identifier) + winreg.SetValueEx(subkey, "DefaultIcon", 0, winreg.REG_SZ, icon) + log.debug("Created registry entry for icon '%s'", icon) + + # TODO: We can add contextual menu items too + # via f"{handler_key}\shell\\command" + + +def unregister_file_extension(extension, identifier, mode="user"): + root, root_str = ( + (winreg.HKEY_LOCAL_MACHINE, "HKLM") + if mode == "system" + else (winreg.HKEY_CURRENT_USER, "HKCU") + ) + _reg_exe("delete", fr"{root_str}\Software\Classes\{identifier}") + + try: + with winreg.OpenKey( + root, fr"Software\Classes\{extension}\OpenWithProgids", 0, winreg.KEY_ALL_ACCESS + ) as key: + try: + winreg.QueryValueEx(key, identifier) + except FileNotFoundError: + log.debug( + "Handler '%s' is not associated with extension '%s'", identifier, extension + ) + else: + winreg.DeleteValue(key, identifier) + except Exception as exc: + log.exception("Could not check key '%s' for deletion", extension, exc_info=exc) + raise + + +def register_url_protocol(protocol, command, identifier=None, icon=None, mode="user"): + if mode == "system": + key = winreg.CreateKey(winreg.HKEY_CLASSES_ROOT, protocol) + else: + key = winreg.CreateKey(winreg.HKEY_CURRENT_USER, fr"Software\Classes\{protocol}") + with key: + winreg.SetValueEx(key, "", 0, winreg.REG_SZ, f"URL:{protocol.title()}") + winreg.SetValueEx(key, "URL Protocol", 0, winreg.REG_SZ, "") + # SetValue creates sub keys when slashes are present; + # SetValueEx creates a value with backslashes - we don't want that here + winreg.SetValue(key, r"shell\open\command", winreg.REG_SZ, command) + if icon: + winreg.SetValueEx(key, "DefaultIcon", 0, winreg.REG_SZ, icon) + if identifier: + # We add this one value for traceability; not required + winreg.SetValueEx(key, "_menuinst", 0, winreg.REG_SZ, identifier) + + +def unregister_url_protocol(protocol, identifier=None, mode="user"): + if mode == "system": + key_tuple = winreg.HKEY_CLASSES_ROOT, protocol + key_str = fr"HKCR\{protocol}" + else: + key_tuple = winreg.HKEY_CURRENT_USER, fr"Software\Classes\{protocol}" + key_str = fr"HKCU\Software\Classes\{protocol}" + try: + with winreg.OpenKey(*key_tuple) as key: + value, _ = winreg.QueryValueEx(key, "_menuinst") + delete = identifier is None or value == identifier + except OSError as exc: + log.exception("Could not check key %s for deletion", protocol, exc_info=exc) + return + + if delete: + _reg_exe("delete", key_str, check=False) diff --git a/shared/package-files/08/084af1309d3205fbbf72f0a828932ef568ea51aa212c8aaa7f6dbc1a6f575892/blob b/shared/package-files/08/084af1309d3205fbbf72f0a828932ef568ea51aa212c8aaa7f6dbc1a6f575892/blob new file mode 100644 index 0000000000000000000000000000000000000000..a44a8c133b674aea416efeb4da469241b50a547f --- /dev/null +++ b/shared/package-files/08/084af1309d3205fbbf72f0a828932ef568ea51aa212c8aaa7f6dbc1a6f575892/blob @@ -0,0 +1,131 @@ +""" +================================================= +Orthogonal distance regression (:mod:`scipy.odr`) +================================================= + +.. currentmodule:: scipy.odr + +Package Content +=============== + +.. autosummary:: + :toctree: generated/ + + Data -- The data to fit. + RealData -- Data with weights as actual std. dev.s and/or covariances. + Model -- Stores information about the function to be fit. + ODR -- Gathers all info & manages the main fitting routine. + Output -- Result from the fit. + odr -- Low-level function for ODR. + + OdrWarning -- Warning about potential problems when running ODR. + OdrError -- Error exception. + OdrStop -- Stop exception. + + polynomial -- Factory function for a general polynomial model. + exponential -- Exponential model + multilinear -- Arbitrary-dimensional linear model + unilinear -- Univariate linear model + quadratic -- Quadratic model + +Usage information +================= + +Introduction +------------ + +Why Orthogonal Distance Regression (ODR)? Sometimes one has +measurement errors in the explanatory (a.k.a., "independent") +variable(s), not just the response (a.k.a., "dependent") variable(s). +Ordinary Least Squares (OLS) fitting procedures treat the data for +explanatory variables as fixed, i.e., not subject to error of any kind. +Furthermore, OLS procedures require that the response variables be an +explicit function of the explanatory variables; sometimes making the +equation explicit is impractical and/or introduces errors. ODR can +handle both of these cases with ease, and can even reduce to the OLS +case if that is sufficient for the problem. + +ODRPACK is a FORTRAN-77 library for performing ODR with possibly +non-linear fitting functions. It uses a modified trust-region +Levenberg-Marquardt-type algorithm [1]_ to estimate the function +parameters. The fitting functions are provided by Python functions +operating on NumPy arrays. The required derivatives may be provided +by Python functions as well, or may be estimated numerically. ODRPACK +can do explicit or implicit ODR fits, or it can do OLS. Input and +output variables may be multidimensional. Weights can be provided to +account for different variances of the observations, and even +covariances between dimensions of the variables. + +The `scipy.odr` package offers an object-oriented interface to +ODRPACK, in addition to the low-level `odr` function. + +Additional background information about ODRPACK can be found in the +`ODRPACK User's Guide +`_, reading +which is recommended. + +Basic usage +----------- + +1. Define the function you want to fit against.:: + + def f(B, x): + '''Linear function y = m*x + b''' + # B is a vector of the parameters. + # x is an array of the current x values. + # x is in the same format as the x passed to Data or RealData. + # + # Return an array in the same format as y passed to Data or RealData. + return B[0]*x + B[1] + +2. Create a Model.:: + + linear = Model(f) + +3. Create a Data or RealData instance.:: + + mydata = Data(x, y, wd=1./power(sx,2), we=1./power(sy,2)) + + or, when the actual covariances are known:: + + mydata = RealData(x, y, sx=sx, sy=sy) + +4. Instantiate ODR with your data, model and initial parameter estimate.:: + + myodr = ODR(mydata, linear, beta0=[1., 2.]) + +5. Run the fit.:: + + myoutput = myodr.run() + +6. Examine output.:: + + myoutput.pprint() + + +References +---------- +.. [1] P. T. Boggs and J. E. Rogers, "Orthogonal Distance Regression," + in "Statistical analysis of measurement error models and + applications: proceedings of the AMS-IMS-SIAM joint summer research + conference held June 10-16, 1989," Contemporary Mathematics, + vol. 112, pg. 186, 1990. + +""" +# version: 0.7 +# author: Robert Kern +# date: 2006-09-21 + +from ._odrpack import * +from ._models import * +from . import _add_newdocs + +# Deprecated namespaces, to be removed in v2.0.0 +from . import models, odrpack + +__all__ = [s for s in dir() + if not (s.startswith('_') or s in ('odr_stop', 'odr_error'))] + +from scipy._lib._testutils import PytestTester +test = PytestTester(__name__) +del PytestTester diff --git a/shared/package-files/08/084bc0c7c2c9f3dd30b251dddfcccdd19971b76cbe369689f4245ecadb510eaf/blob b/shared/package-files/08/084bc0c7c2c9f3dd30b251dddfcccdd19971b76cbe369689f4245ecadb510eaf/blob new file mode 100644 index 0000000000000000000000000000000000000000..e9854b618efc367bf57dd8e8dc75834816ac009c --- /dev/null +++ b/shared/package-files/08/084bc0c7c2c9f3dd30b251dddfcccdd19971b76cbe369689f4245ecadb510eaf/blob @@ -0,0 +1,42 @@ +contourpy-1.3.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +contourpy-1.3.2.dist-info/LICENSE,sha256=NBcJefxk9PXm36Zu8n3sMU___FhSAAxg9INuwd-_FW4,1534 +contourpy-1.3.2.dist-info/METADATA,sha256=DYYPfLivjoUAXCCUmeDKJdqFFbS2eRXui4i4hSwxbAg,5461 +contourpy-1.3.2.dist-info/RECORD,, +contourpy-1.3.2.dist-info/WHEEL,sha256=sZM_NeUMz2G4fDenMf11eikcCxcLaQWiYRmjwQBavQs,137 +contourpy/__init__.py,sha256=Vi2YbtUhM9VxYPY3PBvxfu0xZYr6fBysl5gQPJEo88k,11831 +contourpy/__pycache__/__init__.cpython-310.pyc,, +contourpy/__pycache__/_version.cpython-310.pyc,, +contourpy/__pycache__/array.cpython-310.pyc,, +contourpy/__pycache__/chunk.cpython-310.pyc,, +contourpy/__pycache__/convert.cpython-310.pyc,, +contourpy/__pycache__/dechunk.cpython-310.pyc,, +contourpy/__pycache__/enum_util.cpython-310.pyc,, +contourpy/__pycache__/typecheck.cpython-310.pyc,, +contourpy/__pycache__/types.cpython-310.pyc,, +contourpy/_contourpy.cpython-310-x86_64-linux-gnu.so,sha256=8it_MHwflBYc2jRua5KVBXY14gZO7MuH6GAuQVm8V-E,854312 +contourpy/_contourpy.pyi,sha256=fvtccxkiZwGb6qYag7Fp4E8bsFmAIjAmobf8LNxqfgc,7122 +contourpy/_version.py,sha256=HgKA3RqZvC7slo8MgLyffCGwJbQ3cY6I7oUMFvGLWps,22 +contourpy/array.py,sha256=4WwLuiZe30rizn_raymmY13OzE6hlCsDOO8kuVFOP18,8979 +contourpy/chunk.py,sha256=8njDQqlpuD22RjaaCyA75FXQsSQDY5hZGJSrxFpvGGU,3279 +contourpy/convert.py,sha256=mhyn7prEoWCnf0igaH-VqDwlk-CegFsZ4qOy2LL-hpU,26154 +contourpy/dechunk.py,sha256=EgFL6hw5H54ccuof4tJ2ehdnktT7trgZjiZqppsH8QI,7756 +contourpy/enum_util.py,sha256=o8MItJRs08oqzwPP3IwC75BBAY9Qq95saIzjkXBXwqA,1519 +contourpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +contourpy/typecheck.py,sha256=t1nvvCuKMYva1Zx4fc30EpdKFcO0Enz3n_UFfXBsq9o,10747 +contourpy/types.py,sha256=2K4T5tJpMIjYrkkg1Lqh3C2ZKlnOhnMtYmtwz92l_y8,247 +contourpy/util/__init__.py,sha256=eVhJ_crOHL7nkG4Kb0dOo7NL4WHMy_Px665aAN_3d-8,118 +contourpy/util/__pycache__/__init__.cpython-310.pyc,, +contourpy/util/__pycache__/_build_config.cpython-310.pyc,, +contourpy/util/__pycache__/bokeh_renderer.cpython-310.pyc,, +contourpy/util/__pycache__/bokeh_util.cpython-310.pyc,, +contourpy/util/__pycache__/data.cpython-310.pyc,, +contourpy/util/__pycache__/mpl_renderer.cpython-310.pyc,, +contourpy/util/__pycache__/mpl_util.cpython-310.pyc,, +contourpy/util/__pycache__/renderer.cpython-310.pyc,, +contourpy/util/_build_config.py,sha256=uFmEfpQ4-HVkN0zZi7c2060J1i2uoaPsvkS4pf0XdiY,1848 +contourpy/util/bokeh_renderer.py,sha256=sOAZKyN11296muuLQ4uhQYCM4eaMwjnxUFrbbIxucmY,13959 +contourpy/util/bokeh_util.py,sha256=wc-S3ewBUYWyIkEv9jkhFySIergjLQl4Z0UEVnE0HhA,2804 +contourpy/util/data.py,sha256=-7SSGMLX_gN-1H2JzpNSEB_EcEF_uMtYdOo_ePRIcg8,2586 +contourpy/util/mpl_renderer.py,sha256=qPWMxDL_n-4dg9gOIHX-Va2UQz6n98eJdIRszpYr2AU,20125 +contourpy/util/mpl_util.py,sha256=0Jz5f-aA9XMWlpO2pDnHbkVgxIiw4SY_ysxf_gACWEo,3452 +contourpy/util/renderer.py,sha256=8CBHzPmVsFPfqsWxqrxGBhqFpJhVeFHFeDzVXAgT8Fc,5118 diff --git a/shared/package-files/08/084ef1217dc504cf13b4a96a3bdbad18832b934ac183e8b15725996d43911680/blob b/shared/package-files/08/084ef1217dc504cf13b4a96a3bdbad18832b934ac183e8b15725996d43911680/blob new file mode 100644 index 0000000000000000000000000000000000000000..1d7afaac43659404f572f92ba2d5c8fd19e5c4e0 --- /dev/null +++ b/shared/package-files/08/084ef1217dc504cf13b4a96a3bdbad18832b934ac183e8b15725996d43911680/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor _add_batch_dim(const at::Tensor & self, int64_t batch_dim, int64_t level); +} // namespace native +} // namespace at diff --git a/shared/package-files/08/0852d8ea2cf5f5d00d3e56060c05a8c5ca0d03060290e1a0e4c83b02d7a93615/blob b/shared/package-files/08/0852d8ea2cf5f5d00d3e56060c05a8c5ca0d03060290e1a0e4c83b02d7a93615/blob new file mode 100644 index 0000000000000000000000000000000000000000..883c954bb699a129da9aca72410badf0313263d0 --- /dev/null +++ b/shared/package-files/08/0852d8ea2cf5f5d00d3e56060c05a8c5ca0d03060290e1a0e4c83b02d7a93615/blob @@ -0,0 +1,150 @@ +""" + pygments.styles.nord + ~~~~~~~~~~~~~~~~~~~~ + + pygments version of the "nord" theme by Arctic Ice Studio + https://www.nordtheme.com/ + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, Number, \ + Operator, Generic, Whitespace, Punctuation, Text, Token + + +class NordStyle(Style): + """ + Pygments version of the "nord" theme by Arctic Ice Studio. + """ + + line_number_color = "#D8DEE9" + line_number_background_color = "#242933" + line_number_special_color = "#242933" + line_number_special_background_color = "#D8DEE9" + + background_color = "#2E3440" + highlight_color = "#3B4252" + + styles = { + Token: "#d8dee9", + + Whitespace: '#d8dee9', + Punctuation: '#eceff4', + + Comment: 'italic #616e87', + Comment.Preproc: '#5e81ac', + + Keyword: 'bold #81a1c1', + Keyword.Pseudo: 'nobold #81a1c1', + Keyword.Type: 'nobold #81a1c1', + + Operator: 'bold #81a1c1', + Operator.Word: 'bold #81a1c1', + + Name: '#d8dee9', + Name.Builtin: '#81a1c1', + Name.Function: '#88c0d0', + Name.Class: '#8fbcbb', + Name.Namespace: '#8fbcbb', + Name.Exception: '#bf616a', + Name.Variable: '#d8dee9', + Name.Constant: '#8fbcbb', + Name.Entity: '#d08770', + Name.Attribute: '#8fbcbb', + Name.Tag: '#81a1c1', + Name.Decorator: '#d08770', + + String: '#a3be8c', + String.Doc: '#616e87', + String.Interpol: '#a3be8c', + String.Escape: '#ebcb8b', + String.Regex: '#ebcb8b', + String.Symbol: '#a3be8c', + String.Other: '#a3be8c', + + Number: '#b48ead', + + Generic.Heading: 'bold #88c0d0', + Generic.Subheading: 'bold #88c0d0', + Generic.Deleted: '#bf616a', + Generic.Inserted: '#a3be8c', + Generic.Error: '#bf616a', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.Prompt: 'bold #616e88', + Generic.Output: '#d8dee9', + Generic.Traceback: '#bf616a', + + Error: '#bf616a', + Text: '#d8dee9', + } + + +class NordDarkerStyle(Style): + """ + Pygments version of a darker "nord" theme by Arctic Ice Studio + """ + + line_number_color = "#D8DEE9" + line_number_background_color = "#242933" + line_number_special_color = "#242933" + line_number_special_background_color = "#D8DEE9" + + background_color = "#242933" + highlight_color = "#3B4252" + + styles = { + Token: "#d8dee9", + + Whitespace: '#d8dee9', + Punctuation: '#eceff4', + + Comment: 'italic #616e87', + Comment.Preproc: '#5e81ac', + + Keyword: 'bold #81a1c1', + Keyword.Pseudo: 'nobold #81a1c1', + Keyword.Type: 'nobold #81a1c1', + + Operator: 'bold #81a1c1', + Operator.Word: 'bold #81a1c1', + + Name: '#d8dee9', + Name.Builtin: '#81a1c1', + Name.Function: '#88c0d0', + Name.Class: '#8fbcbb', + Name.Namespace: '#8fbcbb', + Name.Exception: '#bf616a', + Name.Variable: '#d8dee9', + Name.Constant: '#8fbcbb', + Name.Entity: '#d08770', + Name.Attribute: '#8fbcbb', + Name.Tag: '#81a1c1', + Name.Decorator: '#d08770', + + String: '#a3be8c', + String.Doc: '#616e87', + String.Interpol: '#a3be8c', + String.Escape: '#ebcb8b', + String.Regex: '#ebcb8b', + String.Symbol: '#a3be8c', + String.Other: '#a3be8c', + + Number: '#b48ead', + + Generic.Heading: 'bold #88c0d0', + Generic.Subheading: 'bold #88c0d0', + Generic.Deleted: '#bf616a', + Generic.Inserted: '#a3be8c', + Generic.Error: '#bf616a', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.Prompt: 'bold #616e88', + Generic.Output: '#d8dee9', + Generic.Traceback: '#bf616a', + + Error: '#bf616a', + Text: '#d8dee9', + } diff --git a/shared/package-files/08/0855dea48aac25c054c60c36c9f871d630aee355cf8269f977ffba3ade02e35e/blob b/shared/package-files/08/0855dea48aac25c054c60c36c9f871d630aee355cf8269f977ffba3ade02e35e/blob new file mode 100644 index 0000000000000000000000000000000000000000..1fba4d7ff2a57c72f5ecb320db96ecc51d0bc45d Binary files /dev/null and b/shared/package-files/08/0855dea48aac25c054c60c36c9f871d630aee355cf8269f977ffba3ade02e35e/blob differ diff --git a/shared/package-files/08/0858e6c1fda782f1075e22248fcc62b854770b39da1ad00762d5e81b12529ceb/blob b/shared/package-files/08/0858e6c1fda782f1075e22248fcc62b854770b39da1ad00762d5e81b12529ceb/blob new file mode 100644 index 0000000000000000000000000000000000000000..58e5ed30d86debc6063a5d150c89d06faf95a342 --- /dev/null +++ b/shared/package-files/08/0858e6c1fda782f1075e22248fcc62b854770b39da1ad00762d5e81b12529ceb/blob @@ -0,0 +1,401 @@ +import dataclasses +import math +import operator +from typing import Any, Dict, Iterable, List, Optional, Tuple, Type + +import torch +from torch._subclasses.fake_tensor import FakeTensor + +from torch.export import ExportedProgram +from torch.utils._pytree import ( + _register_pytree_node, + Context, + FlattenFunc, + FromDumpableContextFn, + KeyPath, + keystr, + MappingKey, + SequenceKey, + ToDumpableContextFn, + UnflattenFunc, +) + + +def _check_input_constraints_for_graph( + input_placeholders: List[torch.fx.Node], flat_args_with_path, range_constraints +): + def get_keystr(key_path: KeyPath) -> str: + """For a given index into the flat_args, return a human readable string + describing how to access it, e.g. "*args["foo"][0].bar" + """ + # Prefix the keypath with "*args" or "**kwargs" to make it clearer where + # the arguments come from. Ultimately we ought to serialize the + # original arg names for the best error message here. + args_kwargs_key_path = key_path[0] + assert isinstance(args_kwargs_key_path, SequenceKey) + if args_kwargs_key_path.idx == 0: + return f"*args{keystr(key_path[1:])}" + else: + kwarg_key = key_path[1] + assert isinstance(kwarg_key, MappingKey) + name = str(kwarg_key)[1:-1] # get rid of the enclosed [] + return f"{name}{keystr(key_path[2:])}" + + import sympy + + from torch._export.passes.add_runtime_assertions_for_constraints_pass import ( + _convert_range_to_int, + ) + from torch.utils._sympy.solve import try_solve + + if len(flat_args_with_path) != len(input_placeholders): + raise RuntimeError( + "Unexpected number of inputs " + f"(expected {len(input_placeholders)}, got {len(flat_args_with_path)})" + ) + # NOTE: export already guarantees that the same symbol is used in metadata + # for all InputDims related by equality constraints, so we can just unify + # symbols with given input dimension values to check equality constraints. + unification_map: "Dict[sympy.Symbol, Any]" = {} + for (key_path, arg), node in zip(flat_args_with_path, input_placeholders): + node_val = node.meta.get("val") + if isinstance(node_val, FakeTensor): + if not isinstance(arg, torch.Tensor): + raise RuntimeError( + f"Expected input at {get_keystr(key_path)} to be a tensor, but got {type(arg)}", + ) + + if len(node_val.shape) != len(arg.shape): + raise RuntimeError( + f"Unexpected number of dimensions in input at {get_keystr(key_path)}.shape " + f"(expected {node_val.shape}, got {arg.shape})" + ) + + for j, (arg_dim, node_dim) in enumerate(zip(arg.shape, node_val.shape)): + # TODO(avik): Assert the following property in the IR verifier: + # node_dim is either an int or a SymInt containing an int or a unary sympy.Expr + if ( + isinstance(node_dim, torch.SymInt) + and len(node_dim.node.expr.free_symbols) == 1 + ): + symbol = next(iter(node_dim.node.expr.free_symbols)) + if symbol in unification_map: + existing_dim = node_dim.node.expr.subs(unification_map) + if arg_dim != existing_dim: + raise RuntimeError( + f"Expected input at {get_keystr(key_path)}.shape[{j}] to be equal to " + f"{existing_dim}, but got {arg_dim}", + ) + else: + if ( + isinstance(arg_dim, torch.SymInt) + and not arg_dim.node.expr.is_number + ): + # This can happen when, say, arg is a fake tensor. + # We do not run checks on symbolic shapes of fake inputs as + # such checks can affect the shape env. + pass + else: + solution = try_solve( + sympy.Eq(node_dim.node.expr, arg_dim), symbol + ) + if solution is None: + raise RuntimeError( # noqa: TRY200 + f"Expected input {node.name}.shape[{j}] = {arg_dim} to be " + f"of the form {node_dim.node.expr}, where {symbol} is an integer" + ) + else: + unification_map[symbol] = int(solution[1]) + + if node_dim.node.expr in range_constraints: + min_val, max_val = _convert_range_to_int( + range_constraints[node_dim.node.expr] + ) + # NOTE: we allow dimensions to be 0/1 at runtime + if min_val > 2: + if arg_dim < min_val: + raise RuntimeError( + f"Expected input at {get_keystr(key_path)}.shape[{j}] to be >= " + f"{min_val}, but got {arg_dim}", + ) + if max_val < math.inf: + if arg_dim > max_val: + raise RuntimeError( + f"Expected input at {get_keystr(key_path)}.shape[{j}] to be <= " + f"{max_val}, but got {arg_dim}", + ) + else: + if arg_dim != node_dim: + raise RuntimeError( + f"Expected input at {get_keystr(key_path)}.shape[{j}] to be equal to " + f"{node_dim}, but got {arg_dim}", + ) + elif isinstance(node_val, (int, float, str)): + if type(arg) != type(node_val) or arg != node_val: + raise RuntimeError( + f"Expected input at {get_keystr(key_path)} to be equal to {node_val}, but got {arg}", + ) + + +def register_dataclass_as_pytree_node( + cls: Type[Any], + flatten_fn: Optional[FlattenFunc] = None, + unflatten_fn: Optional[UnflattenFunc] = None, + *, + serialized_type_name: Optional[str] = None, + to_dumpable_context: Optional[ToDumpableContextFn] = None, + from_dumpable_context: Optional[FromDumpableContextFn] = None, + return_none_fields: bool = False, +) -> None: + assert dataclasses.is_dataclass( + cls + ), f"Only dataclasses can be registered with this function: {cls}" + + def default_flatten_fn(obj: Any) -> Tuple[List[Any], Context]: + flattened = [] + flat_names = [] + none_names = [] + for f in dataclasses.fields(obj): + name, val = f.name, getattr(obj, f.name) + if val is not None or return_none_fields: + flattened.append(val) + flat_names.append(name) + else: + none_names.append(name) + return flattened, [flat_names, none_names] + + def default_unflatten_fn(values: Iterable[Any], context: Context) -> Any: + flat_names, none_names = context + return cls(**dict(zip(flat_names, values)), **dict.fromkeys(none_names)) + + flatten_fn = flatten_fn if flatten_fn is not None else default_flatten_fn + unflatten_fn = unflatten_fn if unflatten_fn is not None else default_unflatten_fn + + if (to_dumpable_context is None) ^ (from_dumpable_context is None): + raise ValueError( + f"Both to_dumpable_context and from_dumpable_context for {cls} must " + "be None or registered." + ) + + _register_pytree_node( + cls, + flatten_fn, + unflatten_fn, + serialized_type_name=serialized_type_name, + to_dumpable_context=to_dumpable_context, + from_dumpable_context=from_dumpable_context, + ) + + +def is_param(program: ExportedProgram, node: torch.fx.Node) -> bool: + """ + Checks if the given node is a parameter within the exported program + """ + + return node.name in program.graph_signature.inputs_to_parameters + + +def get_param( + program: ExportedProgram, + node: torch.fx.Node, +) -> Optional[torch.nn.Parameter]: + """ + Returns the parameter associated with the given node in the exported program. + Returns None if the node is not a parameter within the exported program + """ + + if is_param(program, node): + parameter_name = program.graph_signature.inputs_to_parameters[node.name] + return program.state_dict[parameter_name] + + return None + + +def is_buffer(program: ExportedProgram, node: torch.fx.Node) -> bool: + """ + Checks if the given node is a buffer within the exported program + """ + + return node.name in program.graph_signature.inputs_to_buffers + + +def get_buffer( + program: ExportedProgram, + node: torch.fx.Node, +) -> Optional[torch.Tensor]: + """ + Returns the buffer associated with the given node in the exported program. + Returns None if the node is not a buffer within the exported program + """ + + if is_buffer(program, node): + buffer_name = program.graph_signature.inputs_to_buffers[node.name] + if buffer_name in program.graph_signature.non_persistent_buffers: + return program.constants[buffer_name] + else: + return program.state_dict[buffer_name] + + return None + + +def is_lifted_tensor_constant( + program: ExportedProgram, + node: torch.fx.Node, +) -> bool: + """ + Checks if the given node is a lifted tensor constant within the exported program + """ + + return node.name in program.graph_signature.inputs_to_lifted_tensor_constants + + +def get_lifted_tensor_constant( + program: ExportedProgram, + node: torch.fx.Node, +) -> Optional[torch.Tensor]: + """ + Returns the lifted tensor constant associated with the given node in the exported program. + Returns None if the node is not a lifted tensor constant within the exported program + """ + + if is_lifted_tensor_constant(program, node): + lifted_tensor_name = program.graph_signature.inputs_to_lifted_tensor_constants[ + node.name + ] + return program.constants[lifted_tensor_name] + + return None + + +def sequential_split(gm: torch.fx.GraphModule, node_call_back) -> torch.fx.GraphModule: + """ + Splits the graph module into multiple submodules based on the node_call_back. + The node_call_back should return True if the node is a delimiter. Delimiter will be + the first node in the next submodule. + """ + from torch.fx.passes.split_module import split_module + + split_map = {} + split_id = 0 + for node in gm.graph.nodes: + if node_call_back(node): + split_id += 1 + split_map[node] = split_id + + new_gm = split_module( + gm, + gm, + lambda node: split_map[node], + keep_original_order=True, + keep_original_node_name=True, + ) + # Keep the codegen from original graph module to preserve e.g. pytree info. + new_gm.graph._codegen = gm.graph._codegen + new_gm.recompile() + return new_gm + + +def nodes_filter(nodes: List[torch.fx.Node], node_call_back) -> List[torch.fx.Node]: + """Returns the nodes that match the node_call_back as a list.""" + return [node for node in nodes if node_call_back(node)] + + +def nodes_first( + nodes: List[torch.fx.Node], node_call_back=None +) -> Optional[torch.fx.Node]: + """ + Returns the first node that matches the node_call_back. If no node matches, returns None. + When node_call_back is None, returns the first node in the node list. + """ + ret = nodes_filter(nodes, node_call_back if node_call_back else lambda node: True) + if len(ret) > 0: + return ret[0] + return None + + +def nodes_count(nodes: List[torch.fx.Node], node_call_back) -> int: + """Returns the number of nodes that match the node_call_back.""" + return len(nodes_filter(nodes, node_call_back)) + + +def nodes_map(nodes: List[torch.fx.Node], node_call_back) -> List[torch.fx.Node]: + """ + Sequentially visit the nodes list and invoke node_call_back on each element. + Returns the nodes list after the node_call_back is invoked on each element. + """ + for node in nodes: + node_call_back(node) + return nodes + + +def node_replace_( + old_node: torch.fx.Node, new_node: torch.fx.Node, delete_old: bool = False +) -> None: + """ + Replace all uses of old_node with new_node. + """ + old_node.replace_all_uses_with(new_node) + if delete_old: + old_node.users.clear() + old_node.graph.erase_node(old_node) + + +def node_inline_(call_mod_node: torch.fx.Node) -> None: + """ + Inline the submodule of the given node into the parent module. + Note: we only support the case where submodule takes tensors inputs. + """ + assert call_mod_node.op == "call_module" + gm = call_mod_node.graph.owning_module + + assert isinstance(call_mod_node.target, str) + sub_gm = getattr(gm, call_mod_node.target) + + phs = (node for node in sub_gm.graph.nodes if node.op == "placeholder") + body = ( + node for node in sub_gm.graph.nodes if node.op not in ("placeholder", "output") + ) + output = [node for node in sub_gm.graph.nodes if node.op == "output"] + + for ph, arg in zip(phs, call_mod_node.args): + assert isinstance(arg, torch.fx.Node) + node_replace_(ph, arg, delete_old=True) + + with gm.graph.inserting_before(call_mod_node): + for node in body: + new_node = gm.graph.node_copy(node) + node_replace_(node, new_node, delete_old=True) + + if len(output) > 0: + assert len(output) == 1 and len(output[0].args) == 1 + new_output = output[0].args[0] + + if isinstance(new_output, torch.fx.Node): + node_replace_(call_mod_node, new_output, delete_old=True) + elif isinstance(new_output, (list, tuple)): + # Inline the get_item calls for the output node. + get_item_users = nodes_filter( + list(call_mod_node.users.keys()), + lambda node: node.op == "call_function" + and node.target == operator.getitem, + ) + # get_item_node.args[1] is the idx referring to new_output[idx] + nodes_map( + get_item_users, + lambda get_item_node: node_replace_( + get_item_node, + new_output[get_item_node.args[1]], + delete_old=True, + ), + ) + call_mod_node.graph.erase_node(call_mod_node) + else: + raise NotImplementedError( + f"Unsupported output type {type(new_output)}. Expect it to be a Node or a list/tuple of Nodes." + ) + else: + call_mod_node.graph.erase_node(call_mod_node) + + gm.delete_all_unused_submodules() + gm.recompile() + return gm diff --git a/shared/package-files/08/085adcca077cb9d7b9c7a384b5f33f0f0d0a607a31a4f3f3ab8e8aa075718e37/blob b/shared/package-files/08/085adcca077cb9d7b9c7a384b5f33f0f0d0a607a31a4f3f3ab8e8aa075718e37/blob new file mode 100644 index 0000000000000000000000000000000000000000..653b146a60e5e5641a07bfc82f9590dad1ed69f5 Binary files /dev/null and b/shared/package-files/08/085adcca077cb9d7b9c7a384b5f33f0f0d0a607a31a4f3f3ab8e8aa075718e37/blob differ diff --git a/shared/package-files/08/085b2fe38a29f41c6927adb16d3be8763153f9822fe5980b0fe8db83c1b20a1c/blob b/shared/package-files/08/085b2fe38a29f41c6927adb16d3be8763153f9822fe5980b0fe8db83c1b20a1c/blob new file mode 100644 index 0000000000000000000000000000000000000000..728675ed7841835aba35771b4b1ba5e827d2c5d5 --- /dev/null +++ b/shared/package-files/08/085b2fe38a29f41c6927adb16d3be8763153f9822fe5980b0fe8db83c1b20a1c/blob @@ -0,0 +1,38 @@ +#pragma once + +#include + +#include +#include +#include + +namespace torch::jit { + +struct TORCH_API JITException : public std::runtime_error { + explicit JITException( + const std::string& msg, + c10::optional python_class_name = c10::nullopt, + c10::optional original_msg = c10::nullopt); + + c10::optional getPythonClassName() const { + return python_class_name_; + } + + // the original msg if this is from a python exception. The interpretor has + // changed the original message by adding "The following operation failed in + // the TorchScript interpreter." in front of it in the handleError function. + c10::optional getOriginalMsg() const { + return original_msg_; + } + + static const std::string& getCaughtOriginalMsg(); + static const std::string& getCaughtPythonClassName(); + static void setCaughtOriginalMsg(const std::string& msg); + static void setCaughtPythonClassName(const std::string& pythonClassName); + + private: + c10::optional python_class_name_; + c10::optional original_msg_; +}; + +} // namespace torch::jit diff --git a/shared/package-files/08/085bbee935f102d83dec053bfb5ebc6b6982e5d5fbe91e8fd8605124d1c71e39/blob b/shared/package-files/08/085bbee935f102d83dec053bfb5ebc6b6982e5d5fbe91e8fd8605124d1c71e39/blob new file mode 100644 index 0000000000000000000000000000000000000000..f60e0b8776ff5d4fe7ac355b7b9319a5b2d8c2a5 --- /dev/null +++ b/shared/package-files/08/085bbee935f102d83dec053bfb5ebc6b6982e5d5fbe91e8fd8605124d1c71e39/blob @@ -0,0 +1,43 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::empty_like(Tensor self, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor +inline at::Tensor empty_like(const at::Tensor & self, at::TensorOptions options={}, c10::optional memory_format=c10::nullopt) { + return at::_ops::empty_like::call(self, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format)); +} +// aten::empty_like(Tensor self, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor +inline at::Tensor empty_like(const at::Tensor & self, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory, c10::optional memory_format) { + return at::_ops::empty_like::call(self, dtype, layout, device, pin_memory, memory_format); +} + +// aten::empty_like.out(Tensor self, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & empty_like_out(at::Tensor & out, const at::Tensor & self, c10::optional memory_format=c10::nullopt) { + return at::_ops::empty_like_out::call(self, memory_format, out); +} +// aten::empty_like.out(Tensor self, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & empty_like_outf(const at::Tensor & self, c10::optional memory_format, at::Tensor & out) { + return at::_ops::empty_like_out::call(self, memory_format, out); +} + +} diff --git a/shared/package-files/08/085de63724bef7a53ede2061593f9693dd992eb92f5b1b51bcb6d7cd77f8b613/blob b/shared/package-files/08/085de63724bef7a53ede2061593f9693dd992eb92f5b1b51bcb6d7cd77f8b613/blob new file mode 100644 index 0000000000000000000000000000000000000000..b4a03898d01de3f3e4ce7823fe7abae8d041e4f5 Binary files /dev/null and b/shared/package-files/08/085de63724bef7a53ede2061593f9693dd992eb92f5b1b51bcb6d7cd77f8b613/blob differ diff --git a/shared/package-files/08/08630ec45901fcdf4d9a6e97dacf70c57a4c4be5c6e81c738d226588b7c71fdf/blob b/shared/package-files/08/08630ec45901fcdf4d9a6e97dacf70c57a4c4be5c6e81c738d226588b7c71fdf/blob new file mode 100644 index 0000000000000000000000000000000000000000..e7fef5f69daa303ae6f5dc8d4729159d9d034b56 --- /dev/null +++ b/shared/package-files/08/08630ec45901fcdf4d9a6e97dacf70c57a4c4be5c6e81c738d226588b7c71fdf/blob @@ -0,0 +1,1713 @@ +#! /usr/bin/env python3 + +import sys +if __name__ == "__main__": + sys.modules['idlelib.pyshell'] = sys.modules['__main__'] + +try: + from tkinter import * +except ImportError: + print("** IDLE can't import Tkinter.\n" + "Your Python may not be configured for Tk. **", file=sys.__stderr__) + raise SystemExit(1) + +# Valid arguments for the ...Awareness call below are defined in the following. +# https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx +if sys.platform == 'win32': + try: + import ctypes + PROCESS_SYSTEM_DPI_AWARE = 1 # Int required. + ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE) + except (ImportError, AttributeError, OSError): + pass + +from tkinter import messagebox +if TkVersion < 8.5: + root = Tk() # otherwise create root in main + root.withdraw() + from idlelib.run import fix_scaling + fix_scaling(root) + messagebox.showerror("Idle Cannot Start", + "Idle requires tcl/tk 8.5+, not %s." % TkVersion, + parent=root) + raise SystemExit(1) + +from code import InteractiveInterpreter +import itertools +import linecache +import os +import os.path +from platform import python_version +import re +import socket +import subprocess +from textwrap import TextWrapper +import threading +import time +import tokenize +import warnings + +from idlelib.colorizer import ColorDelegator +from idlelib.config import idleConf +from idlelib.delegator import Delegator +from idlelib import debugger +from idlelib import debugger_r +from idlelib.editor import EditorWindow, fixwordbreaks +from idlelib.filelist import FileList +from idlelib.outwin import OutputWindow +from idlelib import replace +from idlelib import rpc +from idlelib.run import idle_formatwarning, StdInputFile, StdOutputFile +from idlelib.undo import UndoDelegator + +# Default for testing; defaults to True in main() for running. +use_subprocess = False + +HOST = '127.0.0.1' # python execution server on localhost loopback +PORT = 0 # someday pass in host, port for remote debug capability + +try: # In case IDLE started with -n. + eof = 'Ctrl-D (end-of-file)' + exit.eof = eof + quit.eof = eof +except NameError: # In case python started with -S. + pass + +# Override warnings module to write to warning_stream. Initialize to send IDLE +# internal warnings to the console. ScriptBinding.check_syntax() will +# temporarily redirect the stream to the shell window to display warnings when +# checking user's code. +warning_stream = sys.__stderr__ # None, at least on Windows, if no console. + +def idle_showwarning( + message, category, filename, lineno, file=None, line=None): + """Show Idle-format warning (after replacing warnings.showwarning). + + The differences are the formatter called, the file=None replacement, + which can be None, the capture of the consequence AttributeError, + and the output of a hard-coded prompt. + """ + if file is None: + file = warning_stream + try: + file.write(idle_formatwarning( + message, category, filename, lineno, line=line)) + file.write(">>> ") + except (AttributeError, OSError): + pass # if file (probably __stderr__) is invalid, skip warning. + +_warnings_showwarning = None + +def capture_warnings(capture): + "Replace warning.showwarning with idle_showwarning, or reverse." + + global _warnings_showwarning + if capture: + if _warnings_showwarning is None: + _warnings_showwarning = warnings.showwarning + warnings.showwarning = idle_showwarning + else: + if _warnings_showwarning is not None: + warnings.showwarning = _warnings_showwarning + _warnings_showwarning = None + +capture_warnings(True) + +def extended_linecache_checkcache(filename=None, + orig_checkcache=linecache.checkcache): + """Extend linecache.checkcache to preserve the entries + + Rather than repeating the linecache code, patch it to save the + entries, call the original linecache.checkcache() + (skipping them), and then restore the saved entries. + + orig_checkcache is bound at definition time to the original + method, allowing it to be patched. + """ + cache = linecache.cache + save = {} + for key in list(cache): + if key[:1] + key[-1:] == '<>': + save[key] = cache.pop(key) + orig_checkcache(filename) + cache.update(save) + +# Patch linecache.checkcache(): +linecache.checkcache = extended_linecache_checkcache + + +class PyShellEditorWindow(EditorWindow): + "Regular text edit window in IDLE, supports breakpoints" + + def __init__(self, *args): + self.breakpoints = [] + EditorWindow.__init__(self, *args) + self.text.bind("<>", self.set_breakpoint_here) + self.text.bind("<>", self.clear_breakpoint_here) + self.text.bind("<>", self.flist.open_shell) + + #TODO: don't read/write this from/to .idlerc when testing + self.breakpointPath = os.path.join( + idleConf.userdir, 'breakpoints.lst') + # whenever a file is changed, restore breakpoints + def filename_changed_hook(old_hook=self.io.filename_change_hook, + self=self): + self.restore_file_breaks() + old_hook() + self.io.set_filename_change_hook(filename_changed_hook) + if self.io.filename: + self.restore_file_breaks() + self.color_breakpoint_text() + + rmenu_specs = [ + ("Cut", "<>", "rmenu_check_cut"), + ("Copy", "<>", "rmenu_check_copy"), + ("Paste", "<>", "rmenu_check_paste"), + (None, None, None), + ("Set Breakpoint", "<>", None), + ("Clear Breakpoint", "<>", None) + ] + + def color_breakpoint_text(self, color=True): + "Turn colorizing of breakpoint text on or off" + if self.io is None: + # possible due to update in restore_file_breaks + return + if color: + theme = idleConf.CurrentTheme() + cfg = idleConf.GetHighlight(theme, "break") + else: + cfg = {'foreground': '', 'background': ''} + self.text.tag_config('BREAK', cfg) + + def set_breakpoint(self, lineno): + text = self.text + filename = self.io.filename + text.tag_add("BREAK", "%d.0" % lineno, "%d.0" % (lineno+1)) + try: + self.breakpoints.index(lineno) + except ValueError: # only add if missing, i.e. do once + self.breakpoints.append(lineno) + try: # update the subprocess debugger + debug = self.flist.pyshell.interp.debugger + debug.set_breakpoint_here(filename, lineno) + except: # but debugger may not be active right now.... + pass + + def set_breakpoint_here(self, event=None): + text = self.text + filename = self.io.filename + if not filename: + text.bell() + return + lineno = int(float(text.index("insert"))) + self.set_breakpoint(lineno) + + def clear_breakpoint_here(self, event=None): + text = self.text + filename = self.io.filename + if not filename: + text.bell() + return + lineno = int(float(text.index("insert"))) + try: + self.breakpoints.remove(lineno) + except: + pass + text.tag_remove("BREAK", "insert linestart",\ + "insert lineend +1char") + try: + debug = self.flist.pyshell.interp.debugger + debug.clear_breakpoint_here(filename, lineno) + except: + pass + + def clear_file_breaks(self): + if self.breakpoints: + text = self.text + filename = self.io.filename + if not filename: + text.bell() + return + self.breakpoints = [] + text.tag_remove("BREAK", "1.0", END) + try: + debug = self.flist.pyshell.interp.debugger + debug.clear_file_breaks(filename) + except: + pass + + def store_file_breaks(self): + "Save breakpoints when file is saved" + # XXX 13 Dec 2002 KBK Currently the file must be saved before it can + # be run. The breaks are saved at that time. If we introduce + # a temporary file save feature the save breaks functionality + # needs to be re-verified, since the breaks at the time the + # temp file is created may differ from the breaks at the last + # permanent save of the file. Currently, a break introduced + # after a save will be effective, but not persistent. + # This is necessary to keep the saved breaks synched with the + # saved file. + # + # Breakpoints are set as tagged ranges in the text. + # Since a modified file has to be saved before it is + # run, and since self.breakpoints (from which the subprocess + # debugger is loaded) is updated during the save, the visible + # breaks stay synched with the subprocess even if one of these + # unexpected breakpoint deletions occurs. + breaks = self.breakpoints + filename = self.io.filename + try: + with open(self.breakpointPath, "r") as fp: + lines = fp.readlines() + except OSError: + lines = [] + try: + with open(self.breakpointPath, "w") as new_file: + for line in lines: + if not line.startswith(filename + '='): + new_file.write(line) + self.update_breakpoints() + breaks = self.breakpoints + if breaks: + new_file.write(filename + '=' + str(breaks) + '\n') + except OSError as err: + if not getattr(self.root, "breakpoint_error_displayed", False): + self.root.breakpoint_error_displayed = True + messagebox.showerror(title='IDLE Error', + message='Unable to update breakpoint list:\n%s' + % str(err), + parent=self.text) + + def restore_file_breaks(self): + self.text.update() # this enables setting "BREAK" tags to be visible + if self.io is None: + # can happen if IDLE closes due to the .update() call + return + filename = self.io.filename + if filename is None: + return + if os.path.isfile(self.breakpointPath): + with open(self.breakpointPath, "r") as fp: + lines = fp.readlines() + for line in lines: + if line.startswith(filename + '='): + breakpoint_linenumbers = eval(line[len(filename)+1:]) + for breakpoint_linenumber in breakpoint_linenumbers: + self.set_breakpoint(breakpoint_linenumber) + + def update_breakpoints(self): + "Retrieves all the breakpoints in the current window" + text = self.text + ranges = text.tag_ranges("BREAK") + linenumber_list = self.ranges_to_linenumbers(ranges) + self.breakpoints = linenumber_list + + def ranges_to_linenumbers(self, ranges): + lines = [] + for index in range(0, len(ranges), 2): + lineno = int(float(ranges[index].string)) + end = int(float(ranges[index+1].string)) + while lineno < end: + lines.append(lineno) + lineno += 1 + return lines + +# XXX 13 Dec 2002 KBK Not used currently +# def saved_change_hook(self): +# "Extend base method - clear breaks if module is modified" +# if not self.get_saved(): +# self.clear_file_breaks() +# EditorWindow.saved_change_hook(self) + + def _close(self): + "Extend base method - clear breaks when module is closed" + self.clear_file_breaks() + EditorWindow._close(self) + + +class PyShellFileList(FileList): + "Extend base class: IDLE supports a shell and breakpoints" + + # override FileList's class variable, instances return PyShellEditorWindow + # instead of EditorWindow when new edit windows are created. + EditorWindow = PyShellEditorWindow + + pyshell = None + + def open_shell(self, event=None): + if self.pyshell: + self.pyshell.top.wakeup() + else: + self.pyshell = PyShell(self) + if self.pyshell: + if not self.pyshell.begin(): + return None + return self.pyshell + + +class ModifiedColorDelegator(ColorDelegator): + "Extend base class: colorizer for the shell window itself" + def recolorize_main(self): + self.tag_remove("TODO", "1.0", "iomark") + self.tag_add("SYNC", "1.0", "iomark") + ColorDelegator.recolorize_main(self) + + def removecolors(self): + # Don't remove shell color tags before "iomark" + for tag in self.tagdefs: + self.tag_remove(tag, "iomark", "end") + + +class ModifiedUndoDelegator(UndoDelegator): + "Extend base class: forbid insert/delete before the I/O mark" + def insert(self, index, chars, tags=None): + try: + if self.delegate.compare(index, "<", "iomark"): + self.delegate.bell() + return + except TclError: + pass + UndoDelegator.insert(self, index, chars, tags) + + def delete(self, index1, index2=None): + try: + if self.delegate.compare(index1, "<", "iomark"): + self.delegate.bell() + return + except TclError: + pass + UndoDelegator.delete(self, index1, index2) + + def undo_event(self, event): + # Temporarily monkey-patch the delegate's .insert() method to + # always use the "stdin" tag. This is needed for undo-ing + # deletions to preserve the "stdin" tag, because UndoDelegator + # doesn't preserve tags for deleted text. + orig_insert = self.delegate.insert + self.delegate.insert = \ + lambda index, chars: orig_insert(index, chars, "stdin") + try: + super().undo_event(event) + finally: + self.delegate.insert = orig_insert + + +class UserInputTaggingDelegator(Delegator): + """Delegator used to tag user input with "stdin".""" + def insert(self, index, chars, tags=None): + if tags is None: + tags = "stdin" + self.delegate.insert(index, chars, tags) + + +class MyRPCClient(rpc.RPCClient): + + def handle_EOF(self): + "Override the base class - just re-raise EOFError" + raise EOFError + +def restart_line(width, filename): # See bpo-38141. + """Return width long restart line formatted with filename. + + Fill line with balanced '='s, with any extras and at least one at + the beginning. Do not end with a trailing space. + """ + tag = f"= RESTART: {filename or 'Shell'} =" + if width >= len(tag): + div, mod = divmod((width -len(tag)), 2) + return f"{(div+mod)*'='}{tag}{div*'='}" + else: + return tag[:-2] # Remove ' ='. + + +class ModifiedInterpreter(InteractiveInterpreter): + + def __init__(self, tkconsole): + self.tkconsole = tkconsole + locals = sys.modules['__main__'].__dict__ + InteractiveInterpreter.__init__(self, locals=locals) + self.restarting = False + self.subprocess_arglist = None + self.port = PORT + self.original_compiler_flags = self.compile.compiler.flags + + _afterid = None + rpcclt = None + rpcsubproc = None + + def spawn_subprocess(self): + if self.subprocess_arglist is None: + self.subprocess_arglist = self.build_subprocess_arglist() + self.rpcsubproc = subprocess.Popen(self.subprocess_arglist) + + def build_subprocess_arglist(self): + assert (self.port!=0), ( + "Socket should have been assigned a port number.") + w = ['-W' + s for s in sys.warnoptions] + # Maybe IDLE is installed and is being accessed via sys.path, + # or maybe it's not installed and the idle.py script is being + # run from the IDLE source directory. + del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc', + default=False, type='bool') + command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,) + return [sys.executable] + w + ["-c", command, str(self.port)] + + def start_subprocess(self): + addr = (HOST, self.port) + # GUI makes several attempts to acquire socket, listens for connection + for i in range(3): + time.sleep(i) + try: + self.rpcclt = MyRPCClient(addr) + break + except OSError: + pass + else: + self.display_port_binding_error() + return None + # if PORT was 0, system will assign an 'ephemeral' port. Find it out: + self.port = self.rpcclt.listening_sock.getsockname()[1] + # if PORT was not 0, probably working with a remote execution server + if PORT != 0: + # To allow reconnection within the 2MSL wait (cf. Stevens TCP + # V1, 18.6), set SO_REUSEADDR. Note that this can be problematic + # on Windows since the implementation allows two active sockets on + # the same address! + self.rpcclt.listening_sock.setsockopt(socket.SOL_SOCKET, + socket.SO_REUSEADDR, 1) + self.spawn_subprocess() + #time.sleep(20) # test to simulate GUI not accepting connection + # Accept the connection from the Python execution server + self.rpcclt.listening_sock.settimeout(10) + try: + self.rpcclt.accept() + except TimeoutError: + self.display_no_subprocess_error() + return None + self.rpcclt.register("console", self.tkconsole) + self.rpcclt.register("stdin", self.tkconsole.stdin) + self.rpcclt.register("stdout", self.tkconsole.stdout) + self.rpcclt.register("stderr", self.tkconsole.stderr) + self.rpcclt.register("flist", self.tkconsole.flist) + self.rpcclt.register("linecache", linecache) + self.rpcclt.register("interp", self) + self.transfer_path(with_cwd=True) + self.poll_subprocess() + return self.rpcclt + + def restart_subprocess(self, with_cwd=False, filename=''): + if self.restarting: + return self.rpcclt + self.restarting = True + # close only the subprocess debugger + debug = self.getdebugger() + if debug: + try: + # Only close subprocess debugger, don't unregister gui_adap! + debugger_r.close_subprocess_debugger(self.rpcclt) + except: + pass + # Kill subprocess, spawn a new one, accept connection. + self.rpcclt.close() + self.terminate_subprocess() + console = self.tkconsole + was_executing = console.executing + console.executing = False + self.spawn_subprocess() + try: + self.rpcclt.accept() + except TimeoutError: + self.display_no_subprocess_error() + return None + self.transfer_path(with_cwd=with_cwd) + console.stop_readline() + # annotate restart in shell window and mark it + console.text.delete("iomark", "end-1c") + console.write('\n') + console.write(restart_line(console.width, filename)) + console.text.mark_set("restart", "end-1c") + console.text.mark_gravity("restart", "left") + if not filename: + console.showprompt() + # restart subprocess debugger + if debug: + # Restarted debugger connects to current instance of debug GUI + debugger_r.restart_subprocess_debugger(self.rpcclt) + # reload remote debugger breakpoints for all PyShellEditWindows + debug.load_breakpoints() + self.compile.compiler.flags = self.original_compiler_flags + self.restarting = False + return self.rpcclt + + def __request_interrupt(self): + self.rpcclt.remotecall("exec", "interrupt_the_server", (), {}) + + def interrupt_subprocess(self): + threading.Thread(target=self.__request_interrupt).start() + + def kill_subprocess(self): + if self._afterid is not None: + self.tkconsole.text.after_cancel(self._afterid) + try: + self.rpcclt.listening_sock.close() + except AttributeError: # no socket + pass + try: + self.rpcclt.close() + except AttributeError: # no socket + pass + self.terminate_subprocess() + self.tkconsole.executing = False + self.rpcclt = None + + def terminate_subprocess(self): + "Make sure subprocess is terminated" + try: + self.rpcsubproc.kill() + except OSError: + # process already terminated + return + else: + try: + self.rpcsubproc.wait() + except OSError: + return + + def transfer_path(self, with_cwd=False): + if with_cwd: # Issue 13506 + path = [''] # include Current Working Directory + path.extend(sys.path) + else: + path = sys.path + + self.runcommand("""if 1: + import sys as _sys + _sys.path = %r + del _sys + \n""" % (path,)) + + active_seq = None + + def poll_subprocess(self): + clt = self.rpcclt + if clt is None: + return + try: + response = clt.pollresponse(self.active_seq, wait=0.05) + except (EOFError, OSError, KeyboardInterrupt): + # lost connection or subprocess terminated itself, restart + # [the KBI is from rpc.SocketIO.handle_EOF()] + if self.tkconsole.closing: + return + response = None + self.restart_subprocess() + if response: + self.tkconsole.resetoutput() + self.active_seq = None + how, what = response + console = self.tkconsole.console + if how == "OK": + if what is not None: + print(repr(what), file=console) + elif how == "EXCEPTION": + if self.tkconsole.getvar("<>"): + self.remote_stack_viewer() + elif how == "ERROR": + errmsg = "pyshell.ModifiedInterpreter: Subprocess ERROR:\n" + print(errmsg, what, file=sys.__stderr__) + print(errmsg, what, file=console) + # we received a response to the currently active seq number: + try: + self.tkconsole.endexecuting() + except AttributeError: # shell may have closed + pass + # Reschedule myself + if not self.tkconsole.closing: + self._afterid = self.tkconsole.text.after( + self.tkconsole.pollinterval, self.poll_subprocess) + + debugger = None + + def setdebugger(self, debugger): + self.debugger = debugger + + def getdebugger(self): + return self.debugger + + def open_remote_stack_viewer(self): + """Initiate the remote stack viewer from a separate thread. + + This method is called from the subprocess, and by returning from this + method we allow the subprocess to unblock. After a bit the shell + requests the subprocess to open the remote stack viewer which returns a + static object looking at the last exception. It is queried through + the RPC mechanism. + + """ + self.tkconsole.text.after(300, self.remote_stack_viewer) + return + + def remote_stack_viewer(self): + from idlelib import debugobj_r + oid = self.rpcclt.remotequeue("exec", "stackviewer", ("flist",), {}) + if oid is None: + self.tkconsole.root.bell() + return + item = debugobj_r.StubObjectTreeItem(self.rpcclt, oid) + from idlelib.tree import ScrolledCanvas, TreeNode + top = Toplevel(self.tkconsole.root) + theme = idleConf.CurrentTheme() + background = idleConf.GetHighlight(theme, 'normal')['background'] + sc = ScrolledCanvas(top, bg=background, highlightthickness=0) + sc.frame.pack(expand=1, fill="both") + node = TreeNode(sc.canvas, None, item) + node.expand() + # XXX Should GC the remote tree when closing the window + + gid = 0 + + def execsource(self, source): + "Like runsource() but assumes complete exec source" + filename = self.stuffsource(source) + self.execfile(filename, source) + + def execfile(self, filename, source=None): + "Execute an existing file" + if source is None: + with tokenize.open(filename) as fp: + source = fp.read() + if use_subprocess: + source = (f"__file__ = r'''{os.path.abspath(filename)}'''\n" + + source + "\ndel __file__") + try: + code = compile(source, filename, "exec") + except (OverflowError, SyntaxError): + self.tkconsole.resetoutput() + print('*** Error in script or command!\n' + 'Traceback (most recent call last):', + file=self.tkconsole.stderr) + InteractiveInterpreter.showsyntaxerror(self, filename) + self.tkconsole.showprompt() + else: + self.runcode(code) + + def runsource(self, source): + "Extend base class method: Stuff the source in the line cache first" + filename = self.stuffsource(source) + # at the moment, InteractiveInterpreter expects str + assert isinstance(source, str) + # InteractiveInterpreter.runsource() calls its runcode() method, + # which is overridden (see below) + return InteractiveInterpreter.runsource(self, source, filename) + + def stuffsource(self, source): + "Stuff source in the filename cache" + filename = "" % self.gid + self.gid = self.gid + 1 + lines = source.split("\n") + linecache.cache[filename] = len(source)+1, 0, lines, filename + return filename + + def prepend_syspath(self, filename): + "Prepend sys.path with file's directory if not already included" + self.runcommand("""if 1: + _filename = %r + import sys as _sys + from os.path import dirname as _dirname + _dir = _dirname(_filename) + if not _dir in _sys.path: + _sys.path.insert(0, _dir) + del _filename, _sys, _dirname, _dir + \n""" % (filename,)) + + def showsyntaxerror(self, filename=None): + """Override Interactive Interpreter method: Use Colorizing + + Color the offending position instead of printing it and pointing at it + with a caret. + + """ + tkconsole = self.tkconsole + text = tkconsole.text + text.tag_remove("ERROR", "1.0", "end") + type, value, tb = sys.exc_info() + msg = getattr(value, 'msg', '') or value or "" + lineno = getattr(value, 'lineno', '') or 1 + offset = getattr(value, 'offset', '') or 0 + if offset == 0: + lineno += 1 #mark end of offending line + if lineno == 1: + pos = "iomark + %d chars" % (offset-1) + else: + pos = "iomark linestart + %d lines + %d chars" % \ + (lineno-1, offset-1) + tkconsole.colorize_syntax_error(text, pos) + tkconsole.resetoutput() + self.write("SyntaxError: %s\n" % msg) + tkconsole.showprompt() + + def showtraceback(self): + "Extend base class method to reset output properly" + self.tkconsole.resetoutput() + self.checklinecache() + InteractiveInterpreter.showtraceback(self) + if self.tkconsole.getvar("<>"): + self.tkconsole.open_stack_viewer() + + def checklinecache(self): + c = linecache.cache + for key in list(c.keys()): + if key[:1] + key[-1:] != "<>": + del c[key] + + def runcommand(self, code): + "Run the code without invoking the debugger" + # The code better not raise an exception! + if self.tkconsole.executing: + self.display_executing_dialog() + return 0 + if self.rpcclt: + self.rpcclt.remotequeue("exec", "runcode", (code,), {}) + else: + exec(code, self.locals) + return 1 + + def runcode(self, code): + "Override base class method" + if self.tkconsole.executing: + self.restart_subprocess() + self.checklinecache() + debugger = self.debugger + try: + self.tkconsole.beginexecuting() + if not debugger and self.rpcclt is not None: + self.active_seq = self.rpcclt.asyncqueue("exec", "runcode", + (code,), {}) + elif debugger: + debugger.run(code, self.locals) + else: + exec(code, self.locals) + except SystemExit: + if not self.tkconsole.closing: + if messagebox.askyesno( + "Exit?", + "Do you want to exit altogether?", + default="yes", + parent=self.tkconsole.text): + raise + else: + self.showtraceback() + else: + raise + except: + if use_subprocess: + print("IDLE internal error in runcode()", + file=self.tkconsole.stderr) + self.showtraceback() + self.tkconsole.endexecuting() + else: + if self.tkconsole.canceled: + self.tkconsole.canceled = False + print("KeyboardInterrupt", file=self.tkconsole.stderr) + else: + self.showtraceback() + finally: + if not use_subprocess: + try: + self.tkconsole.endexecuting() + except AttributeError: # shell may have closed + pass + + def write(self, s): + "Override base class method" + return self.tkconsole.stderr.write(s) + + def display_port_binding_error(self): + messagebox.showerror( + "Port Binding Error", + "IDLE can't bind to a TCP/IP port, which is necessary to " + "communicate with its Python execution server. This might be " + "because no networking is installed on this computer. " + "Run IDLE with the -n command line switch to start without a " + "subprocess and refer to Help/IDLE Help 'Running without a " + "subprocess' for further details.", + parent=self.tkconsole.text) + + def display_no_subprocess_error(self): + messagebox.showerror( + "Subprocess Connection Error", + "IDLE's subprocess didn't make connection.\n" + "See the 'Startup failure' section of the IDLE doc, online at\n" + "https://docs.python.org/3/library/idle.html#startup-failure", + parent=self.tkconsole.text) + + def display_executing_dialog(self): + messagebox.showerror( + "Already executing", + "The Python Shell window is already executing a command; " + "please wait until it is finished.", + parent=self.tkconsole.text) + + +class PyShell(OutputWindow): + from idlelib.squeezer import Squeezer + + shell_title = "IDLE Shell " + python_version() + + # Override classes + ColorDelegator = ModifiedColorDelegator + UndoDelegator = ModifiedUndoDelegator + + # Override menus + menu_specs = [ + ("file", "_File"), + ("edit", "_Edit"), + ("debug", "_Debug"), + ("options", "_Options"), + ("window", "_Window"), + ("help", "_Help"), + ] + + # Extend right-click context menu + rmenu_specs = OutputWindow.rmenu_specs + [ + ("Squeeze", "<>"), + ] + _idx = 1 + len(list(itertools.takewhile( + lambda rmenu_item: rmenu_item[0] != "Copy", rmenu_specs) + )) + rmenu_specs.insert(_idx, ("Copy with prompts", + "<>", + "rmenu_check_copy")) + del _idx + + allow_line_numbers = False + user_input_insert_tags = "stdin" + + # New classes + from idlelib.history import History + from idlelib.sidebar import ShellSidebar + + def __init__(self, flist=None): + if use_subprocess: + ms = self.menu_specs + if ms[2][0] != "shell": + ms.insert(2, ("shell", "She_ll")) + self.interp = ModifiedInterpreter(self) + if flist is None: + root = Tk() + fixwordbreaks(root) + root.withdraw() + flist = PyShellFileList(root) + + self.shell_sidebar = None # initialized below + + OutputWindow.__init__(self, flist, None, None) + + self.usetabs = False + # indentwidth must be 8 when using tabs. See note in EditorWindow: + self.indentwidth = 4 + + self.sys_ps1 = sys.ps1 if hasattr(sys, 'ps1') else '>>>\n' + self.prompt_last_line = self.sys_ps1.split('\n')[-1] + self.prompt = self.sys_ps1 # Changes when debug active + + text = self.text + text.configure(wrap="char") + text.bind("<>", self.enter_callback) + text.bind("<>", self.linefeed_callback) + text.bind("<>", self.cancel_callback) + text.bind("<>", self.eof_callback) + text.bind("<>", self.open_stack_viewer) + text.bind("<>", self.toggle_debugger) + text.bind("<>", self.toggle_jit_stack_viewer) + text.bind("<>", self.copy_with_prompts_callback) + if use_subprocess: + text.bind("<>", self.view_restart_mark) + text.bind("<>", self.restart_shell) + self.squeezer = self.Squeezer(self) + text.bind("<>", + self.squeeze_current_text_event) + + self.save_stdout = sys.stdout + self.save_stderr = sys.stderr + self.save_stdin = sys.stdin + from idlelib import iomenu + self.stdin = StdInputFile(self, "stdin", + iomenu.encoding, iomenu.errors) + self.stdout = StdOutputFile(self, "stdout", + iomenu.encoding, iomenu.errors) + self.stderr = StdOutputFile(self, "stderr", + iomenu.encoding, "backslashreplace") + self.console = StdOutputFile(self, "console", + iomenu.encoding, iomenu.errors) + if not use_subprocess: + sys.stdout = self.stdout + sys.stderr = self.stderr + sys.stdin = self.stdin + try: + # page help() text to shell. + import pydoc # import must be done here to capture i/o rebinding. + # XXX KBK 27Dec07 use text viewer someday, but must work w/o subproc + pydoc.pager = pydoc.plainpager + except: + sys.stderr = sys.__stderr__ + raise + # + self.history = self.History(self.text) + # + self.pollinterval = 50 # millisec + + self.shell_sidebar = self.ShellSidebar(self) + + # Insert UserInputTaggingDelegator at the top of the percolator, + # but make calls to text.insert() skip it. This causes only insert + # events generated in Tcl/Tk to go through this delegator. + self.text.insert = self.per.top.insert + self.per.insertfilter(UserInputTaggingDelegator()) + + def ResetFont(self): + super().ResetFont() + + if self.shell_sidebar is not None: + self.shell_sidebar.update_font() + + def ResetColorizer(self): + super().ResetColorizer() + + theme = idleConf.CurrentTheme() + tag_colors = { + "stdin": {'background': None, 'foreground': None}, + "stdout": idleConf.GetHighlight(theme, "stdout"), + "stderr": idleConf.GetHighlight(theme, "stderr"), + "console": idleConf.GetHighlight(theme, "normal"), + } + for tag, tag_colors_config in tag_colors.items(): + self.text.tag_configure(tag, **tag_colors_config) + + if self.shell_sidebar is not None: + self.shell_sidebar.update_colors() + + def replace_event(self, event): + replace.replace(self.text, insert_tags="stdin") + return "break" + + def get_standard_extension_names(self): + return idleConf.GetExtensions(shell_only=True) + + def get_prompt_text(self, first, last): + """Return text between first and last with prompts added.""" + text = self.text.get(first, last) + lineno_range = range( + int(float(first)), + int(float(last)) + ) + prompts = [ + self.shell_sidebar.line_prompts.get(lineno) + for lineno in lineno_range + ] + return "\n".join( + line if prompt is None else f"{prompt} {line}" + for prompt, line in zip(prompts, text.splitlines()) + ) + "\n" + + + def copy_with_prompts_callback(self, event=None): + """Copy selected lines to the clipboard, with prompts. + + This makes the copied text useful for doc-tests and interactive + shell code examples. + + This always copies entire lines, even if only part of the first + and/or last lines is selected. + """ + text = self.text + selfirst = text.index('sel.first linestart') + if selfirst is None: # Should not be possible. + return # No selection, do nothing. + sellast = text.index('sel.last') + if sellast[-1] != '0': + sellast = text.index("sel.last+1line linestart") + text.clipboard_clear() + prompt_text = self.get_prompt_text(selfirst, sellast) + text.clipboard_append(prompt_text) + + reading = False + executing = False + canceled = False + endoffile = False + closing = False + _stop_readline_flag = False + + def set_warning_stream(self, stream): + global warning_stream + warning_stream = stream + + def get_warning_stream(self): + return warning_stream + + def toggle_debugger(self, event=None): + if self.executing: + messagebox.showerror("Don't debug now", + "You can only toggle the debugger when idle", + parent=self.text) + self.set_debugger_indicator() + return "break" + else: + db = self.interp.getdebugger() + if db: + self.close_debugger() + else: + self.open_debugger() + + def set_debugger_indicator(self): + db = self.interp.getdebugger() + self.setvar("<>", not not db) + + def toggle_jit_stack_viewer(self, event=None): + pass # All we need is the variable + + def close_debugger(self): + db = self.interp.getdebugger() + if db: + self.interp.setdebugger(None) + db.close() + if self.interp.rpcclt: + debugger_r.close_remote_debugger(self.interp.rpcclt) + self.resetoutput() + self.console.write("[DEBUG OFF]\n") + self.prompt = self.sys_ps1 + self.showprompt() + self.set_debugger_indicator() + + def open_debugger(self): + if self.interp.rpcclt: + dbg_gui = debugger_r.start_remote_debugger(self.interp.rpcclt, + self) + else: + dbg_gui = debugger.Debugger(self) + self.interp.setdebugger(dbg_gui) + dbg_gui.load_breakpoints() + self.prompt = "[DEBUG ON]\n" + self.sys_ps1 + self.showprompt() + self.set_debugger_indicator() + + def debug_menu_postcommand(self): + state = 'disabled' if self.executing else 'normal' + self.update_menu_state('debug', '*tack*iewer', state) + + def beginexecuting(self): + "Helper for ModifiedInterpreter" + self.resetoutput() + self.executing = True + + def endexecuting(self): + "Helper for ModifiedInterpreter" + self.executing = False + self.canceled = False + self.showprompt() + + def close(self): + "Extend EditorWindow.close()" + if self.executing: + response = messagebox.askokcancel( + "Kill?", + "Your program is still running!\n Do you want to kill it?", + default="ok", + parent=self.text) + if response is False: + return "cancel" + self.stop_readline() + self.canceled = True + self.closing = True + return EditorWindow.close(self) + + def _close(self): + "Extend EditorWindow._close(), shut down debugger and execution server" + self.close_debugger() + if use_subprocess: + self.interp.kill_subprocess() + # Restore std streams + sys.stdout = self.save_stdout + sys.stderr = self.save_stderr + sys.stdin = self.save_stdin + # Break cycles + self.interp = None + self.console = None + self.flist.pyshell = None + self.history = None + EditorWindow._close(self) + + def ispythonsource(self, filename): + "Override EditorWindow method: never remove the colorizer" + return True + + def short_title(self): + return self.shell_title + + COPYRIGHT = \ + 'Type "help", "copyright", "credits" or "license()" for more information.' + + def begin(self): + self.text.mark_set("iomark", "insert") + self.resetoutput() + if use_subprocess: + nosub = '' + client = self.interp.start_subprocess() + if not client: + self.close() + return False + else: + nosub = ("==== No Subprocess ====\n\n" + + "WARNING: Running IDLE without a Subprocess is deprecated\n" + + "and will be removed in a later version. See Help/IDLE Help\n" + + "for details.\n\n") + sys.displayhook = rpc.displayhook + + self.write("Python %s on %s\n%s\n%s" % + (sys.version, sys.platform, self.COPYRIGHT, nosub)) + self.text.focus_force() + self.showprompt() + # User code should use separate default Tk root window + import tkinter + tkinter._support_default_root = True + tkinter._default_root = None + return True + + def stop_readline(self): + if not self.reading: # no nested mainloop to exit. + return + self._stop_readline_flag = True + self.top.quit() + + def readline(self): + save = self.reading + try: + self.reading = True + self.top.mainloop() # nested mainloop() + finally: + self.reading = save + if self._stop_readline_flag: + self._stop_readline_flag = False + return "" + line = self.text.get("iomark", "end-1c") + if len(line) == 0: # may be EOF if we quit our mainloop with Ctrl-C + line = "\n" + self.resetoutput() + if self.canceled: + self.canceled = False + if not use_subprocess: + raise KeyboardInterrupt + if self.endoffile: + self.endoffile = False + line = "" + return line + + def isatty(self): + return True + + def cancel_callback(self, event=None): + try: + if self.text.compare("sel.first", "!=", "sel.last"): + return # Active selection -- always use default binding + except: + pass + if not (self.executing or self.reading): + self.resetoutput() + self.interp.write("KeyboardInterrupt\n") + self.showprompt() + return "break" + self.endoffile = False + self.canceled = True + if (self.executing and self.interp.rpcclt): + if self.interp.getdebugger(): + self.interp.restart_subprocess() + else: + self.interp.interrupt_subprocess() + if self.reading: + self.top.quit() # exit the nested mainloop() in readline() + return "break" + + def eof_callback(self, event): + if self.executing and not self.reading: + return # Let the default binding (delete next char) take over + if not (self.text.compare("iomark", "==", "insert") and + self.text.compare("insert", "==", "end-1c")): + return # Let the default binding (delete next char) take over + if not self.executing: + self.resetoutput() + self.close() + else: + self.canceled = False + self.endoffile = True + self.top.quit() + return "break" + + def linefeed_callback(self, event): + # Insert a linefeed without entering anything (still autoindented) + if self.reading: + self.text.insert("insert", "\n") + self.text.see("insert") + else: + self.newline_and_indent_event(event) + return "break" + + def enter_callback(self, event): + if self.executing and not self.reading: + return # Let the default binding (insert '\n') take over + # If some text is selected, recall the selection + # (but only if this before the I/O mark) + try: + sel = self.text.get("sel.first", "sel.last") + if sel: + if self.text.compare("sel.last", "<=", "iomark"): + self.recall(sel, event) + return "break" + except: + pass + # If we're strictly before the line containing iomark, recall + # the current line, less a leading prompt, less leading or + # trailing whitespace + if self.text.compare("insert", "<", "iomark linestart"): + # Check if there's a relevant stdin range -- if so, use it. + # Note: "stdin" blocks may include several successive statements, + # so look for "console" tags on the newline before each statement + # (and possibly on prompts). + prev = self.text.tag_prevrange("stdin", "insert") + if ( + prev and + self.text.compare("insert", "<", prev[1]) and + # The following is needed to handle empty statements. + "console" not in self.text.tag_names("insert") + ): + prev_cons = self.text.tag_prevrange("console", "insert") + if prev_cons and self.text.compare(prev_cons[1], ">=", prev[0]): + prev = (prev_cons[1], prev[1]) + next_cons = self.text.tag_nextrange("console", "insert") + if next_cons and self.text.compare(next_cons[0], "<", prev[1]): + prev = (prev[0], self.text.index(next_cons[0] + "+1c")) + self.recall(self.text.get(prev[0], prev[1]), event) + return "break" + next = self.text.tag_nextrange("stdin", "insert") + if next and self.text.compare("insert lineend", ">=", next[0]): + next_cons = self.text.tag_nextrange("console", "insert lineend") + if next_cons and self.text.compare(next_cons[0], "<", next[1]): + next = (next[0], self.text.index(next_cons[0] + "+1c")) + self.recall(self.text.get(next[0], next[1]), event) + return "break" + # No stdin mark -- just get the current line, less any prompt + indices = self.text.tag_nextrange("console", "insert linestart") + if indices and \ + self.text.compare(indices[0], "<=", "insert linestart"): + self.recall(self.text.get(indices[1], "insert lineend"), event) + else: + self.recall(self.text.get("insert linestart", "insert lineend"), event) + return "break" + # If we're between the beginning of the line and the iomark, i.e. + # in the prompt area, move to the end of the prompt + if self.text.compare("insert", "<", "iomark"): + self.text.mark_set("insert", "iomark") + # If we're in the current input and there's only whitespace + # beyond the cursor, erase that whitespace first + s = self.text.get("insert", "end-1c") + if s and not s.strip(): + self.text.delete("insert", "end-1c") + # If we're in the current input before its last line, + # insert a newline right at the insert point + if self.text.compare("insert", "<", "end-1c linestart"): + self.newline_and_indent_event(event) + return "break" + # We're in the last line; append a newline and submit it + self.text.mark_set("insert", "end-1c") + if self.reading: + self.text.insert("insert", "\n") + self.text.see("insert") + else: + self.newline_and_indent_event(event) + self.text.update_idletasks() + if self.reading: + self.top.quit() # Break out of recursive mainloop() + else: + self.runit() + return "break" + + def recall(self, s, event): + # remove leading and trailing empty or whitespace lines + s = re.sub(r'^\s*\n', '', s) + s = re.sub(r'\n\s*$', '', s) + lines = s.split('\n') + self.text.undo_block_start() + try: + self.text.tag_remove("sel", "1.0", "end") + self.text.mark_set("insert", "end-1c") + prefix = self.text.get("insert linestart", "insert") + if prefix.rstrip().endswith(':'): + self.newline_and_indent_event(event) + prefix = self.text.get("insert linestart", "insert") + self.text.insert("insert", lines[0].strip(), + self.user_input_insert_tags) + if len(lines) > 1: + orig_base_indent = re.search(r'^([ \t]*)', lines[0]).group(0) + new_base_indent = re.search(r'^([ \t]*)', prefix).group(0) + for line in lines[1:]: + if line.startswith(orig_base_indent): + # replace orig base indentation with new indentation + line = new_base_indent + line[len(orig_base_indent):] + self.text.insert('insert', '\n' + line.rstrip(), + self.user_input_insert_tags) + finally: + self.text.see("insert") + self.text.undo_block_stop() + + _last_newline_re = re.compile(r"[ \t]*(\n[ \t]*)?\Z") + def runit(self): + index_before = self.text.index("end-2c") + line = self.text.get("iomark", "end-1c") + # Strip off last newline and surrounding whitespace. + # (To allow you to hit return twice to end a statement.) + line = self._last_newline_re.sub("", line) + input_is_complete = self.interp.runsource(line) + if not input_is_complete: + if self.text.get(index_before) == '\n': + self.text.tag_remove(self.user_input_insert_tags, index_before) + self.shell_sidebar.update_sidebar() + + def open_stack_viewer(self, event=None): + if self.interp.rpcclt: + return self.interp.remote_stack_viewer() + try: + sys.last_traceback + except: + messagebox.showerror("No stack trace", + "There is no stack trace yet.\n" + "(sys.last_traceback is not defined)", + parent=self.text) + return + from idlelib.stackviewer import StackBrowser + StackBrowser(self.root, self.flist) + + def view_restart_mark(self, event=None): + self.text.see("iomark") + self.text.see("restart") + + def restart_shell(self, event=None): + "Callback for Run/Restart Shell Cntl-F6" + self.interp.restart_subprocess(with_cwd=True) + + def showprompt(self): + self.resetoutput() + + prompt = self.prompt + if self.sys_ps1 and prompt.endswith(self.sys_ps1): + prompt = prompt[:-len(self.sys_ps1)] + self.text.tag_add("console", "iomark-1c") + self.console.write(prompt) + + self.shell_sidebar.update_sidebar() + self.text.mark_set("insert", "end-1c") + self.set_line_and_column() + self.io.reset_undo() + + def show_warning(self, msg): + width = self.interp.tkconsole.width + wrapper = TextWrapper(width=width, tabsize=8, expand_tabs=True) + wrapped_msg = '\n'.join(wrapper.wrap(msg)) + if not wrapped_msg.endswith('\n'): + wrapped_msg += '\n' + self.per.bottom.insert("iomark linestart", wrapped_msg, "stderr") + + def resetoutput(self): + source = self.text.get("iomark", "end-1c") + if self.history: + self.history.store(source) + if self.text.get("end-2c") != "\n": + self.text.insert("end-1c", "\n") + self.text.mark_set("iomark", "end-1c") + self.set_line_and_column() + self.ctip.remove_calltip_window() + + def write(self, s, tags=()): + try: + self.text.mark_gravity("iomark", "right") + count = OutputWindow.write(self, s, tags, "iomark") + self.text.mark_gravity("iomark", "left") + except: + raise ###pass # ### 11Aug07 KBK if we are expecting exceptions + # let's find out what they are and be specific. + if self.canceled: + self.canceled = False + if not use_subprocess: + raise KeyboardInterrupt + return count + + def rmenu_check_cut(self): + try: + if self.text.compare('sel.first', '<', 'iomark'): + return 'disabled' + except TclError: # no selection, so the index 'sel.first' doesn't exist + return 'disabled' + return super().rmenu_check_cut() + + def rmenu_check_paste(self): + if self.text.compare('insert','<','iomark'): + return 'disabled' + return super().rmenu_check_paste() + + def squeeze_current_text_event(self, event=None): + self.squeezer.squeeze_current_text() + self.shell_sidebar.update_sidebar() + + def on_squeezed_expand(self, index, text, tags): + self.shell_sidebar.update_sidebar() + + +def fix_x11_paste(root): + "Make paste replace selection on x11. See issue #5124." + if root._windowingsystem == 'x11': + for cls in 'Text', 'Entry', 'Spinbox': + root.bind_class( + cls, + '<>', + 'catch {%W delete sel.first sel.last}\n' + + root.bind_class(cls, '<>')) + + +usage_msg = """\ + +USAGE: idle [-deins] [-t title] [file]* + idle [-dns] [-t title] (-c cmd | -r file) [arg]* + idle [-dns] [-t title] - [arg]* + + -h print this help message and exit + -n run IDLE without a subprocess (DEPRECATED, + see Help/IDLE Help for details) + +The following options will override the IDLE 'settings' configuration: + + -e open an edit window + -i open a shell window + +The following options imply -i and will open a shell: + + -c cmd run the command in a shell, or + -r file run script from file + + -d enable the debugger + -s run $IDLESTARTUP or $PYTHONSTARTUP before anything else + -t title set title of shell window + +A default edit window will be bypassed when -c, -r, or - are used. + +[arg]* are passed to the command (-c) or script (-r) in sys.argv[1:]. + +Examples: + +idle + Open an edit window or shell depending on IDLE's configuration. + +idle foo.py foobar.py + Edit the files, also open a shell if configured to start with shell. + +idle -est "Baz" foo.py + Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell + window with the title "Baz". + +idle -c "import sys; print(sys.argv)" "foo" + Open a shell window and run the command, passing "-c" in sys.argv[0] + and "foo" in sys.argv[1]. + +idle -d -s -r foo.py "Hello World" + Open a shell window, run a startup script, enable the debugger, and + run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in + sys.argv[1]. + +echo "import sys; print(sys.argv)" | idle - "foobar" + Open a shell window, run the script piped in, passing '' in sys.argv[0] + and "foobar" in sys.argv[1]. +""" + +def main(): + import getopt + from platform import system + from idlelib import testing # bool value + from idlelib import macosx + + global flist, root, use_subprocess + + capture_warnings(True) + use_subprocess = True + enable_shell = False + enable_edit = False + debug = False + cmd = None + script = None + startup = False + try: + opts, args = getopt.getopt(sys.argv[1:], "c:deihnr:st:") + except getopt.error as msg: + print("Error: %s\n%s" % (msg, usage_msg), file=sys.stderr) + sys.exit(2) + for o, a in opts: + if o == '-c': + cmd = a + enable_shell = True + if o == '-d': + debug = True + enable_shell = True + if o == '-e': + enable_edit = True + if o == '-h': + sys.stdout.write(usage_msg) + sys.exit() + if o == '-i': + enable_shell = True + if o == '-n': + print(" Warning: running IDLE without a subprocess is deprecated.", + file=sys.stderr) + use_subprocess = False + if o == '-r': + script = a + if os.path.isfile(script): + pass + else: + print("No script file: ", script) + sys.exit() + enable_shell = True + if o == '-s': + startup = True + enable_shell = True + if o == '-t': + PyShell.shell_title = a + enable_shell = True + if args and args[0] == '-': + cmd = sys.stdin.read() + enable_shell = True + # process sys.argv and sys.path: + for i in range(len(sys.path)): + sys.path[i] = os.path.abspath(sys.path[i]) + if args and args[0] == '-': + sys.argv = [''] + args[1:] + elif cmd: + sys.argv = ['-c'] + args + elif script: + sys.argv = [script] + args + elif args: + enable_edit = True + pathx = [] + for filename in args: + pathx.append(os.path.dirname(filename)) + for dir in pathx: + dir = os.path.abspath(dir) + if not dir in sys.path: + sys.path.insert(0, dir) + else: + dir = os.getcwd() + if dir not in sys.path: + sys.path.insert(0, dir) + # check the IDLE settings configuration (but command line overrides) + edit_start = idleConf.GetOption('main', 'General', + 'editor-on-startup', type='bool') + enable_edit = enable_edit or edit_start + enable_shell = enable_shell or not enable_edit + + # Setup root. Don't break user code run in IDLE process. + # Don't change environment when testing. + if use_subprocess and not testing: + NoDefaultRoot() + root = Tk(className="Idle") + root.withdraw() + from idlelib.run import fix_scaling + fix_scaling(root) + + # set application icon + icondir = os.path.join(os.path.dirname(__file__), 'Icons') + if system() == 'Windows': + iconfile = os.path.join(icondir, 'idle.ico') + root.wm_iconbitmap(default=iconfile) + elif not macosx.isAquaTk(): + if TkVersion >= 8.6: + ext = '.png' + sizes = (16, 32, 48, 256) + else: + ext = '.gif' + sizes = (16, 32, 48) + iconfiles = [os.path.join(icondir, 'idle_%d%s' % (size, ext)) + for size in sizes] + icons = [PhotoImage(master=root, file=iconfile) + for iconfile in iconfiles] + root.wm_iconphoto(True, *icons) + + # start editor and/or shell windows: + fixwordbreaks(root) + fix_x11_paste(root) + flist = PyShellFileList(root) + macosx.setupApp(root, flist) + + if enable_edit: + if not (cmd or script): + for filename in args[:]: + if flist.open(filename) is None: + # filename is a directory actually, disconsider it + args.remove(filename) + if not args: + flist.new() + + if enable_shell: + shell = flist.open_shell() + if not shell: + return # couldn't open shell + if macosx.isAquaTk() and flist.dict: + # On OSX: when the user has double-clicked on a file that causes + # IDLE to be launched the shell window will open just in front of + # the file she wants to see. Lower the interpreter window when + # there are open files. + shell.top.lower() + else: + shell = flist.pyshell + + # Handle remaining options. If any of these are set, enable_shell + # was set also, so shell must be true to reach here. + if debug: + shell.open_debugger() + if startup: + filename = os.environ.get("IDLESTARTUP") or \ + os.environ.get("PYTHONSTARTUP") + if filename and os.path.isfile(filename): + shell.interp.execfile(filename) + if cmd or script: + shell.interp.runcommand("""if 1: + import sys as _sys + _sys.argv = %r + del _sys + \n""" % (sys.argv,)) + if cmd: + shell.interp.execsource(cmd) + elif script: + shell.interp.prepend_syspath(script) + shell.interp.execfile(script) + elif shell: + # If there is a shell window and no cmd or script in progress, + # check for problematic issues and print warning message(s) in + # the IDLE shell window; this is less intrusive than always + # opening a separate window. + + # Warn if using a problematic OS X Tk version. + tkversionwarning = macosx.tkVersionWarning(root) + if tkversionwarning: + shell.show_warning(tkversionwarning) + + # Warn if the "Prefer tabs when opening documents" system + # preference is set to "Always". + prefer_tabs_preference_warning = macosx.preferTabsPreferenceWarning() + if prefer_tabs_preference_warning: + shell.show_warning(prefer_tabs_preference_warning) + + while flist.inversedict: # keep IDLE running while files are open. + root.mainloop() + root.destroy() + capture_warnings(False) + +if __name__ == "__main__": + main() + +capture_warnings(False) # Make sure turned off; see issue 18081 diff --git a/shared/package-files/08/08633c6992181e578f0dd027475c97dcc7c31aed0e71e66952223f638b5919a5/blob b/shared/package-files/08/08633c6992181e578f0dd027475c97dcc7c31aed0e71e66952223f638b5919a5/blob new file mode 100644 index 0000000000000000000000000000000000000000..f8b681eb4ff4410bc9d66a66ba77ee2c6dea6d12 --- /dev/null +++ b/shared/package-files/08/08633c6992181e578f0dd027475c97dcc7c31aed0e71e66952223f638b5919a5/blob @@ -0,0 +1,24 @@ +===================================== + Tests in example form - pure python +===================================== + +This file contains doctest examples embedded as code blocks, using normal +Python prompts. See the accompanying file for similar examples using IPython +prompts (you can't mix both types within one file). The following will be run +as a test:: + + >>> 1+1 + 2 + >>> print ("hello") + hello + +More than one example works:: + + >>> s="Hello World" + + >>> s.upper() + 'HELLO WORLD' + +but you should note that the *entire* test file is considered to be a single +test. Individual code blocks that fail are printed separately as ``example +failures``, but the whole file is still counted and reported as one test. diff --git a/shared/package-files/08/08679fad4ea6fc6a4ec1a2abfd0f77679ccaa799eebfbf75923c5c34d3fc8a21/blob b/shared/package-files/08/08679fad4ea6fc6a4ec1a2abfd0f77679ccaa799eebfbf75923c5c34d3fc8a21/blob new file mode 100644 index 0000000000000000000000000000000000000000..d8c8eb2a56aaa1d1de77bfb90c859ed0af0b7bc4 --- /dev/null +++ b/shared/package-files/08/08679fad4ea6fc6a4ec1a2abfd0f77679ccaa799eebfbf75923c5c34d3fc8a21/blob @@ -0,0 +1,32 @@ +""" Testing miobase module +""" + +import numpy as np + +from numpy.testing import assert_equal +from pytest import raises as assert_raises + +from scipy.io.matlab._miobase import matdims + + +def test_matdims(): + # Test matdims dimension finder + assert_equal(matdims(np.array(1)), (1, 1)) # NumPy scalar + assert_equal(matdims(np.array([1])), (1, 1)) # 1-D array, 1 element + assert_equal(matdims(np.array([1,2])), (2, 1)) # 1-D array, 2 elements + assert_equal(matdims(np.array([[2],[3]])), (2, 1)) # 2-D array, column vector + assert_equal(matdims(np.array([[2,3]])), (1, 2)) # 2-D array, row vector + # 3d array, rowish vector + assert_equal(matdims(np.array([[[2,3]]])), (1, 1, 2)) + assert_equal(matdims(np.array([])), (0, 0)) # empty 1-D array + assert_equal(matdims(np.array([[]])), (1, 0)) # empty 2-D array + assert_equal(matdims(np.array([[[]]])), (1, 1, 0)) # empty 3-D array + assert_equal(matdims(np.empty((1, 0, 1))), (1, 0, 1)) # empty 3-D array + # Optional argument flips 1-D shape behavior. + assert_equal(matdims(np.array([1,2]), 'row'), (1, 2)) # 1-D array, 2 elements + # The argument has to make sense though + assert_raises(ValueError, matdims, np.array([1,2]), 'bizarre') + # Check empty sparse matrices get their own shape + from scipy.sparse import csr_array, csc_array + assert_equal(matdims(csr_array(np.zeros((3, 3)))), (3, 3)) + assert_equal(matdims(csc_array(np.zeros((2, 2)))), (2, 2)) diff --git a/shared/package-files/08/08691e4abd2b52b551e201ab37eb4b4aa67720825a8cbc7bf529c9c5f9f48718/blob b/shared/package-files/08/08691e4abd2b52b551e201ab37eb4b4aa67720825a8cbc7bf529c9c5f9f48718/blob new file mode 100644 index 0000000000000000000000000000000000000000..3890e39ef37ba28e4aacca4fd747cffbf55c31ca Binary files /dev/null and b/shared/package-files/08/08691e4abd2b52b551e201ab37eb4b4aa67720825a8cbc7bf529c9c5f9f48718/blob differ diff --git a/shared/package-files/08/08696f192f5d15bdf6b010bf96568b9a1565071c1c3b6e894ec740de65bcfbd0/blob b/shared/package-files/08/08696f192f5d15bdf6b010bf96568b9a1565071c1c3b6e894ec740de65bcfbd0/blob new file mode 100644 index 0000000000000000000000000000000000000000..33d128fee6d916e8f2eb46f5a77e0ef0baaaf547 --- /dev/null +++ b/shared/package-files/08/08696f192f5d15bdf6b010bf96568b9a1565071c1c3b6e894ec740de65bcfbd0/blob @@ -0,0 +1,27 @@ +from collections import namedtuple +from typing import Any, Dict, List, Optional, Set, Type + +from django.db.backends.base.base import BaseDatabaseWrapper +from django.db.backends.utils import CursorWrapper +from django.db.models.base import Model + +TableInfo = namedtuple("TableInfo", ["name", "type"]) + +FieldInfo = namedtuple("FieldInfo", "name type_code display_size internal_size precision scale null_ok default") + +class BaseDatabaseIntrospection: + data_types_reverse: Any = ... + connection: Any = ... + def __init__(self, connection: BaseDatabaseWrapper) -> None: ... + def get_field_type(self, data_type: str, description: FieldInfo) -> str: ... + def table_name_converter(self, name: str) -> str: ... + def column_name_converter(self, name: str) -> str: ... + def table_names(self, cursor: Optional[CursorWrapper] = ..., include_views: bool = ...) -> List[str]: ... + def get_table_list(self, cursor: Any) -> None: ... + def django_table_names(self, only_existing: bool = ..., include_views: bool = ...) -> List[str]: ... + def installed_models(self, tables: List[str]) -> Set[Type[Model]]: ... + def sequence_list(self) -> List[Dict[str, str]]: ... + def get_sequences(self, cursor: Any, table_name: Any, table_fields: Any = ...) -> None: ... + def get_key_columns(self, cursor: Any, table_name: Any) -> None: ... + def get_primary_key_column(self, cursor: Any, table_name: Any): ... + def get_constraints(self, cursor: Any, table_name: Any) -> None: ... diff --git a/shared/package-files/08/086bf2e7d296995f7cc7b486a62ae430fc9949314867e01d65ccf960e0056a4c/blob b/shared/package-files/08/086bf2e7d296995f7cc7b486a62ae430fc9949314867e01d65ccf960e0056a4c/blob new file mode 100644 index 0000000000000000000000000000000000000000..f7dc573a514232f2ddf88874d8f7a6827afb2cd8 --- /dev/null +++ b/shared/package-files/08/086bf2e7d296995f7cc7b486a62ae430fc9949314867e01d65ccf960e0056a4c/blob @@ -0,0 +1,69 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_sparse_compressed_tensor_unsafe(Tensor compressed_indices, Tensor plain_indices, Tensor values, SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor +inline at::Tensor _sparse_compressed_tensor_unsafe(const at::Tensor & compressed_indices, const at::Tensor & plain_indices, const at::Tensor & values, at::IntArrayRef size, at::TensorOptions options={}) { + return at::_ops::_sparse_compressed_tensor_unsafe::call(compressed_indices, plain_indices, values, c10::fromIntArrayRefSlow(size), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt()); +} +namespace symint { + template ::value>> + at::Tensor _sparse_compressed_tensor_unsafe(const at::Tensor & compressed_indices, const at::Tensor & plain_indices, const at::Tensor & values, at::IntArrayRef size, at::TensorOptions options={}) { + return at::_ops::_sparse_compressed_tensor_unsafe::call(compressed_indices, plain_indices, values, c10::fromIntArrayRefSlow(size), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt()); + } +} + +// aten::_sparse_compressed_tensor_unsafe(Tensor compressed_indices, Tensor plain_indices, Tensor values, SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor +inline at::Tensor _sparse_compressed_tensor_unsafe(const at::Tensor & compressed_indices, const at::Tensor & plain_indices, const at::Tensor & values, at::IntArrayRef size, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory) { + return at::_ops::_sparse_compressed_tensor_unsafe::call(compressed_indices, plain_indices, values, c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory); +} +namespace symint { + template ::value>> + at::Tensor _sparse_compressed_tensor_unsafe(const at::Tensor & compressed_indices, const at::Tensor & plain_indices, const at::Tensor & values, at::IntArrayRef size, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory) { + return at::_ops::_sparse_compressed_tensor_unsafe::call(compressed_indices, plain_indices, values, c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory); + } +} + +// aten::_sparse_compressed_tensor_unsafe(Tensor compressed_indices, Tensor plain_indices, Tensor values, SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor +inline at::Tensor _sparse_compressed_tensor_unsafe_symint(const at::Tensor & compressed_indices, const at::Tensor & plain_indices, const at::Tensor & values, c10::SymIntArrayRef size, at::TensorOptions options={}) { + return at::_ops::_sparse_compressed_tensor_unsafe::call(compressed_indices, plain_indices, values, size, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt()); +} +namespace symint { + template ::value>> + at::Tensor _sparse_compressed_tensor_unsafe(const at::Tensor & compressed_indices, const at::Tensor & plain_indices, const at::Tensor & values, c10::SymIntArrayRef size, at::TensorOptions options={}) { + return at::_ops::_sparse_compressed_tensor_unsafe::call(compressed_indices, plain_indices, values, size, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt()); + } +} + +// aten::_sparse_compressed_tensor_unsafe(Tensor compressed_indices, Tensor plain_indices, Tensor values, SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor +inline at::Tensor _sparse_compressed_tensor_unsafe_symint(const at::Tensor & compressed_indices, const at::Tensor & plain_indices, const at::Tensor & values, c10::SymIntArrayRef size, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory) { + return at::_ops::_sparse_compressed_tensor_unsafe::call(compressed_indices, plain_indices, values, size, dtype, layout, device, pin_memory); +} +namespace symint { + template ::value>> + at::Tensor _sparse_compressed_tensor_unsafe(const at::Tensor & compressed_indices, const at::Tensor & plain_indices, const at::Tensor & values, c10::SymIntArrayRef size, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory) { + return at::_ops::_sparse_compressed_tensor_unsafe::call(compressed_indices, plain_indices, values, size, dtype, layout, device, pin_memory); + } +} + +} diff --git a/shared/package-files/08/086e47ff149bb7065a9232f32fe10483e4fd8f618e5329425396202ec6c79b60/blob b/shared/package-files/08/086e47ff149bb7065a9232f32fe10483e4fd8f618e5329425396202ec6c79b60/blob new file mode 100644 index 0000000000000000000000000000000000000000..fdae6bfc1b26e560abdfca626b059a1ce77aa0a5 --- /dev/null +++ b/shared/package-files/08/086e47ff149bb7065a9232f32fe10483e4fd8f618e5329425396202ec6c79b60/blob @@ -0,0 +1,366 @@ +from sympy.core.function import Function +from sympy.core.mul import Mul +from sympy.core.numbers import (E, I, Rational, oo, pi) +from sympy.core.singleton import S +from sympy.core.symbol import (Dummy, Symbol, symbols) +from sympy.functions.elementary.exponential import (exp, log) +from sympy.functions.elementary.miscellaneous import (root, sqrt) +from sympy.functions.elementary.trigonometric import sin +from sympy.functions.special.gamma_functions import gamma +from sympy.functions.special.hyper import hyper +from sympy.matrices.expressions.matexpr import MatrixSymbol +from sympy.simplify.powsimp import (powdenest, powsimp) +from sympy.simplify.simplify import (signsimp, simplify) +from sympy.core.symbol import Str + +from sympy.abc import x, y, z, a, b + + +def test_powsimp(): + x, y, z, n = symbols('x,y,z,n') + f = Function('f') + assert powsimp( 4**x * 2**(-x) * 2**(-x) ) == 1 + assert powsimp( (-4)**x * (-2)**(-x) * 2**(-x) ) == 1 + + assert powsimp( + f(4**x * 2**(-x) * 2**(-x)) ) == f(4**x * 2**(-x) * 2**(-x)) + assert powsimp( f(4**x * 2**(-x) * 2**(-x)), deep=True ) == f(1) + assert exp(x)*exp(y) == exp(x)*exp(y) + assert powsimp(exp(x)*exp(y)) == exp(x + y) + assert powsimp(exp(x)*exp(y)*2**x*2**y) == (2*E)**(x + y) + assert powsimp(exp(x)*exp(y)*2**x*2**y, combine='exp') == \ + exp(x + y)*2**(x + y) + assert powsimp(exp(x)*exp(y)*exp(2)*sin(x) + sin(y) + 2**x*2**y) == \ + exp(2 + x + y)*sin(x) + sin(y) + 2**(x + y) + assert powsimp(sin(exp(x)*exp(y))) == sin(exp(x)*exp(y)) + assert powsimp(sin(exp(x)*exp(y)), deep=True) == sin(exp(x + y)) + assert powsimp(x**2*x**y) == x**(2 + y) + # This should remain factored, because 'exp' with deep=True is supposed + # to act like old automatic exponent combining. + assert powsimp((1 + E*exp(E))*exp(-E), combine='exp', deep=True) == \ + (1 + exp(1 + E))*exp(-E) + assert powsimp((1 + E*exp(E))*exp(-E), deep=True) == \ + (1 + exp(1 + E))*exp(-E) + assert powsimp((1 + E*exp(E))*exp(-E)) == (1 + exp(1 + E))*exp(-E) + assert powsimp((1 + E*exp(E))*exp(-E), combine='exp') == \ + (1 + exp(1 + E))*exp(-E) + assert powsimp((1 + E*exp(E))*exp(-E), combine='base') == \ + (1 + E*exp(E))*exp(-E) + x, y = symbols('x,y', nonnegative=True) + n = Symbol('n', real=True) + assert powsimp(y**n * (y/x)**(-n)) == x**n + assert powsimp(x**(x**(x*y)*y**(x*y))*y**(x**(x*y)*y**(x*y)), deep=True) \ + == (x*y)**(x*y)**(x*y) + assert powsimp(2**(2**(2*x)*x), deep=False) == 2**(2**(2*x)*x) + assert powsimp(2**(2**(2*x)*x), deep=True) == 2**(x*4**x) + assert powsimp( + exp(-x + exp(-x)*exp(-x*log(x))), deep=False, combine='exp') == \ + exp(-x + exp(-x)*exp(-x*log(x))) + assert powsimp( + exp(-x + exp(-x)*exp(-x*log(x))), deep=False, combine='exp') == \ + exp(-x + exp(-x)*exp(-x*log(x))) + assert powsimp((x + y)/(3*z), deep=False, combine='exp') == (x + y)/(3*z) + assert powsimp((x/3 + y/3)/z, deep=True, combine='exp') == (x/3 + y/3)/z + assert powsimp(exp(x)/(1 + exp(x)*exp(y)), deep=True) == \ + exp(x)/(1 + exp(x + y)) + assert powsimp(x*y**(z**x*z**y), deep=True) == x*y**(z**(x + y)) + assert powsimp((z**x*z**y)**x, deep=True) == (z**(x + y))**x + assert powsimp(x*(z**x*z**y)**x, deep=True) == x*(z**(x + y))**x + p = symbols('p', positive=True) + assert powsimp((1/x)**log(2)/x) == (1/x)**(1 + log(2)) + assert powsimp((1/p)**log(2)/p) == p**(-1 - log(2)) + + # coefficient of exponent can only be simplified for positive bases + assert powsimp(2**(2*x)) == 4**x + assert powsimp((-1)**(2*x)) == (-1)**(2*x) + i = symbols('i', integer=True) + assert powsimp((-1)**(2*i)) == 1 + assert powsimp((-1)**(-x)) != (-1)**x # could be 1/((-1)**x), but is not + # force=True overrides assumptions + assert powsimp((-1)**(2*x), force=True) == 1 + + # rational exponents allow combining of negative terms + w, n, m = symbols('w n m', negative=True) + e = i/a # not a rational exponent if `a` is unknown + ex = w**e*n**e*m**e + assert powsimp(ex) == m**(i/a)*n**(i/a)*w**(i/a) + e = i/3 + ex = w**e*n**e*m**e + assert powsimp(ex) == (-1)**i*(-m*n*w)**(i/3) + e = (3 + i)/i + ex = w**e*n**e*m**e + assert powsimp(ex) == (-1)**(3*e)*(-m*n*w)**e + + eq = x**(a*Rational(2, 3)) + # eq != (x**a)**(2/3) (try x = -1 and a = 3 to see) + assert powsimp(eq).exp == eq.exp == a*Rational(2, 3) + # powdenest goes the other direction + assert powsimp(2**(2*x)) == 4**x + + assert powsimp(exp(p/2)) == exp(p/2) + + # issue 6368 + eq = Mul(*[sqrt(Dummy(imaginary=True)) for i in range(3)]) + assert powsimp(eq) == eq and eq.is_Mul + + assert all(powsimp(e) == e for e in (sqrt(x**a), sqrt(x**2))) + + # issue 8836 + assert str( powsimp(exp(I*pi/3)*root(-1,3)) ) == '(-1)**(2/3)' + + # issue 9183 + assert powsimp(-0.1**x) == -0.1**x + + # issue 10095 + assert powsimp((1/(2*E))**oo) == (exp(-1)/2)**oo + + # PR 13131 + eq = sin(2*x)**2*sin(2.0*x)**2 + assert powsimp(eq) == eq + + # issue 14615 + assert powsimp(x**2*y**3*(x*y**2)**Rational(3, 2) + ) == x*y*(x*y**2)**Rational(5, 2) + + +def test_powsimp_negated_base(): + assert powsimp((-x + y)/sqrt(x - y)) == -sqrt(x - y) + assert powsimp((-x + y)*(-z + y)/sqrt(x - y)/sqrt(z - y)) == sqrt(x - y)*sqrt(z - y) + p = symbols('p', positive=True) + reps = {p: 2, a: S.Half} + assert powsimp((-p)**a/p**a).subs(reps) == ((-1)**a).subs(reps) + assert powsimp((-p)**a*p**a).subs(reps) == ((-p**2)**a).subs(reps) + n = symbols('n', negative=True) + reps = {p: -2, a: S.Half} + assert powsimp((-n)**a/n**a).subs(reps) == (-1)**(-a).subs(a, S.Half) + assert powsimp((-n)**a*n**a).subs(reps) == ((-n**2)**a).subs(reps) + # if x is 0 then the lhs is 0**a*oo**a which is not (-1)**a + eq = (-x)**a/x**a + assert powsimp(eq) == eq + + +def test_powsimp_nc(): + x, y, z = symbols('x,y,z') + A, B, C = symbols('A B C', commutative=False) + + assert powsimp(A**x*A**y, combine='all') == A**(x + y) + assert powsimp(A**x*A**y, combine='base') == A**x*A**y + assert powsimp(A**x*A**y, combine='exp') == A**(x + y) + + assert powsimp(A**x*B**x, combine='all') == A**x*B**x + assert powsimp(A**x*B**x, combine='base') == A**x*B**x + assert powsimp(A**x*B**x, combine='exp') == A**x*B**x + + assert powsimp(B**x*A**x, combine='all') == B**x*A**x + assert powsimp(B**x*A**x, combine='base') == B**x*A**x + assert powsimp(B**x*A**x, combine='exp') == B**x*A**x + + assert powsimp(A**x*A**y*A**z, combine='all') == A**(x + y + z) + assert powsimp(A**x*A**y*A**z, combine='base') == A**x*A**y*A**z + assert powsimp(A**x*A**y*A**z, combine='exp') == A**(x + y + z) + + assert powsimp(A**x*B**x*C**x, combine='all') == A**x*B**x*C**x + assert powsimp(A**x*B**x*C**x, combine='base') == A**x*B**x*C**x + assert powsimp(A**x*B**x*C**x, combine='exp') == A**x*B**x*C**x + + assert powsimp(B**x*A**x*C**x, combine='all') == B**x*A**x*C**x + assert powsimp(B**x*A**x*C**x, combine='base') == B**x*A**x*C**x + assert powsimp(B**x*A**x*C**x, combine='exp') == B**x*A**x*C**x + + +def test_issue_6440(): + assert powsimp(16*2**a*8**b) == 2**(a + 3*b + 4) + + +def test_powdenest(): + x, y = symbols('x,y') + p, q = symbols('p q', positive=True) + i, j = symbols('i,j', integer=True) + + assert powdenest(x) == x + assert powdenest(x + 2*(x**(a*Rational(2, 3)))**(3*x)) == (x + 2*(x**(a*Rational(2, 3)))**(3*x)) + assert powdenest((exp(a*Rational(2, 3)))**(3*x)) # -X-> (exp(a/3))**(6*x) + assert powdenest((x**(a*Rational(2, 3)))**(3*x)) == ((x**(a*Rational(2, 3)))**(3*x)) + assert powdenest(exp(3*x*log(2))) == 2**(3*x) + assert powdenest(sqrt(p**2)) == p + eq = p**(2*i)*q**(4*i) + assert powdenest(eq) == (p*q**2)**(2*i) + # -X-> (x**x)**i*(x**x)**j == x**(x*(i + j)) + assert powdenest((x**x)**(i + j)) + assert powdenest(exp(3*y*log(x))) == x**(3*y) + assert powdenest(exp(y*(log(a) + log(b)))) == (a*b)**y + assert powdenest(exp(3*(log(a) + log(b)))) == a**3*b**3 + assert powdenest(((x**(2*i))**(3*y))**x) == ((x**(2*i))**(3*y))**x + assert powdenest(((x**(2*i))**(3*y))**x, force=True) == x**(6*i*x*y) + assert powdenest(((x**(a*Rational(2, 3)))**(3*y/i))**x) == \ + (((x**(a*Rational(2, 3)))**(3*y/i))**x) + assert powdenest((x**(2*i)*y**(4*i))**z, force=True) == (x*y**2)**(2*i*z) + assert powdenest((p**(2*i)*q**(4*i))**j) == (p*q**2)**(2*i*j) + e = ((p**(2*a))**(3*y))**x + assert powdenest(e) == e + e = ((x**2*y**4)**a)**(x*y) + assert powdenest(e) == e + e = (((x**2*y**4)**a)**(x*y))**3 + assert powdenest(e) == ((x**2*y**4)**a)**(3*x*y) + assert powdenest((((x**2*y**4)**a)**(x*y)), force=True) == \ + (x*y**2)**(2*a*x*y) + assert powdenest((((x**2*y**4)**a)**(x*y))**3, force=True) == \ + (x*y**2)**(6*a*x*y) + assert powdenest((x**2*y**6)**i) != (x*y**3)**(2*i) + x, y = symbols('x,y', positive=True) + assert powdenest((x**2*y**6)**i) == (x*y**3)**(2*i) + + assert powdenest((x**(i*Rational(2, 3))*y**(i/2))**(2*i)) == (x**Rational(4, 3)*y)**(i**2) + assert powdenest(sqrt(x**(2*i)*y**(6*i))) == (x*y**3)**i + + assert powdenest(4**x) == 2**(2*x) + assert powdenest((4**x)**y) == 2**(2*x*y) + assert powdenest(4**x*y) == 2**(2*x)*y + + +def test_powdenest_polar(): + x, y, z = symbols('x y z', polar=True) + a, b, c = symbols('a b c') + assert powdenest((x*y*z)**a) == x**a*y**a*z**a + assert powdenest((x**a*y**b)**c) == x**(a*c)*y**(b*c) + assert powdenest(((x**a)**b*y**c)**c) == x**(a*b*c)*y**(c**2) + + +def test_issue_5805(): + arg = ((gamma(x)*hyper((), (), x))*pi)**2 + assert powdenest(arg) == (pi*gamma(x)*hyper((), (), x))**2 + assert arg.is_positive is None + + +def test_issue_9324_powsimp_on_matrix_symbol(): + M = MatrixSymbol('M', 10, 10) + expr = powsimp(M, deep=True) + assert expr == M + assert expr.args[0] == Str('M') + + +def test_issue_6367(): + z = -5*sqrt(2)/(2*sqrt(2*sqrt(29) + 29)) + sqrt(-sqrt(29)/29 + S.Half) + assert Mul(*[powsimp(a) for a in Mul.make_args(z.normal())]) == 0 + assert powsimp(z.normal()) == 0 + assert simplify(z) == 0 + assert powsimp(sqrt(2 + sqrt(3))*sqrt(2 - sqrt(3)) + 1) == 2 + assert powsimp(z) != 0 + + +def test_powsimp_polar(): + from sympy.functions.elementary.complexes import polar_lift + from sympy.functions.elementary.exponential import exp_polar + x, y, z = symbols('x y z') + p, q, r = symbols('p q r', polar=True) + + assert (polar_lift(-1))**(2*x) == exp_polar(2*pi*I*x) + assert powsimp(p**x * q**x) == (p*q)**x + assert p**x * (1/p)**x == 1 + assert (1/p)**x == p**(-x) + + assert exp_polar(x)*exp_polar(y) == exp_polar(x)*exp_polar(y) + assert powsimp(exp_polar(x)*exp_polar(y)) == exp_polar(x + y) + assert powsimp(exp_polar(x)*exp_polar(y)*p**x*p**y) == \ + (p*exp_polar(1))**(x + y) + assert powsimp(exp_polar(x)*exp_polar(y)*p**x*p**y, combine='exp') == \ + exp_polar(x + y)*p**(x + y) + assert powsimp( + exp_polar(x)*exp_polar(y)*exp_polar(2)*sin(x) + sin(y) + p**x*p**y) \ + == p**(x + y) + sin(x)*exp_polar(2 + x + y) + sin(y) + assert powsimp(sin(exp_polar(x)*exp_polar(y))) == \ + sin(exp_polar(x)*exp_polar(y)) + assert powsimp(sin(exp_polar(x)*exp_polar(y)), deep=True) == \ + sin(exp_polar(x + y)) + + +def test_issue_5728(): + b = x*sqrt(y) + a = sqrt(b) + c = sqrt(sqrt(x)*y) + assert powsimp(a*b) == sqrt(b)**3 + assert powsimp(a*b**2*sqrt(y)) == sqrt(y)*a**5 + assert powsimp(a*x**2*c**3*y) == c**3*a**5 + assert powsimp(a*x*c**3*y**2) == c**7*a + assert powsimp(x*c**3*y**2) == c**7 + assert powsimp(x*c**3*y) == x*y*c**3 + assert powsimp(sqrt(x)*c**3*y) == c**5 + assert powsimp(sqrt(x)*a**3*sqrt(y)) == sqrt(x)*sqrt(y)*a**3 + assert powsimp(Mul(sqrt(x)*c**3*sqrt(y), y, evaluate=False)) == \ + sqrt(x)*sqrt(y)**3*c**3 + assert powsimp(a**2*a*x**2*y) == a**7 + + # symbolic powers work, too + b = x**y*y + a = b*sqrt(b) + assert a.is_Mul is True + assert powsimp(a) == sqrt(b)**3 + + # as does exp + a = x*exp(y*Rational(2, 3)) + assert powsimp(a*sqrt(a)) == sqrt(a)**3 + assert powsimp(a**2*sqrt(a)) == sqrt(a)**5 + assert powsimp(a**2*sqrt(sqrt(a))) == sqrt(sqrt(a))**9 + + +def test_issue_from_PR1599(): + n1, n2, n3, n4 = symbols('n1 n2 n3 n4', negative=True) + assert (powsimp(sqrt(n1)*sqrt(n2)*sqrt(n3)) == + -I*sqrt(-n1)*sqrt(-n2)*sqrt(-n3)) + assert (powsimp(root(n1, 3)*root(n2, 3)*root(n3, 3)*root(n4, 3)) == + -(-1)**Rational(1, 3)* + (-n1)**Rational(1, 3)*(-n2)**Rational(1, 3)*(-n3)**Rational(1, 3)*(-n4)**Rational(1, 3)) + + +def test_issue_10195(): + a = Symbol('a', integer=True) + l = Symbol('l', even=True, nonzero=True) + n = Symbol('n', odd=True) + e_x = (-1)**(n/2 - S.Half) - (-1)**(n*Rational(3, 2) - S.Half) + assert powsimp((-1)**(l/2)) == I**l + assert powsimp((-1)**(n/2)) == I**n + assert powsimp((-1)**(n*Rational(3, 2))) == -I**n + assert powsimp(e_x) == (-1)**(n/2 - S.Half) + (-1)**(n*Rational(3, 2) + + S.Half) + assert powsimp((-1)**(a*Rational(3, 2))) == (-I)**a + +def test_issue_15709(): + assert powsimp(3**x*Rational(2, 3)) == 2*3**(x-1) + assert powsimp(2*3**x/3) == 2*3**(x-1) + + +def test_issue_11981(): + x, y = symbols('x y', commutative=False) + assert powsimp((x*y)**2 * (y*x)**2) == (x*y)**2 * (y*x)**2 + + +def test_issue_17524(): + a = symbols("a", real=True) + e = (-1 - a**2)*sqrt(1 + a**2) + assert signsimp(powsimp(e)) == signsimp(e) == -(a**2 + 1)**(S(3)/2) + + +def test_issue_19627(): + # if you use force the user must verify + assert powdenest(sqrt(sin(x)**2), force=True) == sin(x) + assert powdenest((x**(S.Half/y))**(2*y), force=True) == x + from sympy.core.function import expand_power_base + e = 1 - a + expr = (exp(z/e)*x**(b/e)*y**((1 - b)/e))**e + assert powdenest(expand_power_base(expr, force=True), force=True + ) == x**b*y**(1 - b)*exp(z) + + +def test_issue_22546(): + p1, p2 = symbols('p1, p2', positive=True) + ref = powsimp(p1**z/p2**z) + e = z + 1 + ans = ref.subs(z, e) + assert ans.is_Pow + assert powsimp(p1**e/p2**e) == ans + i = symbols('i', integer=True) + ref = powsimp(x**i/y**i) + e = i + 1 + ans = ref.subs(i, e) + assert ans.is_Pow + assert powsimp(x**e/y**e) == ans diff --git a/shared/package-files/08/08718ad705a9b35495054ffa65e35ac29445fe5ef610620778964a4413901d10/blob b/shared/package-files/08/08718ad705a9b35495054ffa65e35ac29445fe5ef610620778964a4413901d10/blob new file mode 100644 index 0000000000000000000000000000000000000000..ade076c6a008bc21c663edfa3f33a55dee80d661 --- /dev/null +++ b/shared/package-files/08/08718ad705a9b35495054ffa65e35ac29445fe5ef610620778964a4413901d10/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08718ad705a9b35495054ffa65e35ac29445fe5ef610620778964a4413901d10 +size 214650 diff --git a/shared/package-files/08/0872bca8383f1ed0d575fc8350b395f0c643443af8a4e6886e8df55d5e7c9d0b/blob b/shared/package-files/08/0872bca8383f1ed0d575fc8350b395f0c643443af8a4e6886e8df55d5e7c9d0b/blob new file mode 100644 index 0000000000000000000000000000000000000000..c734ac90b8528e3222a1f84d89962abadc6a8568 --- /dev/null +++ b/shared/package-files/08/0872bca8383f1ed0d575fc8350b395f0c643443af8a4e6886e8df55d5e7c9d0b/blob @@ -0,0 +1,16 @@ +# Different platforms have different names for the systemwide bashrc +if [[ -f /etc/bashrc ]]; then + source /etc/bashrc +fi +if [[ -f /etc/bash.bashrc ]]; then + source /etc/bash.bashrc +fi +if [[ -f ~/.bashrc ]]; then + source ~/.bashrc +fi + +# Reset PS1 so pexpect can find it +PS1="$" + +# Unset PROMPT_COMMAND, so that it can't change PS1 to something unexpected. +unset PROMPT_COMMAND diff --git a/shared/package-files/08/08773df6f669b938834340c8d57b0a054d1ed3e7b1d64bf5609d37cb536e4461/blob b/shared/package-files/08/08773df6f669b938834340c8d57b0a054d1ed3e7b1d64bf5609d37cb536e4461/blob new file mode 100644 index 0000000000000000000000000000000000000000..120c2ed4a4a2a6d3d438d6626ec89df3704159b1 --- /dev/null +++ b/shared/package-files/08/08773df6f669b938834340c8d57b0a054d1ed3e7b1d64bf5609d37cb536e4461/blob @@ -0,0 +1,30 @@ +"","oil_fpp1_mean","oil_fpp1_lower","oil_fpp1_upper","oil_fpp2_mean","oil_fpp2_lower","oil_fpp2_upper","oil_fpp3_mean","oil_fpp3_lower","oil_fpp3_upper","oil_ets_mean","oil_ets_lower","oil_ets_upper","air_fpp1_mean","air_fpp1_lower","air_fpp1_upper","air_fpp2_mean","air_fpp2_lower","air_fpp2_upper","air_ets_mean","air_ets_lower","air_ets_upper","aust_fpp1_mean","aust_fpp1_lower","aust_fpp1_upper","aust_ets1_mean","aust_ets1_lower","aust_ets1_upper","aust_ets2_mean","aust_ets2_lower","aust_ets2_upper","aust_ets3_mean","aust_ets3_lower","aust_ets3_upper" +"1",446.6565229,NA,NA,446.6565229,NA,NA,447.483644169658,NA,NA,447.4765151319,NA,NA,21.8601,NA,NA,17.7954446115713,NA,NA,18.8848104890875,NA,NA,42.0722103711899,NA,NA,42.0726494684032,NA,NA,42.3140687929334,NA,NA,41.6055176347889,NA,NA +"2",446.6565229,NA,NA,446.6565229,NA,NA,446.745888372689,NA,NA,446.74499213858,NA,NA,22.032368,NA,NA,20.817519558963,NA,NA,19.746325046866,NA,NA,24.0300518980141,NA,NA,24.0303907377061,NA,NA,23.6146826203943,NA,NA,23.3782029182433,NA,NA +"3",448.21987962,NA,NA,451.34659306,NA,NA,453.638405501868,NA,NA,453.639496055872,NA,NA,25.48461872,NA,NA,24.5629274647867,NA,NA,23.9862948520182,NA,NA,32.4521940690361,NA,NA,32.4521563826045,NA,NA,32.6656107086849,NA,NA,31.0757892153929,NA,NA +"4",449.708498496,NA,NA,453.936421624,NA,NA,455.444231564684,NA,NA,455.44466028185,NA,NA,27.5405858688,NA,NA,26.3821405600342,NA,NA,25.970250589835,NA,NA,37.471454237456,NA,NA,37.4708789137518,NA,NA,36.8985549457114,NA,NA,36.0360885086392,NA,NA +"5",444.4932465568,NA,NA,435.7539119296,NA,NA,427.06933306282,NA,NA,427.064491687769,NA,NA,30.288133559552,NA,NA,28.9196605612728,NA,NA,28.9583809838008,NA,NA,45.5154579083878,NA,NA,45.5153377101515,NA,NA,46.3915788083571,NA,NA,43.4403244523182,NA,NA +"6",446.84886282544,NA,NA,448.06436151184,NA,NA,453.116228197186,NA,NA,453.120192486142,NA,NA,30.2610617281741,NA,NA,28.7346297489894,NA,NA,28.8806381922591,NA,NA,28.111877892052,NA,NA,28.1118959126944,NA,NA,28.2293866144117,NA,NA,26.880680506301,NA,NA +"7",445.596700280352,NA,NA,443.578574664736,NA,NA,441.941644305178,NA,NA,441.940147170615,NA,NA,31.5812214853906,NA,NA,30.0527298566551,NA,NA,30.7673441321706,NA,NA,37.0162234816824,NA,NA,37.0161491447326,NA,NA,36.6564300124886,NA,NA,35.814657706958,NA,NA +"8",441.543864244282,NA,NA,432.630941925894,NA,NA,427.127035958795,NA,NA,427.124322588366,NA,NA,32.5992339991715,NA,NA,31.1292832447351,NA,NA,31.9668332354268,NA,NA,41.9699993461215,NA,NA,41.9698101989698,NA,NA,41.2212389061498,NA,NA,40.4819509265005,NA,NA +"9",450.264980975425,NA,NA,464.142045510358,NA,NA,478.880475670775,NA,NA,478.889097551389,NA,NA,33.2422390620602,NA,NA,31.8588566047118,NA,NA,32.800806899186,NA,NA,51.1483611799169,NA,NA,51.1481646915635,NA,NA,50.4145387733801,NA,NA,49.2184901151708,NA,NA +"10",461.42161720034,NA,NA,489.285715464143,NA,NA,503.11285717111,NA,NA,503.117961461885,NA,NA,32.2675538247083,NA,NA,30.9756820957196,NA,NA,31.9947642206661,NA,NA,32.9789826531404,NA,NA,32.9791638999506,NA,NA,32.5702087527114,NA,NA,30.8661960804354,NA,NA +"11",474.495690420272,NA,NA,511.789476165657,NA,NA,524.233596305251,NA,NA,524.237785095838,NA,NA,33.0777601652846,NA,NA,31.9487539559205,NA,NA,33.3362784643972,NA,NA,39.387458078461,NA,NA,39.3877167954935,NA,NA,39.1695594889739,NA,NA,37.8136796030494,NA,NA +"12",482.450330136218,NA,NA,513.277123866263,NA,NA,515.345515622007,NA,NA,515.344436563468,NA,NA,33.9580660469543,NA,NA,32.9752184432543,NA,NA,34.2930764239575,NA,NA,44.5566368011788,NA,NA,44.5569984473629,NA,NA,44.5456280766089,NA,NA,42.9250082971259,NA,NA +"13",484.802467968974,421.819410399168,547.785525538781,501.837461126505,450.920645731689,552.754276521321,496.494474366562,442.556563027022,550.432385706103,496.491110819357,442.553199364284,550.42902227443,34.7770835357756,NA,NA,33.9073699900036,NA,NA,35.1516833329047,NA,NA,49.0523310113362,NA,NA,49.0527360130482,NA,NA,49.5890555693318,NA,NA,47.6808634384826,NA,NA +"14",484.802467968974,420.572100054138,549.03283588381,501.837461126505,442.458760885327,561.216161367683,496.494474366562,424.217964109606,568.770984623519,496.491110819357,424.209083918694,568.77313772002,40.0553530278157,NA,NA,39.3193419700267,NA,NA,40.6367178875685,NA,NA,32.3529623929265,NA,NA,32.3529835150362,NA,NA,32.5377073619488,NA,NA,31.6742378837601,NA,NA +"15",484.802467968974,419.34855453281,550.256381405138,501.837461126505,435.060683765558,568.614238487453,496.494474366562,409.669998611301,583.318950121823,496.491110819357,409.657450677675,583.324770961039,43.2158603617732,NA,NA,42.4473122175255,NA,NA,42.9749885227721,NA,NA,39.0164375101233,NA,NA,39.0164384823398,NA,NA,39.1398437773272,NA,NA,38.3767414608177,NA,NA +"16",484.802467968974,418.147465112906,551.457470825043,501.837461126505,428.404185650768,575.270736602242,496.494474366562,397.231766135184,595.757182597941,496.491110819357,397.216352424617,595.765869214097,43.756968490681,39.439425250277,48.074511731085,42.875514259192,38.9053203627811,46.8457081556029,43.1552159304263,39.3018254827611,47.0086063780915,43.8927499819843,NA,NA,43.8923775323133,NA,NA,43.3951944766256,NA,NA,43.8050254375785,NA,NA +"17",484.802467968974,416.967638954845,552.637296983104,501.837461126505,422.302852939393,581.372069313617,496.494474366562,386.187262903849,606.801685829276,496.491110819357,386.169441256814,606.8127803819,45.5935233090074,39.4875951022958,51.699451515719,43.8182460735025,38.2870020876681,49.3494900593368,44.6707210001557,39.2320647044486,50.1093772958627,54.1210748367106,NA,NA,54.1210922131825,NA,NA,53.6289630081323,NA,NA,52.6919918454285,NA,NA +"18",484.802467968974,415.807985225715,553.796950712233,501.837461126505,416.637332887991,587.037589365019,496.494474366562,376.152143676437,616.836805056688,496.491110819357,376.132214613884,616.85000702483,47.4300781273338,39.4222283574712,55.4379278971964,44.6197748303083,37.5361663915343,51.7033832690822,46.1496082618676,39.4928700615495,52.8063464621857,35.7035912998415,NA,NA,35.7034526011339,NA,NA,34.9281049488671,NA,NA,34.7889450211398,NA,NA +"19",484.802467968974,414.667503289126,554.937432648822,501.837461126505,411.325750258567,592.349171994443,496.494474366562,366.891726667358,626.097222065766,496.491110819357,366.86990492876,626.112316709954,49.2666329456602,39.2335691056911,59.2996967856293,45.3012500263655,36.6804780887114,53.9220219640196,47.5927624792564,39.9084867400571,55.2770382184557,43.5194561142442,NA,NA,43.5196658634986,NA,NA,43.0510003006297,NA,NA,41.9904280699575,NA,NA +"20",484.802467968974,413.545272597018,556.059663340931,501.837461126505,406.30904777936,597.365874473651,496.494474366562,358.250241696858,634.738707036267,496.491110819357,358.226689736905,634.755531901809,51.1031877639866,38.9218992493525,63.2844762786206,45.8806533714084,35.7461920997009,56.0151146431158,49.0010470382538,40.4111281426106,57.5909659338969,45.6849237077797,NA,NA,45.6850733179871,NA,NA,45.3681869901339,NA,NA,44.8479104063312,NA,NA +"21",484.802467968974,412.440443992922,557.164491945027,501.837461126505,401.542966217737,602.131956035274,496.494474366562,350.118029807722,642.870918925403,496.491110819357,350.092875659235,642.889345979479,52.9397425823129,38.4904792139992,67.3890059506267,46.3732732615953,34.7551562453926,57.9913902777979,50.3753044635614,40.9663758384095,59.7842330887133,56.791056085213,NA,NA,56.7912777167902,NA,NA,56.5653758755025,NA,NA,55.5277678871381,NA,NA +"22",484.802467968974,411.352232193012,558.252703744937,501.837461126505,396.993321274118,606.681600978892,496.494474366562,342.414432904538,650.574515828587,496.491110819357,342.387780619354,650.59444101936,54.7762974006393,37.9434149850241,71.6091798162545,46.7921081859773,33.7249056236008,59.8593107483539,51.716356922702,41.5540872787497,61.8786265666543,36.806357499685,NA,NA,36.8060635459464,NA,NA,35.9921057760824,NA,NA,36.583824769338,NA,NA +"23",484.802467968974,410.279909255668,559.32502668228,501.837461126505,392.63305822182,611.04186403119,496.494474366562,335.078072374103,657.910876359022,496.491110819357,335.050008557683,657.932213081031,56.6128522189657,37.2849128606048,75.9407915773266,47.1482097104521,32.6693168509869,61.6271025699173,53.0250067178918,42.1613975368853,63.8886158988983,44.9603000101059,NA,NA,44.9601813575075,NA,NA,44.1720746796733,NA,NA,44.0203301328436,NA,NA +"24",484.802467968974,409.222798885207,560.382137052742,501.837461126505,388.440329036885,615.234593216125,496.494474366562,328.060954877587,664.927993855538,496.491110819357,328.031553001473,664.950668637241,58.4494070372921,36.5190072569605,80.3798068176236,47.4509740893308,31.5992871285654,63.3026610500962,54.3020367660287,42.7795926595158,65.8244808725417,48.3606012327523,NA,NA,48.3606163334299,NA,NA,47.6013239066589,NA,NA,47.3220021330047,NA,NA +"25",484.802467968974,408.180271443128,561.424664494821,501.837461126505,384.397188994103,619.277733258907,496.494474366562,321.324710586694,671.664238146431,496.491110819357,321.294033957527,671.688187681187,60.2859618556185,35.6494684192016,84.9224552920353,47.7083901991131,30.5233212294905,64.8934591687356,55.5482110670823,43.4025201868337,67.6939019473309,61.2650423365003,57.4688498800486,65.061234792952,61.2653941646371,57.469201667674,65.0615866616002,60.8009544962054,57.1500160756987,64.4518929167121,59.4994294181971,55.3687732859764,63.6300855504178 +"26",484.802467968974,407.151739562351,562.453196375597,501.837461126505,380.488684985522,623.186237267489,496.494474366562,314.838090504209,678.150858228916,496.491110819357,314.806194379761,678.176027258952,62.1225166739448,34.6797825324013,89.5652508154884,47.9272503365599,29.4480126620847,66.4064880110352,56.7642751611668,44.0257032808902,69.5028470414435,37.071590862526,32.9273260460426,41.2158556790094,37.0717895543016,32.9276609274033,41.2159181811999,36.4195487014795,32.6276131136748,40.2114842892843,35.6676030168922,30.9852087547665,40.349997279018 +"27",484.802467968974,406.136654277684,563.468281660265,501.837461126505,376.702200614943,626.972721638067,496.494474366562,308.57524317082,684.413705562305,496.491110819357,308.542176312147,684.440045326567,63.9590714922712,33.6131611605929,94.3049818239496,48.1133294432786,28.3784309287452,67.8482279578119,57.9509565745706,44.6458116249244,71.2561015242167,46.3496222476879,41.7700005700215,50.9292439253542,46.3497540069499,41.7704245062124,50.9290835076873,45.4239843768919,41.4960199222141,49.3519488315696,44.6356278176959,39.4599817740291,49.8112738613628 +"28",484.802467968974,405.134501600135,564.470434337813,501.837461126505,373.026974846551,630.64794740646,496.494474366562,302.514493161154,690.474455571971,496.491110819357,302.480298999169,690.501922639545,65.7956263105976,32.4525617649127,99.1386908562825,48.2715374859178,27.3184313253537,69.2246436464818,59.1089652550077,45.2603278412559,72.9576026687595,50.0719004541517,44.9759122506884,55.1678886576149,50.0720099691788,44.9764836346151,55.1675363037424,48.8618776400004,44.8023588033461,52.9213964766548,47.9137359889234,41.2918305672793,54.5356414105674 +"29",484.802467968974,404.144799474403,565.460136463545,501.837461126505,369.453741099984,634.221181153026,496.494474366562,296.637453564934,696.351495168191,496.491110819357,296.602171095666,696.380050543048,67.632181128924,31.2007113554933,104.063650902355,48.4060490127468,26.2709024661038,70.5411955593899,60.2389939963542,45.8673278219124,74.6106601707959,63.4232050585459,56.3246992632325,70.5217108538594,63.4236661473586,56.3256531990087,70.5216790957085,61.6903568520975,56.2573010390664,67.1234126651287,59.4994294181971,52.5200220395914,66.4788367968027 diff --git a/shared/package-files/08/087756b636c7a2a1f236b988fb58ed6355bf8d0bd6785735aad61a65aa7a3dbb/blob b/shared/package-files/08/087756b636c7a2a1f236b988fb58ed6355bf8d0bd6785735aad61a65aa7a3dbb/blob new file mode 100644 index 0000000000000000000000000000000000000000..06c77edca718cad76bc0db1f63137087fcdaf41b --- /dev/null +++ b/shared/package-files/08/087756b636c7a2a1f236b988fb58ed6355bf8d0bd6785735aad61a65aa7a3dbb/blob @@ -0,0 +1,511 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +C10_CLANG_DIAGNOSTIC_PUSH() +#if C10_CLANG_HAS_WARNING("-Wshorten-64-to-32") +C10_CLANG_DIAGNOSTIC_IGNORE("-Wshorten-64-to-32") +#endif + +namespace torch::jit { + +// GraphExecutor creates specializations of Graphs for different +// dimensionalitities and types of inputs. + +struct ArgumentInfo { + friend struct ArgumentSpec; + using plain_data_type = uint64_t; + + bool defined() const { + return defined_; + } + at::Device device() const { + return at::Device(DeviceType(dev_type_), device_); + } + // XXX: It is guaranteed that this will return false when called on non-tensor + // arguments + bool requires_grad() const { + return requires_grad_; + } + int dim() const { + // NOLINTNEXTLINE(cppcoreguidelines-narrowing-conversions,bugprone-narrowing-conversions) + return dim_; + } + at::ScalarType type() const { + return at::ScalarType(type_); + } + TypePtr toType() const { + if (!defined()) + return TensorType::get(); + + return TensorType::create( + type(), device(), c10::optional(dim()), requires_grad()); + } + operator TypePtr() const { + return toType(); + } + + private: + unsigned defined_ : 1; + unsigned requires_grad_ : 1; + unsigned : 5; + unsigned dim_ : 8; + unsigned device_ : 8; + unsigned type_ : 8; + unsigned dev_type_ : 16; + unsigned : 16; +}; + +static_assert( + std::is_standard_layout::value, + "ArgumentInfo is to be a POD struct"); +static_assert( + sizeof(ArgumentInfo) == sizeof(ArgumentInfo::plain_data_type), + "ArgumentInfo is expected to be a 32-bit struct"); + +struct ArgumentSpec { + ArgumentSpec(size_t num_flat_tensor_inputs, size_t num_flat_optional_inputs) + : hash_code(c10::hash_combine( + num_flat_tensor_inputs, + num_flat_optional_inputs)) { + tensor_args.reserve(num_flat_tensor_inputs); + optional_presence.reserve(num_flat_optional_inputs); + } + + void addOptional(const IValue& input) { + bool is_present = !input.isNone(); + optional_presence.push_back(is_present); + hash_code = c10::hash_combine(hash_code, is_present); + } + + void addTensor(const IValue& input, bool with_grad) { + AT_ASSERT(input.isTensor(), "Expected Tensor but found ", input.tagKind()); + tensor_args.emplace_back(); + auto& arg = tensor_args.back(); + // Initialize all fields to 0. This is convenient, because e.g. + // requires_grad() can be checked even on tensors AND will make + // padding bits all 0s. + std::memset(&arg, 0, sizeof(ArgumentInfo)); + + // [argspec refcounting] reinterpret the IValue to avoid having to refcount + // the Tensor microbenchmarks + // https://github.com/zdevito/pytorch/commit/21e7200a0a0fc456bea2f10e95b1781f83933d10 + // show overhead in extra refcounting along this path + const at::Tensor* t = reinterpret_cast(&input); + arg.defined_ = t->defined(); + if (arg.defined_) { + arg.requires_grad_ = with_grad && autograd::Variable(*t).requires_grad(); + arg.dim_ = t->dim(); + // NOLINTNEXTLINE(cppcoreguidelines-narrowing-conversions,bugprone-narrowing-conversions) + at::Device device = t->device(); + arg.dev_type_ = + // NOLINTNEXTLINE(bugprone-signed-char-misuse) + static_cast::type>(device.type()); + // NOLINTNEXTLINE(bugprone-signed-char-misuse) + arg.device_ = device.index(); + arg.type_ = static_cast(t->scalar_type()); + } + combineHash(arg); + } + + void combineHash(const ArgumentInfo& arg) { + // NOLINTNEXTLINE(cppcoreguidelines-init-variables) + ArgumentInfo::plain_data_type arg_data; + std::memcpy(&arg_data, &arg, sizeof(ArgumentInfo)); + hash_code = c10::hash_combine(hash_code, arg_data); + } + + // equality is fast: check ninputs, and then check the raw array data, + // there are no size/stride indirections + // hopefully std::vector has fast equality + bool operator==(const ArgumentSpec& spec) const { + if (optional_presence != spec.optional_presence) { + return false; + } + if (tensor_args.size() != spec.tensor_args.size()) + return false; + // NB: we need to break out early when there are no elements, because + // passing a nullptr to memcmp is UB. + if (tensor_args.empty()) + return true; + return std::memcmp( + tensor_args.data(), + spec.tensor_args.data(), + tensor_args.size() * sizeof(ArgumentInfo)) == 0; + } + bool operator!=(const ArgumentSpec& spec) const { + return !(*this == spec); + } + size_t numTensors() const { + return tensor_args.size(); + } + const ArgumentInfo& tensorAt(size_t i) const { + return tensor_args[i]; + } + size_t numOptionals() const { + return optional_presence.size(); + } + bool isPresent(size_t i) const { + return optional_presence[i]; + } + size_t hashCode() const { + return hash_code; + } + + private: + size_t hash_code; // precomputed on construction + std::vector tensor_args; + std::vector optional_presence; +}; + +namespace { +static constexpr size_t ARG_SPEC_DEPTH_LIMIT = 128; +} + +// ArgumentSpecCreator takes an initial graph and comes up with a set +// of simple instructions to compute the ArgumentSpec given a set of +// input tensors. +struct TORCH_API ArgumentSpecCreator { + // instructs acts on a stack of a list of input IValues + // at the beginning the stack contains a single list of the inputs to the + // function the ENTER_ instructs descend into subobjects and push new lists + // onto the stack + enum Inst : char { + ENTER_TUPLE, // consume a tuple ivalue from the top-most list, and push the + // list of its elements onto the stack as a new list + ENTER_OBJECT, // same as ENTER_TUPLE, but the input is a class + LEAVE, // pop the top-most list from the stack + SKIP, // consume an element from the top-most list, and discard + SPECIALIZE_OPTIONAL_TENSOR, // consume a optional tensor for the top-most + // list, and add it to the ArgSpec key being + // created + SPECIALIZE_TENSOR, // consume a tensor for the top-most + // list, and add it to the ArgSpec key being created + SPECIALIZE_OPTIONAL, + // consume a nontensor optional from the top-most list, + // and add it to the ArgSpec key being created + }; + ArgumentSpecCreator(Graph& graph); + ArgumentSpec create(bool with_grad, const Stack& stack) const; + void specializeTypes(Graph& g, const ArgumentSpec& spec) const; + void dump() const; + using WrittenSlots = std::unordered_set; + + private: + void scan( + const TypePtr& typ, + size_t depth, + const WrittenSlots& written_slots); + size_t num_inputs_; + size_t num_tensors_ = 0; + size_t num_optionals_ = 0; + std::vector instructions_; +}; + +// CompleteArgumentSpec represents one particular specialization. +// It is designed so that it can be created, hashed, and compared quickly +// since it is used along the hot-path of the JIT to check if the code +// we have created is valid for the given inputs. + +// COmpleteArgumentInfoPOD is only used internally in CompleteArgumentSpec +// API users should use ArgumentInfo +struct CompleteArgumentInfoPOD { + // total size is 64-bit + unsigned is_tensor : 8; // all other fields are invalid if this is false + unsigned type : 8; // scalar type + unsigned defined : 1; + unsigned requires_grad : 1; + signed device : 14; + unsigned dev_type : 16; + unsigned + total_dims : 16; // all TensorInfoPODs are in CompleteArgumentSpec's + // tensor_info() array. total_dims is the total number of + // dimensions seen so far in all previous members of + // tensor_info(), including this tensor 2*total_dims + // becomes the offset into the sizes_strides list for the + // _next_ tensor in the tensor_info array for tensor 0, + // the offset is always 0 +}; + +static_assert( + sizeof(CompleteArgumentInfoPOD) == sizeof(int64_t), + "CompleteArgumentInfoPOD must be 64-bit struct for CompleteArgumentSpec encoding to work"); + +struct CompleteArgumentInfo; + +struct CompleteArgumentSpec { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) + CompleteArgumentSpec(bool with_grad, at::ArrayRef inputs) + : hash_code(0), ninputs(inputs.size()) { + int32_t all_dims = 0; + // NOLINTNEXTLINE(cppcoreguidelines-init-variables) + const int32_t num_inputs = inputs.size(); + for (const auto i : c10::irange(num_inputs)) { + if (!inputs[i].isTensor()) + continue; + auto& tensor = inputs[i].toTensor(); + all_dims += tensor.defined() ? tensor.ndimension() : 0; + } + // allocate enough room for all TensorPODs and dimensions + data.resize(ninputs + all_dims * 2); + + // and reinterpret our data array as these structs + // NOLINTNEXTLINE(cppcoreguidelines-init-variables) + auto* pods = reinterpret_cast(data.data()); + int64_t* next_dim = sizes_strides(); + int32_t total_dims = 0; + for (const auto i : c10::irange(num_inputs)) { + auto& pod = pods[i]; + pod.is_tensor = static_cast(inputs[i].isTensor()); + if (pod.is_tensor) { + at::Tensor t = inputs[i].toTensor(); + pod.defined = t.defined(); + if (pod.defined) { + pod.type = static_cast(t.scalar_type()); + // NOLINTNEXTLINE(cppcoreguidelines-narrowing-conversions,bugprone-narrowing-conversions) + at::Device device = t.device(); + // NOLINTNEXTLINE(bugprone-signed-char-misuse) + pod.dev_type = static_cast::type>( + device.type()); + // NOLINTNEXTLINE(bugprone-signed-char-misuse) + pod.device = device.index(); + pod.requires_grad = with_grad && t.requires_grad(); + total_dims += t.ndimension(); + auto sizes = t.sizes(); + std::copy(sizes.begin(), sizes.end(), next_dim); + next_dim += sizes.size(); + auto strides = t.strides(); + std::copy(strides.begin(), strides.end(), next_dim); + next_dim += strides.size(); + } + } + // each POD has a running tally of all dimensions including its own + TORCH_CHECK( + total_dims < std::numeric_limits::max(), + "The number of dims cannot be packed into CompleteArgumentSpec:", + total_dims); + pod.total_dims = total_dims; + } + // we precompute the hash_code to minimize the time inside of hash + // table operations where we may need to hold a compiler cache lock. + hash_code = c10::hash_combine(0, ninputs); + for (auto d : data) { + hash_code = c10::hash_combine(hash_code, d); + } + } + + // equality is fast: check ninputs, and then check the raw array data, + // there are no size/stride indirections + bool operator==(const CompleteArgumentSpec& spec) const { + return ninputs == spec.ninputs && data == spec.data; + } + bool operator!=(const CompleteArgumentSpec& spec) const { + return !(*this == spec); + } + friend struct CompleteArgumentInfo; + CompleteArgumentInfo at(size_t i) const; + size_t size() const { + return ninputs; + } + size_t hashCode() const { + return hash_code; + } + + private: + ArrayRef tensor_info() const { + return ArrayRef( + reinterpret_cast(data.data()), ninputs); + } + // the start of the sizes_strides information, which comes after the + // CompleteArgumentInfoPOD list. + const int64_t* sizes_strides() const { + return data.data() + ninputs; + } + int64_t* sizes_strides() { + return data.data() + ninputs; + } + size_t hash_code; // precomputed on construction + size_t ninputs; + // layout is ninputs of TensorPOD (each 64-bit) followed by their size and + // stride info for 3 tensors: + // [t0POD][t1POD][t2POD]... + // [t0 sizes][t0 strides][t1 sizes][t1 strides][t2 sizes][t2 strides] + std::vector data; +}; + +// public view of compressed CompleteArgumentInfo +struct CompleteArgumentInfo { + CompleteArgumentInfo(const CompleteArgumentSpec& spec, const int i) + : spec(spec), i(i) {} + bool isTensor() const { + return pod(i).is_tensor; + } + at::ScalarType type() const { + return at::ScalarType(pod(i).type); + } + bool defined() const { + return pod(i).defined; + } + bool requires_grad() const { + return pod(i).requires_grad; + } + at::Device device() const { + return at::Device( + DeviceType(pod(i).dev_type), + static_cast(pod(i).device)); + } + int ndimension() const { + // See [valid range], it is always valid to ask for offset for (i + 1) + return (sizes_strides_offset(i + 1) - sizes_strides_offset(i)) / 2; + } + at::IntArrayRef sizes() const { + return at::IntArrayRef( + spec.sizes_strides() + sizes_strides_offset(i), ndimension()); + } + at::IntArrayRef strides() const { + int ndim = ndimension(); + return at::IntArrayRef( + spec.sizes_strides() + sizes_strides_offset(i) + ndim, ndim); + } + operator TypePtr() const { + if (!defined()) + return TensorType::get(); + return TensorType::create( + type(), + device(), + c10::VaryingShape{sizes()}, + c10::VaryingShape{strides()}, + requires_grad()); + } + + private: + // offsetinto sizes_strides() array where the sizes start for tensor j + // [valid range] valid range is [0, ninputs] + // (i.e. you can ask for the offset at ninputs, which would be the offset of + // the next tensor if it existed) + int sizes_strides_offset(int j) const { + if (j == 0) + return 0; + // NOLINTNEXTLINE(cppcoreguidelines-narrowing-conversions,bugprone-narrowing-conversions) + return 2 * pod(j - 1).total_dims; + } + const CompleteArgumentInfoPOD& pod(int j) const { + return spec.tensor_info().at(j); + } + const CompleteArgumentSpec& spec; + const int i; +}; + +inline std::ostream& operator<<(std::ostream& out, const ArgumentInfo& info) { + if (!info.defined()) { + return out << ""; + } + out << "Tensor(device=" << info.device() << ", type=" << toString(info.type()) + << ", requires_grad=" << info.requires_grad() << ", dims=" << info.dim() + << ")"; + return out; +} + +inline std::ostream& operator<<(std::ostream& out, const ArgumentSpec& spec) { + out << "{"; + for (const auto i : c10::irange(spec.numTensors())) { + if (i > 0) + out << ", "; + out << spec.tensorAt(i); + } + out << "; "; + for (const auto i : c10::irange(spec.numOptionals())) { + if (i > 0) + out << ", "; + out << spec.isPresent(i); + } + out << "}"; + return out; +} + +inline std::ostream& operator<<( + std::ostream& out, + const CompleteArgumentInfo& info) { + if (!info.defined()) { + return out << ""; + } + out << "Tensor(device=" << info.device() << ", type=" << toString(info.type()) + << ", requires_grad=" << info.requires_grad() + << ", sizes=" << info.sizes() << ", strides=" << info.strides() << ")"; + return out; +} + +inline std::ostream& operator<<( + std::ostream& out, + const CompleteArgumentSpec& spec) { + out << "{"; + for (const auto i : c10::irange(spec.size())) { + if (i > 0) + out << ", "; + out << spec.at(i); + } + out << "}"; + return out; +} + +inline CompleteArgumentInfo CompleteArgumentSpec::at(size_t i) const { + return CompleteArgumentInfo(*this, i); +} + +inline c10::optional convertOptional( + c10::optional const& from) { + return (from) ? c10::optional(static_cast(*from)) + : c10::optional{}; +} + +} // namespace torch::jit + +namespace std { + +template +struct hash> { + size_t operator()(const c10::VaryingShape& vs) const { + return c10::get_hash( + vs.size(), + vs.size() ? vs.sizes().value() : std::vector>()); + } +}; + +template <> +struct hash { + size_t operator()(const c10::TensorType& ptt) const { + return c10::get_hash< + c10::optional, + c10::VaryingShape, + c10::VaryingShape, + c10::optional>( + torch::jit::convertOptional(ptt.scalarType()), + ptt.sizes(), + ptt.strides(), + ptt.requiresGrad()); + } +}; + +template <> +struct hash { + size_t operator()(const torch::jit::ArgumentSpec& spec) const { + return spec.hashCode(); + } +}; +template <> +struct hash { + size_t operator()(const torch::jit::CompleteArgumentSpec& spec) const { + return spec.hashCode(); + } +}; +} // namespace std + +C10_CLANG_DIAGNOSTIC_POP() diff --git a/shared/package-files/08/08777de167c3f8b2d3735e72aa383c760f749f60d30366a1fd293e8c2323e0bc/blob b/shared/package-files/08/08777de167c3f8b2d3735e72aa383c760f749f60d30366a1fd293e8c2323e0bc/blob new file mode 100644 index 0000000000000000000000000000000000000000..28ea7b94e5a8c02c59053e32f0aeb69cc42d58cc --- /dev/null +++ b/shared/package-files/08/08777de167c3f8b2d3735e72aa383c760f749f60d30366a1fd293e8c2323e0bc/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API ::std::tuple quantized_lstm_cell(const at::Tensor & input, at::TensorList hx, const at::Tensor & w_ih, const at::Tensor & w_hh, const at::Tensor & b_ih, const at::Tensor & b_hh, const at::Tensor & packed_ih, const at::Tensor & packed_hh, const at::Tensor & col_offsets_ih, const at::Tensor & col_offsets_hh, const at::Scalar & scale_ih, const at::Scalar & scale_hh, const at::Scalar & zero_point_ih, const at::Scalar & zero_point_hh); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/08/087ec533ba384cde3eeb252a348ff8a4b5b89989a0d2074493fd740634ef59bd/blob b/shared/package-files/08/087ec533ba384cde3eeb252a348ff8a4b5b89989a0d2074493fd740634ef59bd/blob new file mode 100644 index 0000000000000000000000000000000000000000..13f909188f99ff8120fec512357baaa0e2ad7639 --- /dev/null +++ b/shared/package-files/08/087ec533ba384cde3eeb252a348ff8a4b5b89989a0d2074493fd740634ef59bd/blob @@ -0,0 +1,602 @@ +from contextlib import contextmanager +from typing import NamedTuple +from functools import partial +from IPython.core.guarded_eval import ( + EvaluationContext, + GuardRejection, + guarded_eval, + _unbind_method, +) +from IPython.testing import decorators as dec +import pytest + + +def create_context(evaluation: str, **kwargs): + return EvaluationContext(locals=kwargs, globals={}, evaluation=evaluation) + + +forbidden = partial(create_context, "forbidden") +minimal = partial(create_context, "minimal") +limited = partial(create_context, "limited") +unsafe = partial(create_context, "unsafe") +dangerous = partial(create_context, "dangerous") + +LIMITED_OR_HIGHER = [limited, unsafe, dangerous] +MINIMAL_OR_HIGHER = [minimal, *LIMITED_OR_HIGHER] + + +@contextmanager +def module_not_installed(module: str): + import sys + + try: + to_restore = sys.modules[module] + del sys.modules[module] + except KeyError: + to_restore = None + try: + yield + finally: + sys.modules[module] = to_restore + + +def test_external_not_installed(): + """ + Because attribute check requires checking if object is not of allowed + external type, this tests logic for absence of external module. + """ + + class Custom: + def __init__(self): + self.test = 1 + + def __getattr__(self, key): + return key + + with module_not_installed("pandas"): + context = limited(x=Custom()) + with pytest.raises(GuardRejection): + guarded_eval("x.test", context) + + +@dec.skip_without("pandas") +def test_external_changed_api(monkeypatch): + """Check that the execution rejects if external API changed paths""" + import pandas as pd + + series = pd.Series([1], index=["a"]) + + with monkeypatch.context() as m: + m.delattr(pd, "Series") + context = limited(data=series) + with pytest.raises(GuardRejection): + guarded_eval("data.iloc[0]", context) + + +@dec.skip_without("pandas") +def test_pandas_series_iloc(): + import pandas as pd + + series = pd.Series([1], index=["a"]) + context = limited(data=series) + assert guarded_eval("data.iloc[0]", context) == 1 + + +def test_rejects_custom_properties(): + class BadProperty: + @property + def iloc(self): + return [None] + + series = BadProperty() + context = limited(data=series) + + with pytest.raises(GuardRejection): + guarded_eval("data.iloc[0]", context) + + +@dec.skip_without("pandas") +def test_accepts_non_overriden_properties(): + import pandas as pd + + class GoodProperty(pd.Series): + pass + + series = GoodProperty([1], index=["a"]) + context = limited(data=series) + + assert guarded_eval("data.iloc[0]", context) == 1 + + +@dec.skip_without("pandas") +def test_pandas_series(): + import pandas as pd + + context = limited(data=pd.Series([1], index=["a"])) + assert guarded_eval('data["a"]', context) == 1 + with pytest.raises(KeyError): + guarded_eval('data["c"]', context) + + +@dec.skip_without("pandas") +def test_pandas_bad_series(): + import pandas as pd + + class BadItemSeries(pd.Series): + def __getitem__(self, key): + return "CUSTOM_ITEM" + + class BadAttrSeries(pd.Series): + def __getattr__(self, key): + return "CUSTOM_ATTR" + + bad_series = BadItemSeries([1], index=["a"]) + context = limited(data=bad_series) + + with pytest.raises(GuardRejection): + guarded_eval('data["a"]', context) + with pytest.raises(GuardRejection): + guarded_eval('data["c"]', context) + + # note: here result is a bit unexpected because + # pandas `__getattr__` calls `__getitem__`; + # FIXME - special case to handle it? + assert guarded_eval("data.a", context) == "CUSTOM_ITEM" + + context = unsafe(data=bad_series) + assert guarded_eval('data["a"]', context) == "CUSTOM_ITEM" + + bad_attr_series = BadAttrSeries([1], index=["a"]) + context = limited(data=bad_attr_series) + assert guarded_eval('data["a"]', context) == 1 + with pytest.raises(GuardRejection): + guarded_eval("data.a", context) + + +@dec.skip_without("pandas") +def test_pandas_dataframe_loc(): + import pandas as pd + from pandas.testing import assert_series_equal + + data = pd.DataFrame([{"a": 1}]) + context = limited(data=data) + assert_series_equal(guarded_eval('data.loc[:, "a"]', context), data["a"]) + + +def test_named_tuple(): + class GoodNamedTuple(NamedTuple): + a: str + pass + + class BadNamedTuple(NamedTuple): + a: str + + def __getitem__(self, key): + return None + + good = GoodNamedTuple(a="x") + bad = BadNamedTuple(a="x") + + context = limited(data=good) + assert guarded_eval("data[0]", context) == "x" + + context = limited(data=bad) + with pytest.raises(GuardRejection): + guarded_eval("data[0]", context) + + +def test_dict(): + context = limited(data={"a": 1, "b": {"x": 2}, ("x", "y"): 3}) + assert guarded_eval('data["a"]', context) == 1 + assert guarded_eval('data["b"]', context) == {"x": 2} + assert guarded_eval('data["b"]["x"]', context) == 2 + assert guarded_eval('data["x", "y"]', context) == 3 + + assert guarded_eval("data.keys", context) + + +def test_set(): + context = limited(data={"a", "b"}) + assert guarded_eval("data.difference", context) + + +def test_list(): + context = limited(data=[1, 2, 3]) + assert guarded_eval("data[1]", context) == 2 + assert guarded_eval("data.copy", context) + + +def test_dict_literal(): + context = limited() + assert guarded_eval("{}", context) == {} + assert guarded_eval('{"a": 1}', context) == {"a": 1} + + +def test_list_literal(): + context = limited() + assert guarded_eval("[]", context) == [] + assert guarded_eval('[1, "a"]', context) == [1, "a"] + + +def test_set_literal(): + context = limited() + assert guarded_eval("set()", context) == set() + assert guarded_eval('{"a"}', context) == {"a"} + + +def test_evaluates_if_expression(): + context = limited() + assert guarded_eval("2 if True else 3", context) == 2 + assert guarded_eval("4 if False else 5", context) == 5 + + +def test_object(): + obj = object() + context = limited(obj=obj) + assert guarded_eval("obj.__dir__", context) == obj.__dir__ + + +@pytest.mark.parametrize( + "code,expected", + [ + ["int.numerator", int.numerator], + ["float.is_integer", float.is_integer], + ["complex.real", complex.real], + ], +) +def test_number_attributes(code, expected): + assert guarded_eval(code, limited()) == expected + + +def test_method_descriptor(): + context = limited() + assert guarded_eval("list.copy.__name__", context) == "copy" + + +class HeapType: + pass + + +class CallCreatesHeapType: + def __call__(self) -> HeapType: + return HeapType() + + +class CallCreatesBuiltin: + def __call__(self) -> frozenset: + return frozenset() + + +@pytest.mark.parametrize( + "data,good,bad,expected, equality", + [ + [[1, 2, 3], "data.index(2)", "data.append(4)", 1, True], + [{"a": 1}, "data.keys().isdisjoint({})", "data.update()", True, True], + [CallCreatesHeapType(), "data()", "data.__class__()", HeapType, False], + [CallCreatesBuiltin(), "data()", "data.__class__()", frozenset, False], + ], +) +def test_evaluates_calls(data, good, bad, expected, equality): + context = limited(data=data) + value = guarded_eval(good, context) + if equality: + assert value == expected + else: + assert isinstance(value, expected) + + with pytest.raises(GuardRejection): + guarded_eval(bad, context) + + +@pytest.mark.parametrize( + "code,expected", + [ + ["(1\n+\n1)", 2], + ["list(range(10))[-1:]", [9]], + ["list(range(20))[3:-2:3]", [3, 6, 9, 12, 15]], + ], +) +@pytest.mark.parametrize("context", LIMITED_OR_HIGHER) +def test_evaluates_complex_cases(code, expected, context): + assert guarded_eval(code, context()) == expected + + +@pytest.mark.parametrize( + "code,expected", + [ + ["1", 1], + ["1.0", 1.0], + ["0xdeedbeef", 0xDEEDBEEF], + ["True", True], + ["None", None], + ["{}", {}], + ["[]", []], + ], +) +@pytest.mark.parametrize("context", MINIMAL_OR_HIGHER) +def test_evaluates_literals(code, expected, context): + assert guarded_eval(code, context()) == expected + + +@pytest.mark.parametrize( + "code,expected", + [ + ["-5", -5], + ["+5", +5], + ["~5", -6], + ], +) +@pytest.mark.parametrize("context", LIMITED_OR_HIGHER) +def test_evaluates_unary_operations(code, expected, context): + assert guarded_eval(code, context()) == expected + + +@pytest.mark.parametrize( + "code,expected", + [ + ["1 + 1", 2], + ["3 - 1", 2], + ["2 * 3", 6], + ["5 // 2", 2], + ["5 / 2", 2.5], + ["5**2", 25], + ["2 >> 1", 1], + ["2 << 1", 4], + ["1 | 2", 3], + ["1 & 1", 1], + ["1 & 2", 0], + ], +) +@pytest.mark.parametrize("context", LIMITED_OR_HIGHER) +def test_evaluates_binary_operations(code, expected, context): + assert guarded_eval(code, context()) == expected + + +@pytest.mark.parametrize( + "code,expected", + [ + ["2 > 1", True], + ["2 < 1", False], + ["2 <= 1", False], + ["2 <= 2", True], + ["1 >= 2", False], + ["2 >= 2", True], + ["2 == 2", True], + ["1 == 2", False], + ["1 != 2", True], + ["1 != 1", False], + ["1 < 4 < 3", False], + ["(1 < 4) < 3", True], + ["4 > 3 > 2 > 1", True], + ["4 > 3 > 2 > 9", False], + ["1 < 2 < 3 < 4", True], + ["9 < 2 < 3 < 4", False], + ["1 < 2 > 1 > 0 > -1 < 1", True], + ["1 in [1] in [[1]]", True], + ["1 in [1] in [[2]]", False], + ["1 in [1]", True], + ["0 in [1]", False], + ["1 not in [1]", False], + ["0 not in [1]", True], + ["True is True", True], + ["False is False", True], + ["True is False", False], + ["True is not True", False], + ["False is not True", True], + ], +) +@pytest.mark.parametrize("context", LIMITED_OR_HIGHER) +def test_evaluates_comparisons(code, expected, context): + assert guarded_eval(code, context()) == expected + + +def test_guards_comparisons(): + class GoodEq(int): + pass + + class BadEq(int): + def __eq__(self, other): + assert False + + context = limited(bad=BadEq(1), good=GoodEq(1)) + + with pytest.raises(GuardRejection): + guarded_eval("bad == 1", context) + + with pytest.raises(GuardRejection): + guarded_eval("bad != 1", context) + + with pytest.raises(GuardRejection): + guarded_eval("1 == bad", context) + + with pytest.raises(GuardRejection): + guarded_eval("1 != bad", context) + + assert guarded_eval("good == 1", context) is True + assert guarded_eval("good != 1", context) is False + assert guarded_eval("1 == good", context) is True + assert guarded_eval("1 != good", context) is False + + +def test_guards_unary_operations(): + class GoodOp(int): + pass + + class BadOpInv(int): + def __inv__(self, other): + assert False + + class BadOpInverse(int): + def __inv__(self, other): + assert False + + context = limited(good=GoodOp(1), bad1=BadOpInv(1), bad2=BadOpInverse(1)) + + with pytest.raises(GuardRejection): + guarded_eval("~bad1", context) + + with pytest.raises(GuardRejection): + guarded_eval("~bad2", context) + + +def test_guards_binary_operations(): + class GoodOp(int): + pass + + class BadOp(int): + def __add__(self, other): + assert False + + context = limited(good=GoodOp(1), bad=BadOp(1)) + + with pytest.raises(GuardRejection): + guarded_eval("1 + bad", context) + + with pytest.raises(GuardRejection): + guarded_eval("bad + 1", context) + + assert guarded_eval("good + 1", context) == 2 + assert guarded_eval("1 + good", context) == 2 + + +def test_guards_attributes(): + class GoodAttr(float): + pass + + class BadAttr1(float): + def __getattr__(self, key): + assert False + + class BadAttr2(float): + def __getattribute__(self, key): + assert False + + context = limited(good=GoodAttr(0.5), bad1=BadAttr1(0.5), bad2=BadAttr2(0.5)) + + with pytest.raises(GuardRejection): + guarded_eval("bad1.as_integer_ratio", context) + + with pytest.raises(GuardRejection): + guarded_eval("bad2.as_integer_ratio", context) + + assert guarded_eval("good.as_integer_ratio()", context) == (1, 2) + + +@pytest.mark.parametrize("context", MINIMAL_OR_HIGHER) +def test_access_builtins(context): + assert guarded_eval("round", context()) == round + + +def test_access_builtins_fails(): + context = limited() + with pytest.raises(NameError): + guarded_eval("this_is_not_builtin", context) + + +def test_rejects_forbidden(): + context = forbidden() + with pytest.raises(GuardRejection): + guarded_eval("1", context) + + +def test_guards_locals_and_globals(): + context = EvaluationContext( + locals={"local_a": "a"}, globals={"global_b": "b"}, evaluation="minimal" + ) + + with pytest.raises(GuardRejection): + guarded_eval("local_a", context) + + with pytest.raises(GuardRejection): + guarded_eval("global_b", context) + + +def test_access_locals_and_globals(): + context = EvaluationContext( + locals={"local_a": "a"}, globals={"global_b": "b"}, evaluation="limited" + ) + assert guarded_eval("local_a", context) == "a" + assert guarded_eval("global_b", context) == "b" + + +@pytest.mark.parametrize( + "code", + ["def func(): pass", "class C: pass", "x = 1", "x += 1", "del x", "import ast"], +) +@pytest.mark.parametrize("context", [minimal(), limited(), unsafe()]) +def test_rejects_side_effect_syntax(code, context): + with pytest.raises(SyntaxError): + guarded_eval(code, context) + + +def test_subscript(): + context = EvaluationContext( + locals={}, globals={}, evaluation="limited", in_subscript=True + ) + empty_slice = slice(None, None, None) + assert guarded_eval("", context) == tuple() + assert guarded_eval(":", context) == empty_slice + assert guarded_eval("1:2:3", context) == slice(1, 2, 3) + assert guarded_eval(':, "a"', context) == (empty_slice, "a") + + +def test_unbind_method(): + class X(list): + def index(self, k): + return "CUSTOM" + + x = X() + assert _unbind_method(x.index) is X.index + assert _unbind_method([].index) is list.index + assert _unbind_method(list.index) is None + + +def test_assumption_instance_attr_do_not_matter(): + """This is semi-specified in Python documentation. + + However, since the specification says 'not guaranteed + to work' rather than 'is forbidden to work', future + versions could invalidate this assumptions. This test + is meant to catch such a change if it ever comes true. + """ + + class T: + def __getitem__(self, k): + return "a" + + def __getattr__(self, k): + return "a" + + def f(self): + return "b" + + t = T() + t.__getitem__ = f + t.__getattr__ = f + assert t[1] == "a" + assert t[1] == "a" + + +def test_assumption_named_tuples_share_getitem(): + """Check assumption on named tuples sharing __getitem__""" + from typing import NamedTuple + + class A(NamedTuple): + pass + + class B(NamedTuple): + pass + + assert A.__getitem__ == B.__getitem__ + + +@dec.skip_without("numpy") +def test_module_access(): + import numpy + + context = limited(numpy=numpy) + assert guarded_eval("numpy.linalg.norm", context) == numpy.linalg.norm + + context = minimal(numpy=numpy) + with pytest.raises(GuardRejection): + guarded_eval("np.linalg.norm", context) diff --git a/shared/package-files/08/087f29bd2b448a869db75af398286341ab65e129b39b3f2f1f18df7c5dc8190c/blob b/shared/package-files/08/087f29bd2b448a869db75af398286341ab65e129b39b3f2f1f18df7c5dc8190c/blob new file mode 100644 index 0000000000000000000000000000000000000000..e63e5eb122f6e93169b0ce13982e69e777559629 --- /dev/null +++ b/shared/package-files/08/087f29bd2b448a869db75af398286341ab65e129b39b3f2f1f18df7c5dc8190c/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor special_scaled_modified_bessel_k0(const at::Tensor & x); +TORCH_API at::Tensor & special_scaled_modified_bessel_k0_out(at::Tensor & out, const at::Tensor & x); +TORCH_API at::Tensor & special_scaled_modified_bessel_k0_outf(const at::Tensor & x, at::Tensor & out); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/08/08811d886039522efb63296f01f62f90614d6a0a92a8060e8a5747724f16a3cd/blob b/shared/package-files/08/08811d886039522efb63296f01f62f90614d6a0a92a8060e8a5747724f16a3cd/blob new file mode 100644 index 0000000000000000000000000000000000000000..b4271e0c5ee50c533d86b50be243a8efa41c78a4 --- /dev/null +++ b/shared/package-files/08/08811d886039522efb63296f01f62f90614d6a0a92a8060e8a5747724f16a3cd/blob @@ -0,0 +1,218 @@ +# mypy: ignore-errors + +# noqa: F401, E501 +# This is an auto-generated file. Please do not modify it by hand. +# To re-generate, run: +# cd ~/pytorch && python +# torchgen/fuse_attention_patterns/gen_attention_patterns.py + +import torch +import torch._inductor + +aten = torch.ops.aten +prims = torch.ops.prims + +from torch._inductor.pattern_matcher import ( + Arg, + CallFunction, + CallFunctionVarArgs, + CallMethod, + CallMethodVarArgs, + CallModule, + CallModuleVarArgs, + ExclusiveKeywordArg, + Ignored, + KeywordArg, + ListOf, + MultiOutputPattern, + PatternExpr, + RepeatedExpr, + _TargetArgsExpr, + _TargetExpr, + _TargetExprVarArgs, +) +permute_default = CallFunction(aten.permute.default, KeywordArg('query'), Ignored()) +expand_default = CallFunction(aten.expand.default, permute_default, Ignored()) +clone_default = CallFunction(aten.clone.default, expand_default, memory_format=torch.contiguous_format) +view_default = CallFunction(aten.view.default, clone_default, Ignored(), _users=2) +permute_default_1 = CallFunction(aten.permute.default, KeywordArg('key'), Ignored()) +permute_default_2 = CallFunction(aten.permute.default, permute_default_1, Ignored()) +expand_default_1 = CallFunction(aten.expand.default, permute_default_2, Ignored()) +clone_default_1 = CallFunction(aten.clone.default, expand_default_1, memory_format=torch.contiguous_format) +view_default_1 = CallFunction(aten.view.default, clone_default_1, Ignored(), _users=2) +bmm_default = CallFunction(aten.bmm.default, view_default, view_default_1) +view_default_2 = CallFunction(aten.view.default, bmm_default, Ignored()) +div_Tensor = CallFunction(aten.div.Tensor, view_default_2, KeywordArg('inv_scale')) +add_Tensor = CallFunction(aten.add.Tensor, div_Tensor, KeywordArg('attn_mask'), _users=2) +amax_default = CallFunction(aten.amax.default, add_Tensor, Ignored(), True) +sub_Tensor = CallFunction(aten.sub.Tensor, add_Tensor, amax_default) +exp_default = CallFunction(aten.exp.default, sub_Tensor, _users=2) +sum_dim_IntList = CallFunction(aten.sum.dim_IntList, exp_default, Ignored(), True) +div_Tensor_1 = CallFunction(aten.div.Tensor, exp_default, sum_dim_IntList, _users=2) +expand_default_2 = CallFunction(aten.expand.default, div_Tensor_1, Ignored()) +view_default_3 = CallFunction(aten.view.default, expand_default_2, Ignored(), _users=2) +permute_default_3 = CallFunction(aten.permute.default, KeywordArg('value'), Ignored()) +expand_default_3 = CallFunction(aten.expand.default, permute_default_3, Ignored()) +clone_default_2 = CallFunction(aten.clone.default, expand_default_3, memory_format=torch.contiguous_format) +view_default_4 = CallFunction(aten.view.default, clone_default_2, Ignored(), _users=2) +bmm_default_1 = CallFunction(aten.bmm.default, view_default_3, view_default_4) +view_default_5 = CallFunction(aten.view.default, bmm_default_1, Ignored()) +view_default_6 = CallFunction(aten.view.default, KeywordArg('tangents_1'), Ignored(), _users=2) +permute_default_4 = CallFunction(aten.permute.default, view_default_4, Ignored()) +bmm_default_2 = CallFunction(aten.bmm.default, view_default_6, permute_default_4) +view_default_7 = CallFunction(aten.view.default, bmm_default_2, Ignored()) +alias_default = CallFunction(aten.alias.default, div_Tensor_1) +alias_default_1 = CallFunction(aten.alias.default, alias_default) +alias_default_2 = CallFunction(aten.alias.default, alias_default_1) +alias_default_3 = CallFunction(aten.alias.default, alias_default_2, _users=2) +mul_Tensor = CallFunction(aten.mul.Tensor, view_default_7, alias_default_3, _users=2) +sum_dim_IntList_1 = CallFunction(aten.sum.dim_IntList, mul_Tensor, Ignored(), True) +mul_Tensor_1 = CallFunction(aten.mul.Tensor, alias_default_3, sum_dim_IntList_1) +sub_Tensor_1 = CallFunction(aten.sub.Tensor, mul_Tensor, mul_Tensor_1) +div_Tensor_2 = CallFunction(aten.div.Tensor, sub_Tensor_1, KeywordArg('inv_scale')) +view_default_8 = CallFunction(aten.view.default, div_Tensor_2, Ignored(), _users=2) +permute_default_5 = CallFunction(aten.permute.default, view_default_1, Ignored()) +bmm_default_3 = CallFunction(aten.bmm.default, view_default_8, permute_default_5) +view_default_9 = CallFunction(aten.view.default, bmm_default_3, Ignored()) +permute_default_6 = CallFunction(aten.permute.default, view_default_9, Ignored()) +permute_default_7 = CallFunction(aten.permute.default, view_default, Ignored()) +bmm_default_4 = CallFunction(aten.bmm.default, permute_default_7, view_default_8) +view_default_10 = CallFunction(aten.view.default, bmm_default_4, Ignored()) +permute_default_8 = CallFunction(aten.permute.default, view_default_10, Ignored()) +permute_default_9 = CallFunction(aten.permute.default, permute_default_8, Ignored()) +permute_default_10 = CallFunction(aten.permute.default, view_default_3, Ignored()) +bmm_default_5 = CallFunction(aten.bmm.default, permute_default_10, view_default_6) +view_default_11 = CallFunction(aten.view.default, bmm_default_5, Ignored()) +permute_default_11 = CallFunction(aten.permute.default, view_default_11, Ignored()) +_sfdp_pattern_14_training = MultiOutputPattern([view_default_5, + permute_default_6, + permute_default_9, + permute_default_11, + None, + None +]) + + +permute_default = CallFunction(aten.permute.default, KeywordArg('query'), Ignored()) +expand_default = CallFunction(aten.expand.default, permute_default, Ignored()) +clone_default = CallFunction(aten.clone.default, expand_default, memory_format=torch.contiguous_format) +view_default = CallFunction(aten.view.default, clone_default, Ignored()) +permute_default_1 = CallFunction(aten.permute.default, KeywordArg('key'), Ignored()) +permute_default_2 = CallFunction(aten.permute.default, permute_default_1, Ignored()) +expand_default_1 = CallFunction(aten.expand.default, permute_default_2, Ignored()) +clone_default_1 = CallFunction(aten.clone.default, expand_default_1, memory_format=torch.contiguous_format) +view_default_1 = CallFunction(aten.view.default, clone_default_1, Ignored()) +bmm_default = CallFunction(aten.bmm.default, view_default, view_default_1) +view_default_2 = CallFunction(aten.view.default, bmm_default, Ignored()) +div_Tensor = CallFunction(aten.div.Tensor, view_default_2, KeywordArg('inv_scale')) +add_Tensor = CallFunction(aten.add.Tensor, div_Tensor, KeywordArg('attn_mask'), _users=2) +amax_default = CallFunction(aten.amax.default, add_Tensor, Ignored(), True) +sub_Tensor = CallFunction(aten.sub.Tensor, add_Tensor, amax_default) +exp_default = CallFunction(aten.exp.default, sub_Tensor, _users=2) +sum_dim_IntList = CallFunction(aten.sum.dim_IntList, exp_default, Ignored(), True) +div_Tensor_1 = CallFunction(aten.div.Tensor, exp_default, sum_dim_IntList) +expand_default_2 = CallFunction(aten.expand.default, div_Tensor_1, Ignored()) +view_default_3 = CallFunction(aten.view.default, expand_default_2, Ignored()) +permute_default_3 = CallFunction(aten.permute.default, KeywordArg('value'), Ignored()) +expand_default_3 = CallFunction(aten.expand.default, permute_default_3, Ignored()) +clone_default_2 = CallFunction(aten.clone.default, expand_default_3, memory_format=torch.contiguous_format) +view_default_4 = CallFunction(aten.view.default, clone_default_2, Ignored()) +bmm_default_1 = CallFunction(aten.bmm.default, view_default_3, view_default_4) +_sfdp_pattern_14_inference = CallFunction(aten.view.default, bmm_default_1, Ignored()) + + +permute_default = CallFunction(aten.permute.default, KeywordArg('query'), Ignored()) +expand_default = CallFunction(aten.expand.default, permute_default, Ignored()) +clone_default = CallFunction(aten.clone.default, expand_default, memory_format=torch.contiguous_format) +view_default = CallFunction(aten.view.default, clone_default, Ignored(), _users=2) +permute_default_1 = CallFunction(aten.permute.default, KeywordArg('key'), Ignored()) +permute_default_2 = CallFunction(aten.permute.default, permute_default_1, Ignored()) +expand_default_1 = CallFunction(aten.expand.default, permute_default_2, Ignored()) +clone_default_1 = CallFunction(aten.clone.default, expand_default_1, memory_format=torch.contiguous_format) +view_default_1 = CallFunction(aten.view.default, clone_default_1, Ignored(), _users=2) +bmm_default = CallFunction(aten.bmm.default, view_default, view_default_1) +view_default_2 = CallFunction(aten.view.default, bmm_default, Ignored()) +div_Tensor = CallFunction(aten.div.Tensor, view_default_2, KeywordArg('inv_scale')) +add_Tensor = CallFunction(aten.add.Tensor, div_Tensor, KeywordArg('attn_mask')) +convert_element_type_default = CallFunction(prims.convert_element_type.default, add_Tensor, Ignored(), _users=2) +amax_default = CallFunction(aten.amax.default, convert_element_type_default, Ignored(), True) +sub_Tensor = CallFunction(aten.sub.Tensor, convert_element_type_default, amax_default) +exp_default = CallFunction(aten.exp.default, sub_Tensor, _users=2) +sum_dim_IntList = CallFunction(aten.sum.dim_IntList, exp_default, Ignored(), True) +div_Tensor_1 = CallFunction(aten.div.Tensor, exp_default, sum_dim_IntList) +convert_element_type_default_1 = CallFunction(prims.convert_element_type.default, div_Tensor_1, Ignored(), _users=2) +expand_default_2 = CallFunction(aten.expand.default, convert_element_type_default_1, Ignored()) +view_default_3 = CallFunction(aten.view.default, expand_default_2, Ignored(), _users=2) +permute_default_3 = CallFunction(aten.permute.default, KeywordArg('value'), Ignored()) +expand_default_3 = CallFunction(aten.expand.default, permute_default_3, Ignored()) +clone_default_2 = CallFunction(aten.clone.default, expand_default_3, memory_format=torch.contiguous_format) +view_default_4 = CallFunction(aten.view.default, clone_default_2, Ignored(), _users=2) +bmm_default_1 = CallFunction(aten.bmm.default, view_default_3, view_default_4) +view_default_5 = CallFunction(aten.view.default, bmm_default_1, Ignored()) +view_default_6 = CallFunction(aten.view.default, KeywordArg('tangents_1'), Ignored(), _users=2) +permute_default_4 = CallFunction(aten.permute.default, view_default_4, Ignored()) +bmm_default_2 = CallFunction(aten.bmm.default, view_default_6, permute_default_4) +view_default_7 = CallFunction(aten.view.default, bmm_default_2, Ignored()) +convert_element_type_default_2 = CallFunction(prims.convert_element_type.default, view_default_7, Ignored()) +alias_default = CallFunction(aten.alias.default, convert_element_type_default_1) +alias_default_1 = CallFunction(aten.alias.default, alias_default) +alias_default_2 = CallFunction(aten.alias.default, alias_default_1) +alias_default_3 = CallFunction(aten.alias.default, alias_default_2) +convert_element_type_default_3 = CallFunction(prims.convert_element_type.default, alias_default_3, Ignored(), _users=2) +mul_Tensor = CallFunction(aten.mul.Tensor, convert_element_type_default_2, convert_element_type_default_3, _users=2) +sum_dim_IntList_1 = CallFunction(aten.sum.dim_IntList, mul_Tensor, Ignored(), True) +mul_Tensor_1 = CallFunction(aten.mul.Tensor, convert_element_type_default_3, sum_dim_IntList_1) +sub_Tensor_1 = CallFunction(aten.sub.Tensor, mul_Tensor, mul_Tensor_1) +convert_element_type_default_4 = CallFunction(prims.convert_element_type.default, sub_Tensor_1, Ignored()) +div_Tensor_2 = CallFunction(aten.div.Tensor, convert_element_type_default_4, KeywordArg('inv_scale')) +view_default_8 = CallFunction(aten.view.default, div_Tensor_2, Ignored(), _users=2) +permute_default_5 = CallFunction(aten.permute.default, view_default_1, Ignored()) +bmm_default_3 = CallFunction(aten.bmm.default, view_default_8, permute_default_5) +view_default_9 = CallFunction(aten.view.default, bmm_default_3, Ignored()) +permute_default_6 = CallFunction(aten.permute.default, view_default_9, Ignored()) +permute_default_7 = CallFunction(aten.permute.default, view_default, Ignored()) +bmm_default_4 = CallFunction(aten.bmm.default, permute_default_7, view_default_8) +view_default_10 = CallFunction(aten.view.default, bmm_default_4, Ignored()) +permute_default_8 = CallFunction(aten.permute.default, view_default_10, Ignored()) +permute_default_9 = CallFunction(aten.permute.default, permute_default_8, Ignored()) +permute_default_10 = CallFunction(aten.permute.default, view_default_3, Ignored()) +bmm_default_5 = CallFunction(aten.bmm.default, permute_default_10, view_default_6) +view_default_11 = CallFunction(aten.view.default, bmm_default_5, Ignored()) +permute_default_11 = CallFunction(aten.permute.default, view_default_11, Ignored()) +_sfdp_pattern_14_half_training = MultiOutputPattern([view_default_5, + permute_default_6, + permute_default_9, + permute_default_11, + None, + None +]) + + +permute_default = CallFunction(aten.permute.default, KeywordArg('query'), Ignored()) +expand_default = CallFunction(aten.expand.default, permute_default, Ignored()) +clone_default = CallFunction(aten.clone.default, expand_default, memory_format=torch.contiguous_format) +view_default = CallFunction(aten.view.default, clone_default, Ignored()) +permute_default_1 = CallFunction(aten.permute.default, KeywordArg('key'), Ignored()) +permute_default_2 = CallFunction(aten.permute.default, permute_default_1, Ignored()) +expand_default_1 = CallFunction(aten.expand.default, permute_default_2, Ignored()) +clone_default_1 = CallFunction(aten.clone.default, expand_default_1, memory_format=torch.contiguous_format) +view_default_1 = CallFunction(aten.view.default, clone_default_1, Ignored()) +bmm_default = CallFunction(aten.bmm.default, view_default, view_default_1) +view_default_2 = CallFunction(aten.view.default, bmm_default, Ignored()) +div_Tensor = CallFunction(aten.div.Tensor, view_default_2, KeywordArg('inv_scale')) +add_Tensor = CallFunction(aten.add.Tensor, div_Tensor, KeywordArg('attn_mask')) +convert_element_type_default = CallFunction(prims.convert_element_type.default, add_Tensor, Ignored(), _users=2) +amax_default = CallFunction(aten.amax.default, convert_element_type_default, Ignored(), True) +sub_Tensor = CallFunction(aten.sub.Tensor, convert_element_type_default, amax_default) +exp_default = CallFunction(aten.exp.default, sub_Tensor, _users=2) +sum_dim_IntList = CallFunction(aten.sum.dim_IntList, exp_default, Ignored(), True) +div_Tensor_1 = CallFunction(aten.div.Tensor, exp_default, sum_dim_IntList) +convert_element_type_default_1 = CallFunction(prims.convert_element_type.default, div_Tensor_1, Ignored()) +expand_default_2 = CallFunction(aten.expand.default, convert_element_type_default_1, Ignored()) +view_default_3 = CallFunction(aten.view.default, expand_default_2, Ignored()) +permute_default_3 = CallFunction(aten.permute.default, KeywordArg('value'), Ignored()) +expand_default_3 = CallFunction(aten.expand.default, permute_default_3, Ignored()) +clone_default_2 = CallFunction(aten.clone.default, expand_default_3, memory_format=torch.contiguous_format) +view_default_4 = CallFunction(aten.view.default, clone_default_2, Ignored()) +bmm_default_1 = CallFunction(aten.bmm.default, view_default_3, view_default_4) +_sfdp_pattern_14_half_inference = CallFunction(aten.view.default, bmm_default_1, Ignored()) diff --git a/shared/package-files/08/088221112d40daa0dc7aefcd59b4379d2a45816d1f91c1a7c930265b219b1f18/blob b/shared/package-files/08/088221112d40daa0dc7aefcd59b4379d2a45816d1f91c1a7c930265b219b1f18/blob new file mode 100644 index 0000000000000000000000000000000000000000..4eb86cde18ee3475bbe1bf528bc6dfa0ce8e50ae --- /dev/null +++ b/shared/package-files/08/088221112d40daa0dc7aefcd59b4379d2a45816d1f91c1a7c930265b219b1f18/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor linalg_eigvalsh(const at::Tensor & self, c10::string_view UPLO="L"); +TORCH_API at::Tensor & linalg_eigvalsh_out(const at::Tensor & self, c10::string_view UPLO, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/08/088314a96b60ee829638709665cf7de2600483d53af2c54b29af91e661bae4a4/blob b/shared/package-files/08/088314a96b60ee829638709665cf7de2600483d53af2c54b29af91e661bae4a4/blob new file mode 100644 index 0000000000000000000000000000000000000000..691559ca60fe92a39e770cdb5d16c42a4c5651e1 --- /dev/null +++ b/shared/package-files/08/088314a96b60ee829638709665cf7de2600483d53af2c54b29af91e661bae4a4/blob @@ -0,0 +1,3 @@ +from statsmodels.tools._test_runner import PytestTester + +test = PytestTester() diff --git a/shared/package-files/08/0883dc6bfa93c4bf73e68683d9ed8dae0304d1e550805f4f69b66775c56a1d93/blob b/shared/package-files/08/0883dc6bfa93c4bf73e68683d9ed8dae0304d1e550805f4f69b66775c56a1d93/blob new file mode 100644 index 0000000000000000000000000000000000000000..6ac7fba7d364bf599e928ccf591b5bef096576d0 --- /dev/null +++ b/shared/package-files/08/0883dc6bfa93c4bf73e68683d9ed8dae0304d1e550805f4f69b66775c56a1d93/blob @@ -0,0 +1,392 @@ +from sympy.core import S, Pow +from sympy.core.function import (Derivative, AppliedUndef, diff) +from sympy.core.relational import Equality, Eq +from sympy.core.symbol import Dummy +from sympy.core.sympify import sympify + +from sympy.logic.boolalg import BooleanAtom +from sympy.functions import exp +from sympy.series import Order +from sympy.simplify.simplify import simplify, posify, besselsimp +from sympy.simplify.trigsimp import trigsimp +from sympy.simplify.sqrtdenest import sqrtdenest +from sympy.solvers import solve +from sympy.solvers.deutils import _preprocess, ode_order +from sympy.utilities.iterables import iterable, is_sequence + + +def sub_func_doit(eq, func, new): + r""" + When replacing the func with something else, we usually want the + derivative evaluated, so this function helps in making that happen. + + Examples + ======== + + >>> from sympy import Derivative, symbols, Function + >>> from sympy.solvers.ode.subscheck import sub_func_doit + >>> x, z = symbols('x, z') + >>> y = Function('y') + + >>> sub_func_doit(3*Derivative(y(x), x) - 1, y(x), x) + 2 + + >>> sub_func_doit(x*Derivative(y(x), x) - y(x)**2 + y(x), y(x), + ... 1/(x*(z + 1/x))) + x*(-1/(x**2*(z + 1/x)) + 1/(x**3*(z + 1/x)**2)) + 1/(x*(z + 1/x)) + ...- 1/(x**2*(z + 1/x)**2) + """ + reps= {func: new} + for d in eq.atoms(Derivative): + if d.expr == func: + reps[d] = new.diff(*d.variable_count) + else: + reps[d] = d.xreplace({func: new}).doit(deep=False) + return eq.xreplace(reps) + + +def checkodesol(ode, sol, func=None, order='auto', solve_for_func=True): + r""" + Substitutes ``sol`` into ``ode`` and checks that the result is ``0``. + + This works when ``func`` is one function, like `f(x)` or a list of + functions like `[f(x), g(x)]` when `ode` is a system of ODEs. ``sol`` can + be a single solution or a list of solutions. Each solution may be an + :py:class:`~sympy.core.relational.Equality` that the solution satisfies, + e.g. ``Eq(f(x), C1), Eq(f(x) + C1, 0)``; or simply an + :py:class:`~sympy.core.expr.Expr`, e.g. ``f(x) - C1``. In most cases it + will not be necessary to explicitly identify the function, but if the + function cannot be inferred from the original equation it can be supplied + through the ``func`` argument. + + If a sequence of solutions is passed, the same sort of container will be + used to return the result for each solution. + + It tries the following methods, in order, until it finds zero equivalence: + + 1. Substitute the solution for `f` in the original equation. This only + works if ``ode`` is solved for `f`. It will attempt to solve it first + unless ``solve_for_func == False``. + 2. Take `n` derivatives of the solution, where `n` is the order of + ``ode``, and check to see if that is equal to the solution. This only + works on exact ODEs. + 3. Take the 1st, 2nd, ..., `n`\th derivatives of the solution, each time + solving for the derivative of `f` of that order (this will always be + possible because `f` is a linear operator). Then back substitute each + derivative into ``ode`` in reverse order. + + This function returns a tuple. The first item in the tuple is ``True`` if + the substitution results in ``0``, and ``False`` otherwise. The second + item in the tuple is what the substitution results in. It should always + be ``0`` if the first item is ``True``. Sometimes this function will + return ``False`` even when an expression is identically equal to ``0``. + This happens when :py:meth:`~sympy.simplify.simplify.simplify` does not + reduce the expression to ``0``. If an expression returned by this + function vanishes identically, then ``sol`` really is a solution to + the ``ode``. + + If this function seems to hang, it is probably because of a hard + simplification. + + To use this function to test, test the first item of the tuple. + + Examples + ======== + + >>> from sympy import (Eq, Function, checkodesol, symbols, + ... Derivative, exp) + >>> x, C1, C2 = symbols('x,C1,C2') + >>> f, g = symbols('f g', cls=Function) + >>> checkodesol(f(x).diff(x), Eq(f(x), C1)) + (True, 0) + >>> assert checkodesol(f(x).diff(x), C1)[0] + >>> assert not checkodesol(f(x).diff(x), x)[0] + >>> checkodesol(f(x).diff(x, 2), x**2) + (False, 2) + + >>> eqs = [Eq(Derivative(f(x), x), f(x)), Eq(Derivative(g(x), x), g(x))] + >>> sol = [Eq(f(x), C1*exp(x)), Eq(g(x), C2*exp(x))] + >>> checkodesol(eqs, sol) + (True, [0, 0]) + + """ + if iterable(ode): + return checksysodesol(ode, sol, func=func) + + if not isinstance(ode, Equality): + ode = Eq(ode, 0) + if func is None: + try: + _, func = _preprocess(ode.lhs) + except ValueError: + funcs = [s.atoms(AppliedUndef) for s in ( + sol if is_sequence(sol, set) else [sol])] + funcs = set().union(*funcs) + if len(funcs) != 1: + raise ValueError( + 'must pass func arg to checkodesol for this case.') + func = funcs.pop() + if not isinstance(func, AppliedUndef) or len(func.args) != 1: + raise ValueError( + "func must be a function of one variable, not %s" % func) + if is_sequence(sol, set): + return type(sol)([checkodesol(ode, i, order=order, solve_for_func=solve_for_func) for i in sol]) + + if not isinstance(sol, Equality): + sol = Eq(func, sol) + elif sol.rhs == func: + sol = sol.reversed + + if order == 'auto': + order = ode_order(ode, func) + solved = sol.lhs == func and not sol.rhs.has(func) + if solve_for_func and not solved: + rhs = solve(sol, func) + if rhs: + eqs = [Eq(func, t) for t in rhs] + if len(rhs) == 1: + eqs = eqs[0] + return checkodesol(ode, eqs, order=order, + solve_for_func=False) + + x = func.args[0] + + # Handle series solutions here + if sol.has(Order): + assert sol.lhs == func + Oterm = sol.rhs.getO() + solrhs = sol.rhs.removeO() + + Oexpr = Oterm.expr + assert isinstance(Oexpr, Pow) + sorder = Oexpr.exp + assert Oterm == Order(x**sorder) + + odesubs = (ode.lhs-ode.rhs).subs(func, solrhs).doit().expand() + + neworder = Order(x**(sorder - order)) + odesubs = odesubs + neworder + assert odesubs.getO() == neworder + residual = odesubs.removeO() + + return (residual == 0, residual) + + s = True + testnum = 0 + while s: + if testnum == 0: + # First pass, try substituting a solved solution directly into the + # ODE. This has the highest chance of succeeding. + ode_diff = ode.lhs - ode.rhs + + if sol.lhs == func: + s = sub_func_doit(ode_diff, func, sol.rhs) + s = besselsimp(s) + else: + testnum += 1 + continue + ss = simplify(s.rewrite(exp)) + if ss: + # with the new numer_denom in power.py, if we do a simple + # expansion then testnum == 0 verifies all solutions. + s = ss.expand(force=True) + else: + s = 0 + testnum += 1 + elif testnum == 1: + # Second pass. If we cannot substitute f, try seeing if the nth + # derivative is equal, this will only work for odes that are exact, + # by definition. + s = simplify( + trigsimp(diff(sol.lhs, x, order) - diff(sol.rhs, x, order)) - + trigsimp(ode.lhs) + trigsimp(ode.rhs)) + # s2 = simplify( + # diff(sol.lhs, x, order) - diff(sol.rhs, x, order) - \ + # ode.lhs + ode.rhs) + testnum += 1 + elif testnum == 2: + # Third pass. Try solving for df/dx and substituting that into the + # ODE. Thanks to Chris Smith for suggesting this method. Many of + # the comments below are his, too. + # The method: + # - Take each of 1..n derivatives of the solution. + # - Solve each nth derivative for d^(n)f/dx^(n) + # (the differential of that order) + # - Back substitute into the ODE in decreasing order + # (i.e., n, n-1, ...) + # - Check the result for zero equivalence + if sol.lhs == func and not sol.rhs.has(func): + diffsols = {0: sol.rhs} + elif sol.rhs == func and not sol.lhs.has(func): + diffsols = {0: sol.lhs} + else: + diffsols = {} + sol = sol.lhs - sol.rhs + for i in range(1, order + 1): + # Differentiation is a linear operator, so there should always + # be 1 solution. Nonetheless, we test just to make sure. + # We only need to solve once. After that, we automatically + # have the solution to the differential in the order we want. + if i == 1: + ds = sol.diff(x) + try: + sdf = solve(ds, func.diff(x, i)) + if not sdf: + raise NotImplementedError + except NotImplementedError: + testnum += 1 + break + else: + diffsols[i] = sdf[0] + else: + # This is what the solution says df/dx should be. + diffsols[i] = diffsols[i - 1].diff(x) + + # Make sure the above didn't fail. + if testnum > 2: + continue + else: + # Substitute it into ODE to check for self consistency. + lhs, rhs = ode.lhs, ode.rhs + for i in range(order, -1, -1): + if i == 0 and 0 not in diffsols: + # We can only substitute f(x) if the solution was + # solved for f(x). + break + lhs = sub_func_doit(lhs, func.diff(x, i), diffsols[i]) + rhs = sub_func_doit(rhs, func.diff(x, i), diffsols[i]) + ode_or_bool = Eq(lhs, rhs) + ode_or_bool = simplify(ode_or_bool) + + if isinstance(ode_or_bool, (bool, BooleanAtom)): + if ode_or_bool: + lhs = rhs = S.Zero + else: + lhs = ode_or_bool.lhs + rhs = ode_or_bool.rhs + # No sense in overworking simplify -- just prove that the + # numerator goes to zero + num = trigsimp((lhs - rhs).as_numer_denom()[0]) + # since solutions are obtained using force=True we test + # using the same level of assumptions + ## replace function with dummy so assumptions will work + _func = Dummy('func') + num = num.subs(func, _func) + ## posify the expression + num, reps = posify(num) + s = simplify(num).xreplace(reps).xreplace({_func: func}) + testnum += 1 + else: + break + + if not s: + return (True, s) + elif s is True: # The code above never was able to change s + raise NotImplementedError("Unable to test if " + str(sol) + + " is a solution to " + str(ode) + ".") + else: + return (False, s) + + +def checksysodesol(eqs, sols, func=None): + r""" + Substitutes corresponding ``sols`` for each functions into each ``eqs`` and + checks that the result of substitutions for each equation is ``0``. The + equations and solutions passed can be any iterable. + + This only works when each ``sols`` have one function only, like `x(t)` or `y(t)`. + For each function, ``sols`` can have a single solution or a list of solutions. + In most cases it will not be necessary to explicitly identify the function, + but if the function cannot be inferred from the original equation it + can be supplied through the ``func`` argument. + + When a sequence of equations is passed, the same sequence is used to return + the result for each equation with each function substituted with corresponding + solutions. + + It tries the following method to find zero equivalence for each equation: + + Substitute the solutions for functions, like `x(t)` and `y(t)` into the + original equations containing those functions. + This function returns a tuple. The first item in the tuple is ``True`` if + the substitution results for each equation is ``0``, and ``False`` otherwise. + The second item in the tuple is what the substitution results in. Each element + of the ``list`` should always be ``0`` corresponding to each equation if the + first item is ``True``. Note that sometimes this function may return ``False``, + but with an expression that is identically equal to ``0``, instead of returning + ``True``. This is because :py:meth:`~sympy.simplify.simplify.simplify` cannot + reduce the expression to ``0``. If an expression returned by each function + vanishes identically, then ``sols`` really is a solution to ``eqs``. + + If this function seems to hang, it is probably because of a difficult simplification. + + Examples + ======== + + >>> from sympy import Eq, diff, symbols, sin, cos, exp, sqrt, S, Function + >>> from sympy.solvers.ode.subscheck import checksysodesol + >>> C1, C2 = symbols('C1:3') + >>> t = symbols('t') + >>> x, y = symbols('x, y', cls=Function) + >>> eq = (Eq(diff(x(t),t), x(t) + y(t) + 17), Eq(diff(y(t),t), -2*x(t) + y(t) + 12)) + >>> sol = [Eq(x(t), (C1*sin(sqrt(2)*t) + C2*cos(sqrt(2)*t))*exp(t) - S(5)/3), + ... Eq(y(t), (sqrt(2)*C1*cos(sqrt(2)*t) - sqrt(2)*C2*sin(sqrt(2)*t))*exp(t) - S(46)/3)] + >>> checksysodesol(eq, sol) + (True, [0, 0]) + >>> eq = (Eq(diff(x(t),t),x(t)*y(t)**4), Eq(diff(y(t),t),y(t)**3)) + >>> sol = [Eq(x(t), C1*exp(-1/(4*(C2 + t)))), Eq(y(t), -sqrt(2)*sqrt(-1/(C2 + t))/2), + ... Eq(x(t), C1*exp(-1/(4*(C2 + t)))), Eq(y(t), sqrt(2)*sqrt(-1/(C2 + t))/2)] + >>> checksysodesol(eq, sol) + (True, [0, 0]) + + """ + def _sympify(eq): + return list(map(sympify, eq if iterable(eq) else [eq])) + eqs = _sympify(eqs) + for i in range(len(eqs)): + if isinstance(eqs[i], Equality): + eqs[i] = eqs[i].lhs - eqs[i].rhs + if func is None: + funcs = [] + for eq in eqs: + derivs = eq.atoms(Derivative) + func = set().union(*[d.atoms(AppliedUndef) for d in derivs]) + funcs.extend(func) + funcs = list(set(funcs)) + if not all(isinstance(func, AppliedUndef) and len(func.args) == 1 for func in funcs)\ + and len({func.args for func in funcs})!=1: + raise ValueError("func must be a function of one variable, not %s" % func) + for sol in sols: + if len(sol.atoms(AppliedUndef)) != 1: + raise ValueError("solutions should have one function only") + if len(funcs) != len({sol.lhs for sol in sols}): + raise ValueError("number of solutions provided does not match the number of equations") + dictsol = {} + for sol in sols: + func = list(sol.atoms(AppliedUndef))[0] + if sol.rhs == func: + sol = sol.reversed + solved = sol.lhs == func and not sol.rhs.has(func) + if not solved: + rhs = solve(sol, func) + if not rhs: + raise NotImplementedError + else: + rhs = sol.rhs + dictsol[func] = rhs + checkeq = [] + for eq in eqs: + for func in funcs: + eq = sub_func_doit(eq, func, dictsol[func]) + ss = simplify(eq) + if ss != 0: + eq = ss.expand(force=True) + if eq != 0: + eq = sqrtdenest(eq).simplify() + else: + eq = 0 + checkeq.append(eq) + if len(set(checkeq)) == 1 and list(set(checkeq))[0] == 0: + return (True, checkeq) + else: + return (False, checkeq) diff --git a/shared/package-files/08/0884d9999154169e3430ad8ecfcb48f1aed64680a2cd053d678275ef66167d6c/blob b/shared/package-files/08/0884d9999154169e3430ad8ecfcb48f1aed64680a2cd053d678275ef66167d6c/blob new file mode 100644 index 0000000000000000000000000000000000000000..c2a1cab9a5ebb7eee134f7c15133954d5ea9f878 --- /dev/null +++ b/shared/package-files/08/0884d9999154169e3430ad8ecfcb48f1aed64680a2cd053d678275ef66167d6c/blob @@ -0,0 +1,30 @@ +# Seaborn common parameters +# .15 = dark_gray +# .8 = light_gray +figure.facecolor: white +text.color: .15 +axes.labelcolor: .15 +legend.frameon: False +legend.numpoints: 1 +legend.scatterpoints: 1 +xtick.direction: out +ytick.direction: out +xtick.color: .15 +ytick.color: .15 +axes.axisbelow: True +image.cmap: Greys +font.family: sans-serif +font.sans-serif: Arial, Liberation Sans, DejaVu Sans, Bitstream Vera Sans, sans-serif +grid.linestyle: - +lines.solid_capstyle: round + +# Seaborn white parameters +axes.grid: False +axes.facecolor: white +axes.edgecolor: .15 +axes.linewidth: 1.25 +grid.color: .8 +xtick.major.size: 6 +ytick.major.size: 6 +xtick.minor.size: 3 +ytick.minor.size: 3 diff --git a/shared/package-files/08/08879f4a4a4dd1d76913bbea6e59db37e743f9236c94f665b851b4030e42620c/blob b/shared/package-files/08/08879f4a4a4dd1d76913bbea6e59db37e743f9236c94f665b851b4030e42620c/blob new file mode 100644 index 0000000000000000000000000000000000000000..45df9288b586c35a04528c38cec7478a5c50df61 --- /dev/null +++ b/shared/package-files/08/08879f4a4a4dd1d76913bbea6e59db37e743f9236c94f665b851b4030e42620c/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor _to_sparse_csc(const at::Tensor & self, c10::optional dense_dim=c10::nullopt); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/08/088c88d23d01bb1bf44200af346daeae368aa68219f9935ac02da6e8dcc695ba/blob b/shared/package-files/08/088c88d23d01bb1bf44200af346daeae368aa68219f9935ac02da6e8dcc695ba/blob new file mode 100644 index 0000000000000000000000000000000000000000..95f52bfbd260914c429cbf0ca57f1ff4b03cbb1d --- /dev/null +++ b/shared/package-files/08/088c88d23d01bb1bf44200af346daeae368aa68219f9935ac02da6e8dcc695ba/blob @@ -0,0 +1,13 @@ +import numpy as np +import numpy.typing as npt + +DTYPE_i8: np.dtype[np.int64] + +np.mintypecode(DTYPE_i8) # E: incompatible type +np.iscomplexobj(DTYPE_i8) # E: incompatible type +np.isrealobj(DTYPE_i8) # E: incompatible type + +np.typename(DTYPE_i8) # E: No overload variant +np.typename("invalid") # E: No overload variant + +np.common_type(np.timedelta64()) # E: incompatible type diff --git a/shared/package-files/08/0896100ee277cb6b6f25c5ed03b32246387133fdd354f9a756e030738b30bad5/blob b/shared/package-files/08/0896100ee277cb6b6f25c5ed03b32246387133fdd354f9a756e030738b30bad5/blob new file mode 100644 index 0000000000000000000000000000000000000000..6e0b4dec8808e4052cc11f4d927cbffdccaf25be --- /dev/null +++ b/shared/package-files/08/0896100ee277cb6b6f25c5ed03b32246387133fdd354f9a756e030738b30bad5/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor erfc(const at::Tensor & self); +TORCH_API at::Tensor & erfc_out(at::Tensor & out, const at::Tensor & self); +TORCH_API at::Tensor & erfc_outf(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & erfc_(at::Tensor & self); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/08/0896c48a43618468c73effc245d088849cd6651819167bd75a89f6ad237337f3/blob b/shared/package-files/08/0896c48a43618468c73effc245d088849cd6651819167bd75a89f6ad237337f3/blob new file mode 100644 index 0000000000000000000000000000000000000000..f2c32c03ba0625753ec89f2fa1eb385c1b26ea17 Binary files /dev/null and b/shared/package-files/08/0896c48a43618468c73effc245d088849cd6651819167bd75a89f6ad237337f3/blob differ diff --git a/shared/package-files/08/0897b0a6c7147a1b7aa79ed5cc0cdfe026c9623cfa00dafac0f86386b19c3ed8/blob b/shared/package-files/08/0897b0a6c7147a1b7aa79ed5cc0cdfe026c9623cfa00dafac0f86386b19c3ed8/blob new file mode 100644 index 0000000000000000000000000000000000000000..5fafbcdec1593de4b5a5509005a806efbeb4fbcd --- /dev/null +++ b/shared/package-files/08/0897b0a6c7147a1b7aa79ed5cc0cdfe026c9623cfa00dafac0f86386b19c3ed8/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _cufft_get_plan_cache_size { + using schema = int64_t (at::DeviceIndex); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_cufft_get_plan_cache_size") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_cufft_get_plan_cache_size(DeviceIndex device_index) -> int") + static int64_t call(at::DeviceIndex device_index); + static int64_t redispatch(c10::DispatchKeySet dispatchKeySet, at::DeviceIndex device_index); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/08/0898b93abf1c99e8300ec3da1c615b6b16f090abff4e6a41380bb781c96ad868/blob b/shared/package-files/08/0898b93abf1c99e8300ec3da1c615b6b16f090abff4e6a41380bb781c96ad868/blob new file mode 100644 index 0000000000000000000000000000000000000000..f263fead0f0dbb6da93105375127f09d35d7f5c5 Binary files /dev/null and b/shared/package-files/08/0898b93abf1c99e8300ec3da1c615b6b16f090abff4e6a41380bb781c96ad868/blob differ diff --git a/shared/package-files/08/0899037850bf916ff6a2d07c638822698d6140674e8f73f8c4643d6999deb041/blob b/shared/package-files/08/0899037850bf916ff6a2d07c638822698d6140674e8f73f8c4643d6999deb041/blob new file mode 100644 index 0000000000000000000000000000000000000000..1a95dfe0d762d8cec467aca366f7ba13f1cb82a3 --- /dev/null +++ b/shared/package-files/08/0899037850bf916ff6a2d07c638822698d6140674e8f73f8c4643d6999deb041/blob @@ -0,0 +1,90 @@ +import math +from numbers import Number + +import torch +from torch import inf, nan +from torch.distributions import constraints +from torch.distributions.distribution import Distribution +from torch.distributions.utils import broadcast_all + +__all__ = ["Cauchy"] + + +class Cauchy(Distribution): + r""" + Samples from a Cauchy (Lorentz) distribution. The distribution of the ratio of + independent normally distributed random variables with means `0` follows a + Cauchy distribution. + + Example:: + + >>> # xdoctest: +IGNORE_WANT("non-deterministic") + >>> m = Cauchy(torch.tensor([0.0]), torch.tensor([1.0])) + >>> m.sample() # sample from a Cauchy distribution with loc=0 and scale=1 + tensor([ 2.3214]) + + Args: + loc (float or Tensor): mode or median of the distribution. + scale (float or Tensor): half width at half maximum. + """ + arg_constraints = {"loc": constraints.real, "scale": constraints.positive} + support = constraints.real + has_rsample = True + + def __init__(self, loc, scale, validate_args=None): + self.loc, self.scale = broadcast_all(loc, scale) + if isinstance(loc, Number) and isinstance(scale, Number): + batch_shape = torch.Size() + else: + batch_shape = self.loc.size() + super().__init__(batch_shape, validate_args=validate_args) + + def expand(self, batch_shape, _instance=None): + new = self._get_checked_instance(Cauchy, _instance) + batch_shape = torch.Size(batch_shape) + new.loc = self.loc.expand(batch_shape) + new.scale = self.scale.expand(batch_shape) + super(Cauchy, new).__init__(batch_shape, validate_args=False) + new._validate_args = self._validate_args + return new + + @property + def mean(self): + return torch.full( + self._extended_shape(), nan, dtype=self.loc.dtype, device=self.loc.device + ) + + @property + def mode(self): + return self.loc + + @property + def variance(self): + return torch.full( + self._extended_shape(), inf, dtype=self.loc.dtype, device=self.loc.device + ) + + def rsample(self, sample_shape=torch.Size()): + shape = self._extended_shape(sample_shape) + eps = self.loc.new(shape).cauchy_() + return self.loc + eps * self.scale + + def log_prob(self, value): + if self._validate_args: + self._validate_sample(value) + return ( + -math.log(math.pi) + - self.scale.log() + - (((value - self.loc) / self.scale) ** 2).log1p() + ) + + def cdf(self, value): + if self._validate_args: + self._validate_sample(value) + return torch.atan((value - self.loc) / self.scale) / math.pi + 0.5 + + def icdf(self, value): + return torch.tan(math.pi * (value - 0.5)) * self.scale + self.loc + + def entropy(self): + return math.log(4 * math.pi) + self.scale.log() diff --git a/shared/package-files/08/08993df49a7df43297e5e1fdcef5ac8230f918d4da18ef1c31fcd5eef1eaa799/blob b/shared/package-files/08/08993df49a7df43297e5e1fdcef5ac8230f918d4da18ef1c31fcd5eef1eaa799/blob new file mode 100644 index 0000000000000000000000000000000000000000..1b98ee4b7d3f0b62f86698103a57efcfa27a2de4 --- /dev/null +++ b/shared/package-files/08/08993df49a7df43297e5e1fdcef5ac8230f918d4da18ef1c31fcd5eef1eaa799/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API fft_ifft2 { + using schema = at::Tensor (const at::Tensor &, at::OptionalSymIntArrayRef, at::IntArrayRef, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::fft_ifft2") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "fft_ifft2(Tensor self, SymInt[1]? s=None, int[1] dim=[-2,-1], str? norm=None) -> Tensor") + static at::Tensor call(const at::Tensor & self, at::OptionalSymIntArrayRef s, at::IntArrayRef dim, c10::optional norm); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::OptionalSymIntArrayRef s, at::IntArrayRef dim, c10::optional norm); +}; + +struct TORCH_API fft_ifft2_out { + using schema = at::Tensor & (const at::Tensor &, at::OptionalSymIntArrayRef, at::IntArrayRef, c10::optional, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::fft_ifft2") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "fft_ifft2.out(Tensor self, SymInt[1]? s=None, int[1] dim=[-2,-1], str? norm=None, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, at::OptionalSymIntArrayRef s, at::IntArrayRef dim, c10::optional norm, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::OptionalSymIntArrayRef s, at::IntArrayRef dim, c10::optional norm, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/08/089949de76f7625218c9bba31312d31054f670ee6422da886b2e5081ce929b7b/blob b/shared/package-files/08/089949de76f7625218c9bba31312d31054f670ee6422da886b2e5081ce929b7b/blob new file mode 100644 index 0000000000000000000000000000000000000000..91e5df09985b75f4971466efb07aa9c965decc1b --- /dev/null +++ b/shared/package-files/08/089949de76f7625218c9bba31312d31054f670ee6422da886b2e5081ce929b7b/blob @@ -0,0 +1,169 @@ +from abc import ABC, abstractmethod +from numba.core.registry import DelayedRegistry, CPUDispatcher +from numba.core.decorators import jit +from numba.core.errors import (InternalTargetMismatchError, + NonexistentTargetError) +from threading import local as tls + + +_active_context = tls() +_active_context_default = 'cpu' + + +class _TargetRegistry(DelayedRegistry): + + def __getitem__(self, item): + try: + return super().__getitem__(item) + except KeyError: + msg = "No target is registered against '{}', known targets:\n{}" + known = '\n'.join([f"{k: <{10}} -> {v}" + for k, v in target_registry.items()]) + raise NonexistentTargetError(msg.format(item, known)) from None + + +# Registry mapping target name strings to Target classes +target_registry = _TargetRegistry() + +# Registry mapping Target classes the @jit decorator for that target +jit_registry = DelayedRegistry() + + +class target_override(object): + """Context manager to temporarily override the current target with that + prescribed.""" + def __init__(self, name): + self._orig_target = getattr(_active_context, 'target', + _active_context_default) + self.target = name + + def __enter__(self): + _active_context.target = self.target + + def __exit__(self, ty, val, tb): + _active_context.target = self._orig_target + + +def current_target(): + """Returns the current target + """ + return getattr(_active_context, 'target', _active_context_default) + + +def get_local_target(context): + """ + Gets the local target from the call stack if available and the TLS + override if not. + """ + # TODO: Should this logic be reversed to prefer TLS override? + if len(context.callstack._stack) > 0: + target = context.callstack[0].target + else: + target = target_registry.get(current_target(), None) + if target is None: + msg = ("The target found is not registered." + "Given target was {}.") + raise ValueError(msg.format(target)) + else: + return target + + +def resolve_target_str(target_str): + """Resolves a target specified as a string to its Target class.""" + return target_registry[target_str] + + +def resolve_dispatcher_from_str(target_str): + """Returns the dispatcher associated with a target string""" + target_hw = resolve_target_str(target_str) + return dispatcher_registry[target_hw] + + +def _get_local_target_checked(tyctx, hwstr, reason): + """Returns the local target if it is compatible with the given target + name during a type resolution; otherwise, raises an exception. + + Parameters + ---------- + tyctx: typing context + hwstr: str + target name to check against + reason: str + Reason for the resolution. Expects a noun. + Returns + ------- + target_hw : Target + + Raises + ------ + InternalTargetMismatchError + """ + # Get the class for the target declared by the function + hw_clazz = resolve_target_str(hwstr) + # get the local target + target_hw = get_local_target(tyctx) + # make sure the target_hw is in the MRO for hw_clazz else bail + if not target_hw.inherits_from(hw_clazz): + raise InternalTargetMismatchError(reason, target_hw, hw_clazz) + return target_hw + + +class JitDecorator(ABC): + + @abstractmethod + def __call__(self): + return NotImplemented + + +class Target(ABC): + """ Implements a target """ + + @classmethod + def inherits_from(cls, other): + """Returns True if this target inherits from 'other' False otherwise""" + return issubclass(cls, other) + + +class Generic(Target): + """Mark the target as generic, i.e. suitable for compilation on + any target. All must inherit from this. + """ + + +class CPU(Generic): + """Mark the target as CPU. + """ + + +class GPU(Generic): + """Mark the target as GPU, i.e. suitable for compilation on a GPU + target. + """ + + +class CUDA(GPU): + """Mark the target as CUDA. + """ + + +class NPyUfunc(Target): + """Mark the target as a ufunc + """ + + +target_registry['generic'] = Generic +target_registry['CPU'] = CPU +target_registry['cpu'] = CPU +target_registry['GPU'] = GPU +target_registry['gpu'] = GPU +target_registry['CUDA'] = CUDA +target_registry['cuda'] = CUDA +target_registry['npyufunc'] = NPyUfunc + +dispatcher_registry = DelayedRegistry(key_type=Target) + + +# Register the cpu target token with its dispatcher and jit +cpu_target = target_registry['cpu'] +dispatcher_registry[cpu_target] = CPUDispatcher +jit_registry[cpu_target] = jit diff --git a/shared/package-files/08/089a161bb4d6291676b4cec9577aac657a40625076891cdfa20b3bef6d711a5d/blob b/shared/package-files/08/089a161bb4d6291676b4cec9577aac657a40625076891cdfa20b3bef6d711a5d/blob new file mode 100644 index 0000000000000000000000000000000000000000..0543aad2f7a6ba551d8ce7483e1dc8e0474ac57e --- /dev/null +++ b/shared/package-files/08/089a161bb4d6291676b4cec9577aac657a40625076891cdfa20b3bef6d711a5d/blob @@ -0,0 +1,334 @@ +# mypy: ignore-errors + +from __future__ import annotations + +from typing import Optional + +import torch + +from . import _binary_ufuncs_impl, _dtypes_impl, _unary_ufuncs_impl, _util +from ._normalizations import ( + ArrayLike, + ArrayLikeOrScalar, + CastingModes, + DTypeLike, + normalizer, + NotImplementedType, + OutArray, +) + + +def _ufunc_postprocess(result, out, casting): + if out is not None: + result = _util.typecast_tensor(result, out.dtype.torch_dtype, casting) + result = torch.broadcast_to(result, out.shape) + return result + + +# ############# Binary ufuncs ###################### + +_binary = [ + name + for name in dir(_binary_ufuncs_impl) + if not name.startswith("_") and name not in ["torch", "matmul", "divmod", "ldexp"] +] + + +NEP50_FUNCS = ( + "add", + "subtract", + "multiply", + "floor_divide", + "true_divide", + "divide", + "remainder", + "bitwise_and", + "bitwise_or", + "bitwise_xor", + "bitwise_left_shift", + "bitwise_right_shift", + "hypot", + "arctan2", + "logaddexp", + "logaddexp2", + "heaviside", + "copysign", + "fmax", + "minimum", + "fmin", + "maximum", + "fmod", + "gcd", + "lcm", + "pow", +) + + +def deco_binary_ufunc(torch_func): + """Common infra for binary ufuncs. + + Normalize arguments, sort out type casting, broadcasting and delegate to + the pytorch functions for the actual work. + """ + + @normalizer + def wrapped( + x1: ArrayLikeOrScalar, + x2: ArrayLikeOrScalar, + /, + out: Optional[OutArray] = None, + *, + where: NotImplementedType = True, + casting: Optional[CastingModes] = "same_kind", + order: NotImplementedType = "K", + dtype: Optional[DTypeLike] = None, + subok: NotImplementedType = False, + signature: NotImplementedType = None, + extobj: NotImplementedType = None, + ): + if dtype is not None: + + def cast(x, dtype): + if isinstance(x, torch.Tensor): + return _util.typecast_tensor(x, dtype, casting) + else: + return torch.as_tensor(x, dtype=dtype) + + x1 = cast(x1, dtype) + x2 = cast(x2, dtype) + elif isinstance(x1, torch.Tensor) and isinstance(x2, torch.Tensor): + dtype = _dtypes_impl.result_type_impl(x1, x2) + x1, x2 = _util.typecast_tensors((x1, x2), dtype, casting) + else: + x1, x2 = _dtypes_impl.nep50_to_tensors( + x1, x2, torch_func.__name__ in NEP50_FUNCS, torch_func.__name__ + ) + + result = torch_func(x1, x2) + + return _ufunc_postprocess(result, out, casting) + + wrapped.__qualname__ = torch_func.__name__ + wrapped.__name__ = torch_func.__name__ + + return wrapped + + +# matmul's signature is _slightly_ different from other ufuncs: +# - no where=... +# - additional axis=..., axes=... +# - no NEP50 scalars in or out +@normalizer +def matmul( + x1: ArrayLike, + x2: ArrayLike, + /, + out: Optional[OutArray] = None, + *, + casting: Optional[CastingModes] = "same_kind", + order: NotImplementedType = "K", + dtype: Optional[DTypeLike] = None, + subok: NotImplementedType = False, + signature: NotImplementedType = None, + extobj: NotImplementedType = None, + axes: NotImplementedType = None, + axis: NotImplementedType = None, +): + if dtype is None: + dtype = _dtypes_impl.result_type_impl(x1, x2) + x1, x2 = _util.typecast_tensors((x1, x2), dtype, casting) + + result = _binary_ufuncs_impl.matmul(x1, x2) + + result = _ufunc_postprocess(result, out, casting) + return result + + +# ldexp casting is special : the dtype of the result == dtype of the 1st arg +@normalizer +def ldexp( + x1: ArrayLikeOrScalar, + x2: ArrayLikeOrScalar, + /, + out: Optional[OutArray] = None, + *, + where: NotImplementedType = True, + casting: Optional[CastingModes] = "same_kind", + order: NotImplementedType = "K", + dtype: Optional[DTypeLike] = None, + subok: NotImplementedType = False, + signature: NotImplementedType = None, + extobj: NotImplementedType = None, +): + if dtype is not None: + if isinstance(x1, torch.Tensor): + x1 = _util.typecast_tensor(x1, dtype, casting) + else: + x1 = torch.as_tensor(x1, dtype=dtype) + else: + if not isinstance(x1, torch.Tensor): + x1 = torch.as_tensor(x1) + x1 = _util.cast_int_to_float(x1) + + x2 = torch.as_tensor(x2) + # the second arg must be integer + if _dtypes_impl._category(x2.dtype) != 1: + raise ValueError("ldexp 2nd arg must be integer") + + result = _binary_ufuncs_impl.ldexp(x1, x2) + + if x1.dtype == torch.float16: + # torch.ldexp(f16, int) -> f32, undo it + result = result.to(torch.float16) + + return _ufunc_postprocess(result, out, casting) + + +# nin=2, nout=2 +@normalizer +def divmod( + x1: ArrayLike, + x2: ArrayLike, + out1: Optional[OutArray] = None, + out2: Optional[OutArray] = None, + /, + out: tuple[Optional[OutArray], Optional[OutArray]] = (None, None), + *, + where: NotImplementedType = True, + casting: Optional[CastingModes] = "same_kind", + order: NotImplementedType = "K", + dtype: Optional[DTypeLike] = None, + subok: NotImplementedType = False, + signature: NotImplementedType = None, + extobj: NotImplementedType = None, +): + # make sure we either have no out arrays at all, or there is either + # out1, out2, or out=tuple, but not both + num_outs = sum(x is not None for x in [out1, out2]) + if num_outs == 1: + raise ValueError("both out1 and out2 need to be provided") + elif num_outs == 2: + o1, o2 = out + if o1 is not None or o2 is not None: + raise TypeError( + "cannot specify 'out' as both a positional and keyword argument" + ) + else: + out1, out2 = out + + if dtype is None: + dtype = _dtypes_impl.result_type_impl(x1, x2) + x1, x2 = _util.typecast_tensors((x1, x2), dtype, casting) + + quot, rem = _binary_ufuncs_impl.divmod(x1, x2) + + quot = _ufunc_postprocess(quot, out1, casting) + rem = _ufunc_postprocess(rem, out2, casting) + return quot, rem + + +# +# Attach ufuncs to this module, for a further export to the public namespace in __init__.py +# +for name in _binary: + ufunc = getattr(_binary_ufuncs_impl, name) + vars()[name] = deco_binary_ufunc(ufunc) + + +def modf(x, /, *args, **kwds): + quot, rem = divmod(x, 1, *args, **kwds) + return rem, quot + + +_binary = _binary + ["divmod", "modf", "matmul", "ldexp"] + + +# ############# Unary ufuncs ###################### + + +_unary = [ + name + for name in dir(_unary_ufuncs_impl) + if not name.startswith("_") and name != "torch" +] + + +# these are ufunc(int) -> float +_fp_unary = [ + "arccos", + "arccosh", + "arcsin", + "arcsinh", + "arctan", + "arctanh", + "cbrt", + "cos", + "cosh", + "deg2rad", + "degrees", + "exp", + "exp2", + "expm1", + "log", + "log10", + "log1p", + "log2", + "rad2deg", + "radians", + "reciprocal", + "sin", + "sinh", + "sqrt", + "square", + "tan", + "tanh", + "trunc", +] + + +def deco_unary_ufunc(torch_func): + """Common infra for unary ufuncs. + + Normalize arguments, sort out type casting, broadcasting and delegate to + the pytorch functions for the actual work. + """ + + @normalizer + def wrapped( + x: ArrayLike, + /, + out: Optional[OutArray] = None, + *, + where=True, + casting: Optional[CastingModes] = "same_kind", + order="K", + dtype: Optional[DTypeLike] = None, + subok: NotImplementedType = False, + signature=None, + extobj=None, + ): + if dtype is not None: + x = _util.typecast_tensor(x, dtype, casting) + + if torch_func.__name__ in _fp_unary: + x = _util.cast_int_to_float(x) + + result = torch_func(x) + result = _ufunc_postprocess(result, out, casting) + return result + + wrapped.__qualname__ = torch_func.__name__ + wrapped.__name__ = torch_func.__name__ + + return wrapped + + +# +# Attach ufuncs to this module, for a further export to the public namespace in __init__.py +# +for name in _unary: + ufunc = getattr(_unary_ufuncs_impl, name) + vars()[name] = deco_unary_ufunc(ufunc) + + +__all__ = _binary + _unary # noqa: PLE0605 diff --git a/shared/package-files/08/089a4fea064faa4a714c1353f230cf17d7dc49fa1c4ba20023ae61989661efdc/blob b/shared/package-files/08/089a4fea064faa4a714c1353f230cf17d7dc49fa1c4ba20023ae61989661efdc/blob new file mode 100644 index 0000000000000000000000000000000000000000..11f2845cc2cc8a7c627d0af04691fe4411068660 --- /dev/null +++ b/shared/package-files/08/089a4fea064faa4a714c1353f230cf17d7dc49fa1c4ba20023ae61989661efdc/blob @@ -0,0 +1,91 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::split_with_sizes_copy(Tensor self, SymInt[] split_sizes, int dim=0) -> Tensor[] +inline ::std::vector split_with_sizes_copy(const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::split_with_sizes_copy::call(self, c10::fromIntArrayRefSlow(split_sizes), dim); +} +namespace symint { + template ::value>> + ::std::vector split_with_sizes_copy(const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::split_with_sizes_copy::call(self, c10::fromIntArrayRefSlow(split_sizes), dim); + } +} + +// aten::split_with_sizes_copy(Tensor self, SymInt[] split_sizes, int dim=0) -> Tensor[] +inline ::std::vector split_with_sizes_copy_symint(const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::split_with_sizes_copy::call(self, split_sizes, dim); +} +namespace symint { + template ::value>> + ::std::vector split_with_sizes_copy(const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::split_with_sizes_copy::call(self, split_sizes, dim); + } +} + +// aten::split_with_sizes_copy.out(Tensor self, SymInt[] split_sizes, int dim=0, *, Tensor(a!)[] out) -> () +inline void split_with_sizes_copy_out(at::TensorList out, const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::split_with_sizes_copy_out::call(self, c10::fromIntArrayRefSlow(split_sizes), dim, out); +} +namespace symint { + template ::value>> + void split_with_sizes_copy_out(at::TensorList out, const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::split_with_sizes_copy_out::call(self, c10::fromIntArrayRefSlow(split_sizes), dim, out); + } +} + +// aten::split_with_sizes_copy.out(Tensor self, SymInt[] split_sizes, int dim=0, *, Tensor(a!)[] out) -> () +inline void split_with_sizes_copy_outf(const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim, at::TensorList out) { + return at::_ops::split_with_sizes_copy_out::call(self, c10::fromIntArrayRefSlow(split_sizes), dim, out); +} +namespace symint { + template ::value>> + void split_with_sizes_copy_outf(const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim, at::TensorList out) { + return at::_ops::split_with_sizes_copy_out::call(self, c10::fromIntArrayRefSlow(split_sizes), dim, out); + } +} + +// aten::split_with_sizes_copy.out(Tensor self, SymInt[] split_sizes, int dim=0, *, Tensor(a!)[] out) -> () +inline void split_with_sizes_copy_symint_out(at::TensorList out, const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::split_with_sizes_copy_out::call(self, split_sizes, dim, out); +} +namespace symint { + template ::value>> + void split_with_sizes_copy_out(at::TensorList out, const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::split_with_sizes_copy_out::call(self, split_sizes, dim, out); + } +} + +// aten::split_with_sizes_copy.out(Tensor self, SymInt[] split_sizes, int dim=0, *, Tensor(a!)[] out) -> () +inline void split_with_sizes_copy_symint_outf(const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim, at::TensorList out) { + return at::_ops::split_with_sizes_copy_out::call(self, split_sizes, dim, out); +} +namespace symint { + template ::value>> + void split_with_sizes_copy_outf(const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim, at::TensorList out) { + return at::_ops::split_with_sizes_copy_out::call(self, split_sizes, dim, out); + } +} + +} diff --git a/shared/package-files/08/089b96d30e927700cfb659360e5d788347b0b8272c20a3f0b6798830149812e7/blob b/shared/package-files/08/089b96d30e927700cfb659360e5d788347b0b8272c20a3f0b6798830149812e7/blob new file mode 100644 index 0000000000000000000000000000000000000000..d8afd29ff31c558a7e99861852b08d86deaa9fac --- /dev/null +++ b/shared/package-files/08/089b96d30e927700cfb659360e5d788347b0b8272c20a3f0b6798830149812e7/blob @@ -0,0 +1,38 @@ +"""Tests for PeriodIndex behaving like a vectorized Period scalar""" + +import pytest + +from pandas import ( + Timedelta, + date_range, + period_range, +) +import pandas._testing as tm + + +class TestPeriodIndexOps: + def test_start_time(self): + # GH#17157 + index = period_range(freq="M", start="2016-01-01", end="2016-05-31") + expected_index = date_range("2016-01-01", end="2016-05-31", freq="MS") + tm.assert_index_equal(index.start_time, expected_index) + + def test_end_time(self): + # GH#17157 + index = period_range(freq="M", start="2016-01-01", end="2016-05-31") + expected_index = date_range("2016-01-01", end="2016-05-31", freq="ME") + expected_index += Timedelta(1, "D") - Timedelta(1, "ns") + tm.assert_index_equal(index.end_time, expected_index) + + @pytest.mark.filterwarnings(r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning") + @pytest.mark.filterwarnings( + "ignore:Period with BDay freq is deprecated:FutureWarning" + ) + def test_end_time_business_friday(self): + # GH#34449 + pi = period_range("1990-01-05", freq="B", periods=1) + result = pi.end_time + + dti = date_range("1990-01-05", freq="D", periods=1)._with_freq(None) + expected = dti + Timedelta(days=1, nanoseconds=-1) + tm.assert_index_equal(result, expected) diff --git a/shared/package-files/08/089d0e4c21c88d6034648552e2fa0e440b27d91e11d9c40112d3ec6442690126/blob b/shared/package-files/08/089d0e4c21c88d6034648552e2fa0e440b27d91e11d9c40112d3ec6442690126/blob new file mode 100644 index 0000000000000000000000000000000000000000..cf0954e1a30546d781bf25781ec716ef92a77e32 --- /dev/null +++ b/shared/package-files/08/089d0e4c21c88d6034648552e2fa0e440b27d91e11d9c40112d3ec6442690126/blob @@ -0,0 +1,30 @@ +import collections + + +# from jaraco.collections 3.3 +class FreezableDefaultDict(collections.defaultdict): + """ + Often it is desirable to prevent the mutation of + a default dict after its initial construction, such + as to prevent mutation during iteration. + + >>> dd = FreezableDefaultDict(list) + >>> dd[0].append('1') + >>> dd.freeze() + >>> dd[1] + [] + >>> len(dd) + 1 + """ + + def __missing__(self, key): + return getattr(self, '_frozen', super().__missing__)(key) + + def freeze(self): + self._frozen = lambda key: self.default_factory() + + +class Pair(collections.namedtuple('Pair', 'name value')): + @classmethod + def parse(cls, text): + return cls(*map(str.strip, text.split("=", 1))) diff --git a/shared/package-files/08/089d2351ad72aee4786bf715a9c151a4e441a5819e6bd0b9bd0e65c067d65192/blob b/shared/package-files/08/089d2351ad72aee4786bf715a9c151a4e441a5819e6bd0b9bd0e65c067d65192/blob new file mode 100644 index 0000000000000000000000000000000000000000..742b880132561e7631ab643accc54c07a61924cc --- /dev/null +++ b/shared/package-files/08/089d2351ad72aee4786bf715a9c151a4e441a5819e6bd0b9bd0e65c067d65192/blob @@ -0,0 +1,7 @@ +from typing import Any, List, Optional, Type, TypeVar + +_T = TypeVar("_T") + +def none_throws(optional: Optional[_T], message: str = ...) -> _T: ... +def safe_cast(new_type: Type[_T], value: Any) -> _T: ... +def ParameterSpecification(__name: str) -> List[Type[Any]]: ... diff --git a/shared/package-files/08/089dabe5ceebc1d17ea056c605db3f6e4a63e9c91a3d37b1a7eabd8897147aa8/blob b/shared/package-files/08/089dabe5ceebc1d17ea056c605db3f6e4a63e9c91a3d37b1a7eabd8897147aa8/blob new file mode 100644 index 0000000000000000000000000000000000000000..f5bba09c28ab025abe774d899e68f19924a7f914 --- /dev/null +++ b/shared/package-files/08/089dabe5ceebc1d17ea056c605db3f6e4a63e9c91a3d37b1a7eabd8897147aa8/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & _dirichlet_grad_out(at::Tensor & out, const at::Tensor & x, const at::Tensor & alpha, const at::Tensor & total); +TORCH_API at::Tensor & _dirichlet_grad_outf(const at::Tensor & x, const at::Tensor & alpha, const at::Tensor & total, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/08/089ea3be042a2f3696ca8afdac20d0ab0f7264f3d29fb92c9c4ec9680181cebb/blob b/shared/package-files/08/089ea3be042a2f3696ca8afdac20d0ab0f7264f3d29fb92c9c4ec9680181cebb/blob new file mode 100644 index 0000000000000000000000000000000000000000..10be3a04a01b328a45cee25148a101b0d6727687 --- /dev/null +++ b/shared/package-files/08/089ea3be042a2f3696ca8afdac20d0ab0f7264f3d29fb92c9c4ec9680181cebb/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_log_softmax(Tensor self, int dim, bool half_to_float) -> Tensor +inline at::Tensor _log_softmax(const at::Tensor & self, int64_t dim, bool half_to_float) { + return at::_ops::_log_softmax::call(self, dim, half_to_float); +} + +// aten::_log_softmax.out(Tensor self, int dim, bool half_to_float, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _log_softmax_out(at::Tensor & out, const at::Tensor & self, int64_t dim, bool half_to_float) { + return at::_ops::_log_softmax_out::call(self, dim, half_to_float, out); +} +// aten::_log_softmax.out(Tensor self, int dim, bool half_to_float, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _log_softmax_outf(const at::Tensor & self, int64_t dim, bool half_to_float, at::Tensor & out) { + return at::_ops::_log_softmax_out::call(self, dim, half_to_float, out); +} + +} diff --git a/shared/package-files/08/08a0df6d0299182f380364874aadd4b0effc19559b4cb755c729a6f38ba62371/blob b/shared/package-files/08/08a0df6d0299182f380364874aadd4b0effc19559b4cb755c729a6f38ba62371/blob new file mode 100644 index 0000000000000000000000000000000000000000..ab2b316bc8a4b99a1af9df2b380bda7d91797ab0 --- /dev/null +++ b/shared/package-files/08/08a0df6d0299182f380364874aadd4b0effc19559b4cb755c729a6f38ba62371/blob @@ -0,0 +1,1742 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef AT_PER_OPERATOR_HEADERS +#include +#else +#include +#include +#include +#endif + +namespace at { namespace native { + +// The maximum number of threads in a block +#if defined(USE_ROCM) +constexpr int MAX_BLOCK_SIZE = 256; +#else +constexpr int MAX_BLOCK_SIZE = 512; +#endif + +constexpr unsigned MAX_GRID_SIZE = 65535u; + +// Number of threads in a block given an input size up to MAX_BLOCK_SIZE +static int getNumThreads(int nElem) { +#if defined(USE_ROCM) + int threadSizes[5] = { 16, 32, 64, 128, MAX_BLOCK_SIZE }; +#else + int threadSizes[5] = { 32, 64, 128, 256, MAX_BLOCK_SIZE }; +#endif + for (int i = 0; i != 5; ++i) { + if (nElem <= threadSizes[i]) { + return threadSizes[i]; + } + } + return MAX_BLOCK_SIZE; +} + +// Returns the index of the most significant 1 bit in `val`. +__device__ __forceinline__ int getMSB(int val) { + return 31 - __clz(val); +} + +template +struct Float2 { + accscalar_t v1, v2; + __device__ Float2() {} + __device__ Float2(scalar_t v1, scalar_t v2) : v1(static_cast(v1)), v2(static_cast(v2)) {} + __device__ Float2(int v) : v1(static_cast(v)), v2(static_cast(v)) {} + __device__ Float2& operator+=(const Float2& a) { + v1 += a.v1; + v2 += a.v2; + return *this; + } + __device__ friend Float2 operator+(Float2 a, const Float2& b) { + a += b; + return a; + } +}; + +template +struct GradOp { + __device__ GradOp(accscalar_t m, const PTA& i, const PTA& g) + : mean(m), input(i), grad_output(g) {} + __device__ __forceinline__ Float2 operator()(int batch, int plane, int n) { + accscalar_t g = grad_output[batch][plane][n]; + accscalar_t c = static_cast(input[batch][plane][n]) - mean; + return Float2(g, g * c); + } + const accscalar_t mean; + const PTA& input; + const PTA& grad_output; +}; + +template +struct SumReduceOp { + __device__ __forceinline__ acc_t combine(acc_t a, acc_t b) const { return a + b; } + + __device__ __forceinline__ acc_t warp_shfl_down(acc_t data, int offset) const { + return WARP_SHFL_DOWN(data, offset); + } +}; + +template +struct SumReduceOp> { + using acc_t = Float2; + + __device__ __forceinline__ acc_t combine(acc_t a, acc_t b) const { return a + b; } + + __device__ __forceinline__ acc_t warp_shfl_down(acc_t data, int offset) const { + return {WARP_SHFL_DOWN(data.v1, offset), WARP_SHFL_DOWN(data.v2, offset)}; + } +}; + +// Sum across (batch, x/y/z) applying Op() pointwise +// this works by first having each thread sum it's part +// of the data. Then there is a double-shuffling reduction. +// First each warp (of C10_WARP_SIZE threads) uses warpSum to reduce its +// data to the "warp leader", who writes its value into shared memory. +// Then a single warp reads the remaining (at most C10_WARP_SIZE) items +// and reduces them using another warpSum. +// The implicit assumption is that there are no more +// than C10_WARP_SIZE**2 threads. +template +__device__ scalar_t reduce(Op op, PTA tensor, int plane) { + // first the reductions each thread does separately + scalar_t sum = static_cast(0); + for (int batch = threadIdx.y; batch < tensor.size(0); batch += blockDim.y) { + for (int x = threadIdx.x; x < tensor.size(2); x += blockDim.x) { + sum += op(batch, plane, x); + } + } + __shared__ scalar_t shared[C10_WARP_SIZE]; + SumReduceOp reduce_op; + sum = cuda_utils::BlockReduce, cuda_utils::Block2D>(sum, reduce_op, 0, shared); + if (threadIdx.x == 0 && threadIdx.y == 0) { + shared[0] = sum; + } + __syncthreads(); + // Everyone picks it up, should be broadcast into the whole grad_input + return shared[0]; +} + +constexpr int ELEMENTS_PER_ITER = 4; // enables concurrency within each thread to hide latency +constexpr int ELEMENTS_PER_THREAD = 16; +constexpr int OPTIMAL_TILE_W = 32; +constexpr int MAX_H_BLOCK = 128; + +__host__ void flexible_launch_configs( + const int reduction, + const int stride, + dim3 &block, + dim3 &grid, + const bool coop_flag = false) { + int block_x = std::min(lastPow2(stride), OPTIMAL_TILE_W); + int block_y = std::min(lastPow2(at::ceil_div(reduction , ELEMENTS_PER_THREAD)), + MAX_BLOCK_SIZE / block_x); + if (block_x * block_y != MAX_BLOCK_SIZE) { + block_x = std::min(lastPow2(stride), MAX_BLOCK_SIZE / block_y); + } + + int grid_x = at::ceil_div(stride, block_x); + int grid_y = std::min(at::ceil_div(reduction, block_y * ELEMENTS_PER_THREAD), MAX_H_BLOCK); + if (coop_flag) { + // it's not worth having a grid reduction if the reduction dimension is not big enough + grid_y = grid_y < 8 ? 1 : grid_y; + } + + block.x = block_x; + block.y = block_y; + block.z = 1; + grid.x = grid_x; + grid.y = grid_y; + grid.z = 1; +} + +template +__device__ __forceinline__ void welford_merge_element(C& count, + T& mean, + T& m2n, + const C& count_new, + const T& mean_new, + const T& m2n_new) { + T factor = T(1.0) / ::max(1, (count + count_new)); + T delta0 = mean - mean_new; + mean = (mean_new * count_new + mean * count) * factor; + m2n += m2n_new + delta0 * delta0 * count_new * count * factor; + count += count_new; +} + +// merge mean/m2n among threadIdx.y within block +template +__device__ __forceinline__ void welford_merge_block_vertical(C& count, + T& mean, + T& m2n, + C* shmem_count, + T* shmem_mean, + T* shmem_m2n) { + // write to shared memory + auto address_base = threadIdx.x + threadIdx.y * blockDim.x; + +#pragma unroll + for (int offset = blockDim.y/2; offset > 0; offset >>= 1) { + if (threadIdx.y < offset*2) { + shmem_mean[address_base] = mean; + shmem_m2n[address_base] = m2n; + shmem_count[address_base] = count; + } + __syncthreads(); + if (threadIdx.y < offset && threadIdx.y + offset < blockDim.y) { + auto address = address_base + offset * blockDim.x; + // read shared memory back to register for reduction + auto count_new = shmem_count[address]; + auto mean_new = shmem_mean[address]; + auto m2n_new = shmem_m2n[address]; + + welford_merge_element(count, mean, m2n, count_new, mean_new, m2n_new); + } + } +} + +template +__global__ void batch_norm_transform_input_kernel( + const GenericPackedTensorAccessor input, + GenericPackedTensorAccessor output, + const GenericPackedTensorAccessor::type, 1, RestrictPtrTraits, index_t> mean_, + const GenericPackedTensorAccessor::type, 1, RestrictPtrTraits, index_t> var_or_invstd, + const GenericPackedTensorAccessor weight, + const GenericPackedTensorAccessor bias, + stat_accscalar_t epsilon) { + + index_t plane = blockIdx.x; + + if (plane >= input.size(1)) { + return; + } + + stat_accscalar_t gamma = weight.size(0) > 0 ? static_cast(weight[plane]) : static_cast(1); + stat_accscalar_t beta = bias.size(0) > 0 ? static_cast(bias[plane]) : static_cast(0); + stat_accscalar_t mean = static_cast(mean_[plane]); + stat_accscalar_t invstd; + if (train) { + invstd = var_or_invstd[plane]; + } else { + invstd = static_cast(1) / device_sqrt(static_cast(var_or_invstd[plane]) + epsilon); + } + + index_t bs = input.size(0); + index_t fs = input.size(2); + + index_t bstep = blockDim.y * gridDim.y; + for (index_t batch = threadIdx.y + blockIdx.y * blockDim.y; batch < bs; batch += bstep) { + auto o = output[batch][plane]; + auto i = input[batch][plane]; + for (index_t feature = threadIdx.x; feature < fs; feature += blockDim.x) { + o[feature] = static_cast(gamma * (i[feature] - mean) * invstd + beta); + } + } +} + +struct InvStd { + template + __device__ __forceinline__ T operator()(T var, double epsilon) const { + T invstd = 0; + if (var != static_cast(0) || epsilon != static_cast(0)) { + invstd = static_cast(1) / device_sqrt(var + epsilon); + } + return invstd; + } +}; + +struct Var { + template + __device__ __forceinline__ T operator()(T var, double epsilon) const { + return var; + } +}; + +template +__global__ void batch_norm_collect_statistics_kernel( + const GenericPackedTensorAccessor input, + const stat_accscalar_t epsilon, + const stat_accscalar_t momentum, + GenericPackedTensorAccessor save_mean, + GenericPackedTensorAccessor save_transformed_var) { + + __shared__ int shared_n[2 * 2 * C10_WARP_SIZE + C10_WARP_SIZE]; + + int plane = blockIdx.x; + int N = input.size(0) * input.size(2); + int tid = threadIdx.x + threadIdx.y * blockDim.x; + + // Compute the mean and variance across (batch, x/y/z) + // this uses the Welford (in the for loop)/parallel algorithm (to sum across the block) + // https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_Online_algorithm + // and the parallel algorithm on the same page. + // We use two shuffles to reduce across the entire block. + // https://devblogs.nvidia.com/faster-parallel-reductions-kepler/ has a description. + stat_accscalar_t* shared_avg_var = (stat_accscalar_t*) &shared_n[C10_WARP_SIZE]; + + // first the reductions each thread does separately + stat_accscalar_t avg = 0; + stat_accscalar_t var_n = 0; + int n = 0; + for (int batch = threadIdx.y; batch < input.size(0); batch += blockDim.y) { + for (int x = threadIdx.x; x < input.size(2); x += blockDim.x) { + stat_accscalar_t v = input[batch][plane][x]; + stat_accscalar_t d1 = v - avg; + n++; + avg += d1 / n; + var_n += d1 * (v - avg); + } + } + + // first warpSum to get one value per thread to + // one value per warp + for (int i = 0; i < getMSB(C10_WARP_SIZE); ++i) { + stat_accscalar_t o_avg = WARP_SHFL_XOR(avg, 1 << i, C10_WARP_SIZE); + int o_n = WARP_SHFL_XOR(n, 1 << i, C10_WARP_SIZE); + stat_accscalar_t factor = 1.0 / fmaxf(1.0, n+o_n); + var_n += WARP_SHFL_XOR(var_n, 1 << i, C10_WARP_SIZE) + (avg - o_avg) * (avg - o_avg) * n * o_n * factor; + avg = (n * avg + o_n * o_avg) * factor; + n += o_n; + } + + // this writes each warps item into shared memory + // there are at most C10_WARP_SIZE items left because + // there are at most C10_WARP_SIZE**2 threads at the beginning + __syncthreads(); + if (tid % C10_WARP_SIZE == 0) { + shared_n[tid / C10_WARP_SIZE] = n; + shared_avg_var[tid / C10_WARP_SIZE * 2] = avg; + shared_avg_var[tid / C10_WARP_SIZE * 2 + 1] = var_n; + } + __syncthreads(); + // now have a second warpSum to reduce the intermediate values + // from shared memory to a single number. The very first + // thread writes it to shared memory. + + if (tid < C10_WARP_SIZE) { + n = (tid < blockDim.x * blockDim.y / C10_WARP_SIZE ? shared_n[tid] : 0); + avg = (tid < blockDim.x * blockDim.y / C10_WARP_SIZE ? shared_avg_var[2 * tid] : stat_accscalar_t(0)); + var_n = (tid < blockDim.x * blockDim.y / C10_WARP_SIZE ? shared_avg_var[2 * tid + 1] : stat_accscalar_t(0)); + } + for (int i = 0; i < getMSB(C10_WARP_SIZE); ++i) { + stat_accscalar_t o_avg = WARP_SHFL_XOR(avg, 1 << i, C10_WARP_SIZE); + int o_n = WARP_SHFL_XOR(n, 1 << i, C10_WARP_SIZE); + stat_accscalar_t factor = 1.0 / fmaxf(1.0, n+o_n); + var_n += WARP_SHFL_XOR(var_n, 1 << i, C10_WARP_SIZE) + (avg - o_avg) * (avg - o_avg) * n * o_n * factor; + avg = (n * avg + o_n * o_avg) * factor; + n += o_n; + } + + // Save the mean, variance, and moving averages + if (tid == 0) { + if (save_mean.data() != NULL) { + save_mean[plane] = avg; + } + if (save_transformed_var.data() != NULL) { + save_transformed_var[plane] = VarTransform{}(var_n / N, epsilon); + } + } + +} + +template +__global__ void batch_norm_backward_kernel( + const GenericPackedTensorAccessor input, + const GenericPackedTensorAccessor grad_output, + GenericPackedTensorAccessor grad_input, + GenericPackedTensorAccessor grad_weight, + GenericPackedTensorAccessor grad_bias, + const GenericPackedTensorAccessor weight, + const GenericPackedTensorAccessor running_mean, + const GenericPackedTensorAccessor running_var, + const GenericPackedTensorAccessor save_mean, + const GenericPackedTensorAccessor save_invstd, + bool train, + stat_accscalar_t epsilon) { + + index_t plane = blockIdx.x; + index_t N = grad_output.size(0) * grad_output.size(2); + + stat_accscalar_t mean, invstd; + if (train) { + mean = save_mean[plane]; + invstd = save_invstd[plane]; + } else { + mean = static_cast(running_mean[plane]); + invstd = static_cast(1) / device_sqrt(static_cast(running_var[plane]) + epsilon); + } + + stat_accscalar_t weight_val = weight.size(0) > 0 ? static_cast(weight[plane]) : stat_accscalar_t(1); + stat_accscalar_t norm = stat_accscalar_t(1) / N; + + // Compute two values across (batch, x/y/z) in one pass: + // 1. Sum(grad_output) + // 2. DotProduct(input - mean, grad_output) + GradOp> g(mean, input, grad_output); + auto res = reduce>(g, grad_output, plane); + + stat_accscalar_t grad_output_sum = res.v1; + stat_accscalar_t dot_p = res.v2; + + stat_accscalar_t grad_mean = grad_output_sum * norm; + stat_accscalar_t proj_scale = dot_p * norm * invstd * invstd; + stat_accscalar_t grad_scale = invstd * weight_val; + + if (grad_input.data() != NULL) { + for (int batch = threadIdx.y; batch < grad_output.size(0); batch += blockDim.y) { + for (int x = threadIdx.x; x < grad_output.size(2); x += blockDim.x) { + input_scalar_t go = grad_output[batch][plane][x]; + if (train) { + stat_accscalar_t inp = input[batch][plane][x]; + stat_accscalar_t proj = (inp - mean) * proj_scale; + grad_input[batch][plane][x] = static_cast((go - proj - grad_mean) * grad_scale); + } else { + grad_input[batch][plane][x] = static_cast(go * grad_scale); + } + } + } + } + + if (grad_weight.size(0) > 0) { + if (threadIdx.x == 0) { + grad_weight[plane] = static_cast(dot_p * invstd); + } + } + + if (grad_bias.size(0) > 0) { + if (threadIdx.x == 0) { + grad_bias[plane] = static_cast(grad_output_sum); + } + } +} + +template +__global__ void batch_norm_reduce_statistics_kernel( + const GenericPackedTensorAccessor vec_mean, + const GenericPackedTensorAccessor vec_invstd, + GenericPackedTensorAccessor mean, + GenericPackedTensorAccessor invstd, + GenericPackedTensorAccessor running_mean, + GenericPackedTensorAccessor running_var, + const accscalar_t epsilon, + const accscalar_t momentum, + const GenericPackedTensorAccessor counts) { + + int feature_size = vec_mean.size(1); + int world_size = vec_mean.size(0); + + int bid = blockIdx.x; + int tid = threadIdx.x; + + // first the reductions each thread does separately + for (int i = bid*blockDim.x+tid; i < feature_size; i += gridDim.x*blockDim.x) { + accscalar_t avg = 0; + accscalar_t var_n = 0; + index_t n = 0; + for (int j = 0; j < world_size; j++) { + scalar_t count = counts[j]; + accscalar_t m = vec_mean[j][i]; + accscalar_t v = accscalar_t(1.0) / (vec_invstd[j][i]); + v = (v * v - epsilon) * count; + accscalar_t factor = 1.0 / (n + count); + var_n += v + (avg - m) * (avg - m) * n * count * factor; + avg = n * factor * avg + count * factor * m; + n += count; + } + mean[i] = avg; + invstd[i] = static_cast(1) / device_sqrt(var_n / n + epsilon); + if (running_mean.data() != NULL) { + running_mean[i] = static_cast((1 - momentum) * running_mean[i] + momentum * avg); + } + accscalar_t unbiasedVar = var_n / (n - 1); + if (running_var.data() != NULL) { + running_var[i] = static_cast((1 - momentum) * running_var[i] + momentum * unbiasedVar); + } + } + +} + +template +__global__ void batch_norm_backward_reduce_kernel( + const GenericPackedTensorAccessor input, + const GenericPackedTensorAccessor grad_output, + GenericPackedTensorAccessor mean, + GenericPackedTensorAccessor invstd, + GenericPackedTensorAccessor sum_dy, + GenericPackedTensorAccessor sum_dy_xmu, + GenericPackedTensorAccessor grad_weight, + GenericPackedTensorAccessor grad_bias) { + + index_t plane = blockIdx.x; + + stat_accscalar_t r_mean = mean[plane]; + stat_accscalar_t factor = invstd[plane]; + + GradOp> g(r_mean, input, grad_output); + auto res = reduce>(g, grad_output, plane); + + if (threadIdx.x == 0) { + if (grad_weight.size(0) > 0) { + grad_weight[plane] = static_cast(res.v2 * factor); + } + if (grad_bias.size(0) > 0) { + grad_bias[plane] = static_cast(res.v1); + } + if (sum_dy.size(0) > 0) { + sum_dy[plane] = static_cast(res.v1); + } + if (sum_dy_xmu.size(0) > 0) { + sum_dy_xmu[plane] = static_cast(res.v2); + } + } +} + +template +__device__ __forceinline__ void batch_norm_backward_elemt_kernel_impl( + const GenericPackedTensorAccessor input, + const GenericPackedTensorAccessor grad_output, + const GenericPackedTensorAccessor mean, + const GenericPackedTensorAccessor invstd, + const GenericPackedTensorAccessor weight, + const GenericPackedTensorAccessor sum_dy, + const GenericPackedTensorAccessor sum_dy_xmu, + GenericPackedTensorAccessor grad_input, + const stat_accscalar_t norm_fct) { + index_t plane = blockIdx.x; + + if (plane >= input.size(1)) { + return; + } + + stat_accscalar_t m_c = mean[plane]; + stat_accscalar_t m_dy_c = sum_dy[plane] * norm_fct; + stat_accscalar_t factor_1_c = invstd[plane]; + stat_accscalar_t factor_2_c = weight.size(0) > 0 ? static_cast(weight[plane]) : stat_accscalar_t(1); + factor_2_c *= factor_1_c; + factor_1_c = factor_1_c * factor_1_c * sum_dy_xmu[plane] * norm_fct; + + index_t bs = input.size(0); + index_t fs = input.size(2); + + index_t bstep = blockDim.y * gridDim.y; + for (index_t batch = threadIdx.y + blockIdx.y * blockDim.y; batch < bs; batch += bstep) { + auto g_i = grad_input[batch][plane]; + auto g_o = grad_output[batch][plane]; + auto i = input[batch][plane]; + for (index_t feature = threadIdx.x; feature < fs; feature += blockDim.x) { + g_i[feature] = static_cast((g_o[feature] - m_dy_c - (i[feature] - m_c) * factor_1_c) * factor_2_c); + } + } +} + +template +__global__ void batch_norm_backward_elemt_kernel( + const GenericPackedTensorAccessor input, + const GenericPackedTensorAccessor grad_output, + const GenericPackedTensorAccessor mean, + const GenericPackedTensorAccessor invstd, + const GenericPackedTensorAccessor weight, + const GenericPackedTensorAccessor sum_dy, + const GenericPackedTensorAccessor sum_dy_xmu, + GenericPackedTensorAccessor grad_input, + const int* __restrict__ numel, const int world_size) { + int64_t total_numel = 0; + for (int i = 0; i < world_size; i ++) { + total_numel += numel[i]; + } + + const stat_accscalar_t norm_fct = + static_cast(1) / static_cast(total_numel); + batch_norm_backward_elemt_kernel_impl( + input, grad_output, mean, invstd, weight, sum_dy, sum_dy_xmu, grad_input, norm_fct); +} + +template +__global__ void batch_norm_backward_elemt_kernel( + const GenericPackedTensorAccessor input, + const GenericPackedTensorAccessor grad_output, + const GenericPackedTensorAccessor mean, + const GenericPackedTensorAccessor invstd, + const GenericPackedTensorAccessor weight, + const GenericPackedTensorAccessor sum_dy, + const GenericPackedTensorAccessor sum_dy_xmu, + GenericPackedTensorAccessor grad_input, + const stat_accscalar_t norm_fct) { + batch_norm_backward_elemt_kernel_impl( + input, grad_output, mean, invstd, weight, sum_dy, sum_dy_xmu, grad_input, norm_fct); +} + +template class PtrTraits = DefaultPtrTraits, typename index_t = int64_t> +static GenericPackedTensorAccessor get_packed_accessor( + const Tensor& t, c10::string_view var_name) { + constexpr auto expect_type = c10::CppTypeToScalarType::value; + const auto actual_type = t.scalar_type(); + TORCH_CHECK(actual_type == expect_type, "Expected ", var_name, + " to have type ", expect_type, " but got ", actual_type); + return t.generic_packed_accessor(); +} + +template class PtrTraits = DefaultPtrTraits, typename index_t = int64_t> +static GenericPackedTensorAccessor packed_accessor_or_dummy( + const Tensor& t, c10::string_view var_name) { + if (!t.defined()) { + const std::array zeros{{0}}; + return GenericPackedTensorAccessor(nullptr, zeros.data(), zeros.data()); + } + return get_packed_accessor(t, var_name); +} + +template +std::tuple batch_norm_backward_cuda_template(const Tensor& grad_out_, const Tensor& input_, const Tensor& weight_, + const Tensor& running_mean_, const Tensor& running_var_, const Tensor& save_mean_, const Tensor& save_invstd_, + bool train, double epsilon, std::array grad_input_mask) { + + using accscalar_t = at::acc_type; + Tensor grad_input_; + Tensor grad_input_reshaped; + Tensor grad_weight_; + Tensor grad_bias_; + auto input_reshaped = input_.reshape({input_.size(0), input_.size(1), -1}); + auto grad_output_reshaped = grad_out_.reshape(input_reshaped.sizes()); + + if (grad_input_mask[0]) { + grad_input_ = at::empty_like(input_, LEGACY_CONTIGUOUS_MEMORY_FORMAT); + grad_input_reshaped = grad_input_.view(input_reshaped.sizes()); + } + if (grad_input_mask[1]) { + grad_weight_ = at::empty_like(weight_, LEGACY_CONTIGUOUS_MEMORY_FORMAT); + } + if (grad_input_mask[2]) { + grad_bias_ = at::empty_like(weight_, LEGACY_CONTIGUOUS_MEMORY_FORMAT); + } + + auto input = get_packed_accessor< + input_scalar_t, 3, DefaultPtrTraits, index_t>(input_reshaped, "input"); + auto grad_output = get_packed_accessor< + input_scalar_t, 3, DefaultPtrTraits, index_t>(grad_output_reshaped, "grad_output"); + auto grad_input = packed_accessor_or_dummy< + input_scalar_t, 3, DefaultPtrTraits, index_t>(grad_input_reshaped, "grad_input"); + auto weight = packed_accessor_or_dummy< + stat_scalar_t, 1, DefaultPtrTraits, index_t>(weight_, "weight"); + auto grad_weight = packed_accessor_or_dummy< + stat_scalar_t, 1, DefaultPtrTraits, index_t>(grad_weight_, "grad_weight"); + auto grad_bias = packed_accessor_or_dummy< + stat_scalar_t, 1, DefaultPtrTraits, index_t>(grad_bias_, "grad_bias"); + auto running_mean = packed_accessor_or_dummy< + stat_scalar_t, 1, DefaultPtrTraits, index_t>(running_mean_, "running_mean"); + auto running_var = packed_accessor_or_dummy< + stat_scalar_t, 1, DefaultPtrTraits, index_t>(running_var_, "running_var"); + auto save_mean = packed_accessor_or_dummy< + accscalar_t, 1, DefaultPtrTraits, index_t>(save_mean_, "save_mean"); + auto save_invstd = packed_accessor_or_dummy< + accscalar_t, 1, DefaultPtrTraits, index_t>(save_invstd_, "save_invstd"); + + auto stream = at::cuda::getCurrentCUDAStream(); + dim3 blocks(input.size(1)); + int tf = getNumThreads(input.size(2)); + dim3 threads(tf, std::max(1, MAX_BLOCK_SIZE/tf)); + + batch_norm_backward_kernel <<>> + (input, grad_output, grad_input, grad_weight, grad_bias, weight, running_mean, running_var, + save_mean, save_invstd, train, epsilon); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + + return std::make_tuple(grad_input_, grad_weight_, grad_bias_); +} + +template +void batch_norm_stats_cuda_template( + const Tensor& out_mean, const Tensor& out_invstd, const Tensor& input_, double epsilon) { + + using accscalar_t = at::acc_type; + int64_t n_input = input_.size(1); + Tensor dummy_mean_; + Tensor dummy_var_; + auto input_reshaped = input_.reshape({input_.size(0), input_.size(1), -1}); // internally we merge the feature dimensions + + resize_output(out_mean, {n_input}); + resize_output(out_invstd, {n_input}); + auto input = get_packed_accessor< + scalar_t, 3, RestrictPtrTraits, index_t>(input_reshaped, "input"); + TORCH_INTERNAL_ASSERT(out_invstd.dim() == 1 && out_invstd.is_contiguous() && + out_invstd.sizes()[0]); + TORCH_INTERNAL_ASSERT(out_mean.dim() == 1 && out_mean.is_contiguous() && + out_mean.sizes()[0]); + + auto mean = packed_accessor_or_dummy< + accscalar_t, 1, RestrictPtrTraits, index_t>(out_mean, "out_mean"); + auto invstd = packed_accessor_or_dummy< + accscalar_t, 1, RestrictPtrTraits, index_t>(out_invstd, "out_invstd"); + auto stream = at::cuda::getCurrentCUDAStream(); + + dim3 blocks(input.size(1)); + int tf = getNumThreads(input.size(2)); + dim3 threads(tf, std::max(1, MAX_BLOCK_SIZE/tf)); + batch_norm_collect_statistics_kernel <<>> + (input, epsilon, 0.0, mean, invstd); + C10_CUDA_KERNEL_LAUNCH_CHECK(); +} + +template +void batch_norm_elemt_cuda_template(const Tensor& output_, const Tensor& input_, const Tensor& weight_, + const Tensor& bias_, const Tensor& mean_, const Tensor& invstd_) { + + using stat_accscalar_t = at::acc_type; + int64_t n_input = input_.size(1); + auto input_reshaped = input_.reshape({input_.size(0), input_.size(1), -1}); // internally we merge the feature dimensions + auto output_reshaped = output_.view({input_.size(0), input_.size(1), -1}); + + auto input = get_packed_accessor< + input_scalar_t, 3, RestrictPtrTraits, index_t>(input_reshaped, "input"); + auto output = get_packed_accessor< + input_scalar_t, 3, RestrictPtrTraits, index_t>(output_reshaped, "output"); + auto weight = packed_accessor_or_dummy< + stat_scalar_t, 1, RestrictPtrTraits, index_t>(weight_, "weight"); + auto bias = packed_accessor_or_dummy< + stat_scalar_t, 1, RestrictPtrTraits, index_t>(bias_, "bias"); + auto mean = packed_accessor_or_dummy< + stat_accscalar_t, 1, RestrictPtrTraits, index_t>(mean_, "mean"); + auto invstd = packed_accessor_or_dummy< + stat_accscalar_t, 1, RestrictPtrTraits, index_t>(invstd_, "invstd"); + auto stream = at::cuda::getCurrentCUDAStream(); + + // NOTE: We use transform_input_kernel in training mode, which ignores epsilon + const double dummy_epsilon = 1e-5; + + // The input_transform kernel is pointwise, but we need to balance reading parameters (save_var/mean, + // weight/bias) - which we only do once and have a for loop afterwards - with having many threads and blocks + // and good occupancy. Quiet likely, we could go with even more blocks than 1024. + // The various planes are independent, so we use blocks for them. + int tf = std::max(getNumThreads(input.size(2)/4), + std::min(getNumThreads(input.size(2)), 64)); + int tb = std::max(64/tf, 1); + dim3 blocks_trans(input.size(1), std::max(1, std::min((256*1024)/input.size(1), + (input.size(0)+tb-1)/tb))); + blocks_trans.y = std::min(blocks_trans.y, MAX_GRID_SIZE); + dim3 threads_trans(tf, tb); + batch_norm_transform_input_kernel <<>> + (input, output, mean, invstd, weight, bias, dummy_epsilon); + C10_CUDA_KERNEL_LAUNCH_CHECK(); +} + +template +std::tuple batch_norm_gather_stats_cuda_template(const Tensor& mean_, const Tensor& invstd_, + const Tensor& running_mean_, const Tensor& running_var_, + double momentum, double epsilon, const Tensor& counts_) { + + Tensor save_mean_; + Tensor save_invstd_; + + auto features = mean_.size(1); + auto input_options = mean_.options(); + if (mean_.scalar_type() == at::ScalarType::Half || mean_.scalar_type() == at::ScalarType::BFloat16) { + input_options = input_options.dtype(ScalarType::Float); + } + save_mean_ = at::empty({features}, input_options); + save_invstd_ = at::empty({features}, input_options); + + auto mean = packed_accessor_or_dummy< + accscalar_t, 2, RestrictPtrTraits, index_t>(mean_, "mean"); + auto invstd = packed_accessor_or_dummy< + accscalar_t, 2, RestrictPtrTraits, index_t>(invstd_, "invstd"); + auto running_mean = packed_accessor_or_dummy< + scalar_t, 1, RestrictPtrTraits, index_t>(running_mean_, "running_mean"); + auto running_var = packed_accessor_or_dummy< + scalar_t, 1, RestrictPtrTraits, index_t>(running_var_, "running_mean"); + auto counts = packed_accessor_or_dummy< + scalar_t, 1, RestrictPtrTraits, index_t>(counts_, "counts"); + + auto save_mean = get_packed_accessor< + accscalar_t, 1, RestrictPtrTraits, index_t>(save_mean_, "save_mean"); + auto save_invstd = get_packed_accessor< + accscalar_t, 1, RestrictPtrTraits, index_t>(save_invstd_, "save_invstd"); + auto stream = at::cuda::getCurrentCUDAStream(); + + int block = getNumThreads(features); + int grid = std::max(1, features/block); + batch_norm_reduce_statistics_kernel <<>> + (mean, invstd, save_mean, save_invstd, running_mean, running_var, epsilon, momentum, counts); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + + return std::make_tuple(save_mean_, save_invstd_); +} + +template +std::tuple batch_norm_backward_reduce_cuda_template(const Tensor& grad_out_, const Tensor& input_, + const Tensor& mean_, const Tensor& invstd_, const Tensor& weight_, + const bool input_g, const bool weight_g, const bool bias_g) { + + using stat_accscalar_t = at::acc_type; + int64_t n_input = input_.size(1); + Tensor sum_dy_; + Tensor sum_dy_xmu_; + Tensor grad_weight_; + Tensor grad_bias_; + auto input_reshaped = input_.reshape({input_.size(0), input_.size(1), -1}); // internally we merge the feature dimensions + auto grad_output_reshaped = grad_out_.reshape(input_reshaped.sizes()); + + if (input_g) { + sum_dy_ = at::empty_like(mean_, LEGACY_CONTIGUOUS_MEMORY_FORMAT); + sum_dy_xmu_ = at::empty_like(mean_, LEGACY_CONTIGUOUS_MEMORY_FORMAT); + } + if (weight_g) { + grad_weight_ = at::empty({n_input}, weight_.options()); + } + if (bias_g) { + grad_bias_ = at::empty({n_input}, weight_.options()); + } + + auto input = get_packed_accessor< + input_scalar_t, 3, DefaultPtrTraits, index_t>(input_reshaped, "input"); + auto grad_output = get_packed_accessor< + input_scalar_t, 3, DefaultPtrTraits, index_t>(grad_output_reshaped, "grad_output"); + auto grad_weight = packed_accessor_or_dummy< + stat_scalar_t, 1, DefaultPtrTraits, index_t>(grad_weight_, "grad_weight"); + auto grad_bias = packed_accessor_or_dummy< + stat_scalar_t, 1, DefaultPtrTraits, index_t>(grad_bias_, "grad_bias"); + auto mean = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(mean_, "mean"); + auto invstd = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(invstd_, "invstd"); + auto sum_dy = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(sum_dy_, "sum_dy"); + auto sum_dy_xmu = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(sum_dy_xmu_, "sum_dy_xmu"); + + auto batch_size = input_reshaped.size(0); + auto feature_size = input_reshaped.size(2); + auto stream = at::cuda::getCurrentCUDAStream(); + + int warp_size = at::cuda::warp_size(); + int block_y = std::min(lastPow2(batch_size), MAX_BLOCK_SIZE/warp_size); + // We want block_x to be at least a warp width + int block_x = std::min(std::max(getNumThreads(feature_size), warp_size), MAX_BLOCK_SIZE/block_y); + const dim3 block(block_x, block_y); + const dim3 grid(n_input); + + batch_norm_backward_reduce_kernel <<>> + (input, grad_output, mean, invstd, sum_dy, sum_dy_xmu, grad_weight, grad_bias); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + + return std::make_tuple(sum_dy_, sum_dy_xmu_, grad_weight_, grad_bias_); +} + +template +Tensor batch_norm_backward_elemt_cuda_template(const Tensor& grad_out_, const Tensor& input_, + const Tensor& mean_, const Tensor& invstd_, + const Tensor& weight_, const Tensor& sum_dy_, const Tensor& sum_dy_xmu_) { + + using stat_accscalar_t = at::acc_type; + int64_t n_input = input_.size(1); + auto input_reshaped = input_.reshape({input_.size(0), input_.size(1), -1}); // internally we merge the feature dimensions + auto grad_output_reshaped = grad_out_.reshape(input_reshaped.sizes()); + auto grad_input_reshaped = at::empty_like(input_reshaped, LEGACY_CONTIGUOUS_MEMORY_FORMAT); + + auto input = get_packed_accessor< + input_scalar_t, 3, DefaultPtrTraits, index_t>(input_reshaped, "input"); + auto grad_input = get_packed_accessor< + input_scalar_t, 3, DefaultPtrTraits, index_t>(grad_input_reshaped, "grad_input"); + auto grad_output = get_packed_accessor< + input_scalar_t, 3, DefaultPtrTraits, index_t>(grad_output_reshaped, "grad_output"); + auto mean = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(mean_, "mean"); + auto invstd = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(invstd_, "invstd"); + auto weight = packed_accessor_or_dummy< + stat_scalar_t, 1, DefaultPtrTraits, index_t>(weight_, "weight"); + auto sum_dy = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(sum_dy_, "sum_dy"); + auto sum_dy_xmu = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(sum_dy_xmu_, "sum_dy_xmu"); + + auto stream = at::cuda::getCurrentCUDAStream(); + + // The kernel is pointwise, but we need to balance reading parameters (save_var/mean, + // weight/bias) - which we only do once and have a for loop afterwards - with having many threads and blocks + // and good occupancy. Quiet likely, we could go with even more blocks than 1024. + // The various planes are independent, so we use blocks for them. + int tf = std::max(getNumThreads(input.size(2)/4), + std::min(getNumThreads(input.size(2)), 64)); + int tb = std::max(64/tf, 1); + dim3 blocks_trans(input.size(1), std::max(1, std::min((256*1024)/input.size(1), + (input.size(0)+tb-1)/tb))); + blocks_trans.y = std::min(blocks_trans.y, MAX_GRID_SIZE); + dim3 threads_trans(tf, tb); + auto reduction_size = input_.numel() / n_input; + auto norm_fct = static_cast(1.0 / reduction_size); + batch_norm_backward_elemt_kernel + <<>> + (input, grad_output, mean, invstd, weight, sum_dy, sum_dy_xmu, grad_input, norm_fct); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + + return grad_input_reshaped.view(input_.sizes()); +} + +template +Tensor batch_norm_backward_elemt_cuda_template(const Tensor& grad_out_, const Tensor& input_, + const Tensor& mean_, const Tensor& invstd_, + const Tensor& weight_, const Tensor& sum_dy_, const Tensor& sum_dy_xmu_, const Tensor& count) { + + using stat_accscalar_t = at::acc_type; + int64_t n_input = input_.size(1); + auto input_reshaped = input_.reshape({input_.size(0), input_.size(1), -1}); // internally we merge the feature dimensions + auto grad_output_reshaped = grad_out_.reshape(input_reshaped.sizes()); + auto grad_input_reshaped = at::empty_like(input_reshaped, LEGACY_CONTIGUOUS_MEMORY_FORMAT); + + auto input = get_packed_accessor< + input_scalar_t, 3, DefaultPtrTraits, index_t>(input_reshaped, "input"); + auto grad_input = get_packed_accessor< + input_scalar_t, 3, DefaultPtrTraits, index_t>(grad_input_reshaped, "grad_input"); + auto grad_output = get_packed_accessor< + input_scalar_t, 3, DefaultPtrTraits, index_t>(grad_output_reshaped, "grad_output"); + auto mean = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(mean_, "mean"); + auto invstd = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(invstd_, "invstd"); + auto weight = packed_accessor_or_dummy< + stat_scalar_t, 1, DefaultPtrTraits, index_t>(weight_, "weight"); + auto sum_dy = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(sum_dy_, "sum_dy"); + auto sum_dy_xmu = packed_accessor_or_dummy< + stat_accscalar_t, 1, DefaultPtrTraits, index_t>(sum_dy_xmu_, "sum_dy_xmu"); + + auto stream = at::cuda::getCurrentCUDAStream(); + + // The kernel is pointwise, but we need to balance reading parameters (save_var/mean, + // weight/bias) - which we only do once and have a for loop afterwards - with having many threads and blocks + // and good occupancy. Quiet likely, we could go with even more blocks than 1024. + // The various planes are independent, so we use blocks for them. + int tf = std::max(getNumThreads(input.size(2)/4), + std::min(getNumThreads(input.size(2)), 64)); + int tb = std::max(64/tf, 1); + dim3 blocks_trans(input.size(1), std::max(1, std::min((256*1024)/input.size(1), + (input.size(0)+tb-1)/tb))); + blocks_trans.y = std::min(blocks_trans.y, MAX_GRID_SIZE); + dim3 threads_trans(tf, tb); + batch_norm_backward_elemt_kernel <<>> + (input, grad_output, mean, invstd, weight, sum_dy, sum_dy_xmu, grad_input, count.const_data_ptr(), count.numel()); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + + return grad_input_reshaped.view(input_.sizes()); +} + +// welford kernel for c last tensor calculating mean/biased_variance/unbiased_variance +// original apex name: welford_kernel_c_last +template + +__global__ void +batch_norm_collect_statistics_channels_last_kernel( + const scalar_t* __restrict__ input, + accscalar_t* __restrict__ out_mean, + accscalar_t* __restrict__ out_invstd, + volatile accscalar_t* staging_data, + int* semaphores, + const int reduction_size, + const int stride, + accscalar_t epsilon) { + // hide latency with concurrency + accscalar_t x_mean[PARALLEL_LOADS]; + accscalar_t m_2_n[PARALLEL_LOADS]; + int count[PARALLEL_LOADS]; + +#pragma unroll + for (int i = 0; i < PARALLEL_LOADS; i++) { + x_mean[i] = accscalar_t(0); + m_2_n[i] = accscalar_t(0); + count[i] = accscalar_t(0); + } + // tensor dimension (m,c) + + // loop along m dimension + int inner_loop_stride = blockDim.y * gridDim.y; + + // offset along m dimension + int m_offset = blockIdx.y * blockDim.y + threadIdx.y; + int c_offset = blockIdx.x * blockDim.x + threadIdx.x; + + int loop_count = 1 + (reduction_size - 1) / (inner_loop_stride * PARALLEL_LOADS); + int address_base = m_offset * stride + c_offset; + int address_increment = inner_loop_stride * stride; + + for (int i = 0; i < loop_count; i++) { + accscalar_t x_math[PARALLEL_LOADS]; + accscalar_t x_count_inv[PARALLEL_LOADS]; + accscalar_t is_valid[PARALLEL_LOADS]; + + // load multiple data in +#pragma unroll + for (int j = 0; j < PARALLEL_LOADS; j++) { + if (c_offset < stride && m_offset < reduction_size) { + x_math[j] = input[address_base]; + count[j]++; + x_count_inv[j] = accscalar_t(1) / count[j]; + is_valid[j] = accscalar_t(1); + } else { + x_math[j] = accscalar_t(0); + x_count_inv[j] = accscalar_t(0); + is_valid[j] = accscalar_t(0); + } + m_offset += inner_loop_stride; + address_base += address_increment; + } + + // calculate mean/m2n with welford +#pragma unroll + for (int j = 0; j < PARALLEL_LOADS; j++) { + accscalar_t delta0 = x_math[j] - x_mean[j]; + x_mean[j] += delta0 * x_count_inv[j]; + accscalar_t delta1 = x_math[j] - x_mean[j]; + m_2_n[j] += delta0 * delta1 * is_valid[j]; + } + } + + // thread reduction to accumulate mean/m_2_n/count between PARALLEL_LOADS +#pragma unroll + for (int j = 1; j < PARALLEL_LOADS; j++) { + welford_merge_element(count[0], x_mean[0], m_2_n[0], count[j], x_mean[j], m_2_n[j]); + } + + // release x_mean / m_2_n + auto mean_th = x_mean[0]; + auto m2_th = m_2_n[0]; + auto count_th = count[0]; + + // block-wise reduction with shared memory (since reduction cannot be done within a warp) + static __shared__ accscalar_t shmem_mean[MAX_BLOCK_SIZE]; + static __shared__ accscalar_t shmem_m2n[MAX_BLOCK_SIZE]; + static __shared__ int shmem_count[MAX_BLOCK_SIZE]; + + welford_merge_block_vertical(count_th, mean_th, m2_th, shmem_count, shmem_mean, shmem_m2n); + + if (gridDim.y > 1) { + volatile accscalar_t* staging_mean = staging_data; + volatile accscalar_t* staging_m2n = &staging_data[stride*gridDim.y]; + volatile int* staging_count = reinterpret_cast(&staging_m2n[stride*gridDim.y]); + + address_base = c_offset + blockIdx.y * stride; + // write data to staging_data; + if (threadIdx.y == 0 && c_offset < stride) { + staging_mean[address_base] = mean_th; + staging_m2n[address_base] = m2_th; + staging_count[address_base] = count_th; + } + + __threadfence(); + __syncthreads(); // ensuring writes to staging_ is visible to all blocks + + __shared__ bool is_last_block_done; + // mark block done + if (threadIdx.x == 0 && threadIdx.y == 0) { + int old = atomicAdd(&semaphores[blockIdx.x], 1); + is_last_block_done = (old == (gridDim.y-1)); + } + + __syncthreads(); + + // check that all data is now available in global memory + if (is_last_block_done) { + count_th = 0; + mean_th = accscalar_t(0.0); + m2_th = accscalar_t(0.0); + + for (int y = threadIdx.y; y < gridDim.y; y += blockDim.y) { + address_base = c_offset + y * stride; + int count_new = c_offset < stride ? staging_count[address_base] : 0; + accscalar_t mean_new = c_offset < stride ? staging_mean[address_base] : accscalar_t(0.0); + accscalar_t m2n_new = c_offset < stride ? staging_m2n[address_base] : accscalar_t(0.0); + + welford_merge_element(count_th, mean_th, m2_th, count_new, mean_new, m2n_new); + } + + welford_merge_block_vertical(count_th, mean_th, m2_th, shmem_count, shmem_mean, shmem_m2n); + if (threadIdx.y == 0 && c_offset < stride) { + out_mean[c_offset] = static_cast(mean_th); + out_invstd[c_offset] = VarTransform{}(m2_th/count_th, epsilon); + } + } + } else { + if (blockIdx.y == 0 && threadIdx.y == 0 && c_offset < stride) { + out_mean[c_offset] = static_cast(mean_th); + out_invstd[c_offset] = VarTransform{}(m2_th/count_th, epsilon); + } + } +} + +// elementwise BN kernel +// original apex name: batchnorm_forward_c_last_kernel +template < + typename scalar_t, + typename accscalar_t, + typename layerscalar_t, + int PARALLEL_LOADS> +__global__ void batch_norm_transform_input_channels_last_kernel( + const scalar_t* __restrict__ input, + const scalar_t* __restrict__ z, + const accscalar_t* __restrict__ mean, + const accscalar_t* __restrict__ inv_std, + const layerscalar_t* __restrict__ weight, + const layerscalar_t* __restrict__ shift, + scalar_t* __restrict__ out, + const int reduction_size, + const int stride, + const bool fuse_relu) { + // tensor dimension (m,c) + // loop along m dimension + int inner_loop_stride = blockDim.y * gridDim.y; + + // offset along m dimension + int m_offset = blockIdx.y * blockDim.y + threadIdx.y; + int c_offset = blockIdx.x * blockDim.x + threadIdx.x; + + if (c_offset >= stride || m_offset >= reduction_size) { + return; + } + + auto m_c = mean[c_offset]; + auto inv_std_c = static_cast(inv_std[c_offset]); + auto w_c = weight == nullptr ? accscalar_t(1.0) : static_cast(weight[c_offset]); + auto s_c = shift == nullptr ? accscalar_t(0.0) : static_cast(shift[c_offset]); + + int loop_count = 1 + (reduction_size - 1) / (inner_loop_stride * PARALLEL_LOADS); + int address_base = m_offset * stride + c_offset; + int address_increment = inner_loop_stride * stride; + + for (int i = 0; i < loop_count; i++) { +#pragma unroll + for (int j = 0; j < PARALLEL_LOADS; j++) { + if (c_offset < stride && m_offset < reduction_size) { + auto tmp = w_c * (static_cast(input[address_base]) - m_c ) * inv_std_c + s_c; + if (z != nullptr) { + tmp += z[address_base]; + } + out[address_base] = (fuse_relu && tmp <= accscalar_t(0.0) ? scalar_t(0.0) : static_cast(tmp)); + } + m_offset += inner_loop_stride; + address_base += address_increment; + } + } +} + +template +__device__ __forceinline__ void merge_block_vertical_backward(T& sum_dy, + T& sum_dy_xmu, + T* shmem_sum_dy, + T* shmem_sum_dy_xmu) { + // write to shared memory + auto address_base = threadIdx.x + threadIdx.y * blockDim.x; + +#pragma unroll + for (int offset = blockDim.y/2; offset > 0; offset >>= 1) { + if (threadIdx.y < offset*2) { + shmem_sum_dy[address_base] = sum_dy; + shmem_sum_dy_xmu[address_base] = sum_dy_xmu; + } + __syncthreads(); + if (threadIdx.y < offset && threadIdx.y + offset < blockDim.y) { + auto address = address_base + offset * blockDim.x; + + sum_dy += shmem_sum_dy[address]; + sum_dy_xmu += shmem_sum_dy_xmu[address]; + } + } +} + +// batchnorm backward kernel for c last tensor +// original apex name: reduce_bn_c_last_kernel +template < + int PARALLEL_LOADS, + typename scalar_t, + typename accscalar_t, + typename layerscalar_t> +__global__ void batch_norm_backward_reduce_channels_last_kernel( + const scalar_t* __restrict__ input, + const scalar_t* __restrict__ grad_output, + const accscalar_t* __restrict__ mean, + const accscalar_t* __restrict__ inv_std, + accscalar_t* __restrict__ sum_dy_o, + accscalar_t* __restrict__ sum_dy_xmu_o, + layerscalar_t* __restrict__ grad_weight, + layerscalar_t* __restrict__ grad_bias, + volatile accscalar_t* staging_data, + int* semaphores, + const int reduction_size, + const int stride) { + + // hide latency with concurrency + accscalar_t sum_dy[PARALLEL_LOADS]; + accscalar_t sum_dy_xmu[PARALLEL_LOADS]; + +#pragma unroll + for (int i = 0; i < PARALLEL_LOADS; i++) { + sum_dy[i] = accscalar_t(0); + sum_dy_xmu[i] = accscalar_t(0); + } + // tensor dimension (m,c) + + // loop along m dimension + int inner_loop_stride = blockDim.y * gridDim.y; + + // offset along m dimension + int m_offset = blockIdx.y * blockDim.y + threadIdx.y; + int c_offset = blockIdx.x * blockDim.x + threadIdx.x; + + if (c_offset >= stride || m_offset >= reduction_size) { + return; + } + + int loop_count = 1 + (reduction_size - 1) / (inner_loop_stride * PARALLEL_LOADS); + int address_base = m_offset * stride + c_offset; + int address_increment = inner_loop_stride * stride; + + auto r_mean = mean[c_offset]; + auto factor = inv_std[c_offset]; + + for (int i = 0; i < loop_count; i++) { + accscalar_t x_input[PARALLEL_LOADS]; + accscalar_t x_grad_output[PARALLEL_LOADS]; + + // load multiple data in +#pragma unroll + for (int j = 0; j < PARALLEL_LOADS; j++) { + if (c_offset < stride && m_offset < reduction_size) { + x_input[j] = input[address_base]; + x_grad_output[j] = grad_output[address_base]; + } else { + x_input[j] = accscalar_t(0); + x_grad_output[j] = accscalar_t(0); + } + m_offset += inner_loop_stride; + address_base += address_increment; + } + + // calculate sum_dy / sum_dy_xmu +#pragma unroll + for (int j = 0; j < PARALLEL_LOADS; j++) { + sum_dy[j] += x_grad_output[j]; + sum_dy_xmu[j] += x_grad_output[j] * (x_input[j] - r_mean); + } + } + + // thread reduction to accumulate sum_dy / sum_dy_xmu between PARALLEL_LOADS +#pragma unroll + for (int j = 1; j < PARALLEL_LOADS; j++) { + sum_dy[0] += sum_dy[j]; + sum_dy_xmu[0] += sum_dy_xmu[j]; + } + + // release array of registers + auto sum_dy_th = sum_dy[0]; + auto sum_dy_xmu_th = sum_dy_xmu[0]; + + // block-wise reduction with shared memory (since reduction cannot be done within a warp) + static __shared__ accscalar_t shmem_sum_dy[MAX_BLOCK_SIZE]; + static __shared__ accscalar_t shmem_sum_dy_xmu[MAX_BLOCK_SIZE]; + + merge_block_vertical_backward(sum_dy_th, sum_dy_xmu_th, shmem_sum_dy, shmem_sum_dy_xmu); + + if (gridDim.y > 1) { + volatile accscalar_t* staging_sum_dy = staging_data; + volatile accscalar_t* staging_sum_dy_xmu = &staging_data[stride*gridDim.y]; + + address_base = c_offset + blockIdx.y * stride; + // write data to staging_data; + if (threadIdx.y == 0 && c_offset < stride) { + staging_sum_dy[address_base] = sum_dy_th; + staging_sum_dy_xmu[address_base] = sum_dy_xmu_th; + } + + __threadfence(); + __syncthreads(); // ensuring writes to staging_ is visible to all blocks + + __shared__ bool is_last_block_done; + // mark block done + if (threadIdx.x == 0 && threadIdx.y == 0) { + int old = atomicAdd(&semaphores[blockIdx.x], 1); + is_last_block_done = (old == (gridDim.y-1)); + } + + __syncthreads(); + + // check that all data is now available in global memory + if (is_last_block_done) { + sum_dy_th = accscalar_t(0.0); + sum_dy_xmu_th = accscalar_t(0.0); + + for (int y = threadIdx.y; y < gridDim.y; y += blockDim.y) { + address_base = c_offset + y * stride; + sum_dy_th += (c_offset < stride ? staging_sum_dy[address_base] : accscalar_t(0.0)); + sum_dy_xmu_th += (c_offset < stride ? staging_sum_dy_xmu[address_base] : accscalar_t(0.0)); + } + + merge_block_vertical_backward(sum_dy_th, sum_dy_xmu_th, shmem_sum_dy, shmem_sum_dy_xmu); + if (threadIdx.y == 0 && c_offset < stride) { + if (grad_bias != nullptr) { + grad_bias[c_offset] = static_cast(sum_dy_th); + } + if (grad_weight != nullptr) { + grad_weight[c_offset] = static_cast(sum_dy_xmu_th * factor); + } + //mean_dy[c_offset] = sum_dy_th / reduction_size; + //mean_dy_xmu[c_offset] = sum_dy_xmu_th / reduction_size; + sum_dy_o[c_offset] = sum_dy_th; + sum_dy_xmu_o[c_offset] = sum_dy_xmu_th; + } + } + } else { + if (blockIdx.y == 0 && threadIdx.y == 0 && c_offset < stride) { + if (grad_bias != nullptr) { + grad_bias[c_offset] = static_cast(sum_dy_th); + } + if (grad_weight != nullptr) { + grad_weight[c_offset] = static_cast(sum_dy_xmu_th * factor); + } + //mean_dy[c_offset] = sum_dy_th / reduction_size; + //mean_dy_xmu[c_offset] = sum_dy_xmu_th / reduction_size; + sum_dy_o[c_offset] = sum_dy_th; + sum_dy_xmu_o[c_offset] = sum_dy_xmu_th; + } + } +} + +// elementwise BN kernel +// original apex name: batchnorm_backward_c_last_kernel +template < + int PARALLEL_LOADS, + typename scalar_t, + typename accscalar_t, + typename layerscalar_t> +__device__ __forceinline__ void batch_norm_backward_elemt_channels_last_kernel_impl( + const scalar_t* __restrict__ grad_output, + const scalar_t* __restrict__ input, + const accscalar_t* __restrict__ mean, + const accscalar_t* __restrict__ inv_std, + const layerscalar_t* __restrict__ weight, + const accscalar_t* __restrict__ sum_dy, + const accscalar_t* __restrict__ sum_dy_xmu, + scalar_t* __restrict__ grad_input, + const accscalar_t norm_fct, + const int reduction_size, + const int stride) { + // tensor dimension (m,c) + // loop along m dimension + int inner_loop_stride = blockDim.y * gridDim.y; + + // offset along m dimension + int m_offset = blockIdx.y * blockDim.y + threadIdx.y; + int c_offset = blockIdx.x * blockDim.x + threadIdx.x; + + if (c_offset >= stride || m_offset >= reduction_size) { + return; + } + + auto m_c = mean[c_offset]; + auto m_dy_c = sum_dy[c_offset] * norm_fct; + auto factor_1_c = inv_std[c_offset]; + auto factor_2_c = (weight == nullptr? accscalar_t(1.0) : static_cast(weight[c_offset])) * factor_1_c; + factor_1_c = factor_1_c * factor_1_c * sum_dy_xmu[c_offset] * norm_fct; + + int loop_count = 1 + (reduction_size - 1) / (inner_loop_stride * PARALLEL_LOADS); + int address_base = m_offset * stride + c_offset; + int address_increment = inner_loop_stride * stride; + + for (int i = 0; i < loop_count; i++) { +#pragma unroll + for (int j = 0; j < PARALLEL_LOADS; j++) { + if (c_offset < stride && m_offset < reduction_size) { + grad_input[address_base] = static_cast( + (static_cast(grad_output[address_base]) - m_dy_c - + (static_cast(input[address_base]) - m_c) * factor_1_c) + * factor_2_c); + } + m_offset += inner_loop_stride; + address_base += address_increment; + } + } +} + +template < + int PARALLEL_LOADS, + typename scalar_t, + typename accscalar_t, + typename layerscalar_t> +__global__ void batch_norm_backward_elemt_channels_last_kernel( + const scalar_t* __restrict__ grad_output, + const scalar_t* __restrict__ input, + const accscalar_t* __restrict__ mean, + const accscalar_t* __restrict__ inv_std, + const layerscalar_t* __restrict__ weight, + const accscalar_t* __restrict__ sum_dy, + const accscalar_t* __restrict__ sum_dy_xmu, + const int* __restrict__ numel, + scalar_t* __restrict__ grad_input, + const int64_t world_size, + const int reduction_size, + const int stride) { + + int64_t total_numel = 0; + for (int i = 0; i < world_size; i++) { + total_numel += numel[i]; + } + + auto norm_fct = static_cast(1) / static_cast(total_numel); + batch_norm_backward_elemt_channels_last_kernel_impl( + grad_output, input, mean, inv_std, weight, sum_dy, sum_dy_xmu, + grad_input, norm_fct, reduction_size, stride); +} + +template < + int PARALLEL_LOADS, + typename scalar_t, + typename accscalar_t, + typename layerscalar_t> +__global__ void batch_norm_backward_elemt_channels_last_kernel( + const scalar_t* __restrict__ grad_output, + const scalar_t* __restrict__ input, + const accscalar_t* __restrict__ mean, + const accscalar_t* __restrict__ inv_std, + const layerscalar_t* __restrict__ weight, + const accscalar_t* __restrict__ sum_dy, + const accscalar_t* __restrict__ sum_dy_xmu, + scalar_t* __restrict__ grad_input, + const accscalar_t norm_fct, + const int reduction_size, + const int stride) { + batch_norm_backward_elemt_channels_last_kernel_impl( + grad_output, input, mean, inv_std, weight, sum_dy, sum_dy_xmu, + grad_input, norm_fct, reduction_size, stride); +} + +template +void batch_norm_stats_channels_last_cuda_template( + const Tensor& out_mean, const Tensor& out_invstd, const Tensor& input, double epsilon) { + using accscalar_t = at::acc_type; + + const auto stride = input.sizes()[1]; + const auto reduction_size = input.numel() / stride; + + resize_output(out_mean, {stride}); + resize_output(out_invstd, {stride}); + TORCH_INTERNAL_ASSERT(out_invstd.dim() == 1 && out_invstd.is_contiguous() && + out_invstd.sizes()[0]); + TORCH_INTERNAL_ASSERT(out_mean.dim() == 1 && out_mean.is_contiguous() && + out_mean.sizes()[0]); + + dim3 block; + dim3 grid; + flexible_launch_configs(reduction_size, stride, block, grid, true); + + at::Tensor staging_data; + at::Tensor semaphores; + if (grid.y > 1) { + staging_data = at::empty({4*stride*grid.y}, out_mean.options()); + semaphores = at::zeros({grid.x}, input.options().dtype(at::kInt)); + } + + accscalar_t* staging_data_ptr = grid.y > 1 ? staging_data.mutable_data_ptr() : nullptr; + int* semaphores_ptr = grid.y > 1 ? semaphores.mutable_data_ptr() : nullptr; + batch_norm_collect_statistics_channels_last_kernel + <<>>( + input.const_data_ptr(), + out_mean.mutable_data_ptr(), + out_invstd.mutable_data_ptr(), + staging_data_ptr, + semaphores_ptr, + reduction_size, + stride, + epsilon); + C10_CUDA_KERNEL_LAUNCH_CHECK(); +} + +void batch_norm_elemt_channels_last_cuda_template( + const at::Tensor& output, + const at::Tensor& input, + const at::Tensor& weight, + const at::Tensor& shift, // bias of BN + const at::Tensor& mean, + const at::Tensor& inv_std, + const at::optional& z = c10::nullopt, // bias after BN + const bool fuse_relu = false) { + const auto stride = input.sizes()[1]; + const auto reduction_size = input.numel() / stride; + + dim3 block; + dim3 grid; + flexible_launch_configs(reduction_size, stride, block, grid); + + auto stream = at::cuda::getCurrentCUDAStream(); + const auto second_dtype = weight.defined() ? weight.scalar_type() : + (shift.defined() ? shift.scalar_type() : input.scalar_type()); + + if (input.scalar_type() != second_dtype) { + AT_DISPATCH_FLOATING_TYPES_AND2(kHalf, kBFloat16, input.scalar_type(), "batchnorm_forward", [&] { + using accscalar_t = at::acc_type; + batch_norm_transform_input_channels_last_kernel + <<>>( + input.const_data_ptr(), + z.has_value() ? z.value().const_data_ptr() : nullptr, + mean.const_data_ptr(), + inv_std.const_data_ptr(), + weight.defined() ? weight.const_data_ptr() : nullptr, + shift.defined() ? shift.const_data_ptr() : nullptr, + output.mutable_data_ptr(), + reduction_size, + stride, + fuse_relu); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + }); + } else { + if (weight.defined()){ + TORCH_CHECK(input.scalar_type() == weight.scalar_type(), "batchnorm_forward: input.scalar_type() ", input.scalar_type(), + " is not supported with weight.scalar_type() ", weight.scalar_type()); + } + AT_DISPATCH_FLOATING_TYPES_AND2(kHalf, kBFloat16, input.scalar_type(), "batchnorm_forward", [&] { + using accscalar_t = at::acc_type; + batch_norm_transform_input_channels_last_kernel + <<>>( + input.const_data_ptr(), + z.has_value() ? z.value().const_data_ptr() : nullptr, + mean.const_data_ptr(), + inv_std.const_data_ptr(), + weight.defined() ? weight.const_data_ptr() : nullptr, + shift.defined() ? shift.const_data_ptr(): nullptr, + output.mutable_data_ptr(), + reduction_size, + stride, + fuse_relu); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + }); + } +} + +std::tuple +batch_norm_backward_reduce_cuda_channels_last_template(const at::Tensor& grad_output, + const at::Tensor& input, + const at::Tensor& mean, + const at::Tensor& inv_std, + const at::Tensor& weight, + const bool input_g, const bool weight_g, const bool bias_g) { + const auto stride = input.sizes()[1]; + const auto reduction_size = input.numel() / stride; + + at::Tensor sumn_dy = at::empty({stride}, mean.options()); + at::Tensor sum_dy_xmu = at::empty({stride}, mean.options()); + + at::Tensor grad_weight; + at::Tensor grad_bias; + if (weight.defined()) { + grad_weight = at::empty({stride}, weight.options()); + grad_bias = at::empty({stride}, weight.options()); + } else { + // because I cannot return an uninitialized at::Tensor + grad_weight = at::empty({0}, mean.options()); + grad_bias = at::empty({0}, mean.options()); + } + + dim3 block; + dim3 grid; + flexible_launch_configs(reduction_size, stride, block, grid, true); + + at::Tensor staging_data; + at::Tensor semaphores; + if (grid.y > 1) { + staging_data = at::empty({2*stride*grid.y}, mean.options()); + semaphores = at::zeros({grid.x}, input.options().dtype(at::kInt)); + } + auto stream = at::cuda::getCurrentCUDAStream(); + + if (weight.defined() && input.scalar_type() != weight.scalar_type()) { + AT_DISPATCH_FLOATING_TYPES_AND2(kHalf, kBFloat16, input.scalar_type(), "batchnorm_backward_reduce", [&] { + using accscalar_t = at::acc_type; + accscalar_t* staging_data_ptr = grid.y > 1 ? staging_data.mutable_data_ptr() : nullptr; + int* semaphores_ptr = grid.y > 1 ? semaphores.mutable_data_ptr() : nullptr; + batch_norm_backward_reduce_channels_last_kernel + <<>>( + input.const_data_ptr(), + grad_output.const_data_ptr(), + mean.const_data_ptr(), + inv_std.const_data_ptr(), + sumn_dy.mutable_data_ptr(), + sum_dy_xmu.mutable_data_ptr(), + grad_weight.mutable_data_ptr(), + grad_bias.mutable_data_ptr(), + staging_data_ptr, + semaphores_ptr, + reduction_size, + stride); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + }); + } else { + if (weight.defined()) { + TORCH_CHECK(input.scalar_type() == weight.scalar_type(), "batchnorm_backward_reduce: input.scalar_type() ", input.scalar_type(), + " is not supported with weight.scalar_type() ", weight.scalar_type()); + } + AT_DISPATCH_FLOATING_TYPES_AND2(kHalf, kBFloat16, input.scalar_type(), "batchnorm_backward_reduce", [&] { + using accscalar_t = at::acc_type; + accscalar_t* staging_data_ptr = grid.y > 1 ? staging_data.mutable_data_ptr() : nullptr; + int* semaphores_ptr = grid.y > 1 ? semaphores.mutable_data_ptr() : nullptr; + batch_norm_backward_reduce_channels_last_kernel + <<>>( + input.const_data_ptr(), + grad_output.const_data_ptr(), + mean.const_data_ptr(), + inv_std.const_data_ptr(), + sumn_dy.mutable_data_ptr(), + sum_dy_xmu.mutable_data_ptr(), + weight.defined() ? grad_weight.mutable_data_ptr() : nullptr, + weight.defined() ? grad_bias.mutable_data_ptr() : nullptr, + staging_data_ptr, + semaphores_ptr, + reduction_size, + stride); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + }); + } + + return std::make_tuple(sumn_dy, sum_dy_xmu, grad_weight, grad_bias); +} + +at::Tensor batch_norm_backward_elemt_channels_last_cuda_template( + const at::Tensor& grad_output, + const at::Tensor& input, + const at::Tensor& mean, + const at::Tensor& inv_std, + const at::Tensor& weight, + const at::Tensor& sum_dy, + const at::Tensor& sum_dy_xmu, + const at::Tensor& count) { + const auto stride = input.sizes()[1]; + const auto reduction_size = input.numel() / stride; + + // Input is guarunteed to be channels-last compatible + at::Tensor grad_input = at::empty_like(input); + + dim3 block; + dim3 grid; + flexible_launch_configs(reduction_size, stride, block, grid); + + auto stream = at::cuda::getCurrentCUDAStream(); + + if (weight.defined() && weight.scalar_type() != input.scalar_type()) { + AT_DISPATCH_FLOATING_TYPES_AND2(kHalf, kBFloat16, input.scalar_type(), "batchnorm_backward_element", [&] { + using accscalar_t = at::acc_type; + batch_norm_backward_elemt_channels_last_kernel + <<>>( + grad_output.const_data_ptr(), + input.const_data_ptr(), + mean.const_data_ptr(), + inv_std.const_data_ptr(), + weight.const_data_ptr(), + sum_dy.const_data_ptr(), + sum_dy_xmu.const_data_ptr(), + count.const_data_ptr(), + grad_input.mutable_data_ptr(), + count.numel(), + reduction_size, + stride); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + }); + } else { + if (weight.defined()) { + TORCH_CHECK(input.scalar_type() == weight.scalar_type(), "batchnorm_backward_element: input.scalar_type() ", input.scalar_type(), + " is not supported with weight.scalar_type() ", weight.scalar_type()); + } + AT_DISPATCH_FLOATING_TYPES_AND2(at::ScalarType::Half, at::ScalarType::BFloat16, input.scalar_type(), "batchnorm_backward_element", [&] { + using accscalar_t = at::acc_type; + batch_norm_backward_elemt_channels_last_kernel + <<>>( + grad_output.const_data_ptr(), + input.const_data_ptr(), + mean.const_data_ptr(), + inv_std.const_data_ptr(), + weight.defined() ? weight.const_data_ptr() : nullptr, + sum_dy.const_data_ptr(), + sum_dy_xmu.const_data_ptr(), + count.const_data_ptr(), + grad_input.mutable_data_ptr(), + count.numel(), + reduction_size, + stride); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + }); + } + + return grad_input; +} + +at::Tensor batch_norm_backward_elemt_channels_last_cuda_template( + const at::Tensor& grad_output, + const at::Tensor& input, + const at::Tensor& mean, + const at::Tensor& inv_std, + const at::Tensor& weight, + const at::Tensor& sum_dy, + const at::Tensor& sum_dy_xmu) { + const auto stride = input.sizes()[1]; + const auto reduction_size = input.numel() / stride; + auto norm_fct = 1.0 / reduction_size; + + // Input is guarunteed to be channels-last compatible + at::Tensor grad_input = at::empty_like(input); + + dim3 block; + dim3 grid; + flexible_launch_configs(reduction_size, stride, block, grid); + + auto stream = at::cuda::getCurrentCUDAStream(); + + AT_DISPATCH_FLOATING_TYPES_AND2(kHalf, kBFloat16, input.scalar_type(), "batchnorm_backward_element", [&] { + using accscalar_t = at::acc_type; + + if (weight.defined() && weight.scalar_type() != input.scalar_type()) { + batch_norm_backward_elemt_channels_last_kernel + <<>>( + grad_output.const_data_ptr(), + input.const_data_ptr(), + mean.const_data_ptr(), + inv_std.const_data_ptr(), + weight.const_data_ptr(), + sum_dy.const_data_ptr(), + sum_dy_xmu.const_data_ptr(), + grad_input.mutable_data_ptr(), + static_cast(norm_fct), + reduction_size, + stride); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + } else { + batch_norm_backward_elemt_channels_last_kernel + <<>>( + grad_output.const_data_ptr(), + input.const_data_ptr(), + mean.const_data_ptr(), + inv_std.const_data_ptr(), + weight.defined() ? weight.const_data_ptr() : nullptr, + sum_dy.const_data_ptr(), + sum_dy_xmu.const_data_ptr(), + grad_input.mutable_data_ptr(), + static_cast(norm_fct), + reduction_size, + stride); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + } + }); + + return grad_input; +} + +} } // namespace at::native diff --git a/shared/package-files/08/08a1238a4ed855f48918be1a6ee72d92696421484086ffb1d9a51c5e24d1f5bd/blob b/shared/package-files/08/08a1238a4ed855f48918be1a6ee72d92696421484086ffb1d9a51c5e24d1f5bd/blob new file mode 100644 index 0000000000000000000000000000000000000000..2e04f5266dc1e9c5a15f130af5f9c596f8bd7ef9 --- /dev/null +++ b/shared/package-files/08/08a1238a4ed855f48918be1a6ee72d92696421484086ffb1d9a51c5e24d1f5bd/blob @@ -0,0 +1,22 @@ +from numpy.testing import assert_ +import numpy.distutils.fcompiler + +nag_version_strings = [('nagfor', 'NAG Fortran Compiler Release ' + '6.2(Chiyoda) Build 6200', '6.2'), + ('nagfor', 'NAG Fortran Compiler Release ' + '6.1(Tozai) Build 6136', '6.1'), + ('nagfor', 'NAG Fortran Compiler Release ' + '6.0(Hibiya) Build 1021', '6.0'), + ('nagfor', 'NAG Fortran Compiler Release ' + '5.3.2(971)', '5.3.2'), + ('nag', 'NAGWare Fortran 95 compiler Release 5.1' + '(347,355-367,375,380-383,389,394,399,401-402,407,' + '431,435,437,446,459-460,463,472,494,496,503,508,' + '511,517,529,555,557,565)', '5.1')] + +class TestNagFCompilerVersions: + def test_version_match(self): + for comp, vs, version in nag_version_strings: + fc = numpy.distutils.fcompiler.new_fcompiler(compiler=comp) + v = fc.version_match(vs) + assert_(v == version) diff --git a/shared/package-files/08/08a1a12eacafc58d26966cbcfc76f85b391275660f51a536c99621cfed22679c/blob b/shared/package-files/08/08a1a12eacafc58d26966cbcfc76f85b391275660f51a536c99621cfed22679c/blob new file mode 100644 index 0000000000000000000000000000000000000000..21916530040ac321180692d1a0811da4ae36a056 --- /dev/null +++ b/shared/package-files/08/08a1a12eacafc58d26966cbcfc76f85b391275660f51a536c99621cfed22679c/blob @@ -0,0 +1,60 @@ +class State: + ''' + A representation of a state managed by a ``StateMachine``. + + Attributes: + name (instance of FreeGroupElement or string) -- State name which is also assigned to the Machine. + transisitons (OrderedDict) -- Represents all the transitions of the state object. + state_type (string) -- Denotes the type (accept/start/dead) of the state. + rh_rule (instance of FreeGroupElement) -- right hand rule for dead state. + state_machine (instance of StateMachine object) -- The finite state machine that the state belongs to. + ''' + + def __init__(self, name, state_machine, state_type=None, rh_rule=None): + self.name = name + self.transitions = {} + self.state_machine = state_machine + self.state_type = state_type[0] + self.rh_rule = rh_rule + + def add_transition(self, letter, state): + ''' + Add a transition from the current state to a new state. + + Keyword Arguments: + letter -- The alphabet element the current state reads to make the state transition. + state -- This will be an instance of the State object which represents a new state after in the transition after the alphabet is read. + + ''' + self.transitions[letter] = state + +class StateMachine: + ''' + Representation of a finite state machine the manages the states and the transitions of the automaton. + + Attributes: + states (dictionary) -- Collection of all registered `State` objects. + name (str) -- Name of the state machine. + ''' + + def __init__(self, name, automaton_alphabet): + self.name = name + self.automaton_alphabet = automaton_alphabet + self.states = {} # Contains all the states in the machine. + self.add_state('start', state_type='s') + + def add_state(self, state_name, state_type=None, rh_rule=None): + ''' + Instantiate a state object and stores it in the 'states' dictionary. + + Arguments: + state_name (instance of FreeGroupElement or string) -- name of the new states. + state_type (string) -- Denotes the type (accept/start/dead) of the state added. + rh_rule (instance of FreeGroupElement) -- right hand rule for dead state. + + ''' + new_state = State(state_name, self, state_type, rh_rule) + self.states[state_name] = new_state + + def __repr__(self): + return "%s" % (self.name) diff --git a/shared/package-files/08/08a228701495e29ad130f479d0d2fa5b105350b05ad7345ea2aa3b66d6ef0ac7/blob b/shared/package-files/08/08a228701495e29ad130f479d0d2fa5b105350b05ad7345ea2aa3b66d6ef0ac7/blob new file mode 100644 index 0000000000000000000000000000000000000000..30f0245242583c5ea162de9e5443da67d7111465 --- /dev/null +++ b/shared/package-files/08/08a228701495e29ad130f479d0d2fa5b105350b05ad7345ea2aa3b66d6ef0ac7/blob @@ -0,0 +1,242 @@ +r""" +A role and directive to display mathtext in Sphinx +================================================== + +The ``mathmpl`` Sphinx extension creates a mathtext image in Matplotlib and +shows it in html output. Thus, it is a true and faithful representation of what +you will see if you pass a given LaTeX string to Matplotlib (see +:ref:`mathtext`). + +.. warning:: + In most cases, you will likely want to use one of `Sphinx's builtin Math + extensions + `__ + instead of this one. The builtin Sphinx math directive uses MathJax to + render mathematical expressions, and addresses accessibility concerns that + ``mathmpl`` doesn't address. + +Mathtext may be included in two ways: + +1. Inline, using the role:: + + This text uses inline math: :mathmpl:`\alpha > \beta`. + + which produces: + + This text uses inline math: :mathmpl:`\alpha > \beta`. + +2. Standalone, using the directive:: + + Here is some standalone math: + + .. mathmpl:: + + \alpha > \beta + + which produces: + + Here is some standalone math: + + .. mathmpl:: + + \alpha > \beta + +Options +------- + +The ``mathmpl`` role and directive both support the following options: + +fontset : str, default: 'cm' + The font set to use when displaying math. See :rc:`mathtext.fontset`. + +fontsize : float + The font size, in points. Defaults to the value from the extension + configuration option defined below. + +Configuration options +--------------------- + +The mathtext extension has the following configuration options: + +mathmpl_fontsize : float, default: 10.0 + Default font size, in points. + +mathmpl_srcset : list of str, default: [] + Additional image sizes to generate when embedding in HTML, to support + `responsive resolution images + `__. + The list should contain additional x-descriptors (``'1.5x'``, ``'2x'``, + etc.) to generate (1x is the default and always included.) + +""" + +import hashlib +from pathlib import Path + +from docutils import nodes +from docutils.parsers.rst import Directive, directives +import sphinx +from sphinx.errors import ConfigError, ExtensionError + +import matplotlib as mpl +from matplotlib import _api, mathtext +from matplotlib.rcsetup import validate_float_or_None + + +# Define LaTeX math node: +class latex_math(nodes.General, nodes.Element): + pass + + +def fontset_choice(arg): + return directives.choice(arg, mathtext.MathTextParser._font_type_mapping) + + +def math_role(role, rawtext, text, lineno, inliner, + options={}, content=[]): + i = rawtext.find('`') + latex = rawtext[i+1:-1] + node = latex_math(rawtext) + node['latex'] = latex + node['fontset'] = options.get('fontset', 'cm') + node['fontsize'] = options.get('fontsize', + setup.app.config.mathmpl_fontsize) + return [node], [] +math_role.options = {'fontset': fontset_choice, + 'fontsize': validate_float_or_None} + + +class MathDirective(Directive): + """ + The ``.. mathmpl::`` directive, as documented in the module's docstring. + """ + has_content = True + required_arguments = 0 + optional_arguments = 0 + final_argument_whitespace = False + option_spec = {'fontset': fontset_choice, + 'fontsize': validate_float_or_None} + + def run(self): + latex = ''.join(self.content) + node = latex_math(self.block_text) + node['latex'] = latex + node['fontset'] = self.options.get('fontset', 'cm') + node['fontsize'] = self.options.get('fontsize', + setup.app.config.mathmpl_fontsize) + return [node] + + +# This uses mathtext to render the expression +def latex2png(latex, filename, fontset='cm', fontsize=10, dpi=100): + with mpl.rc_context({'mathtext.fontset': fontset, 'font.size': fontsize}): + try: + depth = mathtext.math_to_image( + f"${latex}$", filename, dpi=dpi, format="png") + except Exception: + _api.warn_external(f"Could not render math expression {latex}") + depth = 0 + return depth + + +# LaTeX to HTML translation stuff: +def latex2html(node, source): + inline = isinstance(node.parent, nodes.TextElement) + latex = node['latex'] + fontset = node['fontset'] + fontsize = node['fontsize'] + name = 'math-{}'.format( + hashlib.sha256( + f'{latex}{fontset}{fontsize}'.encode(), + usedforsecurity=False, + ).hexdigest()[-10:]) + + destdir = Path(setup.app.builder.outdir, '_images', 'mathmpl') + destdir.mkdir(parents=True, exist_ok=True) + + dest = destdir / f'{name}.png' + depth = latex2png(latex, dest, fontset, fontsize=fontsize) + + srcset = [] + for size in setup.app.config.mathmpl_srcset: + filename = f'{name}-{size.replace(".", "_")}.png' + latex2png(latex, destdir / filename, fontset, fontsize=fontsize, + dpi=100 * float(size[:-1])) + srcset.append( + f'{setup.app.builder.imgpath}/mathmpl/{filename} {size}') + if srcset: + srcset = (f'srcset="{setup.app.builder.imgpath}/mathmpl/{name}.png, ' + + ', '.join(srcset) + '" ') + + if inline: + cls = '' + else: + cls = 'class="center" ' + if inline and depth != 0: + style = 'style="position: relative; bottom: -%dpx"' % (depth + 1) + else: + style = '' + + return (f'') + + +def _config_inited(app, config): + # Check for srcset hidpi images + for i, size in enumerate(app.config.mathmpl_srcset): + if size[-1] == 'x': # "2x" = "2.0" + try: + float(size[:-1]) + except ValueError: + raise ConfigError( + f'Invalid value for mathmpl_srcset parameter: {size!r}. ' + 'Must be a list of strings with the multiplicative ' + 'factor followed by an "x". e.g. ["2.0x", "1.5x"]') + else: + raise ConfigError( + f'Invalid value for mathmpl_srcset parameter: {size!r}. ' + 'Must be a list of strings with the multiplicative ' + 'factor followed by an "x". e.g. ["2.0x", "1.5x"]') + + +def setup(app): + setup.app = app + app.add_config_value('mathmpl_fontsize', 10.0, True) + app.add_config_value('mathmpl_srcset', [], True) + try: + app.connect('config-inited', _config_inited) # Sphinx 1.8+ + except ExtensionError: + app.connect('env-updated', lambda app, env: _config_inited(app, None)) + + # Add visit/depart methods to HTML-Translator: + def visit_latex_math_html(self, node): + source = self.document.attributes['source'] + self.body.append(latex2html(node, source)) + + def depart_latex_math_html(self, node): + pass + + # Add visit/depart methods to LaTeX-Translator: + def visit_latex_math_latex(self, node): + inline = isinstance(node.parent, nodes.TextElement) + if inline: + self.body.append('$%s$' % node['latex']) + else: + self.body.extend(['\\begin{equation}', + node['latex'], + '\\end{equation}']) + + def depart_latex_math_latex(self, node): + pass + + app.add_node(latex_math, + html=(visit_latex_math_html, depart_latex_math_html), + latex=(visit_latex_math_latex, depart_latex_math_latex)) + app.add_role('mathmpl', math_role) + app.add_directive('mathmpl', MathDirective) + if sphinx.version_info < (1, 8): + app.add_role('math', math_role) + app.add_directive('math', MathDirective) + + metadata = {'parallel_read_safe': True, 'parallel_write_safe': True} + return metadata diff --git a/shared/package-files/08/08a22cd6886ea1ae62ab72dbd00f8510cc2a92eb8e122c3a4c8a04c0cffafc10/blob b/shared/package-files/08/08a22cd6886ea1ae62ab72dbd00f8510cc2a92eb8e122c3a4c8a04c0cffafc10/blob new file mode 100644 index 0000000000000000000000000000000000000000..edc4b0590568cbfc02a6fbfb9f9a3e7cc10d6fc1 --- /dev/null +++ b/shared/package-files/08/08a22cd6886ea1ae62ab72dbd00f8510cc2a92eb8e122c3a4c8a04c0cffafc10/blob @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_use_cudnn_rnn_flatten_weight() -> bool +inline bool _use_cudnn_rnn_flatten_weight() { + return at::_ops::_use_cudnn_rnn_flatten_weight::call(); +} + +} diff --git a/shared/package-files/08/08a5be5e50fa494bbda4bcb152dea9f25e6e63337e46392b1aa9e38be0eea7b6/blob b/shared/package-files/08/08a5be5e50fa494bbda4bcb152dea9f25e6e63337e46392b1aa9e38be0eea7b6/blob new file mode 100644 index 0000000000000000000000000000000000000000..bc5f46914bed19ab74b5b5734c766543bf9a413d --- /dev/null +++ b/shared/package-files/08/08a5be5e50fa494bbda4bcb152dea9f25e6e63337e46392b1aa9e38be0eea7b6/blob @@ -0,0 +1,14 @@ +from typing import Any + +from django.test import LiveServerTestCase + +class SeleniumTestCaseBase: + browsers: Any = ... + browser: Any = ... + @classmethod + def import_webdriver(cls, browser: Any): ... + def create_webdriver(self): ... + +class SeleniumTestCase(LiveServerTestCase): + implicit_wait: int = ... + def disable_implicit_wait(self) -> None: ... diff --git a/shared/package-files/08/08a79528ea262e9008647da2a6db346b617dba0c9d1f5982bdf20695fbed11b7/blob b/shared/package-files/08/08a79528ea262e9008647da2a6db346b617dba0c9d1f5982bdf20695fbed11b7/blob new file mode 100644 index 0000000000000000000000000000000000000000..cb0474fb0ee05dda3b01263b4f03dae343e15c83 --- /dev/null +++ b/shared/package-files/08/08a79528ea262e9008647da2a6db346b617dba0c9d1f5982bdf20695fbed11b7/blob @@ -0,0 +1,4 @@ +from typing import Any + +# Explicitly mark this package as incomplete. +def __getattr__(name: str) -> Any: ... diff --git a/shared/package-files/08/08ac7fc4cc17c91d445c4c7b0c5ad7648afc39dae9c99de6da1b56882586be04/blob b/shared/package-files/08/08ac7fc4cc17c91d445c4c7b0c5ad7648afc39dae9c99de6da1b56882586be04/blob new file mode 100644 index 0000000000000000000000000000000000000000..6ca710a71a18e73d09ab496e7f8fe6f9afadb354 --- /dev/null +++ b/shared/package-files/08/08ac7fc4cc17c91d445c4c7b0c5ad7648afc39dae9c99de6da1b56882586be04/blob @@ -0,0 +1,94 @@ +from typing import Any, NamedTuple, Optional, Text + +class _URLTuple(NamedTuple): + scheme: Any + netloc: Any + path: Any + query: Any + fragment: Any + +class BaseURL(_URLTuple): + def replace(self, **kwargs): ... + @property + def host(self): ... + @property + def ascii_host(self): ... + @property + def port(self): ... + @property + def auth(self): ... + @property + def username(self): ... + @property + def raw_username(self): ... + @property + def password(self): ... + @property + def raw_password(self): ... + def decode_query(self, *args, **kwargs): ... + def join(self, *args, **kwargs): ... + def to_url(self): ... + def decode_netloc(self): ... + def to_uri_tuple(self): ... + def to_iri_tuple(self): ... + def get_file_location(self, pathformat: Optional[Any] = ...): ... + +class URL(BaseURL): + def encode_netloc(self): ... + def encode(self, charset: Text = ..., errors: Text = ...): ... + +class BytesURL(BaseURL): + def encode_netloc(self): ... + def decode(self, charset: Text = ..., errors: Text = ...): ... + +def url_parse(url, scheme: Optional[Any] = ..., allow_fragments: bool = ...): ... +def url_quote(string, charset: Text = ..., errors: Text = ..., safe: str = ..., unsafe: str = ...): ... +def url_quote_plus(string, charset: Text = ..., errors: Text = ..., safe: str = ...): ... +def url_unparse(components): ... +def url_unquote(string, charset: Text = ..., errors: Text = ..., unsafe: str = ...): ... +def url_unquote_plus(s, charset: Text = ..., errors: Text = ...): ... +def url_fix(s, charset: Text = ...): ... +def uri_to_iri(uri, charset: Text = ..., errors: Text = ...): ... +def iri_to_uri(iri, charset: Text = ..., errors: Text = ..., safe_conversion: bool = ...): ... +def url_decode( + s, + charset: Text = ..., + decode_keys: bool = ..., + include_empty: bool = ..., + errors: Text = ..., + separator: str = ..., + cls: Optional[Any] = ..., +): ... +def url_decode_stream( + stream, + charset: Text = ..., + decode_keys: bool = ..., + include_empty: bool = ..., + errors: Text = ..., + separator: str = ..., + cls: Optional[Any] = ..., + limit: Optional[Any] = ..., + return_iterator: bool = ..., +): ... +def url_encode( + obj, charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., key: Optional[Any] = ..., separator: bytes = ... +): ... +def url_encode_stream( + obj, + stream: Optional[Any] = ..., + charset: Text = ..., + encode_keys: bool = ..., + sort: bool = ..., + key: Optional[Any] = ..., + separator: bytes = ..., +): ... +def url_join(base, url, allow_fragments: bool = ...): ... + +class Href: + base: Any + charset: Text + sort: Any + key: Any + def __init__(self, base: str = ..., charset: Text = ..., sort: bool = ..., key: Optional[Any] = ...): ... + def __getattr__(self, name): ... + def __call__(self, *path, **query): ... diff --git a/shared/package-files/08/08b8092063fe3c24ed22c342ce4a83171d76028507d2b36a2619f6fe90b076fd/blob b/shared/package-files/08/08b8092063fe3c24ed22c342ce4a83171d76028507d2b36a2619f6fe90b076fd/blob new file mode 100644 index 0000000000000000000000000000000000000000..bd1dbd8529bfd596fcae684f2790bce0b961cdfc --- /dev/null +++ b/shared/package-files/08/08b8092063fe3c24ed22c342ce4a83171d76028507d2b36a2619f6fe90b076fd/blob @@ -0,0 +1,140 @@ +# - Config file for the Caffe2 package +# It defines the following variable(s) +# CAFFE2_INCLUDE_DIRS - include directories for FooBar +# as well as Caffe2 targets for other cmake libraries to use. + +# library version information + +# Utils functions. +include("${CMAKE_CURRENT_LIST_DIR}/public/utils.cmake") + +# Depending on whether Caffe2 uses gflags during compile time or +# not, invoke gflags. +if(OFF) + include("${CMAKE_CURRENT_LIST_DIR}/public/gflags.cmake") + if(NOT TARGET gflags) + message(FATAL_ERROR + "Your installed Caffe2 version uses gflags but the gflags library " + "cannot be found. Did you accidentally remove it, or have you set " + "the right CMAKE_PREFIX_PATH and/or GFLAGS_ROOT_DIR? If you do not " + "have gflags, you will need to install gflags and set the library " + "path accordingly.") + endif() +endif() + +# Depending on whether Caffe2 uses glog during compile time or +# not, invoke glog. +if(OFF) + include("${CMAKE_CURRENT_LIST_DIR}/public/glog.cmake") + if(NOT TARGET glog::glog) + message(FATAL_ERROR + "Your installed Caffe2 version uses glog but the glog library " + "cannot be found. Did you accidentally remove it, or have you set " + "the right CMAKE_PREFIX_PATH and/or GFLAGS_ROOT_DIR? If you do not " + "have glog, you will need to install glog and set the library " + "path accordingly.") + endif() +endif() + +# Protobuf +if(ON) + if(NOT TARGET protobuf::libprotobuf) + # Define protobuf::libprotobuf as a dummy target to resolve references to + # protobuf::libprotobuf in Caffe2Targets.cmake. + add_library(dummy INTERFACE) + add_library(protobuf::libprotobuf ALIAS dummy) + endif() +else() + include("${CMAKE_CURRENT_LIST_DIR}/public/protobuf.cmake") + if(NOT TARGET protobuf::libprotobuf) + message(FATAL_ERROR + "Your installed Caffe2 version uses protobuf but the protobuf library " + "cannot be found. Did you accidentally remove it, or have you set " + "the right CMAKE_PREFIX_PATH? If you do not have protobuf, you will " + "need to install protobuf and set the library path accordingly.") + endif() + message(STATUS "Caffe2: Protobuf version " ${Protobuf_VERSION}) + # If during build time we know the protobuf version, we will also do a sanity + # check to ensure that the protobuf library that Caffe2 found is consistent + # with the compiled version. + if(FALSE) + if(NOT (${Protobuf_VERSION} VERSION_EQUAL Protobuf_VERSION_NOTFOUND)) + message(FATAL_ERROR + "Your installed Caffe2 is built with protobuf " + "Protobuf_VERSION_NOTFOUND" + ", while your current cmake setting discovers protobuf version " + ${Protobuf_VERSION} + ". Please specify a protobuf version that is the same as the built " + "version.") + endif() + endif() +endif() + +if (OFF) + include("${CMAKE_CURRENT_LIST_DIR}/public/LoadHIP.cmake") +endif() + +if(ON) + # The file public/cuda.cmake exclusively uses CAFFE2_USE_*. + # If Caffe2 was compiled with the libraries below, they must + # be found again when including the Caffe2 target. + set(CAFFE2_USE_CUDA ON) + set(CAFFE2_USE_TENSORRT OFF) + + # Add current directory to module path so we pick up FindCUDAToolkit.cmake + set(old_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + include("${CMAKE_CURRENT_LIST_DIR}/public/cuda.cmake") + set(CMAKE_MODULE_PATH "${old_CMAKE_MODULE_PATH}") + + if(ON AND NOT CAFFE2_USE_CUDA) + message(FATAL_ERROR + "Your installed Caffe2 version uses CUDA but I cannot find the CUDA " + "libraries. Please set the proper CUDA prefixes and / or install " + "CUDA.") + endif() + if(OFF AND NOT CAFFE2_USE_TENSORRT) + message(FATAL_ERROR + "Your installed Caffe2 version uses TensorRT but I cannot find the TensorRT " + "libraries. Please set the proper TensorRT prefixes and / or install " + "TensorRT.") + endif() +endif() + +if(OFF) + # Add current directory to module path so we pick up FindSYCLToolkit.cmake + set(old_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + include("${CMAKE_CURRENT_LIST_DIR}/public/xpu.cmake") + set(CMAKE_MODULE_PATH "${old_CMAKE_MODULE_PATH}") +endif() + +if(ON) + include("${CMAKE_CURRENT_LIST_DIR}/public/mkl.cmake") +endif() + +if(ON) + include("${CMAKE_CURRENT_LIST_DIR}/public/mkldnn.cmake") +endif() + +# import targets +include ("${CMAKE_CURRENT_LIST_DIR}/Caffe2Targets.cmake") + +# Interface libraries, that allows one to build proper link flags. +# We will also define a helper variable, Caffe2_MAIN_LIBS, that resolves to +# the main caffe2 libraries in cases of cuda presence / absence. +set(Caffe2_MAIN_LIBS torch_library) + +# include directory. +# +# Newer versions of CMake set the INTERFACE_INCLUDE_DIRECTORIES property +# of the imported targets. It is hence not necessary to add this path +# manually to the include search path for targets which link to gflags. +# The following lines are here for backward compatibility, in case one +# would like to use the old-style include path. +get_filename_component( + CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +# Note: the current list dir is _INSTALL_PREFIX/share/cmake/Gloo. +get_filename_component( + _INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) +set(CAFFE2_INCLUDE_DIRS "${_INSTALL_PREFIX}/include") diff --git a/shared/package-files/08/08ba6e0fd5733dc6285e3f1d67699e4a8a9b5971ce382e55e43e9d14d757aa68/blob b/shared/package-files/08/08ba6e0fd5733dc6285e3f1d67699e4a8a9b5971ce382e55e43e9d14d757aa68/blob new file mode 100644 index 0000000000000000000000000000000000000000..d10fd90b9cdafd187d2cc278c1536921f857f935 --- /dev/null +++ b/shared/package-files/08/08ba6e0fd5733dc6285e3f1d67699e4a8a9b5971ce382e55e43e9d14d757aa68/blob @@ -0,0 +1,260 @@ +from ctypes import byref, c_char, c_char_p, c_int, c_size_t, c_void_p, POINTER +from enum import IntEnum +from numba.core import config +from numba.cuda.cudadrv.error import (NvrtcError, NvrtcCompilationError, + NvrtcSupportError) + +import functools +import os +import threading +import warnings + +# Opaque handle for compilation unit +nvrtc_program = c_void_p + +# Result code +nvrtc_result = c_int + + +class NvrtcResult(IntEnum): + NVRTC_SUCCESS = 0 + NVRTC_ERROR_OUT_OF_MEMORY = 1 + NVRTC_ERROR_PROGRAM_CREATION_FAILURE = 2 + NVRTC_ERROR_INVALID_INPUT = 3 + NVRTC_ERROR_INVALID_PROGRAM = 4 + NVRTC_ERROR_INVALID_OPTION = 5 + NVRTC_ERROR_COMPILATION = 6 + NVRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7 + NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8 + NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9 + NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10 + NVRTC_ERROR_INTERNAL_ERROR = 11 + + +_nvrtc_lock = threading.Lock() + + +class NvrtcProgram: + """ + A class for managing the lifetime of nvrtcProgram instances. Instances of + the class own an nvrtcProgram; when an instance is deleted, the underlying + nvrtcProgram is destroyed using the appropriate NVRTC API. + """ + def __init__(self, nvrtc, handle): + self._nvrtc = nvrtc + self._handle = handle + + @property + def handle(self): + return self._handle + + def __del__(self): + if self._handle: + self._nvrtc.destroy_program(self) + + +class NVRTC: + """ + Provides a Pythonic interface to the NVRTC APIs, abstracting away the C API + calls. + + The sole instance of this class is a process-wide singleton, similar to the + NVVM interface. Initialization is protected by a lock and uses the standard + (for Numba) open_cudalib function to load the NVRTC library. + """ + _PROTOTYPES = { + # nvrtcResult nvrtcVersion(int *major, int *minor) + 'nvrtcVersion': (nvrtc_result, POINTER(c_int), POINTER(c_int)), + # nvrtcResult nvrtcCreateProgram(nvrtcProgram *prog, + # const char *src, + # const char *name, + # int numHeaders, + # const char * const *headers, + # const char * const *includeNames) + 'nvrtcCreateProgram': (nvrtc_result, nvrtc_program, c_char_p, c_char_p, + c_int, POINTER(c_char_p), POINTER(c_char_p)), + # nvrtcResult nvrtcDestroyProgram(nvrtcProgram *prog); + 'nvrtcDestroyProgram': (nvrtc_result, POINTER(nvrtc_program)), + # nvrtcResult nvrtcCompileProgram(nvrtcProgram prog, + # int numOptions, + # const char * const *options) + 'nvrtcCompileProgram': (nvrtc_result, nvrtc_program, c_int, + POINTER(c_char_p)), + # nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, size_t *ptxSizeRet); + 'nvrtcGetPTXSize': (nvrtc_result, nvrtc_program, POINTER(c_size_t)), + # nvrtcResult nvrtcGetPTX(nvrtcProgram prog, char *ptx); + 'nvrtcGetPTX': (nvrtc_result, nvrtc_program, c_char_p), + # nvrtcResult nvrtcGetCUBINSize(nvrtcProgram prog, + # size_t *cubinSizeRet); + 'nvrtcGetCUBINSize': (nvrtc_result, nvrtc_program, POINTER(c_size_t)), + # nvrtcResult nvrtcGetCUBIN(nvrtcProgram prog, char *cubin); + 'nvrtcGetCUBIN': (nvrtc_result, nvrtc_program, c_char_p), + # nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, + # size_t *logSizeRet); + 'nvrtcGetProgramLogSize': (nvrtc_result, nvrtc_program, + POINTER(c_size_t)), + # nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, char *log); + 'nvrtcGetProgramLog': (nvrtc_result, nvrtc_program, c_char_p), + } + + # Singleton reference + __INSTANCE = None + + def __new__(cls): + with _nvrtc_lock: + if cls.__INSTANCE is None: + from numba.cuda.cudadrv.libs import open_cudalib + cls.__INSTANCE = inst = object.__new__(cls) + try: + lib = open_cudalib('nvrtc') + except OSError as e: + cls.__INSTANCE = None + raise NvrtcSupportError("NVRTC cannot be loaded") from e + + # Find & populate functions + for name, proto in inst._PROTOTYPES.items(): + func = getattr(lib, name) + func.restype = proto[0] + func.argtypes = proto[1:] + + @functools.wraps(func) + def checked_call(*args, func=func, name=name): + error = func(*args) + if error == NvrtcResult.NVRTC_ERROR_COMPILATION: + raise NvrtcCompilationError() + elif error != NvrtcResult.NVRTC_SUCCESS: + try: + error_name = NvrtcResult(error).name + except ValueError: + error_name = ('Unknown nvrtc_result ' + f'(error code: {error})') + msg = f'Failed to call {name}: {error_name}' + raise NvrtcError(msg) + + setattr(inst, name, checked_call) + + return cls.__INSTANCE + + def get_version(self): + """ + Get the NVRTC version as a tuple (major, minor). + """ + major = c_int() + minor = c_int() + self.nvrtcVersion(byref(major), byref(minor)) + return major.value, minor.value + + def create_program(self, src, name): + """ + Create an NVRTC program with managed lifetime. + """ + if isinstance(src, str): + src = src.encode() + if isinstance(name, str): + name = name.encode() + + handle = nvrtc_program() + + # The final three arguments are for passing the contents of headers - + # this is not supported, so there are 0 headers and the header names + # and contents are null. + self.nvrtcCreateProgram(byref(handle), src, name, 0, None, None) + return NvrtcProgram(self, handle) + + def compile_program(self, program, options): + """ + Compile an NVRTC program. Compilation may fail due to a user error in + the source; this function returns ``True`` if there is a compilation + error and ``False`` on success. + """ + # We hold a list of encoded options to ensure they can't be collected + # prior to the call to nvrtcCompileProgram + encoded_options = [opt.encode() for opt in options] + option_pointers = [c_char_p(opt) for opt in encoded_options] + c_options_type = (c_char_p * len(options)) + c_options = c_options_type(*option_pointers) + try: + self.nvrtcCompileProgram(program.handle, len(options), c_options) + return False + except NvrtcCompilationError: + return True + + def destroy_program(self, program): + """ + Destroy an NVRTC program. + """ + self.nvrtcDestroyProgram(byref(program.handle)) + + def get_compile_log(self, program): + """ + Get the compile log as a Python string. + """ + log_size = c_size_t() + self.nvrtcGetProgramLogSize(program.handle, byref(log_size)) + + log = (c_char * log_size.value)() + self.nvrtcGetProgramLog(program.handle, log) + + return log.value.decode() + + def get_ptx(self, program): + """ + Get the compiled PTX as a Python string. + """ + ptx_size = c_size_t() + self.nvrtcGetPTXSize(program.handle, byref(ptx_size)) + + ptx = (c_char * ptx_size.value)() + self.nvrtcGetPTX(program.handle, ptx) + + return ptx.value.decode() + + +def compile(src, name, cc): + """ + Compile a CUDA C/C++ source to PTX for a given compute capability. + + :param src: The source code to compile + :type src: str + :param name: The filename of the source (for information only) + :type name: str + :param cc: A tuple ``(major, minor)`` of the compute capability + :type cc: tuple + :return: The compiled PTX and compilation log + :rtype: tuple + """ + nvrtc = NVRTC() + program = nvrtc.create_program(src, name) + + # Compilation options: + # - Compile for the current device's compute capability. + # - The CUDA include path is added. + # - Relocatable Device Code (rdc) is needed to prevent device functions + # being optimized away. + major, minor = cc + arch = f'--gpu-architecture=compute_{major}{minor}' + include = f'-I{config.CUDA_INCLUDE_PATH}' + + cudadrv_path = os.path.dirname(os.path.abspath(__file__)) + numba_cuda_path = os.path.dirname(cudadrv_path) + numba_include = f'-I{numba_cuda_path}' + options = [arch, include, numba_include, '-rdc', 'true'] + + # Compile the program + compile_error = nvrtc.compile_program(program, options) + + # Get log from compilation + log = nvrtc.get_compile_log(program) + + # If the compile failed, provide the log in an exception + if compile_error: + msg = (f'NVRTC Compilation failure whilst compiling {name}:\n\n{log}') + raise NvrtcError(msg) + + # Otherwise, if there's any content in the log, present it as a warning + if log: + msg = (f"NVRTC log messages whilst compiling {name}:\n\n{log}") + warnings.warn(msg) + + ptx = nvrtc.get_ptx(program) + return ptx, log diff --git a/shared/package-files/08/08bd93a0572a48a4d6fdd82afe0f01eff38d7608fd4fd982e29caeaaee6c3350/blob b/shared/package-files/08/08bd93a0572a48a4d6fdd82afe0f01eff38d7608fd4fd982e29caeaaee6c3350/blob new file mode 100644 index 0000000000000000000000000000000000000000..3f9191a91e481c60156325284e3b8d055e429fb8 Binary files /dev/null and b/shared/package-files/08/08bd93a0572a48a4d6fdd82afe0f01eff38d7608fd4fd982e29caeaaee6c3350/blob differ diff --git a/shared/package-files/08/08c90e45d5ec692c8bfb83749f7ec2c9cd650abdb666c5b2ba0f7f41955ed04d/blob b/shared/package-files/08/08c90e45d5ec692c8bfb83749f7ec2c9cd650abdb666c5b2ba0f7f41955ed04d/blob new file mode 100644 index 0000000000000000000000000000000000000000..8fad7c6b0bef4b13898a94f4004726837cde975e Binary files /dev/null and b/shared/package-files/08/08c90e45d5ec692c8bfb83749f7ec2c9cd650abdb666c5b2ba0f7f41955ed04d/blob differ diff --git a/shared/package-files/08/08c9feda6b4a9318af52b6858aefee128074c932b8d991dba0cfeec85ed8850b/blob b/shared/package-files/08/08c9feda6b4a9318af52b6858aefee128074c932b8d991dba0cfeec85ed8850b/blob new file mode 100644 index 0000000000000000000000000000000000000000..6370c6cb19f27aa29b000ec642f42796ef37861d --- /dev/null +++ b/shared/package-files/08/08c9feda6b4a9318af52b6858aefee128074c932b8d991dba0cfeec85ed8850b/blob @@ -0,0 +1,35013 @@ +{ + "initialization": { + "distribution": "Normal(0,0.01)", + "seed": 20261021, + "pretrained_weights": false + }, + "training_data": "all 19880 supplied training shots per condition; all 130 conditions", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "validation_manifest_sha256": "482bb7268c6c827ebbf1f756ee6994750acfcd011adab08eaa2ada703e5faea1", + "calibration_exception": "Supplied even-fitted DEMs include validation syndromes but no logical labels or test data.", + "optimizer": "L-BFGS-B binary cross entropy plus 1e-5 L2, maximum 300 iterations", + "selection": "First trained candidate; validation reported without parameter fitting or hyperparameter selection", + "test_data_used": false, + "released_per_shot_predictions_used": false, + "history": [ + { + "group": "d3_bX_center_3_5", + "train_loss": 0.49244210477855016, + "iterations": 88, + "failure": 0.26941105769230766, + "plain_failure": 0.2847205528846154, + "correlated_failure": 0.2704326923076923, + "coset_failure": 0.2847205528846154, + "optimizer_success": true + }, + { + "group": "d3_bX_center_5_3", + "train_loss": 0.4947914557869911, + "iterations": 85, + "failure": 0.2706430288461538, + "plain_failure": 0.29103064903846154, + "correlated_failure": 0.27076322115384616, + "coset_failure": 0.29103064903846154, + "optimizer_success": true + }, + { + "group": "d3_bX_center_5_7", + "train_loss": 0.4786369068642458, + "iterations": 79, + "failure": 0.25964543269230766, + "plain_failure": 0.2741887019230769, + "correlated_failure": 0.2598106971153846, + "coset_failure": 0.2741887019230769, + "optimizer_success": true + }, + { + "group": "d3_bX_center_7_5", + "train_loss": 0.48299120621578956, + "iterations": 81, + "failure": 0.26062199519230766, + "plain_failure": 0.2762920673076923, + "correlated_failure": 0.2615234375, + "coset_failure": 0.2762920673076923, + "optimizer_success": true + }, + { + "group": "d3_bZ_center_3_5", + "train_loss": 0.4903180822446507, + "iterations": 62, + "failure": 0.2718299278846154, + "plain_failure": 0.2878605769230769, + "correlated_failure": 0.2736778846153846, + "coset_failure": 0.2878605769230769, + "optimizer_success": true + }, + { + "group": "d3_bZ_center_5_3", + "train_loss": 0.4886621962442568, + "iterations": 90, + "failure": 0.25896935096153845, + "plain_failure": 0.27548076923076925, + "correlated_failure": 0.2588942307692308, + "coset_failure": 0.27548076923076925, + "optimizer_success": true + }, + { + "group": "d3_bZ_center_5_7", + "train_loss": 0.4822654448634678, + "iterations": 71, + "failure": 0.2594200721153846, + "plain_failure": 0.2823016826923077, + "correlated_failure": 0.25961538461538464, + "coset_failure": 0.2823016826923077, + "optimizer_success": true + }, + { + "group": "d3_bZ_center_7_5", + "train_loss": 0.47379411844328495, + "iterations": 69, + "failure": 0.2542067307692308, + "plain_failure": 0.27393329326923077, + "correlated_failure": 0.2547776442307692, + "coset_failure": 0.27393329326923077, + "optimizer_success": true + }, + { + "group": "d5_bX_center_5_5", + "train_loss": 0.4801955727360068, + "iterations": 85, + "failure": 0.2616887019230769, + "plain_failure": 0.293359375, + "correlated_failure": 0.2609375, + "coset_failure": 0.293359375, + "optimizer_success": true + }, + { + "group": "d5_bZ_center_5_5", + "train_loss": 0.4661361209861219, + "iterations": 87, + "failure": 0.2465294471153846, + "plain_failure": 0.2799729567307692, + "correlated_failure": 0.24618389423076922, + "coset_failure": 0.2799729567307692, + "optimizer_success": true + } + ], + "elapsed_seconds": 30.247901678085327, + "experiment_2": { + "method": "Exact contraction of supplied DEM for d3; learned logistic mixture with matching features", + "initialization": { + "distribution": "Normal(0,0.01)", + "seed": 20261022, + "pretrained_weights": false + }, + "selection": "Minimum validation condition-mean failure per group among raw exact, calibrated exact, exact plus matching ensemble", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "exact_raw": { + "failure": 0.253125 + }, + "exact_calibrated": { + "failure": 0.25378605769230766, + "train_loss": 0.46127817271552574, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.2522686298076923, + "train_loss": 0.459112999306209, + "iterations": 115 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "exact_raw": { + "failure": 0.2569711538461538 + }, + "exact_calibrated": { + "failure": 0.25790264423076925, + "train_loss": 0.46654812103904, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.257421875, + "train_loss": 0.4647701206688181, + "iterations": 80 + } + }, + "selected": "exact_raw" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "exact_raw": { + "failure": 0.23622295673076923 + }, + "exact_calibrated": { + "failure": 0.23608774038461539, + "train_loss": 0.43883548729746, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.2357421875, + "train_loss": 0.43779428254411507, + "iterations": 82 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "exact_raw": { + "failure": 0.24507211538461537 + }, + "exact_calibrated": { + "failure": 0.24541766826923078, + "train_loss": 0.4551514021617466, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.24453125, + "train_loss": 0.4531701181347552, + "iterations": 87 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "exact_raw": { + "failure": 0.25402644230769234 + }, + "exact_calibrated": { + "failure": 0.2541316105769231, + "train_loss": 0.4629309494609537, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.25310997596153845, + "train_loss": 0.45978815429050657, + "iterations": 96 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "exact_raw": { + "failure": 0.24298377403846153 + }, + "exact_calibrated": { + "failure": 0.24182692307692308, + "train_loss": 0.4539302799880139, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.2408203125, + "train_loss": 0.45299183982324187, + "iterations": 100 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "exact_raw": { + "failure": 0.24226262019230768 + }, + "exact_calibrated": { + "failure": 0.24166165865384615, + "train_loss": 0.4465993958308988, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.24064002403846155, + "train_loss": 0.4446921891727968, + "iterations": 121 + } + }, + "selected": "exact_ensemble" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "exact_raw": { + "failure": 0.23793569711538462 + }, + "exact_calibrated": { + "failure": 0.2377253605769231, + "train_loss": 0.43773570264641537, + "iterations": 8 + }, + "exact_ensemble": { + "failure": 0.2367638221153846, + "train_loss": 0.4363258121838859, + "iterations": 103 + } + }, + "selected": "exact_ensemble" + } + ], + "numerical_check": "r01 all syndromes agrees with exhaustive enumeration to 1.2e-7" + }, + "experiment_3": { + "method": "Exact complementary CSS edge posterior marginals reweight joint error probabilities before relevant CSS exact contraction; induced correlations are factorized", + "initialization": { + "distribution": "Normal(0,0.01)", + "seed": 20261024, + "pretrained_weights": false + }, + "training": "4096 training shots sampled without replacement from each of all 26 d5 conditions, RNG seed 20261023; original matching components retain their all-training-shot fit", + "selection": "Minimum full-validation condition-mean failure per group among previous matching, raw conditional (strength 1), calibrated conditional, and learned combination of strengths 0/.5/1 with matching", + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "matching": { + "failure": 0.2616887019230769 + }, + "conditional_raw": { + "failure": 0.24053485576923078 + }, + "conditional_calibrated": { + "failure": 0.24064002403846155, + "train_loss": 0.4375296643032495, + "iterations": 8 + }, + "conditional_ensemble": { + "failure": 0.24024939903846154, + "train_loss": 0.43518462432711086, + "iterations": 107 + } + }, + "selected": "conditional_ensemble" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "matching": { + "failure": 0.2465294471153846 + }, + "conditional_raw": { + "failure": 0.229296875 + }, + "conditional_calibrated": { + "failure": 0.22944711538461537, + "train_loss": 0.42155058672043744, + "iterations": 9 + }, + "conditional_ensemble": { + "failure": 0.22627704326923076, + "train_loss": 0.4183033939719488, + "iterations": 150 + } + }, + "selected": "conditional_ensemble" + } + ], + "approximation": "Complementary-check conditioning induces error dependencies. This candidate uses their marginal probabilities independently; d5 contraction is therefore approximate." + }, + "contextual_d3_pilot": { + "training": { + "initialization": "Random variance-scaled normal first two layers, random Normal(0,.001) output; zero biases; seed 20261025", + "architecture": "Two 32-unit SiLU layers, output 2*tanh correction to original hyperedge logit; 40 local detection bits and 57 static error/geometry features", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 512, + "batch_size": 128, + "optimizer": "AdamW 1e-3, weight decay 1e-4, global gradient norm clip 1", + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 512, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.5264908075332642, + "error": 0.2578125, + "gradient_norm": 0.06699763983488083, + "elapsed": 432.866411447525 + }, + { + "step": 16, + "loss": 0.3703196942806244, + "error": 0.1484375, + "gradient_norm": 0.030896008014678955, + "elapsed": 437.98383259773254 + }, + { + "step": 32, + "loss": 0.5410848259925842, + "error": 0.3125, + "gradient_norm": 0.023287978023290634, + "elapsed": 443.36136960983276 + }, + { + "step": 48, + "loss": 0.6548658609390259, + "error": 0.3984375, + "gradient_norm": 0.08600008487701416, + "elapsed": 448.5753285884857 + }, + { + "step": 64, + "loss": 0.3396199345588684, + "error": 0.1875, + "gradient_norm": 0.09408964961767197, + "elapsed": 453.55865502357483 + }, + { + "step": 80, + "loss": 0.22403547167778015, + "error": 0.09375, + "gradient_norm": 0.11353142559528351, + "elapsed": 458.8852906227112 + }, + { + "step": 96, + "loss": 0.5754531621932983, + "error": 0.34375, + "gradient_norm": 0.10487920045852661, + "elapsed": 466.05401706695557 + }, + { + "step": 112, + "loss": 0.6411566734313965, + "error": 0.4609375, + "gradient_norm": 0.0897318571805954, + "elapsed": 472.25429010391235 + }, + { + "step": 128, + "loss": 0.4312451481819153, + "error": 0.1875, + "gradient_norm": 0.024307778105139732, + "elapsed": 477.15532541275024 + }, + { + "step": 144, + "loss": 0.18217915296554565, + "error": 0.0625, + "gradient_norm": 0.02471880242228508, + "elapsed": 481.5596089363098 + }, + { + "step": 160, + "loss": 0.3044101595878601, + "error": 0.140625, + "gradient_norm": 0.11279744654893875, + "elapsed": 485.47020196914673 + }, + { + "step": 176, + "loss": 0.6485109329223633, + "error": 0.421875, + "gradient_norm": 0.09296684712171555, + "elapsed": 489.5691695213318 + }, + { + "step": 192, + "loss": 0.2566836178302765, + "error": 0.09375, + "gradient_norm": 0.03372751921415329, + "elapsed": 493.5000331401825 + }, + { + "step": 208, + "loss": 0.5453524589538574, + "error": 0.296875, + "gradient_norm": 0.09404441714286804, + "elapsed": 497.62110686302185 + }, + { + "step": 224, + "loss": 0.19316628575325012, + "error": 0.0859375, + "gradient_norm": 0.03877737745642662, + "elapsed": 501.7119605541229 + }, + { + "step": 240, + "loss": 0.5537517070770264, + "error": 0.328125, + "gradient_norm": 0.030214278027415276, + "elapsed": 505.71154594421387 + }, + { + "step": 256, + "loss": 0.5224764347076416, + "error": 0.2734375, + "gradient_norm": 0.13780595362186432, + "elapsed": 509.65054631233215 + }, + { + "step": 272, + "loss": 0.5350009202957153, + "error": 0.3046875, + "gradient_norm": 0.08942794054746628, + "elapsed": 553.2619364261627 + }, + { + "step": 288, + "loss": 0.4561898112297058, + "error": 0.21875, + "gradient_norm": 0.02774384245276451, + "elapsed": 557.1897430419922 + }, + { + "step": 304, + "loss": 0.6102809309959412, + "error": 0.390625, + "gradient_norm": 0.04374801740050316, + "elapsed": 561.1394822597504 + }, + { + "step": 320, + "loss": 0.37536823749542236, + "error": 0.171875, + "gradient_norm": 0.10325513035058975, + "elapsed": 565.0790395736694 + }, + { + "step": 336, + "loss": 0.419940710067749, + "error": 0.2265625, + "gradient_norm": 0.04723379388451576, + "elapsed": 569.050211429596 + }, + { + "step": 352, + "loss": 0.6458156108856201, + "error": 0.4609375, + "gradient_norm": 0.04816316068172455, + "elapsed": 573.0114912986755 + }, + { + "step": 368, + "loss": 0.5628451108932495, + "error": 0.328125, + "gradient_norm": 0.09256711602210999, + "elapsed": 576.9429559707642 + }, + { + "step": 384, + "loss": 0.5773618221282959, + "error": 0.359375, + "gradient_norm": 0.16693103313446045, + "elapsed": 580.8791544437408 + }, + { + "step": 400, + "loss": 0.12261693179607391, + "error": 0.046875, + "gradient_norm": 0.06734084337949753, + "elapsed": 584.8116250038147 + }, + { + "step": 416, + "loss": 0.33368560671806335, + "error": 0.125, + "gradient_norm": 0.04156317561864853, + "elapsed": 588.7308163642883 + }, + { + "step": 432, + "loss": 0.2161063849925995, + "error": 0.109375, + "gradient_norm": 0.06895668804645538, + "elapsed": 592.6584475040436 + }, + { + "step": 448, + "loss": 0.6331151723861694, + "error": 0.3828125, + "gradient_norm": 0.12380247563123703, + "elapsed": 596.5997920036316 + }, + { + "step": 464, + "loss": 0.28776052594184875, + "error": 0.1484375, + "gradient_norm": 0.03920985758304596, + "elapsed": 600.5359675884247 + }, + { + "step": 480, + "loss": 0.639541745185852, + "error": 0.421875, + "gradient_norm": 0.029632505029439926, + "elapsed": 604.4547488689423 + }, + { + "step": 496, + "loss": 0.5919073820114136, + "error": 0.359375, + "gradient_norm": 0.11676646769046783, + "elapsed": 608.3825929164886 + }, + { + "step": 512, + "loss": 0.5479233264923096, + "error": 0.265625, + "gradient_norm": 0.03692208230495453, + "elapsed": 612.3190803527832 + } + ] + }, + "selection": "Per-group minimum failure among previous decoder and pilot steps 256 and 512, using all 532480 d3 validation shots", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "previous": 0.25226862980769227, + "256": 0.2515625, + "512": 0.2510216346153846 + }, + "selected": "512" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "previous": 0.2569711538461539, + "256": 0.2557542067307692, + "512": 0.256640625 + }, + "selected": "256" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "previous": 0.23574218750000003, + "256": 0.2356820913461538, + "512": 0.23511117788461539 + }, + "selected": "512" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "previous": 0.24453125000000003, + "256": 0.24275841346153845, + "512": 0.24224759615384617 + }, + "selected": "512" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "previous": 0.25310997596153845, + "256": 0.2524188701923077, + "512": 0.2513822115384615 + }, + "selected": "512" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "previous": 0.24082031250000002, + "256": 0.2387469951923077, + "512": 0.23933293269230768 + }, + "selected": "256" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "previous": 0.24064002403846155, + "256": 0.24053485576923073, + "512": 0.24002403846153844 + }, + "selected": "512" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "previous": 0.2367638221153846, + "256": 0.23635817307692306, + "512": 0.23584735576923077 + }, + "selected": "512" + } + ], + "initial_validation_subset": "First 512 validation rows/condition; then both trained checkpoints evaluated on full validation", + "features": "40 detection bits within five frames and 57 static error/geometry features; detector indices come from the ideal geometry/DEM; sample IDs are not features", + "derivative_check": "Relative error 1.16e-7 versus automatic differentiation on a small d3 example" + }, + "previous_package_validation": { + "performance": 0.7672100360576923, + "failure_by_distance": { + "d3": 0.2398212139423077, + "d5": 0.2257587139423077 + }, + "scorer": "Supplied qecbench.scoring on all 130 validation conditions and 665600 shots", + "contract_checks": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "shots": 1, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d3_r25_center_5_3", + "shots": 37, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d3_r13_center_5_7", + "shots": 1025, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 7, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 257, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 17, + "maximum_probability_difference": 0.0 + } + ], + "prediction_generation": "All26 d5 conditions replayed from the assembled package; unchanged d3 predictions retained. Trusted scoring covers all130 conditions.", + "runtime_evidence": "Full133120-shot d5 replay took 312.38s on one H100; compatible physical/neural priors are shared. D3 paths unchanged from the recorded incumbent.", + "d5_validation_runtime_seconds": 312.38163661956787, + "contract_execution": { + "requested_verifier_uid": 10001, + "effective_uid": 1000, + "effective_gid": 1000, + "supplementary_groups": [], + "identity_status": "Development process is already unprivileged and cannot change UID; verifier UID10001 was not executed", + "model_and_input_copy": "Owned by development UID 1000,directories0555,files0444,relocated under a fresh accessible temporary parent", + "output_directory": "Owned by execution UID 1000,mode0700", + "PYTHONPATH": "", + "backend": "Runtime default; full selected subset cases", + "scope": "Local contract check; not a Docker/network/mount-isolation test" + } + }, + "previous_model_manifest_sha256": "d8bed57d4619a87ad756d2347796e396b3169d4146f69ab426f99f9934ef1a8f", + "contextual_updates": [ + { + "name": "large512", + "training": { + "initialization": "This session's pilot checkpoint 512; original random initialization seed 20261025", + "run_config": { + "steps": 2048, + "batch": 2048, + "output": "/run-state/workspace/research/learned_exact/continuation1", + "validation_shots": 1024, + "init_weights": "/workspace/research/learned_exact/pilot/weights-512.npz", + "learning_rate": 0.001, + "eval_every": 512, + "seed": 20261028, + "validation_batch": 1024, + "uniform_validation": true, + "original_random_seed": 20261025, + "starting_checkpoint_sha256": "b14f7bf663b0484b9a79a759455ad09aca456f83a7cc29ed2e9e1d210683c180", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "validation_manifest_sha256": "482bb7268c6c827ebbf1f756ee6994750acfcd011adab08eaa2ada703e5faea1" + }, + "completed_checkpoint_steps": 512, + "new_sampled_training_shots": 1048576, + "optimizer": "AdamW 1e-3, weight decay 1e-4, global norm clip 1; optimizer reset at phase start", + "data": "Uniform sampling over all 104 d3 training conditions; training rows only", + "selection": "Checkpoint 512 evaluated on all 532480 d3 validation shots", + "full_validation_failure": 0.2428973858173077, + "termination": "Saved checkpoint 512, then stopped to restart with corrected validation NLL reporting. Any later in-flight updates were discarded.", + "reporting_correction": "Recomputed with float labels from the full checkpoint predictions; original in-flight diagnostic negated uint8 labels. Training loss and failure metrics were unaffected.", + "test_data_used": false + }, + "selection": "Minimum full validation mean failure per group between the incumbent and this trained checkpoint", + "history": [ + { + "group": "d3_bX_center_3_5", + "previous_failure": 0.2510216346153846, + "candidate_failure": 0.2491436298076923, + "selected_new": true + }, + { + "group": "d3_bX_center_5_3", + "previous_failure": 0.2557542067307692, + "candidate_failure": 0.256640625, + "selected_new": false + }, + { + "group": "d3_bX_center_5_7", + "previous_failure": 0.23511117788461539, + "candidate_failure": 0.23515625, + "selected_new": false + }, + { + "group": "d3_bX_center_7_5", + "previous_failure": 0.24224759615384617, + "candidate_failure": 0.2403996394230769, + "selected_new": true + }, + { + "group": "d3_bZ_center_3_5", + "previous_failure": 0.2513822115384615, + "candidate_failure": 0.24893329326923078, + "selected_new": true + }, + { + "group": "d3_bZ_center_5_3", + "previous_failure": 0.2387469951923077, + "candidate_failure": 0.23925781249999997, + "selected_new": false + }, + { + "group": "d3_bZ_center_5_7", + "previous_failure": 0.24002403846153844, + "candidate_failure": 0.23885216346153845, + "selected_new": true + }, + { + "group": "d3_bZ_center_7_5", + "previous_failure": 0.23584735576923077, + "candidate_failure": 0.23479567307692306, + "selected_new": true + }, + { + "group": "d5_bX_center_5_5", + "previous_failure": 0.24024939903846157, + "candidate_failure": 0.24024939903846157, + "selected_new": false + }, + { + "group": "d5_bZ_center_5_5", + "previous_failure": 0.22627704326923076, + "candidate_failure": 0.22627704326923076, + "selected_new": false + } + ], + "source_checkpoint_sha256": "7a7579b1bded95bcea7b1d26b2cf26de333c1a0f417fac6a0143eeb3a0c93aa2" + }, + { + "name": "continuation2", + "training_run": { + "initialization": "Continue from this session's trained checkpoint", + "original_initialization": "Random variance-scaled normal first two layers, random Normal(0,.001) output; zero biases; seed 20261025", + "architecture": "Two 32-unit SiLU layers, output 2*tanh correction to original hyperedge logit; 40 local detection bits and 57 static error/geometry features", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 1536, + "batch_size": 2048, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261028, + "optimizer_restored": true, + "rng_restored": true, + "session_trained_starting_checkpoint": "/workspace/research/learned_exact/continuation1/weights-512.npz", + "starting_checkpoint_sha256": "7a7579b1bded95bcea7b1d26b2cf26de333c1a0f417fac6a0143eeb3a0c93aa2", + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.05675870552659035, + "error": 0.0166015625, + "gradient_norm": 0.007466103881597519, + "elapsed": 30.636001586914062 + }, + { + "step": 16, + "loss": 0.44421544671058655, + "error": 0.22412109375, + "gradient_norm": 0.029868461191654205, + "elapsed": 35.424378871917725 + }, + { + "step": 32, + "loss": 0.46525052189826965, + "error": 0.23681640625, + "gradient_norm": 0.022205814719200134, + "elapsed": 40.526121854782104 + }, + { + "step": 48, + "loss": 0.6177924871444702, + "error": 0.3544921875, + "gradient_norm": 0.022866439074277878, + "elapsed": 45.67929220199585 + }, + { + "step": 64, + "loss": 0.5046484470367432, + "error": 0.2666015625, + "gradient_norm": 0.0222865492105484, + "elapsed": 50.80926203727722 + }, + { + "step": 80, + "loss": 0.638379693031311, + "error": 0.41064453125, + "gradient_norm": 0.012645655311644077, + "elapsed": 55.93321657180786 + }, + { + "step": 96, + "loss": 0.18619170784950256, + "error": 0.0732421875, + "gradient_norm": 0.012208878062665462, + "elapsed": 61.002137899398804 + }, + { + "step": 112, + "loss": 0.4269826412200928, + "error": 0.2109375, + "gradient_norm": 0.021279584616422653, + "elapsed": 66.13066720962524 + }, + { + "step": 128, + "loss": 0.47232550382614136, + "error": 0.25244140625, + "gradient_norm": 0.03405005484819412, + "elapsed": 85.5297167301178 + }, + { + "step": 144, + "loss": 0.2528073787689209, + "error": 0.11279296875, + "gradient_norm": 0.013145577162504196, + "elapsed": 90.68786001205444 + }, + { + "step": 160, + "loss": 0.5877531170845032, + "error": 0.35595703125, + "gradient_norm": 0.019021881744265556, + "elapsed": 95.76396131515503 + }, + { + "step": 176, + "loss": 0.45082807540893555, + "error": 0.2314453125, + "gradient_norm": 0.023904386907815933, + "elapsed": 100.9375216960907 + }, + { + "step": 192, + "loss": 0.4175146222114563, + "error": 0.19921875, + "gradient_norm": 0.021031895652413368, + "elapsed": 105.98947334289551 + }, + { + "step": 208, + "loss": 0.5424385070800781, + "error": 0.30078125, + "gradient_norm": 0.01396750845015049, + "elapsed": 111.17936706542969 + }, + { + "step": 224, + "loss": 0.29304587841033936, + "error": 0.1259765625, + "gradient_norm": 0.014725692570209503, + "elapsed": 116.36282753944397 + }, + { + "step": 240, + "loss": 0.056691475212574005, + "error": 0.015625, + "gradient_norm": 0.002859376836568117, + "elapsed": 121.54807162284851 + }, + { + "step": 256, + "loss": 0.17413178086280823, + "error": 0.06689453125, + "gradient_norm": 0.02666049636900425, + "elapsed": 126.718514919281 + }, + { + "step": 272, + "loss": 0.6115483641624451, + "error": 0.3466796875, + "gradient_norm": 0.03685307130217552, + "elapsed": 131.77990794181824 + }, + { + "step": 288, + "loss": 0.5973552465438843, + "error": 0.3349609375, + "gradient_norm": 0.02574622817337513, + "elapsed": 138.0202260017395 + }, + { + "step": 304, + "loss": 0.18595321476459503, + "error": 0.0732421875, + "gradient_norm": 0.012303492985665798, + "elapsed": 144.16412949562073 + }, + { + "step": 320, + "loss": 0.5418114066123962, + "error": 0.30126953125, + "gradient_norm": 0.018640751019120216, + "elapsed": 150.969500541687 + }, + { + "step": 336, + "loss": 0.5024716258049011, + "error": 0.26708984375, + "gradient_norm": 0.011490182019770145, + "elapsed": 158.32421374320984 + }, + { + "step": 352, + "loss": 0.5002061128616333, + "error": 0.255859375, + "gradient_norm": 0.03905056416988373, + "elapsed": 165.20316648483276 + }, + { + "step": 368, + "loss": 0.5892350077629089, + "error": 0.33837890625, + "gradient_norm": 0.046964384615421295, + "elapsed": 171.98852562904358 + }, + { + "step": 384, + "loss": 0.526427149772644, + "error": 0.2900390625, + "gradient_norm": 0.021478066220879555, + "elapsed": 178.02048754692078 + }, + { + "step": 400, + "loss": 0.5563177466392517, + "error": 0.306640625, + "gradient_norm": 0.024061864241957664, + "elapsed": 184.09671759605408 + }, + { + "step": 416, + "loss": 0.060019996017217636, + "error": 0.0205078125, + "gradient_norm": 0.006343841087073088, + "elapsed": 190.31260657310486 + }, + { + "step": 432, + "loss": 0.5484405755996704, + "error": 0.3115234375, + "gradient_norm": 0.020139696076512337, + "elapsed": 195.41702342033386 + }, + { + "step": 448, + "loss": 0.6163954138755798, + "error": 0.37646484375, + "gradient_norm": 0.011381164193153381, + "elapsed": 200.53582382202148 + }, + { + "step": 464, + "loss": 0.47678378224372864, + "error": 0.25927734375, + "gradient_norm": 0.03807748854160309, + "elapsed": 205.69636607170105 + }, + { + "step": 480, + "loss": 0.5176759362220764, + "error": 0.2705078125, + "gradient_norm": 0.017451826483011246, + "elapsed": 210.7581787109375 + }, + { + "step": 496, + "loss": 0.3626214563846588, + "error": 0.16455078125, + "gradient_norm": 0.019456032663583755, + "elapsed": 215.82069444656372 + }, + { + "step": 512, + "loss": 0.6202600598335266, + "error": 0.35302734375, + "gradient_norm": 0.013814727775752544, + "elapsed": 220.93863129615784 + }, + { + "step": 528, + "loss": 0.5610182285308838, + "error": 0.29833984375, + "gradient_norm": 0.03955027833580971, + "elapsed": 238.0407817363739 + }, + { + "step": 544, + "loss": 0.332148015499115, + "error": 0.15380859375, + "gradient_norm": 0.013710199855268002, + "elapsed": 243.12822461128235 + }, + { + "step": 560, + "loss": 0.4678276777267456, + "error": 0.23974609375, + "gradient_norm": 0.016155347228050232, + "elapsed": 248.3209776878357 + }, + { + "step": 576, + "loss": 0.6166238784790039, + "error": 0.3740234375, + "gradient_norm": 0.017382115125656128, + "elapsed": 253.49981307983398 + }, + { + "step": 592, + "loss": 0.6137416362762451, + "error": 0.373046875, + "gradient_norm": 0.007819767110049725, + "elapsed": 258.68269968032837 + }, + { + "step": 608, + "loss": 0.2780998647212982, + "error": 0.126953125, + "gradient_norm": 0.03436559438705444, + "elapsed": 263.82615661621094 + }, + { + "step": 624, + "loss": 0.6059691309928894, + "error": 0.3623046875, + "gradient_norm": 0.010842837393283844, + "elapsed": 268.9659583568573 + }, + { + "step": 640, + "loss": 0.058036163449287415, + "error": 0.02001953125, + "gradient_norm": 0.004723707213997841, + "elapsed": 274.09823632240295 + }, + { + "step": 656, + "loss": 0.6149133443832397, + "error": 0.37255859375, + "gradient_norm": 0.008533184416592121, + "elapsed": 279.26951336860657 + }, + { + "step": 672, + "loss": 0.3015868663787842, + "error": 0.1318359375, + "gradient_norm": 0.012536457739770412, + "elapsed": 284.41987442970276 + }, + { + "step": 688, + "loss": 0.16231489181518555, + "error": 0.06494140625, + "gradient_norm": 0.0067833056673407555, + "elapsed": 289.56297039985657 + }, + { + "step": 704, + "loss": 0.04929213970899582, + "error": 0.015625, + "gradient_norm": 0.005747381132096052, + "elapsed": 294.6839826107025 + }, + { + "step": 720, + "loss": 0.5615487098693848, + "error": 0.31689453125, + "gradient_norm": 0.02115021087229252, + "elapsed": 299.8546531200409 + }, + { + "step": 736, + "loss": 0.6306260228157043, + "error": 0.3759765625, + "gradient_norm": 0.02629203163087368, + "elapsed": 305.0923271179199 + }, + { + "step": 752, + "loss": 0.03828414902091026, + "error": 0.0126953125, + "gradient_norm": 0.008905005641281605, + "elapsed": 310.5417342185974 + }, + { + "step": 768, + "loss": 0.48764050006866455, + "error": 0.2626953125, + "gradient_norm": 0.024667929857969284, + "elapsed": 316.01200103759766 + }, + { + "step": 784, + "loss": 0.5836235284805298, + "error": 0.3505859375, + "gradient_norm": 0.023319393396377563, + "elapsed": 321.33294105529785 + }, + { + "step": 800, + "loss": 0.5693534016609192, + "error": 0.31396484375, + "gradient_norm": 0.048126742243766785, + "elapsed": 326.52227997779846 + }, + { + "step": 816, + "loss": 0.5710973739624023, + "error": 0.33349609375, + "gradient_norm": 0.022565416991710663, + "elapsed": 331.62225437164307 + }, + { + "step": 832, + "loss": 0.2818760275840759, + "error": 0.11865234375, + "gradient_norm": 0.025756066665053368, + "elapsed": 336.7874104976654 + }, + { + "step": 848, + "loss": 0.6127357482910156, + "error": 0.3583984375, + "gradient_norm": 0.020077377557754517, + "elapsed": 341.92783546447754 + }, + { + "step": 864, + "loss": 0.5109728574752808, + "error": 0.26171875, + "gradient_norm": 0.022484255954623222, + "elapsed": 347.0137662887573 + }, + { + "step": 880, + "loss": 0.16892661154270172, + "error": 0.06103515625, + "gradient_norm": 0.01363676693290472, + "elapsed": 352.0768094062805 + }, + { + "step": 896, + "loss": 0.593660831451416, + "error": 0.34423828125, + "gradient_norm": 0.01379447989165783, + "elapsed": 357.1796865463257 + }, + { + "step": 912, + "loss": 0.635499119758606, + "error": 0.39306640625, + "gradient_norm": 0.012278803624212742, + "elapsed": 362.29547691345215 + }, + { + "step": 928, + "loss": 0.3966389000415802, + "error": 0.19482421875, + "gradient_norm": 0.019856182858347893, + "elapsed": 367.3532474040985 + }, + { + "step": 944, + "loss": 0.05235423520207405, + "error": 0.01611328125, + "gradient_norm": 0.005415339022874832, + "elapsed": 372.4516806602478 + }, + { + "step": 960, + "loss": 0.5913074612617493, + "error": 0.3330078125, + "gradient_norm": 0.021171825006604195, + "elapsed": 377.5324194431305 + }, + { + "step": 976, + "loss": 0.6479356288909912, + "error": 0.41650390625, + "gradient_norm": 0.02845155820250511, + "elapsed": 382.5862877368927 + }, + { + "step": 992, + "loss": 0.5470497608184814, + "error": 0.30908203125, + "gradient_norm": 0.02726798877120018, + "elapsed": 387.6820628643036 + }, + { + "step": 1008, + "loss": 0.5729615688323975, + "error": 0.32861328125, + "gradient_norm": 0.011548872105777264, + "elapsed": 392.7741017341614 + }, + { + "step": 1024, + "loss": 0.0691118910908699, + "error": 0.0205078125, + "gradient_norm": 0.009204022586345673, + "elapsed": 397.8671176433563 + }, + { + "step": 1040, + "loss": 0.5171630382537842, + "error": 0.2685546875, + "gradient_norm": 0.015718232840299606, + "elapsed": 415.6616735458374 + }, + { + "step": 1056, + "loss": 0.6505192518234253, + "error": 0.39990234375, + "gradient_norm": 0.023937702178955078, + "elapsed": 420.7646098136902 + }, + { + "step": 1072, + "loss": 0.5660485625267029, + "error": 0.32666015625, + "gradient_norm": 0.026201115921139717, + "elapsed": 426.09313225746155 + }, + { + "step": 1088, + "loss": 0.4945259094238281, + "error": 0.25048828125, + "gradient_norm": 0.014495921321213245, + "elapsed": 431.2104251384735 + }, + { + "step": 1104, + "loss": 0.5695121884346008, + "error": 0.33837890625, + "gradient_norm": 0.029924258589744568, + "elapsed": 436.3099756240845 + }, + { + "step": 1120, + "loss": 0.3591366112232208, + "error": 0.16015625, + "gradient_norm": 0.017803259193897247, + "elapsed": 441.4024531841278 + }, + { + "step": 1136, + "loss": 0.3302019536495209, + "error": 0.1572265625, + "gradient_norm": 0.01632549799978733, + "elapsed": 446.55403757095337 + }, + { + "step": 1152, + "loss": 0.6093119382858276, + "error": 0.35107421875, + "gradient_norm": 0.014888457022607327, + "elapsed": 451.6241090297699 + }, + { + "step": 1168, + "loss": 0.3500004708766937, + "error": 0.1650390625, + "gradient_norm": 0.011492405086755753, + "elapsed": 456.7753965854645 + }, + { + "step": 1184, + "loss": 0.3738429844379425, + "error": 0.1845703125, + "gradient_norm": 0.015336514450609684, + "elapsed": 461.90868854522705 + }, + { + "step": 1200, + "loss": 0.2892451882362366, + "error": 0.12890625, + "gradient_norm": 0.010124214924871922, + "elapsed": 467.1151931285858 + }, + { + "step": 1216, + "loss": 0.45089617371559143, + "error": 0.23046875, + "gradient_norm": 0.03627275303006172, + "elapsed": 472.30455207824707 + }, + { + "step": 1232, + "loss": 0.6207081079483032, + "error": 0.36376953125, + "gradient_norm": 0.028164058923721313, + "elapsed": 477.4041998386383 + }, + { + "step": 1248, + "loss": 0.6022387742996216, + "error": 0.32470703125, + "gradient_norm": 0.05243176594376564, + "elapsed": 482.5445365905762 + }, + { + "step": 1264, + "loss": 0.6383136510848999, + "error": 0.38818359375, + "gradient_norm": 0.021598732098937035, + "elapsed": 488.21457719802856 + }, + { + "step": 1280, + "loss": 0.28611207008361816, + "error": 0.13037109375, + "gradient_norm": 0.010211448185145855, + "elapsed": 494.3161232471466 + }, + { + "step": 1296, + "loss": 0.5970274209976196, + "error": 0.35009765625, + "gradient_norm": 0.025076791644096375, + "elapsed": 500.2585813999176 + }, + { + "step": 1312, + "loss": 0.48383909463882446, + "error": 0.2529296875, + "gradient_norm": 0.02830139547586441, + "elapsed": 505.9930474758148 + }, + { + "step": 1328, + "loss": 0.6087884902954102, + "error": 0.365234375, + "gradient_norm": 0.01881619170308113, + "elapsed": 512.0680301189423 + }, + { + "step": 1344, + "loss": 0.49332645535469055, + "error": 0.25634765625, + "gradient_norm": 0.02215457707643509, + "elapsed": 517.9840953350067 + }, + { + "step": 1360, + "loss": 0.6202782392501831, + "error": 0.36767578125, + "gradient_norm": 0.018839120864868164, + "elapsed": 524.07217669487 + }, + { + "step": 1376, + "loss": 0.5857731699943542, + "error": 0.3330078125, + "gradient_norm": 0.015682006254792213, + "elapsed": 529.8370056152344 + }, + { + "step": 1392, + "loss": 0.52056485414505, + "error": 0.263671875, + "gradient_norm": 0.02431550808250904, + "elapsed": 535.9721219539642 + }, + { + "step": 1408, + "loss": 0.6433448791503906, + "error": 0.40625, + "gradient_norm": 0.016954610124230385, + "elapsed": 542.0041825771332 + }, + { + "step": 1424, + "loss": 0.6105660200119019, + "error": 0.35107421875, + "gradient_norm": 0.007737957406789064, + "elapsed": 547.4241607189178 + }, + { + "step": 1440, + "loss": 0.27237576246261597, + "error": 0.12451171875, + "gradient_norm": 0.01314462162554264, + "elapsed": 553.5436873435974 + }, + { + "step": 1456, + "loss": 0.5954712629318237, + "error": 0.3623046875, + "gradient_norm": 0.03746134042739868, + "elapsed": 558.7123465538025 + }, + { + "step": 1472, + "loss": 0.4519508481025696, + "error": 0.2255859375, + "gradient_norm": 0.010652865283191204, + "elapsed": 563.8585436344147 + }, + { + "step": 1488, + "loss": 0.41647869348526, + "error": 0.212890625, + "gradient_norm": 0.028575479984283447, + "elapsed": 569.0573513507843 + }, + { + "step": 1504, + "loss": 0.4384400248527527, + "error": 0.21337890625, + "gradient_norm": 0.017627721652388573, + "elapsed": 574.296462059021 + }, + { + "step": 1520, + "loss": 0.6105232238769531, + "error": 0.37109375, + "gradient_norm": 0.016302449628710747, + "elapsed": 579.4641361236572 + }, + { + "step": 1536, + "loss": 0.6215546131134033, + "error": 0.39013671875, + "gradient_norm": 0.032154034823179245, + "elapsed": 584.5684258937836 + } + ] + }, + "selected_checkpoint_steps": [ + 512, + 1024, + 1536 + ], + "checkpoint_records": { + "1536": { + "step": 1536, + "new_training_shots": 3145728, + "weights": "weights-1536.npz", + "weights_sha256": "785132032c12fa38abbb1103774d91b41828fdc5027e1fe4d42053476eb28199", + "validation": "validation-1536.json", + "complete": true + }, + "512": { + "step": 512, + "new_training_shots": 1048576, + "weights": "weights-512.npz", + "weights_sha256": "e9ebeb958eec680c5458b3a5c39aecf0a21c926aee816517b5f9d3bac5815d7f", + "validation": "validation-512.json", + "complete": true + }, + "1024": { + "step": 1024, + "new_training_shots": 2097152, + "weights": "weights-1024.npz", + "weights_sha256": "f45c568b13c92eb4e768146debbc8c50a8ad51882523938932ba26f4afde66f2", + "validation": "validation-1024.json", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.2491436298076923, + "512": 0.2478215144230769, + "1024": 0.24774639423076922, + "1536": 0.2476862980769231 + }, + "selected": "1536" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2557542067307692, + "512": 0.2544320913461538, + "1024": 0.2548527644230769, + "1536": 0.2545673076923076 + }, + "selected": "512" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.23511117788461539, + "512": 0.23602764423076927, + "1024": 0.23553185096153847, + "1536": 0.2345402644230769 + }, + "selected": "1536" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.2403996394230769, + "512": 0.23999399038461539, + "1024": 0.24008413461538464, + "1536": 0.2401141826923077 + }, + "selected": "512" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24893329326923078, + "512": 0.24894831730769235, + "1024": 0.24735576923076924, + "1536": 0.24664963942307694 + }, + "selected": "1536" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.2387469951923077, + "512": 0.23849158653846156, + "1024": 0.23789062500000002, + "1536": 0.2381610576923077 + }, + "selected": "1024" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.23885216346153845, + "512": 0.23807091346153844, + "1024": 0.2377704326923077, + "1536": 0.23733473557692303 + }, + "selected": "1536" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.23479567307692306, + "512": 0.2340895432692308, + "1024": 0.2340444711538461, + "1536": 0.23431490384615386 + }, + "selected": "1024" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.24024939903846157 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22627704326923076 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "rich1", + "training_run": { + "initialization": "Random initialization in this session", + "original_initialization": "Random variance-scaled normal first two layers, random Normal(0,.001) output; zero biases; seed 20261030", + "architecture": "Two 128-unit SiLU layers, output 4*tanh correction to original hyperedge logit; 40 local events, 40 reconstructed measurements, 8 per-stabilizer full-shot densities and 57 static features", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 1024, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261030, + "optimizer_restored": false, + "rng_restored": false, + "session_trained_starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.1747799664735794, + "error": 0.068359375, + "gradient_norm": 0.03163275867700577, + "elapsed": 30.666016340255737 + }, + { + "step": 16, + "loss": 0.5729950666427612, + "error": 0.30859375, + "gradient_norm": 0.03532477840781212, + "elapsed": 34.992138385772705 + }, + { + "step": 32, + "loss": 0.33759093284606934, + "error": 0.1435546875, + "gradient_norm": 0.03938521817326546, + "elapsed": 40.51379442214966 + }, + { + "step": 48, + "loss": 0.574704647064209, + "error": 0.3212890625, + "gradient_norm": 0.03584429249167442, + "elapsed": 46.82174754142761 + }, + { + "step": 64, + "loss": 0.6351712942123413, + "error": 0.4072265625, + "gradient_norm": 0.027485841885209084, + "elapsed": 52.75151348114014 + }, + { + "step": 80, + "loss": 0.36342084407806396, + "error": 0.1708984375, + "gradient_norm": 0.040388718247413635, + "elapsed": 58.42134428024292 + }, + { + "step": 96, + "loss": 0.613252580165863, + "error": 0.3525390625, + "gradient_norm": 0.035148631781339645, + "elapsed": 64.40935254096985 + }, + { + "step": 112, + "loss": 0.6042842864990234, + "error": 0.3564453125, + "gradient_norm": 0.06634438037872314, + "elapsed": 70.4053041934967 + }, + { + "step": 128, + "loss": 0.4366868734359741, + "error": 0.20703125, + "gradient_norm": 0.040233220905065536, + "elapsed": 76.10137701034546 + }, + { + "step": 144, + "loss": 0.340861976146698, + "error": 0.154296875, + "gradient_norm": 0.03881179168820381, + "elapsed": 81.10126686096191 + }, + { + "step": 160, + "loss": 0.5801218748092651, + "error": 0.32421875, + "gradient_norm": 0.06090407446026802, + "elapsed": 86.1252555847168 + }, + { + "step": 176, + "loss": 0.37582841515541077, + "error": 0.19140625, + "gradient_norm": 0.06935373693704605, + "elapsed": 91.53376078605652 + }, + { + "step": 192, + "loss": 0.5213879346847534, + "error": 0.291015625, + "gradient_norm": 0.038788966834545135, + "elapsed": 96.78960609436035 + }, + { + "step": 208, + "loss": 0.26441627740859985, + "error": 0.115234375, + "gradient_norm": 0.04845435172319412, + "elapsed": 101.85743975639343 + }, + { + "step": 224, + "loss": 0.4369240701198578, + "error": 0.2119140625, + "gradient_norm": 0.098305843770504, + "elapsed": 106.94148802757263 + }, + { + "step": 240, + "loss": 0.5520763397216797, + "error": 0.3037109375, + "gradient_norm": 0.04845161736011505, + "elapsed": 112.27297902107239 + }, + { + "step": 256, + "loss": 0.595374345779419, + "error": 0.3369140625, + "gradient_norm": 0.03840416297316551, + "elapsed": 117.4812536239624 + }, + { + "step": 272, + "loss": 0.2569020390510559, + "error": 0.103515625, + "gradient_norm": 0.050126779824495316, + "elapsed": 137.86142945289612 + }, + { + "step": 288, + "loss": 0.32830360531806946, + "error": 0.1455078125, + "gradient_norm": 0.035532038658857346, + "elapsed": 142.83670139312744 + }, + { + "step": 304, + "loss": 0.6040379405021667, + "error": 0.36328125, + "gradient_norm": 0.0313950814306736, + "elapsed": 148.05078554153442 + }, + { + "step": 320, + "loss": 0.35434311628341675, + "error": 0.1748046875, + "gradient_norm": 0.03184249624609947, + "elapsed": 153.22213292121887 + }, + { + "step": 336, + "loss": 0.2326659858226776, + "error": 0.099609375, + "gradient_norm": 0.06624855101108551, + "elapsed": 158.455664396286 + }, + { + "step": 352, + "loss": 0.06233043968677521, + "error": 0.017578125, + "gradient_norm": 0.02635284699499607, + "elapsed": 163.10541248321533 + }, + { + "step": 368, + "loss": 0.31427502632141113, + "error": 0.1435546875, + "gradient_norm": 0.04170582816004753, + "elapsed": 167.78928112983704 + }, + { + "step": 384, + "loss": 0.41268765926361084, + "error": 0.19921875, + "gradient_norm": 0.10103361308574677, + "elapsed": 172.34387755393982 + }, + { + "step": 400, + "loss": 0.42649346590042114, + "error": 0.2119140625, + "gradient_norm": 0.03481302782893181, + "elapsed": 176.83626103401184 + }, + { + "step": 416, + "loss": 0.6373635530471802, + "error": 0.4013671875, + "gradient_norm": 0.06979350745677948, + "elapsed": 181.35168766975403 + }, + { + "step": 432, + "loss": 0.17961856722831726, + "error": 0.072265625, + "gradient_norm": 0.018565824255347252, + "elapsed": 185.80416321754456 + }, + { + "step": 448, + "loss": 0.5501771569252014, + "error": 0.287109375, + "gradient_norm": 0.04828835278749466, + "elapsed": 190.30530858039856 + }, + { + "step": 464, + "loss": 0.5648394823074341, + "error": 0.2978515625, + "gradient_norm": 0.07398489862680435, + "elapsed": 194.7985327243805 + }, + { + "step": 480, + "loss": 0.5675262212753296, + "error": 0.3125, + "gradient_norm": 0.036255236715078354, + "elapsed": 199.30496096611023 + }, + { + "step": 496, + "loss": 0.6156162023544312, + "error": 0.3779296875, + "gradient_norm": 0.02318546548485756, + "elapsed": 203.8355917930603 + }, + { + "step": 512, + "loss": 0.0660151019692421, + "error": 0.021484375, + "gradient_norm": 0.020883027464151382, + "elapsed": 208.32652711868286 + }, + { + "step": 528, + "loss": 0.6096083521842957, + "error": 0.37890625, + "gradient_norm": 0.04742306470870972, + "elapsed": 225.1866319179535 + }, + { + "step": 544, + "loss": 0.3829265236854553, + "error": 0.18359375, + "gradient_norm": 0.05981605872511864, + "elapsed": 229.68251276016235 + }, + { + "step": 560, + "loss": 0.537099301815033, + "error": 0.2900390625, + "gradient_norm": 0.0949595719575882, + "elapsed": 234.20215129852295 + }, + { + "step": 576, + "loss": 0.5903713703155518, + "error": 0.3447265625, + "gradient_norm": 0.06430540233850479, + "elapsed": 238.70998644828796 + }, + { + "step": 592, + "loss": 0.5619152188301086, + "error": 0.298828125, + "gradient_norm": 0.03404757007956505, + "elapsed": 243.21307158470154 + }, + { + "step": 608, + "loss": 0.5997255444526672, + "error": 0.3623046875, + "gradient_norm": 0.03946321830153465, + "elapsed": 247.7153992652893 + }, + { + "step": 624, + "loss": 0.5695509910583496, + "error": 0.310546875, + "gradient_norm": 0.02815800905227661, + "elapsed": 252.3102250099182 + }, + { + "step": 640, + "loss": 0.5901973247528076, + "error": 0.34765625, + "gradient_norm": 0.04673359915614128, + "elapsed": 256.89224338531494 + }, + { + "step": 656, + "loss": 0.621924877166748, + "error": 0.37890625, + "gradient_norm": 0.04227908328175545, + "elapsed": 261.43869185447693 + }, + { + "step": 672, + "loss": 0.610299825668335, + "error": 0.35546875, + "gradient_norm": 0.036825064569711685, + "elapsed": 265.97225284576416 + }, + { + "step": 688, + "loss": 0.5249245166778564, + "error": 0.2841796875, + "gradient_norm": 0.0948338434100151, + "elapsed": 270.4997045993805 + }, + { + "step": 704, + "loss": 0.2573642134666443, + "error": 0.111328125, + "gradient_norm": 0.055987801402807236, + "elapsed": 275.0399034023285 + }, + { + "step": 720, + "loss": 0.04867870360612869, + "error": 0.0146484375, + "gradient_norm": 0.03132430091500282, + "elapsed": 279.55093908309937 + }, + { + "step": 736, + "loss": 0.24808242917060852, + "error": 0.1015625, + "gradient_norm": 0.051910530775785446, + "elapsed": 284.08127522468567 + }, + { + "step": 752, + "loss": 0.4981001615524292, + "error": 0.2529296875, + "gradient_norm": 0.06427812576293945, + "elapsed": 288.70672821998596 + }, + { + "step": 768, + "loss": 0.5241370797157288, + "error": 0.28125, + "gradient_norm": 0.10227487236261368, + "elapsed": 293.331086397171 + }, + { + "step": 784, + "loss": 0.6427845358848572, + "error": 0.400390625, + "gradient_norm": 0.08984753489494324, + "elapsed": 311.0226716995239 + }, + { + "step": 800, + "loss": 0.5990085601806641, + "error": 0.3544921875, + "gradient_norm": 0.08950027078390121, + "elapsed": 315.6725699901581 + }, + { + "step": 816, + "loss": 0.5930870771408081, + "error": 0.353515625, + "gradient_norm": 0.03096434287726879, + "elapsed": 320.38578844070435 + }, + { + "step": 832, + "loss": 0.5945324897766113, + "error": 0.359375, + "gradient_norm": 0.052297625690698624, + "elapsed": 325.3292770385742 + }, + { + "step": 848, + "loss": 0.6031227111816406, + "error": 0.3642578125, + "gradient_norm": 0.032976675778627396, + "elapsed": 330.2292652130127 + }, + { + "step": 864, + "loss": 0.3953525125980377, + "error": 0.1748046875, + "gradient_norm": 0.07015999406576157, + "elapsed": 335.1212799549103 + }, + { + "step": 880, + "loss": 0.4324202835559845, + "error": 0.2080078125, + "gradient_norm": 0.1018647849559784, + "elapsed": 339.9696366786957 + }, + { + "step": 896, + "loss": 0.5024446249008179, + "error": 0.265625, + "gradient_norm": 0.03973893076181412, + "elapsed": 344.8794775009155 + }, + { + "step": 912, + "loss": 0.5731178522109985, + "error": 0.33203125, + "gradient_norm": 0.047838907688856125, + "elapsed": 349.57729148864746 + }, + { + "step": 928, + "loss": 0.6279090642929077, + "error": 0.412109375, + "gradient_norm": 0.030738679692149162, + "elapsed": 354.4736604690552 + }, + { + "step": 944, + "loss": 0.6028326153755188, + "error": 0.341796875, + "gradient_norm": 0.04459983482956886, + "elapsed": 359.2764792442322 + }, + { + "step": 960, + "loss": 0.19082097709178925, + "error": 0.0791015625, + "gradient_norm": 0.02478513866662979, + "elapsed": 364.1252644062042 + }, + { + "step": 976, + "loss": 0.443341463804245, + "error": 0.2197265625, + "gradient_norm": 0.14411240816116333, + "elapsed": 368.8472623825073 + }, + { + "step": 992, + "loss": 0.5665505528450012, + "error": 0.3125, + "gradient_norm": 0.06498897075653076, + "elapsed": 373.6812598705292 + }, + { + "step": 1008, + "loss": 0.4306175112724304, + "error": 0.1875, + "gradient_norm": 0.04873151704668999, + "elapsed": 378.56014752388 + }, + { + "step": 1024, + "loss": 0.46258389949798584, + "error": 0.244140625, + "gradient_norm": 0.09452047199010849, + "elapsed": 383.46526074409485 + } + ] + }, + "selected_checkpoint_steps": [ + 1024 + ], + "checkpoint_records": { + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "weights": "weights-1024.npz", + "weights_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "validation": "validation-1024.json", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints; when listed, blend candidates average incumbent and new probabilities equally", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.2476862980769231, + "512": 0.24981971153846153, + "1024": 0.24861778846153845, + "blend-512": 0.24816706730769234, + "blend-1024": 0.24764122596153845 + }, + "selected": "blend-1024" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2544320913461538, + "512": 0.25530348557692306, + "1024": 0.2538461538461539, + "blend-512": 0.2550330528846154, + "blend-1024": 0.25369591346153847 + }, + "selected": "blend-1024" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.2345402644230769, + "512": 0.2346905048076923, + "1024": 0.23502103365384613, + "blend-512": 0.23520132211538458, + "blend-1024": 0.23484074519230771 + }, + "selected": "incumbent" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.23999399038461539, + "512": 0.24036959134615385, + "1024": 0.23987379807692305, + "blend-512": 0.240234375, + "blend-1024": 0.24008413461538464 + }, + "selected": "1024" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24664963942307694, + "512": 0.24878305288461539, + "1024": 0.24810697115384614, + "blend-512": 0.2468900240384615, + "blend-1024": 0.24661959134615385 + }, + "selected": "blend-1024" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.23789062500000002, + "512": 0.23919771634615386, + "1024": 0.23847656250000002, + "blend-512": 0.23802584134615382, + "blend-1024": 0.2378155048076923 + }, + "selected": "blend-1024" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.23733473557692303, + "512": 0.23939302884615382, + "1024": 0.2384465144230769, + "blend-512": 0.23829627403846151, + "blend-1024": 0.23727463942307694 + }, + "selected": "blend-1024" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.2340444711538461, + "512": 0.23482572115384615, + "1024": 0.23378906249999998, + "blend-512": 0.23434495192307692, + "blend-1024": 0.23345853365384614 + }, + "selected": "blend-1024" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.24024939903846157 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22627704326923076 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "temporal1", + "training_run": { + "initialization": "Continue from rich weights trained from random initialization in this session; new temporal parameters randomly initialized now", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 2048, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261111, + "optimizer_restored": false, + "rng_restored": false, + "session_trained_starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.6317505836486816, + "error": 0.3681640625, + "gradient_norm": 0.04013459011912346, + "elapsed": 30.971998691558838 + }, + { + "step": 16, + "loss": 0.5091081857681274, + "error": 0.291015625, + "gradient_norm": 0.042228709906339645, + "elapsed": 35.17463397979736 + }, + { + "step": 32, + "loss": 0.626472532749176, + "error": 0.3642578125, + "gradient_norm": 0.05872415751218796, + "elapsed": 39.678136110305786 + }, + { + "step": 48, + "loss": 0.6005369424819946, + "error": 0.3515625, + "gradient_norm": 0.03848014399409294, + "elapsed": 44.16946887969971 + }, + { + "step": 64, + "loss": 0.5523768663406372, + "error": 0.302734375, + "gradient_norm": 0.06031862646341324, + "elapsed": 48.65217089653015 + }, + { + "step": 80, + "loss": 0.3981674611568451, + "error": 0.19921875, + "gradient_norm": 0.0542079322040081, + "elapsed": 53.21601867675781 + }, + { + "step": 96, + "loss": 0.5601426362991333, + "error": 0.2978515625, + "gradient_norm": 0.04770371690392494, + "elapsed": 57.81089663505554 + }, + { + "step": 112, + "loss": 0.5878150463104248, + "error": 0.34765625, + "gradient_norm": 0.10699950158596039, + "elapsed": 62.42190766334534 + }, + { + "step": 128, + "loss": 0.5232458114624023, + "error": 0.2861328125, + "gradient_norm": 0.0911584198474884, + "elapsed": 67.00223755836487 + }, + { + "step": 144, + "loss": 0.6119767427444458, + "error": 0.3623046875, + "gradient_norm": 0.062474437057971954, + "elapsed": 71.54070782661438 + }, + { + "step": 160, + "loss": 0.3037984371185303, + "error": 0.1474609375, + "gradient_norm": 0.05718141421675682, + "elapsed": 76.08167362213135 + }, + { + "step": 176, + "loss": 0.6038273572921753, + "error": 0.3662109375, + "gradient_norm": 0.0437164381146431, + "elapsed": 80.71864247322083 + }, + { + "step": 192, + "loss": 0.3304370641708374, + "error": 0.1572265625, + "gradient_norm": 0.05684761330485344, + "elapsed": 85.54437017440796 + }, + { + "step": 208, + "loss": 0.5785484313964844, + "error": 0.3251953125, + "gradient_norm": 0.09597272425889969, + "elapsed": 91.51522874832153 + }, + { + "step": 224, + "loss": 0.3110499978065491, + "error": 0.13671875, + "gradient_norm": 0.04815748706459999, + "elapsed": 97.1228940486908 + }, + { + "step": 240, + "loss": 0.6213864684104919, + "error": 0.3623046875, + "gradient_norm": 0.0540502592921257, + "elapsed": 102.90286135673523 + }, + { + "step": 256, + "loss": 0.2535272240638733, + "error": 0.1064453125, + "gradient_norm": 0.029962118715047836, + "elapsed": 108.39288640022278 + }, + { + "step": 272, + "loss": 0.6126939058303833, + "error": 0.3671875, + "gradient_norm": 0.06887879222631454, + "elapsed": 113.83897161483765 + }, + { + "step": 288, + "loss": 0.4556676149368286, + "error": 0.2236328125, + "gradient_norm": 0.16127081215381622, + "elapsed": 119.93085813522339 + }, + { + "step": 304, + "loss": 0.4973585605621338, + "error": 0.255859375, + "gradient_norm": 0.08082302659749985, + "elapsed": 125.90891909599304 + }, + { + "step": 320, + "loss": 0.6455868482589722, + "error": 0.419921875, + "gradient_norm": 0.04339660331606865, + "elapsed": 131.20537638664246 + }, + { + "step": 336, + "loss": 0.5343132615089417, + "error": 0.2880859375, + "gradient_norm": 0.07518009096384048, + "elapsed": 136.59086871147156 + }, + { + "step": 352, + "loss": 0.6505346894264221, + "error": 0.4033203125, + "gradient_norm": 0.03800992667675018, + "elapsed": 142.21085906028748 + }, + { + "step": 368, + "loss": 0.4882712960243225, + "error": 0.251953125, + "gradient_norm": 0.08170920610427856, + "elapsed": 146.95903658866882 + }, + { + "step": 384, + "loss": 0.5292021036148071, + "error": 0.296875, + "gradient_norm": 0.08454013615846634, + "elapsed": 151.6385259628296 + }, + { + "step": 400, + "loss": 0.6272899508476257, + "error": 0.3837890625, + "gradient_norm": 0.051436979323625565, + "elapsed": 156.3343904018402 + }, + { + "step": 416, + "loss": 0.052130259573459625, + "error": 0.0166015625, + "gradient_norm": 0.02377190627157688, + "elapsed": 160.92345547676086 + }, + { + "step": 432, + "loss": 0.5256737470626831, + "error": 0.3046875, + "gradient_norm": 0.07986386120319366, + "elapsed": 165.52879118919373 + }, + { + "step": 448, + "loss": 0.15193665027618408, + "error": 0.0576171875, + "gradient_norm": 0.06491660326719284, + "elapsed": 170.14827823638916 + }, + { + "step": 464, + "loss": 0.6418055295944214, + "error": 0.40625, + "gradient_norm": 0.07290885597467422, + "elapsed": 174.64974284172058 + }, + { + "step": 480, + "loss": 0.6055159568786621, + "error": 0.357421875, + "gradient_norm": 0.0795595794916153, + "elapsed": 179.17218685150146 + }, + { + "step": 496, + "loss": 0.6372283697128296, + "error": 0.3916015625, + "gradient_norm": 0.04387903958559036, + "elapsed": 183.77568197250366 + }, + { + "step": 512, + "loss": 0.637977123260498, + "error": 0.408203125, + "gradient_norm": 0.060665905475616455, + "elapsed": 188.31205368041992 + }, + { + "step": 528, + "loss": 0.4668862223625183, + "error": 0.2451171875, + "gradient_norm": 0.08566711097955704, + "elapsed": 206.40719985961914 + }, + { + "step": 544, + "loss": 0.4584413170814514, + "error": 0.244140625, + "gradient_norm": 0.08538200706243515, + "elapsed": 211.02819895744324 + }, + { + "step": 560, + "loss": 0.5615692138671875, + "error": 0.3291015625, + "gradient_norm": 0.043748609721660614, + "elapsed": 215.66470766067505 + }, + { + "step": 576, + "loss": 0.5151895880699158, + "error": 0.2880859375, + "gradient_norm": 0.05164863541722298, + "elapsed": 220.18949556350708 + }, + { + "step": 592, + "loss": 0.5618112087249756, + "error": 0.3291015625, + "gradient_norm": 0.05998719856142998, + "elapsed": 224.7216100692749 + }, + { + "step": 608, + "loss": 0.659294843673706, + "error": 0.431640625, + "gradient_norm": 0.09910348802804947, + "elapsed": 229.26827573776245 + }, + { + "step": 624, + "loss": 0.5895233154296875, + "error": 0.3447265625, + "gradient_norm": 0.045334093272686005, + "elapsed": 233.83731055259705 + }, + { + "step": 640, + "loss": 0.6081801056861877, + "error": 0.3388671875, + "gradient_norm": 0.06578423827886581, + "elapsed": 238.36345624923706 + }, + { + "step": 656, + "loss": 0.5349816083908081, + "error": 0.2939453125, + "gradient_norm": 0.09989562630653381, + "elapsed": 242.95086026191711 + }, + { + "step": 672, + "loss": 0.5871994495391846, + "error": 0.328125, + "gradient_norm": 0.08132346719503403, + "elapsed": 247.67088556289673 + }, + { + "step": 688, + "loss": 0.06012660637497902, + "error": 0.0146484375, + "gradient_norm": 0.012170507572591305, + "elapsed": 252.3202247619629 + }, + { + "step": 704, + "loss": 0.42179757356643677, + "error": 0.21484375, + "gradient_norm": 0.08384513854980469, + "elapsed": 256.91991782188416 + }, + { + "step": 720, + "loss": 0.6111758947372437, + "error": 0.3720703125, + "gradient_norm": 0.06689880788326263, + "elapsed": 261.56407928466797 + }, + { + "step": 736, + "loss": 0.29969727993011475, + "error": 0.1318359375, + "gradient_norm": 0.0743367150425911, + "elapsed": 266.22199630737305 + }, + { + "step": 752, + "loss": 0.051849883049726486, + "error": 0.0166015625, + "gradient_norm": 0.017005126923322678, + "elapsed": 270.8602342605591 + }, + { + "step": 768, + "loss": 0.6178420186042786, + "error": 0.3759765625, + "gradient_norm": 0.027732960879802704, + "elapsed": 275.47888374328613 + }, + { + "step": 784, + "loss": 0.45798996090888977, + "error": 0.228515625, + "gradient_norm": 0.0630083829164505, + "elapsed": 280.1709156036377 + }, + { + "step": 800, + "loss": 0.5104988813400269, + "error": 0.2724609375, + "gradient_norm": 0.041733670979738235, + "elapsed": 286.17937707901 + }, + { + "step": 816, + "loss": 0.6336112022399902, + "error": 0.3837890625, + "gradient_norm": 0.0755191296339035, + "elapsed": 291.7506103515625 + }, + { + "step": 832, + "loss": 0.6260952353477478, + "error": 0.3603515625, + "gradient_norm": 0.0318005345761776, + "elapsed": 297.31094622612 + }, + { + "step": 848, + "loss": 0.5870074033737183, + "error": 0.3525390625, + "gradient_norm": 0.12073405832052231, + "elapsed": 303.11089158058167 + }, + { + "step": 864, + "loss": 0.5125640034675598, + "error": 0.26953125, + "gradient_norm": 0.038650237023830414, + "elapsed": 308.7288725376129 + }, + { + "step": 880, + "loss": 0.19194915890693665, + "error": 0.0703125, + "gradient_norm": 0.061878547072410583, + "elapsed": 314.37042355537415 + }, + { + "step": 896, + "loss": 0.5409250259399414, + "error": 0.2919921875, + "gradient_norm": 0.06288820505142212, + "elapsed": 319.9398190975189 + }, + { + "step": 912, + "loss": 0.6164936423301697, + "error": 0.3701171875, + "gradient_norm": 0.043224163353443146, + "elapsed": 325.361323595047 + }, + { + "step": 928, + "loss": 0.16032151877880096, + "error": 0.0625, + "gradient_norm": 0.030957572162151337, + "elapsed": 331.21752285957336 + }, + { + "step": 944, + "loss": 0.646601676940918, + "error": 0.3818359375, + "gradient_norm": 0.05670839175581932, + "elapsed": 336.7825517654419 + }, + { + "step": 960, + "loss": 0.402952641248703, + "error": 0.1865234375, + "gradient_norm": 0.07500886172056198, + "elapsed": 342.6888346672058 + }, + { + "step": 976, + "loss": 0.5537433624267578, + "error": 0.2939453125, + "gradient_norm": 0.04955969750881195, + "elapsed": 348.5554690361023 + }, + { + "step": 992, + "loss": 0.559626579284668, + "error": 0.294921875, + "gradient_norm": 0.048295993357896805, + "elapsed": 354.3531894683838 + }, + { + "step": 1008, + "loss": 0.5034694671630859, + "error": 0.2705078125, + "gradient_norm": 0.05729879066348076, + "elapsed": 360.0949149131775 + }, + { + "step": 1024, + "loss": 0.3119734525680542, + "error": 0.1259765625, + "gradient_norm": 0.052326612174510956, + "elapsed": 365.7881224155426 + }, + { + "step": 1040, + "loss": 0.35799849033355713, + "error": 0.173828125, + "gradient_norm": 0.03801804035902023, + "elapsed": 386.5749418735504 + }, + { + "step": 1056, + "loss": 0.6178948879241943, + "error": 0.3515625, + "gradient_norm": 0.03620661422610283, + "elapsed": 391.48247838020325 + }, + { + "step": 1072, + "loss": 0.49231401085853577, + "error": 0.24609375, + "gradient_norm": 0.04391559213399887, + "elapsed": 396.08718824386597 + }, + { + "step": 1088, + "loss": 0.4119300842285156, + "error": 0.2001953125, + "gradient_norm": 0.1104700043797493, + "elapsed": 400.5326828956604 + }, + { + "step": 1104, + "loss": 0.4926626682281494, + "error": 0.265625, + "gradient_norm": 0.04246886447072029, + "elapsed": 404.95741271972656 + }, + { + "step": 1120, + "loss": 0.5027930736541748, + "error": 0.2607421875, + "gradient_norm": 0.0547240674495697, + "elapsed": 409.40319633483887 + }, + { + "step": 1136, + "loss": 0.5948058366775513, + "error": 0.3544921875, + "gradient_norm": 0.06810063123703003, + "elapsed": 413.8514006137848 + }, + { + "step": 1152, + "loss": 0.26567256450653076, + "error": 0.125, + "gradient_norm": 0.06689104437828064, + "elapsed": 418.29868721961975 + }, + { + "step": 1168, + "loss": 0.2866836190223694, + "error": 0.1240234375, + "gradient_norm": 0.029536213725805283, + "elapsed": 422.75131845474243 + }, + { + "step": 1184, + "loss": 0.6342021822929382, + "error": 0.4091796875, + "gradient_norm": 0.0704190731048584, + "elapsed": 427.1991722583771 + }, + { + "step": 1200, + "loss": 0.41626787185668945, + "error": 0.212890625, + "gradient_norm": 0.04480795934796333, + "elapsed": 431.6600706577301 + }, + { + "step": 1216, + "loss": 0.28460952639579773, + "error": 0.1337890625, + "gradient_norm": 0.03666983172297478, + "elapsed": 436.14414525032043 + }, + { + "step": 1232, + "loss": 0.044482216238975525, + "error": 0.0146484375, + "gradient_norm": 0.04537617415189743, + "elapsed": 440.6220428943634 + }, + { + "step": 1248, + "loss": 0.42564862966537476, + "error": 0.2119140625, + "gradient_norm": 0.03382417559623718, + "elapsed": 445.06736421585083 + }, + { + "step": 1264, + "loss": 0.27150213718414307, + "error": 0.123046875, + "gradient_norm": 0.033046118915081024, + "elapsed": 449.544029712677 + }, + { + "step": 1280, + "loss": 0.4927375912666321, + "error": 0.255859375, + "gradient_norm": 0.06812550127506256, + "elapsed": 454.07198667526245 + }, + { + "step": 1296, + "loss": 0.5541940927505493, + "error": 0.28125, + "gradient_norm": 0.1435294896364212, + "elapsed": 458.6031415462494 + }, + { + "step": 1312, + "loss": 0.5575842261314392, + "error": 0.2958984375, + "gradient_norm": 0.03811952844262123, + "elapsed": 463.1806228160858 + }, + { + "step": 1328, + "loss": 0.3479428291320801, + "error": 0.1591796875, + "gradient_norm": 0.0709012895822525, + "elapsed": 467.84689688682556 + }, + { + "step": 1344, + "loss": 0.1685580611228943, + "error": 0.0693359375, + "gradient_norm": 0.05423415079712868, + "elapsed": 472.6908576488495 + }, + { + "step": 1360, + "loss": 0.18506410717964172, + "error": 0.0771484375, + "gradient_norm": 0.03418596833944321, + "elapsed": 477.4269769191742 + }, + { + "step": 1376, + "loss": 0.5654555559158325, + "error": 0.3173828125, + "gradient_norm": 0.0685155838727951, + "elapsed": 482.08285188674927 + }, + { + "step": 1392, + "loss": 0.6116407513618469, + "error": 0.3603515625, + "gradient_norm": 0.05198948457837105, + "elapsed": 486.7167499065399 + }, + { + "step": 1408, + "loss": 0.4014682471752167, + "error": 0.19140625, + "gradient_norm": 0.1024075523018837, + "elapsed": 491.4308760166168 + }, + { + "step": 1424, + "loss": 0.051035866141319275, + "error": 0.0166015625, + "gradient_norm": 0.010207361541688442, + "elapsed": 496.1818380355835 + }, + { + "step": 1440, + "loss": 0.4725648760795593, + "error": 0.2412109375, + "gradient_norm": 0.03977378085255623, + "elapsed": 500.8668632507324 + }, + { + "step": 1456, + "loss": 0.5407818555831909, + "error": 0.2939453125, + "gradient_norm": 0.088577501475811, + "elapsed": 505.49274134635925 + }, + { + "step": 1472, + "loss": 0.5655064582824707, + "error": 0.3076171875, + "gradient_norm": 0.04452778398990631, + "elapsed": 510.2188584804535 + }, + { + "step": 1488, + "loss": 0.5799556374549866, + "error": 0.30859375, + "gradient_norm": 0.03976206108927727, + "elapsed": 514.9319434165955 + }, + { + "step": 1504, + "loss": 0.4660354256629944, + "error": 0.25390625, + "gradient_norm": 0.04365506023168564, + "elapsed": 519.5848798751831 + }, + { + "step": 1520, + "loss": 0.5505894422531128, + "error": 0.30859375, + "gradient_norm": 0.057772211730480194, + "elapsed": 524.3388590812683 + }, + { + "step": 1536, + "loss": 0.6251416206359863, + "error": 0.400390625, + "gradient_norm": 0.09649194777011871, + "elapsed": 529.483047246933 + }, + { + "step": 1552, + "loss": 0.05424533039331436, + "error": 0.0185546875, + "gradient_norm": 0.011683990247547626, + "elapsed": 548.1828610897064 + }, + { + "step": 1568, + "loss": 0.33612310886383057, + "error": 0.1611328125, + "gradient_norm": 0.051817383617162704, + "elapsed": 553.4256420135498 + }, + { + "step": 1584, + "loss": 0.045015305280685425, + "error": 0.0166015625, + "gradient_norm": 0.022604886442422867, + "elapsed": 558.6308543682098 + }, + { + "step": 1600, + "loss": 0.2701840102672577, + "error": 0.119140625, + "gradient_norm": 0.02910422720015049, + "elapsed": 563.8571691513062 + }, + { + "step": 1616, + "loss": 0.18982334434986115, + "error": 0.0849609375, + "gradient_norm": 0.025524422526359558, + "elapsed": 568.8628678321838 + }, + { + "step": 1632, + "loss": 0.3950161337852478, + "error": 0.185546875, + "gradient_norm": 0.08419577777385712, + "elapsed": 574.0815451145172 + }, + { + "step": 1648, + "loss": 0.49384528398513794, + "error": 0.255859375, + "gradient_norm": 0.08879344165325165, + "elapsed": 579.1229114532471 + }, + { + "step": 1664, + "loss": 0.5671384930610657, + "error": 0.3115234375, + "gradient_norm": 0.05374513566493988, + "elapsed": 584.114851474762 + }, + { + "step": 1680, + "loss": 0.6192574501037598, + "error": 0.37890625, + "gradient_norm": 0.043836336582899094, + "elapsed": 589.0708522796631 + }, + { + "step": 1696, + "loss": 0.2619469463825226, + "error": 0.1171875, + "gradient_norm": 0.040093280375003815, + "elapsed": 594.2814819812775 + }, + { + "step": 1712, + "loss": 0.33178141713142395, + "error": 0.162109375, + "gradient_norm": 0.04902712255716324, + "elapsed": 599.3068840503693 + }, + { + "step": 1728, + "loss": 0.385281503200531, + "error": 0.171875, + "gradient_norm": 0.03541380167007446, + "elapsed": 604.5308682918549 + }, + { + "step": 1744, + "loss": 0.1628715693950653, + "error": 0.0693359375, + "gradient_norm": 0.06111741065979004, + "elapsed": 609.309522151947 + }, + { + "step": 1760, + "loss": 0.5239119529724121, + "error": 0.2861328125, + "gradient_norm": 0.08513613045215607, + "elapsed": 614.0396001338959 + }, + { + "step": 1776, + "loss": 0.35721707344055176, + "error": 0.150390625, + "gradient_norm": 0.06337940692901611, + "elapsed": 618.6857132911682 + }, + { + "step": 1792, + "loss": 0.5985626578330994, + "error": 0.33203125, + "gradient_norm": 0.035725343972444534, + "elapsed": 623.3352344036102 + }, + { + "step": 1808, + "loss": 0.34676820039749146, + "error": 0.15234375, + "gradient_norm": 0.08163885772228241, + "elapsed": 627.9495220184326 + }, + { + "step": 1824, + "loss": 0.5633711814880371, + "error": 0.3037109375, + "gradient_norm": 0.05938677117228508, + "elapsed": 632.5820379257202 + }, + { + "step": 1840, + "loss": 0.6256523132324219, + "error": 0.384765625, + "gradient_norm": 0.04545137286186218, + "elapsed": 637.205274105072 + }, + { + "step": 1856, + "loss": 0.28091639280319214, + "error": 0.1298828125, + "gradient_norm": 0.04705077037215233, + "elapsed": 641.883561372757 + }, + { + "step": 1872, + "loss": 0.516182541847229, + "error": 0.263671875, + "gradient_norm": 0.08828777819871902, + "elapsed": 646.5188939571381 + }, + { + "step": 1888, + "loss": 0.48386621475219727, + "error": 0.25390625, + "gradient_norm": 0.05322824418544769, + "elapsed": 651.148512840271 + }, + { + "step": 1904, + "loss": 0.6141921281814575, + "error": 0.388671875, + "gradient_norm": 0.050139278173446655, + "elapsed": 655.7796437740326 + }, + { + "step": 1920, + "loss": 0.18002840876579285, + "error": 0.0712890625, + "gradient_norm": 0.04201133921742439, + "elapsed": 660.4064948558807 + }, + { + "step": 1936, + "loss": 0.17531852424144745, + "error": 0.0732421875, + "gradient_norm": 0.024726318195462227, + "elapsed": 664.9991583824158 + }, + { + "step": 1952, + "loss": 0.5088322758674622, + "error": 0.2744140625, + "gradient_norm": 0.04693225398659706, + "elapsed": 669.5544555187225 + }, + { + "step": 1968, + "loss": 0.5684165358543396, + "error": 0.3310546875, + "gradient_norm": 0.031029095873236656, + "elapsed": 674.2354445457458 + }, + { + "step": 1984, + "loss": 0.06459524482488632, + "error": 0.017578125, + "gradient_norm": 0.03600892797112465, + "elapsed": 678.7982559204102 + }, + { + "step": 2000, + "loss": 0.3614455461502075, + "error": 0.1748046875, + "gradient_norm": 0.07060294598340988, + "elapsed": 683.2650325298309 + }, + { + "step": 2016, + "loss": 0.35535523295402527, + "error": 0.166015625, + "gradient_norm": 0.05873403698205948, + "elapsed": 687.7125518321991 + }, + { + "step": 2032, + "loss": 0.5638720989227295, + "error": 0.3232421875, + "gradient_norm": 0.07380504906177521, + "elapsed": 692.1461188793182 + }, + { + "step": 2048, + "loss": 0.5301838517189026, + "error": 0.2919921875, + "gradient_norm": 0.05435395985841751, + "elapsed": 696.6235508918762 + } + ] + }, + "selected_checkpoint_steps": [ + 1024, + 1536, + 2048 + ], + "checkpoint_records": { + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "weights": "weights-2048.npz", + "weights_sha256": "26be9e0259b69a5870bf73e80a5a29fcf3519a3ff63e1d219c57a2113d9d34be", + "validation": "validation-2048.json", + "complete": true + }, + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "weights": "weights-1024.npz", + "weights_sha256": "6ab63cf2443420bfa5f2a817a90432dfc969348a8b23b0e6ccf3ffad3c381672", + "validation": "validation-1024.json", + "complete": true + }, + "1536": { + "step": 1536, + "new_training_shots": 1572864, + "weights": "weights-1536.npz", + "weights_sha256": "a4c6152c3b8f2f8ab8cdda41e92045ebc7eb944f9931a7937bf49c404bf96668", + "validation": "validation-1536.json", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints; when listed, blend candidates average the recorded small-contextual reference and new probabilities equally", + "blend_reference": "/run-state/workspace/research/context_upgrades/continuation2/predictions", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.24764122596153845, + "512": 0.24836237980769232, + "1024": 0.24783653846153847, + "1536": 0.24682992788461539, + "2048": 0.246875, + "blend-512": 0.24767127403846154, + "blend-1024": 0.24747596153846155, + "blend-1536": 0.24684495192307693, + "blend-2048": 0.24672475961538465 + }, + "selected": "blend-2048" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.25369591346153847, + "512": 0.25387620192307697, + "1024": 0.25365084134615384, + "1536": 0.25392127403846154, + "2048": 0.2531550480769231, + "blend-512": 0.25429687500000003, + "blend-1024": 0.25419170673076924, + "blend-1536": 0.25338040865384615, + "blend-2048": 0.2532301682692308 + }, + "selected": "2048" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.2345402644230769, + "512": 0.23535156250000003, + "1024": 0.23467548076923078, + "1536": 0.23575721153846152, + "2048": 0.23529146634615386, + "blend-512": 0.23494591346153842, + "blend-1024": 0.2351862980769231, + "blend-1536": 0.23535156249999997, + "blend-2048": 0.23446514423076925 + }, + "selected": "blend-2048" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.23987379807692305, + "512": 0.2393028846153846, + "1024": 0.2391676682692308, + "1536": 0.2397686298076923, + "2048": 0.23969350961538463, + "blend-512": 0.23972355769230771, + "blend-1024": 0.23967848557692312, + "blend-1536": 0.24044471153846153, + "blend-2048": 0.24048978365384613 + }, + "selected": "1024" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24661959134615385, + "512": 0.24767127403846156, + "1024": 0.24747596153846155, + "1536": 0.24658954326923077, + "2048": 0.2467397836538462, + "blend-512": 0.24634915865384613, + "blend-1024": 0.24684495192307693, + "blend-1536": 0.24640925480769232, + "blend-2048": 0.24625901442307693 + }, + "selected": "blend-2048" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.2378155048076923, + "512": 0.23912259615384615, + "1024": 0.23805588942307693, + "1536": 0.2381610576923077, + "2048": 0.2376802884615385, + "blend-512": 0.2378155048076923, + "blend-1024": 0.23765024038461538, + "blend-1536": 0.23783052884615388, + "blend-2048": 0.23760516826923078 + }, + "selected": "blend-2048" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.23727463942307694, + "512": 0.23766526442307695, + "1024": 0.23789062500000005, + "1536": 0.23713942307692307, + "2048": 0.23778545673076923, + "blend-512": 0.2376201923076923, + "blend-1024": 0.23743990384615382, + "blend-1536": 0.2375, + "blend-2048": 0.2376201923076923 + }, + "selected": "1536" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.23345853365384614, + "512": 0.2344200721153846, + "1024": 0.23431490384615386, + "1536": 0.23435997596153843, + "2048": 0.23390925480769229, + "blend-512": 0.23448016826923074, + "blend-1024": 0.2340895432692308, + "blend-1536": 0.23360877403846156, + "blend-2048": 0.2338792067307692 + }, + "selected": "incumbent" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2338341346153846 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22182992788461542 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "temporal2", + "training_run": { + "initialization": "Continue from this session's trained checkpoint", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "training_source_sha256": { + "learned_exact__temporal_train.py": "7d48d2fc7f62d0bec3023b3df1c2ac28537d0417966131ae3a156697a34cda5f", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "eligible_training_shots": 2067520, + "unique_training_rows_seen_in_this_phase": 1778773, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 18357, + "surface_code_bX_d3_r03_center_3_5": 16816, + "surface_code_bX_d3_r05_center_3_5": 17999, + "surface_code_bX_d3_r07_center_3_5": 15225, + "surface_code_bX_d3_r09_center_3_5": 16132, + "surface_code_bX_d3_r11_center_3_5": 17041, + "surface_code_bX_d3_r13_center_3_5": 18477, + "surface_code_bX_d3_r15_center_3_5": 18214, + "surface_code_bX_d3_r17_center_3_5": 16505, + "surface_code_bX_d3_r19_center_3_5": 17120, + "surface_code_bX_d3_r21_center_3_5": 17563, + "surface_code_bX_d3_r23_center_3_5": 16681, + "surface_code_bX_d3_r25_center_3_5": 18379, + "surface_code_bX_d3_r01_center_5_3": 17450, + "surface_code_bX_d3_r03_center_5_3": 17161, + "surface_code_bX_d3_r05_center_5_3": 15797, + "surface_code_bX_d3_r07_center_5_3": 17800, + "surface_code_bX_d3_r09_center_5_3": 17190, + "surface_code_bX_d3_r11_center_5_3": 15840, + "surface_code_bX_d3_r13_center_5_3": 15178, + "surface_code_bX_d3_r15_center_5_3": 14897, + "surface_code_bX_d3_r17_center_5_3": 18252, + "surface_code_bX_d3_r19_center_5_3": 17083, + "surface_code_bX_d3_r21_center_5_3": 17229, + "surface_code_bX_d3_r23_center_5_3": 14735, + "surface_code_bX_d3_r25_center_5_3": 17949, + "surface_code_bX_d3_r01_center_5_7": 17431, + "surface_code_bX_d3_r03_center_5_7": 16583, + "surface_code_bX_d3_r05_center_5_7": 16891, + "surface_code_bX_d3_r07_center_5_7": 17969, + "surface_code_bX_d3_r09_center_5_7": 17966, + "surface_code_bX_d3_r11_center_5_7": 14424, + "surface_code_bX_d3_r13_center_5_7": 16930, + "surface_code_bX_d3_r15_center_5_7": 15205, + "surface_code_bX_d3_r17_center_5_7": 18252, + "surface_code_bX_d3_r19_center_5_7": 17077, + "surface_code_bX_d3_r21_center_5_7": 16770, + "surface_code_bX_d3_r23_center_5_7": 17308, + "surface_code_bX_d3_r25_center_5_7": 17481, + "surface_code_bX_d3_r01_center_7_5": 16630, + "surface_code_bX_d3_r03_center_7_5": 17439, + "surface_code_bX_d3_r05_center_7_5": 15811, + "surface_code_bX_d3_r07_center_7_5": 16637, + "surface_code_bX_d3_r09_center_7_5": 18306, + "surface_code_bX_d3_r11_center_7_5": 18327, + "surface_code_bX_d3_r13_center_7_5": 17974, + "surface_code_bX_d3_r15_center_7_5": 16106, + "surface_code_bX_d3_r17_center_7_5": 15834, + "surface_code_bX_d3_r19_center_7_5": 17242, + "surface_code_bX_d3_r21_center_7_5": 17889, + "surface_code_bX_d3_r23_center_7_5": 17440, + "surface_code_bX_d3_r25_center_7_5": 17087, + "surface_code_bZ_d3_r01_center_3_5": 16236, + "surface_code_bZ_d3_r03_center_3_5": 17278, + "surface_code_bZ_d3_r05_center_3_5": 16577, + "surface_code_bZ_d3_r07_center_3_5": 17376, + "surface_code_bZ_d3_r09_center_3_5": 16000, + "surface_code_bZ_d3_r11_center_3_5": 15634, + "surface_code_bZ_d3_r13_center_3_5": 14950, + "surface_code_bZ_d3_r15_center_3_5": 16600, + "surface_code_bZ_d3_r17_center_3_5": 15381, + "surface_code_bZ_d3_r19_center_3_5": 16823, + "surface_code_bZ_d3_r21_center_3_5": 18789, + "surface_code_bZ_d3_r23_center_3_5": 15616, + "surface_code_bZ_d3_r25_center_3_5": 17088, + "surface_code_bZ_d3_r01_center_5_3": 17935, + "surface_code_bZ_d3_r03_center_5_3": 16256, + "surface_code_bZ_d3_r05_center_5_3": 17959, + "surface_code_bZ_d3_r07_center_5_3": 18401, + "surface_code_bZ_d3_r09_center_5_3": 16405, + "surface_code_bZ_d3_r11_center_5_3": 17274, + "surface_code_bZ_d3_r13_center_5_3": 18172, + "surface_code_bZ_d3_r15_center_5_3": 17525, + "surface_code_bZ_d3_r17_center_5_3": 18643, + "surface_code_bZ_d3_r19_center_5_3": 17816, + "surface_code_bZ_d3_r21_center_5_3": 17404, + "surface_code_bZ_d3_r23_center_5_3": 17253, + "surface_code_bZ_d3_r25_center_5_3": 17667, + "surface_code_bZ_d3_r01_center_5_7": 16203, + "surface_code_bZ_d3_r03_center_5_7": 17214, + "surface_code_bZ_d3_r05_center_5_7": 16799, + "surface_code_bZ_d3_r07_center_5_7": 17896, + "surface_code_bZ_d3_r09_center_5_7": 16411, + "surface_code_bZ_d3_r11_center_5_7": 17726, + "surface_code_bZ_d3_r13_center_5_7": 16313, + "surface_code_bZ_d3_r15_center_5_7": 17824, + "surface_code_bZ_d3_r17_center_5_7": 15656, + "surface_code_bZ_d3_r19_center_5_7": 17169, + "surface_code_bZ_d3_r21_center_5_7": 17194, + "surface_code_bZ_d3_r23_center_5_7": 16779, + "surface_code_bZ_d3_r25_center_5_7": 16970, + "surface_code_bZ_d3_r01_center_7_5": 16762, + "surface_code_bZ_d3_r03_center_7_5": 17320, + "surface_code_bZ_d3_r05_center_7_5": 17522, + "surface_code_bZ_d3_r07_center_7_5": 17914, + "surface_code_bZ_d3_r09_center_7_5": 18439, + "surface_code_bZ_d3_r11_center_7_5": 18218, + "surface_code_bZ_d3_r13_center_7_5": 17907, + "surface_code_bZ_d3_r15_center_7_5": 17597, + "surface_code_bZ_d3_r17_center_7_5": 18252, + "surface_code_bZ_d3_r19_center_7_5": 18379, + "surface_code_bZ_d3_r21_center_7_5": 16818, + "surface_code_bZ_d3_r23_center_7_5": 18430, + "surface_code_bZ_d3_r25_center_7_5": 17924 + }, + "steps": 4096, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.0005, + "sampling_seed": 20261121, + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_exact/temporal1/rng-2048.json", + "session_trained_starting_checkpoint": "/run-state/workspace/research/learned_exact/temporal1/weights-2048.npz", + "starting_checkpoint_sha256": "26be9e0259b69a5870bf73e80a5a29fcf3519a3ff63e1d219c57a2113d9d34be", + "starting_training_provenance": { + "initialization": "Continue from rich weights trained from random initialization in this session; new temporal parameters randomly initialized now", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 2048, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261111, + "optimizer_restored": false, + "rng_restored": false, + "session_trained_starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.6317505836486816, + "error": 0.3681640625, + "gradient_norm": 0.04013459011912346, + "elapsed": 30.971998691558838 + }, + { + "step": 16, + "loss": 0.5091081857681274, + "error": 0.291015625, + "gradient_norm": 0.042228709906339645, + "elapsed": 35.17463397979736 + }, + { + "step": 32, + "loss": 0.626472532749176, + "error": 0.3642578125, + "gradient_norm": 0.05872415751218796, + "elapsed": 39.678136110305786 + }, + { + "step": 48, + "loss": 0.6005369424819946, + "error": 0.3515625, + "gradient_norm": 0.03848014399409294, + "elapsed": 44.16946887969971 + }, + { + "step": 64, + "loss": 0.5523768663406372, + "error": 0.302734375, + "gradient_norm": 0.06031862646341324, + "elapsed": 48.65217089653015 + }, + { + "step": 80, + "loss": 0.3981674611568451, + "error": 0.19921875, + "gradient_norm": 0.0542079322040081, + "elapsed": 53.21601867675781 + }, + { + "step": 96, + "loss": 0.5601426362991333, + "error": 0.2978515625, + "gradient_norm": 0.04770371690392494, + "elapsed": 57.81089663505554 + }, + { + "step": 112, + "loss": 0.5878150463104248, + "error": 0.34765625, + "gradient_norm": 0.10699950158596039, + "elapsed": 62.42190766334534 + }, + { + "step": 128, + "loss": 0.5232458114624023, + "error": 0.2861328125, + "gradient_norm": 0.0911584198474884, + "elapsed": 67.00223755836487 + }, + { + "step": 144, + "loss": 0.6119767427444458, + "error": 0.3623046875, + "gradient_norm": 0.062474437057971954, + "elapsed": 71.54070782661438 + }, + { + "step": 160, + "loss": 0.3037984371185303, + "error": 0.1474609375, + "gradient_norm": 0.05718141421675682, + "elapsed": 76.08167362213135 + }, + { + "step": 176, + "loss": 0.6038273572921753, + "error": 0.3662109375, + "gradient_norm": 0.0437164381146431, + "elapsed": 80.71864247322083 + }, + { + "step": 192, + "loss": 0.3304370641708374, + "error": 0.1572265625, + "gradient_norm": 0.05684761330485344, + "elapsed": 85.54437017440796 + }, + { + "step": 208, + "loss": 0.5785484313964844, + "error": 0.3251953125, + "gradient_norm": 0.09597272425889969, + "elapsed": 91.51522874832153 + }, + { + "step": 224, + "loss": 0.3110499978065491, + "error": 0.13671875, + "gradient_norm": 0.04815748706459999, + "elapsed": 97.1228940486908 + }, + { + "step": 240, + "loss": 0.6213864684104919, + "error": 0.3623046875, + "gradient_norm": 0.0540502592921257, + "elapsed": 102.90286135673523 + }, + { + "step": 256, + "loss": 0.2535272240638733, + "error": 0.1064453125, + "gradient_norm": 0.029962118715047836, + "elapsed": 108.39288640022278 + }, + { + "step": 272, + "loss": 0.6126939058303833, + "error": 0.3671875, + "gradient_norm": 0.06887879222631454, + "elapsed": 113.83897161483765 + }, + { + "step": 288, + "loss": 0.4556676149368286, + "error": 0.2236328125, + "gradient_norm": 0.16127081215381622, + "elapsed": 119.93085813522339 + }, + { + "step": 304, + "loss": 0.4973585605621338, + "error": 0.255859375, + "gradient_norm": 0.08082302659749985, + "elapsed": 125.90891909599304 + }, + { + "step": 320, + "loss": 0.6455868482589722, + "error": 0.419921875, + "gradient_norm": 0.04339660331606865, + "elapsed": 131.20537638664246 + }, + { + "step": 336, + "loss": 0.5343132615089417, + "error": 0.2880859375, + "gradient_norm": 0.07518009096384048, + "elapsed": 136.59086871147156 + }, + { + "step": 352, + "loss": 0.6505346894264221, + "error": 0.4033203125, + "gradient_norm": 0.03800992667675018, + "elapsed": 142.21085906028748 + }, + { + "step": 368, + "loss": 0.4882712960243225, + "error": 0.251953125, + "gradient_norm": 0.08170920610427856, + "elapsed": 146.95903658866882 + }, + { + "step": 384, + "loss": 0.5292021036148071, + "error": 0.296875, + "gradient_norm": 0.08454013615846634, + "elapsed": 151.6385259628296 + }, + { + "step": 400, + "loss": 0.6272899508476257, + "error": 0.3837890625, + "gradient_norm": 0.051436979323625565, + "elapsed": 156.3343904018402 + }, + { + "step": 416, + "loss": 0.052130259573459625, + "error": 0.0166015625, + "gradient_norm": 0.02377190627157688, + "elapsed": 160.92345547676086 + }, + { + "step": 432, + "loss": 0.5256737470626831, + "error": 0.3046875, + "gradient_norm": 0.07986386120319366, + "elapsed": 165.52879118919373 + }, + { + "step": 448, + "loss": 0.15193665027618408, + "error": 0.0576171875, + "gradient_norm": 0.06491660326719284, + "elapsed": 170.14827823638916 + }, + { + "step": 464, + "loss": 0.6418055295944214, + "error": 0.40625, + "gradient_norm": 0.07290885597467422, + "elapsed": 174.64974284172058 + }, + { + "step": 480, + "loss": 0.6055159568786621, + "error": 0.357421875, + "gradient_norm": 0.0795595794916153, + "elapsed": 179.17218685150146 + }, + { + "step": 496, + "loss": 0.6372283697128296, + "error": 0.3916015625, + "gradient_norm": 0.04387903958559036, + "elapsed": 183.77568197250366 + }, + { + "step": 512, + "loss": 0.637977123260498, + "error": 0.408203125, + "gradient_norm": 0.060665905475616455, + "elapsed": 188.31205368041992 + }, + { + "step": 528, + "loss": 0.4668862223625183, + "error": 0.2451171875, + "gradient_norm": 0.08566711097955704, + "elapsed": 206.40719985961914 + }, + { + "step": 544, + "loss": 0.4584413170814514, + "error": 0.244140625, + "gradient_norm": 0.08538200706243515, + "elapsed": 211.02819895744324 + }, + { + "step": 560, + "loss": 0.5615692138671875, + "error": 0.3291015625, + "gradient_norm": 0.043748609721660614, + "elapsed": 215.66470766067505 + }, + { + "step": 576, + "loss": 0.5151895880699158, + "error": 0.2880859375, + "gradient_norm": 0.05164863541722298, + "elapsed": 220.18949556350708 + }, + { + "step": 592, + "loss": 0.5618112087249756, + "error": 0.3291015625, + "gradient_norm": 0.05998719856142998, + "elapsed": 224.7216100692749 + }, + { + "step": 608, + "loss": 0.659294843673706, + "error": 0.431640625, + "gradient_norm": 0.09910348802804947, + "elapsed": 229.26827573776245 + }, + { + "step": 624, + "loss": 0.5895233154296875, + "error": 0.3447265625, + "gradient_norm": 0.045334093272686005, + "elapsed": 233.83731055259705 + }, + { + "step": 640, + "loss": 0.6081801056861877, + "error": 0.3388671875, + "gradient_norm": 0.06578423827886581, + "elapsed": 238.36345624923706 + }, + { + "step": 656, + "loss": 0.5349816083908081, + "error": 0.2939453125, + "gradient_norm": 0.09989562630653381, + "elapsed": 242.95086026191711 + }, + { + "step": 672, + "loss": 0.5871994495391846, + "error": 0.328125, + "gradient_norm": 0.08132346719503403, + "elapsed": 247.67088556289673 + }, + { + "step": 688, + "loss": 0.06012660637497902, + "error": 0.0146484375, + "gradient_norm": 0.012170507572591305, + "elapsed": 252.3202247619629 + }, + { + "step": 704, + "loss": 0.42179757356643677, + "error": 0.21484375, + "gradient_norm": 0.08384513854980469, + "elapsed": 256.91991782188416 + }, + { + "step": 720, + "loss": 0.6111758947372437, + "error": 0.3720703125, + "gradient_norm": 0.06689880788326263, + "elapsed": 261.56407928466797 + }, + { + "step": 736, + "loss": 0.29969727993011475, + "error": 0.1318359375, + "gradient_norm": 0.0743367150425911, + "elapsed": 266.22199630737305 + }, + { + "step": 752, + "loss": 0.051849883049726486, + "error": 0.0166015625, + "gradient_norm": 0.017005126923322678, + "elapsed": 270.8602342605591 + }, + { + "step": 768, + "loss": 0.6178420186042786, + "error": 0.3759765625, + "gradient_norm": 0.027732960879802704, + "elapsed": 275.47888374328613 + }, + { + "step": 784, + "loss": 0.45798996090888977, + "error": 0.228515625, + "gradient_norm": 0.0630083829164505, + "elapsed": 280.1709156036377 + }, + { + "step": 800, + "loss": 0.5104988813400269, + "error": 0.2724609375, + "gradient_norm": 0.041733670979738235, + "elapsed": 286.17937707901 + }, + { + "step": 816, + "loss": 0.6336112022399902, + "error": 0.3837890625, + "gradient_norm": 0.0755191296339035, + "elapsed": 291.7506103515625 + }, + { + "step": 832, + "loss": 0.6260952353477478, + "error": 0.3603515625, + "gradient_norm": 0.0318005345761776, + "elapsed": 297.31094622612 + }, + { + "step": 848, + "loss": 0.5870074033737183, + "error": 0.3525390625, + "gradient_norm": 0.12073405832052231, + "elapsed": 303.11089158058167 + }, + { + "step": 864, + "loss": 0.5125640034675598, + "error": 0.26953125, + "gradient_norm": 0.038650237023830414, + "elapsed": 308.7288725376129 + }, + { + "step": 880, + "loss": 0.19194915890693665, + "error": 0.0703125, + "gradient_norm": 0.061878547072410583, + "elapsed": 314.37042355537415 + }, + { + "step": 896, + "loss": 0.5409250259399414, + "error": 0.2919921875, + "gradient_norm": 0.06288820505142212, + "elapsed": 319.9398190975189 + }, + { + "step": 912, + "loss": 0.6164936423301697, + "error": 0.3701171875, + "gradient_norm": 0.043224163353443146, + "elapsed": 325.361323595047 + }, + { + "step": 928, + "loss": 0.16032151877880096, + "error": 0.0625, + "gradient_norm": 0.030957572162151337, + "elapsed": 331.21752285957336 + }, + { + "step": 944, + "loss": 0.646601676940918, + "error": 0.3818359375, + "gradient_norm": 0.05670839175581932, + "elapsed": 336.7825517654419 + }, + { + "step": 960, + "loss": 0.402952641248703, + "error": 0.1865234375, + "gradient_norm": 0.07500886172056198, + "elapsed": 342.6888346672058 + }, + { + "step": 976, + "loss": 0.5537433624267578, + "error": 0.2939453125, + "gradient_norm": 0.04955969750881195, + "elapsed": 348.5554690361023 + }, + { + "step": 992, + "loss": 0.559626579284668, + "error": 0.294921875, + "gradient_norm": 0.048295993357896805, + "elapsed": 354.3531894683838 + }, + { + "step": 1008, + "loss": 0.5034694671630859, + "error": 0.2705078125, + "gradient_norm": 0.05729879066348076, + "elapsed": 360.0949149131775 + }, + { + "step": 1024, + "loss": 0.3119734525680542, + "error": 0.1259765625, + "gradient_norm": 0.052326612174510956, + "elapsed": 365.7881224155426 + }, + { + "step": 1040, + "loss": 0.35799849033355713, + "error": 0.173828125, + "gradient_norm": 0.03801804035902023, + "elapsed": 386.5749418735504 + }, + { + "step": 1056, + "loss": 0.6178948879241943, + "error": 0.3515625, + "gradient_norm": 0.03620661422610283, + "elapsed": 391.48247838020325 + }, + { + "step": 1072, + "loss": 0.49231401085853577, + "error": 0.24609375, + "gradient_norm": 0.04391559213399887, + "elapsed": 396.08718824386597 + }, + { + "step": 1088, + "loss": 0.4119300842285156, + "error": 0.2001953125, + "gradient_norm": 0.1104700043797493, + "elapsed": 400.5326828956604 + }, + { + "step": 1104, + "loss": 0.4926626682281494, + "error": 0.265625, + "gradient_norm": 0.04246886447072029, + "elapsed": 404.95741271972656 + }, + { + "step": 1120, + "loss": 0.5027930736541748, + "error": 0.2607421875, + "gradient_norm": 0.0547240674495697, + "elapsed": 409.40319633483887 + }, + { + "step": 1136, + "loss": 0.5948058366775513, + "error": 0.3544921875, + "gradient_norm": 0.06810063123703003, + "elapsed": 413.8514006137848 + }, + { + "step": 1152, + "loss": 0.26567256450653076, + "error": 0.125, + "gradient_norm": 0.06689104437828064, + "elapsed": 418.29868721961975 + }, + { + "step": 1168, + "loss": 0.2866836190223694, + "error": 0.1240234375, + "gradient_norm": 0.029536213725805283, + "elapsed": 422.75131845474243 + }, + { + "step": 1184, + "loss": 0.6342021822929382, + "error": 0.4091796875, + "gradient_norm": 0.0704190731048584, + "elapsed": 427.1991722583771 + }, + { + "step": 1200, + "loss": 0.41626787185668945, + "error": 0.212890625, + "gradient_norm": 0.04480795934796333, + "elapsed": 431.6600706577301 + }, + { + "step": 1216, + "loss": 0.28460952639579773, + "error": 0.1337890625, + "gradient_norm": 0.03666983172297478, + "elapsed": 436.14414525032043 + }, + { + "step": 1232, + "loss": 0.044482216238975525, + "error": 0.0146484375, + "gradient_norm": 0.04537617415189743, + "elapsed": 440.6220428943634 + }, + { + "step": 1248, + "loss": 0.42564862966537476, + "error": 0.2119140625, + "gradient_norm": 0.03382417559623718, + "elapsed": 445.06736421585083 + }, + { + "step": 1264, + "loss": 0.27150213718414307, + "error": 0.123046875, + "gradient_norm": 0.033046118915081024, + "elapsed": 449.544029712677 + }, + { + "step": 1280, + "loss": 0.4927375912666321, + "error": 0.255859375, + "gradient_norm": 0.06812550127506256, + "elapsed": 454.07198667526245 + }, + { + "step": 1296, + "loss": 0.5541940927505493, + "error": 0.28125, + "gradient_norm": 0.1435294896364212, + "elapsed": 458.6031415462494 + }, + { + "step": 1312, + "loss": 0.5575842261314392, + "error": 0.2958984375, + "gradient_norm": 0.03811952844262123, + "elapsed": 463.1806228160858 + }, + { + "step": 1328, + "loss": 0.3479428291320801, + "error": 0.1591796875, + "gradient_norm": 0.0709012895822525, + "elapsed": 467.84689688682556 + }, + { + "step": 1344, + "loss": 0.1685580611228943, + "error": 0.0693359375, + "gradient_norm": 0.05423415079712868, + "elapsed": 472.6908576488495 + }, + { + "step": 1360, + "loss": 0.18506410717964172, + "error": 0.0771484375, + "gradient_norm": 0.03418596833944321, + "elapsed": 477.4269769191742 + }, + { + "step": 1376, + "loss": 0.5654555559158325, + "error": 0.3173828125, + "gradient_norm": 0.0685155838727951, + "elapsed": 482.08285188674927 + }, + { + "step": 1392, + "loss": 0.6116407513618469, + "error": 0.3603515625, + "gradient_norm": 0.05198948457837105, + "elapsed": 486.7167499065399 + }, + { + "step": 1408, + "loss": 0.4014682471752167, + "error": 0.19140625, + "gradient_norm": 0.1024075523018837, + "elapsed": 491.4308760166168 + }, + { + "step": 1424, + "loss": 0.051035866141319275, + "error": 0.0166015625, + "gradient_norm": 0.010207361541688442, + "elapsed": 496.1818380355835 + }, + { + "step": 1440, + "loss": 0.4725648760795593, + "error": 0.2412109375, + "gradient_norm": 0.03977378085255623, + "elapsed": 500.8668632507324 + }, + { + "step": 1456, + "loss": 0.5407818555831909, + "error": 0.2939453125, + "gradient_norm": 0.088577501475811, + "elapsed": 505.49274134635925 + }, + { + "step": 1472, + "loss": 0.5655064582824707, + "error": 0.3076171875, + "gradient_norm": 0.04452778398990631, + "elapsed": 510.2188584804535 + }, + { + "step": 1488, + "loss": 0.5799556374549866, + "error": 0.30859375, + "gradient_norm": 0.03976206108927727, + "elapsed": 514.9319434165955 + }, + { + "step": 1504, + "loss": 0.4660354256629944, + "error": 0.25390625, + "gradient_norm": 0.04365506023168564, + "elapsed": 519.5848798751831 + }, + { + "step": 1520, + "loss": 0.5505894422531128, + "error": 0.30859375, + "gradient_norm": 0.057772211730480194, + "elapsed": 524.3388590812683 + }, + { + "step": 1536, + "loss": 0.6251416206359863, + "error": 0.400390625, + "gradient_norm": 0.09649194777011871, + "elapsed": 529.483047246933 + }, + { + "step": 1552, + "loss": 0.05424533039331436, + "error": 0.0185546875, + "gradient_norm": 0.011683990247547626, + "elapsed": 548.1828610897064 + }, + { + "step": 1568, + "loss": 0.33612310886383057, + "error": 0.1611328125, + "gradient_norm": 0.051817383617162704, + "elapsed": 553.4256420135498 + }, + { + "step": 1584, + "loss": 0.045015305280685425, + "error": 0.0166015625, + "gradient_norm": 0.022604886442422867, + "elapsed": 558.6308543682098 + }, + { + "step": 1600, + "loss": 0.2701840102672577, + "error": 0.119140625, + "gradient_norm": 0.02910422720015049, + "elapsed": 563.8571691513062 + }, + { + "step": 1616, + "loss": 0.18982334434986115, + "error": 0.0849609375, + "gradient_norm": 0.025524422526359558, + "elapsed": 568.8628678321838 + }, + { + "step": 1632, + "loss": 0.3950161337852478, + "error": 0.185546875, + "gradient_norm": 0.08419577777385712, + "elapsed": 574.0815451145172 + }, + { + "step": 1648, + "loss": 0.49384528398513794, + "error": 0.255859375, + "gradient_norm": 0.08879344165325165, + "elapsed": 579.1229114532471 + }, + { + "step": 1664, + "loss": 0.5671384930610657, + "error": 0.3115234375, + "gradient_norm": 0.05374513566493988, + "elapsed": 584.114851474762 + }, + { + "step": 1680, + "loss": 0.6192574501037598, + "error": 0.37890625, + "gradient_norm": 0.043836336582899094, + "elapsed": 589.0708522796631 + }, + { + "step": 1696, + "loss": 0.2619469463825226, + "error": 0.1171875, + "gradient_norm": 0.040093280375003815, + "elapsed": 594.2814819812775 + }, + { + "step": 1712, + "loss": 0.33178141713142395, + "error": 0.162109375, + "gradient_norm": 0.04902712255716324, + "elapsed": 599.3068840503693 + }, + { + "step": 1728, + "loss": 0.385281503200531, + "error": 0.171875, + "gradient_norm": 0.03541380167007446, + "elapsed": 604.5308682918549 + }, + { + "step": 1744, + "loss": 0.1628715693950653, + "error": 0.0693359375, + "gradient_norm": 0.06111741065979004, + "elapsed": 609.309522151947 + }, + { + "step": 1760, + "loss": 0.5239119529724121, + "error": 0.2861328125, + "gradient_norm": 0.08513613045215607, + "elapsed": 614.0396001338959 + }, + { + "step": 1776, + "loss": 0.35721707344055176, + "error": 0.150390625, + "gradient_norm": 0.06337940692901611, + "elapsed": 618.6857132911682 + }, + { + "step": 1792, + "loss": 0.5985626578330994, + "error": 0.33203125, + "gradient_norm": 0.035725343972444534, + "elapsed": 623.3352344036102 + }, + { + "step": 1808, + "loss": 0.34676820039749146, + "error": 0.15234375, + "gradient_norm": 0.08163885772228241, + "elapsed": 627.9495220184326 + }, + { + "step": 1824, + "loss": 0.5633711814880371, + "error": 0.3037109375, + "gradient_norm": 0.05938677117228508, + "elapsed": 632.5820379257202 + }, + { + "step": 1840, + "loss": 0.6256523132324219, + "error": 0.384765625, + "gradient_norm": 0.04545137286186218, + "elapsed": 637.205274105072 + }, + { + "step": 1856, + "loss": 0.28091639280319214, + "error": 0.1298828125, + "gradient_norm": 0.04705077037215233, + "elapsed": 641.883561372757 + }, + { + "step": 1872, + "loss": 0.516182541847229, + "error": 0.263671875, + "gradient_norm": 0.08828777819871902, + "elapsed": 646.5188939571381 + }, + { + "step": 1888, + "loss": 0.48386621475219727, + "error": 0.25390625, + "gradient_norm": 0.05322824418544769, + "elapsed": 651.148512840271 + }, + { + "step": 1904, + "loss": 0.6141921281814575, + "error": 0.388671875, + "gradient_norm": 0.050139278173446655, + "elapsed": 655.7796437740326 + }, + { + "step": 1920, + "loss": 0.18002840876579285, + "error": 0.0712890625, + "gradient_norm": 0.04201133921742439, + "elapsed": 660.4064948558807 + }, + { + "step": 1936, + "loss": 0.17531852424144745, + "error": 0.0732421875, + "gradient_norm": 0.024726318195462227, + "elapsed": 664.9991583824158 + }, + { + "step": 1952, + "loss": 0.5088322758674622, + "error": 0.2744140625, + "gradient_norm": 0.04693225398659706, + "elapsed": 669.5544555187225 + }, + { + "step": 1968, + "loss": 0.5684165358543396, + "error": 0.3310546875, + "gradient_norm": 0.031029095873236656, + "elapsed": 674.2354445457458 + }, + { + "step": 1984, + "loss": 0.06459524482488632, + "error": 0.017578125, + "gradient_norm": 0.03600892797112465, + "elapsed": 678.7982559204102 + }, + { + "step": 2000, + "loss": 0.3614455461502075, + "error": 0.1748046875, + "gradient_norm": 0.07060294598340988, + "elapsed": 683.2650325298309 + }, + { + "step": 2016, + "loss": 0.35535523295402527, + "error": 0.166015625, + "gradient_norm": 0.05873403698205948, + "elapsed": 687.7125518321991 + }, + { + "step": 2032, + "loss": 0.5638720989227295, + "error": 0.3232421875, + "gradient_norm": 0.07380504906177521, + "elapsed": 692.1461188793182 + }, + { + "step": 2048, + "loss": 0.5301838517189026, + "error": 0.2919921875, + "gradient_norm": 0.05435395985841751, + "elapsed": 696.6235508918762 + } + ] + }, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.250907301902771, + "error": 0.1083984375, + "gradient_norm": 0.07171476632356644, + "elapsed": 44.811134576797485 + }, + { + "step": 16, + "loss": 0.5958679914474487, + "error": 0.3662109375, + "gradient_norm": 0.07673005014657974, + "elapsed": 49.90856671333313 + }, + { + "step": 32, + "loss": 0.47648972272872925, + "error": 0.2421875, + "gradient_norm": 0.08561501652002335, + "elapsed": 55.179388761520386 + }, + { + "step": 48, + "loss": 0.06145006790757179, + "error": 0.0234375, + "gradient_norm": 0.01556467730551958, + "elapsed": 61.0339195728302 + }, + { + "step": 64, + "loss": 0.3687053918838501, + "error": 0.1884765625, + "gradient_norm": 0.08752371370792389, + "elapsed": 65.95811891555786 + }, + { + "step": 80, + "loss": 0.6481984853744507, + "error": 0.4140625, + "gradient_norm": 0.05311283841729164, + "elapsed": 70.56021332740784 + }, + { + "step": 96, + "loss": 0.42319929599761963, + "error": 0.2138671875, + "gradient_norm": 0.05047478526830673, + "elapsed": 75.11613631248474 + }, + { + "step": 112, + "loss": 0.47527259588241577, + "error": 0.24609375, + "gradient_norm": 0.038366906344890594, + "elapsed": 79.53446984291077 + }, + { + "step": 128, + "loss": 0.5996723175048828, + "error": 0.3369140625, + "gradient_norm": 0.1213272362947464, + "elapsed": 83.97515749931335 + }, + { + "step": 144, + "loss": 0.04971993714570999, + "error": 0.0146484375, + "gradient_norm": 0.008080735802650452, + "elapsed": 88.44039463996887 + }, + { + "step": 160, + "loss": 0.35900360345840454, + "error": 0.162109375, + "gradient_norm": 0.03359593451023102, + "elapsed": 92.89548206329346 + }, + { + "step": 176, + "loss": 0.5342063903808594, + "error": 0.2978515625, + "gradient_norm": 0.04794691130518913, + "elapsed": 97.35658049583435 + }, + { + "step": 192, + "loss": 0.6300076246261597, + "error": 0.369140625, + "gradient_norm": 0.081769198179245, + "elapsed": 101.81493759155273 + }, + { + "step": 208, + "loss": 0.6191903948783875, + "error": 0.3828125, + "gradient_norm": 0.07145775109529495, + "elapsed": 106.2480263710022 + }, + { + "step": 224, + "loss": 0.5155678391456604, + "error": 0.28515625, + "gradient_norm": 0.06772179156541824, + "elapsed": 110.71284222602844 + }, + { + "step": 240, + "loss": 0.634708046913147, + "error": 0.3857421875, + "gradient_norm": 0.09493093192577362, + "elapsed": 115.14978742599487 + }, + { + "step": 256, + "loss": 0.1840895414352417, + "error": 0.0751953125, + "gradient_norm": 0.025586696341633797, + "elapsed": 119.61202120780945 + }, + { + "step": 272, + "loss": 0.2775103449821472, + "error": 0.12890625, + "gradient_norm": 0.06913147866725922, + "elapsed": 124.02584528923035 + }, + { + "step": 288, + "loss": 0.6163080334663391, + "error": 0.3642578125, + "gradient_norm": 0.05895426496863365, + "elapsed": 128.46512532234192 + }, + { + "step": 304, + "loss": 0.5276986360549927, + "error": 0.287109375, + "gradient_norm": 0.06955187022686005, + "elapsed": 132.89240765571594 + }, + { + "step": 320, + "loss": 0.44859516620635986, + "error": 0.22265625, + "gradient_norm": 0.07272452116012573, + "elapsed": 137.32864713668823 + }, + { + "step": 336, + "loss": 0.48315611481666565, + "error": 0.2626953125, + "gradient_norm": 0.03321139141917229, + "elapsed": 141.80009770393372 + }, + { + "step": 352, + "loss": 0.6107717752456665, + "error": 0.3544921875, + "gradient_norm": 0.05243214592337608, + "elapsed": 146.36439752578735 + }, + { + "step": 368, + "loss": 0.6215153932571411, + "error": 0.357421875, + "gradient_norm": 0.04383325204253197, + "elapsed": 150.99996852874756 + }, + { + "step": 384, + "loss": 0.6130329966545105, + "error": 0.35546875, + "gradient_norm": 0.04113119840621948, + "elapsed": 155.62374639511108 + }, + { + "step": 400, + "loss": 0.30471885204315186, + "error": 0.142578125, + "gradient_norm": 0.04447556659579277, + "elapsed": 160.17594957351685 + }, + { + "step": 416, + "loss": 0.6154489517211914, + "error": 0.37109375, + "gradient_norm": 0.04456057772040367, + "elapsed": 164.7639675140381 + }, + { + "step": 432, + "loss": 0.6134694218635559, + "error": 0.337890625, + "gradient_norm": 0.04219559207558632, + "elapsed": 169.32792139053345 + }, + { + "step": 448, + "loss": 0.5463185906410217, + "error": 0.2939453125, + "gradient_norm": 0.07746092975139618, + "elapsed": 173.88445162773132 + }, + { + "step": 464, + "loss": 0.06016772612929344, + "error": 0.01953125, + "gradient_norm": 0.01364185381680727, + "elapsed": 178.42725706100464 + }, + { + "step": 480, + "loss": 0.388141393661499, + "error": 0.18359375, + "gradient_norm": 0.04870256036520004, + "elapsed": 182.99062085151672 + }, + { + "step": 496, + "loss": 0.44524821639060974, + "error": 0.2216796875, + "gradient_norm": 0.03453445807099342, + "elapsed": 187.56396961212158 + }, + { + "step": 512, + "loss": 0.34312355518341064, + "error": 0.154296875, + "gradient_norm": 0.06794509291648865, + "elapsed": 192.27511191368103 + }, + { + "step": 528, + "loss": 0.19467462599277496, + "error": 0.0771484375, + "gradient_norm": 0.042381469160318375, + "elapsed": 197.7108268737793 + }, + { + "step": 544, + "loss": 0.46226584911346436, + "error": 0.2421875, + "gradient_norm": 0.06073570251464844, + "elapsed": 202.97405791282654 + }, + { + "step": 560, + "loss": 0.525318443775177, + "error": 0.2822265625, + "gradient_norm": 0.06954885274171829, + "elapsed": 208.69676971435547 + }, + { + "step": 576, + "loss": 0.6158387064933777, + "error": 0.349609375, + "gradient_norm": 0.07587578892707825, + "elapsed": 214.80397653579712 + }, + { + "step": 592, + "loss": 0.5515886545181274, + "error": 0.298828125, + "gradient_norm": 0.04969338700175285, + "elapsed": 220.27399611473083 + }, + { + "step": 608, + "loss": 0.18365338444709778, + "error": 0.0654296875, + "gradient_norm": 0.08657706528902054, + "elapsed": 224.81246256828308 + }, + { + "step": 624, + "loss": 0.4578855633735657, + "error": 0.2421875, + "gradient_norm": 0.04942100867629051, + "elapsed": 229.45902252197266 + }, + { + "step": 640, + "loss": 0.37826013565063477, + "error": 0.1865234375, + "gradient_norm": 0.047499872744083405, + "elapsed": 233.9695644378662 + }, + { + "step": 656, + "loss": 0.40863412618637085, + "error": 0.2001953125, + "gradient_norm": 0.07845330238342285, + "elapsed": 238.584894657135 + }, + { + "step": 672, + "loss": 0.5640332698822021, + "error": 0.2880859375, + "gradient_norm": 0.057469289749860764, + "elapsed": 243.0929844379425 + }, + { + "step": 688, + "loss": 0.030216243118047714, + "error": 0.0078125, + "gradient_norm": 0.04682641476392746, + "elapsed": 247.581125497818 + }, + { + "step": 704, + "loss": 0.375002384185791, + "error": 0.1826171875, + "gradient_norm": 0.04864194989204407, + "elapsed": 252.1564691066742 + }, + { + "step": 720, + "loss": 0.5145515203475952, + "error": 0.2744140625, + "gradient_norm": 0.052671682089567184, + "elapsed": 256.6466488838196 + }, + { + "step": 736, + "loss": 0.067174531519413, + "error": 0.0224609375, + "gradient_norm": 0.019299577921628952, + "elapsed": 261.1185076236725 + }, + { + "step": 752, + "loss": 0.24909992516040802, + "error": 0.111328125, + "gradient_norm": 0.06907463818788528, + "elapsed": 265.61960339546204 + }, + { + "step": 768, + "loss": 0.5088074207305908, + "error": 0.2744140625, + "gradient_norm": 0.06963017582893372, + "elapsed": 270.07474064826965 + }, + { + "step": 784, + "loss": 0.3783387839794159, + "error": 0.1826171875, + "gradient_norm": 0.05537794530391693, + "elapsed": 274.52722239494324 + }, + { + "step": 800, + "loss": 0.6107200980186462, + "error": 0.3623046875, + "gradient_norm": 0.0470259003341198, + "elapsed": 279.0401859283447 + }, + { + "step": 816, + "loss": 0.5778236389160156, + "error": 0.3212890625, + "gradient_norm": 0.10146680474281311, + "elapsed": 283.5114622116089 + }, + { + "step": 832, + "loss": 0.576002299785614, + "error": 0.3076171875, + "gradient_norm": 0.07760787010192871, + "elapsed": 288.04797434806824 + }, + { + "step": 848, + "loss": 0.6179666519165039, + "error": 0.3740234375, + "gradient_norm": 0.07383852452039719, + "elapsed": 292.60600209236145 + }, + { + "step": 864, + "loss": 0.3105512857437134, + "error": 0.1455078125, + "gradient_norm": 0.052953749895095825, + "elapsed": 297.12180352211 + }, + { + "step": 880, + "loss": 0.4802623987197876, + "error": 0.2548828125, + "gradient_norm": 0.07736275345087051, + "elapsed": 301.6091134548187 + }, + { + "step": 896, + "loss": 0.5572722554206848, + "error": 0.318359375, + "gradient_norm": 0.053303152322769165, + "elapsed": 306.1978073120117 + }, + { + "step": 912, + "loss": 0.34814420342445374, + "error": 0.1669921875, + "gradient_norm": 0.037726350128650665, + "elapsed": 310.78571581840515 + }, + { + "step": 928, + "loss": 0.41743016242980957, + "error": 0.21875, + "gradient_norm": 0.05238872766494751, + "elapsed": 315.24156188964844 + }, + { + "step": 944, + "loss": 0.5757850408554077, + "error": 0.3173828125, + "gradient_norm": 0.05837905779480934, + "elapsed": 319.78475165367126 + }, + { + "step": 960, + "loss": 0.40727972984313965, + "error": 0.197265625, + "gradient_norm": 0.059294261038303375, + "elapsed": 324.2090265750885 + }, + { + "step": 976, + "loss": 0.32715001702308655, + "error": 0.1533203125, + "gradient_norm": 0.11543179303407669, + "elapsed": 328.6462152004242 + }, + { + "step": 992, + "loss": 0.5578742623329163, + "error": 0.314453125, + "gradient_norm": 0.06282714009284973, + "elapsed": 333.0712504386902 + }, + { + "step": 1008, + "loss": 0.5052692294120789, + "error": 0.265625, + "gradient_norm": 0.04039420187473297, + "elapsed": 337.5182821750641 + }, + { + "step": 1024, + "loss": 0.18790806829929352, + "error": 0.08203125, + "gradient_norm": 0.028905188664793968, + "elapsed": 342.08340406417847 + }, + { + "step": 1040, + "loss": 0.6317684650421143, + "error": 0.3681640625, + "gradient_norm": 0.03441835194826126, + "elapsed": 358.8279616832733 + }, + { + "step": 1056, + "loss": 0.40474164485931396, + "error": 0.2021484375, + "gradient_norm": 0.036449309438467026, + "elapsed": 363.30218267440796 + }, + { + "step": 1072, + "loss": 0.518299400806427, + "error": 0.2666015625, + "gradient_norm": 0.0886964276432991, + "elapsed": 367.87997555732727 + }, + { + "step": 1088, + "loss": 0.2522922158241272, + "error": 0.099609375, + "gradient_norm": 0.07553310692310333, + "elapsed": 372.4414882659912 + }, + { + "step": 1104, + "loss": 0.6214810609817505, + "error": 0.3701171875, + "gradient_norm": 0.10188957303762436, + "elapsed": 376.9120502471924 + }, + { + "step": 1120, + "loss": 0.6307054162025452, + "error": 0.3720703125, + "gradient_norm": 0.07353860139846802, + "elapsed": 381.3824534416199 + }, + { + "step": 1136, + "loss": 0.5259381532669067, + "error": 0.2763671875, + "gradient_norm": 0.05779678374528885, + "elapsed": 385.8413143157959 + }, + { + "step": 1152, + "loss": 0.4995541572570801, + "error": 0.259765625, + "gradient_norm": 0.046648140996694565, + "elapsed": 390.28326058387756 + }, + { + "step": 1168, + "loss": 0.6075694561004639, + "error": 0.3701171875, + "gradient_norm": 0.10612073540687561, + "elapsed": 394.8162364959717 + }, + { + "step": 1184, + "loss": 0.2105136513710022, + "error": 0.080078125, + "gradient_norm": 0.0716402605175972, + "elapsed": 399.2960283756256 + }, + { + "step": 1200, + "loss": 0.6371631026268005, + "error": 0.3857421875, + "gradient_norm": 0.0549108125269413, + "elapsed": 403.7899103164673 + }, + { + "step": 1216, + "loss": 0.5450670719146729, + "error": 0.2939453125, + "gradient_norm": 0.11688558012247086, + "elapsed": 408.34677600860596 + }, + { + "step": 1232, + "loss": 0.035783201456069946, + "error": 0.01171875, + "gradient_norm": 0.02951689623296261, + "elapsed": 412.8558337688446 + }, + { + "step": 1248, + "loss": 0.5582903623580933, + "error": 0.3046875, + "gradient_norm": 0.055107031017541885, + "elapsed": 417.29854226112366 + }, + { + "step": 1264, + "loss": 0.5154441595077515, + "error": 0.27734375, + "gradient_norm": 0.04474929720163345, + "elapsed": 421.7792055606842 + }, + { + "step": 1280, + "loss": 0.35227546095848083, + "error": 0.16015625, + "gradient_norm": 0.05024837702512741, + "elapsed": 426.54427456855774 + }, + { + "step": 1296, + "loss": 0.19417589902877808, + "error": 0.0830078125, + "gradient_norm": 0.026926057413220406, + "elapsed": 431.320588350296 + }, + { + "step": 1312, + "loss": 0.4768218398094177, + "error": 0.248046875, + "gradient_norm": 0.15099607408046722, + "elapsed": 435.96817326545715 + }, + { + "step": 1328, + "loss": 0.48580923676490784, + "error": 0.2509765625, + "gradient_norm": 0.08925126492977142, + "elapsed": 440.64917039871216 + }, + { + "step": 1344, + "loss": 0.42041274905204773, + "error": 0.1982421875, + "gradient_norm": 0.08321093022823334, + "elapsed": 445.34370946884155 + }, + { + "step": 1360, + "loss": 0.06403929740190506, + "error": 0.0185546875, + "gradient_norm": 0.03817005455493927, + "elapsed": 449.98669385910034 + }, + { + "step": 1376, + "loss": 0.463126003742218, + "error": 0.2275390625, + "gradient_norm": 0.08894515782594681, + "elapsed": 454.6478977203369 + }, + { + "step": 1392, + "loss": 0.5995306968688965, + "error": 0.373046875, + "gradient_norm": 0.06733685731887817, + "elapsed": 459.35924530029297 + }, + { + "step": 1408, + "loss": 0.49053263664245605, + "error": 0.25, + "gradient_norm": 0.10475508868694305, + "elapsed": 464.100093126297 + }, + { + "step": 1424, + "loss": 0.6220744848251343, + "error": 0.3818359375, + "gradient_norm": 0.03653963655233383, + "elapsed": 468.89601135253906 + }, + { + "step": 1440, + "loss": 0.39706122875213623, + "error": 0.2021484375, + "gradient_norm": 0.04344598576426506, + "elapsed": 474.03999519348145 + }, + { + "step": 1456, + "loss": 0.5386708974838257, + "error": 0.3095703125, + "gradient_norm": 0.12589037418365479, + "elapsed": 478.8600504398346 + }, + { + "step": 1472, + "loss": 0.49776726961135864, + "error": 0.271484375, + "gradient_norm": 0.058137863874435425, + "elapsed": 483.5920066833496 + }, + { + "step": 1488, + "loss": 0.4757428765296936, + "error": 0.2412109375, + "gradient_norm": 0.050453316420316696, + "elapsed": 488.4611999988556 + }, + { + "step": 1504, + "loss": 0.5694847702980042, + "error": 0.337890625, + "gradient_norm": 0.052419569343328476, + "elapsed": 493.26151037216187 + }, + { + "step": 1520, + "loss": 0.5997745990753174, + "error": 0.3603515625, + "gradient_norm": 0.04338108375668526, + "elapsed": 498.0421245098114 + }, + { + "step": 1536, + "loss": 0.6195274591445923, + "error": 0.3876953125, + "gradient_norm": 0.04848463833332062, + "elapsed": 502.8808298110962 + }, + { + "step": 1552, + "loss": 0.46315908432006836, + "error": 0.2353515625, + "gradient_norm": 0.06380566209554672, + "elapsed": 507.5519721508026 + }, + { + "step": 1568, + "loss": 0.605262041091919, + "error": 0.36328125, + "gradient_norm": 0.05077619478106499, + "elapsed": 512.457685470581 + }, + { + "step": 1584, + "loss": 0.48782041668891907, + "error": 0.232421875, + "gradient_norm": 0.09017211943864822, + "elapsed": 517.2960062026978 + }, + { + "step": 1600, + "loss": 0.3881351947784424, + "error": 0.1875, + "gradient_norm": 0.07205695658922195, + "elapsed": 522.0911631584167 + }, + { + "step": 1616, + "loss": 0.4966873526573181, + "error": 0.24609375, + "gradient_norm": 0.0582038015127182, + "elapsed": 526.8861901760101 + }, + { + "step": 1632, + "loss": 0.5844199657440186, + "error": 0.33203125, + "gradient_norm": 0.05101500824093819, + "elapsed": 531.6640138626099 + }, + { + "step": 1648, + "loss": 0.31010180711746216, + "error": 0.1318359375, + "gradient_norm": 0.053135693073272705, + "elapsed": 536.4960391521454 + }, + { + "step": 1664, + "loss": 0.6174807548522949, + "error": 0.3779296875, + "gradient_norm": 0.04161194711923599, + "elapsed": 541.2560484409332 + }, + { + "step": 1680, + "loss": 0.18213607370853424, + "error": 0.0751953125, + "gradient_norm": 0.07171957194805145, + "elapsed": 546.0000085830688 + }, + { + "step": 1696, + "loss": 0.5445692539215088, + "error": 0.2998046875, + "gradient_norm": 0.054499462246894836, + "elapsed": 551.1221191883087 + }, + { + "step": 1712, + "loss": 0.05744167044758797, + "error": 0.017578125, + "gradient_norm": 0.013108699582517147, + "elapsed": 556.5286149978638 + }, + { + "step": 1728, + "loss": 0.6381571292877197, + "error": 0.3896484375, + "gradient_norm": 0.05157556012272835, + "elapsed": 561.8000066280365 + }, + { + "step": 1744, + "loss": 0.5301004648208618, + "error": 0.28125, + "gradient_norm": 0.04218568280339241, + "elapsed": 567.2760035991669 + }, + { + "step": 1760, + "loss": 0.5275102257728577, + "error": 0.26953125, + "gradient_norm": 0.06798839569091797, + "elapsed": 572.5601994991302 + }, + { + "step": 1776, + "loss": 0.6443773508071899, + "error": 0.4091796875, + "gradient_norm": 0.07035460323095322, + "elapsed": 577.9789206981659 + }, + { + "step": 1792, + "loss": 0.6012362241744995, + "error": 0.337890625, + "gradient_norm": 0.05189951881766319, + "elapsed": 583.028017282486 + }, + { + "step": 1808, + "loss": 0.2939091920852661, + "error": 0.12109375, + "gradient_norm": 0.05555355176329613, + "elapsed": 588.0501506328583 + }, + { + "step": 1824, + "loss": 0.2059091478586197, + "error": 0.08984375, + "gradient_norm": 0.045679714530706406, + "elapsed": 593.2120039463043 + }, + { + "step": 1840, + "loss": 0.6289581060409546, + "error": 0.349609375, + "gradient_norm": 0.04742642492055893, + "elapsed": 598.7767763137817 + }, + { + "step": 1856, + "loss": 0.5532636642456055, + "error": 0.294921875, + "gradient_norm": 0.05997413396835327, + "elapsed": 604.0475382804871 + }, + { + "step": 1872, + "loss": 0.45995670557022095, + "error": 0.228515625, + "gradient_norm": 0.05674462765455246, + "elapsed": 609.292379617691 + }, + { + "step": 1888, + "loss": 0.6178656816482544, + "error": 0.359375, + "gradient_norm": 0.08857566863298416, + "elapsed": 614.5639882087708 + }, + { + "step": 1904, + "loss": 0.5531284213066101, + "error": 0.287109375, + "gradient_norm": 0.10257937759160995, + "elapsed": 619.5600035190582 + }, + { + "step": 1920, + "loss": 0.04184349626302719, + "error": 0.013671875, + "gradient_norm": 0.04087059944868088, + "elapsed": 624.6679775714874 + }, + { + "step": 1936, + "loss": 0.5924860239028931, + "error": 0.3505859375, + "gradient_norm": 0.036822713911533356, + "elapsed": 629.936680316925 + }, + { + "step": 1952, + "loss": 0.46996980905532837, + "error": 0.2421875, + "gradient_norm": 0.034442272037267685, + "elapsed": 635.1109762191772 + }, + { + "step": 1968, + "loss": 0.17859068512916565, + "error": 0.0712890625, + "gradient_norm": 0.03440066799521446, + "elapsed": 640.32000207901 + }, + { + "step": 1984, + "loss": 0.6192275285720825, + "error": 0.3701171875, + "gradient_norm": 0.04386439174413681, + "elapsed": 645.6040184497833 + }, + { + "step": 2000, + "loss": 0.6160917282104492, + "error": 0.35546875, + "gradient_norm": 0.06268990784883499, + "elapsed": 650.7723731994629 + }, + { + "step": 2016, + "loss": 0.6343611478805542, + "error": 0.388671875, + "gradient_norm": 0.04243326932191849, + "elapsed": 655.972663640976 + }, + { + "step": 2032, + "loss": 0.062292590737342834, + "error": 0.021484375, + "gradient_norm": 0.016680095344781876, + "elapsed": 660.8079733848572 + }, + { + "step": 2048, + "loss": 0.5316072702407837, + "error": 0.26953125, + "gradient_norm": 0.057860780507326126, + "elapsed": 665.5760209560394 + }, + { + "step": 2064, + "loss": 0.605312705039978, + "error": 0.3623046875, + "gradient_norm": 0.04028146713972092, + "elapsed": 682.7294294834137 + }, + { + "step": 2080, + "loss": 0.56633460521698, + "error": 0.3330078125, + "gradient_norm": 0.09528280049562454, + "elapsed": 687.4644649028778 + }, + { + "step": 2096, + "loss": 0.3905397057533264, + "error": 0.1943359375, + "gradient_norm": 0.049456462264060974, + "elapsed": 692.1492264270782 + }, + { + "step": 2112, + "loss": 0.28124868869781494, + "error": 0.1259765625, + "gradient_norm": 0.059239838272333145, + "elapsed": 696.8701393604279 + }, + { + "step": 2128, + "loss": 0.6364338994026184, + "error": 0.392578125, + "gradient_norm": 0.08667811006307602, + "elapsed": 701.683988571167 + }, + { + "step": 2144, + "loss": 0.20683243870735168, + "error": 0.07421875, + "gradient_norm": 0.1100710779428482, + "elapsed": 706.4000360965729 + }, + { + "step": 2160, + "loss": 0.5912737250328064, + "error": 0.341796875, + "gradient_norm": 0.05641854554414749, + "elapsed": 711.2359964847565 + }, + { + "step": 2176, + "loss": 0.27793264389038086, + "error": 0.12109375, + "gradient_norm": 0.0893034040927887, + "elapsed": 715.9508004188538 + }, + { + "step": 2192, + "loss": 0.6474133133888245, + "error": 0.4072265625, + "gradient_norm": 0.06980258971452713, + "elapsed": 720.651974439621 + }, + { + "step": 2208, + "loss": 0.5961858630180359, + "error": 0.35546875, + "gradient_norm": 0.06530112773180008, + "elapsed": 725.496098279953 + }, + { + "step": 2224, + "loss": 0.47581571340560913, + "error": 0.263671875, + "gradient_norm": 0.04470043256878853, + "elapsed": 730.2880010604858 + }, + { + "step": 2240, + "loss": 0.577988862991333, + "error": 0.318359375, + "gradient_norm": 0.07201159745454788, + "elapsed": 735.006133556366 + }, + { + "step": 2256, + "loss": 0.28444671630859375, + "error": 0.1181640625, + "gradient_norm": 0.048656050115823746, + "elapsed": 739.6868116855621 + }, + { + "step": 2272, + "loss": 0.2776409089565277, + "error": 0.1201171875, + "gradient_norm": 0.05783981829881668, + "elapsed": 744.3517308235168 + }, + { + "step": 2288, + "loss": 0.621599555015564, + "error": 0.37109375, + "gradient_norm": 0.09731200337409973, + "elapsed": 749.0351710319519 + }, + { + "step": 2304, + "loss": 0.3333754539489746, + "error": 0.1513671875, + "gradient_norm": 0.07069239765405655, + "elapsed": 753.7588081359863 + }, + { + "step": 2320, + "loss": 0.4687051773071289, + "error": 0.2490234375, + "gradient_norm": 0.044891707599163055, + "elapsed": 758.4588432312012 + }, + { + "step": 2336, + "loss": 0.19801637530326843, + "error": 0.078125, + "gradient_norm": 0.10036595165729523, + "elapsed": 763.256409406662 + }, + { + "step": 2352, + "loss": 0.6186277866363525, + "error": 0.388671875, + "gradient_norm": 0.09069584310054779, + "elapsed": 767.9986386299133 + }, + { + "step": 2368, + "loss": 0.6177258491516113, + "error": 0.373046875, + "gradient_norm": 0.049019571393728256, + "elapsed": 772.730831861496 + }, + { + "step": 2384, + "loss": 0.17707547545433044, + "error": 0.0673828125, + "gradient_norm": 0.045190781354904175, + "elapsed": 777.4072704315186 + }, + { + "step": 2400, + "loss": 0.20144733786582947, + "error": 0.08203125, + "gradient_norm": 0.04537162929773331, + "elapsed": 782.0841658115387 + }, + { + "step": 2416, + "loss": 0.6151775121688843, + "error": 0.365234375, + "gradient_norm": 0.050534047186374664, + "elapsed": 786.762966632843 + }, + { + "step": 2432, + "loss": 0.5533859133720398, + "error": 0.314453125, + "gradient_norm": 0.06006559729576111, + "elapsed": 791.4656012058258 + }, + { + "step": 2448, + "loss": 0.5329082012176514, + "error": 0.2880859375, + "gradient_norm": 0.04018115997314453, + "elapsed": 796.1704161167145 + }, + { + "step": 2464, + "loss": 0.6338047981262207, + "error": 0.4140625, + "gradient_norm": 0.06069163978099823, + "elapsed": 800.9180119037628 + }, + { + "step": 2480, + "loss": 0.1603008508682251, + "error": 0.0673828125, + "gradient_norm": 0.040350593626499176, + "elapsed": 805.6127603054047 + }, + { + "step": 2496, + "loss": 0.505940318107605, + "error": 0.2568359375, + "gradient_norm": 0.05209952965378761, + "elapsed": 810.3740313053131 + }, + { + "step": 2512, + "loss": 0.5528728365898132, + "error": 0.298828125, + "gradient_norm": 0.11757992953062057, + "elapsed": 815.1708807945251 + }, + { + "step": 2528, + "loss": 0.5028313994407654, + "error": 0.2666015625, + "gradient_norm": 0.08823780715465546, + "elapsed": 819.8585045337677 + }, + { + "step": 2544, + "loss": 0.5002262592315674, + "error": 0.2783203125, + "gradient_norm": 0.04888603836297989, + "elapsed": 824.5714073181152 + }, + { + "step": 2560, + "loss": 0.6007894277572632, + "error": 0.328125, + "gradient_norm": 0.05186954140663147, + "elapsed": 829.3080432415009 + }, + { + "step": 2576, + "loss": 0.18641480803489685, + "error": 0.076171875, + "gradient_norm": 0.03799928352236748, + "elapsed": 834.044020652771 + }, + { + "step": 2592, + "loss": 0.3050769865512848, + "error": 0.1396484375, + "gradient_norm": 0.10119257122278214, + "elapsed": 838.8401296138763 + }, + { + "step": 2608, + "loss": 0.6063439846038818, + "error": 0.361328125, + "gradient_norm": 0.04979367554187775, + "elapsed": 844.3572654724121 + }, + { + "step": 2624, + "loss": 0.5751967430114746, + "error": 0.3369140625, + "gradient_norm": 0.04269539937376976, + "elapsed": 849.0660374164581 + }, + { + "step": 2640, + "loss": 0.3902108669281006, + "error": 0.193359375, + "gradient_norm": 0.10029696673154831, + "elapsed": 853.8638062477112 + }, + { + "step": 2656, + "loss": 0.15081660449504852, + "error": 0.0625, + "gradient_norm": 0.0303852129727602, + "elapsed": 858.9793758392334 + }, + { + "step": 2672, + "loss": 0.6503090858459473, + "error": 0.400390625, + "gradient_norm": 0.12611964344978333, + "elapsed": 863.9151141643524 + }, + { + "step": 2688, + "loss": 0.5587317943572998, + "error": 0.31640625, + "gradient_norm": 0.10028114914894104, + "elapsed": 868.7600305080414 + }, + { + "step": 2704, + "loss": 0.4399867355823517, + "error": 0.21484375, + "gradient_norm": 0.06889455020427704, + "elapsed": 873.4544236660004 + }, + { + "step": 2720, + "loss": 0.5865127444267273, + "error": 0.337890625, + "gradient_norm": 0.03671631962060928, + "elapsed": 878.0982644557953 + }, + { + "step": 2736, + "loss": 0.6078637838363647, + "error": 0.3701171875, + "gradient_norm": 0.04679318517446518, + "elapsed": 883.0424642562866 + }, + { + "step": 2752, + "loss": 0.5825340151786804, + "error": 0.337890625, + "gradient_norm": 0.05619681254029274, + "elapsed": 887.908124923706 + }, + { + "step": 2768, + "loss": 0.5970422029495239, + "error": 0.3369140625, + "gradient_norm": 0.041302867233753204, + "elapsed": 892.6760206222534 + }, + { + "step": 2784, + "loss": 0.3870226740837097, + "error": 0.1826171875, + "gradient_norm": 0.05731065198779106, + "elapsed": 897.6246056556702 + }, + { + "step": 2800, + "loss": 0.38130277395248413, + "error": 0.1943359375, + "gradient_norm": 0.059244755655527115, + "elapsed": 902.3360238075256 + }, + { + "step": 2816, + "loss": 0.2617901563644409, + "error": 0.1064453125, + "gradient_norm": 0.041736964136362076, + "elapsed": 907.1600468158722 + }, + { + "step": 2832, + "loss": 0.5819337368011475, + "error": 0.314453125, + "gradient_norm": 0.04097156226634979, + "elapsed": 912.0244295597076 + }, + { + "step": 2848, + "loss": 0.41393283009529114, + "error": 0.2001953125, + "gradient_norm": 0.10456771403551102, + "elapsed": 916.8225846290588 + }, + { + "step": 2864, + "loss": 0.5019145011901855, + "error": 0.2548828125, + "gradient_norm": 0.04843736067414284, + "elapsed": 921.538754940033 + }, + { + "step": 2880, + "loss": 0.04561338573694229, + "error": 0.0146484375, + "gradient_norm": 0.025407327339053154, + "elapsed": 926.2588667869568 + }, + { + "step": 2896, + "loss": 0.4338858723640442, + "error": 0.205078125, + "gradient_norm": 0.09900517761707306, + "elapsed": 930.9781975746155 + }, + { + "step": 2912, + "loss": 0.33922863006591797, + "error": 0.162109375, + "gradient_norm": 0.10189604014158249, + "elapsed": 935.6816267967224 + }, + { + "step": 2928, + "loss": 0.5294322967529297, + "error": 0.2822265625, + "gradient_norm": 0.09060791879892349, + "elapsed": 940.4373068809509 + }, + { + "step": 2944, + "loss": 0.037007369101047516, + "error": 0.01171875, + "gradient_norm": 0.05506489425897598, + "elapsed": 945.1270468235016 + }, + { + "step": 2960, + "loss": 0.6096771359443665, + "error": 0.349609375, + "gradient_norm": 0.04987221211194992, + "elapsed": 949.8300130367279 + }, + { + "step": 2976, + "loss": 0.6157823801040649, + "error": 0.373046875, + "gradient_norm": 0.03614233434200287, + "elapsed": 954.5701997280121 + }, + { + "step": 2992, + "loss": 0.1978239268064499, + "error": 0.080078125, + "gradient_norm": 0.05847112461924553, + "elapsed": 959.2756471633911 + }, + { + "step": 3008, + "loss": 0.5237340927124023, + "error": 0.2841796875, + "gradient_norm": 0.06993591040372849, + "elapsed": 963.9875864982605 + }, + { + "step": 3024, + "loss": 0.4559935927391052, + "error": 0.2373046875, + "gradient_norm": 0.05698448419570923, + "elapsed": 968.7997305393219 + }, + { + "step": 3040, + "loss": 0.5025208592414856, + "error": 0.259765625, + "gradient_norm": 0.14909739792346954, + "elapsed": 973.6042547225952 + }, + { + "step": 3056, + "loss": 0.3223109245300293, + "error": 0.1416015625, + "gradient_norm": 0.032974764704704285, + "elapsed": 978.4760546684265 + }, + { + "step": 3072, + "loss": 0.06682582199573517, + "error": 0.021484375, + "gradient_norm": 0.04433188587427139, + "elapsed": 983.2894048690796 + }, + { + "step": 3088, + "loss": 0.5919550061225891, + "error": 0.34765625, + "gradient_norm": 0.06721373647451401, + "elapsed": 1000.9520287513733 + }, + { + "step": 3104, + "loss": 0.5988063812255859, + "error": 0.3642578125, + "gradient_norm": 0.05654948577284813, + "elapsed": 1005.7442932128906 + }, + { + "step": 3120, + "loss": 0.4922299385070801, + "error": 0.2470703125, + "gradient_norm": 0.07545466721057892, + "elapsed": 1010.4616096019745 + }, + { + "step": 3136, + "loss": 0.4533671736717224, + "error": 0.236328125, + "gradient_norm": 0.06288722902536392, + "elapsed": 1015.3559956550598 + }, + { + "step": 3152, + "loss": 0.5070517063140869, + "error": 0.2666015625, + "gradient_norm": 0.07274917513132095, + "elapsed": 1020.0764343738556 + }, + { + "step": 3168, + "loss": 0.5999464988708496, + "error": 0.3408203125, + "gradient_norm": 0.05777016654610634, + "elapsed": 1024.9410600662231 + }, + { + "step": 3184, + "loss": 0.5758363008499146, + "error": 0.3427734375, + "gradient_norm": 0.051027461886405945, + "elapsed": 1029.7082171440125 + }, + { + "step": 3200, + "loss": 0.05016190931200981, + "error": 0.017578125, + "gradient_norm": 0.009175656363368034, + "elapsed": 1034.3982915878296 + }, + { + "step": 3216, + "loss": 0.5471057295799255, + "error": 0.318359375, + "gradient_norm": 0.07572721689939499, + "elapsed": 1039.117841243744 + }, + { + "step": 3232, + "loss": 0.4141446352005005, + "error": 0.193359375, + "gradient_norm": 0.10056859254837036, + "elapsed": 1043.880026102066 + }, + { + "step": 3248, + "loss": 0.5812438726425171, + "error": 0.3212890625, + "gradient_norm": 0.05781616270542145, + "elapsed": 1048.6406455039978 + }, + { + "step": 3264, + "loss": 0.19184701144695282, + "error": 0.078125, + "gradient_norm": 0.05367236211895943, + "elapsed": 1053.5672237873077 + }, + { + "step": 3280, + "loss": 0.5420833826065063, + "error": 0.28515625, + "gradient_norm": 0.052405405789613724, + "elapsed": 1058.3841104507446 + }, + { + "step": 3296, + "loss": 0.4419598877429962, + "error": 0.2177734375, + "gradient_norm": 0.05814693495631218, + "elapsed": 1063.1880333423615 + }, + { + "step": 3312, + "loss": 0.4525642991065979, + "error": 0.208984375, + "gradient_norm": 0.1061021164059639, + "elapsed": 1068.1370933055878 + }, + { + "step": 3328, + "loss": 0.32664671540260315, + "error": 0.154296875, + "gradient_norm": 0.05649850144982338, + "elapsed": 1073.1963467597961 + }, + { + "step": 3344, + "loss": 0.2655770182609558, + "error": 0.1220703125, + "gradient_norm": 0.04070372134447098, + "elapsed": 1078.2698318958282 + }, + { + "step": 3360, + "loss": 0.5894330739974976, + "error": 0.3544921875, + "gradient_norm": 0.0643400028347969, + "elapsed": 1083.0184152126312 + }, + { + "step": 3376, + "loss": 0.6118791103363037, + "error": 0.361328125, + "gradient_norm": 0.08537904173135757, + "elapsed": 1087.834038734436 + }, + { + "step": 3392, + "loss": 0.40694907307624817, + "error": 0.19921875, + "gradient_norm": 0.11411692947149277, + "elapsed": 1092.8119947910309 + }, + { + "step": 3408, + "loss": 0.04629015550017357, + "error": 0.0146484375, + "gradient_norm": 0.017204072326421738, + "elapsed": 1097.5751783847809 + }, + { + "step": 3424, + "loss": 0.20639702677726746, + "error": 0.0849609375, + "gradient_norm": 0.04801144450902939, + "elapsed": 1102.2970931529999 + }, + { + "step": 3440, + "loss": 0.6051071286201477, + "error": 0.33984375, + "gradient_norm": 0.045392412692308426, + "elapsed": 1107.1080610752106 + }, + { + "step": 3456, + "loss": 0.6553700566291809, + "error": 0.40625, + "gradient_norm": 0.05593863129615784, + "elapsed": 1111.8409752845764 + }, + { + "step": 3472, + "loss": 0.591402530670166, + "error": 0.3515625, + "gradient_norm": 0.051181379705667496, + "elapsed": 1116.5800333023071 + }, + { + "step": 3488, + "loss": 0.30494624376296997, + "error": 0.12109375, + "gradient_norm": 0.05175542086362839, + "elapsed": 1121.276373386383 + }, + { + "step": 3504, + "loss": 0.5065370798110962, + "error": 0.279296875, + "gradient_norm": 0.10419930517673492, + "elapsed": 1125.9883344173431 + }, + { + "step": 3520, + "loss": 0.3915700614452362, + "error": 0.1953125, + "gradient_norm": 0.060416825115680695, + "elapsed": 1130.7958455085754 + }, + { + "step": 3536, + "loss": 0.624374270439148, + "error": 0.3759765625, + "gradient_norm": 0.06069556251168251, + "elapsed": 1135.5360939502716 + }, + { + "step": 3552, + "loss": 0.5830206274986267, + "error": 0.3359375, + "gradient_norm": 0.046013280749320984, + "elapsed": 1140.312029838562 + }, + { + "step": 3568, + "loss": 0.4201379716396332, + "error": 0.2119140625, + "gradient_norm": 0.06909621506929398, + "elapsed": 1145.0904593467712 + }, + { + "step": 3584, + "loss": 0.28215405344963074, + "error": 0.1181640625, + "gradient_norm": 0.07625982910394669, + "elapsed": 1149.8156151771545 + }, + { + "step": 3600, + "loss": 0.5229164361953735, + "error": 0.275390625, + "gradient_norm": 0.055048178881406784, + "elapsed": 1154.5280592441559 + }, + { + "step": 3616, + "loss": 0.47238075733184814, + "error": 0.2314453125, + "gradient_norm": 0.06473162025213242, + "elapsed": 1159.2720873355865 + }, + { + "step": 3632, + "loss": 0.46245503425598145, + "error": 0.228515625, + "gradient_norm": 0.07382887601852417, + "elapsed": 1164.0119998455048 + }, + { + "step": 3648, + "loss": 0.37509745359420776, + "error": 0.171875, + "gradient_norm": 0.051260266453027725, + "elapsed": 1168.7440350055695 + }, + { + "step": 3664, + "loss": 0.1948484629392624, + "error": 0.080078125, + "gradient_norm": 0.059623416513204575, + "elapsed": 1173.3906588554382 + }, + { + "step": 3680, + "loss": 0.5552756786346436, + "error": 0.3115234375, + "gradient_norm": 0.08073585480451584, + "elapsed": 1178.0645008087158 + }, + { + "step": 3696, + "loss": 0.6405904293060303, + "error": 0.39453125, + "gradient_norm": 0.05899551138281822, + "elapsed": 1182.730489730835 + }, + { + "step": 3712, + "loss": 0.2767012119293213, + "error": 0.119140625, + "gradient_norm": 0.06593579798936844, + "elapsed": 1187.377315044403 + }, + { + "step": 3728, + "loss": 0.315812885761261, + "error": 0.134765625, + "gradient_norm": 0.035905495285987854, + "elapsed": 1192.0582301616669 + }, + { + "step": 3744, + "loss": 0.6033951640129089, + "error": 0.3544921875, + "gradient_norm": 0.05226197466254234, + "elapsed": 1196.7101175785065 + }, + { + "step": 3760, + "loss": 0.5202592611312866, + "error": 0.275390625, + "gradient_norm": 0.06367512047290802, + "elapsed": 1201.3543090820312 + }, + { + "step": 3776, + "loss": 0.24639368057250977, + "error": 0.1083984375, + "gradient_norm": 0.09370873868465424, + "elapsed": 1206.0717165470123 + }, + { + "step": 3792, + "loss": 0.6175658702850342, + "error": 0.375, + "gradient_norm": 0.06221585348248482, + "elapsed": 1210.754029750824 + }, + { + "step": 3808, + "loss": 0.41153696179389954, + "error": 0.2119140625, + "gradient_norm": 0.05355365574359894, + "elapsed": 1215.4374370574951 + }, + { + "step": 3824, + "loss": 0.28002214431762695, + "error": 0.1123046875, + "gradient_norm": 0.03846330568194389, + "elapsed": 1220.1207013130188 + }, + { + "step": 3840, + "loss": 0.0484195351600647, + "error": 0.013671875, + "gradient_norm": 0.03470242768526077, + "elapsed": 1224.8153104782104 + }, + { + "step": 3856, + "loss": 0.1407160609960556, + "error": 0.0458984375, + "gradient_norm": 0.04061700031161308, + "elapsed": 1229.5512235164642 + }, + { + "step": 3872, + "loss": 0.5881794691085815, + "error": 0.3427734375, + "gradient_norm": 0.062013477087020874, + "elapsed": 1234.3750183582306 + }, + { + "step": 3888, + "loss": 0.17833612859249115, + "error": 0.06640625, + "gradient_norm": 0.038856204599142075, + "elapsed": 1239.110375881195 + }, + { + "step": 3904, + "loss": 0.06211477518081665, + "error": 0.0224609375, + "gradient_norm": 0.02150108851492405, + "elapsed": 1243.800644159317 + }, + { + "step": 3920, + "loss": 0.06039723381400108, + "error": 0.01953125, + "gradient_norm": 0.019367367029190063, + "elapsed": 1248.4831748008728 + }, + { + "step": 3936, + "loss": 0.6010214686393738, + "error": 0.3525390625, + "gradient_norm": 0.051659151911735535, + "elapsed": 1253.1423478126526 + }, + { + "step": 3952, + "loss": 0.5867137312889099, + "error": 0.3388671875, + "gradient_norm": 0.058528851717710495, + "elapsed": 1257.9799931049347 + }, + { + "step": 3968, + "loss": 0.5231834650039673, + "error": 0.2578125, + "gradient_norm": 0.10128334909677505, + "elapsed": 1262.6990082263947 + }, + { + "step": 3984, + "loss": 0.6251651644706726, + "error": 0.353515625, + "gradient_norm": 0.06211795285344124, + "elapsed": 1267.4289934635162 + }, + { + "step": 4000, + "loss": 0.06667037308216095, + "error": 0.01953125, + "gradient_norm": 0.048018258064985275, + "elapsed": 1272.132089138031 + }, + { + "step": 4016, + "loss": 0.5286938548088074, + "error": 0.2744140625, + "gradient_norm": 0.05509360507130623, + "elapsed": 1276.8878977298737 + }, + { + "step": 4032, + "loss": 0.34016552567481995, + "error": 0.1591796875, + "gradient_norm": 0.07597329467535019, + "elapsed": 1281.7364926338196 + }, + { + "step": 4048, + "loss": 0.17750494182109833, + "error": 0.078125, + "gradient_norm": 0.06314503401517868, + "elapsed": 1286.5033600330353 + }, + { + "step": 4064, + "loss": 0.5882893800735474, + "error": 0.34375, + "gradient_norm": 0.10986580699682236, + "elapsed": 1291.1944887638092 + }, + { + "step": 4080, + "loss": 0.4923543930053711, + "error": 0.2568359375, + "gradient_norm": 0.050325747579336166, + "elapsed": 1295.9372322559357 + }, + { + "step": 4096, + "loss": 0.44146978855133057, + "error": 0.2236328125, + "gradient_norm": 0.06535191088914871, + "elapsed": 1300.641023159027 + } + ] + }, + "training_source_snapshot": "training_sources/temporal2", + "selected_checkpoint_steps": [ + "1024", + "2048", + "4096" + ], + "checkpoint_records": { + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "unique_training_rows_seen_in_this_phase": 804757, + "weights": "weights-1024.npz", + "weights_sha256": "0d809362d5afe1dc781f716e3aee1a9bc5a8f75fed6cc0ff6339b9abcf600ada", + "validation": "validation-1024.json", + "complete": true + }, + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints; when listed, blend candidates average the recorded small-contextual reference and new probabilities equally", + "blend_reference": "/run-state/workspace/research/context_upgrades/continuation2/predictions", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.24672475961538465, + "1024": 0.24571814903846154, + "2048": 0.24504206730769232, + "3072": 0.2456129807692308, + "4096": 0.2445763221153846, + "blend-1024": 0.2469501201923077, + "blend-2048": 0.24583834134615387, + "blend-3072": 0.2458984375, + "blend-4096": 0.2456580528846154 + }, + "selected": "4096" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2530348557692308, + "1024": 0.2528545673076923, + "2048": 0.25342548076923077, + "3072": 0.25369591346153847, + "4096": 0.25446213942307694, + "blend-1024": 0.2531550480769231, + "blend-2048": 0.2536658653846154, + "blend-3072": 0.25329026442307695, + "blend-4096": 0.2540264423076923 + }, + "selected": "1024" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.23442007211538465, + "1024": 0.23445012019230768, + "2048": 0.2340895432692308, + "3072": 0.23431490384615383, + "4096": 0.23366887019230773, + "blend-1024": 0.23440504807692308, + "blend-2048": 0.2341496394230769, + "blend-3072": 0.23416466346153844, + "blend-4096": 0.23413461538461536 + }, + "selected": "4096" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.2392427884615385, + "1024": 0.23949819711538464, + "2048": 0.23907752403846155, + "3072": 0.24014423076923078, + "4096": 0.24064002403846152, + "blend-1024": 0.23916766826923075, + "blend-2048": 0.23886718750000002, + "blend-3072": 0.2392578125, + "blend-4096": 0.23900240384615387 + }, + "selected": "blend-2048" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24630408653846156, + "1024": 0.24649939903846152, + "2048": 0.2460486778846154, + "3072": 0.24523737980769228, + "4096": 0.24463641826923077, + "blend-1024": 0.24615384615384614, + "blend-2048": 0.2456580528846154, + "blend-3072": 0.24583834134615384, + "blend-4096": 0.24576322115384613 + }, + "selected": "4096" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.23760516826923078, + "1024": 0.23733473557692308, + "2048": 0.23652343749999996, + "3072": 0.23795072115384613, + "4096": 0.2379807692307692, + "blend-1024": 0.23713942307692307, + "blend-2048": 0.23740985576923077, + "blend-3072": 0.23811598557692307, + "blend-4096": 0.23780048076923077 + }, + "selected": "2048" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.2371694711538461, + "1024": 0.23689903846153845, + "2048": 0.2371243990384615, + "3072": 0.2371844951923077, + "4096": 0.23562199519230764, + "blend-1024": 0.23715444711538464, + "blend-2048": 0.23662860576923078, + "blend-3072": 0.23712439903846153, + "blend-4096": 0.23643329326923077 + }, + "selected": "4096" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.23342848557692306, + "1024": 0.23353365384615385, + "2048": 0.23429987980769232, + "3072": 0.2335637019230769, + "4096": 0.2329627403846154, + "blend-1024": 0.23350360576923074, + "blend-2048": 0.23383413461538463, + "blend-3072": 0.23357872596153847, + "blend-4096": 0.2333533653846154 + }, + "selected": "4096" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2325420673076923 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22017728365384615 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "temporal2_swa", + "training_run": { + "initialization": "Uniform averages of the same session-trained temporal trajectory; no external weights", + "optimizer_updates_in_derived_run": 0, + "source_training_provenance": { + "initialization": "Continue from this session's trained checkpoint", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "training_source_sha256": { + "learned_exact__temporal_train.py": "7d48d2fc7f62d0bec3023b3df1c2ac28537d0417966131ae3a156697a34cda5f", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "eligible_training_shots": 2067520, + "unique_training_rows_seen_in_this_phase": 1778773, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 18357, + "surface_code_bX_d3_r03_center_3_5": 16816, + "surface_code_bX_d3_r05_center_3_5": 17999, + "surface_code_bX_d3_r07_center_3_5": 15225, + "surface_code_bX_d3_r09_center_3_5": 16132, + "surface_code_bX_d3_r11_center_3_5": 17041, + "surface_code_bX_d3_r13_center_3_5": 18477, + "surface_code_bX_d3_r15_center_3_5": 18214, + "surface_code_bX_d3_r17_center_3_5": 16505, + "surface_code_bX_d3_r19_center_3_5": 17120, + "surface_code_bX_d3_r21_center_3_5": 17563, + "surface_code_bX_d3_r23_center_3_5": 16681, + "surface_code_bX_d3_r25_center_3_5": 18379, + "surface_code_bX_d3_r01_center_5_3": 17450, + "surface_code_bX_d3_r03_center_5_3": 17161, + "surface_code_bX_d3_r05_center_5_3": 15797, + "surface_code_bX_d3_r07_center_5_3": 17800, + "surface_code_bX_d3_r09_center_5_3": 17190, + "surface_code_bX_d3_r11_center_5_3": 15840, + "surface_code_bX_d3_r13_center_5_3": 15178, + "surface_code_bX_d3_r15_center_5_3": 14897, + "surface_code_bX_d3_r17_center_5_3": 18252, + "surface_code_bX_d3_r19_center_5_3": 17083, + "surface_code_bX_d3_r21_center_5_3": 17229, + "surface_code_bX_d3_r23_center_5_3": 14735, + "surface_code_bX_d3_r25_center_5_3": 17949, + "surface_code_bX_d3_r01_center_5_7": 17431, + "surface_code_bX_d3_r03_center_5_7": 16583, + "surface_code_bX_d3_r05_center_5_7": 16891, + "surface_code_bX_d3_r07_center_5_7": 17969, + "surface_code_bX_d3_r09_center_5_7": 17966, + "surface_code_bX_d3_r11_center_5_7": 14424, + "surface_code_bX_d3_r13_center_5_7": 16930, + "surface_code_bX_d3_r15_center_5_7": 15205, + "surface_code_bX_d3_r17_center_5_7": 18252, + "surface_code_bX_d3_r19_center_5_7": 17077, + "surface_code_bX_d3_r21_center_5_7": 16770, + "surface_code_bX_d3_r23_center_5_7": 17308, + "surface_code_bX_d3_r25_center_5_7": 17481, + "surface_code_bX_d3_r01_center_7_5": 16630, + "surface_code_bX_d3_r03_center_7_5": 17439, + "surface_code_bX_d3_r05_center_7_5": 15811, + "surface_code_bX_d3_r07_center_7_5": 16637, + "surface_code_bX_d3_r09_center_7_5": 18306, + "surface_code_bX_d3_r11_center_7_5": 18327, + "surface_code_bX_d3_r13_center_7_5": 17974, + "surface_code_bX_d3_r15_center_7_5": 16106, + "surface_code_bX_d3_r17_center_7_5": 15834, + "surface_code_bX_d3_r19_center_7_5": 17242, + "surface_code_bX_d3_r21_center_7_5": 17889, + "surface_code_bX_d3_r23_center_7_5": 17440, + "surface_code_bX_d3_r25_center_7_5": 17087, + "surface_code_bZ_d3_r01_center_3_5": 16236, + "surface_code_bZ_d3_r03_center_3_5": 17278, + "surface_code_bZ_d3_r05_center_3_5": 16577, + "surface_code_bZ_d3_r07_center_3_5": 17376, + "surface_code_bZ_d3_r09_center_3_5": 16000, + "surface_code_bZ_d3_r11_center_3_5": 15634, + "surface_code_bZ_d3_r13_center_3_5": 14950, + "surface_code_bZ_d3_r15_center_3_5": 16600, + "surface_code_bZ_d3_r17_center_3_5": 15381, + "surface_code_bZ_d3_r19_center_3_5": 16823, + "surface_code_bZ_d3_r21_center_3_5": 18789, + "surface_code_bZ_d3_r23_center_3_5": 15616, + "surface_code_bZ_d3_r25_center_3_5": 17088, + "surface_code_bZ_d3_r01_center_5_3": 17935, + "surface_code_bZ_d3_r03_center_5_3": 16256, + "surface_code_bZ_d3_r05_center_5_3": 17959, + "surface_code_bZ_d3_r07_center_5_3": 18401, + "surface_code_bZ_d3_r09_center_5_3": 16405, + "surface_code_bZ_d3_r11_center_5_3": 17274, + "surface_code_bZ_d3_r13_center_5_3": 18172, + "surface_code_bZ_d3_r15_center_5_3": 17525, + "surface_code_bZ_d3_r17_center_5_3": 18643, + "surface_code_bZ_d3_r19_center_5_3": 17816, + "surface_code_bZ_d3_r21_center_5_3": 17404, + "surface_code_bZ_d3_r23_center_5_3": 17253, + "surface_code_bZ_d3_r25_center_5_3": 17667, + "surface_code_bZ_d3_r01_center_5_7": 16203, + "surface_code_bZ_d3_r03_center_5_7": 17214, + "surface_code_bZ_d3_r05_center_5_7": 16799, + "surface_code_bZ_d3_r07_center_5_7": 17896, + "surface_code_bZ_d3_r09_center_5_7": 16411, + "surface_code_bZ_d3_r11_center_5_7": 17726, + "surface_code_bZ_d3_r13_center_5_7": 16313, + "surface_code_bZ_d3_r15_center_5_7": 17824, + "surface_code_bZ_d3_r17_center_5_7": 15656, + "surface_code_bZ_d3_r19_center_5_7": 17169, + "surface_code_bZ_d3_r21_center_5_7": 17194, + "surface_code_bZ_d3_r23_center_5_7": 16779, + "surface_code_bZ_d3_r25_center_5_7": 16970, + "surface_code_bZ_d3_r01_center_7_5": 16762, + "surface_code_bZ_d3_r03_center_7_5": 17320, + "surface_code_bZ_d3_r05_center_7_5": 17522, + "surface_code_bZ_d3_r07_center_7_5": 17914, + "surface_code_bZ_d3_r09_center_7_5": 18439, + "surface_code_bZ_d3_r11_center_7_5": 18218, + "surface_code_bZ_d3_r13_center_7_5": 17907, + "surface_code_bZ_d3_r15_center_7_5": 17597, + "surface_code_bZ_d3_r17_center_7_5": 18252, + "surface_code_bZ_d3_r19_center_7_5": 18379, + "surface_code_bZ_d3_r21_center_7_5": 16818, + "surface_code_bZ_d3_r23_center_7_5": 18430, + "surface_code_bZ_d3_r25_center_7_5": 17924 + }, + "steps": 4096, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.0005, + "sampling_seed": 20261121, + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_exact/temporal1/rng-2048.json", + "session_trained_starting_checkpoint": "/run-state/workspace/research/learned_exact/temporal1/weights-2048.npz", + "starting_checkpoint_sha256": "26be9e0259b69a5870bf73e80a5a29fcf3519a3ff63e1d219c57a2113d9d34be", + "starting_training_provenance": { + "initialization": "Continue from rich weights trained from random initialization in this session; new temporal parameters randomly initialized now", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 2048, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261111, + "optimizer_restored": false, + "rng_restored": false, + "session_trained_starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.6317505836486816, + "error": 0.3681640625, + "gradient_norm": 0.04013459011912346, + "elapsed": 30.971998691558838 + }, + { + "step": 16, + "loss": 0.5091081857681274, + "error": 0.291015625, + "gradient_norm": 0.042228709906339645, + "elapsed": 35.17463397979736 + }, + { + "step": 32, + "loss": 0.626472532749176, + "error": 0.3642578125, + "gradient_norm": 0.05872415751218796, + "elapsed": 39.678136110305786 + }, + { + "step": 48, + "loss": 0.6005369424819946, + "error": 0.3515625, + "gradient_norm": 0.03848014399409294, + "elapsed": 44.16946887969971 + }, + { + "step": 64, + "loss": 0.5523768663406372, + "error": 0.302734375, + "gradient_norm": 0.06031862646341324, + "elapsed": 48.65217089653015 + }, + { + "step": 80, + "loss": 0.3981674611568451, + "error": 0.19921875, + "gradient_norm": 0.0542079322040081, + "elapsed": 53.21601867675781 + }, + { + "step": 96, + "loss": 0.5601426362991333, + "error": 0.2978515625, + "gradient_norm": 0.04770371690392494, + "elapsed": 57.81089663505554 + }, + { + "step": 112, + "loss": 0.5878150463104248, + "error": 0.34765625, + "gradient_norm": 0.10699950158596039, + "elapsed": 62.42190766334534 + }, + { + "step": 128, + "loss": 0.5232458114624023, + "error": 0.2861328125, + "gradient_norm": 0.0911584198474884, + "elapsed": 67.00223755836487 + }, + { + "step": 144, + "loss": 0.6119767427444458, + "error": 0.3623046875, + "gradient_norm": 0.062474437057971954, + "elapsed": 71.54070782661438 + }, + { + "step": 160, + "loss": 0.3037984371185303, + "error": 0.1474609375, + "gradient_norm": 0.05718141421675682, + "elapsed": 76.08167362213135 + }, + { + "step": 176, + "loss": 0.6038273572921753, + "error": 0.3662109375, + "gradient_norm": 0.0437164381146431, + "elapsed": 80.71864247322083 + }, + { + "step": 192, + "loss": 0.3304370641708374, + "error": 0.1572265625, + "gradient_norm": 0.05684761330485344, + "elapsed": 85.54437017440796 + }, + { + "step": 208, + "loss": 0.5785484313964844, + "error": 0.3251953125, + "gradient_norm": 0.09597272425889969, + "elapsed": 91.51522874832153 + }, + { + "step": 224, + "loss": 0.3110499978065491, + "error": 0.13671875, + "gradient_norm": 0.04815748706459999, + "elapsed": 97.1228940486908 + }, + { + "step": 240, + "loss": 0.6213864684104919, + "error": 0.3623046875, + "gradient_norm": 0.0540502592921257, + "elapsed": 102.90286135673523 + }, + { + "step": 256, + "loss": 0.2535272240638733, + "error": 0.1064453125, + "gradient_norm": 0.029962118715047836, + "elapsed": 108.39288640022278 + }, + { + "step": 272, + "loss": 0.6126939058303833, + "error": 0.3671875, + "gradient_norm": 0.06887879222631454, + "elapsed": 113.83897161483765 + }, + { + "step": 288, + "loss": 0.4556676149368286, + "error": 0.2236328125, + "gradient_norm": 0.16127081215381622, + "elapsed": 119.93085813522339 + }, + { + "step": 304, + "loss": 0.4973585605621338, + "error": 0.255859375, + "gradient_norm": 0.08082302659749985, + "elapsed": 125.90891909599304 + }, + { + "step": 320, + "loss": 0.6455868482589722, + "error": 0.419921875, + "gradient_norm": 0.04339660331606865, + "elapsed": 131.20537638664246 + }, + { + "step": 336, + "loss": 0.5343132615089417, + "error": 0.2880859375, + "gradient_norm": 0.07518009096384048, + "elapsed": 136.59086871147156 + }, + { + "step": 352, + "loss": 0.6505346894264221, + "error": 0.4033203125, + "gradient_norm": 0.03800992667675018, + "elapsed": 142.21085906028748 + }, + { + "step": 368, + "loss": 0.4882712960243225, + "error": 0.251953125, + "gradient_norm": 0.08170920610427856, + "elapsed": 146.95903658866882 + }, + { + "step": 384, + "loss": 0.5292021036148071, + "error": 0.296875, + "gradient_norm": 0.08454013615846634, + "elapsed": 151.6385259628296 + }, + { + "step": 400, + "loss": 0.6272899508476257, + "error": 0.3837890625, + "gradient_norm": 0.051436979323625565, + "elapsed": 156.3343904018402 + }, + { + "step": 416, + "loss": 0.052130259573459625, + "error": 0.0166015625, + "gradient_norm": 0.02377190627157688, + "elapsed": 160.92345547676086 + }, + { + "step": 432, + "loss": 0.5256737470626831, + "error": 0.3046875, + "gradient_norm": 0.07986386120319366, + "elapsed": 165.52879118919373 + }, + { + "step": 448, + "loss": 0.15193665027618408, + "error": 0.0576171875, + "gradient_norm": 0.06491660326719284, + "elapsed": 170.14827823638916 + }, + { + "step": 464, + "loss": 0.6418055295944214, + "error": 0.40625, + "gradient_norm": 0.07290885597467422, + "elapsed": 174.64974284172058 + }, + { + "step": 480, + "loss": 0.6055159568786621, + "error": 0.357421875, + "gradient_norm": 0.0795595794916153, + "elapsed": 179.17218685150146 + }, + { + "step": 496, + "loss": 0.6372283697128296, + "error": 0.3916015625, + "gradient_norm": 0.04387903958559036, + "elapsed": 183.77568197250366 + }, + { + "step": 512, + "loss": 0.637977123260498, + "error": 0.408203125, + "gradient_norm": 0.060665905475616455, + "elapsed": 188.31205368041992 + }, + { + "step": 528, + "loss": 0.4668862223625183, + "error": 0.2451171875, + "gradient_norm": 0.08566711097955704, + "elapsed": 206.40719985961914 + }, + { + "step": 544, + "loss": 0.4584413170814514, + "error": 0.244140625, + "gradient_norm": 0.08538200706243515, + "elapsed": 211.02819895744324 + }, + { + "step": 560, + "loss": 0.5615692138671875, + "error": 0.3291015625, + "gradient_norm": 0.043748609721660614, + "elapsed": 215.66470766067505 + }, + { + "step": 576, + "loss": 0.5151895880699158, + "error": 0.2880859375, + "gradient_norm": 0.05164863541722298, + "elapsed": 220.18949556350708 + }, + { + "step": 592, + "loss": 0.5618112087249756, + "error": 0.3291015625, + "gradient_norm": 0.05998719856142998, + "elapsed": 224.7216100692749 + }, + { + "step": 608, + "loss": 0.659294843673706, + "error": 0.431640625, + "gradient_norm": 0.09910348802804947, + "elapsed": 229.26827573776245 + }, + { + "step": 624, + "loss": 0.5895233154296875, + "error": 0.3447265625, + "gradient_norm": 0.045334093272686005, + "elapsed": 233.83731055259705 + }, + { + "step": 640, + "loss": 0.6081801056861877, + "error": 0.3388671875, + "gradient_norm": 0.06578423827886581, + "elapsed": 238.36345624923706 + }, + { + "step": 656, + "loss": 0.5349816083908081, + "error": 0.2939453125, + "gradient_norm": 0.09989562630653381, + "elapsed": 242.95086026191711 + }, + { + "step": 672, + "loss": 0.5871994495391846, + "error": 0.328125, + "gradient_norm": 0.08132346719503403, + "elapsed": 247.67088556289673 + }, + { + "step": 688, + "loss": 0.06012660637497902, + "error": 0.0146484375, + "gradient_norm": 0.012170507572591305, + "elapsed": 252.3202247619629 + }, + { + "step": 704, + "loss": 0.42179757356643677, + "error": 0.21484375, + "gradient_norm": 0.08384513854980469, + "elapsed": 256.91991782188416 + }, + { + "step": 720, + "loss": 0.6111758947372437, + "error": 0.3720703125, + "gradient_norm": 0.06689880788326263, + "elapsed": 261.56407928466797 + }, + { + "step": 736, + "loss": 0.29969727993011475, + "error": 0.1318359375, + "gradient_norm": 0.0743367150425911, + "elapsed": 266.22199630737305 + }, + { + "step": 752, + "loss": 0.051849883049726486, + "error": 0.0166015625, + "gradient_norm": 0.017005126923322678, + "elapsed": 270.8602342605591 + }, + { + "step": 768, + "loss": 0.6178420186042786, + "error": 0.3759765625, + "gradient_norm": 0.027732960879802704, + "elapsed": 275.47888374328613 + }, + { + "step": 784, + "loss": 0.45798996090888977, + "error": 0.228515625, + "gradient_norm": 0.0630083829164505, + "elapsed": 280.1709156036377 + }, + { + "step": 800, + "loss": 0.5104988813400269, + "error": 0.2724609375, + "gradient_norm": 0.041733670979738235, + "elapsed": 286.17937707901 + }, + { + "step": 816, + "loss": 0.6336112022399902, + "error": 0.3837890625, + "gradient_norm": 0.0755191296339035, + "elapsed": 291.7506103515625 + }, + { + "step": 832, + "loss": 0.6260952353477478, + "error": 0.3603515625, + "gradient_norm": 0.0318005345761776, + "elapsed": 297.31094622612 + }, + { + "step": 848, + "loss": 0.5870074033737183, + "error": 0.3525390625, + "gradient_norm": 0.12073405832052231, + "elapsed": 303.11089158058167 + }, + { + "step": 864, + "loss": 0.5125640034675598, + "error": 0.26953125, + "gradient_norm": 0.038650237023830414, + "elapsed": 308.7288725376129 + }, + { + "step": 880, + "loss": 0.19194915890693665, + "error": 0.0703125, + "gradient_norm": 0.061878547072410583, + "elapsed": 314.37042355537415 + }, + { + "step": 896, + "loss": 0.5409250259399414, + "error": 0.2919921875, + "gradient_norm": 0.06288820505142212, + "elapsed": 319.9398190975189 + }, + { + "step": 912, + "loss": 0.6164936423301697, + "error": 0.3701171875, + "gradient_norm": 0.043224163353443146, + "elapsed": 325.361323595047 + }, + { + "step": 928, + "loss": 0.16032151877880096, + "error": 0.0625, + "gradient_norm": 0.030957572162151337, + "elapsed": 331.21752285957336 + }, + { + "step": 944, + "loss": 0.646601676940918, + "error": 0.3818359375, + "gradient_norm": 0.05670839175581932, + "elapsed": 336.7825517654419 + }, + { + "step": 960, + "loss": 0.402952641248703, + "error": 0.1865234375, + "gradient_norm": 0.07500886172056198, + "elapsed": 342.6888346672058 + }, + { + "step": 976, + "loss": 0.5537433624267578, + "error": 0.2939453125, + "gradient_norm": 0.04955969750881195, + "elapsed": 348.5554690361023 + }, + { + "step": 992, + "loss": 0.559626579284668, + "error": 0.294921875, + "gradient_norm": 0.048295993357896805, + "elapsed": 354.3531894683838 + }, + { + "step": 1008, + "loss": 0.5034694671630859, + "error": 0.2705078125, + "gradient_norm": 0.05729879066348076, + "elapsed": 360.0949149131775 + }, + { + "step": 1024, + "loss": 0.3119734525680542, + "error": 0.1259765625, + "gradient_norm": 0.052326612174510956, + "elapsed": 365.7881224155426 + }, + { + "step": 1040, + "loss": 0.35799849033355713, + "error": 0.173828125, + "gradient_norm": 0.03801804035902023, + "elapsed": 386.5749418735504 + }, + { + "step": 1056, + "loss": 0.6178948879241943, + "error": 0.3515625, + "gradient_norm": 0.03620661422610283, + "elapsed": 391.48247838020325 + }, + { + "step": 1072, + "loss": 0.49231401085853577, + "error": 0.24609375, + "gradient_norm": 0.04391559213399887, + "elapsed": 396.08718824386597 + }, + { + "step": 1088, + "loss": 0.4119300842285156, + "error": 0.2001953125, + "gradient_norm": 0.1104700043797493, + "elapsed": 400.5326828956604 + }, + { + "step": 1104, + "loss": 0.4926626682281494, + "error": 0.265625, + "gradient_norm": 0.04246886447072029, + "elapsed": 404.95741271972656 + }, + { + "step": 1120, + "loss": 0.5027930736541748, + "error": 0.2607421875, + "gradient_norm": 0.0547240674495697, + "elapsed": 409.40319633483887 + }, + { + "step": 1136, + "loss": 0.5948058366775513, + "error": 0.3544921875, + "gradient_norm": 0.06810063123703003, + "elapsed": 413.8514006137848 + }, + { + "step": 1152, + "loss": 0.26567256450653076, + "error": 0.125, + "gradient_norm": 0.06689104437828064, + "elapsed": 418.29868721961975 + }, + { + "step": 1168, + "loss": 0.2866836190223694, + "error": 0.1240234375, + "gradient_norm": 0.029536213725805283, + "elapsed": 422.75131845474243 + }, + { + "step": 1184, + "loss": 0.6342021822929382, + "error": 0.4091796875, + "gradient_norm": 0.0704190731048584, + "elapsed": 427.1991722583771 + }, + { + "step": 1200, + "loss": 0.41626787185668945, + "error": 0.212890625, + "gradient_norm": 0.04480795934796333, + "elapsed": 431.6600706577301 + }, + { + "step": 1216, + "loss": 0.28460952639579773, + "error": 0.1337890625, + "gradient_norm": 0.03666983172297478, + "elapsed": 436.14414525032043 + }, + { + "step": 1232, + "loss": 0.044482216238975525, + "error": 0.0146484375, + "gradient_norm": 0.04537617415189743, + "elapsed": 440.6220428943634 + }, + { + "step": 1248, + "loss": 0.42564862966537476, + "error": 0.2119140625, + "gradient_norm": 0.03382417559623718, + "elapsed": 445.06736421585083 + }, + { + "step": 1264, + "loss": 0.27150213718414307, + "error": 0.123046875, + "gradient_norm": 0.033046118915081024, + "elapsed": 449.544029712677 + }, + { + "step": 1280, + "loss": 0.4927375912666321, + "error": 0.255859375, + "gradient_norm": 0.06812550127506256, + "elapsed": 454.07198667526245 + }, + { + "step": 1296, + "loss": 0.5541940927505493, + "error": 0.28125, + "gradient_norm": 0.1435294896364212, + "elapsed": 458.6031415462494 + }, + { + "step": 1312, + "loss": 0.5575842261314392, + "error": 0.2958984375, + "gradient_norm": 0.03811952844262123, + "elapsed": 463.1806228160858 + }, + { + "step": 1328, + "loss": 0.3479428291320801, + "error": 0.1591796875, + "gradient_norm": 0.0709012895822525, + "elapsed": 467.84689688682556 + }, + { + "step": 1344, + "loss": 0.1685580611228943, + "error": 0.0693359375, + "gradient_norm": 0.05423415079712868, + "elapsed": 472.6908576488495 + }, + { + "step": 1360, + "loss": 0.18506410717964172, + "error": 0.0771484375, + "gradient_norm": 0.03418596833944321, + "elapsed": 477.4269769191742 + }, + { + "step": 1376, + "loss": 0.5654555559158325, + "error": 0.3173828125, + "gradient_norm": 0.0685155838727951, + "elapsed": 482.08285188674927 + }, + { + "step": 1392, + "loss": 0.6116407513618469, + "error": 0.3603515625, + "gradient_norm": 0.05198948457837105, + "elapsed": 486.7167499065399 + }, + { + "step": 1408, + "loss": 0.4014682471752167, + "error": 0.19140625, + "gradient_norm": 0.1024075523018837, + "elapsed": 491.4308760166168 + }, + { + "step": 1424, + "loss": 0.051035866141319275, + "error": 0.0166015625, + "gradient_norm": 0.010207361541688442, + "elapsed": 496.1818380355835 + }, + { + "step": 1440, + "loss": 0.4725648760795593, + "error": 0.2412109375, + "gradient_norm": 0.03977378085255623, + "elapsed": 500.8668632507324 + }, + { + "step": 1456, + "loss": 0.5407818555831909, + "error": 0.2939453125, + "gradient_norm": 0.088577501475811, + "elapsed": 505.49274134635925 + }, + { + "step": 1472, + "loss": 0.5655064582824707, + "error": 0.3076171875, + "gradient_norm": 0.04452778398990631, + "elapsed": 510.2188584804535 + }, + { + "step": 1488, + "loss": 0.5799556374549866, + "error": 0.30859375, + "gradient_norm": 0.03976206108927727, + "elapsed": 514.9319434165955 + }, + { + "step": 1504, + "loss": 0.4660354256629944, + "error": 0.25390625, + "gradient_norm": 0.04365506023168564, + "elapsed": 519.5848798751831 + }, + { + "step": 1520, + "loss": 0.5505894422531128, + "error": 0.30859375, + "gradient_norm": 0.057772211730480194, + "elapsed": 524.3388590812683 + }, + { + "step": 1536, + "loss": 0.6251416206359863, + "error": 0.400390625, + "gradient_norm": 0.09649194777011871, + "elapsed": 529.483047246933 + }, + { + "step": 1552, + "loss": 0.05424533039331436, + "error": 0.0185546875, + "gradient_norm": 0.011683990247547626, + "elapsed": 548.1828610897064 + }, + { + "step": 1568, + "loss": 0.33612310886383057, + "error": 0.1611328125, + "gradient_norm": 0.051817383617162704, + "elapsed": 553.4256420135498 + }, + { + "step": 1584, + "loss": 0.045015305280685425, + "error": 0.0166015625, + "gradient_norm": 0.022604886442422867, + "elapsed": 558.6308543682098 + }, + { + "step": 1600, + "loss": 0.2701840102672577, + "error": 0.119140625, + "gradient_norm": 0.02910422720015049, + "elapsed": 563.8571691513062 + }, + { + "step": 1616, + "loss": 0.18982334434986115, + "error": 0.0849609375, + "gradient_norm": 0.025524422526359558, + "elapsed": 568.8628678321838 + }, + { + "step": 1632, + "loss": 0.3950161337852478, + "error": 0.185546875, + "gradient_norm": 0.08419577777385712, + "elapsed": 574.0815451145172 + }, + { + "step": 1648, + "loss": 0.49384528398513794, + "error": 0.255859375, + "gradient_norm": 0.08879344165325165, + "elapsed": 579.1229114532471 + }, + { + "step": 1664, + "loss": 0.5671384930610657, + "error": 0.3115234375, + "gradient_norm": 0.05374513566493988, + "elapsed": 584.114851474762 + }, + { + "step": 1680, + "loss": 0.6192574501037598, + "error": 0.37890625, + "gradient_norm": 0.043836336582899094, + "elapsed": 589.0708522796631 + }, + { + "step": 1696, + "loss": 0.2619469463825226, + "error": 0.1171875, + "gradient_norm": 0.040093280375003815, + "elapsed": 594.2814819812775 + }, + { + "step": 1712, + "loss": 0.33178141713142395, + "error": 0.162109375, + "gradient_norm": 0.04902712255716324, + "elapsed": 599.3068840503693 + }, + { + "step": 1728, + "loss": 0.385281503200531, + "error": 0.171875, + "gradient_norm": 0.03541380167007446, + "elapsed": 604.5308682918549 + }, + { + "step": 1744, + "loss": 0.1628715693950653, + "error": 0.0693359375, + "gradient_norm": 0.06111741065979004, + "elapsed": 609.309522151947 + }, + { + "step": 1760, + "loss": 0.5239119529724121, + "error": 0.2861328125, + "gradient_norm": 0.08513613045215607, + "elapsed": 614.0396001338959 + }, + { + "step": 1776, + "loss": 0.35721707344055176, + "error": 0.150390625, + "gradient_norm": 0.06337940692901611, + "elapsed": 618.6857132911682 + }, + { + "step": 1792, + "loss": 0.5985626578330994, + "error": 0.33203125, + "gradient_norm": 0.035725343972444534, + "elapsed": 623.3352344036102 + }, + { + "step": 1808, + "loss": 0.34676820039749146, + "error": 0.15234375, + "gradient_norm": 0.08163885772228241, + "elapsed": 627.9495220184326 + }, + { + "step": 1824, + "loss": 0.5633711814880371, + "error": 0.3037109375, + "gradient_norm": 0.05938677117228508, + "elapsed": 632.5820379257202 + }, + { + "step": 1840, + "loss": 0.6256523132324219, + "error": 0.384765625, + "gradient_norm": 0.04545137286186218, + "elapsed": 637.205274105072 + }, + { + "step": 1856, + "loss": 0.28091639280319214, + "error": 0.1298828125, + "gradient_norm": 0.04705077037215233, + "elapsed": 641.883561372757 + }, + { + "step": 1872, + "loss": 0.516182541847229, + "error": 0.263671875, + "gradient_norm": 0.08828777819871902, + "elapsed": 646.5188939571381 + }, + { + "step": 1888, + "loss": 0.48386621475219727, + "error": 0.25390625, + "gradient_norm": 0.05322824418544769, + "elapsed": 651.148512840271 + }, + { + "step": 1904, + "loss": 0.6141921281814575, + "error": 0.388671875, + "gradient_norm": 0.050139278173446655, + "elapsed": 655.7796437740326 + }, + { + "step": 1920, + "loss": 0.18002840876579285, + "error": 0.0712890625, + "gradient_norm": 0.04201133921742439, + "elapsed": 660.4064948558807 + }, + { + "step": 1936, + "loss": 0.17531852424144745, + "error": 0.0732421875, + "gradient_norm": 0.024726318195462227, + "elapsed": 664.9991583824158 + }, + { + "step": 1952, + "loss": 0.5088322758674622, + "error": 0.2744140625, + "gradient_norm": 0.04693225398659706, + "elapsed": 669.5544555187225 + }, + { + "step": 1968, + "loss": 0.5684165358543396, + "error": 0.3310546875, + "gradient_norm": 0.031029095873236656, + "elapsed": 674.2354445457458 + }, + { + "step": 1984, + "loss": 0.06459524482488632, + "error": 0.017578125, + "gradient_norm": 0.03600892797112465, + "elapsed": 678.7982559204102 + }, + { + "step": 2000, + "loss": 0.3614455461502075, + "error": 0.1748046875, + "gradient_norm": 0.07060294598340988, + "elapsed": 683.2650325298309 + }, + { + "step": 2016, + "loss": 0.35535523295402527, + "error": 0.166015625, + "gradient_norm": 0.05873403698205948, + "elapsed": 687.7125518321991 + }, + { + "step": 2032, + "loss": 0.5638720989227295, + "error": 0.3232421875, + "gradient_norm": 0.07380504906177521, + "elapsed": 692.1461188793182 + }, + { + "step": 2048, + "loss": 0.5301838517189026, + "error": 0.2919921875, + "gradient_norm": 0.05435395985841751, + "elapsed": 696.6235508918762 + } + ] + }, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.250907301902771, + "error": 0.1083984375, + "gradient_norm": 0.07171476632356644, + "elapsed": 44.811134576797485 + }, + { + "step": 16, + "loss": 0.5958679914474487, + "error": 0.3662109375, + "gradient_norm": 0.07673005014657974, + "elapsed": 49.90856671333313 + }, + { + "step": 32, + "loss": 0.47648972272872925, + "error": 0.2421875, + "gradient_norm": 0.08561501652002335, + "elapsed": 55.179388761520386 + }, + { + "step": 48, + "loss": 0.06145006790757179, + "error": 0.0234375, + "gradient_norm": 0.01556467730551958, + "elapsed": 61.0339195728302 + }, + { + "step": 64, + "loss": 0.3687053918838501, + "error": 0.1884765625, + "gradient_norm": 0.08752371370792389, + "elapsed": 65.95811891555786 + }, + { + "step": 80, + "loss": 0.6481984853744507, + "error": 0.4140625, + "gradient_norm": 0.05311283841729164, + "elapsed": 70.56021332740784 + }, + { + "step": 96, + "loss": 0.42319929599761963, + "error": 0.2138671875, + "gradient_norm": 0.05047478526830673, + "elapsed": 75.11613631248474 + }, + { + "step": 112, + "loss": 0.47527259588241577, + "error": 0.24609375, + "gradient_norm": 0.038366906344890594, + "elapsed": 79.53446984291077 + }, + { + "step": 128, + "loss": 0.5996723175048828, + "error": 0.3369140625, + "gradient_norm": 0.1213272362947464, + "elapsed": 83.97515749931335 + }, + { + "step": 144, + "loss": 0.04971993714570999, + "error": 0.0146484375, + "gradient_norm": 0.008080735802650452, + "elapsed": 88.44039463996887 + }, + { + "step": 160, + "loss": 0.35900360345840454, + "error": 0.162109375, + "gradient_norm": 0.03359593451023102, + "elapsed": 92.89548206329346 + }, + { + "step": 176, + "loss": 0.5342063903808594, + "error": 0.2978515625, + "gradient_norm": 0.04794691130518913, + "elapsed": 97.35658049583435 + }, + { + "step": 192, + "loss": 0.6300076246261597, + "error": 0.369140625, + "gradient_norm": 0.081769198179245, + "elapsed": 101.81493759155273 + }, + { + "step": 208, + "loss": 0.6191903948783875, + "error": 0.3828125, + "gradient_norm": 0.07145775109529495, + "elapsed": 106.2480263710022 + }, + { + "step": 224, + "loss": 0.5155678391456604, + "error": 0.28515625, + "gradient_norm": 0.06772179156541824, + "elapsed": 110.71284222602844 + }, + { + "step": 240, + "loss": 0.634708046913147, + "error": 0.3857421875, + "gradient_norm": 0.09493093192577362, + "elapsed": 115.14978742599487 + }, + { + "step": 256, + "loss": 0.1840895414352417, + "error": 0.0751953125, + "gradient_norm": 0.025586696341633797, + "elapsed": 119.61202120780945 + }, + { + "step": 272, + "loss": 0.2775103449821472, + "error": 0.12890625, + "gradient_norm": 0.06913147866725922, + "elapsed": 124.02584528923035 + }, + { + "step": 288, + "loss": 0.6163080334663391, + "error": 0.3642578125, + "gradient_norm": 0.05895426496863365, + "elapsed": 128.46512532234192 + }, + { + "step": 304, + "loss": 0.5276986360549927, + "error": 0.287109375, + "gradient_norm": 0.06955187022686005, + "elapsed": 132.89240765571594 + }, + { + "step": 320, + "loss": 0.44859516620635986, + "error": 0.22265625, + "gradient_norm": 0.07272452116012573, + "elapsed": 137.32864713668823 + }, + { + "step": 336, + "loss": 0.48315611481666565, + "error": 0.2626953125, + "gradient_norm": 0.03321139141917229, + "elapsed": 141.80009770393372 + }, + { + "step": 352, + "loss": 0.6107717752456665, + "error": 0.3544921875, + "gradient_norm": 0.05243214592337608, + "elapsed": 146.36439752578735 + }, + { + "step": 368, + "loss": 0.6215153932571411, + "error": 0.357421875, + "gradient_norm": 0.04383325204253197, + "elapsed": 150.99996852874756 + }, + { + "step": 384, + "loss": 0.6130329966545105, + "error": 0.35546875, + "gradient_norm": 0.04113119840621948, + "elapsed": 155.62374639511108 + }, + { + "step": 400, + "loss": 0.30471885204315186, + "error": 0.142578125, + "gradient_norm": 0.04447556659579277, + "elapsed": 160.17594957351685 + }, + { + "step": 416, + "loss": 0.6154489517211914, + "error": 0.37109375, + "gradient_norm": 0.04456057772040367, + "elapsed": 164.7639675140381 + }, + { + "step": 432, + "loss": 0.6134694218635559, + "error": 0.337890625, + "gradient_norm": 0.04219559207558632, + "elapsed": 169.32792139053345 + }, + { + "step": 448, + "loss": 0.5463185906410217, + "error": 0.2939453125, + "gradient_norm": 0.07746092975139618, + "elapsed": 173.88445162773132 + }, + { + "step": 464, + "loss": 0.06016772612929344, + "error": 0.01953125, + "gradient_norm": 0.01364185381680727, + "elapsed": 178.42725706100464 + }, + { + "step": 480, + "loss": 0.388141393661499, + "error": 0.18359375, + "gradient_norm": 0.04870256036520004, + "elapsed": 182.99062085151672 + }, + { + "step": 496, + "loss": 0.44524821639060974, + "error": 0.2216796875, + "gradient_norm": 0.03453445807099342, + "elapsed": 187.56396961212158 + }, + { + "step": 512, + "loss": 0.34312355518341064, + "error": 0.154296875, + "gradient_norm": 0.06794509291648865, + "elapsed": 192.27511191368103 + }, + { + "step": 528, + "loss": 0.19467462599277496, + "error": 0.0771484375, + "gradient_norm": 0.042381469160318375, + "elapsed": 197.7108268737793 + }, + { + "step": 544, + "loss": 0.46226584911346436, + "error": 0.2421875, + "gradient_norm": 0.06073570251464844, + "elapsed": 202.97405791282654 + }, + { + "step": 560, + "loss": 0.525318443775177, + "error": 0.2822265625, + "gradient_norm": 0.06954885274171829, + "elapsed": 208.69676971435547 + }, + { + "step": 576, + "loss": 0.6158387064933777, + "error": 0.349609375, + "gradient_norm": 0.07587578892707825, + "elapsed": 214.80397653579712 + }, + { + "step": 592, + "loss": 0.5515886545181274, + "error": 0.298828125, + "gradient_norm": 0.04969338700175285, + "elapsed": 220.27399611473083 + }, + { + "step": 608, + "loss": 0.18365338444709778, + "error": 0.0654296875, + "gradient_norm": 0.08657706528902054, + "elapsed": 224.81246256828308 + }, + { + "step": 624, + "loss": 0.4578855633735657, + "error": 0.2421875, + "gradient_norm": 0.04942100867629051, + "elapsed": 229.45902252197266 + }, + { + "step": 640, + "loss": 0.37826013565063477, + "error": 0.1865234375, + "gradient_norm": 0.047499872744083405, + "elapsed": 233.9695644378662 + }, + { + "step": 656, + "loss": 0.40863412618637085, + "error": 0.2001953125, + "gradient_norm": 0.07845330238342285, + "elapsed": 238.584894657135 + }, + { + "step": 672, + "loss": 0.5640332698822021, + "error": 0.2880859375, + "gradient_norm": 0.057469289749860764, + "elapsed": 243.0929844379425 + }, + { + "step": 688, + "loss": 0.030216243118047714, + "error": 0.0078125, + "gradient_norm": 0.04682641476392746, + "elapsed": 247.581125497818 + }, + { + "step": 704, + "loss": 0.375002384185791, + "error": 0.1826171875, + "gradient_norm": 0.04864194989204407, + "elapsed": 252.1564691066742 + }, + { + "step": 720, + "loss": 0.5145515203475952, + "error": 0.2744140625, + "gradient_norm": 0.052671682089567184, + "elapsed": 256.6466488838196 + }, + { + "step": 736, + "loss": 0.067174531519413, + "error": 0.0224609375, + "gradient_norm": 0.019299577921628952, + "elapsed": 261.1185076236725 + }, + { + "step": 752, + "loss": 0.24909992516040802, + "error": 0.111328125, + "gradient_norm": 0.06907463818788528, + "elapsed": 265.61960339546204 + }, + { + "step": 768, + "loss": 0.5088074207305908, + "error": 0.2744140625, + "gradient_norm": 0.06963017582893372, + "elapsed": 270.07474064826965 + }, + { + "step": 784, + "loss": 0.3783387839794159, + "error": 0.1826171875, + "gradient_norm": 0.05537794530391693, + "elapsed": 274.52722239494324 + }, + { + "step": 800, + "loss": 0.6107200980186462, + "error": 0.3623046875, + "gradient_norm": 0.0470259003341198, + "elapsed": 279.0401859283447 + }, + { + "step": 816, + "loss": 0.5778236389160156, + "error": 0.3212890625, + "gradient_norm": 0.10146680474281311, + "elapsed": 283.5114622116089 + }, + { + "step": 832, + "loss": 0.576002299785614, + "error": 0.3076171875, + "gradient_norm": 0.07760787010192871, + "elapsed": 288.04797434806824 + }, + { + "step": 848, + "loss": 0.6179666519165039, + "error": 0.3740234375, + "gradient_norm": 0.07383852452039719, + "elapsed": 292.60600209236145 + }, + { + "step": 864, + "loss": 0.3105512857437134, + "error": 0.1455078125, + "gradient_norm": 0.052953749895095825, + "elapsed": 297.12180352211 + }, + { + "step": 880, + "loss": 0.4802623987197876, + "error": 0.2548828125, + "gradient_norm": 0.07736275345087051, + "elapsed": 301.6091134548187 + }, + { + "step": 896, + "loss": 0.5572722554206848, + "error": 0.318359375, + "gradient_norm": 0.053303152322769165, + "elapsed": 306.1978073120117 + }, + { + "step": 912, + "loss": 0.34814420342445374, + "error": 0.1669921875, + "gradient_norm": 0.037726350128650665, + "elapsed": 310.78571581840515 + }, + { + "step": 928, + "loss": 0.41743016242980957, + "error": 0.21875, + "gradient_norm": 0.05238872766494751, + "elapsed": 315.24156188964844 + }, + { + "step": 944, + "loss": 0.5757850408554077, + "error": 0.3173828125, + "gradient_norm": 0.05837905779480934, + "elapsed": 319.78475165367126 + }, + { + "step": 960, + "loss": 0.40727972984313965, + "error": 0.197265625, + "gradient_norm": 0.059294261038303375, + "elapsed": 324.2090265750885 + }, + { + "step": 976, + "loss": 0.32715001702308655, + "error": 0.1533203125, + "gradient_norm": 0.11543179303407669, + "elapsed": 328.6462152004242 + }, + { + "step": 992, + "loss": 0.5578742623329163, + "error": 0.314453125, + "gradient_norm": 0.06282714009284973, + "elapsed": 333.0712504386902 + }, + { + "step": 1008, + "loss": 0.5052692294120789, + "error": 0.265625, + "gradient_norm": 0.04039420187473297, + "elapsed": 337.5182821750641 + }, + { + "step": 1024, + "loss": 0.18790806829929352, + "error": 0.08203125, + "gradient_norm": 0.028905188664793968, + "elapsed": 342.08340406417847 + }, + { + "step": 1040, + "loss": 0.6317684650421143, + "error": 0.3681640625, + "gradient_norm": 0.03441835194826126, + "elapsed": 358.8279616832733 + }, + { + "step": 1056, + "loss": 0.40474164485931396, + "error": 0.2021484375, + "gradient_norm": 0.036449309438467026, + "elapsed": 363.30218267440796 + }, + { + "step": 1072, + "loss": 0.518299400806427, + "error": 0.2666015625, + "gradient_norm": 0.0886964276432991, + "elapsed": 367.87997555732727 + }, + { + "step": 1088, + "loss": 0.2522922158241272, + "error": 0.099609375, + "gradient_norm": 0.07553310692310333, + "elapsed": 372.4414882659912 + }, + { + "step": 1104, + "loss": 0.6214810609817505, + "error": 0.3701171875, + "gradient_norm": 0.10188957303762436, + "elapsed": 376.9120502471924 + }, + { + "step": 1120, + "loss": 0.6307054162025452, + "error": 0.3720703125, + "gradient_norm": 0.07353860139846802, + "elapsed": 381.3824534416199 + }, + { + "step": 1136, + "loss": 0.5259381532669067, + "error": 0.2763671875, + "gradient_norm": 0.05779678374528885, + "elapsed": 385.8413143157959 + }, + { + "step": 1152, + "loss": 0.4995541572570801, + "error": 0.259765625, + "gradient_norm": 0.046648140996694565, + "elapsed": 390.28326058387756 + }, + { + "step": 1168, + "loss": 0.6075694561004639, + "error": 0.3701171875, + "gradient_norm": 0.10612073540687561, + "elapsed": 394.8162364959717 + }, + { + "step": 1184, + "loss": 0.2105136513710022, + "error": 0.080078125, + "gradient_norm": 0.0716402605175972, + "elapsed": 399.2960283756256 + }, + { + "step": 1200, + "loss": 0.6371631026268005, + "error": 0.3857421875, + "gradient_norm": 0.0549108125269413, + "elapsed": 403.7899103164673 + }, + { + "step": 1216, + "loss": 0.5450670719146729, + "error": 0.2939453125, + "gradient_norm": 0.11688558012247086, + "elapsed": 408.34677600860596 + }, + { + "step": 1232, + "loss": 0.035783201456069946, + "error": 0.01171875, + "gradient_norm": 0.02951689623296261, + "elapsed": 412.8558337688446 + }, + { + "step": 1248, + "loss": 0.5582903623580933, + "error": 0.3046875, + "gradient_norm": 0.055107031017541885, + "elapsed": 417.29854226112366 + }, + { + "step": 1264, + "loss": 0.5154441595077515, + "error": 0.27734375, + "gradient_norm": 0.04474929720163345, + "elapsed": 421.7792055606842 + }, + { + "step": 1280, + "loss": 0.35227546095848083, + "error": 0.16015625, + "gradient_norm": 0.05024837702512741, + "elapsed": 426.54427456855774 + }, + { + "step": 1296, + "loss": 0.19417589902877808, + "error": 0.0830078125, + "gradient_norm": 0.026926057413220406, + "elapsed": 431.320588350296 + }, + { + "step": 1312, + "loss": 0.4768218398094177, + "error": 0.248046875, + "gradient_norm": 0.15099607408046722, + "elapsed": 435.96817326545715 + }, + { + "step": 1328, + "loss": 0.48580923676490784, + "error": 0.2509765625, + "gradient_norm": 0.08925126492977142, + "elapsed": 440.64917039871216 + }, + { + "step": 1344, + "loss": 0.42041274905204773, + "error": 0.1982421875, + "gradient_norm": 0.08321093022823334, + "elapsed": 445.34370946884155 + }, + { + "step": 1360, + "loss": 0.06403929740190506, + "error": 0.0185546875, + "gradient_norm": 0.03817005455493927, + "elapsed": 449.98669385910034 + }, + { + "step": 1376, + "loss": 0.463126003742218, + "error": 0.2275390625, + "gradient_norm": 0.08894515782594681, + "elapsed": 454.6478977203369 + }, + { + "step": 1392, + "loss": 0.5995306968688965, + "error": 0.373046875, + "gradient_norm": 0.06733685731887817, + "elapsed": 459.35924530029297 + }, + { + "step": 1408, + "loss": 0.49053263664245605, + "error": 0.25, + "gradient_norm": 0.10475508868694305, + "elapsed": 464.100093126297 + }, + { + "step": 1424, + "loss": 0.6220744848251343, + "error": 0.3818359375, + "gradient_norm": 0.03653963655233383, + "elapsed": 468.89601135253906 + }, + { + "step": 1440, + "loss": 0.39706122875213623, + "error": 0.2021484375, + "gradient_norm": 0.04344598576426506, + "elapsed": 474.03999519348145 + }, + { + "step": 1456, + "loss": 0.5386708974838257, + "error": 0.3095703125, + "gradient_norm": 0.12589037418365479, + "elapsed": 478.8600504398346 + }, + { + "step": 1472, + "loss": 0.49776726961135864, + "error": 0.271484375, + "gradient_norm": 0.058137863874435425, + "elapsed": 483.5920066833496 + }, + { + "step": 1488, + "loss": 0.4757428765296936, + "error": 0.2412109375, + "gradient_norm": 0.050453316420316696, + "elapsed": 488.4611999988556 + }, + { + "step": 1504, + "loss": 0.5694847702980042, + "error": 0.337890625, + "gradient_norm": 0.052419569343328476, + "elapsed": 493.26151037216187 + }, + { + "step": 1520, + "loss": 0.5997745990753174, + "error": 0.3603515625, + "gradient_norm": 0.04338108375668526, + "elapsed": 498.0421245098114 + }, + { + "step": 1536, + "loss": 0.6195274591445923, + "error": 0.3876953125, + "gradient_norm": 0.04848463833332062, + "elapsed": 502.8808298110962 + }, + { + "step": 1552, + "loss": 0.46315908432006836, + "error": 0.2353515625, + "gradient_norm": 0.06380566209554672, + "elapsed": 507.5519721508026 + }, + { + "step": 1568, + "loss": 0.605262041091919, + "error": 0.36328125, + "gradient_norm": 0.05077619478106499, + "elapsed": 512.457685470581 + }, + { + "step": 1584, + "loss": 0.48782041668891907, + "error": 0.232421875, + "gradient_norm": 0.09017211943864822, + "elapsed": 517.2960062026978 + }, + { + "step": 1600, + "loss": 0.3881351947784424, + "error": 0.1875, + "gradient_norm": 0.07205695658922195, + "elapsed": 522.0911631584167 + }, + { + "step": 1616, + "loss": 0.4966873526573181, + "error": 0.24609375, + "gradient_norm": 0.0582038015127182, + "elapsed": 526.8861901760101 + }, + { + "step": 1632, + "loss": 0.5844199657440186, + "error": 0.33203125, + "gradient_norm": 0.05101500824093819, + "elapsed": 531.6640138626099 + }, + { + "step": 1648, + "loss": 0.31010180711746216, + "error": 0.1318359375, + "gradient_norm": 0.053135693073272705, + "elapsed": 536.4960391521454 + }, + { + "step": 1664, + "loss": 0.6174807548522949, + "error": 0.3779296875, + "gradient_norm": 0.04161194711923599, + "elapsed": 541.2560484409332 + }, + { + "step": 1680, + "loss": 0.18213607370853424, + "error": 0.0751953125, + "gradient_norm": 0.07171957194805145, + "elapsed": 546.0000085830688 + }, + { + "step": 1696, + "loss": 0.5445692539215088, + "error": 0.2998046875, + "gradient_norm": 0.054499462246894836, + "elapsed": 551.1221191883087 + }, + { + "step": 1712, + "loss": 0.05744167044758797, + "error": 0.017578125, + "gradient_norm": 0.013108699582517147, + "elapsed": 556.5286149978638 + }, + { + "step": 1728, + "loss": 0.6381571292877197, + "error": 0.3896484375, + "gradient_norm": 0.05157556012272835, + "elapsed": 561.8000066280365 + }, + { + "step": 1744, + "loss": 0.5301004648208618, + "error": 0.28125, + "gradient_norm": 0.04218568280339241, + "elapsed": 567.2760035991669 + }, + { + "step": 1760, + "loss": 0.5275102257728577, + "error": 0.26953125, + "gradient_norm": 0.06798839569091797, + "elapsed": 572.5601994991302 + }, + { + "step": 1776, + "loss": 0.6443773508071899, + "error": 0.4091796875, + "gradient_norm": 0.07035460323095322, + "elapsed": 577.9789206981659 + }, + { + "step": 1792, + "loss": 0.6012362241744995, + "error": 0.337890625, + "gradient_norm": 0.05189951881766319, + "elapsed": 583.028017282486 + }, + { + "step": 1808, + "loss": 0.2939091920852661, + "error": 0.12109375, + "gradient_norm": 0.05555355176329613, + "elapsed": 588.0501506328583 + }, + { + "step": 1824, + "loss": 0.2059091478586197, + "error": 0.08984375, + "gradient_norm": 0.045679714530706406, + "elapsed": 593.2120039463043 + }, + { + "step": 1840, + "loss": 0.6289581060409546, + "error": 0.349609375, + "gradient_norm": 0.04742642492055893, + "elapsed": 598.7767763137817 + }, + { + "step": 1856, + "loss": 0.5532636642456055, + "error": 0.294921875, + "gradient_norm": 0.05997413396835327, + "elapsed": 604.0475382804871 + }, + { + "step": 1872, + "loss": 0.45995670557022095, + "error": 0.228515625, + "gradient_norm": 0.05674462765455246, + "elapsed": 609.292379617691 + }, + { + "step": 1888, + "loss": 0.6178656816482544, + "error": 0.359375, + "gradient_norm": 0.08857566863298416, + "elapsed": 614.5639882087708 + }, + { + "step": 1904, + "loss": 0.5531284213066101, + "error": 0.287109375, + "gradient_norm": 0.10257937759160995, + "elapsed": 619.5600035190582 + }, + { + "step": 1920, + "loss": 0.04184349626302719, + "error": 0.013671875, + "gradient_norm": 0.04087059944868088, + "elapsed": 624.6679775714874 + }, + { + "step": 1936, + "loss": 0.5924860239028931, + "error": 0.3505859375, + "gradient_norm": 0.036822713911533356, + "elapsed": 629.936680316925 + }, + { + "step": 1952, + "loss": 0.46996980905532837, + "error": 0.2421875, + "gradient_norm": 0.034442272037267685, + "elapsed": 635.1109762191772 + }, + { + "step": 1968, + "loss": 0.17859068512916565, + "error": 0.0712890625, + "gradient_norm": 0.03440066799521446, + "elapsed": 640.32000207901 + }, + { + "step": 1984, + "loss": 0.6192275285720825, + "error": 0.3701171875, + "gradient_norm": 0.04386439174413681, + "elapsed": 645.6040184497833 + }, + { + "step": 2000, + "loss": 0.6160917282104492, + "error": 0.35546875, + "gradient_norm": 0.06268990784883499, + "elapsed": 650.7723731994629 + }, + { + "step": 2016, + "loss": 0.6343611478805542, + "error": 0.388671875, + "gradient_norm": 0.04243326932191849, + "elapsed": 655.972663640976 + }, + { + "step": 2032, + "loss": 0.062292590737342834, + "error": 0.021484375, + "gradient_norm": 0.016680095344781876, + "elapsed": 660.8079733848572 + }, + { + "step": 2048, + "loss": 0.5316072702407837, + "error": 0.26953125, + "gradient_norm": 0.057860780507326126, + "elapsed": 665.5760209560394 + }, + { + "step": 2064, + "loss": 0.605312705039978, + "error": 0.3623046875, + "gradient_norm": 0.04028146713972092, + "elapsed": 682.7294294834137 + }, + { + "step": 2080, + "loss": 0.56633460521698, + "error": 0.3330078125, + "gradient_norm": 0.09528280049562454, + "elapsed": 687.4644649028778 + }, + { + "step": 2096, + "loss": 0.3905397057533264, + "error": 0.1943359375, + "gradient_norm": 0.049456462264060974, + "elapsed": 692.1492264270782 + }, + { + "step": 2112, + "loss": 0.28124868869781494, + "error": 0.1259765625, + "gradient_norm": 0.059239838272333145, + "elapsed": 696.8701393604279 + }, + { + "step": 2128, + "loss": 0.6364338994026184, + "error": 0.392578125, + "gradient_norm": 0.08667811006307602, + "elapsed": 701.683988571167 + }, + { + "step": 2144, + "loss": 0.20683243870735168, + "error": 0.07421875, + "gradient_norm": 0.1100710779428482, + "elapsed": 706.4000360965729 + }, + { + "step": 2160, + "loss": 0.5912737250328064, + "error": 0.341796875, + "gradient_norm": 0.05641854554414749, + "elapsed": 711.2359964847565 + }, + { + "step": 2176, + "loss": 0.27793264389038086, + "error": 0.12109375, + "gradient_norm": 0.0893034040927887, + "elapsed": 715.9508004188538 + }, + { + "step": 2192, + "loss": 0.6474133133888245, + "error": 0.4072265625, + "gradient_norm": 0.06980258971452713, + "elapsed": 720.651974439621 + }, + { + "step": 2208, + "loss": 0.5961858630180359, + "error": 0.35546875, + "gradient_norm": 0.06530112773180008, + "elapsed": 725.496098279953 + }, + { + "step": 2224, + "loss": 0.47581571340560913, + "error": 0.263671875, + "gradient_norm": 0.04470043256878853, + "elapsed": 730.2880010604858 + }, + { + "step": 2240, + "loss": 0.577988862991333, + "error": 0.318359375, + "gradient_norm": 0.07201159745454788, + "elapsed": 735.006133556366 + }, + { + "step": 2256, + "loss": 0.28444671630859375, + "error": 0.1181640625, + "gradient_norm": 0.048656050115823746, + "elapsed": 739.6868116855621 + }, + { + "step": 2272, + "loss": 0.2776409089565277, + "error": 0.1201171875, + "gradient_norm": 0.05783981829881668, + "elapsed": 744.3517308235168 + }, + { + "step": 2288, + "loss": 0.621599555015564, + "error": 0.37109375, + "gradient_norm": 0.09731200337409973, + "elapsed": 749.0351710319519 + }, + { + "step": 2304, + "loss": 0.3333754539489746, + "error": 0.1513671875, + "gradient_norm": 0.07069239765405655, + "elapsed": 753.7588081359863 + }, + { + "step": 2320, + "loss": 0.4687051773071289, + "error": 0.2490234375, + "gradient_norm": 0.044891707599163055, + "elapsed": 758.4588432312012 + }, + { + "step": 2336, + "loss": 0.19801637530326843, + "error": 0.078125, + "gradient_norm": 0.10036595165729523, + "elapsed": 763.256409406662 + }, + { + "step": 2352, + "loss": 0.6186277866363525, + "error": 0.388671875, + "gradient_norm": 0.09069584310054779, + "elapsed": 767.9986386299133 + }, + { + "step": 2368, + "loss": 0.6177258491516113, + "error": 0.373046875, + "gradient_norm": 0.049019571393728256, + "elapsed": 772.730831861496 + }, + { + "step": 2384, + "loss": 0.17707547545433044, + "error": 0.0673828125, + "gradient_norm": 0.045190781354904175, + "elapsed": 777.4072704315186 + }, + { + "step": 2400, + "loss": 0.20144733786582947, + "error": 0.08203125, + "gradient_norm": 0.04537162929773331, + "elapsed": 782.0841658115387 + }, + { + "step": 2416, + "loss": 0.6151775121688843, + "error": 0.365234375, + "gradient_norm": 0.050534047186374664, + "elapsed": 786.762966632843 + }, + { + "step": 2432, + "loss": 0.5533859133720398, + "error": 0.314453125, + "gradient_norm": 0.06006559729576111, + "elapsed": 791.4656012058258 + }, + { + "step": 2448, + "loss": 0.5329082012176514, + "error": 0.2880859375, + "gradient_norm": 0.04018115997314453, + "elapsed": 796.1704161167145 + }, + { + "step": 2464, + "loss": 0.6338047981262207, + "error": 0.4140625, + "gradient_norm": 0.06069163978099823, + "elapsed": 800.9180119037628 + }, + { + "step": 2480, + "loss": 0.1603008508682251, + "error": 0.0673828125, + "gradient_norm": 0.040350593626499176, + "elapsed": 805.6127603054047 + }, + { + "step": 2496, + "loss": 0.505940318107605, + "error": 0.2568359375, + "gradient_norm": 0.05209952965378761, + "elapsed": 810.3740313053131 + }, + { + "step": 2512, + "loss": 0.5528728365898132, + "error": 0.298828125, + "gradient_norm": 0.11757992953062057, + "elapsed": 815.1708807945251 + }, + { + "step": 2528, + "loss": 0.5028313994407654, + "error": 0.2666015625, + "gradient_norm": 0.08823780715465546, + "elapsed": 819.8585045337677 + }, + { + "step": 2544, + "loss": 0.5002262592315674, + "error": 0.2783203125, + "gradient_norm": 0.04888603836297989, + "elapsed": 824.5714073181152 + }, + { + "step": 2560, + "loss": 0.6007894277572632, + "error": 0.328125, + "gradient_norm": 0.05186954140663147, + "elapsed": 829.3080432415009 + }, + { + "step": 2576, + "loss": 0.18641480803489685, + "error": 0.076171875, + "gradient_norm": 0.03799928352236748, + "elapsed": 834.044020652771 + }, + { + "step": 2592, + "loss": 0.3050769865512848, + "error": 0.1396484375, + "gradient_norm": 0.10119257122278214, + "elapsed": 838.8401296138763 + }, + { + "step": 2608, + "loss": 0.6063439846038818, + "error": 0.361328125, + "gradient_norm": 0.04979367554187775, + "elapsed": 844.3572654724121 + }, + { + "step": 2624, + "loss": 0.5751967430114746, + "error": 0.3369140625, + "gradient_norm": 0.04269539937376976, + "elapsed": 849.0660374164581 + }, + { + "step": 2640, + "loss": 0.3902108669281006, + "error": 0.193359375, + "gradient_norm": 0.10029696673154831, + "elapsed": 853.8638062477112 + }, + { + "step": 2656, + "loss": 0.15081660449504852, + "error": 0.0625, + "gradient_norm": 0.0303852129727602, + "elapsed": 858.9793758392334 + }, + { + "step": 2672, + "loss": 0.6503090858459473, + "error": 0.400390625, + "gradient_norm": 0.12611964344978333, + "elapsed": 863.9151141643524 + }, + { + "step": 2688, + "loss": 0.5587317943572998, + "error": 0.31640625, + "gradient_norm": 0.10028114914894104, + "elapsed": 868.7600305080414 + }, + { + "step": 2704, + "loss": 0.4399867355823517, + "error": 0.21484375, + "gradient_norm": 0.06889455020427704, + "elapsed": 873.4544236660004 + }, + { + "step": 2720, + "loss": 0.5865127444267273, + "error": 0.337890625, + "gradient_norm": 0.03671631962060928, + "elapsed": 878.0982644557953 + }, + { + "step": 2736, + "loss": 0.6078637838363647, + "error": 0.3701171875, + "gradient_norm": 0.04679318517446518, + "elapsed": 883.0424642562866 + }, + { + "step": 2752, + "loss": 0.5825340151786804, + "error": 0.337890625, + "gradient_norm": 0.05619681254029274, + "elapsed": 887.908124923706 + }, + { + "step": 2768, + "loss": 0.5970422029495239, + "error": 0.3369140625, + "gradient_norm": 0.041302867233753204, + "elapsed": 892.6760206222534 + }, + { + "step": 2784, + "loss": 0.3870226740837097, + "error": 0.1826171875, + "gradient_norm": 0.05731065198779106, + "elapsed": 897.6246056556702 + }, + { + "step": 2800, + "loss": 0.38130277395248413, + "error": 0.1943359375, + "gradient_norm": 0.059244755655527115, + "elapsed": 902.3360238075256 + }, + { + "step": 2816, + "loss": 0.2617901563644409, + "error": 0.1064453125, + "gradient_norm": 0.041736964136362076, + "elapsed": 907.1600468158722 + }, + { + "step": 2832, + "loss": 0.5819337368011475, + "error": 0.314453125, + "gradient_norm": 0.04097156226634979, + "elapsed": 912.0244295597076 + }, + { + "step": 2848, + "loss": 0.41393283009529114, + "error": 0.2001953125, + "gradient_norm": 0.10456771403551102, + "elapsed": 916.8225846290588 + }, + { + "step": 2864, + "loss": 0.5019145011901855, + "error": 0.2548828125, + "gradient_norm": 0.04843736067414284, + "elapsed": 921.538754940033 + }, + { + "step": 2880, + "loss": 0.04561338573694229, + "error": 0.0146484375, + "gradient_norm": 0.025407327339053154, + "elapsed": 926.2588667869568 + }, + { + "step": 2896, + "loss": 0.4338858723640442, + "error": 0.205078125, + "gradient_norm": 0.09900517761707306, + "elapsed": 930.9781975746155 + }, + { + "step": 2912, + "loss": 0.33922863006591797, + "error": 0.162109375, + "gradient_norm": 0.10189604014158249, + "elapsed": 935.6816267967224 + }, + { + "step": 2928, + "loss": 0.5294322967529297, + "error": 0.2822265625, + "gradient_norm": 0.09060791879892349, + "elapsed": 940.4373068809509 + }, + { + "step": 2944, + "loss": 0.037007369101047516, + "error": 0.01171875, + "gradient_norm": 0.05506489425897598, + "elapsed": 945.1270468235016 + }, + { + "step": 2960, + "loss": 0.6096771359443665, + "error": 0.349609375, + "gradient_norm": 0.04987221211194992, + "elapsed": 949.8300130367279 + }, + { + "step": 2976, + "loss": 0.6157823801040649, + "error": 0.373046875, + "gradient_norm": 0.03614233434200287, + "elapsed": 954.5701997280121 + }, + { + "step": 2992, + "loss": 0.1978239268064499, + "error": 0.080078125, + "gradient_norm": 0.05847112461924553, + "elapsed": 959.2756471633911 + }, + { + "step": 3008, + "loss": 0.5237340927124023, + "error": 0.2841796875, + "gradient_norm": 0.06993591040372849, + "elapsed": 963.9875864982605 + }, + { + "step": 3024, + "loss": 0.4559935927391052, + "error": 0.2373046875, + "gradient_norm": 0.05698448419570923, + "elapsed": 968.7997305393219 + }, + { + "step": 3040, + "loss": 0.5025208592414856, + "error": 0.259765625, + "gradient_norm": 0.14909739792346954, + "elapsed": 973.6042547225952 + }, + { + "step": 3056, + "loss": 0.3223109245300293, + "error": 0.1416015625, + "gradient_norm": 0.032974764704704285, + "elapsed": 978.4760546684265 + }, + { + "step": 3072, + "loss": 0.06682582199573517, + "error": 0.021484375, + "gradient_norm": 0.04433188587427139, + "elapsed": 983.2894048690796 + }, + { + "step": 3088, + "loss": 0.5919550061225891, + "error": 0.34765625, + "gradient_norm": 0.06721373647451401, + "elapsed": 1000.9520287513733 + }, + { + "step": 3104, + "loss": 0.5988063812255859, + "error": 0.3642578125, + "gradient_norm": 0.05654948577284813, + "elapsed": 1005.7442932128906 + }, + { + "step": 3120, + "loss": 0.4922299385070801, + "error": 0.2470703125, + "gradient_norm": 0.07545466721057892, + "elapsed": 1010.4616096019745 + }, + { + "step": 3136, + "loss": 0.4533671736717224, + "error": 0.236328125, + "gradient_norm": 0.06288722902536392, + "elapsed": 1015.3559956550598 + }, + { + "step": 3152, + "loss": 0.5070517063140869, + "error": 0.2666015625, + "gradient_norm": 0.07274917513132095, + "elapsed": 1020.0764343738556 + }, + { + "step": 3168, + "loss": 0.5999464988708496, + "error": 0.3408203125, + "gradient_norm": 0.05777016654610634, + "elapsed": 1024.9410600662231 + }, + { + "step": 3184, + "loss": 0.5758363008499146, + "error": 0.3427734375, + "gradient_norm": 0.051027461886405945, + "elapsed": 1029.7082171440125 + }, + { + "step": 3200, + "loss": 0.05016190931200981, + "error": 0.017578125, + "gradient_norm": 0.009175656363368034, + "elapsed": 1034.3982915878296 + }, + { + "step": 3216, + "loss": 0.5471057295799255, + "error": 0.318359375, + "gradient_norm": 0.07572721689939499, + "elapsed": 1039.117841243744 + }, + { + "step": 3232, + "loss": 0.4141446352005005, + "error": 0.193359375, + "gradient_norm": 0.10056859254837036, + "elapsed": 1043.880026102066 + }, + { + "step": 3248, + "loss": 0.5812438726425171, + "error": 0.3212890625, + "gradient_norm": 0.05781616270542145, + "elapsed": 1048.6406455039978 + }, + { + "step": 3264, + "loss": 0.19184701144695282, + "error": 0.078125, + "gradient_norm": 0.05367236211895943, + "elapsed": 1053.5672237873077 + }, + { + "step": 3280, + "loss": 0.5420833826065063, + "error": 0.28515625, + "gradient_norm": 0.052405405789613724, + "elapsed": 1058.3841104507446 + }, + { + "step": 3296, + "loss": 0.4419598877429962, + "error": 0.2177734375, + "gradient_norm": 0.05814693495631218, + "elapsed": 1063.1880333423615 + }, + { + "step": 3312, + "loss": 0.4525642991065979, + "error": 0.208984375, + "gradient_norm": 0.1061021164059639, + "elapsed": 1068.1370933055878 + }, + { + "step": 3328, + "loss": 0.32664671540260315, + "error": 0.154296875, + "gradient_norm": 0.05649850144982338, + "elapsed": 1073.1963467597961 + }, + { + "step": 3344, + "loss": 0.2655770182609558, + "error": 0.1220703125, + "gradient_norm": 0.04070372134447098, + "elapsed": 1078.2698318958282 + }, + { + "step": 3360, + "loss": 0.5894330739974976, + "error": 0.3544921875, + "gradient_norm": 0.0643400028347969, + "elapsed": 1083.0184152126312 + }, + { + "step": 3376, + "loss": 0.6118791103363037, + "error": 0.361328125, + "gradient_norm": 0.08537904173135757, + "elapsed": 1087.834038734436 + }, + { + "step": 3392, + "loss": 0.40694907307624817, + "error": 0.19921875, + "gradient_norm": 0.11411692947149277, + "elapsed": 1092.8119947910309 + }, + { + "step": 3408, + "loss": 0.04629015550017357, + "error": 0.0146484375, + "gradient_norm": 0.017204072326421738, + "elapsed": 1097.5751783847809 + }, + { + "step": 3424, + "loss": 0.20639702677726746, + "error": 0.0849609375, + "gradient_norm": 0.04801144450902939, + "elapsed": 1102.2970931529999 + }, + { + "step": 3440, + "loss": 0.6051071286201477, + "error": 0.33984375, + "gradient_norm": 0.045392412692308426, + "elapsed": 1107.1080610752106 + }, + { + "step": 3456, + "loss": 0.6553700566291809, + "error": 0.40625, + "gradient_norm": 0.05593863129615784, + "elapsed": 1111.8409752845764 + }, + { + "step": 3472, + "loss": 0.591402530670166, + "error": 0.3515625, + "gradient_norm": 0.051181379705667496, + "elapsed": 1116.5800333023071 + }, + { + "step": 3488, + "loss": 0.30494624376296997, + "error": 0.12109375, + "gradient_norm": 0.05175542086362839, + "elapsed": 1121.276373386383 + }, + { + "step": 3504, + "loss": 0.5065370798110962, + "error": 0.279296875, + "gradient_norm": 0.10419930517673492, + "elapsed": 1125.9883344173431 + }, + { + "step": 3520, + "loss": 0.3915700614452362, + "error": 0.1953125, + "gradient_norm": 0.060416825115680695, + "elapsed": 1130.7958455085754 + }, + { + "step": 3536, + "loss": 0.624374270439148, + "error": 0.3759765625, + "gradient_norm": 0.06069556251168251, + "elapsed": 1135.5360939502716 + }, + { + "step": 3552, + "loss": 0.5830206274986267, + "error": 0.3359375, + "gradient_norm": 0.046013280749320984, + "elapsed": 1140.312029838562 + }, + { + "step": 3568, + "loss": 0.4201379716396332, + "error": 0.2119140625, + "gradient_norm": 0.06909621506929398, + "elapsed": 1145.0904593467712 + }, + { + "step": 3584, + "loss": 0.28215405344963074, + "error": 0.1181640625, + "gradient_norm": 0.07625982910394669, + "elapsed": 1149.8156151771545 + }, + { + "step": 3600, + "loss": 0.5229164361953735, + "error": 0.275390625, + "gradient_norm": 0.055048178881406784, + "elapsed": 1154.5280592441559 + }, + { + "step": 3616, + "loss": 0.47238075733184814, + "error": 0.2314453125, + "gradient_norm": 0.06473162025213242, + "elapsed": 1159.2720873355865 + }, + { + "step": 3632, + "loss": 0.46245503425598145, + "error": 0.228515625, + "gradient_norm": 0.07382887601852417, + "elapsed": 1164.0119998455048 + }, + { + "step": 3648, + "loss": 0.37509745359420776, + "error": 0.171875, + "gradient_norm": 0.051260266453027725, + "elapsed": 1168.7440350055695 + }, + { + "step": 3664, + "loss": 0.1948484629392624, + "error": 0.080078125, + "gradient_norm": 0.059623416513204575, + "elapsed": 1173.3906588554382 + }, + { + "step": 3680, + "loss": 0.5552756786346436, + "error": 0.3115234375, + "gradient_norm": 0.08073585480451584, + "elapsed": 1178.0645008087158 + }, + { + "step": 3696, + "loss": 0.6405904293060303, + "error": 0.39453125, + "gradient_norm": 0.05899551138281822, + "elapsed": 1182.730489730835 + }, + { + "step": 3712, + "loss": 0.2767012119293213, + "error": 0.119140625, + "gradient_norm": 0.06593579798936844, + "elapsed": 1187.377315044403 + }, + { + "step": 3728, + "loss": 0.315812885761261, + "error": 0.134765625, + "gradient_norm": 0.035905495285987854, + "elapsed": 1192.0582301616669 + }, + { + "step": 3744, + "loss": 0.6033951640129089, + "error": 0.3544921875, + "gradient_norm": 0.05226197466254234, + "elapsed": 1196.7101175785065 + }, + { + "step": 3760, + "loss": 0.5202592611312866, + "error": 0.275390625, + "gradient_norm": 0.06367512047290802, + "elapsed": 1201.3543090820312 + }, + { + "step": 3776, + "loss": 0.24639368057250977, + "error": 0.1083984375, + "gradient_norm": 0.09370873868465424, + "elapsed": 1206.0717165470123 + }, + { + "step": 3792, + "loss": 0.6175658702850342, + "error": 0.375, + "gradient_norm": 0.06221585348248482, + "elapsed": 1210.754029750824 + }, + { + "step": 3808, + "loss": 0.41153696179389954, + "error": 0.2119140625, + "gradient_norm": 0.05355365574359894, + "elapsed": 1215.4374370574951 + }, + { + "step": 3824, + "loss": 0.28002214431762695, + "error": 0.1123046875, + "gradient_norm": 0.03846330568194389, + "elapsed": 1220.1207013130188 + }, + { + "step": 3840, + "loss": 0.0484195351600647, + "error": 0.013671875, + "gradient_norm": 0.03470242768526077, + "elapsed": 1224.8153104782104 + }, + { + "step": 3856, + "loss": 0.1407160609960556, + "error": 0.0458984375, + "gradient_norm": 0.04061700031161308, + "elapsed": 1229.5512235164642 + }, + { + "step": 3872, + "loss": 0.5881794691085815, + "error": 0.3427734375, + "gradient_norm": 0.062013477087020874, + "elapsed": 1234.3750183582306 + }, + { + "step": 3888, + "loss": 0.17833612859249115, + "error": 0.06640625, + "gradient_norm": 0.038856204599142075, + "elapsed": 1239.110375881195 + }, + { + "step": 3904, + "loss": 0.06211477518081665, + "error": 0.0224609375, + "gradient_norm": 0.02150108851492405, + "elapsed": 1243.800644159317 + }, + { + "step": 3920, + "loss": 0.06039723381400108, + "error": 0.01953125, + "gradient_norm": 0.019367367029190063, + "elapsed": 1248.4831748008728 + }, + { + "step": 3936, + "loss": 0.6010214686393738, + "error": 0.3525390625, + "gradient_norm": 0.051659151911735535, + "elapsed": 1253.1423478126526 + }, + { + "step": 3952, + "loss": 0.5867137312889099, + "error": 0.3388671875, + "gradient_norm": 0.058528851717710495, + "elapsed": 1257.9799931049347 + }, + { + "step": 3968, + "loss": 0.5231834650039673, + "error": 0.2578125, + "gradient_norm": 0.10128334909677505, + "elapsed": 1262.6990082263947 + }, + { + "step": 3984, + "loss": 0.6251651644706726, + "error": 0.353515625, + "gradient_norm": 0.06211795285344124, + "elapsed": 1267.4289934635162 + }, + { + "step": 4000, + "loss": 0.06667037308216095, + "error": 0.01953125, + "gradient_norm": 0.048018258064985275, + "elapsed": 1272.132089138031 + }, + { + "step": 4016, + "loss": 0.5286938548088074, + "error": 0.2744140625, + "gradient_norm": 0.05509360507130623, + "elapsed": 1276.8878977298737 + }, + { + "step": 4032, + "loss": 0.34016552567481995, + "error": 0.1591796875, + "gradient_norm": 0.07597329467535019, + "elapsed": 1281.7364926338196 + }, + { + "step": 4048, + "loss": 0.17750494182109833, + "error": 0.078125, + "gradient_norm": 0.06314503401517868, + "elapsed": 1286.5033600330353 + }, + { + "step": 4064, + "loss": 0.5882893800735474, + "error": 0.34375, + "gradient_norm": 0.10986580699682236, + "elapsed": 1291.1944887638092 + }, + { + "step": 4080, + "loss": 0.4923543930053711, + "error": 0.2568359375, + "gradient_norm": 0.050325747579336166, + "elapsed": 1295.9372322559357 + }, + { + "step": 4096, + "loss": 0.44146978855133057, + "error": 0.2236328125, + "gradient_norm": 0.06535191088914871, + "elapsed": 1300.641023159027 + } + ] + }, + "derived_checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_optimizer_steps": [ + 2048, + 3072, + 4096 + ], + "source_training_run": "temporal2", + "source_weights_sha256": { + "2048": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "3072": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "4096": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea" + }, + "source_checkpoint_records": { + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "3072": { + "step": 3072, + "new_training_shots": 3145728, + "unique_training_rows_seen_in_this_phase": 1594502, + "weights": "weights-3072.npz", + "weights_sha256": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "validation": "validation-3072.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "weights_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "complete": true + }, + "mean4": { + "checkpoint_label": "mean4", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_optimizer_steps": [ + 1024, + 2048, + 3072, + 4096 + ], + "source_training_run": "temporal2", + "source_weights_sha256": { + "1024": "0d809362d5afe1dc781f716e3aee1a9bc5a8f75fed6cc0ff6339b9abcf600ada", + "2048": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "3072": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "4096": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "unique_training_rows_seen_in_this_phase": 804757, + "weights": "weights-1024.npz", + "weights_sha256": "0d809362d5afe1dc781f716e3aee1a9bc5a8f75fed6cc0ff6339b9abcf600ada", + "validation": "validation-1024.json", + "complete": true + }, + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "3072": { + "step": 3072, + "new_training_shots": 3145728, + "unique_training_rows_seen_in_this_phase": 1594502, + "weights": "weights-3072.npz", + "weights_sha256": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "validation": "validation-3072.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "weights_sha256": "ff4595e8f3eb7cfaa8da5a58a31e106d9684c7b8437f330573a1291f19f5777a", + "complete": true + } + }, + "selection": "Predefined last-three and all-four noninitial temporal2 checkpoint means; every validation condition evaluated before group selection", + "test_data_used": false, + "derivation_source_sha256": "b68813c7dab697a554185020c430ef05f1c35bedcda5b85b7d165af75461e914" + }, + "training_source_snapshot": "training_sources/temporal2_swa", + "selected_checkpoint_steps": [ + "mean3" + ], + "checkpoint_records": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_optimizer_steps": [ + 2048, + 3072, + 4096 + ], + "source_training_run": "temporal2", + "source_weights_sha256": { + "2048": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "3072": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "4096": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea" + }, + "source_checkpoint_records": { + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "3072": { + "step": 3072, + "new_training_shots": 3145728, + "unique_training_rows_seen_in_this_phase": 1594502, + "weights": "weights-3072.npz", + "weights_sha256": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "validation": "validation-3072.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "weights_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints; when listed, blend candidates average the recorded small-contextual reference and new probabilities equally", + "blend_reference": "/run-state/workspace/research/context_upgrades/continuation2/predictions", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.2445763221153846, + "mean3": 0.24451622596153846, + "mean4": 0.24484675480769236, + "blend-mean3": 0.24570312499999997, + "blend-mean4": 0.24591346153846153 + }, + "selected": "mean3" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2528545673076923, + "mean3": 0.25321514423076924, + "mean4": 0.2538611778846154, + "blend-mean3": 0.25310997596153845, + "blend-mean4": 0.2530498798076923 + }, + "selected": "incumbent" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.23366887019230773, + "mean3": 0.23392427884615385, + "mean4": 0.234375, + "blend-mean3": 0.2338792067307692, + "blend-mean4": 0.23404447115384613 + }, + "selected": "incumbent" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.23886718750000002, + "mean3": 0.23937800480769234, + "mean4": 0.2393780048076923, + "blend-mean3": 0.23942307692307693, + "blend-mean4": 0.2392578125 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24463641826923077, + "mean3": 0.24471153846153845, + "mean4": 0.24505709134615386, + "blend-mean3": 0.24580829326923076, + "blend-mean4": 0.2457782451923077 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.23652343749999996, + "mean3": 0.2379957932692308, + "mean4": 0.23756009615384613, + "blend-mean3": 0.23751502403846153, + "blend-mean4": 0.23737980769230768 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.23562199519230764, + "mean3": 0.23643329326923077, + "mean4": 0.2361177884615384, + "blend-mean3": 0.23662860576923078, + "blend-mean4": 0.23634314903846157 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.2329627403846154, + "mean3": 0.2335186298076923, + "mean4": 0.23344350961538457, + "blend-mean3": 0.23333834134615383, + "blend-mean4": 0.2334134615384615 + }, + "selected": "incumbent" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2325420673076923 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22017728365384615 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "condition_same1", + "training_run": { + "initialization": "Continue from this session's trained checkpoint", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "training_source_sha256": { + "learned_exact__temporal_accumulate_train.py": "9f672468a8b72966b3aa04fd22e5d40b47b0768f1c802c267a1da08244c4323b", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "eligible_training_shots": 2067520, + "unique_training_rows_seen_in_this_phase": 803777, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 11639, + "surface_code_bX_d3_r03_center_3_5": 10232, + "surface_code_bX_d3_r05_center_3_5": 9180, + "surface_code_bX_d3_r07_center_3_5": 10239, + "surface_code_bX_d3_r09_center_3_5": 6051, + "surface_code_bX_d3_r11_center_3_5": 8012, + "surface_code_bX_d3_r13_center_3_5": 6713, + "surface_code_bX_d3_r15_center_3_5": 6022, + "surface_code_bX_d3_r17_center_3_5": 7425, + "surface_code_bX_d3_r19_center_3_5": 8635, + "surface_code_bX_d3_r21_center_3_5": 10217, + "surface_code_bX_d3_r23_center_3_5": 6026, + "surface_code_bX_d3_r25_center_3_5": 4490, + "surface_code_bX_d3_r01_center_5_3": 7371, + "surface_code_bX_d3_r03_center_5_3": 5992, + "surface_code_bX_d3_r05_center_5_3": 6712, + "surface_code_bX_d3_r07_center_5_3": 6716, + "surface_code_bX_d3_r09_center_5_3": 7941, + "surface_code_bX_d3_r11_center_5_3": 6001, + "surface_code_bX_d3_r13_center_5_3": 8037, + "surface_code_bX_d3_r15_center_5_3": 8542, + "surface_code_bX_d3_r17_center_5_3": 10153, + "surface_code_bX_d3_r19_center_5_3": 10675, + "surface_code_bX_d3_r21_center_5_3": 7993, + "surface_code_bX_d3_r23_center_5_3": 6652, + "surface_code_bX_d3_r25_center_5_3": 8608, + "surface_code_bX_d3_r01_center_5_7": 8590, + "surface_code_bX_d3_r03_center_5_7": 11633, + "surface_code_bX_d3_r05_center_5_7": 8588, + "surface_code_bX_d3_r07_center_5_7": 10695, + "surface_code_bX_d3_r09_center_5_7": 7964, + "surface_code_bX_d3_r11_center_5_7": 11658, + "surface_code_bX_d3_r13_center_5_7": 6021, + "surface_code_bX_d3_r15_center_5_7": 9727, + "surface_code_bX_d3_r17_center_5_7": 4526, + "surface_code_bX_d3_r19_center_5_7": 9642, + "surface_code_bX_d3_r21_center_5_7": 3708, + "surface_code_bX_d3_r23_center_5_7": 6687, + "surface_code_bX_d3_r25_center_5_7": 7972, + "surface_code_bX_d3_r01_center_7_5": 6757, + "surface_code_bX_d3_r03_center_7_5": 6726, + "surface_code_bX_d3_r05_center_7_5": 4504, + "surface_code_bX_d3_r07_center_7_5": 8034, + "surface_code_bX_d3_r09_center_7_5": 8633, + "surface_code_bX_d3_r11_center_7_5": 11109, + "surface_code_bX_d3_r13_center_7_5": 9695, + "surface_code_bX_d3_r15_center_7_5": 7370, + "surface_code_bX_d3_r17_center_7_5": 7323, + "surface_code_bX_d3_r19_center_7_5": 10247, + "surface_code_bX_d3_r21_center_7_5": 6718, + "surface_code_bX_d3_r23_center_7_5": 8064, + "surface_code_bX_d3_r25_center_7_5": 8018, + "surface_code_bZ_d3_r01_center_3_5": 2856, + "surface_code_bZ_d3_r03_center_3_5": 6780, + "surface_code_bZ_d3_r05_center_3_5": 8610, + "surface_code_bZ_d3_r07_center_3_5": 9152, + "surface_code_bZ_d3_r09_center_3_5": 4522, + "surface_code_bZ_d3_r11_center_3_5": 3703, + "surface_code_bZ_d3_r13_center_3_5": 6001, + "surface_code_bZ_d3_r15_center_3_5": 7377, + "surface_code_bZ_d3_r17_center_3_5": 4517, + "surface_code_bZ_d3_r19_center_3_5": 10242, + "surface_code_bZ_d3_r21_center_3_5": 6747, + "surface_code_bZ_d3_r23_center_3_5": 7422, + "surface_code_bZ_d3_r25_center_3_5": 10606, + "surface_code_bZ_d3_r01_center_5_3": 5272, + "surface_code_bZ_d3_r03_center_5_3": 11200, + "surface_code_bZ_d3_r05_center_5_3": 4514, + "surface_code_bZ_d3_r07_center_5_3": 8002, + "surface_code_bZ_d3_r09_center_5_3": 8008, + "surface_code_bZ_d3_r11_center_5_3": 8689, + "surface_code_bZ_d3_r13_center_5_3": 8604, + "surface_code_bZ_d3_r15_center_5_3": 5981, + "surface_code_bZ_d3_r17_center_5_3": 5307, + "surface_code_bZ_d3_r19_center_5_3": 6713, + "surface_code_bZ_d3_r21_center_5_3": 8570, + "surface_code_bZ_d3_r23_center_5_3": 6700, + "surface_code_bZ_d3_r25_center_5_3": 10199, + "surface_code_bZ_d3_r01_center_5_7": 6730, + "surface_code_bZ_d3_r03_center_5_7": 7959, + "surface_code_bZ_d3_r05_center_5_7": 9741, + "surface_code_bZ_d3_r07_center_5_7": 10727, + "surface_code_bZ_d3_r09_center_5_7": 11979, + "surface_code_bZ_d3_r11_center_5_7": 3694, + "surface_code_bZ_d3_r13_center_5_7": 6746, + "surface_code_bZ_d3_r15_center_5_7": 6686, + "surface_code_bZ_d3_r17_center_5_7": 10647, + "surface_code_bZ_d3_r19_center_5_7": 8011, + "surface_code_bZ_d3_r21_center_5_7": 6000, + "surface_code_bZ_d3_r23_center_5_7": 9176, + "surface_code_bZ_d3_r25_center_5_7": 6009, + "surface_code_bZ_d3_r01_center_7_5": 9076, + "surface_code_bZ_d3_r03_center_7_5": 9182, + "surface_code_bZ_d3_r05_center_7_5": 6769, + "surface_code_bZ_d3_r07_center_7_5": 11140, + "surface_code_bZ_d3_r09_center_7_5": 7359, + "surface_code_bZ_d3_r11_center_7_5": 8582, + "surface_code_bZ_d3_r13_center_7_5": 5284, + "surface_code_bZ_d3_r15_center_7_5": 6694, + "surface_code_bZ_d3_r17_center_7_5": 5965, + "surface_code_bZ_d3_r19_center_7_5": 6016, + "surface_code_bZ_d3_r21_center_7_5": 9225, + "surface_code_bZ_d3_r23_center_7_5": 4509, + "surface_code_bZ_d3_r25_center_7_5": 6694 + }, + "steps": 1024, + "batch_size": 256, + "accumulate_conditions": 4, + "effective_batch_size": 1024, + "condition_policy": "same", + "training_draws": 1048576, + "condition_sampling": "Draw one condition index per microbatch in both arms; same-condition control reuses the first index while mixed arm uses all indices. Both arms consume identical RNG draws with equal-sized condition pools.", + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.00025, + "sampling_seed": 20261190, + "optimizer_restored": false, + "rng_restored": false, + "explicit_optimizer_reset": true, + "explicit_rng_reset": true, + "sampling_state_source": "Fresh NumPy default_rng seed 20261190", + "session_trained_starting_checkpoint": "/run-state/workspace/research/learned_exact/temporal2_swa/weights-mean3.npz", + "starting_checkpoint_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "starting_training_provenance": { + "initialization": "Uniform averages of the same session-trained temporal trajectory; no external weights", + "optimizer_updates_in_derived_run": 0, + "source_training_provenance": { + "initialization": "Continue from this session's trained checkpoint", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "training_source_sha256": { + "learned_exact__temporal_train.py": "7d48d2fc7f62d0bec3023b3df1c2ac28537d0417966131ae3a156697a34cda5f", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "eligible_training_shots": 2067520, + "unique_training_rows_seen_in_this_phase": 1778773, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 18357, + "surface_code_bX_d3_r03_center_3_5": 16816, + "surface_code_bX_d3_r05_center_3_5": 17999, + "surface_code_bX_d3_r07_center_3_5": 15225, + "surface_code_bX_d3_r09_center_3_5": 16132, + "surface_code_bX_d3_r11_center_3_5": 17041, + "surface_code_bX_d3_r13_center_3_5": 18477, + "surface_code_bX_d3_r15_center_3_5": 18214, + "surface_code_bX_d3_r17_center_3_5": 16505, + "surface_code_bX_d3_r19_center_3_5": 17120, + "surface_code_bX_d3_r21_center_3_5": 17563, + "surface_code_bX_d3_r23_center_3_5": 16681, + "surface_code_bX_d3_r25_center_3_5": 18379, + "surface_code_bX_d3_r01_center_5_3": 17450, + "surface_code_bX_d3_r03_center_5_3": 17161, + "surface_code_bX_d3_r05_center_5_3": 15797, + "surface_code_bX_d3_r07_center_5_3": 17800, + "surface_code_bX_d3_r09_center_5_3": 17190, + "surface_code_bX_d3_r11_center_5_3": 15840, + "surface_code_bX_d3_r13_center_5_3": 15178, + "surface_code_bX_d3_r15_center_5_3": 14897, + "surface_code_bX_d3_r17_center_5_3": 18252, + "surface_code_bX_d3_r19_center_5_3": 17083, + "surface_code_bX_d3_r21_center_5_3": 17229, + "surface_code_bX_d3_r23_center_5_3": 14735, + "surface_code_bX_d3_r25_center_5_3": 17949, + "surface_code_bX_d3_r01_center_5_7": 17431, + "surface_code_bX_d3_r03_center_5_7": 16583, + "surface_code_bX_d3_r05_center_5_7": 16891, + "surface_code_bX_d3_r07_center_5_7": 17969, + "surface_code_bX_d3_r09_center_5_7": 17966, + "surface_code_bX_d3_r11_center_5_7": 14424, + "surface_code_bX_d3_r13_center_5_7": 16930, + "surface_code_bX_d3_r15_center_5_7": 15205, + "surface_code_bX_d3_r17_center_5_7": 18252, + "surface_code_bX_d3_r19_center_5_7": 17077, + "surface_code_bX_d3_r21_center_5_7": 16770, + "surface_code_bX_d3_r23_center_5_7": 17308, + "surface_code_bX_d3_r25_center_5_7": 17481, + "surface_code_bX_d3_r01_center_7_5": 16630, + "surface_code_bX_d3_r03_center_7_5": 17439, + "surface_code_bX_d3_r05_center_7_5": 15811, + "surface_code_bX_d3_r07_center_7_5": 16637, + "surface_code_bX_d3_r09_center_7_5": 18306, + "surface_code_bX_d3_r11_center_7_5": 18327, + "surface_code_bX_d3_r13_center_7_5": 17974, + "surface_code_bX_d3_r15_center_7_5": 16106, + "surface_code_bX_d3_r17_center_7_5": 15834, + "surface_code_bX_d3_r19_center_7_5": 17242, + "surface_code_bX_d3_r21_center_7_5": 17889, + "surface_code_bX_d3_r23_center_7_5": 17440, + "surface_code_bX_d3_r25_center_7_5": 17087, + "surface_code_bZ_d3_r01_center_3_5": 16236, + "surface_code_bZ_d3_r03_center_3_5": 17278, + "surface_code_bZ_d3_r05_center_3_5": 16577, + "surface_code_bZ_d3_r07_center_3_5": 17376, + "surface_code_bZ_d3_r09_center_3_5": 16000, + "surface_code_bZ_d3_r11_center_3_5": 15634, + "surface_code_bZ_d3_r13_center_3_5": 14950, + "surface_code_bZ_d3_r15_center_3_5": 16600, + "surface_code_bZ_d3_r17_center_3_5": 15381, + "surface_code_bZ_d3_r19_center_3_5": 16823, + "surface_code_bZ_d3_r21_center_3_5": 18789, + "surface_code_bZ_d3_r23_center_3_5": 15616, + "surface_code_bZ_d3_r25_center_3_5": 17088, + "surface_code_bZ_d3_r01_center_5_3": 17935, + "surface_code_bZ_d3_r03_center_5_3": 16256, + "surface_code_bZ_d3_r05_center_5_3": 17959, + "surface_code_bZ_d3_r07_center_5_3": 18401, + "surface_code_bZ_d3_r09_center_5_3": 16405, + "surface_code_bZ_d3_r11_center_5_3": 17274, + "surface_code_bZ_d3_r13_center_5_3": 18172, + "surface_code_bZ_d3_r15_center_5_3": 17525, + "surface_code_bZ_d3_r17_center_5_3": 18643, + "surface_code_bZ_d3_r19_center_5_3": 17816, + "surface_code_bZ_d3_r21_center_5_3": 17404, + "surface_code_bZ_d3_r23_center_5_3": 17253, + "surface_code_bZ_d3_r25_center_5_3": 17667, + "surface_code_bZ_d3_r01_center_5_7": 16203, + "surface_code_bZ_d3_r03_center_5_7": 17214, + "surface_code_bZ_d3_r05_center_5_7": 16799, + "surface_code_bZ_d3_r07_center_5_7": 17896, + "surface_code_bZ_d3_r09_center_5_7": 16411, + "surface_code_bZ_d3_r11_center_5_7": 17726, + "surface_code_bZ_d3_r13_center_5_7": 16313, + "surface_code_bZ_d3_r15_center_5_7": 17824, + "surface_code_bZ_d3_r17_center_5_7": 15656, + "surface_code_bZ_d3_r19_center_5_7": 17169, + "surface_code_bZ_d3_r21_center_5_7": 17194, + "surface_code_bZ_d3_r23_center_5_7": 16779, + "surface_code_bZ_d3_r25_center_5_7": 16970, + "surface_code_bZ_d3_r01_center_7_5": 16762, + "surface_code_bZ_d3_r03_center_7_5": 17320, + "surface_code_bZ_d3_r05_center_7_5": 17522, + "surface_code_bZ_d3_r07_center_7_5": 17914, + "surface_code_bZ_d3_r09_center_7_5": 18439, + "surface_code_bZ_d3_r11_center_7_5": 18218, + "surface_code_bZ_d3_r13_center_7_5": 17907, + "surface_code_bZ_d3_r15_center_7_5": 17597, + "surface_code_bZ_d3_r17_center_7_5": 18252, + "surface_code_bZ_d3_r19_center_7_5": 18379, + "surface_code_bZ_d3_r21_center_7_5": 16818, + "surface_code_bZ_d3_r23_center_7_5": 18430, + "surface_code_bZ_d3_r25_center_7_5": 17924 + }, + "steps": 4096, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.0005, + "sampling_seed": 20261121, + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_exact/temporal1/rng-2048.json", + "session_trained_starting_checkpoint": "/run-state/workspace/research/learned_exact/temporal1/weights-2048.npz", + "starting_checkpoint_sha256": "26be9e0259b69a5870bf73e80a5a29fcf3519a3ff63e1d219c57a2113d9d34be", + "starting_training_provenance": { + "initialization": "Continue from rich weights trained from random initialization in this session; new temporal parameters randomly initialized now", + "original_initialization": "Rich network random seed20261030; new 32-channel temporal network random seed20261104; rich parameters retained, new input rows Normal(0,.001)", + "rich_starting_checkpoint": "/run-state/workspace/research/learned_exact/rich1/weights-1024.npz", + "rich_checkpoint_sha256": "04fea2cf8c598cd5587d450b50cdce58aee9a8c770a2c2da57d7a48e3bf3e2a6", + "architecture": "Rich 128-unit MLP plus 32-channel temporal encoder: four residual kernel3 convolutions with dilations1/2/4/8 and channel normalization. Receptive field31 rounds. Encoder sees events, measurements and presence masks. Per-edge 177 input features. Output4*tanh.", + "training": "Uniform condition sampling from all 104 d3 conditions; batch drawn from the supplied training split only", + "steps": 2048, + "batch_size": 1024, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "learning_rate": 0.001, + "sampling_seed": 20261111, + "optimizer_restored": false, + "rng_restored": false, + "session_trained_starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.6317505836486816, + "error": 0.3681640625, + "gradient_norm": 0.04013459011912346, + "elapsed": 30.971998691558838 + }, + { + "step": 16, + "loss": 0.5091081857681274, + "error": 0.291015625, + "gradient_norm": 0.042228709906339645, + "elapsed": 35.17463397979736 + }, + { + "step": 32, + "loss": 0.626472532749176, + "error": 0.3642578125, + "gradient_norm": 0.05872415751218796, + "elapsed": 39.678136110305786 + }, + { + "step": 48, + "loss": 0.6005369424819946, + "error": 0.3515625, + "gradient_norm": 0.03848014399409294, + "elapsed": 44.16946887969971 + }, + { + "step": 64, + "loss": 0.5523768663406372, + "error": 0.302734375, + "gradient_norm": 0.06031862646341324, + "elapsed": 48.65217089653015 + }, + { + "step": 80, + "loss": 0.3981674611568451, + "error": 0.19921875, + "gradient_norm": 0.0542079322040081, + "elapsed": 53.21601867675781 + }, + { + "step": 96, + "loss": 0.5601426362991333, + "error": 0.2978515625, + "gradient_norm": 0.04770371690392494, + "elapsed": 57.81089663505554 + }, + { + "step": 112, + "loss": 0.5878150463104248, + "error": 0.34765625, + "gradient_norm": 0.10699950158596039, + "elapsed": 62.42190766334534 + }, + { + "step": 128, + "loss": 0.5232458114624023, + "error": 0.2861328125, + "gradient_norm": 0.0911584198474884, + "elapsed": 67.00223755836487 + }, + { + "step": 144, + "loss": 0.6119767427444458, + "error": 0.3623046875, + "gradient_norm": 0.062474437057971954, + "elapsed": 71.54070782661438 + }, + { + "step": 160, + "loss": 0.3037984371185303, + "error": 0.1474609375, + "gradient_norm": 0.05718141421675682, + "elapsed": 76.08167362213135 + }, + { + "step": 176, + "loss": 0.6038273572921753, + "error": 0.3662109375, + "gradient_norm": 0.0437164381146431, + "elapsed": 80.71864247322083 + }, + { + "step": 192, + "loss": 0.3304370641708374, + "error": 0.1572265625, + "gradient_norm": 0.05684761330485344, + "elapsed": 85.54437017440796 + }, + { + "step": 208, + "loss": 0.5785484313964844, + "error": 0.3251953125, + "gradient_norm": 0.09597272425889969, + "elapsed": 91.51522874832153 + }, + { + "step": 224, + "loss": 0.3110499978065491, + "error": 0.13671875, + "gradient_norm": 0.04815748706459999, + "elapsed": 97.1228940486908 + }, + { + "step": 240, + "loss": 0.6213864684104919, + "error": 0.3623046875, + "gradient_norm": 0.0540502592921257, + "elapsed": 102.90286135673523 + }, + { + "step": 256, + "loss": 0.2535272240638733, + "error": 0.1064453125, + "gradient_norm": 0.029962118715047836, + "elapsed": 108.39288640022278 + }, + { + "step": 272, + "loss": 0.6126939058303833, + "error": 0.3671875, + "gradient_norm": 0.06887879222631454, + "elapsed": 113.83897161483765 + }, + { + "step": 288, + "loss": 0.4556676149368286, + "error": 0.2236328125, + "gradient_norm": 0.16127081215381622, + "elapsed": 119.93085813522339 + }, + { + "step": 304, + "loss": 0.4973585605621338, + "error": 0.255859375, + "gradient_norm": 0.08082302659749985, + "elapsed": 125.90891909599304 + }, + { + "step": 320, + "loss": 0.6455868482589722, + "error": 0.419921875, + "gradient_norm": 0.04339660331606865, + "elapsed": 131.20537638664246 + }, + { + "step": 336, + "loss": 0.5343132615089417, + "error": 0.2880859375, + "gradient_norm": 0.07518009096384048, + "elapsed": 136.59086871147156 + }, + { + "step": 352, + "loss": 0.6505346894264221, + "error": 0.4033203125, + "gradient_norm": 0.03800992667675018, + "elapsed": 142.21085906028748 + }, + { + "step": 368, + "loss": 0.4882712960243225, + "error": 0.251953125, + "gradient_norm": 0.08170920610427856, + "elapsed": 146.95903658866882 + }, + { + "step": 384, + "loss": 0.5292021036148071, + "error": 0.296875, + "gradient_norm": 0.08454013615846634, + "elapsed": 151.6385259628296 + }, + { + "step": 400, + "loss": 0.6272899508476257, + "error": 0.3837890625, + "gradient_norm": 0.051436979323625565, + "elapsed": 156.3343904018402 + }, + { + "step": 416, + "loss": 0.052130259573459625, + "error": 0.0166015625, + "gradient_norm": 0.02377190627157688, + "elapsed": 160.92345547676086 + }, + { + "step": 432, + "loss": 0.5256737470626831, + "error": 0.3046875, + "gradient_norm": 0.07986386120319366, + "elapsed": 165.52879118919373 + }, + { + "step": 448, + "loss": 0.15193665027618408, + "error": 0.0576171875, + "gradient_norm": 0.06491660326719284, + "elapsed": 170.14827823638916 + }, + { + "step": 464, + "loss": 0.6418055295944214, + "error": 0.40625, + "gradient_norm": 0.07290885597467422, + "elapsed": 174.64974284172058 + }, + { + "step": 480, + "loss": 0.6055159568786621, + "error": 0.357421875, + "gradient_norm": 0.0795595794916153, + "elapsed": 179.17218685150146 + }, + { + "step": 496, + "loss": 0.6372283697128296, + "error": 0.3916015625, + "gradient_norm": 0.04387903958559036, + "elapsed": 183.77568197250366 + }, + { + "step": 512, + "loss": 0.637977123260498, + "error": 0.408203125, + "gradient_norm": 0.060665905475616455, + "elapsed": 188.31205368041992 + }, + { + "step": 528, + "loss": 0.4668862223625183, + "error": 0.2451171875, + "gradient_norm": 0.08566711097955704, + "elapsed": 206.40719985961914 + }, + { + "step": 544, + "loss": 0.4584413170814514, + "error": 0.244140625, + "gradient_norm": 0.08538200706243515, + "elapsed": 211.02819895744324 + }, + { + "step": 560, + "loss": 0.5615692138671875, + "error": 0.3291015625, + "gradient_norm": 0.043748609721660614, + "elapsed": 215.66470766067505 + }, + { + "step": 576, + "loss": 0.5151895880699158, + "error": 0.2880859375, + "gradient_norm": 0.05164863541722298, + "elapsed": 220.18949556350708 + }, + { + "step": 592, + "loss": 0.5618112087249756, + "error": 0.3291015625, + "gradient_norm": 0.05998719856142998, + "elapsed": 224.7216100692749 + }, + { + "step": 608, + "loss": 0.659294843673706, + "error": 0.431640625, + "gradient_norm": 0.09910348802804947, + "elapsed": 229.26827573776245 + }, + { + "step": 624, + "loss": 0.5895233154296875, + "error": 0.3447265625, + "gradient_norm": 0.045334093272686005, + "elapsed": 233.83731055259705 + }, + { + "step": 640, + "loss": 0.6081801056861877, + "error": 0.3388671875, + "gradient_norm": 0.06578423827886581, + "elapsed": 238.36345624923706 + }, + { + "step": 656, + "loss": 0.5349816083908081, + "error": 0.2939453125, + "gradient_norm": 0.09989562630653381, + "elapsed": 242.95086026191711 + }, + { + "step": 672, + "loss": 0.5871994495391846, + "error": 0.328125, + "gradient_norm": 0.08132346719503403, + "elapsed": 247.67088556289673 + }, + { + "step": 688, + "loss": 0.06012660637497902, + "error": 0.0146484375, + "gradient_norm": 0.012170507572591305, + "elapsed": 252.3202247619629 + }, + { + "step": 704, + "loss": 0.42179757356643677, + "error": 0.21484375, + "gradient_norm": 0.08384513854980469, + "elapsed": 256.91991782188416 + }, + { + "step": 720, + "loss": 0.6111758947372437, + "error": 0.3720703125, + "gradient_norm": 0.06689880788326263, + "elapsed": 261.56407928466797 + }, + { + "step": 736, + "loss": 0.29969727993011475, + "error": 0.1318359375, + "gradient_norm": 0.0743367150425911, + "elapsed": 266.22199630737305 + }, + { + "step": 752, + "loss": 0.051849883049726486, + "error": 0.0166015625, + "gradient_norm": 0.017005126923322678, + "elapsed": 270.8602342605591 + }, + { + "step": 768, + "loss": 0.6178420186042786, + "error": 0.3759765625, + "gradient_norm": 0.027732960879802704, + "elapsed": 275.47888374328613 + }, + { + "step": 784, + "loss": 0.45798996090888977, + "error": 0.228515625, + "gradient_norm": 0.0630083829164505, + "elapsed": 280.1709156036377 + }, + { + "step": 800, + "loss": 0.5104988813400269, + "error": 0.2724609375, + "gradient_norm": 0.041733670979738235, + "elapsed": 286.17937707901 + }, + { + "step": 816, + "loss": 0.6336112022399902, + "error": 0.3837890625, + "gradient_norm": 0.0755191296339035, + "elapsed": 291.7506103515625 + }, + { + "step": 832, + "loss": 0.6260952353477478, + "error": 0.3603515625, + "gradient_norm": 0.0318005345761776, + "elapsed": 297.31094622612 + }, + { + "step": 848, + "loss": 0.5870074033737183, + "error": 0.3525390625, + "gradient_norm": 0.12073405832052231, + "elapsed": 303.11089158058167 + }, + { + "step": 864, + "loss": 0.5125640034675598, + "error": 0.26953125, + "gradient_norm": 0.038650237023830414, + "elapsed": 308.7288725376129 + }, + { + "step": 880, + "loss": 0.19194915890693665, + "error": 0.0703125, + "gradient_norm": 0.061878547072410583, + "elapsed": 314.37042355537415 + }, + { + "step": 896, + "loss": 0.5409250259399414, + "error": 0.2919921875, + "gradient_norm": 0.06288820505142212, + "elapsed": 319.9398190975189 + }, + { + "step": 912, + "loss": 0.6164936423301697, + "error": 0.3701171875, + "gradient_norm": 0.043224163353443146, + "elapsed": 325.361323595047 + }, + { + "step": 928, + "loss": 0.16032151877880096, + "error": 0.0625, + "gradient_norm": 0.030957572162151337, + "elapsed": 331.21752285957336 + }, + { + "step": 944, + "loss": 0.646601676940918, + "error": 0.3818359375, + "gradient_norm": 0.05670839175581932, + "elapsed": 336.7825517654419 + }, + { + "step": 960, + "loss": 0.402952641248703, + "error": 0.1865234375, + "gradient_norm": 0.07500886172056198, + "elapsed": 342.6888346672058 + }, + { + "step": 976, + "loss": 0.5537433624267578, + "error": 0.2939453125, + "gradient_norm": 0.04955969750881195, + "elapsed": 348.5554690361023 + }, + { + "step": 992, + "loss": 0.559626579284668, + "error": 0.294921875, + "gradient_norm": 0.048295993357896805, + "elapsed": 354.3531894683838 + }, + { + "step": 1008, + "loss": 0.5034694671630859, + "error": 0.2705078125, + "gradient_norm": 0.05729879066348076, + "elapsed": 360.0949149131775 + }, + { + "step": 1024, + "loss": 0.3119734525680542, + "error": 0.1259765625, + "gradient_norm": 0.052326612174510956, + "elapsed": 365.7881224155426 + }, + { + "step": 1040, + "loss": 0.35799849033355713, + "error": 0.173828125, + "gradient_norm": 0.03801804035902023, + "elapsed": 386.5749418735504 + }, + { + "step": 1056, + "loss": 0.6178948879241943, + "error": 0.3515625, + "gradient_norm": 0.03620661422610283, + "elapsed": 391.48247838020325 + }, + { + "step": 1072, + "loss": 0.49231401085853577, + "error": 0.24609375, + "gradient_norm": 0.04391559213399887, + "elapsed": 396.08718824386597 + }, + { + "step": 1088, + "loss": 0.4119300842285156, + "error": 0.2001953125, + "gradient_norm": 0.1104700043797493, + "elapsed": 400.5326828956604 + }, + { + "step": 1104, + "loss": 0.4926626682281494, + "error": 0.265625, + "gradient_norm": 0.04246886447072029, + "elapsed": 404.95741271972656 + }, + { + "step": 1120, + "loss": 0.5027930736541748, + "error": 0.2607421875, + "gradient_norm": 0.0547240674495697, + "elapsed": 409.40319633483887 + }, + { + "step": 1136, + "loss": 0.5948058366775513, + "error": 0.3544921875, + "gradient_norm": 0.06810063123703003, + "elapsed": 413.8514006137848 + }, + { + "step": 1152, + "loss": 0.26567256450653076, + "error": 0.125, + "gradient_norm": 0.06689104437828064, + "elapsed": 418.29868721961975 + }, + { + "step": 1168, + "loss": 0.2866836190223694, + "error": 0.1240234375, + "gradient_norm": 0.029536213725805283, + "elapsed": 422.75131845474243 + }, + { + "step": 1184, + "loss": 0.6342021822929382, + "error": 0.4091796875, + "gradient_norm": 0.0704190731048584, + "elapsed": 427.1991722583771 + }, + { + "step": 1200, + "loss": 0.41626787185668945, + "error": 0.212890625, + "gradient_norm": 0.04480795934796333, + "elapsed": 431.6600706577301 + }, + { + "step": 1216, + "loss": 0.28460952639579773, + "error": 0.1337890625, + "gradient_norm": 0.03666983172297478, + "elapsed": 436.14414525032043 + }, + { + "step": 1232, + "loss": 0.044482216238975525, + "error": 0.0146484375, + "gradient_norm": 0.04537617415189743, + "elapsed": 440.6220428943634 + }, + { + "step": 1248, + "loss": 0.42564862966537476, + "error": 0.2119140625, + "gradient_norm": 0.03382417559623718, + "elapsed": 445.06736421585083 + }, + { + "step": 1264, + "loss": 0.27150213718414307, + "error": 0.123046875, + "gradient_norm": 0.033046118915081024, + "elapsed": 449.544029712677 + }, + { + "step": 1280, + "loss": 0.4927375912666321, + "error": 0.255859375, + "gradient_norm": 0.06812550127506256, + "elapsed": 454.07198667526245 + }, + { + "step": 1296, + "loss": 0.5541940927505493, + "error": 0.28125, + "gradient_norm": 0.1435294896364212, + "elapsed": 458.6031415462494 + }, + { + "step": 1312, + "loss": 0.5575842261314392, + "error": 0.2958984375, + "gradient_norm": 0.03811952844262123, + "elapsed": 463.1806228160858 + }, + { + "step": 1328, + "loss": 0.3479428291320801, + "error": 0.1591796875, + "gradient_norm": 0.0709012895822525, + "elapsed": 467.84689688682556 + }, + { + "step": 1344, + "loss": 0.1685580611228943, + "error": 0.0693359375, + "gradient_norm": 0.05423415079712868, + "elapsed": 472.6908576488495 + }, + { + "step": 1360, + "loss": 0.18506410717964172, + "error": 0.0771484375, + "gradient_norm": 0.03418596833944321, + "elapsed": 477.4269769191742 + }, + { + "step": 1376, + "loss": 0.5654555559158325, + "error": 0.3173828125, + "gradient_norm": 0.0685155838727951, + "elapsed": 482.08285188674927 + }, + { + "step": 1392, + "loss": 0.6116407513618469, + "error": 0.3603515625, + "gradient_norm": 0.05198948457837105, + "elapsed": 486.7167499065399 + }, + { + "step": 1408, + "loss": 0.4014682471752167, + "error": 0.19140625, + "gradient_norm": 0.1024075523018837, + "elapsed": 491.4308760166168 + }, + { + "step": 1424, + "loss": 0.051035866141319275, + "error": 0.0166015625, + "gradient_norm": 0.010207361541688442, + "elapsed": 496.1818380355835 + }, + { + "step": 1440, + "loss": 0.4725648760795593, + "error": 0.2412109375, + "gradient_norm": 0.03977378085255623, + "elapsed": 500.8668632507324 + }, + { + "step": 1456, + "loss": 0.5407818555831909, + "error": 0.2939453125, + "gradient_norm": 0.088577501475811, + "elapsed": 505.49274134635925 + }, + { + "step": 1472, + "loss": 0.5655064582824707, + "error": 0.3076171875, + "gradient_norm": 0.04452778398990631, + "elapsed": 510.2188584804535 + }, + { + "step": 1488, + "loss": 0.5799556374549866, + "error": 0.30859375, + "gradient_norm": 0.03976206108927727, + "elapsed": 514.9319434165955 + }, + { + "step": 1504, + "loss": 0.4660354256629944, + "error": 0.25390625, + "gradient_norm": 0.04365506023168564, + "elapsed": 519.5848798751831 + }, + { + "step": 1520, + "loss": 0.5505894422531128, + "error": 0.30859375, + "gradient_norm": 0.057772211730480194, + "elapsed": 524.3388590812683 + }, + { + "step": 1536, + "loss": 0.6251416206359863, + "error": 0.400390625, + "gradient_norm": 0.09649194777011871, + "elapsed": 529.483047246933 + }, + { + "step": 1552, + "loss": 0.05424533039331436, + "error": 0.0185546875, + "gradient_norm": 0.011683990247547626, + "elapsed": 548.1828610897064 + }, + { + "step": 1568, + "loss": 0.33612310886383057, + "error": 0.1611328125, + "gradient_norm": 0.051817383617162704, + "elapsed": 553.4256420135498 + }, + { + "step": 1584, + "loss": 0.045015305280685425, + "error": 0.0166015625, + "gradient_norm": 0.022604886442422867, + "elapsed": 558.6308543682098 + }, + { + "step": 1600, + "loss": 0.2701840102672577, + "error": 0.119140625, + "gradient_norm": 0.02910422720015049, + "elapsed": 563.8571691513062 + }, + { + "step": 1616, + "loss": 0.18982334434986115, + "error": 0.0849609375, + "gradient_norm": 0.025524422526359558, + "elapsed": 568.8628678321838 + }, + { + "step": 1632, + "loss": 0.3950161337852478, + "error": 0.185546875, + "gradient_norm": 0.08419577777385712, + "elapsed": 574.0815451145172 + }, + { + "step": 1648, + "loss": 0.49384528398513794, + "error": 0.255859375, + "gradient_norm": 0.08879344165325165, + "elapsed": 579.1229114532471 + }, + { + "step": 1664, + "loss": 0.5671384930610657, + "error": 0.3115234375, + "gradient_norm": 0.05374513566493988, + "elapsed": 584.114851474762 + }, + { + "step": 1680, + "loss": 0.6192574501037598, + "error": 0.37890625, + "gradient_norm": 0.043836336582899094, + "elapsed": 589.0708522796631 + }, + { + "step": 1696, + "loss": 0.2619469463825226, + "error": 0.1171875, + "gradient_norm": 0.040093280375003815, + "elapsed": 594.2814819812775 + }, + { + "step": 1712, + "loss": 0.33178141713142395, + "error": 0.162109375, + "gradient_norm": 0.04902712255716324, + "elapsed": 599.3068840503693 + }, + { + "step": 1728, + "loss": 0.385281503200531, + "error": 0.171875, + "gradient_norm": 0.03541380167007446, + "elapsed": 604.5308682918549 + }, + { + "step": 1744, + "loss": 0.1628715693950653, + "error": 0.0693359375, + "gradient_norm": 0.06111741065979004, + "elapsed": 609.309522151947 + }, + { + "step": 1760, + "loss": 0.5239119529724121, + "error": 0.2861328125, + "gradient_norm": 0.08513613045215607, + "elapsed": 614.0396001338959 + }, + { + "step": 1776, + "loss": 0.35721707344055176, + "error": 0.150390625, + "gradient_norm": 0.06337940692901611, + "elapsed": 618.6857132911682 + }, + { + "step": 1792, + "loss": 0.5985626578330994, + "error": 0.33203125, + "gradient_norm": 0.035725343972444534, + "elapsed": 623.3352344036102 + }, + { + "step": 1808, + "loss": 0.34676820039749146, + "error": 0.15234375, + "gradient_norm": 0.08163885772228241, + "elapsed": 627.9495220184326 + }, + { + "step": 1824, + "loss": 0.5633711814880371, + "error": 0.3037109375, + "gradient_norm": 0.05938677117228508, + "elapsed": 632.5820379257202 + }, + { + "step": 1840, + "loss": 0.6256523132324219, + "error": 0.384765625, + "gradient_norm": 0.04545137286186218, + "elapsed": 637.205274105072 + }, + { + "step": 1856, + "loss": 0.28091639280319214, + "error": 0.1298828125, + "gradient_norm": 0.04705077037215233, + "elapsed": 641.883561372757 + }, + { + "step": 1872, + "loss": 0.516182541847229, + "error": 0.263671875, + "gradient_norm": 0.08828777819871902, + "elapsed": 646.5188939571381 + }, + { + "step": 1888, + "loss": 0.48386621475219727, + "error": 0.25390625, + "gradient_norm": 0.05322824418544769, + "elapsed": 651.148512840271 + }, + { + "step": 1904, + "loss": 0.6141921281814575, + "error": 0.388671875, + "gradient_norm": 0.050139278173446655, + "elapsed": 655.7796437740326 + }, + { + "step": 1920, + "loss": 0.18002840876579285, + "error": 0.0712890625, + "gradient_norm": 0.04201133921742439, + "elapsed": 660.4064948558807 + }, + { + "step": 1936, + "loss": 0.17531852424144745, + "error": 0.0732421875, + "gradient_norm": 0.024726318195462227, + "elapsed": 664.9991583824158 + }, + { + "step": 1952, + "loss": 0.5088322758674622, + "error": 0.2744140625, + "gradient_norm": 0.04693225398659706, + "elapsed": 669.5544555187225 + }, + { + "step": 1968, + "loss": 0.5684165358543396, + "error": 0.3310546875, + "gradient_norm": 0.031029095873236656, + "elapsed": 674.2354445457458 + }, + { + "step": 1984, + "loss": 0.06459524482488632, + "error": 0.017578125, + "gradient_norm": 0.03600892797112465, + "elapsed": 678.7982559204102 + }, + { + "step": 2000, + "loss": 0.3614455461502075, + "error": 0.1748046875, + "gradient_norm": 0.07060294598340988, + "elapsed": 683.2650325298309 + }, + { + "step": 2016, + "loss": 0.35535523295402527, + "error": 0.166015625, + "gradient_norm": 0.05873403698205948, + "elapsed": 687.7125518321991 + }, + { + "step": 2032, + "loss": 0.5638720989227295, + "error": 0.3232421875, + "gradient_norm": 0.07380504906177521, + "elapsed": 692.1461188793182 + }, + { + "step": 2048, + "loss": 0.5301838517189026, + "error": 0.2919921875, + "gradient_norm": 0.05435395985841751, + "elapsed": 696.6235508918762 + } + ] + }, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.250907301902771, + "error": 0.1083984375, + "gradient_norm": 0.07171476632356644, + "elapsed": 44.811134576797485 + }, + { + "step": 16, + "loss": 0.5958679914474487, + "error": 0.3662109375, + "gradient_norm": 0.07673005014657974, + "elapsed": 49.90856671333313 + }, + { + "step": 32, + "loss": 0.47648972272872925, + "error": 0.2421875, + "gradient_norm": 0.08561501652002335, + "elapsed": 55.179388761520386 + }, + { + "step": 48, + "loss": 0.06145006790757179, + "error": 0.0234375, + "gradient_norm": 0.01556467730551958, + "elapsed": 61.0339195728302 + }, + { + "step": 64, + "loss": 0.3687053918838501, + "error": 0.1884765625, + "gradient_norm": 0.08752371370792389, + "elapsed": 65.95811891555786 + }, + { + "step": 80, + "loss": 0.6481984853744507, + "error": 0.4140625, + "gradient_norm": 0.05311283841729164, + "elapsed": 70.56021332740784 + }, + { + "step": 96, + "loss": 0.42319929599761963, + "error": 0.2138671875, + "gradient_norm": 0.05047478526830673, + "elapsed": 75.11613631248474 + }, + { + "step": 112, + "loss": 0.47527259588241577, + "error": 0.24609375, + "gradient_norm": 0.038366906344890594, + "elapsed": 79.53446984291077 + }, + { + "step": 128, + "loss": 0.5996723175048828, + "error": 0.3369140625, + "gradient_norm": 0.1213272362947464, + "elapsed": 83.97515749931335 + }, + { + "step": 144, + "loss": 0.04971993714570999, + "error": 0.0146484375, + "gradient_norm": 0.008080735802650452, + "elapsed": 88.44039463996887 + }, + { + "step": 160, + "loss": 0.35900360345840454, + "error": 0.162109375, + "gradient_norm": 0.03359593451023102, + "elapsed": 92.89548206329346 + }, + { + "step": 176, + "loss": 0.5342063903808594, + "error": 0.2978515625, + "gradient_norm": 0.04794691130518913, + "elapsed": 97.35658049583435 + }, + { + "step": 192, + "loss": 0.6300076246261597, + "error": 0.369140625, + "gradient_norm": 0.081769198179245, + "elapsed": 101.81493759155273 + }, + { + "step": 208, + "loss": 0.6191903948783875, + "error": 0.3828125, + "gradient_norm": 0.07145775109529495, + "elapsed": 106.2480263710022 + }, + { + "step": 224, + "loss": 0.5155678391456604, + "error": 0.28515625, + "gradient_norm": 0.06772179156541824, + "elapsed": 110.71284222602844 + }, + { + "step": 240, + "loss": 0.634708046913147, + "error": 0.3857421875, + "gradient_norm": 0.09493093192577362, + "elapsed": 115.14978742599487 + }, + { + "step": 256, + "loss": 0.1840895414352417, + "error": 0.0751953125, + "gradient_norm": 0.025586696341633797, + "elapsed": 119.61202120780945 + }, + { + "step": 272, + "loss": 0.2775103449821472, + "error": 0.12890625, + "gradient_norm": 0.06913147866725922, + "elapsed": 124.02584528923035 + }, + { + "step": 288, + "loss": 0.6163080334663391, + "error": 0.3642578125, + "gradient_norm": 0.05895426496863365, + "elapsed": 128.46512532234192 + }, + { + "step": 304, + "loss": 0.5276986360549927, + "error": 0.287109375, + "gradient_norm": 0.06955187022686005, + "elapsed": 132.89240765571594 + }, + { + "step": 320, + "loss": 0.44859516620635986, + "error": 0.22265625, + "gradient_norm": 0.07272452116012573, + "elapsed": 137.32864713668823 + }, + { + "step": 336, + "loss": 0.48315611481666565, + "error": 0.2626953125, + "gradient_norm": 0.03321139141917229, + "elapsed": 141.80009770393372 + }, + { + "step": 352, + "loss": 0.6107717752456665, + "error": 0.3544921875, + "gradient_norm": 0.05243214592337608, + "elapsed": 146.36439752578735 + }, + { + "step": 368, + "loss": 0.6215153932571411, + "error": 0.357421875, + "gradient_norm": 0.04383325204253197, + "elapsed": 150.99996852874756 + }, + { + "step": 384, + "loss": 0.6130329966545105, + "error": 0.35546875, + "gradient_norm": 0.04113119840621948, + "elapsed": 155.62374639511108 + }, + { + "step": 400, + "loss": 0.30471885204315186, + "error": 0.142578125, + "gradient_norm": 0.04447556659579277, + "elapsed": 160.17594957351685 + }, + { + "step": 416, + "loss": 0.6154489517211914, + "error": 0.37109375, + "gradient_norm": 0.04456057772040367, + "elapsed": 164.7639675140381 + }, + { + "step": 432, + "loss": 0.6134694218635559, + "error": 0.337890625, + "gradient_norm": 0.04219559207558632, + "elapsed": 169.32792139053345 + }, + { + "step": 448, + "loss": 0.5463185906410217, + "error": 0.2939453125, + "gradient_norm": 0.07746092975139618, + "elapsed": 173.88445162773132 + }, + { + "step": 464, + "loss": 0.06016772612929344, + "error": 0.01953125, + "gradient_norm": 0.01364185381680727, + "elapsed": 178.42725706100464 + }, + { + "step": 480, + "loss": 0.388141393661499, + "error": 0.18359375, + "gradient_norm": 0.04870256036520004, + "elapsed": 182.99062085151672 + }, + { + "step": 496, + "loss": 0.44524821639060974, + "error": 0.2216796875, + "gradient_norm": 0.03453445807099342, + "elapsed": 187.56396961212158 + }, + { + "step": 512, + "loss": 0.34312355518341064, + "error": 0.154296875, + "gradient_norm": 0.06794509291648865, + "elapsed": 192.27511191368103 + }, + { + "step": 528, + "loss": 0.19467462599277496, + "error": 0.0771484375, + "gradient_norm": 0.042381469160318375, + "elapsed": 197.7108268737793 + }, + { + "step": 544, + "loss": 0.46226584911346436, + "error": 0.2421875, + "gradient_norm": 0.06073570251464844, + "elapsed": 202.97405791282654 + }, + { + "step": 560, + "loss": 0.525318443775177, + "error": 0.2822265625, + "gradient_norm": 0.06954885274171829, + "elapsed": 208.69676971435547 + }, + { + "step": 576, + "loss": 0.6158387064933777, + "error": 0.349609375, + "gradient_norm": 0.07587578892707825, + "elapsed": 214.80397653579712 + }, + { + "step": 592, + "loss": 0.5515886545181274, + "error": 0.298828125, + "gradient_norm": 0.04969338700175285, + "elapsed": 220.27399611473083 + }, + { + "step": 608, + "loss": 0.18365338444709778, + "error": 0.0654296875, + "gradient_norm": 0.08657706528902054, + "elapsed": 224.81246256828308 + }, + { + "step": 624, + "loss": 0.4578855633735657, + "error": 0.2421875, + "gradient_norm": 0.04942100867629051, + "elapsed": 229.45902252197266 + }, + { + "step": 640, + "loss": 0.37826013565063477, + "error": 0.1865234375, + "gradient_norm": 0.047499872744083405, + "elapsed": 233.9695644378662 + }, + { + "step": 656, + "loss": 0.40863412618637085, + "error": 0.2001953125, + "gradient_norm": 0.07845330238342285, + "elapsed": 238.584894657135 + }, + { + "step": 672, + "loss": 0.5640332698822021, + "error": 0.2880859375, + "gradient_norm": 0.057469289749860764, + "elapsed": 243.0929844379425 + }, + { + "step": 688, + "loss": 0.030216243118047714, + "error": 0.0078125, + "gradient_norm": 0.04682641476392746, + "elapsed": 247.581125497818 + }, + { + "step": 704, + "loss": 0.375002384185791, + "error": 0.1826171875, + "gradient_norm": 0.04864194989204407, + "elapsed": 252.1564691066742 + }, + { + "step": 720, + "loss": 0.5145515203475952, + "error": 0.2744140625, + "gradient_norm": 0.052671682089567184, + "elapsed": 256.6466488838196 + }, + { + "step": 736, + "loss": 0.067174531519413, + "error": 0.0224609375, + "gradient_norm": 0.019299577921628952, + "elapsed": 261.1185076236725 + }, + { + "step": 752, + "loss": 0.24909992516040802, + "error": 0.111328125, + "gradient_norm": 0.06907463818788528, + "elapsed": 265.61960339546204 + }, + { + "step": 768, + "loss": 0.5088074207305908, + "error": 0.2744140625, + "gradient_norm": 0.06963017582893372, + "elapsed": 270.07474064826965 + }, + { + "step": 784, + "loss": 0.3783387839794159, + "error": 0.1826171875, + "gradient_norm": 0.05537794530391693, + "elapsed": 274.52722239494324 + }, + { + "step": 800, + "loss": 0.6107200980186462, + "error": 0.3623046875, + "gradient_norm": 0.0470259003341198, + "elapsed": 279.0401859283447 + }, + { + "step": 816, + "loss": 0.5778236389160156, + "error": 0.3212890625, + "gradient_norm": 0.10146680474281311, + "elapsed": 283.5114622116089 + }, + { + "step": 832, + "loss": 0.576002299785614, + "error": 0.3076171875, + "gradient_norm": 0.07760787010192871, + "elapsed": 288.04797434806824 + }, + { + "step": 848, + "loss": 0.6179666519165039, + "error": 0.3740234375, + "gradient_norm": 0.07383852452039719, + "elapsed": 292.60600209236145 + }, + { + "step": 864, + "loss": 0.3105512857437134, + "error": 0.1455078125, + "gradient_norm": 0.052953749895095825, + "elapsed": 297.12180352211 + }, + { + "step": 880, + "loss": 0.4802623987197876, + "error": 0.2548828125, + "gradient_norm": 0.07736275345087051, + "elapsed": 301.6091134548187 + }, + { + "step": 896, + "loss": 0.5572722554206848, + "error": 0.318359375, + "gradient_norm": 0.053303152322769165, + "elapsed": 306.1978073120117 + }, + { + "step": 912, + "loss": 0.34814420342445374, + "error": 0.1669921875, + "gradient_norm": 0.037726350128650665, + "elapsed": 310.78571581840515 + }, + { + "step": 928, + "loss": 0.41743016242980957, + "error": 0.21875, + "gradient_norm": 0.05238872766494751, + "elapsed": 315.24156188964844 + }, + { + "step": 944, + "loss": 0.5757850408554077, + "error": 0.3173828125, + "gradient_norm": 0.05837905779480934, + "elapsed": 319.78475165367126 + }, + { + "step": 960, + "loss": 0.40727972984313965, + "error": 0.197265625, + "gradient_norm": 0.059294261038303375, + "elapsed": 324.2090265750885 + }, + { + "step": 976, + "loss": 0.32715001702308655, + "error": 0.1533203125, + "gradient_norm": 0.11543179303407669, + "elapsed": 328.6462152004242 + }, + { + "step": 992, + "loss": 0.5578742623329163, + "error": 0.314453125, + "gradient_norm": 0.06282714009284973, + "elapsed": 333.0712504386902 + }, + { + "step": 1008, + "loss": 0.5052692294120789, + "error": 0.265625, + "gradient_norm": 0.04039420187473297, + "elapsed": 337.5182821750641 + }, + { + "step": 1024, + "loss": 0.18790806829929352, + "error": 0.08203125, + "gradient_norm": 0.028905188664793968, + "elapsed": 342.08340406417847 + }, + { + "step": 1040, + "loss": 0.6317684650421143, + "error": 0.3681640625, + "gradient_norm": 0.03441835194826126, + "elapsed": 358.8279616832733 + }, + { + "step": 1056, + "loss": 0.40474164485931396, + "error": 0.2021484375, + "gradient_norm": 0.036449309438467026, + "elapsed": 363.30218267440796 + }, + { + "step": 1072, + "loss": 0.518299400806427, + "error": 0.2666015625, + "gradient_norm": 0.0886964276432991, + "elapsed": 367.87997555732727 + }, + { + "step": 1088, + "loss": 0.2522922158241272, + "error": 0.099609375, + "gradient_norm": 0.07553310692310333, + "elapsed": 372.4414882659912 + }, + { + "step": 1104, + "loss": 0.6214810609817505, + "error": 0.3701171875, + "gradient_norm": 0.10188957303762436, + "elapsed": 376.9120502471924 + }, + { + "step": 1120, + "loss": 0.6307054162025452, + "error": 0.3720703125, + "gradient_norm": 0.07353860139846802, + "elapsed": 381.3824534416199 + }, + { + "step": 1136, + "loss": 0.5259381532669067, + "error": 0.2763671875, + "gradient_norm": 0.05779678374528885, + "elapsed": 385.8413143157959 + }, + { + "step": 1152, + "loss": 0.4995541572570801, + "error": 0.259765625, + "gradient_norm": 0.046648140996694565, + "elapsed": 390.28326058387756 + }, + { + "step": 1168, + "loss": 0.6075694561004639, + "error": 0.3701171875, + "gradient_norm": 0.10612073540687561, + "elapsed": 394.8162364959717 + }, + { + "step": 1184, + "loss": 0.2105136513710022, + "error": 0.080078125, + "gradient_norm": 0.0716402605175972, + "elapsed": 399.2960283756256 + }, + { + "step": 1200, + "loss": 0.6371631026268005, + "error": 0.3857421875, + "gradient_norm": 0.0549108125269413, + "elapsed": 403.7899103164673 + }, + { + "step": 1216, + "loss": 0.5450670719146729, + "error": 0.2939453125, + "gradient_norm": 0.11688558012247086, + "elapsed": 408.34677600860596 + }, + { + "step": 1232, + "loss": 0.035783201456069946, + "error": 0.01171875, + "gradient_norm": 0.02951689623296261, + "elapsed": 412.8558337688446 + }, + { + "step": 1248, + "loss": 0.5582903623580933, + "error": 0.3046875, + "gradient_norm": 0.055107031017541885, + "elapsed": 417.29854226112366 + }, + { + "step": 1264, + "loss": 0.5154441595077515, + "error": 0.27734375, + "gradient_norm": 0.04474929720163345, + "elapsed": 421.7792055606842 + }, + { + "step": 1280, + "loss": 0.35227546095848083, + "error": 0.16015625, + "gradient_norm": 0.05024837702512741, + "elapsed": 426.54427456855774 + }, + { + "step": 1296, + "loss": 0.19417589902877808, + "error": 0.0830078125, + "gradient_norm": 0.026926057413220406, + "elapsed": 431.320588350296 + }, + { + "step": 1312, + "loss": 0.4768218398094177, + "error": 0.248046875, + "gradient_norm": 0.15099607408046722, + "elapsed": 435.96817326545715 + }, + { + "step": 1328, + "loss": 0.48580923676490784, + "error": 0.2509765625, + "gradient_norm": 0.08925126492977142, + "elapsed": 440.64917039871216 + }, + { + "step": 1344, + "loss": 0.42041274905204773, + "error": 0.1982421875, + "gradient_norm": 0.08321093022823334, + "elapsed": 445.34370946884155 + }, + { + "step": 1360, + "loss": 0.06403929740190506, + "error": 0.0185546875, + "gradient_norm": 0.03817005455493927, + "elapsed": 449.98669385910034 + }, + { + "step": 1376, + "loss": 0.463126003742218, + "error": 0.2275390625, + "gradient_norm": 0.08894515782594681, + "elapsed": 454.6478977203369 + }, + { + "step": 1392, + "loss": 0.5995306968688965, + "error": 0.373046875, + "gradient_norm": 0.06733685731887817, + "elapsed": 459.35924530029297 + }, + { + "step": 1408, + "loss": 0.49053263664245605, + "error": 0.25, + "gradient_norm": 0.10475508868694305, + "elapsed": 464.100093126297 + }, + { + "step": 1424, + "loss": 0.6220744848251343, + "error": 0.3818359375, + "gradient_norm": 0.03653963655233383, + "elapsed": 468.89601135253906 + }, + { + "step": 1440, + "loss": 0.39706122875213623, + "error": 0.2021484375, + "gradient_norm": 0.04344598576426506, + "elapsed": 474.03999519348145 + }, + { + "step": 1456, + "loss": 0.5386708974838257, + "error": 0.3095703125, + "gradient_norm": 0.12589037418365479, + "elapsed": 478.8600504398346 + }, + { + "step": 1472, + "loss": 0.49776726961135864, + "error": 0.271484375, + "gradient_norm": 0.058137863874435425, + "elapsed": 483.5920066833496 + }, + { + "step": 1488, + "loss": 0.4757428765296936, + "error": 0.2412109375, + "gradient_norm": 0.050453316420316696, + "elapsed": 488.4611999988556 + }, + { + "step": 1504, + "loss": 0.5694847702980042, + "error": 0.337890625, + "gradient_norm": 0.052419569343328476, + "elapsed": 493.26151037216187 + }, + { + "step": 1520, + "loss": 0.5997745990753174, + "error": 0.3603515625, + "gradient_norm": 0.04338108375668526, + "elapsed": 498.0421245098114 + }, + { + "step": 1536, + "loss": 0.6195274591445923, + "error": 0.3876953125, + "gradient_norm": 0.04848463833332062, + "elapsed": 502.8808298110962 + }, + { + "step": 1552, + "loss": 0.46315908432006836, + "error": 0.2353515625, + "gradient_norm": 0.06380566209554672, + "elapsed": 507.5519721508026 + }, + { + "step": 1568, + "loss": 0.605262041091919, + "error": 0.36328125, + "gradient_norm": 0.05077619478106499, + "elapsed": 512.457685470581 + }, + { + "step": 1584, + "loss": 0.48782041668891907, + "error": 0.232421875, + "gradient_norm": 0.09017211943864822, + "elapsed": 517.2960062026978 + }, + { + "step": 1600, + "loss": 0.3881351947784424, + "error": 0.1875, + "gradient_norm": 0.07205695658922195, + "elapsed": 522.0911631584167 + }, + { + "step": 1616, + "loss": 0.4966873526573181, + "error": 0.24609375, + "gradient_norm": 0.0582038015127182, + "elapsed": 526.8861901760101 + }, + { + "step": 1632, + "loss": 0.5844199657440186, + "error": 0.33203125, + "gradient_norm": 0.05101500824093819, + "elapsed": 531.6640138626099 + }, + { + "step": 1648, + "loss": 0.31010180711746216, + "error": 0.1318359375, + "gradient_norm": 0.053135693073272705, + "elapsed": 536.4960391521454 + }, + { + "step": 1664, + "loss": 0.6174807548522949, + "error": 0.3779296875, + "gradient_norm": 0.04161194711923599, + "elapsed": 541.2560484409332 + }, + { + "step": 1680, + "loss": 0.18213607370853424, + "error": 0.0751953125, + "gradient_norm": 0.07171957194805145, + "elapsed": 546.0000085830688 + }, + { + "step": 1696, + "loss": 0.5445692539215088, + "error": 0.2998046875, + "gradient_norm": 0.054499462246894836, + "elapsed": 551.1221191883087 + }, + { + "step": 1712, + "loss": 0.05744167044758797, + "error": 0.017578125, + "gradient_norm": 0.013108699582517147, + "elapsed": 556.5286149978638 + }, + { + "step": 1728, + "loss": 0.6381571292877197, + "error": 0.3896484375, + "gradient_norm": 0.05157556012272835, + "elapsed": 561.8000066280365 + }, + { + "step": 1744, + "loss": 0.5301004648208618, + "error": 0.28125, + "gradient_norm": 0.04218568280339241, + "elapsed": 567.2760035991669 + }, + { + "step": 1760, + "loss": 0.5275102257728577, + "error": 0.26953125, + "gradient_norm": 0.06798839569091797, + "elapsed": 572.5601994991302 + }, + { + "step": 1776, + "loss": 0.6443773508071899, + "error": 0.4091796875, + "gradient_norm": 0.07035460323095322, + "elapsed": 577.9789206981659 + }, + { + "step": 1792, + "loss": 0.6012362241744995, + "error": 0.337890625, + "gradient_norm": 0.05189951881766319, + "elapsed": 583.028017282486 + }, + { + "step": 1808, + "loss": 0.2939091920852661, + "error": 0.12109375, + "gradient_norm": 0.05555355176329613, + "elapsed": 588.0501506328583 + }, + { + "step": 1824, + "loss": 0.2059091478586197, + "error": 0.08984375, + "gradient_norm": 0.045679714530706406, + "elapsed": 593.2120039463043 + }, + { + "step": 1840, + "loss": 0.6289581060409546, + "error": 0.349609375, + "gradient_norm": 0.04742642492055893, + "elapsed": 598.7767763137817 + }, + { + "step": 1856, + "loss": 0.5532636642456055, + "error": 0.294921875, + "gradient_norm": 0.05997413396835327, + "elapsed": 604.0475382804871 + }, + { + "step": 1872, + "loss": 0.45995670557022095, + "error": 0.228515625, + "gradient_norm": 0.05674462765455246, + "elapsed": 609.292379617691 + }, + { + "step": 1888, + "loss": 0.6178656816482544, + "error": 0.359375, + "gradient_norm": 0.08857566863298416, + "elapsed": 614.5639882087708 + }, + { + "step": 1904, + "loss": 0.5531284213066101, + "error": 0.287109375, + "gradient_norm": 0.10257937759160995, + "elapsed": 619.5600035190582 + }, + { + "step": 1920, + "loss": 0.04184349626302719, + "error": 0.013671875, + "gradient_norm": 0.04087059944868088, + "elapsed": 624.6679775714874 + }, + { + "step": 1936, + "loss": 0.5924860239028931, + "error": 0.3505859375, + "gradient_norm": 0.036822713911533356, + "elapsed": 629.936680316925 + }, + { + "step": 1952, + "loss": 0.46996980905532837, + "error": 0.2421875, + "gradient_norm": 0.034442272037267685, + "elapsed": 635.1109762191772 + }, + { + "step": 1968, + "loss": 0.17859068512916565, + "error": 0.0712890625, + "gradient_norm": 0.03440066799521446, + "elapsed": 640.32000207901 + }, + { + "step": 1984, + "loss": 0.6192275285720825, + "error": 0.3701171875, + "gradient_norm": 0.04386439174413681, + "elapsed": 645.6040184497833 + }, + { + "step": 2000, + "loss": 0.6160917282104492, + "error": 0.35546875, + "gradient_norm": 0.06268990784883499, + "elapsed": 650.7723731994629 + }, + { + "step": 2016, + "loss": 0.6343611478805542, + "error": 0.388671875, + "gradient_norm": 0.04243326932191849, + "elapsed": 655.972663640976 + }, + { + "step": 2032, + "loss": 0.062292590737342834, + "error": 0.021484375, + "gradient_norm": 0.016680095344781876, + "elapsed": 660.8079733848572 + }, + { + "step": 2048, + "loss": 0.5316072702407837, + "error": 0.26953125, + "gradient_norm": 0.057860780507326126, + "elapsed": 665.5760209560394 + }, + { + "step": 2064, + "loss": 0.605312705039978, + "error": 0.3623046875, + "gradient_norm": 0.04028146713972092, + "elapsed": 682.7294294834137 + }, + { + "step": 2080, + "loss": 0.56633460521698, + "error": 0.3330078125, + "gradient_norm": 0.09528280049562454, + "elapsed": 687.4644649028778 + }, + { + "step": 2096, + "loss": 0.3905397057533264, + "error": 0.1943359375, + "gradient_norm": 0.049456462264060974, + "elapsed": 692.1492264270782 + }, + { + "step": 2112, + "loss": 0.28124868869781494, + "error": 0.1259765625, + "gradient_norm": 0.059239838272333145, + "elapsed": 696.8701393604279 + }, + { + "step": 2128, + "loss": 0.6364338994026184, + "error": 0.392578125, + "gradient_norm": 0.08667811006307602, + "elapsed": 701.683988571167 + }, + { + "step": 2144, + "loss": 0.20683243870735168, + "error": 0.07421875, + "gradient_norm": 0.1100710779428482, + "elapsed": 706.4000360965729 + }, + { + "step": 2160, + "loss": 0.5912737250328064, + "error": 0.341796875, + "gradient_norm": 0.05641854554414749, + "elapsed": 711.2359964847565 + }, + { + "step": 2176, + "loss": 0.27793264389038086, + "error": 0.12109375, + "gradient_norm": 0.0893034040927887, + "elapsed": 715.9508004188538 + }, + { + "step": 2192, + "loss": 0.6474133133888245, + "error": 0.4072265625, + "gradient_norm": 0.06980258971452713, + "elapsed": 720.651974439621 + }, + { + "step": 2208, + "loss": 0.5961858630180359, + "error": 0.35546875, + "gradient_norm": 0.06530112773180008, + "elapsed": 725.496098279953 + }, + { + "step": 2224, + "loss": 0.47581571340560913, + "error": 0.263671875, + "gradient_norm": 0.04470043256878853, + "elapsed": 730.2880010604858 + }, + { + "step": 2240, + "loss": 0.577988862991333, + "error": 0.318359375, + "gradient_norm": 0.07201159745454788, + "elapsed": 735.006133556366 + }, + { + "step": 2256, + "loss": 0.28444671630859375, + "error": 0.1181640625, + "gradient_norm": 0.048656050115823746, + "elapsed": 739.6868116855621 + }, + { + "step": 2272, + "loss": 0.2776409089565277, + "error": 0.1201171875, + "gradient_norm": 0.05783981829881668, + "elapsed": 744.3517308235168 + }, + { + "step": 2288, + "loss": 0.621599555015564, + "error": 0.37109375, + "gradient_norm": 0.09731200337409973, + "elapsed": 749.0351710319519 + }, + { + "step": 2304, + "loss": 0.3333754539489746, + "error": 0.1513671875, + "gradient_norm": 0.07069239765405655, + "elapsed": 753.7588081359863 + }, + { + "step": 2320, + "loss": 0.4687051773071289, + "error": 0.2490234375, + "gradient_norm": 0.044891707599163055, + "elapsed": 758.4588432312012 + }, + { + "step": 2336, + "loss": 0.19801637530326843, + "error": 0.078125, + "gradient_norm": 0.10036595165729523, + "elapsed": 763.256409406662 + }, + { + "step": 2352, + "loss": 0.6186277866363525, + "error": 0.388671875, + "gradient_norm": 0.09069584310054779, + "elapsed": 767.9986386299133 + }, + { + "step": 2368, + "loss": 0.6177258491516113, + "error": 0.373046875, + "gradient_norm": 0.049019571393728256, + "elapsed": 772.730831861496 + }, + { + "step": 2384, + "loss": 0.17707547545433044, + "error": 0.0673828125, + "gradient_norm": 0.045190781354904175, + "elapsed": 777.4072704315186 + }, + { + "step": 2400, + "loss": 0.20144733786582947, + "error": 0.08203125, + "gradient_norm": 0.04537162929773331, + "elapsed": 782.0841658115387 + }, + { + "step": 2416, + "loss": 0.6151775121688843, + "error": 0.365234375, + "gradient_norm": 0.050534047186374664, + "elapsed": 786.762966632843 + }, + { + "step": 2432, + "loss": 0.5533859133720398, + "error": 0.314453125, + "gradient_norm": 0.06006559729576111, + "elapsed": 791.4656012058258 + }, + { + "step": 2448, + "loss": 0.5329082012176514, + "error": 0.2880859375, + "gradient_norm": 0.04018115997314453, + "elapsed": 796.1704161167145 + }, + { + "step": 2464, + "loss": 0.6338047981262207, + "error": 0.4140625, + "gradient_norm": 0.06069163978099823, + "elapsed": 800.9180119037628 + }, + { + "step": 2480, + "loss": 0.1603008508682251, + "error": 0.0673828125, + "gradient_norm": 0.040350593626499176, + "elapsed": 805.6127603054047 + }, + { + "step": 2496, + "loss": 0.505940318107605, + "error": 0.2568359375, + "gradient_norm": 0.05209952965378761, + "elapsed": 810.3740313053131 + }, + { + "step": 2512, + "loss": 0.5528728365898132, + "error": 0.298828125, + "gradient_norm": 0.11757992953062057, + "elapsed": 815.1708807945251 + }, + { + "step": 2528, + "loss": 0.5028313994407654, + "error": 0.2666015625, + "gradient_norm": 0.08823780715465546, + "elapsed": 819.8585045337677 + }, + { + "step": 2544, + "loss": 0.5002262592315674, + "error": 0.2783203125, + "gradient_norm": 0.04888603836297989, + "elapsed": 824.5714073181152 + }, + { + "step": 2560, + "loss": 0.6007894277572632, + "error": 0.328125, + "gradient_norm": 0.05186954140663147, + "elapsed": 829.3080432415009 + }, + { + "step": 2576, + "loss": 0.18641480803489685, + "error": 0.076171875, + "gradient_norm": 0.03799928352236748, + "elapsed": 834.044020652771 + }, + { + "step": 2592, + "loss": 0.3050769865512848, + "error": 0.1396484375, + "gradient_norm": 0.10119257122278214, + "elapsed": 838.8401296138763 + }, + { + "step": 2608, + "loss": 0.6063439846038818, + "error": 0.361328125, + "gradient_norm": 0.04979367554187775, + "elapsed": 844.3572654724121 + }, + { + "step": 2624, + "loss": 0.5751967430114746, + "error": 0.3369140625, + "gradient_norm": 0.04269539937376976, + "elapsed": 849.0660374164581 + }, + { + "step": 2640, + "loss": 0.3902108669281006, + "error": 0.193359375, + "gradient_norm": 0.10029696673154831, + "elapsed": 853.8638062477112 + }, + { + "step": 2656, + "loss": 0.15081660449504852, + "error": 0.0625, + "gradient_norm": 0.0303852129727602, + "elapsed": 858.9793758392334 + }, + { + "step": 2672, + "loss": 0.6503090858459473, + "error": 0.400390625, + "gradient_norm": 0.12611964344978333, + "elapsed": 863.9151141643524 + }, + { + "step": 2688, + "loss": 0.5587317943572998, + "error": 0.31640625, + "gradient_norm": 0.10028114914894104, + "elapsed": 868.7600305080414 + }, + { + "step": 2704, + "loss": 0.4399867355823517, + "error": 0.21484375, + "gradient_norm": 0.06889455020427704, + "elapsed": 873.4544236660004 + }, + { + "step": 2720, + "loss": 0.5865127444267273, + "error": 0.337890625, + "gradient_norm": 0.03671631962060928, + "elapsed": 878.0982644557953 + }, + { + "step": 2736, + "loss": 0.6078637838363647, + "error": 0.3701171875, + "gradient_norm": 0.04679318517446518, + "elapsed": 883.0424642562866 + }, + { + "step": 2752, + "loss": 0.5825340151786804, + "error": 0.337890625, + "gradient_norm": 0.05619681254029274, + "elapsed": 887.908124923706 + }, + { + "step": 2768, + "loss": 0.5970422029495239, + "error": 0.3369140625, + "gradient_norm": 0.041302867233753204, + "elapsed": 892.6760206222534 + }, + { + "step": 2784, + "loss": 0.3870226740837097, + "error": 0.1826171875, + "gradient_norm": 0.05731065198779106, + "elapsed": 897.6246056556702 + }, + { + "step": 2800, + "loss": 0.38130277395248413, + "error": 0.1943359375, + "gradient_norm": 0.059244755655527115, + "elapsed": 902.3360238075256 + }, + { + "step": 2816, + "loss": 0.2617901563644409, + "error": 0.1064453125, + "gradient_norm": 0.041736964136362076, + "elapsed": 907.1600468158722 + }, + { + "step": 2832, + "loss": 0.5819337368011475, + "error": 0.314453125, + "gradient_norm": 0.04097156226634979, + "elapsed": 912.0244295597076 + }, + { + "step": 2848, + "loss": 0.41393283009529114, + "error": 0.2001953125, + "gradient_norm": 0.10456771403551102, + "elapsed": 916.8225846290588 + }, + { + "step": 2864, + "loss": 0.5019145011901855, + "error": 0.2548828125, + "gradient_norm": 0.04843736067414284, + "elapsed": 921.538754940033 + }, + { + "step": 2880, + "loss": 0.04561338573694229, + "error": 0.0146484375, + "gradient_norm": 0.025407327339053154, + "elapsed": 926.2588667869568 + }, + { + "step": 2896, + "loss": 0.4338858723640442, + "error": 0.205078125, + "gradient_norm": 0.09900517761707306, + "elapsed": 930.9781975746155 + }, + { + "step": 2912, + "loss": 0.33922863006591797, + "error": 0.162109375, + "gradient_norm": 0.10189604014158249, + "elapsed": 935.6816267967224 + }, + { + "step": 2928, + "loss": 0.5294322967529297, + "error": 0.2822265625, + "gradient_norm": 0.09060791879892349, + "elapsed": 940.4373068809509 + }, + { + "step": 2944, + "loss": 0.037007369101047516, + "error": 0.01171875, + "gradient_norm": 0.05506489425897598, + "elapsed": 945.1270468235016 + }, + { + "step": 2960, + "loss": 0.6096771359443665, + "error": 0.349609375, + "gradient_norm": 0.04987221211194992, + "elapsed": 949.8300130367279 + }, + { + "step": 2976, + "loss": 0.6157823801040649, + "error": 0.373046875, + "gradient_norm": 0.03614233434200287, + "elapsed": 954.5701997280121 + }, + { + "step": 2992, + "loss": 0.1978239268064499, + "error": 0.080078125, + "gradient_norm": 0.05847112461924553, + "elapsed": 959.2756471633911 + }, + { + "step": 3008, + "loss": 0.5237340927124023, + "error": 0.2841796875, + "gradient_norm": 0.06993591040372849, + "elapsed": 963.9875864982605 + }, + { + "step": 3024, + "loss": 0.4559935927391052, + "error": 0.2373046875, + "gradient_norm": 0.05698448419570923, + "elapsed": 968.7997305393219 + }, + { + "step": 3040, + "loss": 0.5025208592414856, + "error": 0.259765625, + "gradient_norm": 0.14909739792346954, + "elapsed": 973.6042547225952 + }, + { + "step": 3056, + "loss": 0.3223109245300293, + "error": 0.1416015625, + "gradient_norm": 0.032974764704704285, + "elapsed": 978.4760546684265 + }, + { + "step": 3072, + "loss": 0.06682582199573517, + "error": 0.021484375, + "gradient_norm": 0.04433188587427139, + "elapsed": 983.2894048690796 + }, + { + "step": 3088, + "loss": 0.5919550061225891, + "error": 0.34765625, + "gradient_norm": 0.06721373647451401, + "elapsed": 1000.9520287513733 + }, + { + "step": 3104, + "loss": 0.5988063812255859, + "error": 0.3642578125, + "gradient_norm": 0.05654948577284813, + "elapsed": 1005.7442932128906 + }, + { + "step": 3120, + "loss": 0.4922299385070801, + "error": 0.2470703125, + "gradient_norm": 0.07545466721057892, + "elapsed": 1010.4616096019745 + }, + { + "step": 3136, + "loss": 0.4533671736717224, + "error": 0.236328125, + "gradient_norm": 0.06288722902536392, + "elapsed": 1015.3559956550598 + }, + { + "step": 3152, + "loss": 0.5070517063140869, + "error": 0.2666015625, + "gradient_norm": 0.07274917513132095, + "elapsed": 1020.0764343738556 + }, + { + "step": 3168, + "loss": 0.5999464988708496, + "error": 0.3408203125, + "gradient_norm": 0.05777016654610634, + "elapsed": 1024.9410600662231 + }, + { + "step": 3184, + "loss": 0.5758363008499146, + "error": 0.3427734375, + "gradient_norm": 0.051027461886405945, + "elapsed": 1029.7082171440125 + }, + { + "step": 3200, + "loss": 0.05016190931200981, + "error": 0.017578125, + "gradient_norm": 0.009175656363368034, + "elapsed": 1034.3982915878296 + }, + { + "step": 3216, + "loss": 0.5471057295799255, + "error": 0.318359375, + "gradient_norm": 0.07572721689939499, + "elapsed": 1039.117841243744 + }, + { + "step": 3232, + "loss": 0.4141446352005005, + "error": 0.193359375, + "gradient_norm": 0.10056859254837036, + "elapsed": 1043.880026102066 + }, + { + "step": 3248, + "loss": 0.5812438726425171, + "error": 0.3212890625, + "gradient_norm": 0.05781616270542145, + "elapsed": 1048.6406455039978 + }, + { + "step": 3264, + "loss": 0.19184701144695282, + "error": 0.078125, + "gradient_norm": 0.05367236211895943, + "elapsed": 1053.5672237873077 + }, + { + "step": 3280, + "loss": 0.5420833826065063, + "error": 0.28515625, + "gradient_norm": 0.052405405789613724, + "elapsed": 1058.3841104507446 + }, + { + "step": 3296, + "loss": 0.4419598877429962, + "error": 0.2177734375, + "gradient_norm": 0.05814693495631218, + "elapsed": 1063.1880333423615 + }, + { + "step": 3312, + "loss": 0.4525642991065979, + "error": 0.208984375, + "gradient_norm": 0.1061021164059639, + "elapsed": 1068.1370933055878 + }, + { + "step": 3328, + "loss": 0.32664671540260315, + "error": 0.154296875, + "gradient_norm": 0.05649850144982338, + "elapsed": 1073.1963467597961 + }, + { + "step": 3344, + "loss": 0.2655770182609558, + "error": 0.1220703125, + "gradient_norm": 0.04070372134447098, + "elapsed": 1078.2698318958282 + }, + { + "step": 3360, + "loss": 0.5894330739974976, + "error": 0.3544921875, + "gradient_norm": 0.0643400028347969, + "elapsed": 1083.0184152126312 + }, + { + "step": 3376, + "loss": 0.6118791103363037, + "error": 0.361328125, + "gradient_norm": 0.08537904173135757, + "elapsed": 1087.834038734436 + }, + { + "step": 3392, + "loss": 0.40694907307624817, + "error": 0.19921875, + "gradient_norm": 0.11411692947149277, + "elapsed": 1092.8119947910309 + }, + { + "step": 3408, + "loss": 0.04629015550017357, + "error": 0.0146484375, + "gradient_norm": 0.017204072326421738, + "elapsed": 1097.5751783847809 + }, + { + "step": 3424, + "loss": 0.20639702677726746, + "error": 0.0849609375, + "gradient_norm": 0.04801144450902939, + "elapsed": 1102.2970931529999 + }, + { + "step": 3440, + "loss": 0.6051071286201477, + "error": 0.33984375, + "gradient_norm": 0.045392412692308426, + "elapsed": 1107.1080610752106 + }, + { + "step": 3456, + "loss": 0.6553700566291809, + "error": 0.40625, + "gradient_norm": 0.05593863129615784, + "elapsed": 1111.8409752845764 + }, + { + "step": 3472, + "loss": 0.591402530670166, + "error": 0.3515625, + "gradient_norm": 0.051181379705667496, + "elapsed": 1116.5800333023071 + }, + { + "step": 3488, + "loss": 0.30494624376296997, + "error": 0.12109375, + "gradient_norm": 0.05175542086362839, + "elapsed": 1121.276373386383 + }, + { + "step": 3504, + "loss": 0.5065370798110962, + "error": 0.279296875, + "gradient_norm": 0.10419930517673492, + "elapsed": 1125.9883344173431 + }, + { + "step": 3520, + "loss": 0.3915700614452362, + "error": 0.1953125, + "gradient_norm": 0.060416825115680695, + "elapsed": 1130.7958455085754 + }, + { + "step": 3536, + "loss": 0.624374270439148, + "error": 0.3759765625, + "gradient_norm": 0.06069556251168251, + "elapsed": 1135.5360939502716 + }, + { + "step": 3552, + "loss": 0.5830206274986267, + "error": 0.3359375, + "gradient_norm": 0.046013280749320984, + "elapsed": 1140.312029838562 + }, + { + "step": 3568, + "loss": 0.4201379716396332, + "error": 0.2119140625, + "gradient_norm": 0.06909621506929398, + "elapsed": 1145.0904593467712 + }, + { + "step": 3584, + "loss": 0.28215405344963074, + "error": 0.1181640625, + "gradient_norm": 0.07625982910394669, + "elapsed": 1149.8156151771545 + }, + { + "step": 3600, + "loss": 0.5229164361953735, + "error": 0.275390625, + "gradient_norm": 0.055048178881406784, + "elapsed": 1154.5280592441559 + }, + { + "step": 3616, + "loss": 0.47238075733184814, + "error": 0.2314453125, + "gradient_norm": 0.06473162025213242, + "elapsed": 1159.2720873355865 + }, + { + "step": 3632, + "loss": 0.46245503425598145, + "error": 0.228515625, + "gradient_norm": 0.07382887601852417, + "elapsed": 1164.0119998455048 + }, + { + "step": 3648, + "loss": 0.37509745359420776, + "error": 0.171875, + "gradient_norm": 0.051260266453027725, + "elapsed": 1168.7440350055695 + }, + { + "step": 3664, + "loss": 0.1948484629392624, + "error": 0.080078125, + "gradient_norm": 0.059623416513204575, + "elapsed": 1173.3906588554382 + }, + { + "step": 3680, + "loss": 0.5552756786346436, + "error": 0.3115234375, + "gradient_norm": 0.08073585480451584, + "elapsed": 1178.0645008087158 + }, + { + "step": 3696, + "loss": 0.6405904293060303, + "error": 0.39453125, + "gradient_norm": 0.05899551138281822, + "elapsed": 1182.730489730835 + }, + { + "step": 3712, + "loss": 0.2767012119293213, + "error": 0.119140625, + "gradient_norm": 0.06593579798936844, + "elapsed": 1187.377315044403 + }, + { + "step": 3728, + "loss": 0.315812885761261, + "error": 0.134765625, + "gradient_norm": 0.035905495285987854, + "elapsed": 1192.0582301616669 + }, + { + "step": 3744, + "loss": 0.6033951640129089, + "error": 0.3544921875, + "gradient_norm": 0.05226197466254234, + "elapsed": 1196.7101175785065 + }, + { + "step": 3760, + "loss": 0.5202592611312866, + "error": 0.275390625, + "gradient_norm": 0.06367512047290802, + "elapsed": 1201.3543090820312 + }, + { + "step": 3776, + "loss": 0.24639368057250977, + "error": 0.1083984375, + "gradient_norm": 0.09370873868465424, + "elapsed": 1206.0717165470123 + }, + { + "step": 3792, + "loss": 0.6175658702850342, + "error": 0.375, + "gradient_norm": 0.06221585348248482, + "elapsed": 1210.754029750824 + }, + { + "step": 3808, + "loss": 0.41153696179389954, + "error": 0.2119140625, + "gradient_norm": 0.05355365574359894, + "elapsed": 1215.4374370574951 + }, + { + "step": 3824, + "loss": 0.28002214431762695, + "error": 0.1123046875, + "gradient_norm": 0.03846330568194389, + "elapsed": 1220.1207013130188 + }, + { + "step": 3840, + "loss": 0.0484195351600647, + "error": 0.013671875, + "gradient_norm": 0.03470242768526077, + "elapsed": 1224.8153104782104 + }, + { + "step": 3856, + "loss": 0.1407160609960556, + "error": 0.0458984375, + "gradient_norm": 0.04061700031161308, + "elapsed": 1229.5512235164642 + }, + { + "step": 3872, + "loss": 0.5881794691085815, + "error": 0.3427734375, + "gradient_norm": 0.062013477087020874, + "elapsed": 1234.3750183582306 + }, + { + "step": 3888, + "loss": 0.17833612859249115, + "error": 0.06640625, + "gradient_norm": 0.038856204599142075, + "elapsed": 1239.110375881195 + }, + { + "step": 3904, + "loss": 0.06211477518081665, + "error": 0.0224609375, + "gradient_norm": 0.02150108851492405, + "elapsed": 1243.800644159317 + }, + { + "step": 3920, + "loss": 0.06039723381400108, + "error": 0.01953125, + "gradient_norm": 0.019367367029190063, + "elapsed": 1248.4831748008728 + }, + { + "step": 3936, + "loss": 0.6010214686393738, + "error": 0.3525390625, + "gradient_norm": 0.051659151911735535, + "elapsed": 1253.1423478126526 + }, + { + "step": 3952, + "loss": 0.5867137312889099, + "error": 0.3388671875, + "gradient_norm": 0.058528851717710495, + "elapsed": 1257.9799931049347 + }, + { + "step": 3968, + "loss": 0.5231834650039673, + "error": 0.2578125, + "gradient_norm": 0.10128334909677505, + "elapsed": 1262.6990082263947 + }, + { + "step": 3984, + "loss": 0.6251651644706726, + "error": 0.353515625, + "gradient_norm": 0.06211795285344124, + "elapsed": 1267.4289934635162 + }, + { + "step": 4000, + "loss": 0.06667037308216095, + "error": 0.01953125, + "gradient_norm": 0.048018258064985275, + "elapsed": 1272.132089138031 + }, + { + "step": 4016, + "loss": 0.5286938548088074, + "error": 0.2744140625, + "gradient_norm": 0.05509360507130623, + "elapsed": 1276.8878977298737 + }, + { + "step": 4032, + "loss": 0.34016552567481995, + "error": 0.1591796875, + "gradient_norm": 0.07597329467535019, + "elapsed": 1281.7364926338196 + }, + { + "step": 4048, + "loss": 0.17750494182109833, + "error": 0.078125, + "gradient_norm": 0.06314503401517868, + "elapsed": 1286.5033600330353 + }, + { + "step": 4064, + "loss": 0.5882893800735474, + "error": 0.34375, + "gradient_norm": 0.10986580699682236, + "elapsed": 1291.1944887638092 + }, + { + "step": 4080, + "loss": 0.4923543930053711, + "error": 0.2568359375, + "gradient_norm": 0.050325747579336166, + "elapsed": 1295.9372322559357 + }, + { + "step": 4096, + "loss": 0.44146978855133057, + "error": 0.2236328125, + "gradient_norm": 0.06535191088914871, + "elapsed": 1300.641023159027 + } + ] + }, + "derived_checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_optimizer_steps": [ + 2048, + 3072, + 4096 + ], + "source_training_run": "temporal2", + "source_weights_sha256": { + "2048": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "3072": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "4096": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea" + }, + "source_checkpoint_records": { + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "3072": { + "step": 3072, + "new_training_shots": 3145728, + "unique_training_rows_seen_in_this_phase": 1594502, + "weights": "weights-3072.npz", + "weights_sha256": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "validation": "validation-3072.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "weights_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "complete": true + }, + "mean4": { + "checkpoint_label": "mean4", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_optimizer_steps": [ + 1024, + 2048, + 3072, + 4096 + ], + "source_training_run": "temporal2", + "source_weights_sha256": { + "1024": "0d809362d5afe1dc781f716e3aee1a9bc5a8f75fed6cc0ff6339b9abcf600ada", + "2048": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "3072": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "4096": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "unique_training_rows_seen_in_this_phase": 804757, + "weights": "weights-1024.npz", + "weights_sha256": "0d809362d5afe1dc781f716e3aee1a9bc5a8f75fed6cc0ff6339b9abcf600ada", + "validation": "validation-1024.json", + "complete": true + }, + "2048": { + "step": 2048, + "new_training_shots": 2097152, + "unique_training_rows_seen_in_this_phase": 1293629, + "weights": "weights-2048.npz", + "weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "validation": "validation-2048.json", + "complete": true + }, + "3072": { + "step": 3072, + "new_training_shots": 3145728, + "unique_training_rows_seen_in_this_phase": 1594502, + "weights": "weights-3072.npz", + "weights_sha256": "fabbb42432fb0975023f0a367a366b8db591c6866719b4c7efb85cfe91934c65", + "validation": "validation-3072.json", + "complete": true + }, + "4096": { + "step": 4096, + "new_training_shots": 4194304, + "unique_training_rows_seen_in_this_phase": 1778773, + "weights": "weights-4096.npz", + "weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "validation": "validation-4096.json", + "complete": true + } + }, + "weights_sha256": "ff4595e8f3eb7cfaa8da5a58a31e106d9684c7b8437f330573a1291f19f5777a", + "complete": true + } + }, + "selection": "Predefined last-three and all-four noninitial temporal2 checkpoint means; every validation condition evaluated before group selection", + "test_data_used": false, + "derivation_source_sha256": "b68813c7dab697a554185020c430ef05f1c35bedcda5b85b7d165af75461e914" + }, + "loss": "Binary conditional logical likelihood computed by exact frontier elimination", + "validation_shots_per_condition": 1024, + "uniform_validation": true, + "uniform_validation_seed": 20261028, + "test_data_used": false, + "log": [ + { + "step": 1, + "loss": 0.5063965320587158, + "error": 0.263671875, + "gradient_norm": 0.05583755671977997, + "elapsed": 33.61826181411743 + }, + { + "step": 16, + "loss": 0.5231766700744629, + "error": 0.2822265625, + "gradient_norm": 0.05158894136548042, + "elapsed": 48.65802335739136 + }, + { + "step": 32, + "loss": 0.2955678701400757, + "error": 0.1376953125, + "gradient_norm": 0.0717208981513977, + "elapsed": 64.75103712081909 + }, + { + "step": 48, + "loss": 0.5808531045913696, + "error": 0.337890625, + "gradient_norm": 0.0497879758477211, + "elapsed": 81.12590050697327 + }, + { + "step": 64, + "loss": 0.6466071605682373, + "error": 0.3955078125, + "gradient_norm": 0.05340445786714554, + "elapsed": 97.40131282806396 + }, + { + "step": 80, + "loss": 0.43967077136039734, + "error": 0.2197265625, + "gradient_norm": 0.05488451197743416, + "elapsed": 113.68819904327393 + }, + { + "step": 96, + "loss": 0.3481931686401367, + "error": 0.166015625, + "gradient_norm": 0.08198399841785431, + "elapsed": 129.79422783851624 + }, + { + "step": 112, + "loss": 0.37728914618492126, + "error": 0.177734375, + "gradient_norm": 0.04957005754113197, + "elapsed": 146.01310849189758 + }, + { + "step": 128, + "loss": 0.19336706399917603, + "error": 0.07421875, + "gradient_norm": 0.03228567913174629, + "elapsed": 162.3233504295349 + }, + { + "step": 144, + "loss": 0.05673666670918465, + "error": 0.013671875, + "gradient_norm": 0.010086167603731155, + "elapsed": 178.27910375595093 + }, + { + "step": 160, + "loss": 0.05576886981725693, + "error": 0.0185546875, + "gradient_norm": 0.015833213925361633, + "elapsed": 194.4404194355011 + }, + { + "step": 176, + "loss": 0.6271512508392334, + "error": 0.39453125, + "gradient_norm": 0.0890795886516571, + "elapsed": 210.55058026313782 + }, + { + "step": 192, + "loss": 0.5520341992378235, + "error": 0.2998046875, + "gradient_norm": 0.12568876147270203, + "elapsed": 226.60093927383423 + }, + { + "step": 208, + "loss": 0.5262938737869263, + "error": 0.2822265625, + "gradient_norm": 0.055265434086322784, + "elapsed": 244.85273218154907 + }, + { + "step": 224, + "loss": 0.5956001281738281, + "error": 0.3369140625, + "gradient_norm": 0.06895016878843307, + "elapsed": 264.53393387794495 + }, + { + "step": 240, + "loss": 0.25704875588417053, + "error": 0.1259765625, + "gradient_norm": 0.11300098150968552, + "elapsed": 283.89024353027344 + }, + { + "step": 256, + "loss": 0.6143664121627808, + "error": 0.369140625, + "gradient_norm": 0.05419369786977768, + "elapsed": 300.05279064178467 + }, + { + "step": 272, + "loss": 0.5590812563896179, + "error": 0.294921875, + "gradient_norm": 0.06284675002098083, + "elapsed": 315.92391777038574 + }, + { + "step": 288, + "loss": 0.6163386106491089, + "error": 0.353515625, + "gradient_norm": 0.06826888024806976, + "elapsed": 331.96330738067627 + }, + { + "step": 304, + "loss": 0.6250298619270325, + "error": 0.37890625, + "gradient_norm": 0.0710018053650856, + "elapsed": 348.11866188049316 + }, + { + "step": 320, + "loss": 0.3802686631679535, + "error": 0.1796875, + "gradient_norm": 0.05896822363138199, + "elapsed": 364.3013961315155 + }, + { + "step": 336, + "loss": 0.2594846487045288, + "error": 0.1123046875, + "gradient_norm": 0.0468285046517849, + "elapsed": 380.80411195755005 + }, + { + "step": 352, + "loss": 0.19520026445388794, + "error": 0.076171875, + "gradient_norm": 0.032125141471624374, + "elapsed": 396.8971872329712 + }, + { + "step": 368, + "loss": 0.621718168258667, + "error": 0.37890625, + "gradient_norm": 0.0545712448656559, + "elapsed": 412.920996427536 + }, + { + "step": 384, + "loss": 0.6092393398284912, + "error": 0.349609375, + "gradient_norm": 0.04697328060865402, + "elapsed": 428.92249155044556 + }, + { + "step": 400, + "loss": 0.33656495809555054, + "error": 0.171875, + "gradient_norm": 0.04851065203547478, + "elapsed": 444.8614237308502 + }, + { + "step": 416, + "loss": 0.563441812992096, + "error": 0.302734375, + "gradient_norm": 0.06761237233877182, + "elapsed": 460.89916157722473 + }, + { + "step": 432, + "loss": 0.41032207012176514, + "error": 0.205078125, + "gradient_norm": 0.07552587240934372, + "elapsed": 476.91754388809204 + }, + { + "step": 448, + "loss": 0.6176105737686157, + "error": 0.3583984375, + "gradient_norm": 0.03991354629397392, + "elapsed": 492.909494638443 + }, + { + "step": 464, + "loss": 0.47970300912857056, + "error": 0.26171875, + "gradient_norm": 0.08514834195375443, + "elapsed": 508.9842050075531 + }, + { + "step": 480, + "loss": 0.6145294904708862, + "error": 0.3779296875, + "gradient_norm": 0.04053078964352608, + "elapsed": 525.0681574344635 + }, + { + "step": 496, + "loss": 0.5232605934143066, + "error": 0.28125, + "gradient_norm": 0.07535209506750107, + "elapsed": 541.048586845398 + }, + { + "step": 512, + "loss": 0.06574343144893646, + "error": 0.01953125, + "gradient_norm": 0.038100212812423706, + "elapsed": 557.0923149585724 + }, + { + "step": 528, + "loss": 0.052529145032167435, + "error": 0.021484375, + "gradient_norm": 0.017167840152978897, + "elapsed": 588.7646441459656 + }, + { + "step": 544, + "loss": 0.5886420011520386, + "error": 0.3447265625, + "gradient_norm": 0.04695608466863632, + "elapsed": 607.2257866859436 + }, + { + "step": 560, + "loss": 0.6055985689163208, + "error": 0.3466796875, + "gradient_norm": 0.032950498163700104, + "elapsed": 625.9134004116058 + }, + { + "step": 576, + "loss": 0.4632350206375122, + "error": 0.2431640625, + "gradient_norm": 0.07214360684156418, + "elapsed": 642.5683023929596 + }, + { + "step": 592, + "loss": 0.5995157361030579, + "error": 0.33984375, + "gradient_norm": 0.05927892401814461, + "elapsed": 659.0285487174988 + }, + { + "step": 608, + "loss": 0.2751845121383667, + "error": 0.1171875, + "gradient_norm": 0.06076137721538544, + "elapsed": 675.2659955024719 + }, + { + "step": 624, + "loss": 0.0518009215593338, + "error": 0.0205078125, + "gradient_norm": 0.017002176493406296, + "elapsed": 691.3256914615631 + }, + { + "step": 640, + "loss": 0.6293823719024658, + "error": 0.4013671875, + "gradient_norm": 0.07381543517112732, + "elapsed": 707.3796145915985 + }, + { + "step": 656, + "loss": 0.2956032454967499, + "error": 0.126953125, + "gradient_norm": 0.06658996641635895, + "elapsed": 723.4796185493469 + }, + { + "step": 672, + "loss": 0.5275129079818726, + "error": 0.28125, + "gradient_norm": 0.0742238238453865, + "elapsed": 739.52592253685 + }, + { + "step": 688, + "loss": 0.48426946997642517, + "error": 0.251953125, + "gradient_norm": 0.08587855845689774, + "elapsed": 755.599978685379 + }, + { + "step": 704, + "loss": 0.5284034013748169, + "error": 0.298828125, + "gradient_norm": 0.07507473230361938, + "elapsed": 771.6798233985901 + }, + { + "step": 720, + "loss": 0.45124661922454834, + "error": 0.2333984375, + "gradient_norm": 0.040898919105529785, + "elapsed": 787.8532867431641 + }, + { + "step": 736, + "loss": 0.04965062811970711, + "error": 0.0146484375, + "gradient_norm": 0.013609266839921474, + "elapsed": 804.1182470321655 + }, + { + "step": 752, + "loss": 0.04790960252285004, + "error": 0.01171875, + "gradient_norm": 0.01157061941921711, + "elapsed": 820.3099284172058 + }, + { + "step": 768, + "loss": 0.046329010277986526, + "error": 0.0146484375, + "gradient_norm": 0.013687756843864918, + "elapsed": 836.2443821430206 + }, + { + "step": 784, + "loss": 0.20798391103744507, + "error": 0.0830078125, + "gradient_norm": 0.10879658162593842, + "elapsed": 853.994068145752 + }, + { + "step": 800, + "loss": 0.3236527144908905, + "error": 0.1494140625, + "gradient_norm": 0.04277466610074043, + "elapsed": 872.6724886894226 + }, + { + "step": 816, + "loss": 0.5978351831436157, + "error": 0.3310546875, + "gradient_norm": 0.09687308222055435, + "elapsed": 890.0722959041595 + }, + { + "step": 832, + "loss": 0.5914890766143799, + "error": 0.3515625, + "gradient_norm": 0.05389918386936188, + "elapsed": 907.574702501297 + }, + { + "step": 848, + "loss": 0.3500230312347412, + "error": 0.154296875, + "gradient_norm": 0.05182121321558952, + "elapsed": 925.516667842865 + }, + { + "step": 864, + "loss": 0.3173527717590332, + "error": 0.126953125, + "gradient_norm": 0.10333289951086044, + "elapsed": 943.2102818489075 + }, + { + "step": 880, + "loss": 0.6407152414321899, + "error": 0.41015625, + "gradient_norm": 0.03933756425976753, + "elapsed": 960.0137810707092 + }, + { + "step": 896, + "loss": 0.3448338210582733, + "error": 0.1591796875, + "gradient_norm": 0.048397257924079895, + "elapsed": 976.2672023773193 + }, + { + "step": 912, + "loss": 0.2199687361717224, + "error": 0.0830078125, + "gradient_norm": 0.11513829976320267, + "elapsed": 992.4728758335114 + }, + { + "step": 928, + "loss": 0.16880497336387634, + "error": 0.072265625, + "gradient_norm": 0.031767718493938446, + "elapsed": 1008.5988037586212 + }, + { + "step": 944, + "loss": 0.053500816226005554, + "error": 0.017578125, + "gradient_norm": 0.014627245254814625, + "elapsed": 1024.7008044719696 + }, + { + "step": 960, + "loss": 0.5974152684211731, + "error": 0.341796875, + "gradient_norm": 0.09594274312257767, + "elapsed": 1040.908540725708 + }, + { + "step": 976, + "loss": 0.34772756695747375, + "error": 0.1572265625, + "gradient_norm": 0.04134370759129524, + "elapsed": 1056.9926254749298 + }, + { + "step": 992, + "loss": 0.4953954815864563, + "error": 0.2744140625, + "gradient_norm": 0.09671331197023392, + "elapsed": 1073.0582761764526 + }, + { + "step": 1008, + "loss": 0.6424463987350464, + "error": 0.4013671875, + "gradient_norm": 0.13621115684509277, + "elapsed": 1089.2002465724945 + }, + { + "step": 1024, + "loss": 0.1914748251438141, + "error": 0.0771484375, + "gradient_norm": 0.05097605288028717, + "elapsed": 1105.341599225998 + } + ], + "condition_mixing_plan": { + "hypothesis": "Mixing uniformly sampled geometry/basis/duration conditions in each gradient update reduces condition-gradient fluctuations", + "parent": "temporal2_swa/weights-mean3.npz", + "new_random_parameter_initializations": 0, + "sampling_seed": 20261190, + "arms": [ + "same", + "mixed" + ], + "microbatches_per_update": 4, + "microbatch_size": 256, + "effective_batch_size": 1024, + "optimizer_updates": 1024, + "learning_rate": 0.00025, + "optimizer": "Fresh AdamW state, weight decay1e-4, global gradient norm clip1 after averaging gradients", + "sampling_control": "Both arms draw four condition indices then four256-row batches per update. Same arm reuses the first condition index; mixed uses all four. Equal-sized condition pools make RNG states identical.", + "training": "All104 d3 conditions and all supplied training rows eligible;1,048,576 training draws in each arm", + "selection": "Full validation checkpoints512/1024, per-group mean across all13 durations; raw or equal blend with recorded small contextual reference; incumbent retained on ties", + "test_data_used": false + }, + "accumulation_numerical_control": { + "status": "passed", + "device": "cpu", + "condition": "surface_code_bZ_d3_r13_center_5_7", + "parent_checkpoint_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "trainer_source_sha256": "9f672468a8b72966b3aa04fd22e5d40b47b0768f1c802c267a1da08244c4323b", + "gradient_relative_l2_difference": 1.0312139158546257e-06, + "maximum_gradient_difference": 4.023313522338867e-07, + "mean_loss_difference": 0.0, + "maximum_optimizer_update_difference": 1.0697840480133891e-06, + "matched_rng_state_after_1024_updates": true, + "precision_audit": { + "float64_full_vs_accumulated_gradient_relative_l2": 2.4022986924332267e-15, + "float64_full_vs_accumulated_update_maximum_difference": 1.6631390275384517e-15, + "float32_full_gradient_relative_l2_vs_float64": 1.1454018534911662e-06, + "float32_accumulated_gradient_relative_l2_vs_float64": 9.16593382832008e-07, + "float32_full_update_maximum_difference_vs_float64": 6.5271394129382524e-06, + "float32_accumulated_update_maximum_difference_vs_float64": 7.5969234609516415e-06, + "initial_failed_check": { + "maximum_float32_update_difference": 1.0697840480133891e-06, + "original_tolerance": 1e-06 + }, + "interpretation": "Float64 audit checks accumulation algebra independently of float32 reduction rounding and first-Adam-step sensitivity near zero gradients. Original failure is retained; production model/gradient precision and optimizer are unchanged." + }, + "training_draws_each_arm": 1048576, + "draws_by_condition": { + "same": [ + 17408, + 14336, + 12288, + 14336, + 7168, + 10240, + 8192, + 7168, + 9216, + 11264, + 14336, + 7168, + 5120, + 9216, + 7168, + 8192, + 8192, + 10240, + 7168, + 10240, + 11264, + 14336, + 15360, + 10240, + 8192, + 11264, + 11264, + 17408, + 11264, + 15360, + 10240, + 17408, + 7168, + 13312, + 5120, + 13312, + 4096, + 8192, + 10240, + 8192, + 8192, + 5120, + 10240, + 11264, + 16384, + 13312, + 9216, + 9216, + 14336, + 8192, + 10240, + 10240, + 3072, + 8192, + 11264, + 12288, + 5120, + 4096, + 7168, + 9216, + 5120, + 14336, + 8192, + 9216, + 15360, + 6144, + 16384, + 5120, + 10240, + 10240, + 11264, + 11264, + 7168, + 6144, + 8192, + 11264, + 8192, + 14336, + 8192, + 10240, + 13312, + 15360, + 18432, + 4096, + 8192, + 8192, + 15360, + 10240, + 7168, + 12288, + 7168, + 12288, + 12288, + 8192, + 16384, + 9216, + 11264, + 6144, + 8192, + 7168, + 7168, + 12288, + 5120, + 8192 + ], + "mixed": [ + 14336, + 9472, + 8448, + 12032, + 8960, + 11776, + 9984, + 8448, + 9216, + 11264, + 12288, + 11008, + 7936, + 11008, + 9984, + 8448, + 11776, + 9984, + 9984, + 10752, + 8448, + 9984, + 9728, + 10240, + 8704, + 8448, + 8192, + 10496, + 8704, + 11008, + 9984, + 13824, + 8960, + 11264, + 9984, + 11008, + 13824, + 11264, + 9984, + 9216, + 9472, + 11008, + 9472, + 11776, + 12800, + 10240, + 8192, + 8192, + 9728, + 11008, + 8960, + 11264, + 8704, + 10496, + 10240, + 11776, + 7936, + 9216, + 9472, + 10752, + 8448, + 12288, + 9216, + 9728, + 11008, + 9472, + 11008, + 10240, + 8704, + 8448, + 9216, + 9728, + 9728, + 8960, + 10496, + 11520, + 9216, + 8704, + 6400, + 12032, + 11008, + 12288, + 12288, + 7936, + 10752, + 7936, + 12032, + 9216, + 8448, + 9472, + 9472, + 10752, + 10752, + 10752, + 12800, + 10496, + 10496, + 12032, + 8448, + 8960, + 7680, + 9472, + 11008, + 8448 + ] + }, + "scope": "Numerical and sampling controls only. All gradient/update probes are discarded; no trained candidate checkpoint or validation score is produced.", + "test_data_used": false + } + }, + "training_source_snapshot": "training_sources/condition_same1", + "selected_checkpoint_steps": [ + "1024", + "512" + ], + "checkpoint_records": { + "512": { + "step": 512, + "new_training_shots": 524288, + "unique_training_rows_seen_in_this_phase": 451734, + "weights": "weights-512.npz", + "weights_sha256": "4cf3ebae65f19ed882d90aac2157db4127d715f9c688c987280c9aac28efad84", + "validation": "validation-512.json", + "complete": true + }, + "1024": { + "step": 1024, + "new_training_shots": 1048576, + "unique_training_rows_seen_in_this_phase": 803777, + "weights": "weights-1024.npz", + "weights_sha256": "c515815d285cc2eafe52d8ced2df1c754ac578ba54786b98770e15238dc4eaad", + "validation": "validation-1024.json", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure per group among incumbent and listed session-trained checkpoints; when listed, blend candidates average the recorded small-contextual reference and new probabilities equally", + "blend_reference": "/run-state/workspace/research/context_upgrades/continuation2/predictions", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.24451622596153846, + "512": 0.24528245192307693, + "1024": 0.24529747596153847, + "blend-512": 0.24562800480769229, + "blend-1024": 0.24574819711538462 + }, + "selected": "incumbent" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2527794471153846, + "512": 0.25326021634615387, + "1024": 0.252734375, + "blend-512": 0.2533954326923077, + "blend-1024": 0.25307992788461536 + }, + "selected": "1024" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.23366887019230773, + "512": 0.23359375, + "1024": 0.2334435096153846, + "blend-512": 0.23426983173076926, + "blend-1024": 0.23384915865384612 + }, + "selected": "1024" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.23889723557692305, + "512": 0.23933293269230774, + "1024": 0.23951322115384613, + "blend-512": 0.23915264423076918, + "blend-1024": 0.239453125 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.2446213942307692, + "512": 0.2444561298076923, + "1024": 0.24489182692307693, + "blend-512": 0.24508713942307692, + "blend-1024": 0.24568810096153845 + }, + "selected": "512" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.23652343749999996, + "512": 0.23765024038461538, + "1024": 0.2379206730769231, + "blend-512": 0.23787560096153845, + "blend-1024": 0.23759014423076924 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.2356670673076923, + "512": 0.23619290865384618, + "1024": 0.23629807692307692, + "blend-512": 0.23610276442307693, + "blend-1024": 0.23593750000000002 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.23294771634615385, + "512": 0.23398437499999997, + "1024": 0.23342848557692308, + "blend-512": 0.2337590144230769, + "blend-1024": 0.2334435096153846 + }, + "selected": "incumbent" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23228665865384618 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.21953124999999998 + }, + "selected": "incumbent" + } + ] + }, + { + "name": "group_specialize1", + "training_run": { + "experiment": "group-specific d3 continuation", + "groups": { + "d3_bX_center_3_5": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bX_center_3_5", + "parent_model": { + "weights": "weights/contextual-temporal2_swa-mean3.npz", + "training_checkpoint": "temporal2_swa/mean3" + }, + "parent_weights_sha256": "a61fb22f803b795c2a39b6c19dc3a368d536cb21419ba773778601b28e4403fe", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162496, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 11586, + "surface_code_bX_d3_r03_center_3_5": 13164, + "surface_code_bX_d3_r05_center_3_5": 14692, + "surface_code_bX_d3_r07_center_3_5": 12423, + "surface_code_bX_d3_r09_center_3_5": 13507, + "surface_code_bX_d3_r11_center_3_5": 9165, + "surface_code_bX_d3_r13_center_3_5": 14569, + "surface_code_bX_d3_r15_center_3_5": 11563, + "surface_code_bX_d3_r17_center_3_5": 14132, + "surface_code_bX_d3_r19_center_3_5": 9704, + "surface_code_bX_d3_r21_center_3_5": 12014, + "surface_code_bX_d3_r23_center_3_5": 13117, + "surface_code_bX_d3_r25_center_3_5": 12860 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261200, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bX_center_3_5", + "step": 1, + "loss": 0.5817165970802307, + "error": 0.3388671875, + "gradient_norm": 0.07810031622648239, + "elapsed": 23.888731479644775 + }, + { + "group": "d3_bX_center_3_5", + "step": 16, + "loss": 0.43716299533843994, + "error": 0.2177734375, + "gradient_norm": 0.05689458176493645, + "elapsed": 28.204753398895264 + }, + { + "group": "d3_bX_center_3_5", + "step": 32, + "loss": 0.44627559185028076, + "error": 0.208984375, + "gradient_norm": 0.056756604462862015, + "elapsed": 32.84233617782593 + }, + { + "group": "d3_bX_center_3_5", + "step": 48, + "loss": 0.4319554567337036, + "error": 0.234375, + "gradient_norm": 0.05750993266701698, + "elapsed": 37.434494495391846 + }, + { + "group": "d3_bX_center_3_5", + "step": 64, + "loss": 0.2955609858036041, + "error": 0.1279296875, + "gradient_norm": 0.07982950657606125, + "elapsed": 42.03733849525452 + }, + { + "group": "d3_bX_center_3_5", + "step": 80, + "loss": 0.051099054515361786, + "error": 0.01953125, + "gradient_norm": 0.01472504436969757, + "elapsed": 46.64323449134827 + }, + { + "group": "d3_bX_center_3_5", + "step": 96, + "loss": 0.3553770184516907, + "error": 0.1767578125, + "gradient_norm": 0.04556305333971977, + "elapsed": 51.289584159851074 + }, + { + "group": "d3_bX_center_3_5", + "step": 112, + "loss": 0.49853652715682983, + "error": 0.255859375, + "gradient_norm": 0.05837372690439224, + "elapsed": 55.921807527542114 + }, + { + "group": "d3_bX_center_3_5", + "step": 128, + "loss": 0.6128357648849487, + "error": 0.3759765625, + "gradient_norm": 0.04268687590956688, + "elapsed": 60.54293370246887 + }, + { + "group": "d3_bX_center_3_5", + "step": 144, + "loss": 0.40158310532569885, + "error": 0.2109375, + "gradient_norm": 0.06899380683898926, + "elapsed": 66.70903372764587 + }, + { + "group": "d3_bX_center_3_5", + "step": 160, + "loss": 0.6189148426055908, + "error": 0.369140625, + "gradient_norm": 0.049649614840745926, + "elapsed": 71.31301522254944 + }, + { + "group": "d3_bX_center_3_5", + "step": 176, + "loss": 0.5736979246139526, + "error": 0.3271484375, + "gradient_norm": 0.06365907937288284, + "elapsed": 75.90330648422241 + }, + { + "group": "d3_bX_center_3_5", + "step": 192, + "loss": 0.5324695706367493, + "error": 0.294921875, + "gradient_norm": 0.05174271762371063, + "elapsed": 80.51115894317627 + }, + { + "group": "d3_bX_center_3_5", + "step": 208, + "loss": 0.6137855052947998, + "error": 0.3623046875, + "gradient_norm": 0.04891493543982506, + "elapsed": 85.1122133731842 + }, + { + "group": "d3_bX_center_3_5", + "step": 224, + "loss": 0.6262054443359375, + "error": 0.400390625, + "gradient_norm": 0.0478600338101387, + "elapsed": 89.77170705795288 + }, + { + "group": "d3_bX_center_3_5", + "step": 240, + "loss": 0.5114355087280273, + "error": 0.2802734375, + "gradient_norm": 0.06124471500515938, + "elapsed": 94.34836196899414 + }, + { + "group": "d3_bX_center_3_5", + "step": 256, + "loss": 0.3812999129295349, + "error": 0.181640625, + "gradient_norm": 0.050427597016096115, + "elapsed": 98.88006901741028 + } + ] + }, + "d3_bX_center_5_3": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bX_center_5_3", + "parent_model": { + "weights": "weights/contextual-condition_same1-1024.npz", + "training_checkpoint": "condition_same1/1024" + }, + "parent_weights_sha256": "c515815d285cc2eafe52d8ced2df1c754ac578ba54786b98770e15238dc4eaad", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 161233, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_5_3": 11129, + "surface_code_bX_d3_r03_center_5_3": 15369, + "surface_code_bX_d3_r05_center_5_3": 14677, + "surface_code_bX_d3_r07_center_5_3": 9707, + "surface_code_bX_d3_r09_center_5_3": 11152, + "surface_code_bX_d3_r11_center_5_3": 12800, + "surface_code_bX_d3_r13_center_5_3": 13443, + "surface_code_bX_d3_r15_center_5_3": 12388, + "surface_code_bX_d3_r17_center_5_3": 15158, + "surface_code_bX_d3_r19_center_5_3": 10218, + "surface_code_bX_d3_r21_center_5_3": 10711, + "surface_code_bX_d3_r23_center_5_3": 13773, + "surface_code_bX_d3_r25_center_5_3": 10708 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261201, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bX_center_5_3", + "step": 1, + "loss": 0.4805193245410919, + "error": 0.2578125, + "gradient_norm": 0.05444623902440071, + "elapsed": 102.3664813041687 + }, + { + "group": "d3_bX_center_5_3", + "step": 16, + "loss": 0.2784017324447632, + "error": 0.11328125, + "gradient_norm": 0.08824625611305237, + "elapsed": 106.75308656692505 + }, + { + "group": "d3_bX_center_5_3", + "step": 32, + "loss": 0.6410393118858337, + "error": 0.412109375, + "gradient_norm": 0.03859763592481613, + "elapsed": 111.4091112613678 + }, + { + "group": "d3_bX_center_5_3", + "step": 48, + "loss": 0.42605704069137573, + "error": 0.2099609375, + "gradient_norm": 0.050592850893735886, + "elapsed": 116.04315447807312 + }, + { + "group": "d3_bX_center_5_3", + "step": 64, + "loss": 0.5663277506828308, + "error": 0.298828125, + "gradient_norm": 0.055698245763778687, + "elapsed": 120.68257761001587 + }, + { + "group": "d3_bX_center_5_3", + "step": 80, + "loss": 0.6572779417037964, + "error": 0.4267578125, + "gradient_norm": 0.07223570346832275, + "elapsed": 125.41016721725464 + }, + { + "group": "d3_bX_center_5_3", + "step": 96, + "loss": 0.5440086126327515, + "error": 0.2998046875, + "gradient_norm": 0.08954599499702454, + "elapsed": 130.22392392158508 + }, + { + "group": "d3_bX_center_5_3", + "step": 112, + "loss": 0.5094837546348572, + "error": 0.2548828125, + "gradient_norm": 0.06551362574100494, + "elapsed": 134.7945008277893 + }, + { + "group": "d3_bX_center_5_3", + "step": 128, + "loss": 0.5803394317626953, + "error": 0.3193359375, + "gradient_norm": 0.06082230061292648, + "elapsed": 139.35728001594543 + }, + { + "group": "d3_bX_center_5_3", + "step": 144, + "loss": 0.616602897644043, + "error": 0.375, + "gradient_norm": 0.050001099705696106, + "elapsed": 145.55171418190002 + }, + { + "group": "d3_bX_center_5_3", + "step": 160, + "loss": 0.5520708560943604, + "error": 0.2880859375, + "gradient_norm": 0.06085196137428284, + "elapsed": 150.15428566932678 + }, + { + "group": "d3_bX_center_5_3", + "step": 176, + "loss": 0.6117234230041504, + "error": 0.3740234375, + "gradient_norm": 0.0825766772031784, + "elapsed": 154.74532389640808 + }, + { + "group": "d3_bX_center_5_3", + "step": 192, + "loss": 0.5692043304443359, + "error": 0.3203125, + "gradient_norm": 0.07800327241420746, + "elapsed": 159.3635880947113 + }, + { + "group": "d3_bX_center_5_3", + "step": 208, + "loss": 0.30638742446899414, + "error": 0.130859375, + "gradient_norm": 0.049805574119091034, + "elapsed": 163.99608540534973 + }, + { + "group": "d3_bX_center_5_3", + "step": 224, + "loss": 0.5141903758049011, + "error": 0.28515625, + "gradient_norm": 0.06405262649059296, + "elapsed": 168.6415627002716 + }, + { + "group": "d3_bX_center_5_3", + "step": 240, + "loss": 0.5797978639602661, + "error": 0.34765625, + "gradient_norm": 0.10031016170978546, + "elapsed": 173.26013374328613 + }, + { + "group": "d3_bX_center_5_3", + "step": 256, + "loss": 0.2809719741344452, + "error": 0.12890625, + "gradient_norm": 0.04573458060622215, + "elapsed": 177.8879518508911 + } + ] + }, + "d3_bX_center_5_7": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bX_center_5_7", + "parent_model": { + "weights": "weights/contextual-condition_same1-1024.npz", + "training_checkpoint": "condition_same1/1024" + }, + "parent_weights_sha256": "c515815d285cc2eafe52d8ced2df1c754ac578ba54786b98770e15238dc4eaad", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162612, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_5_7": 13532, + "surface_code_bX_d3_r03_center_5_7": 12060, + "surface_code_bX_d3_r05_center_5_7": 14744, + "surface_code_bX_d3_r07_center_5_7": 11642, + "surface_code_bX_d3_r09_center_5_7": 13167, + "surface_code_bX_d3_r11_center_5_7": 8639, + "surface_code_bX_d3_r13_center_5_7": 14627, + "surface_code_bX_d3_r15_center_5_7": 11178, + "surface_code_bX_d3_r17_center_5_7": 10160, + "surface_code_bX_d3_r19_center_5_7": 13125, + "surface_code_bX_d3_r21_center_5_7": 13464, + "surface_code_bX_d3_r23_center_5_7": 13143, + "surface_code_bX_d3_r25_center_5_7": 13131 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261202, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bX_center_5_7", + "step": 1, + "loss": 0.18060244619846344, + "error": 0.0712890625, + "gradient_norm": 0.035179879516363144, + "elapsed": 181.32161450386047 + }, + { + "group": "d3_bX_center_5_7", + "step": 16, + "loss": 0.5082811117172241, + "error": 0.2705078125, + "gradient_norm": 0.07098715752363205, + "elapsed": 185.63990426063538 + }, + { + "group": "d3_bX_center_5_7", + "step": 32, + "loss": 0.5253040790557861, + "error": 0.2880859375, + "gradient_norm": 0.16328570246696472, + "elapsed": 190.24219703674316 + }, + { + "group": "d3_bX_center_5_7", + "step": 48, + "loss": 0.631301760673523, + "error": 0.3994140625, + "gradient_norm": 0.057355962693691254, + "elapsed": 194.84725713729858 + }, + { + "group": "d3_bX_center_5_7", + "step": 64, + "loss": 0.27920418977737427, + "error": 0.1240234375, + "gradient_norm": 0.06183589994907379, + "elapsed": 199.47137212753296 + }, + { + "group": "d3_bX_center_5_7", + "step": 80, + "loss": 0.611309289932251, + "error": 0.3544921875, + "gradient_norm": 0.07737621665000916, + "elapsed": 204.0849051475525 + }, + { + "group": "d3_bX_center_5_7", + "step": 96, + "loss": 0.2803115248680115, + "error": 0.1279296875, + "gradient_norm": 0.05086443945765495, + "elapsed": 208.7057957649231 + }, + { + "group": "d3_bX_center_5_7", + "step": 112, + "loss": 0.5856442451477051, + "error": 0.330078125, + "gradient_norm": 0.09568645805120468, + "elapsed": 213.3731656074524 + }, + { + "group": "d3_bX_center_5_7", + "step": 128, + "loss": 0.6120781898498535, + "error": 0.3486328125, + "gradient_norm": 0.07464266568422318, + "elapsed": 218.0141613483429 + }, + { + "group": "d3_bX_center_5_7", + "step": 144, + "loss": 0.4921022355556488, + "error": 0.24609375, + "gradient_norm": 0.04171774536371231, + "elapsed": 224.291086435318 + }, + { + "group": "d3_bX_center_5_7", + "step": 160, + "loss": 0.6169480085372925, + "error": 0.375, + "gradient_norm": 0.06097063049674034, + "elapsed": 229.43670320510864 + }, + { + "group": "d3_bX_center_5_7", + "step": 176, + "loss": 0.6014459729194641, + "error": 0.3720703125, + "gradient_norm": 0.049403320997953415, + "elapsed": 235.6041157245636 + }, + { + "group": "d3_bX_center_5_7", + "step": 192, + "loss": 0.5643549561500549, + "error": 0.3076171875, + "gradient_norm": 0.034399617463350296, + "elapsed": 242.02996158599854 + }, + { + "group": "d3_bX_center_5_7", + "step": 208, + "loss": 0.04667453467845917, + "error": 0.0146484375, + "gradient_norm": 0.021298106759786606, + "elapsed": 247.37174129486084 + }, + { + "group": "d3_bX_center_5_7", + "step": 224, + "loss": 0.5067787170410156, + "error": 0.2607421875, + "gradient_norm": 0.056687332689762115, + "elapsed": 251.9976110458374 + }, + { + "group": "d3_bX_center_5_7", + "step": 240, + "loss": 0.42991048097610474, + "error": 0.2255859375, + "gradient_norm": 0.061536215245723724, + "elapsed": 256.75613379478455 + }, + { + "group": "d3_bX_center_5_7", + "step": 256, + "loss": 0.47317343950271606, + "error": 0.2529296875, + "gradient_norm": 0.060076676309108734, + "elapsed": 261.4124813079834 + } + ] + }, + "d3_bX_center_7_5": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bX_center_7_5", + "parent_model": { + "weights": "weights/contextual-temporal2-2048.npz", + "training_checkpoint": "temporal2/2048", + "blend_contextual": true + }, + "parent_weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162880, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_7_5": 13450, + "surface_code_bX_d3_r03_center_7_5": 11109, + "surface_code_bX_d3_r05_center_7_5": 14012, + "surface_code_bX_d3_r07_center_7_5": 13898, + "surface_code_bX_d3_r09_center_7_5": 12398, + "surface_code_bX_d3_r11_center_7_5": 9664, + "surface_code_bX_d3_r13_center_7_5": 11550, + "surface_code_bX_d3_r15_center_7_5": 12809, + "surface_code_bX_d3_r17_center_7_5": 10673, + "surface_code_bX_d3_r19_center_7_5": 13751, + "surface_code_bX_d3_r21_center_7_5": 13442, + "surface_code_bX_d3_r23_center_7_5": 13774, + "surface_code_bX_d3_r25_center_7_5": 12350 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261203, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bX_center_7_5", + "step": 1, + "loss": 0.6286593675613403, + "error": 0.3916015625, + "gradient_norm": 0.048550695180892944, + "elapsed": 264.77757954597473 + }, + { + "group": "d3_bX_center_7_5", + "step": 16, + "loss": 0.5998052954673767, + "error": 0.3564453125, + "gradient_norm": 0.04667327180504799, + "elapsed": 269.1457931995392 + }, + { + "group": "d3_bX_center_7_5", + "step": 32, + "loss": 0.6372991800308228, + "error": 0.3984375, + "gradient_norm": 0.03931272402405739, + "elapsed": 273.81044721603394 + }, + { + "group": "d3_bX_center_7_5", + "step": 48, + "loss": 0.32325083017349243, + "error": 0.1455078125, + "gradient_norm": 0.053585249930620193, + "elapsed": 278.48719453811646 + }, + { + "group": "d3_bX_center_7_5", + "step": 64, + "loss": 0.6184052228927612, + "error": 0.3974609375, + "gradient_norm": 0.04405878111720085, + "elapsed": 283.16093349456787 + }, + { + "group": "d3_bX_center_7_5", + "step": 80, + "loss": 0.30300217866897583, + "error": 0.1318359375, + "gradient_norm": 0.03475452959537506, + "elapsed": 287.8628993034363 + }, + { + "group": "d3_bX_center_7_5", + "step": 96, + "loss": 0.4532725214958191, + "error": 0.23828125, + "gradient_norm": 0.053579334169626236, + "elapsed": 292.54087567329407 + }, + { + "group": "d3_bX_center_7_5", + "step": 112, + "loss": 0.5722991824150085, + "error": 0.333984375, + "gradient_norm": 0.05200285091996193, + "elapsed": 297.2698106765747 + }, + { + "group": "d3_bX_center_7_5", + "step": 128, + "loss": 0.47720301151275635, + "error": 0.248046875, + "gradient_norm": 0.08435481041669846, + "elapsed": 301.9647386074066 + }, + { + "group": "d3_bX_center_7_5", + "step": 144, + "loss": 0.49832063913345337, + "error": 0.2666015625, + "gradient_norm": 0.06509781628847122, + "elapsed": 308.208101272583 + }, + { + "group": "d3_bX_center_7_5", + "step": 160, + "loss": 0.05153600126504898, + "error": 0.015625, + "gradient_norm": 0.018944455310702324, + "elapsed": 312.88946986198425 + }, + { + "group": "d3_bX_center_7_5", + "step": 176, + "loss": 0.3049379885196686, + "error": 0.1376953125, + "gradient_norm": 0.03572608530521393, + "elapsed": 317.5962097644806 + }, + { + "group": "d3_bX_center_7_5", + "step": 192, + "loss": 0.4833422899246216, + "error": 0.2275390625, + "gradient_norm": 0.11588290333747864, + "elapsed": 322.2771329879761 + }, + { + "group": "d3_bX_center_7_5", + "step": 208, + "loss": 0.5812653303146362, + "error": 0.34765625, + "gradient_norm": 0.04924288019537926, + "elapsed": 326.9544439315796 + }, + { + "group": "d3_bX_center_7_5", + "step": 224, + "loss": 0.5518968105316162, + "error": 0.2919921875, + "gradient_norm": 0.049676258116960526, + "elapsed": 331.7683095932007 + }, + { + "group": "d3_bX_center_7_5", + "step": 240, + "loss": 0.599678099155426, + "error": 0.353515625, + "gradient_norm": 0.09019427001476288, + "elapsed": 337.0053963661194 + }, + { + "group": "d3_bX_center_7_5", + "step": 256, + "loss": 0.6168051362037659, + "error": 0.373046875, + "gradient_norm": 0.045873139053583145, + "elapsed": 342.27088832855225 + } + ] + }, + "d3_bZ_center_3_5": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bZ_center_3_5", + "parent_model": { + "weights": "weights/contextual-condition_same1-512.npz", + "training_checkpoint": "condition_same1/512" + }, + "parent_weights_sha256": "4cf3ebae65f19ed882d90aac2157db4127d715f9c688c987280c9aac28efad84", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162257, + "unique_rows_by_condition": { + "surface_code_bZ_d3_r01_center_3_5": 13149, + "surface_code_bZ_d3_r03_center_3_5": 12112, + "surface_code_bZ_d3_r05_center_3_5": 12434, + "surface_code_bZ_d3_r07_center_3_5": 13778, + "surface_code_bZ_d3_r09_center_3_5": 12830, + "surface_code_bZ_d3_r11_center_3_5": 6034, + "surface_code_bZ_d3_r13_center_3_5": 13524, + "surface_code_bZ_d3_r15_center_3_5": 13160, + "surface_code_bZ_d3_r17_center_3_5": 12823, + "surface_code_bZ_d3_r19_center_3_5": 11129, + "surface_code_bZ_d3_r21_center_3_5": 13793, + "surface_code_bZ_d3_r23_center_3_5": 14080, + "surface_code_bZ_d3_r25_center_3_5": 13411 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261204, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bZ_center_3_5", + "step": 1, + "loss": 0.36515435576438904, + "error": 0.17578125, + "gradient_norm": 0.068653903901577, + "elapsed": 346.68829584121704 + }, + { + "group": "d3_bZ_center_3_5", + "step": 16, + "loss": 0.2806941568851471, + "error": 0.1318359375, + "gradient_norm": 0.06498919427394867, + "elapsed": 352.6486053466797 + }, + { + "group": "d3_bZ_center_3_5", + "step": 32, + "loss": 0.5172728300094604, + "error": 0.2578125, + "gradient_norm": 0.06919123977422714, + "elapsed": 358.0916488170624 + }, + { + "group": "d3_bZ_center_3_5", + "step": 48, + "loss": 0.5654157400131226, + "error": 0.3134765625, + "gradient_norm": 0.062110695987939835, + "elapsed": 364.1197271347046 + }, + { + "group": "d3_bZ_center_3_5", + "step": 64, + "loss": 0.5950935482978821, + "error": 0.349609375, + "gradient_norm": 0.06901932507753372, + "elapsed": 370.44589829444885 + }, + { + "group": "d3_bZ_center_3_5", + "step": 80, + "loss": 0.3655591607093811, + "error": 0.1865234375, + "gradient_norm": 0.06035780534148216, + "elapsed": 376.3442976474762 + }, + { + "group": "d3_bZ_center_3_5", + "step": 96, + "loss": 0.5849340558052063, + "error": 0.345703125, + "gradient_norm": 0.0669141560792923, + "elapsed": 381.8527054786682 + }, + { + "group": "d3_bZ_center_3_5", + "step": 112, + "loss": 0.04215944558382034, + "error": 0.013671875, + "gradient_norm": 0.029389331117272377, + "elapsed": 386.54820346832275 + }, + { + "group": "d3_bZ_center_3_5", + "step": 128, + "loss": 0.619553804397583, + "error": 0.3876953125, + "gradient_norm": 0.053926873952150345, + "elapsed": 391.31534695625305 + }, + { + "group": "d3_bZ_center_3_5", + "step": 144, + "loss": 0.3793254494667053, + "error": 0.1923828125, + "gradient_norm": 0.07844529300928116, + "elapsed": 397.51641821861267 + }, + { + "group": "d3_bZ_center_3_5", + "step": 160, + "loss": 0.3429756164550781, + "error": 0.1572265625, + "gradient_norm": 0.06213530898094177, + "elapsed": 402.1174716949463 + }, + { + "group": "d3_bZ_center_3_5", + "step": 176, + "loss": 0.2883482277393341, + "error": 0.1416015625, + "gradient_norm": 0.07786665111780167, + "elapsed": 406.72908902168274 + }, + { + "group": "d3_bZ_center_3_5", + "step": 192, + "loss": 0.03280383348464966, + "error": 0.0087890625, + "gradient_norm": 0.035463444888591766, + "elapsed": 411.33272552490234 + }, + { + "group": "d3_bZ_center_3_5", + "step": 208, + "loss": 0.6251656413078308, + "error": 0.38671875, + "gradient_norm": 0.08498021215200424, + "elapsed": 415.93534207344055 + }, + { + "group": "d3_bZ_center_3_5", + "step": 224, + "loss": 0.43049943447113037, + "error": 0.232421875, + "gradient_norm": 0.08405832201242447, + "elapsed": 420.54495644569397 + }, + { + "group": "d3_bZ_center_3_5", + "step": 240, + "loss": 0.5978946089744568, + "error": 0.3349609375, + "gradient_norm": 0.06633604317903519, + "elapsed": 425.1712546348572 + }, + { + "group": "d3_bZ_center_3_5", + "step": 256, + "loss": 0.5690029859542847, + "error": 0.341796875, + "gradient_norm": 0.06171220913529396, + "elapsed": 430.0519812107086 + } + ] + }, + "d3_bZ_center_5_3": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bZ_center_5_3", + "parent_model": { + "weights": "weights/contextual-temporal2-2048.npz", + "training_checkpoint": "temporal2/2048" + }, + "parent_weights_sha256": "ab1175f9ef7ed52106ce1127b7da91bfc3d91782c0a2fec2f8189f661e3679db", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162569, + "unique_rows_by_condition": { + "surface_code_bZ_d3_r01_center_5_3": 11619, + "surface_code_bZ_d3_r03_center_5_3": 13126, + "surface_code_bZ_d3_r05_center_5_3": 12742, + "surface_code_bZ_d3_r07_center_5_3": 9136, + "surface_code_bZ_d3_r09_center_5_3": 15337, + "surface_code_bZ_d3_r11_center_5_3": 11996, + "surface_code_bZ_d3_r13_center_5_3": 12732, + "surface_code_bZ_d3_r15_center_5_3": 13128, + "surface_code_bZ_d3_r17_center_5_3": 14689, + "surface_code_bZ_d3_r19_center_5_3": 11983, + "surface_code_bZ_d3_r21_center_5_3": 11992, + "surface_code_bZ_d3_r23_center_5_3": 11625, + "surface_code_bZ_d3_r25_center_5_3": 12464 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261205, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bZ_center_5_3", + "step": 1, + "loss": 0.6346971988677979, + "error": 0.3818359375, + "gradient_norm": 0.046160198748111725, + "elapsed": 433.7457048892975 + }, + { + "group": "d3_bZ_center_5_3", + "step": 16, + "loss": 0.46678581833839417, + "error": 0.23828125, + "gradient_norm": 0.04110230877995491, + "elapsed": 438.16989040374756 + }, + { + "group": "d3_bZ_center_5_3", + "step": 32, + "loss": 0.17910712957382202, + "error": 0.064453125, + "gradient_norm": 0.030056120827794075, + "elapsed": 442.8582558631897 + }, + { + "group": "d3_bZ_center_5_3", + "step": 48, + "loss": 0.5041052103042603, + "error": 0.27734375, + "gradient_norm": 0.045486729592084885, + "elapsed": 447.66860795021057 + }, + { + "group": "d3_bZ_center_5_3", + "step": 64, + "loss": 0.5663014054298401, + "error": 0.310546875, + "gradient_norm": 0.04649529233574867, + "elapsed": 452.51550030708313 + }, + { + "group": "d3_bZ_center_5_3", + "step": 80, + "loss": 0.5388609766960144, + "error": 0.2841796875, + "gradient_norm": 0.05346957594156265, + "elapsed": 457.18010997772217 + }, + { + "group": "d3_bZ_center_5_3", + "step": 96, + "loss": 0.6176578998565674, + "error": 0.375, + "gradient_norm": 0.08028864115476608, + "elapsed": 461.89074301719666 + }, + { + "group": "d3_bZ_center_5_3", + "step": 112, + "loss": 0.6225342750549316, + "error": 0.36328125, + "gradient_norm": 0.030471889302134514, + "elapsed": 466.5776717662811 + }, + { + "group": "d3_bZ_center_5_3", + "step": 128, + "loss": 0.2725566625595093, + "error": 0.111328125, + "gradient_norm": 0.05236189067363739, + "elapsed": 471.32313442230225 + }, + { + "group": "d3_bZ_center_5_3", + "step": 144, + "loss": 0.6361372470855713, + "error": 0.3984375, + "gradient_norm": 0.07191100716590881, + "elapsed": 478.3580629825592 + }, + { + "group": "d3_bZ_center_5_3", + "step": 160, + "loss": 0.2549514174461365, + "error": 0.1025390625, + "gradient_norm": 0.0485384576022625, + "elapsed": 484.5399954319 + }, + { + "group": "d3_bZ_center_5_3", + "step": 176, + "loss": 0.06202135607600212, + "error": 0.0205078125, + "gradient_norm": 0.01821581833064556, + "elapsed": 490.2966978549957 + }, + { + "group": "d3_bZ_center_5_3", + "step": 192, + "loss": 0.5546645522117615, + "error": 0.296875, + "gradient_norm": 0.07931670546531677, + "elapsed": 496.1227023601532 + }, + { + "group": "d3_bZ_center_5_3", + "step": 208, + "loss": 0.2724062502384186, + "error": 0.1220703125, + "gradient_norm": 0.0482773631811142, + "elapsed": 501.8398952484131 + }, + { + "group": "d3_bZ_center_5_3", + "step": 224, + "loss": 0.6230898499488831, + "error": 0.3671875, + "gradient_norm": 0.05214303359389305, + "elapsed": 508.2803044319153 + }, + { + "group": "d3_bZ_center_5_3", + "step": 240, + "loss": 0.4187527894973755, + "error": 0.2080078125, + "gradient_norm": 0.046042900532484055, + "elapsed": 513.7485942840576 + }, + { + "group": "d3_bZ_center_5_3", + "step": 256, + "loss": 0.5760256052017212, + "error": 0.3271484375, + "gradient_norm": 0.03505929186940193, + "elapsed": 519.0282807350159 + } + ] + }, + "d3_bZ_center_5_7": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bZ_center_5_7", + "parent_model": { + "weights": "weights/contextual-temporal2-4096.npz", + "training_checkpoint": "temporal2/4096" + }, + "parent_weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 163281, + "unique_rows_by_condition": { + "surface_code_bZ_d3_r01_center_5_7": 11175, + "surface_code_bZ_d3_r03_center_5_7": 13171, + "surface_code_bZ_d3_r05_center_5_7": 12697, + "surface_code_bZ_d3_r07_center_5_7": 11648, + "surface_code_bZ_d3_r09_center_5_7": 14077, + "surface_code_bZ_d3_r11_center_5_7": 13454, + "surface_code_bZ_d3_r13_center_5_7": 11564, + "surface_code_bZ_d3_r15_center_5_7": 12728, + "surface_code_bZ_d3_r17_center_5_7": 12048, + "surface_code_bZ_d3_r19_center_5_7": 14459, + "surface_code_bZ_d3_r21_center_5_7": 14010, + "surface_code_bZ_d3_r23_center_5_7": 10239, + "surface_code_bZ_d3_r25_center_5_7": 12011 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261206, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bZ_center_5_7", + "step": 1, + "loss": 0.5979939103126526, + "error": 0.357421875, + "gradient_norm": 0.0660991370677948, + "elapsed": 523.6322765350342 + }, + { + "group": "d3_bZ_center_5_7", + "step": 16, + "loss": 0.6150602102279663, + "error": 0.3701171875, + "gradient_norm": 0.04266919568181038, + "elapsed": 528.4157238006592 + }, + { + "group": "d3_bZ_center_5_7", + "step": 32, + "loss": 0.44577696919441223, + "error": 0.2099609375, + "gradient_norm": 0.06689892709255219, + "elapsed": 533.0822012424469 + }, + { + "group": "d3_bZ_center_5_7", + "step": 48, + "loss": 0.4075019657611847, + "error": 0.1884765625, + "gradient_norm": 0.05801992863416672, + "elapsed": 537.763840675354 + }, + { + "group": "d3_bZ_center_5_7", + "step": 64, + "loss": 0.5356203317642212, + "error": 0.2939453125, + "gradient_norm": 0.0543823316693306, + "elapsed": 542.4880893230438 + }, + { + "group": "d3_bZ_center_5_7", + "step": 80, + "loss": 0.45208629965782166, + "error": 0.2275390625, + "gradient_norm": 0.05819695070385933, + "elapsed": 547.1561362743378 + }, + { + "group": "d3_bZ_center_5_7", + "step": 96, + "loss": 0.4151451587677002, + "error": 0.2119140625, + "gradient_norm": 0.07201892882585526, + "elapsed": 551.8683395385742 + }, + { + "group": "d3_bZ_center_5_7", + "step": 112, + "loss": 0.5576318502426147, + "error": 0.31640625, + "gradient_norm": 0.04457806423306465, + "elapsed": 556.642165184021 + }, + { + "group": "d3_bZ_center_5_7", + "step": 128, + "loss": 0.20078304409980774, + "error": 0.08984375, + "gradient_norm": 0.040219370275735855, + "elapsed": 561.4243121147156 + }, + { + "group": "d3_bZ_center_5_7", + "step": 144, + "loss": 0.45917582511901855, + "error": 0.2236328125, + "gradient_norm": 0.0707971602678299, + "elapsed": 567.7284438610077 + }, + { + "group": "d3_bZ_center_5_7", + "step": 160, + "loss": 0.5936293601989746, + "error": 0.345703125, + "gradient_norm": 0.12180078029632568, + "elapsed": 572.3563349246979 + }, + { + "group": "d3_bZ_center_5_7", + "step": 176, + "loss": 0.24654456973075867, + "error": 0.1044921875, + "gradient_norm": 0.04859209433197975, + "elapsed": 577.008533000946 + }, + { + "group": "d3_bZ_center_5_7", + "step": 192, + "loss": 0.4809238612651825, + "error": 0.2509765625, + "gradient_norm": 0.09741280972957611, + "elapsed": 581.7403192520142 + }, + { + "group": "d3_bZ_center_5_7", + "step": 208, + "loss": 0.36378931999206543, + "error": 0.166015625, + "gradient_norm": 0.04881134256720543, + "elapsed": 586.367921590805 + }, + { + "group": "d3_bZ_center_5_7", + "step": 224, + "loss": 0.5131937265396118, + "error": 0.279296875, + "gradient_norm": 0.08562120050191879, + "elapsed": 591.1944098472595 + }, + { + "group": "d3_bZ_center_5_7", + "step": 240, + "loss": 0.4193183183670044, + "error": 0.2099609375, + "gradient_norm": 0.0680096298456192, + "elapsed": 595.8478200435638 + }, + { + "group": "d3_bZ_center_5_7", + "step": 256, + "loss": 0.467867910861969, + "error": 0.24609375, + "gradient_norm": 0.07342159003019333, + "elapsed": 600.4172458648682 + } + ] + }, + "d3_bZ_center_7_5": { + "initialization": "Continue the temporal component of the selected session-trained group decoder; no new random parameters", + "original_initialization": "Base rich network seed20261030 and temporal encoder seed20261104; all fitting occurred in this session", + "group": "d3_bZ_center_7_5", + "parent_model": { + "weights": "weights/contextual-temporal2-4096.npz", + "training_checkpoint": "temporal2/4096" + }, + "parent_weights_sha256": "5ca716cd5632c9b717bb167d187387483b5485fead55f45b25cc44325d5d18ea", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "training": "Uniform sampling over all13 odd round counts for this geometry/basis group, supplied training labels only", + "eligible_training_shots": 258440, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 159856, + "unique_rows_by_condition": { + "surface_code_bZ_d3_r01_center_7_5": 10637, + "surface_code_bZ_d3_r03_center_7_5": 13460, + "surface_code_bZ_d3_r05_center_7_5": 12002, + "surface_code_bZ_d3_r07_center_7_5": 8000, + "surface_code_bZ_d3_r09_center_7_5": 10743, + "surface_code_bZ_d3_r11_center_7_5": 16789, + "surface_code_bZ_d3_r13_center_7_5": 12364, + "surface_code_bZ_d3_r15_center_7_5": 15213, + "surface_code_bZ_d3_r17_center_7_5": 14167, + "surface_code_bZ_d3_r19_center_7_5": 11099, + "surface_code_bZ_d3_r21_center_7_5": 13178, + "surface_code_bZ_d3_r23_center_7_5": 12014, + "surface_code_bZ_d3_r25_center_7_5": 10190 + }, + "steps": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global norm clip1", + "optimizer_restored": false, + "rng_restored": false, + "sampling_seed": 20261207, + "validation": "Fixed random screen per condition using seed20261028; full validation is used by the separate selector", + "validation_shots_requested_per_condition": 1024, + "loss": "Uniform binary conditional logical likelihood through exact frontier contraction", + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "test_data_used": false, + "log": [ + { + "group": "d3_bZ_center_7_5", + "step": 1, + "loss": 0.4038092792034149, + "error": 0.197265625, + "gradient_norm": 0.05896063148975372, + "elapsed": 603.840416431427 + }, + { + "group": "d3_bZ_center_7_5", + "step": 16, + "loss": 0.6033527851104736, + "error": 0.3515625, + "gradient_norm": 0.05784430727362633, + "elapsed": 608.1250426769257 + }, + { + "group": "d3_bZ_center_7_5", + "step": 32, + "loss": 0.5283372402191162, + "error": 0.283203125, + "gradient_norm": 0.050800539553165436, + "elapsed": 612.7134759426117 + }, + { + "group": "d3_bZ_center_7_5", + "step": 48, + "loss": 0.5995811820030212, + "error": 0.3291015625, + "gradient_norm": 0.05547967553138733, + "elapsed": 617.2784404754639 + }, + { + "group": "d3_bZ_center_7_5", + "step": 64, + "loss": 0.40154707431793213, + "error": 0.205078125, + "gradient_norm": 0.06852669268846512, + "elapsed": 621.8420352935791 + }, + { + "group": "d3_bZ_center_7_5", + "step": 80, + "loss": 0.4995174705982208, + "error": 0.2763671875, + "gradient_norm": 0.061341386288404465, + "elapsed": 626.40260887146 + }, + { + "group": "d3_bZ_center_7_5", + "step": 96, + "loss": 0.5751184225082397, + "error": 0.3251953125, + "gradient_norm": 0.07929262518882751, + "elapsed": 630.9725329875946 + }, + { + "group": "d3_bZ_center_7_5", + "step": 112, + "loss": 0.624832808971405, + "error": 0.369140625, + "gradient_norm": 0.045014865696430206, + "elapsed": 635.5494453907013 + }, + { + "group": "d3_bZ_center_7_5", + "step": 128, + "loss": 0.4616764783859253, + "error": 0.224609375, + "gradient_norm": 0.0743650421500206, + "elapsed": 640.093489408493 + }, + { + "group": "d3_bZ_center_7_5", + "step": 144, + "loss": 0.5214440822601318, + "error": 0.2724609375, + "gradient_norm": 0.05418862774968147, + "elapsed": 646.2130215167999 + }, + { + "group": "d3_bZ_center_7_5", + "step": 160, + "loss": 0.27278852462768555, + "error": 0.12109375, + "gradient_norm": 0.059856753796339035, + "elapsed": 650.7696936130524 + }, + { + "group": "d3_bZ_center_7_5", + "step": 176, + "loss": 0.5251824259757996, + "error": 0.2734375, + "gradient_norm": 0.0982872024178505, + "elapsed": 655.3179745674133 + }, + { + "group": "d3_bZ_center_7_5", + "step": 192, + "loss": 0.510776937007904, + "error": 0.2744140625, + "gradient_norm": 0.0638406053185463, + "elapsed": 659.8532302379608 + }, + { + "group": "d3_bZ_center_7_5", + "step": 208, + "loss": 0.4173796772956848, + "error": 0.20703125, + "gradient_norm": 0.0652337446808815, + "elapsed": 664.3970146179199 + }, + { + "group": "d3_bZ_center_7_5", + "step": 224, + "loss": 0.42136240005493164, + "error": 0.203125, + "gradient_norm": 0.04171523451805115, + "elapsed": 668.9384174346924 + }, + { + "group": "d3_bZ_center_7_5", + "step": 240, + "loss": 0.2494639754295349, + "error": 0.1201171875, + "gradient_norm": 0.06969694793224335, + "elapsed": 673.4954979419708 + }, + { + "group": "d3_bZ_center_7_5", + "step": 256, + "loss": 0.26821407675743103, + "error": 0.1181640625, + "gradient_norm": 0.04254033416509628, + "elapsed": 678.0544662475586 + } + ] + } + }, + "initialization": "Continue session-trained selected temporal components; no new random parameters", + "training": "Each group samples uniformly over its own13 durations; supplied training labels only", + "eligible_training_shots": 2067520, + "steps": 2048, + "steps_per_group": 256, + "batch_size": 1024, + "learning_rate": 0.0001, + "optimizer_restored": false, + "rng_restored": false, + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "run_config": { + "package": "/run-state/workspace/research/context_upgrades/short_categorical3/package", + "output": "/run-state/workspace/research/learned_exact/group_specialize1", + "steps": 256, + "eval_every": 128, + "batch": 1024, + "validation_shots": 1024, + "validation_batch": 1024, + "learning_rate": 0.0001, + "seed": 20261200, + "groups": [ + "d3_bX_center_3_5", + "d3_bX_center_5_3", + "d3_bX_center_5_7", + "d3_bX_center_7_5", + "d3_bZ_center_3_5", + "d3_bZ_center_5_3", + "d3_bZ_center_5_7", + "d3_bZ_center_7_5" + ], + "training_source_sha256": { + "learned_exact__specialize_train.py": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "learned_exact__temporal_model.py": "76fd01d5ae50f7d0b5790800898e7103ddb86db8f6a2ace883407515add2e186", + "learned_exact__data.py": "6f88582230aec7bbf35170a672ff615cac0cf18c0a690b2983874bb4c02c75e6", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "parent_config_sha256": "50123b5d6a4515814bb74a93963e83d17c2d3eb47af4d12b7757f523ac7c2f6a", + "parent_provenance_sha256": "7c76c4ba7b6bb90ddb1ac3fa9cd5d27788fdad2bf6bc6f95e8187824c971bdfb", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "validation_manifest_sha256": "482bb7268c6c827ebbf1f756ee6994750acfcd011adab08eaa2ada703e5faea1" + }, + "parent_record": "training_sources/group_specialize1/parent_training_provenance.json", + "new_random_parameters": 0, + "training_draws": 2097152, + "test_data_used": false, + "declared_plan": { + "hypothesis": "Group-specific fine-tuning may reduce conflicting updates across d3 geometries and bases", + "parents": "The temporal component selected for each of the8 groups in CURRENT after fresh2_continuation_finished.json", + "new_random_parameters": 0, + "sampling_seeds": "20261200 plus lexicographic group rank0..7", + "training": "256 updates per group,B1024,LR.0001; uniform sampling of all13 durations and all258440 training rows per group", + "optimizer": "Fresh AdamW moments for every group, weight decay1e-4, global gradient norm clip1", + "total_optimizer_updates": 2048, + "total_training_draws": 2097152, + "validation": "Screen at0/128/256. Full validation at0/128/256; step0 is a diagnostic, excluded from new checkpoint selection", + "selection": "Per-group mean failure over all13 durations: incumbent, raw128/256, or equal small-contextual blend128/256; retain incumbent on ties", + "short_model_followup": "Recheck the previously training-fitted categorical1 heads after group replacement", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "selection_eligible": false, + "submission_eligible": false, + "trainer_sha256": "5a2e7ba25969f4599cb65d60cbd53544fd77d7a6926ec0d03662b72b151acf95", + "run": "/run-state/workspace/research/learned_exact/specialize_smoke2", + "checks": [ + { + "group": "d3_bX_center_3_5", + "parent_exact": true, + "fresh_zero_optimizer": true, + "one_update_changes_parameters": true, + "sampling_replay_exact": true, + "all13_durations_evaluated": true + }, + { + "group": "d3_bZ_center_7_5", + "parent_exact": true, + "fresh_zero_optimizer": true, + "one_update_changes_parameters": true, + "sampling_replay_exact": true, + "all13_durations_evaluated": true + } + ], + "test_data_used": false + } + }, + "training_source_snapshot": "training_sources/group_specialize1", + "selected_checkpoints": { + "d3_bX_center_3_5": 128, + "d3_bX_center_5_7": 256, + "d3_bX_center_7_5": 128, + "d3_bZ_center_7_5": 128 + }, + "checkpoint_records": { + "d3_bX_center_3_5": { + "group": "d3_bX_center_3_5", + "step": 128, + "training_draws": 131072, + "unique_training_rows_seen_in_this_phase": 101608, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_3_5": 7393, + "surface_code_bX_d3_r03_center_3_5": 9191, + "surface_code_bX_d3_r05_center_3_5": 9634, + "surface_code_bX_d3_r07_center_3_5": 9218, + "surface_code_bX_d3_r09_center_3_5": 6691, + "surface_code_bX_d3_r11_center_3_5": 6028, + "surface_code_bX_d3_r13_center_3_5": 9122, + "surface_code_bX_d3_r15_center_3_5": 5301, + "surface_code_bX_d3_r17_center_3_5": 8630, + "surface_code_bX_d3_r19_center_3_5": 5276, + "surface_code_bX_d3_r21_center_3_5": 8553, + "surface_code_bX_d3_r23_center_3_5": 7977, + "surface_code_bX_d3_r25_center_3_5": 8594 + }, + "weights": "weights-128.npz", + "weights_sha256": "90c6cb7fd3be8d363318f45257de6670ba19d9336d096dc3efb309bac88b2bf9", + "complete": true + }, + "d3_bX_center_5_7": { + "group": "d3_bX_center_5_7", + "step": 256, + "training_draws": 262144, + "unique_training_rows_seen_in_this_phase": 162612, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_5_7": 13532, + "surface_code_bX_d3_r03_center_5_7": 12060, + "surface_code_bX_d3_r05_center_5_7": 14744, + "surface_code_bX_d3_r07_center_5_7": 11642, + "surface_code_bX_d3_r09_center_5_7": 13167, + "surface_code_bX_d3_r11_center_5_7": 8639, + "surface_code_bX_d3_r13_center_5_7": 14627, + "surface_code_bX_d3_r15_center_5_7": 11178, + "surface_code_bX_d3_r17_center_5_7": 10160, + "surface_code_bX_d3_r19_center_5_7": 13125, + "surface_code_bX_d3_r21_center_5_7": 13464, + "surface_code_bX_d3_r23_center_5_7": 13143, + "surface_code_bX_d3_r25_center_5_7": 13131 + }, + "weights": "weights-256.npz", + "weights_sha256": "7dc5b5ed51423bae023bb2c15de420850fef4fedb82760a7bcd993393301e038", + "complete": true + }, + "d3_bX_center_7_5": { + "group": "d3_bX_center_7_5", + "step": 128, + "training_draws": 131072, + "unique_training_rows_seen_in_this_phase": 101875, + "unique_rows_by_condition": { + "surface_code_bX_d3_r01_center_7_5": 7327, + "surface_code_bX_d3_r03_center_7_5": 6711, + "surface_code_bX_d3_r05_center_7_5": 9068, + "surface_code_bX_d3_r07_center_7_5": 9212, + "surface_code_bX_d3_r09_center_7_5": 6001, + "surface_code_bX_d3_r11_center_7_5": 7353, + "surface_code_bX_d3_r13_center_7_5": 7373, + "surface_code_bX_d3_r15_center_7_5": 8580, + "surface_code_bX_d3_r17_center_7_5": 6713, + "surface_code_bX_d3_r19_center_7_5": 9686, + "surface_code_bX_d3_r21_center_7_5": 8553, + "surface_code_bX_d3_r23_center_7_5": 7325, + "surface_code_bX_d3_r25_center_7_5": 7973 + }, + "weights": "weights-128.npz", + "weights_sha256": "1dc16b14813ebfd874acf9c907870144bc6ac98c8de8b4e8c47e41cdcfb3f1c3", + "complete": true + }, + "d3_bZ_center_7_5": { + "group": "d3_bZ_center_7_5", + "step": 128, + "training_draws": 131072, + "unique_training_rows_seen_in_this_phase": 101460, + "unique_rows_by_condition": { + "surface_code_bZ_d3_r01_center_7_5": 7386, + "surface_code_bZ_d3_r03_center_7_5": 7382, + "surface_code_bZ_d3_r05_center_7_5": 7375, + "surface_code_bZ_d3_r07_center_7_5": 4523, + "surface_code_bZ_d3_r09_center_7_5": 6016, + "surface_code_bZ_d3_r11_center_7_5": 10680, + "surface_code_bZ_d3_r13_center_7_5": 9644, + "surface_code_bZ_d3_r15_center_7_5": 7341, + "surface_code_bZ_d3_r17_center_7_5": 9210, + "surface_code_bZ_d3_r19_center_7_5": 8536, + "surface_code_bZ_d3_r21_center_7_5": 7410, + "surface_code_bZ_d3_r23_center_7_5": 8625, + "surface_code_bZ_d3_r25_center_7_5": 7332 + }, + "weights": "weights-128.npz", + "weights_sha256": "8f78092b6539927132aebd28deb0e0d1b72f43596b79e074e3206f4a784dd000", + "complete": true + } + }, + "selection": "Minimum full-validation mean failure across all13 durations per group among incumbent, specialized128/256 and equal small-contextual blends; retain incumbent on ties", + "blend_reference": "/run-state/workspace/research/context_upgrades/continuation2/predictions", + "history": [ + { + "group": "d3_bX_center_3_5", + "candidates": { + "incumbent": 0.24451622596153846, + "128": 0.2444110576923077, + "blend-128": 0.24523737980769234, + "256": 0.24468149038461534, + "blend-256": 0.24532752403846156 + }, + "selected": "128" + }, + { + "group": "d3_bX_center_5_3", + "candidates": { + "incumbent": 0.2526592548076923, + "128": 0.2528094951923077, + "blend-128": 0.25312499999999993, + "256": 0.2532001201923077, + "blend-256": 0.25318509615384616 + }, + "selected": "incumbent" + }, + { + "group": "d3_bX_center_5_7", + "candidates": { + "incumbent": 0.2333984375, + "128": 0.23329326923076926, + "blend-128": 0.23414963942307693, + "256": 0.233203125, + "blend-256": 0.2338641826923077 + }, + "selected": "256" + }, + { + "group": "d3_bX_center_7_5", + "candidates": { + "incumbent": 0.23889723557692305, + "128": 0.23933293269230768, + "blend-128": 0.23880709134615385, + "256": 0.23907752403846153, + "blend-256": 0.23888221153846154 + }, + "selected": "blend-128" + }, + { + "group": "d3_bZ_center_3_5", + "candidates": { + "incumbent": 0.24447115384615387, + "128": 0.24456129807692306, + "blend-128": 0.24534254807692307, + "256": 0.24462139423076923, + "blend-256": 0.24505709134615386 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_5_3", + "candidates": { + "incumbent": 0.23652343749999996, + "128": 0.2371394230769231, + "blend-128": 0.23753004807692307, + "256": 0.2373347355769231, + "blend-256": 0.23728966346153849 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_5_7", + "candidates": { + "incumbent": 0.2356670673076923, + "128": 0.23635817307692306, + "blend-128": 0.23662860576923073, + "256": 0.23571213942307687, + "blend-256": 0.23638822115384614 + }, + "selected": "incumbent" + }, + { + "group": "d3_bZ_center_7_5", + "candidates": { + "incumbent": 0.23294771634615385, + "128": 0.23282752403846158, + "blend-128": 0.2331280048076923, + "256": 0.23348858173076922, + "blend-256": 0.23336838942307692 + }, + "selected": "128" + }, + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23228665865384618 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.21953124999999998 + }, + "selected": "incumbent" + } + ] + } + ], + "turbo_d5_experiment": { + "method": "Three passes of extrinsic log-odds feedback between complementary exact CSS syndrome-likelihood contractions, damping 1, messages clipped to [-8,8]. Induced dependencies are approximated.", + "initialization": "Logistic coefficients randomly initialized Normal(0,.01), seed 20261103; all underlying states built in this session from permitted even-fitted DEMs.", + "training": "4096 uniformly sampled training rows per all 26 d5 conditions (sample seed 20261023); BCE plus 1e-5 L2, L-BFGS-B up to 300 iterations.", + "screen": { + "scope": "Diagnostic screen only: both d5 bases, rounds 5/13/25, 1024 uniform validation samples per condition", + "sample_seed": 20261031, + "results": [ + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "rounds": 5, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 5.466358661651611, + "elapsed": 7.00129771232605, + "first_pass_max_delta": 8.940696716308594e-07, + "failure": [ + 0.1025390625, + 0.1044921875, + 0.1025390625 + ], + "peak_gpu_bytes": 4742925056 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "rounds": 5, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 1.1764235496520996, + "elapsed": 8.178237438201904, + "first_pass_max_delta": 8.940696716308594e-07, + "failure": [ + 0.1025390625, + 0.0966796875, + 0.1005859375 + ], + "peak_gpu_bytes": 4742925056 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "rounds": 13, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 7.137438058853149, + "elapsed": 16.021901607513428, + "first_pass_max_delta": 1.1324882507324219e-06, + "failure": [ + 0.2548828125, + 0.2490234375, + 0.25 + ], + "peak_gpu_bytes": 11611887104 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "rounds": 13, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 3.088695526123047, + "elapsed": 19.11112403869629, + "first_pass_max_delta": 1.1324882507324219e-06, + "failure": [ + 0.2548828125, + 0.2490234375, + 0.2412109375 + ], + "peak_gpu_bytes": 11611887104 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "rounds": 25, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 10.504217624664307, + "elapsed": 30.677946090698242, + "first_pass_max_delta": 1.5497207641601562e-06, + "failure": [ + 0.3916015625, + 0.38671875, + 0.3896484375 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "rounds": 25, + "basis": "X", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 5.937381267547607, + "elapsed": 36.615668296813965, + "first_pass_max_delta": 1.5497207641601562e-06, + "failure": [ + 0.3916015625, + 0.3857421875, + 0.3896484375 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "rounds": 5, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 4.611798286437988, + "elapsed": 41.71111083030701, + "first_pass_max_delta": 2.0265579223632812e-06, + "failure": [ + 0.1005859375, + 0.1015625, + 0.09765625 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "rounds": 5, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 1.1570250988006592, + "elapsed": 42.86858010292053, + "first_pass_max_delta": 2.0265579223632812e-06, + "failure": [ + 0.1005859375, + 0.0986328125, + 0.095703125 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "rounds": 13, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 6.715797185897827, + "elapsed": 50.234126567840576, + "first_pass_max_delta": 1.0132789611816406e-06, + "failure": [ + 0.236328125, + 0.234375, + 0.2314453125 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "rounds": 13, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 3.08017635345459, + "elapsed": 53.31461310386658, + "first_pass_max_delta": 1.0132789611816406e-06, + "failure": [ + 0.236328125, + 0.23828125, + 0.234375 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "rounds": 25, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 0.5, + "seconds": 9.802945375442505, + "elapsed": 64.01536726951599, + "first_pass_max_delta": 1.4901161193847656e-06, + "failure": [ + 0.384765625, + 0.3857421875, + 0.38671875 + ], + "peak_gpu_bytes": 21913887488 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "rounds": 25, + "basis": "Z", + "shots": 1024, + "batch": 192, + "damping": 1.0, + "seconds": 5.927323341369629, + "elapsed": 69.9429976940155, + "first_pass_max_delta": 1.4901161193847656e-06, + "failure": [ + 0.384765625, + 0.3701171875, + 0.361328125 + ], + "peak_gpu_bytes": 21913887488 + } + ] + }, + "cache": { + "method": "Three extrinsic-message passes between exact CSS likelihoods, damping 1, extrinsic clipping [-8,8]", + "scope": "All 26 d5 conditions. Full validation and 4096 training shots per condition.", + "training_selection": "Same uniformly sampled training indices as d5_cache, seed 20261023; labels are only used downstream in ensemble fitting.", + "model_selection": "Damping 1 and three passes chosen from a six-condition, 1024-validation-shot diagnostic screen of .5/1 damping and 1/2/3 passes.", + "batch": 384, + "test_data_used": false, + "resume_note": "Initial dynamic allocator failed at X/r21 after saving X/r1 through r19. Those complete records are retained; remaining conditions resumed with a 90 percent preallocated pool.", + "records": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "batch": 384, + "validation": { + "seconds": 0.0023708343505859375, + "shots": 5120, + "first_pass_max_delta": 0.0, + "failure": [ + 0.0080078125, + 0.0080078125, + 0.0080078125 + ] + }, + "train": { + "seconds": 0.00203704833984375, + "shots": 4096, + "first_pass_max_delta": 0.0, + "failure": [ + 0.00830078125, + 0.00830078125, + 0.00830078125 + ] + }, + "elapsed": 0.031897783279418945, + "peak_gpu_bytes": 0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "batch": 384, + "validation": { + "seconds": 6.5025129318237305, + "shots": 5120, + "first_pass_max_delta": 1.1622905731201172e-06, + "failure": [ + 0.05390625, + 0.05234375, + 0.0515625 + ] + }, + "train": { + "seconds": 1.8498849868774414, + "shots": 4096, + "first_pass_max_delta": 1.0728836059570312e-06, + "failure": [ + 0.056640625, + 0.056884765625, + 0.057373046875 + ] + }, + "elapsed": 9.963430881500244, + "peak_gpu_bytes": 6053389568 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "batch": 384, + "validation": { + "seconds": 7.887800455093384, + "shots": 5120, + "first_pass_max_delta": 1.1920928955078125e-06, + "failure": [ + 0.1111328125, + 0.1078125, + 0.1078125 + ] + }, + "train": { + "seconds": 3.1277287006378174, + "shots": 4096, + "first_pass_max_delta": 1.5497207641601562e-06, + "failure": [ + 0.110595703125, + 0.1044921875, + 0.106689453125 + ] + }, + "elapsed": 21.591607809066772, + "peak_gpu_bytes": 9485051136 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "batch": 384, + "validation": { + "seconds": 9.284316062927246, + "shots": 5120, + "first_pass_max_delta": 1.0728836059570312e-06, + "failure": [ + 0.1638671875, + 0.16328125, + 0.16328125 + ] + }, + "train": { + "seconds": 4.408588647842407, + "shots": 4096, + "first_pass_max_delta": 3.2186508178710938e-06, + "failure": [ + 0.165771484375, + 0.15966796875, + 0.160888671875 + ] + }, + "elapsed": 35.83207678794861, + "peak_gpu_bytes": 12921052416 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "batch": 384, + "validation": { + "seconds": 10.81107211112976, + "shots": 5120, + "first_pass_max_delta": 4.172325134277344e-06, + "failure": [ + 0.1994140625, + 0.1947265625, + 0.192578125 + ] + }, + "train": { + "seconds": 5.6971564292907715, + "shots": 4096, + "first_pass_max_delta": 1.9073486328125e-06, + "failure": [ + 0.193603515625, + 0.190185546875, + 0.1865234375 + ] + }, + "elapsed": 52.94058084487915, + "peak_gpu_bytes": 16355555584 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "batch": 384, + "validation": { + "seconds": 13.042934894561768, + "shots": 5120, + "first_pass_max_delta": 1.2516975402832031e-06, + "failure": [ + 0.2330078125, + 0.229296875, + 0.2283203125 + ] + }, + "train": { + "seconds": 6.935072898864746, + "shots": 4096, + "first_pass_max_delta": 1.043081283569336e-06, + "failure": [ + 0.237060546875, + 0.2373046875, + 0.23388671875 + ] + }, + "elapsed": 73.53631615638733, + "peak_gpu_bytes": 19787549696 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "batch": 384, + "validation": { + "seconds": 14.011132955551147, + "shots": 5120, + "first_pass_max_delta": 1.430511474609375e-06, + "failure": [ + 0.251953125, + 0.243359375, + 0.2427734375 + ] + }, + "train": { + "seconds": 8.214681386947632, + "shots": 4096, + "first_pass_max_delta": 1.6689300537109375e-06, + "failure": [ + 0.261962890625, + 0.257080078125, + 0.254150390625 + ] + }, + "elapsed": 96.39840364456177, + "peak_gpu_bytes": 23221127680 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "batch": 384, + "validation": { + "seconds": 15.821684837341309, + "shots": 5120, + "first_pass_max_delta": 2.3245811462402344e-06, + "failure": [ + 0.2822265625, + 0.286328125, + 0.2798828125 + ] + }, + "train": { + "seconds": 9.5097815990448, + "shots": 4096, + "first_pass_max_delta": 1.8477439880371094e-06, + "failure": [ + 0.294677734375, + 0.28515625, + 0.2861328125 + ] + }, + "elapsed": 122.39457035064697, + "peak_gpu_bytes": 26659319552 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "batch": 384, + "validation": { + "seconds": 18.90661311149597, + "shots": 5120, + "first_pass_max_delta": 2.3245811462402344e-06, + "failure": [ + 0.329296875, + 0.323828125, + 0.3169921875 + ] + }, + "train": { + "seconds": 11.201237440109253, + "shots": 4096, + "first_pass_max_delta": 1.0728836059570312e-06, + "failure": [ + 0.3046875, + 0.304931640625, + 0.302978515625 + ] + }, + "elapsed": 153.40053129196167, + "peak_gpu_bytes": 30096252672 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "batch": 384, + "validation": { + "seconds": 22.513427734375, + "shots": 5120, + "first_pass_max_delta": 1.4007091522216797e-06, + "failure": [ + 0.3560546875, + 0.3458984375, + 0.3455078125 + ] + }, + "train": { + "seconds": 16.373472213745117, + "shots": 4096, + "first_pass_max_delta": 1.430511474609375e-06, + "failure": [ + 0.350341796875, + 0.3447265625, + 0.339111328125 + ] + }, + "elapsed": 193.22454714775085, + "peak_gpu_bytes": 33531435520 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 20.595962524414062, + "shots": 5120, + "first_pass_max_delta": 1.1920928955078125e-06, + "failure": [ + 0.3640625, + 0.3626953125, + 0.3607421875 + ] + }, + "train": { + "seconds": 13.13056755065918, + "shots": 4096, + "first_pass_max_delta": 1.6689300537109375e-06, + "failure": [ + 0.366455078125, + 0.364013671875, + 0.3603515625 + ] + }, + "elapsed": 36.23082995414734, + "peak_gpu_bytes": 36971696384 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 21.875932693481445, + "shots": 5120, + "first_pass_max_delta": 1.2516975402832031e-06, + "failure": [ + 0.3857421875, + 0.3837890625, + 0.3794921875 + ] + }, + "train": { + "seconds": 14.333576440811157, + "shots": 4096, + "first_pass_max_delta": 1.1920928955078125e-06, + "failure": [ + 0.37841796875, + 0.380859375, + 0.378173828125 + ] + }, + "elapsed": 73.29396986961365, + "peak_gpu_bytes": 40408369664 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 23.68450117111206, + "shots": 5120, + "first_pass_max_delta": 1.7285346984863281e-06, + "failure": [ + 0.38828125, + 0.39140625, + 0.390234375 + ] + }, + "train": { + "seconds": 15.625046253204346, + "shots": 4096, + "first_pass_max_delta": 2.3543834686279297e-06, + "failure": [ + 0.401611328125, + 0.3984375, + 0.3896484375 + ] + }, + "elapsed": 113.62051224708557, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 0.0020935535430908203, + "shots": 5120, + "first_pass_max_delta": 0.0, + "failure": [ + 0.0078125, + 0.0078125, + 0.0078125 + ] + }, + "train": { + "seconds": 0.0018491744995117188, + "shots": 4096, + "first_pass_max_delta": 0.0, + "failure": [ + 0.006103515625, + 0.006103515625, + 0.006103515625 + ] + }, + "elapsed": 113.74299573898315, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 6.421818256378174, + "shots": 5120, + "first_pass_max_delta": 9.5367431640625e-07, + "failure": [ + 0.0474609375, + 0.0466796875, + 0.04609375 + ] + }, + "train": { + "seconds": 2.009964942932129, + "shots": 4096, + "first_pass_max_delta": 1.6093254089355469e-06, + "failure": [ + 0.05224609375, + 0.050537109375, + 0.050537109375 + ] + }, + "elapsed": 122.82617926597595, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 8.133492231369019, + "shots": 5120, + "first_pass_max_delta": 2.115964889526367e-06, + "failure": [ + 0.1037109375, + 0.1029296875, + 0.102734375 + ] + }, + "train": { + "seconds": 3.179387331008911, + "shots": 4096, + "first_pass_max_delta": 1.6689300537109375e-06, + "failure": [ + 0.108642578125, + 0.1044921875, + 0.10595703125 + ] + }, + "elapsed": 134.6406970024109, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 13.694931983947754, + "shots": 5120, + "first_pass_max_delta": 2.3245811462402344e-06, + "failure": [ + 0.1484375, + 0.14765625, + 0.1494140625 + ] + }, + "train": { + "seconds": 6.147953748703003, + "shots": 4096, + "first_pass_max_delta": 2.0563602447509766e-06, + "failure": [ + 0.147705078125, + 0.144775390625, + 0.143310546875 + ] + }, + "elapsed": 155.0307319164276, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 14.462661504745483, + "shots": 5120, + "first_pass_max_delta": 1.4901161193847656e-06, + "failure": [ + 0.181640625, + 0.1765625, + 0.1734375 + ] + }, + "train": { + "seconds": 6.59630274772644, + "shots": 4096, + "first_pass_max_delta": 1.7285346984863281e-06, + "failure": [ + 0.181640625, + 0.173583984375, + 0.17431640625 + ] + }, + "elapsed": 176.9893820285797, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 15.458272933959961, + "shots": 5120, + "first_pass_max_delta": 1.430511474609375e-06, + "failure": [ + 0.2208984375, + 0.2169921875, + 0.2189453125 + ] + }, + "train": { + "seconds": 8.347567081451416, + "shots": 4096, + "first_pass_max_delta": 1.7285346984863281e-06, + "failure": [ + 0.2216796875, + 0.214111328125, + 0.209716796875 + ] + }, + "elapsed": 201.48220419883728, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 16.03638219833374, + "shots": 5120, + "first_pass_max_delta": 1.0728836059570312e-06, + "failure": [ + 0.2439453125, + 0.2349609375, + 0.2333984375 + ] + }, + "train": { + "seconds": 8.29888391494751, + "shots": 4096, + "first_pass_max_delta": 8.344650268554688e-07, + "failure": [ + 0.24365234375, + 0.248046875, + 0.2451171875 + ] + }, + "elapsed": 226.75215530395508, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 16.009416103363037, + "shots": 5120, + "first_pass_max_delta": 1.341104507446289e-06, + "failure": [ + 0.271875, + 0.264453125, + 0.2638671875 + ] + }, + "train": { + "seconds": 9.500921726226807, + "shots": 4096, + "first_pass_max_delta": 1.0728836059570312e-06, + "failure": [ + 0.28076171875, + 0.267333984375, + 0.267333984375 + ] + }, + "elapsed": 252.95993447303772, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 17.426681518554688, + "shots": 5120, + "first_pass_max_delta": 1.6242265701293945e-06, + "failure": [ + 0.31484375, + 0.3056640625, + 0.3087890625 + ] + }, + "train": { + "seconds": 10.742947816848755, + "shots": 4096, + "first_pass_max_delta": 1.430511474609375e-06, + "failure": [ + 0.310791015625, + 0.309814453125, + 0.31103515625 + ] + }, + "elapsed": 281.84620356559753, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 18.49993872642517, + "shots": 5120, + "first_pass_max_delta": 1.9073486328125e-06, + "failure": [ + 0.334375, + 0.334765625, + 0.33515625 + ] + }, + "train": { + "seconds": 11.90273404121399, + "shots": 4096, + "first_pass_max_delta": 1.3113021850585938e-06, + "failure": [ + 0.327880859375, + 0.315673828125, + 0.310546875 + ] + }, + "elapsed": 313.02247071266174, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 20.121089458465576, + "shots": 5120, + "first_pass_max_delta": 1.2516975402832031e-06, + "failure": [ + 0.34609375, + 0.342578125, + 0.344140625 + ] + }, + "train": { + "seconds": 13.077136278152466, + "shots": 4096, + "first_pass_max_delta": 1.6391277313232422e-06, + "failure": [ + 0.349853515625, + 0.34765625, + 0.352294921875 + ] + }, + "elapsed": 347.0259063243866, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 22.116555213928223, + "shots": 5120, + "first_pass_max_delta": 1.6689300537109375e-06, + "failure": [ + 0.3625, + 0.3625, + 0.3564453125 + ] + }, + "train": { + "seconds": 14.53529953956604, + "shots": 4096, + "first_pass_max_delta": 1.7285346984863281e-06, + "failure": [ + 0.361572265625, + 0.36083984375, + 0.35205078125 + ] + }, + "elapsed": 384.53587651252747, + "peak_gpu_bytes": 43842280448 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "batch": 384, + "gpu_allocation": "90 percent preallocated contiguous pool", + "validation": { + "seconds": 24.039794921875, + "shots": 5120, + "first_pass_max_delta": 1.2516975402832031e-06, + "failure": [ + 0.397265625, + 0.3810546875, + 0.3755859375 + ] + }, + "train": { + "seconds": 15.72797179222107, + "shots": 4096, + "first_pass_max_delta": 1.1920928955078125e-06, + "failure": [ + 0.378662109375, + 0.370849609375, + 0.369384765625 + ] + }, + "elapsed": 425.2448420524597, + "peak_gpu_bytes": 43842280448 + } + ] + }, + "selection": "Full-validation mean failure per basis group, comparing incumbent, raw pass3, calibrated pass3, confidence ensemble, and confidence+matching ensemble.", + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": { + "failure": 0.24024939903846157 + }, + "turbo_raw": { + "failure": 0.2359375 + }, + "turbo_calibrated": { + "failure": 0.23592247596153845, + "train_loss": 0.4342440304618462, + "iterations": 8, + "optimizer_success": true + }, + "turbo_confidence": { + "failure": 0.23646334134615385, + "train_loss": 0.4325824823965761, + "iterations": 31, + "optimizer_success": true + }, + "turbo_ensemble": { + "failure": 0.23825120192307692, + "train_loss": 0.43104343457008354, + "iterations": 128, + "optimizer_success": true + } + }, + "selected": "turbo_calibrated" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": { + "failure": 0.22627704326923076 + }, + "turbo_raw": { + "failure": 0.2242938701923077 + }, + "turbo_calibrated": { + "failure": 0.22444411057692307, + "train_loss": 0.41862854651685183, + "iterations": 8, + "optimizer_success": true + }, + "turbo_confidence": { + "failure": 0.22463942307692308, + "train_loss": 0.4165407454935999, + "iterations": 28, + "optimizer_success": true + }, + "turbo_ensemble": { + "failure": 0.22291165865384616, + "train_loss": 0.4143765903988058, + "iterations": 153, + "optimizer_success": true + } + }, + "selected": "turbo_ensemble" + } + ], + "test_data_used": false, + "memory_optimization": { + "method": "Logical parity retained in forward state, marginalized out of stored histories and backward syndrome-likelihood messages; half the on-partition history size.", + "equivalence_checks": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "log_likelihood_max_delta": 0.0, + "logical_max_delta": 0.0, + "edge_posterior_max_delta": 3.2687214002180554e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "log_likelihood_max_delta": 0.0, + "logical_max_delta": 0.0, + "edge_posterior_max_delta": 3.698800981055683e-07 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "log_likelihood_max_delta": 0.0, + "logical_max_delta": 0.0, + "edge_posterior_max_delta": 4.061699030444288e-07 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "log_likelihood_max_delta": 0.0, + "logical_max_delta": 0.0, + "edge_posterior_max_delta": 4.5500107148654934e-07 + } + ], + "runtime_batch": 512, + "gpu_pool": "90 percent preallocated before JAX backend initialization" + } + }, + "neural_d5_history": [ + { + "training": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261101", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to exact complementary-CSS-conditioned relevant-edge logits; exact width-14 contraction predicts logical probability", + "training": "4096 training shots per each of all 26 d5 conditions, sampled without replacement with seed 20261023. Uniform condition and within-condition sampling for optimizer batches.", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; complementary conditioning held fixed", + "steps": 512, + "batch": 256, + "learning_rate": 0.001, + "sampling_seed": 20261101, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "starting_checkpoint": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 512, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.12617039680480957, + "error": 0.0390625, + "gradient_norm": 0.04250018671154976, + "elapsed": 18.675416231155396 + }, + { + "step": 16, + "loss": 0.6377020478248596, + "error": 0.4140625, + "gradient_norm": 0.09590183943510056, + "elapsed": 23.17981266975403 + }, + { + "step": 32, + "loss": 0.29977816343307495, + "error": 0.12109375, + "gradient_norm": 0.07157808542251587, + "elapsed": 28.000701189041138 + }, + { + "step": 48, + "loss": 0.34505343437194824, + "error": 0.1484375, + "gradient_norm": 0.07669594883918762, + "elapsed": 32.97374606132507 + }, + { + "step": 64, + "loss": 0.5405071973800659, + "error": 0.29296875, + "gradient_norm": 0.08529861271381378, + "elapsed": 37.794785499572754 + }, + { + "step": 80, + "loss": 0.5131822228431702, + "error": 0.28515625, + "gradient_norm": 0.12556222081184387, + "elapsed": 42.73275876045227 + }, + { + "step": 96, + "loss": 0.6790875196456909, + "error": 0.421875, + "gradient_norm": 0.19858981668949127, + "elapsed": 47.55139684677124 + }, + { + "step": 112, + "loss": 0.4744196832180023, + "error": 0.2421875, + "gradient_norm": 0.14321450889110565, + "elapsed": 52.42716360092163 + }, + { + "step": 128, + "loss": 0.01264211069792509, + "error": 0.00390625, + "gradient_norm": 0.007236324716359377, + "elapsed": 57.2592077255249 + }, + { + "step": 144, + "loss": 0.35788118839263916, + "error": 0.15234375, + "gradient_norm": 0.07203944772481918, + "elapsed": 64.91656231880188 + }, + { + "step": 160, + "loss": 0.6330419778823853, + "error": 0.3671875, + "gradient_norm": 0.08350329101085663, + "elapsed": 69.75011849403381 + }, + { + "step": 176, + "loss": 0.6195905208587646, + "error": 0.4140625, + "gradient_norm": 0.11415330320596695, + "elapsed": 74.56864047050476 + }, + { + "step": 192, + "loss": 0.5832147598266602, + "error": 0.37109375, + "gradient_norm": 0.3569585978984833, + "elapsed": 79.38981986045837 + }, + { + "step": 208, + "loss": 0.6469261646270752, + "error": 0.4296875, + "gradient_norm": 0.18999285995960236, + "elapsed": 84.23919153213501 + }, + { + "step": 224, + "loss": 0.5015400648117065, + "error": 0.26171875, + "gradient_norm": 0.14661277830600739, + "elapsed": 89.08856391906738 + }, + { + "step": 240, + "loss": 0.5771075487136841, + "error": 0.30859375, + "gradient_norm": 0.16081298887729645, + "elapsed": 94.75072908401489 + }, + { + "step": 256, + "loss": 0.4888438582420349, + "error": 0.265625, + "gradient_norm": 0.0695391371846199, + "elapsed": 101.01203680038452 + }, + { + "step": 272, + "loss": 0.4024130702018738, + "error": 0.171875, + "gradient_norm": 0.12405848503112793, + "elapsed": 110.68109226226807 + }, + { + "step": 288, + "loss": 0.5895810723304749, + "error": 0.34375, + "gradient_norm": 0.11818791180849075, + "elapsed": 117.13554787635803 + }, + { + "step": 304, + "loss": 0.4740591049194336, + "error": 0.23828125, + "gradient_norm": 0.12323135882616043, + "elapsed": 123.14409065246582 + }, + { + "step": 320, + "loss": 0.007106379605829716, + "error": 0.0, + "gradient_norm": 0.011303205043077469, + "elapsed": 129.3651967048645 + }, + { + "step": 336, + "loss": 0.11020991206169128, + "error": 0.046875, + "gradient_norm": 0.09031850099563599, + "elapsed": 135.01193165779114 + }, + { + "step": 352, + "loss": 0.47800248861312866, + "error": 0.23046875, + "gradient_norm": 0.09636854380369186, + "elapsed": 141.10205006599426 + }, + { + "step": 368, + "loss": 0.4062168598175049, + "error": 0.203125, + "gradient_norm": 0.17921771109104156, + "elapsed": 146.6507167816162 + }, + { + "step": 384, + "loss": 0.24366013705730438, + "error": 0.12109375, + "gradient_norm": 0.11793741583824158, + "elapsed": 152.7517864704132 + }, + { + "step": 400, + "loss": 0.4949762225151062, + "error": 0.28515625, + "gradient_norm": 0.09550267457962036, + "elapsed": 160.96661829948425 + }, + { + "step": 416, + "loss": 0.21066513657569885, + "error": 0.08984375, + "gradient_norm": 0.07445460557937622, + "elapsed": 165.83068180084229 + }, + { + "step": 432, + "loss": 0.4017776548862457, + "error": 0.18359375, + "gradient_norm": 0.1278357356786728, + "elapsed": 170.6406123638153 + }, + { + "step": 448, + "loss": 0.11823543906211853, + "error": 0.04296875, + "gradient_norm": 0.09968453645706177, + "elapsed": 175.4701704978943 + }, + { + "step": 464, + "loss": 0.47654634714126587, + "error": 0.2265625, + "gradient_norm": 0.18101797997951508, + "elapsed": 180.26738119125366 + }, + { + "step": 480, + "loss": 0.4916652739048004, + "error": 0.24609375, + "gradient_norm": 0.08958703279495239, + "elapsed": 185.08883357048035 + }, + { + "step": 496, + "loss": 0.5418418645858765, + "error": 0.3515625, + "gradient_norm": 0.08218713104724884, + "elapsed": 189.9677882194519 + }, + { + "step": 512, + "loss": 0.5470219850540161, + "error": 0.359375, + "gradient_norm": 0.07939601689577103, + "elapsed": 194.77887177467346 + } + ] + }, + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with incumbent.", + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23592247596153845, + "128": 0.23888221153846154, + "blend-128": 0.23536658653846151, + "256": 0.23865685096153846, + "blend-256": 0.23538161057692308, + "384": 0.23852163461538461, + "blend-384": 0.23487079326923077, + "512": 0.23870192307692306, + "blend-512": 0.23482572115384615 + }, + "selected": "blend-512" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22291165865384616, + "128": 0.2279897836538462, + "blend-128": 0.22366286057692308, + "256": 0.2274188701923077, + "blend-256": 0.22304687500000003, + "384": 0.22729867788461536, + "blend-384": 0.22337740384615384, + "512": 0.22662259615384617, + "blend-512": 0.22355769230769235 + }, + "selected": "incumbent" + } + ], + "checkpoints": { + "512": { + "step": 512, + "training_samples": 131072, + "weights_sha256": "86aa65455686eb06a430030bd4b8242ac78521dccf4e9b07f1e93b2aa2ec40af", + "complete": true + } + }, + "runtime": "Shared initial complementary-CSS priors between neural and physical branches in blended groups. Last-only physical branches omit logical tracking in intermediate passes when intermediate probabilities are unused.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false + }, + { + "training": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "4096 training shots per each of all 26 d5 conditions, sampled without replacement with seed 20261023. Uniform condition and within-condition sampling for optimizer batches.", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1024, + "batch": 256, + "learning_rate": 0.001, + "sampling_seed": 20261108, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "starting_checkpoint": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.011146659031510353, + "error": 0.00390625, + "gradient_norm": 0.011240893043577671, + "elapsed": 21.276997089385986 + }, + { + "step": 16, + "loss": 0.645737886428833, + "error": 0.40625, + "gradient_norm": 0.1628236621618271, + "elapsed": 25.872907638549805 + }, + { + "step": 32, + "loss": 0.574029803276062, + "error": 0.35546875, + "gradient_norm": 0.3000081777572632, + "elapsed": 30.761418342590332 + }, + { + "step": 48, + "loss": 0.574467122554779, + "error": 0.296875, + "gradient_norm": 0.24150623381137848, + "elapsed": 35.67650651931763 + }, + { + "step": 64, + "loss": 0.6003620624542236, + "error": 0.35546875, + "gradient_norm": 0.07430054992437363, + "elapsed": 40.60572576522827 + }, + { + "step": 80, + "loss": 0.5429091453552246, + "error": 0.33203125, + "gradient_norm": 0.15341751277446747, + "elapsed": 45.546849727630615 + }, + { + "step": 96, + "loss": 0.368771493434906, + "error": 0.1640625, + "gradient_norm": 0.08923184871673584, + "elapsed": 50.49156332015991 + }, + { + "step": 112, + "loss": 0.516342043876648, + "error": 0.265625, + "gradient_norm": 0.10965219140052795, + "elapsed": 55.45058846473694 + }, + { + "step": 128, + "loss": 0.5925382971763611, + "error": 0.37109375, + "gradient_norm": 0.055406324565410614, + "elapsed": 60.40891766548157 + }, + { + "step": 144, + "loss": 0.19184258580207825, + "error": 0.07421875, + "gradient_norm": 0.07042146474123001, + "elapsed": 65.33323669433594 + }, + { + "step": 160, + "loss": 0.5202382206916809, + "error": 0.25390625, + "gradient_norm": 0.14782382547855377, + "elapsed": 70.26605796813965 + }, + { + "step": 176, + "loss": 0.46083134412765503, + "error": 0.22265625, + "gradient_norm": 0.09074779599905014, + "elapsed": 75.18221640586853 + }, + { + "step": 192, + "loss": 0.3054918646812439, + "error": 0.14453125, + "gradient_norm": 0.0588168129324913, + "elapsed": 80.1186010837555 + }, + { + "step": 208, + "loss": 0.4836011230945587, + "error": 0.27734375, + "gradient_norm": 0.09208947420120239, + "elapsed": 85.05764293670654 + }, + { + "step": 224, + "loss": 0.6640600562095642, + "error": 0.38671875, + "gradient_norm": 0.22026506066322327, + "elapsed": 89.98808217048645 + }, + { + "step": 240, + "loss": 0.02421322464942932, + "error": 0.00390625, + "gradient_norm": 0.008131005801260471, + "elapsed": 94.90194272994995 + }, + { + "step": 256, + "loss": 0.6302106976509094, + "error": 0.4296875, + "gradient_norm": 0.09762304276227951, + "elapsed": 99.82612204551697 + }, + { + "step": 272, + "loss": 0.5092596411705017, + "error": 0.27734375, + "gradient_norm": 0.11407691985368729, + "elapsed": 110.44065999984741 + }, + { + "step": 288, + "loss": 0.452798455953598, + "error": 0.2265625, + "gradient_norm": 0.1105576679110527, + "elapsed": 115.36984539031982 + }, + { + "step": 304, + "loss": 0.3378596305847168, + "error": 0.18359375, + "gradient_norm": 0.0841713547706604, + "elapsed": 120.29337763786316 + }, + { + "step": 320, + "loss": 0.6271854639053345, + "error": 0.38671875, + "gradient_norm": 0.1972702294588089, + "elapsed": 125.2231035232544 + }, + { + "step": 336, + "loss": 0.04562236741185188, + "error": 0.01171875, + "gradient_norm": 0.027922745794057846, + "elapsed": 130.14725255966187 + }, + { + "step": 352, + "loss": 0.5342530608177185, + "error": 0.26953125, + "gradient_norm": 0.09031179547309875, + "elapsed": 135.08111095428467 + }, + { + "step": 368, + "loss": 0.49785488843917847, + "error": 0.2578125, + "gradient_norm": 0.19366280734539032, + "elapsed": 140.00699138641357 + }, + { + "step": 384, + "loss": 0.5673326253890991, + "error": 0.30859375, + "gradient_norm": 0.20644932985305786, + "elapsed": 144.92276740074158 + }, + { + "step": 400, + "loss": 0.5581298470497131, + "error": 0.3203125, + "gradient_norm": 0.17668266594409943, + "elapsed": 149.86573243141174 + }, + { + "step": 416, + "loss": 0.5564071536064148, + "error": 0.30078125, + "gradient_norm": 0.0821610689163208, + "elapsed": 154.7953712940216 + }, + { + "step": 432, + "loss": 0.5540086030960083, + "error": 0.34765625, + "gradient_norm": 0.1438807100057602, + "elapsed": 159.72657418251038 + }, + { + "step": 448, + "loss": 0.540939450263977, + "error": 0.29296875, + "gradient_norm": 0.17986361682415009, + "elapsed": 164.6689453125 + }, + { + "step": 464, + "loss": 0.45807865262031555, + "error": 0.25, + "gradient_norm": 0.14453186094760895, + "elapsed": 169.58739304542542 + }, + { + "step": 480, + "loss": 0.5191650390625, + "error": 0.22265625, + "gradient_norm": 0.07955105602741241, + "elapsed": 174.5444438457489 + }, + { + "step": 496, + "loss": 0.1692925989627838, + "error": 0.0703125, + "gradient_norm": 0.07875128090381622, + "elapsed": 179.48035550117493 + }, + { + "step": 512, + "loss": 0.5580664873123169, + "error": 0.3125, + "gradient_norm": 0.27090802788734436, + "elapsed": 184.42834162712097 + }, + { + "step": 528, + "loss": 0.26402050256729126, + "error": 0.13671875, + "gradient_norm": 0.13135771453380585, + "elapsed": 195.17691040039062 + }, + { + "step": 544, + "loss": 0.4352915287017822, + "error": 0.1953125, + "gradient_norm": 0.15959712862968445, + "elapsed": 200.0421543121338 + }, + { + "step": 560, + "loss": 0.22861814498901367, + "error": 0.1015625, + "gradient_norm": 0.08776932209730148, + "elapsed": 204.95144605636597 + }, + { + "step": 576, + "loss": 0.28309381008148193, + "error": 0.1328125, + "gradient_norm": 0.11050742119550705, + "elapsed": 209.8526291847229 + }, + { + "step": 592, + "loss": 0.6409220695495605, + "error": 0.41015625, + "gradient_norm": 0.19826626777648926, + "elapsed": 214.84447717666626 + }, + { + "step": 608, + "loss": 0.25090643763542175, + "error": 0.109375, + "gradient_norm": 0.05864342302083969, + "elapsed": 219.72637391090393 + }, + { + "step": 624, + "loss": 0.11423969268798828, + "error": 0.05078125, + "gradient_norm": 0.05318564549088478, + "elapsed": 224.6331377029419 + }, + { + "step": 640, + "loss": 0.32663431763648987, + "error": 0.1328125, + "gradient_norm": 0.06877780705690384, + "elapsed": 229.5065622329712 + }, + { + "step": 656, + "loss": 0.24196995794773102, + "error": 0.10546875, + "gradient_norm": 0.07683655619621277, + "elapsed": 234.4042534828186 + }, + { + "step": 672, + "loss": 0.5349344611167908, + "error": 0.296875, + "gradient_norm": 0.15214307606220245, + "elapsed": 239.26656579971313 + }, + { + "step": 688, + "loss": 0.26759713888168335, + "error": 0.1171875, + "gradient_norm": 0.14698348939418793, + "elapsed": 244.21049737930298 + }, + { + "step": 704, + "loss": 0.37338894605636597, + "error": 0.18359375, + "gradient_norm": 0.10210632532835007, + "elapsed": 249.13519072532654 + }, + { + "step": 720, + "loss": 0.36807945370674133, + "error": 0.17578125, + "gradient_norm": 0.09668388962745667, + "elapsed": 254.06281065940857 + }, + { + "step": 736, + "loss": 0.3736685514450073, + "error": 0.15625, + "gradient_norm": 0.10987236350774765, + "elapsed": 259.01695108413696 + }, + { + "step": 752, + "loss": 0.5266942977905273, + "error": 0.29296875, + "gradient_norm": 0.09041415899991989, + "elapsed": 263.9530746936798 + }, + { + "step": 768, + "loss": 0.360038161277771, + "error": 0.1640625, + "gradient_norm": 0.10391079634428024, + "elapsed": 268.9019305706024 + }, + { + "step": 784, + "loss": 0.5700286626815796, + "error": 0.34375, + "gradient_norm": 0.12206032127141953, + "elapsed": 279.4174163341522 + }, + { + "step": 800, + "loss": 0.42533689737319946, + "error": 0.20703125, + "gradient_norm": 0.06605375558137894, + "elapsed": 284.3391351699829 + }, + { + "step": 816, + "loss": 0.12355346977710724, + "error": 0.046875, + "gradient_norm": 0.06571663916110992, + "elapsed": 289.2815272808075 + }, + { + "step": 832, + "loss": 0.6411258578300476, + "error": 0.3984375, + "gradient_norm": 0.160088911652565, + "elapsed": 294.2048614025116 + }, + { + "step": 848, + "loss": 0.5756919980049133, + "error": 0.3515625, + "gradient_norm": 0.0962308868765831, + "elapsed": 299.15635418891907 + }, + { + "step": 864, + "loss": 0.2706402540206909, + "error": 0.1171875, + "gradient_norm": 0.11391306668519974, + "elapsed": 304.09321761131287 + }, + { + "step": 880, + "loss": 0.33621329069137573, + "error": 0.1640625, + "gradient_norm": 0.09049320220947266, + "elapsed": 309.0412187576294 + }, + { + "step": 896, + "loss": 0.44343245029449463, + "error": 0.23828125, + "gradient_norm": 0.12484703958034515, + "elapsed": 313.98498797416687 + }, + { + "step": 912, + "loss": 0.5987736582756042, + "error": 0.359375, + "gradient_norm": 0.07541236281394958, + "elapsed": 318.9334623813629 + }, + { + "step": 928, + "loss": 0.38585522770881653, + "error": 0.1875, + "gradient_norm": 0.09290861338376999, + "elapsed": 323.86884689331055 + }, + { + "step": 944, + "loss": 0.4820440113544464, + "error": 0.234375, + "gradient_norm": 0.22198310494422913, + "elapsed": 328.7963180541992 + }, + { + "step": 960, + "loss": 0.07455944269895554, + "error": 0.015625, + "gradient_norm": 0.055282026529312134, + "elapsed": 333.75238251686096 + }, + { + "step": 976, + "loss": 0.013475366868078709, + "error": 0.0078125, + "gradient_norm": 0.009843004867434502, + "elapsed": 338.6403331756592 + }, + { + "step": 992, + "loss": 0.4429199695587158, + "error": 0.2265625, + "gradient_norm": 0.09489083290100098, + "elapsed": 343.5606532096863 + }, + { + "step": 1008, + "loss": 0.4892328381538391, + "error": 0.234375, + "gradient_norm": 0.1342826634645462, + "elapsed": 348.5243353843689 + }, + { + "step": 1024, + "loss": 0.6096819043159485, + "error": 0.32421875, + "gradient_norm": 0.17938998341560364, + "elapsed": 353.36506962776184 + } + ] + }, + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23482572115384615, + "256": 0.2346754807692308, + "blend-256": 0.23484074519230771, + "512": 0.23569711538461538, + "blend-512": 0.2338341346153846, + "768": 0.23470552884615387, + "blend-768": 0.23464543269230764, + "1024": 0.23653846153846153, + "blend-1024": 0.23445012019230768 + }, + "selected": "blend-512" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22291165865384616, + "256": 0.2231520432692308, + "blend-256": 0.2219951923076923, + "512": 0.22303185096153846, + "blend-512": 0.22211538461538463, + "768": 0.22279146634615382, + "blend-768": 0.2219501201923077, + "1024": 0.22291165865384616, + "blend-1024": 0.22182992788461542 + }, + "selected": "blend-1024" + } + ], + "checkpoints": { + "512": { + "step": 512, + "training_samples": 131072, + "weights_sha256": "6109f95c51d7b8803085c84b6bb34e3f199cc349bd846d6007c8f9a4f2a0c4fe", + "complete": true + }, + "1024": { + "step": 1024, + "training_samples": 262144, + "weights_sha256": "46aa01e703f38fa153206c54ff0ce7083d839de7aeb51bf14c8e732d52d5bd2d", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit logical tracking in intermediate passes when intermediate probabilities are unused.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false + }, + { + "training": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "training_source_sha256": { + "learned_d5__train.py": "b73af9da21332dee9a43f653b514695b020fbc3516604b2e721d8cf0ea876d53", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "5e9420df1f6dd56518925e910096fb9bc93bd796a5933b13bf894a1a96256cdf", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "All supplied training shots per each of all26 d5 conditions; uniform condition and within-condition sampling for optimizer batches.", + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 516880, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 507282, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 19592, + "surface_code_bX_d5_r03_center_5_5": 19646, + "surface_code_bX_d5_r05_center_5_5": 19513, + "surface_code_bX_d5_r07_center_5_5": 19341, + "surface_code_bX_d5_r09_center_5_5": 19211, + "surface_code_bX_d5_r11_center_5_5": 19239, + "surface_code_bX_d5_r13_center_5_5": 19679, + "surface_code_bX_d5_r15_center_5_5": 19455, + "surface_code_bX_d5_r17_center_5_5": 19479, + "surface_code_bX_d5_r19_center_5_5": 19479, + "surface_code_bX_d5_r21_center_5_5": 19551, + "surface_code_bX_d5_r23_center_5_5": 19586, + "surface_code_bX_d5_r25_center_5_5": 19526, + "surface_code_bZ_d5_r01_center_5_5": 19652, + "surface_code_bZ_d5_r03_center_5_5": 19732, + "surface_code_bZ_d5_r05_center_5_5": 19754, + "surface_code_bZ_d5_r07_center_5_5": 19194, + "surface_code_bZ_d5_r09_center_5_5": 19641, + "surface_code_bZ_d5_r11_center_5_5": 19611, + "surface_code_bZ_d5_r13_center_5_5": 19424, + "surface_code_bZ_d5_r15_center_5_5": 19380, + "surface_code_bZ_d5_r17_center_5_5": 19384, + "surface_code_bZ_d5_r19_center_5_5": 19684, + "surface_code_bZ_d5_r21_center_5_5": 19559, + "surface_code_bZ_d5_r23_center_5_5": 19524, + "surface_code_bZ_d5_r25_center_5_5": 19446 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 2048, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261113, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_d5/feedback3_pilot/rng-768.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/feedback3_pilot/weights-768.npz", + "starting_checkpoint_sha256": "bc2ba1c529317ce1b5b661efae4707eca49c6995d6f22b04193fe7642662fed8", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "4096 training shots per each of all 26 d5 conditions, sampled without replacement with seed 20261023. Uniform condition and within-condition sampling for optimizer batches.", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1024, + "batch": 256, + "learning_rate": 0.001, + "sampling_seed": 20261108, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "starting_checkpoint": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.011146659031510353, + "error": 0.00390625, + "gradient_norm": 0.011240893043577671, + "elapsed": 21.276997089385986 + }, + { + "step": 16, + "loss": 0.645737886428833, + "error": 0.40625, + "gradient_norm": 0.1628236621618271, + "elapsed": 25.872907638549805 + }, + { + "step": 32, + "loss": 0.574029803276062, + "error": 0.35546875, + "gradient_norm": 0.3000081777572632, + "elapsed": 30.761418342590332 + }, + { + "step": 48, + "loss": 0.574467122554779, + "error": 0.296875, + "gradient_norm": 0.24150623381137848, + "elapsed": 35.67650651931763 + }, + { + "step": 64, + "loss": 0.6003620624542236, + "error": 0.35546875, + "gradient_norm": 0.07430054992437363, + "elapsed": 40.60572576522827 + }, + { + "step": 80, + "loss": 0.5429091453552246, + "error": 0.33203125, + "gradient_norm": 0.15341751277446747, + "elapsed": 45.546849727630615 + }, + { + "step": 96, + "loss": 0.368771493434906, + "error": 0.1640625, + "gradient_norm": 0.08923184871673584, + "elapsed": 50.49156332015991 + }, + { + "step": 112, + "loss": 0.516342043876648, + "error": 0.265625, + "gradient_norm": 0.10965219140052795, + "elapsed": 55.45058846473694 + }, + { + "step": 128, + "loss": 0.5925382971763611, + "error": 0.37109375, + "gradient_norm": 0.055406324565410614, + "elapsed": 60.40891766548157 + }, + { + "step": 144, + "loss": 0.19184258580207825, + "error": 0.07421875, + "gradient_norm": 0.07042146474123001, + "elapsed": 65.33323669433594 + }, + { + "step": 160, + "loss": 0.5202382206916809, + "error": 0.25390625, + "gradient_norm": 0.14782382547855377, + "elapsed": 70.26605796813965 + }, + { + "step": 176, + "loss": 0.46083134412765503, + "error": 0.22265625, + "gradient_norm": 0.09074779599905014, + "elapsed": 75.18221640586853 + }, + { + "step": 192, + "loss": 0.3054918646812439, + "error": 0.14453125, + "gradient_norm": 0.0588168129324913, + "elapsed": 80.1186010837555 + }, + { + "step": 208, + "loss": 0.4836011230945587, + "error": 0.27734375, + "gradient_norm": 0.09208947420120239, + "elapsed": 85.05764293670654 + }, + { + "step": 224, + "loss": 0.6640600562095642, + "error": 0.38671875, + "gradient_norm": 0.22026506066322327, + "elapsed": 89.98808217048645 + }, + { + "step": 240, + "loss": 0.02421322464942932, + "error": 0.00390625, + "gradient_norm": 0.008131005801260471, + "elapsed": 94.90194272994995 + }, + { + "step": 256, + "loss": 0.6302106976509094, + "error": 0.4296875, + "gradient_norm": 0.09762304276227951, + "elapsed": 99.82612204551697 + }, + { + "step": 272, + "loss": 0.5092596411705017, + "error": 0.27734375, + "gradient_norm": 0.11407691985368729, + "elapsed": 110.44065999984741 + }, + { + "step": 288, + "loss": 0.452798455953598, + "error": 0.2265625, + "gradient_norm": 0.1105576679110527, + "elapsed": 115.36984539031982 + }, + { + "step": 304, + "loss": 0.3378596305847168, + "error": 0.18359375, + "gradient_norm": 0.0841713547706604, + "elapsed": 120.29337763786316 + }, + { + "step": 320, + "loss": 0.6271854639053345, + "error": 0.38671875, + "gradient_norm": 0.1972702294588089, + "elapsed": 125.2231035232544 + }, + { + "step": 336, + "loss": 0.04562236741185188, + "error": 0.01171875, + "gradient_norm": 0.027922745794057846, + "elapsed": 130.14725255966187 + }, + { + "step": 352, + "loss": 0.5342530608177185, + "error": 0.26953125, + "gradient_norm": 0.09031179547309875, + "elapsed": 135.08111095428467 + }, + { + "step": 368, + "loss": 0.49785488843917847, + "error": 0.2578125, + "gradient_norm": 0.19366280734539032, + "elapsed": 140.00699138641357 + }, + { + "step": 384, + "loss": 0.5673326253890991, + "error": 0.30859375, + "gradient_norm": 0.20644932985305786, + "elapsed": 144.92276740074158 + }, + { + "step": 400, + "loss": 0.5581298470497131, + "error": 0.3203125, + "gradient_norm": 0.17668266594409943, + "elapsed": 149.86573243141174 + }, + { + "step": 416, + "loss": 0.5564071536064148, + "error": 0.30078125, + "gradient_norm": 0.0821610689163208, + "elapsed": 154.7953712940216 + }, + { + "step": 432, + "loss": 0.5540086030960083, + "error": 0.34765625, + "gradient_norm": 0.1438807100057602, + "elapsed": 159.72657418251038 + }, + { + "step": 448, + "loss": 0.540939450263977, + "error": 0.29296875, + "gradient_norm": 0.17986361682415009, + "elapsed": 164.6689453125 + }, + { + "step": 464, + "loss": 0.45807865262031555, + "error": 0.25, + "gradient_norm": 0.14453186094760895, + "elapsed": 169.58739304542542 + }, + { + "step": 480, + "loss": 0.5191650390625, + "error": 0.22265625, + "gradient_norm": 0.07955105602741241, + "elapsed": 174.5444438457489 + }, + { + "step": 496, + "loss": 0.1692925989627838, + "error": 0.0703125, + "gradient_norm": 0.07875128090381622, + "elapsed": 179.48035550117493 + }, + { + "step": 512, + "loss": 0.5580664873123169, + "error": 0.3125, + "gradient_norm": 0.27090802788734436, + "elapsed": 184.42834162712097 + }, + { + "step": 528, + "loss": 0.26402050256729126, + "error": 0.13671875, + "gradient_norm": 0.13135771453380585, + "elapsed": 195.17691040039062 + }, + { + "step": 544, + "loss": 0.4352915287017822, + "error": 0.1953125, + "gradient_norm": 0.15959712862968445, + "elapsed": 200.0421543121338 + }, + { + "step": 560, + "loss": 0.22861814498901367, + "error": 0.1015625, + "gradient_norm": 0.08776932209730148, + "elapsed": 204.95144605636597 + }, + { + "step": 576, + "loss": 0.28309381008148193, + "error": 0.1328125, + "gradient_norm": 0.11050742119550705, + "elapsed": 209.8526291847229 + }, + { + "step": 592, + "loss": 0.6409220695495605, + "error": 0.41015625, + "gradient_norm": 0.19826626777648926, + "elapsed": 214.84447717666626 + }, + { + "step": 608, + "loss": 0.25090643763542175, + "error": 0.109375, + "gradient_norm": 0.05864342302083969, + "elapsed": 219.72637391090393 + }, + { + "step": 624, + "loss": 0.11423969268798828, + "error": 0.05078125, + "gradient_norm": 0.05318564549088478, + "elapsed": 224.6331377029419 + }, + { + "step": 640, + "loss": 0.32663431763648987, + "error": 0.1328125, + "gradient_norm": 0.06877780705690384, + "elapsed": 229.5065622329712 + }, + { + "step": 656, + "loss": 0.24196995794773102, + "error": 0.10546875, + "gradient_norm": 0.07683655619621277, + "elapsed": 234.4042534828186 + }, + { + "step": 672, + "loss": 0.5349344611167908, + "error": 0.296875, + "gradient_norm": 0.15214307606220245, + "elapsed": 239.26656579971313 + }, + { + "step": 688, + "loss": 0.26759713888168335, + "error": 0.1171875, + "gradient_norm": 0.14698348939418793, + "elapsed": 244.21049737930298 + }, + { + "step": 704, + "loss": 0.37338894605636597, + "error": 0.18359375, + "gradient_norm": 0.10210632532835007, + "elapsed": 249.13519072532654 + }, + { + "step": 720, + "loss": 0.36807945370674133, + "error": 0.17578125, + "gradient_norm": 0.09668388962745667, + "elapsed": 254.06281065940857 + }, + { + "step": 736, + "loss": 0.3736685514450073, + "error": 0.15625, + "gradient_norm": 0.10987236350774765, + "elapsed": 259.01695108413696 + }, + { + "step": 752, + "loss": 0.5266942977905273, + "error": 0.29296875, + "gradient_norm": 0.09041415899991989, + "elapsed": 263.9530746936798 + }, + { + "step": 768, + "loss": 0.360038161277771, + "error": 0.1640625, + "gradient_norm": 0.10391079634428024, + "elapsed": 268.9019305706024 + }, + { + "step": 784, + "loss": 0.5700286626815796, + "error": 0.34375, + "gradient_norm": 0.12206032127141953, + "elapsed": 279.4174163341522 + }, + { + "step": 800, + "loss": 0.42533689737319946, + "error": 0.20703125, + "gradient_norm": 0.06605375558137894, + "elapsed": 284.3391351699829 + }, + { + "step": 816, + "loss": 0.12355346977710724, + "error": 0.046875, + "gradient_norm": 0.06571663916110992, + "elapsed": 289.2815272808075 + }, + { + "step": 832, + "loss": 0.6411258578300476, + "error": 0.3984375, + "gradient_norm": 0.160088911652565, + "elapsed": 294.2048614025116 + }, + { + "step": 848, + "loss": 0.5756919980049133, + "error": 0.3515625, + "gradient_norm": 0.0962308868765831, + "elapsed": 299.15635418891907 + }, + { + "step": 864, + "loss": 0.2706402540206909, + "error": 0.1171875, + "gradient_norm": 0.11391306668519974, + "elapsed": 304.09321761131287 + }, + { + "step": 880, + "loss": 0.33621329069137573, + "error": 0.1640625, + "gradient_norm": 0.09049320220947266, + "elapsed": 309.0412187576294 + }, + { + "step": 896, + "loss": 0.44343245029449463, + "error": 0.23828125, + "gradient_norm": 0.12484703958034515, + "elapsed": 313.98498797416687 + }, + { + "step": 912, + "loss": 0.5987736582756042, + "error": 0.359375, + "gradient_norm": 0.07541236281394958, + "elapsed": 318.9334623813629 + }, + { + "step": 928, + "loss": 0.38585522770881653, + "error": 0.1875, + "gradient_norm": 0.09290861338376999, + "elapsed": 323.86884689331055 + }, + { + "step": 944, + "loss": 0.4820440113544464, + "error": 0.234375, + "gradient_norm": 0.22198310494422913, + "elapsed": 328.7963180541992 + }, + { + "step": 960, + "loss": 0.07455944269895554, + "error": 0.015625, + "gradient_norm": 0.055282026529312134, + "elapsed": 333.75238251686096 + }, + { + "step": 976, + "loss": 0.013475366868078709, + "error": 0.0078125, + "gradient_norm": 0.009843004867434502, + "elapsed": 338.6403331756592 + }, + { + "step": 992, + "loss": 0.4429199695587158, + "error": 0.2265625, + "gradient_norm": 0.09489083290100098, + "elapsed": 343.5606532096863 + }, + { + "step": 1008, + "loss": 0.4892328381538391, + "error": 0.234375, + "gradient_norm": 0.1342826634645462, + "elapsed": 348.5243353843689 + }, + { + "step": 1024, + "loss": 0.6096819043159485, + "error": 0.32421875, + "gradient_norm": 0.17938998341560364, + "elapsed": 353.36506962776184 + } + ] + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.4341062307357788, + "objective": 0.4341062307357788, + "error": 0.208984375, + "gradient_norm": 0.07617632299661636, + "elapsed": 31.45817995071411 + }, + { + "step": 16, + "loss": 0.5996706485748291, + "objective": 0.5996706485748291, + "error": 0.359375, + "gradient_norm": 0.05249844491481781, + "elapsed": 56.34200572967529 + }, + { + "step": 32, + "loss": 0.4388691186904907, + "objective": 0.4388691186904907, + "error": 0.2041015625, + "gradient_norm": 0.0376109778881073, + "elapsed": 67.83739852905273 + }, + { + "step": 48, + "loss": 0.5373439788818359, + "objective": 0.5373439788818359, + "error": 0.2919921875, + "gradient_norm": 0.06261218339204788, + "elapsed": 76.69065475463867 + }, + { + "step": 64, + "loss": 0.24871854484081268, + "objective": 0.24871854484081268, + "error": 0.1162109375, + "gradient_norm": 0.05284671485424042, + "elapsed": 86.3852767944336 + }, + { + "step": 80, + "loss": 0.26628297567367554, + "objective": 0.26628297567367554, + "error": 0.123046875, + "gradient_norm": 0.04054367542266846, + "elapsed": 95.77356100082397 + }, + { + "step": 96, + "loss": 0.48436349630355835, + "objective": 0.48436349630355835, + "error": 0.259765625, + "gradient_norm": 0.05399860441684723, + "elapsed": 107.06293416023254 + }, + { + "step": 112, + "loss": 0.41063767671585083, + "objective": 0.41063767671585083, + "error": 0.1943359375, + "gradient_norm": 0.043602071702480316, + "elapsed": 116.78119611740112 + }, + { + "step": 128, + "loss": 0.3990316390991211, + "objective": 0.3990316390991211, + "error": 0.1865234375, + "gradient_norm": 0.0424419641494751, + "elapsed": 125.6915397644043 + }, + { + "step": 144, + "loss": 0.5119550228118896, + "objective": 0.5119550228118896, + "error": 0.2646484375, + "gradient_norm": 0.07688591629266739, + "elapsed": 136.20711088180542 + }, + { + "step": 160, + "loss": 0.3388235569000244, + "objective": 0.3388235569000244, + "error": 0.1630859375, + "gradient_norm": 0.07015731930732727, + "elapsed": 145.3505516052246 + }, + { + "step": 176, + "loss": 0.5952156186103821, + "objective": 0.5952156186103821, + "error": 0.3369140625, + "gradient_norm": 0.039373140782117844, + "elapsed": 154.77994871139526 + }, + { + "step": 192, + "loss": 0.15157413482666016, + "objective": 0.15157413482666016, + "error": 0.0634765625, + "gradient_norm": 0.029710670933127403, + "elapsed": 164.46801733970642 + }, + { + "step": 208, + "loss": 0.3120684027671814, + "objective": 0.3120684027671814, + "error": 0.1474609375, + "gradient_norm": 0.035548821091651917, + "elapsed": 173.24825358390808 + }, + { + "step": 224, + "loss": 0.5486405491828918, + "objective": 0.5486405491828918, + "error": 0.2900390625, + "gradient_norm": 0.0503678023815155, + "elapsed": 185.29849314689636 + }, + { + "step": 240, + "loss": 0.6046283841133118, + "objective": 0.6046283841133118, + "error": 0.3349609375, + "gradient_norm": 0.05043461173772812, + "elapsed": 197.54880928993225 + }, + { + "step": 256, + "loss": 0.5926339626312256, + "objective": 0.5926339626312256, + "error": 0.3359375, + "gradient_norm": 0.051241543143987656, + "elapsed": 211.79861068725586 + }, + { + "step": 272, + "loss": 0.4018518924713135, + "objective": 0.4018518924713135, + "error": 0.1943359375, + "gradient_norm": 0.0772147998213768, + "elapsed": 222.41974115371704 + }, + { + "step": 288, + "loss": 0.13863243162631989, + "objective": 0.13863243162631989, + "error": 0.0556640625, + "gradient_norm": 0.03334609419107437, + "elapsed": 234.04247426986694 + }, + { + "step": 304, + "loss": 0.562490701675415, + "objective": 0.562490701675415, + "error": 0.337890625, + "gradient_norm": 0.04585934057831764, + "elapsed": 242.65421533584595 + }, + { + "step": 320, + "loss": 0.5352796316146851, + "objective": 0.5352796316146851, + "error": 0.294921875, + "gradient_norm": 0.0837635025382042, + "elapsed": 252.10656356811523 + }, + { + "step": 336, + "loss": 0.26082637906074524, + "objective": 0.26082637906074524, + "error": 0.1220703125, + "gradient_norm": 0.048336997628211975, + "elapsed": 262.33449625968933 + }, + { + "step": 352, + "loss": 0.5959363579750061, + "objective": 0.5959363579750061, + "error": 0.3388671875, + "gradient_norm": 0.06797357648611069, + "elapsed": 271.9942307472229 + }, + { + "step": 368, + "loss": 0.48994284868240356, + "objective": 0.48994284868240356, + "error": 0.2587890625, + "gradient_norm": 0.06296153366565704, + "elapsed": 283.0493588447571 + }, + { + "step": 384, + "loss": 0.5710494518280029, + "objective": 0.5710494518280029, + "error": 0.3134765625, + "gradient_norm": 0.045333269983530045, + "elapsed": 294.64637446403503 + }, + { + "step": 400, + "loss": 0.5957783460617065, + "objective": 0.5957783460617065, + "error": 0.349609375, + "gradient_norm": 0.03918786719441414, + "elapsed": 307.6200888156891 + }, + { + "step": 416, + "loss": 0.27521568536758423, + "objective": 0.27521568536758423, + "error": 0.1220703125, + "gradient_norm": 0.038001637905836105, + "elapsed": 317.01610231399536 + }, + { + "step": 432, + "loss": 0.02379823848605156, + "objective": 0.02379823848605156, + "error": 0.0078125, + "gradient_norm": 0.007661945186555386, + "elapsed": 326.9360330104828 + }, + { + "step": 448, + "loss": 0.56734299659729, + "objective": 0.56734299659729, + "error": 0.3271484375, + "gradient_norm": 0.057416290044784546, + "elapsed": 339.6289041042328 + }, + { + "step": 464, + "loss": 0.10715995728969574, + "objective": 0.10715995728969574, + "error": 0.0380859375, + "gradient_norm": 0.02532491274178028, + "elapsed": 349.8584108352661 + }, + { + "step": 480, + "loss": 0.6143364310264587, + "objective": 0.6143364310264587, + "error": 0.36328125, + "gradient_norm": 0.08023032546043396, + "elapsed": 360.36362075805664 + }, + { + "step": 496, + "loss": 0.44069671630859375, + "objective": 0.44069671630859375, + "error": 0.2197265625, + "gradient_norm": 0.048025116324424744, + "elapsed": 369.48225808143616 + }, + { + "step": 512, + "loss": 0.019900165498256683, + "objective": 0.019900165498256683, + "error": 0.0107421875, + "gradient_norm": 0.0038635791279375553, + "elapsed": 378.59970593452454 + }, + { + "step": 528, + "loss": 0.033316534012556076, + "objective": 0.033316534012556076, + "error": 0.009765625, + "gradient_norm": 0.009174940176308155, + "elapsed": 393.4021761417389 + }, + { + "step": 544, + "loss": 0.41130945086479187, + "objective": 0.41130945086479187, + "error": 0.20703125, + "gradient_norm": 0.04695262759923935, + "elapsed": 402.8586280345917 + }, + { + "step": 560, + "loss": 0.5885373950004578, + "objective": 0.5885373950004578, + "error": 0.3544921875, + "gradient_norm": 0.08534500002861023, + "elapsed": 416.98661041259766 + }, + { + "step": 576, + "loss": 0.3804720640182495, + "objective": 0.3804720640182495, + "error": 0.19140625, + "gradient_norm": 0.05163278803229332, + "elapsed": 427.7550480365753 + }, + { + "step": 592, + "loss": 0.6101120710372925, + "objective": 0.6101120710372925, + "error": 0.3525390625, + "gradient_norm": 0.05593184754252434, + "elapsed": 441.05026268959045 + }, + { + "step": 608, + "loss": 0.5586092472076416, + "objective": 0.5586092472076416, + "error": 0.302734375, + "gradient_norm": 0.07458740472793579, + "elapsed": 452.95383286476135 + }, + { + "step": 624, + "loss": 0.5992780923843384, + "objective": 0.5992780923843384, + "error": 0.357421875, + "gradient_norm": 0.03618372976779938, + "elapsed": 466.1582691669464 + }, + { + "step": 640, + "loss": 0.3536975383758545, + "objective": 0.3536975383758545, + "error": 0.1650390625, + "gradient_norm": 0.05353165790438652, + "elapsed": 477.166255235672 + }, + { + "step": 656, + "loss": 0.4926893711090088, + "objective": 0.4926893711090088, + "error": 0.2626953125, + "gradient_norm": 0.05201377719640732, + "elapsed": 491.1417751312256 + }, + { + "step": 672, + "loss": 0.5754991173744202, + "objective": 0.5754991173744202, + "error": 0.3271484375, + "gradient_norm": 0.08167096972465515, + "elapsed": 501.630366563797 + }, + { + "step": 688, + "loss": 0.5685014724731445, + "objective": 0.5685014724731445, + "error": 0.333984375, + "gradient_norm": 0.043775107711553574, + "elapsed": 514.2880456447601 + }, + { + "step": 704, + "loss": 0.022465089336037636, + "objective": 0.022465089336037636, + "error": 0.0068359375, + "gradient_norm": 0.010172540321946144, + "elapsed": 522.9173214435577 + }, + { + "step": 720, + "loss": 0.035460107028484344, + "objective": 0.035460107028484344, + "error": 0.0107421875, + "gradient_norm": 0.010515578091144562, + "elapsed": 532.8470129966736 + }, + { + "step": 736, + "loss": 0.44765588641166687, + "objective": 0.44765588641166687, + "error": 0.2138671875, + "gradient_norm": 0.09050357341766357, + "elapsed": 541.9488840103149 + }, + { + "step": 752, + "loss": 0.5933939218521118, + "objective": 0.5933939218521118, + "error": 0.3359375, + "gradient_norm": 0.0665116235613823, + "elapsed": 552.9967355728149 + }, + { + "step": 768, + "loss": 0.6100764870643616, + "objective": 0.6100764870643616, + "error": 0.3515625, + "gradient_norm": 0.0821211114525795, + "elapsed": 563.7709202766418 + }, + { + "step": 784, + "loss": 0.02964692935347557, + "objective": 0.02964692935347557, + "error": 0.009765625, + "gradient_norm": 0.012663272209465504, + "elapsed": 573.1517221927643 + }, + { + "step": 800, + "loss": 0.38091832399368286, + "objective": 0.38091832399368286, + "error": 0.1904296875, + "gradient_norm": 0.060622021555900574, + "elapsed": 582.5687477588654 + }, + { + "step": 816, + "loss": 0.552335262298584, + "objective": 0.552335262298584, + "error": 0.3076171875, + "gradient_norm": 0.14419035613536835, + "elapsed": 594.4292685985565 + }, + { + "step": 832, + "loss": 0.5943340063095093, + "objective": 0.5943340063095093, + "error": 0.34375, + "gradient_norm": 0.0633513554930687, + "elapsed": 605.2052299976349 + }, + { + "step": 848, + "loss": 0.6074100732803345, + "objective": 0.6074100732803345, + "error": 0.3486328125, + "gradient_norm": 0.04225531220436096, + "elapsed": 614.8996202945709 + }, + { + "step": 864, + "loss": 0.6198879480361938, + "objective": 0.6198879480361938, + "error": 0.361328125, + "gradient_norm": 0.04208856821060181, + "elapsed": 625.4266908168793 + }, + { + "step": 880, + "loss": 0.6151762008666992, + "objective": 0.6151762008666992, + "error": 0.369140625, + "gradient_norm": 0.06261089444160461, + "elapsed": 636.0696911811829 + }, + { + "step": 896, + "loss": 0.49680083990097046, + "objective": 0.49680083990097046, + "error": 0.25390625, + "gradient_norm": 0.0827067643404007, + "elapsed": 644.6893246173859 + }, + { + "step": 912, + "loss": 0.4610927402973175, + "objective": 0.4610927402973175, + "error": 0.23828125, + "gradient_norm": 0.06652095168828964, + "elapsed": 655.969132900238 + }, + { + "step": 928, + "loss": 0.5218505859375, + "objective": 0.5218505859375, + "error": 0.2685546875, + "gradient_norm": 0.07188194245100021, + "elapsed": 667.5352523326874 + }, + { + "step": 944, + "loss": 0.33009427785873413, + "objective": 0.33009427785873413, + "error": 0.1533203125, + "gradient_norm": 0.05718810483813286, + "elapsed": 677.8397319316864 + }, + { + "step": 960, + "loss": 0.5703234672546387, + "objective": 0.5703234672546387, + "error": 0.3193359375, + "gradient_norm": 0.11168288439512253, + "elapsed": 687.8742904663086 + }, + { + "step": 976, + "loss": 0.025548014789819717, + "objective": 0.025548014789819717, + "error": 0.0107421875, + "gradient_norm": 0.009453393518924713, + "elapsed": 698.294285774231 + }, + { + "step": 992, + "loss": 0.45398157835006714, + "objective": 0.45398157835006714, + "error": 0.2412109375, + "gradient_norm": 0.04607952758669853, + "elapsed": 707.903199672699 + }, + { + "step": 1008, + "loss": 0.3412189781665802, + "objective": 0.3412189781665802, + "error": 0.1513671875, + "gradient_norm": 0.0432075597345829, + "elapsed": 718.5662748813629 + }, + { + "step": 1024, + "loss": 0.4376429319381714, + "objective": 0.4376429319381714, + "error": 0.2275390625, + "gradient_norm": 0.07974351197481155, + "elapsed": 728.8954858779907 + }, + { + "step": 1040, + "loss": 0.33512815833091736, + "objective": 0.33512815833091736, + "error": 0.150390625, + "gradient_norm": 0.04476875811815262, + "elapsed": 744.0822694301605 + }, + { + "step": 1056, + "loss": 0.5214208364486694, + "objective": 0.5214208364486694, + "error": 0.283203125, + "gradient_norm": 0.08898192644119263, + "elapsed": 755.1484262943268 + }, + { + "step": 1072, + "loss": 0.13849599659442902, + "objective": 0.13849599659442902, + "error": 0.052734375, + "gradient_norm": 0.028359953314065933, + "elapsed": 764.3303108215332 + }, + { + "step": 1088, + "loss": 0.323838472366333, + "objective": 0.323838472366333, + "error": 0.1435546875, + "gradient_norm": 0.04081716760993004, + "elapsed": 773.2739362716675 + }, + { + "step": 1104, + "loss": 0.5627881288528442, + "objective": 0.5627881288528442, + "error": 0.3125, + "gradient_norm": 0.08322097361087799, + "elapsed": 784.7223973274231 + }, + { + "step": 1120, + "loss": 0.44111010432243347, + "objective": 0.44111010432243347, + "error": 0.2216796875, + "gradient_norm": 0.05700977146625519, + "elapsed": 795.085648059845 + }, + { + "step": 1136, + "loss": 0.6395992040634155, + "objective": 0.6395992040634155, + "error": 0.39453125, + "gradient_norm": 0.0744553729891777, + "elapsed": 805.7942585945129 + }, + { + "step": 1152, + "loss": 0.5433304309844971, + "objective": 0.5433304309844971, + "error": 0.287109375, + "gradient_norm": 0.04814797267317772, + "elapsed": 817.3382890224457 + }, + { + "step": 1168, + "loss": 0.5708576440811157, + "objective": 0.5708576440811157, + "error": 0.3203125, + "gradient_norm": 0.051331400871276855, + "elapsed": 829.288791179657 + }, + { + "step": 1184, + "loss": 0.5447035431861877, + "objective": 0.5447035431861877, + "error": 0.2939453125, + "gradient_norm": 0.10116687417030334, + "elapsed": 839.6822843551636 + }, + { + "step": 1200, + "loss": 0.6125671863555908, + "objective": 0.6125671863555908, + "error": 0.3642578125, + "gradient_norm": 0.04368080571293831, + "elapsed": 850.2262740135193 + }, + { + "step": 1216, + "loss": 0.5002380609512329, + "objective": 0.5002380609512329, + "error": 0.259765625, + "gradient_norm": 0.04939017817378044, + "elapsed": 862.3783452510834 + }, + { + "step": 1232, + "loss": 0.5698772668838501, + "objective": 0.5698772668838501, + "error": 0.3173828125, + "gradient_norm": 0.04916854575276375, + "elapsed": 871.4622664451599 + }, + { + "step": 1248, + "loss": 0.6046518683433533, + "objective": 0.6046518683433533, + "error": 0.341796875, + "gradient_norm": 0.04919794574379921, + "elapsed": 883.3905737400055 + }, + { + "step": 1264, + "loss": 0.5913128852844238, + "objective": 0.5913128852844238, + "error": 0.357421875, + "gradient_norm": 0.046917904168367386, + "elapsed": 892.4264807701111 + }, + { + "step": 1280, + "loss": 0.5027461051940918, + "objective": 0.5027461051940918, + "error": 0.2626953125, + "gradient_norm": 0.04705750197172165, + "elapsed": 902.5875842571259 + }, + { + "step": 1296, + "loss": 0.13519814610481262, + "objective": 0.13519814610481262, + "error": 0.052734375, + "gradient_norm": 0.02625490538775921, + "elapsed": 912.4087471961975 + }, + { + "step": 1312, + "loss": 0.5862359404563904, + "objective": 0.5862359404563904, + "error": 0.3271484375, + "gradient_norm": 0.05441493168473244, + "elapsed": 923.992555141449 + }, + { + "step": 1328, + "loss": 0.6031408309936523, + "objective": 0.6031408309936523, + "error": 0.3505859375, + "gradient_norm": 0.05901554971933365, + "elapsed": 933.3936491012573 + }, + { + "step": 1344, + "loss": 0.5823733806610107, + "objective": 0.5823733806610107, + "error": 0.3310546875, + "gradient_norm": 0.0842989832162857, + "elapsed": 941.979998588562 + }, + { + "step": 1360, + "loss": 0.6241492033004761, + "objective": 0.6241492033004761, + "error": 0.3720703125, + "gradient_norm": 0.04446673393249512, + "elapsed": 954.969649553299 + }, + { + "step": 1376, + "loss": 0.5829156637191772, + "objective": 0.5829156637191772, + "error": 0.361328125, + "gradient_norm": 0.06615480780601501, + "elapsed": 966.0245676040649 + }, + { + "step": 1392, + "loss": 0.5968320369720459, + "objective": 0.5968320369720459, + "error": 0.34765625, + "gradient_norm": 0.05093541368842125, + "elapsed": 975.1022663116455 + }, + { + "step": 1408, + "loss": 0.045559000223875046, + "objective": 0.045559000223875046, + "error": 0.01171875, + "gradient_norm": 0.02514980360865593, + "elapsed": 987.2391452789307 + }, + { + "step": 1424, + "loss": 0.22601813077926636, + "objective": 0.22601813077926636, + "error": 0.09765625, + "gradient_norm": 0.04834206402301788, + "elapsed": 996.4583384990692 + }, + { + "step": 1440, + "loss": 0.23011144995689392, + "objective": 0.23011144995689392, + "error": 0.111328125, + "gradient_norm": 0.050687842071056366, + "elapsed": 1007.1440904140472 + }, + { + "step": 1456, + "loss": 0.018240466713905334, + "objective": 0.018240466713905334, + "error": 0.0078125, + "gradient_norm": 0.005604141391813755, + "elapsed": 1016.4502851963043 + }, + { + "step": 1472, + "loss": 0.4498720169067383, + "objective": 0.4498720169067383, + "error": 0.232421875, + "gradient_norm": 0.08179625123739243, + "elapsed": 1028.8303294181824 + }, + { + "step": 1488, + "loss": 0.24151627719402313, + "objective": 0.24151627719402313, + "error": 0.107421875, + "gradient_norm": 0.03838668763637543, + "elapsed": 1037.8867321014404 + }, + { + "step": 1504, + "loss": 0.46122002601623535, + "objective": 0.46122002601623535, + "error": 0.232421875, + "gradient_norm": 0.0726623386144638, + "elapsed": 1047.7258644104004 + }, + { + "step": 1520, + "loss": 0.5085602402687073, + "objective": 0.5085602402687073, + "error": 0.2705078125, + "gradient_norm": 0.06673175096511841, + "elapsed": 1059.352120399475 + }, + { + "step": 1536, + "loss": 0.6105246543884277, + "objective": 0.6105246543884277, + "error": 0.3818359375, + "gradient_norm": 0.04271261766552925, + "elapsed": 1070.1413230895996 + }, + { + "step": 1552, + "loss": 0.4792126417160034, + "objective": 0.4792126417160034, + "error": 0.2578125, + "gradient_norm": 0.05200039595365524, + "elapsed": 1086.444006204605 + }, + { + "step": 1568, + "loss": 0.5814266204833984, + "objective": 0.5814266204833984, + "error": 0.330078125, + "gradient_norm": 0.05867309868335724, + "elapsed": 1097.2902619838715 + }, + { + "step": 1584, + "loss": 0.6321226358413696, + "objective": 0.6321226358413696, + "error": 0.3798828125, + "gradient_norm": 0.05418067052960396, + "elapsed": 1107.9767682552338 + }, + { + "step": 1600, + "loss": 0.5931253433227539, + "objective": 0.5931253433227539, + "error": 0.3603515625, + "gradient_norm": 0.06396215409040451, + "elapsed": 1121.782609462738 + }, + { + "step": 1616, + "loss": 0.6411516666412354, + "objective": 0.6411516666412354, + "error": 0.38671875, + "gradient_norm": 0.05035768821835518, + "elapsed": 1132.7197887897491 + }, + { + "step": 1632, + "loss": 0.4267754852771759, + "objective": 0.4267754852771759, + "error": 0.2080078125, + "gradient_norm": 0.09109894186258316, + "elapsed": 1139.1667578220367 + }, + { + "step": 1648, + "loss": 0.21246182918548584, + "objective": 0.21246182918548584, + "error": 0.095703125, + "gradient_norm": 0.04478950425982475, + "elapsed": 1149.1183021068573 + }, + { + "step": 1664, + "loss": 0.46360665559768677, + "objective": 0.46360665559768677, + "error": 0.251953125, + "gradient_norm": 0.07668188214302063, + "elapsed": 1161.1197745800018 + }, + { + "step": 1680, + "loss": 0.46281397342681885, + "objective": 0.46281397342681885, + "error": 0.236328125, + "gradient_norm": 0.07954126596450806, + "elapsed": 1171.8474535942078 + }, + { + "step": 1696, + "loss": 0.2484058141708374, + "objective": 0.2484058141708374, + "error": 0.12109375, + "gradient_norm": 0.047261305153369904, + "elapsed": 1185.6542596817017 + }, + { + "step": 1712, + "loss": 0.24310235679149628, + "objective": 0.24310235679149628, + "error": 0.1064453125, + "gradient_norm": 0.07262872904539108, + "elapsed": 1197.8986082077026 + }, + { + "step": 1728, + "loss": 0.009729458019137383, + "objective": 0.009729458019137383, + "error": 0.001953125, + "gradient_norm": 0.01146845705807209, + "elapsed": 1208.495581150055 + }, + { + "step": 1744, + "loss": 0.24568752944469452, + "objective": 0.24568752944469452, + "error": 0.10546875, + "gradient_norm": 0.05830742046236992, + "elapsed": 1219.9394850730896 + }, + { + "step": 1760, + "loss": 0.022546378895640373, + "objective": 0.022546378895640373, + "error": 0.0068359375, + "gradient_norm": 0.007667526602745056, + "elapsed": 1229.5703229904175 + }, + { + "step": 1776, + "loss": 0.5848401784896851, + "objective": 0.5848401784896851, + "error": 0.3271484375, + "gradient_norm": 0.061901818960905075, + "elapsed": 1238.750280380249 + }, + { + "step": 1792, + "loss": 0.6031335592269897, + "objective": 0.6031335592269897, + "error": 0.3671875, + "gradient_norm": 0.0676632970571518, + "elapsed": 1247.7468683719635 + }, + { + "step": 1808, + "loss": 0.6210961937904358, + "objective": 0.6210961937904358, + "error": 0.3603515625, + "gradient_norm": 0.0718468651175499, + "elapsed": 1256.1821897029877 + }, + { + "step": 1824, + "loss": 0.570877730846405, + "objective": 0.570877730846405, + "error": 0.3212890625, + "gradient_norm": 0.05575930327177048, + "elapsed": 1266.4091975688934 + }, + { + "step": 1840, + "loss": 0.5711429119110107, + "objective": 0.5711429119110107, + "error": 0.31640625, + "gradient_norm": 0.0691002607345581, + "elapsed": 1277.4722146987915 + }, + { + "step": 1856, + "loss": 0.36046335101127625, + "objective": 0.36046335101127625, + "error": 0.16796875, + "gradient_norm": 0.04694395884871483, + "elapsed": 1287.1420249938965 + }, + { + "step": 1872, + "loss": 0.4688999652862549, + "objective": 0.4688999652862549, + "error": 0.2216796875, + "gradient_norm": 0.07401346415281296, + "elapsed": 1297.3945078849792 + }, + { + "step": 1888, + "loss": 0.46385282278060913, + "objective": 0.46385282278060913, + "error": 0.2373046875, + "gradient_norm": 0.05608939751982689, + "elapsed": 1305.9779334068298 + }, + { + "step": 1904, + "loss": 0.60875403881073, + "objective": 0.60875403881073, + "error": 0.365234375, + "gradient_norm": 0.05085878074169159, + "elapsed": 1317.3097081184387 + }, + { + "step": 1920, + "loss": 0.12223530560731888, + "objective": 0.12223530560731888, + "error": 0.0458984375, + "gradient_norm": 0.024870412424206734, + "elapsed": 1328.6486887931824 + }, + { + "step": 1936, + "loss": 0.3486189544200897, + "objective": 0.3486189544200897, + "error": 0.16796875, + "gradient_norm": 0.04780663549900055, + "elapsed": 1336.6701011657715 + }, + { + "step": 1952, + "loss": 0.5777363777160645, + "objective": 0.5777363777160645, + "error": 0.3427734375, + "gradient_norm": 0.0571451336145401, + "elapsed": 1346.9158833026886 + }, + { + "step": 1968, + "loss": 0.39320266246795654, + "objective": 0.39320266246795654, + "error": 0.1884765625, + "gradient_norm": 0.05673858895897865, + "elapsed": 1354.9182631969452 + }, + { + "step": 1984, + "loss": 0.5900611281394958, + "objective": 0.5900611281394958, + "error": 0.3349609375, + "gradient_norm": 0.06593932211399078, + "elapsed": 1364.2754452228546 + }, + { + "step": 2000, + "loss": 0.6212430000305176, + "objective": 0.6212430000305176, + "error": 0.3857421875, + "gradient_norm": 0.040818918496370316, + "elapsed": 1374.7192046642303 + }, + { + "step": 2016, + "loss": 0.15605247020721436, + "objective": 0.15605247020721436, + "error": 0.0556640625, + "gradient_norm": 0.03108786791563034, + "elapsed": 1386.2740807533264 + }, + { + "step": 2032, + "loss": 0.22049596905708313, + "objective": 0.22049596905708313, + "error": 0.1015625, + "gradient_norm": 0.042733557522296906, + "elapsed": 1396.6422457695007 + }, + { + "step": 2048, + "loss": 0.5642613172531128, + "objective": 0.5642613172531128, + "error": 0.306640625, + "gradient_norm": 0.07527482509613037, + "elapsed": 1407.6688070297241 + } + ] + }, + "training_source_snapshot": "training_sources/full3_1", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2338341346153846, + "512": 0.2336688701923077, + "blend-512": 0.23399939903846154, + "1024": 0.23329326923076923, + "blend-1024": 0.23342848557692306, + "1536": 0.2330679086538462, + "blend-1536": 0.23291766826923077, + "2048": 0.2335186298076923, + "blend-2048": 0.23290264423076928 + }, + "selected": "blend-2048" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22182992788461542, + "512": 0.22143930288461539, + "blend-512": 0.22125901442307694, + "1024": 0.22104867788461538, + "blend-1024": 0.22079326923076922, + "1536": 0.22017728365384615, + "blend-1536": 0.22095853365384618, + "2048": 0.22076322115384617, + "blend-2048": 0.22025240384615385 + }, + "selected": "1536" + } + ], + "checkpoints": { + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit logical tracking in intermediate passes when intermediate probabilities are unused.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false, + "numerical_controls": { + "gpu_gradient_control.json": { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "data": "First1024 rows of the authorized4096 training sample; no validation labels", + "weights": "Random scratch parameters, seed20261112; gradients only, no parameter update", + "block_size": 32, + "records": [ + { + "batch": 256, + "seconds_per_gradient": 0.38611968358357746, + "shots_per_second": 663.0068625977924, + "memory_stats": { + "num_allocs": 694, + "bytes_in_use": 306432, + "peak_bytes_in_use": 3054084608, + "largest_alloc_size": 3047267584, + "bytes_limit": 76526240993, + "bytes_reserved": 0, + "peak_bytes_reserved": 0, + "largest_free_block_bytes": 0, + "pool_bytes": 76526240768, + "peak_pool_bytes": 76526240768 + } + }, + { + "batch": 512, + "seconds_per_gradient": 0.6622018814086914, + "shots_per_second": 773.178111350017, + "memory_stats": { + "num_allocs": 1332, + "bytes_in_use": 308480, + "peak_bytes_in_use": 6079704832, + "largest_alloc_size": 6069432576, + "bytes_limit": 76526240993, + "bytes_reserved": 0, + "peak_bytes_reserved": 0, + "largest_free_block_bytes": 0, + "pool_bytes": 76526240768, + "peak_pool_bytes": 76526240768 + } + }, + { + "batch": 1024, + "seconds_per_gradient": 1.117707888285319, + "shots_per_second": 916.1606630252231, + "memory_stats": { + "num_allocs": 1970, + "bytes_in_use": 312576, + "peak_bytes_in_use": 12138994176, + "largest_alloc_size": 12122019840, + "bytes_limit": 76526240993, + "bytes_reserved": 0, + "peak_bytes_reserved": 0, + "largest_free_block_bytes": 0, + "pool_bytes": 76526240768, + "peak_pool_bytes": 76526240768 + } + } + ], + "original_gradient_gpu_control": { + "loss_max_difference": 1.6689300537109375e-06, + "prediction_max_difference": 1.0132789611816406e-06, + "neural_gradient_relative_difference": 5.505155786522664e-05, + "float64_precision_audit": "/run-state/workspace/research/learned_d5/full3_1/gpu_gradient_precision.json", + "tolerance_rationale": "Original3e-5 GPU gradient threshold failed at5.51e-5. Independent float64 audits of both float32 algorithms across six X/Z durations found comparable relative rounding errors up to5.72e-5, with probability errors below6.2e-7. Use1e-4 relative for this accumulated derivative." + } + }, + "gpu_gradient_precision.json": { + "data": "First16 supplied training rows per listed condition; no parameter updates", + "weights": "full3_1/weights-1536.npz", + "reference": "Original unblocked algorithm in float64, fixed float32 neural edge probabilities", + "source_sha256": { + "gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8" + }, + "initial_gpu_control_failure": { + "relative_neural_gradient_difference": 5.505155786522664e-05, + "original_tolerance": 3e-05, + "maximum_loss_difference": 1.6689300537109375e-06, + "maximum_prediction_difference": 1.0132789611816406e-06 + }, + "records": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.30205945019442737, + "unblocked_float32": { + "maximum_loss_error": 2.966804864001915e-07, + "maximum_probability_error": 9.592670685565352e-08, + "neural_gradient_maximum_absolute_error": 1.6391277313232422e-07, + "neural_gradient_relative_error": 3.6604459916077934e-06, + "neural_gradient_cosine": 0.9999999999933656 + }, + "blocked_float32": { + "maximum_loss_error": 1.7747119684941026e-07, + "maximum_probability_error": 8.879568846875685e-08, + "neural_gradient_maximum_absolute_error": 1.7881393432617188e-07, + "neural_gradient_relative_error": 4.366049097416422e-06, + "neural_gradient_cosine": 0.9999999999904692 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.22069588396473294, + "unblocked_float32": { + "maximum_loss_error": 5.498523059088711e-07, + "maximum_probability_error": 9.703680636796719e-08, + "neural_gradient_maximum_absolute_error": 6.686605047434568e-08, + "neural_gradient_relative_error": 2.392500410145668e-06, + "neural_gradient_cosine": 0.999999999997144 + }, + "blocked_float32": { + "maximum_loss_error": 8.745212829311194e-08, + "maximum_probability_error": 6.418482079162402e-08, + "neural_gradient_maximum_absolute_error": 6.705522537231445e-08, + "neural_gradient_relative_error": 1.7739189351699108e-06, + "neural_gradient_cosine": 0.9999999999984265 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.4664494516878606, + "unblocked_float32": { + "maximum_loss_error": 3.922858555771569e-07, + "maximum_probability_error": 2.581999101192167e-07, + "neural_gradient_maximum_absolute_error": 1.7015263438224792e-06, + "neural_gradient_relative_error": 2.234804892316077e-05, + "neural_gradient_cosine": 0.9999999997509151 + }, + "blocked_float32": { + "maximum_loss_error": 3.3479861938356947e-07, + "maximum_probability_error": 1.4954284288659636e-07, + "neural_gradient_maximum_absolute_error": 1.6633421182632446e-06, + "neural_gradient_relative_error": 2.4167285966292737e-05, + "neural_gradient_cosine": 0.9999999997089409 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.438354906018253, + "unblocked_float32": { + "maximum_loss_error": 6.361644384611509e-07, + "maximum_probability_error": 3.6173952677742705e-07, + "neural_gradient_maximum_absolute_error": 1.9436702132225037e-06, + "neural_gradient_relative_error": 5.252014500992631e-05, + "neural_gradient_cosine": 0.9999999986254251 + }, + "blocked_float32": { + "maximum_loss_error": 5.060161181180689e-07, + "maximum_probability_error": 2.589724067414423e-07, + "neural_gradient_maximum_absolute_error": 1.946929842233658e-06, + "neural_gradient_relative_error": 5.71756656511251e-05, + "neural_gradient_cosine": 0.999999998372327 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.3057787329709659, + "unblocked_float32": { + "maximum_loss_error": 6.74491174690317e-07, + "maximum_probability_error": 4.3885854938974234e-07, + "neural_gradient_maximum_absolute_error": 8.174683898687363e-07, + "neural_gradient_relative_error": 4.090547224844183e-05, + "neural_gradient_cosine": 0.9999999991633716 + }, + "blocked_float32": { + "maximum_loss_error": 6.643292806973733e-07, + "maximum_probability_error": 4.835620329712853e-07, + "neural_gradient_maximum_absolute_error": 1.1210795491933823e-06, + "neural_gradient_relative_error": 5.584921905818847e-05, + "neural_gradient_cosine": 0.9999999984491473 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "training_rows": 16, + "reference_neural_gradient_norm": 0.2501411033127809, + "unblocked_float32": { + "maximum_loss_error": 1.167099820564843e-06, + "maximum_probability_error": 4.921027032533942e-07, + "neural_gradient_maximum_absolute_error": 7.14324414730072e-07, + "neural_gradient_relative_error": 4.528117886548381e-05, + "neural_gradient_cosine": 0.9999999989770499 + }, + "blocked_float32": { + "maximum_loss_error": 1.4055183996664056e-06, + "maximum_probability_error": 6.113119928041755e-07, + "neural_gradient_maximum_absolute_error": 7.075723260641098e-07, + "neural_gradient_relative_error": 5.112087336342683e-05, + "neural_gradient_cosine": 0.9999999986947755 + } + } + ], + "status": "passed" + } + } + }, + { + "training": { + "initialization": "Uniform parameter averages of checkpoints from the same session-initialized training trajectory; no external weights", + "prior_pass": 3, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "hidden_width": 64, + "training": "No new optimizer updates; all learning comes from the recorded source trajectory and its session-trained parent", + "optimizer_updates_in_derived_run": 0, + "source_training_provenance": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "training_source_sha256": { + "learned_d5__train.py": "b73af9da21332dee9a43f653b514695b020fbc3516604b2e721d8cf0ea876d53", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "5e9420df1f6dd56518925e910096fb9bc93bd796a5933b13bf894a1a96256cdf", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "All supplied training shots per each of all26 d5 conditions; uniform condition and within-condition sampling for optimizer batches.", + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 516880, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 507282, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 19592, + "surface_code_bX_d5_r03_center_5_5": 19646, + "surface_code_bX_d5_r05_center_5_5": 19513, + "surface_code_bX_d5_r07_center_5_5": 19341, + "surface_code_bX_d5_r09_center_5_5": 19211, + "surface_code_bX_d5_r11_center_5_5": 19239, + "surface_code_bX_d5_r13_center_5_5": 19679, + "surface_code_bX_d5_r15_center_5_5": 19455, + "surface_code_bX_d5_r17_center_5_5": 19479, + "surface_code_bX_d5_r19_center_5_5": 19479, + "surface_code_bX_d5_r21_center_5_5": 19551, + "surface_code_bX_d5_r23_center_5_5": 19586, + "surface_code_bX_d5_r25_center_5_5": 19526, + "surface_code_bZ_d5_r01_center_5_5": 19652, + "surface_code_bZ_d5_r03_center_5_5": 19732, + "surface_code_bZ_d5_r05_center_5_5": 19754, + "surface_code_bZ_d5_r07_center_5_5": 19194, + "surface_code_bZ_d5_r09_center_5_5": 19641, + "surface_code_bZ_d5_r11_center_5_5": 19611, + "surface_code_bZ_d5_r13_center_5_5": 19424, + "surface_code_bZ_d5_r15_center_5_5": 19380, + "surface_code_bZ_d5_r17_center_5_5": 19384, + "surface_code_bZ_d5_r19_center_5_5": 19684, + "surface_code_bZ_d5_r21_center_5_5": 19559, + "surface_code_bZ_d5_r23_center_5_5": 19524, + "surface_code_bZ_d5_r25_center_5_5": 19446 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 2048, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261113, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_d5/feedback3_pilot/rng-768.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/feedback3_pilot/weights-768.npz", + "starting_checkpoint_sha256": "bc2ba1c529317ce1b5b661efae4707eca49c6995d6f22b04193fe7642662fed8", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "4096 training shots per each of all 26 d5 conditions, sampled without replacement with seed 20261023. Uniform condition and within-condition sampling for optimizer batches.", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1024, + "batch": 256, + "learning_rate": 0.001, + "sampling_seed": 20261108, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "starting_checkpoint": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.011146659031510353, + "error": 0.00390625, + "gradient_norm": 0.011240893043577671, + "elapsed": 21.276997089385986 + }, + { + "step": 16, + "loss": 0.645737886428833, + "error": 0.40625, + "gradient_norm": 0.1628236621618271, + "elapsed": 25.872907638549805 + }, + { + "step": 32, + "loss": 0.574029803276062, + "error": 0.35546875, + "gradient_norm": 0.3000081777572632, + "elapsed": 30.761418342590332 + }, + { + "step": 48, + "loss": 0.574467122554779, + "error": 0.296875, + "gradient_norm": 0.24150623381137848, + "elapsed": 35.67650651931763 + }, + { + "step": 64, + "loss": 0.6003620624542236, + "error": 0.35546875, + "gradient_norm": 0.07430054992437363, + "elapsed": 40.60572576522827 + }, + { + "step": 80, + "loss": 0.5429091453552246, + "error": 0.33203125, + "gradient_norm": 0.15341751277446747, + "elapsed": 45.546849727630615 + }, + { + "step": 96, + "loss": 0.368771493434906, + "error": 0.1640625, + "gradient_norm": 0.08923184871673584, + "elapsed": 50.49156332015991 + }, + { + "step": 112, + "loss": 0.516342043876648, + "error": 0.265625, + "gradient_norm": 0.10965219140052795, + "elapsed": 55.45058846473694 + }, + { + "step": 128, + "loss": 0.5925382971763611, + "error": 0.37109375, + "gradient_norm": 0.055406324565410614, + "elapsed": 60.40891766548157 + }, + { + "step": 144, + "loss": 0.19184258580207825, + "error": 0.07421875, + "gradient_norm": 0.07042146474123001, + "elapsed": 65.33323669433594 + }, + { + "step": 160, + "loss": 0.5202382206916809, + "error": 0.25390625, + "gradient_norm": 0.14782382547855377, + "elapsed": 70.26605796813965 + }, + { + "step": 176, + "loss": 0.46083134412765503, + "error": 0.22265625, + "gradient_norm": 0.09074779599905014, + "elapsed": 75.18221640586853 + }, + { + "step": 192, + "loss": 0.3054918646812439, + "error": 0.14453125, + "gradient_norm": 0.0588168129324913, + "elapsed": 80.1186010837555 + }, + { + "step": 208, + "loss": 0.4836011230945587, + "error": 0.27734375, + "gradient_norm": 0.09208947420120239, + "elapsed": 85.05764293670654 + }, + { + "step": 224, + "loss": 0.6640600562095642, + "error": 0.38671875, + "gradient_norm": 0.22026506066322327, + "elapsed": 89.98808217048645 + }, + { + "step": 240, + "loss": 0.02421322464942932, + "error": 0.00390625, + "gradient_norm": 0.008131005801260471, + "elapsed": 94.90194272994995 + }, + { + "step": 256, + "loss": 0.6302106976509094, + "error": 0.4296875, + "gradient_norm": 0.09762304276227951, + "elapsed": 99.82612204551697 + }, + { + "step": 272, + "loss": 0.5092596411705017, + "error": 0.27734375, + "gradient_norm": 0.11407691985368729, + "elapsed": 110.44065999984741 + }, + { + "step": 288, + "loss": 0.452798455953598, + "error": 0.2265625, + "gradient_norm": 0.1105576679110527, + "elapsed": 115.36984539031982 + }, + { + "step": 304, + "loss": 0.3378596305847168, + "error": 0.18359375, + "gradient_norm": 0.0841713547706604, + "elapsed": 120.29337763786316 + }, + { + "step": 320, + "loss": 0.6271854639053345, + "error": 0.38671875, + "gradient_norm": 0.1972702294588089, + "elapsed": 125.2231035232544 + }, + { + "step": 336, + "loss": 0.04562236741185188, + "error": 0.01171875, + "gradient_norm": 0.027922745794057846, + "elapsed": 130.14725255966187 + }, + { + "step": 352, + "loss": 0.5342530608177185, + "error": 0.26953125, + "gradient_norm": 0.09031179547309875, + "elapsed": 135.08111095428467 + }, + { + "step": 368, + "loss": 0.49785488843917847, + "error": 0.2578125, + "gradient_norm": 0.19366280734539032, + "elapsed": 140.00699138641357 + }, + { + "step": 384, + "loss": 0.5673326253890991, + "error": 0.30859375, + "gradient_norm": 0.20644932985305786, + "elapsed": 144.92276740074158 + }, + { + "step": 400, + "loss": 0.5581298470497131, + "error": 0.3203125, + "gradient_norm": 0.17668266594409943, + "elapsed": 149.86573243141174 + }, + { + "step": 416, + "loss": 0.5564071536064148, + "error": 0.30078125, + "gradient_norm": 0.0821610689163208, + "elapsed": 154.7953712940216 + }, + { + "step": 432, + "loss": 0.5540086030960083, + "error": 0.34765625, + "gradient_norm": 0.1438807100057602, + "elapsed": 159.72657418251038 + }, + { + "step": 448, + "loss": 0.540939450263977, + "error": 0.29296875, + "gradient_norm": 0.17986361682415009, + "elapsed": 164.6689453125 + }, + { + "step": 464, + "loss": 0.45807865262031555, + "error": 0.25, + "gradient_norm": 0.14453186094760895, + "elapsed": 169.58739304542542 + }, + { + "step": 480, + "loss": 0.5191650390625, + "error": 0.22265625, + "gradient_norm": 0.07955105602741241, + "elapsed": 174.5444438457489 + }, + { + "step": 496, + "loss": 0.1692925989627838, + "error": 0.0703125, + "gradient_norm": 0.07875128090381622, + "elapsed": 179.48035550117493 + }, + { + "step": 512, + "loss": 0.5580664873123169, + "error": 0.3125, + "gradient_norm": 0.27090802788734436, + "elapsed": 184.42834162712097 + }, + { + "step": 528, + "loss": 0.26402050256729126, + "error": 0.13671875, + "gradient_norm": 0.13135771453380585, + "elapsed": 195.17691040039062 + }, + { + "step": 544, + "loss": 0.4352915287017822, + "error": 0.1953125, + "gradient_norm": 0.15959712862968445, + "elapsed": 200.0421543121338 + }, + { + "step": 560, + "loss": 0.22861814498901367, + "error": 0.1015625, + "gradient_norm": 0.08776932209730148, + "elapsed": 204.95144605636597 + }, + { + "step": 576, + "loss": 0.28309381008148193, + "error": 0.1328125, + "gradient_norm": 0.11050742119550705, + "elapsed": 209.8526291847229 + }, + { + "step": 592, + "loss": 0.6409220695495605, + "error": 0.41015625, + "gradient_norm": 0.19826626777648926, + "elapsed": 214.84447717666626 + }, + { + "step": 608, + "loss": 0.25090643763542175, + "error": 0.109375, + "gradient_norm": 0.05864342302083969, + "elapsed": 219.72637391090393 + }, + { + "step": 624, + "loss": 0.11423969268798828, + "error": 0.05078125, + "gradient_norm": 0.05318564549088478, + "elapsed": 224.6331377029419 + }, + { + "step": 640, + "loss": 0.32663431763648987, + "error": 0.1328125, + "gradient_norm": 0.06877780705690384, + "elapsed": 229.5065622329712 + }, + { + "step": 656, + "loss": 0.24196995794773102, + "error": 0.10546875, + "gradient_norm": 0.07683655619621277, + "elapsed": 234.4042534828186 + }, + { + "step": 672, + "loss": 0.5349344611167908, + "error": 0.296875, + "gradient_norm": 0.15214307606220245, + "elapsed": 239.26656579971313 + }, + { + "step": 688, + "loss": 0.26759713888168335, + "error": 0.1171875, + "gradient_norm": 0.14698348939418793, + "elapsed": 244.21049737930298 + }, + { + "step": 704, + "loss": 0.37338894605636597, + "error": 0.18359375, + "gradient_norm": 0.10210632532835007, + "elapsed": 249.13519072532654 + }, + { + "step": 720, + "loss": 0.36807945370674133, + "error": 0.17578125, + "gradient_norm": 0.09668388962745667, + "elapsed": 254.06281065940857 + }, + { + "step": 736, + "loss": 0.3736685514450073, + "error": 0.15625, + "gradient_norm": 0.10987236350774765, + "elapsed": 259.01695108413696 + }, + { + "step": 752, + "loss": 0.5266942977905273, + "error": 0.29296875, + "gradient_norm": 0.09041415899991989, + "elapsed": 263.9530746936798 + }, + { + "step": 768, + "loss": 0.360038161277771, + "error": 0.1640625, + "gradient_norm": 0.10391079634428024, + "elapsed": 268.9019305706024 + }, + { + "step": 784, + "loss": 0.5700286626815796, + "error": 0.34375, + "gradient_norm": 0.12206032127141953, + "elapsed": 279.4174163341522 + }, + { + "step": 800, + "loss": 0.42533689737319946, + "error": 0.20703125, + "gradient_norm": 0.06605375558137894, + "elapsed": 284.3391351699829 + }, + { + "step": 816, + "loss": 0.12355346977710724, + "error": 0.046875, + "gradient_norm": 0.06571663916110992, + "elapsed": 289.2815272808075 + }, + { + "step": 832, + "loss": 0.6411258578300476, + "error": 0.3984375, + "gradient_norm": 0.160088911652565, + "elapsed": 294.2048614025116 + }, + { + "step": 848, + "loss": 0.5756919980049133, + "error": 0.3515625, + "gradient_norm": 0.0962308868765831, + "elapsed": 299.15635418891907 + }, + { + "step": 864, + "loss": 0.2706402540206909, + "error": 0.1171875, + "gradient_norm": 0.11391306668519974, + "elapsed": 304.09321761131287 + }, + { + "step": 880, + "loss": 0.33621329069137573, + "error": 0.1640625, + "gradient_norm": 0.09049320220947266, + "elapsed": 309.0412187576294 + }, + { + "step": 896, + "loss": 0.44343245029449463, + "error": 0.23828125, + "gradient_norm": 0.12484703958034515, + "elapsed": 313.98498797416687 + }, + { + "step": 912, + "loss": 0.5987736582756042, + "error": 0.359375, + "gradient_norm": 0.07541236281394958, + "elapsed": 318.9334623813629 + }, + { + "step": 928, + "loss": 0.38585522770881653, + "error": 0.1875, + "gradient_norm": 0.09290861338376999, + "elapsed": 323.86884689331055 + }, + { + "step": 944, + "loss": 0.4820440113544464, + "error": 0.234375, + "gradient_norm": 0.22198310494422913, + "elapsed": 328.7963180541992 + }, + { + "step": 960, + "loss": 0.07455944269895554, + "error": 0.015625, + "gradient_norm": 0.055282026529312134, + "elapsed": 333.75238251686096 + }, + { + "step": 976, + "loss": 0.013475366868078709, + "error": 0.0078125, + "gradient_norm": 0.009843004867434502, + "elapsed": 338.6403331756592 + }, + { + "step": 992, + "loss": 0.4429199695587158, + "error": 0.2265625, + "gradient_norm": 0.09489083290100098, + "elapsed": 343.5606532096863 + }, + { + "step": 1008, + "loss": 0.4892328381538391, + "error": 0.234375, + "gradient_norm": 0.1342826634645462, + "elapsed": 348.5243353843689 + }, + { + "step": 1024, + "loss": 0.6096819043159485, + "error": 0.32421875, + "gradient_norm": 0.17938998341560364, + "elapsed": 353.36506962776184 + } + ] + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.4341062307357788, + "objective": 0.4341062307357788, + "error": 0.208984375, + "gradient_norm": 0.07617632299661636, + "elapsed": 31.45817995071411 + }, + { + "step": 16, + "loss": 0.5996706485748291, + "objective": 0.5996706485748291, + "error": 0.359375, + "gradient_norm": 0.05249844491481781, + "elapsed": 56.34200572967529 + }, + { + "step": 32, + "loss": 0.4388691186904907, + "objective": 0.4388691186904907, + "error": 0.2041015625, + "gradient_norm": 0.0376109778881073, + "elapsed": 67.83739852905273 + }, + { + "step": 48, + "loss": 0.5373439788818359, + "objective": 0.5373439788818359, + "error": 0.2919921875, + "gradient_norm": 0.06261218339204788, + "elapsed": 76.69065475463867 + }, + { + "step": 64, + "loss": 0.24871854484081268, + "objective": 0.24871854484081268, + "error": 0.1162109375, + "gradient_norm": 0.05284671485424042, + "elapsed": 86.3852767944336 + }, + { + "step": 80, + "loss": 0.26628297567367554, + "objective": 0.26628297567367554, + "error": 0.123046875, + "gradient_norm": 0.04054367542266846, + "elapsed": 95.77356100082397 + }, + { + "step": 96, + "loss": 0.48436349630355835, + "objective": 0.48436349630355835, + "error": 0.259765625, + "gradient_norm": 0.05399860441684723, + "elapsed": 107.06293416023254 + }, + { + "step": 112, + "loss": 0.41063767671585083, + "objective": 0.41063767671585083, + "error": 0.1943359375, + "gradient_norm": 0.043602071702480316, + "elapsed": 116.78119611740112 + }, + { + "step": 128, + "loss": 0.3990316390991211, + "objective": 0.3990316390991211, + "error": 0.1865234375, + "gradient_norm": 0.0424419641494751, + "elapsed": 125.6915397644043 + }, + { + "step": 144, + "loss": 0.5119550228118896, + "objective": 0.5119550228118896, + "error": 0.2646484375, + "gradient_norm": 0.07688591629266739, + "elapsed": 136.20711088180542 + }, + { + "step": 160, + "loss": 0.3388235569000244, + "objective": 0.3388235569000244, + "error": 0.1630859375, + "gradient_norm": 0.07015731930732727, + "elapsed": 145.3505516052246 + }, + { + "step": 176, + "loss": 0.5952156186103821, + "objective": 0.5952156186103821, + "error": 0.3369140625, + "gradient_norm": 0.039373140782117844, + "elapsed": 154.77994871139526 + }, + { + "step": 192, + "loss": 0.15157413482666016, + "objective": 0.15157413482666016, + "error": 0.0634765625, + "gradient_norm": 0.029710670933127403, + "elapsed": 164.46801733970642 + }, + { + "step": 208, + "loss": 0.3120684027671814, + "objective": 0.3120684027671814, + "error": 0.1474609375, + "gradient_norm": 0.035548821091651917, + "elapsed": 173.24825358390808 + }, + { + "step": 224, + "loss": 0.5486405491828918, + "objective": 0.5486405491828918, + "error": 0.2900390625, + "gradient_norm": 0.0503678023815155, + "elapsed": 185.29849314689636 + }, + { + "step": 240, + "loss": 0.6046283841133118, + "objective": 0.6046283841133118, + "error": 0.3349609375, + "gradient_norm": 0.05043461173772812, + "elapsed": 197.54880928993225 + }, + { + "step": 256, + "loss": 0.5926339626312256, + "objective": 0.5926339626312256, + "error": 0.3359375, + "gradient_norm": 0.051241543143987656, + "elapsed": 211.79861068725586 + }, + { + "step": 272, + "loss": 0.4018518924713135, + "objective": 0.4018518924713135, + "error": 0.1943359375, + "gradient_norm": 0.0772147998213768, + "elapsed": 222.41974115371704 + }, + { + "step": 288, + "loss": 0.13863243162631989, + "objective": 0.13863243162631989, + "error": 0.0556640625, + "gradient_norm": 0.03334609419107437, + "elapsed": 234.04247426986694 + }, + { + "step": 304, + "loss": 0.562490701675415, + "objective": 0.562490701675415, + "error": 0.337890625, + "gradient_norm": 0.04585934057831764, + "elapsed": 242.65421533584595 + }, + { + "step": 320, + "loss": 0.5352796316146851, + "objective": 0.5352796316146851, + "error": 0.294921875, + "gradient_norm": 0.0837635025382042, + "elapsed": 252.10656356811523 + }, + { + "step": 336, + "loss": 0.26082637906074524, + "objective": 0.26082637906074524, + "error": 0.1220703125, + "gradient_norm": 0.048336997628211975, + "elapsed": 262.33449625968933 + }, + { + "step": 352, + "loss": 0.5959363579750061, + "objective": 0.5959363579750061, + "error": 0.3388671875, + "gradient_norm": 0.06797357648611069, + "elapsed": 271.9942307472229 + }, + { + "step": 368, + "loss": 0.48994284868240356, + "objective": 0.48994284868240356, + "error": 0.2587890625, + "gradient_norm": 0.06296153366565704, + "elapsed": 283.0493588447571 + }, + { + "step": 384, + "loss": 0.5710494518280029, + "objective": 0.5710494518280029, + "error": 0.3134765625, + "gradient_norm": 0.045333269983530045, + "elapsed": 294.64637446403503 + }, + { + "step": 400, + "loss": 0.5957783460617065, + "objective": 0.5957783460617065, + "error": 0.349609375, + "gradient_norm": 0.03918786719441414, + "elapsed": 307.6200888156891 + }, + { + "step": 416, + "loss": 0.27521568536758423, + "objective": 0.27521568536758423, + "error": 0.1220703125, + "gradient_norm": 0.038001637905836105, + "elapsed": 317.01610231399536 + }, + { + "step": 432, + "loss": 0.02379823848605156, + "objective": 0.02379823848605156, + "error": 0.0078125, + "gradient_norm": 0.007661945186555386, + "elapsed": 326.9360330104828 + }, + { + "step": 448, + "loss": 0.56734299659729, + "objective": 0.56734299659729, + "error": 0.3271484375, + "gradient_norm": 0.057416290044784546, + "elapsed": 339.6289041042328 + }, + { + "step": 464, + "loss": 0.10715995728969574, + "objective": 0.10715995728969574, + "error": 0.0380859375, + "gradient_norm": 0.02532491274178028, + "elapsed": 349.8584108352661 + }, + { + "step": 480, + "loss": 0.6143364310264587, + "objective": 0.6143364310264587, + "error": 0.36328125, + "gradient_norm": 0.08023032546043396, + "elapsed": 360.36362075805664 + }, + { + "step": 496, + "loss": 0.44069671630859375, + "objective": 0.44069671630859375, + "error": 0.2197265625, + "gradient_norm": 0.048025116324424744, + "elapsed": 369.48225808143616 + }, + { + "step": 512, + "loss": 0.019900165498256683, + "objective": 0.019900165498256683, + "error": 0.0107421875, + "gradient_norm": 0.0038635791279375553, + "elapsed": 378.59970593452454 + }, + { + "step": 528, + "loss": 0.033316534012556076, + "objective": 0.033316534012556076, + "error": 0.009765625, + "gradient_norm": 0.009174940176308155, + "elapsed": 393.4021761417389 + }, + { + "step": 544, + "loss": 0.41130945086479187, + "objective": 0.41130945086479187, + "error": 0.20703125, + "gradient_norm": 0.04695262759923935, + "elapsed": 402.8586280345917 + }, + { + "step": 560, + "loss": 0.5885373950004578, + "objective": 0.5885373950004578, + "error": 0.3544921875, + "gradient_norm": 0.08534500002861023, + "elapsed": 416.98661041259766 + }, + { + "step": 576, + "loss": 0.3804720640182495, + "objective": 0.3804720640182495, + "error": 0.19140625, + "gradient_norm": 0.05163278803229332, + "elapsed": 427.7550480365753 + }, + { + "step": 592, + "loss": 0.6101120710372925, + "objective": 0.6101120710372925, + "error": 0.3525390625, + "gradient_norm": 0.05593184754252434, + "elapsed": 441.05026268959045 + }, + { + "step": 608, + "loss": 0.5586092472076416, + "objective": 0.5586092472076416, + "error": 0.302734375, + "gradient_norm": 0.07458740472793579, + "elapsed": 452.95383286476135 + }, + { + "step": 624, + "loss": 0.5992780923843384, + "objective": 0.5992780923843384, + "error": 0.357421875, + "gradient_norm": 0.03618372976779938, + "elapsed": 466.1582691669464 + }, + { + "step": 640, + "loss": 0.3536975383758545, + "objective": 0.3536975383758545, + "error": 0.1650390625, + "gradient_norm": 0.05353165790438652, + "elapsed": 477.166255235672 + }, + { + "step": 656, + "loss": 0.4926893711090088, + "objective": 0.4926893711090088, + "error": 0.2626953125, + "gradient_norm": 0.05201377719640732, + "elapsed": 491.1417751312256 + }, + { + "step": 672, + "loss": 0.5754991173744202, + "objective": 0.5754991173744202, + "error": 0.3271484375, + "gradient_norm": 0.08167096972465515, + "elapsed": 501.630366563797 + }, + { + "step": 688, + "loss": 0.5685014724731445, + "objective": 0.5685014724731445, + "error": 0.333984375, + "gradient_norm": 0.043775107711553574, + "elapsed": 514.2880456447601 + }, + { + "step": 704, + "loss": 0.022465089336037636, + "objective": 0.022465089336037636, + "error": 0.0068359375, + "gradient_norm": 0.010172540321946144, + "elapsed": 522.9173214435577 + }, + { + "step": 720, + "loss": 0.035460107028484344, + "objective": 0.035460107028484344, + "error": 0.0107421875, + "gradient_norm": 0.010515578091144562, + "elapsed": 532.8470129966736 + }, + { + "step": 736, + "loss": 0.44765588641166687, + "objective": 0.44765588641166687, + "error": 0.2138671875, + "gradient_norm": 0.09050357341766357, + "elapsed": 541.9488840103149 + }, + { + "step": 752, + "loss": 0.5933939218521118, + "objective": 0.5933939218521118, + "error": 0.3359375, + "gradient_norm": 0.0665116235613823, + "elapsed": 552.9967355728149 + }, + { + "step": 768, + "loss": 0.6100764870643616, + "objective": 0.6100764870643616, + "error": 0.3515625, + "gradient_norm": 0.0821211114525795, + "elapsed": 563.7709202766418 + }, + { + "step": 784, + "loss": 0.02964692935347557, + "objective": 0.02964692935347557, + "error": 0.009765625, + "gradient_norm": 0.012663272209465504, + "elapsed": 573.1517221927643 + }, + { + "step": 800, + "loss": 0.38091832399368286, + "objective": 0.38091832399368286, + "error": 0.1904296875, + "gradient_norm": 0.060622021555900574, + "elapsed": 582.5687477588654 + }, + { + "step": 816, + "loss": 0.552335262298584, + "objective": 0.552335262298584, + "error": 0.3076171875, + "gradient_norm": 0.14419035613536835, + "elapsed": 594.4292685985565 + }, + { + "step": 832, + "loss": 0.5943340063095093, + "objective": 0.5943340063095093, + "error": 0.34375, + "gradient_norm": 0.0633513554930687, + "elapsed": 605.2052299976349 + }, + { + "step": 848, + "loss": 0.6074100732803345, + "objective": 0.6074100732803345, + "error": 0.3486328125, + "gradient_norm": 0.04225531220436096, + "elapsed": 614.8996202945709 + }, + { + "step": 864, + "loss": 0.6198879480361938, + "objective": 0.6198879480361938, + "error": 0.361328125, + "gradient_norm": 0.04208856821060181, + "elapsed": 625.4266908168793 + }, + { + "step": 880, + "loss": 0.6151762008666992, + "objective": 0.6151762008666992, + "error": 0.369140625, + "gradient_norm": 0.06261089444160461, + "elapsed": 636.0696911811829 + }, + { + "step": 896, + "loss": 0.49680083990097046, + "objective": 0.49680083990097046, + "error": 0.25390625, + "gradient_norm": 0.0827067643404007, + "elapsed": 644.6893246173859 + }, + { + "step": 912, + "loss": 0.4610927402973175, + "objective": 0.4610927402973175, + "error": 0.23828125, + "gradient_norm": 0.06652095168828964, + "elapsed": 655.969132900238 + }, + { + "step": 928, + "loss": 0.5218505859375, + "objective": 0.5218505859375, + "error": 0.2685546875, + "gradient_norm": 0.07188194245100021, + "elapsed": 667.5352523326874 + }, + { + "step": 944, + "loss": 0.33009427785873413, + "objective": 0.33009427785873413, + "error": 0.1533203125, + "gradient_norm": 0.05718810483813286, + "elapsed": 677.8397319316864 + }, + { + "step": 960, + "loss": 0.5703234672546387, + "objective": 0.5703234672546387, + "error": 0.3193359375, + "gradient_norm": 0.11168288439512253, + "elapsed": 687.8742904663086 + }, + { + "step": 976, + "loss": 0.025548014789819717, + "objective": 0.025548014789819717, + "error": 0.0107421875, + "gradient_norm": 0.009453393518924713, + "elapsed": 698.294285774231 + }, + { + "step": 992, + "loss": 0.45398157835006714, + "objective": 0.45398157835006714, + "error": 0.2412109375, + "gradient_norm": 0.04607952758669853, + "elapsed": 707.903199672699 + }, + { + "step": 1008, + "loss": 0.3412189781665802, + "objective": 0.3412189781665802, + "error": 0.1513671875, + "gradient_norm": 0.0432075597345829, + "elapsed": 718.5662748813629 + }, + { + "step": 1024, + "loss": 0.4376429319381714, + "objective": 0.4376429319381714, + "error": 0.2275390625, + "gradient_norm": 0.07974351197481155, + "elapsed": 728.8954858779907 + }, + { + "step": 1040, + "loss": 0.33512815833091736, + "objective": 0.33512815833091736, + "error": 0.150390625, + "gradient_norm": 0.04476875811815262, + "elapsed": 744.0822694301605 + }, + { + "step": 1056, + "loss": 0.5214208364486694, + "objective": 0.5214208364486694, + "error": 0.283203125, + "gradient_norm": 0.08898192644119263, + "elapsed": 755.1484262943268 + }, + { + "step": 1072, + "loss": 0.13849599659442902, + "objective": 0.13849599659442902, + "error": 0.052734375, + "gradient_norm": 0.028359953314065933, + "elapsed": 764.3303108215332 + }, + { + "step": 1088, + "loss": 0.323838472366333, + "objective": 0.323838472366333, + "error": 0.1435546875, + "gradient_norm": 0.04081716760993004, + "elapsed": 773.2739362716675 + }, + { + "step": 1104, + "loss": 0.5627881288528442, + "objective": 0.5627881288528442, + "error": 0.3125, + "gradient_norm": 0.08322097361087799, + "elapsed": 784.7223973274231 + }, + { + "step": 1120, + "loss": 0.44111010432243347, + "objective": 0.44111010432243347, + "error": 0.2216796875, + "gradient_norm": 0.05700977146625519, + "elapsed": 795.085648059845 + }, + { + "step": 1136, + "loss": 0.6395992040634155, + "objective": 0.6395992040634155, + "error": 0.39453125, + "gradient_norm": 0.0744553729891777, + "elapsed": 805.7942585945129 + }, + { + "step": 1152, + "loss": 0.5433304309844971, + "objective": 0.5433304309844971, + "error": 0.287109375, + "gradient_norm": 0.04814797267317772, + "elapsed": 817.3382890224457 + }, + { + "step": 1168, + "loss": 0.5708576440811157, + "objective": 0.5708576440811157, + "error": 0.3203125, + "gradient_norm": 0.051331400871276855, + "elapsed": 829.288791179657 + }, + { + "step": 1184, + "loss": 0.5447035431861877, + "objective": 0.5447035431861877, + "error": 0.2939453125, + "gradient_norm": 0.10116687417030334, + "elapsed": 839.6822843551636 + }, + { + "step": 1200, + "loss": 0.6125671863555908, + "objective": 0.6125671863555908, + "error": 0.3642578125, + "gradient_norm": 0.04368080571293831, + "elapsed": 850.2262740135193 + }, + { + "step": 1216, + "loss": 0.5002380609512329, + "objective": 0.5002380609512329, + "error": 0.259765625, + "gradient_norm": 0.04939017817378044, + "elapsed": 862.3783452510834 + }, + { + "step": 1232, + "loss": 0.5698772668838501, + "objective": 0.5698772668838501, + "error": 0.3173828125, + "gradient_norm": 0.04916854575276375, + "elapsed": 871.4622664451599 + }, + { + "step": 1248, + "loss": 0.6046518683433533, + "objective": 0.6046518683433533, + "error": 0.341796875, + "gradient_norm": 0.04919794574379921, + "elapsed": 883.3905737400055 + }, + { + "step": 1264, + "loss": 0.5913128852844238, + "objective": 0.5913128852844238, + "error": 0.357421875, + "gradient_norm": 0.046917904168367386, + "elapsed": 892.4264807701111 + }, + { + "step": 1280, + "loss": 0.5027461051940918, + "objective": 0.5027461051940918, + "error": 0.2626953125, + "gradient_norm": 0.04705750197172165, + "elapsed": 902.5875842571259 + }, + { + "step": 1296, + "loss": 0.13519814610481262, + "objective": 0.13519814610481262, + "error": 0.052734375, + "gradient_norm": 0.02625490538775921, + "elapsed": 912.4087471961975 + }, + { + "step": 1312, + "loss": 0.5862359404563904, + "objective": 0.5862359404563904, + "error": 0.3271484375, + "gradient_norm": 0.05441493168473244, + "elapsed": 923.992555141449 + }, + { + "step": 1328, + "loss": 0.6031408309936523, + "objective": 0.6031408309936523, + "error": 0.3505859375, + "gradient_norm": 0.05901554971933365, + "elapsed": 933.3936491012573 + }, + { + "step": 1344, + "loss": 0.5823733806610107, + "objective": 0.5823733806610107, + "error": 0.3310546875, + "gradient_norm": 0.0842989832162857, + "elapsed": 941.979998588562 + }, + { + "step": 1360, + "loss": 0.6241492033004761, + "objective": 0.6241492033004761, + "error": 0.3720703125, + "gradient_norm": 0.04446673393249512, + "elapsed": 954.969649553299 + }, + { + "step": 1376, + "loss": 0.5829156637191772, + "objective": 0.5829156637191772, + "error": 0.361328125, + "gradient_norm": 0.06615480780601501, + "elapsed": 966.0245676040649 + }, + { + "step": 1392, + "loss": 0.5968320369720459, + "objective": 0.5968320369720459, + "error": 0.34765625, + "gradient_norm": 0.05093541368842125, + "elapsed": 975.1022663116455 + }, + { + "step": 1408, + "loss": 0.045559000223875046, + "objective": 0.045559000223875046, + "error": 0.01171875, + "gradient_norm": 0.02514980360865593, + "elapsed": 987.2391452789307 + }, + { + "step": 1424, + "loss": 0.22601813077926636, + "objective": 0.22601813077926636, + "error": 0.09765625, + "gradient_norm": 0.04834206402301788, + "elapsed": 996.4583384990692 + }, + { + "step": 1440, + "loss": 0.23011144995689392, + "objective": 0.23011144995689392, + "error": 0.111328125, + "gradient_norm": 0.050687842071056366, + "elapsed": 1007.1440904140472 + }, + { + "step": 1456, + "loss": 0.018240466713905334, + "objective": 0.018240466713905334, + "error": 0.0078125, + "gradient_norm": 0.005604141391813755, + "elapsed": 1016.4502851963043 + }, + { + "step": 1472, + "loss": 0.4498720169067383, + "objective": 0.4498720169067383, + "error": 0.232421875, + "gradient_norm": 0.08179625123739243, + "elapsed": 1028.8303294181824 + }, + { + "step": 1488, + "loss": 0.24151627719402313, + "objective": 0.24151627719402313, + "error": 0.107421875, + "gradient_norm": 0.03838668763637543, + "elapsed": 1037.8867321014404 + }, + { + "step": 1504, + "loss": 0.46122002601623535, + "objective": 0.46122002601623535, + "error": 0.232421875, + "gradient_norm": 0.0726623386144638, + "elapsed": 1047.7258644104004 + }, + { + "step": 1520, + "loss": 0.5085602402687073, + "objective": 0.5085602402687073, + "error": 0.2705078125, + "gradient_norm": 0.06673175096511841, + "elapsed": 1059.352120399475 + }, + { + "step": 1536, + "loss": 0.6105246543884277, + "objective": 0.6105246543884277, + "error": 0.3818359375, + "gradient_norm": 0.04271261766552925, + "elapsed": 1070.1413230895996 + }, + { + "step": 1552, + "loss": 0.4792126417160034, + "objective": 0.4792126417160034, + "error": 0.2578125, + "gradient_norm": 0.05200039595365524, + "elapsed": 1086.444006204605 + }, + { + "step": 1568, + "loss": 0.5814266204833984, + "objective": 0.5814266204833984, + "error": 0.330078125, + "gradient_norm": 0.05867309868335724, + "elapsed": 1097.2902619838715 + }, + { + "step": 1584, + "loss": 0.6321226358413696, + "objective": 0.6321226358413696, + "error": 0.3798828125, + "gradient_norm": 0.05418067052960396, + "elapsed": 1107.9767682552338 + }, + { + "step": 1600, + "loss": 0.5931253433227539, + "objective": 0.5931253433227539, + "error": 0.3603515625, + "gradient_norm": 0.06396215409040451, + "elapsed": 1121.782609462738 + }, + { + "step": 1616, + "loss": 0.6411516666412354, + "objective": 0.6411516666412354, + "error": 0.38671875, + "gradient_norm": 0.05035768821835518, + "elapsed": 1132.7197887897491 + }, + { + "step": 1632, + "loss": 0.4267754852771759, + "objective": 0.4267754852771759, + "error": 0.2080078125, + "gradient_norm": 0.09109894186258316, + "elapsed": 1139.1667578220367 + }, + { + "step": 1648, + "loss": 0.21246182918548584, + "objective": 0.21246182918548584, + "error": 0.095703125, + "gradient_norm": 0.04478950425982475, + "elapsed": 1149.1183021068573 + }, + { + "step": 1664, + "loss": 0.46360665559768677, + "objective": 0.46360665559768677, + "error": 0.251953125, + "gradient_norm": 0.07668188214302063, + "elapsed": 1161.1197745800018 + }, + { + "step": 1680, + "loss": 0.46281397342681885, + "objective": 0.46281397342681885, + "error": 0.236328125, + "gradient_norm": 0.07954126596450806, + "elapsed": 1171.8474535942078 + }, + { + "step": 1696, + "loss": 0.2484058141708374, + "objective": 0.2484058141708374, + "error": 0.12109375, + "gradient_norm": 0.047261305153369904, + "elapsed": 1185.6542596817017 + }, + { + "step": 1712, + "loss": 0.24310235679149628, + "objective": 0.24310235679149628, + "error": 0.1064453125, + "gradient_norm": 0.07262872904539108, + "elapsed": 1197.8986082077026 + }, + { + "step": 1728, + "loss": 0.009729458019137383, + "objective": 0.009729458019137383, + "error": 0.001953125, + "gradient_norm": 0.01146845705807209, + "elapsed": 1208.495581150055 + }, + { + "step": 1744, + "loss": 0.24568752944469452, + "objective": 0.24568752944469452, + "error": 0.10546875, + "gradient_norm": 0.05830742046236992, + "elapsed": 1219.9394850730896 + }, + { + "step": 1760, + "loss": 0.022546378895640373, + "objective": 0.022546378895640373, + "error": 0.0068359375, + "gradient_norm": 0.007667526602745056, + "elapsed": 1229.5703229904175 + }, + { + "step": 1776, + "loss": 0.5848401784896851, + "objective": 0.5848401784896851, + "error": 0.3271484375, + "gradient_norm": 0.061901818960905075, + "elapsed": 1238.750280380249 + }, + { + "step": 1792, + "loss": 0.6031335592269897, + "objective": 0.6031335592269897, + "error": 0.3671875, + "gradient_norm": 0.0676632970571518, + "elapsed": 1247.7468683719635 + }, + { + "step": 1808, + "loss": 0.6210961937904358, + "objective": 0.6210961937904358, + "error": 0.3603515625, + "gradient_norm": 0.0718468651175499, + "elapsed": 1256.1821897029877 + }, + { + "step": 1824, + "loss": 0.570877730846405, + "objective": 0.570877730846405, + "error": 0.3212890625, + "gradient_norm": 0.05575930327177048, + "elapsed": 1266.4091975688934 + }, + { + "step": 1840, + "loss": 0.5711429119110107, + "objective": 0.5711429119110107, + "error": 0.31640625, + "gradient_norm": 0.0691002607345581, + "elapsed": 1277.4722146987915 + }, + { + "step": 1856, + "loss": 0.36046335101127625, + "objective": 0.36046335101127625, + "error": 0.16796875, + "gradient_norm": 0.04694395884871483, + "elapsed": 1287.1420249938965 + }, + { + "step": 1872, + "loss": 0.4688999652862549, + "objective": 0.4688999652862549, + "error": 0.2216796875, + "gradient_norm": 0.07401346415281296, + "elapsed": 1297.3945078849792 + }, + { + "step": 1888, + "loss": 0.46385282278060913, + "objective": 0.46385282278060913, + "error": 0.2373046875, + "gradient_norm": 0.05608939751982689, + "elapsed": 1305.9779334068298 + }, + { + "step": 1904, + "loss": 0.60875403881073, + "objective": 0.60875403881073, + "error": 0.365234375, + "gradient_norm": 0.05085878074169159, + "elapsed": 1317.3097081184387 + }, + { + "step": 1920, + "loss": 0.12223530560731888, + "objective": 0.12223530560731888, + "error": 0.0458984375, + "gradient_norm": 0.024870412424206734, + "elapsed": 1328.6486887931824 + }, + { + "step": 1936, + "loss": 0.3486189544200897, + "objective": 0.3486189544200897, + "error": 0.16796875, + "gradient_norm": 0.04780663549900055, + "elapsed": 1336.6701011657715 + }, + { + "step": 1952, + "loss": 0.5777363777160645, + "objective": 0.5777363777160645, + "error": 0.3427734375, + "gradient_norm": 0.0571451336145401, + "elapsed": 1346.9158833026886 + }, + { + "step": 1968, + "loss": 0.39320266246795654, + "objective": 0.39320266246795654, + "error": 0.1884765625, + "gradient_norm": 0.05673858895897865, + "elapsed": 1354.9182631969452 + }, + { + "step": 1984, + "loss": 0.5900611281394958, + "objective": 0.5900611281394958, + "error": 0.3349609375, + "gradient_norm": 0.06593932211399078, + "elapsed": 1364.2754452228546 + }, + { + "step": 2000, + "loss": 0.6212430000305176, + "objective": 0.6212430000305176, + "error": 0.3857421875, + "gradient_norm": 0.040818918496370316, + "elapsed": 1374.7192046642303 + }, + { + "step": 2016, + "loss": 0.15605247020721436, + "objective": 0.15605247020721436, + "error": 0.0556640625, + "gradient_norm": 0.03108786791563034, + "elapsed": 1386.2740807533264 + }, + { + "step": 2032, + "loss": 0.22049596905708313, + "objective": 0.22049596905708313, + "error": 0.1015625, + "gradient_norm": 0.042733557522296906, + "elapsed": 1396.6422457695007 + }, + { + "step": 2048, + "loss": 0.5642613172531128, + "objective": 0.5642613172531128, + "error": 0.306640625, + "gradient_norm": 0.07527482509613037, + "elapsed": 1407.6688070297241 + } + ] + }, + "derived_checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ce5951e7095a9912dc74719254f2fcf9654f219078392b7acf7a8545e6f9f3f4", + "complete": true + }, + "mean4": { + "checkpoint_label": "mean4", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 512, + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "512": "d4194b40470453e5df9b75e12326cbbd0e6845946870bb0d53a2cbbdd6ea32dc", + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "512": { + "step": 512, + "training_samples": 524288, + "unique_training_rows_seen_in_this_phase": 324661, + "weights_sha256": "d4194b40470453e5df9b75e12326cbbd0e6845946870bb0d53a2cbbdd6ea32dc", + "complete": true + }, + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ff5a023ce2c18be7c29f810a3788a450e3ad3ad2237d6e9448923aa6a28c5074", + "complete": true + } + }, + "selection": "Predefined averages of the last3 or all4 saved noninitial full3_1 checkpoints; evaluate every validation condition before selecting", + "test_data_used": false, + "derivation_source_sha256": "08c498d6952b0380e001371df9a0461a483631a301f93747b821e529e72b349d" + }, + "training_source_snapshot": "training_sources/full3_swa", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23290264423076928, + "mean3": 0.2335186298076923, + "blend-mean3": 0.2325420673076923, + "mean4": 0.23326322115384618, + "blend-mean4": 0.23300781250000002 + }, + "selected": "blend-mean3" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22017728365384615, + "mean3": 0.22037259615384613, + "blend-mean3": 0.22091346153846153, + "mean4": 0.2205528846153846, + "blend-mean4": 0.22100360576923078 + }, + "selected": "incumbent" + } + ], + "checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ce5951e7095a9912dc74719254f2fcf9654f219078392b7acf7a8545e6f9f3f4", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit logical tracking in intermediate passes when intermediate probabilities are unused.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false + }, + { + "training": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261134", + "prior_pass": 3, + "initial_seed": 20261134, + "training_source_sha256": { + "learned_d5__train.py": "1f66b75e34e385a6d2654021f3fd124c9d8a359da1f677369e3e774728f83168", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "All supplied training shots per each of all26 d5 conditions; uniform condition and within-condition sampling for optimizer batches.", + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 516880, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 491030, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18670, + "surface_code_bX_d5_r03_center_5_5": 18940, + "surface_code_bX_d5_r05_center_5_5": 19128, + "surface_code_bX_d5_r07_center_5_5": 18988, + "surface_code_bX_d5_r09_center_5_5": 18523, + "surface_code_bX_d5_r11_center_5_5": 19227, + "surface_code_bX_d5_r13_center_5_5": 18816, + "surface_code_bX_d5_r15_center_5_5": 18107, + "surface_code_bX_d5_r17_center_5_5": 18728, + "surface_code_bX_d5_r19_center_5_5": 18983, + "surface_code_bX_d5_r21_center_5_5": 18959, + "surface_code_bX_d5_r23_center_5_5": 19079, + "surface_code_bX_d5_r25_center_5_5": 19193, + "surface_code_bZ_d5_r01_center_5_5": 18828, + "surface_code_bZ_d5_r03_center_5_5": 18896, + "surface_code_bZ_d5_r05_center_5_5": 19011, + "surface_code_bZ_d5_r07_center_5_5": 18806, + "surface_code_bZ_d5_r09_center_5_5": 18268, + "surface_code_bZ_d5_r11_center_5_5": 18927, + "surface_code_bZ_d5_r13_center_5_5": 19399, + "surface_code_bZ_d5_r15_center_5_5": 19358, + "surface_code_bZ_d5_r17_center_5_5": 18634, + "surface_code_bZ_d5_r19_center_5_5": 19126, + "surface_code_bZ_d5_r21_center_5_5": 18603, + "surface_code_bZ_d5_r23_center_5_5": 18626, + "surface_code_bZ_d5_r25_center_5_5": 19207 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1536, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261135, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "/run-state/workspace/research/learned_d5/fresh2_warm/rng-512.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/fresh2_warm/weights-512.npz", + "starting_checkpoint_sha256": "d3e3abba07693bd7fd3d17be2dd981d5b803a496e76ba230ed94afeb51f26f4f", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261134", + "prior_pass": 3, + "initial_seed": 20261134, + "training_source_sha256": { + "learned_d5__train.py": "1f66b75e34e385a6d2654021f3fd124c9d8a359da1f677369e3e774728f83168", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "All supplied training shots per each of all26 d5 conditions; uniform condition and within-condition sampling for optimizer batches.", + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 516880, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 325678, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 11962, + "surface_code_bX_d5_r03_center_5_5": 10232, + "surface_code_bX_d5_r05_center_5_5": 14014, + "surface_code_bX_d5_r07_center_5_5": 11594, + "surface_code_bX_d5_r09_center_5_5": 12805, + "surface_code_bX_d5_r11_center_5_5": 11644, + "surface_code_bX_d5_r13_center_5_5": 13845, + "surface_code_bX_d5_r15_center_5_5": 10703, + "surface_code_bX_d5_r17_center_5_5": 15460, + "surface_code_bX_d5_r19_center_5_5": 14156, + "surface_code_bX_d5_r21_center_5_5": 11568, + "surface_code_bX_d5_r23_center_5_5": 14156, + "surface_code_bX_d5_r25_center_5_5": 12021, + "surface_code_bZ_d5_r01_center_5_5": 10601, + "surface_code_bZ_d5_r03_center_5_5": 14135, + "surface_code_bZ_d5_r05_center_5_5": 11975, + "surface_code_bZ_d5_r07_center_5_5": 13841, + "surface_code_bZ_d5_r09_center_5_5": 12024, + "surface_code_bZ_d5_r11_center_5_5": 11151, + "surface_code_bZ_d5_r13_center_5_5": 10640, + "surface_code_bZ_d5_r15_center_5_5": 11089, + "surface_code_bZ_d5_r17_center_5_5": 13788, + "surface_code_bZ_d5_r19_center_5_5": 12350, + "surface_code_bZ_d5_r21_center_5_5": 12797, + "surface_code_bZ_d5_r23_center_5_5": 12809, + "surface_code_bZ_d5_r25_center_5_5": 14318 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 512, + "batch": 1024, + "learning_rate": 0.001, + "sampling_seed": 20261135, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "rng_restored": false, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "Fresh NumPy default_rng seed 20261135", + "starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "starting_training_provenance": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.6522030830383301, + "objective": 0.6522030830383301, + "error": 0.375, + "gradient_norm": 0.11649785190820694, + "elapsed": 30.089841604232788 + }, + { + "step": 16, + "loss": 0.5927819609642029, + "objective": 0.5927819609642029, + "error": 0.3466796875, + "gradient_norm": 0.07945127785205841, + "elapsed": 48.85365080833435 + }, + { + "step": 32, + "loss": 0.3115929663181305, + "objective": 0.3115929663181305, + "error": 0.13671875, + "gradient_norm": 0.039320655167102814, + "elapsed": 63.60312819480896 + }, + { + "step": 48, + "loss": 0.2456369698047638, + "objective": 0.2456369698047638, + "error": 0.1015625, + "gradient_norm": 0.029398636892437935, + "elapsed": 73.71074151992798 + }, + { + "step": 64, + "loss": 0.6231744885444641, + "objective": 0.6231744885444641, + "error": 0.3759765625, + "gradient_norm": 0.06867238879203796, + "elapsed": 83.75580954551697 + }, + { + "step": 80, + "loss": 0.3674217164516449, + "objective": 0.3674217164516449, + "error": 0.1572265625, + "gradient_norm": 0.0557992123067379, + "elapsed": 94.6383364200592 + }, + { + "step": 96, + "loss": 0.5152362585067749, + "objective": 0.5152362585067749, + "error": 0.2568359375, + "gradient_norm": 0.08284599334001541, + "elapsed": 106.90000939369202 + }, + { + "step": 112, + "loss": 0.020773420110344887, + "objective": 0.020773420110344887, + "error": 0.0048828125, + "gradient_norm": 0.008813572116196156, + "elapsed": 117.77558088302612 + }, + { + "step": 128, + "loss": 0.02593131735920906, + "objective": 0.02593131735920906, + "error": 0.0087890625, + "gradient_norm": 0.00872033555060625, + "elapsed": 128.93439435958862 + }, + { + "step": 144, + "loss": 0.5852900743484497, + "objective": 0.5852900743484497, + "error": 0.3291015625, + "gradient_norm": 0.04771002382040024, + "elapsed": 139.5588686466217 + }, + { + "step": 160, + "loss": 0.46074625849723816, + "objective": 0.46074625849723816, + "error": 0.232421875, + "gradient_norm": 0.08834747970104218, + "elapsed": 151.5595977306366 + }, + { + "step": 176, + "loss": 0.6310865879058838, + "objective": 0.6310865879058838, + "error": 0.376953125, + "gradient_norm": 0.14084596931934357, + "elapsed": 163.7892107963562 + }, + { + "step": 192, + "loss": 0.246865376830101, + "objective": 0.246865376830101, + "error": 0.1103515625, + "gradient_norm": 0.041402049362659454, + "elapsed": 174.28971648216248 + }, + { + "step": 208, + "loss": 0.3103577196598053, + "objective": 0.3103577196598053, + "error": 0.15625, + "gradient_norm": 0.04525696486234665, + "elapsed": 187.03909611701965 + }, + { + "step": 224, + "loss": 0.4523138999938965, + "objective": 0.4523138999938965, + "error": 0.208984375, + "gradient_norm": 0.09180521965026855, + "elapsed": 199.56195068359375 + }, + { + "step": 240, + "loss": 0.02241751179099083, + "objective": 0.02241751179099083, + "error": 0.009765625, + "gradient_norm": 0.009998111054301262, + "elapsed": 212.35500597953796 + }, + { + "step": 256, + "loss": 0.5487150549888611, + "objective": 0.5487150549888611, + "error": 0.294921875, + "gradient_norm": 0.12748055160045624, + "elapsed": 223.03854608535767 + }, + { + "step": 272, + "loss": 0.023057367652654648, + "objective": 0.023057367652654648, + "error": 0.0078125, + "gradient_norm": 0.006953821517527103, + "elapsed": 244.6508972644806 + }, + { + "step": 288, + "loss": 0.5845386981964111, + "objective": 0.5845386981964111, + "error": 0.330078125, + "gradient_norm": 0.06542652100324631, + "elapsed": 256.78167748451233 + }, + { + "step": 304, + "loss": 0.442532479763031, + "objective": 0.442532479763031, + "error": 0.232421875, + "gradient_norm": 0.10874580591917038, + "elapsed": 269.1364529132843 + }, + { + "step": 320, + "loss": 0.3264174163341522, + "objective": 0.3264174163341522, + "error": 0.15625, + "gradient_norm": 0.06276191771030426, + "elapsed": 282.38969564437866 + }, + { + "step": 336, + "loss": 0.386960506439209, + "objective": 0.386960506439209, + "error": 0.177734375, + "gradient_norm": 0.06561421602964401, + "elapsed": 292.9079031944275 + }, + { + "step": 352, + "loss": 0.23919886350631714, + "objective": 0.23919886350631714, + "error": 0.107421875, + "gradient_norm": 0.02755703590810299, + "elapsed": 304.16068935394287 + }, + { + "step": 368, + "loss": 0.5029175281524658, + "objective": 0.5029175281524658, + "error": 0.259765625, + "gradient_norm": 0.0378776490688324, + "elapsed": 315.11088514328003 + }, + { + "step": 384, + "loss": 0.565666675567627, + "objective": 0.565666675567627, + "error": 0.322265625, + "gradient_norm": 0.11368246376514435, + "elapsed": 324.3651068210602 + }, + { + "step": 400, + "loss": 0.5846428275108337, + "objective": 0.5846428275108337, + "error": 0.3408203125, + "gradient_norm": 0.08116643130779266, + "elapsed": 334.70786476135254 + }, + { + "step": 416, + "loss": 0.025111017748713493, + "objective": 0.025111017748713493, + "error": 0.0078125, + "gradient_norm": 0.008838560432195663, + "elapsed": 345.56963562965393 + }, + { + "step": 432, + "loss": 0.628488302230835, + "objective": 0.628488302230835, + "error": 0.3818359375, + "gradient_norm": 0.04001976177096367, + "elapsed": 355.3310384750366 + }, + { + "step": 448, + "loss": 0.4569575786590576, + "objective": 0.4569575786590576, + "error": 0.2578125, + "gradient_norm": 0.06344135850667953, + "elapsed": 367.05255675315857 + }, + { + "step": 464, + "loss": 0.49193111062049866, + "objective": 0.49193111062049866, + "error": 0.24609375, + "gradient_norm": 0.06022385507822037, + "elapsed": 377.38399291038513 + }, + { + "step": 480, + "loss": 0.5920064449310303, + "objective": 0.5920064449310303, + "error": 0.3466796875, + "gradient_norm": 0.036063045263290405, + "elapsed": 387.7266733646393 + }, + { + "step": 496, + "loss": 0.22157302498817444, + "objective": 0.22157302498817444, + "error": 0.09375, + "gradient_norm": 0.04071022942662239, + "elapsed": 397.78643012046814 + }, + { + "step": 512, + "loss": 0.39216887950897217, + "objective": 0.39216887950897217, + "error": 0.1728515625, + "gradient_norm": 0.09079446643590927, + "elapsed": 407.0137679576874 + } + ] + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.6092928647994995, + "objective": 0.6092928647994995, + "error": 0.3583984375, + "gradient_norm": 0.08161187171936035, + "elapsed": 27.421262741088867 + }, + { + "step": 16, + "loss": 0.4709879755973816, + "objective": 0.4709879755973816, + "error": 0.2529296875, + "gradient_norm": 0.0541619211435318, + "elapsed": 48.74575757980347 + }, + { + "step": 32, + "loss": 0.5842419862747192, + "objective": 0.5842419862747192, + "error": 0.34375, + "gradient_norm": 0.09450904279947281, + "elapsed": 60.68022179603577 + }, + { + "step": 48, + "loss": 0.5840846300125122, + "objective": 0.5840846300125122, + "error": 0.32421875, + "gradient_norm": 0.04569687321782112, + "elapsed": 74.63272476196289 + }, + { + "step": 64, + "loss": 0.5139708518981934, + "objective": 0.5139708518981934, + "error": 0.2646484375, + "gradient_norm": 0.16111725568771362, + "elapsed": 91.88426613807678 + }, + { + "step": 80, + "loss": 0.49099838733673096, + "objective": 0.49099838733673096, + "error": 0.251953125, + "gradient_norm": 0.04431874305009842, + "elapsed": 105.08457684516907 + }, + { + "step": 96, + "loss": 0.30287861824035645, + "objective": 0.30287861824035645, + "error": 0.14453125, + "gradient_norm": 0.03792181238532066, + "elapsed": 118.16054177284241 + }, + { + "step": 112, + "loss": 0.6026535630226135, + "objective": 0.6026535630226135, + "error": 0.359375, + "gradient_norm": 0.043088704347610474, + "elapsed": 134.6414511203766 + }, + { + "step": 128, + "loss": 0.5983598828315735, + "objective": 0.5983598828315735, + "error": 0.328125, + "gradient_norm": 0.06492504477500916, + "elapsed": 148.38875198364258 + }, + { + "step": 144, + "loss": 0.616276204586029, + "objective": 0.616276204586029, + "error": 0.3857421875, + "gradient_norm": 0.05420554056763649, + "elapsed": 164.11315298080444 + }, + { + "step": 160, + "loss": 0.017882924526929855, + "objective": 0.017882924526929855, + "error": 0.0048828125, + "gradient_norm": 0.004682278726249933, + "elapsed": 178.31525373458862 + }, + { + "step": 176, + "loss": 0.5279660820960999, + "objective": 0.5279660820960999, + "error": 0.271484375, + "gradient_norm": 0.03895021602511406, + "elapsed": 192.20261907577515 + }, + { + "step": 192, + "loss": 0.5794406533241272, + "objective": 0.5794406533241272, + "error": 0.34375, + "gradient_norm": 0.041880734264850616, + "elapsed": 200.32051873207092 + }, + { + "step": 208, + "loss": 0.3353561758995056, + "objective": 0.3353561758995056, + "error": 0.1513671875, + "gradient_norm": 0.07022152841091156, + "elapsed": 212.5193521976471 + }, + { + "step": 224, + "loss": 0.47239983081817627, + "objective": 0.47239983081817627, + "error": 0.23828125, + "gradient_norm": 0.044771477580070496, + "elapsed": 223.36571788787842 + }, + { + "step": 240, + "loss": 0.6235381364822388, + "objective": 0.6235381364822388, + "error": 0.3779296875, + "gradient_norm": 0.047636937350034714, + "elapsed": 233.90032649040222 + }, + { + "step": 256, + "loss": 0.516319751739502, + "objective": 0.516319751739502, + "error": 0.271484375, + "gradient_norm": 0.087476447224617, + "elapsed": 245.52193427085876 + }, + { + "step": 272, + "loss": 0.23385891318321228, + "objective": 0.23385891318321228, + "error": 0.091796875, + "gradient_norm": 0.05921977758407593, + "elapsed": 254.38622951507568 + }, + { + "step": 288, + "loss": 0.31280556321144104, + "objective": 0.31280556321144104, + "error": 0.1318359375, + "gradient_norm": 0.03548427298665047, + "elapsed": 263.25871300697327 + }, + { + "step": 304, + "loss": 0.6208417415618896, + "objective": 0.6208417415618896, + "error": 0.361328125, + "gradient_norm": 0.10255666077136993, + "elapsed": 273.5115919113159 + }, + { + "step": 320, + "loss": 0.5985375642776489, + "objective": 0.5985375642776489, + "error": 0.3603515625, + "gradient_norm": 0.04024764895439148, + "elapsed": 285.4135670661926 + }, + { + "step": 336, + "loss": 0.028151696547865868, + "objective": 0.028151696547865868, + "error": 0.009765625, + "gradient_norm": 0.008847440592944622, + "elapsed": 295.0800693035126 + }, + { + "step": 352, + "loss": 0.6147637963294983, + "objective": 0.6147637963294983, + "error": 0.3603515625, + "gradient_norm": 0.05709920823574066, + "elapsed": 305.32019686698914 + }, + { + "step": 368, + "loss": 0.5955979824066162, + "objective": 0.5955979824066162, + "error": 0.3486328125, + "gradient_norm": 0.04276399686932564, + "elapsed": 316.3869025707245 + }, + { + "step": 384, + "loss": 0.23504304885864258, + "objective": 0.23504304885864258, + "error": 0.1025390625, + "gradient_norm": 0.03205326199531555, + "elapsed": 325.7849349975586 + }, + { + "step": 400, + "loss": 0.13460804522037506, + "objective": 0.13460804522037506, + "error": 0.0546875, + "gradient_norm": 0.03109711967408657, + "elapsed": 335.72691917419434 + }, + { + "step": 416, + "loss": 0.5798783302307129, + "objective": 0.5798783302307129, + "error": 0.322265625, + "gradient_norm": 0.053542010486125946, + "elapsed": 345.7052640914917 + }, + { + "step": 432, + "loss": 0.3892784118652344, + "objective": 0.3892784118652344, + "error": 0.19140625, + "gradient_norm": 0.052194178104400635, + "elapsed": 357.38475036621094 + }, + { + "step": 448, + "loss": 0.23582103848457336, + "objective": 0.23582103848457336, + "error": 0.1181640625, + "gradient_norm": 0.032037943601608276, + "elapsed": 369.5841510295868 + }, + { + "step": 464, + "loss": 0.5408849716186523, + "objective": 0.5408849716186523, + "error": 0.2900390625, + "gradient_norm": 0.07508285343647003, + "elapsed": 379.84099793434143 + }, + { + "step": 480, + "loss": 0.3894873559474945, + "objective": 0.3894873559474945, + "error": 0.19140625, + "gradient_norm": 0.03977999836206436, + "elapsed": 390.9687530994415 + }, + { + "step": 496, + "loss": 0.6059300899505615, + "objective": 0.6059300899505615, + "error": 0.361328125, + "gradient_norm": 0.06041429564356804, + "elapsed": 403.2380111217499 + }, + { + "step": 512, + "loss": 0.2117740511894226, + "objective": 0.2117740511894226, + "error": 0.0908203125, + "gradient_norm": 0.05693414434790611, + "elapsed": 414.4854781627655 + }, + { + "step": 528, + "loss": 0.4666211009025574, + "objective": 0.4666211009025574, + "error": 0.2470703125, + "gradient_norm": 0.0764947235584259, + "elapsed": 433.42368054389954 + }, + { + "step": 544, + "loss": 0.22636458277702332, + "objective": 0.22636458277702332, + "error": 0.1083984375, + "gradient_norm": 0.03683016076683998, + "elapsed": 442.92575907707214 + }, + { + "step": 560, + "loss": 0.23172692954540253, + "objective": 0.23172692954540253, + "error": 0.1083984375, + "gradient_norm": 0.034071482717990875, + "elapsed": 453.3129711151123 + }, + { + "step": 576, + "loss": 0.4768703579902649, + "objective": 0.4768703579902649, + "error": 0.2529296875, + "gradient_norm": 0.06308378279209137, + "elapsed": 462.4127457141876 + }, + { + "step": 592, + "loss": 0.5165150165557861, + "objective": 0.5165150165557861, + "error": 0.291015625, + "gradient_norm": 0.07674732059240341, + "elapsed": 473.8309862613678 + }, + { + "step": 608, + "loss": 0.5919064283370972, + "objective": 0.5919064283370972, + "error": 0.3359375, + "gradient_norm": 0.06379934400320053, + "elapsed": 484.3733870983124 + }, + { + "step": 624, + "loss": 0.01804366335272789, + "objective": 0.01804366335272789, + "error": 0.0068359375, + "gradient_norm": 0.005318541545420885, + "elapsed": 495.94076347351074 + }, + { + "step": 640, + "loss": 0.41747498512268066, + "objective": 0.41747498512268066, + "error": 0.1962890625, + "gradient_norm": 0.052116431295871735, + "elapsed": 506.73559165000916 + }, + { + "step": 656, + "loss": 0.6140056848526001, + "objective": 0.6140056848526001, + "error": 0.3896484375, + "gradient_norm": 0.05376415699720383, + "elapsed": 517.2397899627686 + }, + { + "step": 672, + "loss": 0.4098930358886719, + "objective": 0.4098930358886719, + "error": 0.197265625, + "gradient_norm": 0.04737741872668266, + "elapsed": 525.7957897186279 + }, + { + "step": 688, + "loss": 0.3499884009361267, + "objective": 0.3499884009361267, + "error": 0.1650390625, + "gradient_norm": 0.0714973583817482, + "elapsed": 534.9302124977112 + }, + { + "step": 704, + "loss": 0.552291989326477, + "objective": 0.552291989326477, + "error": 0.3095703125, + "gradient_norm": 0.10188189148902893, + "elapsed": 545.4470670223236 + }, + { + "step": 720, + "loss": 0.4040689468383789, + "objective": 0.4040689468383789, + "error": 0.1943359375, + "gradient_norm": 0.06630362570285797, + "elapsed": 554.2920794487 + }, + { + "step": 736, + "loss": 0.3191133439540863, + "objective": 0.3191133439540863, + "error": 0.15625, + "gradient_norm": 0.060587506741285324, + "elapsed": 562.335791349411 + }, + { + "step": 752, + "loss": 0.5949387550354004, + "objective": 0.5949387550354004, + "error": 0.330078125, + "gradient_norm": 0.051291145384311676, + "elapsed": 570.9363489151001 + }, + { + "step": 768, + "loss": 0.4783790409564972, + "objective": 0.4783790409564972, + "error": 0.244140625, + "gradient_norm": 0.08808670938014984, + "elapsed": 581.1555306911469 + }, + { + "step": 784, + "loss": 0.4414710998535156, + "objective": 0.4414710998535156, + "error": 0.20703125, + "gradient_norm": 0.06632383912801743, + "elapsed": 590.4109175205231 + }, + { + "step": 800, + "loss": 0.2536136507987976, + "objective": 0.2536136507987976, + "error": 0.1142578125, + "gradient_norm": 0.03191893920302391, + "elapsed": 601.43274974823 + }, + { + "step": 816, + "loss": 0.22448071837425232, + "objective": 0.22448071837425232, + "error": 0.1015625, + "gradient_norm": 0.04966023191809654, + "elapsed": 612.7252013683319 + }, + { + "step": 832, + "loss": 0.5342355966567993, + "objective": 0.5342355966567993, + "error": 0.2783203125, + "gradient_norm": 0.05757307633757591, + "elapsed": 623.6647284030914 + }, + { + "step": 848, + "loss": 0.2506354749202728, + "objective": 0.2506354749202728, + "error": 0.109375, + "gradient_norm": 0.03991081938147545, + "elapsed": 635.1636409759521 + }, + { + "step": 864, + "loss": 0.40698009729385376, + "objective": 0.40698009729385376, + "error": 0.1953125, + "gradient_norm": 0.09155476838350296, + "elapsed": 645.2128469944 + }, + { + "step": 880, + "loss": 0.563283383846283, + "objective": 0.563283383846283, + "error": 0.3134765625, + "gradient_norm": 0.11409252882003784, + "elapsed": 659.2946681976318 + }, + { + "step": 896, + "loss": 0.13591040670871735, + "objective": 0.13591040670871735, + "error": 0.064453125, + "gradient_norm": 0.02692740224301815, + "elapsed": 668.6167254447937 + }, + { + "step": 912, + "loss": 0.5798318982124329, + "objective": 0.5798318982124329, + "error": 0.3310546875, + "gradient_norm": 0.06674209237098694, + "elapsed": 680.6492185592651 + }, + { + "step": 928, + "loss": 0.6140691041946411, + "objective": 0.6140691041946411, + "error": 0.3857421875, + "gradient_norm": 0.06117575615644455, + "elapsed": 693.1704411506653 + }, + { + "step": 944, + "loss": 0.3964633643627167, + "objective": 0.3964633643627167, + "error": 0.1865234375, + "gradient_norm": 0.08617512136697769, + "elapsed": 708.2128443717957 + }, + { + "step": 960, + "loss": 0.5512299537658691, + "objective": 0.5512299537658691, + "error": 0.2861328125, + "gradient_norm": 0.05705108866095543, + "elapsed": 720.2417063713074 + }, + { + "step": 976, + "loss": 0.454137921333313, + "objective": 0.454137921333313, + "error": 0.216796875, + "gradient_norm": 0.07962293922901154, + "elapsed": 730.2567391395569 + }, + { + "step": 992, + "loss": 0.5681213140487671, + "objective": 0.5681213140487671, + "error": 0.3017578125, + "gradient_norm": 0.09802286326885223, + "elapsed": 742.7380962371826 + }, + { + "step": 1008, + "loss": 0.13060352206230164, + "objective": 0.13060352206230164, + "error": 0.0537109375, + "gradient_norm": 0.04271279275417328, + "elapsed": 750.8077793121338 + }, + { + "step": 1024, + "loss": 0.6129879355430603, + "objective": 0.6129879355430603, + "error": 0.3603515625, + "gradient_norm": 0.04127912223339081, + "elapsed": 761.0585849285126 + }, + { + "step": 1040, + "loss": 0.31361687183380127, + "objective": 0.31361687183380127, + "error": 0.1455078125, + "gradient_norm": 0.04341907799243927, + "elapsed": 776.3491418361664 + }, + { + "step": 1056, + "loss": 0.6326502561569214, + "objective": 0.6326502561569214, + "error": 0.365234375, + "gradient_norm": 0.07518075406551361, + "elapsed": 786.0424168109894 + }, + { + "step": 1072, + "loss": 0.537599503993988, + "objective": 0.537599503993988, + "error": 0.2958984375, + "gradient_norm": 0.08455493301153183, + "elapsed": 795.1607735157013 + }, + { + "step": 1088, + "loss": 0.5953108072280884, + "objective": 0.5953108072280884, + "error": 0.337890625, + "gradient_norm": 0.06973882764577866, + "elapsed": 804.0053510665894 + }, + { + "step": 1104, + "loss": 0.36860400438308716, + "objective": 0.36860400438308716, + "error": 0.1923828125, + "gradient_norm": 0.04828036576509476, + "elapsed": 813.4029138088226 + }, + { + "step": 1120, + "loss": 0.5423247218132019, + "objective": 0.5423247218132019, + "error": 0.28125, + "gradient_norm": 0.04841453209519386, + "elapsed": 823.626978635788 + }, + { + "step": 1136, + "loss": 0.4766136407852173, + "objective": 0.4766136407852173, + "error": 0.236328125, + "gradient_norm": 0.07564551383256912, + "elapsed": 832.4641265869141 + }, + { + "step": 1152, + "loss": 0.5473434925079346, + "objective": 0.5473434925079346, + "error": 0.2958984375, + "gradient_norm": 0.13677075505256653, + "elapsed": 844.9307618141174 + }, + { + "step": 1168, + "loss": 0.3040686249732971, + "objective": 0.3040686249732971, + "error": 0.150390625, + "gradient_norm": 0.045926257967948914, + "elapsed": 854.336992263794 + }, + { + "step": 1184, + "loss": 0.6298375129699707, + "objective": 0.6298375129699707, + "error": 0.3798828125, + "gradient_norm": 0.06807851791381836, + "elapsed": 864.5731596946716 + }, + { + "step": 1200, + "loss": 0.6272540092468262, + "objective": 0.6272540092468262, + "error": 0.37890625, + "gradient_norm": 0.139838308095932, + "elapsed": 877.8357374668121 + }, + { + "step": 1216, + "loss": 0.5224937200546265, + "objective": 0.5224937200546265, + "error": 0.287109375, + "gradient_norm": 0.0647057592868805, + "elapsed": 887.8107197284698 + }, + { + "step": 1232, + "loss": 0.02408422902226448, + "objective": 0.02408422902226448, + "error": 0.0107421875, + "gradient_norm": 0.007562167476862669, + "elapsed": 902.201171875 + }, + { + "step": 1248, + "loss": 0.01936865597963333, + "objective": 0.01936865597963333, + "error": 0.0048828125, + "gradient_norm": 0.006423021201044321, + "elapsed": 914.0247437953949 + }, + { + "step": 1264, + "loss": 0.47522181272506714, + "objective": 0.47522181272506714, + "error": 0.2490234375, + "gradient_norm": 0.04962826892733574, + "elapsed": 927.0462884902954 + }, + { + "step": 1280, + "loss": 0.019577551633119583, + "objective": 0.019577551633119583, + "error": 0.0068359375, + "gradient_norm": 0.008308992721140385, + "elapsed": 939.3647270202637 + }, + { + "step": 1296, + "loss": 0.5085430145263672, + "objective": 0.5085430145263672, + "error": 0.2734375, + "gradient_norm": 0.06214233115315437, + "elapsed": 949.4259700775146 + }, + { + "step": 1312, + "loss": 0.23232896625995636, + "objective": 0.23232896625995636, + "error": 0.1015625, + "gradient_norm": 0.05894213914871216, + "elapsed": 961.3636543750763 + }, + { + "step": 1328, + "loss": 0.5330536365509033, + "objective": 0.5330536365509033, + "error": 0.2861328125, + "gradient_norm": 0.11579663306474686, + "elapsed": 972.1607241630554 + }, + { + "step": 1344, + "loss": 0.019525721669197083, + "objective": 0.019525721669197083, + "error": 0.0087890625, + "gradient_norm": 0.008134250529110432, + "elapsed": 983.0828921794891 + }, + { + "step": 1360, + "loss": 0.22790294885635376, + "objective": 0.22790294885635376, + "error": 0.103515625, + "gradient_norm": 0.04187086224555969, + "elapsed": 991.3167304992676 + }, + { + "step": 1376, + "loss": 0.48713046312332153, + "objective": 0.48713046312332153, + "error": 0.2666015625, + "gradient_norm": 0.06267429888248444, + "elapsed": 1003.5033710002899 + }, + { + "step": 1392, + "loss": 0.6043434143066406, + "objective": 0.6043434143066406, + "error": 0.369140625, + "gradient_norm": 0.037880122661590576, + "elapsed": 1017.8567223548889 + }, + { + "step": 1408, + "loss": 0.034499723464250565, + "objective": 0.034499723464250565, + "error": 0.0068359375, + "gradient_norm": 0.013505477458238602, + "elapsed": 1027.3547134399414 + }, + { + "step": 1424, + "loss": 0.5320160388946533, + "objective": 0.5320160388946533, + "error": 0.306640625, + "gradient_norm": 0.07510018348693848, + "elapsed": 1036.9454221725464 + }, + { + "step": 1440, + "loss": 0.3451523780822754, + "objective": 0.3451523780822754, + "error": 0.171875, + "gradient_norm": 0.06453985720872879, + "elapsed": 1046.1805095672607 + }, + { + "step": 1456, + "loss": 0.21541815996170044, + "objective": 0.21541815996170044, + "error": 0.08984375, + "gradient_norm": 0.043503839522600174, + "elapsed": 1055.850379705429 + }, + { + "step": 1472, + "loss": 0.43667086958885193, + "objective": 0.43667086958885193, + "error": 0.22265625, + "gradient_norm": 0.07311506569385529, + "elapsed": 1066.6324400901794 + }, + { + "step": 1488, + "loss": 0.6163139939308167, + "objective": 0.6163139939308167, + "error": 0.3779296875, + "gradient_norm": 0.06406569480895996, + "elapsed": 1075.7883398532867 + }, + { + "step": 1504, + "loss": 0.23901250958442688, + "objective": 0.23901250958442688, + "error": 0.10546875, + "gradient_norm": 0.04792191833257675, + "elapsed": 1085.4756922721863 + }, + { + "step": 1520, + "loss": 0.3817014694213867, + "objective": 0.3817014694213867, + "error": 0.18359375, + "gradient_norm": 0.046061187982559204, + "elapsed": 1095.974383354187 + }, + { + "step": 1536, + "loss": 0.5593156814575195, + "objective": 0.5593156814575195, + "error": 0.3017578125, + "gradient_norm": 0.0735388696193695, + "elapsed": 1105.913155078888 + } + ] + }, + "training_source_snapshot": "training_sources/fresh2_full", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2325420673076923, + "0": 0.23359374999999996, + "blend-0": 0.23372896634615387, + "512": 0.23342848557692306, + "blend-512": 0.23329326923076926, + "1024": 0.23315805288461536, + "blend-1024": 0.23309795673076922, + "1536": 0.2326923076923077, + "blend-1536": 0.23278245192307695 + }, + "selected": "incumbent" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22017728365384615, + "0": 0.22125901442307688, + "blend-0": 0.22125901442307694, + "512": 0.22080829326923082, + "blend-512": 0.2211838942307692, + "1024": 0.22052283653846153, + "blend-1024": 0.22031249999999997, + "1536": 0.21953124999999998, + "blend-1536": 0.21998197115384616 + }, + "selected": "1536" + } + ], + "checkpoints": { + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 491030, + "weights_sha256": "20746e71c276e720074318b0978e6ea0ddc0df206954834f13c7f36354933cea", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit unused intermediate logical tracking; raw neural branches also omit the unused final physical readout.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false, + "numerical_controls": { + "packaged_runtime_control_cpu": { + "device": "cpu", + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 7, + "same_cpu_old_vs_new_maximum_difference": 0.0, + "old_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "new_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "cpu_vs_reconstructed_old_gpu_runtime_maximum_difference": 4.976987838745117e-05, + "original_gpu_evaluation_vs_reconstructed_gpu_runtime_maximum_difference": 7.748603820800781e-07, + "initial_failed_control": { + "comparison": "CPU runtime against original GPU evaluator", + "observed_maximum_difference": 4.971027374267578e-05, + "original_tolerance": 3e-06 + }, + "sources": { + "d5_base_context_model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "d5_context_model.py": "d58bcfe01767228d18ce2078d555abf13037b5df63edf38273ba66f0966ee445", + "d5_contextual.py": "59d6c85dc4bd61e26cf7243baf0e2637c3de1d35327b2c763707badd19446550", + "turbo.py": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b" + }, + "scope": "Same-device compatibility check. Reconstructed GPU runtime removes the recorded equal physical blend; that reconstruction has floating-point rounding uncertainty.", + "status": "passed_same_device_compatibility" + }, + "cpu_probability_precision": { + "condition": "surface_code_bX_d5_r03_center_5_5", + "validation_syndromes": 7, + "logical_labels_used": false, + "parameter_updates": 0, + "reference": "Float64 neural forward and exact contraction from the same stored weights and fixed float32 input logits, on CPU", + "cpu_float32_vs_float64_maximum_difference": 7.624897924163321e-08, + "cpu_float32_edges_float64_contraction_vs_float64_maximum_difference": 4.725248914372315e-08, + "gpu_float32_vs_float64_maximum_difference": 4.964999121059854e-05, + "cpu_vs_gpu_float32_maximum_difference": 4.971027374267578e-05, + "maximum_neural_edge_probability_difference": 2.6330936014895556e-08, + "float32_edge_values_above_one_minus_1e6": 0, + "scope": "Precision diagnostic only; the published model is unchanged. Same-device old/new packaged-code compatibility was independently exact." + }, + "priors_only_control_cpu": { + "status": "passed", + "device": "cpu", + "source_sha256": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b", + "records": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 2.7116777896881104, + "priors_only_seconds_warm": 0.13569164276123047 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 3.557781457901001, + "priors_only_seconds_warm": 1.7711329460144043 + } + ], + "scope": "CPU numerical equivalence on supplied training syndromes; timings are not a controlled speed comparison." + } + } + }, + { + "training": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261271", + "prior_pass": 3, + "initial_seed": 20261271, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 466919, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18000, + "surface_code_bX_d5_r03_center_5_5": 18251, + "surface_code_bX_d5_r05_center_5_5": 18224, + "surface_code_bX_d5_r07_center_5_5": 17881, + "surface_code_bX_d5_r09_center_5_5": 18247, + "surface_code_bX_d5_r11_center_5_5": 17452, + "surface_code_bX_d5_r13_center_5_5": 17982, + "surface_code_bX_d5_r15_center_5_5": 17498, + "surface_code_bX_d5_r17_center_5_5": 18487, + "surface_code_bX_d5_r19_center_5_5": 18100, + "surface_code_bX_d5_r21_center_5_5": 17622, + "surface_code_bX_d5_r23_center_5_5": 17449, + "surface_code_bX_d5_r25_center_5_5": 17739, + "surface_code_bZ_d5_r01_center_5_5": 16689, + "surface_code_bZ_d5_r03_center_5_5": 18119, + "surface_code_bZ_d5_r05_center_5_5": 18146, + "surface_code_bZ_d5_r07_center_5_5": 18185, + "surface_code_bZ_d5_r09_center_5_5": 18473, + "surface_code_bZ_d5_r11_center_5_5": 18636, + "surface_code_bZ_d5_r13_center_5_5": 18474, + "surface_code_bZ_d5_r15_center_5_5": 17779, + "surface_code_bZ_d5_r17_center_5_5": 18474, + "surface_code_bZ_d5_r19_center_5_5": 17306, + "surface_code_bZ_d5_r21_center_5_5": 17165, + "surface_code_bZ_d5_r23_center_5_5": 18616, + "surface_code_bZ_d5_r25_center_5_5": 17925 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1536, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261272, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "/run-state/workspace/research/learned_d5/reserved1_warm/rng-512.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/reserved1_warm/weights-512.npz", + "starting_checkpoint_sha256": "1adc47acc35148d4260df25e25384124609d2b1e098ffcf30a1eccea55ef8712", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261271", + "prior_pass": 3, + "initial_seed": 20261271, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 317613, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 14297, + "surface_code_bX_d5_r03_center_5_5": 11305, + "surface_code_bX_d5_r05_center_5_5": 12479, + "surface_code_bX_d5_r07_center_5_5": 10433, + "surface_code_bX_d5_r09_center_5_5": 10919, + "surface_code_bX_d5_r11_center_5_5": 12516, + "surface_code_bX_d5_r13_center_5_5": 12043, + "surface_code_bX_d5_r15_center_5_5": 12143, + "surface_code_bX_d5_r17_center_5_5": 11354, + "surface_code_bX_d5_r19_center_5_5": 13660, + "surface_code_bX_d5_r21_center_5_5": 13753, + "surface_code_bX_d5_r23_center_5_5": 12161, + "surface_code_bX_d5_r25_center_5_5": 12531, + "surface_code_bZ_d5_r01_center_5_5": 11397, + "surface_code_bZ_d5_r03_center_5_5": 9053, + "surface_code_bZ_d5_r05_center_5_5": 13723, + "surface_code_bZ_d5_r07_center_5_5": 14763, + "surface_code_bZ_d5_r09_center_5_5": 10969, + "surface_code_bZ_d5_r11_center_5_5": 12129, + "surface_code_bZ_d5_r13_center_5_5": 10020, + "surface_code_bZ_d5_r15_center_5_5": 13170, + "surface_code_bZ_d5_r17_center_5_5": 14946, + "surface_code_bZ_d5_r19_center_5_5": 10579, + "surface_code_bZ_d5_r21_center_5_5": 11745, + "surface_code_bZ_d5_r23_center_5_5": 12426, + "surface_code_bZ_d5_r25_center_5_5": 13099 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 512, + "batch": 1024, + "learning_rate": 0.001, + "sampling_seed": 20261272, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "rng_restored": false, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "Fresh NumPy default_rng seed 20261272", + "starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "starting_training_provenance": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.1412775069475174, + "objective": 0.1412775069475174, + "error": 0.0595703125, + "gradient_norm": 0.030735325068235397, + "elapsed": 28.457472801208496 + }, + { + "step": 16, + "loss": 0.6315727233886719, + "objective": 0.6315727233886719, + "error": 0.384765625, + "gradient_norm": 0.06563512235879898, + "elapsed": 47.886730670928955 + }, + { + "step": 32, + "loss": 0.5130410194396973, + "objective": 0.5130410194396973, + "error": 0.263671875, + "gradient_norm": 0.10626910626888275, + "elapsed": 60.16136598587036 + }, + { + "step": 48, + "loss": 0.6413166522979736, + "objective": 0.6413166522979736, + "error": 0.408203125, + "gradient_norm": 0.03790846839547157, + "elapsed": 70.9611382484436 + }, + { + "step": 64, + "loss": 0.5491592884063721, + "objective": 0.5491592884063721, + "error": 0.2939453125, + "gradient_norm": 0.093081034719944, + "elapsed": 81.46673464775085 + }, + { + "step": 80, + "loss": 0.6315242648124695, + "objective": 0.6315242648124695, + "error": 0.359375, + "gradient_norm": 0.0384257510304451, + "elapsed": 91.71172666549683 + }, + { + "step": 96, + "loss": 0.6311566829681396, + "objective": 0.6311566829681396, + "error": 0.3798828125, + "gradient_norm": 0.03731638938188553, + "elapsed": 100.83252763748169 + }, + { + "step": 112, + "loss": 0.5327925682067871, + "objective": 0.5327925682067871, + "error": 0.29296875, + "gradient_norm": 0.11202990263700485, + "elapsed": 111.35073852539062 + }, + { + "step": 128, + "loss": 0.6284654140472412, + "objective": 0.6284654140472412, + "error": 0.3740234375, + "gradient_norm": 0.03215613588690758, + "elapsed": 121.32994651794434 + }, + { + "step": 144, + "loss": 0.33964547514915466, + "objective": 0.33964547514915466, + "error": 0.1259765625, + "gradient_norm": 0.05133189633488655, + "elapsed": 131.2744882106781 + }, + { + "step": 160, + "loss": 0.14193454384803772, + "objective": 0.14193454384803772, + "error": 0.0478515625, + "gradient_norm": 0.03264402225613594, + "elapsed": 139.58473920822144 + }, + { + "step": 176, + "loss": 0.14203950762748718, + "objective": 0.14203950762748718, + "error": 0.0654296875, + "gradient_norm": 0.022548990324139595, + "elapsed": 148.9861602783203 + }, + { + "step": 192, + "loss": 0.6307225227355957, + "objective": 0.6307225227355957, + "error": 0.3955078125, + "gradient_norm": 0.08607082068920135, + "elapsed": 162.27514505386353 + }, + { + "step": 208, + "loss": 0.16193106770515442, + "objective": 0.16193106770515442, + "error": 0.064453125, + "gradient_norm": 0.023293493315577507, + "elapsed": 173.59824013710022 + }, + { + "step": 224, + "loss": 0.5426318049430847, + "objective": 0.5426318049430847, + "error": 0.3037109375, + "gradient_norm": 0.03944721072912216, + "elapsed": 182.70232272148132 + }, + { + "step": 240, + "loss": 0.6270365715026855, + "objective": 0.6270365715026855, + "error": 0.3896484375, + "gradient_norm": 0.14661568403244019, + "elapsed": 193.759183883667 + }, + { + "step": 256, + "loss": 0.4933152198791504, + "objective": 0.4933152198791504, + "error": 0.2724609375, + "gradient_norm": 0.1065438985824585, + "elapsed": 205.62959718704224 + }, + { + "step": 272, + "loss": 0.3671969473361969, + "objective": 0.3671969473361969, + "error": 0.177734375, + "gradient_norm": 0.05156548321247101, + "elapsed": 222.249596118927 + }, + { + "step": 288, + "loss": 0.5478869676589966, + "objective": 0.5478869676589966, + "error": 0.3203125, + "gradient_norm": 0.08357688039541245, + "elapsed": 232.2198715209961 + }, + { + "step": 304, + "loss": 0.21171918511390686, + "objective": 0.21171918511390686, + "error": 0.0849609375, + "gradient_norm": 0.06231697276234627, + "elapsed": 241.07631373405457 + }, + { + "step": 320, + "loss": 0.5333335995674133, + "objective": 0.5333335995674133, + "error": 0.2861328125, + "gradient_norm": 0.08931853622198105, + "elapsed": 251.28962755203247 + }, + { + "step": 336, + "loss": 0.12485946714878082, + "objective": 0.12485946714878082, + "error": 0.046875, + "gradient_norm": 0.018839582800865173, + "elapsed": 262.3605041503906 + }, + { + "step": 352, + "loss": 0.2334863245487213, + "objective": 0.2334863245487213, + "error": 0.09765625, + "gradient_norm": 0.03669576346874237, + "elapsed": 273.16373229026794 + }, + { + "step": 368, + "loss": 0.5818328857421875, + "objective": 0.5818328857421875, + "error": 0.3232421875, + "gradient_norm": 0.09833699464797974, + "elapsed": 282.8677294254303 + }, + { + "step": 384, + "loss": 0.6228232383728027, + "objective": 0.6228232383728027, + "error": 0.3671875, + "gradient_norm": 0.033418990671634674, + "elapsed": 295.04902839660645 + }, + { + "step": 400, + "loss": 0.5749450922012329, + "objective": 0.5749450922012329, + "error": 0.333984375, + "gradient_norm": 0.04644288495182991, + "elapsed": 306.67032837867737 + }, + { + "step": 416, + "loss": 0.46251457929611206, + "objective": 0.46251457929611206, + "error": 0.2216796875, + "gradient_norm": 0.06633804738521576, + "elapsed": 317.759464263916 + }, + { + "step": 432, + "loss": 0.5577508211135864, + "objective": 0.5577508211135864, + "error": 0.30859375, + "gradient_norm": 0.0970199704170227, + "elapsed": 327.4626543521881 + }, + { + "step": 448, + "loss": 0.11625733226537704, + "objective": 0.11625733226537704, + "error": 0.0419921875, + "gradient_norm": 0.020417485386133194, + "elapsed": 336.3522970676422 + }, + { + "step": 464, + "loss": 0.23657961189746857, + "objective": 0.23657961189746857, + "error": 0.1025390625, + "gradient_norm": 0.03908605873584747, + "elapsed": 344.3832321166992 + }, + { + "step": 480, + "loss": 0.011504358612000942, + "objective": 0.011504358612000942, + "error": 0.00390625, + "gradient_norm": 0.006708688102662563, + "elapsed": 355.18855381011963 + }, + { + "step": 496, + "loss": 0.3410624563694, + "objective": 0.3410624563694, + "error": 0.1533203125, + "gradient_norm": 0.05804387852549553, + "elapsed": 366.2978138923645 + }, + { + "step": 512, + "loss": 0.034005306661129, + "objective": 0.034005306661129, + "error": 0.0107421875, + "gradient_norm": 0.01019973959773779, + "elapsed": 375.73491764068604 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved1_warm", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "b31e8f5ee2b5ea1b661e6bf8b5649bec45b7ab5da74fe9de46e4d06846356b87", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 256, + 512 + ], + "training_draws": 524288, + "distinct_phase_training_rows": 317613, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 14297, + "surface_code_bX_d5_r03_center_5_5": 11305, + "surface_code_bX_d5_r05_center_5_5": 12479, + "surface_code_bX_d5_r07_center_5_5": 10433, + "surface_code_bX_d5_r09_center_5_5": 10919, + "surface_code_bX_d5_r11_center_5_5": 12516, + "surface_code_bX_d5_r13_center_5_5": 12043, + "surface_code_bX_d5_r15_center_5_5": 12143, + "surface_code_bX_d5_r17_center_5_5": 11354, + "surface_code_bX_d5_r19_center_5_5": 13660, + "surface_code_bX_d5_r21_center_5_5": 13753, + "surface_code_bX_d5_r23_center_5_5": 12161, + "surface_code_bX_d5_r25_center_5_5": 12531, + "surface_code_bZ_d5_r01_center_5_5": 11397, + "surface_code_bZ_d5_r03_center_5_5": 9053, + "surface_code_bZ_d5_r05_center_5_5": 13723, + "surface_code_bZ_d5_r07_center_5_5": 14763, + "surface_code_bZ_d5_r09_center_5_5": 10969, + "surface_code_bZ_d5_r11_center_5_5": 12129, + "surface_code_bZ_d5_r13_center_5_5": 10020, + "surface_code_bZ_d5_r15_center_5_5": 13170, + "surface_code_bZ_d5_r17_center_5_5": 14946, + "surface_code_bZ_d5_r19_center_5_5": 10579, + "surface_code_bZ_d5_r21_center_5_5": 11745, + "surface_code_bZ_d5_r23_center_5_5": 12426, + "surface_code_bZ_d5_r25_center_5_5": 13099 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 512, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.5523660182952881, + "objective": 0.5523660182952881, + "error": 0.30859375, + "gradient_norm": 0.05200070142745972, + "elapsed": 30.08410096168518 + }, + { + "step": 16, + "loss": 0.5380295515060425, + "objective": 0.5380295515060425, + "error": 0.306640625, + "gradient_norm": 0.0804876759648323, + "elapsed": 50.77648210525513 + }, + { + "step": 32, + "loss": 0.6359301805496216, + "objective": 0.6359301805496216, + "error": 0.3837890625, + "gradient_norm": 0.059380218386650085, + "elapsed": 59.453776836395264 + }, + { + "step": 48, + "loss": 0.2540435492992401, + "objective": 0.2540435492992401, + "error": 0.1083984375, + "gradient_norm": 0.04367281496524811, + "elapsed": 67.29314041137695 + }, + { + "step": 64, + "loss": 0.5867692232131958, + "objective": 0.5867692232131958, + "error": 0.3447265625, + "gradient_norm": 0.053885214030742645, + "elapsed": 78.74847197532654 + }, + { + "step": 80, + "loss": 0.6015321016311646, + "objective": 0.6015321016311646, + "error": 0.365234375, + "gradient_norm": 0.04807985574007034, + "elapsed": 90.48145818710327 + }, + { + "step": 96, + "loss": 0.49287766218185425, + "objective": 0.49287766218185425, + "error": 0.271484375, + "gradient_norm": 0.07899080961942673, + "elapsed": 101.65468978881836 + }, + { + "step": 112, + "loss": 0.3271353542804718, + "objective": 0.3271353542804718, + "error": 0.15234375, + "gradient_norm": 0.049542222172021866, + "elapsed": 111.14713263511658 + }, + { + "step": 128, + "loss": 0.50013667345047, + "objective": 0.50013667345047, + "error": 0.271484375, + "gradient_norm": 0.06454745680093765, + "elapsed": 121.21207547187805 + }, + { + "step": 144, + "loss": 0.028576843440532684, + "objective": 0.028576843440532684, + "error": 0.0087890625, + "gradient_norm": 0.010781333781778812, + "elapsed": 130.69302248954773 + }, + { + "step": 160, + "loss": 0.5668779015541077, + "objective": 0.5668779015541077, + "error": 0.330078125, + "gradient_norm": 0.06098390743136406, + "elapsed": 142.14290237426758 + }, + { + "step": 176, + "loss": 0.3986494839191437, + "objective": 0.3986494839191437, + "error": 0.1884765625, + "gradient_norm": 0.042795032262802124, + "elapsed": 152.75753688812256 + }, + { + "step": 192, + "loss": 0.31897079944610596, + "objective": 0.31897079944610596, + "error": 0.142578125, + "gradient_norm": 0.040675707161426544, + "elapsed": 160.04981398582458 + }, + { + "step": 208, + "loss": 0.5092275142669678, + "objective": 0.5092275142669678, + "error": 0.255859375, + "gradient_norm": 0.07929783314466476, + "elapsed": 169.85345673561096 + }, + { + "step": 224, + "loss": 0.35782667994499207, + "objective": 0.35782667994499207, + "error": 0.1748046875, + "gradient_norm": 0.05785144120454788, + "elapsed": 179.90323066711426 + }, + { + "step": 240, + "loss": 0.5660895109176636, + "objective": 0.5660895109176636, + "error": 0.3349609375, + "gradient_norm": 0.10684454441070557, + "elapsed": 191.3668942451477 + }, + { + "step": 256, + "loss": 0.6265910863876343, + "objective": 0.6265910863876343, + "error": 0.3779296875, + "gradient_norm": 0.034383758902549744, + "elapsed": 200.3055775165558 + }, + { + "step": 272, + "loss": 0.6210677623748779, + "objective": 0.6210677623748779, + "error": 0.369140625, + "gradient_norm": 0.04434216767549515, + "elapsed": 210.09376430511475 + }, + { + "step": 288, + "loss": 0.4892377257347107, + "objective": 0.4892377257347107, + "error": 0.2490234375, + "gradient_norm": 0.1040654331445694, + "elapsed": 220.45881819725037 + }, + { + "step": 304, + "loss": 0.6407739520072937, + "objective": 0.6407739520072937, + "error": 0.3916015625, + "gradient_norm": 0.07782924920320511, + "elapsed": 233.3719048500061 + }, + { + "step": 320, + "loss": 0.4752756953239441, + "objective": 0.4752756953239441, + "error": 0.263671875, + "gradient_norm": 0.051829319447278976, + "elapsed": 244.25844407081604 + }, + { + "step": 336, + "loss": 0.6482080221176147, + "objective": 0.6482080221176147, + "error": 0.41015625, + "gradient_norm": 0.04979892820119858, + "elapsed": 253.1897099018097 + }, + { + "step": 352, + "loss": 0.34022292494773865, + "objective": 0.34022292494773865, + "error": 0.1708984375, + "gradient_norm": 0.09951864182949066, + "elapsed": 264.0781395435333 + }, + { + "step": 368, + "loss": 0.3494992256164551, + "objective": 0.3494992256164551, + "error": 0.15625, + "gradient_norm": 0.10392706841230392, + "elapsed": 275.8111581802368 + }, + { + "step": 384, + "loss": 0.47191378474235535, + "objective": 0.47191378474235535, + "error": 0.25, + "gradient_norm": 0.07366786152124405, + "elapsed": 283.9459602832794 + }, + { + "step": 400, + "loss": 0.583655595779419, + "objective": 0.583655595779419, + "error": 0.3623046875, + "gradient_norm": 0.10394527018070221, + "elapsed": 294.3349726200104 + }, + { + "step": 416, + "loss": 0.6212975978851318, + "objective": 0.6212975978851318, + "error": 0.37109375, + "gradient_norm": 0.054796766489744186, + "elapsed": 304.7477548122406 + }, + { + "step": 432, + "loss": 0.4719577431678772, + "objective": 0.4719577431678772, + "error": 0.2431640625, + "gradient_norm": 0.05418012663722038, + "elapsed": 315.91914200782776 + }, + { + "step": 448, + "loss": 0.5696494579315186, + "objective": 0.5696494579315186, + "error": 0.3330078125, + "gradient_norm": 0.047046076506376266, + "elapsed": 324.96326184272766 + }, + { + "step": 464, + "loss": 0.613875687122345, + "objective": 0.613875687122345, + "error": 0.34765625, + "gradient_norm": 0.05237002298235893, + "elapsed": 334.7670781612396 + }, + { + "step": 480, + "loss": 0.28741705417633057, + "objective": 0.28741705417633057, + "error": 0.1240234375, + "gradient_norm": 0.05365394428372383, + "elapsed": 344.03080439567566 + }, + { + "step": 496, + "loss": 0.3729455769062042, + "objective": 0.3729455769062042, + "error": 0.1875, + "gradient_norm": 0.05905403569340706, + "elapsed": 356.01581716537476 + }, + { + "step": 512, + "loss": 0.38685142993927, + "objective": 0.38685142993927, + "error": 0.17578125, + "gradient_norm": 0.048455506563186646, + "elapsed": 367.7296392917633 + }, + { + "step": 528, + "loss": 0.6062720417976379, + "objective": 0.6062720417976379, + "error": 0.369140625, + "gradient_norm": 0.07544548809528351, + "elapsed": 385.4480962753296 + }, + { + "step": 544, + "loss": 0.520085871219635, + "objective": 0.520085871219635, + "error": 0.279296875, + "gradient_norm": 0.08394371718168259, + "elapsed": 397.71993708610535 + }, + { + "step": 560, + "loss": 0.5944540500640869, + "objective": 0.5944540500640869, + "error": 0.3544921875, + "gradient_norm": 0.05468091368675232, + "elapsed": 406.9417428970337 + }, + { + "step": 576, + "loss": 0.34102559089660645, + "objective": 0.34102559089660645, + "error": 0.1611328125, + "gradient_norm": 0.07333917915821075, + "elapsed": 417.0068130493164 + }, + { + "step": 592, + "loss": 0.47373664379119873, + "objective": 0.47373664379119873, + "error": 0.2412109375, + "gradient_norm": 0.05662858858704567, + "elapsed": 425.1176447868347 + }, + { + "step": 608, + "loss": 0.48517894744873047, + "objective": 0.48517894744873047, + "error": 0.25, + "gradient_norm": 0.08127480745315552, + "elapsed": 434.92080903053284 + }, + { + "step": 624, + "loss": 0.39865612983703613, + "objective": 0.39865612983703613, + "error": 0.1904296875, + "gradient_norm": 0.07332058995962143, + "elapsed": 446.6602101325989 + }, + { + "step": 640, + "loss": 0.41867297887802124, + "objective": 0.41867297887802124, + "error": 0.2177734375, + "gradient_norm": 0.07386308163404465, + "elapsed": 457.0243580341339 + }, + { + "step": 656, + "loss": 0.5108687877655029, + "objective": 0.5108687877655029, + "error": 0.2822265625, + "gradient_norm": 0.052080318331718445, + "elapsed": 469.5842761993408 + }, + { + "step": 672, + "loss": 0.5043742656707764, + "objective": 0.5043742656707764, + "error": 0.2734375, + "gradient_norm": 0.047204963862895966, + "elapsed": 479.356397151947 + }, + { + "step": 688, + "loss": 0.5550935864448547, + "objective": 0.5550935864448547, + "error": 0.30078125, + "gradient_norm": 0.04080262407660484, + "elapsed": 489.9912152290344 + }, + { + "step": 704, + "loss": 0.5698974132537842, + "objective": 0.5698974132537842, + "error": 0.322265625, + "gradient_norm": 0.10692963004112244, + "elapsed": 500.3283371925354 + }, + { + "step": 720, + "loss": 0.45870622992515564, + "objective": 0.45870622992515564, + "error": 0.2255859375, + "gradient_norm": 0.06705734878778458, + "elapsed": 509.82279753685 + }, + { + "step": 736, + "loss": 0.555386483669281, + "objective": 0.555386483669281, + "error": 0.31640625, + "gradient_norm": 0.05112688988447189, + "elapsed": 518.507036447525 + }, + { + "step": 752, + "loss": 0.14282986521720886, + "objective": 0.14282986521720886, + "error": 0.056640625, + "gradient_norm": 0.03209136053919792, + "elapsed": 529.1373023986816 + }, + { + "step": 768, + "loss": 0.5362129807472229, + "objective": 0.5362129807472229, + "error": 0.2841796875, + "gradient_norm": 0.049996186047792435, + "elapsed": 538.9186007976532 + }, + { + "step": 784, + "loss": 0.5071826577186584, + "objective": 0.5071826577186584, + "error": 0.2744140625, + "gradient_norm": 0.04826078191399574, + "elapsed": 549.5225830078125 + }, + { + "step": 800, + "loss": 0.24775367975234985, + "objective": 0.24775367975234985, + "error": 0.107421875, + "gradient_norm": 0.06889795511960983, + "elapsed": 560.7170543670654 + }, + { + "step": 816, + "loss": 0.17432856559753418, + "objective": 0.17432856559753418, + "error": 0.06640625, + "gradient_norm": 0.05147368833422661, + "elapsed": 570.7887880802155 + }, + { + "step": 832, + "loss": 0.5410823822021484, + "objective": 0.5410823822021484, + "error": 0.3115234375, + "gradient_norm": 0.11862928420305252, + "elapsed": 581.9721121788025 + }, + { + "step": 848, + "loss": 0.5555508732795715, + "objective": 0.5555508732795715, + "error": 0.296875, + "gradient_norm": 0.060369592159986496, + "elapsed": 592.2823219299316 + }, + { + "step": 864, + "loss": 0.31839215755462646, + "objective": 0.31839215755462646, + "error": 0.1552734375, + "gradient_norm": 0.063877172768116, + "elapsed": 603.1910541057587 + }, + { + "step": 880, + "loss": 0.481766939163208, + "objective": 0.481766939163208, + "error": 0.2470703125, + "gradient_norm": 0.1623816341161728, + "elapsed": 614.4277107715607 + }, + { + "step": 896, + "loss": 0.5780366659164429, + "objective": 0.5780366659164429, + "error": 0.3037109375, + "gradient_norm": 0.06694691628217697, + "elapsed": 623.9365792274475 + }, + { + "step": 912, + "loss": 0.4794909358024597, + "objective": 0.4794909358024597, + "error": 0.2314453125, + "gradient_norm": 0.07813122123479843, + "elapsed": 633.9845306873322 + }, + { + "step": 928, + "loss": 0.6279138922691345, + "objective": 0.6279138922691345, + "error": 0.380859375, + "gradient_norm": 0.047679927200078964, + "elapsed": 643.7766675949097 + }, + { + "step": 944, + "loss": 0.6401606798171997, + "objective": 0.6401606798171997, + "error": 0.3994140625, + "gradient_norm": 0.07329051941633224, + "elapsed": 655.2369928359985 + }, + { + "step": 960, + "loss": 0.4340277910232544, + "objective": 0.4340277910232544, + "error": 0.2158203125, + "gradient_norm": 0.11762503534555435, + "elapsed": 666.9884371757507 + }, + { + "step": 976, + "loss": 0.44496864080429077, + "objective": 0.44496864080429077, + "error": 0.2236328125, + "gradient_norm": 0.05260347202420235, + "elapsed": 677.3464586734772 + }, + { + "step": 992, + "loss": 0.13230293989181519, + "objective": 0.13230293989181519, + "error": 0.05078125, + "gradient_norm": 0.030240925028920174, + "elapsed": 685.7275724411011 + }, + { + "step": 1008, + "loss": 0.2971688508987427, + "objective": 0.2971688508987427, + "error": 0.1171875, + "gradient_norm": 0.05503479763865471, + "elapsed": 694.1270356178284 + }, + { + "step": 1024, + "loss": 0.5688735246658325, + "objective": 0.5688735246658325, + "error": 0.314453125, + "gradient_norm": 0.06526188552379608, + "elapsed": 703.9192817211151 + }, + { + "step": 1040, + "loss": 0.42805811762809753, + "objective": 0.42805811762809753, + "error": 0.2080078125, + "gradient_norm": 0.13000032305717468, + "elapsed": 720.145961523056 + }, + { + "step": 1056, + "loss": 0.5543602705001831, + "objective": 0.5543602705001831, + "error": 0.298828125, + "gradient_norm": 0.15922385454177856, + "elapsed": 733.5112845897675 + }, + { + "step": 1072, + "loss": 0.031130114570260048, + "objective": 0.031130114570260048, + "error": 0.013671875, + "gradient_norm": 0.008926023729145527, + "elapsed": 742.4467866420746 + }, + { + "step": 1088, + "loss": 0.14947748184204102, + "objective": 0.14947748184204102, + "error": 0.056640625, + "gradient_norm": 0.03975249081850052, + "elapsed": 751.8575854301453 + }, + { + "step": 1104, + "loss": 0.6275734901428223, + "objective": 0.6275734901428223, + "error": 0.3671875, + "gradient_norm": 0.08096148073673248, + "elapsed": 761.5625903606415 + }, + { + "step": 1120, + "loss": 0.23923414945602417, + "objective": 0.23923414945602417, + "error": 0.0966796875, + "gradient_norm": 0.03325376287102699, + "elapsed": 773.9633615016937 + }, + { + "step": 1136, + "loss": 0.570243239402771, + "objective": 0.570243239402771, + "error": 0.31640625, + "gradient_norm": 0.07534287869930267, + "elapsed": 783.1533136367798 + }, + { + "step": 1152, + "loss": 0.4264270067214966, + "objective": 0.4264270067214966, + "error": 0.2119140625, + "gradient_norm": 0.08900073170661926, + "elapsed": 792.1710996627808 + }, + { + "step": 1168, + "loss": 0.5958121418952942, + "objective": 0.5958121418952942, + "error": 0.3583984375, + "gradient_norm": 0.08239343762397766, + "elapsed": 803.1175289154053 + }, + { + "step": 1184, + "loss": 0.2909137010574341, + "objective": 0.2909137010574341, + "error": 0.1416015625, + "gradient_norm": 0.05281354859471321, + "elapsed": 812.6055159568787 + }, + { + "step": 1200, + "loss": 0.6119058728218079, + "objective": 0.6119058728218079, + "error": 0.36328125, + "gradient_norm": 0.056254416704177856, + "elapsed": 823.2276427745819 + }, + { + "step": 1216, + "loss": 0.13595536351203918, + "objective": 0.13595536351203918, + "error": 0.0556640625, + "gradient_norm": 0.04057573154568672, + "elapsed": 834.1696293354034 + }, + { + "step": 1232, + "loss": 0.5840731263160706, + "objective": 0.5840731263160706, + "error": 0.328125, + "gradient_norm": 0.054566267877817154, + "elapsed": 845.3501887321472 + }, + { + "step": 1248, + "loss": 0.3053072690963745, + "objective": 0.3053072690963745, + "error": 0.1337890625, + "gradient_norm": 0.04617297649383545, + "elapsed": 854.9564871788025 + }, + { + "step": 1264, + "loss": 0.6288673281669617, + "objective": 0.6288673281669617, + "error": 0.3994140625, + "gradient_norm": 0.08229745179414749, + "elapsed": 864.8914043903351 + }, + { + "step": 1280, + "loss": 0.5586361289024353, + "objective": 0.5586361289024353, + "error": 0.2958984375, + "gradient_norm": 0.05713959410786629, + "elapsed": 877.0349607467651 + }, + { + "step": 1296, + "loss": 0.3648858666419983, + "objective": 0.3648858666419983, + "error": 0.16796875, + "gradient_norm": 0.08502963185310364, + "elapsed": 888.5764675140381 + }, + { + "step": 1312, + "loss": 0.4747084081172943, + "objective": 0.4747084081172943, + "error": 0.244140625, + "gradient_norm": 0.08609883487224579, + "elapsed": 899.7598609924316 + }, + { + "step": 1328, + "loss": 0.15583917498588562, + "objective": 0.15583917498588562, + "error": 0.05859375, + "gradient_norm": 0.027793049812316895, + "elapsed": 909.47514295578 + }, + { + "step": 1344, + "loss": 0.47515708208084106, + "objective": 0.47515708208084106, + "error": 0.263671875, + "gradient_norm": 0.07668807357549667, + "elapsed": 919.7640328407288 + }, + { + "step": 1360, + "loss": 0.5173689126968384, + "objective": 0.5173689126968384, + "error": 0.2744140625, + "gradient_norm": 0.05054212734103203, + "elapsed": 930.6309463977814 + }, + { + "step": 1376, + "loss": 0.46629998087882996, + "objective": 0.46629998087882996, + "error": 0.24609375, + "gradient_norm": 0.051172077655792236, + "elapsed": 939.0202586650848 + }, + { + "step": 1392, + "loss": 0.11312969774007797, + "objective": 0.11312969774007797, + "error": 0.044921875, + "gradient_norm": 0.05863805115222931, + "elapsed": 949.1451416015625 + }, + { + "step": 1408, + "loss": 0.5750841498374939, + "objective": 0.5750841498374939, + "error": 0.322265625, + "gradient_norm": 0.051106806844472885, + "elapsed": 959.94162940979 + }, + { + "step": 1424, + "loss": 0.5937192440032959, + "objective": 0.5937192440032959, + "error": 0.3408203125, + "gradient_norm": 0.05014815554022789, + "elapsed": 969.5868306159973 + }, + { + "step": 1440, + "loss": 0.5292985439300537, + "objective": 0.5292985439300537, + "error": 0.2958984375, + "gradient_norm": 0.057068243622779846, + "elapsed": 982.6692054271698 + }, + { + "step": 1456, + "loss": 0.5959951877593994, + "objective": 0.5959951877593994, + "error": 0.3408203125, + "gradient_norm": 0.0703694075345993, + "elapsed": 995.0066986083984 + }, + { + "step": 1472, + "loss": 0.018453411757946014, + "objective": 0.018453411757946014, + "error": 0.00390625, + "gradient_norm": 0.012016087770462036, + "elapsed": 1004.0057821273804 + }, + { + "step": 1488, + "loss": 0.5711684823036194, + "objective": 0.5711684823036194, + "error": 0.3095703125, + "gradient_norm": 0.07746906578540802, + "elapsed": 1016.1701967716217 + }, + { + "step": 1504, + "loss": 0.3114882707595825, + "objective": 0.3114882707595825, + "error": 0.1455078125, + "gradient_norm": 0.05321609228849411, + "elapsed": 1026.6053586006165 + }, + { + "step": 1520, + "loss": 0.6433392763137817, + "objective": 0.6433392763137817, + "error": 0.4072265625, + "gradient_norm": 0.05683734640479088, + "elapsed": 1036.1535296440125 + }, + { + "step": 1536, + "loss": 0.38409170508384705, + "objective": 0.38409170508384705, + "error": 0.19140625, + "gradient_norm": 0.07577994465827942, + "elapsed": 1046.9508447647095 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved1_full", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "7b45252d6bb77a39c003c8f34f040d0d672e9dd1a1338a14126e1fe07a02c8c9", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 512, + 1024, + 1536 + ], + "training_draws": 1572864, + "distinct_phase_training_rows": 466919, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18000, + "surface_code_bX_d5_r03_center_5_5": 18251, + "surface_code_bX_d5_r05_center_5_5": 18224, + "surface_code_bX_d5_r07_center_5_5": 17881, + "surface_code_bX_d5_r09_center_5_5": 18247, + "surface_code_bX_d5_r11_center_5_5": 17452, + "surface_code_bX_d5_r13_center_5_5": 17982, + "surface_code_bX_d5_r15_center_5_5": 17498, + "surface_code_bX_d5_r17_center_5_5": 18487, + "surface_code_bX_d5_r19_center_5_5": 18100, + "surface_code_bX_d5_r21_center_5_5": 17622, + "surface_code_bX_d5_r23_center_5_5": 17449, + "surface_code_bX_d5_r25_center_5_5": 17739, + "surface_code_bZ_d5_r01_center_5_5": 16689, + "surface_code_bZ_d5_r03_center_5_5": 18119, + "surface_code_bZ_d5_r05_center_5_5": 18146, + "surface_code_bZ_d5_r07_center_5_5": 18185, + "surface_code_bZ_d5_r09_center_5_5": 18473, + "surface_code_bZ_d5_r11_center_5_5": 18636, + "surface_code_bZ_d5_r13_center_5_5": 18474, + "surface_code_bZ_d5_r15_center_5_5": 17779, + "surface_code_bZ_d5_r17_center_5_5": 18474, + "surface_code_bZ_d5_r19_center_5_5": 17306, + "surface_code_bZ_d5_r21_center_5_5": 17165, + "surface_code_bZ_d5_r23_center_5_5": 18616, + "surface_code_bZ_d5_r25_center_5_5": 17925 + }, + "initial_optimizer_count": 512, + "last_optimizer_count": 2048, + "parent_checkpoint_sha256": "1adc47acc35148d4260df25e25384124609d2b1e098ffcf30a1eccea55ef8712", + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "training_source_snapshot": "training_sources/reserved1_full", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23228665865384618, + "0": 0.2337439903846154, + "blend-0": 0.23366887019230773, + "512": 0.23284254807692306, + "blend-512": 0.23275240384615387, + "1024": 0.23356370192307693, + "blend-1024": 0.23315805288461536, + "1536": 0.23218149038461539, + "blend-1536": 0.2330378605769231 + }, + "selected": "1536" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.21953124999999998, + "0": 0.2206580528846154, + "blend-0": 0.2208683894230769, + "512": 0.22100360576923078, + "blend-512": 0.2208984375, + "1024": 0.22104867788461538, + "blend-1024": 0.22019230769230771, + "1536": 0.22264122596153849, + "blend-1536": 0.22032752403846154 + }, + "selected": "incumbent" + } + ], + "checkpoints": { + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 466919, + "weights_sha256": "65a762bc0623024c3fbc416ff5df00d8ea275f6c7d691a54c6e0492f459a362f", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit unused intermediate logical tracking; raw neural branches also omit the unused final physical readout.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false, + "numerical_controls": { + "packaged_runtime_control_cpu": { + "device": "cpu", + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 7, + "same_cpu_old_vs_new_maximum_difference": 0.0, + "old_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "new_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "cpu_vs_reconstructed_old_gpu_runtime_maximum_difference": 4.976987838745117e-05, + "original_gpu_evaluation_vs_reconstructed_gpu_runtime_maximum_difference": 7.748603820800781e-07, + "initial_failed_control": { + "comparison": "CPU runtime against original GPU evaluator", + "observed_maximum_difference": 4.971027374267578e-05, + "original_tolerance": 3e-06 + }, + "sources": { + "d5_base_context_model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "d5_context_model.py": "53342e15dcbb8bc2dd0b288d75ea115fb504be99a33bc283a518b9d76232cd99", + "d5_temporal_context_model.py": "d58bcfe01767228d18ce2078d555abf13037b5df63edf38273ba66f0966ee445", + "d5_history_context_model.py": "4cc383b4909ff740bccfd20b687f8ee46866e67f93f82fe6c4bace162149ffb4", + "d5_history_features.py": "d709cd54225aa1b14707afa436314c8392f59f748a0007d988c6d18dedd275ee", + "d5_contextual.py": "59d6c85dc4bd61e26cf7243baf0e2637c3de1d35327b2c763707badd19446550", + "turbo.py": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b" + }, + "scope": "Same-device compatibility check. Reconstructed GPU runtime removes the recorded equal physical blend; that reconstruction has floating-point rounding uncertainty.", + "status": "passed_same_device_compatibility" + }, + "dispatcher_control_cpu": { + "status": "passed", + "device": "cpu", + "sources": { + "d5_context_model.py": "53342e15dcbb8bc2dd0b288d75ea115fb504be99a33bc283a518b9d76232cd99", + "d5_base_context_model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "d5_temporal_context_model.py": "d58bcfe01767228d18ce2078d555abf13037b5df63edf38273ba66f0966ee445", + "d5_history_context_model.py": "4cc383b4909ff740bccfd20b687f8ee46866e67f93f82fe6c4bace162149ffb4", + "d5_history_features.py": "d709cd54225aa1b14707afa436314c8392f59f748a0007d988c6d18dedd275ee" + }, + "cases": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "base64", + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "base128", + "weights_sha256": "2a21869e7669492fac8252131434b2e09c97f1def2714988382ab7f127371bd8", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "temporal", + "weights_sha256": "9446a1e6dc46e1bcae540531e4f124930bb151ebfa600746ca77bc8f5b2aaa7c", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "history", + "weights_sha256": "c508d8968ffa143be4219a207fb54ece3e1bfe144b8a880e4ed4f3d13f092c1e", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "base64", + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "base128", + "weights_sha256": "2a21869e7669492fac8252131434b2e09c97f1def2714988382ab7f127371bd8", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "temporal", + "weights_sha256": "9446a1e6dc46e1bcae540531e4f124930bb151ebfa600746ca77bc8f5b2aaa7c", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "history", + "weights_sha256": "c508d8968ffa143be4219a207fb54ece3e1bfe144b8a880e4ed4f3d13f092c1e", + "maximum_edge_probability_difference": 0.0 + } + ], + "scope": "Routing and code-copy check against each direct model implementation, using training detector inputs without labels. Tiny trained temporal/history smoke weights test nonzero feature couplings; they are excluded from model selection and submission.", + "test_data_used": false + }, + "cpu_probability_precision": { + "condition": "surface_code_bX_d5_r03_center_5_5", + "validation_syndromes": 7, + "logical_labels_used": false, + "parameter_updates": 0, + "reference": "Float64 neural forward and exact contraction from the same stored weights and fixed float32 input logits, on CPU", + "cpu_float32_vs_float64_maximum_difference": 7.624897924163321e-08, + "cpu_float32_edges_float64_contraction_vs_float64_maximum_difference": 4.725248914372315e-08, + "gpu_float32_vs_float64_maximum_difference": 4.964999121059854e-05, + "cpu_vs_gpu_float32_maximum_difference": 4.971027374267578e-05, + "maximum_neural_edge_probability_difference": 2.6330936014895556e-08, + "float32_edge_values_above_one_minus_1e6": 0, + "scope": "Precision diagnostic only; the published model is unchanged. Same-device old/new packaged-code compatibility was independently exact." + }, + "priors_only_control_cpu": { + "status": "passed", + "device": "cpu", + "source_sha256": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b", + "records": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 2.7116777896881104, + "priors_only_seconds_warm": 0.13569164276123047 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 3.557781457901001, + "priors_only_seconds_warm": 1.7711329460144043 + } + ], + "scope": "CPU numerical equivalence on supplied training syndromes; timings are not a controlled speed comparison." + } + } + } + ], + "short_syndrome_updates": [ + { + "training": { + "initialization": "256 residual logits per condition initialized independently Normal(0,.01), seeds20261126 through20261133; optimized in this session", + "architecture": "One categorical residual per possible8-bit detection syndrome, added to an exact physical DEM logit; no sample IDs or row indices are model features", + "loss": "Binomial logical BCE sufficient statistics plus strength times cross entropy to the fixed physical prior; damped Newton optimization from random residual initialization", + "fixed_prior": "Exact full-DEM probabilities for all256 possible input syndromes, computed now from the authorized packaged even-fitted DEM plans; no external trained weights or decoder answers", + "training": "All19880 supplied training labels for each of eight d3 one-round conditions; only aggregate counts by detection syndrome enter fitting", + "data_scope": "This is a finite categorical classifier, indexed by detection events, not a per-shot answer table. Other122 conditions retain the incumbent in any candidate benchmark.", + "selection": "One common strength and optional equal probability blend for all eight geometries/bases, minimizing full validation mean; all other conditions unchanged", + "base_package": { + "package": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/package", + "predictions": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/predictions", + "score": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/score.json", + "P": 0.7663217397836538 + }, + "test_data_used": false, + "training_records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 149, + "initial_seed": 20261126, + "physical_plan_sha256": "640c371577096ba08c799b70fd16d03a06a37004feaa15c85c4cb6ef87529080", + "training_arrays_sha256": "a7acd6f6e5372873cf2d34946876a791996238efdea39f7fa33f7d2eabc1c10f" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 157, + "initial_seed": 20261127, + "physical_plan_sha256": "4a0f8f630b7f34fba620a4e03bd77e14fb80149e70b7da80b6176dbd24d9ddc8", + "training_arrays_sha256": "0e2267afc5dc4e761d3b9e09288875f2077215fac2f902ce4151699c38c24531" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 152, + "initial_seed": 20261128, + "physical_plan_sha256": "de8914194be7689d70e9424540923197a5c0465fb42ec96556df97b73ba250c1", + "training_arrays_sha256": "0542609248a5d2c8b410666bb901361b60c39cb8b32b3b46fdd24a6c7913db56" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 147, + "initial_seed": 20261129, + "physical_plan_sha256": "bc1a6888cc5a854f0348cab463b8879c2d176d9509176b944b7f4265e0772ab3", + "training_arrays_sha256": "ccd43f09fba55b2138a5401e6f5c89cc7b4c4ec470a07cd037d9f715acaa1188" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 153, + "initial_seed": 20261130, + "physical_plan_sha256": "1931b5b85d0014c2a928a40c3ec502316ff30ea1632a25c5f64e2694f828434b", + "training_arrays_sha256": "aa27eee730c88b2071b5fd97f9d47a0f3ad010e29202415f786babc073d405e4" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 159, + "initial_seed": 20261131, + "physical_plan_sha256": "6d231f857bbe85040c91af1160c2dda16557a67851deaedc8092412f6abeb294", + "training_arrays_sha256": "569131ce49a2c1060ebd472c0290fc0c1de6e522cd7cd7aa92b10e17cdd1783c" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 158, + "initial_seed": 20261132, + "physical_plan_sha256": "ef285cea44ad63e0452596d4be65c8844ea8a7dcc49fb31b6a6241d367ed63eb", + "training_arrays_sha256": "6928ade685b05f76b7a3a9dc6423504d0bdce09742603c24978aa21fcf106f88" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 160, + "initial_seed": 20261133, + "physical_plan_sha256": "82bee01cf3e00079270a27cb79472322867548df5c9dc4db3252e4c6ec89e6a6", + "training_arrays_sha256": "afbc73fc5ca8e3b8e996377ab3df5a5b9397f36362e72c01feea7848ea1995f3" + } + ], + "records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261126, + "iterations": 8, + "failure": 0.0134765625, + "blended_failure": 0.013671875, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04649575086997129, + "weights_sha256": "d985985dedbe644bfae165330f4f46da14d04efbc4cad1af81c5510115380701" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261126, + "iterations": 6, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04591998541695955, + "weights_sha256": "17383d153dd1dfef62b3d4f6c5b7549c3209150faf0714e78fede09b941ecc3a" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.0458401737684183, + "weights_sha256": "f863a64ca698135f6fac6ac184d3c689db684a15d73bf0565418b240d76b5c58" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.045887733186657405, + "weights_sha256": "ded1a941e0dfc58e55ced6523720445fb70032d2d15c9929b0c93544f7c567f8" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261127, + "iterations": 8, + "failure": 0.0177734375, + "blended_failure": 0.0177734375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05532273244895745, + "weights_sha256": "02950043334a38d3e7980cc97685904338553746653bd2d6a4c9be88ae845270" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261127, + "iterations": 6, + "failure": 0.01875, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055166841080990084, + "weights_sha256": "412ee1f453695e4f3534dbe8d7eb1ca565d06fd7c718b52fe9a306b35e845d9d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261127, + "iterations": 5, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055186840974757456, + "weights_sha256": "12d8f72c2ee5cb837145aaf9a1b485d8517e4374721eebcbea9803d3bfdc8fcd" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261127, + "iterations": 4, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05544033886527203, + "weights_sha256": "d1daa90794c1c3c8cd00134d9b22a7173aee4dd9b139b86f6d3f9b8f2131056d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261128, + "iterations": 7, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.049592331750930654, + "weights_sha256": "ad21a8640e2fe7bbd550225e354dedcbad8cb70433b892f45d28fa2346ab88de" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04900882633372332, + "weights_sha256": "4664564f60149b00b1754a3f9e91c8b04b29ef819b231bf17ea7588346433a57" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04861554683295004, + "weights_sha256": "cad51322361a95020501afa64e356f2a49dd02afa0cd91294d4498f7eb0c5a8d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04843255984360956, + "weights_sha256": "5fe850e6313cb9ed6631697684afeeb7b7c5857a5c74fad66189cfcf8a08218b" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261129, + "iterations": 7, + "failure": 0.0158203125, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05156220348280275, + "weights_sha256": "56c2fd4a7c35033084020cd1f5c9dcc2ab1cf2c631d0e88cc87ac4c715c6af17" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05139675960346585, + "weights_sha256": "0bf66368e18c8d1baecaa614d4c0cec16304ac14bcd29d22d1cdb2a0ff6c0173" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05135569004239689, + "weights_sha256": "d9581a6f29f9d3ea54d482c17995a37b55e3b4253d36e1d49cfce95b398eb5c2" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05141882723288258, + "weights_sha256": "2c4e4592067fcbbe69d6ede68c4494209652a2d510e74aa2ea3b4420c3cdd741" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261130, + "iterations": 7, + "failure": 0.0173828125, + "blended_failure": 0.0173828125, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.054216247940585036, + "weights_sha256": "7b12f028f764293a9496d9fd2ddbf92ba9c23653d7889a602a9ec23f8cde3d6b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261130, + "iterations": 6, + "failure": 0.017578125, + "blended_failure": 0.0171875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05364509063427466, + "weights_sha256": "1ad2ffaafa33009129a0953d79fe2d30ad62308eb9dbf8da0b76eca018a5b55a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261130, + "iterations": 5, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05368896256105915, + "weights_sha256": "64619c9b7bd40a14651bcd056d58f5b55e79eb334a4e5105ff12cb7ff6f2400a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261130, + "iterations": 6, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05387292464104988, + "weights_sha256": "b1490702e212d7cdcc936f55186b15411ced3a8928a1a32f2d4ac1212706fabf" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261131, + "iterations": 8, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04709647994869577, + "weights_sha256": "eb56715dfc5e8c6b8866ceeb2636422acad9992dd2c625355dc21b94c25351f0" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261131, + "iterations": 6, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.046679107084477436, + "weights_sha256": "320cd10cc8cd9d13d20d9ce0ea90413ed8343587f0c77abb0e1c8c84503aa2d8" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261131, + "iterations": 5, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04621785858320204, + "weights_sha256": "c7e63309de0668bd4d5c05169ecd6af1879c88be10947d0fdb958ca37068d433" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261131, + "iterations": 4, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04577880173787941, + "weights_sha256": "494824e979e52fbf0302e706ff6786d89ce60b607afd6b376cad9700f328feda" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261132, + "iterations": 7, + "failure": 0.01484375, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.05068038016752655, + "weights_sha256": "0b4c35df1d44c9353a2ea505205f3def95bb28de0c7052ded18cf599bef2709b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049663607204405706, + "weights_sha256": "b18deed32b51a58789873a1b45718f5c40d1d9500b57e113520b700a66902f1a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261132, + "iterations": 5, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.04918133832768282, + "weights_sha256": "12e71625e223602cbc9f7ae150473a1dad2c32f2d9221a4b88ccb93babc2c41d" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049002647954447996, + "weights_sha256": "e909b83698caba60ad01e28027b28005544cd8e795f88574fc6f81bcf56b2add" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261133, + "iterations": 7, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05204562159505248, + "weights_sha256": "b03b071238dda333574a4da2d9b2bb999cf362a83b9194b1c53871e9438f9f45" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05177096705064832, + "weights_sha256": "2a4c8113ee9a1dadcfc0f1b7ff8d164e7c8771d5764b0512ee1a5de2a8aaa395" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.051861030681133645, + "weights_sha256": "f201491af84870ffa8c1b59e16dea1fea910e7fda32f0e3d82863943222b57ee" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261133, + "iterations": 6, + "failure": 0.01640625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05206536190640361, + "weights_sha256": "b7cfd76b6574457626306868e31ab5327a1950cbbca41f6384eb2c4bc759e800" + } + ], + "choices": { + "incumbent": 0.0154541015625, + "16": 0.015380859375, + "blend-16": 0.015429687499999999, + "64": 0.0155029296875, + "blend-64": 0.015600585937500001, + "256": 0.0155517578125, + "blend-256": 0.015600585937500001, + "1024": 0.0156005859375, + "blend-1024": 0.015600585937500001 + }, + "selected": "16", + "expected_full_P": 0.7663245567908653, + "validation_P_gain": 2.817007211538435e-06, + "source_sha256": "7e75f14190b18b05e9af540a8ef0f75522060e78c30b05475686ea18faf0035f", + "seconds": 3.316046953201294 + }, + "packaging_selection": { + "incumbent": 0.0154541015625, + "16": 0.015380859375, + "64": 0.0155029296875, + "256": 0.0155517578125, + "1024": 0.0156005859375 + }, + "selected": "16", + "selection_scope": "One common prior strength for all eight short conditions; other122 condition predictions retained", + "runtime_source_sha256": "451ce740551f9e13348064f2e726e7e31a611b64bcf5d95def601deb78e854af" + }, + { + "training": { + "initialization": "256 residual logits per condition initialized independently Normal(0,.01), seeds20261126 through20261133; optimized in this session", + "architecture": "One categorical residual per possible8-bit detection syndrome, added to an exact physical DEM logit; no sample IDs or row indices are model features", + "loss": "Binomial logical BCE sufficient statistics plus strength times cross entropy to the fixed physical prior; damped Newton optimization from random residual initialization", + "fixed_prior": "Exact full-DEM probabilities for all256 possible input syndromes, computed now from the authorized packaged even-fitted DEM plans; no external trained weights or decoder answers", + "training": "All19880 supplied training labels for each of eight d3 one-round conditions; only aggregate counts by detection syndrome enter fitting", + "data_scope": "This is a finite categorical classifier, indexed by detection events, not a per-shot answer table. Other122 conditions retain the incumbent in any candidate benchmark.", + "selection": "One common strength and optional equal probability blend for all eight geometries/bases, minimizing full validation mean; all other conditions unchanged", + "base_package": { + "package": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/package", + "predictions": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/predictions", + "score": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/score.json", + "P": 0.7663217397836538 + }, + "test_data_used": false, + "training_records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 149, + "initial_seed": 20261126, + "physical_plan_sha256": "640c371577096ba08c799b70fd16d03a06a37004feaa15c85c4cb6ef87529080", + "training_arrays_sha256": "a7acd6f6e5372873cf2d34946876a791996238efdea39f7fa33f7d2eabc1c10f" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 157, + "initial_seed": 20261127, + "physical_plan_sha256": "4a0f8f630b7f34fba620a4e03bd77e14fb80149e70b7da80b6176dbd24d9ddc8", + "training_arrays_sha256": "0e2267afc5dc4e761d3b9e09288875f2077215fac2f902ce4151699c38c24531" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 152, + "initial_seed": 20261128, + "physical_plan_sha256": "de8914194be7689d70e9424540923197a5c0465fb42ec96556df97b73ba250c1", + "training_arrays_sha256": "0542609248a5d2c8b410666bb901361b60c39cb8b32b3b46fdd24a6c7913db56" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 147, + "initial_seed": 20261129, + "physical_plan_sha256": "bc1a6888cc5a854f0348cab463b8879c2d176d9509176b944b7f4265e0772ab3", + "training_arrays_sha256": "ccd43f09fba55b2138a5401e6f5c89cc7b4c4ec470a07cd037d9f715acaa1188" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 153, + "initial_seed": 20261130, + "physical_plan_sha256": "1931b5b85d0014c2a928a40c3ec502316ff30ea1632a25c5f64e2694f828434b", + "training_arrays_sha256": "aa27eee730c88b2071b5fd97f9d47a0f3ad010e29202415f786babc073d405e4" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 159, + "initial_seed": 20261131, + "physical_plan_sha256": "6d231f857bbe85040c91af1160c2dda16557a67851deaedc8092412f6abeb294", + "training_arrays_sha256": "569131ce49a2c1060ebd472c0290fc0c1de6e522cd7cd7aa92b10e17cdd1783c" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 158, + "initial_seed": 20261132, + "physical_plan_sha256": "ef285cea44ad63e0452596d4be65c8844ea8a7dcc49fb31b6a6241d367ed63eb", + "training_arrays_sha256": "6928ade685b05f76b7a3a9dc6423504d0bdce09742603c24978aa21fcf106f88" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 160, + "initial_seed": 20261133, + "physical_plan_sha256": "82bee01cf3e00079270a27cb79472322867548df5c9dc4db3252e4c6ec89e6a6", + "training_arrays_sha256": "afbc73fc5ca8e3b8e996377ab3df5a5b9397f36362e72c01feea7848ea1995f3" + } + ], + "records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261126, + "iterations": 8, + "failure": 0.0134765625, + "blended_failure": 0.013671875, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04649575086997129, + "weights_sha256": "d985985dedbe644bfae165330f4f46da14d04efbc4cad1af81c5510115380701" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261126, + "iterations": 6, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04591998541695955, + "weights_sha256": "17383d153dd1dfef62b3d4f6c5b7549c3209150faf0714e78fede09b941ecc3a" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.0458401737684183, + "weights_sha256": "f863a64ca698135f6fac6ac184d3c689db684a15d73bf0565418b240d76b5c58" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.045887733186657405, + "weights_sha256": "ded1a941e0dfc58e55ced6523720445fb70032d2d15c9929b0c93544f7c567f8" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261127, + "iterations": 8, + "failure": 0.0177734375, + "blended_failure": 0.0177734375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05532273244895745, + "weights_sha256": "02950043334a38d3e7980cc97685904338553746653bd2d6a4c9be88ae845270" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261127, + "iterations": 6, + "failure": 0.01875, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055166841080990084, + "weights_sha256": "412ee1f453695e4f3534dbe8d7eb1ca565d06fd7c718b52fe9a306b35e845d9d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261127, + "iterations": 5, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055186840974757456, + "weights_sha256": "12d8f72c2ee5cb837145aaf9a1b485d8517e4374721eebcbea9803d3bfdc8fcd" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261127, + "iterations": 4, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05544033886527203, + "weights_sha256": "d1daa90794c1c3c8cd00134d9b22a7173aee4dd9b139b86f6d3f9b8f2131056d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261128, + "iterations": 7, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.049592331750930654, + "weights_sha256": "ad21a8640e2fe7bbd550225e354dedcbad8cb70433b892f45d28fa2346ab88de" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04900882633372332, + "weights_sha256": "4664564f60149b00b1754a3f9e91c8b04b29ef819b231bf17ea7588346433a57" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04861554683295004, + "weights_sha256": "cad51322361a95020501afa64e356f2a49dd02afa0cd91294d4498f7eb0c5a8d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04843255984360956, + "weights_sha256": "5fe850e6313cb9ed6631697684afeeb7b7c5857a5c74fad66189cfcf8a08218b" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261129, + "iterations": 7, + "failure": 0.0158203125, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05156220348280275, + "weights_sha256": "56c2fd4a7c35033084020cd1f5c9dcc2ab1cf2c631d0e88cc87ac4c715c6af17" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05139675960346585, + "weights_sha256": "0bf66368e18c8d1baecaa614d4c0cec16304ac14bcd29d22d1cdb2a0ff6c0173" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05135569004239689, + "weights_sha256": "d9581a6f29f9d3ea54d482c17995a37b55e3b4253d36e1d49cfce95b398eb5c2" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05141882723288258, + "weights_sha256": "2c4e4592067fcbbe69d6ede68c4494209652a2d510e74aa2ea3b4420c3cdd741" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261130, + "iterations": 7, + "failure": 0.0173828125, + "blended_failure": 0.0173828125, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.054216247940585036, + "weights_sha256": "7b12f028f764293a9496d9fd2ddbf92ba9c23653d7889a602a9ec23f8cde3d6b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261130, + "iterations": 6, + "failure": 0.017578125, + "blended_failure": 0.0171875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05364509063427466, + "weights_sha256": "1ad2ffaafa33009129a0953d79fe2d30ad62308eb9dbf8da0b76eca018a5b55a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261130, + "iterations": 5, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05368896256105915, + "weights_sha256": "64619c9b7bd40a14651bcd056d58f5b55e79eb334a4e5105ff12cb7ff6f2400a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261130, + "iterations": 6, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05387292464104988, + "weights_sha256": "b1490702e212d7cdcc936f55186b15411ced3a8928a1a32f2d4ac1212706fabf" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261131, + "iterations": 8, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04709647994869577, + "weights_sha256": "eb56715dfc5e8c6b8866ceeb2636422acad9992dd2c625355dc21b94c25351f0" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261131, + "iterations": 6, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.046679107084477436, + "weights_sha256": "320cd10cc8cd9d13d20d9ce0ea90413ed8343587f0c77abb0e1c8c84503aa2d8" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261131, + "iterations": 5, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04621785858320204, + "weights_sha256": "c7e63309de0668bd4d5c05169ecd6af1879c88be10947d0fdb958ca37068d433" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261131, + "iterations": 4, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04577880173787941, + "weights_sha256": "494824e979e52fbf0302e706ff6786d89ce60b607afd6b376cad9700f328feda" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261132, + "iterations": 7, + "failure": 0.01484375, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.05068038016752655, + "weights_sha256": "0b4c35df1d44c9353a2ea505205f3def95bb28de0c7052ded18cf599bef2709b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049663607204405706, + "weights_sha256": "b18deed32b51a58789873a1b45718f5c40d1d9500b57e113520b700a66902f1a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261132, + "iterations": 5, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.04918133832768282, + "weights_sha256": "12e71625e223602cbc9f7ae150473a1dad2c32f2d9221a4b88ccb93babc2c41d" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049002647954447996, + "weights_sha256": "e909b83698caba60ad01e28027b28005544cd8e795f88574fc6f81bcf56b2add" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261133, + "iterations": 7, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05204562159505248, + "weights_sha256": "b03b071238dda333574a4da2d9b2bb999cf362a83b9194b1c53871e9438f9f45" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05177096705064832, + "weights_sha256": "2a4c8113ee9a1dadcfc0f1b7ff8d164e7c8771d5764b0512ee1a5de2a8aaa395" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.051861030681133645, + "weights_sha256": "f201491af84870ffa8c1b59e16dea1fea910e7fda32f0e3d82863943222b57ee" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261133, + "iterations": 6, + "failure": 0.01640625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05206536190640361, + "weights_sha256": "b7cfd76b6574457626306868e31ab5327a1950cbbca41f6384eb2c4bc759e800" + } + ], + "choices": { + "incumbent": 0.0154541015625, + "16": 0.015380859375, + "blend-16": 0.015429687499999999, + "64": 0.0155029296875, + "blend-64": 0.015600585937500001, + "256": 0.0155517578125, + "blend-256": 0.015600585937500001, + "1024": 0.0156005859375, + "blend-1024": 0.015600585937500001 + }, + "selected": "16", + "expected_full_P": 0.7663245567908653, + "validation_P_gain": 2.817007211538435e-06, + "source_sha256": "7e75f14190b18b05e9af540a8ef0f75522060e78c30b05475686ea18faf0035f", + "seconds": 3.316046953201294 + }, + "packaging_selection": { + "incumbent": 0.0154296875, + "16": 0.015380859375, + "64": 0.0155029296875, + "256": 0.0155517578125, + "1024": 0.0156005859375 + }, + "selected": "16", + "new_optimizer_updates": 0, + "selection_scope": "One common prior strength for all eight short conditions; other122 condition predictions retained", + "runtime_source_sha256": "451ce740551f9e13348064f2e726e7e31a611b64bcf5d95def601deb78e854af" + }, + { + "training": { + "initialization": "256 residual logits per condition initialized independently Normal(0,.01), seeds20261126 through20261133; optimized in this session", + "architecture": "One categorical residual per possible8-bit detection syndrome, added to an exact physical DEM logit; no sample IDs or row indices are model features", + "loss": "Binomial logical BCE sufficient statistics plus strength times cross entropy to the fixed physical prior; damped Newton optimization from random residual initialization", + "fixed_prior": "Exact full-DEM probabilities for all256 possible input syndromes, computed now from the authorized packaged even-fitted DEM plans; no external trained weights or decoder answers", + "training": "All19880 supplied training labels for each of eight d3 one-round conditions; only aggregate counts by detection syndrome enter fitting", + "data_scope": "This is a finite categorical classifier, indexed by detection events, not a per-shot answer table. Other122 conditions retain the incumbent in any candidate benchmark.", + "selection": "One common strength and optional equal probability blend for all eight geometries/bases, minimizing full validation mean; all other conditions unchanged", + "base_package": { + "package": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/package", + "predictions": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/predictions", + "score": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/score.json", + "P": 0.7663217397836538 + }, + "test_data_used": false, + "training_records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 149, + "initial_seed": 20261126, + "physical_plan_sha256": "640c371577096ba08c799b70fd16d03a06a37004feaa15c85c4cb6ef87529080", + "training_arrays_sha256": "a7acd6f6e5372873cf2d34946876a791996238efdea39f7fa33f7d2eabc1c10f" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 157, + "initial_seed": 20261127, + "physical_plan_sha256": "4a0f8f630b7f34fba620a4e03bd77e14fb80149e70b7da80b6176dbd24d9ddc8", + "training_arrays_sha256": "0e2267afc5dc4e761d3b9e09288875f2077215fac2f902ce4151699c38c24531" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 152, + "initial_seed": 20261128, + "physical_plan_sha256": "de8914194be7689d70e9424540923197a5c0465fb42ec96556df97b73ba250c1", + "training_arrays_sha256": "0542609248a5d2c8b410666bb901361b60c39cb8b32b3b46fdd24a6c7913db56" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 147, + "initial_seed": 20261129, + "physical_plan_sha256": "bc1a6888cc5a854f0348cab463b8879c2d176d9509176b944b7f4265e0772ab3", + "training_arrays_sha256": "ccd43f09fba55b2138a5401e6f5c89cc7b4c4ec470a07cd037d9f715acaa1188" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "training_shots": 19880, + "observed_syndromes": 153, + "initial_seed": 20261130, + "physical_plan_sha256": "1931b5b85d0014c2a928a40c3ec502316ff30ea1632a25c5f64e2694f828434b", + "training_arrays_sha256": "aa27eee730c88b2071b5fd97f9d47a0f3ad010e29202415f786babc073d405e4" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "training_shots": 19880, + "observed_syndromes": 159, + "initial_seed": 20261131, + "physical_plan_sha256": "6d231f857bbe85040c91af1160c2dda16557a67851deaedc8092412f6abeb294", + "training_arrays_sha256": "569131ce49a2c1060ebd472c0290fc0c1de6e522cd7cd7aa92b10e17cdd1783c" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "training_shots": 19880, + "observed_syndromes": 158, + "initial_seed": 20261132, + "physical_plan_sha256": "ef285cea44ad63e0452596d4be65c8844ea8a7dcc49fb31b6a6241d367ed63eb", + "training_arrays_sha256": "6928ade685b05f76b7a3a9dc6423504d0bdce09742603c24978aa21fcf106f88" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "training_shots": 19880, + "observed_syndromes": 160, + "initial_seed": 20261133, + "physical_plan_sha256": "82bee01cf3e00079270a27cb79472322867548df5c9dc4db3252e4c6ec89e6a6", + "training_arrays_sha256": "afbc73fc5ca8e3b8e996377ab3df5a5b9397f36362e72c01feea7848ea1995f3" + } + ], + "records": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261126, + "iterations": 8, + "failure": 0.0134765625, + "blended_failure": 0.013671875, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04649575086997129, + "weights_sha256": "d985985dedbe644bfae165330f4f46da14d04efbc4cad1af81c5510115380701" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261126, + "iterations": 6, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.04591998541695955, + "weights_sha256": "17383d153dd1dfef62b3d4f6c5b7549c3209150faf0714e78fede09b941ecc3a" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.0458401737684183, + "weights_sha256": "f863a64ca698135f6fac6ac184d3c689db684a15d73bf0565418b240d76b5c58" + }, + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261126, + "iterations": 5, + "failure": 0.0140625, + "blended_failure": 0.0140625, + "incumbent_failure": 0.0134765625, + "negative_log_likelihood": 0.045887733186657405, + "weights_sha256": "ded1a941e0dfc58e55ced6523720445fb70032d2d15c9929b0c93544f7c567f8" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261127, + "iterations": 8, + "failure": 0.0177734375, + "blended_failure": 0.0177734375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05532273244895745, + "weights_sha256": "02950043334a38d3e7980cc97685904338553746653bd2d6a4c9be88ae845270" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261127, + "iterations": 6, + "failure": 0.01875, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055166841080990084, + "weights_sha256": "412ee1f453695e4f3534dbe8d7eb1ca565d06fd7c718b52fe9a306b35e845d9d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261127, + "iterations": 5, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.055186840974757456, + "weights_sha256": "12d8f72c2ee5cb837145aaf9a1b485d8517e4374721eebcbea9803d3bfdc8fcd" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261127, + "iterations": 4, + "failure": 0.01953125, + "blended_failure": 0.0193359375, + "incumbent_failure": 0.0193359375, + "negative_log_likelihood": 0.05544033886527203, + "weights_sha256": "d1daa90794c1c3c8cd00134d9b22a7173aee4dd9b139b86f6d3f9b8f2131056d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261128, + "iterations": 7, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.049592331750930654, + "weights_sha256": "ad21a8640e2fe7bbd550225e354dedcbad8cb70433b892f45d28fa2346ab88de" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04900882633372332, + "weights_sha256": "4664564f60149b00b1754a3f9e91c8b04b29ef819b231bf17ea7588346433a57" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04861554683295004, + "weights_sha256": "cad51322361a95020501afa64e356f2a49dd02afa0cd91294d4498f7eb0c5a8d" + }, + { + "condition": "surface_code_bX_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261128, + "iterations": 6, + "failure": 0.015234375, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.0158203125, + "negative_log_likelihood": 0.04843255984360956, + "weights_sha256": "5fe850e6313cb9ed6631697684afeeb7b7c5857a5c74fad66189cfcf8a08218b" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261129, + "iterations": 7, + "failure": 0.0158203125, + "blended_failure": 0.0158203125, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05156220348280275, + "weights_sha256": "56c2fd4a7c35033084020cd1f5c9dcc2ab1cf2c631d0e88cc87ac4c715c6af17" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05139675960346585, + "weights_sha256": "0bf66368e18c8d1baecaa614d4c0cec16304ac14bcd29d22d1cdb2a0ff6c0173" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05135569004239689, + "weights_sha256": "d9581a6f29f9d3ea54d482c17995a37b55e3b4253d36e1d49cfce95b398eb5c2" + }, + { + "condition": "surface_code_bX_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261129, + "iterations": 6, + "failure": 0.0154296875, + "blended_failure": 0.0154296875, + "incumbent_failure": 0.01484375, + "negative_log_likelihood": 0.05141882723288258, + "weights_sha256": "2c4e4592067fcbbe69d6ede68c4494209652a2d510e74aa2ea3b4420c3cdd741" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 16, + "seed": 20261130, + "iterations": 7, + "failure": 0.0173828125, + "blended_failure": 0.0173828125, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.054216247940585036, + "weights_sha256": "7b12f028f764293a9496d9fd2ddbf92ba9c23653d7889a602a9ec23f8cde3d6b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 64, + "seed": 20261130, + "iterations": 6, + "failure": 0.017578125, + "blended_failure": 0.0171875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05364509063427466, + "weights_sha256": "1ad2ffaafa33009129a0953d79fe2d30ad62308eb9dbf8da0b76eca018a5b55a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 256, + "seed": 20261130, + "iterations": 5, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05368896256105915, + "weights_sha256": "64619c9b7bd40a14651bcd056d58f5b55e79eb334a4e5105ff12cb7ff6f2400a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_3_5", + "prior_strength": 1024, + "seed": 20261130, + "iterations": 6, + "failure": 0.0171875, + "blended_failure": 0.016796875, + "incumbent_failure": 0.016796875, + "negative_log_likelihood": 0.05387292464104988, + "weights_sha256": "b1490702e212d7cdcc936f55186b15411ced3a8928a1a32f2d4ac1212706fabf" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 16, + "seed": 20261131, + "iterations": 8, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04709647994869577, + "weights_sha256": "eb56715dfc5e8c6b8866ceeb2636422acad9992dd2c625355dc21b94c25351f0" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 64, + "seed": 20261131, + "iterations": 6, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.046679107084477436, + "weights_sha256": "320cd10cc8cd9d13d20d9ce0ea90413ed8343587f0c77abb0e1c8c84503aa2d8" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 256, + "seed": 20261131, + "iterations": 5, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04621785858320204, + "weights_sha256": "c7e63309de0668bd4d5c05169ecd6af1879c88be10947d0fdb958ca37068d433" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_3", + "prior_strength": 1024, + "seed": 20261131, + "iterations": 4, + "failure": 0.0125, + "blended_failure": 0.0125, + "incumbent_failure": 0.0125, + "negative_log_likelihood": 0.04577880173787941, + "weights_sha256": "494824e979e52fbf0302e706ff6786d89ce60b607afd6b376cad9700f328feda" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 16, + "seed": 20261132, + "iterations": 7, + "failure": 0.01484375, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.05068038016752655, + "weights_sha256": "0b4c35df1d44c9353a2ea505205f3def95bb28de0c7052ded18cf599bef2709b" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 64, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049663607204405706, + "weights_sha256": "b18deed32b51a58789873a1b45718f5c40d1d9500b57e113520b700a66902f1a" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 256, + "seed": 20261132, + "iterations": 5, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.04918133832768282, + "weights_sha256": "12e71625e223602cbc9f7ae150473a1dad2c32f2d9221a4b88ccb93babc2c41d" + }, + { + "condition": "surface_code_bZ_d3_r01_center_5_7", + "prior_strength": 1024, + "seed": 20261132, + "iterations": 6, + "failure": 0.014453125, + "blended_failure": 0.014453125, + "incumbent_failure": 0.014453125, + "negative_log_likelihood": 0.049002647954447996, + "weights_sha256": "e909b83698caba60ad01e28027b28005544cd8e795f88574fc6f81bcf56b2add" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 16, + "seed": 20261133, + "iterations": 7, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05204562159505248, + "weights_sha256": "b03b071238dda333574a4da2d9b2bb999cf362a83b9194b1c53871e9438f9f45" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 64, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.016015625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05177096705064832, + "weights_sha256": "2a4c8113ee9a1dadcfc0f1b7ff8d164e7c8771d5764b0512ee1a5de2a8aaa395" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 256, + "seed": 20261133, + "iterations": 6, + "failure": 0.016015625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.051861030681133645, + "weights_sha256": "f201491af84870ffa8c1b59e16dea1fea910e7fda32f0e3d82863943222b57ee" + }, + { + "condition": "surface_code_bZ_d3_r01_center_7_5", + "prior_strength": 1024, + "seed": 20261133, + "iterations": 6, + "failure": 0.01640625, + "blended_failure": 0.01640625, + "incumbent_failure": 0.01640625, + "negative_log_likelihood": 0.05206536190640361, + "weights_sha256": "b7cfd76b6574457626306868e31ab5327a1950cbbca41f6384eb2c4bc759e800" + } + ], + "choices": { + "incumbent": 0.0154541015625, + "16": 0.015380859375, + "blend-16": 0.015429687499999999, + "64": 0.0155029296875, + "blend-64": 0.015600585937500001, + "256": 0.0155517578125, + "blend-256": 0.015600585937500001, + "1024": 0.0156005859375, + "blend-1024": 0.015600585937500001 + }, + "selected": "16", + "expected_full_P": 0.7663245567908653, + "validation_P_gain": 2.817007211538435e-06, + "source_sha256": "7e75f14190b18b05e9af540a8ef0f75522060e78c30b05475686ea18faf0035f", + "seconds": 3.316046953201294 + }, + "packaging_selection": { + "incumbent": 0.0155517578125, + "16": 0.015380859375, + "64": 0.0155029296875, + "256": 0.0155517578125, + "1024": 0.0156005859375 + }, + "selected": "16", + "new_optimizer_updates": 0, + "selection_scope": "One common prior strength for all eight short conditions; other122 condition predictions retained", + "runtime_source_sha256": "451ce740551f9e13348064f2e726e7e31a611b64bcf5d95def601deb78e854af" + } + ], + "research_selection_history": { + "path": "selection_history.json", + "sha256": "46cdb96e1e8663328d17de14e7cbbdaa58fa7261cd94467496613ab0086f5986", + "completed_training_runs": 50, + "assembled_candidates": 39 + }, + "runtime_projection": { + "measured_full_validation_seconds_by_distance": { + "d3": 68.0347409248352, + "d5": 322.1027355194092 + }, + "validation_shots_per_condition": 5120, + "benchmark_shots_per_condition": 25000, + "workload_source": "Supplied data/README.md declares 25000 benchmark rows per condition; no benchmark examples accessed", + "linear_scale": 4.8828125, + "projected_total_seconds": 1904.968146700412, + "limit_seconds": 3600, + "interpretation": "Projection from complete validation replays, scaling startup/compilation overhead as well as shot work. Retained-path timings are inherited; one-round categorical replacements only remove contractions. This is not a timed benchmark-split run." + }, + "neural_probability_ensemble": { + "new_optimizer_updates": 0, + "new_trainable_parameters": 0, + "initialization": "Constituents trained from random initialization in this session; this step only averages their predicted probabilities.", + "new_training": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261273", + "prior_pass": 3, + "initial_seed": 20261273, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 467790, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18254, + "surface_code_bX_d5_r03_center_5_5": 18525, + "surface_code_bX_d5_r05_center_5_5": 18175, + "surface_code_bX_d5_r07_center_5_5": 18005, + "surface_code_bX_d5_r09_center_5_5": 18067, + "surface_code_bX_d5_r11_center_5_5": 18445, + "surface_code_bX_d5_r13_center_5_5": 18673, + "surface_code_bX_d5_r15_center_5_5": 17345, + "surface_code_bX_d5_r17_center_5_5": 17898, + "surface_code_bX_d5_r19_center_5_5": 18359, + "surface_code_bX_d5_r21_center_5_5": 18036, + "surface_code_bX_d5_r23_center_5_5": 17255, + "surface_code_bX_d5_r25_center_5_5": 18057, + "surface_code_bZ_d5_r01_center_5_5": 17596, + "surface_code_bZ_d5_r03_center_5_5": 18333, + "surface_code_bZ_d5_r05_center_5_5": 18250, + "surface_code_bZ_d5_r07_center_5_5": 18210, + "surface_code_bZ_d5_r09_center_5_5": 17447, + "surface_code_bZ_d5_r11_center_5_5": 18120, + "surface_code_bZ_d5_r13_center_5_5": 18224, + "surface_code_bZ_d5_r15_center_5_5": 17857, + "surface_code_bZ_d5_r17_center_5_5": 18359, + "surface_code_bZ_d5_r19_center_5_5": 17398, + "surface_code_bZ_d5_r21_center_5_5": 18235, + "surface_code_bZ_d5_r23_center_5_5": 16653, + "surface_code_bZ_d5_r25_center_5_5": 18014 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1536, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261274, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "/run-state/workspace/research/learned_d5/reserved2_warm/rng-512.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/reserved2_warm/weights-512.npz", + "starting_checkpoint_sha256": "2b00e3f258886b5c4ecf69f36fd5463a205eefc84bd10c550acc391e84515c24", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261273", + "prior_pass": 3, + "initial_seed": 20261273, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 317635, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 13700, + "surface_code_bX_d5_r03_center_5_5": 10036, + "surface_code_bX_d5_r05_center_5_5": 11768, + "surface_code_bX_d5_r07_center_5_5": 10917, + "surface_code_bX_d5_r09_center_5_5": 13458, + "surface_code_bX_d5_r11_center_5_5": 11764, + "surface_code_bX_d5_r13_center_5_5": 14018, + "surface_code_bX_d5_r15_center_5_5": 10968, + "surface_code_bX_d5_r17_center_5_5": 13469, + "surface_code_bX_d5_r19_center_5_5": 11340, + "surface_code_bX_d5_r21_center_5_5": 11327, + "surface_code_bX_d5_r23_center_5_5": 13970, + "surface_code_bX_d5_r25_center_5_5": 10500, + "surface_code_bZ_d5_r01_center_5_5": 12079, + "surface_code_bZ_d5_r03_center_5_5": 12160, + "surface_code_bZ_d5_r05_center_5_5": 9494, + "surface_code_bZ_d5_r07_center_5_5": 10910, + "surface_code_bZ_d5_r09_center_5_5": 10064, + "surface_code_bZ_d5_r11_center_5_5": 10969, + "surface_code_bZ_d5_r13_center_5_5": 13419, + "surface_code_bZ_d5_r15_center_5_5": 12842, + "surface_code_bZ_d5_r17_center_5_5": 13694, + "surface_code_bZ_d5_r19_center_5_5": 13449, + "surface_code_bZ_d5_r21_center_5_5": 13799, + "surface_code_bZ_d5_r23_center_5_5": 12754, + "surface_code_bZ_d5_r25_center_5_5": 14767 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 512, + "batch": 1024, + "learning_rate": 0.001, + "sampling_seed": 20261274, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "rng_restored": false, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "Fresh NumPy default_rng seed 20261274", + "starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "starting_training_provenance": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.2600052058696747, + "objective": 0.2600052058696747, + "error": 0.1123046875, + "gradient_norm": 0.06799795478582382, + "elapsed": 27.333195447921753 + }, + { + "step": 16, + "loss": 0.0312246885150671, + "objective": 0.0312246885150671, + "error": 0.01171875, + "gradient_norm": 0.004962741397321224, + "elapsed": 48.383540868759155 + }, + { + "step": 32, + "loss": 0.22698244452476501, + "objective": 0.22698244452476501, + "error": 0.08984375, + "gradient_norm": 0.06353150308132172, + "elapsed": 57.04609966278076 + }, + { + "step": 48, + "loss": 0.5861443281173706, + "objective": 0.5861443281173706, + "error": 0.3486328125, + "gradient_norm": 0.04095375910401344, + "elapsed": 69.08654689788818 + }, + { + "step": 64, + "loss": 0.6103856563568115, + "objective": 0.6103856563568115, + "error": 0.3662109375, + "gradient_norm": 0.04155975207686424, + "elapsed": 81.63970494270325 + }, + { + "step": 80, + "loss": 0.5673234462738037, + "objective": 0.5673234462738037, + "error": 0.3125, + "gradient_norm": 0.1773851364850998, + "elapsed": 92.5357596874237 + }, + { + "step": 96, + "loss": 0.3763846755027771, + "objective": 0.3763846755027771, + "error": 0.1875, + "gradient_norm": 0.0951203852891922, + "elapsed": 103.12279391288757 + }, + { + "step": 112, + "loss": 0.45539408922195435, + "objective": 0.45539408922195435, + "error": 0.22265625, + "gradient_norm": 0.056369006633758545, + "elapsed": 112.61882042884827 + }, + { + "step": 128, + "loss": 0.015473627485334873, + "objective": 0.015473627485334873, + "error": 0.005859375, + "gradient_norm": 0.005696057807654142, + "elapsed": 125.16960310935974 + }, + { + "step": 144, + "loss": 0.03449750319123268, + "objective": 0.03449750319123268, + "error": 0.0107421875, + "gradient_norm": 0.008358650840818882, + "elapsed": 135.8080232143402 + }, + { + "step": 160, + "loss": 0.5731935501098633, + "objective": 0.5731935501098633, + "error": 0.31640625, + "gradient_norm": 0.056162577122449875, + "elapsed": 145.0349259376526 + }, + { + "step": 176, + "loss": 0.5626271963119507, + "objective": 0.5626271963119507, + "error": 0.314453125, + "gradient_norm": 0.048817526549100876, + "elapsed": 154.84093379974365 + }, + { + "step": 192, + "loss": 0.5507581233978271, + "objective": 0.5507581233978271, + "error": 0.3173828125, + "gradient_norm": 0.06503377854824066, + "elapsed": 164.7195086479187 + }, + { + "step": 208, + "loss": 0.5725968480110168, + "objective": 0.5725968480110168, + "error": 0.3251953125, + "gradient_norm": 0.047704510390758514, + "elapsed": 175.38803815841675 + }, + { + "step": 224, + "loss": 0.5249365568161011, + "objective": 0.5249365568161011, + "error": 0.2802734375, + "gradient_norm": 0.10021239519119263, + "elapsed": 187.0162854194641 + }, + { + "step": 240, + "loss": 0.2526492476463318, + "objective": 0.2526492476463318, + "error": 0.1103515625, + "gradient_norm": 0.06751289963722229, + "elapsed": 196.51696944236755 + }, + { + "step": 256, + "loss": 0.5214780569076538, + "objective": 0.5214780569076538, + "error": 0.275390625, + "gradient_norm": 0.14627203345298767, + "elapsed": 208.2405219078064 + }, + { + "step": 272, + "loss": 0.59315025806427, + "objective": 0.59315025806427, + "error": 0.341796875, + "gradient_norm": 0.03693874180316925, + "elapsed": 224.87874341011047 + }, + { + "step": 288, + "loss": 0.37350377440452576, + "objective": 0.37350377440452576, + "error": 0.169921875, + "gradient_norm": 0.05035478249192238, + "elapsed": 235.2427306175232 + }, + { + "step": 304, + "loss": 0.6201726198196411, + "objective": 0.6201726198196411, + "error": 0.3798828125, + "gradient_norm": 0.04230104014277458, + "elapsed": 244.4733214378357 + }, + { + "step": 320, + "loss": 0.5781067609786987, + "objective": 0.5781067609786987, + "error": 0.3291015625, + "gradient_norm": 0.06764703243970871, + "elapsed": 256.96991300582886 + }, + { + "step": 336, + "loss": 0.13824111223220825, + "objective": 0.13824111223220825, + "error": 0.0556640625, + "gradient_norm": 0.02330971322953701, + "elapsed": 268.097412109375 + }, + { + "step": 352, + "loss": 0.6141752004623413, + "objective": 0.6141752004623413, + "error": 0.37890625, + "gradient_norm": 0.08660273998975754, + "elapsed": 282.79302310943604 + }, + { + "step": 368, + "loss": 0.3470626473426819, + "objective": 0.3470626473426819, + "error": 0.1611328125, + "gradient_norm": 0.05711895599961281, + "elapsed": 293.79467129707336 + }, + { + "step": 384, + "loss": 0.6023644208908081, + "objective": 0.6023644208908081, + "error": 0.3466796875, + "gradient_norm": 0.08649417012929916, + "elapsed": 305.9786322116852 + }, + { + "step": 400, + "loss": 0.03022841364145279, + "objective": 0.03022841364145279, + "error": 0.0087890625, + "gradient_norm": 0.009741511195898056, + "elapsed": 315.06104922294617 + }, + { + "step": 416, + "loss": 0.23827238380908966, + "objective": 0.23827238380908966, + "error": 0.1015625, + "gradient_norm": 0.03526044636964798, + "elapsed": 325.6410942077637 + }, + { + "step": 432, + "loss": 0.43375664949417114, + "objective": 0.43375664949417114, + "error": 0.201171875, + "gradient_norm": 0.03940205276012421, + "elapsed": 336.9890570640564 + }, + { + "step": 448, + "loss": 0.5915575623512268, + "objective": 0.5915575623512268, + "error": 0.3359375, + "gradient_norm": 0.04364592209458351, + "elapsed": 346.9254243373871 + }, + { + "step": 464, + "loss": 0.5641118288040161, + "objective": 0.5641118288040161, + "error": 0.3076171875, + "gradient_norm": 0.052896615117788315, + "elapsed": 356.9816539287567 + }, + { + "step": 480, + "loss": 0.5682889223098755, + "objective": 0.5682889223098755, + "error": 0.322265625, + "gradient_norm": 0.07130409777164459, + "elapsed": 369.16103172302246 + }, + { + "step": 496, + "loss": 0.37034764885902405, + "objective": 0.37034764885902405, + "error": 0.181640625, + "gradient_norm": 0.11464523524045944, + "elapsed": 381.041054725647 + }, + { + "step": 512, + "loss": 0.5398496389389038, + "objective": 0.5398496389389038, + "error": 0.3076171875, + "gradient_norm": 0.05673467367887497, + "elapsed": 394.5030150413513 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved2_warm", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "db182d721768f832e1c83f6258b31bef0d8bf2ded239a8ab5a45cbb76378fd30", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 256, + 512 + ], + "training_draws": 524288, + "distinct_phase_training_rows": 317635, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 13700, + "surface_code_bX_d5_r03_center_5_5": 10036, + "surface_code_bX_d5_r05_center_5_5": 11768, + "surface_code_bX_d5_r07_center_5_5": 10917, + "surface_code_bX_d5_r09_center_5_5": 13458, + "surface_code_bX_d5_r11_center_5_5": 11764, + "surface_code_bX_d5_r13_center_5_5": 14018, + "surface_code_bX_d5_r15_center_5_5": 10968, + "surface_code_bX_d5_r17_center_5_5": 13469, + "surface_code_bX_d5_r19_center_5_5": 11340, + "surface_code_bX_d5_r21_center_5_5": 11327, + "surface_code_bX_d5_r23_center_5_5": 13970, + "surface_code_bX_d5_r25_center_5_5": 10500, + "surface_code_bZ_d5_r01_center_5_5": 12079, + "surface_code_bZ_d5_r03_center_5_5": 12160, + "surface_code_bZ_d5_r05_center_5_5": 9494, + "surface_code_bZ_d5_r07_center_5_5": 10910, + "surface_code_bZ_d5_r09_center_5_5": 10064, + "surface_code_bZ_d5_r11_center_5_5": 10969, + "surface_code_bZ_d5_r13_center_5_5": 13419, + "surface_code_bZ_d5_r15_center_5_5": 12842, + "surface_code_bZ_d5_r17_center_5_5": 13694, + "surface_code_bZ_d5_r19_center_5_5": 13449, + "surface_code_bZ_d5_r21_center_5_5": 13799, + "surface_code_bZ_d5_r23_center_5_5": 12754, + "surface_code_bZ_d5_r25_center_5_5": 14767 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 512, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.30839407444000244, + "objective": 0.30839407444000244, + "error": 0.130859375, + "gradient_norm": 0.053425733000040054, + "elapsed": 28.537403345108032 + }, + { + "step": 16, + "loss": 0.021987520158290863, + "objective": 0.021987520158290863, + "error": 0.0078125, + "gradient_norm": 0.01397851575165987, + "elapsed": 48.18276286125183 + }, + { + "step": 32, + "loss": 0.5041587352752686, + "objective": 0.5041587352752686, + "error": 0.2724609375, + "gradient_norm": 0.0528741292655468, + "elapsed": 58.27348470687866 + }, + { + "step": 48, + "loss": 0.4326452612876892, + "objective": 0.4326452612876892, + "error": 0.21484375, + "gradient_norm": 0.0559566393494606, + "elapsed": 68.90473222732544 + }, + { + "step": 64, + "loss": 0.4804917275905609, + "objective": 0.4804917275905609, + "error": 0.248046875, + "gradient_norm": 0.0669105276465416, + "elapsed": 77.87249231338501 + }, + { + "step": 80, + "loss": 0.2889654338359833, + "objective": 0.2889654338359833, + "error": 0.1328125, + "gradient_norm": 0.08293467015028, + "elapsed": 86.87973022460938 + }, + { + "step": 96, + "loss": 0.5135385990142822, + "objective": 0.5135385990142822, + "error": 0.271484375, + "gradient_norm": 0.06412295252084732, + "elapsed": 95.98773431777954 + }, + { + "step": 112, + "loss": 0.31248384714126587, + "objective": 0.31248384714126587, + "error": 0.1357421875, + "gradient_norm": 0.03881710395216942, + "elapsed": 106.47444081306458 + }, + { + "step": 128, + "loss": 0.23868557810783386, + "objective": 0.23868557810783386, + "error": 0.091796875, + "gradient_norm": 0.03896595537662506, + "elapsed": 117.72143626213074 + }, + { + "step": 144, + "loss": 0.5315916538238525, + "objective": 0.5315916538238525, + "error": 0.2890625, + "gradient_norm": 0.09184520691633224, + "elapsed": 126.97882843017578 + }, + { + "step": 160, + "loss": 0.604732096195221, + "objective": 0.604732096195221, + "error": 0.3603515625, + "gradient_norm": 0.044600710272789, + "elapsed": 137.403742313385 + }, + { + "step": 176, + "loss": 0.032417282462120056, + "objective": 0.032417282462120056, + "error": 0.0107421875, + "gradient_norm": 0.010968778282403946, + "elapsed": 147.58081603050232 + }, + { + "step": 192, + "loss": 0.24050910770893097, + "objective": 0.24050910770893097, + "error": 0.087890625, + "gradient_norm": 0.052534136921167374, + "elapsed": 156.545964717865 + }, + { + "step": 208, + "loss": 0.3183761537075043, + "objective": 0.3183761537075043, + "error": 0.1435546875, + "gradient_norm": 0.05253623053431511, + "elapsed": 166.62695455551147 + }, + { + "step": 224, + "loss": 0.6407097578048706, + "objective": 0.6407097578048706, + "error": 0.3837890625, + "gradient_norm": 0.08772490173578262, + "elapsed": 174.46970582008362 + }, + { + "step": 240, + "loss": 0.597212553024292, + "objective": 0.597212553024292, + "error": 0.36328125, + "gradient_norm": 0.13039150834083557, + "elapsed": 184.2768793106079 + }, + { + "step": 256, + "loss": 0.3317721486091614, + "objective": 0.3317721486091614, + "error": 0.14453125, + "gradient_norm": 0.03749232366681099, + "elapsed": 194.6345317363739 + }, + { + "step": 272, + "loss": 0.6330116987228394, + "objective": 0.6330116987228394, + "error": 0.3955078125, + "gradient_norm": 0.06468097865581512, + "elapsed": 205.8717017173767 + }, + { + "step": 288, + "loss": 0.3141757845878601, + "objective": 0.3141757845878601, + "error": 0.138671875, + "gradient_norm": 0.046496689319610596, + "elapsed": 215.2117359638214 + }, + { + "step": 304, + "loss": 0.5782994031906128, + "objective": 0.5782994031906128, + "error": 0.345703125, + "gradient_norm": 0.06487675756216049, + "elapsed": 225.47403240203857 + }, + { + "step": 320, + "loss": 0.45729100704193115, + "objective": 0.45729100704193115, + "error": 0.2255859375, + "gradient_norm": 0.04169687256217003, + "elapsed": 233.03686332702637 + }, + { + "step": 336, + "loss": 0.49350813031196594, + "objective": 0.49350813031196594, + "error": 0.24609375, + "gradient_norm": 0.08623651415109634, + "elapsed": 244.53246903419495 + }, + { + "step": 352, + "loss": 0.25660067796707153, + "objective": 0.25660067796707153, + "error": 0.1103515625, + "gradient_norm": 0.03029652312397957, + "elapsed": 254.88137793540955 + }, + { + "step": 368, + "loss": 0.2295728325843811, + "objective": 0.2295728325843811, + "error": 0.0966796875, + "gradient_norm": 0.042884912341833115, + "elapsed": 262.7415475845337 + }, + { + "step": 384, + "loss": 0.6214326620101929, + "objective": 0.6214326620101929, + "error": 0.3759765625, + "gradient_norm": 0.08176509290933609, + "elapsed": 271.72958397865295 + }, + { + "step": 400, + "loss": 0.6463049650192261, + "objective": 0.6463049650192261, + "error": 0.3984375, + "gradient_norm": 0.08226390928030014, + "elapsed": 281.51069259643555 + }, + { + "step": 416, + "loss": 0.024987798184156418, + "objective": 0.024987798184156418, + "error": 0.0078125, + "gradient_norm": 0.0075854891911149025, + "elapsed": 291.0118627548218 + }, + { + "step": 432, + "loss": 0.5520929098129272, + "objective": 0.5520929098129272, + "error": 0.3125, + "gradient_norm": 0.09755270183086395, + "elapsed": 301.23231768608093 + }, + { + "step": 448, + "loss": 0.6077401638031006, + "objective": 0.6077401638031006, + "error": 0.361328125, + "gradient_norm": 0.04908076301217079, + "elapsed": 312.93572759628296 + }, + { + "step": 464, + "loss": 0.016434211283922195, + "objective": 0.016434211283922195, + "error": 0.005859375, + "gradient_norm": 0.007213531993329525, + "elapsed": 323.8330478668213 + }, + { + "step": 480, + "loss": 0.1582300364971161, + "objective": 0.1582300364971161, + "error": 0.064453125, + "gradient_norm": 0.028335656970739365, + "elapsed": 334.6112554073334 + }, + { + "step": 496, + "loss": 0.5916742086410522, + "objective": 0.5916742086410522, + "error": 0.35546875, + "gradient_norm": 0.08213689178228378, + "elapsed": 345.8490369319916 + }, + { + "step": 512, + "loss": 0.11447565257549286, + "objective": 0.11447565257549286, + "error": 0.04296875, + "gradient_norm": 0.028994916006922722, + "elapsed": 358.71793270111084 + }, + { + "step": 528, + "loss": 0.3011414408683777, + "objective": 0.3011414408683777, + "error": 0.1435546875, + "gradient_norm": 0.04305516928434372, + "elapsed": 373.143226146698 + }, + { + "step": 544, + "loss": 0.3099900782108307, + "objective": 0.3099900782108307, + "error": 0.130859375, + "gradient_norm": 0.06152835488319397, + "elapsed": 380.42762184143066 + }, + { + "step": 560, + "loss": 0.42917633056640625, + "objective": 0.42917633056640625, + "error": 0.203125, + "gradient_norm": 0.051812849938869476, + "elapsed": 390.78397703170776 + }, + { + "step": 576, + "loss": 0.4895544648170471, + "objective": 0.4895544648170471, + "error": 0.2451171875, + "gradient_norm": 0.059052009135484695, + "elapsed": 400.29374146461487 + }, + { + "step": 592, + "loss": 0.5950886011123657, + "objective": 0.5950886011123657, + "error": 0.328125, + "gradient_norm": 0.1449151188135147, + "elapsed": 410.06920647621155 + }, + { + "step": 608, + "loss": 0.3282078504562378, + "objective": 0.3282078504562378, + "error": 0.1484375, + "gradient_norm": 0.06495015323162079, + "elapsed": 420.5240683555603 + }, + { + "step": 624, + "loss": 0.6034166812896729, + "objective": 0.6034166812896729, + "error": 0.3388671875, + "gradient_norm": 0.05658626928925514, + "elapsed": 430.7997169494629 + }, + { + "step": 640, + "loss": 0.590431809425354, + "objective": 0.590431809425354, + "error": 0.3447265625, + "gradient_norm": 0.046094730496406555, + "elapsed": 441.8197224140167 + }, + { + "step": 656, + "loss": 0.2260439246892929, + "objective": 0.2260439246892929, + "error": 0.1015625, + "gradient_norm": 0.06323576718568802, + "elapsed": 450.76086831092834 + }, + { + "step": 672, + "loss": 0.26158156991004944, + "objective": 0.26158156991004944, + "error": 0.1162109375, + "gradient_norm": 0.08324819058179855, + "elapsed": 459.1986529827118 + }, + { + "step": 688, + "loss": 0.4871026873588562, + "objective": 0.4871026873588562, + "error": 0.244140625, + "gradient_norm": 0.051720812916755676, + "elapsed": 470.4437210559845 + }, + { + "step": 704, + "loss": 0.5861694812774658, + "objective": 0.5861694812774658, + "error": 0.341796875, + "gradient_norm": 0.05766218528151512, + "elapsed": 483.85575103759766 + }, + { + "step": 720, + "loss": 0.4168863296508789, + "objective": 0.4168863296508789, + "error": 0.21484375, + "gradient_norm": 0.05056491494178772, + "elapsed": 494.63891077041626 + }, + { + "step": 736, + "loss": 0.42054638266563416, + "objective": 0.42054638266563416, + "error": 0.21875, + "gradient_norm": 0.07021808624267578, + "elapsed": 505.4899232387543 + }, + { + "step": 752, + "loss": 0.2022928148508072, + "objective": 0.2022928148508072, + "error": 0.0849609375, + "gradient_norm": 0.0765448734164238, + "elapsed": 516.2925503253937 + }, + { + "step": 768, + "loss": 0.026398655027151108, + "objective": 0.026398655027151108, + "error": 0.0068359375, + "gradient_norm": 0.00973521638661623, + "elapsed": 524.7940125465393 + }, + { + "step": 784, + "loss": 0.5843480825424194, + "objective": 0.5843480825424194, + "error": 0.345703125, + "gradient_norm": 0.04805552959442139, + "elapsed": 535.345025062561 + }, + { + "step": 800, + "loss": 0.3102012872695923, + "objective": 0.3102012872695923, + "error": 0.134765625, + "gradient_norm": 0.09761057049036026, + "elapsed": 544.4683487415314 + }, + { + "step": 816, + "loss": 0.5332639217376709, + "objective": 0.5332639217376709, + "error": 0.30078125, + "gradient_norm": 0.10398133844137192, + "elapsed": 554.8217175006866 + }, + { + "step": 832, + "loss": 0.4870310425758362, + "objective": 0.4870310425758362, + "error": 0.2685546875, + "gradient_norm": 0.05754273384809494, + "elapsed": 564.9130115509033 + }, + { + "step": 848, + "loss": 0.1336989849805832, + "objective": 0.1336989849805832, + "error": 0.0498046875, + "gradient_norm": 0.02862304449081421, + "elapsed": 573.6143791675568 + }, + { + "step": 864, + "loss": 0.5794297456741333, + "objective": 0.5794297456741333, + "error": 0.3427734375, + "gradient_norm": 0.05002075806260109, + "elapsed": 584.2565310001373 + }, + { + "step": 880, + "loss": 0.6150081753730774, + "objective": 0.6150081753730774, + "error": 0.341796875, + "gradient_norm": 0.0605069138109684, + "elapsed": 596.845867395401 + }, + { + "step": 896, + "loss": 0.3804032504558563, + "objective": 0.3804032504558563, + "error": 0.18359375, + "gradient_norm": 0.057405781000852585, + "elapsed": 606.0786938667297 + }, + { + "step": 912, + "loss": 0.5734928846359253, + "objective": 0.5734928846359253, + "error": 0.2958984375, + "gradient_norm": 0.06807747483253479, + "elapsed": 616.9755277633667 + }, + { + "step": 928, + "loss": 0.23615539073944092, + "objective": 0.23615539073944092, + "error": 0.107421875, + "gradient_norm": 0.04033413156867027, + "elapsed": 625.9104406833649 + }, + { + "step": 944, + "loss": 0.5668450593948364, + "objective": 0.5668450593948364, + "error": 0.3134765625, + "gradient_norm": 0.04825817048549652, + "elapsed": 635.4241654872894 + }, + { + "step": 960, + "loss": 0.1369795948266983, + "objective": 0.1369795948266983, + "error": 0.0537109375, + "gradient_norm": 0.029475854709744453, + "elapsed": 646.0763671398163 + }, + { + "step": 976, + "loss": 0.026218727231025696, + "objective": 0.026218727231025696, + "error": 0.009765625, + "gradient_norm": 0.0067830472253263, + "elapsed": 656.7150173187256 + }, + { + "step": 992, + "loss": 0.6016548871994019, + "objective": 0.6016548871994019, + "error": 0.3564453125, + "gradient_norm": 0.04935981705784798, + "elapsed": 668.9989516735077 + }, + { + "step": 1008, + "loss": 0.1370980143547058, + "objective": 0.1370980143547058, + "error": 0.0546875, + "gradient_norm": 0.04418199881911278, + "elapsed": 677.3821382522583 + }, + { + "step": 1024, + "loss": 0.4085504412651062, + "objective": 0.4085504412651062, + "error": 0.19921875, + "gradient_norm": 0.07943295687437057, + "elapsed": 688.8395888805389 + }, + { + "step": 1040, + "loss": 0.34129297733306885, + "objective": 0.34129297733306885, + "error": 0.15625, + "gradient_norm": 0.04551500454545021, + "elapsed": 703.4613966941833 + }, + { + "step": 1056, + "loss": 0.5297085046768188, + "objective": 0.5297085046768188, + "error": 0.2705078125, + "gradient_norm": 0.06177444010972977, + "elapsed": 714.0862259864807 + }, + { + "step": 1072, + "loss": 0.3833361268043518, + "objective": 0.3833361268043518, + "error": 0.185546875, + "gradient_norm": 0.053057629615068436, + "elapsed": 724.1480000019073 + }, + { + "step": 1088, + "loss": 0.6497273445129395, + "objective": 0.6497273445129395, + "error": 0.421875, + "gradient_norm": 0.10790837556123734, + "elapsed": 735.8740057945251 + }, + { + "step": 1104, + "loss": 0.5393906831741333, + "objective": 0.5393906831741333, + "error": 0.2998046875, + "gradient_norm": 0.06015805900096893, + "elapsed": 743.9961709976196 + }, + { + "step": 1120, + "loss": 0.38553956151008606, + "objective": 0.38553956151008606, + "error": 0.1875, + "gradient_norm": 0.05357081815600395, + "elapsed": 753.2208635807037 + }, + { + "step": 1136, + "loss": 0.5478834509849548, + "objective": 0.5478834509849548, + "error": 0.2900390625, + "gradient_norm": 0.05761478468775749, + "elapsed": 761.3359644412994 + }, + { + "step": 1152, + "loss": 0.5732287168502808, + "objective": 0.5732287168502808, + "error": 0.341796875, + "gradient_norm": 0.07881136238574982, + "elapsed": 771.133172750473 + }, + { + "step": 1168, + "loss": 0.5174047946929932, + "objective": 0.5174047946929932, + "error": 0.29296875, + "gradient_norm": 0.07794999331235886, + "elapsed": 783.7084786891937 + }, + { + "step": 1184, + "loss": 0.5022754669189453, + "objective": 0.5022754669189453, + "error": 0.265625, + "gradient_norm": 0.05175226181745529, + "elapsed": 793.499255657196 + }, + { + "step": 1200, + "loss": 0.5698775053024292, + "objective": 0.5698775053024292, + "error": 0.34375, + "gradient_norm": 0.06385946273803711, + "elapsed": 804.970814704895 + }, + { + "step": 1216, + "loss": 0.6203033924102783, + "objective": 0.6203033924102783, + "error": 0.37109375, + "gradient_norm": 0.07393646240234375, + "elapsed": 816.1773698329926 + }, + { + "step": 1232, + "loss": 0.6154648065567017, + "objective": 0.6154648065567017, + "error": 0.3857421875, + "gradient_norm": 0.04278155043721199, + "elapsed": 827.3619928359985 + }, + { + "step": 1248, + "loss": 0.5948328971862793, + "objective": 0.5948328971862793, + "error": 0.3291015625, + "gradient_norm": 0.062024734914302826, + "elapsed": 838.8370804786682 + }, + { + "step": 1264, + "loss": 0.5644958019256592, + "objective": 0.5644958019256592, + "error": 0.3212890625, + "gradient_norm": 0.12030917406082153, + "elapsed": 849.5000331401825 + }, + { + "step": 1280, + "loss": 0.028782427310943604, + "objective": 0.028782427310943604, + "error": 0.0087890625, + "gradient_norm": 0.009096251800656319, + "elapsed": 857.8837285041809 + }, + { + "step": 1296, + "loss": 0.5129679441452026, + "objective": 0.5129679441452026, + "error": 0.2626953125, + "gradient_norm": 0.12833116948604584, + "elapsed": 868.5195860862732 + }, + { + "step": 1312, + "loss": 0.4095553159713745, + "objective": 0.4095553159713745, + "error": 0.193359375, + "gradient_norm": 0.09977155178785324, + "elapsed": 877.4712297916412 + }, + { + "step": 1328, + "loss": 0.2850862741470337, + "objective": 0.2850862741470337, + "error": 0.1240234375, + "gradient_norm": 0.05365074798464775, + "elapsed": 887.5133347511292 + }, + { + "step": 1344, + "loss": 0.41809165477752686, + "objective": 0.41809165477752686, + "error": 0.19140625, + "gradient_norm": 0.10622142255306244, + "elapsed": 895.0828025341034 + }, + { + "step": 1360, + "loss": 0.3627069890499115, + "objective": 0.3627069890499115, + "error": 0.1650390625, + "gradient_norm": 0.049557290971279144, + "elapsed": 906.2595431804657 + }, + { + "step": 1376, + "loss": 0.023341629654169083, + "objective": 0.023341629654169083, + "error": 0.0068359375, + "gradient_norm": 0.008970360271632671, + "elapsed": 916.6110022068024 + }, + { + "step": 1392, + "loss": 0.519214391708374, + "objective": 0.519214391708374, + "error": 0.26953125, + "gradient_norm": 0.052287619560956955, + "elapsed": 926.660523891449 + }, + { + "step": 1408, + "loss": 0.6152850389480591, + "objective": 0.6152850389480591, + "error": 0.3662109375, + "gradient_norm": 0.049617987126111984, + "elapsed": 936.7533056735992 + }, + { + "step": 1424, + "loss": 0.020841240882873535, + "objective": 0.020841240882873535, + "error": 0.0068359375, + "gradient_norm": 0.008459246717393398, + "elapsed": 946.8231542110443 + }, + { + "step": 1440, + "loss": 0.5963407754898071, + "objective": 0.5963407754898071, + "error": 0.3525390625, + "gradient_norm": 0.08714025467634201, + "elapsed": 956.0344398021698 + }, + { + "step": 1456, + "loss": 0.44305220246315, + "objective": 0.44305220246315, + "error": 0.2099609375, + "gradient_norm": 0.061915796250104904, + "elapsed": 967.506050825119 + }, + { + "step": 1472, + "loss": 0.5292993783950806, + "objective": 0.5292993783950806, + "error": 0.2939453125, + "gradient_norm": 0.10089804977178574, + "elapsed": 977.855934381485 + }, + { + "step": 1488, + "loss": 0.6087026596069336, + "objective": 0.6087026596069336, + "error": 0.345703125, + "gradient_norm": 0.05276322737336159, + "elapsed": 986.2705359458923 + }, + { + "step": 1504, + "loss": 0.3670162558555603, + "objective": 0.3670162558555603, + "error": 0.1796875, + "gradient_norm": 0.0575372576713562, + "elapsed": 995.2220902442932 + }, + { + "step": 1520, + "loss": 0.33479321002960205, + "objective": 0.33479321002960205, + "error": 0.1435546875, + "gradient_norm": 0.056317709386348724, + "elapsed": 1005.2168045043945 + }, + { + "step": 1536, + "loss": 0.5869293212890625, + "objective": 0.5869293212890625, + "error": 0.337890625, + "gradient_norm": 0.07419256865978241, + "elapsed": 1016.8691458702087 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved2_full", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "0f5926c94bb1aa83840c6d257757b80c081835affc2cb34bf9246ba18e00266a", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 512, + 1024, + 1536 + ], + "training_draws": 1572864, + "distinct_phase_training_rows": 467790, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18254, + "surface_code_bX_d5_r03_center_5_5": 18525, + "surface_code_bX_d5_r05_center_5_5": 18175, + "surface_code_bX_d5_r07_center_5_5": 18005, + "surface_code_bX_d5_r09_center_5_5": 18067, + "surface_code_bX_d5_r11_center_5_5": 18445, + "surface_code_bX_d5_r13_center_5_5": 18673, + "surface_code_bX_d5_r15_center_5_5": 17345, + "surface_code_bX_d5_r17_center_5_5": 17898, + "surface_code_bX_d5_r19_center_5_5": 18359, + "surface_code_bX_d5_r21_center_5_5": 18036, + "surface_code_bX_d5_r23_center_5_5": 17255, + "surface_code_bX_d5_r25_center_5_5": 18057, + "surface_code_bZ_d5_r01_center_5_5": 17596, + "surface_code_bZ_d5_r03_center_5_5": 18333, + "surface_code_bZ_d5_r05_center_5_5": 18250, + "surface_code_bZ_d5_r07_center_5_5": 18210, + "surface_code_bZ_d5_r09_center_5_5": 17447, + "surface_code_bZ_d5_r11_center_5_5": 18120, + "surface_code_bZ_d5_r13_center_5_5": 18224, + "surface_code_bZ_d5_r15_center_5_5": 17857, + "surface_code_bZ_d5_r17_center_5_5": 18359, + "surface_code_bZ_d5_r19_center_5_5": 17398, + "surface_code_bZ_d5_r21_center_5_5": 18235, + "surface_code_bZ_d5_r23_center_5_5": 16653, + "surface_code_bZ_d5_r25_center_5_5": 18014 + }, + "initial_optimizer_count": 512, + "last_optimizer_count": 2048, + "parent_checkpoint_sha256": "2b00e3f258886b5c4ecf69f36fd5463a205eefc84bd10c550acc391e84515c24", + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "source_reference_package": "/run-state/workspace/research/context_upgrades/neural_d5_full3_swa/package", + "original_training_provenance": { + "training": { + "initialization": "Uniform parameter averages of checkpoints from the same session-initialized training trajectory; no external weights", + "prior_pass": 3, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "hidden_width": 64, + "training": "No new optimizer updates; all learning comes from the recorded source trajectory and its session-trained parent", + "optimizer_updates_in_derived_run": 0, + "source_training_provenance": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "training_source_sha256": { + "learned_d5__train.py": "b73af9da21332dee9a43f653b514695b020fbc3516604b2e721d8cf0ea876d53", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "5e9420df1f6dd56518925e910096fb9bc93bd796a5933b13bf894a1a96256cdf", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "All supplied training shots per each of all26 d5 conditions; uniform condition and within-condition sampling for optimizer batches.", + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 516880, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 507282, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 19592, + "surface_code_bX_d5_r03_center_5_5": 19646, + "surface_code_bX_d5_r05_center_5_5": 19513, + "surface_code_bX_d5_r07_center_5_5": 19341, + "surface_code_bX_d5_r09_center_5_5": 19211, + "surface_code_bX_d5_r11_center_5_5": 19239, + "surface_code_bX_d5_r13_center_5_5": 19679, + "surface_code_bX_d5_r15_center_5_5": 19455, + "surface_code_bX_d5_r17_center_5_5": 19479, + "surface_code_bX_d5_r19_center_5_5": 19479, + "surface_code_bX_d5_r21_center_5_5": 19551, + "surface_code_bX_d5_r23_center_5_5": 19586, + "surface_code_bX_d5_r25_center_5_5": 19526, + "surface_code_bZ_d5_r01_center_5_5": 19652, + "surface_code_bZ_d5_r03_center_5_5": 19732, + "surface_code_bZ_d5_r05_center_5_5": 19754, + "surface_code_bZ_d5_r07_center_5_5": 19194, + "surface_code_bZ_d5_r09_center_5_5": 19641, + "surface_code_bZ_d5_r11_center_5_5": 19611, + "surface_code_bZ_d5_r13_center_5_5": 19424, + "surface_code_bZ_d5_r15_center_5_5": 19380, + "surface_code_bZ_d5_r17_center_5_5": 19384, + "surface_code_bZ_d5_r19_center_5_5": 19684, + "surface_code_bZ_d5_r21_center_5_5": 19559, + "surface_code_bZ_d5_r23_center_5_5": 19524, + "surface_code_bZ_d5_r25_center_5_5": 19446 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 2048, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261113, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "sampling_state_source": "/run-state/workspace/research/learned_d5/feedback3_pilot/rng-768.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/feedback3_pilot/weights-768.npz", + "starting_checkpoint_sha256": "bc2ba1c529317ce1b5b661efae4707eca49c6995d6f22b04193fe7642662fed8", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261108", + "prior_pass": 3, + "initial_seed": 20261108, + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "4096 training shots per each of all 26 d5 conditions, sampled without replacement with seed 20261023. Uniform condition and within-condition sampling for optimizer batches.", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1024, + "batch": 256, + "learning_rate": 0.001, + "sampling_seed": 20261108, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "starting_checkpoint": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.011146659031510353, + "error": 0.00390625, + "gradient_norm": 0.011240893043577671, + "elapsed": 21.276997089385986 + }, + { + "step": 16, + "loss": 0.645737886428833, + "error": 0.40625, + "gradient_norm": 0.1628236621618271, + "elapsed": 25.872907638549805 + }, + { + "step": 32, + "loss": 0.574029803276062, + "error": 0.35546875, + "gradient_norm": 0.3000081777572632, + "elapsed": 30.761418342590332 + }, + { + "step": 48, + "loss": 0.574467122554779, + "error": 0.296875, + "gradient_norm": 0.24150623381137848, + "elapsed": 35.67650651931763 + }, + { + "step": 64, + "loss": 0.6003620624542236, + "error": 0.35546875, + "gradient_norm": 0.07430054992437363, + "elapsed": 40.60572576522827 + }, + { + "step": 80, + "loss": 0.5429091453552246, + "error": 0.33203125, + "gradient_norm": 0.15341751277446747, + "elapsed": 45.546849727630615 + }, + { + "step": 96, + "loss": 0.368771493434906, + "error": 0.1640625, + "gradient_norm": 0.08923184871673584, + "elapsed": 50.49156332015991 + }, + { + "step": 112, + "loss": 0.516342043876648, + "error": 0.265625, + "gradient_norm": 0.10965219140052795, + "elapsed": 55.45058846473694 + }, + { + "step": 128, + "loss": 0.5925382971763611, + "error": 0.37109375, + "gradient_norm": 0.055406324565410614, + "elapsed": 60.40891766548157 + }, + { + "step": 144, + "loss": 0.19184258580207825, + "error": 0.07421875, + "gradient_norm": 0.07042146474123001, + "elapsed": 65.33323669433594 + }, + { + "step": 160, + "loss": 0.5202382206916809, + "error": 0.25390625, + "gradient_norm": 0.14782382547855377, + "elapsed": 70.26605796813965 + }, + { + "step": 176, + "loss": 0.46083134412765503, + "error": 0.22265625, + "gradient_norm": 0.09074779599905014, + "elapsed": 75.18221640586853 + }, + { + "step": 192, + "loss": 0.3054918646812439, + "error": 0.14453125, + "gradient_norm": 0.0588168129324913, + "elapsed": 80.1186010837555 + }, + { + "step": 208, + "loss": 0.4836011230945587, + "error": 0.27734375, + "gradient_norm": 0.09208947420120239, + "elapsed": 85.05764293670654 + }, + { + "step": 224, + "loss": 0.6640600562095642, + "error": 0.38671875, + "gradient_norm": 0.22026506066322327, + "elapsed": 89.98808217048645 + }, + { + "step": 240, + "loss": 0.02421322464942932, + "error": 0.00390625, + "gradient_norm": 0.008131005801260471, + "elapsed": 94.90194272994995 + }, + { + "step": 256, + "loss": 0.6302106976509094, + "error": 0.4296875, + "gradient_norm": 0.09762304276227951, + "elapsed": 99.82612204551697 + }, + { + "step": 272, + "loss": 0.5092596411705017, + "error": 0.27734375, + "gradient_norm": 0.11407691985368729, + "elapsed": 110.44065999984741 + }, + { + "step": 288, + "loss": 0.452798455953598, + "error": 0.2265625, + "gradient_norm": 0.1105576679110527, + "elapsed": 115.36984539031982 + }, + { + "step": 304, + "loss": 0.3378596305847168, + "error": 0.18359375, + "gradient_norm": 0.0841713547706604, + "elapsed": 120.29337763786316 + }, + { + "step": 320, + "loss": 0.6271854639053345, + "error": 0.38671875, + "gradient_norm": 0.1972702294588089, + "elapsed": 125.2231035232544 + }, + { + "step": 336, + "loss": 0.04562236741185188, + "error": 0.01171875, + "gradient_norm": 0.027922745794057846, + "elapsed": 130.14725255966187 + }, + { + "step": 352, + "loss": 0.5342530608177185, + "error": 0.26953125, + "gradient_norm": 0.09031179547309875, + "elapsed": 135.08111095428467 + }, + { + "step": 368, + "loss": 0.49785488843917847, + "error": 0.2578125, + "gradient_norm": 0.19366280734539032, + "elapsed": 140.00699138641357 + }, + { + "step": 384, + "loss": 0.5673326253890991, + "error": 0.30859375, + "gradient_norm": 0.20644932985305786, + "elapsed": 144.92276740074158 + }, + { + "step": 400, + "loss": 0.5581298470497131, + "error": 0.3203125, + "gradient_norm": 0.17668266594409943, + "elapsed": 149.86573243141174 + }, + { + "step": 416, + "loss": 0.5564071536064148, + "error": 0.30078125, + "gradient_norm": 0.0821610689163208, + "elapsed": 154.7953712940216 + }, + { + "step": 432, + "loss": 0.5540086030960083, + "error": 0.34765625, + "gradient_norm": 0.1438807100057602, + "elapsed": 159.72657418251038 + }, + { + "step": 448, + "loss": 0.540939450263977, + "error": 0.29296875, + "gradient_norm": 0.17986361682415009, + "elapsed": 164.6689453125 + }, + { + "step": 464, + "loss": 0.45807865262031555, + "error": 0.25, + "gradient_norm": 0.14453186094760895, + "elapsed": 169.58739304542542 + }, + { + "step": 480, + "loss": 0.5191650390625, + "error": 0.22265625, + "gradient_norm": 0.07955105602741241, + "elapsed": 174.5444438457489 + }, + { + "step": 496, + "loss": 0.1692925989627838, + "error": 0.0703125, + "gradient_norm": 0.07875128090381622, + "elapsed": 179.48035550117493 + }, + { + "step": 512, + "loss": 0.5580664873123169, + "error": 0.3125, + "gradient_norm": 0.27090802788734436, + "elapsed": 184.42834162712097 + }, + { + "step": 528, + "loss": 0.26402050256729126, + "error": 0.13671875, + "gradient_norm": 0.13135771453380585, + "elapsed": 195.17691040039062 + }, + { + "step": 544, + "loss": 0.4352915287017822, + "error": 0.1953125, + "gradient_norm": 0.15959712862968445, + "elapsed": 200.0421543121338 + }, + { + "step": 560, + "loss": 0.22861814498901367, + "error": 0.1015625, + "gradient_norm": 0.08776932209730148, + "elapsed": 204.95144605636597 + }, + { + "step": 576, + "loss": 0.28309381008148193, + "error": 0.1328125, + "gradient_norm": 0.11050742119550705, + "elapsed": 209.8526291847229 + }, + { + "step": 592, + "loss": 0.6409220695495605, + "error": 0.41015625, + "gradient_norm": 0.19826626777648926, + "elapsed": 214.84447717666626 + }, + { + "step": 608, + "loss": 0.25090643763542175, + "error": 0.109375, + "gradient_norm": 0.05864342302083969, + "elapsed": 219.72637391090393 + }, + { + "step": 624, + "loss": 0.11423969268798828, + "error": 0.05078125, + "gradient_norm": 0.05318564549088478, + "elapsed": 224.6331377029419 + }, + { + "step": 640, + "loss": 0.32663431763648987, + "error": 0.1328125, + "gradient_norm": 0.06877780705690384, + "elapsed": 229.5065622329712 + }, + { + "step": 656, + "loss": 0.24196995794773102, + "error": 0.10546875, + "gradient_norm": 0.07683655619621277, + "elapsed": 234.4042534828186 + }, + { + "step": 672, + "loss": 0.5349344611167908, + "error": 0.296875, + "gradient_norm": 0.15214307606220245, + "elapsed": 239.26656579971313 + }, + { + "step": 688, + "loss": 0.26759713888168335, + "error": 0.1171875, + "gradient_norm": 0.14698348939418793, + "elapsed": 244.21049737930298 + }, + { + "step": 704, + "loss": 0.37338894605636597, + "error": 0.18359375, + "gradient_norm": 0.10210632532835007, + "elapsed": 249.13519072532654 + }, + { + "step": 720, + "loss": 0.36807945370674133, + "error": 0.17578125, + "gradient_norm": 0.09668388962745667, + "elapsed": 254.06281065940857 + }, + { + "step": 736, + "loss": 0.3736685514450073, + "error": 0.15625, + "gradient_norm": 0.10987236350774765, + "elapsed": 259.01695108413696 + }, + { + "step": 752, + "loss": 0.5266942977905273, + "error": 0.29296875, + "gradient_norm": 0.09041415899991989, + "elapsed": 263.9530746936798 + }, + { + "step": 768, + "loss": 0.360038161277771, + "error": 0.1640625, + "gradient_norm": 0.10391079634428024, + "elapsed": 268.9019305706024 + }, + { + "step": 784, + "loss": 0.5700286626815796, + "error": 0.34375, + "gradient_norm": 0.12206032127141953, + "elapsed": 279.4174163341522 + }, + { + "step": 800, + "loss": 0.42533689737319946, + "error": 0.20703125, + "gradient_norm": 0.06605375558137894, + "elapsed": 284.3391351699829 + }, + { + "step": 816, + "loss": 0.12355346977710724, + "error": 0.046875, + "gradient_norm": 0.06571663916110992, + "elapsed": 289.2815272808075 + }, + { + "step": 832, + "loss": 0.6411258578300476, + "error": 0.3984375, + "gradient_norm": 0.160088911652565, + "elapsed": 294.2048614025116 + }, + { + "step": 848, + "loss": 0.5756919980049133, + "error": 0.3515625, + "gradient_norm": 0.0962308868765831, + "elapsed": 299.15635418891907 + }, + { + "step": 864, + "loss": 0.2706402540206909, + "error": 0.1171875, + "gradient_norm": 0.11391306668519974, + "elapsed": 304.09321761131287 + }, + { + "step": 880, + "loss": 0.33621329069137573, + "error": 0.1640625, + "gradient_norm": 0.09049320220947266, + "elapsed": 309.0412187576294 + }, + { + "step": 896, + "loss": 0.44343245029449463, + "error": 0.23828125, + "gradient_norm": 0.12484703958034515, + "elapsed": 313.98498797416687 + }, + { + "step": 912, + "loss": 0.5987736582756042, + "error": 0.359375, + "gradient_norm": 0.07541236281394958, + "elapsed": 318.9334623813629 + }, + { + "step": 928, + "loss": 0.38585522770881653, + "error": 0.1875, + "gradient_norm": 0.09290861338376999, + "elapsed": 323.86884689331055 + }, + { + "step": 944, + "loss": 0.4820440113544464, + "error": 0.234375, + "gradient_norm": 0.22198310494422913, + "elapsed": 328.7963180541992 + }, + { + "step": 960, + "loss": 0.07455944269895554, + "error": 0.015625, + "gradient_norm": 0.055282026529312134, + "elapsed": 333.75238251686096 + }, + { + "step": 976, + "loss": 0.013475366868078709, + "error": 0.0078125, + "gradient_norm": 0.009843004867434502, + "elapsed": 338.6403331756592 + }, + { + "step": 992, + "loss": 0.4429199695587158, + "error": 0.2265625, + "gradient_norm": 0.09489083290100098, + "elapsed": 343.5606532096863 + }, + { + "step": 1008, + "loss": 0.4892328381538391, + "error": 0.234375, + "gradient_norm": 0.1342826634645462, + "elapsed": 348.5243353843689 + }, + { + "step": 1024, + "loss": 0.6096819043159485, + "error": 0.32421875, + "gradient_norm": 0.17938998341560364, + "elapsed": 353.36506962776184 + } + ] + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.4341062307357788, + "objective": 0.4341062307357788, + "error": 0.208984375, + "gradient_norm": 0.07617632299661636, + "elapsed": 31.45817995071411 + }, + { + "step": 16, + "loss": 0.5996706485748291, + "objective": 0.5996706485748291, + "error": 0.359375, + "gradient_norm": 0.05249844491481781, + "elapsed": 56.34200572967529 + }, + { + "step": 32, + "loss": 0.4388691186904907, + "objective": 0.4388691186904907, + "error": 0.2041015625, + "gradient_norm": 0.0376109778881073, + "elapsed": 67.83739852905273 + }, + { + "step": 48, + "loss": 0.5373439788818359, + "objective": 0.5373439788818359, + "error": 0.2919921875, + "gradient_norm": 0.06261218339204788, + "elapsed": 76.69065475463867 + }, + { + "step": 64, + "loss": 0.24871854484081268, + "objective": 0.24871854484081268, + "error": 0.1162109375, + "gradient_norm": 0.05284671485424042, + "elapsed": 86.3852767944336 + }, + { + "step": 80, + "loss": 0.26628297567367554, + "objective": 0.26628297567367554, + "error": 0.123046875, + "gradient_norm": 0.04054367542266846, + "elapsed": 95.77356100082397 + }, + { + "step": 96, + "loss": 0.48436349630355835, + "objective": 0.48436349630355835, + "error": 0.259765625, + "gradient_norm": 0.05399860441684723, + "elapsed": 107.06293416023254 + }, + { + "step": 112, + "loss": 0.41063767671585083, + "objective": 0.41063767671585083, + "error": 0.1943359375, + "gradient_norm": 0.043602071702480316, + "elapsed": 116.78119611740112 + }, + { + "step": 128, + "loss": 0.3990316390991211, + "objective": 0.3990316390991211, + "error": 0.1865234375, + "gradient_norm": 0.0424419641494751, + "elapsed": 125.6915397644043 + }, + { + "step": 144, + "loss": 0.5119550228118896, + "objective": 0.5119550228118896, + "error": 0.2646484375, + "gradient_norm": 0.07688591629266739, + "elapsed": 136.20711088180542 + }, + { + "step": 160, + "loss": 0.3388235569000244, + "objective": 0.3388235569000244, + "error": 0.1630859375, + "gradient_norm": 0.07015731930732727, + "elapsed": 145.3505516052246 + }, + { + "step": 176, + "loss": 0.5952156186103821, + "objective": 0.5952156186103821, + "error": 0.3369140625, + "gradient_norm": 0.039373140782117844, + "elapsed": 154.77994871139526 + }, + { + "step": 192, + "loss": 0.15157413482666016, + "objective": 0.15157413482666016, + "error": 0.0634765625, + "gradient_norm": 0.029710670933127403, + "elapsed": 164.46801733970642 + }, + { + "step": 208, + "loss": 0.3120684027671814, + "objective": 0.3120684027671814, + "error": 0.1474609375, + "gradient_norm": 0.035548821091651917, + "elapsed": 173.24825358390808 + }, + { + "step": 224, + "loss": 0.5486405491828918, + "objective": 0.5486405491828918, + "error": 0.2900390625, + "gradient_norm": 0.0503678023815155, + "elapsed": 185.29849314689636 + }, + { + "step": 240, + "loss": 0.6046283841133118, + "objective": 0.6046283841133118, + "error": 0.3349609375, + "gradient_norm": 0.05043461173772812, + "elapsed": 197.54880928993225 + }, + { + "step": 256, + "loss": 0.5926339626312256, + "objective": 0.5926339626312256, + "error": 0.3359375, + "gradient_norm": 0.051241543143987656, + "elapsed": 211.79861068725586 + }, + { + "step": 272, + "loss": 0.4018518924713135, + "objective": 0.4018518924713135, + "error": 0.1943359375, + "gradient_norm": 0.0772147998213768, + "elapsed": 222.41974115371704 + }, + { + "step": 288, + "loss": 0.13863243162631989, + "objective": 0.13863243162631989, + "error": 0.0556640625, + "gradient_norm": 0.03334609419107437, + "elapsed": 234.04247426986694 + }, + { + "step": 304, + "loss": 0.562490701675415, + "objective": 0.562490701675415, + "error": 0.337890625, + "gradient_norm": 0.04585934057831764, + "elapsed": 242.65421533584595 + }, + { + "step": 320, + "loss": 0.5352796316146851, + "objective": 0.5352796316146851, + "error": 0.294921875, + "gradient_norm": 0.0837635025382042, + "elapsed": 252.10656356811523 + }, + { + "step": 336, + "loss": 0.26082637906074524, + "objective": 0.26082637906074524, + "error": 0.1220703125, + "gradient_norm": 0.048336997628211975, + "elapsed": 262.33449625968933 + }, + { + "step": 352, + "loss": 0.5959363579750061, + "objective": 0.5959363579750061, + "error": 0.3388671875, + "gradient_norm": 0.06797357648611069, + "elapsed": 271.9942307472229 + }, + { + "step": 368, + "loss": 0.48994284868240356, + "objective": 0.48994284868240356, + "error": 0.2587890625, + "gradient_norm": 0.06296153366565704, + "elapsed": 283.0493588447571 + }, + { + "step": 384, + "loss": 0.5710494518280029, + "objective": 0.5710494518280029, + "error": 0.3134765625, + "gradient_norm": 0.045333269983530045, + "elapsed": 294.64637446403503 + }, + { + "step": 400, + "loss": 0.5957783460617065, + "objective": 0.5957783460617065, + "error": 0.349609375, + "gradient_norm": 0.03918786719441414, + "elapsed": 307.6200888156891 + }, + { + "step": 416, + "loss": 0.27521568536758423, + "objective": 0.27521568536758423, + "error": 0.1220703125, + "gradient_norm": 0.038001637905836105, + "elapsed": 317.01610231399536 + }, + { + "step": 432, + "loss": 0.02379823848605156, + "objective": 0.02379823848605156, + "error": 0.0078125, + "gradient_norm": 0.007661945186555386, + "elapsed": 326.9360330104828 + }, + { + "step": 448, + "loss": 0.56734299659729, + "objective": 0.56734299659729, + "error": 0.3271484375, + "gradient_norm": 0.057416290044784546, + "elapsed": 339.6289041042328 + }, + { + "step": 464, + "loss": 0.10715995728969574, + "objective": 0.10715995728969574, + "error": 0.0380859375, + "gradient_norm": 0.02532491274178028, + "elapsed": 349.8584108352661 + }, + { + "step": 480, + "loss": 0.6143364310264587, + "objective": 0.6143364310264587, + "error": 0.36328125, + "gradient_norm": 0.08023032546043396, + "elapsed": 360.36362075805664 + }, + { + "step": 496, + "loss": 0.44069671630859375, + "objective": 0.44069671630859375, + "error": 0.2197265625, + "gradient_norm": 0.048025116324424744, + "elapsed": 369.48225808143616 + }, + { + "step": 512, + "loss": 0.019900165498256683, + "objective": 0.019900165498256683, + "error": 0.0107421875, + "gradient_norm": 0.0038635791279375553, + "elapsed": 378.59970593452454 + }, + { + "step": 528, + "loss": 0.033316534012556076, + "objective": 0.033316534012556076, + "error": 0.009765625, + "gradient_norm": 0.009174940176308155, + "elapsed": 393.4021761417389 + }, + { + "step": 544, + "loss": 0.41130945086479187, + "objective": 0.41130945086479187, + "error": 0.20703125, + "gradient_norm": 0.04695262759923935, + "elapsed": 402.8586280345917 + }, + { + "step": 560, + "loss": 0.5885373950004578, + "objective": 0.5885373950004578, + "error": 0.3544921875, + "gradient_norm": 0.08534500002861023, + "elapsed": 416.98661041259766 + }, + { + "step": 576, + "loss": 0.3804720640182495, + "objective": 0.3804720640182495, + "error": 0.19140625, + "gradient_norm": 0.05163278803229332, + "elapsed": 427.7550480365753 + }, + { + "step": 592, + "loss": 0.6101120710372925, + "objective": 0.6101120710372925, + "error": 0.3525390625, + "gradient_norm": 0.05593184754252434, + "elapsed": 441.05026268959045 + }, + { + "step": 608, + "loss": 0.5586092472076416, + "objective": 0.5586092472076416, + "error": 0.302734375, + "gradient_norm": 0.07458740472793579, + "elapsed": 452.95383286476135 + }, + { + "step": 624, + "loss": 0.5992780923843384, + "objective": 0.5992780923843384, + "error": 0.357421875, + "gradient_norm": 0.03618372976779938, + "elapsed": 466.1582691669464 + }, + { + "step": 640, + "loss": 0.3536975383758545, + "objective": 0.3536975383758545, + "error": 0.1650390625, + "gradient_norm": 0.05353165790438652, + "elapsed": 477.166255235672 + }, + { + "step": 656, + "loss": 0.4926893711090088, + "objective": 0.4926893711090088, + "error": 0.2626953125, + "gradient_norm": 0.05201377719640732, + "elapsed": 491.1417751312256 + }, + { + "step": 672, + "loss": 0.5754991173744202, + "objective": 0.5754991173744202, + "error": 0.3271484375, + "gradient_norm": 0.08167096972465515, + "elapsed": 501.630366563797 + }, + { + "step": 688, + "loss": 0.5685014724731445, + "objective": 0.5685014724731445, + "error": 0.333984375, + "gradient_norm": 0.043775107711553574, + "elapsed": 514.2880456447601 + }, + { + "step": 704, + "loss": 0.022465089336037636, + "objective": 0.022465089336037636, + "error": 0.0068359375, + "gradient_norm": 0.010172540321946144, + "elapsed": 522.9173214435577 + }, + { + "step": 720, + "loss": 0.035460107028484344, + "objective": 0.035460107028484344, + "error": 0.0107421875, + "gradient_norm": 0.010515578091144562, + "elapsed": 532.8470129966736 + }, + { + "step": 736, + "loss": 0.44765588641166687, + "objective": 0.44765588641166687, + "error": 0.2138671875, + "gradient_norm": 0.09050357341766357, + "elapsed": 541.9488840103149 + }, + { + "step": 752, + "loss": 0.5933939218521118, + "objective": 0.5933939218521118, + "error": 0.3359375, + "gradient_norm": 0.0665116235613823, + "elapsed": 552.9967355728149 + }, + { + "step": 768, + "loss": 0.6100764870643616, + "objective": 0.6100764870643616, + "error": 0.3515625, + "gradient_norm": 0.0821211114525795, + "elapsed": 563.7709202766418 + }, + { + "step": 784, + "loss": 0.02964692935347557, + "objective": 0.02964692935347557, + "error": 0.009765625, + "gradient_norm": 0.012663272209465504, + "elapsed": 573.1517221927643 + }, + { + "step": 800, + "loss": 0.38091832399368286, + "objective": 0.38091832399368286, + "error": 0.1904296875, + "gradient_norm": 0.060622021555900574, + "elapsed": 582.5687477588654 + }, + { + "step": 816, + "loss": 0.552335262298584, + "objective": 0.552335262298584, + "error": 0.3076171875, + "gradient_norm": 0.14419035613536835, + "elapsed": 594.4292685985565 + }, + { + "step": 832, + "loss": 0.5943340063095093, + "objective": 0.5943340063095093, + "error": 0.34375, + "gradient_norm": 0.0633513554930687, + "elapsed": 605.2052299976349 + }, + { + "step": 848, + "loss": 0.6074100732803345, + "objective": 0.6074100732803345, + "error": 0.3486328125, + "gradient_norm": 0.04225531220436096, + "elapsed": 614.8996202945709 + }, + { + "step": 864, + "loss": 0.6198879480361938, + "objective": 0.6198879480361938, + "error": 0.361328125, + "gradient_norm": 0.04208856821060181, + "elapsed": 625.4266908168793 + }, + { + "step": 880, + "loss": 0.6151762008666992, + "objective": 0.6151762008666992, + "error": 0.369140625, + "gradient_norm": 0.06261089444160461, + "elapsed": 636.0696911811829 + }, + { + "step": 896, + "loss": 0.49680083990097046, + "objective": 0.49680083990097046, + "error": 0.25390625, + "gradient_norm": 0.0827067643404007, + "elapsed": 644.6893246173859 + }, + { + "step": 912, + "loss": 0.4610927402973175, + "objective": 0.4610927402973175, + "error": 0.23828125, + "gradient_norm": 0.06652095168828964, + "elapsed": 655.969132900238 + }, + { + "step": 928, + "loss": 0.5218505859375, + "objective": 0.5218505859375, + "error": 0.2685546875, + "gradient_norm": 0.07188194245100021, + "elapsed": 667.5352523326874 + }, + { + "step": 944, + "loss": 0.33009427785873413, + "objective": 0.33009427785873413, + "error": 0.1533203125, + "gradient_norm": 0.05718810483813286, + "elapsed": 677.8397319316864 + }, + { + "step": 960, + "loss": 0.5703234672546387, + "objective": 0.5703234672546387, + "error": 0.3193359375, + "gradient_norm": 0.11168288439512253, + "elapsed": 687.8742904663086 + }, + { + "step": 976, + "loss": 0.025548014789819717, + "objective": 0.025548014789819717, + "error": 0.0107421875, + "gradient_norm": 0.009453393518924713, + "elapsed": 698.294285774231 + }, + { + "step": 992, + "loss": 0.45398157835006714, + "objective": 0.45398157835006714, + "error": 0.2412109375, + "gradient_norm": 0.04607952758669853, + "elapsed": 707.903199672699 + }, + { + "step": 1008, + "loss": 0.3412189781665802, + "objective": 0.3412189781665802, + "error": 0.1513671875, + "gradient_norm": 0.0432075597345829, + "elapsed": 718.5662748813629 + }, + { + "step": 1024, + "loss": 0.4376429319381714, + "objective": 0.4376429319381714, + "error": 0.2275390625, + "gradient_norm": 0.07974351197481155, + "elapsed": 728.8954858779907 + }, + { + "step": 1040, + "loss": 0.33512815833091736, + "objective": 0.33512815833091736, + "error": 0.150390625, + "gradient_norm": 0.04476875811815262, + "elapsed": 744.0822694301605 + }, + { + "step": 1056, + "loss": 0.5214208364486694, + "objective": 0.5214208364486694, + "error": 0.283203125, + "gradient_norm": 0.08898192644119263, + "elapsed": 755.1484262943268 + }, + { + "step": 1072, + "loss": 0.13849599659442902, + "objective": 0.13849599659442902, + "error": 0.052734375, + "gradient_norm": 0.028359953314065933, + "elapsed": 764.3303108215332 + }, + { + "step": 1088, + "loss": 0.323838472366333, + "objective": 0.323838472366333, + "error": 0.1435546875, + "gradient_norm": 0.04081716760993004, + "elapsed": 773.2739362716675 + }, + { + "step": 1104, + "loss": 0.5627881288528442, + "objective": 0.5627881288528442, + "error": 0.3125, + "gradient_norm": 0.08322097361087799, + "elapsed": 784.7223973274231 + }, + { + "step": 1120, + "loss": 0.44111010432243347, + "objective": 0.44111010432243347, + "error": 0.2216796875, + "gradient_norm": 0.05700977146625519, + "elapsed": 795.085648059845 + }, + { + "step": 1136, + "loss": 0.6395992040634155, + "objective": 0.6395992040634155, + "error": 0.39453125, + "gradient_norm": 0.0744553729891777, + "elapsed": 805.7942585945129 + }, + { + "step": 1152, + "loss": 0.5433304309844971, + "objective": 0.5433304309844971, + "error": 0.287109375, + "gradient_norm": 0.04814797267317772, + "elapsed": 817.3382890224457 + }, + { + "step": 1168, + "loss": 0.5708576440811157, + "objective": 0.5708576440811157, + "error": 0.3203125, + "gradient_norm": 0.051331400871276855, + "elapsed": 829.288791179657 + }, + { + "step": 1184, + "loss": 0.5447035431861877, + "objective": 0.5447035431861877, + "error": 0.2939453125, + "gradient_norm": 0.10116687417030334, + "elapsed": 839.6822843551636 + }, + { + "step": 1200, + "loss": 0.6125671863555908, + "objective": 0.6125671863555908, + "error": 0.3642578125, + "gradient_norm": 0.04368080571293831, + "elapsed": 850.2262740135193 + }, + { + "step": 1216, + "loss": 0.5002380609512329, + "objective": 0.5002380609512329, + "error": 0.259765625, + "gradient_norm": 0.04939017817378044, + "elapsed": 862.3783452510834 + }, + { + "step": 1232, + "loss": 0.5698772668838501, + "objective": 0.5698772668838501, + "error": 0.3173828125, + "gradient_norm": 0.04916854575276375, + "elapsed": 871.4622664451599 + }, + { + "step": 1248, + "loss": 0.6046518683433533, + "objective": 0.6046518683433533, + "error": 0.341796875, + "gradient_norm": 0.04919794574379921, + "elapsed": 883.3905737400055 + }, + { + "step": 1264, + "loss": 0.5913128852844238, + "objective": 0.5913128852844238, + "error": 0.357421875, + "gradient_norm": 0.046917904168367386, + "elapsed": 892.4264807701111 + }, + { + "step": 1280, + "loss": 0.5027461051940918, + "objective": 0.5027461051940918, + "error": 0.2626953125, + "gradient_norm": 0.04705750197172165, + "elapsed": 902.5875842571259 + }, + { + "step": 1296, + "loss": 0.13519814610481262, + "objective": 0.13519814610481262, + "error": 0.052734375, + "gradient_norm": 0.02625490538775921, + "elapsed": 912.4087471961975 + }, + { + "step": 1312, + "loss": 0.5862359404563904, + "objective": 0.5862359404563904, + "error": 0.3271484375, + "gradient_norm": 0.05441493168473244, + "elapsed": 923.992555141449 + }, + { + "step": 1328, + "loss": 0.6031408309936523, + "objective": 0.6031408309936523, + "error": 0.3505859375, + "gradient_norm": 0.05901554971933365, + "elapsed": 933.3936491012573 + }, + { + "step": 1344, + "loss": 0.5823733806610107, + "objective": 0.5823733806610107, + "error": 0.3310546875, + "gradient_norm": 0.0842989832162857, + "elapsed": 941.979998588562 + }, + { + "step": 1360, + "loss": 0.6241492033004761, + "objective": 0.6241492033004761, + "error": 0.3720703125, + "gradient_norm": 0.04446673393249512, + "elapsed": 954.969649553299 + }, + { + "step": 1376, + "loss": 0.5829156637191772, + "objective": 0.5829156637191772, + "error": 0.361328125, + "gradient_norm": 0.06615480780601501, + "elapsed": 966.0245676040649 + }, + { + "step": 1392, + "loss": 0.5968320369720459, + "objective": 0.5968320369720459, + "error": 0.34765625, + "gradient_norm": 0.05093541368842125, + "elapsed": 975.1022663116455 + }, + { + "step": 1408, + "loss": 0.045559000223875046, + "objective": 0.045559000223875046, + "error": 0.01171875, + "gradient_norm": 0.02514980360865593, + "elapsed": 987.2391452789307 + }, + { + "step": 1424, + "loss": 0.22601813077926636, + "objective": 0.22601813077926636, + "error": 0.09765625, + "gradient_norm": 0.04834206402301788, + "elapsed": 996.4583384990692 + }, + { + "step": 1440, + "loss": 0.23011144995689392, + "objective": 0.23011144995689392, + "error": 0.111328125, + "gradient_norm": 0.050687842071056366, + "elapsed": 1007.1440904140472 + }, + { + "step": 1456, + "loss": 0.018240466713905334, + "objective": 0.018240466713905334, + "error": 0.0078125, + "gradient_norm": 0.005604141391813755, + "elapsed": 1016.4502851963043 + }, + { + "step": 1472, + "loss": 0.4498720169067383, + "objective": 0.4498720169067383, + "error": 0.232421875, + "gradient_norm": 0.08179625123739243, + "elapsed": 1028.8303294181824 + }, + { + "step": 1488, + "loss": 0.24151627719402313, + "objective": 0.24151627719402313, + "error": 0.107421875, + "gradient_norm": 0.03838668763637543, + "elapsed": 1037.8867321014404 + }, + { + "step": 1504, + "loss": 0.46122002601623535, + "objective": 0.46122002601623535, + "error": 0.232421875, + "gradient_norm": 0.0726623386144638, + "elapsed": 1047.7258644104004 + }, + { + "step": 1520, + "loss": 0.5085602402687073, + "objective": 0.5085602402687073, + "error": 0.2705078125, + "gradient_norm": 0.06673175096511841, + "elapsed": 1059.352120399475 + }, + { + "step": 1536, + "loss": 0.6105246543884277, + "objective": 0.6105246543884277, + "error": 0.3818359375, + "gradient_norm": 0.04271261766552925, + "elapsed": 1070.1413230895996 + }, + { + "step": 1552, + "loss": 0.4792126417160034, + "objective": 0.4792126417160034, + "error": 0.2578125, + "gradient_norm": 0.05200039595365524, + "elapsed": 1086.444006204605 + }, + { + "step": 1568, + "loss": 0.5814266204833984, + "objective": 0.5814266204833984, + "error": 0.330078125, + "gradient_norm": 0.05867309868335724, + "elapsed": 1097.2902619838715 + }, + { + "step": 1584, + "loss": 0.6321226358413696, + "objective": 0.6321226358413696, + "error": 0.3798828125, + "gradient_norm": 0.05418067052960396, + "elapsed": 1107.9767682552338 + }, + { + "step": 1600, + "loss": 0.5931253433227539, + "objective": 0.5931253433227539, + "error": 0.3603515625, + "gradient_norm": 0.06396215409040451, + "elapsed": 1121.782609462738 + }, + { + "step": 1616, + "loss": 0.6411516666412354, + "objective": 0.6411516666412354, + "error": 0.38671875, + "gradient_norm": 0.05035768821835518, + "elapsed": 1132.7197887897491 + }, + { + "step": 1632, + "loss": 0.4267754852771759, + "objective": 0.4267754852771759, + "error": 0.2080078125, + "gradient_norm": 0.09109894186258316, + "elapsed": 1139.1667578220367 + }, + { + "step": 1648, + "loss": 0.21246182918548584, + "objective": 0.21246182918548584, + "error": 0.095703125, + "gradient_norm": 0.04478950425982475, + "elapsed": 1149.1183021068573 + }, + { + "step": 1664, + "loss": 0.46360665559768677, + "objective": 0.46360665559768677, + "error": 0.251953125, + "gradient_norm": 0.07668188214302063, + "elapsed": 1161.1197745800018 + }, + { + "step": 1680, + "loss": 0.46281397342681885, + "objective": 0.46281397342681885, + "error": 0.236328125, + "gradient_norm": 0.07954126596450806, + "elapsed": 1171.8474535942078 + }, + { + "step": 1696, + "loss": 0.2484058141708374, + "objective": 0.2484058141708374, + "error": 0.12109375, + "gradient_norm": 0.047261305153369904, + "elapsed": 1185.6542596817017 + }, + { + "step": 1712, + "loss": 0.24310235679149628, + "objective": 0.24310235679149628, + "error": 0.1064453125, + "gradient_norm": 0.07262872904539108, + "elapsed": 1197.8986082077026 + }, + { + "step": 1728, + "loss": 0.009729458019137383, + "objective": 0.009729458019137383, + "error": 0.001953125, + "gradient_norm": 0.01146845705807209, + "elapsed": 1208.495581150055 + }, + { + "step": 1744, + "loss": 0.24568752944469452, + "objective": 0.24568752944469452, + "error": 0.10546875, + "gradient_norm": 0.05830742046236992, + "elapsed": 1219.9394850730896 + }, + { + "step": 1760, + "loss": 0.022546378895640373, + "objective": 0.022546378895640373, + "error": 0.0068359375, + "gradient_norm": 0.007667526602745056, + "elapsed": 1229.5703229904175 + }, + { + "step": 1776, + "loss": 0.5848401784896851, + "objective": 0.5848401784896851, + "error": 0.3271484375, + "gradient_norm": 0.061901818960905075, + "elapsed": 1238.750280380249 + }, + { + "step": 1792, + "loss": 0.6031335592269897, + "objective": 0.6031335592269897, + "error": 0.3671875, + "gradient_norm": 0.0676632970571518, + "elapsed": 1247.7468683719635 + }, + { + "step": 1808, + "loss": 0.6210961937904358, + "objective": 0.6210961937904358, + "error": 0.3603515625, + "gradient_norm": 0.0718468651175499, + "elapsed": 1256.1821897029877 + }, + { + "step": 1824, + "loss": 0.570877730846405, + "objective": 0.570877730846405, + "error": 0.3212890625, + "gradient_norm": 0.05575930327177048, + "elapsed": 1266.4091975688934 + }, + { + "step": 1840, + "loss": 0.5711429119110107, + "objective": 0.5711429119110107, + "error": 0.31640625, + "gradient_norm": 0.0691002607345581, + "elapsed": 1277.4722146987915 + }, + { + "step": 1856, + "loss": 0.36046335101127625, + "objective": 0.36046335101127625, + "error": 0.16796875, + "gradient_norm": 0.04694395884871483, + "elapsed": 1287.1420249938965 + }, + { + "step": 1872, + "loss": 0.4688999652862549, + "objective": 0.4688999652862549, + "error": 0.2216796875, + "gradient_norm": 0.07401346415281296, + "elapsed": 1297.3945078849792 + }, + { + "step": 1888, + "loss": 0.46385282278060913, + "objective": 0.46385282278060913, + "error": 0.2373046875, + "gradient_norm": 0.05608939751982689, + "elapsed": 1305.9779334068298 + }, + { + "step": 1904, + "loss": 0.60875403881073, + "objective": 0.60875403881073, + "error": 0.365234375, + "gradient_norm": 0.05085878074169159, + "elapsed": 1317.3097081184387 + }, + { + "step": 1920, + "loss": 0.12223530560731888, + "objective": 0.12223530560731888, + "error": 0.0458984375, + "gradient_norm": 0.024870412424206734, + "elapsed": 1328.6486887931824 + }, + { + "step": 1936, + "loss": 0.3486189544200897, + "objective": 0.3486189544200897, + "error": 0.16796875, + "gradient_norm": 0.04780663549900055, + "elapsed": 1336.6701011657715 + }, + { + "step": 1952, + "loss": 0.5777363777160645, + "objective": 0.5777363777160645, + "error": 0.3427734375, + "gradient_norm": 0.0571451336145401, + "elapsed": 1346.9158833026886 + }, + { + "step": 1968, + "loss": 0.39320266246795654, + "objective": 0.39320266246795654, + "error": 0.1884765625, + "gradient_norm": 0.05673858895897865, + "elapsed": 1354.9182631969452 + }, + { + "step": 1984, + "loss": 0.5900611281394958, + "objective": 0.5900611281394958, + "error": 0.3349609375, + "gradient_norm": 0.06593932211399078, + "elapsed": 1364.2754452228546 + }, + { + "step": 2000, + "loss": 0.6212430000305176, + "objective": 0.6212430000305176, + "error": 0.3857421875, + "gradient_norm": 0.040818918496370316, + "elapsed": 1374.7192046642303 + }, + { + "step": 2016, + "loss": 0.15605247020721436, + "objective": 0.15605247020721436, + "error": 0.0556640625, + "gradient_norm": 0.03108786791563034, + "elapsed": 1386.2740807533264 + }, + { + "step": 2032, + "loss": 0.22049596905708313, + "objective": 0.22049596905708313, + "error": 0.1015625, + "gradient_norm": 0.042733557522296906, + "elapsed": 1396.6422457695007 + }, + { + "step": 2048, + "loss": 0.5642613172531128, + "objective": 0.5642613172531128, + "error": 0.306640625, + "gradient_norm": 0.07527482509613037, + "elapsed": 1407.6688070297241 + } + ] + }, + "derived_checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ce5951e7095a9912dc74719254f2fcf9654f219078392b7acf7a8545e6f9f3f4", + "complete": true + }, + "mean4": { + "checkpoint_label": "mean4", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 512, + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "512": "d4194b40470453e5df9b75e12326cbbd0e6845946870bb0d53a2cbbdd6ea32dc", + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "512": { + "step": 512, + "training_samples": 524288, + "unique_training_rows_seen_in_this_phase": 324661, + "weights_sha256": "d4194b40470453e5df9b75e12326cbbd0e6845946870bb0d53a2cbbdd6ea32dc", + "complete": true + }, + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ff5a023ce2c18be7c29f810a3788a450e3ad3ad2237d6e9448923aa6a28c5074", + "complete": true + } + }, + "selection": "Predefined averages of the last3 or all4 saved noninitial full3_1 checkpoints; evaluate every validation condition before selecting", + "test_data_used": false, + "derivation_source_sha256": "08c498d6952b0380e001371df9a0461a483631a301f93747b821e529e72b349d" + }, + "training_source_snapshot": "training_sources/full3_swa", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23290264423076928, + "mean3": 0.2335186298076923, + "blend-mean3": 0.2325420673076923, + "mean4": 0.23326322115384618, + "blend-mean4": 0.23300781250000002 + }, + "selected": "blend-mean3" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.22017728365384615, + "mean3": 0.22037259615384613, + "blend-mean3": 0.22091346153846153, + "mean4": 0.2205528846153846, + "blend-mean4": 0.22100360576923078 + }, + "selected": "incumbent" + } + ], + "checkpoints": { + "mean3": { + "checkpoint_label": "mean3", + "kind": "uniform_parameter_average", + "optimizer_updates_in_derived_run": 0, + "source_run": "full3_1", + "source_optimizer_steps": [ + 1024, + 1536, + 2048 + ], + "source_weights_sha256": { + "1024": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "1536": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "2048": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5" + }, + "source_checkpoint_records": { + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 446179, + "weights_sha256": "22adf2425bbfb872e814227799b725f78618bccf68410935470e6c37d159a6b7", + "complete": true + }, + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 490266, + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "complete": true + }, + "2048": { + "step": 2048, + "training_samples": 2097152, + "unique_training_rows_seen_in_this_phase": 507282, + "weights_sha256": "b93c1367dfeb0e32b2add76b1abeb3f12d4d9f8145d0f13d8d5b17ca882ba3b5", + "complete": true + } + }, + "weights_sha256": "ce5951e7095a9912dc74719254f2fcf9654f219078392b7acf7a8545e6f9f3f4", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit logical tracking in intermediate passes when intermediate probabilities are unused.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false + }, + "checkpoints": { + "1536": { + "step": 1536, + "training_samples": 1572864, + "unique_training_rows_seen_in_this_phase": 467790, + "weights_sha256": "6ebe606c36cfd41862e589568878e67b2c2accafeb093b1fee3a0955d5948f0d", + "complete": true + } + }, + "selection": "Per-basis minimum full-validation mean over the incumbent and equal old/new neural probability averages, optionally blended with physical probability at fractions 0, .25, or .5. All 13 durations included.", + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.2319861778846154, + "0-physical-0": 0.23278245192307695, + "0-physical-0.25": 0.23291766826923077, + "0-physical-0.5": 0.23315805288461539, + "512-physical-0": 0.2319110576923077, + "512-physical-0.25": 0.23314302884615387, + "512-physical-0.5": 0.2329477163461538, + "1024-physical-0": 0.2325721153846154, + "1024-physical-0.25": 0.23218149038461536, + "1024-physical-0.5": 0.2329627403846154, + "1536-physical-0": 0.23186598557692306, + "1536-physical-0.25": 0.23234675480769235, + "1536-physical-0.5": 0.2330829326923077 + }, + "selected": "1536-physical-0", + "original_checkpoint": "full3_swa/mean3" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.21953124999999998, + "0-physical-0": 0.22029747596153845, + "0-physical-0.25": 0.22067307692307694, + "0-physical-0.5": 0.22079326923076922, + "512-physical-0": 0.22034254807692305, + "512-physical-0.25": 0.22050781249999998, + "512-physical-0.5": 0.2203725961538462, + "1024-physical-0": 0.21998197115384613, + "1024-physical-0.25": 0.22049278846153844, + "1024-physical-0.5": 0.22031250000000002, + "1536-physical-0": 0.2204026442307692, + "1536-physical-0.25": 0.2201923076923077, + "1536-physical-0.5": 0.22061298076923078 + }, + "selected": "incumbent", + "original_checkpoint": "full3_1/1536" + } + ], + "control": { + "status": "passed", + "device": "cpu", + "source_sha256": "59d6c85dc4bd61e26cf7243baf0e2637c3de1d35327b2c763707badd19446550", + "reference_package": "/run-state/workspace/research/context_upgrades/short_categorical2/package", + "members": [ + { + "weights": "weights/neural-d5-neural_d5_full3_swa-mean3.npz", + "coefficient": 1.0 + }, + { + "weights": "weights/neural-d5-neural_d5_full3_1-1536.npz", + "coefficient": 3.0 + } + ], + "cases": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 1, + "single_path_exact": true, + "shared_mixture_exact": true, + "cpu_recomputed_vs_gpu_cached_prior_max_difference": null + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 7, + "single_path_exact": true, + "shared_mixture_exact": true, + "cpu_recomputed_vs_gpu_cached_prior_max_difference": 1.7881393432617188e-07 + } + ], + "seconds": 4.879673480987549, + "scope": "Runtime probability aggregation and prior reuse; no model fitting or validation selection." + }, + "test_data_used": false + }, + "neural_d5": { + "training": { + "initialization": "Continue from the recorded session-trained checkpoint; original random initialization seed 20261273", + "prior_pass": 3, + "initial_seed": 20261273, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 467790, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18254, + "surface_code_bX_d5_r03_center_5_5": 18525, + "surface_code_bX_d5_r05_center_5_5": 18175, + "surface_code_bX_d5_r07_center_5_5": 18005, + "surface_code_bX_d5_r09_center_5_5": 18067, + "surface_code_bX_d5_r11_center_5_5": 18445, + "surface_code_bX_d5_r13_center_5_5": 18673, + "surface_code_bX_d5_r15_center_5_5": 17345, + "surface_code_bX_d5_r17_center_5_5": 17898, + "surface_code_bX_d5_r19_center_5_5": 18359, + "surface_code_bX_d5_r21_center_5_5": 18036, + "surface_code_bX_d5_r23_center_5_5": 17255, + "surface_code_bX_d5_r25_center_5_5": 18057, + "surface_code_bZ_d5_r01_center_5_5": 17596, + "surface_code_bZ_d5_r03_center_5_5": 18333, + "surface_code_bZ_d5_r05_center_5_5": 18250, + "surface_code_bZ_d5_r07_center_5_5": 18210, + "surface_code_bZ_d5_r09_center_5_5": 17447, + "surface_code_bZ_d5_r11_center_5_5": 18120, + "surface_code_bZ_d5_r13_center_5_5": 18224, + "surface_code_bZ_d5_r15_center_5_5": 17857, + "surface_code_bZ_d5_r17_center_5_5": 18359, + "surface_code_bZ_d5_r19_center_5_5": 17398, + "surface_code_bZ_d5_r21_center_5_5": 18235, + "surface_code_bZ_d5_r23_center_5_5": 16653, + "surface_code_bZ_d5_r25_center_5_5": 18014 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 1536, + "batch": 1024, + "learning_rate": 0.0005, + "sampling_seed": 20261274, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": true, + "rng_restored": true, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "/run-state/workspace/research/learned_d5/reserved2_warm/rng-512.json", + "starting_checkpoint": "/run-state/workspace/research/learned_d5/reserved2_warm/weights-512.npz", + "starting_checkpoint_sha256": "2b00e3f258886b5c4ecf69f36fd5463a205eefc84bd10c550acc391e84515c24", + "starting_training_provenance": { + "initialization": "All parameters initialized in this session: variance-scaled normal hidden layers, Normal(0,.001) output weights, zero biases, seed 20261273", + "prior_pass": 3, + "initial_seed": 20261273, + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "runtime_versions": { + "jax": "0.7.2", + "numpy": "2.3.3", + "optax": "0.2.6" + }, + "hidden_width": 64, + "input_features": 394, + "feature_mode": "local events, reconstructed measurements, shot densities, physical edge support and conditioned prior", + "architecture": "Two 64-unit SiLU layers; 394 features; bounded 2*tanh correction to relevant-CSS edge logits from the recorded physical feedback pass; exact width-14 contraction predicts logical probability. D5 joint conditioning remains approximate.", + "training": "Only the18856 declared fit rows per each of26 d5 conditions; both512-row gate and512-row audit partitions excluded from every optimizer update. Uniform condition/within-condition sampling.", + "reserved_training_partition": { + "manifest": "/run-state/workspace/research/learned_d5/reserved_split1/manifest.json", + "manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "selected_part": "fit", + "details": { + "schema": "qecbench-training-reserved-split/v1", + "seed": 20261270, + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "source_sha256": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "conditions": [ + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "file": "surface_code_bX_d5_r01_center_5_5.npz", + "sha256": "c72d5c5ee3daf1b128e0c226f2815009daf6127e8b028004e86cebd6047ac474", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "file": "surface_code_bX_d5_r03_center_5_5.npz", + "sha256": "3a59636161c80fbbf326cf1919817ce5f60ec9e6d3e4b6223579cb6a36e12e31", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "file": "surface_code_bX_d5_r05_center_5_5.npz", + "sha256": "e808936ef0cb32869e0944ab70a3026ef96d0f31fe0fe9967c6d87a15b85abb5", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "file": "surface_code_bX_d5_r07_center_5_5.npz", + "sha256": "cd0f71459448a41af10e4399637d02e8d8193dea16ab300f839cb56ad8b08203", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "file": "surface_code_bX_d5_r09_center_5_5.npz", + "sha256": "56648e2b93499736d40f6aa5e9e8a568f150cbc8589929578f57c1e839c92d76", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "file": "surface_code_bX_d5_r11_center_5_5.npz", + "sha256": "ce2dcc2bfcb57bbfcb2291105a9a011a2a3113ad92348dfa7c76076f1fb3cacf", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "file": "surface_code_bX_d5_r13_center_5_5.npz", + "sha256": "968b14d4d948474afd0e182d9c60cd577297d4b7bb331e916058e41692d7c9d2", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "file": "surface_code_bX_d5_r15_center_5_5.npz", + "sha256": "8d73808a777d81c2acc2f6aab924cc11690a94136bc666fbf11f78292a47615d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "file": "surface_code_bX_d5_r17_center_5_5.npz", + "sha256": "0ab49c9dc61605d43f0c03427352af0ee230ecf7360927f75de60519d707c7ee", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "file": "surface_code_bX_d5_r19_center_5_5.npz", + "sha256": "27594cc6e0943860d828ebde2c76fdde64ccf2a357f896d551f3d4606e74fec4", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "file": "surface_code_bX_d5_r21_center_5_5.npz", + "sha256": "1b1fdcf280ca7c8ba94476f9c54b6ab70eee59b63b3be406a534014132295b7e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "file": "surface_code_bX_d5_r23_center_5_5.npz", + "sha256": "d31e0ca2ce6a6d04ed7bbd80113aec8cca40526b643752d8f429ece168736759", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "file": "surface_code_bX_d5_r25_center_5_5.npz", + "sha256": "f45a5978d77b1ef450f2ffd9fa19413c9d647448a3d61dfafd7590671dcace19", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "file": "surface_code_bZ_d5_r01_center_5_5.npz", + "sha256": "647e82ac0721a7245b3deb831a5a73eb555a3cb3e58b460774ffb96dc99c3b64", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "file": "surface_code_bZ_d5_r03_center_5_5.npz", + "sha256": "b64be8c7883b921bd57d5eefcc53656c2dad484833e5533e499b19b45be90158", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "file": "surface_code_bZ_d5_r05_center_5_5.npz", + "sha256": "63361e091640a4d506fc372bd0764ad248f6551d77cdf57550405b2624ca97b1", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "file": "surface_code_bZ_d5_r07_center_5_5.npz", + "sha256": "c50d26a58c1fb6b5a20f5737b94c3bac9182fe703bafa221532b8b012064f655", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "file": "surface_code_bZ_d5_r09_center_5_5.npz", + "sha256": "d62ecb975d63f13664bc6b02d30499a3fb10f0c22f1068b28bbbc31d1ec91fcc", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "file": "surface_code_bZ_d5_r11_center_5_5.npz", + "sha256": "724c7dc2c4cf2b551abf4f75e230f5aa04a74eebba79c25c845f14d15863de5e", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "file": "surface_code_bZ_d5_r13_center_5_5.npz", + "sha256": "0e618a998fb591a85dd365eead741a91b6560ed1a3987046286a67a2c754fa83", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "file": "surface_code_bZ_d5_r15_center_5_5.npz", + "sha256": "e1f8c6f812dc98c48402b69a08b09b520d1374e9f2e51b3e681b67bf306e17be", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "file": "surface_code_bZ_d5_r17_center_5_5.npz", + "sha256": "aa23a51a79677a8ac43cc31b72fe07e73c827f935c632c29b09924fc88242d0d", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "file": "surface_code_bZ_d5_r19_center_5_5.npz", + "sha256": "8420b79a8d7324f41dfd1cccacfd1fae9b27b370f40c60059e9de187864dba2b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "file": "surface_code_bZ_d5_r21_center_5_5.npz", + "sha256": "088b92610c90dc1a180b2eca8b16e8f225d191ec7fc11355c85e6959f35e7073", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "file": "surface_code_bZ_d5_r23_center_5_5.npz", + "sha256": "b1484c581cbd5439c74befabbd7c1c12e7cb38db099c793dfb3cf748df20fc3b", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "file": "surface_code_bZ_d5_r25_center_5_5.npz", + "sha256": "92f552059b6c197b53ff1030d9ba0fe03cf22ea1f116e5280be944ad60f04be3", + "counts": { + "fit": 18856, + "gate": 512, + "audit": 512 + } + } + ], + "counts": { + "fit": 490256, + "gate": 13312, + "audit": 13312 + }, + "split_features": "Only array lengths and seeded random permutations; IDs verify alignment and are never model features", + "gate_use": "Fit a small combiner on gate labels only after experts exclude both reserved parts", + "audit_use": "Diagnostic only; no parameter fitting, checkpoint selection, or hyperparameter selection", + "validation_use": "Supplied validation selects checkpoints and candidates; no validation labels fit parameters", + "test_data_used": false + } + }, + "training_cache": "/run-state/workspace/research/learned_d5/full_training_priors3", + "training_cache_provenance": { + "method": "Three undamped physical CSS extrinsic-message passes, clipping8, pass1/pass3 priors captured before logical readout", + "scope": "All supplied training rows in all26 d5 conditions; no validation or test labels used in cache generation", + "reused_rows": "4096 rows per condition from feedback5_cache, sampled with seed20261023; same first three passes", + "remaining_rows": "Computed now with last-only logical tracking; previously controlled against full logical tracking", + "train_manifest_sha256": "ce46c21e3595cfc5885bbe2b6481105317d2e6267498ec4572601469825914b8", + "records": [ + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 44.93641114234924, + "elapsed": 45.15474009513855, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.11551070213318, + "elapsed": 88.52458453178406, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 39.70699763298035, + "elapsed": 128.4802794456482, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r23_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.178571701049805, + "elapsed": 169.95510387420654, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 41.53053879737854, + "elapsed": 211.7576286792755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r21_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 43.43117809295654, + "elapsed": 255.62733364105225, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 33.84876799583435, + "elapsed": 289.70106053352356, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r19_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 32.88018870353699, + "elapsed": 322.7981607913971, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.585307836532593, + "elapsed": 352.58776783943176, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r17_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.854028463363647, + "elapsed": 382.6393291950226, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 26.721288919448853, + "elapsed": 409.54919600486755, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r15_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.810269832611084, + "elapsed": 439.6440734863281, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 29.79407238960266, + "elapsed": 469.7887041568756, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r13_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 28.757604837417603, + "elapsed": 498.71140813827515, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.38013219833374, + "elapsed": 524.2447266578674, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r11_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 25.378958225250244, + "elapsed": 549.8600506782532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 21.241567850112915, + "elapsed": 571.2600774765015, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 18.780335664749146, + "elapsed": 590.304051399231, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.346807956695557, + "elapsed": 604.8041462898254, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r07_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 14.03441047668457, + "elapsed": 618.9537570476532, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.811666488647461, + "elapsed": 629.8610434532166, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r05_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 10.982703924179077, + "elapsed": 640.9919559955597, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.846271991729736, + "elapsed": 648.9624857902527, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 7.83586859703064, + "elapsed": 656.9065537452698, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.7685718536376953, + "elapsed": 657.7747800350189, + "peak_gpu_bytes": 58661028096 + }, + { + "condition": "surface_code_bZ_d5_r01_center_5_5", + "shots": 19880, + "reused_training_rows": 4096, + "new_rows": 15784, + "seconds": 0.748960018157959, + "elapsed": 658.5666444301605, + "peak_gpu_bytes": 58661028096 + } + ], + "test_data_used": false + }, + "training_shots": 490256, + "training_pool_interpretation": "Eligible training rows; optimizer samples conditions and rows with replacement. Distinct rows used in this phase are recorded separately.", + "unique_training_rows_seen_in_this_phase": 317635, + "unique_rows_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 13700, + "surface_code_bX_d5_r03_center_5_5": 10036, + "surface_code_bX_d5_r05_center_5_5": 11768, + "surface_code_bX_d5_r07_center_5_5": 10917, + "surface_code_bX_d5_r09_center_5_5": 13458, + "surface_code_bX_d5_r11_center_5_5": 11764, + "surface_code_bX_d5_r13_center_5_5": 14018, + "surface_code_bX_d5_r15_center_5_5": 10968, + "surface_code_bX_d5_r17_center_5_5": 13469, + "surface_code_bX_d5_r19_center_5_5": 11340, + "surface_code_bX_d5_r21_center_5_5": 11327, + "surface_code_bX_d5_r23_center_5_5": 13970, + "surface_code_bX_d5_r25_center_5_5": 10500, + "surface_code_bZ_d5_r01_center_5_5": 12079, + "surface_code_bZ_d5_r03_center_5_5": 12160, + "surface_code_bZ_d5_r05_center_5_5": 9494, + "surface_code_bZ_d5_r07_center_5_5": 10910, + "surface_code_bZ_d5_r09_center_5_5": 10064, + "surface_code_bZ_d5_r11_center_5_5": 10969, + "surface_code_bZ_d5_r13_center_5_5": 13419, + "surface_code_bZ_d5_r15_center_5_5": 12842, + "surface_code_bZ_d5_r17_center_5_5": 13694, + "surface_code_bZ_d5_r19_center_5_5": 13449, + "surface_code_bZ_d5_r21_center_5_5": 13799, + "surface_code_bZ_d5_r23_center_5_5": 12754, + "surface_code_bZ_d5_r25_center_5_5": 14767 + }, + "gradient_block_size": 32, + "bucket_operations": true, + "accumulate_conditions": 1, + "effective_batch_size": 1024, + "uncertainty_weight_floor": 1.0, + "example_weighting": "Uniform BCE", + "loss": "Conditional logical binary cross entropy, differentiated through exact relevant-CSS contraction; physical CSS feedback prior held fixed", + "steps": 512, + "batch": 1024, + "learning_rate": 0.001, + "sampling_seed": 20261274, + "optimizer": "AdamW, weight decay 1e-4, global gradient norm clip 1", + "optimizer_restored": false, + "rng_restored": false, + "explicit_optimizer_reset": false, + "explicit_rng_reset": false, + "sampling_state_source": "Fresh NumPy default_rng seed 20261274", + "starting_checkpoint": null, + "starting_checkpoint_sha256": null, + "starting_training_provenance": null, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.2600052058696747, + "objective": 0.2600052058696747, + "error": 0.1123046875, + "gradient_norm": 0.06799795478582382, + "elapsed": 27.333195447921753 + }, + { + "step": 16, + "loss": 0.0312246885150671, + "objective": 0.0312246885150671, + "error": 0.01171875, + "gradient_norm": 0.004962741397321224, + "elapsed": 48.383540868759155 + }, + { + "step": 32, + "loss": 0.22698244452476501, + "objective": 0.22698244452476501, + "error": 0.08984375, + "gradient_norm": 0.06353150308132172, + "elapsed": 57.04609966278076 + }, + { + "step": 48, + "loss": 0.5861443281173706, + "objective": 0.5861443281173706, + "error": 0.3486328125, + "gradient_norm": 0.04095375910401344, + "elapsed": 69.08654689788818 + }, + { + "step": 64, + "loss": 0.6103856563568115, + "objective": 0.6103856563568115, + "error": 0.3662109375, + "gradient_norm": 0.04155975207686424, + "elapsed": 81.63970494270325 + }, + { + "step": 80, + "loss": 0.5673234462738037, + "objective": 0.5673234462738037, + "error": 0.3125, + "gradient_norm": 0.1773851364850998, + "elapsed": 92.5357596874237 + }, + { + "step": 96, + "loss": 0.3763846755027771, + "objective": 0.3763846755027771, + "error": 0.1875, + "gradient_norm": 0.0951203852891922, + "elapsed": 103.12279391288757 + }, + { + "step": 112, + "loss": 0.45539408922195435, + "objective": 0.45539408922195435, + "error": 0.22265625, + "gradient_norm": 0.056369006633758545, + "elapsed": 112.61882042884827 + }, + { + "step": 128, + "loss": 0.015473627485334873, + "objective": 0.015473627485334873, + "error": 0.005859375, + "gradient_norm": 0.005696057807654142, + "elapsed": 125.16960310935974 + }, + { + "step": 144, + "loss": 0.03449750319123268, + "objective": 0.03449750319123268, + "error": 0.0107421875, + "gradient_norm": 0.008358650840818882, + "elapsed": 135.8080232143402 + }, + { + "step": 160, + "loss": 0.5731935501098633, + "objective": 0.5731935501098633, + "error": 0.31640625, + "gradient_norm": 0.056162577122449875, + "elapsed": 145.0349259376526 + }, + { + "step": 176, + "loss": 0.5626271963119507, + "objective": 0.5626271963119507, + "error": 0.314453125, + "gradient_norm": 0.048817526549100876, + "elapsed": 154.84093379974365 + }, + { + "step": 192, + "loss": 0.5507581233978271, + "objective": 0.5507581233978271, + "error": 0.3173828125, + "gradient_norm": 0.06503377854824066, + "elapsed": 164.7195086479187 + }, + { + "step": 208, + "loss": 0.5725968480110168, + "objective": 0.5725968480110168, + "error": 0.3251953125, + "gradient_norm": 0.047704510390758514, + "elapsed": 175.38803815841675 + }, + { + "step": 224, + "loss": 0.5249365568161011, + "objective": 0.5249365568161011, + "error": 0.2802734375, + "gradient_norm": 0.10021239519119263, + "elapsed": 187.0162854194641 + }, + { + "step": 240, + "loss": 0.2526492476463318, + "objective": 0.2526492476463318, + "error": 0.1103515625, + "gradient_norm": 0.06751289963722229, + "elapsed": 196.51696944236755 + }, + { + "step": 256, + "loss": 0.5214780569076538, + "objective": 0.5214780569076538, + "error": 0.275390625, + "gradient_norm": 0.14627203345298767, + "elapsed": 208.2405219078064 + }, + { + "step": 272, + "loss": 0.59315025806427, + "objective": 0.59315025806427, + "error": 0.341796875, + "gradient_norm": 0.03693874180316925, + "elapsed": 224.87874341011047 + }, + { + "step": 288, + "loss": 0.37350377440452576, + "objective": 0.37350377440452576, + "error": 0.169921875, + "gradient_norm": 0.05035478249192238, + "elapsed": 235.2427306175232 + }, + { + "step": 304, + "loss": 0.6201726198196411, + "objective": 0.6201726198196411, + "error": 0.3798828125, + "gradient_norm": 0.04230104014277458, + "elapsed": 244.4733214378357 + }, + { + "step": 320, + "loss": 0.5781067609786987, + "objective": 0.5781067609786987, + "error": 0.3291015625, + "gradient_norm": 0.06764703243970871, + "elapsed": 256.96991300582886 + }, + { + "step": 336, + "loss": 0.13824111223220825, + "objective": 0.13824111223220825, + "error": 0.0556640625, + "gradient_norm": 0.02330971322953701, + "elapsed": 268.097412109375 + }, + { + "step": 352, + "loss": 0.6141752004623413, + "objective": 0.6141752004623413, + "error": 0.37890625, + "gradient_norm": 0.08660273998975754, + "elapsed": 282.79302310943604 + }, + { + "step": 368, + "loss": 0.3470626473426819, + "objective": 0.3470626473426819, + "error": 0.1611328125, + "gradient_norm": 0.05711895599961281, + "elapsed": 293.79467129707336 + }, + { + "step": 384, + "loss": 0.6023644208908081, + "objective": 0.6023644208908081, + "error": 0.3466796875, + "gradient_norm": 0.08649417012929916, + "elapsed": 305.9786322116852 + }, + { + "step": 400, + "loss": 0.03022841364145279, + "objective": 0.03022841364145279, + "error": 0.0087890625, + "gradient_norm": 0.009741511195898056, + "elapsed": 315.06104922294617 + }, + { + "step": 416, + "loss": 0.23827238380908966, + "objective": 0.23827238380908966, + "error": 0.1015625, + "gradient_norm": 0.03526044636964798, + "elapsed": 325.6410942077637 + }, + { + "step": 432, + "loss": 0.43375664949417114, + "objective": 0.43375664949417114, + "error": 0.201171875, + "gradient_norm": 0.03940205276012421, + "elapsed": 336.9890570640564 + }, + { + "step": 448, + "loss": 0.5915575623512268, + "objective": 0.5915575623512268, + "error": 0.3359375, + "gradient_norm": 0.04364592209458351, + "elapsed": 346.9254243373871 + }, + { + "step": 464, + "loss": 0.5641118288040161, + "objective": 0.5641118288040161, + "error": 0.3076171875, + "gradient_norm": 0.052896615117788315, + "elapsed": 356.9816539287567 + }, + { + "step": 480, + "loss": 0.5682889223098755, + "objective": 0.5682889223098755, + "error": 0.322265625, + "gradient_norm": 0.07130409777164459, + "elapsed": 369.16103172302246 + }, + { + "step": 496, + "loss": 0.37034764885902405, + "objective": 0.37034764885902405, + "error": 0.181640625, + "gradient_norm": 0.11464523524045944, + "elapsed": 381.041054725647 + }, + { + "step": 512, + "loss": 0.5398496389389038, + "objective": 0.5398496389389038, + "error": 0.3076171875, + "gradient_norm": 0.05673467367887497, + "elapsed": 394.5030150413513 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved2_warm", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "db182d721768f832e1c83f6258b31bef0d8bf2ded239a8ab5a45cbb76378fd30", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 256, + 512 + ], + "training_draws": 524288, + "distinct_phase_training_rows": 317635, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 13700, + "surface_code_bX_d5_r03_center_5_5": 10036, + "surface_code_bX_d5_r05_center_5_5": 11768, + "surface_code_bX_d5_r07_center_5_5": 10917, + "surface_code_bX_d5_r09_center_5_5": 13458, + "surface_code_bX_d5_r11_center_5_5": 11764, + "surface_code_bX_d5_r13_center_5_5": 14018, + "surface_code_bX_d5_r15_center_5_5": 10968, + "surface_code_bX_d5_r17_center_5_5": 13469, + "surface_code_bX_d5_r19_center_5_5": 11340, + "surface_code_bX_d5_r21_center_5_5": 11327, + "surface_code_bX_d5_r23_center_5_5": 13970, + "surface_code_bX_d5_r25_center_5_5": 10500, + "surface_code_bZ_d5_r01_center_5_5": 12079, + "surface_code_bZ_d5_r03_center_5_5": 12160, + "surface_code_bZ_d5_r05_center_5_5": 9494, + "surface_code_bZ_d5_r07_center_5_5": 10910, + "surface_code_bZ_d5_r09_center_5_5": 10064, + "surface_code_bZ_d5_r11_center_5_5": 10969, + "surface_code_bZ_d5_r13_center_5_5": 13419, + "surface_code_bZ_d5_r15_center_5_5": 12842, + "surface_code_bZ_d5_r17_center_5_5": 13694, + "surface_code_bZ_d5_r19_center_5_5": 13449, + "surface_code_bZ_d5_r21_center_5_5": 13799, + "surface_code_bZ_d5_r23_center_5_5": 12754, + "surface_code_bZ_d5_r25_center_5_5": 14767 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 512, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "validation": "Uniform subset per all 26 conditions, sample seed 20261102; full validation required before publication", + "validation_shots_per_condition": 1024, + "test_data_used": false, + "records": [ + { + "step": 1, + "loss": 0.30839407444000244, + "objective": 0.30839407444000244, + "error": 0.130859375, + "gradient_norm": 0.053425733000040054, + "elapsed": 28.537403345108032 + }, + { + "step": 16, + "loss": 0.021987520158290863, + "objective": 0.021987520158290863, + "error": 0.0078125, + "gradient_norm": 0.01397851575165987, + "elapsed": 48.18276286125183 + }, + { + "step": 32, + "loss": 0.5041587352752686, + "objective": 0.5041587352752686, + "error": 0.2724609375, + "gradient_norm": 0.0528741292655468, + "elapsed": 58.27348470687866 + }, + { + "step": 48, + "loss": 0.4326452612876892, + "objective": 0.4326452612876892, + "error": 0.21484375, + "gradient_norm": 0.0559566393494606, + "elapsed": 68.90473222732544 + }, + { + "step": 64, + "loss": 0.4804917275905609, + "objective": 0.4804917275905609, + "error": 0.248046875, + "gradient_norm": 0.0669105276465416, + "elapsed": 77.87249231338501 + }, + { + "step": 80, + "loss": 0.2889654338359833, + "objective": 0.2889654338359833, + "error": 0.1328125, + "gradient_norm": 0.08293467015028, + "elapsed": 86.87973022460938 + }, + { + "step": 96, + "loss": 0.5135385990142822, + "objective": 0.5135385990142822, + "error": 0.271484375, + "gradient_norm": 0.06412295252084732, + "elapsed": 95.98773431777954 + }, + { + "step": 112, + "loss": 0.31248384714126587, + "objective": 0.31248384714126587, + "error": 0.1357421875, + "gradient_norm": 0.03881710395216942, + "elapsed": 106.47444081306458 + }, + { + "step": 128, + "loss": 0.23868557810783386, + "objective": 0.23868557810783386, + "error": 0.091796875, + "gradient_norm": 0.03896595537662506, + "elapsed": 117.72143626213074 + }, + { + "step": 144, + "loss": 0.5315916538238525, + "objective": 0.5315916538238525, + "error": 0.2890625, + "gradient_norm": 0.09184520691633224, + "elapsed": 126.97882843017578 + }, + { + "step": 160, + "loss": 0.604732096195221, + "objective": 0.604732096195221, + "error": 0.3603515625, + "gradient_norm": 0.044600710272789, + "elapsed": 137.403742313385 + }, + { + "step": 176, + "loss": 0.032417282462120056, + "objective": 0.032417282462120056, + "error": 0.0107421875, + "gradient_norm": 0.010968778282403946, + "elapsed": 147.58081603050232 + }, + { + "step": 192, + "loss": 0.24050910770893097, + "objective": 0.24050910770893097, + "error": 0.087890625, + "gradient_norm": 0.052534136921167374, + "elapsed": 156.545964717865 + }, + { + "step": 208, + "loss": 0.3183761537075043, + "objective": 0.3183761537075043, + "error": 0.1435546875, + "gradient_norm": 0.05253623053431511, + "elapsed": 166.62695455551147 + }, + { + "step": 224, + "loss": 0.6407097578048706, + "objective": 0.6407097578048706, + "error": 0.3837890625, + "gradient_norm": 0.08772490173578262, + "elapsed": 174.46970582008362 + }, + { + "step": 240, + "loss": 0.597212553024292, + "objective": 0.597212553024292, + "error": 0.36328125, + "gradient_norm": 0.13039150834083557, + "elapsed": 184.2768793106079 + }, + { + "step": 256, + "loss": 0.3317721486091614, + "objective": 0.3317721486091614, + "error": 0.14453125, + "gradient_norm": 0.03749232366681099, + "elapsed": 194.6345317363739 + }, + { + "step": 272, + "loss": 0.6330116987228394, + "objective": 0.6330116987228394, + "error": 0.3955078125, + "gradient_norm": 0.06468097865581512, + "elapsed": 205.8717017173767 + }, + { + "step": 288, + "loss": 0.3141757845878601, + "objective": 0.3141757845878601, + "error": 0.138671875, + "gradient_norm": 0.046496689319610596, + "elapsed": 215.2117359638214 + }, + { + "step": 304, + "loss": 0.5782994031906128, + "objective": 0.5782994031906128, + "error": 0.345703125, + "gradient_norm": 0.06487675756216049, + "elapsed": 225.47403240203857 + }, + { + "step": 320, + "loss": 0.45729100704193115, + "objective": 0.45729100704193115, + "error": 0.2255859375, + "gradient_norm": 0.04169687256217003, + "elapsed": 233.03686332702637 + }, + { + "step": 336, + "loss": 0.49350813031196594, + "objective": 0.49350813031196594, + "error": 0.24609375, + "gradient_norm": 0.08623651415109634, + "elapsed": 244.53246903419495 + }, + { + "step": 352, + "loss": 0.25660067796707153, + "objective": 0.25660067796707153, + "error": 0.1103515625, + "gradient_norm": 0.03029652312397957, + "elapsed": 254.88137793540955 + }, + { + "step": 368, + "loss": 0.2295728325843811, + "objective": 0.2295728325843811, + "error": 0.0966796875, + "gradient_norm": 0.042884912341833115, + "elapsed": 262.7415475845337 + }, + { + "step": 384, + "loss": 0.6214326620101929, + "objective": 0.6214326620101929, + "error": 0.3759765625, + "gradient_norm": 0.08176509290933609, + "elapsed": 271.72958397865295 + }, + { + "step": 400, + "loss": 0.6463049650192261, + "objective": 0.6463049650192261, + "error": 0.3984375, + "gradient_norm": 0.08226390928030014, + "elapsed": 281.51069259643555 + }, + { + "step": 416, + "loss": 0.024987798184156418, + "objective": 0.024987798184156418, + "error": 0.0078125, + "gradient_norm": 0.0075854891911149025, + "elapsed": 291.0118627548218 + }, + { + "step": 432, + "loss": 0.5520929098129272, + "objective": 0.5520929098129272, + "error": 0.3125, + "gradient_norm": 0.09755270183086395, + "elapsed": 301.23231768608093 + }, + { + "step": 448, + "loss": 0.6077401638031006, + "objective": 0.6077401638031006, + "error": 0.361328125, + "gradient_norm": 0.04908076301217079, + "elapsed": 312.93572759628296 + }, + { + "step": 464, + "loss": 0.016434211283922195, + "objective": 0.016434211283922195, + "error": 0.005859375, + "gradient_norm": 0.007213531993329525, + "elapsed": 323.8330478668213 + }, + { + "step": 480, + "loss": 0.1582300364971161, + "objective": 0.1582300364971161, + "error": 0.064453125, + "gradient_norm": 0.028335656970739365, + "elapsed": 334.6112554073334 + }, + { + "step": 496, + "loss": 0.5916742086410522, + "objective": 0.5916742086410522, + "error": 0.35546875, + "gradient_norm": 0.08213689178228378, + "elapsed": 345.8490369319916 + }, + { + "step": 512, + "loss": 0.11447565257549286, + "objective": 0.11447565257549286, + "error": 0.04296875, + "gradient_norm": 0.028994916006922722, + "elapsed": 358.71793270111084 + }, + { + "step": 528, + "loss": 0.3011414408683777, + "objective": 0.3011414408683777, + "error": 0.1435546875, + "gradient_norm": 0.04305516928434372, + "elapsed": 373.143226146698 + }, + { + "step": 544, + "loss": 0.3099900782108307, + "objective": 0.3099900782108307, + "error": 0.130859375, + "gradient_norm": 0.06152835488319397, + "elapsed": 380.42762184143066 + }, + { + "step": 560, + "loss": 0.42917633056640625, + "objective": 0.42917633056640625, + "error": 0.203125, + "gradient_norm": 0.051812849938869476, + "elapsed": 390.78397703170776 + }, + { + "step": 576, + "loss": 0.4895544648170471, + "objective": 0.4895544648170471, + "error": 0.2451171875, + "gradient_norm": 0.059052009135484695, + "elapsed": 400.29374146461487 + }, + { + "step": 592, + "loss": 0.5950886011123657, + "objective": 0.5950886011123657, + "error": 0.328125, + "gradient_norm": 0.1449151188135147, + "elapsed": 410.06920647621155 + }, + { + "step": 608, + "loss": 0.3282078504562378, + "objective": 0.3282078504562378, + "error": 0.1484375, + "gradient_norm": 0.06495015323162079, + "elapsed": 420.5240683555603 + }, + { + "step": 624, + "loss": 0.6034166812896729, + "objective": 0.6034166812896729, + "error": 0.3388671875, + "gradient_norm": 0.05658626928925514, + "elapsed": 430.7997169494629 + }, + { + "step": 640, + "loss": 0.590431809425354, + "objective": 0.590431809425354, + "error": 0.3447265625, + "gradient_norm": 0.046094730496406555, + "elapsed": 441.8197224140167 + }, + { + "step": 656, + "loss": 0.2260439246892929, + "objective": 0.2260439246892929, + "error": 0.1015625, + "gradient_norm": 0.06323576718568802, + "elapsed": 450.76086831092834 + }, + { + "step": 672, + "loss": 0.26158156991004944, + "objective": 0.26158156991004944, + "error": 0.1162109375, + "gradient_norm": 0.08324819058179855, + "elapsed": 459.1986529827118 + }, + { + "step": 688, + "loss": 0.4871026873588562, + "objective": 0.4871026873588562, + "error": 0.244140625, + "gradient_norm": 0.051720812916755676, + "elapsed": 470.4437210559845 + }, + { + "step": 704, + "loss": 0.5861694812774658, + "objective": 0.5861694812774658, + "error": 0.341796875, + "gradient_norm": 0.05766218528151512, + "elapsed": 483.85575103759766 + }, + { + "step": 720, + "loss": 0.4168863296508789, + "objective": 0.4168863296508789, + "error": 0.21484375, + "gradient_norm": 0.05056491494178772, + "elapsed": 494.63891077041626 + }, + { + "step": 736, + "loss": 0.42054638266563416, + "objective": 0.42054638266563416, + "error": 0.21875, + "gradient_norm": 0.07021808624267578, + "elapsed": 505.4899232387543 + }, + { + "step": 752, + "loss": 0.2022928148508072, + "objective": 0.2022928148508072, + "error": 0.0849609375, + "gradient_norm": 0.0765448734164238, + "elapsed": 516.2925503253937 + }, + { + "step": 768, + "loss": 0.026398655027151108, + "objective": 0.026398655027151108, + "error": 0.0068359375, + "gradient_norm": 0.00973521638661623, + "elapsed": 524.7940125465393 + }, + { + "step": 784, + "loss": 0.5843480825424194, + "objective": 0.5843480825424194, + "error": 0.345703125, + "gradient_norm": 0.04805552959442139, + "elapsed": 535.345025062561 + }, + { + "step": 800, + "loss": 0.3102012872695923, + "objective": 0.3102012872695923, + "error": 0.134765625, + "gradient_norm": 0.09761057049036026, + "elapsed": 544.4683487415314 + }, + { + "step": 816, + "loss": 0.5332639217376709, + "objective": 0.5332639217376709, + "error": 0.30078125, + "gradient_norm": 0.10398133844137192, + "elapsed": 554.8217175006866 + }, + { + "step": 832, + "loss": 0.4870310425758362, + "objective": 0.4870310425758362, + "error": 0.2685546875, + "gradient_norm": 0.05754273384809494, + "elapsed": 564.9130115509033 + }, + { + "step": 848, + "loss": 0.1336989849805832, + "objective": 0.1336989849805832, + "error": 0.0498046875, + "gradient_norm": 0.02862304449081421, + "elapsed": 573.6143791675568 + }, + { + "step": 864, + "loss": 0.5794297456741333, + "objective": 0.5794297456741333, + "error": 0.3427734375, + "gradient_norm": 0.05002075806260109, + "elapsed": 584.2565310001373 + }, + { + "step": 880, + "loss": 0.6150081753730774, + "objective": 0.6150081753730774, + "error": 0.341796875, + "gradient_norm": 0.0605069138109684, + "elapsed": 596.845867395401 + }, + { + "step": 896, + "loss": 0.3804032504558563, + "objective": 0.3804032504558563, + "error": 0.18359375, + "gradient_norm": 0.057405781000852585, + "elapsed": 606.0786938667297 + }, + { + "step": 912, + "loss": 0.5734928846359253, + "objective": 0.5734928846359253, + "error": 0.2958984375, + "gradient_norm": 0.06807747483253479, + "elapsed": 616.9755277633667 + }, + { + "step": 928, + "loss": 0.23615539073944092, + "objective": 0.23615539073944092, + "error": 0.107421875, + "gradient_norm": 0.04033413156867027, + "elapsed": 625.9104406833649 + }, + { + "step": 944, + "loss": 0.5668450593948364, + "objective": 0.5668450593948364, + "error": 0.3134765625, + "gradient_norm": 0.04825817048549652, + "elapsed": 635.4241654872894 + }, + { + "step": 960, + "loss": 0.1369795948266983, + "objective": 0.1369795948266983, + "error": 0.0537109375, + "gradient_norm": 0.029475854709744453, + "elapsed": 646.0763671398163 + }, + { + "step": 976, + "loss": 0.026218727231025696, + "objective": 0.026218727231025696, + "error": 0.009765625, + "gradient_norm": 0.0067830472253263, + "elapsed": 656.7150173187256 + }, + { + "step": 992, + "loss": 0.6016548871994019, + "objective": 0.6016548871994019, + "error": 0.3564453125, + "gradient_norm": 0.04935981705784798, + "elapsed": 668.9989516735077 + }, + { + "step": 1008, + "loss": 0.1370980143547058, + "objective": 0.1370980143547058, + "error": 0.0546875, + "gradient_norm": 0.04418199881911278, + "elapsed": 677.3821382522583 + }, + { + "step": 1024, + "loss": 0.4085504412651062, + "objective": 0.4085504412651062, + "error": 0.19921875, + "gradient_norm": 0.07943295687437057, + "elapsed": 688.8395888805389 + }, + { + "step": 1040, + "loss": 0.34129297733306885, + "objective": 0.34129297733306885, + "error": 0.15625, + "gradient_norm": 0.04551500454545021, + "elapsed": 703.4613966941833 + }, + { + "step": 1056, + "loss": 0.5297085046768188, + "objective": 0.5297085046768188, + "error": 0.2705078125, + "gradient_norm": 0.06177444010972977, + "elapsed": 714.0862259864807 + }, + { + "step": 1072, + "loss": 0.3833361268043518, + "objective": 0.3833361268043518, + "error": 0.185546875, + "gradient_norm": 0.053057629615068436, + "elapsed": 724.1480000019073 + }, + { + "step": 1088, + "loss": 0.6497273445129395, + "objective": 0.6497273445129395, + "error": 0.421875, + "gradient_norm": 0.10790837556123734, + "elapsed": 735.8740057945251 + }, + { + "step": 1104, + "loss": 0.5393906831741333, + "objective": 0.5393906831741333, + "error": 0.2998046875, + "gradient_norm": 0.06015805900096893, + "elapsed": 743.9961709976196 + }, + { + "step": 1120, + "loss": 0.38553956151008606, + "objective": 0.38553956151008606, + "error": 0.1875, + "gradient_norm": 0.05357081815600395, + "elapsed": 753.2208635807037 + }, + { + "step": 1136, + "loss": 0.5478834509849548, + "objective": 0.5478834509849548, + "error": 0.2900390625, + "gradient_norm": 0.05761478468775749, + "elapsed": 761.3359644412994 + }, + { + "step": 1152, + "loss": 0.5732287168502808, + "objective": 0.5732287168502808, + "error": 0.341796875, + "gradient_norm": 0.07881136238574982, + "elapsed": 771.133172750473 + }, + { + "step": 1168, + "loss": 0.5174047946929932, + "objective": 0.5174047946929932, + "error": 0.29296875, + "gradient_norm": 0.07794999331235886, + "elapsed": 783.7084786891937 + }, + { + "step": 1184, + "loss": 0.5022754669189453, + "objective": 0.5022754669189453, + "error": 0.265625, + "gradient_norm": 0.05175226181745529, + "elapsed": 793.499255657196 + }, + { + "step": 1200, + "loss": 0.5698775053024292, + "objective": 0.5698775053024292, + "error": 0.34375, + "gradient_norm": 0.06385946273803711, + "elapsed": 804.970814704895 + }, + { + "step": 1216, + "loss": 0.6203033924102783, + "objective": 0.6203033924102783, + "error": 0.37109375, + "gradient_norm": 0.07393646240234375, + "elapsed": 816.1773698329926 + }, + { + "step": 1232, + "loss": 0.6154648065567017, + "objective": 0.6154648065567017, + "error": 0.3857421875, + "gradient_norm": 0.04278155043721199, + "elapsed": 827.3619928359985 + }, + { + "step": 1248, + "loss": 0.5948328971862793, + "objective": 0.5948328971862793, + "error": 0.3291015625, + "gradient_norm": 0.062024734914302826, + "elapsed": 838.8370804786682 + }, + { + "step": 1264, + "loss": 0.5644958019256592, + "objective": 0.5644958019256592, + "error": 0.3212890625, + "gradient_norm": 0.12030917406082153, + "elapsed": 849.5000331401825 + }, + { + "step": 1280, + "loss": 0.028782427310943604, + "objective": 0.028782427310943604, + "error": 0.0087890625, + "gradient_norm": 0.009096251800656319, + "elapsed": 857.8837285041809 + }, + { + "step": 1296, + "loss": 0.5129679441452026, + "objective": 0.5129679441452026, + "error": 0.2626953125, + "gradient_norm": 0.12833116948604584, + "elapsed": 868.5195860862732 + }, + { + "step": 1312, + "loss": 0.4095553159713745, + "objective": 0.4095553159713745, + "error": 0.193359375, + "gradient_norm": 0.09977155178785324, + "elapsed": 877.4712297916412 + }, + { + "step": 1328, + "loss": 0.2850862741470337, + "objective": 0.2850862741470337, + "error": 0.1240234375, + "gradient_norm": 0.05365074798464775, + "elapsed": 887.5133347511292 + }, + { + "step": 1344, + "loss": 0.41809165477752686, + "objective": 0.41809165477752686, + "error": 0.19140625, + "gradient_norm": 0.10622142255306244, + "elapsed": 895.0828025341034 + }, + { + "step": 1360, + "loss": 0.3627069890499115, + "objective": 0.3627069890499115, + "error": 0.1650390625, + "gradient_norm": 0.049557290971279144, + "elapsed": 906.2595431804657 + }, + { + "step": 1376, + "loss": 0.023341629654169083, + "objective": 0.023341629654169083, + "error": 0.0068359375, + "gradient_norm": 0.008970360271632671, + "elapsed": 916.6110022068024 + }, + { + "step": 1392, + "loss": 0.519214391708374, + "objective": 0.519214391708374, + "error": 0.26953125, + "gradient_norm": 0.052287619560956955, + "elapsed": 926.660523891449 + }, + { + "step": 1408, + "loss": 0.6152850389480591, + "objective": 0.6152850389480591, + "error": 0.3662109375, + "gradient_norm": 0.049617987126111984, + "elapsed": 936.7533056735992 + }, + { + "step": 1424, + "loss": 0.020841240882873535, + "objective": 0.020841240882873535, + "error": 0.0068359375, + "gradient_norm": 0.008459246717393398, + "elapsed": 946.8231542110443 + }, + { + "step": 1440, + "loss": 0.5963407754898071, + "objective": 0.5963407754898071, + "error": 0.3525390625, + "gradient_norm": 0.08714025467634201, + "elapsed": 956.0344398021698 + }, + { + "step": 1456, + "loss": 0.44305220246315, + "objective": 0.44305220246315, + "error": 0.2099609375, + "gradient_norm": 0.061915796250104904, + "elapsed": 967.506050825119 + }, + { + "step": 1472, + "loss": 0.5292993783950806, + "objective": 0.5292993783950806, + "error": 0.2939453125, + "gradient_norm": 0.10089804977178574, + "elapsed": 977.855934381485 + }, + { + "step": 1488, + "loss": 0.6087026596069336, + "objective": 0.6087026596069336, + "error": 0.345703125, + "gradient_norm": 0.05276322737336159, + "elapsed": 986.2705359458923 + }, + { + "step": 1504, + "loss": 0.3670162558555603, + "objective": 0.3670162558555603, + "error": 0.1796875, + "gradient_norm": 0.0575372576713562, + "elapsed": 995.2220902442932 + }, + { + "step": 1520, + "loss": 0.33479321002960205, + "objective": 0.33479321002960205, + "error": 0.1435546875, + "gradient_norm": 0.056317709386348724, + "elapsed": 1005.2168045043945 + }, + { + "step": 1536, + "loss": 0.5869293212890625, + "objective": 0.5869293212890625, + "error": 0.337890625, + "gradient_norm": 0.07419256865978241, + "elapsed": 1016.8691458702087 + } + ], + "reserved_sampling_audit": { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved2_full", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "0f5926c94bb1aa83840c6d257757b80c081835affc2cb34bf9246ba18e00266a", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 512, + 1024, + 1536 + ], + "training_draws": 1572864, + "distinct_phase_training_rows": 467790, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 18254, + "surface_code_bX_d5_r03_center_5_5": 18525, + "surface_code_bX_d5_r05_center_5_5": 18175, + "surface_code_bX_d5_r07_center_5_5": 18005, + "surface_code_bX_d5_r09_center_5_5": 18067, + "surface_code_bX_d5_r11_center_5_5": 18445, + "surface_code_bX_d5_r13_center_5_5": 18673, + "surface_code_bX_d5_r15_center_5_5": 17345, + "surface_code_bX_d5_r17_center_5_5": 17898, + "surface_code_bX_d5_r19_center_5_5": 18359, + "surface_code_bX_d5_r21_center_5_5": 18036, + "surface_code_bX_d5_r23_center_5_5": 17255, + "surface_code_bX_d5_r25_center_5_5": 18057, + "surface_code_bZ_d5_r01_center_5_5": 17596, + "surface_code_bZ_d5_r03_center_5_5": 18333, + "surface_code_bZ_d5_r05_center_5_5": 18250, + "surface_code_bZ_d5_r07_center_5_5": 18210, + "surface_code_bZ_d5_r09_center_5_5": 17447, + "surface_code_bZ_d5_r11_center_5_5": 18120, + "surface_code_bZ_d5_r13_center_5_5": 18224, + "surface_code_bZ_d5_r15_center_5_5": 17857, + "surface_code_bZ_d5_r17_center_5_5": 18359, + "surface_code_bZ_d5_r19_center_5_5": 17398, + "surface_code_bZ_d5_r21_center_5_5": 18235, + "surface_code_bZ_d5_r23_center_5_5": 16653, + "surface_code_bZ_d5_r25_center_5_5": 18014 + }, + "initial_optimizer_count": 512, + "last_optimizer_count": 2048, + "parent_checkpoint_sha256": "2b00e3f258886b5c4ecf69f36fd5463a205eefc84bd10c550acc391e84515c24", + "test_data_used": false + }, + "declared_study_plan": { + "hypothesis": "Fresh independent experts with an excluded training partition permit an honest combiner fit and an independent training-period diagnostic", + "experts": [ + { + "name": "reserved1", + "initial_seed": 20261271, + "sampling_seed": 20261272 + }, + { + "name": "reserved2", + "initial_seed": 20261273, + "sampling_seed": 20261274 + } + ], + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "partition": "Per26 d5 conditions:18856 fit,512 combiner,512 diagnostic rows; uniformly random partition seed20261270; sample IDs only check alignment", + "architecture": "Unchanged394-input64-unit neural correction, bound2, fixed physical pass3 priors, exact relevant-CSS contraction", + "training": "Each new expert:512 updates B1024 LR.001 from random initialization;1536 updates LR.0005 restoring own Adam/RNG state. Uniform eligible condition and row sampling, BCE, clip1,AdamW decay1e-4", + "validation_selection": "All26conditions/13durations: main-phase0/512/1024/1536, raw and equal-physical options versus incumbent, then fixed original/new ensembles with physical fractions0/.25/.5. Full replay/contract verification required before publication", + "combiner_expert_selection": "For each new expert and basis, minimum raw full-validation mean failure across0/512/1024/1536; earlier listed checkpoint wins ties. Freeze before using reserved labels", + "combiner_plan": "Fit small regularized syndrome-dependent mixtures using only the512 gate rows/condition. Diagnostic512 rows/condition must not fit or select weights/checkpoints/hyperparameters", + "holdout_prediction_generation": "Both reserved parts predicted without accessing label NPZ members; diagnostics only after final combiner selection is frozen", + "test_data_used": false + }, + "pipeline_control": { + "status": "passed", + "backend": "CPU", + "training_source_sha256": { + "learned_d5__reserved_train.py": "f1789039eb1500b30f716864237b9c564887ccb615f117fb9fb1a0ff15f54ff0", + "learned_d5__reserved_split.py": "69f3d3741a9625b1d70490f45202f101b6cd61b6bf332977559ec14307597456", + "learned_d5__data.py": "9e3bcfe9d45f6af60b86a580cdc9374043758a1a6f10564aef9eb344f7a6b364", + "learned_d5__model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "learned_exact__gradient.py": "ecb6b45698480386fa124fe878db7dbfa246d1969fd720ec26daff9547da2001", + "learned_exact__checkpoint_gradient.py": "7ece6b3f45e009727fd104a3d39e2816a8c3437f737c3d98131d3a5d7d60e9b8", + "exact_d3__exact.py": "869dfacb295c419c156d1070fc2afdd6e20d02ac1840e45e72346b2b289f4825" + }, + "control_sha256": "0302573e82d5113dfe1f63080b21b6976cc05b2ddb3677a640b005fc6050aa66", + "audits": [ + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke1", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ad3b3170d682b103f82456476e4a4f7c3096707269b72c242ec43d820dc06856", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 2, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 0, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 0, + "last_optimizer_count": 1, + "parent_checkpoint_sha256": null, + "test_data_used": false + }, + { + "status": "passed", + "run": "/run-state/workspace/research/learned_d5/reserved_smoke2", + "partition_manifest_sha256": "241221ce16d1d4fc634bdfef691aa2a40d888f6cb75e981485c570905056257b", + "source_sha256": "0b474c57cd4d84ef86c631af7473eac8a956f03b7e4c9859efc1fbf2dbd0bca6", + "training_config_sha256": "ea2e649b4880641cb0c7e7b7a349d4174ce4dd276c4cdbac376e9c087f00ea1f", + "fit_pool": 490256, + "gate_rows_excluded": 13312, + "audit_rows_excluded": 13312, + "sampling_replayed_checkpoints": [ + 1 + ], + "training_draws": 2, + "distinct_phase_training_rows": 2, + "distinct_by_condition": { + "surface_code_bX_d5_r01_center_5_5": 0, + "surface_code_bX_d5_r03_center_5_5": 0, + "surface_code_bX_d5_r05_center_5_5": 0, + "surface_code_bX_d5_r07_center_5_5": 0, + "surface_code_bX_d5_r09_center_5_5": 0, + "surface_code_bX_d5_r11_center_5_5": 0, + "surface_code_bX_d5_r13_center_5_5": 0, + "surface_code_bX_d5_r15_center_5_5": 0, + "surface_code_bX_d5_r17_center_5_5": 0, + "surface_code_bX_d5_r19_center_5_5": 0, + "surface_code_bX_d5_r21_center_5_5": 0, + "surface_code_bX_d5_r23_center_5_5": 0, + "surface_code_bX_d5_r25_center_5_5": 0, + "surface_code_bZ_d5_r01_center_5_5": 0, + "surface_code_bZ_d5_r03_center_5_5": 0, + "surface_code_bZ_d5_r05_center_5_5": 0, + "surface_code_bZ_d5_r07_center_5_5": 0, + "surface_code_bZ_d5_r09_center_5_5": 0, + "surface_code_bZ_d5_r11_center_5_5": 0, + "surface_code_bZ_d5_r13_center_5_5": 0, + "surface_code_bZ_d5_r15_center_5_5": 0, + "surface_code_bZ_d5_r17_center_5_5": 0, + "surface_code_bZ_d5_r19_center_5_5": 0, + "surface_code_bZ_d5_r21_center_5_5": 2, + "surface_code_bZ_d5_r23_center_5_5": 0, + "surface_code_bZ_d5_r25_center_5_5": 0 + }, + "initial_optimizer_count": 1, + "last_optimizer_count": 2, + "parent_checkpoint_sha256": "faf01476f397259640c31a761f9774af9c0592e9118c38ffdce9502acdfcfb31", + "test_data_used": false + } + ], + "initialization_exact": true, + "parameters_updated": true, + "smoke_runs_excluded_from_selection_and_submission": true, + "test_data_used": false + } + }, + "training_source_snapshot": "training_sources/reserved2_full", + "selection": "Minimum full-validation condition-mean failure per basis group over incumbent, listed neural checkpoints and equal probability averages with the recorded physical decoder.", + "physical_prediction_reference": "/run-state/workspace/research/context_upgrades/turbo1/predictions", + "prior_pass": 3, + "history": [ + { + "group": "d5_bX_center_5_5", + "candidates": { + "incumbent": 0.23212139423076927, + "0": 0.23353365384615382, + "blend-0": 0.23306790865384613, + "512": 0.23380408653846152, + "blend-512": 0.23366887019230773, + "1024": 0.23197115384615388, + "blend-1024": 0.23299278846153842, + "1536": 0.23206129807692305, + "blend-1536": 0.2329326923076923 + }, + "selected": "1024" + }, + { + "group": "d5_bZ_center_5_5", + "candidates": { + "incumbent": 0.21953124999999998, + "0": 0.22103365384615387, + "blend-0": 0.2211388221153846, + "512": 0.22092848557692304, + "blend-512": 0.22094350961538464, + "1024": 0.2204326923076923, + "blend-1024": 0.22046274038461539, + "1536": 0.22086838942307688, + "blend-1536": 0.22059795673076926 + }, + "selected": "incumbent" + } + ], + "checkpoints": { + "1024": { + "step": 1024, + "training_samples": 1048576, + "unique_training_rows_seen_in_this_phase": 428858, + "weights_sha256": "a346f535004381e2e0b628fac8ff7c58282a2447b9704638e46232dff46e511f", + "complete": true + } + }, + "runtime": "Share physical priors when the conditioning pass and regime agree; otherwise recompute the neural prior independently. Last-only physical branches omit unused intermediate logical tracking; raw neural branches also omit the unused final physical readout.", + "last_only_equivalence_controls": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "maximum_probability_difference": 7.450580596923828e-07 + }, + { + "condition": "surface_code_bZ_d5_r03_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "maximum_probability_difference": 5.960464477539063e-08 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "maximum_probability_difference": 1.7881393432617188e-07 + } + ], + "test_data_used": false, + "numerical_controls": { + "packaged_runtime_control_cpu": { + "device": "cpu", + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 7, + "same_cpu_old_vs_new_maximum_difference": 0.0, + "old_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "new_cpu_vs_original_gpu_evaluation_maximum_difference": 4.971027374267578e-05, + "cpu_vs_reconstructed_old_gpu_runtime_maximum_difference": 4.976987838745117e-05, + "original_gpu_evaluation_vs_reconstructed_gpu_runtime_maximum_difference": 7.748603820800781e-07, + "initial_failed_control": { + "comparison": "CPU runtime against original GPU evaluator", + "observed_maximum_difference": 4.971027374267578e-05, + "original_tolerance": 3e-06 + }, + "sources": { + "d5_base_context_model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "d5_context_model.py": "53342e15dcbb8bc2dd0b288d75ea115fb504be99a33bc283a518b9d76232cd99", + "d5_temporal_context_model.py": "d58bcfe01767228d18ce2078d555abf13037b5df63edf38273ba66f0966ee445", + "d5_history_context_model.py": "4cc383b4909ff740bccfd20b687f8ee46866e67f93f82fe6c4bace162149ffb4", + "d5_history_features.py": "d709cd54225aa1b14707afa436314c8392f59f748a0007d988c6d18dedd275ee", + "d5_contextual.py": "59d6c85dc4bd61e26cf7243baf0e2637c3de1d35327b2c763707badd19446550", + "turbo.py": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b" + }, + "scope": "Same-device compatibility check. Reconstructed GPU runtime removes the recorded equal physical blend; that reconstruction has floating-point rounding uncertainty.", + "status": "passed_same_device_compatibility" + }, + "dispatcher_control_cpu": { + "status": "passed", + "device": "cpu", + "sources": { + "d5_context_model.py": "53342e15dcbb8bc2dd0b288d75ea115fb504be99a33bc283a518b9d76232cd99", + "d5_base_context_model.py": "3b2d4b34a8945ddfe82d76e28b4aa917f11933ed885c0cdcd2bc389448a871fb", + "d5_temporal_context_model.py": "d58bcfe01767228d18ce2078d555abf13037b5df63edf38273ba66f0966ee445", + "d5_history_context_model.py": "4cc383b4909ff740bccfd20b687f8ee46866e67f93f82fe6c4bace162149ffb4", + "d5_history_features.py": "d709cd54225aa1b14707afa436314c8392f59f748a0007d988c6d18dedd275ee" + }, + "cases": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "base64", + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "base128", + "weights_sha256": "2a21869e7669492fac8252131434b2e09c97f1def2714988382ab7f127371bd8", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "temporal", + "weights_sha256": "9446a1e6dc46e1bcae540531e4f124930bb151ebfa600746ca77bc8f5b2aaa7c", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "architecture": "history", + "weights_sha256": "c508d8968ffa143be4219a207fb54ece3e1bfe144b8a880e4ed4f3d13f092c1e", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "base64", + "weights_sha256": "fb250c19cf7bb00741b6d862b8f646a2c8ab88397bb03c7bafc9085f9347eca5", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "base128", + "weights_sha256": "2a21869e7669492fac8252131434b2e09c97f1def2714988382ab7f127371bd8", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "temporal", + "weights_sha256": "9446a1e6dc46e1bcae540531e4f124930bb151ebfa600746ca77bc8f5b2aaa7c", + "maximum_edge_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "architecture": "history", + "weights_sha256": "c508d8968ffa143be4219a207fb54ece3e1bfe144b8a880e4ed4f3d13f092c1e", + "maximum_edge_probability_difference": 0.0 + } + ], + "scope": "Routing and code-copy check against each direct model implementation, using training detector inputs without labels. Tiny trained temporal/history smoke weights test nonzero feature couplings; they are excluded from model selection and submission.", + "test_data_used": false + }, + "cpu_probability_precision": { + "condition": "surface_code_bX_d5_r03_center_5_5", + "validation_syndromes": 7, + "logical_labels_used": false, + "parameter_updates": 0, + "reference": "Float64 neural forward and exact contraction from the same stored weights and fixed float32 input logits, on CPU", + "cpu_float32_vs_float64_maximum_difference": 7.624897924163321e-08, + "cpu_float32_edges_float64_contraction_vs_float64_maximum_difference": 4.725248914372315e-08, + "gpu_float32_vs_float64_maximum_difference": 4.964999121059854e-05, + "cpu_vs_gpu_float32_maximum_difference": 4.971027374267578e-05, + "maximum_neural_edge_probability_difference": 2.6330936014895556e-08, + "float32_edge_values_above_one_minus_1e6": 0, + "scope": "Precision diagnostic only; the published model is unchanged. Same-device old/new packaged-code compatibility was independently exact." + }, + "priors_only_control_cpu": { + "status": "passed", + "device": "cpu", + "source_sha256": "c07dce8d7098142f5cd550d594b948290287a8cb2221f70acaeff3965c3dac0b", + "records": [ + { + "condition": "surface_code_bX_d5_r03_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 2.7116777896881104, + "priors_only_seconds_warm": 0.13569164276123047 + }, + { + "condition": "surface_code_bZ_d5_r25_center_5_5", + "shots": 3, + "priors_bitwise_identical": true, + "normal_seconds_including_compilation": 3.557781457901001, + "priors_only_seconds_warm": 1.7711329460144043 + } + ], + "scope": "CPU numerical equivalence on supplied training syndromes; timings are not a controlled speed comparison." + } + } + }, + "package_validation": { + "performance": 0.7672400841346154, + "failure_by_distance": { + "d3": 0.2398212139423077, + "d5": 0.22569861778846154 + }, + "scorer": "Supplied qecbench.scoring on all 130 validation conditions and 665600 shots", + "contract_checks": [ + { + "condition": "surface_code_bX_d3_r01_center_3_5", + "shots": 1, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d3_r25_center_5_3", + "shots": 37, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d3_r13_center_5_7", + "shots": 1025, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r01_center_5_5", + "shots": 7, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bZ_d5_r09_center_5_5", + "shots": 257, + "maximum_probability_difference": 0.0 + }, + { + "condition": "surface_code_bX_d5_r25_center_5_5", + "shots": 17, + "maximum_probability_difference": 0.0 + } + ], + "prediction_generation": "All26 d5 conditions replayed from the assembled package; unchanged d3 predictions retained. Full trusted scoring and relocated arbitrary-ID/subset checks.", + "runtime_evidence": "Full133120-shot d5 replay took 322.10s on one H100; d3 paths unchanged from the recorded incumbent.", + "d5_validation_runtime_seconds": 322.1027355194092, + "runtime_vs_cached": { + "scope": "Assembled runtime versus cached candidate predictions, including physical-prior recomputation and compilation/batching differences; descriptive, not a causal precision attribution", + "maximum_probability_difference": 4.285573959350586e-05, + "decision_differences": 0, + "source_sha256": "2e3e81d122f9d626d486d050c38d86bfd3e55bc6cd8e0e270b9e8eabbf69539a" + }, + "contract_execution": { + "requested_verifier_uid": 10001, + "effective_uid": 1000, + "effective_gid": 1000, + "supplementary_groups": [], + "identity_status": "Development process is already unprivileged and cannot change UID; verifier UID10001 was not executed", + "model_and_input_copy": "Owned by development UID 1000,directories0555,files0444,relocated under a fresh accessible temporary parent", + "output_directory": "Owned by execution UID 1000,mode0700", + "PYTHONPATH": "", + "backend": "Runtime default; full selected subset cases", + "scope": "Local contract check; not a Docker/network/mount-isolation test" + } + } +} diff --git a/shared/package-files/08/08cb68e4b52a4f2bfc9b486c131a6f111050f7e5179f2b5dc264f610854036f2/blob b/shared/package-files/08/08cb68e4b52a4f2bfc9b486c131a6f111050f7e5179f2b5dc264f610854036f2/blob new file mode 100644 index 0000000000000000000000000000000000000000..4d1a872685514fd7a8bc4b77deb191ecd660cab0 --- /dev/null +++ b/shared/package-files/08/08cb68e4b52a4f2bfc9b486c131a6f111050f7e5179f2b5dc264f610854036f2/blob @@ -0,0 +1,632 @@ +# mypy: ignore-errors + +import torch +from functools import partial +from torch.testing import make_tensor +from torch.testing._internal.opinfo.core import ( + OpInfo, + SampleInput, +) +from torch.testing._internal.common_dtype import all_types_and +import numpy as np + +# Note: [autograd.Function db] +# +# This is a collection of autograd.Function test cases written as OpInfos +# so they can easily be consumed by OpInfo-based tests to check if a subsystem +# supports autograd.Function. +# +# Axes: +# - saves {output, input, intermediate, non-tensor} +# - {inputs, output} x {single tensor, tensors, arbitrary objects} +# - Uses {mark_dirty, mark_non_differentiable, once_differentiable} + + +def to_numpy(tensor): + return tensor.cpu().numpy() + + +class NumpyCube(torch.autograd.Function): + @staticmethod + def forward(input): + input_np = to_numpy(input) + dinput = torch.tensor(3 * input_np ** 2, device=input.device) + return torch.tensor(input_np ** 3, device=input.device), dinput + + @staticmethod + def setup_context(ctx, inputs, output): + ctx.save_for_backward(inputs[0], output[1]) + ctx.save_for_forward(inputs[0], output[1]) + + @staticmethod + def backward(ctx, grad_output, grad_saved): + input, dinput = ctx.saved_tensors + return NumpyMul.apply(grad_output, dinput) + 6 * NumpyMul.apply(grad_saved, input) + + @staticmethod + def vmap(info, in_dims, input): + result = NumpyCube.apply(input) + return result, (in_dims[0], in_dims[0]) + + @staticmethod + def jvp(ctx, input_tangent): + input, dinput = ctx.saved_tensors + return NumpyMul.apply(input_tangent, dinput), 6 * NumpyMul.apply(input_tangent, input) + + +class CubeGenVmap(torch.autograd.Function): + generate_vmap_rule = True + + @staticmethod + def forward(x): + return x ** 3, 3 * x ** 2 + + @staticmethod + def setup_context(ctx, inputs, outputs): + ctx.save_for_backward(inputs[0], outputs[1]) + ctx.save_for_forward(inputs[0], outputs[1]) + + @staticmethod + def backward(ctx, grad_output, grad_saved): + input, dinput = ctx.saved_tensors + result = grad_output * dinput + 6 * dinput + return result + + @staticmethod + def jvp(ctx, input_tangent): + input, dinput = ctx.saved_tensors + return MulGenVmap.apply(input_tangent, dinput), 6 * NumpyMul.apply(input_tangent, input) + + +def sample_inputs_numpy_cube(opinfo, device, dtype, requires_grad, **kwargs): + make_arg = partial(make_tensor, device=device, dtype=dtype, requires_grad=requires_grad) + yield SampleInput(make_arg(1, low=0.8, high=2), args=()) + + +class NumpyCubeNotComposable(torch.autograd.Function): + @staticmethod + def forward(input): + input_np = to_numpy(input) + return torch.tensor(input_np ** 3, device=input.device), input_np + + @staticmethod + def setup_context(ctx, inputs, output): + _, input_np = output + ctx.input_np = input_np + ctx.device = inputs[0].device + + @staticmethod + @torch.autograd.function.once_differentiable + def backward(ctx, grad_output, grad_saved): + result_np = 3 * (ctx.input_np ** 2) + return torch.tensor(result_np, device=ctx.device) + + +class NumpyMul(torch.autograd.Function): + @staticmethod + def forward(x, y): + return torch.tensor(to_numpy(x) * to_numpy(y), device=x.device) + + @staticmethod + def setup_context(ctx, inputs, output): + ctx.save_for_backward(*inputs) + ctx.save_for_forward(*inputs) + + @staticmethod + def backward(ctx, grad_output): + x, y = ctx.saved_tensors + gx = None + if ctx.needs_input_grad[0]: + gx = NumpyMul.apply(grad_output, y) + gy = None + if ctx.needs_input_grad[1]: + gy = NumpyMul.apply(grad_output, x) + return gx, gy + + @staticmethod + def vmap(info, in_dims, x, y): + x_bdim, y_bdim = in_dims + x = x.movedim(x_bdim, -1) if x_bdim is not None else x.unsqueeze(-1) + y = y.movedim(y_bdim, -1) if y_bdim is not None else y.unsqueeze(-1) + result = NumpyMul.apply(x, y) + result = result.movedim(-1, 0) + return result, 0 + + @staticmethod + def jvp(ctx, x_tangent, y_tangent): + x, y = ctx.saved_tensors + return x_tangent * y + y_tangent * x + +def sample_inputs_numpy_mul(opinfo, device, dtype, requires_grad, **kwargs): + make_arg = partial(make_tensor, device=device, dtype=dtype, requires_grad=requires_grad) + # Broadcasting + yield SampleInput(make_arg(4, low=0.9, high=2), args=(make_arg(3, 4, low=0.9, high=2),)) + + +class MulGenVmap(torch.autograd.Function): + generate_vmap_rule = True + + @staticmethod + def forward(x, y): + return x * y + + @staticmethod + def setup_context(ctx, inputs, outputs): + ctx.save_for_backward(*inputs) + ctx.save_for_forward(*inputs) + + @staticmethod + def backward(ctx, grad_output): + x, y = ctx.saved_tensors + gx = None + if ctx.needs_input_grad[0]: + gx = MulGenVmap.apply(grad_output, y) + gy = None + if ctx.needs_input_grad[1]: + gy = MulGenVmap.apply(grad_output, x) + return gx, gy + + @staticmethod + def jvp(ctx, x_tangent, y_tangent): + x, y = ctx.saved_tensors + return x_tangent * y + y_tangent * x + + +class NumpyExp_(torch.autograd.Function): + @staticmethod + def forward(x): + x_np = to_numpy(x) + np.exp(x_np, x_np) + return x + + @staticmethod + def setup_context(ctx, inputs, output): + x, = inputs + ctx.mark_dirty(x) + ctx.save_for_backward(output) + ctx.save_for_forward(output) + + @staticmethod + def backward(ctx, grad_output): + output, = ctx.saved_tensors + return NumpyMul.apply(grad_output, output) + + @staticmethod + def vmap(info, in_dims, x): + NumpyExp_.apply(x) + return x, in_dims[0] + + @staticmethod + def jvp(ctx, x_tangent): + # Doesn't call numpy operations because I didn't want to write NumpyMul_ + output, = ctx.saved_tensors + x_tangent.mul_(output) + return x_tangent + +class NumpySort(torch.autograd.Function): + @staticmethod + def forward(x, dim): + device = x.device + x = to_numpy(x) + ind = np.argsort(x, axis=dim) + ind_inv = np.argsort(ind, axis=dim) + result = np.take_along_axis(x, ind, axis=dim) + return ( + torch.tensor(x, device=device), + torch.tensor(ind, device=device), + torch.tensor(ind_inv, device=device), + ) + + @staticmethod + def setup_context(ctx, inputs, output): + x, dim = inputs + _, ind, ind_inv = output + ctx.mark_non_differentiable(ind, ind_inv) + ctx.save_for_backward(ind, ind_inv) + ctx.save_for_forward(ind, ind_inv) + ctx.dim = dim + + @staticmethod + def backward(ctx, grad_output, _0, _1): + ind, ind_inv = ctx.saved_tensors + return NumpyTake.apply(grad_output, ind_inv, ind, ctx.dim), None + + @staticmethod + def vmap(info, in_dims, x, dim): + x_bdim, _ = in_dims + x = x.movedim(x_bdim, 0) + # wrap dim + dim = dim if dim >= 0 else dim + x.dim() - 1 + return NumpySort.apply(x, dim + 1), (0, 0, 0) + + @staticmethod + def jvp(ctx, x_tangent, _): + ind, ind_inv = ctx.saved_tensors + return NumpyTake.apply(x_tangent, ind, ind_inv, ctx.dim), None, None + +class SortGenVmap(torch.autograd.Function): + generate_vmap_rule = True + + @staticmethod + def forward(x, dim): + device = x.device + ind = torch.argsort(x, dim=dim) + ind_inv = torch.argsort(ind, axis=dim) + result = torch.take_along_dim(x, ind, dim=dim) + return result, ind, ind_inv + + @staticmethod + def setup_context(ctx, inputs, outputs): + x, dim = inputs + _, ind, ind_inv = outputs + ctx.mark_non_differentiable(ind, ind_inv) + ctx.save_for_backward(ind, ind_inv) + ctx.save_for_forward(ind, ind_inv) + ctx.dim = dim + + @staticmethod + def backward(ctx, grad_output, _0, _1): + ind, ind_inv = ctx.saved_tensors + return TakeGenVmap.apply(grad_output, ind_inv, ind, ctx.dim), None + + @staticmethod + def jvp(ctx, x_tangent, _): + ind, ind_inv = ctx.saved_tensors + return TakeGenVmap.apply(x_tangent, ind, ind_inv, ctx.dim), None, None + + +def sample_inputs_numpy_sort(opinfo, device, dtype, requires_grad, **kwargs): + make_arg = partial(make_tensor, device=device, dtype=dtype, requires_grad=requires_grad) + yield SampleInput(make_arg(3, 5), args=(1,)) + + +def sample_inputs_numpy_take(opinfo, device, dtype, requires_grad, **kwargs): + make_arg = partial(make_tensor, device=device, dtype=dtype, requires_grad=requires_grad) + tensor = make_arg(3, 5) + dim = 1 + _, ind, ind_inv = NumpySort.apply(tensor, 1) + yield SampleInput(tensor, args=(ind, ind_inv, dim)) + + +class NumpyTake(torch.autograd.Function): + @staticmethod + def forward(x, ind, ind_inv, dim): + device = x.device + x = to_numpy(x) + ind = to_numpy(ind) + return torch.tensor(np.take_along_axis(x, ind, dim), device=device) + + @staticmethod + def setup_context(ctx, inputs, output): + x, ind, ind_inv, dim = inputs + ctx.save_for_backward(ind, ind_inv) + ctx.save_for_forward(ind, ind_inv) + ctx.dim = dim + + @staticmethod + def backward(ctx, grad_output): + ind, ind_inv = ctx.saved_tensors + result = NumpyTake.apply(grad_output, ind_inv, ind, ctx.dim) + return result, None, None, None + + @staticmethod + def vmap(info, in_dims, x, ind, ind_inv, dim): + x_bdim, ind_bdim, ind_inv_bdim, _ = in_dims + + # wrap dim + logical_dim = x.dim() if x_bdim is None else x_bdim - 1 + dim = dim if dim >= 0 else dim + logical_dim + + def expand_bdim(x, x_bdim): + if x_bdim is None: + return x.expand(info.batch_size, *x.shape) + return x.movedim(x_bdim, 0) + + x = expand_bdim(x, x_bdim) + ind = expand_bdim(ind, ind_bdim) + ind_inv = expand_bdim(ind_inv, ind_inv_bdim) + + return NumpyTake.apply(x, ind, ind_inv, dim + 1), 0 + + @staticmethod + def jvp(ctx, x_tangent, ind_tangent, ind_inv_tangent, _): + assert ind_tangent is None + assert ind_inv_tangent is None + ind, ind_inv = ctx.saved_tensors + return NumpyTake.apply(x_tangent, ind, ind_inv, ctx.dim) + +class TakeGenVmap(torch.autograd.Function): + generate_vmap_rule = True + + @staticmethod + def forward(x, ind, ind_inv, dim): + return torch.take_along_dim(x, ind, dim) + + @staticmethod + def setup_context(ctx, inputs, outputs): + x, ind, ind_inv, dim = inputs + ctx.save_for_backward(ind, ind_inv) + ctx.save_for_forward(ind, ind_inv) + ctx.dim = dim + + @staticmethod + def backward(ctx, grad_output): + ind, ind_inv = ctx.saved_tensors + result = TakeGenVmap.apply(grad_output, ind_inv, ind, ctx.dim) + return result, None, None, None + + @staticmethod + def jvp(ctx, x_tangent, ind_tangent, ind_inv_tangent, _): + ind, ind_inv = ctx.saved_tensors + return TakeGenVmap.apply(x_tangent, ind, ind_inv, ctx.dim) + +class Select(torch.autograd.Function): + @staticmethod + def forward(x, idx): + return x[idx] + + @staticmethod + def setup_context(ctx, inputs, output): + x, idx = inputs + ctx.x_shape = x.shape + ctx.idx = idx + + @staticmethod + def backward(ctx, grad_output): + result = grad_output.new_zeros(ctx.x_shape) + result[ctx.idx] = grad_output + return result, None + + @staticmethod + def vmap(info, in_dims, x, idx): + x_bdim, _ = in_dims + x = x.movedim(x_bdim, 1) + return Select.apply(x, idx), 0 + + @staticmethod + def jvp(ctx, x_tangent, _): + return Select.apply(x_tangent, ctx.idx) + +class SelectGenVmap(torch.autograd.Function): + generate_vmap_rule = True + + @staticmethod + def forward(x, idx): + return x[idx] + + @staticmethod + def setup_context(ctx, inputs, outputs): + x, idx = inputs + ctx.x_shape = x.shape + ctx.idx = idx + + @staticmethod + def backward(ctx, grad_output): + result = grad_output.new_zeros(ctx.x_shape) + result[ctx.idx] = grad_output + return result, None + + @staticmethod + def jvp(ctx, x_tangent, _): + return SelectGenVmap.apply(x_tangent, ctx.idx) + + +def sample_inputs_select(opinfo, device, dtype, requires_grad, **kwargs): + make_arg = partial(make_tensor, device=device, dtype=dtype, requires_grad=requires_grad) + yield SampleInput(make_arg(3, 5), args=(2,)) + +class ScaleGradGenVmap(torch.autograd.Function): + generate_vmap_rule = True + scale = 3.14 + + @staticmethod + def forward(x): + return x.clone() + + @staticmethod + def setup_context(ctx, inputs, outputs): + pass + + @staticmethod + def backward(ctx, grad_output): + return grad_output * ScaleGradGenVmap.scale + + @staticmethod + def jvp(ctx, x_tangent): + return x_tangent * ScaleGradGenVmap.scale + +class ZeroGradientsGenVmap(torch.autograd.Function): + generate_vmap_rule = True + + @staticmethod + def forward(x, y): + return x.clone(), y.clone() + + @staticmethod + def setup_context(ctx, inputs, outputs): + pass + + @staticmethod + def backward(ctx, gx, gy): + # Intentionally returning torch.zeros instead of zeros_like or new_zeros. + # Also intentionally not None. + return ( + # Intentionally too-large gradient + torch.zeros(3, 4, *gx.shape, dtype=gx.dtype, device=gx.device), + torch.zeros(gy.shape, dtype=gy.dtype, device=gy.device), + ) + + @staticmethod + def jvp(ctx, gx, gy): + # Intentionally returning torch.zeros instead of zeros_like or new_zeros. + # Also intentionally not None. + return ( + torch.zeros(gx.shape, dtype=gx.dtype, device=gx.device), + torch.zeros(gy.shape, dtype=gy.dtype, device=gy.device), + ) + + +def sample_inputs_forward_default_args(opinfo, device, dtype, requires_grad, **kwargs): + make_arg = partial(make_tensor, device=device, dtype=dtype, requires_grad=requires_grad) + yield SampleInput(make_arg(3, 5)) + + +class ForwardHasDefaultArgs(torch.autograd.Function): + @staticmethod + def forward(x, idx=(2,)): + return x[idx] + + @staticmethod + def setup_context(ctx, inputs, output): + x, idx = inputs + ctx.x_shape = x.shape + ctx.idx = idx + + @staticmethod + def backward(ctx, grad_output): + result = grad_output.new_zeros(ctx.x_shape) + result[ctx.idx] = grad_output + return result, None + + @staticmethod + def vmap(info, in_dims, x, idx): + x_bdim, _ = in_dims + x = x.movedim(x_bdim, 1) + return ForwardHasDefaultArgs.apply(x, idx), 0 + + @staticmethod + def jvp(ctx, x_tangent, _): + return ForwardHasDefaultArgs.apply(x_tangent, ctx.idx) + + +autograd_function_db = [ + OpInfo( + 'NumpyCubeAutogradFunction', + op=NumpyCube.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_numpy_cube, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'NumpyExpMarkDirtyAutogradFunction', + op=lambda x: NumpyExp_.apply(x.clone()), + inplace_variant=NumpyExp_.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_numpy_cube, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'NumpyMulAutogradFunction', + op=NumpyMul.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_numpy_mul, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'NumpyCubeNotComposableAutogradFunction', + op=lambda x: NumpyCubeNotComposable.apply(x)[0], + supports_forward_ad=False, + supports_fwgrad_bwgrad=False, + sample_inputs_func=sample_inputs_numpy_cube, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'NumpySortAutogradFunction', + op=NumpySort.apply, + supports_forward_ad=False, + supports_fwgrad_bwgrad=False, + sample_inputs_func=sample_inputs_numpy_sort, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + gradcheck_wrapper=lambda y, ind: y, + ), + OpInfo( + 'NumpyTakeAutogradFunction', + op=NumpyTake.apply, + supports_forward_ad=False, + supports_fwgrad_bwgrad=False, + sample_inputs_func=sample_inputs_numpy_take, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'SelectAutogradFunction', + op=Select.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_select, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'CubeGenVmapAutogradFunction', + op=CubeGenVmap.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_numpy_cube, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'MulGenVmapAutogradFunction', + op=MulGenVmap.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_numpy_mul, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'SortGenVmapAutogradFunction', + op=SortGenVmap.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_numpy_sort, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + gradcheck_wrapper=lambda y, ind: y, + ), + OpInfo( + 'SelectGenVmapAutogradFunction', + op=SelectGenVmap.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_select, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'ScaleGradGenVmapAutogradFunction', + op=ScaleGradGenVmap.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_numpy_cube, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'ZeroGradientsGenVmapAutogradFunction', + op=ZeroGradientsGenVmap.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_numpy_mul, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), + OpInfo( + 'ForwardHasDefaultArgsAutogradFunction', + op=ForwardHasDefaultArgs.apply, + supports_forward_ad=True, + supports_fwgrad_bwgrad=True, + sample_inputs_func=sample_inputs_forward_default_args, + dtypes=all_types_and(torch.bool, torch.half), + supports_out=False, + ), +] diff --git a/shared/package-files/08/08cd45a2ba20e85242ff9618e08b9e8967d0f5c0139520c9e21176dd14e78814/blob b/shared/package-files/08/08cd45a2ba20e85242ff9618e08b9e8967d0f5c0139520c9e21176dd14e78814/blob new file mode 100644 index 0000000000000000000000000000000000000000..e361726dc6f80d41cb4975641b44624427b489d6 --- /dev/null +++ b/shared/package-files/08/08cd45a2ba20e85242ff9618e08b9e8967d0f5c0139520c9e21176dd14e78814/blob @@ -0,0 +1,12 @@ +# ruff: noqa: TCH004 +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + # import modules that have public classes/functions: + from pandas.tseries import ( + frequencies, + offsets, + ) + + # and mark only those modules as public + __all__ = ["frequencies", "offsets"] diff --git a/shared/package-files/08/08cd4c031952588ed911f4a3c8b4c3d426b4df77bdce47f4ebcaa1142e538571/blob b/shared/package-files/08/08cd4c031952588ed911f4a3c8b4c3d426b4df77bdce47f4ebcaa1142e538571/blob new file mode 100644 index 0000000000000000000000000000000000000000..327d4612ee4c22149de11a457f94c84a76ac9c6d --- /dev/null +++ b/shared/package-files/08/08cd4c031952588ed911f4a3c8b4c3d426b4df77bdce47f4ebcaa1142e538571/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _embedding_bag_backward { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &, c10::SymInt, bool, int64_t, bool, const c10::optional &, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_embedding_bag_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_embedding_bag_backward(Tensor grad, Tensor indices, Tensor offsets, Tensor offset2bag, Tensor bag_size, Tensor maximum_indices, SymInt num_weights, bool scale_grad_by_freq, int mode, bool sparse, Tensor? per_sample_weights, int padding_idx=-1) -> Tensor") + static at::Tensor call(const at::Tensor & grad, const at::Tensor & indices, const at::Tensor & offsets, const at::Tensor & offset2bag, const at::Tensor & bag_size, const at::Tensor & maximum_indices, c10::SymInt num_weights, bool scale_grad_by_freq, int64_t mode, bool sparse, const c10::optional & per_sample_weights, int64_t padding_idx); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad, const at::Tensor & indices, const at::Tensor & offsets, const at::Tensor & offset2bag, const at::Tensor & bag_size, const at::Tensor & maximum_indices, c10::SymInt num_weights, bool scale_grad_by_freq, int64_t mode, bool sparse, const c10::optional & per_sample_weights, int64_t padding_idx); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/08/08cd7048dcd79fa9e48cb3124de06104994be9dd2153ed5874dc043bc1c4fbd5/blob b/shared/package-files/08/08cd7048dcd79fa9e48cb3124de06104994be9dd2153ed5874dc043bc1c4fbd5/blob new file mode 100644 index 0000000000000000000000000000000000000000..62c17bd03927e5f852af708e6b9ef6cf7e74d57c --- /dev/null +++ b/shared/package-files/08/08cd7048dcd79fa9e48cb3124de06104994be9dd2153ed5874dc043bc1c4fbd5/blob @@ -0,0 +1,310 @@ +from __future__ import annotations + +from typing import Final + +magic: Final = ( + b"\x00\x00\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\xc2\xea\x81\x60" + b"\xb3\x14\x11\xcf\xbd\x92\x08\x00" + b"\x09\xc7\x31\x8c\x18\x1f\x10\x11" +) + +align_1_checker_value: Final = b"3" +align_1_offset: Final = 32 +align_1_length: Final = 1 +align_1_value: Final = 4 +u64_byte_checker_value: Final = b"3" +align_2_offset: Final = 35 +align_2_length: Final = 1 +align_2_value: Final = 4 +endianness_offset: Final = 37 +endianness_length: Final = 1 +platform_offset: Final = 39 +platform_length: Final = 1 +encoding_offset: Final = 70 +encoding_length: Final = 1 +dataset_offset: Final = 92 +dataset_length: Final = 64 +file_type_offset: Final = 156 +file_type_length: Final = 8 +date_created_offset: Final = 164 +date_created_length: Final = 8 +date_modified_offset: Final = 172 +date_modified_length: Final = 8 +header_size_offset: Final = 196 +header_size_length: Final = 4 +page_size_offset: Final = 200 +page_size_length: Final = 4 +page_count_offset: Final = 204 +page_count_length: Final = 4 +sas_release_offset: Final = 216 +sas_release_length: Final = 8 +sas_server_type_offset: Final = 224 +sas_server_type_length: Final = 16 +os_version_number_offset: Final = 240 +os_version_number_length: Final = 16 +os_maker_offset: Final = 256 +os_maker_length: Final = 16 +os_name_offset: Final = 272 +os_name_length: Final = 16 +page_bit_offset_x86: Final = 16 +page_bit_offset_x64: Final = 32 +subheader_pointer_length_x86: Final = 12 +subheader_pointer_length_x64: Final = 24 +page_type_offset: Final = 0 +page_type_length: Final = 2 +block_count_offset: Final = 2 +block_count_length: Final = 2 +subheader_count_offset: Final = 4 +subheader_count_length: Final = 2 +page_type_mask: Final = 0x0F00 +# Keep "page_comp_type" bits +page_type_mask2: Final = 0xF000 | page_type_mask +page_meta_type: Final = 0x0000 +page_data_type: Final = 0x0100 +page_mix_type: Final = 0x0200 +page_amd_type: Final = 0x0400 +page_meta2_type: Final = 0x4000 +page_comp_type: Final = 0x9000 +page_meta_types: Final = [page_meta_type, page_meta2_type] +subheader_pointers_offset: Final = 8 +truncated_subheader_id: Final = 1 +compressed_subheader_id: Final = 4 +compressed_subheader_type: Final = 1 +text_block_size_length: Final = 2 +row_length_offset_multiplier: Final = 5 +row_count_offset_multiplier: Final = 6 +col_count_p1_multiplier: Final = 9 +col_count_p2_multiplier: Final = 10 +row_count_on_mix_page_offset_multiplier: Final = 15 +column_name_pointer_length: Final = 8 +column_name_text_subheader_offset: Final = 0 +column_name_text_subheader_length: Final = 2 +column_name_offset_offset: Final = 2 +column_name_offset_length: Final = 2 +column_name_length_offset: Final = 4 +column_name_length_length: Final = 2 +column_data_offset_offset: Final = 8 +column_data_length_offset: Final = 8 +column_data_length_length: Final = 4 +column_type_offset: Final = 14 +column_type_length: Final = 1 +column_format_text_subheader_index_offset: Final = 22 +column_format_text_subheader_index_length: Final = 2 +column_format_offset_offset: Final = 24 +column_format_offset_length: Final = 2 +column_format_length_offset: Final = 26 +column_format_length_length: Final = 2 +column_label_text_subheader_index_offset: Final = 28 +column_label_text_subheader_index_length: Final = 2 +column_label_offset_offset: Final = 30 +column_label_offset_length: Final = 2 +column_label_length_offset: Final = 32 +column_label_length_length: Final = 2 +rle_compression: Final = b"SASYZCRL" +rdc_compression: Final = b"SASYZCR2" + +compression_literals: Final = [rle_compression, rdc_compression] + +# Incomplete list of encodings, using SAS nomenclature: +# https://support.sas.com/documentation/onlinedoc/dfdmstudio/2.6/dmpdmsug/Content/dfU_Encodings_SAS.html +# corresponding to the Python documentation of standard encodings +# https://docs.python.org/3/library/codecs.html#standard-encodings +encoding_names: Final = { + 20: "utf-8", + 29: "latin1", + 30: "latin2", + 31: "latin3", + 32: "latin4", + 33: "cyrillic", + 34: "arabic", + 35: "greek", + 36: "hebrew", + 37: "latin5", + 38: "latin6", + 39: "cp874", + 40: "latin9", + 41: "cp437", + 42: "cp850", + 43: "cp852", + 44: "cp857", + 45: "cp858", + 46: "cp862", + 47: "cp864", + 48: "cp865", + 49: "cp866", + 50: "cp869", + 51: "cp874", + # 52: "", # not found + # 53: "", # not found + # 54: "", # not found + 55: "cp720", + 56: "cp737", + 57: "cp775", + 58: "cp860", + 59: "cp863", + 60: "cp1250", + 61: "cp1251", + 62: "cp1252", + 63: "cp1253", + 64: "cp1254", + 65: "cp1255", + 66: "cp1256", + 67: "cp1257", + 68: "cp1258", + 118: "cp950", + # 119: "", # not found + 123: "big5", + 125: "gb2312", + 126: "cp936", + 134: "euc_jp", + 136: "cp932", + 138: "shift_jis", + 140: "euc-kr", + 141: "cp949", + 227: "latin8", + # 228: "", # not found + # 229: "" # not found +} + + +class SASIndex: + row_size_index: Final = 0 + column_size_index: Final = 1 + subheader_counts_index: Final = 2 + column_text_index: Final = 3 + column_name_index: Final = 4 + column_attributes_index: Final = 5 + format_and_label_index: Final = 6 + column_list_index: Final = 7 + data_subheader_index: Final = 8 + + +subheader_signature_to_index: Final = { + b"\xF7\xF7\xF7\xF7": SASIndex.row_size_index, + b"\x00\x00\x00\x00\xF7\xF7\xF7\xF7": SASIndex.row_size_index, + b"\xF7\xF7\xF7\xF7\x00\x00\x00\x00": SASIndex.row_size_index, + b"\xF7\xF7\xF7\xF7\xFF\xFF\xFB\xFE": SASIndex.row_size_index, + b"\xF6\xF6\xF6\xF6": SASIndex.column_size_index, + b"\x00\x00\x00\x00\xF6\xF6\xF6\xF6": SASIndex.column_size_index, + b"\xF6\xF6\xF6\xF6\x00\x00\x00\x00": SASIndex.column_size_index, + b"\xF6\xF6\xF6\xF6\xFF\xFF\xFB\xFE": SASIndex.column_size_index, + b"\x00\xFC\xFF\xFF": SASIndex.subheader_counts_index, + b"\xFF\xFF\xFC\x00": SASIndex.subheader_counts_index, + b"\x00\xFC\xFF\xFF\xFF\xFF\xFF\xFF": SASIndex.subheader_counts_index, + b"\xFF\xFF\xFF\xFF\xFF\xFF\xFC\x00": SASIndex.subheader_counts_index, + b"\xFD\xFF\xFF\xFF": SASIndex.column_text_index, + b"\xFF\xFF\xFF\xFD": SASIndex.column_text_index, + b"\xFD\xFF\xFF\xFF\xFF\xFF\xFF\xFF": SASIndex.column_text_index, + b"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD": SASIndex.column_text_index, + b"\xFF\xFF\xFF\xFF": SASIndex.column_name_index, + b"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF": SASIndex.column_name_index, + b"\xFC\xFF\xFF\xFF": SASIndex.column_attributes_index, + b"\xFF\xFF\xFF\xFC": SASIndex.column_attributes_index, + b"\xFC\xFF\xFF\xFF\xFF\xFF\xFF\xFF": SASIndex.column_attributes_index, + b"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC": SASIndex.column_attributes_index, + b"\xFE\xFB\xFF\xFF": SASIndex.format_and_label_index, + b"\xFF\xFF\xFB\xFE": SASIndex.format_and_label_index, + b"\xFE\xFB\xFF\xFF\xFF\xFF\xFF\xFF": SASIndex.format_and_label_index, + b"\xFF\xFF\xFF\xFF\xFF\xFF\xFB\xFE": SASIndex.format_and_label_index, + b"\xFE\xFF\xFF\xFF": SASIndex.column_list_index, + b"\xFF\xFF\xFF\xFE": SASIndex.column_list_index, + b"\xFE\xFF\xFF\xFF\xFF\xFF\xFF\xFF": SASIndex.column_list_index, + b"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE": SASIndex.column_list_index, +} + + +# List of frequently used SAS date and datetime formats +# http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#etsug_intervals_sect009.htm +# https://github.com/epam/parso/blob/master/src/main/java/com/epam/parso/impl/SasFileConstants.java +sas_date_formats: Final = ( + "DATE", + "DAY", + "DDMMYY", + "DOWNAME", + "JULDAY", + "JULIAN", + "MMDDYY", + "MMYY", + "MMYYC", + "MMYYD", + "MMYYP", + "MMYYS", + "MMYYN", + "MONNAME", + "MONTH", + "MONYY", + "QTR", + "QTRR", + "NENGO", + "WEEKDATE", + "WEEKDATX", + "WEEKDAY", + "WEEKV", + "WORDDATE", + "WORDDATX", + "YEAR", + "YYMM", + "YYMMC", + "YYMMD", + "YYMMP", + "YYMMS", + "YYMMN", + "YYMON", + "YYMMDD", + "YYQ", + "YYQC", + "YYQD", + "YYQP", + "YYQS", + "YYQN", + "YYQR", + "YYQRC", + "YYQRD", + "YYQRP", + "YYQRS", + "YYQRN", + "YYMMDDP", + "YYMMDDC", + "E8601DA", + "YYMMDDN", + "MMDDYYC", + "MMDDYYS", + "MMDDYYD", + "YYMMDDS", + "B8601DA", + "DDMMYYN", + "YYMMDDD", + "DDMMYYB", + "DDMMYYP", + "MMDDYYP", + "YYMMDDB", + "MMDDYYN", + "DDMMYYC", + "DDMMYYD", + "DDMMYYS", + "MINGUO", +) + +sas_datetime_formats: Final = ( + "DATETIME", + "DTWKDATX", + "B8601DN", + "B8601DT", + "B8601DX", + "B8601DZ", + "B8601LX", + "E8601DN", + "E8601DT", + "E8601DX", + "E8601DZ", + "E8601LX", + "DATEAMPM", + "DTDATE", + "DTMONYY", + "DTMONYY", + "DTWKDATX", + "DTYEAR", + "TOD", + "MDYAMPM", +) diff --git a/shared/package-files/08/08cf0e370ad6f5418b4ffb90df1a46e61b94f8cdd7440600df68422cd9ee4d34/blob b/shared/package-files/08/08cf0e370ad6f5418b4ffb90df1a46e61b94f8cdd7440600df68422cd9ee4d34/blob new file mode 100644 index 0000000000000000000000000000000000000000..874fced9fd9924d549655b55caec96d7518182f4 --- /dev/null +++ b/shared/package-files/08/08cf0e370ad6f5418b4ffb90df1a46e61b94f8cdd7440600df68422cd9ee4d34/blob @@ -0,0 +1,56 @@ +import threading +import functools +import numba.core.event as ev + + +# Lock for the preventing multiple compiler execution +class _CompilerLock(object): + def __init__(self): + self._lock = threading.RLock() + + def acquire(self): + ev.start_event("numba:compiler_lock") + self._lock.acquire() + + def release(self): + self._lock.release() + ev.end_event("numba:compiler_lock") + + def __enter__(self): + self.acquire() + + def __exit__(self, exc_val, exc_type, traceback): + self.release() + + def is_locked(self): + is_owned = getattr(self._lock, '_is_owned') + if not callable(is_owned): + is_owned = self._is_owned + return is_owned() + + def __call__(self, func): + @functools.wraps(func) + def _acquire_compile_lock(*args, **kwargs): + with self: + return func(*args, **kwargs) + return _acquire_compile_lock + + def _is_owned(self): + # This method is borrowed from threading.Condition. + # Return True if lock is owned by current_thread. + # This method is called only if _lock doesn't have _is_owned(). + if self._lock.acquire(0): + self._lock.release() + return False + else: + return True + + +global_compiler_lock = _CompilerLock() + + +def require_global_compiler_lock(): + """Sentry that checks the global_compiler_lock is acquired. + """ + # Use assert to allow turning off this check + assert global_compiler_lock.is_locked() diff --git a/shared/package-files/08/08cfa007e5dc66a6fe08a52a844b743622bef6c95cff252cb43958cb389b6aac/blob b/shared/package-files/08/08cfa007e5dc66a6fe08a52a844b743622bef6c95cff252cb43958cb389b6aac/blob new file mode 100644 index 0000000000000000000000000000000000000000..0e96dc300cf3642ee3a042bf55cda4885a98c547 --- /dev/null +++ b/shared/package-files/08/08cfa007e5dc66a6fe08a52a844b743622bef6c95cff252cb43958cb389b6aac/blob @@ -0,0 +1,69 @@ +from numba import vectorize + + +def add(a, b): + """An addition""" + return a + b + + +def equals(a, b): + return a == b + + +def mul(a, b): + """A multiplication""" + return a * b + + +def guadd(a, b, c): + """A generalized addition""" + x, y = c.shape + for i in range(x): + for j in range(y): + c[i, j] = a[i, j] + b[i, j] + + +@vectorize(nopython=True) +def inner(a, b): + return a + b + + +@vectorize(["int64(int64, int64)"], nopython=True) +def inner_explicit(a, b): + return a + b + + +def outer(a, b): + return inner(a, b) + + +def outer_explicit(a, b): + return inner_explicit(a, b) + + +class Dummy: + pass + + +def guadd_obj(a, b, c): + Dummy() # to force object mode + x, y = c.shape + for i in range(x): + for j in range(y): + c[i, j] = a[i, j] + b[i, j] + + +def guadd_scalar_obj(a, b, c): + Dummy() # to force object mode + x, y = c.shape + for i in range(x): + for j in range(y): + c[i, j] = a[i, j] + b + + +class MyException(Exception): + pass + + +def guerror(a, b, c): + raise MyException diff --git a/shared/package-files/08/08d0994b6daec7b24862fd269bd286275b0f5a4e3ece2c0dd7748a002d2edfa3/blob b/shared/package-files/08/08d0994b6daec7b24862fd269bd286275b0f5a4e3ece2c0dd7748a002d2edfa3/blob new file mode 100644 index 0000000000000000000000000000000000000000..a39e64dd32cae46b459f92ad4326099c25ad4b28 --- /dev/null +++ b/shared/package-files/08/08d0994b6daec7b24862fd269bd286275b0f5a4e3ece2c0dd7748a002d2edfa3/blob @@ -0,0 +1,30 @@ +from typing import Any, Iterable, Mapping, Optional, Sequence, Tuple, Union + +ascii_letters: str +ascii_lowercase: str +ascii_uppercase: str +digits: str +hexdigits: str +octdigits: str +punctuation: str +printable: str +whitespace: str + +def capwords(s: str, sep: Optional[str] = ...) -> str: ... + +class Template: + template: str + def __init__(self, template: str) -> None: ... + def substitute(self, __mapping: Mapping[str, object] = ..., **kwds: object) -> str: ... + def safe_substitute(self, __mapping: Mapping[str, object] = ..., **kwds: object) -> str: ... + +# TODO(MichalPokorny): This is probably badly and/or loosely typed. +class Formatter: + def format(self, __format_string: str, *args: Any, **kwargs: Any) -> str: ... + def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str: ... + def parse(self, format_string: str) -> Iterable[Tuple[str, Optional[str], Optional[str], Optional[str]]]: ... + def get_field(self, field_name: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... + def get_value(self, key: Union[int, str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... + def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], kwargs: Mapping[str, Any]) -> None: ... + def format_field(self, value: Any, format_spec: str) -> Any: ... + def convert_field(self, value: Any, conversion: str) -> Any: ... diff --git a/shared/package-files/08/08d32fbd33463522173c62da623c403852a4fb64e7e32a772fdc3e85cd483271/blob b/shared/package-files/08/08d32fbd33463522173c62da623c403852a4fb64e7e32a772fdc3e85cd483271/blob new file mode 100644 index 0000000000000000000000000000000000000000..b4703d846ce86dbb6c0e317872a4fe42e852fd64 --- /dev/null +++ b/shared/package-files/08/08d32fbd33463522173c62da623c403852a4fb64e7e32a772fdc3e85cd483271/blob @@ -0,0 +1,38 @@ +from sympy.physics.quantum import Dagger +from sympy.physics.quantum.boson import BosonOp +from sympy.physics.quantum.fermion import FermionOp +from sympy.physics.quantum.operatorordering import (normal_order, + normal_ordered_form) + + +def test_normal_order(): + a = BosonOp('a') + + c = FermionOp('c') + + assert normal_order(a * Dagger(a)) == Dagger(a) * a + assert normal_order(Dagger(a) * a) == Dagger(a) * a + assert normal_order(a * Dagger(a) ** 2) == Dagger(a) ** 2 * a + + assert normal_order(c * Dagger(c)) == - Dagger(c) * c + assert normal_order(Dagger(c) * c) == Dagger(c) * c + assert normal_order(c * Dagger(c) ** 2) == Dagger(c) ** 2 * c + + +def test_normal_ordered_form(): + a = BosonOp('a') + + c = FermionOp('c') + + assert normal_ordered_form(Dagger(a) * a) == Dagger(a) * a + assert normal_ordered_form(a * Dagger(a)) == 1 + Dagger(a) * a + assert normal_ordered_form(a ** 2 * Dagger(a)) == \ + 2 * a + Dagger(a) * a ** 2 + assert normal_ordered_form(a ** 3 * Dagger(a)) == \ + 3 * a ** 2 + Dagger(a) * a ** 3 + + assert normal_ordered_form(Dagger(c) * c) == Dagger(c) * c + assert normal_ordered_form(c * Dagger(c)) == 1 - Dagger(c) * c + assert normal_ordered_form(c ** 2 * Dagger(c)) == Dagger(c) * c ** 2 + assert normal_ordered_form(c ** 3 * Dagger(c)) == \ + c ** 2 - Dagger(c) * c ** 3 diff --git a/shared/package-files/08/08d5ced763bab5e744b8c1b48cd99ae2a7db4e00acc006c7c21e3d6b7b84dd89/blob b/shared/package-files/08/08d5ced763bab5e744b8c1b48cd99ae2a7db4e00acc006c7c21e3d6b7b84dd89/blob new file mode 100644 index 0000000000000000000000000000000000000000..faf9221b776eee67cd5d2971da5ba77732ef8016 Binary files /dev/null and b/shared/package-files/08/08d5ced763bab5e744b8c1b48cd99ae2a7db4e00acc006c7c21e3d6b7b84dd89/blob differ diff --git a/shared/package-files/08/08d721209e4714c3e9365559876bce5341a04376ec7ba86acaa0e8be90c794a1/blob b/shared/package-files/08/08d721209e4714c3e9365559876bce5341a04376ec7ba86acaa0e8be90c794a1/blob new file mode 100644 index 0000000000000000000000000000000000000000..76b273909e415318a7d3bace00ffff2a0bc53762 --- /dev/null +++ b/shared/package-files/08/08d721209e4714c3e9365559876bce5341a04376ec7ba86acaa0e8be90c794a1/blob @@ -0,0 +1,83 @@ +import sys +from time import time +from sympy.ntheory.residue_ntheory import (discrete_log, + _discrete_log_trial_mul, _discrete_log_shanks_steps, + _discrete_log_pollard_rho, _discrete_log_pohlig_hellman) + + +# Cyclic group (Z/pZ)* with p prime, order p - 1 and generator g +data_set_1 = [ + # p, p - 1, g + [191, 190, 19], + [46639, 46638, 6], + [14789363, 14789362, 2], + [4254225211, 4254225210, 2], + [432751500361, 432751500360, 7], + [158505390797053, 158505390797052, 2], + [6575202655312007, 6575202655312006, 5], + [8430573471995353769, 8430573471995353768, 3], + [3938471339744997827267, 3938471339744997827266, 2], + [875260951364705563393093, 875260951364705563393092, 5], + ] + + +# Cyclic sub-groups of (Z/nZ)* with prime order p and generator g +# (n, p are primes and n = 2 * p + 1) +data_set_2 = [ + # n, p, g + [227, 113, 3], + [2447, 1223, 2], + [24527, 12263, 2], + [245639, 122819, 2], + [2456747, 1228373, 3], + [24567899, 12283949, 3], + [245679023, 122839511, 2], + [2456791307, 1228395653, 3], + [24567913439, 12283956719, 2], + [245679135407, 122839567703, 2], + [2456791354763, 1228395677381, 3], + [24567913550903, 12283956775451, 2], + [245679135509519, 122839567754759, 2], + ] + + +# Cyclic sub-groups of (Z/nZ)* with smooth order o and generator g +data_set_3 = [ + # n, o, g + [2**118, 2**116, 3], + ] + + +def bench_discrete_log(data_set, algo=None): + if algo is None: + f = discrete_log + elif algo == 'trial': + f = _discrete_log_trial_mul + elif algo == 'shanks': + f = _discrete_log_shanks_steps + elif algo == 'rho': + f = _discrete_log_pollard_rho + elif algo == 'ph': + f = _discrete_log_pohlig_hellman + else: + raise ValueError("Argument 'algo' should be one" + " of ('trial', 'shanks', 'rho' or 'ph')") + + for i, data in enumerate(data_set): + for j, (n, p, g) in enumerate(data): + t = time() + l = f(n, pow(g, p - 1, n), g, p) + t = time() - t + print('[%02d-%03d] %15.10f' % (i, j, t)) + assert l == p - 1 + + +if __name__ == '__main__': + algo = sys.argv[1] \ + if len(sys.argv) > 1 else None + data_set = [ + data_set_1, + data_set_2, + data_set_3, + ] + bench_discrete_log(data_set, algo) diff --git a/shared/package-files/08/08d8334a344a345981faaa2de2db8758fce0ceff8d3c3987879127730a100a66/blob b/shared/package-files/08/08d8334a344a345981faaa2de2db8758fce0ceff8d3c3987879127730a100a66/blob new file mode 100644 index 0000000000000000000000000000000000000000..9abfc1d4fb5f5547f5e2ce35f8123c7c4c8de949 --- /dev/null +++ b/shared/package-files/08/08d8334a344a345981faaa2de2db8758fce0ceff8d3c3987879127730a100a66/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor glu_jvp(const at::Tensor & glu, const at::Tensor & x, const at::Tensor & dx, int64_t dim); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/08/08db0ef806f8cb03365b3dc06ea58e1f78a0d6ae419e8f4fb1432b0aff87352e/blob b/shared/package-files/08/08db0ef806f8cb03365b3dc06ea58e1f78a0d6ae419e8f4fb1432b0aff87352e/blob new file mode 100644 index 0000000000000000000000000000000000000000..2d59b89e6b8a0ef1addde24ffafc476b98f92d89 --- /dev/null +++ b/shared/package-files/08/08db0ef806f8cb03365b3dc06ea58e1f78a0d6ae419e8f4fb1432b0aff87352e/blob @@ -0,0 +1,180 @@ +""" +Contains the core of NumPy: ndarray, ufuncs, dtypes, etc. + +Please note that this module is private. All functions and objects +are available in the main ``numpy`` namespace - use that instead. + +""" + +import os +import warnings + +from numpy.version import version as __version__ + + +# disables OpenBLAS affinity setting of the main thread that limits +# python threads or processes to one core +env_added = [] +for envkey in ['OPENBLAS_MAIN_FREE', 'GOTOBLAS_MAIN_FREE']: + if envkey not in os.environ: + os.environ[envkey] = '1' + env_added.append(envkey) + +try: + from . import multiarray +except ImportError as exc: + import sys + msg = """ + +IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! + +Importing the numpy C-extensions failed. This error can happen for +many reasons, often due to issues with your setup or how NumPy was +installed. + +We have compiled some common reasons and troubleshooting tips at: + + https://numpy.org/devdocs/user/troubleshooting-importerror.html + +Please note and check the following: + + * The Python version is: Python%d.%d from "%s" + * The NumPy version is: "%s" + +and make sure that they are the versions you expect. +Please carefully study the documentation linked above for further help. + +Original error was: %s +""" % (sys.version_info[0], sys.version_info[1], sys.executable, + __version__, exc) + raise ImportError(msg) +finally: + for envkey in env_added: + del os.environ[envkey] +del envkey +del env_added +del os + +from . import umath + +# Check that multiarray,umath are pure python modules wrapping +# _multiarray_umath and not either of the old c-extension modules +if not (hasattr(multiarray, '_multiarray_umath') and + hasattr(umath, '_multiarray_umath')): + import sys + path = sys.modules['numpy'].__path__ + msg = ("Something is wrong with the numpy installation. " + "While importing we detected an older version of " + "numpy in {}. One method of fixing this is to repeatedly uninstall " + "numpy until none is found, then reinstall this version.") + raise ImportError(msg.format(path)) + +from . import numerictypes as nt +multiarray.set_typeDict(nt.sctypeDict) +from . import numeric +from .numeric import * +from . import fromnumeric +from .fromnumeric import * +from . import defchararray as char +from . import records +from . import records as rec +from .records import record, recarray, format_parser +# Note: module name memmap is overwritten by a class with same name +from .memmap import * +from .defchararray import chararray +from . import function_base +from .function_base import * +from . import _machar +from . import getlimits +from .getlimits import * +from . import shape_base +from .shape_base import * +from . import einsumfunc +from .einsumfunc import * +del nt + +from .numeric import absolute as abs + +# do this after everything else, to minimize the chance of this misleadingly +# appearing in an import-time traceback +from . import _add_newdocs +from . import _add_newdocs_scalars +# add these for module-freeze analysis (like PyInstaller) +from . import _dtype_ctypes +from . import _internal +from . import _dtype +from . import _methods + +__all__ = ['char', 'rec', 'memmap'] +__all__ += numeric.__all__ +__all__ += ['record', 'recarray', 'format_parser'] +__all__ += ['chararray'] +__all__ += function_base.__all__ +__all__ += getlimits.__all__ +__all__ += shape_base.__all__ +__all__ += einsumfunc.__all__ + +# We used to use `np.core._ufunc_reconstruct` to unpickle. This is unnecessary, +# but old pickles saved before 1.20 will be using it, and there is no reason +# to break loading them. +def _ufunc_reconstruct(module, name): + # The `fromlist` kwarg is required to ensure that `mod` points to the + # inner-most module rather than the parent package when module name is + # nested. This makes it possible to pickle non-toplevel ufuncs such as + # scipy.special.expit for instance. + mod = __import__(module, fromlist=[name]) + return getattr(mod, name) + + +def _ufunc_reduce(func): + # Report the `__name__`. pickle will try to find the module. Note that + # pickle supports for this `__name__` to be a `__qualname__`. It may + # make sense to add a `__qualname__` to ufuncs, to allow this more + # explicitly (Numba has ufuncs as attributes). + # See also: https://github.com/dask/distributed/issues/3450 + return func.__name__ + + +def _DType_reconstruct(scalar_type): + # This is a work-around to pickle type(np.dtype(np.float64)), etc. + # and it should eventually be replaced with a better solution, e.g. when + # DTypes become HeapTypes. + return type(dtype(scalar_type)) + + +def _DType_reduce(DType): + # As types/classes, most DTypes can simply be pickled by their name: + if not DType._legacy or DType.__module__ == "numpy.dtypes": + return DType.__name__ + + # However, user defined legacy dtypes (like rational) do not end up in + # `numpy.dtypes` as module and do not have a public class at all. + # For these, we pickle them by reconstructing them from the scalar type: + scalar_type = DType.type + return _DType_reconstruct, (scalar_type,) + + +def __getattr__(name): + # Deprecated 2022-11-22, NumPy 1.25. + if name == "MachAr": + warnings.warn( + "The `np.core.MachAr` is considered private API (NumPy 1.24)", + DeprecationWarning, stacklevel=2, + ) + return _machar.MachAr + raise AttributeError(f"Module {__name__!r} has no attribute {name!r}") + + +import copyreg + +copyreg.pickle(ufunc, _ufunc_reduce) +copyreg.pickle(type(dtype), _DType_reduce, _DType_reconstruct) + +# Unclutter namespace (must keep _*_reconstruct for unpickling) +del copyreg +del _ufunc_reduce +del _DType_reduce + +from numpy._pytesttester import PytestTester +test = PytestTester(__name__) +del PytestTester diff --git a/shared/package-files/08/08e0f2dd55fc670da1177c2cdba78afe488d4676ec0e1f806064d86d22975cbf/blob b/shared/package-files/08/08e0f2dd55fc670da1177c2cdba78afe488d4676ec0e1f806064d86d22975cbf/blob new file mode 100644 index 0000000000000000000000000000000000000000..88915cd5c1267e2ac2878e6525bc9f1681cecd47 --- /dev/null +++ b/shared/package-files/08/08e0f2dd55fc670da1177c2cdba78afe488d4676ec0e1f806064d86d22975cbf/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::histc.out(Tensor self, int bins=100, Scalar min=0, Scalar max=0, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & histc_out(at::Tensor & out, const at::Tensor & self, int64_t bins=100, const at::Scalar & min=0, const at::Scalar & max=0) { + return at::_ops::histc_out::call(self, bins, min, max, out); +} +// aten::histc.out(Tensor self, int bins=100, Scalar min=0, Scalar max=0, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & histc_outf(const at::Tensor & self, int64_t bins, const at::Scalar & min, const at::Scalar & max, at::Tensor & out) { + return at::_ops::histc_out::call(self, bins, min, max, out); +} + +// aten::histc(Tensor self, int bins=100, Scalar min=0, Scalar max=0) -> Tensor +inline at::Tensor histc(const at::Tensor & self, int64_t bins=100, const at::Scalar & min=0, const at::Scalar & max=0) { + return at::_ops::histc::call(self, bins, min, max); +} + +} diff --git a/shared/package-files/08/08e1672176ab463c51982c6d12ddd355f7544351135f2746044db7dd184499ee/blob b/shared/package-files/08/08e1672176ab463c51982c6d12ddd355f7544351135f2746044db7dd184499ee/blob new file mode 100644 index 0000000000000000000000000000000000000000..f98de71a83b6101cf5cb542eee360a22bf1930e3 --- /dev/null +++ b/shared/package-files/08/08e1672176ab463c51982c6d12ddd355f7544351135f2746044db7dd184499ee/blob @@ -0,0 +1,72 @@ +#pragma once + +#include + +namespace c10 { + +// Structure used to pack all the thread local boolean +// flags used by autograd +struct C10_API AutogradState { + static AutogradState& get_tls_state(); + static void set_tls_state(AutogradState state); + + AutogradState( + bool grad_mode, + bool inference_mode, + bool fw_grad_mode, + bool multithreading_enabled) + : grad_mode_(grad_mode), + inference_mode_(inference_mode), + fw_grad_mode_(fw_grad_mode), + multithreading_enabled_(multithreading_enabled), + view_replay_enabled_(false) {} + + void set_grad_mode(bool enabled) { + grad_mode_ = enabled; + } + + void set_fw_grad_mode(bool enabled) { + fw_grad_mode_ = enabled; + } + + void set_inference_mode(bool enabled) { + inference_mode_ = enabled; + } + + void set_multithreading_enabled(bool multithreading_enabled) { + multithreading_enabled_ = multithreading_enabled; + } + + void set_view_replay_enabled(bool view_replay_enabled) { + view_replay_enabled_ = view_replay_enabled; + } + + bool get_grad_mode() const { + return grad_mode_; + } + + bool get_fw_grad_mode() const { + return fw_grad_mode_; + } + + bool get_inference_mode() const { + return inference_mode_; + } + + bool get_multithreading_enabled() const { + return multithreading_enabled_; + } + + bool get_view_replay_enabled() const { + return view_replay_enabled_; + } + + private: + bool grad_mode_ : 1; + bool inference_mode_ : 1; + bool fw_grad_mode_ : 1; + bool multithreading_enabled_ : 1; + bool view_replay_enabled_ : 1; +}; + +} // namespace c10 diff --git a/shared/package-files/08/08e19609857da5e3862ea9585a1a86e00353d94aa502da157a16c92d6e9fc47c/blob b/shared/package-files/08/08e19609857da5e3862ea9585a1a86e00353d94aa502da157a16c92d6e9fc47c/blob new file mode 100644 index 0000000000000000000000000000000000000000..30f0dbf91b078ef670868d5e7321f956a6a7a506 --- /dev/null +++ b/shared/package-files/08/08e19609857da5e3862ea9585a1a86e00353d94aa502da157a16c92d6e9fc47c/blob @@ -0,0 +1,15 @@ +@RELATION test2 + +@ATTRIBUTE attr0 REAL +@ATTRIBUTE attr1 real +@ATTRIBUTE attr2 integer +@ATTRIBUTE attr3 Integer +@ATTRIBUTE attr4 Numeric +@ATTRIBUTE attr5 numeric +@ATTRIBUTE attr6 string +@ATTRIBUTE attr7 STRING +@ATTRIBUTE attr8 {bla} +@ATTRIBUTE attr9 {bla, bla} + +@DATA +0.1, 0.2, 0.3, 0.4,class1 diff --git a/shared/package-files/08/08e768f35d2af2f8d5c8788e62c803e537001381b76d0533417944ae80d6b23d/blob b/shared/package-files/08/08e768f35d2af2f8d5c8788e62c803e537001381b76d0533417944ae80d6b23d/blob new file mode 100644 index 0000000000000000000000000000000000000000..37f08011d662026eab1089948c37dc5af38f9b79 --- /dev/null +++ b/shared/package-files/08/08e768f35d2af2f8d5c8788e62c803e537001381b76d0533417944ae80d6b23d/blob @@ -0,0 +1,852 @@ +import string + +from sympy.concrete.products import Product +from sympy.concrete.summations import Sum +from sympy.core.function import (diff, expand_func) +from sympy.core import (EulerGamma, TribonacciConstant) +from sympy.core.numbers import (Float, I, Rational, oo, pi) +from sympy.core.singleton import S +from sympy.core.symbol import (Dummy, Symbol, symbols) +from sympy.functions.combinatorial.numbers import carmichael +from sympy.functions.elementary.complexes import (im, re) +from sympy.functions.elementary.integers import floor +from sympy.polys.polytools import cancel +from sympy.series.limits import limit, Limit +from sympy.series.order import O +from sympy.functions import ( + bernoulli, harmonic, bell, fibonacci, tribonacci, lucas, euler, catalan, + genocchi, andre, partition, motzkin, binomial, gamma, sqrt, cbrt, hyper, log, digamma, + trigamma, polygamma, factorial, sin, cos, cot, polylog, zeta, dirichlet_eta) +from sympy.functions.combinatorial.numbers import _nT + +from sympy.core.expr import unchanged +from sympy.core.numbers import GoldenRatio, Integer + +from sympy.testing.pytest import raises, nocache_fail, warns_deprecated_sympy +from sympy.abc import x + + +def test_carmichael(): + assert carmichael.find_carmichael_numbers_in_range(0, 561) == [] + assert carmichael.find_carmichael_numbers_in_range(561, 562) == [561] + assert carmichael.find_carmichael_numbers_in_range(561, 1105) == carmichael.find_carmichael_numbers_in_range(561, + 562) + assert carmichael.find_first_n_carmichaels(5) == [561, 1105, 1729, 2465, 2821] + raises(ValueError, lambda: carmichael.is_carmichael(-2)) + raises(ValueError, lambda: carmichael.find_carmichael_numbers_in_range(-2, 2)) + raises(ValueError, lambda: carmichael.find_carmichael_numbers_in_range(22, 2)) + with warns_deprecated_sympy(): + assert carmichael.is_prime(2821) == False + + +def test_bernoulli(): + assert bernoulli(0) == 1 + assert bernoulli(1) == Rational(1, 2) + assert bernoulli(2) == Rational(1, 6) + assert bernoulli(3) == 0 + assert bernoulli(4) == Rational(-1, 30) + assert bernoulli(5) == 0 + assert bernoulli(6) == Rational(1, 42) + assert bernoulli(7) == 0 + assert bernoulli(8) == Rational(-1, 30) + assert bernoulli(10) == Rational(5, 66) + assert bernoulli(1000001) == 0 + + assert bernoulli(0, x) == 1 + assert bernoulli(1, x) == x - S.Half + assert bernoulli(2, x) == x**2 - x + Rational(1, 6) + assert bernoulli(3, x) == x**3 - (3*x**2)/2 + x/2 + + # Should be fast; computed with mpmath + b = bernoulli(1000) + assert b.p % 10**10 == 7950421099 + assert b.q == 342999030 + + b = bernoulli(10**6, evaluate=False).evalf() + assert str(b) == '-2.23799235765713e+4767529' + + # Issue #8527 + l = Symbol('l', integer=True) + m = Symbol('m', integer=True, nonnegative=True) + n = Symbol('n', integer=True, positive=True) + assert isinstance(bernoulli(2 * l + 1), bernoulli) + assert isinstance(bernoulli(2 * m + 1), bernoulli) + assert bernoulli(2 * n + 1) == 0 + + assert bernoulli(x, 1) == bernoulli(x) + + assert str(bernoulli(0.0, 2.3).evalf(n=10)) == '1.000000000' + assert str(bernoulli(1.0).evalf(n=10)) == '0.5000000000' + assert str(bernoulli(1.2).evalf(n=10)) == '0.4195995367' + assert str(bernoulli(1.2, 0.8).evalf(n=10)) == '0.2144830348' + assert str(bernoulli(1.2, -0.8).evalf(n=10)) == '-1.158865646 - 0.6745558744*I' + assert str(bernoulli(3.0, 1j).evalf(n=10)) == '1.5 - 0.5*I' + assert str(bernoulli(I).evalf(n=10)) == '0.9268485643 - 0.5821580598*I' + assert str(bernoulli(I, I).evalf(n=10)) == '0.1267792071 + 0.01947413152*I' + assert bernoulli(x).evalf() == bernoulli(x) + + +def test_bernoulli_rewrite(): + from sympy.functions.elementary.piecewise import Piecewise + n = Symbol('n', integer=True, nonnegative=True) + + assert bernoulli(-1).rewrite(zeta) == pi**2/6 + assert bernoulli(-2).rewrite(zeta) == 2*zeta(3) + assert not bernoulli(n, -3).rewrite(zeta).has(harmonic) + assert bernoulli(-4, x).rewrite(zeta) == 4*zeta(5, x) + assert isinstance(bernoulli(n, x).rewrite(zeta), Piecewise) + assert bernoulli(n+1, x).rewrite(zeta) == -(n+1) * zeta(-n, x) + + +def test_fibonacci(): + assert [fibonacci(n) for n in range(-3, 5)] == [2, -1, 1, 0, 1, 1, 2, 3] + assert fibonacci(100) == 354224848179261915075 + assert [lucas(n) for n in range(-3, 5)] == [-4, 3, -1, 2, 1, 3, 4, 7] + assert lucas(100) == 792070839848372253127 + + assert fibonacci(1, x) == 1 + assert fibonacci(2, x) == x + assert fibonacci(3, x) == x**2 + 1 + assert fibonacci(4, x) == x**3 + 2*x + + # issue #8800 + n = Dummy('n') + assert fibonacci(n).limit(n, S.Infinity) is S.Infinity + assert lucas(n).limit(n, S.Infinity) is S.Infinity + + assert fibonacci(n).rewrite(sqrt) == \ + 2**(-n)*sqrt(5)*((1 + sqrt(5))**n - (-sqrt(5) + 1)**n) / 5 + assert fibonacci(n).rewrite(sqrt).subs(n, 10).expand() == fibonacci(10) + assert fibonacci(n).rewrite(GoldenRatio).subs(n,10).evalf() == \ + Float(fibonacci(10)) + assert lucas(n).rewrite(sqrt) == \ + (fibonacci(n-1).rewrite(sqrt) + fibonacci(n+1).rewrite(sqrt)).simplify() + assert lucas(n).rewrite(sqrt).subs(n, 10).expand() == lucas(10) + raises(ValueError, lambda: fibonacci(-3, x)) + + +def test_tribonacci(): + assert [tribonacci(n) for n in range(8)] == [0, 1, 1, 2, 4, 7, 13, 24] + assert tribonacci(100) == 98079530178586034536500564 + + assert tribonacci(0, x) == 0 + assert tribonacci(1, x) == 1 + assert tribonacci(2, x) == x**2 + assert tribonacci(3, x) == x**4 + x + assert tribonacci(4, x) == x**6 + 2*x**3 + 1 + assert tribonacci(5, x) == x**8 + 3*x**5 + 3*x**2 + + n = Dummy('n') + assert tribonacci(n).limit(n, S.Infinity) is S.Infinity + + w = (-1 + S.ImaginaryUnit * sqrt(3)) / 2 + a = (1 + cbrt(19 + 3*sqrt(33)) + cbrt(19 - 3*sqrt(33))) / 3 + b = (1 + w*cbrt(19 + 3*sqrt(33)) + w**2*cbrt(19 - 3*sqrt(33))) / 3 + c = (1 + w**2*cbrt(19 + 3*sqrt(33)) + w*cbrt(19 - 3*sqrt(33))) / 3 + assert tribonacci(n).rewrite(sqrt) == \ + (a**(n + 1)/((a - b)*(a - c)) + + b**(n + 1)/((b - a)*(b - c)) + + c**(n + 1)/((c - a)*(c - b))) + assert tribonacci(n).rewrite(sqrt).subs(n, 4).simplify() == tribonacci(4) + assert tribonacci(n).rewrite(GoldenRatio).subs(n,10).evalf() == \ + Float(tribonacci(10)) + assert tribonacci(n).rewrite(TribonacciConstant) == floor( + 3*TribonacciConstant**n*(102*sqrt(33) + 586)**Rational(1, 3)/ + (-2*(102*sqrt(33) + 586)**Rational(1, 3) + 4 + (102*sqrt(33) + + 586)**Rational(2, 3)) + S.Half) + raises(ValueError, lambda: tribonacci(-1, x)) + + +@nocache_fail +def test_bell(): + assert [bell(n) for n in range(8)] == [1, 1, 2, 5, 15, 52, 203, 877] + + assert bell(0, x) == 1 + assert bell(1, x) == x + assert bell(2, x) == x**2 + x + assert bell(5, x) == x**5 + 10*x**4 + 25*x**3 + 15*x**2 + x + assert bell(oo) is S.Infinity + raises(ValueError, lambda: bell(oo, x)) + + raises(ValueError, lambda: bell(-1)) + raises(ValueError, lambda: bell(S.Half)) + + X = symbols('x:6') + # X = (x0, x1, .. x5) + # at the same time: X[1] = x1, X[2] = x2 for standard readablity. + # but we must supply zero-based indexed object X[1:] = (x1, .. x5) + + assert bell(6, 2, X[1:]) == 6*X[5]*X[1] + 15*X[4]*X[2] + 10*X[3]**2 + assert bell( + 6, 3, X[1:]) == 15*X[4]*X[1]**2 + 60*X[3]*X[2]*X[1] + 15*X[2]**3 + + X = (1, 10, 100, 1000, 10000) + assert bell(6, 2, X) == (6 + 15 + 10)*10000 + + X = (1, 2, 3, 3, 5) + assert bell(6, 2, X) == 6*5 + 15*3*2 + 10*3**2 + + X = (1, 2, 3, 5) + assert bell(6, 3, X) == 15*5 + 60*3*2 + 15*2**3 + + # Dobinski's formula + n = Symbol('n', integer=True, nonnegative=True) + # For large numbers, this is too slow + # For nonintegers, there are significant precision errors + for i in [0, 2, 3, 7, 13, 42, 55]: + # Running without the cache this is either very slow or goes into an + # infinite loop. + assert bell(i).evalf() == bell(n).rewrite(Sum).evalf(subs={n: i}) + + m = Symbol("m") + assert bell(m).rewrite(Sum) == bell(m) + assert bell(n, m).rewrite(Sum) == bell(n, m) + # issue 9184 + n = Dummy('n') + assert bell(n).limit(n, S.Infinity) is S.Infinity + + +def test_harmonic(): + n = Symbol("n") + m = Symbol("m") + + assert harmonic(n, 0) == n + assert harmonic(n).evalf() == harmonic(n) + assert harmonic(n, 1) == harmonic(n) + assert harmonic(1, n) == 1 + + assert harmonic(0, 1) == 0 + assert harmonic(1, 1) == 1 + assert harmonic(2, 1) == Rational(3, 2) + assert harmonic(3, 1) == Rational(11, 6) + assert harmonic(4, 1) == Rational(25, 12) + assert harmonic(0, 2) == 0 + assert harmonic(1, 2) == 1 + assert harmonic(2, 2) == Rational(5, 4) + assert harmonic(3, 2) == Rational(49, 36) + assert harmonic(4, 2) == Rational(205, 144) + assert harmonic(0, 3) == 0 + assert harmonic(1, 3) == 1 + assert harmonic(2, 3) == Rational(9, 8) + assert harmonic(3, 3) == Rational(251, 216) + assert harmonic(4, 3) == Rational(2035, 1728) + + assert harmonic(oo, -1) is S.NaN + assert harmonic(oo, 0) is oo + assert harmonic(oo, S.Half) is oo + assert harmonic(oo, 1) is oo + assert harmonic(oo, 2) == (pi**2)/6 + assert harmonic(oo, 3) == zeta(3) + assert harmonic(oo, Dummy(negative=True)) is S.NaN + ip = Dummy(integer=True, positive=True) + if (1/ip <= 1) is True: #---------------------------------+ + assert None, 'delete this if-block and the next line' #| + ip = Dummy(even=True, positive=True) #--------------------+ + assert harmonic(oo, 1/ip) is oo + assert harmonic(oo, 1 + ip) is zeta(1 + ip) + + assert harmonic(0, m) == 0 + assert harmonic(-1, -1) == 0 + assert harmonic(-1, 0) == -1 + assert harmonic(-1, 1) is S.ComplexInfinity + assert harmonic(-1, 2) is S.NaN + assert harmonic(-3, -2) == -5 + assert harmonic(-3, -3) == 9 + + +def test_harmonic_rational(): + ne = S(6) + no = S(5) + pe = S(8) + po = S(9) + qe = S(10) + qo = S(13) + + Heee = harmonic(ne + pe/qe) + Aeee = (-log(10) + 2*(Rational(-1, 4) + sqrt(5)/4)*log(sqrt(-sqrt(5)/8 + Rational(5, 8))) + + 2*(-sqrt(5)/4 - Rational(1, 4))*log(sqrt(sqrt(5)/8 + Rational(5, 8))) + + pi*sqrt(2*sqrt(5)/5 + 1)/2 + Rational(13944145, 4720968)) + + Heeo = harmonic(ne + pe/qo) + Aeeo = (-log(26) + 2*log(sin(pi*Rational(3, 13)))*cos(pi*Rational(4, 13)) + 2*log(sin(pi*Rational(2, 13)))*cos(pi*Rational(32, 13)) + + 2*log(sin(pi*Rational(5, 13)))*cos(pi*Rational(80, 13)) - 2*log(sin(pi*Rational(6, 13)))*cos(pi*Rational(5, 13)) + - 2*log(sin(pi*Rational(4, 13)))*cos(pi/13) + pi*cot(pi*Rational(5, 13))/2 - 2*log(sin(pi/13))*cos(pi*Rational(3, 13)) + + Rational(2422020029, 702257080)) + + Heoe = harmonic(ne + po/qe) + Aeoe = (-log(20) + 2*(Rational(1, 4) + sqrt(5)/4)*log(Rational(-1, 4) + sqrt(5)/4) + + 2*(Rational(-1, 4) + sqrt(5)/4)*log(sqrt(-sqrt(5)/8 + Rational(5, 8))) + + 2*(-sqrt(5)/4 - Rational(1, 4))*log(sqrt(sqrt(5)/8 + Rational(5, 8))) + + 2*(-sqrt(5)/4 + Rational(1, 4))*log(Rational(1, 4) + sqrt(5)/4) + + Rational(11818877030, 4286604231) + pi*sqrt(2*sqrt(5) + 5)/2) + + Heoo = harmonic(ne + po/qo) + Aeoo = (-log(26) + 2*log(sin(pi*Rational(3, 13)))*cos(pi*Rational(54, 13)) + 2*log(sin(pi*Rational(4, 13)))*cos(pi*Rational(6, 13)) + + 2*log(sin(pi*Rational(6, 13)))*cos(pi*Rational(108, 13)) - 2*log(sin(pi*Rational(5, 13)))*cos(pi/13) + - 2*log(sin(pi/13))*cos(pi*Rational(5, 13)) + pi*cot(pi*Rational(4, 13))/2 + - 2*log(sin(pi*Rational(2, 13)))*cos(pi*Rational(3, 13)) + Rational(11669332571, 3628714320)) + + Hoee = harmonic(no + pe/qe) + Aoee = (-log(10) + 2*(Rational(-1, 4) + sqrt(5)/4)*log(sqrt(-sqrt(5)/8 + Rational(5, 8))) + + 2*(-sqrt(5)/4 - Rational(1, 4))*log(sqrt(sqrt(5)/8 + Rational(5, 8))) + + pi*sqrt(2*sqrt(5)/5 + 1)/2 + Rational(779405, 277704)) + + Hoeo = harmonic(no + pe/qo) + Aoeo = (-log(26) + 2*log(sin(pi*Rational(3, 13)))*cos(pi*Rational(4, 13)) + 2*log(sin(pi*Rational(2, 13)))*cos(pi*Rational(32, 13)) + + 2*log(sin(pi*Rational(5, 13)))*cos(pi*Rational(80, 13)) - 2*log(sin(pi*Rational(6, 13)))*cos(pi*Rational(5, 13)) + - 2*log(sin(pi*Rational(4, 13)))*cos(pi/13) + pi*cot(pi*Rational(5, 13))/2 + - 2*log(sin(pi/13))*cos(pi*Rational(3, 13)) + Rational(53857323, 16331560)) + + Hooe = harmonic(no + po/qe) + Aooe = (-log(20) + 2*(Rational(1, 4) + sqrt(5)/4)*log(Rational(-1, 4) + sqrt(5)/4) + + 2*(Rational(-1, 4) + sqrt(5)/4)*log(sqrt(-sqrt(5)/8 + Rational(5, 8))) + + 2*(-sqrt(5)/4 - Rational(1, 4))*log(sqrt(sqrt(5)/8 + Rational(5, 8))) + + 2*(-sqrt(5)/4 + Rational(1, 4))*log(Rational(1, 4) + sqrt(5)/4) + + Rational(486853480, 186374097) + pi*sqrt(2*sqrt(5) + 5)/2) + + Hooo = harmonic(no + po/qo) + Aooo = (-log(26) + 2*log(sin(pi*Rational(3, 13)))*cos(pi*Rational(54, 13)) + 2*log(sin(pi*Rational(4, 13)))*cos(pi*Rational(6, 13)) + + 2*log(sin(pi*Rational(6, 13)))*cos(pi*Rational(108, 13)) - 2*log(sin(pi*Rational(5, 13)))*cos(pi/13) + - 2*log(sin(pi/13))*cos(pi*Rational(5, 13)) + pi*cot(pi*Rational(4, 13))/2 + - 2*log(sin(pi*Rational(2, 13)))*cos(3*pi/13) + Rational(383693479, 125128080)) + + H = [Heee, Heeo, Heoe, Heoo, Hoee, Hoeo, Hooe, Hooo] + A = [Aeee, Aeeo, Aeoe, Aeoo, Aoee, Aoeo, Aooe, Aooo] + for h, a in zip(H, A): + e = expand_func(h).doit() + assert cancel(e/a) == 1 + assert abs(h.n() - a.n()) < 1e-12 + + +def test_harmonic_evalf(): + assert str(harmonic(1.5).evalf(n=10)) == '1.280372306' + assert str(harmonic(1.5, 2).evalf(n=10)) == '1.154576311' # issue 7443 + assert str(harmonic(4.0, -3).evalf(n=10)) == '100.0000000' + assert str(harmonic(7.0, 1.0).evalf(n=10)) == '2.592857143' + assert str(harmonic(1, pi).evalf(n=10)) == '1.000000000' + assert str(harmonic(2, pi).evalf(n=10)) == '1.113314732' + assert str(harmonic(1000.0, pi).evalf(n=10)) == '1.176241563' + assert str(harmonic(I).evalf(n=10)) == '0.6718659855 + 1.076674047*I' + assert str(harmonic(I, I).evalf(n=10)) == '-0.3970915266 + 1.9629689*I' + + assert harmonic(-1.0, 1).evalf() is S.NaN + assert harmonic(-2.0, 2.0).evalf() is S.NaN + +def test_harmonic_rewrite(): + from sympy.functions.elementary.piecewise import Piecewise + n = Symbol("n") + m = Symbol("m", integer=True, positive=True) + x1 = Symbol("x1", positive=True) + x2 = Symbol("x2", negative=True) + + assert harmonic(n).rewrite(digamma) == polygamma(0, n + 1) + EulerGamma + assert harmonic(n).rewrite(trigamma) == polygamma(0, n + 1) + EulerGamma + assert harmonic(n).rewrite(polygamma) == polygamma(0, n + 1) + EulerGamma + + assert harmonic(n,3).rewrite(polygamma) == polygamma(2, n + 1)/2 - polygamma(2, 1)/2 + assert isinstance(harmonic(n,m).rewrite(polygamma), Piecewise) + + assert expand_func(harmonic(n+4)) == harmonic(n) + 1/(n + 4) + 1/(n + 3) + 1/(n + 2) + 1/(n + 1) + assert expand_func(harmonic(n-4)) == harmonic(n) - 1/(n - 1) - 1/(n - 2) - 1/(n - 3) - 1/n + + assert harmonic(n, m).rewrite("tractable") == harmonic(n, m).rewrite(polygamma) + assert harmonic(n, x1).rewrite("tractable") == harmonic(n, x1) + assert harmonic(n, x1 + 1).rewrite("tractable") == zeta(x1 + 1) - zeta(x1 + 1, n + 1) + assert harmonic(n, x2).rewrite("tractable") == zeta(x2) - zeta(x2, n + 1) + + _k = Dummy("k") + assert harmonic(n).rewrite(Sum).dummy_eq(Sum(1/_k, (_k, 1, n))) + assert harmonic(n, m).rewrite(Sum).dummy_eq(Sum(_k**(-m), (_k, 1, n))) + + +def test_harmonic_calculus(): + y = Symbol("y", positive=True) + z = Symbol("z", negative=True) + assert harmonic(x, 1).limit(x, 0) == 0 + assert harmonic(x, y).limit(x, 0) == 0 + assert harmonic(x, 1).series(x, y, 2) == \ + harmonic(y) + (x - y)*zeta(2, y + 1) + O((x - y)**2, (x, y)) + assert limit(harmonic(x, y), x, oo) == harmonic(oo, y) + assert limit(harmonic(x, y + 1), x, oo) == zeta(y + 1) + assert limit(harmonic(x, y - 1), x, oo) == harmonic(oo, y - 1) + assert limit(harmonic(x, z), x, oo) == Limit(harmonic(x, z), x, oo, dir='-') + assert limit(harmonic(x, z + 1), x, oo) == oo + assert limit(harmonic(x, z + 2), x, oo) == harmonic(oo, z + 2) + assert limit(harmonic(x, z - 1), x, oo) == Limit(harmonic(x, z - 1), x, oo, dir='-') + + +def test_euler(): + assert euler(0) == 1 + assert euler(1) == 0 + assert euler(2) == -1 + assert euler(3) == 0 + assert euler(4) == 5 + assert euler(6) == -61 + assert euler(8) == 1385 + + assert euler(20, evaluate=False) != 370371188237525 + + n = Symbol('n', integer=True) + assert euler(n) != -1 + assert euler(n).subs(n, 2) == -1 + + assert euler(-1) == S.Pi / 2 + assert euler(-1, 1) == 2*log(2) + assert euler(-2).evalf() == (2*S.Catalan).evalf() + assert euler(-3).evalf() == (S.Pi**3 / 16).evalf() + assert str(euler(2.3).evalf(n=10)) == '-1.052850274' + assert str(euler(1.2, 3.4).evalf(n=10)) == '3.575613489' + assert str(euler(I).evalf(n=10)) == '1.248446443 - 0.7675445124*I' + assert str(euler(I, I).evalf(n=10)) == '0.04812930469 + 0.01052411008*I' + + assert euler(20).evalf() == 370371188237525.0 + assert euler(20, evaluate=False).evalf() == 370371188237525.0 + + assert euler(n).rewrite(Sum) == euler(n) + n = Symbol('n', integer=True, nonnegative=True) + assert euler(2*n + 1).rewrite(Sum) == 0 + _j = Dummy('j') + _k = Dummy('k') + assert euler(2*n).rewrite(Sum).dummy_eq( + I*Sum((-1)**_j*2**(-_k)*I**(-_k)*(-2*_j + _k)**(2*n + 1)* + binomial(_k, _j)/_k, (_j, 0, _k), (_k, 1, 2*n + 1))) + + +def test_euler_odd(): + n = Symbol('n', odd=True, positive=True) + assert euler(n) == 0 + n = Symbol('n', odd=True) + assert euler(n) != 0 + + +def test_euler_polynomials(): + assert euler(0, x) == 1 + assert euler(1, x) == x - S.Half + assert euler(2, x) == x**2 - x + assert euler(3, x) == x**3 - (3*x**2)/2 + Rational(1, 4) + m = Symbol('m') + assert isinstance(euler(m, x), euler) + from sympy.core.numbers import Float + A = Float('-0.46237208575048694923364757452876131e8') # from Maple + B = euler(19, S.Pi).evalf(32) + assert abs((A - B)/A) < 1e-31 + + +def test_euler_polynomial_rewrite(): + m = Symbol('m') + A = euler(m, x).rewrite('Sum'); + assert A.subs({m:3, x:5}).doit() == euler(3, 5) + + +def test_catalan(): + n = Symbol('n', integer=True) + m = Symbol('m', integer=True, positive=True) + k = Symbol('k', integer=True, nonnegative=True) + p = Symbol('p', nonnegative=True) + + catalans = [1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786] + for i, c in enumerate(catalans): + assert catalan(i) == c + assert catalan(n).rewrite(factorial).subs(n, i) == c + assert catalan(n).rewrite(Product).subs(n, i).doit() == c + + assert unchanged(catalan, x) + assert catalan(2*x).rewrite(binomial) == binomial(4*x, 2*x)/(2*x + 1) + assert catalan(S.Half).rewrite(gamma) == 8/(3*pi) + assert catalan(S.Half).rewrite(factorial).rewrite(gamma) ==\ + 8 / (3 * pi) + assert catalan(3*x).rewrite(gamma) == 4**( + 3*x)*gamma(3*x + S.Half)/(sqrt(pi)*gamma(3*x + 2)) + assert catalan(x).rewrite(hyper) == hyper((-x + 1, -x), (2,), 1) + + assert catalan(n).rewrite(factorial) == factorial(2*n) / (factorial(n + 1) + * factorial(n)) + assert isinstance(catalan(n).rewrite(Product), catalan) + assert isinstance(catalan(m).rewrite(Product), Product) + + assert diff(catalan(x), x) == (polygamma( + 0, x + S.Half) - polygamma(0, x + 2) + log(4))*catalan(x) + + assert catalan(x).evalf() == catalan(x) + c = catalan(S.Half).evalf() + assert str(c) == '0.848826363156775' + c = catalan(I).evalf(3) + assert str((re(c), im(c))) == '(0.398, -0.0209)' + + # Assumptions + assert catalan(p).is_positive is True + assert catalan(k).is_integer is True + assert catalan(m+3).is_composite is True + + +def test_genocchi(): + genocchis = [0, -1, -1, 0, 1, 0, -3, 0, 17] + for n, g in enumerate(genocchis): + assert genocchi(n) == g + + m = Symbol('m', integer=True) + n = Symbol('n', integer=True, positive=True) + assert unchanged(genocchi, m) + assert genocchi(2*n + 1) == 0 + gn = 2 * (1 - 2**n) * bernoulli(n) + assert genocchi(n).rewrite(bernoulli).factor() == gn.factor() + gnx = 2 * (bernoulli(n, x) - 2**n * bernoulli(n, (x+1) / 2)) + assert genocchi(n, x).rewrite(bernoulli).factor() == gnx.factor() + assert genocchi(2 * n).is_odd + assert genocchi(2 * n).is_even is False + assert genocchi(2 * n + 1).is_even + assert genocchi(n).is_integer + assert genocchi(4 * n).is_positive + # these are the only 2 prime Genocchi numbers + assert genocchi(6, evaluate=False).is_prime == S(-3).is_prime + assert genocchi(8, evaluate=False).is_prime + assert genocchi(4 * n + 2).is_negative + assert genocchi(4 * n + 1).is_negative is False + assert genocchi(4 * n - 2).is_negative + + g0 = genocchi(0, evaluate=False) + assert g0.is_positive is False + assert g0.is_negative is False + assert g0.is_even is True + assert g0.is_odd is False + + assert genocchi(0, x) == 0 + assert genocchi(1, x) == -1 + assert genocchi(2, x) == 1 - 2*x + assert genocchi(3, x) == 3*x - 3*x**2 + assert genocchi(4, x) == -1 + 6*x**2 - 4*x**3 + y = Symbol("y") + assert genocchi(5, (x+y)**100) == -5*(x+y)**400 + 10*(x+y)**300 - 5*(x+y)**100 + + assert str(genocchi(5.0, 4.0).evalf(n=10)) == '-660.0000000' + assert str(genocchi(Rational(5, 4)).evalf(n=10)) == '-1.104286457' + assert str(genocchi(-2).evalf(n=10)) == '3.606170709' + assert str(genocchi(1.3, 3.7).evalf(n=10)) == '-1.847375373' + assert str(genocchi(I, 1.0).evalf(n=10)) == '-0.3161917278 - 1.45311955*I' + + n = Symbol('n') + assert genocchi(n, x).rewrite(dirichlet_eta) == -2*n * dirichlet_eta(1-n, x) + + +def test_andre(): + nums = [1, 1, 1, 2, 5, 16, 61, 272, 1385, 7936, 50521] + for n, a in enumerate(nums): + assert andre(n) == a + assert andre(S.Infinity) == S.Infinity + assert andre(-1) == -log(2) + assert andre(-2) == -2*S.Catalan + assert andre(-3) == 3*zeta(3)/16 + assert andre(-5) == -15*zeta(5)/256 + # In fact andre(-2*n) is related to the Dirichlet *beta* function + # at 2*n, but SymPy doesn't implement that (or general L-functions) + assert unchanged(andre, -4) + + n = Symbol('n', integer=True, nonnegative=True) + assert unchanged(andre, n) + assert andre(n).is_integer is True + assert andre(n).is_positive is True + + assert str(andre(10, evaluate=False).evalf(n=10)) == '50521.00000' + assert str(andre(-1, evaluate=False).evalf(n=10)) == '-0.6931471806' + assert str(andre(-2, evaluate=False).evalf(n=10)) == '-1.831931188' + assert str(andre(-4, evaluate=False).evalf(n=10)) == '1.977889103' + assert str(andre(I, evaluate=False).evalf(n=10)) == '2.378417833 + 0.6343322845*I' + + assert andre(x).rewrite(polylog) == \ + (-I)**(x+1) * polylog(-x, I) + I**(x+1) * polylog(-x, -I) + assert andre(x).rewrite(zeta) == \ + 2 * gamma(x+1) / (2*pi)**(x+1) * \ + (zeta(x+1, Rational(1,4)) - cos(pi*x) * zeta(x+1, Rational(3,4))) + + +@nocache_fail +def test_partition(): + partition_nums = [1, 1, 2, 3, 5, 7, 11, 15, 22] + for n, p in enumerate(partition_nums): + assert partition(n) == p + + x = Symbol('x') + y = Symbol('y', real=True) + m = Symbol('m', integer=True) + n = Symbol('n', integer=True, negative=True) + p = Symbol('p', integer=True, nonnegative=True) + assert partition(m).is_integer + assert not partition(m).is_negative + assert partition(m).is_nonnegative + assert partition(n).is_zero + assert partition(p).is_positive + assert partition(x).subs(x, 7) == 15 + assert partition(y).subs(y, 8) == 22 + raises(ValueError, lambda: partition(Rational(5, 4))) + + +def test__nT(): + assert [_nT(i, j) for i in range(5) for j in range(i + 2)] == [ + 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 2, 1, 1, 0] + check = [_nT(10, i) for i in range(11)] + assert check == [0, 1, 5, 8, 9, 7, 5, 3, 2, 1, 1] + assert all(type(i) is int for i in check) + assert _nT(10, 5) == 7 + assert _nT(100, 98) == 2 + assert _nT(100, 100) == 1 + assert _nT(10, 3) == 8 + + +def test_nC_nP_nT(): + from sympy.utilities.iterables import ( + multiset_permutations, multiset_combinations, multiset_partitions, + partitions, subsets, permutations) + from sympy.functions.combinatorial.numbers import ( + nP, nC, nT, stirling, _stirling1, _stirling2, _multiset_histogram, _AOP_product) + + from sympy.combinatorics.permutations import Permutation + from sympy.core.random import choice + + c = string.ascii_lowercase + for i in range(100): + s = ''.join(choice(c) for i in range(7)) + u = len(s) == len(set(s)) + try: + tot = 0 + for i in range(8): + check = nP(s, i) + tot += check + assert len(list(multiset_permutations(s, i))) == check + if u: + assert nP(len(s), i) == check + assert nP(s) == tot + except AssertionError: + print(s, i, 'failed perm test') + raise ValueError() + + for i in range(100): + s = ''.join(choice(c) for i in range(7)) + u = len(s) == len(set(s)) + try: + tot = 0 + for i in range(8): + check = nC(s, i) + tot += check + assert len(list(multiset_combinations(s, i))) == check + if u: + assert nC(len(s), i) == check + assert nC(s) == tot + if u: + assert nC(len(s)) == tot + except AssertionError: + print(s, i, 'failed combo test') + raise ValueError() + + for i in range(1, 10): + tot = 0 + for j in range(1, i + 2): + check = nT(i, j) + assert check.is_Integer + tot += check + assert sum(1 for p in partitions(i, j, size=True) if p[0] == j) == check + assert nT(i) == tot + + for i in range(1, 10): + tot = 0 + for j in range(1, i + 2): + check = nT(range(i), j) + tot += check + assert len(list(multiset_partitions(list(range(i)), j))) == check + assert nT(range(i)) == tot + + for i in range(100): + s = ''.join(choice(c) for i in range(7)) + u = len(s) == len(set(s)) + try: + tot = 0 + for i in range(1, 8): + check = nT(s, i) + tot += check + assert len(list(multiset_partitions(s, i))) == check + if u: + assert nT(range(len(s)), i) == check + if u: + assert nT(range(len(s))) == tot + assert nT(s) == tot + except AssertionError: + print(s, i, 'failed partition test') + raise ValueError() + + # tests for Stirling numbers of the first kind that are not tested in the + # above + assert [stirling(9, i, kind=1) for i in range(11)] == [ + 0, 40320, 109584, 118124, 67284, 22449, 4536, 546, 36, 1, 0] + perms = list(permutations(range(4))) + assert [sum(1 for p in perms if Permutation(p).cycles == i) + for i in range(5)] == [0, 6, 11, 6, 1] == [ + stirling(4, i, kind=1) for i in range(5)] + # http://oeis.org/A008275 + assert [stirling(n, k, signed=1) + for n in range(10) for k in range(1, n + 1)] == [ + 1, -1, + 1, 2, -3, + 1, -6, 11, -6, + 1, 24, -50, 35, -10, + 1, -120, 274, -225, 85, -15, + 1, 720, -1764, 1624, -735, 175, -21, + 1, -5040, 13068, -13132, 6769, -1960, 322, -28, + 1, 40320, -109584, 118124, -67284, 22449, -4536, 546, -36, 1] + # https://en.wikipedia.org/wiki/Stirling_numbers_of_the_first_kind + assert [stirling(n, k, kind=1) + for n in range(10) for k in range(n+1)] == [ + 1, + 0, 1, + 0, 1, 1, + 0, 2, 3, 1, + 0, 6, 11, 6, 1, + 0, 24, 50, 35, 10, 1, + 0, 120, 274, 225, 85, 15, 1, + 0, 720, 1764, 1624, 735, 175, 21, 1, + 0, 5040, 13068, 13132, 6769, 1960, 322, 28, 1, + 0, 40320, 109584, 118124, 67284, 22449, 4536, 546, 36, 1] + # https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind + assert [stirling(n, k, kind=2) + for n in range(10) for k in range(n+1)] == [ + 1, + 0, 1, + 0, 1, 1, + 0, 1, 3, 1, + 0, 1, 7, 6, 1, + 0, 1, 15, 25, 10, 1, + 0, 1, 31, 90, 65, 15, 1, + 0, 1, 63, 301, 350, 140, 21, 1, + 0, 1, 127, 966, 1701, 1050, 266, 28, 1, + 0, 1, 255, 3025, 7770, 6951, 2646, 462, 36, 1] + assert stirling(3, 4, kind=1) == stirling(3, 4, kind=1) == 0 + raises(ValueError, lambda: stirling(-2, 2)) + + # Assertion that the return type is SymPy Integer. + assert isinstance(_stirling1(6, 3), Integer) + assert isinstance(_stirling2(6, 3), Integer) + + def delta(p): + if len(p) == 1: + return oo + return min(abs(i[0] - i[1]) for i in subsets(p, 2)) + parts = multiset_partitions(range(5), 3) + d = 2 + assert (sum(1 for p in parts if all(delta(i) >= d for i in p)) == + stirling(5, 3, d=d) == 7) + + # other coverage tests + assert nC('abb', 2) == nC('aab', 2) == 2 + assert nP(3, 3, replacement=True) == nP('aabc', 3, replacement=True) == 27 + assert nP(3, 4) == 0 + assert nP('aabc', 5) == 0 + assert nC(4, 2, replacement=True) == nC('abcdd', 2, replacement=True) == \ + len(list(multiset_combinations('aabbccdd', 2))) == 10 + assert nC('abcdd') == sum(nC('abcdd', i) for i in range(6)) == 24 + assert nC(list('abcdd'), 4) == 4 + assert nT('aaaa') == nT(4) == len(list(partitions(4))) == 5 + assert nT('aaab') == len(list(multiset_partitions('aaab'))) == 7 + assert nC('aabb'*3, 3) == 4 # aaa, bbb, abb, baa + assert dict(_AOP_product((4,1,1,1))) == { + 0: 1, 1: 4, 2: 7, 3: 8, 4: 8, 5: 7, 6: 4, 7: 1} + # the following was the first t that showed a problem in a previous form of + # the function, so it's not as random as it may appear + t = (3, 9, 4, 6, 6, 5, 5, 2, 10, 4) + assert sum(_AOP_product(t)[i] for i in range(55)) == 58212000 + raises(ValueError, lambda: _multiset_histogram({1:'a'})) + + +def test_PR_14617(): + from sympy.functions.combinatorial.numbers import nT + for n in (0, []): + for k in (-1, 0, 1): + if k == 0: + assert nT(n, k) == 1 + else: + assert nT(n, k) == 0 + + +def test_issue_8496(): + n = Symbol("n") + k = Symbol("k") + + raises(TypeError, lambda: catalan(n, k)) + + +def test_issue_8601(): + n = Symbol('n', integer=True, negative=True) + + assert catalan(n - 1) is S.Zero + assert catalan(Rational(-1, 2)) is S.ComplexInfinity + assert catalan(-S.One) == Rational(-1, 2) + c1 = catalan(-5.6).evalf() + assert str(c1) == '6.93334070531408e-5' + c2 = catalan(-35.4).evalf() + assert str(c2) == '-4.14189164517449e-24' + + +def test_motzkin(): + assert motzkin.is_motzkin(4) == True + assert motzkin.is_motzkin(9) == True + assert motzkin.is_motzkin(10) == False + assert motzkin.find_motzkin_numbers_in_range(10,200) == [21, 51, 127] + assert motzkin.find_motzkin_numbers_in_range(10,400) == [21, 51, 127, 323] + assert motzkin.find_motzkin_numbers_in_range(10,1600) == [21, 51, 127, 323, 835] + assert motzkin.find_first_n_motzkins(5) == [1, 1, 2, 4, 9] + assert motzkin.find_first_n_motzkins(7) == [1, 1, 2, 4, 9, 21, 51] + assert motzkin.find_first_n_motzkins(10) == [1, 1, 2, 4, 9, 21, 51, 127, 323, 835] + raises(ValueError, lambda: motzkin.eval(77.58)) + raises(ValueError, lambda: motzkin.eval(-8)) + raises(ValueError, lambda: motzkin.find_motzkin_numbers_in_range(-2,7)) + raises(ValueError, lambda: motzkin.find_motzkin_numbers_in_range(13,7)) + raises(ValueError, lambda: motzkin.find_first_n_motzkins(112.8)) + + +def test_nD_derangements(): + from sympy.utilities.iterables import (partitions, multiset, + multiset_derangements, multiset_permutations) + from sympy.functions.combinatorial.numbers import nD + + got = [] + for i in partitions(8, k=4): + s = [] + it = 0 + for k, v in i.items(): + for i in range(v): + s.extend([it]*k) + it += 1 + ms = multiset(s) + c1 = sum(1 for i in multiset_permutations(s) if + all(i != j for i, j in zip(i, s))) + assert c1 == nD(ms) == nD(ms, 0) == nD(ms, 1) + v = [tuple(i) for i in multiset_derangements(s)] + c2 = len(v) + assert c2 == len(set(v)) + assert c1 == c2 + got.append(c1) + assert got == [1, 4, 6, 12, 24, 24, 61, 126, 315, 780, 297, 772, + 2033, 5430, 14833] + + assert nD('1112233456', brute=True) == nD('1112233456') == 16356 + assert nD('') == nD([]) == nD({}) == 0 + assert nD({1: 0}) == 0 + raises(ValueError, lambda: nD({1: -1})) + assert nD('112') == 0 + assert nD(i='112') == 0 + assert [nD(n=i) for i in range(6)] == [0, 0, 1, 2, 9, 44] + assert nD((i for i in range(4))) == nD('0123') == 9 + assert nD(m=(i for i in range(4))) == 3 + assert nD(m={0: 1, 1: 1, 2: 1, 3: 1}) == 3 + assert nD(m=[0, 1, 2, 3]) == 3 + raises(TypeError, lambda: nD(m=0)) + raises(TypeError, lambda: nD(-1)) + assert nD({-1: 1, -2: 1}) == 1 + assert nD(m={0: 3}) == 0 + raises(ValueError, lambda: nD(i='123', n=3)) + raises(ValueError, lambda: nD(i='123', m=(1,2))) + raises(ValueError, lambda: nD(n=0, m=(1,2))) + raises(ValueError, lambda: nD({1: -1})) + raises(ValueError, lambda: nD(m={-1: 1, 2: 1})) + raises(ValueError, lambda: nD(m={1: -1, 2: 1})) + raises(ValueError, lambda: nD(m=[-1, 2])) + raises(TypeError, lambda: nD({1: x})) + raises(TypeError, lambda: nD(m={1: x})) + raises(TypeError, lambda: nD(m={x: 1})) diff --git a/shared/package-files/08/08e87363e587c102c8179aa7fd7bc13e08169fd39f330ec9d8838b57adcc29ac/blob b/shared/package-files/08/08e87363e587c102c8179aa7fd7bc13e08169fd39f330ec9d8838b57adcc29ac/blob new file mode 100644 index 0000000000000000000000000000000000000000..e221c3fea4e02fc66cb206e856415a963b66026f --- /dev/null +++ b/shared/package-files/08/08e87363e587c102c8179aa7fd7bc13e08169fd39f330ec9d8838b57adcc29ac/blob @@ -0,0 +1,250 @@ +import numpy as np +import pytest + +from sklearn.utils._cython_blas import ( + BLAS_Order, + BLAS_Trans, + _asum_memview, + _axpy_memview, + _copy_memview, + _dot_memview, + _gemm_memview, + _gemv_memview, + _ger_memview, + _nrm2_memview, + _rot_memview, + _rotg_memview, + _scal_memview, +) +from sklearn.utils._testing import assert_allclose + + +def _numpy_to_cython(dtype): + cython = pytest.importorskip("cython") + if dtype == np.float32: + return cython.float + elif dtype == np.float64: + return cython.double + + +RTOL = {np.float32: 1e-6, np.float64: 1e-12} +ORDER = {BLAS_Order.RowMajor: "C", BLAS_Order.ColMajor: "F"} + + +def _no_op(x): + return x + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +def test_dot(dtype): + dot = _dot_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + x = rng.random_sample(10).astype(dtype, copy=False) + y = rng.random_sample(10).astype(dtype, copy=False) + + expected = x.dot(y) + actual = dot(x, y) + + assert_allclose(actual, expected, rtol=RTOL[dtype]) + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +def test_asum(dtype): + asum = _asum_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + x = rng.random_sample(10).astype(dtype, copy=False) + + expected = np.abs(x).sum() + actual = asum(x) + + assert_allclose(actual, expected, rtol=RTOL[dtype]) + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +def test_axpy(dtype): + axpy = _axpy_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + x = rng.random_sample(10).astype(dtype, copy=False) + y = rng.random_sample(10).astype(dtype, copy=False) + alpha = 2.5 + + expected = alpha * x + y + axpy(alpha, x, y) + + assert_allclose(y, expected, rtol=RTOL[dtype]) + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +def test_nrm2(dtype): + nrm2 = _nrm2_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + x = rng.random_sample(10).astype(dtype, copy=False) + + expected = np.linalg.norm(x) + actual = nrm2(x) + + assert_allclose(actual, expected, rtol=RTOL[dtype]) + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +def test_copy(dtype): + copy = _copy_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + x = rng.random_sample(10).astype(dtype, copy=False) + y = np.empty_like(x) + + expected = x.copy() + copy(x, y) + + assert_allclose(y, expected, rtol=RTOL[dtype]) + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +def test_scal(dtype): + scal = _scal_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + x = rng.random_sample(10).astype(dtype, copy=False) + alpha = 2.5 + + expected = alpha * x + scal(alpha, x) + + assert_allclose(x, expected, rtol=RTOL[dtype]) + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +def test_rotg(dtype): + rotg = _rotg_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + a = dtype(rng.randn()) + b = dtype(rng.randn()) + c, s = 0.0, 0.0 + + def expected_rotg(a, b): + roe = a if abs(a) > abs(b) else b + if a == 0 and b == 0: + c, s, r, z = (1, 0, 0, 0) + else: + r = np.sqrt(a**2 + b**2) * (1 if roe >= 0 else -1) + c, s = a / r, b / r + z = s if roe == a else (1 if c == 0 else 1 / c) + return r, z, c, s + + expected = expected_rotg(a, b) + actual = rotg(a, b, c, s) + + assert_allclose(actual, expected, rtol=RTOL[dtype]) + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +def test_rot(dtype): + rot = _rot_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + x = rng.random_sample(10).astype(dtype, copy=False) + y = rng.random_sample(10).astype(dtype, copy=False) + c = dtype(rng.randn()) + s = dtype(rng.randn()) + + expected_x = c * x + s * y + expected_y = c * y - s * x + + rot(x, y, c, s) + + assert_allclose(x, expected_x) + assert_allclose(y, expected_y) + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +@pytest.mark.parametrize( + "opA, transA", + [(_no_op, BLAS_Trans.NoTrans), (np.transpose, BLAS_Trans.Trans)], + ids=["NoTrans", "Trans"], +) +@pytest.mark.parametrize( + "order", + [BLAS_Order.RowMajor, BLAS_Order.ColMajor], + ids=["RowMajor", "ColMajor"], +) +def test_gemv(dtype, opA, transA, order): + gemv = _gemv_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + A = np.asarray( + opA(rng.random_sample((20, 10)).astype(dtype, copy=False)), order=ORDER[order] + ) + x = rng.random_sample(10).astype(dtype, copy=False) + y = rng.random_sample(20).astype(dtype, copy=False) + alpha, beta = 2.5, -0.5 + + expected = alpha * opA(A).dot(x) + beta * y + gemv(transA, alpha, A, x, beta, y) + + assert_allclose(y, expected, rtol=RTOL[dtype]) + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +@pytest.mark.parametrize( + "order", + [BLAS_Order.RowMajor, BLAS_Order.ColMajor], + ids=["BLAS_Order.RowMajor", "BLAS_Order.ColMajor"], +) +def test_ger(dtype, order): + ger = _ger_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + x = rng.random_sample(10).astype(dtype, copy=False) + y = rng.random_sample(20).astype(dtype, copy=False) + A = np.asarray( + rng.random_sample((10, 20)).astype(dtype, copy=False), order=ORDER[order] + ) + alpha = 2.5 + + expected = alpha * np.outer(x, y) + A + ger(alpha, x, y, A) + + assert_allclose(A, expected, rtol=RTOL[dtype]) + + +@pytest.mark.parametrize("dtype", [np.float32, np.float64]) +@pytest.mark.parametrize( + "opB, transB", + [(_no_op, BLAS_Trans.NoTrans), (np.transpose, BLAS_Trans.Trans)], + ids=["NoTrans", "Trans"], +) +@pytest.mark.parametrize( + "opA, transA", + [(_no_op, BLAS_Trans.NoTrans), (np.transpose, BLAS_Trans.Trans)], + ids=["NoTrans", "Trans"], +) +@pytest.mark.parametrize( + "order", + [BLAS_Order.RowMajor, BLAS_Order.ColMajor], + ids=["BLAS_Order.RowMajor", "BLAS_Order.ColMajor"], +) +def test_gemm(dtype, opA, transA, opB, transB, order): + gemm = _gemm_memview[_numpy_to_cython(dtype)] + + rng = np.random.RandomState(0) + A = np.asarray( + opA(rng.random_sample((30, 10)).astype(dtype, copy=False)), order=ORDER[order] + ) + B = np.asarray( + opB(rng.random_sample((10, 20)).astype(dtype, copy=False)), order=ORDER[order] + ) + C = np.asarray( + rng.random_sample((30, 20)).astype(dtype, copy=False), order=ORDER[order] + ) + alpha, beta = 2.5, -0.5 + + expected = alpha * opA(A).dot(opB(B)) + beta * C + gemm(transA, transB, alpha, A, B, beta, C) + + assert_allclose(C, expected, rtol=RTOL[dtype]) diff --git a/shared/package-files/08/08e9e5a17afbf8c7ad3e1f98a2707587ab04cb9524cc16164dd36e106b9db9ec/blob b/shared/package-files/08/08e9e5a17afbf8c7ad3e1f98a2707587ab04cb9524cc16164dd36e106b9db9ec/blob new file mode 100644 index 0000000000000000000000000000000000000000..a26bd7139b9b7050d4ffc61760a309bb733aeaa1 --- /dev/null +++ b/shared/package-files/08/08e9e5a17afbf8c7ad3e1f98a2707587ab04cb9524cc16164dd36e106b9db9ec/blob @@ -0,0 +1,1862 @@ +from itertools import product +import math +import inspect + + + +import mpmath +from sympy.testing.pytest import raises, warns_deprecated_sympy +from sympy.concrete.summations import Sum +from sympy.core.function import (Function, Lambda, diff) +from sympy.core.numbers import (E, Float, I, Rational, oo, pi) +from sympy.core.relational import Eq +from sympy.core.singleton import S +from sympy.core.symbol import (Dummy, symbols) +from sympy.functions.combinatorial.factorials import (RisingFactorial, factorial) +from sympy.functions.combinatorial.numbers import bernoulli, harmonic +from sympy.functions.elementary.complexes import Abs +from sympy.functions.elementary.exponential import exp, log +from sympy.functions.elementary.hyperbolic import acosh +from sympy.functions.elementary.integers import floor +from sympy.functions.elementary.miscellaneous import (Max, Min, sqrt) +from sympy.functions.elementary.piecewise import Piecewise +from sympy.functions.elementary.trigonometric import (acos, cos, cot, sin, + sinc, tan) +from sympy.functions.special.bessel import (besseli, besselj, besselk, bessely) +from sympy.functions.special.beta_functions import (beta, betainc, betainc_regularized) +from sympy.functions.special.delta_functions import (Heaviside) +from sympy.functions.special.error_functions import (Ei, erf, erfc, fresnelc, fresnels, Si, Ci) +from sympy.functions.special.gamma_functions import (digamma, gamma, loggamma, polygamma) +from sympy.integrals.integrals import Integral +from sympy.logic.boolalg import (And, false, ITE, Not, Or, true) +from sympy.matrices.expressions.dotproduct import DotProduct +from sympy.tensor.array import derive_by_array, Array +from sympy.tensor.indexed import IndexedBase +from sympy.utilities.lambdify import lambdify +from sympy.core.expr import UnevaluatedExpr +from sympy.codegen.cfunctions import expm1, log1p, exp2, log2, log10, hypot +from sympy.codegen.numpy_nodes import logaddexp, logaddexp2 +from sympy.codegen.scipy_nodes import cosm1, powm1 +from sympy.functions.elementary.complexes import re, im, arg +from sympy.functions.special.polynomials import \ + chebyshevt, chebyshevu, legendre, hermite, laguerre, gegenbauer, \ + assoc_legendre, assoc_laguerre, jacobi +from sympy.matrices import Matrix, MatrixSymbol, SparseMatrix +from sympy.printing.lambdarepr import LambdaPrinter +from sympy.printing.numpy import NumPyPrinter +from sympy.utilities.lambdify import implemented_function, lambdastr +from sympy.testing.pytest import skip +from sympy.utilities.decorator import conserve_mpmath_dps +from sympy.utilities.exceptions import ignore_warnings +from sympy.external import import_module +from sympy.functions.special.gamma_functions import uppergamma, lowergamma + + +import sympy + + +MutableDenseMatrix = Matrix + +numpy = import_module('numpy') +scipy = import_module('scipy', import_kwargs={'fromlist': ['sparse']}) +numexpr = import_module('numexpr') +tensorflow = import_module('tensorflow') +cupy = import_module('cupy') +jax = import_module('jax') +numba = import_module('numba') + +if tensorflow: + # Hide Tensorflow warnings + import os + os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' + +w, x, y, z = symbols('w,x,y,z') + +#================== Test different arguments ======================= + + +def test_no_args(): + f = lambdify([], 1) + raises(TypeError, lambda: f(-1)) + assert f() == 1 + + +def test_single_arg(): + f = lambdify(x, 2*x) + assert f(1) == 2 + + +def test_list_args(): + f = lambdify([x, y], x + y) + assert f(1, 2) == 3 + + +def test_nested_args(): + f1 = lambdify([[w, x]], [w, x]) + assert f1([91, 2]) == [91, 2] + raises(TypeError, lambda: f1(1, 2)) + + f2 = lambdify([(w, x), (y, z)], [w, x, y, z]) + assert f2((18, 12), (73, 4)) == [18, 12, 73, 4] + raises(TypeError, lambda: f2(3, 4)) + + f3 = lambdify([w, [[[x]], y], z], [w, x, y, z]) + assert f3(10, [[[52]], 31], 44) == [10, 52, 31, 44] + + +def test_str_args(): + f = lambdify('x,y,z', 'z,y,x') + assert f(3, 2, 1) == (1, 2, 3) + assert f(1.0, 2.0, 3.0) == (3.0, 2.0, 1.0) + # make sure correct number of args required + raises(TypeError, lambda: f(0)) + + +def test_own_namespace_1(): + myfunc = lambda x: 1 + f = lambdify(x, sin(x), {"sin": myfunc}) + assert f(0.1) == 1 + assert f(100) == 1 + + +def test_own_namespace_2(): + def myfunc(x): + return 1 + f = lambdify(x, sin(x), {'sin': myfunc}) + assert f(0.1) == 1 + assert f(100) == 1 + + +def test_own_module(): + f = lambdify(x, sin(x), math) + assert f(0) == 0.0 + + p, q, r = symbols("p q r", real=True) + ae = abs(exp(p+UnevaluatedExpr(q+r))) + f = lambdify([p, q, r], [ae, ae], modules=math) + results = f(1.0, 1e18, -1e18) + refvals = [math.exp(1.0)]*2 + for res, ref in zip(results, refvals): + assert abs((res-ref)/ref) < 1e-15 + + +def test_bad_args(): + # no vargs given + raises(TypeError, lambda: lambdify(1)) + # same with vector exprs + raises(TypeError, lambda: lambdify([1, 2])) + + +def test_atoms(): + # Non-Symbol atoms should not be pulled out from the expression namespace + f = lambdify(x, pi + x, {"pi": 3.14}) + assert f(0) == 3.14 + f = lambdify(x, I + x, {"I": 1j}) + assert f(1) == 1 + 1j + +#================== Test different modules ========================= + +# high precision output of sin(0.2*pi) is used to detect if precision is lost unwanted + + +@conserve_mpmath_dps +def test_sympy_lambda(): + mpmath.mp.dps = 50 + sin02 = mpmath.mpf("0.19866933079506121545941262711838975037020672954020") + f = lambdify(x, sin(x), "sympy") + assert f(x) == sin(x) + prec = 1e-15 + assert -prec < f(Rational(1, 5)).evalf() - Float(str(sin02)) < prec + # arctan is in numpy module and should not be available + # The arctan below gives NameError. What is this supposed to test? + # raises(NameError, lambda: lambdify(x, arctan(x), "sympy")) + + +@conserve_mpmath_dps +def test_math_lambda(): + mpmath.mp.dps = 50 + sin02 = mpmath.mpf("0.19866933079506121545941262711838975037020672954020") + f = lambdify(x, sin(x), "math") + prec = 1e-15 + assert -prec < f(0.2) - sin02 < prec + raises(TypeError, lambda: f(x)) + # if this succeeds, it can't be a Python math function + + +@conserve_mpmath_dps +def test_mpmath_lambda(): + mpmath.mp.dps = 50 + sin02 = mpmath.mpf("0.19866933079506121545941262711838975037020672954020") + f = lambdify(x, sin(x), "mpmath") + prec = 1e-49 # mpmath precision is around 50 decimal places + assert -prec < f(mpmath.mpf("0.2")) - sin02 < prec + raises(TypeError, lambda: f(x)) + # if this succeeds, it can't be a mpmath function + + ref2 = (mpmath.mpf("1e-30") + - mpmath.mpf("1e-45")/2 + + 5*mpmath.mpf("1e-60")/6 + - 3*mpmath.mpf("1e-75")/4 + + 33*mpmath.mpf("1e-90")/40 + ) + f2a = lambdify((x, y), x**y - 1, "mpmath") + f2b = lambdify((x, y), powm1(x, y), "mpmath") + f2c = lambdify((x,), expm1(x*log1p(x)), "mpmath") + ans2a = f2a(mpmath.mpf("1")+mpmath.mpf("1e-15"), mpmath.mpf("1e-15")) + ans2b = f2b(mpmath.mpf("1")+mpmath.mpf("1e-15"), mpmath.mpf("1e-15")) + ans2c = f2c(mpmath.mpf("1e-15")) + assert abs(ans2a - ref2) < 1e-51 + assert abs(ans2b - ref2) < 1e-67 + assert abs(ans2c - ref2) < 1e-80 + + +@conserve_mpmath_dps +def test_number_precision(): + mpmath.mp.dps = 50 + sin02 = mpmath.mpf("0.19866933079506121545941262711838975037020672954020") + f = lambdify(x, sin02, "mpmath") + prec = 1e-49 # mpmath precision is around 50 decimal places + assert -prec < f(0) - sin02 < prec + +@conserve_mpmath_dps +def test_mpmath_precision(): + mpmath.mp.dps = 100 + assert str(lambdify((), pi.evalf(100), 'mpmath')()) == str(pi.evalf(100)) + +#================== Test Translations ============================== +# We can only check if all translated functions are valid. It has to be checked +# by hand if they are complete. + + +def test_math_transl(): + from sympy.utilities.lambdify import MATH_TRANSLATIONS + for sym, mat in MATH_TRANSLATIONS.items(): + assert sym in sympy.__dict__ + assert mat in math.__dict__ + + +def test_mpmath_transl(): + from sympy.utilities.lambdify import MPMATH_TRANSLATIONS + for sym, mat in MPMATH_TRANSLATIONS.items(): + assert sym in sympy.__dict__ or sym == 'Matrix' + assert mat in mpmath.__dict__ + + +def test_numpy_transl(): + if not numpy: + skip("numpy not installed.") + + from sympy.utilities.lambdify import NUMPY_TRANSLATIONS + for sym, nump in NUMPY_TRANSLATIONS.items(): + assert sym in sympy.__dict__ + assert nump in numpy.__dict__ + + +def test_scipy_transl(): + if not scipy: + skip("scipy not installed.") + + from sympy.utilities.lambdify import SCIPY_TRANSLATIONS + for sym, scip in SCIPY_TRANSLATIONS.items(): + assert sym in sympy.__dict__ + assert scip in scipy.__dict__ or scip in scipy.special.__dict__ + + +def test_numpy_translation_abs(): + if not numpy: + skip("numpy not installed.") + + f = lambdify(x, Abs(x), "numpy") + assert f(-1) == 1 + assert f(1) == 1 + + +def test_numexpr_printer(): + if not numexpr: + skip("numexpr not installed.") + + # if translation/printing is done incorrectly then evaluating + # a lambdified numexpr expression will throw an exception + from sympy.printing.lambdarepr import NumExprPrinter + + blacklist = ('where', 'complex', 'contains') + arg_tuple = (x, y, z) # some functions take more than one argument + for sym in NumExprPrinter._numexpr_functions.keys(): + if sym in blacklist: + continue + ssym = S(sym) + if hasattr(ssym, '_nargs'): + nargs = ssym._nargs[0] + else: + nargs = 1 + args = arg_tuple[:nargs] + f = lambdify(args, ssym(*args), modules='numexpr') + assert f(*(1, )*nargs) is not None + + +def test_issue_9334(): + if not numexpr: + skip("numexpr not installed.") + if not numpy: + skip("numpy not installed.") + expr = S('b*a - sqrt(a**2)') + a, b = sorted(expr.free_symbols, key=lambda s: s.name) + func_numexpr = lambdify((a,b), expr, modules=[numexpr], dummify=False) + foo, bar = numpy.random.random((2, 4)) + func_numexpr(foo, bar) + + +def test_issue_12984(): + if not numexpr: + skip("numexpr not installed.") + func_numexpr = lambdify((x,y,z), Piecewise((y, x >= 0), (z, x > -1)), numexpr) + with ignore_warnings(RuntimeWarning): + assert func_numexpr(1, 24, 42) == 24 + assert str(func_numexpr(-1, 24, 42)) == 'nan' + + +def test_empty_modules(): + x, y = symbols('x y') + expr = -(x % y) + + no_modules = lambdify([x, y], expr) + empty_modules = lambdify([x, y], expr, modules=[]) + assert no_modules(3, 7) == empty_modules(3, 7) + assert no_modules(3, 7) == -3 + + +def test_exponentiation(): + f = lambdify(x, x**2) + assert f(-1) == 1 + assert f(0) == 0 + assert f(1) == 1 + assert f(-2) == 4 + assert f(2) == 4 + assert f(2.5) == 6.25 + + +def test_sqrt(): + f = lambdify(x, sqrt(x)) + assert f(0) == 0.0 + assert f(1) == 1.0 + assert f(4) == 2.0 + assert abs(f(2) - 1.414) < 0.001 + assert f(6.25) == 2.5 + + +def test_trig(): + f = lambdify([x], [cos(x), sin(x)], 'math') + d = f(pi) + prec = 1e-11 + assert -prec < d[0] + 1 < prec + assert -prec < d[1] < prec + d = f(3.14159) + prec = 1e-5 + assert -prec < d[0] + 1 < prec + assert -prec < d[1] < prec + + +def test_integral(): + if numpy and not scipy: + skip("scipy not installed.") + f = Lambda(x, exp(-x**2)) + l = lambdify(y, Integral(f(x), (x, y, oo))) + d = l(-oo) + assert 1.77245385 < d < 1.772453851 + + +def test_double_integral(): + if numpy and not scipy: + skip("scipy not installed.") + # example from http://mpmath.org/doc/current/calculus/integration.html + i = Integral(1/(1 - x**2*y**2), (x, 0, 1), (y, 0, z)) + l = lambdify([z], i) + d = l(1) + assert 1.23370055 < d < 1.233700551 + + +#================== Test vectors =================================== + + +def test_vector_simple(): + f = lambdify((x, y, z), (z, y, x)) + assert f(3, 2, 1) == (1, 2, 3) + assert f(1.0, 2.0, 3.0) == (3.0, 2.0, 1.0) + # make sure correct number of args required + raises(TypeError, lambda: f(0)) + + +def test_vector_discontinuous(): + f = lambdify(x, (-1/x, 1/x)) + raises(ZeroDivisionError, lambda: f(0)) + assert f(1) == (-1.0, 1.0) + assert f(2) == (-0.5, 0.5) + assert f(-2) == (0.5, -0.5) + + +def test_trig_symbolic(): + f = lambdify([x], [cos(x), sin(x)], 'math') + d = f(pi) + assert abs(d[0] + 1) < 0.0001 + assert abs(d[1] - 0) < 0.0001 + + +def test_trig_float(): + f = lambdify([x], [cos(x), sin(x)]) + d = f(3.14159) + assert abs(d[0] + 1) < 0.0001 + assert abs(d[1] - 0) < 0.0001 + + +def test_docs(): + f = lambdify(x, x**2) + assert f(2) == 4 + f = lambdify([x, y, z], [z, y, x]) + assert f(1, 2, 3) == [3, 2, 1] + f = lambdify(x, sqrt(x)) + assert f(4) == 2.0 + f = lambdify((x, y), sin(x*y)**2) + assert f(0, 5) == 0 + + +def test_math(): + f = lambdify((x, y), sin(x), modules="math") + assert f(0, 5) == 0 + + +def test_sin(): + f = lambdify(x, sin(x)**2) + assert isinstance(f(2), float) + f = lambdify(x, sin(x)**2, modules="math") + assert isinstance(f(2), float) + + +def test_matrix(): + A = Matrix([[x, x*y], [sin(z) + 4, x**z]]) + sol = Matrix([[1, 2], [sin(3) + 4, 1]]) + f = lambdify((x, y, z), A, modules="sympy") + assert f(1, 2, 3) == sol + f = lambdify((x, y, z), (A, [A]), modules="sympy") + assert f(1, 2, 3) == (sol, [sol]) + J = Matrix((x, x + y)).jacobian((x, y)) + v = Matrix((x, y)) + sol = Matrix([[1, 0], [1, 1]]) + assert lambdify(v, J, modules='sympy')(1, 2) == sol + assert lambdify(v.T, J, modules='sympy')(1, 2) == sol + + +def test_numpy_matrix(): + if not numpy: + skip("numpy not installed.") + A = Matrix([[x, x*y], [sin(z) + 4, x**z]]) + sol_arr = numpy.array([[1, 2], [numpy.sin(3) + 4, 1]]) + #Lambdify array first, to ensure return to array as default + f = lambdify((x, y, z), A, ['numpy']) + numpy.testing.assert_allclose(f(1, 2, 3), sol_arr) + #Check that the types are arrays and matrices + assert isinstance(f(1, 2, 3), numpy.ndarray) + + # gh-15071 + class dot(Function): + pass + x_dot_mtx = dot(x, Matrix([[2], [1], [0]])) + f_dot1 = lambdify(x, x_dot_mtx) + inp = numpy.zeros((17, 3)) + assert numpy.all(f_dot1(inp) == 0) + + strict_kw = {"allow_unknown_functions": False, "inline": True, "fully_qualified_modules": False} + p2 = NumPyPrinter(dict(user_functions={'dot': 'dot'}, **strict_kw)) + f_dot2 = lambdify(x, x_dot_mtx, printer=p2) + assert numpy.all(f_dot2(inp) == 0) + + p3 = NumPyPrinter(strict_kw) + # The line below should probably fail upon construction (before calling with "(inp)"): + raises(Exception, lambda: lambdify(x, x_dot_mtx, printer=p3)(inp)) + + +def test_numpy_transpose(): + if not numpy: + skip("numpy not installed.") + A = Matrix([[1, x], [0, 1]]) + f = lambdify((x), A.T, modules="numpy") + numpy.testing.assert_array_equal(f(2), numpy.array([[1, 0], [2, 1]])) + + +def test_numpy_dotproduct(): + if not numpy: + skip("numpy not installed") + A = Matrix([x, y, z]) + f1 = lambdify([x, y, z], DotProduct(A, A), modules='numpy') + f2 = lambdify([x, y, z], DotProduct(A, A.T), modules='numpy') + f3 = lambdify([x, y, z], DotProduct(A.T, A), modules='numpy') + f4 = lambdify([x, y, z], DotProduct(A, A.T), modules='numpy') + + assert f1(1, 2, 3) == \ + f2(1, 2, 3) == \ + f3(1, 2, 3) == \ + f4(1, 2, 3) == \ + numpy.array([14]) + + +def test_numpy_inverse(): + if not numpy: + skip("numpy not installed.") + A = Matrix([[1, x], [0, 1]]) + f = lambdify((x), A**-1, modules="numpy") + numpy.testing.assert_array_equal(f(2), numpy.array([[1, -2], [0, 1]])) + + +def test_numpy_old_matrix(): + if not numpy: + skip("numpy not installed.") + A = Matrix([[x, x*y], [sin(z) + 4, x**z]]) + sol_arr = numpy.array([[1, 2], [numpy.sin(3) + 4, 1]]) + f = lambdify((x, y, z), A, [{'ImmutableDenseMatrix': numpy.matrix}, 'numpy']) + with ignore_warnings(PendingDeprecationWarning): + numpy.testing.assert_allclose(f(1, 2, 3), sol_arr) + assert isinstance(f(1, 2, 3), numpy.matrix) + + +def test_scipy_sparse_matrix(): + if not scipy: + skip("scipy not installed.") + A = SparseMatrix([[x, 0], [0, y]]) + f = lambdify((x, y), A, modules="scipy") + B = f(1, 2) + assert isinstance(B, scipy.sparse.coo_matrix) + + +def test_python_div_zero_issue_11306(): + if not numpy: + skip("numpy not installed.") + p = Piecewise((1 / x, y < -1), (x, y < 1), (1 / x, True)) + f = lambdify([x, y], p, modules='numpy') + numpy.seterr(divide='ignore') + assert float(f(numpy.array([0]),numpy.array([0.5]))) == 0 + assert str(float(f(numpy.array([0]),numpy.array([1])))) == 'inf' + numpy.seterr(divide='warn') + + +def test_issue9474(): + mods = [None, 'math'] + if numpy: + mods.append('numpy') + if mpmath: + mods.append('mpmath') + for mod in mods: + f = lambdify(x, S.One/x, modules=mod) + assert f(2) == 0.5 + f = lambdify(x, floor(S.One/x), modules=mod) + assert f(2) == 0 + + for absfunc, modules in product([Abs, abs], mods): + f = lambdify(x, absfunc(x), modules=modules) + assert f(-1) == 1 + assert f(1) == 1 + assert f(3+4j) == 5 + + +def test_issue_9871(): + if not numexpr: + skip("numexpr not installed.") + if not numpy: + skip("numpy not installed.") + + r = sqrt(x**2 + y**2) + expr = diff(1/r, x) + + xn = yn = numpy.linspace(1, 10, 16) + # expr(xn, xn) = -xn/(sqrt(2)*xn)^3 + fv_exact = -numpy.sqrt(2.)**-3 * xn**-2 + + fv_numpy = lambdify((x, y), expr, modules='numpy')(xn, yn) + fv_numexpr = lambdify((x, y), expr, modules='numexpr')(xn, yn) + numpy.testing.assert_allclose(fv_numpy, fv_exact, rtol=1e-10) + numpy.testing.assert_allclose(fv_numexpr, fv_exact, rtol=1e-10) + + +def test_numpy_piecewise(): + if not numpy: + skip("numpy not installed.") + pieces = Piecewise((x, x < 3), (x**2, x > 5), (0, True)) + f = lambdify(x, pieces, modules="numpy") + numpy.testing.assert_array_equal(f(numpy.arange(10)), + numpy.array([0, 1, 2, 0, 0, 0, 36, 49, 64, 81])) + # If we evaluate somewhere all conditions are False, we should get back NaN + nodef_func = lambdify(x, Piecewise((x, x > 0), (-x, x < 0))) + numpy.testing.assert_array_equal(nodef_func(numpy.array([-1, 0, 1])), + numpy.array([1, numpy.nan, 1])) + + +def test_numpy_logical_ops(): + if not numpy: + skip("numpy not installed.") + and_func = lambdify((x, y), And(x, y), modules="numpy") + and_func_3 = lambdify((x, y, z), And(x, y, z), modules="numpy") + or_func = lambdify((x, y), Or(x, y), modules="numpy") + or_func_3 = lambdify((x, y, z), Or(x, y, z), modules="numpy") + not_func = lambdify((x), Not(x), modules="numpy") + arr1 = numpy.array([True, True]) + arr2 = numpy.array([False, True]) + arr3 = numpy.array([True, False]) + numpy.testing.assert_array_equal(and_func(arr1, arr2), numpy.array([False, True])) + numpy.testing.assert_array_equal(and_func_3(arr1, arr2, arr3), numpy.array([False, False])) + numpy.testing.assert_array_equal(or_func(arr1, arr2), numpy.array([True, True])) + numpy.testing.assert_array_equal(or_func_3(arr1, arr2, arr3), numpy.array([True, True])) + numpy.testing.assert_array_equal(not_func(arr2), numpy.array([True, False])) + + +def test_numpy_matmul(): + if not numpy: + skip("numpy not installed.") + xmat = Matrix([[x, y], [z, 1+z]]) + ymat = Matrix([[x**2], [Abs(x)]]) + mat_func = lambdify((x, y, z), xmat*ymat, modules="numpy") + numpy.testing.assert_array_equal(mat_func(0.5, 3, 4), numpy.array([[1.625], [3.5]])) + numpy.testing.assert_array_equal(mat_func(-0.5, 3, 4), numpy.array([[1.375], [3.5]])) + # Multiple matrices chained together in multiplication + f = lambdify((x, y, z), xmat*xmat*xmat, modules="numpy") + numpy.testing.assert_array_equal(f(0.5, 3, 4), numpy.array([[72.125, 119.25], + [159, 251]])) + + +def test_numpy_numexpr(): + if not numpy: + skip("numpy not installed.") + if not numexpr: + skip("numexpr not installed.") + a, b, c = numpy.random.randn(3, 128, 128) + # ensure that numpy and numexpr return same value for complicated expression + expr = sin(x) + cos(y) + tan(z)**2 + Abs(z-y)*acos(sin(y*z)) + \ + Abs(y-z)*acosh(2+exp(y-x))- sqrt(x**2+I*y**2) + npfunc = lambdify((x, y, z), expr, modules='numpy') + nefunc = lambdify((x, y, z), expr, modules='numexpr') + assert numpy.allclose(npfunc(a, b, c), nefunc(a, b, c)) + + +def test_numexpr_userfunctions(): + if not numpy: + skip("numpy not installed.") + if not numexpr: + skip("numexpr not installed.") + a, b = numpy.random.randn(2, 10) + uf = type('uf', (Function, ), + {'eval' : classmethod(lambda x, y : y**2+1)}) + func = lambdify(x, 1-uf(x), modules='numexpr') + assert numpy.allclose(func(a), -(a**2)) + + uf = implemented_function(Function('uf'), lambda x, y : 2*x*y+1) + func = lambdify((x, y), uf(x, y), modules='numexpr') + assert numpy.allclose(func(a, b), 2*a*b+1) + + +def test_tensorflow_basic_math(): + if not tensorflow: + skip("tensorflow not installed.") + expr = Max(sin(x), Abs(1/(x+2))) + func = lambdify(x, expr, modules="tensorflow") + + with tensorflow.compat.v1.Session() as s: + a = tensorflow.constant(0, dtype=tensorflow.float32) + assert func(a).eval(session=s) == 0.5 + + +def test_tensorflow_placeholders(): + if not tensorflow: + skip("tensorflow not installed.") + expr = Max(sin(x), Abs(1/(x+2))) + func = lambdify(x, expr, modules="tensorflow") + + with tensorflow.compat.v1.Session() as s: + a = tensorflow.compat.v1.placeholder(dtype=tensorflow.float32) + assert func(a).eval(session=s, feed_dict={a: 0}) == 0.5 + + +def test_tensorflow_variables(): + if not tensorflow: + skip("tensorflow not installed.") + expr = Max(sin(x), Abs(1/(x+2))) + func = lambdify(x, expr, modules="tensorflow") + + with tensorflow.compat.v1.Session() as s: + a = tensorflow.Variable(0, dtype=tensorflow.float32) + s.run(a.initializer) + assert func(a).eval(session=s, feed_dict={a: 0}) == 0.5 + + +def test_tensorflow_logical_operations(): + if not tensorflow: + skip("tensorflow not installed.") + expr = Not(And(Or(x, y), y)) + func = lambdify([x, y], expr, modules="tensorflow") + + with tensorflow.compat.v1.Session() as s: + assert func(False, True).eval(session=s) == False + + +def test_tensorflow_piecewise(): + if not tensorflow: + skip("tensorflow not installed.") + expr = Piecewise((0, Eq(x,0)), (-1, x < 0), (1, x > 0)) + func = lambdify(x, expr, modules="tensorflow") + + with tensorflow.compat.v1.Session() as s: + assert func(-1).eval(session=s) == -1 + assert func(0).eval(session=s) == 0 + assert func(1).eval(session=s) == 1 + + +def test_tensorflow_multi_max(): + if not tensorflow: + skip("tensorflow not installed.") + expr = Max(x, -x, x**2) + func = lambdify(x, expr, modules="tensorflow") + + with tensorflow.compat.v1.Session() as s: + assert func(-2).eval(session=s) == 4 + + +def test_tensorflow_multi_min(): + if not tensorflow: + skip("tensorflow not installed.") + expr = Min(x, -x, x**2) + func = lambdify(x, expr, modules="tensorflow") + + with tensorflow.compat.v1.Session() as s: + assert func(-2).eval(session=s) == -2 + + +def test_tensorflow_relational(): + if not tensorflow: + skip("tensorflow not installed.") + expr = x >= 0 + func = lambdify(x, expr, modules="tensorflow") + + with tensorflow.compat.v1.Session() as s: + assert func(1).eval(session=s) == True + + +def test_tensorflow_complexes(): + if not tensorflow: + skip("tensorflow not installed") + + func1 = lambdify(x, re(x), modules="tensorflow") + func2 = lambdify(x, im(x), modules="tensorflow") + func3 = lambdify(x, Abs(x), modules="tensorflow") + func4 = lambdify(x, arg(x), modules="tensorflow") + + with tensorflow.compat.v1.Session() as s: + # For versions before + # https://github.com/tensorflow/tensorflow/issues/30029 + # resolved, using Python numeric types may not work + a = tensorflow.constant(1+2j) + assert func1(a).eval(session=s) == 1 + assert func2(a).eval(session=s) == 2 + + tensorflow_result = func3(a).eval(session=s) + sympy_result = Abs(1 + 2j).evalf() + assert abs(tensorflow_result-sympy_result) < 10**-6 + + tensorflow_result = func4(a).eval(session=s) + sympy_result = arg(1 + 2j).evalf() + assert abs(tensorflow_result-sympy_result) < 10**-6 + + +def test_tensorflow_array_arg(): + # Test for issue 14655 (tensorflow part) + if not tensorflow: + skip("tensorflow not installed.") + + f = lambdify([[x, y]], x*x + y, 'tensorflow') + + with tensorflow.compat.v1.Session() as s: + fcall = f(tensorflow.constant([2.0, 1.0])) + assert fcall.eval(session=s) == 5.0 + + +#================== Test symbolic ================================== + + +def test_sym_single_arg(): + f = lambdify(x, x * y) + assert f(z) == z * y + + +def test_sym_list_args(): + f = lambdify([x, y], x + y + z) + assert f(1, 2) == 3 + z + + +def test_sym_integral(): + f = Lambda(x, exp(-x**2)) + l = lambdify(x, Integral(f(x), (x, -oo, oo)), modules="sympy") + assert l(y) == Integral(exp(-y**2), (y, -oo, oo)) + assert l(y).doit() == sqrt(pi) + + +def test_namespace_order(): + # lambdify had a bug, such that module dictionaries or cached module + # dictionaries would pull earlier namespaces into themselves. + # Because the module dictionaries form the namespace of the + # generated lambda, this meant that the behavior of a previously + # generated lambda function could change as a result of later calls + # to lambdify. + n1 = {'f': lambda x: 'first f'} + n2 = {'f': lambda x: 'second f', + 'g': lambda x: 'function g'} + f = sympy.Function('f') + g = sympy.Function('g') + if1 = lambdify(x, f(x), modules=(n1, "sympy")) + assert if1(1) == 'first f' + if2 = lambdify(x, g(x), modules=(n2, "sympy")) + # previously gave 'second f' + assert if1(1) == 'first f' + + assert if2(1) == 'function g' + + +def test_imps(): + # Here we check if the default returned functions are anonymous - in + # the sense that we can have more than one function with the same name + f = implemented_function('f', lambda x: 2*x) + g = implemented_function('f', lambda x: math.sqrt(x)) + l1 = lambdify(x, f(x)) + l2 = lambdify(x, g(x)) + assert str(f(x)) == str(g(x)) + assert l1(3) == 6 + assert l2(3) == math.sqrt(3) + # check that we can pass in a Function as input + func = sympy.Function('myfunc') + assert not hasattr(func, '_imp_') + my_f = implemented_function(func, lambda x: 2*x) + assert hasattr(my_f, '_imp_') + # Error for functions with same name and different implementation + f2 = implemented_function("f", lambda x: x + 101) + raises(ValueError, lambda: lambdify(x, f(f2(x)))) + + +def test_imps_errors(): + # Test errors that implemented functions can return, and still be able to + # form expressions. + # See: https://github.com/sympy/sympy/issues/10810 + # + # XXX: Removed AttributeError here. This test was added due to issue 10810 + # but that issue was about ValueError. It doesn't seem reasonable to + # "support" catching AttributeError in the same context... + for val, error_class in product((0, 0., 2, 2.0), (TypeError, ValueError)): + + def myfunc(a): + if a == 0: + raise error_class + return 1 + + f = implemented_function('f', myfunc) + expr = f(val) + assert expr == f(val) + + +def test_imps_wrong_args(): + raises(ValueError, lambda: implemented_function(sin, lambda x: x)) + + +def test_lambdify_imps(): + # Test lambdify with implemented functions + # first test basic (sympy) lambdify + f = sympy.cos + assert lambdify(x, f(x))(0) == 1 + assert lambdify(x, 1 + f(x))(0) == 2 + assert lambdify((x, y), y + f(x))(0, 1) == 2 + # make an implemented function and test + f = implemented_function("f", lambda x: x + 100) + assert lambdify(x, f(x))(0) == 100 + assert lambdify(x, 1 + f(x))(0) == 101 + assert lambdify((x, y), y + f(x))(0, 1) == 101 + # Can also handle tuples, lists, dicts as expressions + lam = lambdify(x, (f(x), x)) + assert lam(3) == (103, 3) + lam = lambdify(x, [f(x), x]) + assert lam(3) == [103, 3] + lam = lambdify(x, [f(x), (f(x), x)]) + assert lam(3) == [103, (103, 3)] + lam = lambdify(x, {f(x): x}) + assert lam(3) == {103: 3} + lam = lambdify(x, {f(x): x}) + assert lam(3) == {103: 3} + lam = lambdify(x, {x: f(x)}) + assert lam(3) == {3: 103} + # Check that imp preferred to other namespaces by default + d = {'f': lambda x: x + 99} + lam = lambdify(x, f(x), d) + assert lam(3) == 103 + # Unless flag passed + lam = lambdify(x, f(x), d, use_imps=False) + assert lam(3) == 102 + + +def test_dummification(): + t = symbols('t') + F = Function('F') + G = Function('G') + #"\alpha" is not a valid Python variable name + #lambdify should sub in a dummy for it, and return + #without a syntax error + alpha = symbols(r'\alpha') + some_expr = 2 * F(t)**2 / G(t) + lam = lambdify((F(t), G(t)), some_expr) + assert lam(3, 9) == 2 + lam = lambdify(sin(t), 2 * sin(t)**2) + assert lam(F(t)) == 2 * F(t)**2 + #Test that \alpha was properly dummified + lam = lambdify((alpha, t), 2*alpha + t) + assert lam(2, 1) == 5 + raises(SyntaxError, lambda: lambdify(F(t) * G(t), F(t) * G(t) + 5)) + raises(SyntaxError, lambda: lambdify(2 * F(t), 2 * F(t) + 5)) + raises(SyntaxError, lambda: lambdify(2 * F(t), 4 * F(t) + 5)) + + +def test_curly_matrix_symbol(): + # Issue #15009 + curlyv = sympy.MatrixSymbol("{v}", 2, 1) + lam = lambdify(curlyv, curlyv) + assert lam(1)==1 + lam = lambdify(curlyv, curlyv, dummify=True) + assert lam(1)==1 + + +def test_python_keywords(): + # Test for issue 7452. The automatic dummification should ensure use of + # Python reserved keywords as symbol names will create valid lambda + # functions. This is an additional regression test. + python_if = symbols('if') + expr = python_if / 2 + f = lambdify(python_if, expr) + assert f(4.0) == 2.0 + + +def test_lambdify_docstring(): + func = lambdify((w, x, y, z), w + x + y + z) + ref = ( + "Created with lambdify. Signature:\n\n" + "func(w, x, y, z)\n\n" + "Expression:\n\n" + "w + x + y + z" + ).splitlines() + assert func.__doc__.splitlines()[:len(ref)] == ref + syms = symbols('a1:26') + func = lambdify(syms, sum(syms)) + ref = ( + "Created with lambdify. Signature:\n\n" + "func(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,\n" + " a16, a17, a18, a19, a20, a21, a22, a23, a24, a25)\n\n" + "Expression:\n\n" + "a1 + a10 + a11 + a12 + a13 + a14 + a15 + a16 + a17 + a18 + a19 + a2 + a20 +..." + ).splitlines() + assert func.__doc__.splitlines()[:len(ref)] == ref + + +#================== Test special printers ========================== + + +def test_special_printers(): + from sympy.printing.lambdarepr import IntervalPrinter + + def intervalrepr(expr): + return IntervalPrinter().doprint(expr) + + expr = sqrt(sqrt(2) + sqrt(3)) + S.Half + + func0 = lambdify((), expr, modules="mpmath", printer=intervalrepr) + func1 = lambdify((), expr, modules="mpmath", printer=IntervalPrinter) + func2 = lambdify((), expr, modules="mpmath", printer=IntervalPrinter()) + + mpi = type(mpmath.mpi(1, 2)) + + assert isinstance(func0(), mpi) + assert isinstance(func1(), mpi) + assert isinstance(func2(), mpi) + + # To check Is lambdify loggamma works for mpmath or not + exp1 = lambdify(x, loggamma(x), 'mpmath')(5) + exp2 = lambdify(x, loggamma(x), 'mpmath')(1.8) + exp3 = lambdify(x, loggamma(x), 'mpmath')(15) + exp_ls = [exp1, exp2, exp3] + + sol1 = mpmath.loggamma(5) + sol2 = mpmath.loggamma(1.8) + sol3 = mpmath.loggamma(15) + sol_ls = [sol1, sol2, sol3] + + assert exp_ls == sol_ls + + +def test_true_false(): + # We want exact is comparison here, not just == + assert lambdify([], true)() is True + assert lambdify([], false)() is False + + +def test_issue_2790(): + assert lambdify((x, (y, z)), x + y)(1, (2, 4)) == 3 + assert lambdify((x, (y, (w, z))), w + x + y + z)(1, (2, (3, 4))) == 10 + assert lambdify(x, x + 1, dummify=False)(1) == 2 + + +def test_issue_12092(): + f = implemented_function('f', lambda x: x**2) + assert f(f(2)).evalf() == Float(16) + + +def test_issue_14911(): + class Variable(sympy.Symbol): + def _sympystr(self, printer): + return printer.doprint(self.name) + + _lambdacode = _sympystr + _numpycode = _sympystr + + x = Variable('x') + y = 2 * x + code = LambdaPrinter().doprint(y) + assert code.replace(' ', '') == '2*x' + + +def test_ITE(): + assert lambdify((x, y, z), ITE(x, y, z))(True, 5, 3) == 5 + assert lambdify((x, y, z), ITE(x, y, z))(False, 5, 3) == 3 + + +def test_Min_Max(): + # see gh-10375 + assert lambdify((x, y, z), Min(x, y, z))(1, 2, 3) == 1 + assert lambdify((x, y, z), Max(x, y, z))(1, 2, 3) == 3 + + +def test_Indexed(): + # Issue #10934 + if not numpy: + skip("numpy not installed") + + a = IndexedBase('a') + i, j = symbols('i j') + b = numpy.array([[1, 2], [3, 4]]) + assert lambdify(a, Sum(a[x, y], (x, 0, 1), (y, 0, 1)))(b) == 10 + + +def test_issue_12173(): + #test for issue 12173 + expr1 = lambdify((x, y), uppergamma(x, y),"mpmath")(1, 2) + expr2 = lambdify((x, y), lowergamma(x, y),"mpmath")(1, 2) + assert expr1 == uppergamma(1, 2).evalf() + assert expr2 == lowergamma(1, 2).evalf() + + +def test_issue_13642(): + if not numpy: + skip("numpy not installed") + f = lambdify(x, sinc(x)) + assert Abs(f(1) - sinc(1)).n() < 1e-15 + + +def test_sinc_mpmath(): + f = lambdify(x, sinc(x), "mpmath") + assert Abs(f(1) - sinc(1)).n() < 1e-15 + + +def test_lambdify_dummy_arg(): + d1 = Dummy() + f1 = lambdify(d1, d1 + 1, dummify=False) + assert f1(2) == 3 + f1b = lambdify(d1, d1 + 1) + assert f1b(2) == 3 + d2 = Dummy('x') + f2 = lambdify(d2, d2 + 1) + assert f2(2) == 3 + f3 = lambdify([[d2]], d2 + 1) + assert f3([2]) == 3 + + +def test_lambdify_mixed_symbol_dummy_args(): + d = Dummy() + # Contrived example of name clash + dsym = symbols(str(d)) + f = lambdify([d, dsym], d - dsym) + assert f(4, 1) == 3 + + +def test_numpy_array_arg(): + # Test for issue 14655 (numpy part) + if not numpy: + skip("numpy not installed") + + f = lambdify([[x, y]], x*x + y, 'numpy') + + assert f(numpy.array([2.0, 1.0])) == 5 + + +def test_scipy_fns(): + if not scipy: + skip("scipy not installed") + + single_arg_sympy_fns = [Ei, erf, erfc, factorial, gamma, loggamma, digamma, Si, Ci] + single_arg_scipy_fns = [scipy.special.expi, scipy.special.erf, scipy.special.erfc, + scipy.special.factorial, scipy.special.gamma, scipy.special.gammaln, + scipy.special.psi, scipy.special.sici, scipy.special.sici] + numpy.random.seed(0) + for (sympy_fn, scipy_fn) in zip(single_arg_sympy_fns, single_arg_scipy_fns): + f = lambdify(x, sympy_fn(x), modules="scipy") + for i in range(20): + tv = numpy.random.uniform(-10, 10) + 1j*numpy.random.uniform(-5, 5) + # SciPy thinks that factorial(z) is 0 when re(z) < 0 and + # does not support complex numbers. + # SymPy does not think so. + if sympy_fn == factorial: + tv = numpy.abs(tv) + # SciPy supports gammaln for real arguments only, + # and there is also a branch cut along the negative real axis + if sympy_fn == loggamma: + tv = numpy.abs(tv) + # SymPy's digamma evaluates as polygamma(0, z) + # which SciPy supports for real arguments only + if sympy_fn == digamma: + tv = numpy.real(tv) + sympy_result = sympy_fn(tv).evalf() + scipy_result = scipy_fn(tv) + # SciPy's sici returns a tuple with both Si and Ci present in it + # which needs to be unpacked + if sympy_fn == Si: + scipy_result = scipy_fn(tv)[0] + if sympy_fn == Ci: + scipy_result = scipy_fn(tv)[1] + assert abs(f(tv) - sympy_result) < 1e-13*(1 + abs(sympy_result)) + assert abs(f(tv) - scipy_result) < 1e-13*(1 + abs(sympy_result)) + + double_arg_sympy_fns = [RisingFactorial, besselj, bessely, besseli, + besselk, polygamma] + double_arg_scipy_fns = [scipy.special.poch, scipy.special.jv, + scipy.special.yv, scipy.special.iv, scipy.special.kv, scipy.special.polygamma] + for (sympy_fn, scipy_fn) in zip(double_arg_sympy_fns, double_arg_scipy_fns): + f = lambdify((x, y), sympy_fn(x, y), modules="scipy") + for i in range(20): + # SciPy supports only real orders of Bessel functions + tv1 = numpy.random.uniform(-10, 10) + tv2 = numpy.random.uniform(-10, 10) + 1j*numpy.random.uniform(-5, 5) + # SciPy requires a real valued 2nd argument for: poch, polygamma + if sympy_fn in (RisingFactorial, polygamma): + tv2 = numpy.real(tv2) + if sympy_fn == polygamma: + tv1 = abs(int(tv1)) # first argument to polygamma must be a non-negative integral. + sympy_result = sympy_fn(tv1, tv2).evalf() + assert abs(f(tv1, tv2) - sympy_result) < 1e-13*(1 + abs(sympy_result)) + assert abs(f(tv1, tv2) - scipy_fn(tv1, tv2)) < 1e-13*(1 + abs(sympy_result)) + + +def test_scipy_polys(): + if not scipy: + skip("scipy not installed") + numpy.random.seed(0) + + params = symbols('n k a b') + # list polynomials with the number of parameters + polys = [ + (chebyshevt, 1), + (chebyshevu, 1), + (legendre, 1), + (hermite, 1), + (laguerre, 1), + (gegenbauer, 2), + (assoc_legendre, 2), + (assoc_laguerre, 2), + (jacobi, 3) + ] + + msg = \ + "The random test of the function {func} with the arguments " \ + "{args} had failed because the SymPy result {sympy_result} " \ + "and SciPy result {scipy_result} had failed to converge " \ + "within the tolerance {tol} " \ + "(Actual absolute difference : {diff})" + + for sympy_fn, num_params in polys: + args = params[:num_params] + (x,) + f = lambdify(args, sympy_fn(*args)) + for _ in range(10): + tn = numpy.random.randint(3, 10) + tparams = tuple(numpy.random.uniform(0, 5, size=num_params-1)) + tv = numpy.random.uniform(-10, 10) + 1j*numpy.random.uniform(-5, 5) + # SciPy supports hermite for real arguments only + if sympy_fn == hermite: + tv = numpy.real(tv) + # assoc_legendre needs x in (-1, 1) and integer param at most n + if sympy_fn == assoc_legendre: + tv = numpy.random.uniform(-1, 1) + tparams = tuple(numpy.random.randint(1, tn, size=1)) + + vals = (tn,) + tparams + (tv,) + scipy_result = f(*vals) + sympy_result = sympy_fn(*vals).evalf() + atol = 1e-9*(1 + abs(sympy_result)) + diff = abs(scipy_result - sympy_result) + try: + assert diff < atol + except TypeError: + raise AssertionError( + msg.format( + func=repr(sympy_fn), + args=repr(vals), + sympy_result=repr(sympy_result), + scipy_result=repr(scipy_result), + diff=diff, + tol=atol) + ) + + +def test_lambdify_inspect(): + f = lambdify(x, x**2) + # Test that inspect.getsource works but don't hard-code implementation + # details + assert 'x**2' in inspect.getsource(f) + + +def test_issue_14941(): + x, y = Dummy(), Dummy() + + # test dict + f1 = lambdify([x, y], {x: 3, y: 3}, 'sympy') + assert f1(2, 3) == {2: 3, 3: 3} + + # test tuple + f2 = lambdify([x, y], (y, x), 'sympy') + assert f2(2, 3) == (3, 2) + f2b = lambdify([], (1,)) # gh-23224 + assert f2b() == (1,) + + # test list + f3 = lambdify([x, y], [y, x], 'sympy') + assert f3(2, 3) == [3, 2] + + +def test_lambdify_Derivative_arg_issue_16468(): + f = Function('f')(x) + fx = f.diff() + assert lambdify((f, fx), f + fx)(10, 5) == 15 + assert eval(lambdastr((f, fx), f/fx))(10, 5) == 2 + raises(SyntaxError, lambda: + eval(lambdastr((f, fx), f/fx, dummify=False))) + assert eval(lambdastr((f, fx), f/fx, dummify=True))(10, 5) == 2 + assert eval(lambdastr((fx, f), f/fx, dummify=True))(S(10), 5) == S.Half + assert lambdify(fx, 1 + fx)(41) == 42 + assert eval(lambdastr(fx, 1 + fx, dummify=True))(41) == 42 + + +def test_imag_real(): + f_re = lambdify([z], sympy.re(z)) + val = 3+2j + assert f_re(val) == val.real + + f_im = lambdify([z], sympy.im(z)) # see #15400 + assert f_im(val) == val.imag + + +def test_MatrixSymbol_issue_15578(): + if not numpy: + skip("numpy not installed") + A = MatrixSymbol('A', 2, 2) + A0 = numpy.array([[1, 2], [3, 4]]) + f = lambdify(A, A**(-1)) + assert numpy.allclose(f(A0), numpy.array([[-2., 1.], [1.5, -0.5]])) + g = lambdify(A, A**3) + assert numpy.allclose(g(A0), numpy.array([[37, 54], [81, 118]])) + + +def test_issue_15654(): + if not scipy: + skip("scipy not installed") + from sympy.abc import n, l, r, Z + from sympy.physics import hydrogen + nv, lv, rv, Zv = 1, 0, 3, 1 + sympy_value = hydrogen.R_nl(nv, lv, rv, Zv).evalf() + f = lambdify((n, l, r, Z), hydrogen.R_nl(n, l, r, Z)) + scipy_value = f(nv, lv, rv, Zv) + assert abs(sympy_value - scipy_value) < 1e-15 + + +def test_issue_15827(): + if not numpy: + skip("numpy not installed") + A = MatrixSymbol("A", 3, 3) + B = MatrixSymbol("B", 2, 3) + C = MatrixSymbol("C", 3, 4) + D = MatrixSymbol("D", 4, 5) + k=symbols("k") + f = lambdify(A, (2*k)*A) + g = lambdify(A, (2+k)*A) + h = lambdify(A, 2*A) + i = lambdify((B, C, D), 2*B*C*D) + assert numpy.array_equal(f(numpy.array([[1, 2, 3], [1, 2, 3], [1, 2, 3]])), \ + numpy.array([[2*k, 4*k, 6*k], [2*k, 4*k, 6*k], [2*k, 4*k, 6*k]], dtype=object)) + + assert numpy.array_equal(g(numpy.array([[1, 2, 3], [1, 2, 3], [1, 2, 3]])), \ + numpy.array([[k + 2, 2*k + 4, 3*k + 6], [k + 2, 2*k + 4, 3*k + 6], \ + [k + 2, 2*k + 4, 3*k + 6]], dtype=object)) + + assert numpy.array_equal(h(numpy.array([[1, 2, 3], [1, 2, 3], [1, 2, 3]])), \ + numpy.array([[2, 4, 6], [2, 4, 6], [2, 4, 6]])) + + assert numpy.array_equal(i(numpy.array([[1, 2, 3], [1, 2, 3]]), numpy.array([[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]]), \ + numpy.array([[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]])), numpy.array([[ 120, 240, 360, 480, 600], \ + [ 120, 240, 360, 480, 600]])) + + +def test_issue_16930(): + if not scipy: + skip("scipy not installed") + + x = symbols("x") + f = lambda x: S.GoldenRatio * x**2 + f_ = lambdify(x, f(x), modules='scipy') + assert f_(1) == scipy.constants.golden_ratio + +def test_issue_17898(): + if not scipy: + skip("scipy not installed") + x = symbols("x") + f_ = lambdify([x], sympy.LambertW(x,-1), modules='scipy') + assert f_(0.1) == mpmath.lambertw(0.1, -1) + +def test_issue_13167_21411(): + if not numpy: + skip("numpy not installed") + f1 = lambdify(x, sympy.Heaviside(x)) + f2 = lambdify(x, sympy.Heaviside(x, 1)) + res1 = f1([-1, 0, 1]) + res2 = f2([-1, 0, 1]) + assert Abs(res1[0]).n() < 1e-15 # First functionality: only one argument passed + assert Abs(res1[1] - 1/2).n() < 1e-15 + assert Abs(res1[2] - 1).n() < 1e-15 + assert Abs(res2[0]).n() < 1e-15 # Second functionality: two arguments passed + assert Abs(res2[1] - 1).n() < 1e-15 + assert Abs(res2[2] - 1).n() < 1e-15 + +def test_single_e(): + f = lambdify(x, E) + assert f(23) == exp(1.0) + +def test_issue_16536(): + if not scipy: + skip("scipy not installed") + + a = symbols('a') + f1 = lowergamma(a, x) + F = lambdify((a, x), f1, modules='scipy') + assert abs(lowergamma(1, 3) - F(1, 3)) <= 1e-10 + + f2 = uppergamma(a, x) + F = lambdify((a, x), f2, modules='scipy') + assert abs(uppergamma(1, 3) - F(1, 3)) <= 1e-10 + + +def test_issue_22726(): + if not numpy: + skip("numpy not installed") + + x1, x2 = symbols('x1 x2') + f = Max(S.Zero, Min(x1, x2)) + g = derive_by_array(f, (x1, x2)) + G = lambdify((x1, x2), g, modules='numpy') + point = {x1: 1, x2: 2} + assert (abs(g.subs(point) - G(*point.values())) <= 1e-10).all() + + +def test_issue_22739(): + if not numpy: + skip("numpy not installed") + + x1, x2 = symbols('x1 x2') + f = Heaviside(Min(x1, x2)) + F = lambdify((x1, x2), f, modules='numpy') + point = {x1: 1, x2: 2} + assert abs(f.subs(point) - F(*point.values())) <= 1e-10 + + +def test_issue_22992(): + if not numpy: + skip("numpy not installed") + + a, t = symbols('a t') + expr = a*(log(cot(t/2)) - cos(t)) + F = lambdify([a, t], expr, 'numpy') + + point = {a: 10, t: 2} + + assert abs(expr.subs(point) - F(*point.values())) <= 1e-10 + + # Standard math + F = lambdify([a, t], expr) + + assert abs(expr.subs(point) - F(*point.values())) <= 1e-10 + + +def test_issue_19764(): + if not numpy: + skip("numpy not installed") + + expr = Array([x, x**2]) + f = lambdify(x, expr, 'numpy') + + assert f(1).__class__ == numpy.ndarray + +def test_issue_20070(): + if not numba: + skip("numba not installed") + + f = lambdify(x, sin(x), 'numpy') + assert numba.jit(f)(1)==0.8414709848078965 + + +def test_fresnel_integrals_scipy(): + if not scipy: + skip("scipy not installed") + + f1 = fresnelc(x) + f2 = fresnels(x) + F1 = lambdify(x, f1, modules='scipy') + F2 = lambdify(x, f2, modules='scipy') + + assert abs(fresnelc(1.3) - F1(1.3)) <= 1e-10 + assert abs(fresnels(1.3) - F2(1.3)) <= 1e-10 + + +def test_beta_scipy(): + if not scipy: + skip("scipy not installed") + + f = beta(x, y) + F = lambdify((x, y), f, modules='scipy') + + assert abs(beta(1.3, 2.3) - F(1.3, 2.3)) <= 1e-10 + + +def test_beta_math(): + f = beta(x, y) + F = lambdify((x, y), f, modules='math') + + assert abs(beta(1.3, 2.3) - F(1.3, 2.3)) <= 1e-10 + + +def test_betainc_scipy(): + if not scipy: + skip("scipy not installed") + + f = betainc(w, x, y, z) + F = lambdify((w, x, y, z), f, modules='scipy') + + assert abs(betainc(1.4, 3.1, 0.1, 0.5) - F(1.4, 3.1, 0.1, 0.5)) <= 1e-10 + + +def test_betainc_regularized_scipy(): + if not scipy: + skip("scipy not installed") + + f = betainc_regularized(w, x, y, z) + F = lambdify((w, x, y, z), f, modules='scipy') + + assert abs(betainc_regularized(0.2, 3.5, 0.1, 1) - F(0.2, 3.5, 0.1, 1)) <= 1e-10 + + +def test_numpy_special_math(): + if not numpy: + skip("numpy not installed") + + funcs = [expm1, log1p, exp2, log2, log10, hypot, logaddexp, logaddexp2] + for func in funcs: + if 2 in func.nargs: + expr = func(x, y) + args = (x, y) + num_args = (0.3, 0.4) + elif 1 in func.nargs: + expr = func(x) + args = (x,) + num_args = (0.3,) + else: + raise NotImplementedError("Need to handle other than unary & binary functions in test") + f = lambdify(args, expr) + result = f(*num_args) + reference = expr.subs(dict(zip(args, num_args))).evalf() + assert numpy.allclose(result, float(reference)) + + lae2 = lambdify((x, y), logaddexp2(log2(x), log2(y))) + assert abs(2.0**lae2(1e-50, 2.5e-50) - 3.5e-50) < 1e-62 # from NumPy's docstring + + +def test_scipy_special_math(): + if not scipy: + skip("scipy not installed") + + cm1 = lambdify((x,), cosm1(x), modules='scipy') + assert abs(cm1(1e-20) + 5e-41) < 1e-200 + + have_scipy_1_10plus = tuple(map(int, scipy.version.version.split('.')[:2])) >= (1, 10) + + if have_scipy_1_10plus: + cm2 = lambdify((x, y), powm1(x, y), modules='scipy') + assert abs(cm2(1.2, 1e-9) - 1.82321557e-10) < 1e-17 + + +def test_scipy_bernoulli(): + if not scipy: + skip("scipy not installed") + + bern = lambdify((x,), bernoulli(x), modules='scipy') + assert bern(1) == 0.5 + + +def test_scipy_harmonic(): + if not scipy: + skip("scipy not installed") + + hn = lambdify((x,), harmonic(x), modules='scipy') + assert hn(2) == 1.5 + hnm = lambdify((x, y), harmonic(x, y), modules='scipy') + assert hnm(2, 2) == 1.25 + + +def test_cupy_array_arg(): + if not cupy: + skip("CuPy not installed") + + f = lambdify([[x, y]], x*x + y, 'cupy') + result = f(cupy.array([2.0, 1.0])) + assert result == 5 + assert "cupy" in str(type(result)) + + +def test_cupy_array_arg_using_numpy(): + # numpy functions can be run on cupy arrays + # unclear if we can "officially" support this, + # depends on numpy __array_function__ support + if not cupy: + skip("CuPy not installed") + + f = lambdify([[x, y]], x*x + y, 'numpy') + result = f(cupy.array([2.0, 1.0])) + assert result == 5 + assert "cupy" in str(type(result)) + +def test_cupy_dotproduct(): + if not cupy: + skip("CuPy not installed") + + A = Matrix([x, y, z]) + f1 = lambdify([x, y, z], DotProduct(A, A), modules='cupy') + f2 = lambdify([x, y, z], DotProduct(A, A.T), modules='cupy') + f3 = lambdify([x, y, z], DotProduct(A.T, A), modules='cupy') + f4 = lambdify([x, y, z], DotProduct(A, A.T), modules='cupy') + + assert f1(1, 2, 3) == \ + f2(1, 2, 3) == \ + f3(1, 2, 3) == \ + f4(1, 2, 3) == \ + cupy.array([14]) + + +def test_jax_array_arg(): + if not jax: + skip("JAX not installed") + + f = lambdify([[x, y]], x*x + y, 'jax') + result = f(jax.numpy.array([2.0, 1.0])) + assert result == 5 + assert "jax" in str(type(result)) + + +def test_jax_array_arg_using_numpy(): + if not jax: + skip("JAX not installed") + + f = lambdify([[x, y]], x*x + y, 'numpy') + result = f(jax.numpy.array([2.0, 1.0])) + assert result == 5 + assert "jax" in str(type(result)) + + +def test_jax_dotproduct(): + if not jax: + skip("JAX not installed") + + A = Matrix([x, y, z]) + f1 = lambdify([x, y, z], DotProduct(A, A), modules='jax') + f2 = lambdify([x, y, z], DotProduct(A, A.T), modules='jax') + f3 = lambdify([x, y, z], DotProduct(A.T, A), modules='jax') + f4 = lambdify([x, y, z], DotProduct(A, A.T), modules='jax') + + assert f1(1, 2, 3) == \ + f2(1, 2, 3) == \ + f3(1, 2, 3) == \ + f4(1, 2, 3) == \ + jax.numpy.array([14]) + + +def test_lambdify_cse(): + def dummy_cse(exprs): + return (), exprs + + def minmem(exprs): + from sympy.simplify.cse_main import cse_release_variables, cse + return cse(exprs, postprocess=cse_release_variables) + + class Case: + def __init__(self, *, args, exprs, num_args, requires_numpy=False): + self.args = args + self.exprs = exprs + self.num_args = num_args + subs_dict = dict(zip(self.args, self.num_args)) + self.ref = [e.subs(subs_dict).evalf() for e in exprs] + self.requires_numpy = requires_numpy + + def lambdify(self, *, cse): + return lambdify(self.args, self.exprs, cse=cse) + + def assertAllClose(self, result, *, abstol=1e-15, reltol=1e-15): + if self.requires_numpy: + assert all(numpy.allclose(result[i], numpy.asarray(r, dtype=float), + rtol=reltol, atol=abstol) + for i, r in enumerate(self.ref)) + return + + for i, r in enumerate(self.ref): + abs_err = abs(result[i] - r) + if r == 0: + assert abs_err < abstol + else: + assert abs_err/abs(r) < reltol + + cases = [ + Case( + args=(x, y, z), + exprs=[ + x + y + z, + x + y - z, + 2*x + 2*y - z, + (x+y)**2 + (y+z)**2, + ], + num_args=(2., 3., 4.) + ), + Case( + args=(x, y, z), + exprs=[ + x + sympy.Heaviside(x), + y + sympy.Heaviside(x), + z + sympy.Heaviside(x, 1), + z/sympy.Heaviside(x, 1) + ], + num_args=(0., 3., 4.) + ), + Case( + args=(x, y, z), + exprs=[ + x + sinc(y), + y + sinc(y), + z - sinc(y) + ], + num_args=(0.1, 0.2, 0.3) + ), + Case( + args=(x, y, z), + exprs=[ + Matrix([[x, x*y], [sin(z) + 4, x**z]]), + x*y+sin(z)-x**z, + Matrix([x*x, sin(z), x**z]) + ], + num_args=(1.,2.,3.), + requires_numpy=True + ), + Case( + args=(x, y), + exprs=[(x + y - 1)**2, x, x + y, + (x + y)/(2*x + 1) + (x + y - 1)**2, (2*x + 1)**(x + y)], + num_args=(1,2) + ) + ] + for case in cases: + if not numpy and case.requires_numpy: + continue + for cse in [False, True, minmem, dummy_cse]: + f = case.lambdify(cse=cse) + result = f(*case.num_args) + case.assertAllClose(result) + +def test_deprecated_set(): + with warns_deprecated_sympy(): + lambdify({x, y}, x + y) + +def test_issue_13881(): + if not numpy: + skip("numpy not installed.") + + X = MatrixSymbol('X', 3, 1) + + f = lambdify(X, X.T*X, 'numpy') + assert f(numpy.array([1, 2, 3])) == 14 + assert f(numpy.array([3, 2, 1])) == 14 + + f = lambdify(X, X*X.T, 'numpy') + assert f(numpy.array([1, 2, 3])) == 14 + assert f(numpy.array([3, 2, 1])) == 14 + + f = lambdify(X, (X*X.T)*X, 'numpy') + arr1 = numpy.array([[1], [2], [3]]) + arr2 = numpy.array([[14],[28],[42]]) + + assert numpy.array_equal(f(arr1), arr2) + + +def test_23536_lambdify_cse_dummy(): + + f = Function('x')(y) + g = Function('w')(y) + expr = z + (f**4 + g**5)*(f**3 + (g*f)**3) + expr = expr.expand() + eval_expr = lambdify(((f, g), z), expr, cse=True) + ans = eval_expr((1.0, 2.0), 3.0) # shouldn't raise NameError + assert ans == 300.0 # not a list and value is 300 + + +class LambdifyDocstringTestCase: + SIGNATURE = None + EXPR = None + SRC = None + + def __init__(self, docstring_limit, expected_redacted): + self.docstring_limit = docstring_limit + self.expected_redacted = expected_redacted + + @property + def expected_expr(self): + expr_redacted_msg = 'EXPRESSION REDACTED DUE TO LENGTH' + return self.EXPR if not self.expected_redacted else expr_redacted_msg + + @property + def expected_src(self): + src_redacted_msg = 'SOURCE CODE REDACTED DUE TO LENGTH' + return self.SRC if not self.expected_redacted else src_redacted_msg + + @property + def expected_docstring(self): + expected_docstring = ( + f'Created with lambdify. Signature:\n\n' + f'func({self.SIGNATURE})\n\n' + f'Expression:\n\n' + f'{self.expected_expr}\n\n' + f'Source code:\n\n' + f'{self.expected_src}\n\n' + f'Imported modules:\n\n' + ) + return expected_docstring + + def __len__(self): + return len(self.expected_docstring) + + def __repr__(self): + return ( + f'{self.__class__.__name__}(' + f'docstring_limit={self.docstring_limit}, ' + f'expected_redacted={self.expected_redacted})' + ) + + +def test_lambdify_docstring_size_limit_simple_symbol(): + + class SimpleSymbolTestCase(LambdifyDocstringTestCase): + SIGNATURE = 'x' + EXPR = 'x' + SRC = ( + 'def _lambdifygenerated(x):\n' + ' return x\n' + ) + + x = symbols('x') + + test_cases = ( + SimpleSymbolTestCase(docstring_limit=None, expected_redacted=False), + SimpleSymbolTestCase(docstring_limit=100, expected_redacted=False), + SimpleSymbolTestCase(docstring_limit=1, expected_redacted=False), + SimpleSymbolTestCase(docstring_limit=0, expected_redacted=True), + SimpleSymbolTestCase(docstring_limit=-1, expected_redacted=True), + ) + for test_case in test_cases: + lambdified_expr = lambdify( + [x], + x, + 'sympy', + docstring_limit=test_case.docstring_limit, + ) + assert lambdified_expr.__doc__ == test_case.expected_docstring + + +def test_lambdify_docstring_size_limit_nested_expr(): + + class ExprListTestCase(LambdifyDocstringTestCase): + SIGNATURE = 'x, y, z' + EXPR = ( + '[x, [y], z, x**3 + 3*x**2*y + 3*x**2*z + 3*x*y**2 + 6*x*y*z ' + '+ 3*x*z**2 +...' + ) + SRC = ( + 'def _lambdifygenerated(x, y, z):\n' + ' return [x, [y], z, x**3 + 3*x**2*y + 3*x**2*z + 3*x*y**2 ' + '+ 6*x*y*z + 3*x*z**2 + y**3 + 3*y**2*z + 3*y*z**2 + z**3]\n' + ) + + x, y, z = symbols('x, y, z') + expr = [x, [y], z, ((x + y + z)**3).expand()] + + test_cases = ( + ExprListTestCase(docstring_limit=None, expected_redacted=False), + ExprListTestCase(docstring_limit=200, expected_redacted=False), + ExprListTestCase(docstring_limit=50, expected_redacted=True), + ExprListTestCase(docstring_limit=0, expected_redacted=True), + ExprListTestCase(docstring_limit=-1, expected_redacted=True), + ) + for test_case in test_cases: + lambdified_expr = lambdify( + [x, y, z], + expr, + 'sympy', + docstring_limit=test_case.docstring_limit, + ) + assert lambdified_expr.__doc__ == test_case.expected_docstring + + +def test_lambdify_docstring_size_limit_matrix(): + + class MatrixTestCase(LambdifyDocstringTestCase): + SIGNATURE = 'x, y, z' + EXPR = ( + 'Matrix([[0, x], [x + y + z, x**3 + 3*x**2*y + 3*x**2*z + 3*x*y**2 ' + '+ 6*x*y*z...' + ) + SRC = ( + 'def _lambdifygenerated(x, y, z):\n' + ' return ImmutableDenseMatrix([[0, x], [x + y + z, x**3 ' + '+ 3*x**2*y + 3*x**2*z + 3*x*y**2 + 6*x*y*z + 3*x*z**2 + y**3 ' + '+ 3*y**2*z + 3*y*z**2 + z**3]])\n' + ) + + x, y, z = symbols('x, y, z') + expr = Matrix([[S.Zero, x], [x + y + z, ((x + y + z)**3).expand()]]) + + test_cases = ( + MatrixTestCase(docstring_limit=None, expected_redacted=False), + MatrixTestCase(docstring_limit=200, expected_redacted=False), + MatrixTestCase(docstring_limit=50, expected_redacted=True), + MatrixTestCase(docstring_limit=0, expected_redacted=True), + MatrixTestCase(docstring_limit=-1, expected_redacted=True), + ) + for test_case in test_cases: + lambdified_expr = lambdify( + [x, y, z], + expr, + 'sympy', + docstring_limit=test_case.docstring_limit, + ) + assert lambdified_expr.__doc__ == test_case.expected_docstring diff --git a/shared/package-files/08/08ea83077299fd21f6a14a1c9ba90da7d66162b6506d07c4471c4096ad8f1cd8/blob b/shared/package-files/08/08ea83077299fd21f6a14a1c9ba90da7d66162b6506d07c4471c4096ad8f1cd8/blob new file mode 100644 index 0000000000000000000000000000000000000000..68b8104db50f9210e5d83e3c0702f87351189871 --- /dev/null +++ b/shared/package-files/08/08ea83077299fd21f6a14a1c9ba90da7d66162b6506d07c4471c4096ad8f1cd8/blob @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2009 Agendaless Consulting, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/shared/package-files/08/08eb0d40a60d3f53e829edad1f5b20d96188af40d93c35b7bafde7c9cf1ec933/blob b/shared/package-files/08/08eb0d40a60d3f53e829edad1f5b20d96188af40d93c35b7bafde7c9cf1ec933/blob new file mode 100644 index 0000000000000000000000000000000000000000..b38f0fbd2d07307da5b565841b54996a4f9168ee Binary files /dev/null and b/shared/package-files/08/08eb0d40a60d3f53e829edad1f5b20d96188af40d93c35b7bafde7c9cf1ec933/blob differ diff --git a/shared/package-files/08/08ebfe68a3c8ea6dc07aa6d1bba0c165279a062b36e06a7ba5f95fe4f9d86e9f/blob b/shared/package-files/08/08ebfe68a3c8ea6dc07aa6d1bba0c165279a062b36e06a7ba5f95fe4f9d86e9f/blob new file mode 100644 index 0000000000000000000000000000000000000000..4128841701ac4c777cdf7d9a2212f493723bf35c --- /dev/null +++ b/shared/package-files/08/08ebfe68a3c8ea6dc07aa6d1bba0c165279a062b36e06a7ba5f95fe4f9d86e9f/blob @@ -0,0 +1,1335 @@ +#pragma once + +// DO NOT DEFINE STATIC DATA IN THIS HEADER! +// See Note [Do not compile initializers with AVX] + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +// This file defines Vectorized<> for the quantized types. +// +// +// Currently, we simply use these classes as efficient converters between +// the quantized types and Vectorized, usually in bandwidth-bound cases +// where doing the arithmetic in full-precision is acceptable (e.g. +// elementwise operators). +// +// +// Conversions are as follows: +// Vectorized -> 4x Vectorized +// Vectorized -> 4x Vectorized +// Vectorized -> 1x Vectorized +// +// The size of the returned float vector is specified by the special +// constexpr function float_num_vecs. The type of the value returned +// from dequantize (and expected as an argument to quantize) is +// specified by float_vec_return_type. +// +// When writing kernels with these vectors, it is expected that floating- +// point operations will be carried out in a loop over Vectorized::float_num_vecs +// iterations. + +namespace at::vec { +inline namespace CPU_CAPABILITY { + +#if defined(CPU_CAPABILITY_AVX2) && !defined(_MSC_VER) + +struct Vectorizedqi { + protected: + __m256i vals __attribute__((aligned(64))); + + public: + Vectorizedqi() {} + Vectorizedqi(__m256i v) : vals(v) {} + operator __m256i() const { + return vals; + } +}; + +template +__m256i pack_saturate_and_clamp( + __m256i first, + __m256i second, + T min_val, + T max_val); + +template <> +inline __m256i pack_saturate_and_clamp( + __m256i /*first*/, + __m256i /*second*/, + int32_t /*min_val*/, + int32_t /*max_val*/) { + // This function is for linkage only, will not be used + AT_ERROR("pack_saturate_and_clamp is not supported"); +} + +template <> +inline __m256i pack_saturate_and_clamp( + __m256i first, + __m256i second, + int8_t min_val, + int8_t max_val) { + __m256i packed_and_sat = _mm256_packs_epi16(first, second); + return _mm256_max_epi8( + _mm256_set1_epi8(min_val), + _mm256_min_epi8(packed_and_sat, _mm256_set1_epi8(max_val))); +} + +template <> +inline __m256i pack_saturate_and_clamp( + __m256i first, + __m256i second, + uint8_t min_val, + uint8_t max_val) { + __m256i packed_and_sat = _mm256_packus_epi16(first, second); + return _mm256_max_epu8( + _mm256_set1_epi8(min_val), + _mm256_min_epu8(packed_and_sat, _mm256_set1_epi8(max_val))); +} + +template +typename std::enable_if::value || std::is_same::value, at::vec::Vectorized>::type +inline convert_int8_to_float(at::vec::Vectorized src) { + // Note: this function only convert inputs number of elements equal to at::vec::Vectorized.size() + // Only handle first 8*8 bits + __m128i input_128 = _mm256_castsi256_si128(src); + // Convert from 8*uint8/int8 to 8*int32 + __m256i input_256_int32; + if constexpr (std::is_same_v) + input_256_int32 = _mm256_cvtepu8_epi32(input_128); + else + input_256_int32 = _mm256_cvtepi8_epi32(input_128); + // Convert from 8*int32 to 8*float + return _mm256_cvtepi32_ps(input_256_int32); +} + +template +typename std::enable_if::value || std::is_same::value, at::vec::Vectorized>::type +inline convert_float_to_int8(at::vec::Vectorized src) { + // Convert from float32 to int32 with truncation + __m256i x_values_int32 = _mm256_cvttps_epi32(src); + + // Convert from int32 to int16 using signed saturation + __m256i xy_packed_v = _mm256_packs_epi32(x_values_int32, x_values_int32); + + constexpr auto min_val = std::numeric_limits::min(); + constexpr auto max_val = std::numeric_limits::max(); + + // Convert from int16 to uint8/int8 using unsigned saturation + __m256i xyzw_clamped_v = pack_saturate_and_clamp( + xy_packed_v, xy_packed_v, min_val, max_val); + __m256i permute_mask_v = + _mm256_set_epi32(0x07, 0x03, 0x06, 0x02, 0x05, 0x01, 0x04, 0x00); + return _mm256_permutevar8x32_epi32(xyzw_clamped_v, permute_mask_v); +} + +template +inline void __attribute__((always_inline)) QuantizeAvx2( + const float* src, + T* dst, + int len, + float inverse_scale, + int64_t zero_point) { + constexpr int VLEN = 8; + constexpr auto min_val = std::numeric_limits::min(); + constexpr auto max_val = std::numeric_limits::max(); + const __m256i min_v = _mm256_set1_epi32(min_val); + const __m256i max_v = _mm256_set1_epi32(max_val); + // This is the largest int32 value < int32_max exactly representable in float + constexpr int32_t int32_float_max_val = + std::numeric_limits::max() - 127; + int i = 0; + __m256 inverse_scale_v = _mm256_set1_ps(inverse_scale); + // clang-format off + static const __m256i shuffle_mask_v = _mm256_set_epi8( + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0x0c, 0x08, 0x04, 0x00, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0x0c, 0x08, 0x04, 0x00); + // clang-format on + __m256i permute_mask_v = + _mm256_set_epi32(0x07, 0x03, 0x06, 0x02, 0x05, 0x01, 0x04, 0x00); + __m256i permute_mask_l8_v = + _mm256_set_epi32(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00); + int len_aligned = len / (VLEN * 4) * (VLEN * 4); + for (; i < len_aligned; i += 4 * VLEN) { + // x + __m256 x_vals = _mm256_load_ps(src + i); + __m256 x_transformed_v = _mm256_mul_ps(x_vals, inverse_scale_v); + // If the floating point value is greater than int32_max, + // _mm256_cvtps_epi32 converts them to -ve. Clip at int32_float_max_val to + // Clip at int32_float_max_val to avoid this. + x_transformed_v = + _mm256_min_ps(x_transformed_v, _mm256_set1_ps(int32_float_max_val)); + // y + __m256 y_vals = _mm256_load_ps(src + i + VLEN); + __m256 y_transformed_v = _mm256_mul_ps(y_vals, inverse_scale_v); + y_transformed_v = + _mm256_min_ps(y_transformed_v, _mm256_set1_ps(int32_float_max_val)); + // z + __m256 z_vals = _mm256_load_ps(src + i + 2 * VLEN); + __m256 z_transformed_v = _mm256_mul_ps(z_vals, inverse_scale_v); + z_transformed_v = + _mm256_min_ps(z_transformed_v, _mm256_set1_ps(int32_float_max_val)); + // w + __m256 w_vals = _mm256_load_ps(src + i + 3 * VLEN); + __m256 w_transformed_v = _mm256_mul_ps(w_vals, inverse_scale_v); + w_transformed_v = + _mm256_min_ps(w_transformed_v, _mm256_set1_ps(int32_float_max_val)); + + __m256i x_rounded_v = _mm256_cvtps_epi32(x_transformed_v); + __m256i y_rounded_v = _mm256_cvtps_epi32(y_transformed_v); + __m256i z_rounded_v = _mm256_cvtps_epi32(z_transformed_v); + __m256i w_rounded_v = _mm256_cvtps_epi32(w_transformed_v); + + // add zero point + x_rounded_v = _mm256_add_epi32(x_rounded_v, _mm256_set1_epi32(zero_point)); + y_rounded_v = _mm256_add_epi32(y_rounded_v, _mm256_set1_epi32(zero_point)); + z_rounded_v = _mm256_add_epi32(z_rounded_v, _mm256_set1_epi32(zero_point)); + w_rounded_v = _mm256_add_epi32(w_rounded_v, _mm256_set1_epi32(zero_point)); + + __m256i xy_packed_v = _mm256_packs_epi32(x_rounded_v, y_rounded_v); + __m256i zw_packed_v = _mm256_packs_epi32(z_rounded_v, w_rounded_v); + __m256i xyzw_clamped_v = + pack_saturate_and_clamp(xy_packed_v, zw_packed_v, min_val, max_val); + + xyzw_clamped_v = + _mm256_permutevar8x32_epi32(xyzw_clamped_v, permute_mask_v); + _mm256_storeu_si256(reinterpret_cast<__m256i*>(dst + i), xyzw_clamped_v); + } + + // Additional 8-lane AVX2 version to take advantage when len is smaller + // based on fbgemm::QuantizeAvx2 (https://github.com/pytorch/FBGEMM) + for (; i < len / VLEN * VLEN; i += VLEN) { + __m256 x_vals = _mm256_load_ps(src + i); + __m256 x_transformed_v = _mm256_mul_ps(x_vals, inverse_scale_v); + x_transformed_v = + _mm256_min_ps(x_transformed_v, _mm256_set1_ps(int32_float_max_val)); + __m256i x_rounded_v = _mm256_cvtps_epi32(x_transformed_v); + x_rounded_v = _mm256_add_epi32(x_rounded_v, _mm256_set1_epi32(zero_point)); + __m256i x_clipped_v = + _mm256_max_epi32(min_v, _mm256_min_epi32(max_v, x_rounded_v)); + + x_clipped_v = _mm256_shuffle_epi8(x_clipped_v, shuffle_mask_v); + x_clipped_v = _mm256_permutevar8x32_epi32(x_clipped_v, permute_mask_l8_v); + _mm_storel_epi64( + reinterpret_cast<__m128i*>(dst + i), + _mm256_castsi256_si128(x_clipped_v)); + } + + for (; i < len; ++i) { + float transformed = src[i] * inverse_scale; + + // Not exactly the same behavior as the vectorized code. + // The vectorized code above always rounds to even in halfway cases + // (https://software.intel.com/en-us/node/523819), but std::nearbyint + // does the same only when the current rounding mode is FE_TONEAREST. + // However, in practice, this should not be a problem because most cases + // use the default rounding mode FE_TONEAREST. + // Note that we cannot implement the same behavior as the vectorized code + // using std::round because it does rounding away from zero in halfway + // cases. + transformed = zero_point + std::nearbyint(transformed); + float clipped = + std::min(std::max(transformed, float(min_val)), float(max_val)); + dst[i] = clipped; + } +} + +template<> +struct Vectorized : public Vectorizedqi { + using size_type = int; + static constexpr size_type size() { + return 8; + } + + static constexpr int float_num_vecs() { + return 1; + } + + static constexpr int int_num_vecs() { + return 1; + } + + using float_vec_return_type = std::array, 1>; + using int_vec_return_type = std::array, 1>; + using value_type = c10::qint32::underlying; + + public: + using Vectorizedqi::Vectorizedqi; + Vectorized() {} + + Vectorized(__m256i vals_) { vals = vals_;} + + // Broadcast constructor + Vectorized(const c10::qint32& val) { + value_type uw = val.val_; + vals = _mm256_set1_epi32(uw); + } + + void store(void* ptr, int count = size()) const { + if (count != size()) { + memcpy(ptr, &vals, count * sizeof(value_type)); + } else { + _mm256_storeu_si256((__m256i*)ptr, vals); + } + } + + static Vectorized loadu(const void* ptr) { + return Vectorized(ptr); + } + + static Vectorized loadu(const void* ptr, int64_t count) { + __at_align__ value_type tmp_values[size()]; + // Ensure uninitialized memory does not change the output value See https://github.com/pytorch/pytorch/issues/32502 + // for more details. We do not initialize arrays to zero using "={0}" because gcc would compile it to two + // instructions while a loop would be compiled to one instruction. + for (const auto i : c10::irange(size())) { + tmp_values[i] = 0; + } + std::memcpy( + tmp_values, reinterpret_cast(ptr), count * sizeof(value_type)); + return _mm256_loadu_si256((const __m256i*)tmp_values); + } + + float_vec_return_type dequantize( + Vectorized scale, + Vectorized /*zero_point*/, + Vectorized scale_zp_premul) const { + __m256 float_vals = _mm256_cvtepi32_ps(vals); + return {vec::fmadd(scale, Vectorized(float_vals), scale_zp_premul)}; + } + + float_vec_return_type dequantize( + Vectorized scale, + Vectorized zero_point) const { + __m256 float_vals = _mm256_cvtepi32_ps(vals); + return {(Vectorized(float_vals) - zero_point) * scale}; + } + + static Vectorized quantize( + const float_vec_return_type& rhs, + float scale, + int32_t zero_point, + float /*inverse_scale*/) { + Vectorized retval; + auto rhs_data = (__m256)rhs[0]; + at::native::quantize_vec( + scale, zero_point, (float*)&rhs_data, (c10::qint32*)&retval.vals, 8); + return retval; + } + + Vectorized maximum(Vectorized b) const { + return _mm256_max_epi32(vals, b.vals); + } + + Vectorized minimum(Vectorized b) const { + return _mm256_min_epi32(vals, b.vals); + } + + Vectorized relu(Vectorized zero_point) const { + return maximum(zero_point); + } + + Vectorized relu6( + Vectorized zero_point, + Vectorized q_six) { + return _mm256_min_epi32( + _mm256_max_epi32(vals, zero_point.vals), q_six.vals); + } + + int_vec_return_type widening_subtract(Vectorized b) const { + return {_mm256_sub_epi32(vals, b)}; + } + + static Vectorized requantize_from_int( + const int_vec_return_type& inp, + float multiplier, + int32_t zero_point) { + __m256 multiplier_v = _mm256_set1_ps(multiplier); + __m256i zero_point_v = _mm256_set1_epi32(zero_point); + + __m256 scaled = _mm256_mul_ps(_mm256_cvtepi32_ps(inp[0]), multiplier_v); + __m256i rounded = _mm256_cvtps_epi32(scaled); + return _mm256_add_epi32(rounded, zero_point_v); + } + + private: + // Load from memory constructor + Vectorized(const void* ptr) { + vals = _mm256_loadu_si256((const __m256i*)ptr); + } +}; + +template <> +Vectorized inline maximum(const Vectorized& a, const Vectorized& b) { + return a.maximum(b); +} + +template <> +Vectorized inline operator*( + const Vectorized& a, + const Vectorized& b) { + return _mm256_mullo_epi32(a, b); +} + +template <> +Vectorized inline operator+( + const Vectorized& a, + const Vectorized& b) { + return _mm256_add_epi32(a, b); +} + +/* + * Convert values from int32 back to int8/uint8 + */ +template +__m256i RequantizeAvx2( + const std::array, 4>& inp, + __m256 multiplier, + __m256i zp) { + static_assert( + std::is_same::value || std::is_same::value, + "Only int8_t/uint8_t are supported"); + constexpr auto min_val = std::numeric_limits::min(); + constexpr auto max_val = std::numeric_limits::max(); + __m256i permute_mask_v = + _mm256_set_epi32(0x07, 0x03, 0x06, 0x02, 0x05, 0x01, 0x04, 0x00); + __m256 x_scaled_v = _mm256_mul_ps(_mm256_cvtepi32_ps(inp[0]), multiplier); + __m256 y_scaled_v = _mm256_mul_ps(_mm256_cvtepi32_ps(inp[1]), multiplier); + __m256 z_scaled_v = _mm256_mul_ps(_mm256_cvtepi32_ps(inp[2]), multiplier); + __m256 w_scaled_v = _mm256_mul_ps(_mm256_cvtepi32_ps(inp[3]), multiplier); + + __m256i x_rounded_v = _mm256_cvtps_epi32(x_scaled_v); + __m256i y_rounded_v = _mm256_cvtps_epi32(y_scaled_v); + __m256i z_rounded_v = _mm256_cvtps_epi32(z_scaled_v); + __m256i w_rounded_v = _mm256_cvtps_epi32(w_scaled_v); + + /* Add zero point */ + __m256i x_v = _mm256_add_epi32(x_rounded_v, zp); + __m256i y_v = _mm256_add_epi32(y_rounded_v, zp); + __m256i z_v = _mm256_add_epi32(z_rounded_v, zp); + __m256i w_v = _mm256_add_epi32(w_rounded_v, zp); + + /* Pack to int16_t and saturate */ + __m256i xy_packed_v = _mm256_packs_epi32(x_v, y_v); + __m256i zw_packed_v = _mm256_packs_epi32(z_v, w_v); + + __m256i xyzw_clamped_v = + pack_saturate_and_clamp(xy_packed_v, zw_packed_v, min_val, max_val); + + /* + * xyzw_clamped_v has results in the following layout so we need to + * permute: x0-3 y0-3 z0-3 w0-3 x4-7 y4-7 z4-7 w4-7 + */ + xyzw_clamped_v = _mm256_permutevar8x32_epi32(xyzw_clamped_v, permute_mask_v); + return xyzw_clamped_v; +} + +template<> +struct Vectorized : public Vectorizedqi { + static constexpr int size() { + return 32; + } + + static constexpr int float_num_vecs() { + return 4; + } + + static constexpr int int_num_vecs() { + return 4; + } + + using float_vec_return_type = std::array, 4>; + using int_vec_return_type = std::array, 4>; + using value_type = typename c10::qint8::underlying; + + public: + using Vectorizedqi::Vectorizedqi; + + Vectorized() {} + Vectorized(__m256i vals_) { vals = vals_;} + + // Broadcast constructor + Vectorized(const c10::qint8& val) { + value_type uw = val.val_; + vals = _mm256_set1_epi8(uw); + } + + // This is needed because the compiler emits awful code for the default + // constructor for moving the enum + // NOLINTNEXTLINE(clang-diagnostic-deprecated-copy) + C10_CLANG_DIAGNOSTIC_PUSH() + #if C10_CLANG_HAS_WARNING("-Wdeprecated-copy") + C10_CLANG_DIAGNOSTIC_IGNORE("-Wdeprecated-copy") + #endif + Vectorized(const Vectorized& other) : Vectorizedqi(other.vals) { } + C10_CLANG_DIAGNOSTIC_POP() + + void store(void* ptr, int count = size()) const { + if (count != size()) { + memcpy(ptr, &vals, count * sizeof(value_type)); + } else { + _mm256_storeu_si256((__m256i*)ptr, vals); + } + } + + static Vectorized loadu(const void* ptr) { + return Vectorized(ptr); + } + + static Vectorized loadu(const void* ptr, int64_t count) { + __at_align__ value_type tmp_values[size()]; + // Ensure uninitialized memory does not change the output value See https://github.com/pytorch/pytorch/issues/32502 + // for more details. We do not initialize arrays to zero using "={0}" because gcc would compile it to two + // instructions while a loop would be compiled to one instruction. + for (const auto i : c10::irange(size())) { + tmp_values[i] = 0; + } + std::memcpy( + tmp_values, reinterpret_cast(ptr), count * sizeof(value_type)); + return _mm256_loadu_si256((const __m256i*)tmp_values); + } + + private: + __m256i cvtepi8_epi32(__m128i epi8_vals) const { + return _mm256_cvtepi8_epi32(epi8_vals); + } + + public: + float_vec_return_type dequantize( + Vectorized scale, + Vectorized /*zero_point*/, + Vectorized scale_neg_zp_premul) const { + __m128i int_val0 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 0)); + __m128i int_val1 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 1)); + __m128i int_val2 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 2)); + __m128i int_val3 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 3)); + + __m256 float_val0 = _mm256_cvtepi32_ps(cvtepi8_epi32(int_val0)); + __m256 float_val1 = _mm256_cvtepi32_ps(cvtepi8_epi32(int_val1)); + __m256 float_val2 = _mm256_cvtepi32_ps(cvtepi8_epi32(int_val2)); + __m256 float_val3 = _mm256_cvtepi32_ps(cvtepi8_epi32(int_val3)); + + auto val0 = + vec::fmadd(scale, Vectorized(float_val0), scale_neg_zp_premul); + auto val1 = + vec::fmadd(scale, Vectorized(float_val1), scale_neg_zp_premul); + auto val2 = + vec::fmadd(scale, Vectorized(float_val2), scale_neg_zp_premul); + auto val3 = + vec::fmadd(scale, Vectorized(float_val3), scale_neg_zp_premul); + return {val0, val1, val2, val3}; + } + + float_vec_return_type dequantize( + Vectorized scale, + Vectorized zero_point) const { + __m128i int_val0 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 0)); + __m128i int_val1 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 1)); + __m128i int_val2 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 2)); + __m128i int_val3 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 3)); + + __m256 float_val0 = _mm256_cvtepi32_ps(cvtepi8_epi32(int_val0)); + __m256 float_val1 = _mm256_cvtepi32_ps(cvtepi8_epi32(int_val1)); + __m256 float_val2 = _mm256_cvtepi32_ps(cvtepi8_epi32(int_val2)); + __m256 float_val3 = _mm256_cvtepi32_ps(cvtepi8_epi32(int_val3)); + + auto val0 = (Vectorized(float_val0) - zero_point) * scale; + auto val1 = (Vectorized(float_val1) - zero_point) * scale; + auto val2 = (Vectorized(float_val2) - zero_point) * scale; + auto val3 = (Vectorized(float_val3) - zero_point) * scale; + return {val0, val1, val2, val3}; + } + + static Vectorized quantize( + const float_vec_return_type& rhs, + float /*scale*/, + int32_t zero_point, + float inverse_scale) { + auto* rhs_data = (float*)rhs.data(); + int8_t quantized_values[32]; + QuantizeAvx2( + rhs_data, quantized_values, 32, inverse_scale, zero_point); + return Vectorized::loadu(quantized_values); + } + + Vectorized maximum(Vectorized b) const { + return _mm256_max_epi8(vals, b.vals); + } + + Vectorized minimum(Vectorized b) const { + return _mm256_min_epi8(vals, b.vals); + } + + Vectorized relu(Vectorized zero_point) const { + return maximum(zero_point); + } + + Vectorized relu6( + Vectorized zero_point, + Vectorized q_six) { + return _mm256_min_epi8( + _mm256_max_epi8(vals, zero_point.vals), q_six.vals); + } + + int_vec_return_type widening_subtract(Vectorized b) const { + __m128i int_val0 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 0)); + __m128i int_val1 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 1)); + __m128i int_val2 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 2)); + __m128i int_val3 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 3)); + + __m256i int32_val0 = cvtepi8_epi32(int_val0); + __m256i int32_val1 = cvtepi8_epi32(int_val1); + __m256i int32_val2 = cvtepi8_epi32(int_val2); + __m256i int32_val3 = cvtepi8_epi32(int_val3); + + __m128i int_b0 = _mm_set1_epi64x(_mm256_extract_epi64(b, 0)); + __m128i int_b1 = _mm_set1_epi64x(_mm256_extract_epi64(b, 1)); + __m128i int_b2 = _mm_set1_epi64x(_mm256_extract_epi64(b, 2)); + __m128i int_b3 = _mm_set1_epi64x(_mm256_extract_epi64(b, 3)); + + __m256i int32_b0 = cvtepi8_epi32(int_b0); + __m256i int32_b1 = cvtepi8_epi32(int_b1); + __m256i int32_b2 = cvtepi8_epi32(int_b2); + __m256i int32_b3 = cvtepi8_epi32(int_b3); + + __m256i res_0 = _mm256_sub_epi32(int32_val0, int32_b0); + __m256i res_1 = _mm256_sub_epi32(int32_val1, int32_b1); + __m256i res_2 = _mm256_sub_epi32(int32_val2, int32_b2); + __m256i res_3 = _mm256_sub_epi32(int32_val3, int32_b3); + + return {Vectorized(res_0), + Vectorized(res_1), + Vectorized(res_2), + Vectorized(res_3)}; + } + + static Vectorized requantize_from_int( + const int_vec_return_type& inp, + float multiplier, + int32_t zero_point) { + __m256 multiplier_v = _mm256_set1_ps(multiplier); + __m256i zero_point_v = _mm256_set1_epi32(zero_point); + return RequantizeAvx2(inp, multiplier_v, zero_point_v); + } + + private: + // Load from memory constructor + Vectorized(const void* ptr) { + vals = _mm256_loadu_si256((const __m256i*)ptr); + } +}; + +template <> +Vectorized inline maximum(const Vectorized& a, const Vectorized& b) { + return a.maximum(b); +} + +template<> +struct Vectorized : public Vectorizedqi { + static constexpr int size() { + return 32; + } + + static constexpr int float_num_vecs() { + return 4; + } + + static constexpr int int_num_vecs() { + return 4; + } + + using float_vec_return_type = std::array, 4>; + using int_vec_return_type = std::array, 4>; + using value_type = typename c10::quint8::underlying; + + public: + using Vectorizedqi::Vectorizedqi; + Vectorized() {} + + Vectorized(__m256i vals_) { vals = vals_;} + + // Broadcast constructor + Vectorized(const c10::quint8& val) { + value_type uw = val.val_; + vals = _mm256_set1_epi8(uw); + } + + // NOLINTNEXTLINE(clang-diagnostic-deprecated-copy) + C10_CLANG_DIAGNOSTIC_PUSH() + #if C10_CLANG_HAS_WARNING("-Wdeprecated-copy") + C10_CLANG_DIAGNOSTIC_IGNORE("-Wdeprecated-copy") + #endif + Vectorized(const Vectorized& other) : Vectorizedqi(other.vals) { } + C10_CLANG_DIAGNOSTIC_POP() + + void store(void* ptr, int count = size()) const { + if (count != size()) { + memcpy(ptr, &vals, count * sizeof(value_type)); + } else { + _mm256_storeu_si256((__m256i*)ptr, vals); + } + } + + static Vectorized loadu(const void* ptr) { + return Vectorized(ptr); + } + + static Vectorized loadu(const void* ptr, int64_t count) { + __at_align__ value_type tmp_values[size()]; + // Ensure uninitialized memory does not change the output value See https://github.com/pytorch/pytorch/issues/32502 + // for more details. We do not initialize arrays to zero using "={0}" because gcc would compile it to two + // instructions while a loop would be compiled to one instruction. + for (const auto i : c10::irange(size())) { + tmp_values[i] = 0; + } + std::memcpy( + tmp_values, reinterpret_cast(ptr), count * sizeof(value_type)); + return _mm256_loadu_si256((const __m256i*)tmp_values); + } + + private: + __m256i cvtepu8_epi32(__m128i epu8_vals) const { + return _mm256_cvtepu8_epi32(epu8_vals); + } + + public: + float_vec_return_type dequantize( + Vectorized scale, + Vectorized /*zero_point*/, + Vectorized scale_zp_premul) const { + __m128i int_val0 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 0)); + __m128i int_val1 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 1)); + __m128i int_val2 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 2)); + __m128i int_val3 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 3)); + + __m256 float_val0 = _mm256_cvtepi32_ps(cvtepu8_epi32(int_val0)); + __m256 float_val1 = _mm256_cvtepi32_ps(cvtepu8_epi32(int_val1)); + __m256 float_val2 = _mm256_cvtepi32_ps(cvtepu8_epi32(int_val2)); + __m256 float_val3 = _mm256_cvtepi32_ps(cvtepu8_epi32(int_val3)); + + auto val0 = + vec::fmadd(scale, Vectorized(float_val0), scale_zp_premul); + auto val1 = + vec::fmadd(scale, Vectorized(float_val1), scale_zp_premul); + auto val2 = + vec::fmadd(scale, Vectorized(float_val2), scale_zp_premul); + auto val3 = + vec::fmadd(scale, Vectorized(float_val3), scale_zp_premul); + return {val0, val1, val2, val3}; + } + + float_vec_return_type dequantize( + Vectorized scale, + Vectorized zero_point) const { + __m128i int_val0 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 0)); + __m128i int_val1 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 1)); + __m128i int_val2 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 2)); + __m128i int_val3 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 3)); + + __m256 float_val0 = _mm256_cvtepi32_ps(cvtepu8_epi32(int_val0)); + __m256 float_val1 = _mm256_cvtepi32_ps(cvtepu8_epi32(int_val1)); + __m256 float_val2 = _mm256_cvtepi32_ps(cvtepu8_epi32(int_val2)); + __m256 float_val3 = _mm256_cvtepi32_ps(cvtepu8_epi32(int_val3)); + + auto val0 = (Vectorized(float_val0) - zero_point) * scale; + auto val1 = (Vectorized(float_val1) - zero_point) * scale; + auto val2 = (Vectorized(float_val2) - zero_point) * scale; + auto val3 = (Vectorized(float_val3) - zero_point) * scale; + return {val0, val1, val2, val3}; + } + + static Vectorized quantize( + const float_vec_return_type& rhs, + float /*scale*/, + int32_t zero_point, + float inverse_scale) { + auto* rhs_data = (float*)rhs.data(); + uint8_t quantized_values[32]; + QuantizeAvx2( + rhs_data, quantized_values, 32, inverse_scale, zero_point); + return Vectorized::loadu(quantized_values); + } + + Vectorized maximum(Vectorized b) const { + return _mm256_max_epu8(vals, b.vals); + } + + Vectorized minimum(Vectorized b) const { + return _mm256_min_epu8(vals, b.vals); + } + + Vectorized relu(Vectorized zero_point) const { + return maximum(zero_point); + } + + Vectorized relu6( + Vectorized zero_point, + Vectorized q_six) { + return _mm256_min_epu8( + _mm256_max_epu8(vals, zero_point.vals), q_six.vals); + } + + int_vec_return_type widening_subtract(Vectorized b) const { + __m128i int_val0 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 0)); + __m128i int_val1 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 1)); + __m128i int_val2 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 2)); + __m128i int_val3 = _mm_set1_epi64x(_mm256_extract_epi64(vals, 3)); + + __m256i int32_val0 = cvtepu8_epi32(int_val0); + __m256i int32_val1 = cvtepu8_epi32(int_val1); + __m256i int32_val2 = cvtepu8_epi32(int_val2); + __m256i int32_val3 = cvtepu8_epi32(int_val3); + + __m128i int_b0 = _mm_set1_epi64x(_mm256_extract_epi64(b, 0)); + __m128i int_b1 = _mm_set1_epi64x(_mm256_extract_epi64(b, 1)); + __m128i int_b2 = _mm_set1_epi64x(_mm256_extract_epi64(b, 2)); + __m128i int_b3 = _mm_set1_epi64x(_mm256_extract_epi64(b, 3)); + + __m256i int32_b0 = cvtepu8_epi32(int_b0); + __m256i int32_b1 = cvtepu8_epi32(int_b1); + __m256i int32_b2 = cvtepu8_epi32(int_b2); + __m256i int32_b3 = cvtepu8_epi32(int_b3); + + __m256i res_0 = _mm256_sub_epi32(int32_val0, int32_b0); + __m256i res_1 = _mm256_sub_epi32(int32_val1, int32_b1); + __m256i res_2 = _mm256_sub_epi32(int32_val2, int32_b2); + __m256i res_3 = _mm256_sub_epi32(int32_val3, int32_b3); + return {Vectorized(res_0), + Vectorized(res_1), + Vectorized(res_2), + Vectorized(res_3)}; + } + + static Vectorized requantize_from_int( + const int_vec_return_type& inp, + float multiplier, + int32_t zero_point) { + __m256 multiplier_v = _mm256_set1_ps(multiplier); + __m256i zero_point_v = _mm256_set1_epi32(zero_point); + return RequantizeAvx2(inp, multiplier_v, zero_point_v); + } + + private: + + // Load from memory constructor + Vectorized(const void* ptr) { + vals = _mm256_loadu_si256((const __m256i*)ptr); + } +}; + +template <> +Vectorized inline maximum(const Vectorized& a, const Vectorized& b) { + return a.maximum(b); +} + +#else + +// NOTE: These are low-performance implementations that we fall back on +// if we are not building with AVX2. This may not be an issue, because +// currently for quantization we assume the user has at least AVX512 +// installed, so these can simply act as a reference implementation. +// +// If in the future we relax this requirement (AVX2+), we should probably +// revisit these implementations + +template < + typename T, + typename float_vec_return_type_, + typename int_vec_return_type_, + int size_> +struct VectorizedQuantizedConverter { + static constexpr int size() { + return size_; + } + + static constexpr int float_num_vecs() { + return size() / 8; + } + + static constexpr int int_num_vecs() { + return size() / 8; + } + + using float_vec_return_type = float_vec_return_type_; + using int_vec_return_type = int_vec_return_type_; + + using value_type = typename T::underlying; + std::array vals; + + VectorizedQuantizedConverter(T val) { + for (const auto i : c10::irange(size())) { + vals[i] = val.val_; + } + } + + VectorizedQuantizedConverter(const void* ptr) { + memcpy(vals.data(), ptr, sizeof(value_type) * size()); + } + + void store(void* ptr, int count = size()) const { + memcpy(ptr, vals.data(), count * sizeof(value_type)); + } + + float_vec_return_type dequantize( + Vectorized scale, + Vectorized zero_point, + Vectorized /*scale_zp_premul*/) const { + float_vec_return_type rv; + for (const auto i : c10::irange(float_num_vecs())) { + float tmp_vals[8]; + for (const auto j : c10::irange(8)) { + tmp_vals[j] = at::native::dequantize_val( + scale[j], zero_point[j], T(vals[8 * i + j])); + } + rv[i] = Vectorized(tmp_vals[0], + tmp_vals[1], + tmp_vals[2], + tmp_vals[3], + tmp_vals[4], + tmp_vals[5], + tmp_vals[6], + tmp_vals[7]); + } + return rv; + } + + float_vec_return_type dequantize( + Vectorized scale, + Vectorized zero_point) const { + Vectorized scale_zp_premul; + return dequantize(scale, zero_point, scale_zp_premul); + } + + protected: + VectorizedQuantizedConverter() {} +}; + +template <> +struct Vectorized : public VectorizedQuantizedConverter< + c10::qint32, + std::array, 1>, + std::array, 1>, + 8> { + Vectorized() + : VectorizedQuantizedConverter< + c10::qint32, + std::array, 1>, + std::array, 1>, + 8>() {} + Vectorized(c10::qint32 val) + : VectorizedQuantizedConverter< + c10::qint32, + std::array, 1>, + std::array, 1>, + 8>(val) {} + Vectorized(const void* ptr) + : VectorizedQuantizedConverter< + c10::qint32, + std::array, 1>, + std::array, 1>, + 8>(ptr) {} + + static Vectorized loadu(const void* ptr) { + return Vectorized(ptr); + } + + static Vectorized loadu(const void* ptr, int64_t count) { + __at_align__ value_type tmp_values[size()]; + // Ensure uninitialized memory does not change the output value See https://github.com/pytorch/pytorch/issues/32502 + // for more details. We do not initialize arrays to zero using "={0}" because gcc would compile it to two + // instructions while a loop would be compiled to one instruction. + for (const auto i : c10::irange(size())) { + tmp_values[i] = 0; + } + std::memcpy( + tmp_values, reinterpret_cast(ptr), count * sizeof(value_type)); + return Vectorized(tmp_values); + } + + static Vectorized quantize( + const float_vec_return_type& rhs, + float scale, + int32_t zero_point, + float /*inverse_scale*/) { + std::array qvals; + std::array float_vals; + + for (const auto i : c10::irange(float_num_vecs())) { + rhs[i].store(&float_vals[i * 8], 8); + } + + at::native::quantize_vec( + scale, + zero_point, + float_vals.data(), + (c10::qint32*)qvals.data(), + 8 * float_num_vecs()); + + return Vectorized::loadu(qvals.data()); + } + + Vectorized maximum(Vectorized b) const { + Vectorized retval; + for (const auto i : c10::irange(size())) { + retval.vals[i] = std::max(vals[i], b.vals[i]); + } + return retval; + } + + Vectorized minimum(Vectorized b) const { + Vectorized retval; + for (const auto i : c10::irange(size())) { + retval.vals[i] = std::min(vals[i], b.vals[i]); + } + return retval; + } + + Vectorized relu(Vectorized zero_point) const { + return maximum(zero_point); + } + + + Vectorized relu6( + Vectorized zero_point, + Vectorized q_six) { + Vectorized retval; + for (const auto i : c10::irange(size())) { + retval.vals[i] = std::min( + std::max(vals[i], zero_point.vals[i]), q_six.vals[i]); + } + return retval; + } + + int_vec_return_type widening_subtract(Vectorized b) const { + int_vec_return_type retval; + for (const auto i : c10::irange(size())) { + retval[0].vals[i] = vals[i] - b.vals[i]; + } + return retval; + } + + static Vectorized requantize_from_int( + const int_vec_return_type& inp, + float multiplier, + int32_t zero_point) { + Vectorized retval; + for (const auto i : c10::irange(size())) { + retval.vals[i] = + std::nearbyint(static_cast(inp[0].vals[i]) * multiplier) + + zero_point; + } + return retval; + } +}; + +template <> +Vectorized inline maximum(const Vectorized& a, const Vectorized& b) { + return a.maximum(b); +} + +template <> +Vectorized inline operator*( + const Vectorized& a, + const Vectorized& b) { + Vectorized retval; + for (const auto i : c10::irange(std::decay_t::size())) { + retval.vals[i] = a.vals[i] * b.vals[i]; + } + return retval; +} + +template <> +Vectorized inline operator+( + const Vectorized& a, + const Vectorized& b) { + Vectorized retval; + for (const auto i : c10::irange(std::decay_t::size())) { + retval.vals[i] = a.vals[i] + b.vals[i]; + } + return retval; +} + +template <> +struct Vectorized : public VectorizedQuantizedConverter< + c10::qint8, + std::array, 4>, + std::array, 4>, + 32> { + Vectorized() + : VectorizedQuantizedConverter< + c10::qint8, + std::array, 4>, + std::array, 4>, + 32>() {} + Vectorized(c10::qint8 val) + : VectorizedQuantizedConverter< + c10::qint8, + std::array, 4>, + std::array, 4>, + 32>(val) {} + Vectorized(const void* ptr) + : VectorizedQuantizedConverter< + c10::qint8, + std::array, 4>, + std::array, 4>, + 32>(ptr) {} + + static Vectorized loadu(const void* ptr) { + return Vectorized(ptr); + } + + static Vectorized loadu(const void* ptr, int64_t count) { + __at_align__ value_type tmp_values[size()]; + // Ensure uninitialized memory does not change the output value See https://github.com/pytorch/pytorch/issues/32502 + // for more details. We do not initialize arrays to zero using "={0}" because gcc would compile it to two + // instructions while a loop would be compiled to one instruction. + for (const auto i : c10::irange(size())) { + tmp_values[i] = 0; + } + std::memcpy( + tmp_values, reinterpret_cast(ptr), count * sizeof(value_type)); + return Vectorized(tmp_values); + } + + static Vectorized quantize( + const float_vec_return_type& rhs, + float scale, + int32_t zero_point, + float /*inverse_scale*/) { + std::array qvals; + std::array float_vals; + + for (const auto i : c10::irange(float_num_vecs())) { + rhs[i].store(&float_vals[i * 8], 8); + } + + at::native::quantize_vec( + scale, + zero_point, + float_vals.data(), + (c10::qint8*)qvals.data(), + 8 * float_num_vecs()); + + return Vectorized::loadu(qvals.data()); + } + + Vectorized maximum(Vectorized b) const { + Vectorized retval; + for (const auto i : c10::irange(size())) { + retval.vals[i] = std::max(vals[i], b.vals[i]); + } + return retval; + } + + Vectorized minimum(Vectorized b) const { + Vectorized retval; + for (const auto i : c10::irange(size())) { + retval.vals[i] = std::min(vals[i], b.vals[i]); + } + return retval; + } + + Vectorized relu(Vectorized zero_point) const { + return maximum(zero_point); + } + + Vectorized relu6( + Vectorized zero_point, + Vectorized q_six) { + Vectorized retval; + for (const auto i : c10::irange(size())) { + retval.vals[i] = std::min( + std::max(vals[i], zero_point.vals[i]), q_six.vals[i]); + } + return retval; + } + + int_vec_return_type widening_subtract(Vectorized b) const { + int_vec_return_type retval; + constexpr int elem_per_int_vec = size() / int_num_vecs(); + for (const auto i : c10::irange(int_num_vecs())) { + for (const auto j : c10::irange(elem_per_int_vec)) { + retval[i].vals[j] = + static_cast(vals[i * elem_per_int_vec + j]) - + static_cast(b.vals[i * elem_per_int_vec + j]); + } + } + return retval; + } + static Vectorized requantize_from_int( + const int_vec_return_type& inp, + float multiplier, + int32_t zero_point) { + constexpr int elem_per_int_vec = size() / int_num_vecs(); + constexpr auto min_val = std::numeric_limits::min(); + constexpr auto max_val = std::numeric_limits::max(); + Vectorized retval; + for (const auto i : c10::irange(int_num_vecs())) { + for (const auto j : c10::irange(elem_per_int_vec)) { + int32_t rounded = + std::nearbyint(static_cast(inp[i].vals[j]) * multiplier) + + zero_point; + retval.vals[i * elem_per_int_vec + j] = + std::min(std::max(rounded, min_val), max_val); + } + } + return retval; + } +}; + +template <> +Vectorized inline maximum(const Vectorized& a, const Vectorized& b) { + return a.maximum(b); +} + +template <> +struct Vectorized : public VectorizedQuantizedConverter< + c10::quint8, + std::array, 4>, + std::array, 4>, + 32> { + Vectorized() + : VectorizedQuantizedConverter< + c10::quint8, + std::array, 4>, + std::array, 4>, + 32>() {} + Vectorized(c10::quint8 val) + : VectorizedQuantizedConverter< + c10::quint8, + std::array, 4>, + std::array, 4>, + 32>(val) {} + Vectorized(const void* ptr) + : VectorizedQuantizedConverter< + c10::quint8, + std::array, 4>, + std::array, 4>, + 32>(ptr) {} + + static Vectorized loadu(const void* ptr) { + return Vectorized(ptr); + } + + static Vectorized loadu(const void* ptr, int64_t count) { + __at_align__ value_type tmp_values[size()]; + // Ensure uninitialized memory does not change the output value See https://github.com/pytorch/pytorch/issues/32502 + // for more details. We do not initialize arrays to zero using "={0}" because gcc would compile it to two + // instructions while a loop would be compiled to one instruction. + for (const auto i : c10::irange(size())) { + tmp_values[i] = 0; + } + std::memcpy( + tmp_values, reinterpret_cast(ptr), count * sizeof(value_type)); + return Vectorized(tmp_values); + } + + static Vectorized quantize( + const float_vec_return_type& rhs, + float scale, + int32_t zero_point, + float /*inverse_scale*/) { + std::array qvals; + std::array float_vals; + + for (const auto i : c10::irange(float_num_vecs())) { + rhs[i].store(&float_vals[i * 8], 8); + } + + at::native::quantize_vec( + scale, + zero_point, + float_vals.data(), + (c10::quint8*)qvals.data(), + 8 * float_num_vecs()); + + return Vectorized::loadu(qvals.data()); + } + + Vectorized maximum(Vectorized b) const { + Vectorized retval; + for (const auto i : c10::irange(size())) { + retval.vals[i] = std::max(vals[i], b.vals[i]); + } + return retval; + } + + Vectorized minimum(Vectorized b) const { + Vectorized retval; + for (const auto i : c10::irange(size())) { + retval.vals[i] = std::min(vals[i], b.vals[i]); + } + return retval; + } + + Vectorized relu(Vectorized zero_point) const { + return maximum(zero_point); + } + + + Vectorized relu6( + Vectorized zero_point, + Vectorized q_six) { + Vectorized retval; + for (const auto i : c10::irange(size())) { + retval.vals[i] = std::min( + std::max(vals[i], zero_point.vals[i]), q_six.vals[i]); + } + return retval; + } + + int_vec_return_type widening_subtract(Vectorized b) const { + int_vec_return_type retval; + constexpr int elem_per_int_vec = size() / int_num_vecs(); + for (const auto i : c10::irange(int_num_vecs())) { + for (const auto j : c10::irange(elem_per_int_vec)) { + retval[i].vals[j] = + static_cast(vals[i * elem_per_int_vec + j]) - + static_cast(b.vals[i * elem_per_int_vec + j]); + } + } + return retval; + } + static Vectorized requantize_from_int( + const int_vec_return_type& inp, + float multiplier, + int32_t zero_point) { + constexpr int elem_per_int_vec = size() / int_num_vecs(); + constexpr auto min_val = std::numeric_limits::min(); + constexpr auto max_val = std::numeric_limits::max(); + Vectorized retval; + for (const auto i : c10::irange(int_num_vecs())) { + for (const auto j : c10::irange(elem_per_int_vec)) { + int32_t rounded = + std::nearbyint(static_cast(inp[i].vals[j]) * multiplier) + + zero_point; + retval.vals[i * elem_per_int_vec + j] = + std::min(std::max(rounded, min_val), max_val); + } + } + return retval; + } +}; + +template <> +Vectorized inline maximum(const Vectorized& a, const Vectorized& b) { + return a.maximum(b); +} + +#endif // if defined(CPU_CAPABILITY_AVX2) && !defined(_MSC_VER) +}} // namespace at::vec::CPU_CAPABILITY diff --git a/shared/package-files/08/08ec1d9800855d7ba9307ed55447f92661e7a9582824c7bcd58b8a44222e3191/blob b/shared/package-files/08/08ec1d9800855d7ba9307ed55447f92661e7a9582824c7bcd58b8a44222e3191/blob new file mode 100644 index 0000000000000000000000000000000000000000..586d876b08d6e729b6bc5365abfaf1b117331c2d --- /dev/null +++ b/shared/package-files/08/08ec1d9800855d7ba9307ed55447f92661e7a9582824c7bcd58b8a44222e3191/blob @@ -0,0 +1,593 @@ +""" +Create a wheel (.whl) distribution. + +A wheel is a built archive format. +""" + +from __future__ import annotations + +import os +import re +import shutil +import stat +import struct +import sys +import sysconfig +import warnings +from email.generator import BytesGenerator, Generator +from email.policy import EmailPolicy +from glob import iglob +from io import BytesIO +from shutil import rmtree +from zipfile import ZIP_DEFLATED, ZIP_STORED + +import setuptools +from setuptools import Command + +from . import __version__ as wheel_version +from .macosx_libfile import calculate_macosx_platform_tag +from .metadata import pkginfo_to_metadata +from .util import log +from .vendored.packaging import tags +from .vendored.packaging import version as _packaging_version +from .wheelfile import WheelFile + + +def safe_name(name): + """Convert an arbitrary string to a standard distribution name + Any runs of non-alphanumeric/. characters are replaced with a single '-'. + """ + return re.sub("[^A-Za-z0-9.]+", "-", name) + + +def safe_version(version): + """ + Convert an arbitrary string to a standard version string + """ + try: + # normalize the version + return str(_packaging_version.Version(version)) + except _packaging_version.InvalidVersion: + version = version.replace(" ", ".") + return re.sub("[^A-Za-z0-9.]+", "-", version) + + +setuptools_major_version = int(setuptools.__version__.split(".")[0]) + +PY_LIMITED_API_PATTERN = r"cp3\d" + + +def _is_32bit_interpreter(): + return struct.calcsize("P") == 4 + + +def python_tag(): + return f"py{sys.version_info[0]}" + + +def get_platform(archive_root): + """Return our platform name 'win32', 'linux_x86_64'""" + result = sysconfig.get_platform() + if result.startswith("macosx") and archive_root is not None: + result = calculate_macosx_platform_tag(archive_root, result) + elif _is_32bit_interpreter(): + if result == "linux-x86_64": + # pip pull request #3497 + result = "linux-i686" + elif result == "linux-aarch64": + # packaging pull request #234 + # TODO armv8l, packaging pull request #690 => this did not land + # in pip/packaging yet + result = "linux-armv7l" + + return result.replace("-", "_") + + +def get_flag(var, fallback, expected=True, warn=True): + """Use a fallback value for determining SOABI flags if the needed config + var is unset or unavailable.""" + val = sysconfig.get_config_var(var) + if val is None: + if warn: + warnings.warn( + f"Config variable '{var}' is unset, Python ABI tag may " "be incorrect", + RuntimeWarning, + stacklevel=2, + ) + return fallback + return val == expected + + +def get_abi_tag(): + """Return the ABI tag based on SOABI (if available) or emulate SOABI (PyPy2).""" + soabi = sysconfig.get_config_var("SOABI") + impl = tags.interpreter_name() + if not soabi and impl in ("cp", "pp") and hasattr(sys, "maxunicode"): + d = "" + m = "" + u = "" + if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")): + d = "d" + + if get_flag( + "WITH_PYMALLOC", + impl == "cp", + warn=(impl == "cp" and sys.version_info < (3, 8)), + ) and sys.version_info < (3, 8): + m = "m" + + abi = f"{impl}{tags.interpreter_version()}{d}{m}{u}" + elif soabi and impl == "cp": + abi = "cp" + soabi.split("-")[1] + elif soabi and impl == "pp": + # we want something like pypy36-pp73 + abi = "-".join(soabi.split("-")[:2]) + abi = abi.replace(".", "_").replace("-", "_") + elif soabi and impl == "graalpy": + abi = "-".join(soabi.split("-")[:3]) + abi = abi.replace(".", "_").replace("-", "_") + elif soabi: + abi = soabi.replace(".", "_").replace("-", "_") + else: + abi = None + + return abi + + +def safer_name(name): + return safe_name(name).replace("-", "_") + + +def safer_version(version): + return safe_version(version).replace("-", "_") + + +def remove_readonly(func, path, excinfo): + remove_readonly_exc(func, path, excinfo[1]) + + +def remove_readonly_exc(func, path, exc): + os.chmod(path, stat.S_IWRITE) + func(path) + + +class bdist_wheel(Command): + description = "create a wheel distribution" + + supported_compressions = { + "stored": ZIP_STORED, + "deflated": ZIP_DEFLATED, + } + + user_options = [ + ("bdist-dir=", "b", "temporary directory for creating the distribution"), + ( + "plat-name=", + "p", + "platform name to embed in generated filenames " + "(default: %s)" % get_platform(None), + ), + ( + "keep-temp", + "k", + "keep the pseudo-installation tree around after " + "creating the distribution archive", + ), + ("dist-dir=", "d", "directory to put final built distributions in"), + ("skip-build", None, "skip rebuilding everything (for testing/debugging)"), + ( + "relative", + None, + "build the archive using relative paths " "(default: false)", + ), + ( + "owner=", + "u", + "Owner name used when creating a tar file" " [default: current user]", + ), + ( + "group=", + "g", + "Group name used when creating a tar file" " [default: current group]", + ), + ("universal", None, "make a universal wheel" " (default: false)"), + ( + "compression=", + None, + "zipfile compression (one of: {})" + " (default: 'deflated')".format(", ".join(supported_compressions)), + ), + ( + "python-tag=", + None, + "Python implementation compatibility tag" + " (default: '%s')" % (python_tag()), + ), + ( + "build-number=", + None, + "Build number for this particular version. " + "As specified in PEP-0427, this must start with a digit. " + "[default: None]", + ), + ( + "py-limited-api=", + None, + "Python tag (cp32|cp33|cpNN) for abi3 wheel tag" " (default: false)", + ), + ] + + boolean_options = ["keep-temp", "skip-build", "relative", "universal"] + + def initialize_options(self): + self.bdist_dir = None + self.data_dir = None + self.plat_name = None + self.plat_tag = None + self.format = "zip" + self.keep_temp = False + self.dist_dir = None + self.egginfo_dir = None + self.root_is_pure = None + self.skip_build = None + self.relative = False + self.owner = None + self.group = None + self.universal = False + self.compression = "deflated" + self.python_tag = python_tag() + self.build_number = None + self.py_limited_api = False + self.plat_name_supplied = False + + def finalize_options(self): + if self.bdist_dir is None: + bdist_base = self.get_finalized_command("bdist").bdist_base + self.bdist_dir = os.path.join(bdist_base, "wheel") + + egg_info = self.distribution.get_command_obj("egg_info") + egg_info.ensure_finalized() # needed for correct `wheel_dist_name` + + self.data_dir = self.wheel_dist_name + ".data" + self.plat_name_supplied = self.plat_name is not None + + try: + self.compression = self.supported_compressions[self.compression] + except KeyError: + raise ValueError(f"Unsupported compression: {self.compression}") from None + + need_options = ("dist_dir", "plat_name", "skip_build") + + self.set_undefined_options("bdist", *zip(need_options, need_options)) + + self.root_is_pure = not ( + self.distribution.has_ext_modules() or self.distribution.has_c_libraries() + ) + + if self.py_limited_api and not re.match( + PY_LIMITED_API_PATTERN, self.py_limited_api + ): + raise ValueError("py-limited-api must match '%s'" % PY_LIMITED_API_PATTERN) + + # Support legacy [wheel] section for setting universal + wheel = self.distribution.get_option_dict("wheel") + if "universal" in wheel: + # please don't define this in your global configs + log.warning( + "The [wheel] section is deprecated. Use [bdist_wheel] instead.", + ) + val = wheel["universal"][1].strip() + if val.lower() in ("1", "true", "yes"): + self.universal = True + + if self.build_number is not None and not self.build_number[:1].isdigit(): + raise ValueError("Build tag (build-number) must start with a digit.") + + @property + def wheel_dist_name(self): + """Return distribution full name with - replaced with _""" + components = ( + safer_name(self.distribution.get_name()), + safer_version(self.distribution.get_version()), + ) + if self.build_number: + components += (self.build_number,) + return "-".join(components) + + def get_tag(self): + # bdist sets self.plat_name if unset, we should only use it for purepy + # wheels if the user supplied it. + if self.plat_name_supplied: + plat_name = self.plat_name + elif self.root_is_pure: + plat_name = "any" + else: + # macosx contains system version in platform name so need special handle + if self.plat_name and not self.plat_name.startswith("macosx"): + plat_name = self.plat_name + else: + # on macosx always limit the platform name to comply with any + # c-extension modules in bdist_dir, since the user can specify + # a higher MACOSX_DEPLOYMENT_TARGET via tools like CMake + + # on other platforms, and on macosx if there are no c-extension + # modules, use the default platform name. + plat_name = get_platform(self.bdist_dir) + + if _is_32bit_interpreter(): + if plat_name in ("linux-x86_64", "linux_x86_64"): + plat_name = "linux_i686" + if plat_name in ("linux-aarch64", "linux_aarch64"): + # TODO armv8l, packaging pull request #690 => this did not land + # in pip/packaging yet + plat_name = "linux_armv7l" + + plat_name = ( + plat_name.lower().replace("-", "_").replace(".", "_").replace(" ", "_") + ) + + if self.root_is_pure: + if self.universal: + impl = "py2.py3" + else: + impl = self.python_tag + tag = (impl, "none", plat_name) + else: + impl_name = tags.interpreter_name() + impl_ver = tags.interpreter_version() + impl = impl_name + impl_ver + # We don't work on CPython 3.1, 3.0. + if self.py_limited_api and (impl_name + impl_ver).startswith("cp3"): + impl = self.py_limited_api + abi_tag = "abi3" + else: + abi_tag = str(get_abi_tag()).lower() + tag = (impl, abi_tag, plat_name) + # issue gh-374: allow overriding plat_name + supported_tags = [ + (t.interpreter, t.abi, plat_name) for t in tags.sys_tags() + ] + assert ( + tag in supported_tags + ), f"would build wheel with unsupported tag {tag}" + return tag + + def run(self): + build_scripts = self.reinitialize_command("build_scripts") + build_scripts.executable = "python" + build_scripts.force = True + + build_ext = self.reinitialize_command("build_ext") + build_ext.inplace = False + + if not self.skip_build: + self.run_command("build") + + install = self.reinitialize_command("install", reinit_subcommands=True) + install.root = self.bdist_dir + install.compile = False + install.skip_build = self.skip_build + install.warn_dir = False + + # A wheel without setuptools scripts is more cross-platform. + # Use the (undocumented) `no_ep` option to setuptools' + # install_scripts command to avoid creating entry point scripts. + install_scripts = self.reinitialize_command("install_scripts") + install_scripts.no_ep = True + + # Use a custom scheme for the archive, because we have to decide + # at installation time which scheme to use. + for key in ("headers", "scripts", "data", "purelib", "platlib"): + setattr(install, "install_" + key, os.path.join(self.data_dir, key)) + + basedir_observed = "" + + if os.name == "nt": + # win32 barfs if any of these are ''; could be '.'? + # (distutils.command.install:change_roots bug) + basedir_observed = os.path.normpath(os.path.join(self.data_dir, "..")) + self.install_libbase = self.install_lib = basedir_observed + + setattr( + install, + "install_purelib" if self.root_is_pure else "install_platlib", + basedir_observed, + ) + + log.info(f"installing to {self.bdist_dir}") + + self.run_command("install") + + impl_tag, abi_tag, plat_tag = self.get_tag() + archive_basename = f"{self.wheel_dist_name}-{impl_tag}-{abi_tag}-{plat_tag}" + if not self.relative: + archive_root = self.bdist_dir + else: + archive_root = os.path.join( + self.bdist_dir, self._ensure_relative(install.install_base) + ) + + self.set_undefined_options("install_egg_info", ("target", "egginfo_dir")) + distinfo_dirname = "{}-{}.dist-info".format( + safer_name(self.distribution.get_name()), + safer_version(self.distribution.get_version()), + ) + distinfo_dir = os.path.join(self.bdist_dir, distinfo_dirname) + self.egg2dist(self.egginfo_dir, distinfo_dir) + + self.write_wheelfile(distinfo_dir) + + # Make the archive + if not os.path.exists(self.dist_dir): + os.makedirs(self.dist_dir) + + wheel_path = os.path.join(self.dist_dir, archive_basename + ".whl") + with WheelFile(wheel_path, "w", self.compression) as wf: + wf.write_files(archive_root) + + # Add to 'Distribution.dist_files' so that the "upload" command works + getattr(self.distribution, "dist_files", []).append( + ( + "bdist_wheel", + "{}.{}".format(*sys.version_info[:2]), # like 3.7 + wheel_path, + ) + ) + + if not self.keep_temp: + log.info(f"removing {self.bdist_dir}") + if not self.dry_run: + if sys.version_info < (3, 12): + rmtree(self.bdist_dir, onerror=remove_readonly) + else: + rmtree(self.bdist_dir, onexc=remove_readonly_exc) + + def write_wheelfile( + self, wheelfile_base, generator="bdist_wheel (" + wheel_version + ")" + ): + from email.message import Message + + msg = Message() + msg["Wheel-Version"] = "1.0" # of the spec + msg["Generator"] = generator + msg["Root-Is-Purelib"] = str(self.root_is_pure).lower() + if self.build_number is not None: + msg["Build"] = self.build_number + + # Doesn't work for bdist_wininst + impl_tag, abi_tag, plat_tag = self.get_tag() + for impl in impl_tag.split("."): + for abi in abi_tag.split("."): + for plat in plat_tag.split("."): + msg["Tag"] = "-".join((impl, abi, plat)) + + wheelfile_path = os.path.join(wheelfile_base, "WHEEL") + log.info(f"creating {wheelfile_path}") + buffer = BytesIO() + BytesGenerator(buffer, maxheaderlen=0).flatten(msg) + with open(wheelfile_path, "wb") as f: + f.write(buffer.getvalue().replace(b"\r\n", b"\r")) + + def _ensure_relative(self, path): + # copied from dir_util, deleted + drive, path = os.path.splitdrive(path) + if path[0:1] == os.sep: + path = drive + path[1:] + return path + + @property + def license_paths(self): + if setuptools_major_version >= 57: + # Setuptools has resolved any patterns to actual file names + return self.distribution.metadata.license_files or () + + files = set() + metadata = self.distribution.get_option_dict("metadata") + if setuptools_major_version >= 42: + # Setuptools recognizes the license_files option but does not do globbing + patterns = self.distribution.metadata.license_files + else: + # Prior to those, wheel is entirely responsible for handling license files + if "license_files" in metadata: + patterns = metadata["license_files"][1].split() + else: + patterns = () + + if "license_file" in metadata: + warnings.warn( + 'The "license_file" option is deprecated. Use "license_files" instead.', + DeprecationWarning, + stacklevel=2, + ) + files.add(metadata["license_file"][1]) + + if not files and not patterns and not isinstance(patterns, list): + patterns = ("LICEN[CS]E*", "COPYING*", "NOTICE*", "AUTHORS*") + + for pattern in patterns: + for path in iglob(pattern): + if path.endswith("~"): + log.debug( + f'ignoring license file "{path}" as it looks like a backup' + ) + continue + + if path not in files and os.path.isfile(path): + log.info( + f'adding license file "{path}" (matched pattern "{pattern}")' + ) + files.add(path) + + return files + + def egg2dist(self, egginfo_path, distinfo_path): + """Convert an .egg-info directory into a .dist-info directory""" + + def adios(p): + """Appropriately delete directory, file or link.""" + if os.path.exists(p) and not os.path.islink(p) and os.path.isdir(p): + shutil.rmtree(p) + elif os.path.exists(p): + os.unlink(p) + + adios(distinfo_path) + + if not os.path.exists(egginfo_path): + # There is no egg-info. This is probably because the egg-info + # file/directory is not named matching the distribution name used + # to name the archive file. Check for this case and report + # accordingly. + import glob + + pat = os.path.join(os.path.dirname(egginfo_path), "*.egg-info") + possible = glob.glob(pat) + err = f"Egg metadata expected at {egginfo_path} but not found" + if possible: + alt = os.path.basename(possible[0]) + err += f" ({alt} found - possible misnamed archive file?)" + + raise ValueError(err) + + if os.path.isfile(egginfo_path): + # .egg-info is a single file + pkginfo_path = egginfo_path + pkg_info = pkginfo_to_metadata(egginfo_path, egginfo_path) + os.mkdir(distinfo_path) + else: + # .egg-info is a directory + pkginfo_path = os.path.join(egginfo_path, "PKG-INFO") + pkg_info = pkginfo_to_metadata(egginfo_path, pkginfo_path) + + # ignore common egg metadata that is useless to wheel + shutil.copytree( + egginfo_path, + distinfo_path, + ignore=lambda x, y: { + "PKG-INFO", + "requires.txt", + "SOURCES.txt", + "not-zip-safe", + }, + ) + + # delete dependency_links if it is only whitespace + dependency_links_path = os.path.join(distinfo_path, "dependency_links.txt") + with open(dependency_links_path, encoding="utf-8") as dependency_links_file: + dependency_links = dependency_links_file.read().strip() + if not dependency_links: + adios(dependency_links_path) + + pkg_info_path = os.path.join(distinfo_path, "METADATA") + serialization_policy = EmailPolicy( + utf8=True, + mangle_from_=False, + max_line_length=0, + ) + with open(pkg_info_path, "w", encoding="utf-8") as out: + Generator(out, policy=serialization_policy).flatten(pkg_info) + + for license_path in self.license_paths: + filename = os.path.basename(license_path) + shutil.copy(license_path, os.path.join(distinfo_path, filename)) + + adios(egginfo_path) diff --git a/shared/package-files/08/08ef6c42f131bfcc0827b247a93692dfeb2f7e4bde15df2bc17ba33605510bf8/blob b/shared/package-files/08/08ef6c42f131bfcc0827b247a93692dfeb2f7e4bde15df2bc17ba33605510bf8/blob new file mode 100644 index 0000000000000000000000000000000000000000..c34917f3dd074cf50e3ab2e030f9730c3d4333a9 --- /dev/null +++ b/shared/package-files/08/08ef6c42f131bfcc0827b247a93692dfeb2f7e4bde15df2bc17ba33605510bf8/blob @@ -0,0 +1,201 @@ +import logging +from collections import defaultdict +from typing import Tuple, Dict, Optional, List + +import torch +from torch.export import export +from torch._export.pass_base import _ExportPassBaseDeprecatedDoNotUse +from torch._export.pass_infra.node_metadata import NodeMetadata +from torch._export.pass_infra.proxy_value import ProxyValue +from torch._subclasses import FakeTensor +from torch.fx.node import Target, Argument +from torch.library import Library +from torch.utils._pytree import tree_unflatten +import torch._export.exported_program as ep +import re + +lib = Library("aten", "FRAGMENT") +impl_lib = Library("aten", "IMPL") + +log = logging.getLogger(__name__) + + +def get_target_version(versioned_upgrader_name: str) -> int: + """div_Scalar_0_3 is the name of the upgrader, meaning it applies to div.Scalar of version 0 to 3 and is + upgrading to version 4.""" + if not re.match("^.*_[0-9]+_[0-9]+$", versioned_upgrader_name): + raise RuntimeError(f"Upgrader name {versioned_upgrader_name} is invalid") + + return int(versioned_upgrader_name.split('_')[-1]) + 1 + + +def get_upgraders() -> Dict[str, Tuple[str, str]]: + """Getting upgraders entry map and operator version map and merge them into one dict.""" + upgraders = torch._C._get_upgraders_entry_map() + op_version_map = torch._C._get_operator_version_map() + output: Dict[str, Tuple[str, str]] = defaultdict(tuple) # type: ignore[arg-type] + for opname, entry_list in op_version_map.items(): + if not entry_list: + raise RuntimeError(f"Op version map has an empty entry for opname {opname}") + entry = entry_list[0] + old_schema = entry.old_schema + upgrader_name = entry.upgrader_name + upgrader_str = upgraders.get(upgrader_name, None) + if not upgrader_str: + raise RuntimeError(f"Can't find upgrader for op {opname} and upgrader name {upgrader_name}") + output[upgrader_name] = (old_schema, upgrader_str) + return output + + +class GraphModuleOpUpgrader: + """This upgrader is able to upgrade the old version of ops in a given GraphModule, if all upgraders are available. + To use it, retrieve upgraders from somewhere (TorchScript API or new API) and pass it into this upgrader. In + __init__() it does the following: + 1. parse the upgrader list and reorder for upgrading purpose. + 2. register old versions of operators as custom ops. + 3. prepare upgrader passes. + + In `upgrade()` API run these upgrader passes. + + An example of op_upgraders input: + { + "aten::div__Scalar_0_3": ( # versioned op name + "div._Scalar(self: Tensor, other: Scalar)", # old schema + ''' + def div__Scalar_0_3(self: torch.Tensor, other) -> torch.Tensor: # upgrader in literal string + if (self.is_floating_point() or isinstance(other, float)): + return self.true_divide_(other) + return self.divide_(other, rounding_mode='trunc') + ''', + ), + }, + + Note that we require the upgrader function to be runnable in Python (which is a stricter requirement than the + original TorchScript upgrader). + """ + + class UpgraderPass(_ExportPassBaseDeprecatedDoNotUse): + def __init__(self, old_target: Target, new_target: Target): + super().__init__() + self.old_target = old_target + self.new_target = new_target + + def call_operator( + self, + op, + args: Tuple[Argument, ...], + kwargs: Dict[str, Argument], + meta: NodeMetadata, + ) -> ProxyValue: + if op == self.old_target: + return super().call_operator(self.new_target, args, kwargs, meta) + return super().call_operator(op, args, kwargs, meta) + + def __init__( + self, + compiler_opset_version: Optional[Dict[str, int]] = None, + model_opset_version: Optional[Dict[str, int]] = None, + op_upgraders: Optional[Dict[str, Tuple[str, str]]] = None, + ): + self.op_upgraders: Dict[str, Tuple[str, str]] = get_upgraders() if not op_upgraders else op_upgraders + self.compiler_opset_version = compiler_opset_version if compiler_opset_version else {} + self.model_opset_version = model_opset_version if model_opset_version else {} + self.upgrader_passes: List[GraphModuleOpUpgrader.UpgraderPass] = GraphModuleOpUpgrader._populate_passes( + self._parse_upgraders(self.op_upgraders)) + + def _parse_upgraders(self, op_upgraders: Optional[Dict[str, Tuple[str, str]]] = None) -> List[Tuple[str, str]]: + """Reorder op_upgraders by version number, return an ordered list of tuples, containing old op schema as well + as the upgrader function string literal.""" + # TODO(larryliu0820): Add support for custom ops + op_namespace = "aten" + if not op_upgraders or op_namespace not in self.model_opset_version or op_namespace not in self.compiler_opset_version: + return [] + model_ver = self.model_opset_version[op_namespace] + curr_ver = self.compiler_opset_version[op_namespace] + + # key is the target version. div__Scalar_0_3 should have a key of 4. + versioned_upgraders: Dict[int, Tuple[str, str]] = {get_target_version(name): v for name, v in + op_upgraders.items()} + target_upgraders: List[Tuple[str, str]] = [] + # we need all upgraders from model_ver + 1 to curr_ver, inclusively + for ver in range(model_ver + 1, curr_ver + 1): + if ver in versioned_upgraders: + target_upgraders.append(versioned_upgraders[ver]) + else: + # we may be able to get away with missing upgraders, if that operator is missing from given graph + # module. + log.warning("Missing an upgrader to upgrade to version {ver}.", extra={"ver": ver}) + + return target_upgraders + + @staticmethod + def _populate_passes(upgraders: List[Tuple[str, str]]) -> List[UpgraderPass]: + """Given a list of upgraders, loop through it from lower version to higher version and create passes for all + upgraders. se torch.Library API to register old ops. Op name will be + __. Register upgraders as CompositeImplicitAutograd kernels. For example: + + lib = Library("aten", "FRAGMENT") + lib.define(old_schema) + + impl_lib = Library("aten", "IMPL") + impl_lib.impl("div__Scalar_0_3", div__Scalar_0_3, "CompositeImplicitAutograd") + + @:var upgraders: a list of tuples. The first element of the tuple is the old schema and the second is the + upgrader function literal text. + @:return upgrader passes, order matters + """ + + upgrader_passes = [] + + def register_old_op(name: str, schema: str, impl_str: str): + """Registers an old version operator using impl_name as old op name.""" + lib.define(schema) + try: + exec(impl_str) + except Exception as e: + raise RuntimeError(f"Invalid upgrader string: {impl_str}") from e + impl_lib.impl(name, locals()[name], "CompositeImplicitAutograd") + + for (schema, upgrader_str) in upgraders: + upgrader_name = upgrader_str.split('(')[0].split(' ')[-1] + op_name = schema.split('(')[0].split("::")[-1] + schema = schema.replace(op_name, upgrader_name) + try: + register_old_op(name=upgrader_name, schema=schema, impl_str=upgrader_str) + except RuntimeError as e: + if "with the same name and overload name multiple times" in str(e): + print(f"Registering {upgrader_name} multiple times") + else: + raise RuntimeError from e + old_op_target = getattr(torch.ops.aten, upgrader_name).default + # for example, the operator instance of "aten::div" is torch.op.aten.div.default. We need to append the + # "default" at the end. + op_name, overload_name = (op_name, "default") if "." not in op_name else tuple(op_name.split(".")[:2]) + new_op_target = getattr(getattr(torch.ops.aten, op_name), overload_name) + # Note that the graph will have op names in the graph, but actually they are of old versions. + upgrader_passes.append( + GraphModuleOpUpgrader.UpgraderPass(old_target=new_op_target, new_target=old_op_target)) + + return upgrader_passes + + def upgrade(self, exported_program: ep.ExportedProgram) -> ep.ExportedProgram: + """Run each upgrader pass and then retrace to decompose it. Each upgrader pass replaces the old version of + operators with a custom operator. The custom operator contains a CompositeImplicitAutograd kernel (the + upgrading function itself). After retrace, this custom operator will be decomposed into the ops used in the + upgrader. After all passes are applied, the exported program will be upgraded to the target version.""" + if not self.upgrader_passes: + return exported_program + + args = [n.meta.get("val", None) for n in exported_program.graph.nodes if n.op == "placeholder"] + args_real_tensors = [torch.ones(tuple(arg.size()), dtype=arg.dtype) if isinstance(arg, FakeTensor) else arg for + arg in args] + assert exported_program.call_spec.in_spec is not None + args, kwargs = tree_unflatten(args_real_tensors, exported_program.call_spec.in_spec) + assert kwargs == {} + + for _pass in self.upgrader_passes: + upgraded_program = exported_program._transform_do_not_use(_pass) + # NB: we have to retrace the graph_module instead of ep because of some failure. + exported_program = export(upgraded_program.module(), args, kwargs) + + return exported_program diff --git a/shared/package-files/08/08f07fa033ae67fbbcf5ef7033c6c69fcf261af0a581f6bb503c43a61eaff6c6/blob b/shared/package-files/08/08f07fa033ae67fbbcf5ef7033c6c69fcf261af0a581f6bb503c43a61eaff6c6/blob new file mode 100644 index 0000000000000000000000000000000000000000..ed38a4dcf7ab87aad4db906dd8b6abc058387f8e --- /dev/null +++ b/shared/package-files/08/08f07fa033ae67fbbcf5ef7033c6c69fcf261af0a581f6bb503c43a61eaff6c6/blob @@ -0,0 +1,29 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "arrow/util/visibility.h" + +namespace arrow { +namespace internal { + +ARROW_EXPORT +void DebugTrap(); + +} // namespace internal +} // namespace arrow diff --git a/shared/package-files/08/08f3cf76fa0ef707aeddf310e36f31d6fbfcbe288cdc851f7583afdcff536837/blob b/shared/package-files/08/08f3cf76fa0ef707aeddf310e36f31d6fbfcbe288cdc851f7583afdcff536837/blob new file mode 100644 index 0000000000000000000000000000000000000000..bd60c1e77224f743cbb50df61b099b30ccd64a2f --- /dev/null +++ b/shared/package-files/08/08f3cf76fa0ef707aeddf310e36f31d6fbfcbe288cdc851f7583afdcff536837/blob @@ -0,0 +1,101 @@ +#pragma once + +#include + +#include + +namespace c10 { + +struct EnumType; +using EnumTypePtr = std::shared_ptr; +using EnumNameValue = std::pair; +struct TORCH_API EnumType : public NamedType { + friend struct Type; + static const TypeKind Kind = TypeKind::EnumType; + + static EnumTypePtr create( + const c10::QualifiedName& qualified_class_name, + TypePtr value, + std::vector enum_names_values, + std::weak_ptr<::torch::jit::CompilationUnit> cu) { + switch (value->kind()) { + case TypeKind::IntType: + case TypeKind::FloatType: + case TypeKind::StringType: + return EnumTypePtr(new EnumType( + qualified_class_name, + std::move(value), + std::move(enum_names_values), + std::move(cu))); + default: + AT_ERROR( + "Cannot create Enum with value type '", + value->str(), + "', only int, float and string are supported"); + } + } + + std::string str() const override { + return "Enum<" + annotation_str() + ">"; + } + + std::string repr_str() const override { + return str(); + } + + const TypePtr& getValueType() const { + return value_type_; + } + + bool equals(const Type& rhs) const override { + if (auto* enum_rhs = rhs.castRaw()) { + return name().value() == enum_rhs->name().value() && + *getValueType() == *(enum_rhs->getValueType()) && + this->compilation_unit() == enum_rhs->compilation_unit(); + } + return false; + } + + bool isSubtypeOfExt(const Type& rhs, std::ostream* why_not) const override; + + std::shared_ptr compilation_unit() + const { + auto cu = cu_.lock(); + return cu; + } + + const QualifiedName& qualifiedClassName() const { + return name().value(); + } + + at::ArrayRef containedTypes() const override { + return value_type_; + } + + const at::ArrayRef enumNamesValues() const { + return enum_names_values_; + } + + private: + EnumType( + c10::QualifiedName qualified_class_name, + TypePtr value_type, + std::vector enum_names_values, + std::weak_ptr cu) + : NamedType(TypeKind::EnumType, std::move(qualified_class_name)), + value_type_(std::move(value_type)), + enum_names_values_(std::move(enum_names_values)), + cu_(std::move(cu)) {} + + std::string annotation_str_impl( + C10_UNUSED TypePrinter printer = nullptr) const override { + const auto& n = name().value(); + return n.qualifiedName(); + } + + TypePtr value_type_; + std::vector enum_names_values_; + std::weak_ptr<::torch::jit::CompilationUnit> cu_; +}; + +} // namespace c10 diff --git a/shared/package-files/08/08f563075f3eab9ba6d200d8f48cca4e9fbd5b2270092b811e359d9c3237caa6/blob b/shared/package-files/08/08f563075f3eab9ba6d200d8f48cca4e9fbd5b2270092b811e359d9c3237caa6/blob new file mode 100644 index 0000000000000000000000000000000000000000..f011423b4136aa8340ee948e83cd7e6a37d16543 Binary files /dev/null and b/shared/package-files/08/08f563075f3eab9ba6d200d8f48cca4e9fbd5b2270092b811e359d9c3237caa6/blob differ diff --git a/shared/package-files/08/08f8592ff52c9f526a839c078f9fc73b6351f4e942b65c5c430c997187d6355d/blob b/shared/package-files/08/08f8592ff52c9f526a839c078f9fc73b6351f4e942b65c5c430c997187d6355d/blob new file mode 100644 index 0000000000000000000000000000000000000000..65a911f92ee3debad596dc3e02822978c05c372d --- /dev/null +++ b/shared/package-files/08/08f8592ff52c9f526a839c078f9fc73b6351f4e942b65c5c430c997187d6355d/blob @@ -0,0 +1 @@ +Import-Module "$Env:_CONDA_ROOT\shell\condabin\Conda.psm1" -ArgumentList $CondaModuleArgs diff --git a/shared/package-files/08/08f85958af5b6f4e88d760210f72aee02477e93eeda7c2ffcdd433e08eab40c6/blob b/shared/package-files/08/08f85958af5b6f4e88d760210f72aee02477e93eeda7c2ffcdd433e08eab40c6/blob new file mode 100644 index 0000000000000000000000000000000000000000..96408457a4497c72236986122c0cc3204fad4437 --- /dev/null +++ b/shared/package-files/08/08f85958af5b6f4e88d760210f72aee02477e93eeda7c2ffcdd433e08eab40c6/blob @@ -0,0 +1,249 @@ +from typing import List + +import torch +from torch import Tensor +from torch._ops import ops + +__all__ = ['FloatFunctional', 'FXFloatFunctional', 'QFunctional'] + +class FloatFunctional(torch.nn.Module): + r"""State collector class for float operations. + + The instance of this class can be used instead of the ``torch.`` prefix for + some operations. See example usage below. + + .. note:: + + This class does not provide a ``forward`` hook. Instead, you must use + one of the underlying functions (e.g. ``add``). + + Examples:: + + >>> f_add = FloatFunctional() + >>> a = torch.tensor(3.0) + >>> b = torch.tensor(4.0) + >>> f_add.add(a, b) # Equivalent to ``torch.add(a, b)`` + + Valid operation names: + - add + - cat + - mul + - add_relu + - add_scalar + - mul_scalar + """ + def __init__(self): + super().__init__() + self.activation_post_process = torch.nn.Identity() + + def forward(self, x): + raise RuntimeError("FloatFunctional is not intended to use the " + + "'forward'. Please use the underlying operation") + + r"""Operation equivalent to ``torch.add(Tensor, Tensor)``""" + def add(self, x: Tensor, y: Tensor) -> Tensor: + r = torch.add(x, y) + r = self.activation_post_process(r) + return r + + r"""Operation equivalent to ``torch.add(Tensor, float)``""" + def add_scalar(self, x: Tensor, y: float) -> Tensor: + r = torch.add(x, y) + # Note: this operation is not observed because the observation is not + # needed for the quantized op. + return r + + r"""Operation equivalent to ``torch.mul(Tensor, Tensor)``""" + def mul(self, x: Tensor, y: Tensor) -> Tensor: + r = torch.mul(x, y) + r = self.activation_post_process(r) + return r + + r"""Operation equivalent to ``torch.mul(Tensor, float)``""" + def mul_scalar(self, x: Tensor, y: float) -> Tensor: + r = torch.mul(x, y) + # Note: this operation is not observed because the observation is not + # needed for the quantized op. + return r + + r"""Operation equivalent to ``torch.cat``""" + def cat(self, x: List[Tensor], dim: int = 0) -> Tensor: + r = torch.cat(x, dim=dim) + r = self.activation_post_process(r) + return r + + r"""Operation equivalent to ``relu(torch.add(x,y))``""" + def add_relu(self, x: Tensor, y: Tensor) -> Tensor: + r = torch.add(x, y) + r = torch.nn.functional.relu(r) + r = self.activation_post_process(r) + return r + + r"""Operation equivalent to ``torch.matmul(Tensor, Tensor)``""" + def matmul(self, x: Tensor, y: Tensor) -> Tensor: + r = torch.matmul(x, y) + r = self.activation_post_process(r) + return r + +class FXFloatFunctional(torch.nn.Module): + r""" module to replace FloatFunctional module before FX graph mode quantization, + since activation_post_process will be inserted in top level module directly + + Valid operation names: + - add + - cat + - mul + - add_relu + - add_scalar + - mul_scalar + """ + def forward(self, x): + raise RuntimeError("FloatFunctional is not intended to use the " + + "'forward'. Please use the underlying operation") + + r"""Operation equivalent to ``torch.add(Tensor, Tensor)``""" + def add(self, x: Tensor, y: Tensor) -> Tensor: + r = torch.add(x, y) + return r + + r"""Operation equivalent to ``torch.add(Tensor, float)``""" + def add_scalar(self, x: Tensor, y: float) -> Tensor: + r = torch.add(x, y) + return r + + r"""Operation equivalent to ``torch.mul(Tensor, Tensor)``""" + def mul(self, x: Tensor, y: Tensor) -> Tensor: + r = torch.mul(x, y) + return r + + r"""Operation equivalent to ``torch.mul(Tensor, float)``""" + def mul_scalar(self, x: Tensor, y: float) -> Tensor: + r = torch.mul(x, y) + return r + + r"""Operation equivalent to ``torch.cat``""" + def cat(self, x: List[Tensor], dim: int = 0) -> Tensor: + r = torch.cat(x, dim=dim) + return r + + r"""Operation equivalent to ``relu(torch.add(x,y))``""" + def add_relu(self, x: Tensor, y: Tensor) -> Tensor: + r = torch.add(x, y) + r = torch.nn.functional.relu(r) + return r + + r"""Operation equivalent to ``torch.matmul(Tensor, Tensor)``""" + def matmul(self, x: Tensor, y: Tensor) -> Tensor: + r = torch.matmul(x, y) + return r + +class QFunctional(torch.nn.Module): + r"""Wrapper class for quantized operations. + + The instance of this class can be used instead of the + ``torch.ops.quantized`` prefix. See example usage below. + + .. note:: + + This class does not provide a ``forward`` hook. Instead, you must use + one of the underlying functions (e.g. ``add``). + + Examples:: + + >>> q_add = QFunctional() + >>> # xdoctest: +SKIP + >>> a = torch.quantize_per_tensor(torch.tensor(3.0), 1.0, 0, torch.qint32) + >>> b = torch.quantize_per_tensor(torch.tensor(4.0), 1.0, 0, torch.qint32) + >>> q_add.add(a, b) # Equivalent to ``torch.ops.quantized.add(a, b, 1.0, 0)`` + + Valid operation names: + - add + - cat + - mul + - add_relu + - add_scalar + - mul_scalar + """ + def __init__(self): + super().__init__() + self.scale = 1.0 + self.zero_point = 0 + self.activation_post_process = torch.nn.Identity() + + def _save_to_state_dict(self, destination, prefix, keep_vars): + super()._save_to_state_dict(destination, prefix, keep_vars) + destination[prefix + 'scale'] = torch.tensor(self.scale) + destination[prefix + 'zero_point'] = torch.tensor(self.zero_point) + + def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, + missing_keys, unexpected_keys, error_msgs): + + self.scale = float(state_dict.pop(prefix + 'scale')) + self.zero_point = int(state_dict.pop(prefix + 'zero_point')) + super()._load_from_state_dict(state_dict, prefix, local_metadata, False, + missing_keys, unexpected_keys, error_msgs) + + def _get_name(self): + return 'QFunctional' + + def extra_repr(self): + return f'scale={self.scale}, zero_point={self.zero_point}' + + def forward(self, x): + raise RuntimeError("Functional is not intended to use the " + + "'forward'. Please use the underlying operation") + + r"""Operation equivalent to ``torch.ops.quantized.add``""" + def add(self, x: Tensor, y: Tensor) -> Tensor: + r = ops.quantized.add(x, y, scale=self.scale, zero_point=self.zero_point) + r = self.activation_post_process(r) + return r + + r"""Operation equivalent to ``torch.ops.quantized.add(Tensor, float)``""" + def add_scalar(self, x: Tensor, y: float) -> Tensor: + r = ops.quantized.add_scalar(x, y) + # Note: this operation is not observed because the observation is not + # needed for the quantized op. + return r + + r"""Operation equivalent to ``torch.ops.quantized.mul(Tensor, Tensor)``""" + def mul(self, x: Tensor, y: Tensor) -> Tensor: + r = ops.quantized.mul(x, y, scale=self.scale, zero_point=self.zero_point) + r = self.activation_post_process(r) + return r + + r"""Operation equivalent to ``torch.ops.quantized.mul(Tensor, float)``""" + def mul_scalar(self, x: Tensor, y: float) -> Tensor: + r = ops.quantized.mul_scalar(x, y) + # Note: this operation is not observed because the observation is not + # needed for the quantized op. + return r + + r"""Operation equivalent to ``torch.ops.quantized.cat``""" + def cat(self, x: List[Tensor], dim: int = 0) -> Tensor: + r = ops.quantized.cat(x, scale=self.scale, zero_point=self.zero_point, dim=dim) + r = self.activation_post_process(r) + return r + + r"""Operation equivalent to ``torch.ops.quantized.add_relu``""" + def add_relu(self, x: Tensor, y: Tensor) -> Tensor: + r = ops.quantized.add_relu(x, y, scale=self.scale, zero_point=self.zero_point) + r = self.activation_post_process(r) + return r + + r"""Operation equivalent to ``torch.ops.quantized.matmul(Tensor, Tensor)``""" + def matmul(self, x: Tensor, y: Tensor) -> Tensor: + r = ops.quantized.matmul(x, y, scale=self.scale, zero_point=self.zero_point) + # Note: this operation is not observed because the observation is not + # needed for the quantized op. + return r + + @classmethod + def from_float(cls, mod): + assert type(mod) == FloatFunctional, \ + "QFunctional.from_float expects an instance of FloatFunctional" + scale, zero_point = mod.activation_post_process.calculate_qparams() # type: ignore[operator] + new_mod = QFunctional() + new_mod.scale = float(scale) + new_mod.zero_point = int(zero_point) + return new_mod diff --git a/shared/package-files/08/08ff644bca4315de17c8941d808941a77a53217f66343d4bbe1f39adee080bcc/blob b/shared/package-files/08/08ff644bca4315de17c8941d808941a77a53217f66343d4bbe1f39adee080bcc/blob new file mode 100644 index 0000000000000000000000000000000000000000..ecd2136f5d20ba126bd359977ea17f76c4fe23ed --- /dev/null +++ b/shared/package-files/08/08ff644bca4315de17c8941d808941a77a53217f66343d4bbe1f39adee080bcc/blob @@ -0,0 +1,371 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include // IWYU pragma: keep +#include +#include +#include +#include +#include + +#include "arrow/array/array_base.h" +#include "arrow/array/array_primitive.h" +#include "arrow/buffer.h" +#include "arrow/buffer_builder.h" +#include "arrow/result.h" +#include "arrow/status.h" +#include "arrow/type_fwd.h" +#include "arrow/util/macros.h" +#include "arrow/util/visibility.h" + +namespace arrow { + +namespace internal { + +template +class ArrayBuilderExtraOps { + public: + /// \brief Append a value from an optional or null if it has no value. + Status AppendOrNull(const std::optional& value) { + auto* self = static_cast(this); + return value.has_value() ? self->Append(*value) : self->AppendNull(); + } + + /// \brief Append a value from an optional or null if it has no value. + /// + /// Unsafe methods don't check existing size. + void UnsafeAppendOrNull(const std::optional& value) { + auto* self = static_cast(this); + return value.has_value() ? self->UnsafeAppend(*value) : self->UnsafeAppendNull(); + } +}; + +} // namespace internal + +/// \defgroup numeric-builders Concrete builder subclasses for numeric types +/// @{ +/// @} + +/// \defgroup temporal-builders Concrete builder subclasses for temporal types +/// @{ +/// @} + +/// \defgroup binary-builders Concrete builder subclasses for binary types +/// @{ +/// @} + +/// \defgroup nested-builders Concrete builder subclasses for nested types +/// @{ +/// @} + +/// \defgroup dictionary-builders Concrete builder subclasses for dictionary types +/// @{ +/// @} + +/// \defgroup run-end-encoded-builders Concrete builder subclasses for run-end encoded +/// arrays +/// @{ +/// @} + +constexpr int64_t kMinBuilderCapacity = 1 << 5; +constexpr int64_t kListMaximumElements = std::numeric_limits::max() - 1; + +/// Base class for all data array builders. +/// +/// This class provides a facilities for incrementally building the null bitmap +/// (see Append methods) and as a side effect the current number of slots and +/// the null count. +/// +/// \note Users are expected to use builders as one of the concrete types below. +/// For example, ArrayBuilder* pointing to BinaryBuilder should be downcast before use. +class ARROW_EXPORT ArrayBuilder { + public: + explicit ArrayBuilder(MemoryPool* pool, int64_t alignment = kDefaultBufferAlignment) + : pool_(pool), alignment_(alignment), null_bitmap_builder_(pool, alignment) {} + + ARROW_DEFAULT_MOVE_AND_ASSIGN(ArrayBuilder); + + virtual ~ArrayBuilder() = default; + + /// For nested types. Since the objects are owned by this class instance, we + /// skip shared pointers and just return a raw pointer + ArrayBuilder* child(int i) { return children_[i].get(); } + + const std::shared_ptr& child_builder(int i) const { return children_[i]; } + + int num_children() const { return static_cast(children_.size()); } + + virtual int64_t length() const { return length_; } + int64_t null_count() const { return null_count_; } + int64_t capacity() const { return capacity_; } + + /// \brief Ensure that enough memory has been allocated to fit the indicated + /// number of total elements in the builder, including any that have already + /// been appended. Does not account for reallocations that may be due to + /// variable size data, like binary values. To make space for incremental + /// appends, use Reserve instead. + /// + /// \param[in] capacity the minimum number of total array values to + /// accommodate. Must be greater than the current capacity. + /// \return Status + virtual Status Resize(int64_t capacity); + + /// \brief Ensure that there is enough space allocated to append the indicated + /// number of elements without any further reallocation. Overallocation is + /// used in order to minimize the impact of incremental Reserve() calls. + /// Note that additional_capacity is relative to the current number of elements + /// rather than to the current capacity, so calls to Reserve() which are not + /// interspersed with addition of new elements may not increase the capacity. + /// + /// \param[in] additional_capacity the number of additional array values + /// \return Status + Status Reserve(int64_t additional_capacity) { + auto current_capacity = capacity(); + auto min_capacity = length() + additional_capacity; + if (min_capacity <= current_capacity) return Status::OK(); + + // leave growth factor up to BufferBuilder + auto new_capacity = BufferBuilder::GrowByFactor(current_capacity, min_capacity); + return Resize(new_capacity); + } + + /// Reset the builder. + virtual void Reset(); + + /// \brief Append a null value to builder + virtual Status AppendNull() = 0; + /// \brief Append a number of null values to builder + virtual Status AppendNulls(int64_t length) = 0; + + /// \brief Append a non-null value to builder + /// + /// The appended value is an implementation detail, but the corresponding + /// memory slot is guaranteed to be initialized. + /// This method is useful when appending a null value to a parent nested type. + virtual Status AppendEmptyValue() = 0; + + /// \brief Append a number of non-null values to builder + /// + /// The appended values are an implementation detail, but the corresponding + /// memory slot is guaranteed to be initialized. + /// This method is useful when appending null values to a parent nested type. + virtual Status AppendEmptyValues(int64_t length) = 0; + + /// \brief Append a value from a scalar + Status AppendScalar(const Scalar& scalar) { return AppendScalar(scalar, 1); } + virtual Status AppendScalar(const Scalar& scalar, int64_t n_repeats); + virtual Status AppendScalars(const ScalarVector& scalars); + + /// \brief Append a range of values from an array. + /// + /// The given array must be the same type as the builder. + virtual Status AppendArraySlice(const ArraySpan& ARROW_ARG_UNUSED(array), + int64_t ARROW_ARG_UNUSED(offset), + int64_t ARROW_ARG_UNUSED(length)) { + return Status::NotImplemented("AppendArraySlice for builder for ", *type()); + } + + /// \brief Return result of builder as an internal generic ArrayData + /// object. Resets builder except for dictionary builder + /// + /// \param[out] out the finalized ArrayData object + /// \return Status + virtual Status FinishInternal(std::shared_ptr* out) = 0; + + /// \brief Return result of builder as an Array object. + /// + /// The builder is reset except for DictionaryBuilder. + /// + /// \param[out] out the finalized Array object + /// \return Status + Status Finish(std::shared_ptr* out); + + /// \brief Return result of builder as an Array object. + /// + /// The builder is reset except for DictionaryBuilder. + /// + /// \return The finalized Array object + Result> Finish(); + + /// \brief Return the type of the built Array + virtual std::shared_ptr type() const = 0; + + protected: + /// Append to null bitmap + Status AppendToBitmap(bool is_valid); + + /// Vector append. Treat each zero byte as a null. If valid_bytes is null + /// assume all of length bits are valid. + Status AppendToBitmap(const uint8_t* valid_bytes, int64_t length); + + /// Uniform append. Append N times the same validity bit. + Status AppendToBitmap(int64_t num_bits, bool value); + + /// Set the next length bits to not null (i.e. valid). + Status SetNotNull(int64_t length); + + // Unsafe operations (don't check capacity/don't resize) + + void UnsafeAppendNull() { UnsafeAppendToBitmap(false); } + + // Append to null bitmap, update the length + void UnsafeAppendToBitmap(bool is_valid) { + null_bitmap_builder_.UnsafeAppend(is_valid); + ++length_; + if (!is_valid) ++null_count_; + } + + // Vector append. Treat each zero byte as a nullzero. If valid_bytes is null + // assume all of length bits are valid. + void UnsafeAppendToBitmap(const uint8_t* valid_bytes, int64_t length) { + if (valid_bytes == NULLPTR) { + return UnsafeSetNotNull(length); + } + null_bitmap_builder_.UnsafeAppend(valid_bytes, length); + length_ += length; + null_count_ = null_bitmap_builder_.false_count(); + } + + // Vector append. Copy from a given bitmap. If bitmap is null assume + // all of length bits are valid. + void UnsafeAppendToBitmap(const uint8_t* bitmap, int64_t offset, int64_t length) { + if (bitmap == NULLPTR) { + return UnsafeSetNotNull(length); + } + null_bitmap_builder_.UnsafeAppend(bitmap, offset, length); + length_ += length; + null_count_ = null_bitmap_builder_.false_count(); + } + + // Append the same validity value a given number of times. + void UnsafeAppendToBitmap(const int64_t num_bits, bool value) { + if (value) { + UnsafeSetNotNull(num_bits); + } else { + UnsafeSetNull(num_bits); + } + } + + void UnsafeAppendToBitmap(const std::vector& is_valid); + + // Set the next validity bits to not null (i.e. valid). + void UnsafeSetNotNull(int64_t length); + + // Set the next validity bits to null (i.e. invalid). + void UnsafeSetNull(int64_t length); + + static Status TrimBuffer(const int64_t bytes_filled, ResizableBuffer* buffer); + + /// \brief Finish to an array of the specified ArrayType + template + Status FinishTyped(std::shared_ptr* out) { + std::shared_ptr out_untyped; + ARROW_RETURN_NOT_OK(Finish(&out_untyped)); + *out = std::static_pointer_cast(std::move(out_untyped)); + return Status::OK(); + } + + // Check the requested capacity for validity + Status CheckCapacity(int64_t new_capacity) { + if (ARROW_PREDICT_FALSE(new_capacity < 0)) { + return Status::Invalid( + "Resize capacity must be positive (requested: ", new_capacity, ")"); + } + + if (ARROW_PREDICT_FALSE(new_capacity < length_)) { + return Status::Invalid("Resize cannot downsize (requested: ", new_capacity, + ", current length: ", length_, ")"); + } + + return Status::OK(); + } + + // Check for array type + Status CheckArrayType(const std::shared_ptr& expected_type, + const Array& array, const char* message); + Status CheckArrayType(Type::type expected_type, const Array& array, + const char* message); + + MemoryPool* pool_; + int64_t alignment_; + + TypedBufferBuilder null_bitmap_builder_; + int64_t null_count_ = 0; + + // Array length, so far. Also, the index of the next element to be added + int64_t length_ = 0; + int64_t capacity_ = 0; + + // Child value array builders. These are owned by this class + std::vector> children_; + + private: + ARROW_DISALLOW_COPY_AND_ASSIGN(ArrayBuilder); +}; + +/// \brief Construct an empty ArrayBuilder corresponding to the data +/// type +/// \param[in] pool the MemoryPool to use for allocations +/// \param[in] type the data type to create the builder for +/// \param[out] out the created ArrayBuilder +ARROW_EXPORT +Status MakeBuilder(MemoryPool* pool, const std::shared_ptr& type, + std::unique_ptr* out); + +inline Result> MakeBuilder( + const std::shared_ptr& type, MemoryPool* pool = default_memory_pool()) { + std::unique_ptr out; + ARROW_RETURN_NOT_OK(MakeBuilder(pool, type, &out)); + return out; +} + +/// \brief Construct an empty ArrayBuilder corresponding to the data +/// type, where any top-level or nested dictionary builders return the +/// exact index type specified by the type. +ARROW_EXPORT +Status MakeBuilderExactIndex(MemoryPool* pool, const std::shared_ptr& type, + std::unique_ptr* out); + +inline Result> MakeBuilderExactIndex( + const std::shared_ptr& type, MemoryPool* pool = default_memory_pool()) { + std::unique_ptr out; + ARROW_RETURN_NOT_OK(MakeBuilderExactIndex(pool, type, &out)); + return out; +} + +/// \brief Construct an empty DictionaryBuilder initialized optionally +/// with a preexisting dictionary +/// \param[in] pool the MemoryPool to use for allocations +/// \param[in] type the dictionary type to create the builder for +/// \param[in] dictionary the initial dictionary, if any. May be nullptr +/// \param[out] out the created ArrayBuilder +ARROW_EXPORT +Status MakeDictionaryBuilder(MemoryPool* pool, const std::shared_ptr& type, + const std::shared_ptr& dictionary, + std::unique_ptr* out); + +inline Result> MakeDictionaryBuilder( + const std::shared_ptr& type, const std::shared_ptr& dictionary, + MemoryPool* pool = default_memory_pool()) { + std::unique_ptr out; + ARROW_RETURN_NOT_OK(MakeDictionaryBuilder(pool, type, dictionary, &out)); + return out; +} + +} // namespace arrow diff --git a/shared/package-files/09/09010af0a34857fa30ad9b982d0e2b7b0e6d2898bab34351a631fbe333c4581b/blob b/shared/package-files/09/09010af0a34857fa30ad9b982d0e2b7b0e6d2898bab34351a631fbe333c4581b/blob new file mode 100644 index 0000000000000000000000000000000000000000..909513d306c688a5ef379f855b4eb9bffda324d7 Binary files /dev/null and b/shared/package-files/09/09010af0a34857fa30ad9b982d0e2b7b0e6d2898bab34351a631fbe333c4581b/blob differ diff --git a/shared/package-files/09/0901dec6b93a3968959fe44a4ffaaaf70f5609937e687b180b606a2b1452783f/blob b/shared/package-files/09/0901dec6b93a3968959fe44a4ffaaaf70f5609937e687b180b606a2b1452783f/blob new file mode 100644 index 0000000000000000000000000000000000000000..c6dffde40933020dfc25d331b11df5a3e9e53962 --- /dev/null +++ b/shared/package-files/09/0901dec6b93a3968959fe44a4ffaaaf70f5609937e687b180b606a2b1452783f/blob @@ -0,0 +1,843 @@ +"""Generators for some classic graphs. + +The typical graph builder function is called as follows: + +>>> G = nx.complete_graph(100) + +returning the complete graph on n nodes labeled 0, .., 99 +as a simple graph. Except for `empty_graph`, all the functions +in this module return a Graph class (i.e. a simple, undirected graph). + +""" + +import itertools +import numbers + +import networkx as nx +from networkx.classes import Graph +from networkx.exception import NetworkXError +from networkx.utils import nodes_or_number, pairwise + +__all__ = [ + "balanced_tree", + "barbell_graph", + "binomial_tree", + "complete_graph", + "complete_multipartite_graph", + "circular_ladder_graph", + "circulant_graph", + "cycle_graph", + "dorogovtsev_goltsev_mendes_graph", + "empty_graph", + "full_rary_tree", + "ladder_graph", + "lollipop_graph", + "null_graph", + "path_graph", + "star_graph", + "trivial_graph", + "turan_graph", + "wheel_graph", +] + + +# ------------------------------------------------------------------- +# Some Classic Graphs +# ------------------------------------------------------------------- + + +def _tree_edges(n, r): + if n == 0: + return + # helper function for trees + # yields edges in rooted tree at 0 with n nodes and branching ratio r + nodes = iter(range(n)) + parents = [next(nodes)] # stack of max length r + while parents: + source = parents.pop(0) + for i in range(r): + try: + target = next(nodes) + parents.append(target) + yield source, target + except StopIteration: + break + + +def full_rary_tree(r, n, create_using=None): + """Creates a full r-ary tree of `n` nodes. + + Sometimes called a k-ary, n-ary, or m-ary tree. + "... all non-leaf nodes have exactly r children and all levels + are full except for some rightmost position of the bottom level + (if a leaf at the bottom level is missing, then so are all of the + leaves to its right." [1]_ + + Parameters + ---------- + r : int + branching factor of the tree + n : int + Number of nodes in the tree + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + Returns + ------- + G : networkx Graph + An r-ary tree with n nodes + + References + ---------- + .. [1] An introduction to data structures and algorithms, + James Andrew Storer, Birkhauser Boston 2001, (page 225). + """ + G = empty_graph(n, create_using) + G.add_edges_from(_tree_edges(n, r)) + return G + + +def balanced_tree(r, h, create_using=None): + """Returns the perfectly balanced `r`-ary tree of height `h`. + + Parameters + ---------- + r : int + Branching factor of the tree; each node will have `r` + children. + + h : int + Height of the tree. + + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + Returns + ------- + G : NetworkX graph + A balanced `r`-ary tree of height `h`. + + Notes + ----- + This is the rooted tree where all leaves are at distance `h` from + the root. The root has degree `r` and all other internal nodes + have degree `r + 1`. + + Node labels are integers, starting from zero. + + A balanced tree is also known as a *complete r-ary tree*. + + """ + # The number of nodes in the balanced tree is `1 + r + ... + r^h`, + # which is computed by using the closed-form formula for a geometric + # sum with ratio `r`. In the special case that `r` is 1, the number + # of nodes is simply `h + 1` (since the tree is actually a path + # graph). + if r == 1: + n = h + 1 + else: + # This must be an integer if both `r` and `h` are integers. If + # they are not, we force integer division anyway. + n = (1 - r ** (h + 1)) // (1 - r) + return full_rary_tree(r, n, create_using=create_using) + + +def barbell_graph(m1, m2, create_using=None): + """Returns the Barbell Graph: two complete graphs connected by a path. + + Parameters + ---------- + m1 : int + Size of the left and right barbells, must be greater than 2. + + m2 : int + Length of the path connecting the barbells. + + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + Only undirected Graphs are supported. + + Returns + ------- + G : NetworkX graph + A barbell graph. + + Notes + ----- + + + Two identical complete graphs $K_{m1}$ form the left and right bells, + and are connected by a path $P_{m2}$. + + The `2*m1+m2` nodes are numbered + `0, ..., m1-1` for the left barbell, + `m1, ..., m1+m2-1` for the path, + and `m1+m2, ..., 2*m1+m2-1` for the right barbell. + + The 3 subgraphs are joined via the edges `(m1-1, m1)` and + `(m1+m2-1, m1+m2)`. If `m2=0`, this is merely two complete + graphs joined together. + + This graph is an extremal example in David Aldous + and Jim Fill's e-text on Random Walks on Graphs. + + """ + if m1 < 2: + raise NetworkXError("Invalid graph description, m1 should be >=2") + if m2 < 0: + raise NetworkXError("Invalid graph description, m2 should be >=0") + + # left barbell + G = complete_graph(m1, create_using) + if G.is_directed(): + raise NetworkXError("Directed Graph not supported") + + # connecting path + G.add_nodes_from(range(m1, m1 + m2 - 1)) + if m2 > 1: + G.add_edges_from(pairwise(range(m1, m1 + m2))) + + # right barbell + G.add_edges_from( + (u, v) for u in range(m1 + m2, 2 * m1 + m2) for v in range(u + 1, 2 * m1 + m2) + ) + + # connect it up + G.add_edge(m1 - 1, m1) + if m2 > 0: + G.add_edge(m1 + m2 - 1, m1 + m2) + + return G + + +def binomial_tree(n, create_using=None): + """Returns the Binomial Tree of order n. + + The binomial tree of order 0 consists of a single node. A binomial tree of order k + is defined recursively by linking two binomial trees of order k-1: the root of one is + the leftmost child of the root of the other. + + Parameters + ---------- + n : int + Order of the binomial tree. + + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + Returns + ------- + G : NetworkX graph + A binomial tree of $2^n$ nodes and $2^n - 1$ edges. + + """ + G = nx.empty_graph(1, create_using) + + N = 1 + for i in range(n): + # Use G.edges() to ensure 2-tuples. G.edges is 3-tuple for MultiGraph + edges = [(u + N, v + N) for (u, v) in G.edges()] + G.add_edges_from(edges) + G.add_edge(0, N) + N *= 2 + return G + + +@nodes_or_number(0) +def complete_graph(n, create_using=None): + """Return the complete graph `K_n` with n nodes. + + A complete graph on `n` nodes means that all pairs + of distinct nodes have an edge connecting them. + + Parameters + ---------- + n : int or iterable container of nodes + If n is an integer, nodes are from range(n). + If n is a container of nodes, those nodes appear in the graph. + Warning: n is not checked for duplicates and if present the + resulting graph may not be as desired. Make sure you have no duplicates. + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + Examples + -------- + >>> G = nx.complete_graph(9) + >>> len(G) + 9 + >>> G.size() + 36 + >>> G = nx.complete_graph(range(11, 14)) + >>> list(G.nodes()) + [11, 12, 13] + >>> G = nx.complete_graph(4, nx.DiGraph()) + >>> G.is_directed() + True + + """ + _, nodes = n + G = empty_graph(nodes, create_using) + if len(nodes) > 1: + if G.is_directed(): + edges = itertools.permutations(nodes, 2) + else: + edges = itertools.combinations(nodes, 2) + G.add_edges_from(edges) + return G + + +def circular_ladder_graph(n, create_using=None): + """Returns the circular ladder graph $CL_n$ of length n. + + $CL_n$ consists of two concentric n-cycles in which + each of the n pairs of concentric nodes are joined by an edge. + + Node labels are the integers 0 to n-1 + + """ + G = ladder_graph(n, create_using) + G.add_edge(0, n - 1) + G.add_edge(n, 2 * n - 1) + return G + + +def circulant_graph(n, offsets, create_using=None): + r"""Returns the circulant graph $Ci_n(x_1, x_2, ..., x_m)$ with $n$ nodes. + + The circulant graph $Ci_n(x_1, ..., x_m)$ consists of $n$ nodes $0, ..., n-1$ + such that node $i$ is connected to nodes $(i + x) \mod n$ and $(i - x) \mod n$ + for all $x$ in $x_1, ..., x_m$. Thus $Ci_n(1)$ is a cycle graph. + + Parameters + ---------- + n : integer + The number of nodes in the graph. + offsets : list of integers + A list of node offsets, $x_1$ up to $x_m$, as described above. + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + Returns + ------- + NetworkX Graph of type create_using + + Examples + -------- + Many well-known graph families are subfamilies of the circulant graphs; + for example, to create the cycle graph on n points, we connect every + node to nodes on either side (with offset plus or minus one). For n = 10, + + >>> G = nx.circulant_graph(10, [1]) + >>> edges = [ + ... (0, 9), + ... (0, 1), + ... (1, 2), + ... (2, 3), + ... (3, 4), + ... (4, 5), + ... (5, 6), + ... (6, 7), + ... (7, 8), + ... (8, 9), + ... ] + ... + >>> sorted(edges) == sorted(G.edges()) + True + + Similarly, we can create the complete graph + on 5 points with the set of offsets [1, 2]: + + >>> G = nx.circulant_graph(5, [1, 2]) + >>> edges = [ + ... (0, 1), + ... (0, 2), + ... (0, 3), + ... (0, 4), + ... (1, 2), + ... (1, 3), + ... (1, 4), + ... (2, 3), + ... (2, 4), + ... (3, 4), + ... ] + ... + >>> sorted(edges) == sorted(G.edges()) + True + + """ + G = empty_graph(n, create_using) + for i in range(n): + for j in offsets: + G.add_edge(i, (i - j) % n) + G.add_edge(i, (i + j) % n) + return G + + +@nodes_or_number(0) +def cycle_graph(n, create_using=None): + """Returns the cycle graph $C_n$ of cyclically connected nodes. + + $C_n$ is a path with its two end-nodes connected. + + Parameters + ---------- + n : int or iterable container of nodes + If n is an integer, nodes are from `range(n)`. + If n is a container of nodes, those nodes appear in the graph. + Warning: n is not checked for duplicates and if present the + resulting graph may not be as desired. Make sure you have no duplicates. + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + Notes + ----- + If create_using is directed, the direction is in increasing order. + + """ + _, nodes = n + G = empty_graph(nodes, create_using) + G.add_edges_from(pairwise(nodes, cyclic=True)) + return G + + +def dorogovtsev_goltsev_mendes_graph(n, create_using=None): + """Returns the hierarchically constructed Dorogovtsev-Goltsev-Mendes graph. + + The Dorogovtsev-Goltsev-Mendes [1]_ procedure produces a scale-free graph + deterministically with the following properties for a given `n`: + - Total number of nodes = ``3 * (3**n + 1) / 2`` + - Total number of edges = ``3 ** (n + 1)`` + + Parameters + ---------- + n : integer + The generation number. + + create_using : NetworkX Graph, optional + Graph type to be returned. Directed graphs and multi graphs are not + supported. + + Returns + ------- + G : NetworkX Graph + + Examples + -------- + >>> G = nx.dorogovtsev_goltsev_mendes_graph(3) + >>> G.number_of_nodes() + 15 + >>> G.number_of_edges() + 27 + >>> nx.is_planar(G) + True + + References + ---------- + .. [1] Dorogotsev S.N., Goltsev A.V., and Mendes J.F.F "Pseudofractal + Scale-free Web". arXiv:cond-mat/0112143 + """ + G = empty_graph(0, create_using) + if G.is_directed(): + raise NetworkXError("Directed Graph not supported") + if G.is_multigraph(): + raise NetworkXError("Multigraph not supported") + + G.add_edge(0, 1) + if n == 0: + return G + new_node = 2 # next node to be added + for i in range(1, n + 1): # iterate over number of generations. + last_generation_edges = list(G.edges()) + number_of_edges_in_last_generation = len(last_generation_edges) + for j in range(0, number_of_edges_in_last_generation): + G.add_edge(new_node, last_generation_edges[j][0]) + G.add_edge(new_node, last_generation_edges[j][1]) + new_node += 1 + return G + + +@nodes_or_number(0) +def empty_graph(n=0, create_using=None, default=Graph): + """Returns the empty graph with n nodes and zero edges. + + Parameters + ---------- + n : int or iterable container of nodes (default = 0) + If n is an integer, nodes are from `range(n)`. + If n is a container of nodes, those nodes appear in the graph. + create_using : Graph Instance, Constructor or None + Indicator of type of graph to return. + If a Graph-type instance, then clear and use it. + If None, use the `default` constructor. + If a constructor, call it to create an empty graph. + default : Graph constructor (optional, default = nx.Graph) + The constructor to use if create_using is None. + If None, then nx.Graph is used. + This is used when passing an unknown `create_using` value + through your home-grown function to `empty_graph` and + you want a default constructor other than nx.Graph. + + Examples + -------- + >>> G = nx.empty_graph(10) + >>> G.number_of_nodes() + 10 + >>> G.number_of_edges() + 0 + >>> G = nx.empty_graph("ABC") + >>> G.number_of_nodes() + 3 + >>> sorted(G) + ['A', 'B', 'C'] + + Notes + ----- + The variable create_using should be a Graph Constructor or a + "graph"-like object. Constructors, e.g. `nx.Graph` or `nx.MultiGraph` + will be used to create the returned graph. "graph"-like objects + will be cleared (nodes and edges will be removed) and refitted as + an empty "graph" with nodes specified in n. This capability + is useful for specifying the class-nature of the resulting empty + "graph" (i.e. Graph, DiGraph, MyWeirdGraphClass, etc.). + + The variable create_using has three main uses: + Firstly, the variable create_using can be used to create an + empty digraph, multigraph, etc. For example, + + >>> n = 10 + >>> G = nx.empty_graph(n, create_using=nx.DiGraph) + + will create an empty digraph on n nodes. + + Secondly, one can pass an existing graph (digraph, multigraph, + etc.) via create_using. For example, if G is an existing graph + (resp. digraph, multigraph, etc.), then empty_graph(n, create_using=G) + will empty G (i.e. delete all nodes and edges using G.clear()) + and then add n nodes and zero edges, and return the modified graph. + + Thirdly, when constructing your home-grown graph creation function + you can use empty_graph to construct the graph by passing a user + defined create_using to empty_graph. In this case, if you want the + default constructor to be other than nx.Graph, specify `default`. + + >>> def mygraph(n, create_using=None): + ... G = nx.empty_graph(n, create_using, nx.MultiGraph) + ... G.add_edges_from([(0, 1), (0, 1)]) + ... return G + >>> G = mygraph(3) + >>> G.is_multigraph() + True + >>> G = mygraph(3, nx.Graph) + >>> G.is_multigraph() + False + + See also create_empty_copy(G). + + """ + if create_using is None: + G = default() + elif isinstance(create_using, type): + G = create_using() + elif not hasattr(create_using, "adj"): + raise TypeError("create_using is not a valid NetworkX graph type or instance") + else: + # create_using is a NetworkX style Graph + create_using.clear() + G = create_using + + _, nodes = n + G.add_nodes_from(nodes) + return G + + +def ladder_graph(n, create_using=None): + """Returns the Ladder graph of length n. + + This is two paths of n nodes, with + each pair connected by a single edge. + + Node labels are the integers 0 to 2*n - 1. + + """ + G = empty_graph(2 * n, create_using) + if G.is_directed(): + raise NetworkXError("Directed Graph not supported") + G.add_edges_from(pairwise(range(n))) + G.add_edges_from(pairwise(range(n, 2 * n))) + G.add_edges_from((v, v + n) for v in range(n)) + return G + + +@nodes_or_number([0, 1]) +def lollipop_graph(m, n, create_using=None): + """Returns the Lollipop Graph; `K_m` connected to `P_n`. + + This is the Barbell Graph without the right barbell. + + Parameters + ---------- + m, n : int or iterable container of nodes (default = 0) + If an integer, nodes are from `range(m)` and `range(m,m+n)`. + If a container of nodes, those nodes appear in the graph. + Warning: m and n are not checked for duplicates and if present the + resulting graph may not be as desired. Make sure you have no duplicates. + + The nodes for m appear in the complete graph $K_m$ and the nodes + for n appear in the path $P_n$ + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + Notes + ----- + The 2 subgraphs are joined via an edge (m-1, m). + If n=0, this is merely a complete graph. + + (This graph is an extremal example in David Aldous and Jim + Fill's etext on Random Walks on Graphs.) + + """ + m, m_nodes = m + M = len(m_nodes) + if M < 2: + raise NetworkXError("Invalid description: m should indicate at least 2 nodes") + + n, n_nodes = n + if isinstance(m, numbers.Integral) and isinstance(n, numbers.Integral): + n_nodes = list(range(M, M + n)) + N = len(n_nodes) + + # the ball + G = complete_graph(m_nodes, create_using) + if G.is_directed(): + raise NetworkXError("Directed Graph not supported") + + # the stick + G.add_nodes_from(n_nodes) + if N > 1: + G.add_edges_from(pairwise(n_nodes)) + + if len(G) != M + N: + raise NetworkXError("Nodes must be distinct in containers m and n") + + # connect ball to stick + if M > 0 and N > 0: + G.add_edge(m_nodes[-1], n_nodes[0]) + return G + + +def null_graph(create_using=None): + """Returns the Null graph with no nodes or edges. + + See empty_graph for the use of create_using. + + """ + G = empty_graph(0, create_using) + return G + + +@nodes_or_number(0) +def path_graph(n, create_using=None): + """Returns the Path graph `P_n` of linearly connected nodes. + + Parameters + ---------- + n : int or iterable + If an integer, nodes are 0 to n - 1. + If an iterable of nodes, in the order they appear in the path. + Warning: n is not checked for duplicates and if present the + resulting graph may not be as desired. Make sure you have no duplicates. + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + """ + _, nodes = n + G = empty_graph(nodes, create_using) + G.add_edges_from(pairwise(nodes)) + return G + + +@nodes_or_number(0) +def star_graph(n, create_using=None): + """Return the star graph + + The star graph consists of one center node connected to n outer nodes. + + Parameters + ---------- + n : int or iterable + If an integer, node labels are 0 to n with center 0. + If an iterable of nodes, the center is the first. + Warning: n is not checked for duplicates and if present the + resulting graph may not be as desired. Make sure you have no duplicates. + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + Notes + ----- + The graph has n+1 nodes for integer n. + So star_graph(3) is the same as star_graph(range(4)). + """ + n, nodes = n + if isinstance(n, numbers.Integral): + nodes.append(n) # there should be n+1 nodes + G = empty_graph(nodes, create_using) + if G.is_directed(): + raise NetworkXError("Directed Graph not supported") + + if len(nodes) > 1: + hub, *spokes = nodes + G.add_edges_from((hub, node) for node in spokes) + return G + + +def trivial_graph(create_using=None): + """Return the Trivial graph with one node (with label 0) and no edges.""" + G = empty_graph(1, create_using) + return G + + +def turan_graph(n, r): + r"""Return the Turan Graph + + The Turan Graph is a complete multipartite graph on $n$ nodes + with $r$ disjoint subsets. That is, edges connect each node to + every node not in its subset. + + Given $n$ and $r$, we create a complete multipartite graph with + $r-(n \mod r)$ partitions of size $n/r$, rounded down, and + $n \mod r$ partitions of size $n/r+1$, rounded down. + + Parameters + ---------- + n : int + The number of nodes. + r : int + The number of partitions. + Must be less than or equal to n. + + Notes + ----- + Must satisfy $1 <= r <= n$. + The graph has $(r-1)(n^2)/(2r)$ edges, rounded down. + """ + + if not 1 <= r <= n: + raise NetworkXError("Must satisfy 1 <= r <= n") + + partitions = [n // r] * (r - (n % r)) + [n // r + 1] * (n % r) + G = complete_multipartite_graph(*partitions) + return G + + +@nodes_or_number(0) +def wheel_graph(n, create_using=None): + """Return the wheel graph + + The wheel graph consists of a hub node connected to a cycle of (n-1) nodes. + + Parameters + ---------- + n : int or iterable + If an integer, node labels are 0 to n with center 0. + If an iterable of nodes, the center is the first. + Warning: n is not checked for duplicates and if present the + resulting graph may not be as desired. Make sure you have no duplicates. + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + Node labels are the integers 0 to n - 1. + """ + _, nodes = n + G = empty_graph(nodes, create_using) + if G.is_directed(): + raise NetworkXError("Directed Graph not supported") + + if len(nodes) > 1: + hub, *rim = nodes + G.add_edges_from((hub, node) for node in rim) + if len(rim) > 1: + G.add_edges_from(pairwise(rim, cyclic=True)) + return G + + +def complete_multipartite_graph(*subset_sizes): + """Returns the complete multipartite graph with the specified subset sizes. + + Parameters + ---------- + subset_sizes : tuple of integers or tuple of node iterables + The arguments can either all be integer number of nodes or they + can all be iterables of nodes. If integers, they represent the + number of nodes in each subset of the multipartite graph. + If iterables, each is used to create the nodes for that subset. + The length of subset_sizes is the number of subsets. + + Returns + ------- + G : NetworkX Graph + Returns the complete multipartite graph with the specified subsets. + + For each node, the node attribute 'subset' is an integer + indicating which subset contains the node. + + Examples + -------- + Creating a complete tripartite graph, with subsets of one, two, and three + nodes, respectively. + + >>> G = nx.complete_multipartite_graph(1, 2, 3) + >>> [G.nodes[u]["subset"] for u in G] + [0, 1, 1, 2, 2, 2] + >>> list(G.edges(0)) + [(0, 1), (0, 2), (0, 3), (0, 4), (0, 5)] + >>> list(G.edges(2)) + [(2, 0), (2, 3), (2, 4), (2, 5)] + >>> list(G.edges(4)) + [(4, 0), (4, 1), (4, 2)] + + >>> G = nx.complete_multipartite_graph("a", "bc", "def") + >>> [G.nodes[u]["subset"] for u in sorted(G)] + [0, 1, 1, 2, 2, 2] + + Notes + ----- + This function generalizes several other graph builder functions. + + - If no subset sizes are given, this returns the null graph. + - If a single subset size `n` is given, this returns the empty graph on + `n` nodes. + - If two subset sizes `m` and `n` are given, this returns the complete + bipartite graph on `m + n` nodes. + - If subset sizes `1` and `n` are given, this returns the star graph on + `n + 1` nodes. + + See also + -------- + complete_bipartite_graph + """ + # The complete multipartite graph is an undirected simple graph. + G = Graph() + + if len(subset_sizes) == 0: + return G + + # set up subsets of nodes + try: + extents = pairwise(itertools.accumulate((0,) + subset_sizes)) + subsets = [range(start, end) for start, end in extents] + except TypeError: + subsets = subset_sizes + + # add nodes with subset attribute + # while checking that ints are not mixed with iterables + try: + for i, subset in enumerate(subsets): + G.add_nodes_from(subset, subset=i) + except TypeError as err: + raise NetworkXError("Arguments must be all ints or all iterables") from err + + # Across subsets, all nodes should be adjacent. + # We can use itertools.combinations() because undirected. + for subset1, subset2 in itertools.combinations(subsets, 2): + G.add_edges_from(itertools.product(subset1, subset2)) + return G diff --git a/shared/package-files/09/09035620bd831697a3e9072f82de34cfca5e912d50c8da547739aa2f28fb6d8e/blob b/shared/package-files/09/09035620bd831697a3e9072f82de34cfca5e912d50c8da547739aa2f28fb6d8e/blob new file mode 100644 index 0000000000000000000000000000000000000000..6bc216823e007c8dbdd6a5e8402b2e0cc5eaf3fc Binary files /dev/null and b/shared/package-files/09/09035620bd831697a3e9072f82de34cfca5e912d50c8da547739aa2f28fb6d8e/blob differ diff --git a/shared/package-files/09/09052e30ef3321739d7a14a841069fd57269a690cdb4cf4743c76693ec998c85/blob b/shared/package-files/09/09052e30ef3321739d7a14a841069fd57269a690cdb4cf4743c76693ec998c85/blob new file mode 100644 index 0000000000000000000000000000000000000000..79be6ba3e2f32dc84ffbfa214fe7736e6a4c9ed7 --- /dev/null +++ b/shared/package-files/09/09052e30ef3321739d7a14a841069fd57269a690cdb4cf4743c76693ec998c85/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor linalg_solve_triangular(const at::Tensor & self, const at::Tensor & B, bool upper, bool left=true, bool unitriangular=false); +TORCH_API at::Tensor & linalg_solve_triangular_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & B, bool upper, bool left=true, bool unitriangular=false); +TORCH_API at::Tensor & linalg_solve_triangular_outf(const at::Tensor & self, const at::Tensor & B, bool upper, bool left, bool unitriangular, at::Tensor & out); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/09/090588299152a6451ee57ec0176ec4a95c19e25d19ab2725ddb758815663dc7b/blob b/shared/package-files/09/090588299152a6451ee57ec0176ec4a95c19e25d19ab2725ddb758815663dc7b/blob new file mode 100644 index 0000000000000000000000000000000000000000..2920097aa23927138aa0360f77b8068500c6cc09 --- /dev/null +++ b/shared/package-files/09/090588299152a6451ee57ec0176ec4a95c19e25d19ab2725ddb758815663dc7b/blob @@ -0,0 +1,50 @@ +from sympy.core.numbers import (I, pi) +from sympy.core.symbol import Symbol +from sympy.functions.elementary.exponential import exp +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.matrices.dense import Matrix + +from sympy.physics.quantum.qft import QFT, IQFT, RkGate +from sympy.physics.quantum.gate import (ZGate, SwapGate, HadamardGate, CGate, + PhaseGate, TGate) +from sympy.physics.quantum.qubit import Qubit +from sympy.physics.quantum.qapply import qapply +from sympy.physics.quantum.represent import represent + + +def test_RkGate(): + x = Symbol('x') + assert RkGate(1, x).k == x + assert RkGate(1, x).targets == (1,) + assert RkGate(1, 1) == ZGate(1) + assert RkGate(2, 2) == PhaseGate(2) + assert RkGate(3, 3) == TGate(3) + + assert represent( + RkGate(0, x), nqubits=1) == Matrix([[1, 0], [0, exp(2*I*pi/2**x)]]) + + +def test_quantum_fourier(): + assert QFT(0, 3).decompose() == \ + SwapGate(0, 2)*HadamardGate(0)*CGate((0,), PhaseGate(1)) * \ + HadamardGate(1)*CGate((0,), TGate(2))*CGate((1,), PhaseGate(2)) * \ + HadamardGate(2) + + assert IQFT(0, 3).decompose() == \ + HadamardGate(2)*CGate((1,), RkGate(2, -2))*CGate((0,), RkGate(2, -3)) * \ + HadamardGate(1)*CGate((0,), RkGate(1, -2))*HadamardGate(0)*SwapGate(0, 2) + + assert represent(QFT(0, 3), nqubits=3) == \ + Matrix([[exp(2*pi*I/8)**(i*j % 8)/sqrt(8) for i in range(8)] for j in range(8)]) + + assert QFT(0, 4).decompose() # non-trivial decomposition + assert qapply(QFT(0, 3).decompose()*Qubit(0, 0, 0)).expand() == qapply( + HadamardGate(0)*HadamardGate(1)*HadamardGate(2)*Qubit(0, 0, 0) + ).expand() + + +def test_qft_represent(): + c = QFT(0, 3) + a = represent(c, nqubits=3) + b = represent(c.decompose(), nqubits=3) + assert a.evalf(n=10) == b.evalf(n=10) diff --git a/shared/package-files/09/0906a3a9745218c604aeaca0c2961eb9fb7cc975c3477f490d344b80f4b6ae45/blob b/shared/package-files/09/0906a3a9745218c604aeaca0c2961eb9fb7cc975c3477f490d344b80f4b6ae45/blob new file mode 100644 index 0000000000000000000000000000000000000000..cb1ba86948312e48ff851f5acaf743229720d006 --- /dev/null +++ b/shared/package-files/09/0906a3a9745218c604aeaca0c2961eb9fb7cc975c3477f490d344b80f4b6ae45/blob @@ -0,0 +1,63 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +import tempfile +from os.path import basename + +try: + from boltons.setutils import IndexedSet +except ImportError: # pragma: no cover + from conda._vendor.boltons.setutils import IndexedSet + +from conda.base.constants import UpdateModifier +from conda.base.context import context +from conda.common.constants import NULL +from conda.exceptions import UnsatisfiableError +from conda.models.channel import Channel, prioritize_channels + +from ..env import Environment + + +def _solve(prefix, specs, args, env, *_, **kwargs): + # TODO: support all various ways this happens + # Including 'nodefaults' in the channels list disables the defaults + channel_urls = [chan for chan in env.channels if chan != "nodefaults"] + + if "nodefaults" not in env.channels: + channel_urls.extend(context.channels) + _channel_priority_map = prioritize_channels(channel_urls) + + channels = IndexedSet(Channel(url) for url in _channel_priority_map) + subdirs = IndexedSet(basename(url) for url in _channel_priority_map) + + solver_backend = context.plugin_manager.get_cached_solver_backend() + solver = solver_backend(prefix, channels, subdirs, specs_to_add=specs) + return solver + + +def dry_run(specs, args, env, *_, **kwargs): + solver = _solve(tempfile.mkdtemp(), specs, args, env, *_, **kwargs) + pkgs = solver.solve_final_state() + solved_env = Environment( + name=env.name, dependencies=[str(p) for p in pkgs], channels=env.channels + ) + return solved_env + + +def install(prefix, specs, args, env, *_, **kwargs): + solver = _solve(prefix, specs, args, env, *_, **kwargs) + + try: + unlink_link_transaction = solver.solve_for_transaction( + prune=getattr(args, "prune", False), + update_modifier=UpdateModifier.FREEZE_INSTALLED, + ) + except (UnsatisfiableError, SystemExit): + unlink_link_transaction = solver.solve_for_transaction( + prune=getattr(args, "prune", False), update_modifier=NULL + ) + + if unlink_link_transaction.nothing_to_do: + return None + unlink_link_transaction.download_and_extract() + unlink_link_transaction.execute() + return unlink_link_transaction._make_legacy_action_groups()[0] diff --git a/shared/package-files/09/09076b739d5ba8bc591bf49dfeedb748f708c5f7d0b6081fa75b12f0524b8a88/blob b/shared/package-files/09/09076b739d5ba8bc591bf49dfeedb748f708c5f7d0b6081fa75b12f0524b8a88/blob new file mode 100644 index 0000000000000000000000000000000000000000..90832482d6d7e460f668f43c8ec3642120324285 --- /dev/null +++ b/shared/package-files/09/09076b739d5ba8bc591bf49dfeedb748f708c5f7d0b6081fa75b12f0524b8a88/blob @@ -0,0 +1,121 @@ +from typing import Any + +from . import connection, exceptions, request, response +from .connection import BaseSSLError as BaseSSLError, ConnectionError as ConnectionError, HTTPException as HTTPException +from .packages import ssl_match_hostname +from .util import connection as _connection, retry, timeout, url + +ClosedPoolError = exceptions.ClosedPoolError +ProtocolError = exceptions.ProtocolError +EmptyPoolError = exceptions.EmptyPoolError +HostChangedError = exceptions.HostChangedError +LocationValueError = exceptions.LocationValueError +MaxRetryError = exceptions.MaxRetryError +ProxyError = exceptions.ProxyError +ReadTimeoutError = exceptions.ReadTimeoutError +SSLError = exceptions.SSLError +TimeoutError = exceptions.TimeoutError +InsecureRequestWarning = exceptions.InsecureRequestWarning +CertificateError = ssl_match_hostname.CertificateError +port_by_scheme = connection.port_by_scheme +DummyConnection = connection.DummyConnection +HTTPConnection = connection.HTTPConnection +HTTPSConnection = connection.HTTPSConnection +VerifiedHTTPSConnection = connection.VerifiedHTTPSConnection +RequestMethods = request.RequestMethods +HTTPResponse = response.HTTPResponse +is_connection_dropped = _connection.is_connection_dropped +Retry = retry.Retry +Timeout = timeout.Timeout +get_host = url.get_host + +xrange: Any +log: Any + +class ConnectionPool: + scheme: Any + QueueCls: Any + host: Any + port: Any + def __init__(self, host, port=...) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + def close(self): ... + +class HTTPConnectionPool(ConnectionPool, RequestMethods): + scheme: Any + ConnectionCls: Any + strict: Any + timeout: Any + retries: Any + pool: Any + block: Any + proxy: Any + proxy_headers: Any + num_connections: Any + num_requests: Any + conn_kw: Any + def __init__( + self, + host, + port=..., + strict=..., + timeout=..., + maxsize=..., + block=..., + headers=..., + retries=..., + _proxy=..., + _proxy_headers=..., + **conn_kw, + ) -> None: ... + def close(self): ... + def is_same_host(self, url): ... + def urlopen( + self, + method, + url, + body=..., + headers=..., + retries=..., + redirect=..., + assert_same_host=..., + timeout=..., + pool_timeout=..., + release_conn=..., + **response_kw, + ): ... + +class HTTPSConnectionPool(HTTPConnectionPool): + scheme: Any + ConnectionCls: Any + key_file: Any + cert_file: Any + cert_reqs: Any + ca_certs: Any + ssl_version: Any + assert_hostname: Any + assert_fingerprint: Any + def __init__( + self, + host, + port=..., + strict=..., + timeout=..., + maxsize=..., + block=..., + headers=..., + retries=..., + _proxy=..., + _proxy_headers=..., + key_file=..., + cert_file=..., + cert_reqs=..., + ca_certs=..., + ssl_version=..., + assert_hostname=..., + assert_fingerprint=..., + **conn_kw, + ) -> None: ... + +def connection_from_url(url, **kw): ... diff --git a/shared/package-files/09/090d80174870c9d7204c7c9c302162c99200539ed17194fe4d589dd7b488b15e/blob b/shared/package-files/09/090d80174870c9d7204c7c9c302162c99200539ed17194fe4d589dd7b488b15e/blob new file mode 100644 index 0000000000000000000000000000000000000000..bd3be5b3f8c42267c8a61421b7f0877a01b33d34 --- /dev/null +++ b/shared/package-files/09/090d80174870c9d7204c7c9c302162c99200539ed17194fe4d589dd7b488b15e/blob @@ -0,0 +1,2 @@ +__all__ = ["eval"] +from pandas.core.computation.eval import eval diff --git a/shared/package-files/09/090eed401f903d4c43e999db4b64b31558e3bc20fbf9c8a095ec6475b6e7ef2f/blob b/shared/package-files/09/090eed401f903d4c43e999db4b64b31558e3bc20fbf9c8a095ec6475b6e7ef2f/blob new file mode 100644 index 0000000000000000000000000000000000000000..ae889a7fdbc24935c0884e8bbcdf56bde8946460 --- /dev/null +++ b/shared/package-files/09/090eed401f903d4c43e999db4b64b31558e3bc20fbf9c8a095ec6475b6e7ef2f/blob @@ -0,0 +1,93 @@ +""" +Arithmetic operations for PandasObjects + +This is not a public API. +""" +from __future__ import annotations + +from pandas.core.ops.array_ops import ( + arithmetic_op, + comp_method_OBJECT_ARRAY, + comparison_op, + fill_binop, + get_array_op, + logical_op, + maybe_prepare_scalar_for_op, +) +from pandas.core.ops.common import ( + get_op_result_name, + unpack_zerodim_and_defer, +) +from pandas.core.ops.docstrings import make_flex_doc +from pandas.core.ops.invalid import invalid_comparison +from pandas.core.ops.mask_ops import ( + kleene_and, + kleene_or, + kleene_xor, +) +from pandas.core.roperator import ( + radd, + rand_, + rdiv, + rdivmod, + rfloordiv, + rmod, + rmul, + ror_, + rpow, + rsub, + rtruediv, + rxor, +) + +# ----------------------------------------------------------------------------- +# constants +ARITHMETIC_BINOPS: set[str] = { + "add", + "sub", + "mul", + "pow", + "mod", + "floordiv", + "truediv", + "divmod", + "radd", + "rsub", + "rmul", + "rpow", + "rmod", + "rfloordiv", + "rtruediv", + "rdivmod", +} + + +__all__ = [ + "ARITHMETIC_BINOPS", + "arithmetic_op", + "comparison_op", + "comp_method_OBJECT_ARRAY", + "invalid_comparison", + "fill_binop", + "kleene_and", + "kleene_or", + "kleene_xor", + "logical_op", + "make_flex_doc", + "radd", + "rand_", + "rdiv", + "rdivmod", + "rfloordiv", + "rmod", + "rmul", + "ror_", + "rpow", + "rsub", + "rtruediv", + "rxor", + "unpack_zerodim_and_defer", + "get_op_result_name", + "maybe_prepare_scalar_for_op", + "get_array_op", +] diff --git a/shared/package-files/09/09140d274234ec4174f608f106ff3673ad60b48731e4ed725a89937cd4443064/blob b/shared/package-files/09/09140d274234ec4174f608f106ff3673ad60b48731e4ed725a89937cd4443064/blob new file mode 100644 index 0000000000000000000000000000000000000000..9985d4feda0b1942d9b08b0e680f0b05789576bf --- /dev/null +++ b/shared/package-files/09/09140d274234ec4174f608f106ff3673ad60b48731e4ed725a89937cd4443064/blob @@ -0,0 +1,251 @@ +uhat1,uhat2,uhat3,uhat4,uhat5,uhat6 +-0.5970431276,1.9644571186,2.8581920718,0.3336822851,-0.9942852808,0.5009863795 +0.0182019932,1.7543008581,2.2466917128,-0.0864473659,1.7501015883,-0.2719219510 +-0.6646218029,0.7882000432,1.3123982015,0.0291953651,-0.0183595554,-0.5588249004 +0.3041627028,1.4260297117,0.4013891725,0.4387285760,-0.6767949950,1.2156408981 +0.3080415611,-2.3612568438,1.3562373892,-0.0887524571,-1.0478225880,0.2279833245 +1.1102135466,-1.3355179523,1.5175137957,-0.2914457219,0.6309651010,1.5542159924 +-0.3750674840,0.6209127991,-1.4835375273,-0.8144600730,-0.7455396506,1.1478549803 +1.4734230995,0.2255282580,-0.7050370159,-2.4979692592,0.4537075911,1.1200774711 +2.0278429631,-1.4427300171,0.5403961356,0.8407341818,0.3140312594,0.8195137122 +-1.6149655785,-0.8089418562,1.3815810688,1.7898138934,1.9679042023,-1.3005530082 +-0.2755977630,0.5980026905,-0.9373441467,0.3815041911,0.3111338100,-1.2695995777 +-0.2975061740,-0.8749236050,0.1779066520,-0.2361575413,-1.1993712521,-1.2018225425 +-1.2825402275,-0.3577104145,1.8995942610,-0.7619536359,1.9261527400,0.2549977510 +-0.1950117688,0.0276080679,-0.4127830466,0.5021540396,0.8049308784,-1.4079837702 +0.0456334419,1.6337230347,-0.2030765577,-0.4451751953,-1.0269237400,0.2297868253 +-0.7064283511,-1.5944080013,-1.8457576875,3.3972990909,-0.8113905379,0.4031928346 +0.6869022133,-0.7487949244,-0.7002970827,-1.6540012043,-0.6685116236,2.1558559783 +-0.9056012206,1.6537578452,-0.0935723229,-0.4177424962,-0.7827922088,-1.0965771746 +-1.4108673168,-0.1526657909,-2.0860459175,-1.4300339212,1.8205676286,-1.3963866243 +-0.5002273043,-0.3399087504,0.2027621991,-0.7811584356,-0.6081202834,-0.5198160208 +-0.1966401225,0.2754314830,2.1606703618,-1.0252276657,1.0305200452,-0.3663237829 +0.9423540691,0.7666956830,1.6216312394,2.7315920650,-0.5669633942,0.1294828415 +-0.5032111555,-0.2136098372,-0.9624645465,-0.5073518362,1.8529743435,1.0464812565 +-0.0706422357,-0.5624932357,0.6417029559,0.1106822327,-0.5648899797,0.2273004765 +0.1555984072,0.1319017330,0.8041912071,1.5043778592,-1.1362093293,-1.4625115106 +-0.6829072554,0.1231105864,-0.7463346850,-1.7556051868,0.0182871309,1.3242897728 +0.4836822472,-1.1677156970,0.9267983681,0.1541236776,-1.4995756981,0.3342838502 +-0.3077717297,0.1065021989,0.5663413950,3.2375541811,-0.4121988713,-0.3936978961 +0.1422450005,0.1446017784,-0.2280636153,-1.5670003785,-1.3965176381,1.1626849759 +-0.5988298111,-1.4965152782,0.5431332398,-1.8950082750,1.6699521931,1.2370800417 +2.8746976404,0.7580957785,-0.7339595217,-0.6008727472,0.2385596845,0.1014095588 +-2.6700228960,-1.2704087440,0.5840693867,0.7222886974,0.0040762785,-0.5102429766 +-0.2782115122,-3.3234438676,-1.7934650536,-1.3785523950,-0.4061594951,-0.8366553692 +-0.6967148976,-0.0363622973,-0.2611968674,0.3129215170,0.3129386265,-0.1726092824 +0.0402046937,0.8792427681,-0.5331476333,-1.0733083099,-0.8044108072,0.5838434960 +1.5180370949,0.2334318433,-1.3171921124,-0.4643530942,1.9215806538,-0.0058033158 +0.7563656945,-0.5134812446,-0.2559645287,0.2040444357,-0.6218164834,-1.0029930496 +-0.6249147390,1.9404407009,0.2665262803,0.5597759687,-1.1149901482,1.3367894108 +0.4744339282,-1.7097702633,-1.8645512156,-0.0736846579,-1.3252181044,0.5140586604 +0.9158104137,-0.9644630048,-1.4817564666,0.9846826489,0.6392910454,2.5267241117 +0.5364609746,-0.8141007853,0.3372000793,-0.3762203642,-0.2293680809,-2.6645523947 +-0.0734802478,-0.6220087695,1.4526685262,0.7493570727,0.4078787234,-2.6336935317 +0.0587578744,-0.8699847497,-0.5242355555,-0.4794854495,-0.4858072680,-0.7477007545 +-0.2407166951,-0.3203468407,-0.3689658970,-2.4165529703,1.1224721133,-0.9147506030 +0.0744741105,-1.0663502156,0.2018525004,0.1787101865,-0.7149062503,-1.1498034333 +0.2444709563,0.6730306720,0.2144755307,-0.2282144195,0.0350468684,-0.1805236338 +-0.2390260915,1.3909419529,-0.5007056884,-0.6534495825,-0.0847841237,-0.7985575032 +0.7188959090,-0.0421098279,-0.2721075638,-0.7473534301,0.8649118003,0.5212385523 +-0.5015783857,0.6049928771,0.4752398468,-0.5198150247,0.0035904764,-0.2662702383 +1.0197207272,-0.4937799065,-2.0519793793,-0.7458038747,0.9733469781,0.1493912332 +1.5174292591,1.5356995338,-0.7742674121,1.2218531030,-1.1312514329,-0.4464500577 +1.3483923243,2.1025617736,0.7357470171,1.0915233924,-2.1303056403,-1.5953693831 +0.4075515335,-0.4022549382,-1.4197719512,0.7209796745,0.4593709476,0.0341408612 +-0.7568619442,-0.4619157424,0.1930412082,0.3217207379,-0.8859414115,-0.4786778739 +0.5681134676,0.4010450399,1.3768139995,-0.2865830408,0.3113651021,-1.1179661508 +-0.0298286223,1.1353451283,0.8122675983,0.7421053835,-0.0951124157,0.3385079057 +-1.6231637691,1.1500085978,-0.1695253546,1.5749876901,-1.2967601255,0.8216667446 +1.3233252145,-0.2943328747,0.0824832495,0.5927644624,-1.0091359254,-0.0784046669 +1.6262580824,1.3479676090,-0.7688615769,0.5870165097,-1.4815829042,-1.5492257821 +0.6818028263,0.4563877043,-0.6063830759,-1.0050973742,-1.9011574220,0.5252749698 +-0.3297340633,-1.9878290183,0.1930280850,-0.7056995477,0.4035505567,0.8734846677 +0.8422795969,-0.0686086486,0.8450008200,-0.6150070433,0.2107718492,0.7923768106 +0.9455943990,0.0316159426,-2.1369601254,-0.0585718305,-1.2734388108,0.2291744885 +-2.1802948840,0.6068394707,-0.5245701971,-1.3260769199,-0.9834878791,-0.7072045861 +-1.7701348833,0.5367533137,-0.1957437854,0.5995379852,-0.6187486557,-1.5745844609 +-1.1176897355,-1.6526597428,0.2334153137,1.0604557797,0.9357929297,-0.3050253953 +0.4175794484,1.8303196766,0.8490840727,0.7817106891,0.7110343481,0.7133295932 +-0.1964943002,-0.4818922767,1.1130594091,0.6450738934,0.6575107120,0.3145902913 +-0.0514206178,0.8556366912,-1.3999812724,-0.2886114710,0.7920136166,0.6960829080 +-0.1901124543,1.4712387562,1.5363387733,-1.0025951076,-0.2843685223,0.9100409074 +0.8109179338,0.3238904846,0.6256522145,2.2061012187,-0.2739236756,-0.7457566458 +0.3913362496,-0.3413491593,0.1478906149,-0.3916413989,0.3251831385,0.0245097168 +-0.8823778411,1.1926748571,-0.6341592270,-0.5589796229,-1.0518769862,-0.2110828624 +0.4418106002,0.0396072932,-1.5983280145,0.1346865785,-1.4612221719,-0.8379460255 +-0.2573625300,1.1205792460,0.7964352244,-0.4552514273,-0.7330815587,0.6475908135 +1.3483117455,0.0788662442,-0.6250567532,0.4237556024,-0.2799573282,1.2334454851 +1.4571156134,-1.4172699378,-1.3825567026,-0.5324836065,0.6324662014,-0.6792444896 +-1.0968867604,-0.1579061348,0.5027972539,-0.5868140914,1.0160881336,-1.3805164027 +0.5033360438,-0.6949098258,-0.3353555331,0.2961763584,-1.4418738692,0.9716975289 +1.3377995909,-0.6933694389,-0.1297336949,0.3198599819,1.0700205073,1.9319119128 +-0.4893687646,-2.1916423650,-0.5084693605,0.0094820413,-1.5954583614,-0.2415163462 +0.8407375180,1.0851282562,0.9076087022,2.0858882110,0.8550737023,0.4121428611 +0.2329189800,-1.9308292403,-1.9471066316,-0.3333486039,-0.6179148116,-0.4876903850 +0.7887634684,-0.5066737936,0.0140685340,-0.2154659055,0.6856316133,-0.5733476235 +1.2876420408,-1.0017008922,0.4047785308,1.7332830849,-0.7434175661,-0.7506038467 +1.3831933237,0.2610588894,-1.0252886762,-1.6814656007,0.7577395814,0.7010080753 +-0.1390007449,0.3206198470,-0.3233859492,-0.5927685850,-1.2963773187,-0.0870908365 +0.0764508525,-0.0681337595,0.4492050165,-1.2001505903,-1.4631666187,1.6555568808 +-0.4344763776,-0.2568228099,1.1778776146,-1.0003945433,0.3741289770,-1.6510829465 +-1.0371316821,-1.5592859356,0.8159671789,-1.7755574720,0.0434710248,0.5449048695 +0.3444787655,0.3090727676,0.2452982560,-1.0989779141,-0.0480727359,0.6981980650 +0.1919641040,-0.3204360708,0.3328934650,-1.2451886319,0.6561994334,1.8427653499 +-1.1720978846,0.7904723055,-3.3362351111,-0.9411742116,-1.2802287987,0.6515088935 +1.1396206811,0.2748270617,-0.5175966998,-0.0735431223,-0.0684056295,1.1448528646 +-2.0195769715,-0.4475420741,-0.3429326238,0.3761768981,0.0537397325,-1.0118614556 +-1.7267046951,0.7766764222,-1.1638093304,1.1458643850,-0.8626962230,0.6895731392 +-0.2814854762,-0.2783129171,-0.3682718240,-3.0456779822,-0.2828212693,-0.2073910030 +0.8362030629,-0.2196532998,1.0696347425,-0.0284164744,-0.9862793221,1.6659680149 +0.8386993754,0.6600397414,-1.0336573298,0.4562314613,-1.2356041607,-0.9510741752 +2.2068096979,0.5415287036,-0.0255683679,-1.4552977819,0.2970715588,1.0732996894 +0.1796356212,1.1528413269,0.0237541456,-0.5372340392,0.4941692266,-0.3645515480 +0.6409734352,0.0604139515,0.5078790903,-1.7618529635,0.3250273463,0.9493556626 +-0.1460513305,1.3828333196,0.6312418683,1.9103277546,-1.8952113459,-1.4503796502 +-3.6857422734,-0.0841685337,0.9063497823,-2.1378477070,-1.8427389423,1.6708728777 +-1.6337658056,-0.1361837568,-0.7428804647,-0.0522557625,0.2745812822,1.1750029750 +-0.7140781271,-0.3864649626,-1.5664856393,-1.0558627049,-0.8611850252,-2.0717990875 +-1.0082497842,-0.9240520934,1.3600650590,-0.2255766020,-1.4888105086,-0.5233934788 +1.0136010064,-0.1609410773,-1.4104734602,-0.8377364876,-0.3904790472,-0.2556220507 +-0.9235316724,-0.3380407315,-1.4787867585,-0.2785107309,0.8689524762,0.1419894719 +0.9725390021,-0.6154797240,-1.5491420218,-1.0885464758,0.8246587658,-1.4542529829 +-0.5418985311,-1.6203629923,0.3603642343,0.2084435025,0.2110502977,2.7283800276 +1.1329756393,-0.7382376568,0.6765107641,-0.6703906994,1.3323909189,-0.6675389623 +1.6999369960,-0.0977837869,0.0180434354,-0.6838520359,0.6449245873,-0.1078982923 +1.3564030901,1.3275009700,-0.0577451096,1.6811608990,1.7515181438,-0.3611869398 +0.9469061220,-0.2135540585,-1.6567969585,0.3088311232,-0.4902417764,-1.1306865884 +-0.1841890502,-1.4853870850,0.0856503011,-0.6379423853,1.8309828227,0.7852357487 +-1.4536915741,0.0632123465,-1.8234177941,1.6595057084,1.1199326538,0.7202726057 +1.4088346446,1.9391106968,0.9451277496,1.2107037403,1.1795972052,-0.5737558057 +0.7655504535,0.3327495520,-0.2048871911,2.0356170778,0.1359660412,2.2997673250 +-1.4104923594,-0.2348042172,0.6975444611,0.5913615874,-1.3257257753,-0.7218283404 +0.8337126103,0.8161613886,0.1639138278,-0.8210989482,0.3452162615,1.1874970675 +-0.4356284910,0.5187057069,0.3577519398,0.5130210011,1.6999147781,0.8832991404 +0.8846465060,-0.0051902623,-1.2255699057,0.0192750213,0.0062405495,-1.1207934975 +0.2369079064,0.3152940534,-0.1138471334,-0.3799238761,0.4837601417,1.1911298640 +-1.4328148841,-0.0354154803,0.3611111888,-0.6364231138,1.1598812716,-0.9336430149 +0.4256491501,-0.4701956609,-1.8513455515,-1.7049516090,-0.1402054173,-1.1659169047 +0.4148241328,0.3010553687,1.1324110281,0.1307862565,-1.5218769161,0.6247000156 +0.6070389717,1.9750231781,0.2070679107,2.2424672508,0.2162197184,-0.2690549140 +-1.7752595172,-0.4413987581,-0.3017539787,-2.3063680339,-1.6303755410,-0.8112068999 +0.7811115012,-1.4894385174,0.1936515932,1.6168949288,1.0209677009,-0.5244542530 +-0.6734067364,0.2657777140,-0.0038243417,-2.1283693967,0.5399643755,-1.5613418114 +-0.2174957932,1.9957083397,-1.3199720918,-2.2776071044,0.8752264806,-2.3067446324 +1.0237897515,1.3155917492,0.2739655446,-1.5709450773,-0.8176618305,0.4567617557 +-0.7471269751,1.6420611482,-0.0489931433,0.6869780486,-1.0269445719,-2.1286931543 +1.4273277054,-0.8369015853,-0.2473552077,-1.0403942178,0.8533151937,-1.4161444193 +2.3053408143,1.4644570088,-0.4750353592,2.3704727317,1.6905771157,-1.6750137235 +-0.8417034145,-1.6563925000,0.4536428058,0.4382360847,1.3272058716,-0.0161537412 +-0.1334965047,0.0348737044,2.6390318650,-0.5154150238,0.1286760028,2.5013499985 +-0.6377388045,-1.1059372897,-0.9406951711,0.9965841407,0.9261273877,-0.6615435409 +-0.3044004944,-0.6419936851,-0.8493417956,-0.8810166806,1.2122951406,0.4227747943 +0.0927762800,1.1187914870,-0.3282395877,1.9232104950,-1.5108539569,0.3924326075 +0.7696331260,1.3128863032,0.1169529873,2.1307136518,0.7106151747,-0.7394879661 +-0.3169533695,-0.1346665759,0.9996726166,0.6566449417,-1.3199045902,1.9146994135 +1.1209568623,0.3780268564,-1.1278817755,-0.0834756235,-0.3652882095,-0.9545461033 +-0.1424351862,0.3947473673,0.0960760957,1.8278147469,0.8827012037,-1.3460305046 +-0.0460696301,-0.1348995761,0.6021925582,-0.1817705347,-0.6821234444,1.1924973402 +0.0794128789,-0.6782448784,-0.9737902055,-0.2084556001,-0.2846151577,-1.0247814478 +1.0396479644,1.3722297706,0.9341845449,-0.6062307263,0.9081820658,0.8416308138 +0.4180619954,-0.0338592385,-0.8266233510,2.0678630552,-1.4185931428,-1.6437071063 +0.1006336771,0.8545344223,0.5923130449,1.7003825860,-0.8028027195,-0.4544195127 +-0.3652576943,-0.7747206319,0.4987438114,0.1485055174,-0.1898679822,1.6070099733 +0.0295764170,-0.3530289029,-0.9733870283,1.8166544249,1.7111368028,-1.3277793325 +0.2832641023,0.8738000118,-0.1992883675,0.3223353066,0.9258268620,-0.2230200504 +1.5255399509,-1.1741505018,-1.6548952594,1.1492836774,-1.3994035634,2.1483503956 +-0.0408371910,0.8899494695,1.0347682699,-0.4528970387,1.1073613208,0.4952797226 +-0.7490403558,0.7502145281,-0.3304993290,0.2717700198,-0.3568045607,1.7485517770 +-0.2088213611,-0.7140297829,0.0793484784,-1.2062147663,-0.2922395886,0.3779819558 +-0.2495819968,0.3352199964,-0.1203674115,-0.7606579127,1.2082274335,0.9937045976 +0.2481018030,-1.2799372351,-0.5358000415,-1.0659413994,-0.8745863760,1.9176582287 +-0.6318424808,0.3281309586,-0.5961626378,-0.5396088147,-0.1263077738,-0.5198788140 +-0.7303715198,-0.2569322658,0.1568709631,1.9514817200,-0.7364148890,-1.1022168783 +-2.4520769710,0.1069101303,0.1698165254,0.6942051151,0.8281460028,0.8191075683 +1.3978509400,1.0023270488,-0.2630521366,-0.5830565394,1.6463523933,0.4771658979 +-1.0767718403,0.4595819916,0.2872482286,-1.6981461284,0.0236185317,-0.3954284632 +0.4651573703,-0.6799042741,-1.3452905761,0.3304140080,-0.1454021729,-2.0146310976 +0.3926464230,-0.8897315892,0.2017895760,-0.3857399256,0.8294236188,-0.1000763585 +-1.2711964311,-0.2252652677,-0.1010781965,1.0126028625,0.6927958655,0.9508566267 +-0.0745022617,-0.0001941124,1.3921424253,-2.4328326521,-1.4652483486,0.3846345342 +0.3307660153,1.3827349811,0.5659697128,0.6993403677,-0.0803432645,-0.7980560932 +1.4395988116,0.4074995902,1.0042474786,1.0907817954,-0.5195176924,0.6740252299 +0.8497971310,-0.1023099568,-0.8369796404,2.8315243105,-1.8466679869,-1.3201306883 +-1.9802586837,-0.3026898409,0.0735763039,1.2480455448,0.2823876789,0.7240756880 +-0.8214792991,0.5728084888,-0.6355821370,0.8955002571,-1.6009133913,1.0827795062 +-0.6226660988,-0.2113479451,-0.2077281285,0.7056288442,0.7282736337,-0.3524923630 +2.0156785834,0.4261317390,0.4354259404,-0.4135615335,0.7043689458,-1.0010273054 +-1.1938678024,-0.8207651393,-0.4750570852,1.3841687075,1.4371266232,0.4323277221 +2.2215920189,-0.0467132122,-0.3308847291,-0.3737980634,0.3733913374,0.5903136898 +0.3681771160,-1.0535392127,-0.6731617493,0.3385852544,0.4905619093,-0.0140872327 +0.0205557877,0.0550704484,-0.6981519338,0.9164293869,-1.0422603599,-0.0400766508 +-0.5570507782,0.7516698280,-0.4000586000,0.5552754565,-0.4110633488,-0.9425706790 +1.7169994409,0.5989763398,-1.7150610826,1.2734600165,-0.4379423364,0.2442528429 +-0.3734919114,0.6851968175,-0.1161592764,-1.2465332445,-0.0133770906,-0.9746076476 +0.6896090510,0.4537162423,-0.5098606858,0.0838134122,0.2215448640,-0.9338181008 +-0.2099379540,0.0266792409,-0.3662486539,-2.2541100586,-0.8204512381,0.7611786034 +-0.9541807107,-1.4262513478,-0.3105062140,0.0570837481,1.1517387198,-0.2610892939 +-1.7998439732,0.1541591827,0.3129387559,-0.0795165036,1.1508103114,-0.4006190215 +0.0179155277,0.1791117886,1.4076575419,0.4558639749,0.7469106230,-0.7259696501 +-0.6138474833,-0.2423150155,0.1448101820,-0.7990435746,-0.0279480236,-1.0117087121 +-1.3626968813,0.3134593972,-0.9013476352,-1.0759731343,-1.7589526155,-1.1135062224 +-2.1358541760,1.0517529184,-0.2649633538,0.3500761332,-1.6815056661,-1.8841675164 +-0.2732300363,-0.3692284382,1.0570174341,-0.2393173079,1.2547959517,1.0756363615 +-1.6862703385,-0.5369078921,-0.6369242805,0.0323463577,0.4108922020,-0.8027437652 +0.1397952975,0.4125397300,0.8116024820,1.0015275666,0.2714761759,-2.5902677539 +1.2800250774,-0.2924960257,-1.3739783929,0.2405021506,1.0444337048,-0.7232994999 +1.7640236604,-0.4289971973,0.7450214645,0.5901412879,0.5279407487,0.8907023481 +1.7501469387,-1.2793636115,-0.7388995388,0.0690156553,0.0097405802,1.4064427134 +-0.1588699363,-1.0513261766,0.0158276195,-1.1994590635,0.2634631013,-1.0082328908 +1.4179499206,-1.0327145289,-0.6527251747,-0.2057569002,0.1497138195,0.1749424460 +-0.1674403107,-0.4211908380,0.0545002618,-0.0034162811,1.0609715609,1.2897029422 +0.5478829553,0.5344159002,-1.8956191514,0.1652145444,-0.3060729049,1.0614935376 +-0.6972611849,0.5745465349,-0.4806010650,-0.4431365401,-0.2385344545,1.2423015750 +0.4170578841,0.3684011031,0.8689572007,-1.4277039840,1.0263180218,-1.1333234801 +1.6047844579,0.6387872114,1.0336837445,1.6093993672,-1.4639886159,-0.8982776163 +0.9084848368,-1.0316255096,-0.6523623006,-0.5171643169,-0.2307658021,-1.8186180420 +-1.0691311273,1.3411372194,-0.1362275714,2.3951997078,0.3063366590,-0.1598231567 +-0.1594467413,2.4700088685,-1.2902530098,0.7283323535,-2.0246034009,-0.8767294071 +-0.6208824069,-0.6707878277,0.4250705465,0.2505395447,-0.4972287407,0.0326843988 +-1.3227916249,0.7401988506,1.3245850449,-1.2859072015,2.3109403148,-0.2619295607 +-1.4277892392,-1.1971949997,1.1866510792,-1.6231891964,-0.2206031215,0.4679058263 +1.6506475833,0.7822523697,0.4685356907,1.8734497391,0.8920071168,2.1613011439 +0.9127046346,0.5193312047,0.8944519172,1.0416669732,0.6268382310,-0.2955578938 +-1.7506028990,1.1154420981,0.5385802794,-0.7407154146,0.1399457702,-0.9221036559 +-1.0312855817,0.2960087960,-0.6126117053,-0.8785785087,0.8049976920,0.3505285777 +0.7040949864,1.0669821155,0.2027328834,0.9724814437,-0.0064729835,1.1121459185 +-0.6724445359,-1.3200321023,0.0108409239,-0.7409356830,0.3716778126,-1.4674551200 +-1.1196089902,0.1887134767,-0.2999337558,-0.1625181957,0.6120763629,0.0132213140 +-0.5910231363,-0.3080587139,0.2990054750,0.2504683844,0.4246433649,0.1831549931 +-1.2800018569,-2.0494955036,-1.1357830616,0.4875943248,1.2861469708,0.0362277151 +-0.8171409789,0.3226359088,-0.7380576527,0.4892498489,0.2283417157,0.4451909641 +-0.0402475420,-0.2484413130,-0.6408356539,-1.1785325637,0.5823003986,2.1822563629 +0.7259021694,1.3331227416,0.2669347700,-0.0772869213,-0.0679861755,0.4012839360 +0.5604639195,1.0802546328,-0.2652451656,-2.9399114367,1.4630189441,0.1901286936 +-1.4171781222,-0.5044145917,1.8442119141,0.4190027434,0.1832869663,0.8541291226 +1.0680050772,0.5036902866,0.3547553156,3.6456233962,-0.8100558715,0.9226095939 +-0.3042454694,-1.8976955112,0.3532691641,-0.1916636207,-0.0753872894,0.4536988019 +-0.6512490544,-0.4032090178,-0.7525208960,-3.0083376522,2.0060822340,-1.2628688071 +0.5065533937,1.1439543588,1.2073612510,-0.4448538043,-1.1900590126,2.0862142834 +-1.5527840959,0.0043282083,0.2409690372,0.5274113259,-0.6138046722,0.3453588486 +0.9161463795,-0.3131544045,1.2232032816,-1.8285927811,0.9955628148,-1.1910306337 +-0.7714986061,-2.0777237007,1.0536951282,1.2016643362,-0.7239032911,0.8684202376 +0.8021314723,-2.2515879086,1.2745807907,-0.7980714505,-0.3571583443,-1.7821450445 +1.5390533021,0.0565577067,0.3332554058,0.5881620129,-0.7325098313,1.8843236245 +-0.8313849011,-1.7561074662,0.5939412040,-1.6180884601,-0.9420944551,1.8843809082 +0.2446278553,1.2329048784,-0.3398292738,-2.9634602546,-0.0645858479,1.1080505945 +-0.1949706130,0.3044473230,-0.8345102768,0.2856082181,0.4019392759,-1.3058739290 +0.2492237720,1.8779287520,0.8369059500,-0.9887666597,1.7562504632,-0.0060916447 +0.6562907872,-0.4703283927,1.0359201419,1.9163817545,-0.0528805817,-0.8103226172 +-0.5514660716,0.7624900677,0.9595106362,1.4577229401,0.3766069911,-0.2956107877 +-0.8984367964,-0.7552247488,-0.4322982493,1.5841627751,1.7671311098,-0.4313412521 +-0.4827093377,1.2875925935,-0.8314207724,0.6394334802,-2.1969883903,0.3348063324 +-1.3043642650,-1.4976414067,-0.0924965644,0.5180522013,-0.6203046507,1.1022608092 +-0.2982226737,-0.5813375780,1.3702563403,0.7390508352,-0.6151849706,-0.7711008212 +-1.6242819707,-0.1316135027,0.3998850173,0.0370333587,1.3034335052,0.0659296197 +2.2173655546,0.3528905441,-1.1387912477,-0.5222782244,1.2257439440,-0.6912874520 +-2.1592264237,1.3140633923,-0.1401834447,0.1051707742,-0.4159006088,-1.4188288959 +-0.9378440991,-1.2792693278,-0.5417741431,0.1537519405,0.1262690351,0.5975162642 +0.7154589499,-0.4995606327,-0.2898683286,-1.1643167185,0.4422724959,0.7407248814 +0.9224622886,-0.3948156070,0.7481846099,-0.4650743378,-0.6175096000,0.1731187469 +0.3842094796,-3.2824482082,0.1299513635,1.3052091945,-1.0710189251,0.9611999243 +-1.0324299367,1.2118891286,1.0702407218,1.6918980125,-0.1971999343,1.8706281041 diff --git a/shared/package-files/09/091440954d092f28032fba479f17c82d20c043a51b25f68a66b0a501d181d621/blob b/shared/package-files/09/091440954d092f28032fba479f17c82d20c043a51b25f68a66b0a501d181d621/blob new file mode 100644 index 0000000000000000000000000000000000000000..afb63b5977908d719ae6358dfd8dc62fc4118bc6 --- /dev/null +++ b/shared/package-files/09/091440954d092f28032fba479f17c82d20c043a51b25f68a66b0a501d181d621/blob @@ -0,0 +1,476 @@ +from sympy.core import EulerGamma +from sympy.core.numbers import (E, I, Integer, Rational, oo, pi) +from sympy.core.singleton import S +from sympy.core.symbol import Symbol +from sympy.functions.elementary.exponential import (exp, log) +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.functions.elementary.trigonometric import (acot, atan, cos, sin) +from sympy.functions.elementary.complexes import sign as _sign +from sympy.functions.special.error_functions import (Ei, erf) +from sympy.functions.special.gamma_functions import (digamma, gamma, loggamma) +from sympy.functions.special.zeta_functions import zeta +from sympy.polys.polytools import cancel +from sympy.functions.elementary.hyperbolic import cosh, coth, sinh, tanh +from sympy.series.gruntz import compare, mrv, rewrite, mrv_leadterm, gruntz, \ + sign +from sympy.testing.pytest import XFAIL, skip, slow + +""" +This test suite is testing the limit algorithm using the bottom up approach. +See the documentation in limits2.py. The algorithm itself is highly recursive +by nature, so "compare" is logically the lowest part of the algorithm, yet in +some sense it's the most complex part, because it needs to calculate a limit +to return the result. + +Nevertheless, the rest of the algorithm depends on compare working correctly. +""" + +x = Symbol('x', real=True) +m = Symbol('m', real=True) + + +runslow = False + + +def _sskip(): + if not runslow: + skip("slow") + + +@slow +def test_gruntz_evaluation(): + # Gruntz' thesis pp. 122 to 123 + # 8.1 + assert gruntz(exp(x)*(exp(1/x - exp(-x)) - exp(1/x)), x, oo) == -1 + # 8.2 + assert gruntz(exp(x)*(exp(1/x + exp(-x) + exp(-x**2)) + - exp(1/x - exp(-exp(x)))), x, oo) == 1 + # 8.3 + assert gruntz(exp(exp(x - exp(-x))/(1 - 1/x)) - exp(exp(x)), x, oo) is oo + # 8.5 + assert gruntz(exp(exp(exp(x + exp(-x)))) / exp(exp(exp(x))), x, oo) is oo + # 8.6 + assert gruntz(exp(exp(exp(x))) / exp(exp(exp(x - exp(-exp(x))))), + x, oo) is oo + # 8.7 + assert gruntz(exp(exp(exp(x))) / exp(exp(exp(x - exp(-exp(exp(x)))))), + x, oo) == 1 + # 8.8 + assert gruntz(exp(exp(x)) / exp(exp(x - exp(-exp(exp(x))))), x, oo) == 1 + # 8.9 + assert gruntz(log(x)**2 * exp(sqrt(log(x))*(log(log(x)))**2 + * exp(sqrt(log(log(x))) * (log(log(log(x))))**3)) / sqrt(x), + x, oo) == 0 + # 8.10 + assert gruntz((x*log(x)*(log(x*exp(x) - x**2))**2) + / (log(log(x**2 + 2*exp(exp(3*x**3*log(x)))))), x, oo) == Rational(1, 3) + # 8.11 + assert gruntz((exp(x*exp(-x)/(exp(-x) + exp(-2*x**2/(x + 1)))) - exp(x))/x, + x, oo) == -exp(2) + # 8.12 + assert gruntz((3**x + 5**x)**(1/x), x, oo) == 5 + # 8.13 + assert gruntz(x/log(x**(log(x**(log(2)/log(x))))), x, oo) is oo + # 8.14 + assert gruntz(exp(exp(2*log(x**5 + x)*log(log(x)))) + / exp(exp(10*log(x)*log(log(x)))), x, oo) is oo + # 8.15 + assert gruntz(exp(exp(Rational(5, 2)*x**Rational(-5, 7) + Rational(21, 8)*x**Rational(6, 11) + + 2*x**(-8) + Rational(54, 17)*x**Rational(49, 45)))**8 + / log(log(-log(Rational(4, 3)*x**Rational(-5, 14))))**Rational(7, 6), x, oo) is oo + # 8.16 + assert gruntz((exp(4*x*exp(-x)/(1/exp(x) + 1/exp(2*x**2/(x + 1)))) - exp(x)) + / exp(x)**4, x, oo) == 1 + # 8.17 + assert gruntz(exp(x*exp(-x)/(exp(-x) + exp(-2*x**2/(x + 1))))/exp(x), x, oo) \ + == 1 + # 8.19 + assert gruntz(log(x)*(log(log(x) + log(log(x))) - log(log(x))) + / (log(log(x) + log(log(log(x))))), x, oo) == 1 + # 8.20 + assert gruntz(exp((log(log(x + exp(log(x)*log(log(x)))))) + / (log(log(log(exp(x) + x + log(x)))))), x, oo) == E + # Another + assert gruntz(exp(exp(exp(x + exp(-x)))) / exp(exp(x)), x, oo) is oo + + +def test_gruntz_evaluation_slow(): + _sskip() + # 8.4 + assert gruntz(exp(exp(exp(x)/(1 - 1/x))) + - exp(exp(exp(x)/(1 - 1/x - log(x)**(-log(x))))), x, oo) is -oo + # 8.18 + assert gruntz((exp(exp(-x/(1 + exp(-x))))*exp(-x/(1 + exp(-x/(1 + exp(-x))))) + *exp(exp(-x + exp(-x/(1 + exp(-x)))))) + / (exp(-x/(1 + exp(-x))))**2 - exp(x) + x, x, oo) == 2 + + +@slow +def test_gruntz_eval_special(): + # Gruntz, p. 126 + assert gruntz(exp(x)*(sin(1/x + exp(-x)) - sin(1/x + exp(-x**2))), x, oo) == 1 + assert gruntz((erf(x - exp(-exp(x))) - erf(x)) * exp(exp(x)) * exp(x**2), + x, oo) == -2/sqrt(pi) + assert gruntz(exp(exp(x)) * (exp(sin(1/x + exp(-exp(x)))) - exp(sin(1/x))), + x, oo) == 1 + assert gruntz(exp(x)*(gamma(x + exp(-x)) - gamma(x)), x, oo) is oo + assert gruntz(exp(exp(digamma(digamma(x))))/x, x, oo) == exp(Rational(-1, 2)) + assert gruntz(exp(exp(digamma(log(x))))/x, x, oo) == exp(Rational(-1, 2)) + assert gruntz(digamma(digamma(digamma(x))), x, oo) is oo + assert gruntz(loggamma(loggamma(x)), x, oo) is oo + assert gruntz(((gamma(x + 1/gamma(x)) - gamma(x))/log(x) - cos(1/x)) + * x*log(x), x, oo) == Rational(-1, 2) + assert gruntz(x * (gamma(x - 1/gamma(x)) - gamma(x) + log(x)), x, oo) \ + == S.Half + assert gruntz((gamma(x + 1/gamma(x)) - gamma(x)) / log(x), x, oo) == 1 + + +def test_gruntz_eval_special_slow(): + _sskip() + assert gruntz(gamma(x + 1)/sqrt(2*pi) + - exp(-x)*(x**(x + S.Half) + x**(x - S.Half)/12), x, oo) is oo + assert gruntz(exp(exp(exp(digamma(digamma(digamma(x))))))/x, x, oo) == 0 + + +@XFAIL +def test_grunts_eval_special_slow_sometimes_fail(): + _sskip() + # XXX This sometimes fails!!! + assert gruntz(exp(gamma(x - exp(-x))*exp(1/x)) - exp(gamma(x)), x, oo) is oo + + +def test_gruntz_Ei(): + assert gruntz((Ei(x - exp(-exp(x))) - Ei(x)) *exp(-x)*exp(exp(x))*x, x, oo) == -1 + + +@XFAIL +def test_gruntz_eval_special_fail(): + # TODO zeta function series + assert gruntz( + exp((log(2) + 1)*x) * (zeta(x + exp(-x)) - zeta(x)), x, oo) == -log(2) + + # TODO 8.35 - 8.37 (bessel, max-min) + + +def test_gruntz_hyperbolic(): + assert gruntz(cosh(x), x, oo) is oo + assert gruntz(cosh(x), x, -oo) is oo + assert gruntz(sinh(x), x, oo) is oo + assert gruntz(sinh(x), x, -oo) is -oo + assert gruntz(2*cosh(x)*exp(x), x, oo) is oo + assert gruntz(2*cosh(x)*exp(x), x, -oo) == 1 + assert gruntz(2*sinh(x)*exp(x), x, oo) is oo + assert gruntz(2*sinh(x)*exp(x), x, -oo) == -1 + assert gruntz(tanh(x), x, oo) == 1 + assert gruntz(tanh(x), x, -oo) == -1 + assert gruntz(coth(x), x, oo) == 1 + assert gruntz(coth(x), x, -oo) == -1 + + +def test_compare1(): + assert compare(2, x, x) == "<" + assert compare(x, exp(x), x) == "<" + assert compare(exp(x), exp(x**2), x) == "<" + assert compare(exp(x**2), exp(exp(x)), x) == "<" + assert compare(1, exp(exp(x)), x) == "<" + + assert compare(x, 2, x) == ">" + assert compare(exp(x), x, x) == ">" + assert compare(exp(x**2), exp(x), x) == ">" + assert compare(exp(exp(x)), exp(x**2), x) == ">" + assert compare(exp(exp(x)), 1, x) == ">" + + assert compare(2, 3, x) == "=" + assert compare(3, -5, x) == "=" + assert compare(2, -5, x) == "=" + + assert compare(x, x**2, x) == "=" + assert compare(x**2, x**3, x) == "=" + assert compare(x**3, 1/x, x) == "=" + assert compare(1/x, x**m, x) == "=" + assert compare(x**m, -x, x) == "=" + + assert compare(exp(x), exp(-x), x) == "=" + assert compare(exp(-x), exp(2*x), x) == "=" + assert compare(exp(2*x), exp(x)**2, x) == "=" + assert compare(exp(x)**2, exp(x + exp(-x)), x) == "=" + assert compare(exp(x), exp(x + exp(-x)), x) == "=" + + assert compare(exp(x**2), 1/exp(x**2), x) == "=" + + +def test_compare2(): + assert compare(exp(x), x**5, x) == ">" + assert compare(exp(x**2), exp(x)**2, x) == ">" + assert compare(exp(x), exp(x + exp(-x)), x) == "=" + assert compare(exp(x + exp(-x)), exp(x), x) == "=" + assert compare(exp(x + exp(-x)), exp(-x), x) == "=" + assert compare(exp(-x), x, x) == ">" + assert compare(x, exp(-x), x) == "<" + assert compare(exp(x + 1/x), x, x) == ">" + assert compare(exp(-exp(x)), exp(x), x) == ">" + assert compare(exp(exp(-exp(x)) + x), exp(-exp(x)), x) == "<" + + +def test_compare3(): + assert compare(exp(exp(x)), exp(x + exp(-exp(x))), x) == ">" + + +def test_sign1(): + assert sign(Rational(0), x) == 0 + assert sign(Rational(3), x) == 1 + assert sign(Rational(-5), x) == -1 + assert sign(log(x), x) == 1 + assert sign(exp(-x), x) == 1 + assert sign(exp(x), x) == 1 + assert sign(-exp(x), x) == -1 + assert sign(3 - 1/x, x) == 1 + assert sign(-3 - 1/x, x) == -1 + assert sign(sin(1/x), x) == 1 + assert sign((x**Integer(2)), x) == 1 + assert sign(x**2, x) == 1 + assert sign(x**5, x) == 1 + + +def test_sign2(): + assert sign(x, x) == 1 + assert sign(-x, x) == -1 + y = Symbol("y", positive=True) + assert sign(y, x) == 1 + assert sign(-y, x) == -1 + assert sign(y*x, x) == 1 + assert sign(-y*x, x) == -1 + + +def mmrv(a, b): + return set(mrv(a, b)[0].keys()) + + +def test_mrv1(): + assert mmrv(x, x) == {x} + assert mmrv(x + 1/x, x) == {x} + assert mmrv(x**2, x) == {x} + assert mmrv(log(x), x) == {x} + assert mmrv(exp(x), x) == {exp(x)} + assert mmrv(exp(-x), x) == {exp(-x)} + assert mmrv(exp(x**2), x) == {exp(x**2)} + assert mmrv(-exp(1/x), x) == {x} + assert mmrv(exp(x + 1/x), x) == {exp(x + 1/x)} + + +def test_mrv2a(): + assert mmrv(exp(x + exp(-exp(x))), x) == {exp(-exp(x))} + assert mmrv(exp(x + exp(-x)), x) == {exp(x + exp(-x)), exp(-x)} + assert mmrv(exp(1/x + exp(-x)), x) == {exp(-x)} + +#sometimes infinite recursion due to log(exp(x**2)) not simplifying + + +def test_mrv2b(): + assert mmrv(exp(x + exp(-x**2)), x) == {exp(-x**2)} + +#sometimes infinite recursion due to log(exp(x**2)) not simplifying + + +def test_mrv2c(): + assert mmrv( + exp(-x + 1/x**2) - exp(x + 1/x), x) == {exp(x + 1/x), exp(1/x**2 - x)} + +#sometimes infinite recursion due to log(exp(x**2)) not simplifying + + +def test_mrv3(): + assert mmrv(exp(x**2) + x*exp(x) + log(x)**x/x, x) == {exp(x**2)} + assert mmrv( + exp(x)*(exp(1/x + exp(-x)) - exp(1/x)), x) == {exp(x), exp(-x)} + assert mmrv(log( + x**2 + 2*exp(exp(3*x**3*log(x)))), x) == {exp(exp(3*x**3*log(x)))} + assert mmrv(log(x - log(x))/log(x), x) == {x} + assert mmrv( + (exp(1/x - exp(-x)) - exp(1/x))*exp(x), x) == {exp(x), exp(-x)} + assert mmrv( + 1/exp(-x + exp(-x)) - exp(x), x) == {exp(x), exp(-x), exp(x - exp(-x))} + assert mmrv(log(log(x*exp(x*exp(x)) + 1)), x) == {exp(x*exp(x))} + assert mmrv(exp(exp(log(log(x) + 1/x))), x) == {x} + + +def test_mrv4(): + ln = log + assert mmrv((ln(ln(x) + ln(ln(x))) - ln(ln(x)))/ln(ln(x) + ln(ln(ln(x))))*ln(x), + x) == {x} + assert mmrv(log(log(x*exp(x*exp(x)) + 1)) - exp(exp(log(log(x) + 1/x))), x) == \ + {exp(x*exp(x))} + + +def mrewrite(a, b, c): + return rewrite(a[1], a[0], b, c) + + +def test_rewrite1(): + e = exp(x) + assert mrewrite(mrv(e, x), x, m) == (1/m, -x) + e = exp(x**2) + assert mrewrite(mrv(e, x), x, m) == (1/m, -x**2) + e = exp(x + 1/x) + assert mrewrite(mrv(e, x), x, m) == (1/m, -x - 1/x) + e = 1/exp(-x + exp(-x)) - exp(x) + assert mrewrite(mrv(e, x), x, m) == (1/(m*exp(m)) - 1/m, -x) + + +def test_rewrite2(): + e = exp(x)*log(log(exp(x))) + assert mmrv(e, x) == {exp(x)} + assert mrewrite(mrv(e, x), x, m) == (1/m*log(x), -x) + +#sometimes infinite recursion due to log(exp(x**2)) not simplifying + + +def test_rewrite3(): + e = exp(-x + 1/x**2) - exp(x + 1/x) + #both of these are correct and should be equivalent: + assert mrewrite(mrv(e, x), x, m) in [(-1/m + m*exp( + 1/x + 1/x**2), -x - 1/x), (m - 1/m*exp(1/x + x**(-2)), x**(-2) - x)] + + +def test_mrv_leadterm1(): + assert mrv_leadterm(-exp(1/x), x) == (-1, 0) + assert mrv_leadterm(1/exp(-x + exp(-x)) - exp(x), x) == (-1, 0) + assert mrv_leadterm( + (exp(1/x - exp(-x)) - exp(1/x))*exp(x), x) == (-exp(1/x), 0) + + +def test_mrv_leadterm2(): + #Gruntz: p51, 3.25 + assert mrv_leadterm((log(exp(x) + x) - x)/log(exp(x) + log(x))*exp(x), x) == \ + (1, 0) + + +def test_mrv_leadterm3(): + #Gruntz: p56, 3.27 + assert mmrv(exp(-x + exp(-x)*exp(-x*log(x))), x) == {exp(-x - x*log(x))} + assert mrv_leadterm(exp(-x + exp(-x)*exp(-x*log(x))), x) == (exp(-x), 0) + + +def test_limit1(): + assert gruntz(x, x, oo) is oo + assert gruntz(x, x, -oo) is -oo + assert gruntz(-x, x, oo) is -oo + assert gruntz(x**2, x, -oo) is oo + assert gruntz(-x**2, x, oo) is -oo + assert gruntz(x*log(x), x, 0, dir="+") == 0 + assert gruntz(1/x, x, oo) == 0 + assert gruntz(exp(x), x, oo) is oo + assert gruntz(-exp(x), x, oo) is -oo + assert gruntz(exp(x)/x, x, oo) is oo + assert gruntz(1/x - exp(-x), x, oo) == 0 + assert gruntz(x + 1/x, x, oo) is oo + + +def test_limit2(): + assert gruntz(x**x, x, 0, dir="+") == 1 + assert gruntz((exp(x) - 1)/x, x, 0) == 1 + assert gruntz(1 + 1/x, x, oo) == 1 + assert gruntz(-exp(1/x), x, oo) == -1 + assert gruntz(x + exp(-x), x, oo) is oo + assert gruntz(x + exp(-x**2), x, oo) is oo + assert gruntz(x + exp(-exp(x)), x, oo) is oo + assert gruntz(13 + 1/x - exp(-x), x, oo) == 13 + + +def test_limit3(): + a = Symbol('a') + assert gruntz(x - log(1 + exp(x)), x, oo) == 0 + assert gruntz(x - log(a + exp(x)), x, oo) == 0 + assert gruntz(exp(x)/(1 + exp(x)), x, oo) == 1 + assert gruntz(exp(x)/(a + exp(x)), x, oo) == 1 + + +def test_limit4(): + #issue 3463 + assert gruntz((3**x + 5**x)**(1/x), x, oo) == 5 + #issue 3463 + assert gruntz((3**(1/x) + 5**(1/x))**x, x, 0) == 5 + + +@XFAIL +def test_MrvTestCase_page47_ex3_21(): + h = exp(-x/(1 + exp(-x))) + expr = exp(h)*exp(-x/(1 + h))*exp(exp(-x + h))/h**2 - exp(x) + x + assert mmrv(expr, x) == {1/h, exp(-x), exp(x), exp(x - h), exp(x/(1 + h))} + + +def test_gruntz_I(): + y = Symbol("y") + assert gruntz(I*x, x, oo) == I*oo + assert gruntz(y*I*x, x, oo) == y*I*oo + assert gruntz(y*3*I*x, x, oo) == y*I*oo + assert gruntz(y*3*sin(I)*x, x, oo).simplify().rewrite(_sign) == _sign(y)*I*oo + + +def test_issue_4814(): + assert gruntz((x + 1)**(1/log(x + 1)), x, oo) == E + + +def test_intractable(): + assert gruntz(1/gamma(x), x, oo) == 0 + assert gruntz(1/loggamma(x), x, oo) == 0 + assert gruntz(gamma(x)/loggamma(x), x, oo) is oo + assert gruntz(exp(gamma(x))/gamma(x), x, oo) is oo + assert gruntz(gamma(x), x, 3) == 2 + assert gruntz(gamma(Rational(1, 7) + 1/x), x, oo) == gamma(Rational(1, 7)) + assert gruntz(log(x**x)/log(gamma(x)), x, oo) == 1 + assert gruntz(log(gamma(gamma(x)))/exp(x), x, oo) is oo + + +def test_aseries_trig(): + assert cancel(gruntz(1/log(atan(x)), x, oo) + - 1/(log(pi) + log(S.Half))) == 0 + assert gruntz(1/acot(x), x, -oo) is -oo + + +def test_exp_log_series(): + assert gruntz(x/log(log(x*exp(x))), x, oo) is oo + + +def test_issue_3644(): + assert gruntz(((x**7 + x + 1)/(2**x + x**2))**(-1/x), x, oo) == 2 + + +def test_issue_6843(): + n = Symbol('n', integer=True, positive=True) + r = (n + 1)*x**(n + 1)/(x**(n + 1) - 1) - x/(x - 1) + assert gruntz(r, x, 1).simplify() == n/2 + + +def test_issue_4190(): + assert gruntz(x - gamma(1/x), x, oo) == S.EulerGamma + + +@XFAIL +def test_issue_5172(): + n = Symbol('n') + r = Symbol('r', positive=True) + c = Symbol('c') + p = Symbol('p', positive=True) + m = Symbol('m', negative=True) + expr = ((2*n*(n - r + 1)/(n + r*(n - r + 1)))**c + \ + (r - 1)*(n*(n - r + 2)/(n + r*(n - r + 1)))**c - n)/(n**c - n) + expr = expr.subs(c, c + 1) + assert gruntz(expr.subs(c, m), n, oo) == 1 + # fail: + assert gruntz(expr.subs(c, p), n, oo).simplify() == \ + (2**(p + 1) + r - 1)/(r + 1)**(p + 1) + + +def test_issue_4109(): + assert gruntz(1/gamma(x), x, 0) == 0 + assert gruntz(x*gamma(x), x, 0) == 1 + + +def test_issue_6682(): + assert gruntz(exp(2*Ei(-x))/x**2, x, 0) == exp(2*EulerGamma) + + +def test_issue_7096(): + from sympy.functions import sign + assert gruntz(x**-pi, x, 0, dir='-') == oo*sign((-1)**(-pi)) diff --git a/shared/package-files/09/09156e525e6333899095fd62d57b27db39b52a58d24b45f312f369008da43d19/blob b/shared/package-files/09/09156e525e6333899095fd62d57b27db39b52a58d24b45f312f369008da43d19/blob new file mode 100644 index 0000000000000000000000000000000000000000..65f1e0e95b736a4692a0b9a6ad24264f7cfa5c56 --- /dev/null +++ b/shared/package-files/09/09156e525e6333899095fd62d57b27db39b52a58d24b45f312f369008da43d19/blob @@ -0,0 +1,327 @@ +import sys +import typing +from typing import ( + AbstractSet, + Any, + AsyncGenerator as AsyncGenerator, + AsyncIterable as AsyncIterable, + AsyncIterator as AsyncIterator, + Awaitable as Awaitable, + ByteString as ByteString, + Callable as Callable, + Collection as Collection, + Container as Container, + Coroutine as Coroutine, + Dict, + Generator as Generator, + Generic, + Hashable as Hashable, + ItemsView as ItemsView, + Iterable as Iterable, + Iterator as Iterator, + KeysView as KeysView, + List, + Mapping as Mapping, + MappingView as MappingView, + MutableMapping as MutableMapping, + MutableSequence as MutableSequence, + MutableSet as MutableSet, + Optional, + Reversible as Reversible, + Sequence as Sequence, + Sized as Sized, + Tuple, + Type, + TypeVar, + Union, + ValuesView as ValuesView, + overload, +) + +Set = AbstractSet + +_S = TypeVar("_S") +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +# namedtuple is special-cased in the type checker; the initializer is ignored. +if sys.version_info >= (3, 7): + def namedtuple( + typename: str, + field_names: Union[str, Iterable[str]], + *, + rename: bool = ..., + module: Optional[str] = ..., + defaults: Optional[Iterable[Any]] = ..., + ) -> Type[Tuple[Any, ...]]: ... + +else: + def namedtuple( + typename: str, + field_names: Union[str, Iterable[str]], + *, + verbose: bool = ..., + rename: bool = ..., + module: Optional[str] = ..., + ) -> Type[Tuple[Any, ...]]: ... + +class UserDict(MutableMapping[_KT, _VT]): + data: Dict[_KT, _VT] + def __init__(self, __dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ... + def __len__(self) -> int: ... + def __getitem__(self, key: _KT) -> _VT: ... + def __setitem__(self, key: _KT, item: _VT) -> None: ... + def __delitem__(self, key: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __contains__(self, key: object) -> bool: ... + def copy(self: _S) -> _S: ... + @classmethod + def fromkeys(cls: Type[_S], iterable: Iterable[_KT], value: Optional[_VT] = ...) -> _S: ... + +class UserList(MutableSequence[_T]): + data: List[_T] + def __init__(self, initlist: Optional[Iterable[_T]] = ...) -> None: ... + def __lt__(self, other: object) -> bool: ... + def __le__(self, other: object) -> bool: ... + def __gt__(self, other: object) -> bool: ... + def __ge__(self, other: object) -> bool: ... + def __contains__(self, item: object) -> bool: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, i: slice) -> MutableSequence[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, i: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __add__(self: _S, other: Iterable[_T]) -> _S: ... + def __iadd__(self: _S, other: Iterable[_T]) -> _S: ... + def __mul__(self: _S, n: int) -> _S: ... + def __imul__(self: _S, n: int) -> _S: ... + def append(self, item: _T) -> None: ... + def insert(self, i: int, item: _T) -> None: ... + def pop(self, i: int = ...) -> _T: ... + def remove(self, item: _T) -> None: ... + def clear(self) -> None: ... + def copy(self: _S) -> _S: ... + def count(self, item: _T) -> int: ... + def index(self, item: _T, *args: Any) -> int: ... + def reverse(self) -> None: ... + def sort(self, *args: Any, **kwds: Any) -> None: ... + def extend(self, other: Iterable[_T]) -> None: ... + +_UserStringT = TypeVar("_UserStringT", bound=UserString) + +class UserString(Sequence[str]): + data: str + def __init__(self, seq: object) -> None: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __complex__(self) -> complex: ... + def __getnewargs__(self) -> Tuple[str]: ... + def __lt__(self, string: Union[str, UserString]) -> bool: ... + def __le__(self, string: Union[str, UserString]) -> bool: ... + def __gt__(self, string: Union[str, UserString]) -> bool: ... + def __ge__(self, string: Union[str, UserString]) -> bool: ... + def __contains__(self, char: object) -> bool: ... + def __len__(self) -> int: ... + # It should return a str to implement Sequence correctly, but it doesn't. + def __getitem__(self: _UserStringT, i: Union[int, slice]) -> _UserStringT: ... # type: ignore + def __add__(self: _UserStringT, other: object) -> _UserStringT: ... + def __mul__(self: _UserStringT, n: int) -> _UserStringT: ... + def __mod__(self: _UserStringT, args: Any) -> _UserStringT: ... + def capitalize(self: _UserStringT) -> _UserStringT: ... + def casefold(self: _UserStringT) -> _UserStringT: ... + def center(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def count(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + if sys.version_info >= (3, 8): + def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> bytes: ... + else: + def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ... + def endswith(self, suffix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ... + def expandtabs(self: _UserStringT, tabsize: int = ...) -> _UserStringT: ... + def find(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def format(self, *args: Any, **kwds: Any) -> str: ... + def format_map(self, mapping: Mapping[str, Any]) -> str: ... + def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def isalpha(self) -> bool: ... + def isalnum(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, seq: Iterable[str]) -> str: ... + def ljust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def lower(self: _UserStringT) -> _UserStringT: ... + def lstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + @staticmethod + @overload + def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... + def partition(self, sep: str) -> Tuple[str, str, str]: ... + if sys.version_info >= (3, 9): + def removeprefix(self: _UserStringT, __prefix: Union[str, UserString]) -> _UserStringT: ... + def removesuffix(self: _UserStringT, __suffix: Union[str, UserString]) -> _UserStringT: ... + def replace( + self: _UserStringT, old: Union[str, UserString], new: Union[str, UserString], maxsplit: int = ... + ) -> _UserStringT: ... + def rfind(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def rjust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + def rstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + def startswith(self, prefix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ... + def strip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + def swapcase(self: _UserStringT) -> _UserStringT: ... + def title(self: _UserStringT) -> _UserStringT: ... + def translate(self: _UserStringT, *args: Any) -> _UserStringT: ... + def upper(self: _UserStringT) -> _UserStringT: ... + def zfill(self: _UserStringT, width: int) -> _UserStringT: ... + +class deque(MutableSequence[_T], Generic[_T]): + @property + def maxlen(self) -> Optional[int]: ... + def __init__(self, iterable: Iterable[_T] = ..., maxlen: Optional[int] = ...) -> None: ... + def append(self, x: _T) -> None: ... + def appendleft(self, x: _T) -> None: ... + def clear(self) -> None: ... + def copy(self) -> deque[_T]: ... + def count(self, x: _T) -> int: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def extendleft(self, iterable: Iterable[_T]) -> None: ... + def insert(self, i: int, x: _T) -> None: ... + def index(self, x: _T, start: int = ..., stop: int = ...) -> int: ... + def pop(self) -> _T: ... # type: ignore + def popleft(self) -> _T: ... + def remove(self, value: _T) -> None: ... + def reverse(self) -> None: ... + def rotate(self, n: int = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + # These methods of deque don't really take slices, but we need to + # define them as taking a slice to satisfy MutableSequence. + @overload + def __getitem__(self, index: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> MutableSequence[_T]: ... + @overload + def __setitem__(self, i: int, x: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + @overload + def __delitem__(self, i: int) -> None: ... + @overload + def __delitem__(self, s: slice) -> None: ... + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ... + def __add__(self, other: deque[_T]) -> deque[_T]: ... + def __mul__(self, other: int) -> deque[_T]: ... + def __imul__(self, other: int) -> None: ... + +class Counter(Dict[_T, int], Generic[_T]): + @overload + def __init__(self, __iterable: None = ..., **kwargs: int) -> None: ... + @overload + def __init__(self, __mapping: Mapping[_T, int]) -> None: ... + @overload + def __init__(self, __iterable: Iterable[_T]) -> None: ... + def copy(self: _S) -> _S: ... + def elements(self) -> Iterator[_T]: ... + def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ... + @overload + def subtract(self, __iterable: None = ...) -> None: ... + @overload + def subtract(self, __mapping: Mapping[_T, int]) -> None: ... + @overload + def subtract(self, __iterable: Iterable[_T]) -> None: ... + # The Iterable[Tuple[...]] argument type is not actually desirable + # (the tuples will be added as keys, breaking type safety) but + # it's included so that the signature is compatible with + # Dict.update. Not sure if we should use '# type: ignore' instead + # and omit the type from the union. + @overload + def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ... + @overload + def update(self, __m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: int) -> None: ... + @overload + def update(self, __m: None = ..., **kwargs: int) -> None: ... + def __add__(self, other: Counter[_T]) -> Counter[_T]: ... + def __sub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __and__(self, other: Counter[_T]) -> Counter[_T]: ... + def __or__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore + def __pos__(self) -> Counter[_T]: ... + def __neg__(self) -> Counter[_T]: ... + def __iadd__(self, other: Counter[_T]) -> Counter[_T]: ... + def __isub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __iand__(self, other: Counter[_T]) -> Counter[_T]: ... + def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore + +class _OrderedDictKeysView(KeysView[_KT], Reversible[_KT]): + def __reversed__(self) -> Iterator[_KT]: ... + +class _OrderedDictItemsView(ItemsView[_KT, _VT], Reversible[Tuple[_KT, _VT]]): + def __reversed__(self) -> Iterator[Tuple[_KT, _VT]]: ... + +class _OrderedDictValuesView(ValuesView[_VT], Reversible[_VT]): + def __reversed__(self) -> Iterator[_VT]: ... + +class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): + def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ... + def move_to_end(self, key: _KT, last: bool = ...) -> None: ... + def copy(self: _S) -> _S: ... + def __reversed__(self) -> Iterator[_KT]: ... + def keys(self) -> _OrderedDictKeysView[_KT]: ... + def items(self) -> _OrderedDictItemsView[_KT, _VT]: ... + def values(self) -> _OrderedDictValuesView[_VT]: ... + +class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): + default_factory: Optional[Callable[[], _VT]] + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], map: Mapping[_KT, _VT]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... + @overload + def __init__( + self, default_factory: Optional[Callable[[], _VT]], iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT + ) -> None: ... + def __missing__(self, key: _KT) -> _VT: ... + # TODO __reversed__ + def copy(self: _S) -> _S: ... + +class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, *maps: Mapping[_KT, _VT]) -> None: ... + @property + def maps(self) -> List[Mapping[_KT, _VT]]: ... + def new_child(self, m: Mapping[_KT, _VT] = ...) -> typing.ChainMap[_KT, _VT]: ... + @property + def parents(self) -> typing.ChainMap[_KT, _VT]: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... + def __missing__(self, key: _KT) -> _VT: ... # undocumented diff --git a/shared/package-files/09/09191205c0d364c1fa29cebecc12e9670ed851c0146c24b3ed11d87c0b212cd5/blob b/shared/package-files/09/09191205c0d364c1fa29cebecc12e9670ed851c0146c24b3ed11d87c0b212cd5/blob new file mode 100644 index 0000000000000000000000000000000000000000..c00bc2eb8ee6fdbde81a69213ac933b51689f9c8 --- /dev/null +++ b/shared/package-files/09/09191205c0d364c1fa29cebecc12e9670ed851c0146c24b3ed11d87c0b212cd5/blob @@ -0,0 +1,8 @@ +@REM Copyright (C) 2012 Anaconda, Inc +@REM SPDX-License-Identifier: BSD-3-Clause +@REM Helper script to conda_hook.bat. This is a separate script so that the Anaconda Prompt +@REM can enable this option while only conda_hook.bat can be used in AutoRun. + +@FOR /F "delims=" %%i IN ('@CALL "%CONDA_EXE%" config --show auto_activate_base') DO @SET "__conda_auto_activate_base=%%i" +@IF NOT "x%__conda_auto_activate_base:True=%"=="x%__conda_auto_activate_base%" @CALL "%CONDA_BAT%" activate base +@SET __conda_auto_activate_base= diff --git a/shared/package-files/09/09198aa0ce140bd0efcb562bb812f96cbe0c18b5e5b30d3b5290c91974e4736d/blob b/shared/package-files/09/09198aa0ce140bd0efcb562bb812f96cbe0c18b5e5b30d3b5290c91974e4736d/blob new file mode 100644 index 0000000000000000000000000000000000000000..80bce114749b0aeb652a51785f0729d06db4b7a5 --- /dev/null +++ b/shared/package-files/09/09198aa0ce140bd0efcb562bb812f96cbe0c18b5e5b30d3b5290c91974e4736d/blob @@ -0,0 +1,178 @@ +"""GPU accelerated tree explanations""" + +import numpy as np + +from ..utils import assert_import, record_import_error +from ._tree import ( + TreeExplainer, + _xgboost_cat_unsupported, + feature_perturbation_codes, + output_transform_codes, +) + +try: + from .. import _cext_gpu # type: ignore +except ImportError as e: + record_import_error("cext_gpu", "cuda extension was not built during install!", e) + + +class GPUTreeExplainer(TreeExplainer): + """Experimental GPU accelerated version of TreeExplainer. Currently requires source build with + cuda available and 'CUDA_PATH' environment variable defined. + + Examples + -------- + See `GPUTree explainer examples `_ + + """ + + def shap_values(self, X, y=None, tree_limit=None, approximate=False, check_additivity=True, from_call=False): + """Estimate the SHAP values for a set of samples. + + Parameters + ---------- + X : numpy.array, pandas.DataFrame or catboost.Pool (for catboost) + A matrix of samples (# samples x # features) on which to explain the model's output. + + y : numpy.array + An array of label values for each sample. Used when explaining loss functions. + + tree_limit : None (default) or int + Limit the number of trees used by the model. By default None means no use the limit + of the + original model, and -1 means no limit. + + approximate : bool + Not supported. + + check_additivity : bool + Run a validation check that the sum of the SHAP values equals the output of the + model. This + check takes only a small amount of time, and will catch potential unforeseen errors. + Note that this check only runs right now when explaining the margin of the model. + + Returns + ------- + array or list + For models with a single output this returns a matrix of SHAP values + (# samples x # features). Each row sums to the difference between the model output + for that + sample and the expected value of the model output (which is stored in the expected_value + attribute of the explainer when it is constant). For models with vector outputs this + returns + a list of such matrices, one for each output. + + """ + assert not approximate, "approximate not supported" + + X, y, X_missing, flat_output, tree_limit, check_additivity = self._validate_inputs( + X, y, tree_limit, check_additivity + ) + + model = self.model + _xgboost_cat_unsupported(model) + transform = model.get_transform() + + # run the core algorithm using the C extension + assert_import("cext_gpu") + phi = np.zeros((X.shape[0], X.shape[1] + 1, self.model.num_outputs)) + _cext_gpu.dense_tree_shap( + self.model.children_left, + self.model.children_right, + self.model.children_default, + self.model.features, + self.model.thresholds, + self.model.values, + self.model.node_sample_weight, + self.model.max_depth, + X, + X_missing, + y, + self.data, + self.data_missing, + tree_limit, + self.model.base_offset, + phi, + feature_perturbation_codes[self.feature_perturbation], + output_transform_codes[transform], + False, + ) + + out = self._get_shap_output(phi, flat_output) + if check_additivity and self.model.model_output == "raw": + self.assert_additivity(out, self.model.predict(X)) + + return out + + def shap_interaction_values(self, X, y=None, tree_limit=None): + """Estimate the SHAP interaction values for a set of samples. + + Parameters + ---------- + X : numpy.array, pandas.DataFrame or catboost.Pool (for catboost) + A matrix of samples (# samples x # features) on which to explain the model's output. + + y : numpy.array + An array of label values for each sample. Used when explaining loss functions (not + yet supported). + + tree_limit : None (default) or int + Limit the number of trees used by the model. By default None means no use the limit + of the + original model, and -1 means no limit. + + Returns + ------- + array or list + For models with a single output this returns a tensor of SHAP values + (# samples x # features x # features). The matrix (# features x # features) for each + sample sums + to the difference between the model output for that sample and the expected value of + the model output + (which is stored in the expected_value attribute of the explainer). Each row of this + matrix sums to the + SHAP value for that feature for that sample. The diagonal entries of the matrix + represent the + "main effect" of that feature on the prediction and the symmetric off-diagonal + entries represent the + interaction effects between all pairs of features for that sample. For models with + vector outputs + this returns a list of tensors, one for each output. + + """ + if self.model.model_output != "raw": + raise ValueError('Only model_output = "raw" is supported for SHAP interaction values right now!') + if self.feature_perturbation == "interventional": + raise ValueError( + 'feature_perturbation="interventional" is not yet supported for interaction values. ' + 'Use feature_perturbation="tree_path_dependent" instead.' + ) + transform = "identity" + + X, y, X_missing, flat_output, tree_limit, _ = self._validate_inputs(X, y, tree_limit, False) + # run the core algorithm using the C extension + assert_import("cext_gpu") + phi = np.zeros((X.shape[0], X.shape[1] + 1, X.shape[1] + 1, self.model.num_outputs)) + _cext_gpu.dense_tree_shap( + self.model.children_left, + self.model.children_right, + self.model.children_default, + self.model.features, + self.model.thresholds, + self.model.values, + self.model.node_sample_weight, + self.model.max_depth, + X, + X_missing, + y, + self.data, + self.data_missing, + tree_limit, + self.model.base_offset, + phi, + feature_perturbation_codes[self.feature_perturbation], + output_transform_codes[transform], + True, + ) + + return self._get_shap_interactions_output(phi, flat_output) diff --git a/shared/package-files/09/091b2b39205b4005e957d2669e456d1cfa7f71021fa4b2f5b4e03fdee1ba74cf/blob b/shared/package-files/09/091b2b39205b4005e957d2669e456d1cfa7f71021fa4b2f5b4e03fdee1ba74cf/blob new file mode 100644 index 0000000000000000000000000000000000000000..769b5cb2ad3d99e979a5fb371a9e7b41cea9027b --- /dev/null +++ b/shared/package-files/09/091b2b39205b4005e957d2669e456d1cfa7f71021fa4b2f5b4e03fdee1ba74cf/blob @@ -0,0 +1,74 @@ +""" + pygments.styles.manni + ~~~~~~~~~~~~~~~~~~~~~ + + A colorful style, inspired by the terminal highlighting style. + + This is a port of the style used in the `php port`_ of pygments + by Manni. The style is called 'default' there. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +class ManniStyle(Style): + """ + A colorful style, inspired by the terminal highlighting style. + """ + + background_color = '#f0f3f3' + + styles = { + Whitespace: '#bbbbbb', + Comment: 'italic #0099FF', + Comment.Preproc: 'noitalic #009999', + Comment.Special: 'bold', + + Keyword: 'bold #006699', + Keyword.Pseudo: 'nobold', + Keyword.Type: '#007788', + + Operator: '#555555', + Operator.Word: 'bold #000000', + + Name.Builtin: '#336666', + Name.Function: '#CC00FF', + Name.Class: 'bold #00AA88', + Name.Namespace: 'bold #00CCFF', + Name.Exception: 'bold #CC0000', + Name.Variable: '#003333', + Name.Constant: '#336600', + Name.Label: '#9999FF', + Name.Entity: 'bold #999999', + Name.Attribute: '#330099', + Name.Tag: 'bold #330099', + Name.Decorator: '#9999FF', + + String: '#CC3300', + String.Doc: 'italic', + String.Interpol: '#AA0000', + String.Escape: 'bold #CC3300', + String.Regex: '#33AAAA', + String.Symbol: '#FFCC33', + String.Other: '#CC3300', + + Number: '#FF6600', + + Generic.Heading: 'bold #003300', + Generic.Subheading: 'bold #003300', + Generic.Deleted: 'border:#CC0000 bg:#FFCCCC', + Generic.Inserted: 'border:#00CC00 bg:#CCFFCC', + Generic.Error: '#FF0000', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.Prompt: 'bold #000099', + Generic.Output: '#AAAAAA', + Generic.Traceback: '#99CC66', + + Error: 'bg:#FFAAAA #AA0000' + } diff --git a/shared/package-files/09/091cc0c2a376ab8d2d5fcee31dda9eb881d45c339100cdc8c3c0b581864c0cc1/blob b/shared/package-files/09/091cc0c2a376ab8d2d5fcee31dda9eb881d45c339100cdc8c3c0b581864c0cc1/blob new file mode 100644 index 0000000000000000000000000000000000000000..9991a1c8bfd030f27535d8ad936ddb896fdbf938 --- /dev/null +++ b/shared/package-files/09/091cc0c2a376ab8d2d5fcee31dda9eb881d45c339100cdc8c3c0b581864c0cc1/blob @@ -0,0 +1,822 @@ +import collections +import itertools + +import numpy as np + +from numba import njit, jit, typeof, literally +from numba.core import types, errors, utils +from numba.tests.support import TestCase, MemoryLeakMixin, tag +import unittest + + +Rect = collections.namedtuple('Rect', ('width', 'height')) + +Point = collections.namedtuple('Point', ('x', 'y', 'z')) + +Point2 = collections.namedtuple('Point2', ('x', 'y', 'z')) + +Empty = collections.namedtuple('Empty', ()) + +def tuple_return_usecase(a, b): + return a, b + +def tuple_first(tup): + a, b = tup + return a + +def tuple_second(tup): + a, b = tup + return b + +def tuple_index(tup, idx): + return tup[idx] + +def tuple_index_static(tup): + # Note the negative index + return tup[-2] + +def tuple_slice2(tup): + return tup[1:-1] + +def tuple_slice3(tup): + return tup[1::2] + +def len_usecase(tup): + return len(tup) + +def add_usecase(a, b): + return a + b + +def eq_usecase(a, b): + return a == b + +def ne_usecase(a, b): + return a != b + +def gt_usecase(a, b): + return a > b + +def ge_usecase(a, b): + return a >= b + +def lt_usecase(a, b): + return a < b + +def le_usecase(a, b): + return a <= b + +def in_usecase(a, b): + return a in b + +def bool_usecase(tup): + return bool(tup), (3 if tup else 2) + +def getattr_usecase(tup): + return tup.z, tup.y, tup.x + +def make_point(a, b, c): + return Point(a, b, c) + +def make_point_kws(a, b, c): + return Point(z=c, y=b, x=a) + +def make_point_nrt(n): + r = Rect(list(range(n)), np.zeros(n + 1)) + # This also exercises attribute access + p = Point(r, len(r.width), len(r.height)) + return p + +def type_usecase(tup, *args): + return type(tup)(*args) + +def identity(tup): + return tup + +def index_method_usecase(tup, value): + return tup.index(value) + +def tuple_unpack_static_getitem_err(): + # see issue3895, `c` is imprecise + a, b, c, d = [], [], [], 0.0 + a.append(1) + b.append(1) + return + + +class TestTupleLengthError(unittest.TestCase): + + def test_tuple_length_error(self): + # issue 2195 + # raise an error on tuples greater than 1000 in length + @njit + def eattuple(tup): + return len(tup) + + with self.assertRaises(errors.UnsupportedError) as raises: + tup = tuple(range(1001)) + eattuple(tup) + + expected = "Tuple 'tup' length must be smaller than 1000" + self.assertIn(expected, str(raises.exception)) + +class TestTupleTypeNotIterable(unittest.TestCase): + ''' + issue 4369 + raise an error if 'type' is not iterable + ''' + def test_namedtuple_types_exception(self): + with self.assertRaises(errors.TypingError) as raises: + types.NamedTuple(types.uint32, 'p') + self.assertIn( + "Argument 'types' is not iterable", + str(raises.exception) + ) + + def test_tuple_types_exception(self): + with self.assertRaises(errors.TypingError) as raises: + types.Tuple((types.uint32)) + self.assertIn( + "Argument 'types' is not iterable", + str(raises.exception) + ) + + +class TestTupleReturn(TestCase): + + def test_array_tuple(self): + aryty = types.Array(types.float64, 1, 'C') + cfunc = njit((aryty, aryty))(tuple_return_usecase) + a = b = np.arange(5, dtype='float64') + ra, rb = cfunc(a, b) + self.assertPreciseEqual(ra, a) + self.assertPreciseEqual(rb, b) + del a, b + self.assertPreciseEqual(ra, rb) + + def test_scalar_tuple(self): + scalarty = types.float32 + cfunc = njit((scalarty, scalarty))(tuple_return_usecase) + a = b = 1 + ra, rb = cfunc(a, b) + self.assertEqual(ra, a) + self.assertEqual(rb, b) + + def test_hetero_tuple(self): + alltypes = [] + allvalues = [] + + alltypes.append((types.int32, types.int64)) + allvalues.append((1, 2)) + + alltypes.append((types.float32, types.float64)) + allvalues.append((1.125, .25)) + + alltypes.append((types.int32, types.float64)) + allvalues.append((1231, .5)) + + for (ta, tb), (a, b) in zip(alltypes, allvalues): + cfunc = njit((ta, tb))(tuple_return_usecase) + ra, rb = cfunc(a, b) + self.assertPreciseEqual((ra, rb), (a, b)) + + +class TestTuplePassing(TestCase): + + def test_unituple(self): + tuple_type = types.UniTuple(types.int32, 2) + cf_first = njit((tuple_type,))(tuple_first) + cf_second = njit((tuple_type,))(tuple_second) + self.assertPreciseEqual(cf_first((4, 5)), 4) + self.assertPreciseEqual(cf_second((4, 5)), 5) + + def test_hetero_tuple(self): + tuple_type = types.Tuple((types.int64, types.float32)) + cf_first = njit((tuple_type,))(tuple_first) + cf_second = njit((tuple_type,))(tuple_second) + self.assertPreciseEqual(cf_first((2**61, 1.5)), 2**61) + self.assertPreciseEqual(cf_second((2**61, 1.5)), 1.5) + + def test_size_mismatch(self): + # Issue #1638: tuple size should be checked when unboxing + tuple_type = types.UniTuple(types.int32, 2) + cfunc = njit((tuple_type,))(tuple_first) + entry_point = cfunc.overloads[cfunc.signatures[0]].entry_point + with self.assertRaises(ValueError) as raises: + entry_point((4, 5, 6)) + self.assertEqual(str(raises.exception), + ("size mismatch for tuple, " + "expected 2 element(s) but got 3")) + + +class TestOperations(TestCase): + + def test_len(self): + pyfunc = len_usecase + cfunc = njit((types.Tuple((types.int64, types.float32)),))(pyfunc) + self.assertPreciseEqual(cfunc((4, 5)), 2) + cfunc = njit((types.UniTuple(types.int64, 3),))(pyfunc) + self.assertPreciseEqual(cfunc((4, 5, 6)), 3) + + def test_index_literal(self): + # issue #6023, test non-static getitem with IntegerLiteral index + def pyfunc(tup, idx): + idx = literally(idx) + return tup[idx] + cfunc = njit(pyfunc) + + tup = (4, 3.1, 'sss') + for i in range(len(tup)): + self.assertPreciseEqual(cfunc(tup, i), tup[i]) + + def test_index(self): + pyfunc = tuple_index + cfunc = njit((types.UniTuple(types.int64, 3), types.int64),)(pyfunc) + tup = (4, 3, 6) + for i in range(len(tup)): + self.assertPreciseEqual(cfunc(tup, i), tup[i]) + + # test negative indexing + for i in range(len(tup) + 1): + self.assertPreciseEqual(cfunc(tup, -i), tup[-i]) + + # oob indexes, +ve then -ve + with self.assertRaises(IndexError) as raises: + cfunc(tup, len(tup)) + self.assertEqual("tuple index out of range", str(raises.exception)) + with self.assertRaises(IndexError) as raises: + cfunc(tup, -(len(tup) + 1)) + self.assertEqual("tuple index out of range", str(raises.exception)) + + # Test empty tuple, this is a bit unusual as `njit` will infer the empty + # tuple arg as a types.Tuple and not match the compiled signature, this + # is essentially because the test originally relied on + # `compile_isolated`. + args = (types.UniTuple(types.int64, 0), types.int64,) + cr = njit(args)(pyfunc).overloads[args] + with self.assertRaises(IndexError) as raises: + cr.entry_point((), 0) + self.assertEqual("tuple index out of range", str(raises.exception)) + + # test uintp indexing (because, e.g., parfor generates unsigned prange) + cfunc = njit((types.UniTuple(types.int64, 3), types.uintp,),)(pyfunc) + for i in range(len(tup)): + self.assertPreciseEqual(cfunc(tup, types.uintp(i)), tup[i]) + + # With a compile-time static index (the code generation path is + # different) + pyfunc = tuple_index_static + for typ in (types.UniTuple(types.int64, 4), + types.Tuple((types.int64, types.int32, types.int64, types.int32))): + cfunc = njit((typ,))(pyfunc) + tup = (4, 3, 42, 6) + self.assertPreciseEqual(cfunc(tup), pyfunc(tup)) + + typ = types.UniTuple(types.int64, 1) + with self.assertTypingError(): + njit((typ,))(pyfunc) + + # test unpack, staticgetitem with imprecise type (issue #3895) + pyfunc = tuple_unpack_static_getitem_err + with self.assertTypingError() as raises: + njit((),)(pyfunc) + msg = ("Cannot infer the type of variable 'c', have imprecise type: " + "list(undefined).") + self.assertIn(msg, str(raises.exception)) + + def test_in(self): + pyfunc = in_usecase + cfunc = njit((types.int64, types.UniTuple(types.int64, 3),),)(pyfunc) + tup = (4, 1, 5) + for i in range(5): + self.assertPreciseEqual(cfunc(i, tup), pyfunc(i, tup)) + + # Test the empty case + cfunc = njit((types.int64, types.Tuple([]),),)(pyfunc) + self.assertPreciseEqual(cfunc(1, ()), pyfunc(1, ())) + + def check_slice(self, pyfunc): + tup = (4, 5, 6, 7) + cfunc = njit((types.UniTuple(types.int64, 4),),)(pyfunc) + self.assertPreciseEqual(cfunc(tup), pyfunc(tup)) + args = types.Tuple((types.int64, types.int32, types.int64, types.int32)) + cfunc = njit((args,))(pyfunc) + self.assertPreciseEqual(cfunc(tup), pyfunc(tup)) + + def test_slice2(self): + self.check_slice(tuple_slice2) + + def test_slice3(self): + self.check_slice(tuple_slice3) + + def test_bool(self): + pyfunc = bool_usecase + cfunc = njit((types.Tuple((types.int64, types.int32)),),)(pyfunc) + args = ((4, 5),) + self.assertPreciseEqual(cfunc(*args), pyfunc(*args)) + cfunc = njit((types.UniTuple(types.int64, 3),),)(pyfunc) + args = ((4, 5, 6),) + self.assertPreciseEqual(cfunc(*args), pyfunc(*args)) + cfunc = njit((types.Tuple(()),),)(pyfunc) + self.assertPreciseEqual(cfunc(()), pyfunc(())) + + def test_add(self): + pyfunc = add_usecase + samples = [(types.Tuple(()), ()), + (types.UniTuple(types.int32, 0), ()), + (types.UniTuple(types.int32, 1), (42,)), + (types.Tuple((types.int64, types.float32)), (3, 4.5)), + ] + for (ta, a), (tb, b) in itertools.product(samples, samples): + cfunc = njit((ta, tb),)(pyfunc) + expected = pyfunc(a, b) + got = cfunc(a, b) + self.assertPreciseEqual(got, expected, msg=(ta, tb)) + + def _test_compare(self, pyfunc): + def eq(pyfunc, cfunc, args): + self.assertIs(cfunc(*args), pyfunc(*args), + "mismatch for arguments %s" % (args,)) + + # Same-sized tuples + argtypes = [types.Tuple((types.int64, types.float32)), + types.UniTuple(types.int32, 2)] + for ta, tb in itertools.product(argtypes, argtypes): + cfunc = njit((ta, tb),)(pyfunc) + for args in [((4, 5), (4, 5)), + ((4, 5), (4, 6)), + ((4, 6), (4, 5)), + ((4, 5), (5, 4))]: + eq(pyfunc, cfunc, args) + # Different-sized tuples + argtypes = [types.Tuple((types.int64, types.float32)), + types.UniTuple(types.int32, 3)] + cfunc = njit(tuple(argtypes),)(pyfunc) + for args in [((4, 5), (4, 5, 6)), + ((4, 5), (4, 4, 6)), + ((4, 5), (4, 6, 7))]: + eq(pyfunc, cfunc, args) + + def test_eq(self): + self._test_compare(eq_usecase) + + def test_ne(self): + self._test_compare(ne_usecase) + + def test_gt(self): + self._test_compare(gt_usecase) + + def test_ge(self): + self._test_compare(ge_usecase) + + def test_lt(self): + self._test_compare(lt_usecase) + + def test_le(self): + self._test_compare(le_usecase) + + +class TestNamedTuple(TestCase, MemoryLeakMixin): + + def test_unpack(self): + def check(p): + for pyfunc in tuple_first, tuple_second: + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check(Rect(4, 5)) + # Heterogeneous + check(Rect(4, 5.5)) + + def test_len(self): + def check(p): + pyfunc = len_usecase + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check(Rect(4, 5)) + check(Point(4, 5, 6)) + # Heterogeneous + check(Rect(4, 5.5)) + check(Point(4, 5.5, 6j)) + + def test_index(self): + pyfunc = tuple_index + cfunc = jit(nopython=True)(pyfunc) + + p = Point(4, 5, 6) + for i in range(len(p)): + self.assertPreciseEqual(cfunc(p, i), pyfunc(p, i)) + + # test uintp indexing (because, e.g., parfor generates unsigned prange) + for i in range(len(p)): + self.assertPreciseEqual(cfunc(p, types.uintp(i)), pyfunc(p, i)) + + def test_bool(self): + def check(p): + pyfunc = bool_usecase + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check(Rect(4, 5)) + # Heterogeneous + check(Rect(4, 5.5)) + check(Empty()) + + def _test_compare(self, pyfunc): + def eq(pyfunc, cfunc, args): + self.assertIs(cfunc(*args), pyfunc(*args), + "mismatch for arguments %s" % (args,)) + + cfunc = jit(nopython=True)(pyfunc) + + # Same-sized named tuples + for a, b in [((4, 5), (4, 5)), + ((4, 5), (4, 6)), + ((4, 6), (4, 5)), + ((4, 5), (5, 4))]: + eq(pyfunc, cfunc, (Rect(*a), Rect(*b))) + + # Different-sized named tuples + for a, b in [((4, 5), (4, 5, 6)), + ((4, 5), (4, 4, 6)), + ((4, 5), (4, 6, 7))]: + eq(pyfunc, cfunc, (Rect(*a), Point(*b))) + + def test_eq(self): + self._test_compare(eq_usecase) + + def test_ne(self): + self._test_compare(ne_usecase) + + def test_gt(self): + self._test_compare(gt_usecase) + + def test_ge(self): + self._test_compare(ge_usecase) + + def test_lt(self): + self._test_compare(lt_usecase) + + def test_le(self): + self._test_compare(le_usecase) + + def test_getattr(self): + pyfunc = getattr_usecase + cfunc = jit(nopython=True)(pyfunc) + + for args in (4, 5, 6), (4, 5.5, 6j): + p = Point(*args) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + def test_construct(self): + def check(pyfunc): + cfunc = jit(nopython=True)(pyfunc) + for args in (4, 5, 6), (4, 5.5, 6j): + expected = pyfunc(*args) + got = cfunc(*args) + self.assertIs(type(got), type(expected)) + self.assertPreciseEqual(got, expected) + + check(make_point) + check(make_point_kws) + + def test_type(self): + # Test the type() built-in on named tuples + pyfunc = type_usecase + cfunc = jit(nopython=True)(pyfunc) + + arg_tuples = [(4, 5, 6), (4, 5.5, 6j)] + for tup_args, args in itertools.product(arg_tuples, arg_tuples): + tup = Point(*tup_args) + expected = pyfunc(tup, *args) + got = cfunc(tup, *args) + self.assertIs(type(got), type(expected)) + self.assertPreciseEqual(got, expected) + + def test_literal_unification(self): + # Test for #3565. + @jit(nopython=True) + def Data1(value): + return Rect(value, -321) + + @jit(nopython=True) + def call(i, j): + if j == 0: + # In the error, `result` is typed to `Rect(int, LiteralInt)` + # because of the `-321` literal. This doesn't match the + # `result` type in the other branch. + result = Data1(i) + else: + # `result` is typed to be `Rect(int, int)` + result = Rect(i, j) + return result + + r = call(123, 1321) + self.assertEqual(r, Rect(width=123, height=1321)) + r = call(123, 0) + self.assertEqual(r, Rect(width=123, height=-321)) + + def test_string_literal_in_ctor(self): + # Test for issue #3813 + + @jit(nopython=True) + def foo(): + return Rect(10, 'somestring') + + r = foo() + self.assertEqual(r, Rect(width=10, height='somestring')) + + def test_dispatcher_mistreat(self): + # Test for issue #5215 that mistreat namedtuple as tuples + @jit(nopython=True) + def foo(x): + return x + + in1 = (1, 2, 3) + out1 = foo(in1) + self.assertEqual(in1, out1) + + in2 = Point(1, 2, 3) + out2 = foo(in2) + self.assertEqual(in2, out2) + + # Check the signatures + self.assertEqual(len(foo.nopython_signatures), 2) + self.assertEqual(foo.nopython_signatures[0].args[0], typeof(in1)) + self.assertEqual(foo.nopython_signatures[1].args[0], typeof(in2)) + + # Differently named + in3 = Point2(1, 2, 3) + out3 = foo(in3) + self.assertEqual(in3, out3) + self.assertEqual(len(foo.nopython_signatures), 3) + self.assertEqual(foo.nopython_signatures[2].args[0], typeof(in3)) + + +class TestTupleNRT(TestCase, MemoryLeakMixin): + def test_tuple_add(self): + def pyfunc(x): + a = np.arange(3) + return (a,) + (x,) + + cfunc = jit(nopython=True)(pyfunc) + x = 123 + expect_a, expect_x = pyfunc(x) + got_a, got_x = cfunc(x) + np.testing.assert_equal(got_a, expect_a) + self.assertEqual(got_x, expect_x) + + +class TestNamedTupleNRT(TestCase, MemoryLeakMixin): + + def test_return(self): + # Check returning a namedtuple with a list inside it + pyfunc = make_point_nrt + cfunc = jit(nopython=True)(pyfunc) + + for arg in (3, 0): + expected = pyfunc(arg) + got = cfunc(arg) + self.assertIs(type(got), type(expected)) + self.assertPreciseEqual(got, expected) + + +class TestConversions(TestCase): + """ + Test implicit conversions between tuple types. + """ + + def check_conversion(self, fromty, toty, val): + pyfunc = identity + cfunc = njit(toty(fromty))(pyfunc) + res = cfunc(val) + self.assertEqual(res, val) + + def test_conversions(self): + check = self.check_conversion + fromty = types.UniTuple(types.int32, 2) + check(fromty, types.UniTuple(types.float32, 2), (4, 5)) + check(fromty, types.Tuple((types.float32, types.int16)), (4, 5)) + aty = types.UniTuple(types.int32, 0) + bty = types.Tuple(()) + check(aty, bty, ()) + check(bty, aty, ()) + + with self.assertRaises(errors.TypingError) as raises: + check(fromty, types.Tuple((types.float32,)), (4, 5)) + msg = "No conversion from UniTuple(int32 x 2) to UniTuple(float32 x 1)" + self.assertIn(msg, str(raises.exception)) + + +class TestMethods(TestCase): + + def test_index(self): + pyfunc = index_method_usecase + cfunc = jit(nopython=True)(pyfunc) + self.assertEqual(cfunc((1, 2, 3), 2), 1) + + with self.assertRaises(ValueError) as raises: + cfunc((1, 2, 3), 4) + msg = 'tuple.index(x): x not in tuple' + self.assertEqual(msg, str(raises.exception)) + + +class TestTupleBuild(TestCase): + + def test_build_unpack(self): + def check(p): + pyfunc = lambda a: (1, *a) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check((4, 5)) + # Heterogeneous + check((4, 5.5)) + + def test_build_unpack_assign_like(self): + # see #6534 + def check(p): + pyfunc = lambda a: (*a,) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check((4, 5)) + # Heterogeneous + check((4, 5.5)) + + def test_build_unpack_fail_on_list_assign_like(self): + # see #6534 + def check(p): + pyfunc = lambda a: (*a,) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + with self.assertRaises(errors.TypingError) as raises: + check([4, 5]) + + # Python 3.9 has a peephole rewrite due to large changes in tuple + # unpacking. It results in a tuple + list situation from the above + # so the error message reflects that. Catching this specific and + # seemingly rare sequence in the peephole rewrite is prohibitively + # hard. Should it be reported numerous times, revisit then. + msg1 = "No implementation of function" + self.assertIn(msg1, str(raises.exception)) + msg2 = "tuple(reflected list(" # ignore the rest of reflected list + # part, it's repr is quite volatile. + self.assertIn(msg2, str(raises.exception)) + + def test_build_unpack_more(self): + def check(p): + pyfunc = lambda a: (1, *a, (1, 2), *a) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check((4, 5)) + # Heterogeneous + check((4, 5.5)) + + def test_build_unpack_call(self): + def check(p): + @jit + def inner(*args): + return args + pyfunc = lambda a: inner(1, *a) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check((4, 5)) + # Heterogeneous + check((4, 5.5)) + + def test_build_unpack_call_more(self): + def check(p): + @jit + def inner(*args): + return args + pyfunc = lambda a: inner(1, *a, *(1, 2), *a) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check((4, 5)) + # Heterogeneous + check((4, 5.5)) + + def test_tuple_constructor(self): + def check(pyfunc, arg): + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(arg), pyfunc(arg)) + + # empty + check(lambda _: tuple(), ()) + # Homogeneous + check(lambda a: tuple(a), (4, 5)) + # Heterogeneous + check(lambda a: tuple(a), (4, 5.5)) + + def test_many_positional_args_are_one_build_tuple(self): + # CPython emits BUILD_LIST/LIST_APPEND/LIST_TO_TUPLE/CALL_FUNCTION_EX + # for calls with more than 30 arguments. Coalescing the appends keeps + # the IR (and the LLVM generated from it) linear in the argument count + # instead of quadratic. + from numba.core import compiler, ir + + n_args = 35 + glbls = {"g": jit(lambda *a: a)} + # variables, not constants: CPython builds a constant tuple and a single + # LIST_EXTEND for literal arguments, which is not the path under test + src = "def f(x):\n return g(%s)\n" % ", ".join(["x"] * n_args) + exec(src, glbls) + + func_ir = compiler.run_frontend(glbls["f"]) + build_tuples = [ + stmt.value + for blk in func_ir.blocks.values() + for stmt in blk.body + if isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op == "build_tuple" + ] + # all the appends land in a single build_tuple (the empty list the + # peephole starts from may survive as dead code) + self.assertEqual( + [len(bt.items) for bt in build_tuples if bt.items], [n_args] + ) + binops = [ + stmt + for blk in func_ir.blocks.values() + for stmt in blk.body + if isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op == "binop" + ] + self.assertFalse(binops) + + self.assertPreciseEqual(glbls["f"](3), (3,) * n_args) + + def test_many_positional_args_mixed_with_unpack(self): + # runs of appends are coalesced around the extends, order preserved + @jit + def inner(*args): + return args + + n = 33 + glbls = {"inner": inner} + src = ( + "def f(t, x):\n return inner(%s, *t, x, *t)\n" + % ", ".join(["x"] * n) + ) + exec(src, glbls) + pyfunc = glbls["f"] + cfunc = jit(pyfunc) + for arg in ((4, 5), (4, 5.5)): + self.assertPreciseEqual(cfunc(arg, 1), pyfunc(arg, 1)) + + def test_unpack_with_predicate_fails(self): + # this fails as the list_to_tuple/list_extend peephole bytecode + # rewriting needed for Python 3.9+ cannot yet traverse the CFG. + @njit + def foo(): + a = (1,) + b = (3,2, 4) + return (*(b if a[0] else (5, 6)),) + + with self.assertRaises(errors.UnsupportedBytecodeError) as raises: + foo() + msg = "op_LIST_EXTEND at the start of a block" + self.assertIn(msg, str(raises.exception)) + + def test_build_unpack_with_calls_in_unpack(self): + def check(p): + def pyfunc(a): + z = [1, 2] + return (*a, z.append(3), z.extend(a), np.ones(3)), z + + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + check((4, 5)) + + def test_build_unpack_complicated(self): + def check(p): + def pyfunc(a): + z = [1, 2] + return (*a, *(*a, a), *(a, (*(a, (1, 2), *(3,), *a), + (a, 1, (2, 3), *a, 1), (1,))), + *(z.append(4), z.extend(a))), z + + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + check((10, 20)) + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/09/0920e485d9bcec5089cc33d267b9114aeaee2da5090853bafa0ae75c902884f8/blob b/shared/package-files/09/0920e485d9bcec5089cc33d267b9114aeaee2da5090853bafa0ae75c902884f8/blob new file mode 100644 index 0000000000000000000000000000000000000000..05209ba05b9bc7d47f9d4d358266c90c8f54844e --- /dev/null +++ b/shared/package-files/09/0920e485d9bcec5089cc33d267b9114aeaee2da5090853bafa0ae75c902884f8/blob @@ -0,0 +1,24 @@ +# NOTE: These are incomplete! + +from typing import Callable, Sequence, Tuple + +def cloexec_pipe() -> Tuple[int, int]: ... +def fork_exec( + args: Sequence[str], + executable_list: Sequence[bytes], + close_fds: bool, + fds_to_keep: Sequence[int], + cwd: str, + env_list: Sequence[bytes], + p2cread: int, + p2cwrite: int, + c2pred: int, + c2pwrite: int, + errread: int, + errwrite: int, + errpipe_read: int, + errpipe_write: int, + restore_signals: int, + start_new_session: int, + preexec_fn: Callable[[], None], +) -> int: ... diff --git a/shared/package-files/09/092508d08fd6e88f5f37e9dbeab1a0ccb8c63083b40ba3b03a6cd8cfe1c44195/blob b/shared/package-files/09/092508d08fd6e88f5f37e9dbeab1a0ccb8c63083b40ba3b03a6cd8cfe1c44195/blob new file mode 100644 index 0000000000000000000000000000000000000000..160d6fd76f76dfe0b04aee3d478f05f68a22a195 --- /dev/null +++ b/shared/package-files/09/092508d08fd6e88f5f37e9dbeab1a0ccb8c63083b40ba3b03a6cd8cfe1c44195/blob @@ -0,0 +1,7 @@ +from typing import Dict, Match, Text + +simple_escapes: Dict[Text, Text] + +def escape(m: Match[str]) -> Text: ... +def evalString(s: Text) -> Text: ... +def test() -> None: ... diff --git a/shared/package-files/09/0926566f9f406178d1214f8cc796e166b1213dd7c05e0c5b461a8b8ac9e50bbe/blob b/shared/package-files/09/0926566f9f406178d1214f8cc796e166b1213dd7c05e0c5b461a8b8ac9e50bbe/blob new file mode 100644 index 0000000000000000000000000000000000000000..e87667e1b8c178e53c6a7c6268ebc09ab4b0476c --- /dev/null +++ b/shared/package-files/09/0926566f9f406178d1214f8cc796e166b1213dd7c05e0c5b461a8b8ac9e50bbe/blob @@ -0,0 +1,45 @@ + +BSD Software License + +Pertains to ARPACK and P_ARPACK + +Copyright (c) 1996-2008 Rice University. +Developed by D.C. Sorensen, R.B. Lehoucq, C. Yang, and K. Maschhoff. +All rights reserved. + +Arpack has been renamed to arpack-ng. + +Copyright (c) 2001-2011 - Scilab Enterprises +Updated by Allan Cornet, Sylvestre Ledru. + +Copyright (c) 2010 - Jordi Gutiérrez Hermoso (Octave patch) + +Copyright (c) 2007 - Sébastien Fabbro (gentoo patch) + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer listed + in this license in the documentation and/or other materials + provided with the distribution. + +- Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/shared/package-files/09/0927ec7cc34edb5670920cb2ff1542e46de27a2010746e1662f4276cf3569a24/blob b/shared/package-files/09/0927ec7cc34edb5670920cb2ff1542e46de27a2010746e1662f4276cf3569a24/blob new file mode 100644 index 0000000000000000000000000000000000000000..0661f2682e6f31e60ef0483f198d9b72df9e3962 --- /dev/null +++ b/shared/package-files/09/0927ec7cc34edb5670920cb2ff1542e46de27a2010746e1662f4276cf3569a24/blob @@ -0,0 +1,17 @@ +"Obs","TOTEMP","GNPDEFL","GNP","UNEMP","ARMED","POP","YEAR" +1,60323,83,234289,2356,1590,107608,1947 +2,61122,88.5,259426,2325,1456,108632,1948 +3,60171,88.2,258054,3682,1616,109773,1949 +4,61187,89.5,284599,3351,1650,110929,1950 +5,63221,96.2,328975,2099,3099,112075,1951 +6,63639,98.1,346999,1932,3594,113270,1952 +7,64989,99,365385,1870,3547,115094,1953 +8,63761,100,363112,3578,3350,116219,1954 +9,66019,101.2,397469,2904,3048,117388,1955 +10,67857,104.6,419180,2822,2857,118734,1956 +11,68169,108.4,442769,2936,2798,120445,1957 +12,66513,110.8,444546,4681,2637,121950,1958 +13,68655,112.6,482704,3813,2552,123366,1959 +14,69564,114.2,502601,3931,2514,125368,1960 +15,69331,115.7,518173,4806,2572,127852,1961 +16,70551,116.9,554894,4007,2827,130081,1962 diff --git a/shared/package-files/09/09283c5fe86aebeea35bcbe48ba6957c415845419358e839f2c8a53355cd5db5/blob b/shared/package-files/09/09283c5fe86aebeea35bcbe48ba6957c415845419358e839f2c8a53355cd5db5/blob new file mode 100644 index 0000000000000000000000000000000000000000..44916ba96293db19756b8222422e76945aa48ebb --- /dev/null +++ b/shared/package-files/09/09283c5fe86aebeea35bcbe48ba6957c415845419358e839f2c8a53355cd5db5/blob @@ -0,0 +1,40 @@ +"""Regression tests for optimize. + +""" +import numpy as np +from numpy.testing import assert_almost_equal +from pytest import raises as assert_raises + +import scipy.optimize + + +class TestRegression: + + def test_newton_x0_is_0(self): + # Regression test for gh-1601 + tgt = 1 + res = scipy.optimize.newton(lambda x: x - 1, 0) + assert_almost_equal(res, tgt) + + def test_newton_integers(self): + # Regression test for gh-1741 + root = scipy.optimize.newton(lambda x: x**2 - 1, x0=2, + fprime=lambda x: 2*x) + assert_almost_equal(root, 1.0) + + def test_lmdif_errmsg(self): + # This shouldn't cause a crash on Python 3 + class SomeError(Exception): + pass + counter = [0] + + def func(x): + counter[0] += 1 + if counter[0] < 3: + return x**2 - np.array([9, 10, 11]) + else: + raise SomeError() + assert_raises(SomeError, + scipy.optimize.leastsq, + func, [1, 2, 3]) + diff --git a/shared/package-files/09/0929b63f53e2dfb1d716ff4578585f8db35bcd6dc6884e41f9cf1fe0254771e7/blob b/shared/package-files/09/0929b63f53e2dfb1d716ff4578585f8db35bcd6dc6884e41f9cf1fe0254771e7/blob new file mode 100644 index 0000000000000000000000000000000000000000..065812694cfe4e17623d5fa0464b8ea5f0199a6a --- /dev/null +++ b/shared/package-files/09/0929b63f53e2dfb1d716ff4578585f8db35bcd6dc6884e41f9cf1fe0254771e7/blob @@ -0,0 +1,59 @@ +#pragma once + +// ${generated_comment} + +#include +#include + +#include + +#include +#include + +#include // for size_t +#include // for function +#include // for unique_ptr +#include +#include + +namespace at { + struct Quantizer; +}; + +namespace torch { namespace autograd { + +using Variable = at::Tensor; +using at::Context; +using at::Device; +using at::Dimname; +using at::DimnameList; +using at::Generator; +using at::IntArrayRef; +using at::MemoryFormat; +using at::QScheme; +using at::Scalar; +using at::ScalarType; +using at::Storage; +using at::Tensor; +using at::TensorList; +using at::TensorOptions; +using at::Quantizer; +// This is temporary typedef to enable Quantizer in aten native function API +// we'll remove them when we are actually exposing Quantizer class +// to frontend +using ConstQuantizerPtr = const c10::intrusive_ptr&; +using c10::optional; + +namespace VariableType { + TORCH_API std::vector allCUDATypes(); + TORCH_API std::vector allXPUTypes(); + TORCH_API std::vector allCPUTypes(); + TORCH_API std::vector allPrivateUser1Types(); + + at::Tensor & unpack(Tensor & t, const char * name, int pos); + const at::Tensor & unpack(const Tensor & t, const char * name, int pos); + at::Tensor unpack_opt(const Tensor & t, const char * name, int pos); + std::vector unpack(const at::ITensorListRef& tl, const char *name, int pos); +}; + +}} // namespace torch::autograd diff --git a/shared/package-files/09/0929d7f0f99fd683c29ddee3edb9f5fdfe7c1bd28736201b96f549e73ca437e0/blob b/shared/package-files/09/0929d7f0f99fd683c29ddee3edb9f5fdfe7c1bd28736201b96f549e73ca437e0/blob new file mode 100644 index 0000000000000000000000000000000000000000..ed578aa2500d8917d5d3ed1249526b48ad7ee996 --- /dev/null +++ b/shared/package-files/09/0929d7f0f99fd683c29ddee3edb9f5fdfe7c1bd28736201b96f549e73ca437e0/blob @@ -0,0 +1,183 @@ +import logging +import os +import shutil +from optparse import Values +from typing import List + +from pip._internal.cache import WheelCache +from pip._internal.cli import cmdoptions +from pip._internal.cli.req_command import RequirementCommand, with_cleanup +from pip._internal.cli.status_codes import SUCCESS +from pip._internal.exceptions import CommandError +from pip._internal.operations.build.build_tracker import get_build_tracker +from pip._internal.req.req_install import ( + InstallRequirement, + check_legacy_setup_py_options, +) +from pip._internal.utils.misc import ensure_dir, normalize_path +from pip._internal.utils.temp_dir import TempDirectory +from pip._internal.wheel_builder import build, should_build_for_wheel_command + +logger = logging.getLogger(__name__) + + +class WheelCommand(RequirementCommand): + """ + Build Wheel archives for your requirements and dependencies. + + Wheel is a built-package format, and offers the advantage of not + recompiling your software during every install. For more details, see the + wheel docs: https://wheel.readthedocs.io/en/latest/ + + 'pip wheel' uses the build system interface as described here: + https://pip.pypa.io/en/stable/reference/build-system/ + + """ + + usage = """ + %prog [options] ... + %prog [options] -r ... + %prog [options] [-e] ... + %prog [options] [-e] ... + %prog [options] ...""" + + def add_options(self) -> None: + self.cmd_opts.add_option( + "-w", + "--wheel-dir", + dest="wheel_dir", + metavar="dir", + default=os.curdir, + help=( + "Build wheels into , where the default is the " + "current working directory." + ), + ) + self.cmd_opts.add_option(cmdoptions.no_binary()) + self.cmd_opts.add_option(cmdoptions.only_binary()) + self.cmd_opts.add_option(cmdoptions.prefer_binary()) + self.cmd_opts.add_option(cmdoptions.no_build_isolation()) + self.cmd_opts.add_option(cmdoptions.use_pep517()) + self.cmd_opts.add_option(cmdoptions.no_use_pep517()) + self.cmd_opts.add_option(cmdoptions.check_build_deps()) + self.cmd_opts.add_option(cmdoptions.constraints()) + self.cmd_opts.add_option(cmdoptions.editable()) + self.cmd_opts.add_option(cmdoptions.requirements()) + self.cmd_opts.add_option(cmdoptions.src()) + self.cmd_opts.add_option(cmdoptions.ignore_requires_python()) + self.cmd_opts.add_option(cmdoptions.no_deps()) + self.cmd_opts.add_option(cmdoptions.progress_bar()) + + self.cmd_opts.add_option( + "--no-verify", + dest="no_verify", + action="store_true", + default=False, + help="Don't verify if built wheel is valid.", + ) + + self.cmd_opts.add_option(cmdoptions.config_settings()) + self.cmd_opts.add_option(cmdoptions.build_options()) + self.cmd_opts.add_option(cmdoptions.global_options()) + + self.cmd_opts.add_option( + "--pre", + action="store_true", + default=False, + help=( + "Include pre-release and development versions. By default, " + "pip only finds stable versions." + ), + ) + + self.cmd_opts.add_option(cmdoptions.require_hashes()) + + index_opts = cmdoptions.make_option_group( + cmdoptions.index_group, + self.parser, + ) + + self.parser.insert_option_group(0, index_opts) + self.parser.insert_option_group(0, self.cmd_opts) + + @with_cleanup + def run(self, options: Values, args: List[str]) -> int: + session = self.get_default_session(options) + + finder = self._build_package_finder(options, session) + + options.wheel_dir = normalize_path(options.wheel_dir) + ensure_dir(options.wheel_dir) + + build_tracker = self.enter_context(get_build_tracker()) + + directory = TempDirectory( + delete=not options.no_clean, + kind="wheel", + globally_managed=True, + ) + + reqs = self.get_requirements(args, options, finder, session) + check_legacy_setup_py_options(options, reqs) + + wheel_cache = WheelCache(options.cache_dir) + + preparer = self.make_requirement_preparer( + temp_build_dir=directory, + options=options, + build_tracker=build_tracker, + session=session, + finder=finder, + download_dir=options.wheel_dir, + use_user_site=False, + verbosity=self.verbosity, + ) + + resolver = self.make_resolver( + preparer=preparer, + finder=finder, + options=options, + wheel_cache=wheel_cache, + ignore_requires_python=options.ignore_requires_python, + use_pep517=options.use_pep517, + ) + + self.trace_basic_info(finder) + + requirement_set = resolver.resolve(reqs, check_supported_wheels=True) + + reqs_to_build: List[InstallRequirement] = [] + for req in requirement_set.requirements.values(): + if req.is_wheel: + preparer.save_linked_requirement(req) + elif should_build_for_wheel_command(req): + reqs_to_build.append(req) + + preparer.prepare_linked_requirements_more(requirement_set.requirements.values()) + requirement_set.warn_legacy_versions_and_specifiers() + + # build wheels + build_successes, build_failures = build( + reqs_to_build, + wheel_cache=wheel_cache, + verify=(not options.no_verify), + build_options=options.build_options or [], + global_options=options.global_options or [], + ) + for req in build_successes: + assert req.link and req.link.is_wheel + assert req.local_file_path + # copy from cache to target directory + try: + shutil.copy(req.local_file_path, options.wheel_dir) + except OSError as e: + logger.warning( + "Building wheel for %s failed: %s", + req.name, + e, + ) + build_failures.append(req) + if len(build_failures) != 0: + raise CommandError("Failed to build one or more wheels") + + return SUCCESS diff --git a/shared/package-files/09/092ac789ee7dfcd8cd67d07619a1f328f36c333c66e4a87a1aec65624f334ee2/blob b/shared/package-files/09/092ac789ee7dfcd8cd67d07619a1f328f36c333c66e4a87a1aec65624f334ee2/blob new file mode 100644 index 0000000000000000000000000000000000000000..587e5f104cbf095f851ec538601ca146377b51ae --- /dev/null +++ b/shared/package-files/09/092ac789ee7dfcd8cd67d07619a1f328f36c333c66e4a87a1aec65624f334ee2/blob @@ -0,0 +1,22 @@ +from sympy.integrals.singularityfunctions import singularityintegrate +from sympy.core.function import Function +from sympy.core.symbol import symbols +from sympy.functions.special.singularity_functions import SingularityFunction + +x, a, n, y = symbols('x a n y') +f = Function('f') + + +def test_singularityintegrate(): + assert singularityintegrate(x, x) is None + assert singularityintegrate(x + SingularityFunction(x, 9, 1), x) is None + + assert 4*singularityintegrate(SingularityFunction(x, a, 3), x) == 4*SingularityFunction(x, a, 4)/4 + assert singularityintegrate(5*SingularityFunction(x, 5, -2), x) == 5*SingularityFunction(x, 5, -1) + assert singularityintegrate(6*SingularityFunction(x, 5, -1), x) == 6*SingularityFunction(x, 5, 0) + assert singularityintegrate(x*SingularityFunction(x, 0, -1), x) == 0 + assert singularityintegrate((x - 5)*SingularityFunction(x, 5, -1), x) == 0 + assert singularityintegrate(SingularityFunction(x, 0, -1) * f(x), x) == f(0) * SingularityFunction(x, 0, 0) + assert singularityintegrate(SingularityFunction(x, 1, -1) * f(x), x) == f(1) * SingularityFunction(x, 1, 0) + assert singularityintegrate(y*SingularityFunction(x, 0, -1)**2, x) == \ + y*SingularityFunction(0, 0, -1)*SingularityFunction(x, 0, 0) diff --git a/shared/package-files/09/092c55c8d143ede58245b8d0e5c3b44bf4d4328707a86312614542073abeeaf9/blob b/shared/package-files/09/092c55c8d143ede58245b8d0e5c3b44bf4d4328707a86312614542073abeeaf9/blob new file mode 100644 index 0000000000000000000000000000000000000000..9cdebee676db088e052c2c9d2f4c66ef96189cb6 --- /dev/null +++ b/shared/package-files/09/092c55c8d143ede58245b8d0e5c3b44bf4d4328707a86312614542073abeeaf9/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor logit_backward(const at::Tensor & grad_output, const at::Tensor & self, c10::optional eps=c10::nullopt); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/09/092e0bf966c8d99b962e06c6013b45e35fbe87488691fb84e9d2b90d86220b98/blob b/shared/package-files/09/092e0bf966c8d99b962e06c6013b45e35fbe87488691fb84e9d2b90d86220b98/blob new file mode 100644 index 0000000000000000000000000000000000000000..372a5b0356b7a7473ecf595df45ae31c3bfaff71 --- /dev/null +++ b/shared/package-files/09/092e0bf966c8d99b962e06c6013b45e35fbe87488691fb84e9d2b90d86220b98/blob @@ -0,0 +1,89 @@ +from sympy.concrete.products import Product +from sympy.concrete.summations import Sum +from sympy.core.function import Derivative +from sympy.core.numbers import Integer, Rational, Float, oo +from sympy.core.relational import Rel +from sympy.core.symbol import symbols +from sympy.functions import sin +from sympy.integrals.integrals import Integral +from sympy.series.order import Order + +from sympy.printing.precedence import precedence, PRECEDENCE + +x, y = symbols("x,y") + + +def test_Add(): + assert precedence(x + y) == PRECEDENCE["Add"] + assert precedence(x*y + 1) == PRECEDENCE["Add"] + + +def test_Function(): + assert precedence(sin(x)) == PRECEDENCE["Func"] + +def test_Derivative(): + assert precedence(Derivative(x, y)) == PRECEDENCE["Atom"] + +def test_Integral(): + assert precedence(Integral(x, y)) == PRECEDENCE["Atom"] + + +def test_Mul(): + assert precedence(x*y) == PRECEDENCE["Mul"] + assert precedence(-x*y) == PRECEDENCE["Add"] + + +def test_Number(): + assert precedence(Integer(0)) == PRECEDENCE["Atom"] + assert precedence(Integer(1)) == PRECEDENCE["Atom"] + assert precedence(Integer(-1)) == PRECEDENCE["Add"] + assert precedence(Integer(10)) == PRECEDENCE["Atom"] + assert precedence(Rational(5, 2)) == PRECEDENCE["Mul"] + assert precedence(Rational(-5, 2)) == PRECEDENCE["Add"] + assert precedence(Float(5)) == PRECEDENCE["Atom"] + assert precedence(Float(-5)) == PRECEDENCE["Add"] + assert precedence(oo) == PRECEDENCE["Atom"] + assert precedence(-oo) == PRECEDENCE["Add"] + + +def test_Order(): + assert precedence(Order(x)) == PRECEDENCE["Atom"] + + +def test_Pow(): + assert precedence(x**y) == PRECEDENCE["Pow"] + assert precedence(-x**y) == PRECEDENCE["Add"] + assert precedence(x**-y) == PRECEDENCE["Pow"] + + +def test_Product(): + assert precedence(Product(x, (x, y, y + 1))) == PRECEDENCE["Atom"] + + +def test_Relational(): + assert precedence(Rel(x + y, y, "<")) == PRECEDENCE["Relational"] + + +def test_Sum(): + assert precedence(Sum(x, (x, y, y + 1))) == PRECEDENCE["Atom"] + + +def test_Symbol(): + assert precedence(x) == PRECEDENCE["Atom"] + + +def test_And_Or(): + # precedence relations between logical operators, ... + assert precedence(x & y) > precedence(x | y) + assert precedence(~y) > precedence(x & y) + # ... and with other operators (cfr. other programming languages) + assert precedence(x + y) > precedence(x | y) + assert precedence(x + y) > precedence(x & y) + assert precedence(x*y) > precedence(x | y) + assert precedence(x*y) > precedence(x & y) + assert precedence(~y) > precedence(x*y) + assert precedence(~y) > precedence(x - y) + # double checks + assert precedence(x & y) == PRECEDENCE["And"] + assert precedence(x | y) == PRECEDENCE["Or"] + assert precedence(~y) == PRECEDENCE["Not"] diff --git a/shared/package-files/09/092f0da64648f18f2dcb4345402ec665c525339a3cff501bbf519b1a5b6c6e40/blob b/shared/package-files/09/092f0da64648f18f2dcb4345402ec665c525339a3cff501bbf519b1a5b6c6e40/blob new file mode 100644 index 0000000000000000000000000000000000000000..8d4342f81bb372105dbc5a3511bb2159da2e3129 --- /dev/null +++ b/shared/package-files/09/092f0da64648f18f2dcb4345402ec665c525339a3cff501bbf519b1a5b6c6e40/blob @@ -0,0 +1,714 @@ +/* + pybind11/eigen/matrix.h: Transparent conversion for dense and sparse Eigen matrices + + Copyright (c) 2016 Wenzel Jakob + + All rights reserved. Use of this source code is governed by a + BSD-style license that can be found in the LICENSE file. +*/ + +#pragma once + +#include "../numpy.h" +#include "common.h" + +/* HINT: To suppress warnings originating from the Eigen headers, use -isystem. + See also: + https://stackoverflow.com/questions/2579576/i-dir-vs-isystem-dir + https://stackoverflow.com/questions/1741816/isystem-for-ms-visual-studio-c-compiler +*/ +PYBIND11_WARNING_PUSH +PYBIND11_WARNING_DISABLE_MSVC(5054) // https://github.com/pybind/pybind11/pull/3741 +// C5054: operator '&': deprecated between enumerations of different types +#if defined(__MINGW32__) +PYBIND11_WARNING_DISABLE_GCC("-Wmaybe-uninitialized") +#endif + +#include +#include + +PYBIND11_WARNING_POP + +// Eigen prior to 3.2.7 doesn't have proper move constructors--but worse, some classes get implicit +// move constructors that break things. We could detect this an explicitly copy, but an extra copy +// of matrices seems highly undesirable. +static_assert(EIGEN_VERSION_AT_LEAST(3, 2, 7), + "Eigen matrix support in pybind11 requires Eigen >= 3.2.7"); + +PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) + +PYBIND11_WARNING_DISABLE_MSVC(4127) + +// Provide a convenience alias for easier pass-by-ref usage with fully dynamic strides: +using EigenDStride = Eigen::Stride; +template +using EigenDRef = Eigen::Ref; +template +using EigenDMap = Eigen::Map; + +PYBIND11_NAMESPACE_BEGIN(detail) + +#if EIGEN_VERSION_AT_LEAST(3, 3, 0) +using EigenIndex = Eigen::Index; +template +using EigenMapSparseMatrix = Eigen::Map>; +#else +using EigenIndex = EIGEN_DEFAULT_DENSE_INDEX_TYPE; +template +using EigenMapSparseMatrix = Eigen::MappedSparseMatrix; +#endif + +// Matches Eigen::Map, Eigen::Ref, blocks, etc: +template +using is_eigen_dense_map = all_of, + std::is_base_of, T>>; +template +using is_eigen_mutable_map = std::is_base_of, T>; +template +using is_eigen_dense_plain + = all_of>, is_template_base_of>; +template +using is_eigen_sparse = is_template_base_of; +// Test for objects inheriting from EigenBase that aren't captured by the above. This +// basically covers anything that can be assigned to a dense matrix but that don't have a typical +// matrix data layout that can be copied from their .data(). For example, DiagonalMatrix and +// SelfAdjointView fall into this category. +template +using is_eigen_other + = all_of, + negation, is_eigen_dense_plain, is_eigen_sparse>>>; + +// Captures numpy/eigen conformability status (returned by EigenProps::conformable()): +template +struct EigenConformable { + bool conformable = false; + EigenIndex rows = 0, cols = 0; + EigenDStride stride{0, 0}; // Only valid if negativestrides is false! + bool negativestrides = false; // If true, do not use stride! + + // NOLINTNEXTLINE(google-explicit-constructor) + EigenConformable(bool fits = false) : conformable{fits} {} + // Matrix type: + EigenConformable(EigenIndex r, EigenIndex c, EigenIndex rstride, EigenIndex cstride) + : conformable{true}, rows{r}, cols{c}, + // TODO: when Eigen bug #747 is fixed, remove the tests for non-negativity. + // http://eigen.tuxfamily.org/bz/show_bug.cgi?id=747 + stride{EigenRowMajor ? (rstride > 0 ? rstride : 0) + : (cstride > 0 ? cstride : 0) /* outer stride */, + EigenRowMajor ? (cstride > 0 ? cstride : 0) + : (rstride > 0 ? rstride : 0) /* inner stride */}, + negativestrides{rstride < 0 || cstride < 0} {} + // Vector type: + EigenConformable(EigenIndex r, EigenIndex c, EigenIndex stride) + : EigenConformable(r, c, r == 1 ? c * stride : stride, c == 1 ? r : r * stride) {} + + template + bool stride_compatible() const { + // To have compatible strides, we need (on both dimensions) one of fully dynamic strides, + // matching strides, or a dimension size of 1 (in which case the stride value is + // irrelevant). Alternatively, if any dimension size is 0, the strides are not relevant + // (and numpy ≥ 1.23 sets the strides to 0 in that case, so we need to check explicitly). + if (negativestrides) { + return false; + } + if (rows == 0 || cols == 0) { + return true; + } + return (props::inner_stride == Eigen::Dynamic || props::inner_stride == stride.inner() + || (EigenRowMajor ? cols : rows) == 1) + && (props::outer_stride == Eigen::Dynamic || props::outer_stride == stride.outer() + || (EigenRowMajor ? rows : cols) == 1); + } + // NOLINTNEXTLINE(google-explicit-constructor) + operator bool() const { return conformable; } +}; + +template +struct eigen_extract_stride { + using type = Type; +}; +template +struct eigen_extract_stride> { + using type = StrideType; +}; +template +struct eigen_extract_stride> { + using type = StrideType; +}; + +// Helper struct for extracting information from an Eigen type +template +struct EigenProps { + using Type = Type_; + using Scalar = typename Type::Scalar; + using StrideType = typename eigen_extract_stride::type; + static constexpr EigenIndex rows = Type::RowsAtCompileTime, cols = Type::ColsAtCompileTime, + size = Type::SizeAtCompileTime; + static constexpr bool row_major = Type::IsRowMajor, + vector + = Type::IsVectorAtCompileTime, // At least one dimension has fixed size 1 + fixed_rows = rows != Eigen::Dynamic, fixed_cols = cols != Eigen::Dynamic, + fixed = size != Eigen::Dynamic, // Fully-fixed size + dynamic = !fixed_rows && !fixed_cols; // Fully-dynamic size + + template + using if_zero = std::integral_constant; + static constexpr EigenIndex inner_stride + = if_zero::value, + outer_stride = if_zero < StrideType::OuterStrideAtCompileTime, + vector ? size + : row_major ? cols + : rows > ::value; + static constexpr bool dynamic_stride + = inner_stride == Eigen::Dynamic && outer_stride == Eigen::Dynamic; + static constexpr bool requires_row_major + = !dynamic_stride && !vector && (row_major ? inner_stride : outer_stride) == 1; + static constexpr bool requires_col_major + = !dynamic_stride && !vector && (row_major ? outer_stride : inner_stride) == 1; + + // Takes an input array and determines whether we can make it fit into the Eigen type. If + // the array is a vector, we attempt to fit it into either an Eigen 1xN or Nx1 vector + // (preferring the latter if it will fit in either, i.e. for a fully dynamic matrix type). + static EigenConformable conformable(const array &a) { + const auto dims = a.ndim(); + if (dims < 1 || dims > 2) { + return false; + } + + if (dims == 2) { // Matrix type: require exact match (or dynamic) + + EigenIndex np_rows = a.shape(0), np_cols = a.shape(1), + np_rstride = a.strides(0) / static_cast(sizeof(Scalar)), + np_cstride = a.strides(1) / static_cast(sizeof(Scalar)); + if ((fixed_rows && np_rows != rows) || (fixed_cols && np_cols != cols)) { + return false; + } + + return {np_rows, np_cols, np_rstride, np_cstride}; + } + + // Otherwise we're storing an n-vector. Only one of the strides will be used, but + // whichever is used, we want the (single) numpy stride value. + const EigenIndex n = a.shape(0), + stride = a.strides(0) / static_cast(sizeof(Scalar)); + + if (vector) { // Eigen type is a compile-time vector + if (fixed && size != n) { + return false; // Vector size mismatch + } + return {rows == 1 ? 1 : n, cols == 1 ? 1 : n, stride}; + } + if (fixed) { + // The type has a fixed size, but is not a vector: abort + return false; + } + if (fixed_cols) { + // Since this isn't a vector, cols must be != 1. We allow this only if it exactly + // equals the number of elements (rows is Dynamic, and so 1 row is allowed). + if (cols != n) { + return false; + } + return {1, n, stride}; + } // Otherwise it's either fully dynamic, or column dynamic; both become a column vector + if (fixed_rows && rows != n) { + return false; + } + return {n, 1, stride}; + } + + static constexpr bool show_writeable + = is_eigen_dense_map::value && is_eigen_mutable_map::value; + static constexpr bool show_order = is_eigen_dense_map::value; + static constexpr bool show_c_contiguous = show_order && requires_row_major; + static constexpr bool show_f_contiguous + = !show_c_contiguous && show_order && requires_col_major; + + static constexpr auto descriptor + = const_name("numpy.ndarray[") + npy_format_descriptor::name + const_name("[") + + const_name(const_name<(size_t) rows>(), const_name("m")) + const_name(", ") + + const_name(const_name<(size_t) cols>(), const_name("n")) + const_name("]") + + + // For a reference type (e.g. Ref) we have other constraints that might need to + // be satisfied: writeable=True (for a mutable reference), and, depending on the map's + // stride options, possibly f_contiguous or c_contiguous. We include them in the + // descriptor output to provide some hint as to why a TypeError is occurring (otherwise + // it can be confusing to see that a function accepts a 'numpy.ndarray[float64[3,2]]' and + // an error message that you *gave* a numpy.ndarray of the right type and dimensions. + const_name(", flags.writeable", "") + + const_name(", flags.c_contiguous", "") + + const_name(", flags.f_contiguous", "") + const_name("]"); +}; + +// Casts an Eigen type to numpy array. If given a base, the numpy array references the src data, +// otherwise it'll make a copy. writeable lets you turn off the writeable flag for the array. +template +handle +eigen_array_cast(typename props::Type const &src, handle base = handle(), bool writeable = true) { + constexpr ssize_t elem_size = sizeof(typename props::Scalar); + array a; + if (props::vector) { + a = array({src.size()}, {elem_size * src.innerStride()}, src.data(), base); + } else { + a = array({src.rows(), src.cols()}, + {elem_size * src.rowStride(), elem_size * src.colStride()}, + src.data(), + base); + } + + if (!writeable) { + array_proxy(a.ptr())->flags &= ~detail::npy_api::NPY_ARRAY_WRITEABLE_; + } + + return a.release(); +} + +// Takes an lvalue ref to some Eigen type and a (python) base object, creating a numpy array that +// reference the Eigen object's data with `base` as the python-registered base class (if omitted, +// the base will be set to None, and lifetime management is up to the caller). The numpy array is +// non-writeable if the given type is const. +template +handle eigen_ref_array(Type &src, handle parent = none()) { + // none here is to get past array's should-we-copy detection, which currently always + // copies when there is no base. Setting the base to None should be harmless. + return eigen_array_cast(src, parent, !std::is_const::value); +} + +// Takes a pointer to some dense, plain Eigen type, builds a capsule around it, then returns a +// numpy array that references the encapsulated data with a python-side reference to the capsule to +// tie its destruction to that of any dependent python objects. Const-ness is determined by +// whether or not the Type of the pointer given is const. +template ::value>> +handle eigen_encapsulate(Type *src) { + capsule base(src, [](void *o) { delete static_cast(o); }); + return eigen_ref_array(*src, base); +} + +// Type caster for regular, dense matrix types (e.g. MatrixXd), but not maps/refs/etc. of dense +// types. +template +struct type_caster::value>> { + using Scalar = typename Type::Scalar; + static_assert(!std::is_pointer::value, + PYBIND11_EIGEN_MESSAGE_POINTER_TYPES_ARE_NOT_SUPPORTED); + using props = EigenProps; + + bool load(handle src, bool convert) { + // If we're in no-convert mode, only load if given an array of the correct type + if (!convert && !isinstance>(src)) { + return false; + } + + // Coerce into an array, but don't do type conversion yet; the copy below handles it. + auto buf = array::ensure(src); + + if (!buf) { + return false; + } + + auto dims = buf.ndim(); + if (dims < 1 || dims > 2) { + return false; + } + + auto fits = props::conformable(buf); + if (!fits) { + return false; + } + + // Allocate the new type, then build a numpy reference into it + value = Type(fits.rows, fits.cols); + auto ref = reinterpret_steal(eigen_ref_array(value)); + if (dims == 1) { + ref = ref.squeeze(); + } else if (ref.ndim() == 1) { + buf = buf.squeeze(); + } + + int result = detail::npy_api::get().PyArray_CopyInto_(ref.ptr(), buf.ptr()); + + if (result < 0) { // Copy failed! + PyErr_Clear(); + return false; + } + + return true; + } + +private: + // Cast implementation + template + static handle cast_impl(CType *src, return_value_policy policy, handle parent) { + switch (policy) { + case return_value_policy::take_ownership: + case return_value_policy::automatic: + return eigen_encapsulate(src); + case return_value_policy::move: + return eigen_encapsulate(new CType(std::move(*src))); + case return_value_policy::copy: + return eigen_array_cast(*src); + case return_value_policy::reference: + case return_value_policy::automatic_reference: + return eigen_ref_array(*src); + case return_value_policy::reference_internal: + return eigen_ref_array(*src, parent); + default: + throw cast_error("unhandled return_value_policy: should not happen!"); + }; + } + +public: + // Normal returned non-reference, non-const value: + static handle cast(Type &&src, return_value_policy /* policy */, handle parent) { + return cast_impl(&src, return_value_policy::move, parent); + } + // If you return a non-reference const, we mark the numpy array readonly: + static handle cast(const Type &&src, return_value_policy /* policy */, handle parent) { + return cast_impl(&src, return_value_policy::move, parent); + } + // lvalue reference return; default (automatic) becomes copy + static handle cast(Type &src, return_value_policy policy, handle parent) { + if (policy == return_value_policy::automatic + || policy == return_value_policy::automatic_reference) { + policy = return_value_policy::copy; + } + return cast_impl(&src, policy, parent); + } + // const lvalue reference return; default (automatic) becomes copy + static handle cast(const Type &src, return_value_policy policy, handle parent) { + if (policy == return_value_policy::automatic + || policy == return_value_policy::automatic_reference) { + policy = return_value_policy::copy; + } + return cast(&src, policy, parent); + } + // non-const pointer return + static handle cast(Type *src, return_value_policy policy, handle parent) { + return cast_impl(src, policy, parent); + } + // const pointer return + static handle cast(const Type *src, return_value_policy policy, handle parent) { + return cast_impl(src, policy, parent); + } + + static constexpr auto name = props::descriptor; + + // NOLINTNEXTLINE(google-explicit-constructor) + operator Type *() { return &value; } + // NOLINTNEXTLINE(google-explicit-constructor) + operator Type &() { return value; } + // NOLINTNEXTLINE(google-explicit-constructor) + operator Type &&() && { return std::move(value); } + template + using cast_op_type = movable_cast_op_type; + +private: + Type value; +}; + +// Base class for casting reference/map/block/etc. objects back to python. +template +struct eigen_map_caster { + static_assert(!std::is_pointer::value, + PYBIND11_EIGEN_MESSAGE_POINTER_TYPES_ARE_NOT_SUPPORTED); + +private: + using props = EigenProps; + +public: + // Directly referencing a ref/map's data is a bit dangerous (whatever the map/ref points to has + // to stay around), but we'll allow it under the assumption that you know what you're doing + // (and have an appropriate keep_alive in place). We return a numpy array pointing directly at + // the ref's data (The numpy array ends up read-only if the ref was to a const matrix type.) + // Note that this means you need to ensure you don't destroy the object in some other way (e.g. + // with an appropriate keep_alive, or with a reference to a statically allocated matrix). + static handle cast(const MapType &src, return_value_policy policy, handle parent) { + switch (policy) { + case return_value_policy::copy: + return eigen_array_cast(src); + case return_value_policy::reference_internal: + return eigen_array_cast(src, parent, is_eigen_mutable_map::value); + case return_value_policy::reference: + case return_value_policy::automatic: + case return_value_policy::automatic_reference: + return eigen_array_cast(src, none(), is_eigen_mutable_map::value); + default: + // move, take_ownership don't make any sense for a ref/map: + pybind11_fail("Invalid return_value_policy for Eigen Map/Ref/Block type"); + } + } + + static constexpr auto name = props::descriptor; + + // Explicitly delete these: support python -> C++ conversion on these (i.e. these can be return + // types but not bound arguments). We still provide them (with an explicitly delete) so that + // you end up here if you try anyway. + bool load(handle, bool) = delete; + operator MapType() = delete; + template + using cast_op_type = MapType; +}; + +// We can return any map-like object (but can only load Refs, specialized next): +template +struct type_caster::value>> : eigen_map_caster {}; + +// Loader for Ref<...> arguments. See the documentation for info on how to make this work without +// copying (it requires some extra effort in many cases). +template +struct type_caster< + Eigen::Ref, + enable_if_t>::value>> + : public eigen_map_caster> { +private: + using Type = Eigen::Ref; + using props = EigenProps; + using Scalar = typename props::Scalar; + static_assert(!std::is_pointer::value, + PYBIND11_EIGEN_MESSAGE_POINTER_TYPES_ARE_NOT_SUPPORTED); + using MapType = Eigen::Map; + using Array + = array_t; + static constexpr bool need_writeable = is_eigen_mutable_map::value; + // Delay construction (these have no default constructor) + std::unique_ptr map; + std::unique_ptr ref; + // Our array. When possible, this is just a numpy array pointing to the source data, but + // sometimes we can't avoid copying (e.g. input is not a numpy array at all, has an + // incompatible layout, or is an array of a type that needs to be converted). Using a numpy + // temporary (rather than an Eigen temporary) saves an extra copy when we need both type + // conversion and storage order conversion. (Note that we refuse to use this temporary copy + // when loading an argument for a Ref with M non-const, i.e. a read-write reference). + Array copy_or_ref; + +public: + bool load(handle src, bool convert) { + // First check whether what we have is already an array of the right type. If not, we + // can't avoid a copy (because the copy is also going to do type conversion). + bool need_copy = !isinstance(src); + + EigenConformable fits; + if (!need_copy) { + // We don't need a converting copy, but we also need to check whether the strides are + // compatible with the Ref's stride requirements + auto aref = reinterpret_borrow(src); + + if (aref && (!need_writeable || aref.writeable())) { + fits = props::conformable(aref); + if (!fits) { + return false; // Incompatible dimensions + } + if (!fits.template stride_compatible()) { + need_copy = true; + } else { + copy_or_ref = std::move(aref); + } + } else { + need_copy = true; + } + } + + if (need_copy) { + // We need to copy: If we need a mutable reference, or we're not supposed to convert + // (either because we're in the no-convert overload pass, or because we're explicitly + // instructed not to copy (via `py::arg().noconvert()`) we have to fail loading. + if (!convert || need_writeable) { + return false; + } + + Array copy = Array::ensure(src); + if (!copy) { + return false; + } + fits = props::conformable(copy); + if (!fits || !fits.template stride_compatible()) { + return false; + } + copy_or_ref = std::move(copy); + loader_life_support::add_patient(copy_or_ref); + } + + ref.reset(); + map.reset(new MapType(data(copy_or_ref), + fits.rows, + fits.cols, + make_stride(fits.stride.outer(), fits.stride.inner()))); + ref.reset(new Type(*map)); + + return true; + } + + // NOLINTNEXTLINE(google-explicit-constructor) + operator Type *() { return ref.get(); } + // NOLINTNEXTLINE(google-explicit-constructor) + operator Type &() { return *ref; } + template + using cast_op_type = pybind11::detail::cast_op_type<_T>; + +private: + template ::value, int> = 0> + Scalar *data(Array &a) { + return a.mutable_data(); + } + + template ::value, int> = 0> + const Scalar *data(Array &a) { + return a.data(); + } + + // Attempt to figure out a constructor of `Stride` that will work. + // If both strides are fixed, use a default constructor: + template + using stride_ctor_default = bool_constant::value>; + // Otherwise, if there is a two-index constructor, assume it is (outer,inner) like + // Eigen::Stride, and use it: + template + using stride_ctor_dual + = bool_constant::value + && std::is_constructible::value>; + // Otherwise, if there is a one-index constructor, and just one of the strides is dynamic, use + // it (passing whichever stride is dynamic). + template + using stride_ctor_outer + = bool_constant, stride_ctor_dual>::value + && S::OuterStrideAtCompileTime == Eigen::Dynamic + && S::InnerStrideAtCompileTime != Eigen::Dynamic + && std::is_constructible::value>; + template + using stride_ctor_inner + = bool_constant, stride_ctor_dual>::value + && S::InnerStrideAtCompileTime == Eigen::Dynamic + && S::OuterStrideAtCompileTime != Eigen::Dynamic + && std::is_constructible::value>; + + template ::value, int> = 0> + static S make_stride(EigenIndex, EigenIndex) { + return S(); + } + template ::value, int> = 0> + static S make_stride(EigenIndex outer, EigenIndex inner) { + return S(outer, inner); + } + template ::value, int> = 0> + static S make_stride(EigenIndex outer, EigenIndex) { + return S(outer); + } + template ::value, int> = 0> + static S make_stride(EigenIndex, EigenIndex inner) { + return S(inner); + } +}; + +// type_caster for special matrix types (e.g. DiagonalMatrix), which are EigenBase, but not +// EigenDense (i.e. they don't have a data(), at least not with the usual matrix layout). +// load() is not supported, but we can cast them into the python domain by first copying to a +// regular Eigen::Matrix, then casting that. +template +struct type_caster::value>> { + static_assert(!std::is_pointer::value, + PYBIND11_EIGEN_MESSAGE_POINTER_TYPES_ARE_NOT_SUPPORTED); + +protected: + using Matrix + = Eigen::Matrix; + using props = EigenProps; + +public: + static handle cast(const Type &src, return_value_policy /* policy */, handle /* parent */) { + handle h = eigen_encapsulate(new Matrix(src)); + return h; + } + static handle cast(const Type *src, return_value_policy policy, handle parent) { + return cast(*src, policy, parent); + } + + static constexpr auto name = props::descriptor; + + // Explicitly delete these: support python -> C++ conversion on these (i.e. these can be return + // types but not bound arguments). We still provide them (with an explicitly delete) so that + // you end up here if you try anyway. + bool load(handle, bool) = delete; + operator Type() = delete; + template + using cast_op_type = Type; +}; + +template +struct type_caster::value>> { + using Scalar = typename Type::Scalar; + static_assert(!std::is_pointer::value, + PYBIND11_EIGEN_MESSAGE_POINTER_TYPES_ARE_NOT_SUPPORTED); + using StorageIndex = remove_reference_t().outerIndexPtr())>; + using Index = typename Type::Index; + static constexpr bool rowMajor = Type::IsRowMajor; + + bool load(handle src, bool) { + if (!src) { + return false; + } + + auto obj = reinterpret_borrow(src); + object sparse_module = module_::import("scipy.sparse"); + object matrix_type = sparse_module.attr(rowMajor ? "csr_matrix" : "csc_matrix"); + + if (!type::handle_of(obj).is(matrix_type)) { + try { + obj = matrix_type(obj); + } catch (const error_already_set &) { + return false; + } + } + + auto values = array_t((object) obj.attr("data")); + auto innerIndices = array_t((object) obj.attr("indices")); + auto outerIndices = array_t((object) obj.attr("indptr")); + auto shape = pybind11::tuple((pybind11::object) obj.attr("shape")); + auto nnz = obj.attr("nnz").cast(); + + if (!values || !innerIndices || !outerIndices) { + return false; + } + + value = EigenMapSparseMatrix(shape[0].cast(), + shape[1].cast(), + std::move(nnz), + outerIndices.mutable_data(), + innerIndices.mutable_data(), + values.mutable_data()); + + return true; + } + + static handle cast(const Type &src, return_value_policy /* policy */, handle /* parent */) { + const_cast(src).makeCompressed(); + + object matrix_type + = module_::import("scipy.sparse").attr(rowMajor ? "csr_matrix" : "csc_matrix"); + + array data(src.nonZeros(), src.valuePtr()); + array outerIndices((rowMajor ? src.rows() : src.cols()) + 1, src.outerIndexPtr()); + array innerIndices(src.nonZeros(), src.innerIndexPtr()); + + return matrix_type(pybind11::make_tuple( + std::move(data), std::move(innerIndices), std::move(outerIndices)), + pybind11::make_tuple(src.rows(), src.cols())) + .release(); + } + + PYBIND11_TYPE_CASTER(Type, + const_name<(Type::IsRowMajor) != 0>("scipy.sparse.csr_matrix[", + "scipy.sparse.csc_matrix[") + + npy_format_descriptor::name + const_name("]")); +}; + +PYBIND11_NAMESPACE_END(detail) +PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) diff --git a/shared/package-files/09/092fad4454f593d7bf2e5e1e746acade92bb346d06476ba527f162f843ae3208/blob b/shared/package-files/09/092fad4454f593d7bf2e5e1e746acade92bb346d06476ba527f162f843ae3208/blob new file mode 100644 index 0000000000000000000000000000000000000000..91a32cebb513f9140bf5e8df709e90b9e1c996e8 --- /dev/null +++ b/shared/package-files/09/092fad4454f593d7bf2e5e1e746acade92bb346d06476ba527f162f843ae3208/blob @@ -0,0 +1,126 @@ +"""Define the menu contents, hotkeys, and event bindings. + +There is additional configuration information in the EditorWindow class (and +subclasses): the menus are created there based on the menu_specs (class) +variable, and menus not created are silently skipped in the code here. This +makes it possible, for example, to define a Debug menu which is only present in +the PythonShell window, and a Format menu which is only present in the Editor +windows. + +""" +from importlib.util import find_spec + +from idlelib.config import idleConf + +# Warning: menudefs is altered in macosx.overrideRootMenu() +# after it is determined that an OS X Aqua Tk is in use, +# which cannot be done until after Tk() is first called. +# Do not alter the 'file', 'options', or 'help' cascades here +# without altering overrideRootMenu() as well. +# TODO: Make this more robust + +menudefs = [ + # underscore prefixes character to underscore + ('file', [ + ('_New File', '<>'), + ('_Open...', '<>'), + ('Open _Module...', '<>'), + ('Module _Browser', '<>'), + ('_Path Browser', '<>'), + None, + ('_Save', '<>'), + ('Save _As...', '<>'), + ('Save Cop_y As...', '<>'), + None, + ('Prin_t Window', '<>'), + None, + ('_Close Window', '<>'), + ('E_xit IDLE', '<>'), + ]), + + ('edit', [ + ('_Undo', '<>'), + ('_Redo', '<>'), + None, + ('Select _All', '<>'), + ('Cu_t', '<>'), + ('_Copy', '<>'), + ('_Paste', '<>'), + None, + ('_Find...', '<>'), + ('Find A_gain', '<>'), + ('Find _Selection', '<>'), + ('Find in Files...', '<>'), + ('R_eplace...', '<>'), + None, + ('Go to _Line', '<>'), + ('S_how Completions', '<>'), + ('E_xpand Word', '<>'), + ('Show C_all Tip', '<>'), + ('Show Surrounding P_arens', '<>'), + ]), + + ('format', [ + ('F_ormat Paragraph', '<>'), + ('_Indent Region', '<>'), + ('_Dedent Region', '<>'), + ('Comment _Out Region', '<>'), + ('U_ncomment Region', '<>'), + ('Tabify Region', '<>'), + ('Untabify Region', '<>'), + ('Toggle Tabs', '<>'), + ('New Indent Width', '<>'), + ('S_trip Trailing Whitespace', '<>'), + ]), + + ('run', [ + ('R_un Module', '<>'), + ('Run... _Customized', '<>'), + ('C_heck Module', '<>'), + ('Python Shell', '<>'), + ]), + + ('shell', [ + ('_View Last Restart', '<>'), + ('_Restart Shell', '<>'), + None, + ('_Previous History', '<>'), + ('_Next History', '<>'), + None, + ('_Interrupt Execution', '<>'), + ]), + + ('debug', [ + ('_Go to File/Line', '<>'), + ('!_Debugger', '<>'), + ('_Stack Viewer', '<>'), + ('!_Auto-open Stack Viewer', '<>'), + ]), + + ('options', [ + ('Configure _IDLE', '<>'), + None, + ('Show _Code Context', '<>'), + ('Show _Line Numbers', '<>'), + ('_Zoom Height', '<>'), + ]), + + ('window', [ + ]), + + ('help', [ + ('_About IDLE', '<>'), + None, + ('_IDLE Doc', '<>'), + ('Python _Docs', '<>'), + ]), +] + +if find_spec('turtledemo'): + menudefs[-1][1].append(('Turtle Demo', '<>')) + +default_keydefs = idleConf.GetCurrentKeySet() + +if __name__ == '__main__': + from unittest import main + main('idlelib.idle_test.test_mainmenu', verbosity=2) diff --git a/shared/package-files/09/0931c05cbbcf280d5eb97df9742e8049e99c8100ca6fb2445fb0b7535169fe4a/blob b/shared/package-files/09/0931c05cbbcf280d5eb97df9742e8049e99c8100ca6fb2445fb0b7535169fe4a/blob new file mode 100644 index 0000000000000000000000000000000000000000..3b08f3a43ddf63a97401cf3e67f81a32b5c693e8 --- /dev/null +++ b/shared/package-files/09/0931c05cbbcf280d5eb97df9742e8049e99c8100ca6fb2445fb0b7535169fe4a/blob @@ -0,0 +1,179 @@ +# This file is part of Hypothesis, which may be found at +# https://github.com/HypothesisWorks/hypothesis/ +# +# Copyright the Hypothesis Authors. +# Individual contributors are listed in AUTHORS.rst and the git log. +# +# This Source Code Form is subject to the terms of the Mozilla Public License, +# v. 2.0. If a copy of the MPL was not distributed with this file, You can +# obtain one at https://mozilla.org/MPL/2.0/. + +from functools import reduce +from itertools import chain + +import attr + +from hypothesis import strategies as st +from hypothesis.errors import ResolutionFailed +from hypothesis.internal.compat import get_type_hints +from hypothesis.strategies._internal.core import BuildsStrategy +from hypothesis.strategies._internal.types import is_a_type, type_sorting_key +from hypothesis.utils.conventions import infer + + +def get_attribute_by_alias(fields, alias, *, target=None): + """ + Get an attrs attribute by its alias, rather than its name (compare + getattr(fields, name)). + + ``target`` is used only to provide a nicer error message, and can be safely + omitted. + """ + # attrs supports defining an alias for a field, which is the name used when + # defining __init__. The init args are what we pull from when determining + # what parameters we need to supply to the class, so it's what we need to + # match against as well, rather than the class-level attribute name. + matched_fields = [f for f in fields if f.alias == alias] + if not matched_fields: + raise TypeError( + f"Unexpected keyword argument {alias} for attrs class" + f"{f' {target}' if target else ''}. Expected one of " + f"{[f.name for f in fields]}" + ) + # alias is used as an arg in __init__, so it is guaranteed to be unique, if + # it exists. + assert len(matched_fields) == 1 + return matched_fields[0] + + +def from_attrs(target, args, kwargs, to_infer): + """An internal version of builds(), specialised for Attrs classes.""" + fields = attr.fields(target) + kwargs = {k: v for k, v in kwargs.items() if v is not infer} + for name in to_infer: + attrib = get_attribute_by_alias(fields, name, target=target) + kwargs[name] = from_attrs_attribute(attrib, target) + # We might make this strategy more efficient if we added a layer here that + # retries drawing if validation fails, for improved composition. + # The treatment of timezones in datetimes() provides a precedent. + return BuildsStrategy(target, args, kwargs) + + +def from_attrs_attribute(attrib, target): + """Infer a strategy from the metadata on an attr.Attribute object.""" + # Try inferring from the default argument. Note that this will only help if + # the user passed `...` to builds() for this attribute, but in that case + # we use it as the minimal example. + default = st.nothing() + if isinstance(attrib.default, attr.Factory): + if not attrib.default.takes_self: + default = st.builds(attrib.default.factory) + elif attrib.default is not attr.NOTHING: + default = st.just(attrib.default) + + # Try inferring None, exact values, or type from attrs provided validators. + null = st.nothing() # updated to none() on seeing an OptionalValidator + in_collections = [] # list of in_ validator collections to sample from + validator_types = set() # type constraints to pass to types_to_strategy() + if attrib.validator is not None: + validator = attrib.validator + if isinstance(validator, attr.validators._OptionalValidator): + null = st.none() + validator = validator.validator + if isinstance(validator, attr.validators._AndValidator): + vs = validator._validators + else: + vs = [validator] + for v in vs: + if isinstance(v, attr.validators._InValidator): + if isinstance(v.options, str): + in_collections.append(list(all_substrings(v.options))) + else: + in_collections.append(v.options) + elif isinstance(v, attr.validators._InstanceOfValidator): + validator_types.add(v.type) + + # This is the important line. We compose the final strategy from various + # parts. The default value, if any, is the minimal shrink, followed by + # None (again, if allowed). We then prefer to sample from values passed + # to an in_ validator if available, but infer from a type otherwise. + # Pick one because (sampled_from((1, 2)) | from_type(int)) would usually + # fail validation by generating e.g. zero! + if in_collections: + sample = st.sampled_from(list(ordered_intersection(in_collections))) + strat = default | null | sample + else: + strat = default | null | types_to_strategy(attrib, validator_types) + + # Better to give a meaningful error here than an opaque "could not draw" + # when we try to get a value but have lost track of where this was created. + if strat.is_empty: + raise ResolutionFailed( + "Cannot infer a strategy from the default, validator, type, or " + f"converter for attribute={attrib!r} of class={target!r}" + ) + return strat + + +def types_to_strategy(attrib, types): + """Find all the type metadata for this attribute, reconcile it, and infer a + strategy from the mess.""" + # If we know types from the validator(s), that's sufficient. + if len(types) == 1: + (typ,) = types + if isinstance(typ, tuple): + return st.one_of(*map(st.from_type, typ)) + return st.from_type(typ) + elif types: + # We have a list of tuples of types, and want to find a type + # (or tuple of types) that is a subclass of all of of them. + type_tuples = [k if isinstance(k, tuple) else (k,) for k in types] + # Flatten the list, filter types that would fail validation, and + # sort so that ordering is stable between runs and shrinks well. + allowed = [ + t + for t in set(sum(type_tuples, ())) + if all(issubclass(t, tup) for tup in type_tuples) + ] + allowed.sort(key=type_sorting_key) + return st.one_of([st.from_type(t) for t in allowed]) + + # Otherwise, try the `type` attribute as a fallback, and finally try + # the type hints on a converter (desperate!) before giving up. + if is_a_type(getattr(attrib, "type", None)): + # The convoluted test is because variable annotations may be stored + # in string form; attrs doesn't evaluate them and we don't handle them. + # See PEP 526, PEP 563, and Hypothesis issue #1004 for details. + return st.from_type(attrib.type) + + converter = getattr(attrib, "converter", None) + if isinstance(converter, type): + return st.from_type(converter) + elif callable(converter): + hints = get_type_hints(converter) + if "return" in hints: + return st.from_type(hints["return"]) + + return st.nothing() + + +def ordered_intersection(in_): + """Set union of n sequences, ordered for reproducibility across runs.""" + intersection = reduce(set.intersection, in_, set(in_[0])) + for x in chain.from_iterable(in_): + if x in intersection: + yield x + intersection.remove(x) + + +def all_substrings(s): + """Generate all substrings of `s`, in order of length then occurrence. + Includes the empty string (first), and any duplicates that are present. + + >>> list(all_substrings('010')) + ['', '0', '1', '0', '01', '10', '010'] + """ + yield s[:0] + for n, _ in enumerate(s): + for i in range(len(s) - n): + yield s[i : i + n + 1] diff --git a/shared/package-files/09/0931d025bb82f990203caca6c6beb60e3b2c9671783f8e51650fdad7be3cd540/blob b/shared/package-files/09/0931d025bb82f990203caca6c6beb60e3b2c9671783f8e51650fdad7be3cd540/blob new file mode 100644 index 0000000000000000000000000000000000000000..eb5f662de05865e637770c8e354b7ff45c94ea52 --- /dev/null +++ b/shared/package-files/09/0931d025bb82f990203caca6c6beb60e3b2c9671783f8e51650fdad7be3cd540/blob @@ -0,0 +1,17 @@ +from email.message import Message +from email.mime.base import MIMEBase +from email.policy import Policy +from typing import Optional, Sequence, Tuple, Union + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEMultipart(MIMEBase): + def __init__( + self, + _subtype: str = ..., + boundary: Optional[str] = ..., + _subparts: Optional[Sequence[Message]] = ..., + *, + policy: Optional[Policy] = ..., + **_params: _ParamsType, + ) -> None: ... diff --git a/shared/package-files/09/093273687bc10458a29ca269d8766c293d05589f107f92da53f75d3f47690b07/blob b/shared/package-files/09/093273687bc10458a29ca269d8766c293d05589f107f92da53f75d3f47690b07/blob new file mode 100644 index 0000000000000000000000000000000000000000..999c7acf2b5174eb00eb0776c5c3d92d7a9ebb02 --- /dev/null +++ b/shared/package-files/09/093273687bc10458a29ca269d8766c293d05589f107f92da53f75d3f47690b07/blob @@ -0,0 +1,275 @@ +""" +Implement logic relating to wrapping (box) and unwrapping (unbox) instances +of jitclasses for use inside the python interpreter. +""" + +from functools import wraps, partial + +from llvmlite import ir + +from numba.core import types, cgutils +from numba.core.decorators import njit +from numba.core.pythonapi import box, unbox, NativeValue +from numba.core.typing.typeof import typeof_impl +from numba.experimental.jitclass import _box + + +_getter_code_template = """ +def accessor(__numba_self_): + return __numba_self_.{0} +""" + +_setter_code_template = """ +def mutator(__numba_self_, __numba_val): + __numba_self_.{0} = __numba_val +""" + +_method_code_template = """ +def method(__numba_self_, *args): + return __numba_self_.{method}(*args) +""" + + +def _generate_property(field, template, fname): + """ + Generate simple function that get/set a field of the instance + """ + source = template.format(field) + glbls = {} + exec(source, glbls) + return njit(glbls[fname]) + + +_generate_getter = partial(_generate_property, template=_getter_code_template, + fname='accessor') +_generate_setter = partial(_generate_property, template=_setter_code_template, + fname='mutator') + + +def _generate_method(name, func): + """ + Generate a wrapper for calling a method. Note the wrapper will only + accept positional arguments. + """ + source = _method_code_template.format(method=name) + glbls = {} + exec(source, glbls) + method = njit(glbls['method']) + + @wraps(func) + def wrapper(*args, **kwargs): + return method(*args, **kwargs) + + return wrapper + + +_cache_specialized_box = {} + + +def _specialize_box(typ): + """ + Create a subclass of Box that is specialized to the jitclass. + + This function caches the result to avoid code bloat. + """ + # Check cache + if typ in _cache_specialized_box: + return _cache_specialized_box[typ] + dct = {'__slots__': (), + '_numba_type_': typ, + '__doc__': typ.class_type.class_doc, + } + # Inject attributes as class properties + for field in typ.struct: + getter = _generate_getter(field) + setter = _generate_setter(field) + dct[field] = property(getter, setter) + # Inject properties as class properties + for field, impdct in typ.jit_props.items(): + getter = None + setter = None + if 'get' in impdct: + getter = _generate_getter(field) + if 'set' in impdct: + setter = _generate_setter(field) + # get docstring from either the fget or fset + imp = impdct.get('get') or impdct.get('set') or None + doc = getattr(imp, '__doc__', None) + dct[field] = property(getter, setter, doc=doc) + # Inject methods as class members + supported_dunders = { + "__abs__", + "__annotate_func__", + "__bool__", + "__complex__", + "__contains__", + "__float__", + "__getitem__", + "__hash__", + "__index__", + "__invert__", + "__int__", + "__len__", + "__setitem__", + "__str__", + "__eq__", + "__ne__", + "__ge__", + "__gt__", + "__le__", + "__lt__", + "__add__", + "__floordiv__", + "__lshift__", + "__matmul__", + "__mod__", + "__mul__", + "__neg__", + "__pos__", + "__pow__", + "__rshift__", + "__sub__", + "__truediv__", + "__and__", + "__or__", + "__xor__", + "__iadd__", + "__ifloordiv__", + "__ilshift__", + "__imatmul__", + "__imod__", + "__imul__", + "__ipow__", + "__irshift__", + "__isub__", + "__itruediv__", + "__iand__", + "__ior__", + "__ixor__", + "__radd__", + "__rfloordiv__", + "__rlshift__", + "__rmatmul__", + "__rmod__", + "__rmul__", + "__rpow__", + "__rrshift__", + "__rsub__", + "__rtruediv__", + "__rand__", + "__ror__", + "__rxor__", + } + for name, func in typ.methods.items(): + if name == "__init__": + continue + if ( + name.startswith("__") + and name.endswith("__") + and name not in supported_dunders + ): + raise TypeError(f"Method '{name}' is not supported.") + dct[name] = _generate_method(name, func) + + # Inject static methods as class members + for name, func in typ.static_methods.items(): + dct[name] = _generate_method(name, func) + + # Create subclass + subcls = type(typ.classname, (_box.Box,), dct) + # Store to cache + _cache_specialized_box[typ] = subcls + + # Pre-compile attribute getter. + # Note: This must be done after the "box" class is created because + # compiling the getter requires the "box" class to be defined. + for k, v in dct.items(): + if isinstance(v, property): + prop = getattr(subcls, k) + if prop.fget is not None: + fget = prop.fget + fast_fget = fget.compile((typ,)) + fget.disable_compile() + setattr(subcls, k, + property(fast_fget, prop.fset, prop.fdel, + doc=prop.__doc__)) + + return subcls + + +############################################################################### +# Implement box/unbox for call wrapper + +@box(types.ClassInstanceType) +def _box_class_instance(typ, val, c): + meminfo, dataptr = cgutils.unpack_tuple(c.builder, val) + + # Create Box instance + box_subclassed = _specialize_box(typ) + # Note: the ``box_subclassed`` is kept alive by the cache + voidptr_boxcls = c.context.add_dynamic_addr( + c.builder, + id(box_subclassed), + info="box_class_instance", + ) + box_cls = c.builder.bitcast(voidptr_boxcls, c.pyapi.pyobj) + + box = c.pyapi.call_function_objargs(box_cls, ()) + + # Initialize Box instance + llvoidptr = ir.IntType(8).as_pointer() + addr_meminfo = c.builder.bitcast(meminfo, llvoidptr) + addr_data = c.builder.bitcast(dataptr, llvoidptr) + + def set_member(member_offset, value): + # Access member by byte offset + offset = c.context.get_constant(types.uintp, member_offset) + ptr = cgutils.pointer_add(c.builder, box, offset) + casted = c.builder.bitcast(ptr, llvoidptr.as_pointer()) + c.builder.store(value, casted) + + set_member(_box.box_meminfoptr_offset, addr_meminfo) + set_member(_box.box_dataptr_offset, addr_data) + return box + + +@unbox(types.ClassInstanceType) +def _unbox_class_instance(typ, val, c): + def access_member(member_offset): + # Access member by byte offset + offset = c.context.get_constant(types.uintp, member_offset) + llvoidptr = ir.IntType(8).as_pointer() + ptr = cgutils.pointer_add(c.builder, val, offset) + casted = c.builder.bitcast(ptr, llvoidptr.as_pointer()) + return c.builder.load(casted) + + struct_cls = cgutils.create_struct_proxy(typ) + inst = struct_cls(c.context, c.builder) + + # load from Python object + ptr_meminfo = access_member(_box.box_meminfoptr_offset) + ptr_dataptr = access_member(_box.box_dataptr_offset) + + # store to native structure + inst.meminfo = c.builder.bitcast(ptr_meminfo, inst.meminfo.type) + inst.data = c.builder.bitcast(ptr_dataptr, inst.data.type) + + ret = inst._getvalue() + + c.context.nrt.incref(c.builder, typ, ret) + + return NativeValue(ret, is_error=c.pyapi.c_api_error()) + + +# Add a typeof_impl implementation for boxed jitclasses to short-circut the +# various tests in typeof. This is needed for jitclasses which implement a +# custom hash method. Without this, typeof_impl will return None, and one of the +# later attempts to determine the type of the jitclass (before checking for +# _numba_type_) will look up the object in a dictionary, triggering the hash +# method. This will cause the dispatcher to determine the call signature of the +# jit decorated obj.__hash__ method, which will call typeof(obj), and thus +# infinite loop. +# This implementation is here instead of in typeof.py to avoid circular imports. +@typeof_impl.register(_box.Box) +def _typeof_jitclass_box(val, c): + return getattr(type(val), "_numba_type_") diff --git a/shared/package-files/09/093360564826db257d7356cef707a6f3afccf17e931b2b84b62b548c1cc6c017/blob b/shared/package-files/09/093360564826db257d7356cef707a6f3afccf17e931b2b84b62b548c1cc6c017/blob new file mode 100644 index 0000000000000000000000000000000000000000..f9a60751285785eecf91921ae9148930ebb427f8 --- /dev/null +++ b/shared/package-files/09/093360564826db257d7356cef707a6f3afccf17e931b2b84b62b548c1cc6c017/blob @@ -0,0 +1,138 @@ +from distutils.util import convert_path +from distutils import log +from distutils.errors import DistutilsOptionError +import distutils +import os +import configparser + +from setuptools import Command + +__all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] + + +def config_file(kind="local"): + """Get the filename of the distutils, local, global, or per-user config + + `kind` must be one of "local", "global", or "user" + """ + if kind == 'local': + return 'setup.cfg' + if kind == 'global': + return os.path.join(os.path.dirname(distutils.__file__), 'distutils.cfg') + if kind == 'user': + dot = os.name == 'posix' and '.' or '' + return os.path.expanduser(convert_path("~/%spydistutils.cfg" % dot)) + raise ValueError("config_file() type must be 'local', 'global', or 'user'", kind) + + +def edit_config(filename, settings, dry_run=False): + """Edit a configuration file to include `settings` + + `settings` is a dictionary of dictionaries or ``None`` values, keyed by + command/section name. A ``None`` value means to delete the entire section, + while a dictionary lists settings to be changed or deleted in that section. + A setting of ``None`` means to delete that setting. + """ + log.debug("Reading configuration from %s", filename) + opts = configparser.RawConfigParser() + opts.optionxform = lambda x: x + opts.read([filename]) + for section, options in settings.items(): + if options is None: + log.info("Deleting section [%s] from %s", section, filename) + opts.remove_section(section) + else: + if not opts.has_section(section): + log.debug("Adding new section [%s] to %s", section, filename) + opts.add_section(section) + for option, value in options.items(): + if value is None: + log.debug("Deleting %s.%s from %s", section, option, filename) + opts.remove_option(section, option) + if not opts.options(section): + log.info( + "Deleting empty [%s] section from %s", section, filename + ) + opts.remove_section(section) + else: + log.debug( + "Setting %s.%s to %r in %s", section, option, value, filename + ) + opts.set(section, option, value) + + log.info("Writing %s", filename) + if not dry_run: + with open(filename, 'w') as f: + opts.write(f) + + +class option_base(Command): + """Abstract base class for commands that mess with config files""" + + user_options = [ + ('global-config', 'g', "save options to the site-wide distutils.cfg file"), + ('user-config', 'u', "save options to the current user's pydistutils.cfg file"), + ('filename=', 'f', "configuration file to use (default=setup.cfg)"), + ] + + boolean_options = [ + 'global-config', + 'user-config', + ] + + def initialize_options(self): + self.global_config = None + self.user_config = None + self.filename = None + + def finalize_options(self): + filenames = [] + if self.global_config: + filenames.append(config_file('global')) + if self.user_config: + filenames.append(config_file('user')) + if self.filename is not None: + filenames.append(self.filename) + if not filenames: + filenames.append(config_file('local')) + if len(filenames) > 1: + raise DistutilsOptionError( + "Must specify only one configuration file option", filenames + ) + (self.filename,) = filenames + + +class setopt(option_base): + """Save command-line options to a file""" + + description = "set an option in setup.cfg or another config file" + + user_options = [ + ('command=', 'c', 'command to set an option for'), + ('option=', 'o', 'option to set'), + ('set-value=', 's', 'value of the option'), + ('remove', 'r', 'remove (unset) the value'), + ] + option_base.user_options + + boolean_options = option_base.boolean_options + ['remove'] + + def initialize_options(self): + option_base.initialize_options(self) + self.command = None + self.option = None + self.set_value = None + self.remove = None + + def finalize_options(self): + option_base.finalize_options(self) + if self.command is None or self.option is None: + raise DistutilsOptionError("Must specify --command *and* --option") + if self.set_value is None and not self.remove: + raise DistutilsOptionError("Must specify --set-value or --remove") + + def run(self): + edit_config( + self.filename, + {self.command: {self.option.replace('-', '_'): self.set_value}}, + self.dry_run, + ) diff --git a/shared/package-files/09/0933d964a6d194c3c10324056dc6490956cdcc766dfa9d28197aa4165f393a5d/blob b/shared/package-files/09/0933d964a6d194c3c10324056dc6490956cdcc766dfa9d28197aa4165f393a5d/blob new file mode 100644 index 0000000000000000000000000000000000000000..2e32a3b57442b207c0e38aed4ec6578007b67cb7 Binary files /dev/null and b/shared/package-files/09/0933d964a6d194c3c10324056dc6490956cdcc766dfa9d28197aa4165f393a5d/blob differ diff --git a/shared/package-files/09/09349633e530eeef7399c8889f6253f97a12015319c55f27cba69d9186306692/blob b/shared/package-files/09/09349633e530eeef7399c8889f6253f97a12015319c55f27cba69d9186306692/blob new file mode 100644 index 0000000000000000000000000000000000000000..ca2fb3ec8babce6c3f036aa83a504a433e215c56 --- /dev/null +++ b/shared/package-files/09/09349633e530eeef7399c8889f6253f97a12015319c55f27cba69d9186306692/blob @@ -0,0 +1,638 @@ +"""Reference results for quantile regression tests.""" + +import numpy as np + +from statsmodels.tools.tools import Bunch + +epanechnikov_hsheather_q75 = Bunch() +epanechnikov_hsheather_q75.table = np.array([ + [.6440143, .0122001, 52.79, 0.000, .6199777, .6680508], + [62.39648, 13.5509, 4.60, 0.000, 35.69854, 89.09443] +]) +epanechnikov_hsheather_q75.psrsquared = 0.6966 +epanechnikov_hsheather_q75.rank = 2 +epanechnikov_hsheather_q75.sparsity = 223.784434936344 +epanechnikov_hsheather_q75.bwidth = .1090401129546568 +# epanechnikov_hsheather_q75.kbwidth = 59.62067927472172 # Stata 12 results +epanechnikov_hsheather_q75.kbwidth = 59.30 # TODO: why do we need lower tol? +epanechnikov_hsheather_q75.df_m = 1 +epanechnikov_hsheather_q75.df_r = 233 +epanechnikov_hsheather_q75.f_r = .0044685860313942 +epanechnikov_hsheather_q75.N = 235 +epanechnikov_hsheather_q75.q_v = 745.2352905273438 +epanechnikov_hsheather_q75.q = .75 +epanechnikov_hsheather_q75.sum_rdev = 43036.06956481934 +epanechnikov_hsheather_q75.sum_adev = 13058.50008841318 +epanechnikov_hsheather_q75.convcode = 0 + + +biweight_bofinger = Bunch() +biweight_bofinger.table = np.array([ + [.5601805, .0136491, 41.04, 0.000, .533289, .5870719], + [81.48233, 15.1604, 5.37, 0.000, 51.61335, 111.3513] + ]) +biweight_bofinger.psrsquared = 0.6206 +biweight_bofinger.rank = 2 +biweight_bofinger.sparsity = 216.8218989750115 +biweight_bofinger.bwidth = .2173486679767846 +biweight_bofinger.kbwidth = 91.50878448104551 +biweight_bofinger.df_m = 1 +biweight_bofinger.df_r = 233 +biweight_bofinger.f_r = .0046120802590851 +biweight_bofinger.N = 235 +biweight_bofinger.q_v = 582.541259765625 +biweight_bofinger.q = .5 +biweight_bofinger.sum_rdev = 46278.05667114258 +biweight_bofinger.sum_adev = 17559.93220318131 +biweight_bofinger.convcode = 0 + + +biweight_hsheather = Bunch() +biweight_hsheather.table = np.array([ + [.5601805, .0128449, 43.61, 0.000, .5348735, .5854875], + [81.48233, 14.26713, 5.71, 0.000, 53.37326, 109.5914] + ]) +biweight_hsheather.psrsquared = 0.6206 +biweight_hsheather.rank = 2 +biweight_hsheather.sparsity = 204.0465407204423 +biweight_hsheather.bwidth = .1574393314202373 +biweight_hsheather.kbwidth = 64.53302151153288 +biweight_hsheather.df_m = 1 +biweight_hsheather.df_r = 233 +biweight_hsheather.f_r = .0049008427022052 +biweight_hsheather.N = 235 +biweight_hsheather.q_v = 582.541259765625 +biweight_hsheather.q = .5 +biweight_hsheather.sum_rdev = 46278.05667114258 +biweight_hsheather.sum_adev = 17559.93220318131 +biweight_hsheather.convcode = 0 + +biweight_chamberlain = Bunch() +biweight_chamberlain.table = np.array([ + [.5601805, .0114969, 48.72, 0.000, .5375294, .5828315], + [81.48233, 12.76983, 6.38, 0.000, 56.32325, 106.6414] +]) +biweight_chamberlain.psrsquared = 0.6206 +biweight_chamberlain.rank = 2 +biweight_chamberlain.sparsity = 182.6322495257494 +biweight_chamberlain.bwidth = .063926976464458 +biweight_chamberlain.kbwidth = 25.61257055690209 +biweight_chamberlain.df_m = 1 +biweight_chamberlain.df_r = 233 +biweight_chamberlain.f_r = .005475484218131 +biweight_chamberlain.N = 235 +biweight_chamberlain.q_v = 582.541259765625 +biweight_chamberlain.q = .5 +biweight_chamberlain.sum_rdev = 46278.05667114258 +biweight_chamberlain.sum_adev = 17559.93220318131 +biweight_chamberlain.convcode = 0 + +epanechnikov_bofinger = Bunch() +epanechnikov_bofinger.table = np.array([ + [.5601805, .0209663, 26.72, 0.000, .5188727, .6014882], + [81.48233, 23.28774, 3.50, 0.001, 35.60088, 127.3638] + ]) +epanechnikov_bofinger.psrsquared = 0.6206 +epanechnikov_bofinger.rank = 2 +epanechnikov_bofinger.sparsity = 333.0579553401614 +epanechnikov_bofinger.bwidth = .2173486679767846 +epanechnikov_bofinger.kbwidth = 91.50878448104551 +epanechnikov_bofinger.df_m = 1 +epanechnikov_bofinger.df_r = 233 +epanechnikov_bofinger.f_r = .0030024804511235 +epanechnikov_bofinger.N = 235 +epanechnikov_bofinger.q_v = 582.541259765625 +epanechnikov_bofinger.q = .5 +epanechnikov_bofinger.sum_rdev = 46278.05667114258 +epanechnikov_bofinger.sum_adev = 17559.93220318131 +epanechnikov_bofinger.convcode = 0 + +epanechnikov_hsheather = Bunch() +epanechnikov_hsheather.table = np.array([ + [.5601805, .0170484, 32.86, 0.000, .5265918, .5937692], + [81.48233, 18.93605, 4.30, 0.000, 44.17457, 118.7901] + ]) +epanechnikov_hsheather.psrsquared = 0.6206 +epanechnikov_hsheather.rank = 2 +epanechnikov_hsheather.sparsity = 270.8207209067576 +epanechnikov_hsheather.bwidth = .1574393314202373 +epanechnikov_hsheather.kbwidth = 64.53302151153288 +epanechnikov_hsheather.df_m = 1 +epanechnikov_hsheather.df_r = 233 +epanechnikov_hsheather.f_r = .0036924796472434 +epanechnikov_hsheather.N = 235 +epanechnikov_hsheather.q_v = 582.541259765625 +epanechnikov_hsheather.q = .5 +epanechnikov_hsheather.sum_rdev = 46278.05667114258 +epanechnikov_hsheather.sum_adev = 17559.93220318131 +epanechnikov_hsheather.convcode = 0 + +epanechnikov_chamberlain = Bunch() +epanechnikov_chamberlain.table = np.array([ + [.5601805, .0130407, 42.96, 0.000, .5344876, .5858733], + [81.48233, 14.48467, 5.63, 0.000, 52.94468, 110.02] + ]) +epanechnikov_chamberlain.psrsquared = 0.6206 +epanechnikov_chamberlain.rank = 2 +epanechnikov_chamberlain.sparsity = 207.1576340635951 +epanechnikov_chamberlain.bwidth = .063926976464458 +epanechnikov_chamberlain.kbwidth = 25.61257055690209 +epanechnikov_chamberlain.df_m = 1 +epanechnikov_chamberlain.df_r = 233 +epanechnikov_chamberlain.f_r = .0048272418466269 +epanechnikov_chamberlain.N = 235 +epanechnikov_chamberlain.q_v = 582.541259765625 +epanechnikov_chamberlain.q = .5 +epanechnikov_chamberlain.sum_rdev = 46278.05667114258 +epanechnikov_chamberlain.sum_adev = 17559.93220318131 +epanechnikov_chamberlain.convcode = 0 + +epan2_bofinger = Bunch() +epan2_bofinger.table = np.array([ + [.5601805, .0143484, 39.04, 0.000, .5319113, .5884496], + [81.48233, 15.93709, 5.11, 0.000, 50.08313, 112.8815] + ]) +epan2_bofinger.psrsquared = 0.6206 +epan2_bofinger.rank = 2 +epan2_bofinger.sparsity = 227.9299402797656 +epan2_bofinger.bwidth = .2173486679767846 +epan2_bofinger.kbwidth = 91.50878448104551 +epan2_bofinger.df_m = 1 +epan2_bofinger.df_r = 233 +epan2_bofinger.f_r = .0043873130435281 +epan2_bofinger.N = 235 +epan2_bofinger.q_v = 582.541259765625 +epan2_bofinger.q = .5 +epan2_bofinger.sum_rdev = 46278.05667114258 +epan2_bofinger.sum_adev = 17559.93220318131 +epan2_bofinger.convcode = 0 + +epan2_hsheather = Bunch() +epan2_hsheather.table = np.array([ + [.5601805, .0131763, 42.51, 0.000, .5342206, .5861403], + [81.48233, 14.63518, 5.57, 0.000, 52.64815, 110.3165] + ]) +epan2_hsheather.psrsquared = 0.6206 +epan2_hsheather.rank = 2 +epan2_hsheather.sparsity = 209.3102085912557 +epan2_hsheather.bwidth = .1574393314202373 +epan2_hsheather.kbwidth = 64.53302151153288 +epan2_hsheather.df_m = 1 +epan2_hsheather.df_r = 233 +epan2_hsheather.f_r = .0047775978378236 +epan2_hsheather.N = 235 +epan2_hsheather.q_v = 582.541259765625 +epan2_hsheather.q = .5 +epan2_hsheather.sum_rdev = 46278.05667114258 +epan2_hsheather.sum_adev = 17559.93220318131 +epan2_hsheather.convcode = 0 + +epan2_chamberlain = Bunch() +epan2_chamberlain.table = np.array([ + [.5601805, .0117925, 47.50, 0.000, .5369469, .583414], + [81.48233, 13.0982, 6.22, 0.000, 55.67629, 107.2884] + ]) +epan2_chamberlain.psrsquared = 0.6206 +epan2_chamberlain.rank = 2 +epan2_chamberlain.sparsity = 187.3286437436797 +epan2_chamberlain.bwidth = .063926976464458 +epan2_chamberlain.kbwidth = 25.61257055690209 +epan2_chamberlain.df_m = 1 +epan2_chamberlain.df_r = 233 +epan2_chamberlain.f_r = .0053382119253919 +epan2_chamberlain.N = 235 +epan2_chamberlain.q_v = 582.541259765625 +epan2_chamberlain.q = .5 +epan2_chamberlain.sum_rdev = 46278.05667114258 +epan2_chamberlain.sum_adev = 17559.93220318131 +epan2_chamberlain.convcode = 0 + + +rectangle_bofinger = Bunch() +rectangle_bofinger.table = np.array([ + [.5601805, .0158331, 35.38, 0.000, .5289861, .5913748], + [81.48233, 17.5862, 4.63, 0.000, 46.83404, 116.1306] + ]) +rectangle_bofinger.psrsquared = 0.6206 +rectangle_bofinger.rank = 2 +rectangle_bofinger.sparsity = 251.515372550242 +rectangle_bofinger.bwidth = .2173486679767846 +rectangle_bofinger.kbwidth = 91.50878448104551 +rectangle_bofinger.df_m = 1 +rectangle_bofinger.df_r = 233 +rectangle_bofinger.f_r = .0039759001203803 +rectangle_bofinger.N = 235 +rectangle_bofinger.q_v = 582.541259765625 +rectangle_bofinger.q = .5 +rectangle_bofinger.sum_rdev = 46278.05667114258 +rectangle_bofinger.sum_adev = 17559.93220318131 +rectangle_bofinger.convcode = 0 + +rectangle_hsheather = Bunch() +rectangle_hsheather.table = np.array([ + [.5601805, .0137362, 40.78, 0.000, .5331174, .5872435], + [81.48233, 15.25712, 5.34, 0.000, 51.42279, 111.5419] + ]) +rectangle_hsheather.psrsquared = 0.6206 +rectangle_hsheather.rank = 2 +rectangle_hsheather.sparsity = 218.2051806505069 +rectangle_hsheather.bwidth = .1574393314202373 +rectangle_hsheather.kbwidth = 64.53302151153288 +rectangle_hsheather.df_m = 1 +rectangle_hsheather.df_r = 233 +rectangle_hsheather.f_r = .004582842611797 +rectangle_hsheather.N = 235 +rectangle_hsheather.q_v = 582.541259765625 +rectangle_hsheather.q = .5 +rectangle_hsheather.sum_rdev = 46278.05667114258 +rectangle_hsheather.sum_adev = 17559.93220318131 +rectangle_hsheather.convcode = 0 + +rectangle_chamberlain = Bunch() +rectangle_chamberlain.table = np.array([ + [.5601805, .0118406, 47.31, 0.000, .5368522, .5835087], + [81.48233, 13.1516, 6.20, 0.000, 55.57108, 107.3936] + ]) +rectangle_chamberlain.psrsquared = 0.6206 +rectangle_chamberlain.rank = 2 +rectangle_chamberlain.sparsity = 188.0923150272497 +rectangle_chamberlain.bwidth = .063926976464458 +rectangle_chamberlain.kbwidth = 25.61257055690209 +rectangle_chamberlain.df_m = 1 +rectangle_chamberlain.df_r = 233 +rectangle_chamberlain.f_r = .0053165383171297 +rectangle_chamberlain.N = 235 +rectangle_chamberlain.q_v = 582.541259765625 +rectangle_chamberlain.q = .5 +rectangle_chamberlain.sum_rdev = 46278.05667114258 +rectangle_chamberlain.sum_adev = 17559.93220318131 +rectangle_chamberlain.convcode = 0 + +triangle_bofinger = Bunch() +triangle_bofinger.table = np.array([ + [.5601805, .0138712, 40.38, 0.000, .5328515, .5875094], + [81.48233, 15.40706, 5.29, 0.000, 51.12738, 111.8373] + ]) +triangle_bofinger.psrsquared = 0.6206 +triangle_bofinger.rank = 2 +triangle_bofinger.sparsity = 220.3495620604223 +triangle_bofinger.bwidth = .2173486679767846 +triangle_bofinger.kbwidth = 91.50878448104551 +triangle_bofinger.df_m = 1 +triangle_bofinger.df_r = 233 +triangle_bofinger.f_r = .0045382436463649 +triangle_bofinger.N = 235 +triangle_bofinger.q_v = 582.541259765625 +triangle_bofinger.q = .5 +triangle_bofinger.sum_rdev = 46278.05667114258 +triangle_bofinger.sum_adev = 17559.93220318131 +triangle_bofinger.convcode = 0 + +triangle_hsheather = Bunch() +triangle_hsheather.table = np.array([ + [.5601805, .0128874, 43.47, 0.000, .5347898, .5855711], + [81.48233, 14.31431, 5.69, 0.000, 53.2803, 109.6844] + ]) +triangle_hsheather.psrsquared = 0.6206 +triangle_hsheather.rank = 2 +triangle_hsheather.sparsity = 204.7212998199564 +triangle_hsheather.bwidth = .1574393314202373 +triangle_hsheather.kbwidth = 64.53302151153288 +triangle_hsheather.df_m = 1 +triangle_hsheather.df_r = 233 +triangle_hsheather.f_r = .004884689579831 +triangle_hsheather.N = 235 +triangle_hsheather.q_v = 582.541259765625 +triangle_hsheather.q = .5 +triangle_hsheather.sum_rdev = 46278.05667114258 +triangle_hsheather.sum_adev = 17559.93220318131 +triangle_hsheather.convcode = 0 + +triangle_chamberlain = Bunch() +triangle_chamberlain.table = np.array([ + [.5601805, .0115725, 48.41, 0.000, .5373803, .5829806], + [81.48233, 12.85389, 6.34, 0.000, 56.15764, 106.807] + ]) +triangle_chamberlain.psrsquared = 0.6206 +triangle_chamberlain.rank = 2 +triangle_chamberlain.sparsity = 183.8344452913298 +triangle_chamberlain.bwidth = .063926976464458 +triangle_chamberlain.kbwidth = 25.61257055690209 +triangle_chamberlain.df_m = 1 +triangle_chamberlain.df_r = 233 +triangle_chamberlain.f_r = .0054396769790083 +triangle_chamberlain.N = 235 +triangle_chamberlain.q_v = 582.541259765625 +triangle_chamberlain.q = .5 +triangle_chamberlain.sum_rdev = 46278.05667114258 +triangle_chamberlain.sum_adev = 17559.93220318131 +triangle_chamberlain.convcode = 0 + +gaussian_bofinger = Bunch() +gaussian_bofinger.table = np.array([ + [.5601805, .0197311, 28.39, 0.000, .5213062, .5990547], + [81.48233, 21.91582, 3.72, 0.000, 38.30383, 124.6608] + ]) +gaussian_bofinger.psrsquared = 0.6206 +gaussian_bofinger.rank = 2 +gaussian_bofinger.sparsity = 313.4370075776719 +gaussian_bofinger.bwidth = .2173486679767846 +gaussian_bofinger.kbwidth = 91.50878448104551 +gaussian_bofinger.df_m = 1 +gaussian_bofinger.df_r = 233 +gaussian_bofinger.f_r = .0031904337261521 +gaussian_bofinger.N = 235 +gaussian_bofinger.q_v = 582.541259765625 +gaussian_bofinger.q = .5 +gaussian_bofinger.sum_rdev = 46278.05667114258 +gaussian_bofinger.sum_adev = 17559.93220318131 +gaussian_bofinger.convcode = 0 + +gaussian_hsheather = Bunch() +gaussian_hsheather.table = np.array([ + [.5601805, .016532, 33.88, 0.000, .5276092, .5927518], + [81.48233, 18.36248, 4.44, 0.000, 45.30462, 117.66] + ]) +gaussian_hsheather.psrsquared = 0.6206 +gaussian_hsheather.rank = 2 +gaussian_hsheather.sparsity = 262.6175743002715 +gaussian_hsheather.bwidth = .1574393314202373 +gaussian_hsheather.kbwidth = 64.53302151153288 +gaussian_hsheather.df_m = 1 +gaussian_hsheather.df_r = 233 +gaussian_hsheather.f_r = .0038078182797341 +gaussian_hsheather.N = 235 +gaussian_hsheather.q_v = 582.541259765625 +gaussian_hsheather.q = .5 +gaussian_hsheather.sum_rdev = 46278.05667114258 +gaussian_hsheather.sum_adev = 17559.93220318131 +gaussian_hsheather.convcode = 0 + +gaussian_chamberlain = Bunch() +gaussian_chamberlain.table = np.array([ + [.5601805, .0128123, 43.72, 0.000, .5349378, .5854232], + [81.48233, 14.23088, 5.73, 0.000, 53.44468, 109.52] + ]) +gaussian_chamberlain.psrsquared = 0.6206 +gaussian_chamberlain.rank = 2 +gaussian_chamberlain.sparsity = 203.5280962791137 +gaussian_chamberlain.bwidth = .063926976464458 +gaussian_chamberlain.kbwidth = 25.61257055690209 +gaussian_chamberlain.df_m = 1 +gaussian_chamberlain.df_r = 233 +gaussian_chamberlain.f_r = .004913326554328 +gaussian_chamberlain.N = 235 +gaussian_chamberlain.q_v = 582.541259765625 +gaussian_chamberlain.q = .5 +gaussian_chamberlain.sum_rdev = 46278.05667114258 +gaussian_chamberlain.sum_adev = 17559.93220318131 +gaussian_chamberlain.convcode = 0 + +cosine_bofinger = Bunch() +cosine_bofinger.table = np.array([ + [.5601805, .0121011, 46.29, 0.000, .536339, .5840219], + [81.48233, 13.44092, 6.06, 0.000, 55.00106, 107.9636] + ]) +cosine_bofinger.psrsquared = 0.6206 +cosine_bofinger.rank = 2 +cosine_bofinger.sparsity = 192.2302014415605 +cosine_bofinger.bwidth = .2173486679767846 +cosine_bofinger.kbwidth = 91.50878448104551 +cosine_bofinger.df_m = 1 +cosine_bofinger.df_r = 233 +cosine_bofinger.f_r = .0052020961976883 +cosine_bofinger.N = 235 +cosine_bofinger.q_v = 582.541259765625 +cosine_bofinger.q = .5 +cosine_bofinger.sum_rdev = 46278.05667114258 +cosine_bofinger.sum_adev = 17559.93220318131 +cosine_bofinger.convcode = 0 + +cosine_hsheather = Bunch() +cosine_hsheather.table = np.array([ + [.5601805, .0116679, 48.01, 0.000, .5371924, .5831685], + [81.48233, 12.9598, 6.29, 0.000, 55.94897, 107.0157] +]) +cosine_hsheather.psrsquared = 0.6206 +cosine_hsheather.rank = 2 +cosine_hsheather.sparsity = 185.349198428224 +cosine_hsheather.bwidth = .1574393314202373 +cosine_hsheather.kbwidth = 64.53302151153288 +cosine_hsheather.df_m = 1 +cosine_hsheather.df_r = 233 +cosine_hsheather.f_r = .0053952216059205 +cosine_hsheather.N = 235 +cosine_hsheather.q_v = 582.541259765625 +cosine_hsheather.q = .5 +cosine_hsheather.sum_rdev = 46278.05667114258 +cosine_hsheather.sum_adev = 17559.93220318131 +cosine_hsheather.convcode = 0 + +cosine_chamberlain = Bunch() +cosine_chamberlain.table = np.array([ + [.5601805, .0106479, 52.61, 0.000, .539202, .5811589], + [81.48233, 11.82688, 6.89, 0.000, 58.18104, 104.7836] +]) +cosine_chamberlain.psrsquared = 0.6206 +cosine_chamberlain.rank = 2 +cosine_chamberlain.sparsity = 169.1463943762948 +cosine_chamberlain.bwidth = .063926976464458 +cosine_chamberlain.kbwidth = 25.61257055690209 +cosine_chamberlain.df_m = 1 +cosine_chamberlain.df_r = 233 +cosine_chamberlain.f_r = .0059120385254878 +cosine_chamberlain.N = 235 +cosine_chamberlain.q_v = 582.541259765625 +cosine_chamberlain.q = .5 +cosine_chamberlain.sum_rdev = 46278.05667114258 +cosine_chamberlain.sum_adev = 17559.93220318131 +cosine_chamberlain.convcode = 0 + +parzen_bofinger = Bunch() +parzen_bofinger.table = np.array([ + [.5601805, .012909, 43.39, 0.000, .5347471, .5856138], + [81.48233, 14.33838, 5.68, 0.000, 53.23289, 109.7318] +]) +parzen_bofinger.psrsquared = 0.6206 +parzen_bofinger.rank = 2 +parzen_bofinger.sparsity = 205.0654663067616 +parzen_bofinger.bwidth = .2173486679767846 +parzen_bofinger.kbwidth = 91.50878448104551 +parzen_bofinger.df_m = 1 +parzen_bofinger.df_r = 233 +parzen_bofinger.f_r = .0048764914834762 +parzen_bofinger.N = 235 +parzen_bofinger.q_v = 582.541259765625 +parzen_bofinger.q = .5 +parzen_bofinger.sum_rdev = 46278.05667114258 +parzen_bofinger.sum_adev = 17559.93220318131 +parzen_bofinger.convcode = 0 + +parzen_hsheather = Bunch() +parzen_hsheather.table = np.array([ + [.5601805, .0122688, 45.66, 0.000, .5360085, .5843524], + [81.48233, 13.62723, 5.98, 0.000, 54.63401, 108.3307] +]) +parzen_hsheather.psrsquared = 0.6206 +parzen_hsheather.rank = 2 +parzen_hsheather.sparsity = 194.8946558099188 +parzen_hsheather.bwidth = .1574393314202373 +parzen_hsheather.kbwidth = 64.53302151153288 +parzen_hsheather.df_m = 1 +parzen_hsheather.df_r = 233 +parzen_hsheather.f_r = .0051309770185556 +parzen_hsheather.N = 235 +parzen_hsheather.q_v = 582.541259765625 +parzen_hsheather.q = .5 +parzen_hsheather.sum_rdev = 46278.05667114258 +parzen_hsheather.sum_adev = 17559.93220318131 +parzen_hsheather.convcode = 0 + +parzen_chamberlain = Bunch() +parzen_chamberlain.table = np.array([ + [.5601805, .0110507, 50.69, 0.000, .5384084, .5819526], + [81.48233, 12.2743, 6.64, 0.000, 57.29954, 105.6651] +]) +parzen_chamberlain.psrsquared = 0.6206 +parzen_chamberlain.rank = 2 +parzen_chamberlain.sparsity = 175.5452813763412 +parzen_chamberlain.bwidth = .063926976464458 +parzen_chamberlain.kbwidth = 25.61257055690209 +parzen_chamberlain.df_m = 1 +parzen_chamberlain.df_r = 233 +parzen_chamberlain.f_r = .0056965359146063 +parzen_chamberlain.N = 235 +parzen_chamberlain.q_v = 582.541259765625 +parzen_chamberlain.q = .5 +parzen_chamberlain.sum_rdev = 46278.05667114258 +parzen_chamberlain.sum_adev = 17559.93220318131 +parzen_chamberlain.convcode = 0 + +Rquantreg = Bunch() +Rquantreg.fittedvalues = np.array([ + 278.946531823426, 327.662259651587, 472.195784028597, 366.902127539958, + 411.817682123087, 490.131199885949, 443.36524597881, 503.536477958636, + 636.406081281679, 709.736288922034, 312.165058899648, 357.917286612496, + 427.907157504212, 333.474578745265, 396.777813086185, 447.125068738706, + 325.117049130677, 349.771067249961, 481.598886608367, 306.106158691415, + 388.420502955027, 511.05437589194, 313.836609745169, 372.960145596262, + 485.358358918327, 284.379882747628, 346.21761302202, 470.314386890694, + 292.735362869831, 345.174109237497, 431.875199165716, 312.003504742171, + 396.809344806674, 474.141604734191, 463.93526593027, 430.280150030025, + 453.602705891221, 579.151509166254, 320.586493222875, 379.637682965454, + 261.63071606774, 452.262394881918, 560.558633285135, 361.453261675451, + 433.779038355879, 334.560374744198, 465.46340752116, 615.361560833631, + 934.235038902725, 699.263962186247, 403.470311834164, 431.875199165716, + 610.619729234566, 592.662336978523, 365.021855935831, 494.3226340628, + 571.610146001548, 820.79435094965, 1244.13870203673, 480.7121636877, + 1031.46758784013, 362.238578597709, 467.705425607653, 577.073721157792, + 591.087071047729, 323.397708458532, 569.0193777981, 547.264281981988, + 304.861831677351, 727.261856258699, 382.899300447742, 380.080019200391, + 387.548077543462, 455.939284414524, 461.007422390708, 469.504909066202, + 571.628605113602, 482.528691661418, 447.239662606701, 443.405235218729, + 617.975233440748, 888.754433927184, 390.908239427091, 479.934781986261, + 872.520684097057, 468.389025193617, 467.583874563025, 600.891141536243, + 328.94286096288, 524.54251098332, 697.904660068404, 443.782036008026, + 501.879849409525, 647.703493205875, 458.730704476452, 401.721440320659, + 507.49016247142, 722.834547664808, 380.206920088912, 481.131145133749, + 299.904199685339, 347.488751302111, 488.171723133137, 368.620444647759, + 1135.31179977255, 831.440717300088, 578.509405496803, 437.83023460596, + 618.056493326843, 550.238043601025, 289.910800377653, 583.813030650723, + 502.185524461957, 519.079736225537, 280.441976767315, 334.638935071642, + 489.10661171308, 651.842445716676, 1050.52148262534, 346.050058523346, + 729.252186278533, 558.451123252156, 529.859949563712, 668.51276154189, + 1113.66644452647, 747.093352541566, 858.247029841287, 917.230577685989, + 390.29683477012, 339.650965997876, 350.536705877117, 295.394850812194, + 502.711215489629, 465.29644549865, 398.753783734842, 328.660789278315, + 747.883662637697, 2102.02108846944, 499.727307212846, 278.882398125705, + 335.933513242034, 387.198765462081, 672.019128653175, 439.917678218736, + 461.755563134383, 669.580269655421, 614.886877182468, 657.691667171562, + 913.373865558921, 596.066409235456, 562.142375003233, 844.328711460744, + 517.593907165227, 463.853902738299, 1087.39298812569, 583.363256443676, + 601.337926899021, 720.657238588974, 386.421327566452, 493.072243052398, + 493.072243052398, 493.072243052398, 487.416418391789, 625.768736956952, + 717.442211022949, 649.545102325439, 315.764483006998, 387.279123698926, + 725.770230770932, 534.438688677752, 265.753297513836, 265.753297513836, + 275.266770483504, 444.714192650306, 357.226955834115, 466.694950404995, + 521.878226495306, 514.492832530541, 401.82351113515, 308.781536524607, + 410.920025494164, 506.942199600954, 426.771590593594, 444.329655290455, + 567.951437149727, 314.044484679614, 341.637888287124, 390.011222091572, + 371.617953454683, 491.650387255751, 309.86707973756, 339.215312155678, + 401.313514123063, 274.198577993648, 366.737853359169, 602.621623875386, + 397.5527766612, 431.743315417498, 502.103203876367, 758.493699184236, + 354.616793574895, 495.299694296035, 445.994704272822, 461.179388784645, + 492.398877810457, 300.177654706392, 351.604018662754, 397.001476569931, + 443.325261537312, 495.754449130328, 597.467889923833, 495.384438403965, + 563.913157758648, 890.789267794131, 326.949960612346, 296.399786939819, + 336.191062827908, 406.145865402583, 678.81933687482, 997.557647439337, + 365.6649642219, 415.242904378452, 543.581822640472, 310.924419326878, + 519.951702825405, 751.022676264054, 422.151172626615, 604.684498888169, + 836.51478813311, 277.051441764913, 287.126391607546, 327.57744312456, + 343.712072517474, 408.684566875422, 535.079861284096 +]) + +Rquantreg.residuals = np.array([ + -23.1071072288498, -16.7035925924416, 13.4842301424879, + 36.0952280042049, 83.7430928106889, 143.666615246444, 187.391321726407, + 196.904426307396, 194.552540223671, 105.623928368427, 25.8363284299391, + 54.4440518161423, 92.0934604769094, 118.926894162067, 115.9422447507, + 211.714461564889, 67.4824476183351, 93.7875665496341, 158.517491105043, + 27.7332282843317, 78.537815573821, 32.3425283712905, 3.88323401131549, + 51.360750756311, 33.6032971350797, 53.6215045819588, 73.423561609355, + 6.00566204286901, 93.6248004402887, 78.1042405680565, 71.4819720245138, + 42.635363803128, 100.508824022316, 114.377859224531, 190.661878666847, + 120.44727756794, 74.7742708230821, 61.3298388891191, 80.7338623237625, + 56.3613389354645, 14.9298935780977, 136.086423177107, 103.639168918795, + 83.406904735325, 29.1204765079443, 43.2188638018142, 87.68702809519, + 195.534593927816, 133.719017238015, 350.614829501073, 119.230897841979, + 140.205463451968, 296.7772153462, 218.915256717207, 62.7756642652107, + 155.675830060721, 288.990008558354, 322.6267348787, 788.540488171593, + 109.906163322267, 538.923550476946, 121.241446063999, 132.774973479468, + 119.128384587689, 183.709108010048, 67.2007219409504, 43.5425230980599, + 161.49786961119, -7.94264590491014, 344.200840210711, 113.698279589573, + 123.317422174319, -29.9069666643728, -25.6016916976065, + 163.691619008174, 113.036341875648, 8.59293713333579, 61.3520511228119, + 141.397517015987, 184.594660239251, 94.1259408216085, 79.6405061341515, + 91.6733481942127, 113.234603595283, 161.045070172193, 225.290448255665, + 226.095598886257, 160.387924286533, 32.4551953759993, 103.909707216036, + 73.543904350086, 313.336630439861, 319.717144678425, 374.616677214425, + 220.710022883649, 137.027675366142, 172.507934775539, 254.168723294869, + 180.994568087336, 247.26860148984, 72.4144228992704, 14.0322012670994, + 29.7478676180694, 91.1972063421171, -271.391948301552, + -1.13686837721616e-13, -43.7483617057195, -45.7799925843755, + 316.918702117259, 263.070052700293, -26.2008042070246, + 185.270818370404, 128.400761958987, 126.90766445377, 39.11640958216, + 13.8128950328002, 125.400191450337, 10.1671163220818, 453.849292287238, + 60.1679571929374, -37.0832869573327, 29.6859273527971, + -18.5990635840888, 32.0472277998125, 187.478653019356, + 131.972664872163, 54.6380484088667, 592.550594160211, 93.7637141660844, + 60.0193510971532, 93.5633996863289, -46.5847395899585, + 25.0901440883857, 35.3349035566588, 38.0569510057356, 46.1382548463761, + -21.4915275364559, -274.821124029843, 23.7637774954742, + 56.1174237129451, 137.267370647069, 194.004180243594, 257.734838779675, + 151.279738459292, 175.792712085095, 5.37066578891586, 161.87201799729, + 301.825301306357, 337.590468355399, 141.753670144823, 248.534867350933, + 138.672153434971, 191.302922030722, 169.266111420092, 337.411668163301, + 247.595365061674, 324.241547334534, 441.345158140916, + -2.96336484193375, 128.045086149367, 128.045086149367, + 128.045086149367, 61.183812841238, 119.466557499153, 120.358284525061, + 145.795139311381, 102.833084929086, 121.51832618868, 157.507780852421, + 208.08888035649, -23.4330955930956, -23.4330955930956, + -9.26578861762408, 170.044609958764, 28.0914420512634, + 48.9250186205624, 186.600476930648, 219.742798279756, 31.1774726408891, + 18.6372355131512, 18.1199081442213, 112.698628091063, + -25.9726125403696, 176.470984835994, 252.045003846191, + 46.8335329758523, 54.1229163256514, 51.9888300300891, 32.4204776768067, + 179.14892185478, -12.2969284011601, 14.2728509760057, + -17.3759292437432, 10.6022252751131, 64.362111397076, 198.730134737533, + 50.898482335236, 146.167755331756, 68.4178084237137, 106.826836694182, + 89.9409707510827, 185.120132493866, 130.283190180665, 170.618786347098, + 116.24297250849, 0.822265604206791, 26.3943953963694, 0, + 145.19420242141, 186.007125906439, 209.892380176326, 201.416658681816, + 247.283084092749, 414.930873548859, 115.050091509315, 57.2015105045924, + 131.809734683313, 120.611481397197, 211.419693391706, 321.245634797383, + -34.6644264712713, 1.15862100546684, 53.2587319600932, + 97.5747986822971, 255.069199707627, 387.139369759176, 63.3685935821613, + 168.076643464964, 157.44822913826, 28.387531965303, 19.3926869633912, + -28.3781151570223, 124.288724993746, 113.917339005042, 215.240302135105 +]) diff --git a/shared/package-files/09/0934de8f9f68aabdbae28e8c9fab75905a3df484614bb04be50f77c359b049e2/blob b/shared/package-files/09/0934de8f9f68aabdbae28e8c9fab75905a3df484614bb04be50f77c359b049e2/blob new file mode 100644 index 0000000000000000000000000000000000000000..bdddd008470438109129901215c59c738d9de051 --- /dev/null +++ b/shared/package-files/09/0934de8f9f68aabdbae28e8c9fab75905a3df484614bb04be50f77c359b049e2/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _functional_assert_scalar { + using schema = at::Tensor (const at::Scalar &, c10::string_view, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_functional_assert_scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_functional_assert_scalar(Scalar self, str assert_msg, Tensor dep_token) -> Tensor") + static at::Tensor call(const at::Scalar & self, c10::string_view assert_msg, const at::Tensor & dep_token); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & self, c10::string_view assert_msg, const at::Tensor & dep_token); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/09/0937a7157f289e976861b7b61f621ee424d94363dcac53dbfc45dec89a4635d8/blob b/shared/package-files/09/0937a7157f289e976861b7b61f621ee424d94363dcac53dbfc45dec89a4635d8/blob new file mode 100644 index 0000000000000000000000000000000000000000..082750f56d4644b63e06025cf07085467812af9c --- /dev/null +++ b/shared/package-files/09/0937a7157f289e976861b7b61f621ee424d94363dcac53dbfc45dec89a4635d8/blob @@ -0,0 +1,528 @@ +""" +Instantiate a variation font. Run, eg: + +.. code-block:: sh + + $ fonttools varLib.mutator ./NotoSansArabic-VF.ttf wght=140 wdth=85 + +.. warning:: + ``fontTools.varLib.mutator`` is deprecated in favor of :mod:`fontTools.varLib.instancer` + which provides equivalent full instancing and also supports partial instancing. + Please migrate CLI usage to ``fonttools varLib.instancer`` and API usage to + :func:`fontTools.varLib.instancer.instantiateVariableFont`. +""" + +from fontTools.misc.fixedTools import floatToFixedToFloat, floatToFixed +from fontTools.misc.loggingTools import deprecateFunction +from fontTools.misc.roundTools import otRound +from fontTools.pens.boundsPen import BoundsPen +from fontTools.ttLib import TTFont, newTable +from fontTools.ttLib.tables import ttProgram +from fontTools.ttLib.tables._g_l_y_f import ( + GlyphCoordinates, + flagOverlapSimple, + OVERLAP_COMPOUND, +) +from fontTools.varLib.models import ( + supportScalar, + normalizeLocation, + piecewiseLinearMap, +) +from fontTools.varLib.merger import MutatorMerger +from fontTools.varLib.varStore import VarStoreInstancer +from fontTools.varLib.mvar import MVAR_ENTRIES +from fontTools.varLib.iup import iup_delta +import fontTools.subset.cff +import os.path +import logging +from io import BytesIO + +log = logging.getLogger("fontTools.varlib.mutator") + +# map 'wdth' axis (1..200) to OS/2.usWidthClass (1..9), rounding to closest +OS2_WIDTH_CLASS_VALUES = {} +percents = [50.0, 62.5, 75.0, 87.5, 100.0, 112.5, 125.0, 150.0, 200.0] +for i, (prev, curr) in enumerate(zip(percents[:-1], percents[1:]), start=1): + half = (prev + curr) / 2 + OS2_WIDTH_CLASS_VALUES[half] = i + + +def interpolate_cff2_PrivateDict(topDict, interpolateFromDeltas): + pd_blend_lists = ( + "BlueValues", + "OtherBlues", + "FamilyBlues", + "FamilyOtherBlues", + "StemSnapH", + "StemSnapV", + ) + pd_blend_values = ("BlueScale", "BlueShift", "BlueFuzz", "StdHW", "StdVW") + for fontDict in topDict.FDArray: + pd = fontDict.Private + vsindex = pd.vsindex if (hasattr(pd, "vsindex")) else 0 + for key, value in pd.rawDict.items(): + if (key in pd_blend_values) and isinstance(value, list): + delta = interpolateFromDeltas(vsindex, value[1:]) + pd.rawDict[key] = otRound(value[0] + delta) + elif (key in pd_blend_lists) and isinstance(value[0], list): + """If any argument in a BlueValues list is a blend list, + then they all are. The first value of each list is an + absolute value. The delta tuples are calculated from + relative master values, hence we need to append all the + deltas to date to each successive absolute value.""" + delta = 0 + for i, val_list in enumerate(value): + delta += otRound(interpolateFromDeltas(vsindex, val_list[1:])) + value[i] = val_list[0] + delta + + +def interpolate_cff2_charstrings(topDict, interpolateFromDeltas, glyphOrder): + charstrings = topDict.CharStrings + for gname in glyphOrder: + # Interpolate charstring + # e.g replace blend op args with regular args, + # and use and discard vsindex op. + charstring = charstrings[gname] + new_program = [] + vsindex = 0 + last_i = 0 + for i, token in enumerate(charstring.program): + if token == "vsindex": + vsindex = charstring.program[i - 1] + if last_i != 0: + new_program.extend(charstring.program[last_i : i - 1]) + last_i = i + 1 + elif token == "blend": + num_regions = charstring.getNumRegions(vsindex) + numMasters = 1 + num_regions + num_args = charstring.program[i - 1] + # The program list starting at program[i] is now: + # ..args for following operations + # num_args values from the default font + # num_args tuples, each with numMasters-1 delta values + # num_blend_args + # 'blend' + argi = i - (num_args * numMasters + 1) + end_args = tuplei = argi + num_args + while argi < end_args: + next_ti = tuplei + num_regions + deltas = charstring.program[tuplei:next_ti] + delta = interpolateFromDeltas(vsindex, deltas) + charstring.program[argi] += otRound(delta) + tuplei = next_ti + argi += 1 + new_program.extend(charstring.program[last_i:end_args]) + last_i = i + 1 + if last_i != 0: + new_program.extend(charstring.program[last_i:]) + charstring.program = new_program + + +def interpolate_cff2_metrics(varfont, topDict, glyphOrder, loc): + """Unlike TrueType glyphs, neither advance width nor bounding box + info is stored in a CFF2 charstring. The width data exists only in + the hmtx and HVAR tables. Since LSB data cannot be interpolated + reliably from the master LSB values in the hmtx table, we traverse + the charstring to determine the actual bound box.""" + + charstrings = topDict.CharStrings + boundsPen = BoundsPen(glyphOrder) + hmtx = varfont["hmtx"] + hvar_table = None + if "HVAR" in varfont: + hvar_table = varfont["HVAR"].table + fvar = varfont["fvar"] + varStoreInstancer = VarStoreInstancer(hvar_table.VarStore, fvar.axes, loc) + + for gid, gname in enumerate(glyphOrder): + entry = list(hmtx[gname]) + # get width delta. + if hvar_table: + if hvar_table.AdvWidthMap: + width_idx = hvar_table.AdvWidthMap.mapping[gname] + else: + width_idx = gid + width_delta = otRound(varStoreInstancer[width_idx]) + else: + width_delta = 0 + + # get LSB. + boundsPen.init() + charstring = charstrings[gname] + charstring.draw(boundsPen) + if boundsPen.bounds is None: + # Happens with non-marking glyphs + lsb_delta = 0 + else: + lsb = otRound(boundsPen.bounds[0]) + lsb_delta = entry[1] - lsb + + if lsb_delta or width_delta: + if width_delta: + entry[0] = max(0, entry[0] + width_delta) + if lsb_delta: + entry[1] = lsb + hmtx[gname] = tuple(entry) + + +@deprecateFunction( + "use fontTools.varLib.instancer.instantiateVariableFont instead " + "for either full or partial instancing", +) +def instantiateVariableFont(varfont, location, inplace=False, overlap=True): + """Generate a static instance from a variable TTFont and a dictionary + defining the desired location along the variable font's axes. + The location values must be specified as user-space coordinates, e.g.: + + .. code-block:: + + {'wght': 400, 'wdth': 100} + + By default, a new TTFont object is returned. If ``inplace`` is True, the + input varfont is modified and reduced to a static font. + + When the overlap parameter is defined as True, + OVERLAP_SIMPLE and OVERLAP_COMPOUND bits are set to 1. See + https://docs.microsoft.com/en-us/typography/opentype/spec/glyf + """ + if not inplace: + # make a copy to leave input varfont unmodified + stream = BytesIO() + varfont.save(stream) + stream.seek(0) + varfont = TTFont(stream) + + fvar = varfont["fvar"] + axes = {a.axisTag: (a.minValue, a.defaultValue, a.maxValue) for a in fvar.axes} + loc = normalizeLocation(location, axes) + if "avar" in varfont: + maps = varfont["avar"].segments + loc = {k: piecewiseLinearMap(v, maps[k]) for k, v in loc.items()} + # Quantize to F2Dot14, to avoid surprise interpolations. + loc = {k: floatToFixedToFloat(v, 14) for k, v in loc.items()} + # Location is normalized now + log.info("Normalized location: %s", loc) + + if "gvar" in varfont: + log.info("Mutating glyf/gvar tables") + gvar = varfont["gvar"] + glyf = varfont["glyf"] + hMetrics = varfont["hmtx"].metrics + vMetrics = getattr(varfont.get("vmtx"), "metrics", None) + # get list of glyph names in gvar sorted by component depth + glyphnames = sorted( + gvar.variations.keys(), + key=lambda name: ( + ( + glyf[name].getCompositeMaxpValues(glyf).maxComponentDepth + if glyf[name].isComposite() + else 0 + ), + name, + ), + ) + for glyphname in glyphnames: + variations = gvar.variations[glyphname] + coordinates, _ = glyf._getCoordinatesAndControls( + glyphname, hMetrics, vMetrics + ) + origCoords, endPts = None, None + for var in variations: + scalar = supportScalar(loc, var.axes) + if not scalar: + continue + delta = var.coordinates + if None in delta: + if origCoords is None: + origCoords, g = glyf._getCoordinatesAndControls( + glyphname, hMetrics, vMetrics + ) + delta = iup_delta(delta, origCoords, g.endPts) + coordinates += GlyphCoordinates(delta) * scalar + glyf._setCoordinates(glyphname, coordinates, hMetrics, vMetrics) + else: + glyf = None + + if "DSIG" in varfont: + del varfont["DSIG"] + + if "cvar" in varfont: + log.info("Mutating cvt/cvar tables") + cvar = varfont["cvar"] + cvt = varfont["cvt "] + deltas = {} + for var in cvar.variations: + scalar = supportScalar(loc, var.axes) + if not scalar: + continue + for i, c in enumerate(var.coordinates): + if c is not None: + deltas[i] = deltas.get(i, 0) + scalar * c + for i, delta in deltas.items(): + cvt[i] += otRound(delta) + + if "CFF2" in varfont: + log.info("Mutating CFF2 table") + glyphOrder = varfont.getGlyphOrder() + CFF2 = varfont["CFF2"] + topDict = CFF2.cff.topDictIndex[0] + vsInstancer = VarStoreInstancer(topDict.VarStore.otVarStore, fvar.axes, loc) + interpolateFromDeltas = vsInstancer.interpolateFromDeltas + interpolate_cff2_PrivateDict(topDict, interpolateFromDeltas) + CFF2.desubroutinize() + interpolate_cff2_charstrings(topDict, interpolateFromDeltas, glyphOrder) + interpolate_cff2_metrics(varfont, topDict, glyphOrder, loc) + del topDict.rawDict["VarStore"] + del topDict.VarStore + + if "MVAR" in varfont: + log.info("Mutating MVAR table") + mvar = varfont["MVAR"].table + varStoreInstancer = VarStoreInstancer(mvar.VarStore, fvar.axes, loc) + records = mvar.ValueRecord + for rec in records: + mvarTag = rec.ValueTag + if mvarTag not in MVAR_ENTRIES: + continue + tableTag, itemName = MVAR_ENTRIES[mvarTag] + delta = otRound(varStoreInstancer[rec.VarIdx]) + if not delta: + continue + setattr( + varfont[tableTag], + itemName, + getattr(varfont[tableTag], itemName) + delta, + ) + + log.info("Mutating FeatureVariations") + for tableTag in "GSUB", "GPOS": + if not tableTag in varfont: + continue + table = varfont[tableTag].table + if not getattr(table, "FeatureVariations", None): + continue + variations = table.FeatureVariations + for record in variations.FeatureVariationRecord: + applies = True + for condition in record.ConditionSet.ConditionTable: + if condition.Format == 1: + axisIdx = condition.AxisIndex + axisTag = fvar.axes[axisIdx].axisTag + Min = condition.FilterRangeMinValue + Max = condition.FilterRangeMaxValue + v = loc[axisTag] + if not (Min <= v <= Max): + applies = False + else: + applies = False + if not applies: + break + + if applies: + assert record.FeatureTableSubstitution.Version == 0x00010000 + for rec in record.FeatureTableSubstitution.SubstitutionRecord: + table.FeatureList.FeatureRecord[rec.FeatureIndex].Feature = ( + rec.Feature + ) + break + del table.FeatureVariations + + if "GDEF" in varfont and varfont["GDEF"].table.Version >= 0x00010003: + log.info("Mutating GDEF/GPOS/GSUB tables") + gdef = varfont["GDEF"].table + instancer = VarStoreInstancer(gdef.VarStore, fvar.axes, loc) + + merger = MutatorMerger(varfont, instancer) + merger.mergeTables(varfont, [varfont], ["GDEF", "GPOS"]) + + # Downgrade GDEF. + del gdef.VarStore + gdef.Version = 0x00010002 + if gdef.MarkGlyphSetsDef is None: + del gdef.MarkGlyphSetsDef + gdef.Version = 0x00010000 + + if not ( + gdef.LigCaretList + or gdef.MarkAttachClassDef + or gdef.GlyphClassDef + or gdef.AttachList + or (gdef.Version >= 0x00010002 and gdef.MarkGlyphSetsDef) + ): + del varfont["GDEF"] + + addidef = False + if glyf: + for glyph in glyf.glyphs.values(): + if hasattr(glyph, "program"): + instructions = glyph.program.getAssembly() + # If GETVARIATION opcode is used in bytecode of any glyph add IDEF + addidef = any(op.startswith("GETVARIATION") for op in instructions) + if addidef: + break + if overlap: + for glyph_name in glyf.keys(): + glyph = glyf[glyph_name] + # Set OVERLAP_COMPOUND bit for compound glyphs + if glyph.isComposite(): + glyph.components[0].flags |= OVERLAP_COMPOUND + # Set OVERLAP_SIMPLE bit for simple glyphs + elif glyph.numberOfContours > 0: + glyph.flags[0] |= flagOverlapSimple + if addidef: + log.info("Adding IDEF to fpgm table for GETVARIATION opcode") + asm = [] + if "fpgm" in varfont: + fpgm = varfont["fpgm"] + asm = fpgm.program.getAssembly() + else: + fpgm = newTable("fpgm") + fpgm.program = ttProgram.Program() + varfont["fpgm"] = fpgm + asm.append("PUSHB[000] 145") + asm.append("IDEF[ ]") + args = [str(len(loc))] + for a in fvar.axes: + args.append(str(floatToFixed(loc[a.axisTag], 14))) + asm.append("NPUSHW[ ] " + " ".join(args)) + asm.append("ENDF[ ]") + fpgm.program.fromAssembly(asm) + + # Change maxp attributes as IDEF is added + if "maxp" in varfont: + maxp = varfont["maxp"] + setattr( + maxp, "maxInstructionDefs", 1 + getattr(maxp, "maxInstructionDefs", 0) + ) + setattr( + maxp, + "maxStackElements", + max(len(loc), getattr(maxp, "maxStackElements", 0)), + ) + + if "name" in varfont: + log.info("Pruning name table") + exclude = {a.axisNameID for a in fvar.axes} + for i in fvar.instances: + exclude.add(i.subfamilyNameID) + exclude.add(i.postscriptNameID) + if "ltag" in varfont: + # Drop the whole 'ltag' table if all its language tags are referenced by + # name records to be pruned. + # TODO: prune unused ltag tags and re-enumerate langIDs accordingly + excludedUnicodeLangIDs = [ + n.langID + for n in varfont["name"].names + if n.nameID in exclude and n.platformID == 0 and n.langID != 0xFFFF + ] + if set(excludedUnicodeLangIDs) == set(range(len((varfont["ltag"].tags)))): + del varfont["ltag"] + varfont["name"].names[:] = [ + n + for n in varfont["name"].names + if n.nameID < 256 or n.nameID not in exclude + ] + + if "wght" in location and "OS/2" in varfont: + varfont["OS/2"].usWeightClass = otRound(max(1, min(location["wght"], 1000))) + if "wdth" in location: + wdth = location["wdth"] + for percent, widthClass in sorted(OS2_WIDTH_CLASS_VALUES.items()): + if wdth < percent: + varfont["OS/2"].usWidthClass = widthClass + break + else: + varfont["OS/2"].usWidthClass = 9 + if "slnt" in location and "post" in varfont: + varfont["post"].italicAngle = max(-90, min(location["slnt"], 90)) + + log.info("Removing variable tables") + for tag in ("avar", "cvar", "fvar", "gvar", "HVAR", "MVAR", "VVAR", "STAT"): + if tag in varfont: + del varfont[tag] + + return varfont + + +def main(args=None): + """Instantiate a variation font""" + from fontTools import configLogger + import argparse + + parser = argparse.ArgumentParser( + "fonttools varLib.mutator", description="Instantiate a variable font" + ) + parser.add_argument("input", metavar="INPUT.ttf", help="Input variable TTF file.") + parser.add_argument( + "locargs", + metavar="AXIS=LOC", + nargs="*", + help="List of space separated locations. A location consist in " + "the name of a variation axis, followed by '=' and a number. E.g.: " + " wght=700 wdth=80. The default is the location of the base master.", + ) + parser.add_argument( + "-o", + "--output", + metavar="OUTPUT.ttf", + default=None, + help="Output instance TTF file (default: INPUT-instance.ttf).", + ) + parser.add_argument( + "--no-recalc-timestamp", + dest="recalc_timestamp", + action="store_false", + help="Don't set the output font's timestamp to the current time.", + ) + logging_group = parser.add_mutually_exclusive_group(required=False) + logging_group.add_argument( + "-v", "--verbose", action="store_true", help="Run more verbosely." + ) + logging_group.add_argument( + "-q", "--quiet", action="store_true", help="Turn verbosity off." + ) + parser.add_argument( + "--no-overlap", + dest="overlap", + action="store_false", + help="Don't set OVERLAP_SIMPLE/OVERLAP_COMPOUND glyf flags.", + ) + options = parser.parse_args(args) + + varfilename = options.input + outfile = ( + os.path.splitext(varfilename)[0] + "-instance.ttf" + if not options.output + else options.output + ) + configLogger( + level=("DEBUG" if options.verbose else "ERROR" if options.quiet else "INFO") + ) + + loc = {} + for arg in options.locargs: + try: + tag, val = arg.split("=") + assert len(tag) <= 4 + loc[tag.ljust(4)] = float(val) + except (ValueError, AssertionError): + parser.error("invalid location argument format: %r" % arg) + log.info("Location: %s", loc) + + log.info("Loading variable font") + varfont = TTFont(varfilename, recalcTimestamp=options.recalc_timestamp) + + instantiateVariableFont(varfont, loc, inplace=True, overlap=options.overlap) + + log.info("Saving instance font %s", outfile) + varfont.save(outfile) + + +if __name__ == "__main__": + import sys + + if len(sys.argv) > 1: + sys.exit(main()) + import doctest + + sys.exit(doctest.testmod().failed) diff --git a/shared/package-files/09/0937eba3aba4585c86ec30d86450b6b80de9333c6be40fdab150f0b3c639f81b/blob b/shared/package-files/09/0937eba3aba4585c86ec30d86450b6b80de9333c6be40fdab150f0b3c639f81b/blob new file mode 100644 index 0000000000000000000000000000000000000000..587861ac0f1f9aad782d6f3abae6bf70ea60e1c8 --- /dev/null +++ b/shared/package-files/09/0937eba3aba4585c86ec30d86450b6b80de9333c6be40fdab150f0b3c639f81b/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor index_copy(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & source); +TORCH_API at::Tensor & index_copy_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & source); +TORCH_API at::Tensor & index_copy_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & source, at::Tensor & out); +TORCH_API at::Tensor & index_copy_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & source); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/09/0938f82cbc2dbac239d47929cc3d093e884fd5f7cdc68800545cfc58bb961733/blob b/shared/package-files/09/0938f82cbc2dbac239d47929cc3d093e884fd5f7cdc68800545cfc58bb961733/blob new file mode 100644 index 0000000000000000000000000000000000000000..1228d0af2e6a6a8ae504297c7562d3beb5ba9516 --- /dev/null +++ b/shared/package-files/09/0938f82cbc2dbac239d47929cc3d093e884fd5f7cdc68800545cfc58bb961733/blob @@ -0,0 +1,114 @@ +from inspect import getfullargspec + +from numpy.testing import assert_raises + +from .. import asarray, _elementwise_functions +from .._elementwise_functions import bitwise_left_shift, bitwise_right_shift +from .._dtypes import ( + _dtype_categories, + _boolean_dtypes, + _floating_dtypes, + _integer_dtypes, +) + + +def nargs(func): + return len(getfullargspec(func).args) + + +def test_function_types(): + # Test that every function accepts only the required input types. We only + # test the negative cases here (error). The positive cases are tested in + # the array API test suite. + + elementwise_function_input_types = { + "abs": "numeric", + "acos": "floating-point", + "acosh": "floating-point", + "add": "numeric", + "asin": "floating-point", + "asinh": "floating-point", + "atan": "floating-point", + "atan2": "real floating-point", + "atanh": "floating-point", + "bitwise_and": "integer or boolean", + "bitwise_invert": "integer or boolean", + "bitwise_left_shift": "integer", + "bitwise_or": "integer or boolean", + "bitwise_right_shift": "integer", + "bitwise_xor": "integer or boolean", + "ceil": "real numeric", + "conj": "complex floating-point", + "cos": "floating-point", + "cosh": "floating-point", + "divide": "floating-point", + "equal": "all", + "exp": "floating-point", + "expm1": "floating-point", + "floor": "real numeric", + "floor_divide": "real numeric", + "greater": "real numeric", + "greater_equal": "real numeric", + "imag": "complex floating-point", + "isfinite": "numeric", + "isinf": "numeric", + "isnan": "numeric", + "less": "real numeric", + "less_equal": "real numeric", + "log": "floating-point", + "logaddexp": "real floating-point", + "log10": "floating-point", + "log1p": "floating-point", + "log2": "floating-point", + "logical_and": "boolean", + "logical_not": "boolean", + "logical_or": "boolean", + "logical_xor": "boolean", + "multiply": "numeric", + "negative": "numeric", + "not_equal": "all", + "positive": "numeric", + "pow": "numeric", + "real": "complex floating-point", + "remainder": "real numeric", + "round": "numeric", + "sign": "numeric", + "sin": "floating-point", + "sinh": "floating-point", + "sqrt": "floating-point", + "square": "numeric", + "subtract": "numeric", + "tan": "floating-point", + "tanh": "floating-point", + "trunc": "real numeric", + } + + def _array_vals(): + for d in _integer_dtypes: + yield asarray(1, dtype=d) + for d in _boolean_dtypes: + yield asarray(False, dtype=d) + for d in _floating_dtypes: + yield asarray(1.0, dtype=d) + + for x in _array_vals(): + for func_name, types in elementwise_function_input_types.items(): + dtypes = _dtype_categories[types] + func = getattr(_elementwise_functions, func_name) + if nargs(func) == 2: + for y in _array_vals(): + if x.dtype not in dtypes or y.dtype not in dtypes: + assert_raises(TypeError, lambda: func(x, y)) + else: + if x.dtype not in dtypes: + assert_raises(TypeError, lambda: func(x)) + + +def test_bitwise_shift_error(): + # bitwise shift functions should raise when the second argument is negative + assert_raises( + ValueError, lambda: bitwise_left_shift(asarray([1, 1]), asarray([1, -1])) + ) + assert_raises( + ValueError, lambda: bitwise_right_shift(asarray([1, 1]), asarray([1, -1])) + ) diff --git a/shared/package-files/09/0939533feac811be371ac5aec67815b9c6fccb0c08cf86886c1b86962511fd82/blob b/shared/package-files/09/0939533feac811be371ac5aec67815b9c6fccb0c08cf86886c1b86962511fd82/blob new file mode 100644 index 0000000000000000000000000000000000000000..3529dc4ee420354d778dce0ab7ac4474ce403298 --- /dev/null +++ b/shared/package-files/09/0939533feac811be371ac5aec67815b9c6fccb0c08cf86886c1b86962511fd82/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0939533feac811be371ac5aec67815b9c6fccb0c08cf86886c1b86962511fd82 +size 447648 diff --git a/shared/package-files/09/0939d6eba1e1f58eade0f604c8bb8d08b3588dff3d718a67cca19d3221e5e1df/blob b/shared/package-files/09/0939d6eba1e1f58eade0f604c8bb8d08b3588dff3d718a67cca19d3221e5e1df/blob new file mode 100644 index 0000000000000000000000000000000000000000..1a69ee8bb5e223ce3c801ccef4aaf147aa9e3d1c --- /dev/null +++ b/shared/package-files/09/0939d6eba1e1f58eade0f604c8bb8d08b3588dff3d718a67cca19d3221e5e1df/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API linalg_lstsq { + using schema = ::std::tuple (const at::Tensor &, const at::Tensor &, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linalg_lstsq") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linalg_lstsq(Tensor self, Tensor b, float? rcond=None, *, str? driver=None) -> (Tensor solution, Tensor residuals, Tensor rank, Tensor singular_values)") + static ::std::tuple call(const at::Tensor & self, const at::Tensor & b, c10::optional rcond, c10::optional driver); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & b, c10::optional rcond, c10::optional driver); +}; + +struct TORCH_API linalg_lstsq_out { + using schema = ::std::tuple (const at::Tensor &, const at::Tensor &, c10::optional, c10::optional, at::Tensor &, at::Tensor &, at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linalg_lstsq") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linalg_lstsq.out(Tensor self, Tensor b, float? rcond=None, *, str? driver=None, Tensor(a!) solution, Tensor(b!) residuals, Tensor(c!) rank, Tensor(d!) singular_values) -> (Tensor(a!) solution, Tensor(b!) residuals, Tensor(c!) rank, Tensor(d!) singular_values)") + static ::std::tuple call(const at::Tensor & self, const at::Tensor & b, c10::optional rcond, c10::optional driver, at::Tensor & solution, at::Tensor & residuals, at::Tensor & rank, at::Tensor & singular_values); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & b, c10::optional rcond, c10::optional driver, at::Tensor & solution, at::Tensor & residuals, at::Tensor & rank, at::Tensor & singular_values); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/09/093c08b8b6e09f425fa7baca10f6461bf168d35abda14ebb329c38f12202525b/blob b/shared/package-files/09/093c08b8b6e09f425fa7baca10f6461bf168d35abda14ebb329c38f12202525b/blob new file mode 100644 index 0000000000000000000000000000000000000000..e772304b3ffdd97a39026f018d40ed7877f39e60 --- /dev/null +++ b/shared/package-files/09/093c08b8b6e09f425fa7baca10f6461bf168d35abda14ebb329c38f12202525b/blob @@ -0,0 +1,24 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#include + +namespace tensorpipe { + +struct CudaBuffer { + void* ptr{nullptr}; + cudaStream_t stream{cudaStreamDefault}; + + Device getDevice() const; +}; + +} // namespace tensorpipe diff --git a/shared/package-files/09/093ece02a65662a114c92cc51ee6823dda612ef2bf0e9d5509b2d5d042dba61d/blob b/shared/package-files/09/093ece02a65662a114c92cc51ee6823dda612ef2bf0e9d5509b2d5d042dba61d/blob new file mode 100644 index 0000000000000000000000000000000000000000..2b9dac4e6fddc4497d3ca5d8c37727ed9a4826e0 --- /dev/null +++ b/shared/package-files/09/093ece02a65662a114c92cc51ee6823dda612ef2bf0e9d5509b2d5d042dba61d/blob @@ -0,0 +1,44 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_foreach_zero_(Tensor(a!)[] self) -> () +inline void _foreach_zero_(at::TensorList self) { + return at::_ops::_foreach_zero_::call(self); +} + +// aten::_foreach_zero.out(Tensor[] self, *, Tensor(a!)[] out) -> () +inline void _foreach_zero_out(at::TensorList out, at::TensorList self) { + return at::_ops::_foreach_zero_out::call(self, out); +} +// aten::_foreach_zero.out(Tensor[] self, *, Tensor(a!)[] out) -> () +inline void _foreach_zero_outf(at::TensorList self, at::TensorList out) { + return at::_ops::_foreach_zero_out::call(self, out); +} + +// aten::_foreach_zero(Tensor[] self) -> Tensor[] self_out +inline ::std::vector _foreach_zero(at::TensorList self) { + return at::_ops::_foreach_zero::call(self); +} + +} diff --git a/shared/package-files/09/09402c8e2722f0119a63cb53230aba00431f0dfe263bfc8ecb304006cb6b4250/blob b/shared/package-files/09/09402c8e2722f0119a63cb53230aba00431f0dfe263bfc8ecb304006cb6b4250/blob new file mode 100644 index 0000000000000000000000000000000000000000..5e46daaf075b7c602f3d2193ca79cc3c6507823b Binary files /dev/null and b/shared/package-files/09/09402c8e2722f0119a63cb53230aba00431f0dfe263bfc8ecb304006cb6b4250/blob differ diff --git a/shared/package-files/09/0940b70196c6f88b6301ea2161020e4f9ecde429edc5d87e07b055fe48d16c64/blob b/shared/package-files/09/0940b70196c6f88b6301ea2161020e4f9ecde429edc5d87e07b055fe48d16c64/blob new file mode 100644 index 0000000000000000000000000000000000000000..4cdb866d653526099d1a74b617b2369351fa9994 Binary files /dev/null and b/shared/package-files/09/0940b70196c6f88b6301ea2161020e4f9ecde429edc5d87e07b055fe48d16c64/blob differ diff --git a/shared/package-files/09/094104114df3261ea99a3fa0c2ceda87286c1c94f13b45bd30aada5de160f3d0/blob b/shared/package-files/09/094104114df3261ea99a3fa0c2ceda87286c1c94f13b45bd30aada5de160f3d0/blob new file mode 100644 index 0000000000000000000000000000000000000000..c5cac5a5caf090d85d7284103459c6f03d3d41ce --- /dev/null +++ b/shared/package-files/09/094104114df3261ea99a3fa0c2ceda87286c1c94f13b45bd30aada5de160f3d0/blob @@ -0,0 +1,195 @@ +import numpy as np +import pytest + +import pandas as pd +from pandas import ( + DataFrame, + Series, +) +import pandas._testing as tm +from pandas.tests.io.pytables.common import ensure_clean_store + +from pandas.io.pytables import read_hdf + + +def test_complex_fixed(tmp_path, setup_path): + df = DataFrame( + np.random.default_rng(2).random((4, 5)).astype(np.complex64), + index=list("abcd"), + columns=list("ABCDE"), + ) + + path = tmp_path / setup_path + df.to_hdf(path, key="df") + reread = read_hdf(path, "df") + tm.assert_frame_equal(df, reread) + + df = DataFrame( + np.random.default_rng(2).random((4, 5)).astype(np.complex128), + index=list("abcd"), + columns=list("ABCDE"), + ) + path = tmp_path / setup_path + df.to_hdf(path, key="df") + reread = read_hdf(path, "df") + tm.assert_frame_equal(df, reread) + + +def test_complex_table(tmp_path, setup_path): + df = DataFrame( + np.random.default_rng(2).random((4, 5)).astype(np.complex64), + index=list("abcd"), + columns=list("ABCDE"), + ) + + path = tmp_path / setup_path + df.to_hdf(path, key="df", format="table") + reread = read_hdf(path, key="df") + tm.assert_frame_equal(df, reread) + + df = DataFrame( + np.random.default_rng(2).random((4, 5)).astype(np.complex128), + index=list("abcd"), + columns=list("ABCDE"), + ) + + path = tmp_path / setup_path + df.to_hdf(path, key="df", format="table", mode="w") + reread = read_hdf(path, "df") + tm.assert_frame_equal(df, reread) + + +def test_complex_mixed_fixed(tmp_path, setup_path): + complex64 = np.array( + [1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j], dtype=np.complex64 + ) + complex128 = np.array( + [1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j], dtype=np.complex128 + ) + df = DataFrame( + { + "A": [1, 2, 3, 4], + "B": ["a", "b", "c", "d"], + "C": complex64, + "D": complex128, + "E": [1.0, 2.0, 3.0, 4.0], + }, + index=list("abcd"), + ) + path = tmp_path / setup_path + df.to_hdf(path, key="df") + reread = read_hdf(path, "df") + tm.assert_frame_equal(df, reread) + + +def test_complex_mixed_table(tmp_path, setup_path): + complex64 = np.array( + [1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j], dtype=np.complex64 + ) + complex128 = np.array( + [1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j], dtype=np.complex128 + ) + df = DataFrame( + { + "A": [1, 2, 3, 4], + "B": ["a", "b", "c", "d"], + "C": complex64, + "D": complex128, + "E": [1.0, 2.0, 3.0, 4.0], + }, + index=list("abcd"), + ) + + with ensure_clean_store(setup_path) as store: + store.append("df", df, data_columns=["A", "B"]) + result = store.select("df", where="A>2") + tm.assert_frame_equal(df.loc[df.A > 2], result) + + path = tmp_path / setup_path + df.to_hdf(path, key="df", format="table") + reread = read_hdf(path, "df") + tm.assert_frame_equal(df, reread) + + +def test_complex_across_dimensions_fixed(tmp_path, setup_path): + complex128 = np.array([1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j]) + s = Series(complex128, index=list("abcd")) + df = DataFrame({"A": s, "B": s}) + + objs = [s, df] + comps = [tm.assert_series_equal, tm.assert_frame_equal] + for obj, comp in zip(objs, comps): + path = tmp_path / setup_path + obj.to_hdf(path, key="obj", format="fixed") + reread = read_hdf(path, "obj") + comp(obj, reread) + + +def test_complex_across_dimensions(tmp_path, setup_path): + complex128 = np.array([1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j]) + s = Series(complex128, index=list("abcd")) + df = DataFrame({"A": s, "B": s}) + + path = tmp_path / setup_path + df.to_hdf(path, key="obj", format="table") + reread = read_hdf(path, "obj") + tm.assert_frame_equal(df, reread) + + +def test_complex_indexing_error(setup_path): + complex128 = np.array( + [1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j], dtype=np.complex128 + ) + df = DataFrame( + {"A": [1, 2, 3, 4], "B": ["a", "b", "c", "d"], "C": complex128}, + index=list("abcd"), + ) + + msg = ( + "Columns containing complex values can be stored " + "but cannot be indexed when using table format. " + "Either use fixed format, set index=False, " + "or do not include the columns containing complex " + "values to data_columns when initializing the table." + ) + + with ensure_clean_store(setup_path) as store: + with pytest.raises(TypeError, match=msg): + store.append("df", df, data_columns=["C"]) + + +def test_complex_series_error(tmp_path, setup_path): + complex128 = np.array([1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j]) + s = Series(complex128, index=list("abcd")) + + msg = ( + "Columns containing complex values can be stored " + "but cannot be indexed when using table format. " + "Either use fixed format, set index=False, " + "or do not include the columns containing complex " + "values to data_columns when initializing the table." + ) + + path = tmp_path / setup_path + with pytest.raises(TypeError, match=msg): + s.to_hdf(path, key="obj", format="t") + + path = tmp_path / setup_path + s.to_hdf(path, key="obj", format="t", index=False) + reread = read_hdf(path, "obj") + tm.assert_series_equal(s, reread) + + +def test_complex_append(setup_path): + df = DataFrame( + { + "a": np.random.default_rng(2).standard_normal(100).astype(np.complex128), + "b": np.random.default_rng(2).standard_normal(100), + } + ) + + with ensure_clean_store(setup_path) as store: + store.append("df", df, data_columns=["b"]) + store.append("df", df) + result = store.select("df") + tm.assert_frame_equal(pd.concat([df, df], axis=0), result) diff --git a/shared/package-files/09/09418309b09cb25002cb7360abece88a0f499cee321d3c3720f70acb4167469c/blob b/shared/package-files/09/09418309b09cb25002cb7360abece88a0f499cee321d3c3720f70acb4167469c/blob new file mode 100644 index 0000000000000000000000000000000000000000..f43260ccc636ac461ba0c06dbfcf3fe3a8d5338d --- /dev/null +++ b/shared/package-files/09/09418309b09cb25002cb7360abece88a0f499cee321d3c3720f70acb4167469c/blob @@ -0,0 +1,22 @@ +from sympy.tensor.array import (ImmutableDenseNDimArray, + ImmutableSparseNDimArray, MutableDenseNDimArray, MutableSparseNDimArray) +from sympy.abc import x, y, z + + +def test_NDim_array_conv(): + MD = MutableDenseNDimArray([x, y, z]) + MS = MutableSparseNDimArray([x, y, z]) + ID = ImmutableDenseNDimArray([x, y, z]) + IS = ImmutableSparseNDimArray([x, y, z]) + + assert MD.as_immutable() == ID + assert MD.as_mutable() == MD + + assert MS.as_immutable() == IS + assert MS.as_mutable() == MS + + assert ID.as_immutable() == ID + assert ID.as_mutable() == MD + + assert IS.as_immutable() == IS + assert IS.as_mutable() == MS diff --git a/shared/package-files/09/0941ad930214f4205ad12971d7799b68cebbfde734a7eba765dbbc6786183377/blob b/shared/package-files/09/0941ad930214f4205ad12971d7799b68cebbfde734a7eba765dbbc6786183377/blob new file mode 100644 index 0000000000000000000000000000000000000000..b3b086cc31dce2de1e300a1d018b0bf5661b69f3 Binary files /dev/null and b/shared/package-files/09/0941ad930214f4205ad12971d7799b68cebbfde734a7eba765dbbc6786183377/blob differ diff --git a/shared/package-files/09/0941b2eb518c2c83dcc1251a0ac62afb0142fdcff081611a738c41bb3a580dea/blob b/shared/package-files/09/0941b2eb518c2c83dcc1251a0ac62afb0142fdcff081611a738c41bb3a580dea/blob new file mode 100644 index 0000000000000000000000000000000000000000..4a1cd78823f294e3bf791774419722daafd15b79 --- /dev/null +++ b/shared/package-files/09/0941b2eb518c2c83dcc1251a0ac62afb0142fdcff081611a738c41bb3a580dea/blob @@ -0,0 +1,70 @@ +survival,censors,age +15.000000,1.000000,54.300000 +3.000000,1.000000,40.400000 +624.000000,1.000000,51.000000 +46.000000,1.000000,42.500000 +127.000000,1.000000,48.000000 +64.000000,1.000000,54.600000 +1350.000000,1.000000,54.100000 +280.000000,1.000000,49.500000 +23.000000,1.000000,56.900000 +10.000000,1.000000,55.300000 +1024.000000,1.000000,43.400000 +39.000000,1.000000,42.800000 +730.000000,1.000000,58.400000 +136.000000,1.000000,52.000000 +1775.000000,0.000000,33.300000 +1.000000,1.000000,54.200000 +836.000000,1.000000,45.000000 +60.000000,1.000000,64.500000 +1536.000000,0.000000,49.000000 +1549.000000,0.000000,40.600000 +54.000000,1.000000,49.000000 +47.000000,1.000000,61.500000 +1.000000,1.000000,41.500000 +51.000000,1.000000,50.500000 +1367.000000,0.000000,48.600000 +1264.000000,0.000000,45.500000 +44.000000,1.000000,36.200000 +994.000000,1.000000,48.600000 +51.000000,1.000000,47.200000 +1106.000000,0.000000,36.800000 +897.000000,1.000000,46.100000 +253.000000,1.000000,48.800000 +147.000000,1.000000,47.500000 +51.000000,1.000000,52.500000 +875.000000,0.000000,38.900000 +322.000000,1.000000,48.100000 +838.000000,0.000000,41.600000 +65.000000,1.000000,49.100000 +815.000000,0.000000,32.700000 +551.000000,1.000000,48.900000 +66.000000,1.000000,51.300000 +228.000000,1.000000,19.700000 +65.000000,1.000000,45.200000 +660.000000,0.000000,48.000000 +25.000000,1.000000,53.000000 +589.000000,0.000000,47.500000 +592.000000,0.000000,26.700000 +63.000000,1.000000,56.400000 +12.000000,1.000000,29.200000 +499.000000,0.000000,52.200000 +305.000000,0.000000,49.300000 +29.000000,1.000000,54.000000 +456.000000,0.000000,46.500000 +439.000000,0.000000,52.900000 +48.000000,1.000000,53.400000 +297.000000,1.000000,42.800000 +389.000000,0.000000,48.900000 +50.000000,1.000000,46.400000 +339.000000,0.000000,54.400000 +68.000000,1.000000,51.400000 +26.000000,1.000000,52.500000 +30.000000,0.000000,45.800000 +237.000000,0.000000,47.800000 +161.000000,1.000000,43.800000 +14.000000,1.000000,40.300000 +167.000000,0.000000,26.700000 +110.000000,0.000000,23.700000 +13.000000,0.000000,28.900000 +1.000000,0.000000,35.200000 diff --git a/shared/package-files/09/094253f85a16114892089ec19df04567fffbe2c848b8c6c7481850a706d58271/blob b/shared/package-files/09/094253f85a16114892089ec19df04567fffbe2c848b8c6c7481850a706d58271/blob new file mode 100644 index 0000000000000000000000000000000000000000..91dee2641f20cbc8fa3d131188c9173037081db3 --- /dev/null +++ b/shared/package-files/09/094253f85a16114892089ec19df04567fffbe2c848b8c6c7481850a706d58271/blob @@ -0,0 +1,96 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +from functools import update_wrapper, wraps +from types import MethodType + + +class _AvailableIfDescriptor: + """Implements a conditional property using the descriptor protocol. + + Using this class to create a decorator will raise an ``AttributeError`` + if check(self) returns a falsey value. Note that if check raises an error + this will also result in hasattr returning false. + + See https://docs.python.org/3/howto/descriptor.html for an explanation of + descriptors. + """ + + def __init__(self, fn, check, attribute_name): + self.fn = fn + self.check = check + self.attribute_name = attribute_name + + # update the docstring of the descriptor + update_wrapper(self, fn) + + def _check(self, obj, owner): + attr_err_msg = ( + f"This {owner.__name__!r} has no attribute {self.attribute_name!r}" + ) + try: + check_result = self.check(obj) + except Exception as e: + raise AttributeError(attr_err_msg) from e + + if not check_result: + raise AttributeError(attr_err_msg) + + def __get__(self, obj, owner=None): + if obj is not None: + # delegate only on instances, not the classes. + # this is to allow access to the docstrings. + self._check(obj, owner=owner) + out = MethodType(self.fn, obj) + + else: + # This makes it possible to use the decorated method as an unbound method, + # for instance when monkeypatching. + @wraps(self.fn) + def out(*args, **kwargs): + self._check(args[0], owner=owner) + return self.fn(*args, **kwargs) + + return out + + +def available_if(check): + """An attribute that is available only if check returns a truthy value. + + Parameters + ---------- + check : callable + When passed the object with the decorated method, this should return + a truthy value if the attribute is available, and either return False + or raise an AttributeError if not available. + + Returns + ------- + callable + Callable makes the decorated method available if `check` returns + a truthy value, otherwise the decorated method is unavailable. + + Examples + -------- + >>> from sklearn.utils.metaestimators import available_if + >>> class HelloIfEven: + ... def __init__(self, x): + ... self.x = x + ... + ... def _x_is_even(self): + ... return self.x % 2 == 0 + ... + ... @available_if(_x_is_even) + ... def say_hello(self): + ... print("Hello") + ... + >>> obj = HelloIfEven(1) + >>> hasattr(obj, "say_hello") + False + >>> obj.x = 2 + >>> hasattr(obj, "say_hello") + True + >>> obj.say_hello() + Hello + """ + return lambda fn: _AvailableIfDescriptor(fn, check, attribute_name=fn.__name__) diff --git a/shared/package-files/09/0949d3c7e98a2fe6229db51faefc3c58858bc2eaaee0fb52559f4cda6c524af6/blob b/shared/package-files/09/0949d3c7e98a2fe6229db51faefc3c58858bc2eaaee0fb52559f4cda6c524af6/blob new file mode 100644 index 0000000000000000000000000000000000000000..bc6c2bc072566ebc67a93da7e109650fec648160 --- /dev/null +++ b/shared/package-files/09/0949d3c7e98a2fe6229db51faefc3c58858bc2eaaee0fb52559f4cda6c524af6/blob @@ -0,0 +1,9 @@ +import sys +from typing import Dict, List + +if sys.platform != "win32": + def cat(map: str, domain: str = ...) -> Dict[str, str]: ... + def get_default_domain() -> str: ... + def maps(domain: str = ...) -> List[str]: ... + def match(key: str, map: str, domain: str = ...) -> str: ... + class error(Exception): ... diff --git a/shared/package-files/09/0949f15ecc3fdff6bcc666a3f823bb673b19619179a8f9bc3a0544a8e943a2a6/blob b/shared/package-files/09/0949f15ecc3fdff6bcc666a3f823bb673b19619179a8f9bc3a0544a8e943a2a6/blob new file mode 100644 index 0000000000000000000000000000000000000000..c38c77a7466ea23882bf22a7ab0dc92b9f295cde --- /dev/null +++ b/shared/package-files/09/0949f15ecc3fdff6bcc666a3f823bb673b19619179a8f9bc3a0544a8e943a2a6/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_sub_Tensor : public TensorIteratorBase { + + + void meta(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/09/094a35ae4fc294c731108a1b6ff5f18515998b5219fbe1641dacf2918c3c6ba4/blob b/shared/package-files/09/094a35ae4fc294c731108a1b6ff5f18515998b5219fbe1641dacf2918c3c6ba4/blob new file mode 100644 index 0000000000000000000000000000000000000000..b6a73e7b7814175c9e19977fc2ebff2367fc1dca --- /dev/null +++ b/shared/package-files/09/094a35ae4fc294c731108a1b6ff5f18515998b5219fbe1641dacf2918c3c6ba4/blob @@ -0,0 +1,667 @@ +""" +.. _statsrefmanual: + +========================================== +Statistical functions (:mod:`scipy.stats`) +========================================== + +.. currentmodule:: scipy.stats + +This module contains a large number of probability distributions, +summary and frequency statistics, correlation functions and statistical +tests, masked statistics, kernel density estimation, quasi-Monte Carlo +functionality, and more. + +Statistics is a very large area, and there are topics that are out of scope +for SciPy and are covered by other packages. Some of the most important ones +are: + +- `statsmodels `__: + regression, linear models, time series analysis, extensions to topics + also covered by ``scipy.stats``. +- `Pandas `__: tabular data, time series + functionality, interfaces to other statistical languages. +- `PyMC `__: Bayesian statistical + modeling, probabilistic machine learning. +- `scikit-learn `__: classification, regression, + model selection. +- `Seaborn `__: statistical data visualization. +- `rpy2 `__: Python to R bridge. + + +Probability distributions +========================= + +Each univariate distribution is an instance of a subclass of `rv_continuous` +(`rv_discrete` for discrete distributions): + +.. autosummary:: + :toctree: generated/ + + rv_continuous + rv_discrete + rv_histogram + +Continuous distributions +------------------------ + +.. autosummary:: + :toctree: generated/ + + alpha -- Alpha + anglit -- Anglit + arcsine -- Arcsine + argus -- Argus + beta -- Beta + betaprime -- Beta Prime + bradford -- Bradford + burr -- Burr (Type III) + burr12 -- Burr (Type XII) + cauchy -- Cauchy + chi -- Chi + chi2 -- Chi-squared + cosine -- Cosine + crystalball -- Crystalball + dgamma -- Double Gamma + dpareto_lognorm -- Double Pareto Lognormal + dweibull -- Double Weibull + erlang -- Erlang + expon -- Exponential + exponnorm -- Exponentially Modified Normal + exponweib -- Exponentiated Weibull + exponpow -- Exponential Power + f -- F (Snecdor F) + fatiguelife -- Fatigue Life (Birnbaum-Saunders) + fisk -- Fisk + foldcauchy -- Folded Cauchy + foldnorm -- Folded Normal + genlogistic -- Generalized Logistic + gennorm -- Generalized normal + genpareto -- Generalized Pareto + genexpon -- Generalized Exponential + genextreme -- Generalized Extreme Value + gausshyper -- Gauss Hypergeometric + gamma -- Gamma + gengamma -- Generalized gamma + genhalflogistic -- Generalized Half Logistic + genhyperbolic -- Generalized Hyperbolic + geninvgauss -- Generalized Inverse Gaussian + gibrat -- Gibrat + gompertz -- Gompertz (Truncated Gumbel) + gumbel_r -- Right Sided Gumbel, Log-Weibull, Fisher-Tippett, Extreme Value Type I + gumbel_l -- Left Sided Gumbel, etc. + halfcauchy -- Half Cauchy + halflogistic -- Half Logistic + halfnorm -- Half Normal + halfgennorm -- Generalized Half Normal + hypsecant -- Hyperbolic Secant + invgamma -- Inverse Gamma + invgauss -- Inverse Gaussian + invweibull -- Inverse Weibull + irwinhall -- Irwin-Hall + jf_skew_t -- Jones and Faddy Skew-T + johnsonsb -- Johnson SB + johnsonsu -- Johnson SU + kappa4 -- Kappa 4 parameter + kappa3 -- Kappa 3 parameter + ksone -- Distribution of Kolmogorov-Smirnov one-sided test statistic + kstwo -- Distribution of Kolmogorov-Smirnov two-sided test statistic + kstwobign -- Limiting Distribution of scaled Kolmogorov-Smirnov two-sided test statistic. + landau -- Landau + laplace -- Laplace + laplace_asymmetric -- Asymmetric Laplace + levy -- Levy + levy_l + levy_stable + logistic -- Logistic + loggamma -- Log-Gamma + loglaplace -- Log-Laplace (Log Double Exponential) + lognorm -- Log-Normal + loguniform -- Log-Uniform + lomax -- Lomax (Pareto of the second kind) + maxwell -- Maxwell + mielke -- Mielke's Beta-Kappa + moyal -- Moyal + nakagami -- Nakagami + ncx2 -- Non-central chi-squared + ncf -- Non-central F + nct -- Non-central Student's T + norm -- Normal (Gaussian) + norminvgauss -- Normal Inverse Gaussian + pareto -- Pareto + pearson3 -- Pearson type III + powerlaw -- Power-function + powerlognorm -- Power log normal + powernorm -- Power normal + rdist -- R-distribution + rayleigh -- Rayleigh + rel_breitwigner -- Relativistic Breit-Wigner + rice -- Rice + recipinvgauss -- Reciprocal Inverse Gaussian + semicircular -- Semicircular + skewcauchy -- Skew Cauchy + skewnorm -- Skew normal + studentized_range -- Studentized Range + t -- Student's T + trapezoid -- Trapezoidal + triang -- Triangular + truncexpon -- Truncated Exponential + truncnorm -- Truncated Normal + truncpareto -- Truncated Pareto + truncweibull_min -- Truncated minimum Weibull distribution + tukeylambda -- Tukey-Lambda + uniform -- Uniform + vonmises -- Von-Mises (Circular) + vonmises_line -- Von-Mises (Line) + wald -- Wald + weibull_min -- Minimum Weibull (see Frechet) + weibull_max -- Maximum Weibull (see Frechet) + wrapcauchy -- Wrapped Cauchy + +The ``fit`` method of the univariate continuous distributions uses +maximum likelihood estimation to fit the distribution to a data set. +The ``fit`` method can accept regular data or *censored data*. +Censored data is represented with instances of the `CensoredData` +class. + +.. autosummary:: + :toctree: generated/ + + CensoredData + + +Multivariate distributions +-------------------------- + +.. autosummary:: + :toctree: generated/ + + multivariate_normal -- Multivariate normal distribution + matrix_normal -- Matrix normal distribution + dirichlet -- Dirichlet + dirichlet_multinomial -- Dirichlet multinomial distribution + wishart -- Wishart + invwishart -- Inverse Wishart + multinomial -- Multinomial distribution + special_ortho_group -- SO(N) group + ortho_group -- O(N) group + unitary_group -- U(N) group + random_correlation -- random correlation matrices + multivariate_t -- Multivariate t-distribution + multivariate_hypergeom -- Multivariate hypergeometric distribution + normal_inverse_gamma -- Normal-inverse-gamma distribution + random_table -- Distribution of random tables with given marginals + uniform_direction -- Uniform distribution on S(N-1) + vonmises_fisher -- Von Mises-Fisher distribution + +`scipy.stats.multivariate_normal` methods accept instances +of the following class to represent the covariance. + +.. autosummary:: + :toctree: generated/ + + Covariance -- Representation of a covariance matrix + + +Discrete distributions +---------------------- + +.. autosummary:: + :toctree: generated/ + + bernoulli -- Bernoulli + betabinom -- Beta-Binomial + betanbinom -- Beta-Negative Binomial + binom -- Binomial + boltzmann -- Boltzmann (Truncated Discrete Exponential) + dlaplace -- Discrete Laplacian + geom -- Geometric + hypergeom -- Hypergeometric + logser -- Logarithmic (Log-Series, Series) + nbinom -- Negative Binomial + nchypergeom_fisher -- Fisher's Noncentral Hypergeometric + nchypergeom_wallenius -- Wallenius's Noncentral Hypergeometric + nhypergeom -- Negative Hypergeometric + planck -- Planck (Discrete Exponential) + poisson -- Poisson + poisson_binom -- Poisson Binomial + randint -- Discrete Uniform + skellam -- Skellam + yulesimon -- Yule-Simon + zipf -- Zipf (Zeta) + zipfian -- Zipfian + + +An overview of statistical functions is given below. Many of these functions +have a similar version in `scipy.stats.mstats` which work for masked arrays. + +Summary statistics +================== + +.. autosummary:: + :toctree: generated/ + + describe -- Descriptive statistics + gmean -- Geometric mean + hmean -- Harmonic mean + pmean -- Power mean + kurtosis -- Fisher or Pearson kurtosis + mode -- Modal value + moment -- Central moment + lmoment + expectile -- Expectile + skew -- Skewness + kstat -- + kstatvar -- + tmean -- Truncated arithmetic mean + tvar -- Truncated variance + tmin -- + tmax -- + tstd -- + tsem -- + variation -- Coefficient of variation + find_repeats + rankdata + tiecorrect + trim_mean + gstd -- Geometric Standard Deviation + iqr + sem + bayes_mvs + mvsdist + entropy + differential_entropy + median_abs_deviation + +Frequency statistics +==================== + +.. autosummary:: + :toctree: generated/ + + cumfreq + percentileofscore + scoreatpercentile + relfreq + +.. autosummary:: + :toctree: generated/ + + binned_statistic -- Compute a binned statistic for a set of data. + binned_statistic_2d -- Compute a 2-D binned statistic for a set of data. + binned_statistic_dd -- Compute a d-D binned statistic for a set of data. + +.. _hypotests: + +Hypothesis Tests and related functions +====================================== +SciPy has many functions for performing hypothesis tests that return a +test statistic and a p-value, and several of them return confidence intervals +and/or other related information. + +The headings below are based on common uses of the functions within, but due to +the wide variety of statistical procedures, any attempt at coarse-grained +categorization will be imperfect. Also, note that tests within the same heading +are not interchangeable in general (e.g. many have different distributional +assumptions). + +One Sample Tests / Paired Sample Tests +-------------------------------------- +One sample tests are typically used to assess whether a single sample was +drawn from a specified distribution or a distribution with specified properties +(e.g. zero mean). + +.. autosummary:: + :toctree: generated/ + + ttest_1samp + binomtest + quantile_test + skewtest + kurtosistest + normaltest + jarque_bera + shapiro + anderson + cramervonmises + ks_1samp + goodness_of_fit + chisquare + power_divergence + +Paired sample tests are often used to assess whether two samples were drawn +from the same distribution; they differ from the independent sample tests below +in that each observation in one sample is treated as paired with a +closely-related observation in the other sample (e.g. when environmental +factors are controlled between observations within a pair but not among pairs). +They can also be interpreted or used as one-sample tests (e.g. tests on the +mean or median of *differences* between paired observations). + +.. autosummary:: + :toctree: generated/ + + ttest_rel + wilcoxon + +Association/Correlation Tests +----------------------------- + +These tests are often used to assess whether there is a relationship (e.g. +linear) between paired observations in multiple samples or among the +coordinates of multivariate observations. + +.. autosummary:: + :toctree: generated/ + + linregress + pearsonr + spearmanr + pointbiserialr + kendalltau + chatterjeexi + weightedtau + somersd + siegelslopes + theilslopes + page_trend_test + multiscale_graphcorr + +These association tests and are to work with samples in the form of contingency +tables. Supporting functions are available in `scipy.stats.contingency`. + +.. autosummary:: + :toctree: generated/ + + chi2_contingency + fisher_exact + barnard_exact + boschloo_exact + +Independent Sample Tests +------------------------ +Independent sample tests are typically used to assess whether multiple samples +were independently drawn from the same distribution or different distributions +with a shared property (e.g. equal means). + +Some tests are specifically for comparing two samples. + +.. autosummary:: + :toctree: generated/ + + ttest_ind_from_stats + poisson_means_test + ttest_ind + mannwhitneyu + bws_test + ranksums + brunnermunzel + mood + ansari + cramervonmises_2samp + epps_singleton_2samp + ks_2samp + kstest + +Others are generalized to multiple samples. + +.. autosummary:: + :toctree: generated/ + + f_oneway + tukey_hsd + dunnett + kruskal + alexandergovern + fligner + levene + bartlett + median_test + friedmanchisquare + anderson_ksamp + +Resampling and Monte Carlo Methods +---------------------------------- +The following functions can reproduce the p-value and confidence interval +results of most of the functions above, and often produce accurate results in a +wider variety of conditions. They can also be used to perform hypothesis tests +and generate confidence intervals for custom statistics. This flexibility comes +at the cost of greater computational requirements and stochastic results. + +.. autosummary:: + :toctree: generated/ + + monte_carlo_test + permutation_test + bootstrap + power + +Instances of the following object can be passed into some hypothesis test +functions to perform a resampling or Monte Carlo version of the hypothesis +test. + +.. autosummary:: + :toctree: generated/ + + MonteCarloMethod + PermutationMethod + BootstrapMethod + +Multiple Hypothesis Testing and Meta-Analysis +--------------------------------------------- +These functions are for assessing the results of individual tests as a whole. +Functions for performing specific multiple hypothesis tests (e.g. post hoc +tests) are listed above. + +.. autosummary:: + :toctree: generated/ + + combine_pvalues + false_discovery_control + + +The following functions are related to the tests above but do not belong in the +above categories. + +Random Variables +================ + +.. autosummary:: + :toctree: generated/ + + make_distribution + Normal + Uniform + Mixture + order_statistic + truncate + abs + exp + log + +Quasi-Monte Carlo +================= + +.. toctree:: + :maxdepth: 4 + + stats.qmc + +Contingency Tables +================== + +.. toctree:: + :maxdepth: 4 + + stats.contingency + +Masked statistics functions +=========================== + +.. toctree:: + + stats.mstats + + +Other statistical functionality +=============================== + +Transformations +--------------- + +.. autosummary:: + :toctree: generated/ + + boxcox + boxcox_normmax + boxcox_llf + yeojohnson + yeojohnson_normmax + yeojohnson_llf + obrientransform + sigmaclip + trimboth + trim1 + zmap + zscore + gzscore + +Statistical distances +--------------------- + +.. autosummary:: + :toctree: generated/ + + wasserstein_distance + wasserstein_distance_nd + energy_distance + +Sampling +-------- + +.. toctree:: + :maxdepth: 4 + + stats.sampling + +Fitting / Survival Analysis +--------------------------- + +.. autosummary:: + :toctree: generated/ + + fit + ecdf + logrank + +Directional statistical functions +--------------------------------- + +.. autosummary:: + :toctree: generated/ + + directional_stats + circmean + circvar + circstd + +Sensitivity Analysis +-------------------- + +.. autosummary:: + :toctree: generated/ + + sobol_indices + +Plot-tests +---------- + +.. autosummary:: + :toctree: generated/ + + ppcc_max + ppcc_plot + probplot + boxcox_normplot + yeojohnson_normplot + +Univariate and multivariate kernel density estimation +----------------------------------------------------- + +.. autosummary:: + :toctree: generated/ + + gaussian_kde + +Warnings / Errors used in :mod:`scipy.stats` +-------------------------------------------- + +.. autosummary:: + :toctree: generated/ + + DegenerateDataWarning + ConstantInputWarning + NearConstantInputWarning + FitError + +Result classes used in :mod:`scipy.stats` +----------------------------------------- + +.. warning:: + + These classes are private, but they are included here because instances + of them are returned by other statistical functions. User import and + instantiation is not supported. + +.. toctree:: + :maxdepth: 2 + + stats._result_classes + +""" # noqa: E501 + +from ._warnings_errors import (ConstantInputWarning, NearConstantInputWarning, + DegenerateDataWarning, FitError) +from ._stats_py import * +from ._variation import variation +from .distributions import * +from ._morestats import * +from ._multicomp import * +from ._binomtest import binomtest +from ._binned_statistic import * +from ._kde import gaussian_kde +from . import mstats +from . import qmc +from ._multivariate import * +from . import contingency +from .contingency import chi2_contingency +from ._censored_data import CensoredData +from ._resampling import (bootstrap, monte_carlo_test, permutation_test, power, + MonteCarloMethod, PermutationMethod, BootstrapMethod) +from ._entropy import * +from ._hypotests import * +from ._page_trend_test import page_trend_test +from ._mannwhitneyu import mannwhitneyu +from ._bws_test import bws_test +from ._fit import fit, goodness_of_fit +from ._covariance import Covariance +from ._sensitivity_analysis import * +from ._survival import * +from ._distribution_infrastructure import ( + make_distribution, Mixture, order_statistic, truncate, exp, log, abs +) +from ._new_distributions import Normal, Uniform +from ._mgc import multiscale_graphcorr +from ._correlation import chatterjeexi + + +# Deprecated namespaces, to be removed in v2.0.0 +from . import ( + biasedurn, kde, morestats, mstats_basic, mstats_extras, mvn, stats +) + + +__all__ = [s for s in dir() if not s.startswith("_")] # Remove dunders. + +from scipy._lib._testutils import PytestTester +test = PytestTester(__name__) +del PytestTester diff --git a/shared/package-files/09/094aae3095028060a3795524dd04b1f6f55c663987289b20548dd58eab62d599/blob b/shared/package-files/09/094aae3095028060a3795524dd04b1f6f55c663987289b20548dd58eab62d599/blob new file mode 100644 index 0000000000000000000000000000000000000000..7b5f7b2d182a86676ef63a639789ad5293c52f11 --- /dev/null +++ b/shared/package-files/09/094aae3095028060a3795524dd04b1f6f55c663987289b20548dd58eab62d599/blob @@ -0,0 +1,75 @@ +from typing import ( + Any, + Callable, + Dict, + Iterable, + List, + Mapping, + MutableMapping, + MutableSet, + Tuple, + TypeVar, + Union, + overload, + Iterator, + Optional, +) + +from typing_extensions import Literal + +_K = TypeVar("_K") +_V = TypeVar("_V") + +class OrderedSet(MutableSet[_K]): + dict: Dict[_K, None] = ... + def __init__(self, iterable: Optional[Iterable[_K]] = ...) -> None: ... + def __contains__(self, item: object) -> bool: ... + def __iter__(self) -> Iterator[_K]: ... + def __len__(self) -> int: ... + def add(self, x: _K) -> None: ... + def discard(self, item: _K) -> None: ... + +class MultiValueDictKeyError(KeyError): ... + +_D = TypeVar("_D", bound="MultiValueDict") + +class MultiValueDict(MutableMapping[_K, _V]): + @overload + def __init__(self, key_to_list_mapping: Mapping[_K, Optional[List[_V]]] = ...) -> None: ... + @overload + def __init__(self, key_to_list_mapping: Iterable[Tuple[_K, List[_V]]] = ...) -> None: ... + def getlist(self, key: _K, default: Any = ...) -> List[_V]: ... + def setlist(self, key: _K, list_: List[_V]) -> None: ... + def setlistdefault(self, key: _K, default_list: Optional[List[_V]] = ...) -> List[_V]: ... + def appendlist(self, key: _K, value: _V) -> None: ... + def lists(self) -> Iterable[Tuple[_K, List[_V]]]: ... + def dict(self) -> Dict[_K, Union[_V, List[_V]]]: ... + def copy(self: _D) -> _D: ... + # These overrides are needed to convince mypy that this isn't an abstract class + def __delitem__(self, item: _K) -> None: ... + def __getitem__(self, item: _K) -> Union[_V, Literal[[]]]: ... # type: ignore + def __setitem__(self, k: _K, v: Union[_V, List[_V]]) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_K]: ... + +class ImmutableList(Tuple[_V, ...]): + warning: str = ... + def __init__(self, *args: Any, warning: str = ..., **kwargs: Any) -> None: ... + def complain(self, *wargs: Any, **kwargs: Any) -> None: ... + +class DictWrapper(Dict[str, _V]): + func: Callable[[_V], _V] = ... + prefix: str = ... + @overload + def __init__(self, data: Mapping[str, _V], func: Callable[[_V], _V], prefix: str) -> None: ... + @overload + def __init__(self, data: Iterable[Tuple[str, _V]], func: Callable[[_V], _V], prefix: str) -> None: ... + +_T = TypeVar("_T", bound="CaseInsensitiveMapping") + +class CaseInsensitiveMapping(Mapping): + def __init__(self, data: Any) -> None: ... + def __getitem__(self, key: str) -> Any: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def copy(self: _T) -> _T: ... diff --git a/shared/package-files/09/094b38e25f20ffa9188bec8b752b8f21f13a6d716b20a2ac061f8a531dfa6249/blob b/shared/package-files/09/094b38e25f20ffa9188bec8b752b8f21f13a6d716b20a2ac061f8a531dfa6249/blob new file mode 100644 index 0000000000000000000000000000000000000000..f74c42f44fda584982bc9aa1e4b5d3f8bd4db3b7 --- /dev/null +++ b/shared/package-files/09/094b38e25f20ffa9188bec8b752b8f21f13a6d716b20a2ac061f8a531dfa6249/blob @@ -0,0 +1,49 @@ +#pragma once + +#include +#include +#include +#include + +namespace at { + +struct TORCH_API CPUGeneratorImpl : public c10::GeneratorImpl { + // Constructors + CPUGeneratorImpl(uint64_t seed_in = default_rng_seed_val); + ~CPUGeneratorImpl() override = default; + + // CPUGeneratorImpl methods + std::shared_ptr clone() const; + void set_current_seed(uint64_t seed) override; + void set_offset(uint64_t offset) override; + uint64_t get_offset() const override; + uint64_t current_seed() const override; + uint64_t seed() override; + void set_state(const c10::TensorImpl& new_state) override; + c10::intrusive_ptr get_state() const override; + static c10::DeviceType device_type(); + uint32_t random(); + uint64_t random64(); + c10::optional next_float_normal_sample(); + c10::optional next_double_normal_sample(); + void set_next_float_normal_sample(c10::optional randn); + void set_next_double_normal_sample(c10::optional randn); + at::mt19937 engine(); + void set_engine(at::mt19937 engine); + + private: + CPUGeneratorImpl* clone_impl() const override; + at::mt19937 engine_; + c10::optional next_float_normal_sample_; + c10::optional next_double_normal_sample_; +}; + +namespace detail { + +TORCH_API const Generator& getDefaultCPUGenerator(); +TORCH_API Generator +createCPUGenerator(uint64_t seed_val = default_rng_seed_val); + +} // namespace detail + +} // namespace at diff --git a/shared/package-files/09/094e096eec7941afc484f3edf508e35f830a4f144c7e2486480b263fab4e3ba8/blob b/shared/package-files/09/094e096eec7941afc484f3edf508e35f830a4f144c7e2486480b263fab4e3ba8/blob new file mode 100644 index 0000000000000000000000000000000000000000..b4516bf8904e1553e9cce2b806919e35ee9343ba --- /dev/null +++ b/shared/package-files/09/094e096eec7941afc484f3edf508e35f830a4f144c7e2486480b263fab4e3ba8/blob @@ -0,0 +1,26 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_adaptive_max_pool2d_backward_out_cpu : public at::meta::structured_adaptive_max_pool2d_backward { +void impl(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices, const at::Tensor & grad_input); +}; +struct TORCH_API structured_adaptive_max_pool2d_backward_out_cuda : public at::meta::structured_adaptive_max_pool2d_backward { +void impl(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices, const at::Tensor & grad_input); +}; +} // namespace native +} // namespace at diff --git a/shared/package-files/09/095280f515d28efe19ca0a831cc885f87da1521dd01d0be9d466580b73008641/blob b/shared/package-files/09/095280f515d28efe19ca0a831cc885f87da1521dd01d0be9d466580b73008641/blob new file mode 100644 index 0000000000000000000000000000000000000000..4cedc0bee04e6470ce02d27b9390068e0ec0fcc1 --- /dev/null +++ b/shared/package-files/09/095280f515d28efe19ca0a831cc885f87da1521dd01d0be9d466580b73008641/blob @@ -0,0 +1,449 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DOUBLE_H_ +#define DOUBLE_CONVERSION_DOUBLE_H_ + +#include "diy-fp.h" + +namespace arrow_vendored { +namespace double_conversion { + +// We assume that doubles and uint64_t have the same endianness. +static uint64_t double_to_uint64(double d) { return BitCast(d); } +static double uint64_to_double(uint64_t d64) { return BitCast(d64); } +static uint32_t float_to_uint32(float f) { return BitCast(f); } +static float uint32_to_float(uint32_t d32) { return BitCast(d32); } + +// Helper functions for doubles. +class Double { + public: + static const uint64_t kSignMask = DOUBLE_CONVERSION_UINT64_2PART_C(0x80000000, 00000000); + static const uint64_t kExponentMask = DOUBLE_CONVERSION_UINT64_2PART_C(0x7FF00000, 00000000); + static const uint64_t kSignificandMask = DOUBLE_CONVERSION_UINT64_2PART_C(0x000FFFFF, FFFFFFFF); + static const uint64_t kHiddenBit = DOUBLE_CONVERSION_UINT64_2PART_C(0x00100000, 00000000); + static const uint64_t kQuietNanBit = DOUBLE_CONVERSION_UINT64_2PART_C(0x00080000, 00000000); + static const int kPhysicalSignificandSize = 52; // Excludes the hidden bit. + static const int kSignificandSize = 53; + static const int kExponentBias = 0x3FF + kPhysicalSignificandSize; + static const int kMaxExponent = 0x7FF - kExponentBias; + + Double() : d64_(0) {} + explicit Double(double d) : d64_(double_to_uint64(d)) {} + explicit Double(uint64_t d64) : d64_(d64) {} + explicit Double(DiyFp diy_fp) + : d64_(DiyFpToUint64(diy_fp)) {} + + // The value encoded by this Double must be greater or equal to +0.0. + // It must not be special (infinity, or NaN). + DiyFp AsDiyFp() const { + DOUBLE_CONVERSION_ASSERT(Sign() > 0); + DOUBLE_CONVERSION_ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); + } + + // The value encoded by this Double must be strictly greater than 0. + DiyFp AsNormalizedDiyFp() const { + DOUBLE_CONVERSION_ASSERT(value() > 0.0); + uint64_t f = Significand(); + int e = Exponent(); + + // The current double could be a denormal. + while ((f & kHiddenBit) == 0) { + f <<= 1; + e--; + } + // Do the final shifts in one go. + f <<= DiyFp::kSignificandSize - kSignificandSize; + e -= DiyFp::kSignificandSize - kSignificandSize; + return DiyFp(f, e); + } + + // Returns the double's bit as uint64. + uint64_t AsUint64() const { + return d64_; + } + + // Returns the next greater double. Returns +infinity on input +infinity. + double NextDouble() const { + if (d64_ == kInfinity) return Double(kInfinity).value(); + if (Sign() < 0 && Significand() == 0) { + // -0.0 + return 0.0; + } + if (Sign() < 0) { + return Double(d64_ - 1).value(); + } else { + return Double(d64_ + 1).value(); + } + } + + double PreviousDouble() const { + if (d64_ == (kInfinity | kSignMask)) return -Infinity(); + if (Sign() < 0) { + return Double(d64_ + 1).value(); + } else { + if (Significand() == 0) return -0.0; + return Double(d64_ - 1).value(); + } + } + + int Exponent() const { + if (IsDenormal()) return kDenormalExponent; + + uint64_t d64 = AsUint64(); + int biased_e = + static_cast((d64 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; + } + + uint64_t Significand() const { + uint64_t d64 = AsUint64(); + uint64_t significand = d64 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } + } + + // Returns true if the double is a denormal. + bool IsDenormal() const { + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == 0; + } + + // We consider denormals not to be special. + // Hence only Infinity and NaN are special. + bool IsSpecial() const { + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == kExponentMask; + } + + bool IsNan() const { + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) != 0); + } + + bool IsQuietNan() const { +#if (defined(__mips__) && !defined(__mips_nan2008)) || defined(__hppa__) + return IsNan() && ((AsUint64() & kQuietNanBit) == 0); +#else + return IsNan() && ((AsUint64() & kQuietNanBit) != 0); +#endif + } + + bool IsSignalingNan() const { +#if (defined(__mips__) && !defined(__mips_nan2008)) || defined(__hppa__) + return IsNan() && ((AsUint64() & kQuietNanBit) != 0); +#else + return IsNan() && ((AsUint64() & kQuietNanBit) == 0); +#endif + } + + + bool IsInfinite() const { + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) == 0); + } + + int Sign() const { + uint64_t d64 = AsUint64(); + return (d64 & kSignMask) == 0? 1: -1; + } + + // Precondition: the value encoded by this Double must be greater or equal + // than +0.0. + DiyFp UpperBoundary() const { + DOUBLE_CONVERSION_ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); + } + + // Computes the two boundaries of this. + // The bigger boundary (m_plus) is normalized. The lower boundary has the same + // exponent as m_plus. + // Precondition: the value encoded by this Double must be greater than 0. + void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { + DOUBLE_CONVERSION_ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; + } + + bool LowerBoundaryIsCloser() const { + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint64() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); + } + + double value() const { return uint64_to_double(d64_); } + + // Returns the significand size for a given order of magnitude. + // If v = f*2^e with 2^p-1 <= f <= 2^p then p+e is v's order of magnitude. + // This function returns the number of significant binary digits v will have + // once it's encoded into a double. In almost all cases this is equal to + // kSignificandSize. The only exceptions are denormals. They start with + // leading zeroes and their effective significand-size is hence smaller. + static int SignificandSizeForOrderOfMagnitude(int order) { + if (order >= (kDenormalExponent + kSignificandSize)) { + return kSignificandSize; + } + if (order <= kDenormalExponent) return 0; + return order - kDenormalExponent; + } + + static double Infinity() { + return Double(kInfinity).value(); + } + + static double NaN() { + return Double(kNaN).value(); + } + + private: + static const int kDenormalExponent = -kExponentBias + 1; + static const uint64_t kInfinity = DOUBLE_CONVERSION_UINT64_2PART_C(0x7FF00000, 00000000); +#if (defined(__mips__) && !defined(__mips_nan2008)) || defined(__hppa__) + static const uint64_t kNaN = DOUBLE_CONVERSION_UINT64_2PART_C(0x7FF7FFFF, FFFFFFFF); +#else + static const uint64_t kNaN = DOUBLE_CONVERSION_UINT64_2PART_C(0x7FF80000, 00000000); +#endif + + + const uint64_t d64_; + + static uint64_t DiyFpToUint64(DiyFp diy_fp) { + uint64_t significand = diy_fp.f(); + int exponent = diy_fp.e(); + while (significand > kHiddenBit + kSignificandMask) { + significand >>= 1; + exponent++; + } + if (exponent >= kMaxExponent) { + return kInfinity; + } + if (exponent < kDenormalExponent) { + return 0; + } + while (exponent > kDenormalExponent && (significand & kHiddenBit) == 0) { + significand <<= 1; + exponent--; + } + uint64_t biased_exponent; + if (exponent == kDenormalExponent && (significand & kHiddenBit) == 0) { + biased_exponent = 0; + } else { + biased_exponent = static_cast(exponent + kExponentBias); + } + return (significand & kSignificandMask) | + (biased_exponent << kPhysicalSignificandSize); + } + + DOUBLE_CONVERSION_DISALLOW_COPY_AND_ASSIGN(Double); +}; + +class Single { + public: + static const uint32_t kSignMask = 0x80000000; + static const uint32_t kExponentMask = 0x7F800000; + static const uint32_t kSignificandMask = 0x007FFFFF; + static const uint32_t kHiddenBit = 0x00800000; + static const uint32_t kQuietNanBit = 0x00400000; + static const int kPhysicalSignificandSize = 23; // Excludes the hidden bit. + static const int kSignificandSize = 24; + + Single() : d32_(0) {} + explicit Single(float f) : d32_(float_to_uint32(f)) {} + explicit Single(uint32_t d32) : d32_(d32) {} + + // The value encoded by this Single must be greater or equal to +0.0. + // It must not be special (infinity, or NaN). + DiyFp AsDiyFp() const { + DOUBLE_CONVERSION_ASSERT(Sign() > 0); + DOUBLE_CONVERSION_ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); + } + + // Returns the single's bit as uint64. + uint32_t AsUint32() const { + return d32_; + } + + int Exponent() const { + if (IsDenormal()) return kDenormalExponent; + + uint32_t d32 = AsUint32(); + int biased_e = + static_cast((d32 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; + } + + uint32_t Significand() const { + uint32_t d32 = AsUint32(); + uint32_t significand = d32 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } + } + + // Returns true if the single is a denormal. + bool IsDenormal() const { + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == 0; + } + + // We consider denormals not to be special. + // Hence only Infinity and NaN are special. + bool IsSpecial() const { + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == kExponentMask; + } + + bool IsNan() const { + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) != 0); + } + + bool IsQuietNan() const { +#if (defined(__mips__) && !defined(__mips_nan2008)) || defined(__hppa__) + return IsNan() && ((AsUint32() & kQuietNanBit) == 0); +#else + return IsNan() && ((AsUint32() & kQuietNanBit) != 0); +#endif + } + + bool IsSignalingNan() const { +#if (defined(__mips__) && !defined(__mips_nan2008)) || defined(__hppa__) + return IsNan() && ((AsUint32() & kQuietNanBit) != 0); +#else + return IsNan() && ((AsUint32() & kQuietNanBit) == 0); +#endif + } + + + bool IsInfinite() const { + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) == 0); + } + + int Sign() const { + uint32_t d32 = AsUint32(); + return (d32 & kSignMask) == 0? 1: -1; + } + + // Computes the two boundaries of this. + // The bigger boundary (m_plus) is normalized. The lower boundary has the same + // exponent as m_plus. + // Precondition: the value encoded by this Single must be greater than 0. + void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { + DOUBLE_CONVERSION_ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; + } + + // Precondition: the value encoded by this Single must be greater or equal + // than +0.0. + DiyFp UpperBoundary() const { + DOUBLE_CONVERSION_ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); + } + + bool LowerBoundaryIsCloser() const { + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint32() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); + } + + float value() const { return uint32_to_float(d32_); } + + static float Infinity() { + return Single(kInfinity).value(); + } + + static float NaN() { + return Single(kNaN).value(); + } + + private: + static const int kExponentBias = 0x7F + kPhysicalSignificandSize; + static const int kDenormalExponent = -kExponentBias + 1; + static const int kMaxExponent = 0xFF - kExponentBias; + static const uint32_t kInfinity = 0x7F800000; +#if (defined(__mips__) && !defined(__mips_nan2008)) || defined(__hppa__) + static const uint32_t kNaN = 0x7FBFFFFF; +#else + static const uint32_t kNaN = 0x7FC00000; +#endif + + const uint32_t d32_; + + DOUBLE_CONVERSION_DISALLOW_COPY_AND_ASSIGN(Single); +}; + +} // namespace double_conversion +} // namespace arrow_vendored + +#endif // DOUBLE_CONVERSION_DOUBLE_H_ diff --git a/shared/package-files/09/0953670e900322628d9ff059a8282a02a9dbab27cd59f4f643348dccb16000d3/blob b/shared/package-files/09/0953670e900322628d9ff059a8282a02a9dbab27cd59f4f643348dccb16000d3/blob new file mode 100644 index 0000000000000000000000000000000000000000..f5b7f6611c28533851f41b16ca0eec532095741a --- /dev/null +++ b/shared/package-files/09/0953670e900322628d9ff059a8282a02a9dbab27cd59f4f643348dccb16000d3/blob @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///opt/conda/conda-bld/decorator_1643638310831/work"} \ No newline at end of file diff --git a/shared/package-files/09/0954b2d9a301d94f4348024606a71bbcb2fa24d3cd3709f5bc8bca605039785d/blob b/shared/package-files/09/0954b2d9a301d94f4348024606a71bbcb2fa24d3cd3709f5bc8bca605039785d/blob new file mode 100644 index 0000000000000000000000000000000000000000..dbbdea3c8149004cfd525a0fc26e5da72b20e8a1 Binary files /dev/null and b/shared/package-files/09/0954b2d9a301d94f4348024606a71bbcb2fa24d3cd3709f5bc8bca605039785d/blob differ diff --git a/shared/package-files/09/095509071c1ecb629e0117da1ae5466109f289595b3acd162ed103a54177ccb9/blob b/shared/package-files/09/095509071c1ecb629e0117da1ae5466109f289595b3acd162ed103a54177ccb9/blob new file mode 100644 index 0000000000000000000000000000000000000000..becb3e4bd64d377ce246bd2a41a1e822c3e30656 --- /dev/null +++ b/shared/package-files/09/095509071c1ecb629e0117da1ae5466109f289595b3acd162ed103a54177ccb9/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _embedding_bag_per_sample_weights_backward { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &, int64_t, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_embedding_bag_per_sample_weights_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_embedding_bag_per_sample_weights_backward(Tensor grad, Tensor weight, Tensor indices, Tensor offsets, Tensor offset2bag, int mode, int padding_idx=-1) -> Tensor") + static at::Tensor call(const at::Tensor & grad, const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, const at::Tensor & offset2bag, int64_t mode, int64_t padding_idx); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad, const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, const at::Tensor & offset2bag, int64_t mode, int64_t padding_idx); +}; + +struct TORCH_API _embedding_bag_per_sample_weights_backward_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &, int64_t, int64_t, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_embedding_bag_per_sample_weights_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_embedding_bag_per_sample_weights_backward.out(Tensor grad, Tensor weight, Tensor indices, Tensor offsets, Tensor offset2bag, int mode, int padding_idx=-1, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & grad, const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, const at::Tensor & offset2bag, int64_t mode, int64_t padding_idx, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad, const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, const at::Tensor & offset2bag, int64_t mode, int64_t padding_idx, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/09/0956b0ec3d3ee83391820efc43a6f7e5234a9f4e4f94ac1626ea973ae53ea9d6/blob b/shared/package-files/09/0956b0ec3d3ee83391820efc43a6f7e5234a9f4e4f94ac1626ea973ae53ea9d6/blob new file mode 100644 index 0000000000000000000000000000000000000000..3746d1a311eb68bb1af16e18ab152c7236b42bb5 --- /dev/null +++ b/shared/package-files/09/0956b0ec3d3ee83391820efc43a6f7e5234a9f4e4f94ac1626ea973ae53ea9d6/blob @@ -0,0 +1,35 @@ +# This testfile tests SymPy <-> SciPy compatibility + +# Don't test any SymPy features here. Just pure interaction with SciPy. +# Always write regular SymPy tests for anything, that can be tested in pure +# Python (without scipy). Here we test everything, that a user may need when +# using SymPy with SciPy + +from sympy.external import import_module + +scipy = import_module('scipy') +if not scipy: + #bin/test will not execute any tests now + disabled = True + +from sympy.functions.special.bessel import jn_zeros + + +def eq(a, b, tol=1e-6): + for x, y in zip(a, b): + if not (abs(x - y) < tol): + return False + return True + + +def test_jn_zeros(): + assert eq(jn_zeros(0, 4, method="scipy"), + [3.141592, 6.283185, 9.424777, 12.566370]) + assert eq(jn_zeros(1, 4, method="scipy"), + [4.493409, 7.725251, 10.904121, 14.066193]) + assert eq(jn_zeros(2, 4, method="scipy"), + [5.763459, 9.095011, 12.322940, 15.514603]) + assert eq(jn_zeros(3, 4, method="scipy"), + [6.987932, 10.417118, 13.698023, 16.923621]) + assert eq(jn_zeros(4, 4, method="scipy"), + [8.182561, 11.704907, 15.039664, 18.301255]) diff --git a/shared/package-files/09/09580ed397fbc398a6654b7bf3d8bfcc96bc4d8ca0346f9542c6b86108686909/blob b/shared/package-files/09/09580ed397fbc398a6654b7bf3d8bfcc96bc4d8ca0346f9542c6b86108686909/blob new file mode 100644 index 0000000000000000000000000000000000000000..dd504288ab1f3151ee3ff98722e65393375f5533 Binary files /dev/null and b/shared/package-files/09/09580ed397fbc398a6654b7bf3d8bfcc96bc4d8ca0346f9542c6b86108686909/blob differ diff --git a/shared/package-files/09/0958eb7910661af17718c1c21698e8de7bac9fc6ea90b6e3cca6bec58ab741ee/blob b/shared/package-files/09/0958eb7910661af17718c1c21698e8de7bac9fc6ea90b6e3cca6bec58ab741ee/blob new file mode 100644 index 0000000000000000000000000000000000000000..2228691e29ea25b64facd841d84648c098dd39ab --- /dev/null +++ b/shared/package-files/09/0958eb7910661af17718c1c21698e8de7bac9fc6ea90b6e3cca6bec58ab741ee/blob @@ -0,0 +1,12 @@ +from warnings import warn + +from .std import TqdmDeprecationWarning +from .utils import ( # NOQA, pylint: disable=unused-import + CUR_OS, IS_NIX, IS_WIN, RE_ANSI, Comparable, FormatReplace, SimpleTextIOWrapper, + _basestring, _environ_cols_wrapper, _is_ascii, _is_utf, _range, _screen_shape_linux, + _screen_shape_tput, _screen_shape_windows, _screen_shape_wrapper, _supports_unicode, + _term_move_up, _unich, _unicode, colorama) + +warn("This function will be removed in tqdm==5.0.0\n" + "Please use `tqdm.utils.*` instead of `tqdm._utils.*`", + TqdmDeprecationWarning, stacklevel=2) diff --git a/shared/package-files/09/0959181e9fd4e23c582914474ae6797d1128a78b498e765c434d8329f39b9110/blob b/shared/package-files/09/0959181e9fd4e23c582914474ae6797d1128a78b498e765c434d8329f39b9110/blob new file mode 100644 index 0000000000000000000000000000000000000000..c9ab357ec85972cf0014752a1e0ccb08ff284af9 Binary files /dev/null and b/shared/package-files/09/0959181e9fd4e23c582914474ae6797d1128a78b498e765c434d8329f39b9110/blob differ diff --git a/shared/package-files/09/095999abb5bfc856893703e933d53591adc5ed8e60dce9c569f2a53ea9873439/blob b/shared/package-files/09/095999abb5bfc856893703e933d53591adc5ed8e60dce9c569f2a53ea9873439/blob new file mode 100644 index 0000000000000000000000000000000000000000..a9ad0421b69082c667156284190d21a6a83a1a24 --- /dev/null +++ b/shared/package-files/09/095999abb5bfc856893703e933d53591adc5ed8e60dce9c569f2a53ea9873439/blob @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::vander(Tensor x, int? N=None, bool increasing=False) -> Tensor +inline at::Tensor vander(const at::Tensor & x, c10::optional N=c10::nullopt, bool increasing=false) { + return at::_ops::vander::call(x, N, increasing); +} + +} diff --git a/shared/package-files/09/095dd59f39dea8b6f09615631ccecedb30e347d1db484ee64785fa3dbcbef33c/blob b/shared/package-files/09/095dd59f39dea8b6f09615631ccecedb30e347d1db484ee64785fa3dbcbef33c/blob new file mode 100644 index 0000000000000000000000000000000000000000..d46caca8c21fed8a90c5c3664974d3f1b010e7c4 --- /dev/null +++ b/shared/package-files/09/095dd59f39dea8b6f09615631ccecedb30e347d1db484ee64785fa3dbcbef33c/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor linalg_ldl_solve(const at::Tensor & LD, const at::Tensor & pivots, const at::Tensor & B, bool hermitian=false); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/09/095eb70dfa92e3a49654e241a545ffc7c900dc9e727af8d0debdfa181755cfcf/blob b/shared/package-files/09/095eb70dfa92e3a49654e241a545ffc7c900dc9e727af8d0debdfa181755cfcf/blob new file mode 100644 index 0000000000000000000000000000000000000000..1634701593160305d66923be4374989a798bc003 --- /dev/null +++ b/shared/package-files/09/095eb70dfa92e3a49654e241a545ffc7c900dc9e727af8d0debdfa181755cfcf/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_xlogy_Tensor : public TensorIteratorBase { + + + void meta(const at::Tensor & self, const at::Tensor & other); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/09/095f121f7cd5cc05295e97a550cd54f18d37a5c464f67a20c17a35308c1fe4ce/blob b/shared/package-files/09/095f121f7cd5cc05295e97a550cd54f18d37a5c464f67a20c17a35308c1fe4ce/blob new file mode 100644 index 0000000000000000000000000000000000000000..8e976d80c3f737a868d9c4aeffbb281e4444fd7e --- /dev/null +++ b/shared/package-files/09/095f121f7cd5cc05295e97a550cd54f18d37a5c464f67a20c17a35308c1fe4ce/blob @@ -0,0 +1,83 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API special_chebyshev_polynomial_v { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_chebyshev_polynomial_v") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_chebyshev_polynomial_v(Tensor x, Tensor n) -> Tensor") + static at::Tensor call(const at::Tensor & x, const at::Tensor & n); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Tensor & n); +}; + +struct TORCH_API special_chebyshev_polynomial_v_x_scalar { + using schema = at::Tensor (const at::Scalar &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_chebyshev_polynomial_v") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "x_scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_chebyshev_polynomial_v.x_scalar(Scalar x, Tensor n) -> Tensor") + static at::Tensor call(const at::Scalar & x, const at::Tensor & n); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & x, const at::Tensor & n); +}; + +struct TORCH_API special_chebyshev_polynomial_v_n_scalar { + using schema = at::Tensor (const at::Tensor &, const at::Scalar &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_chebyshev_polynomial_v") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "n_scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_chebyshev_polynomial_v.n_scalar(Tensor x, Scalar n) -> Tensor") + static at::Tensor call(const at::Tensor & x, const at::Scalar & n); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Scalar & n); +}; + +struct TORCH_API special_chebyshev_polynomial_v_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_chebyshev_polynomial_v") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_chebyshev_polynomial_v.out(Tensor x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & x, const at::Tensor & n, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Tensor & n, at::Tensor & out); +}; + +struct TORCH_API special_chebyshev_polynomial_v_x_scalar_out { + using schema = at::Tensor & (const at::Scalar &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_chebyshev_polynomial_v") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "x_scalar_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_chebyshev_polynomial_v.x_scalar_out(Scalar x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Scalar & x, const at::Tensor & n, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & x, const at::Tensor & n, at::Tensor & out); +}; + +struct TORCH_API special_chebyshev_polynomial_v_n_scalar_out { + using schema = at::Tensor & (const at::Tensor &, const at::Scalar &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_chebyshev_polynomial_v") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "n_scalar_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_chebyshev_polynomial_v.n_scalar_out(Tensor x, Scalar n, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & x, const at::Scalar & n, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Scalar & n, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/09/095f7f37c150e6915d06e745c51a9d60c9b1da51810685c4156fac3cc5c9abd6/blob b/shared/package-files/09/095f7f37c150e6915d06e745c51a9d60c9b1da51810685c4156fac3cc5c9abd6/blob new file mode 100644 index 0000000000000000000000000000000000000000..fd6f79ad121e799e453a91b90fe3be1eff8eaf6d Binary files /dev/null and b/shared/package-files/09/095f7f37c150e6915d06e745c51a9d60c9b1da51810685c4156fac3cc5c9abd6/blob differ diff --git a/shared/package-files/09/09629d990753e2081a47f778f2828aaf8274b0a54253c37c4382a4c76561655b/blob b/shared/package-files/09/09629d990753e2081a47f778f2828aaf8274b0a54253c37c4382a4c76561655b/blob new file mode 100644 index 0000000000000000000000000000000000000000..c19a1f167253eff6b67729a41e39ee7da68fecab --- /dev/null +++ b/shared/package-files/09/09629d990753e2081a47f778f2828aaf8274b0a54253c37c4382a4c76561655b/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor fbgemm_pack_gemm_matrix_fp16(const at::Tensor & input); +} // namespace native +} // namespace at diff --git a/shared/package-files/09/0963b64ceb8480ce87d74d451c9a7fccad8062a00b55bf2b659b207d047c4cab/blob b/shared/package-files/09/0963b64ceb8480ce87d74d451c9a7fccad8062a00b55bf2b659b207d047c4cab/blob new file mode 100644 index 0000000000000000000000000000000000000000..d82246bf2894f7a4638ce7bd988f5c6e77f34704 --- /dev/null +++ b/shared/package-files/09/0963b64ceb8480ce87d74d451c9a7fccad8062a00b55bf2b659b207d047c4cab/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & _cudnn_init_dropout_state_out(at::Tensor & out, double dropout, bool train, int64_t dropout_seed); +TORCH_API at::Tensor & _cudnn_init_dropout_state_outf(double dropout, bool train, int64_t dropout_seed, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/09/09651e52ccc5404eefd3f1376c0d2a9a11fde1936d7db9017bcc7a12dd08da09/blob b/shared/package-files/09/09651e52ccc5404eefd3f1376c0d2a9a11fde1936d7db9017bcc7a12dd08da09/blob new file mode 100644 index 0000000000000000000000000000000000000000..7c3f58b82ca0ad2b82bb4589277ab1d4711729c7 --- /dev/null +++ b/shared/package-files/09/09651e52ccc5404eefd3f1376c0d2a9a11fde1936d7db9017bcc7a12dd08da09/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor type_as(const at::Tensor & self, const at::Tensor & other); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/09/09660ec4ef8c338222af58140a0917f526d30290ed9749705a9ad604640720e0/blob b/shared/package-files/09/09660ec4ef8c338222af58140a0917f526d30290ed9749705a9ad604640720e0/blob new file mode 100644 index 0000000000000000000000000000000000000000..e2e30462968258dfe608ae0a73604a71a312cf85 --- /dev/null +++ b/shared/package-files/09/09660ec4ef8c338222af58140a0917f526d30290ed9749705a9ad604640720e0/blob @@ -0,0 +1,739 @@ +""" +Tests for collapsed observation vector + +These tests cannot be run for the Clark 1989 model since the dimension of +observations (2) is smaller than the number of states (6). + +Author: Chad Fulton +License: Simplified-BSD +""" +from pathlib import Path + +import numpy as np +from numpy.testing import assert_allclose, assert_equal +import pandas as pd +import pytest + +from statsmodels import datasets +from statsmodels.tsa.statespace import dynamic_factor +from statsmodels.tsa.statespace.kalman_filter import FILTER_UNIVARIATE +from statsmodels.tsa.statespace.kalman_smoother import ( + SMOOTH_ALTERNATIVE, + SMOOTH_CLASSICAL, + SMOOTH_UNIVARIATE, +) +from statsmodels.tsa.statespace.mlemodel import MLEModel +from statsmodels.tsa.statespace.tests.results import results_kalman_filter + +current_path = Path(__file__).resolve().parent + + +class Trivariate: + """ + Tests collapsing three-dimensional observation data to two-dimensional + """ + + @classmethod + def setup_class(cls, dtype=float, alternate_timing=False, **kwargs): + cls.results = results_kalman_filter.uc_bi + + # GDP and Unemployment, Quarterly, 1948.1 - 1995.3 + data = pd.DataFrame( + cls.results["data"], + index=pd.date_range("1947-01-01", "1995-07-01", freq="QS"), + columns=["GDP", "UNEMP"], + )[4:] + data["GDP"] = np.log(data["GDP"]) + data["UNEMP"] = data["UNEMP"] / 100 + data["X"] = np.exp(data["GDP"]) * data["UNEMP"] + + k_states = 2 + cls.mlemodel = MLEModel(data, k_states=k_states, **kwargs) + cls.model = cls.mlemodel.ssm + if alternate_timing: + cls.model.timing_init_filtered = True + + # Statespace representation + cls.model["selection"] = np.eye(cls.model.k_states) + + # Update matrices with test parameters + cls.model["design"] = np.array([[0.5, 0.2], [0, 0.8], [1, -0.5]]) + cls.model["transition"] = np.array([[0.4, 0.5], [1, 0]]) + cls.model["obs_cov"] = np.diag([0.2, 1.1, 0.5]) + cls.model["state_cov"] = np.diag([2.0, 1]) + + # Initialization + cls.model.initialize_approximate_diffuse() + + def test_using_collapsed(self): + # Test to make sure the results_b actually used a collapsed Kalman + # filtering approach (i.e., that the flag being set actually caused the + # filter to not use the conventional filter) + + assert not self.results_a.filter_collapsed + assert self.results_b.filter_collapsed + + assert self.results_a.collapsed_forecasts is None + assert self.results_b.collapsed_forecasts is not None + + assert_equal(self.results_a.forecasts.shape[0], 3) + assert_equal(self.results_b.collapsed_forecasts.shape[0], 2) + + def test_forecasts(self): + assert_allclose( + self.results_a.forecasts[0, :], + self.results_b.forecasts[0, :], + ) + + def test_forecasts_error(self): + assert_allclose( + self.results_a.forecasts_error[0, :], self.results_b.forecasts_error[0, :] + ) + + def test_forecasts_error_cov(self): + assert_allclose( + self.results_a.forecasts_error_cov[0, 0, :], + self.results_b.forecasts_error_cov[0, 0, :], + ) + + def test_filtered_state(self): + assert_allclose(self.results_a.filtered_state, self.results_b.filtered_state) + + def test_filtered_state_cov(self): + assert_allclose( + self.results_a.filtered_state_cov, self.results_b.filtered_state_cov + ) + + def test_predicted_state(self): + assert_allclose(self.results_a.predicted_state, self.results_b.predicted_state) + + def test_predicted_state_cov(self): + assert_allclose( + self.results_a.predicted_state_cov, self.results_b.predicted_state_cov + ) + + def test_loglike(self): + assert_allclose(self.results_a.llf_obs, self.results_b.llf_obs) + + def test_smoothed_states(self): + assert_allclose(self.results_a.smoothed_state, self.results_b.smoothed_state) + + def test_smoothed_states_cov(self): + assert_allclose( + self.results_a.smoothed_state_cov, + self.results_b.smoothed_state_cov, + atol=1e-4, + ) + + def test_smoothed_states_autocov(self): + assert_allclose( + self.results_a.smoothed_state_autocov, self.results_b.smoothed_state_autocov + ) + + # Skipped because "measurement" refers to different things; even different + # dimensions + @pytest.mark.skip + def test_smoothed_measurement_disturbance(self): + assert_allclose( + self.results_a.smoothed_measurement_disturbance, + self.results_b.smoothed_measurement_disturbance, + ) + + # Skipped because "measurement" refers to different things; even different + # dimensions + @pytest.mark.skip + def test_smoothed_measurement_disturbance_cov(self): + assert_allclose( + self.results_a.smoothed_measurement_disturbance_cov, + self.results_b.smoothed_measurement_disturbance_cov, + ) + + def test_smoothed_state_disturbance(self): + assert_allclose( + self.results_a.smoothed_state_disturbance, + self.results_b.smoothed_state_disturbance, + ) + + def test_smoothed_state_disturbance_cov(self): + assert_allclose( + self.results_a.smoothed_state_disturbance_cov, + self.results_b.smoothed_state_disturbance_cov, + ) + + def test_simulation_smoothed_state(self): + assert_allclose(self.sim_a.simulated_state, self.sim_a.simulated_state) + + def test_simulation_smoothed_measurement_disturbance(self): + assert_allclose( + self.sim_a.simulated_measurement_disturbance, + self.sim_a.simulated_measurement_disturbance, + ) + + def test_simulation_smoothed_state_disturbance(self): + assert_allclose( + self.sim_a.simulated_state_disturbance, + self.sim_a.simulated_state_disturbance, + ) + + +class TestTrivariateConventional(Trivariate): + + @classmethod + def setup_class(cls, dtype=float, **kwargs): + super().setup_class(dtype, **kwargs) + + nobs = cls.model.nobs + k_endog = cls.model.k_endog + k_posdef = cls.model.k_posdef + + # Collapsed filtering, smoothing, and simulation smoothing + cls.model.filter_conventional = True + cls.model.filter_collapsed = True + cls.results_b = cls.model.smooth() + cls.sim_b = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + # Conventional filtering, smoothing, and simulation smoothing + cls.model.filter_collapsed = False + cls.results_a = cls.model.smooth() + cls.sim_a = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + +class TestTrivariateConventionalAlternate(TestTrivariateConventional): + @classmethod + def setup_class(cls, *args, **kwargs): + super().setup_class(*args, alternate_timing=True, **kwargs) + + def test_using_alterate(self): + assert self.model._kalman_filter.filter_timing == 1 + + +class TestTrivariateConventionalPartialMissing(Trivariate): + @classmethod + def setup_class(cls, dtype=float, **kwargs): + super().setup_class(dtype, **kwargs) + nobs = cls.model.nobs + k_endog = cls.model.k_endog + k_posdef = cls.model.k_posdef + + # Set partially missing data + cls.model.endog[:2, 10:180] = np.nan + + # Collapsed filtering, smoothing, and simulation smoothing + cls.model.filter_conventional = True + cls.model.filter_collapsed = True + cls.results_b = cls.model.smooth() + cls.sim_b = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + # Conventional filtering, smoothing, and simulation smoothing + cls.model.filter_collapsed = False + cls.results_a = cls.model.smooth() + cls.sim_a = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + +class TestTrivariateConventionalPartialMissingAlternate( + TestTrivariateConventionalPartialMissing +): + @classmethod + def setup_class(cls, *args, **kwargs): + super().setup_class(*args, alternate_timing=True, **kwargs) + + def test_using_alterate(self): + assert self.model._kalman_filter.filter_timing == 1 + + +class TestTrivariateConventionalAllMissing(Trivariate): + @classmethod + def setup_class(cls, dtype=float, **kwargs): + super().setup_class(dtype, **kwargs) + nobs = cls.model.nobs + k_endog = cls.model.k_endog + k_posdef = cls.model.k_posdef + + # Set partially missing data + cls.model.endog[:, 10:180] = np.nan + + # Collapsed filtering, smoothing, and simulation smoothing + cls.model.filter_conventional = True + cls.model.filter_collapsed = True + cls.results_b = cls.model.smooth() + cls.sim_b = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + # Conventional filtering, smoothing, and simulation smoothing + cls.model.filter_collapsed = False + cls.results_a = cls.model.smooth() + cls.sim_a = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + +class TestTrivariateConventionalAllMissingAlternate( + TestTrivariateConventionalAllMissing +): + @classmethod + def setup_class(cls, *args, **kwargs): + super().setup_class(*args, alternate_timing=True, **kwargs) + + def test_using_alterate(self): + assert self.model._kalman_filter.filter_timing == 1 + + +class TestTrivariateUnivariate(Trivariate): + @classmethod + def setup_class(cls, dtype=float, **kwargs): + super().setup_class(dtype, **kwargs) + nobs = cls.model.nobs + k_endog = cls.model.k_endog + k_posdef = cls.model.k_posdef + + # Collapsed filtering, smoothing, and simulation smoothing + cls.model.filter_univariate = True + cls.model.filter_collapsed = True + cls.results_b = cls.model.smooth() + cls.sim_b = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + # Univariate filtering, smoothing, and simulation smoothing + cls.model.filter_collapsed = False + cls.results_a = cls.model.smooth() + cls.sim_a = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + +class TestTrivariateUnivariateAlternate(TestTrivariateUnivariate): + @classmethod + def setup_class(cls, *args, **kwargs): + super().setup_class(*args, alternate_timing=True, **kwargs) + + def test_using_alterate(self): + assert self.model._kalman_filter.filter_timing == 1 + + +class TestTrivariateUnivariatePartialMissing(Trivariate): + @classmethod + def setup_class(cls, dtype=float, **kwargs): + super().setup_class(dtype, **kwargs) + nobs = cls.model.nobs + k_endog = cls.model.k_endog + k_posdef = cls.model.k_posdef + + # Set partially missing data + cls.model.endog[:2, 10:180] = np.nan + + # Collapsed filtering, smoothing, and simulation smoothing + cls.model.filter_univariate = True + cls.model.filter_collapsed = True + cls.results_b = cls.model.smooth() + cls.sim_b = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + # Univariate filtering, smoothing, and simulation smoothing + cls.model.filter_collapsed = False + cls.results_a = cls.model.smooth() + cls.sim_a = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + +class TestTrivariateUnivariatePartialMissingAlternate( + TestTrivariateUnivariatePartialMissing +): + @classmethod + def setup_class(cls, *args, **kwargs): + super().setup_class(*args, alternate_timing=True, **kwargs) + + def test_using_alterate(self): + assert self.model._kalman_filter.filter_timing == 1 + + +class TestTrivariateUnivariateAllMissing(Trivariate): + @classmethod + def setup_class(cls, dtype=float, **kwargs): + super().setup_class(dtype, **kwargs) + nobs = cls.model.nobs + k_endog = cls.model.k_endog + k_posdef = cls.model.k_posdef + + # Set partially missing data + cls.model.endog[:, 10:180] = np.nan + + # Univariate filtering, smoothing, and simulation smoothing + cls.model.filter_univariate = True + cls.model.filter_collapsed = True + cls.results_b = cls.model.smooth() + cls.sim_b = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + # Conventional filtering, smoothing, and simulation smoothing + cls.model.filter_collapsed = False + cls.results_a = cls.model.smooth() + cls.sim_a = cls.model.simulation_smoother( + measurement_disturbance_variates=np.zeros(nobs * k_endog), + state_disturbance_variates=np.zeros(nobs * k_posdef), + initial_state_variates=np.zeros(cls.model.k_states), + ) + + +class TestTrivariateUnivariateAllMissingAlternate(TestTrivariateUnivariateAllMissing): + @classmethod + def setup_class(cls, *args, **kwargs): + super().setup_class(*args, alternate_timing=True, **kwargs) + + def test_using_alterate(self): + assert self.model._kalman_filter.filter_timing == 1 + + +class TestDFM: + @classmethod + def create_model(cls, obs, **kwargs): + # Create the model with typical state space + mod = MLEModel(obs, k_states=2, k_posdef=2, **kwargs) + mod["design"] = np.array( + [ + [-32.47143586, 17.33779024], + [-7.40264169, 1.69279859], + [-209.04702853, 125.2879374], + ] + ) + mod["obs_cov"] = np.diag(np.array([0.0622668, 1.95666886, 58.37473642])) + mod["transition"] = np.array( + [[0.29935707, 0.33289005], [-0.7639868, 1.2844237]] + ) + mod["selection"] = np.eye(2) + mod["state_cov"] = np.array([[1.2, -0.25], [-0.25, 1.1]]) + mod.initialize_approximate_diffuse(1e6) + return mod + + @classmethod + def collapse(cls, obs, **kwargs): + mod = cls.create_model(obs, **kwargs) + mod.smooth([], return_ssm=True) + + _ss = mod.ssm._statespace + out = np.zeros((mod.nobs, mod.k_states)) + for t in range(mod.nobs): + _ss.seek(t, mod.ssm.filter_univariate, 1) + out[t] = np.array(_ss.collapse_obs) + return out + + @classmethod + def setup_class(cls, which="mixed", *args, **kwargs): + # Data + dta = datasets.macrodata.load_pandas().data + dta.index = pd.date_range(start="1959-01-01", end="2009-7-01", freq="QS") + levels = dta[["realgdp", "realcons", "realinv"]] + obs = np.log(levels).diff().iloc[1:] * 400 + + if which == "all": + obs.iloc[:50, :] = np.nan + obs.iloc[119:130, :] = np.nan + elif which == "partial": + obs.iloc[0:50, 0] = np.nan + obs.iloc[119:130, 0] = np.nan + elif which == "mixed": + obs.iloc[0:50, 0] = np.nan + obs.iloc[19:70, 1] = np.nan + obs.iloc[39:90, 2] = np.nan + obs.iloc[119:130, 0] = np.nan + obs.iloc[119:130, 2] = np.nan + + mod = cls.create_model(obs, **kwargs) + cls.model = mod.ssm + + nobs = cls.model.nobs + k_endog = cls.model.k_endog + k_posdef = cls.model.k_posdef + + rs = np.random.RandomState(1234) + mdv = rs.normal(size=nobs * k_endog) + sdv = rs.normal(size=nobs * k_posdef) + isv = rs.normal(size=cls.model.k_states) + + # Collapsed filtering, smoothing, and simulation smoothing + cls.model.filter_collapsed = True + cls.results_b = cls.model.smooth() + cls.sim_b = cls.model.simulation_smoother() + cls.sim_b.simulate( + measurement_disturbance_variates=mdv, + state_disturbance_variates=sdv, + initial_state_variates=isv, + ) + + # Conventional filtering, smoothing, and simulation smoothing + cls.model.filter_collapsed = False + cls.results_a = cls.model.smooth() + cls.sim_a = cls.model.simulation_smoother() + cls.sim_a.simulate( + measurement_disturbance_variates=mdv, + state_disturbance_variates=sdv, + initial_state_variates=isv, + ) + + # Create the model with augmented state space + kwargs.pop("filter_collapsed", None) + mod = MLEModel(obs, k_states=4, k_posdef=2, **kwargs) + mod["design", :3, :2] = np.array( + [ + [-32.47143586, 17.33779024], + [-7.40264169, 1.69279859], + [-209.04702853, 125.2879374], + ] + ) + mod["obs_cov"] = np.diag(np.array([0.0622668, 1.95666886, 58.37473642])) + mod["transition", :2, :2] = np.array( + [[0.29935707, 0.33289005], [-0.7639868, 1.2844237]] + ) + mod["transition", 2:, :2] = np.eye(2) + mod["selection", :2, :2] = np.eye(2) + mod["state_cov"] = np.array([[1.2, -0.25], [-0.25, 1.1]]) + + mod.initialize_approximate_diffuse(1e6) + cls.augmented_model = mod.ssm + cls.augmented_results = mod.ssm.smooth() + + def test_using_collapsed(self): + # Test to make sure the results_b actually used a collapsed Kalman + # filtering approach (i.e., that the flag being set actually caused the + # filter to not use the conventional filter) + + assert not self.results_a.filter_collapsed + assert self.results_b.filter_collapsed + + assert self.results_a.collapsed_forecasts is None + assert self.results_b.collapsed_forecasts is not None + + assert_equal(self.results_a.forecasts.shape[0], 3) + assert_equal(self.results_b.collapsed_forecasts.shape[0], 2) + + def test_forecasts(self): + assert_allclose( + self.results_a.forecasts[0, :], + self.results_b.forecasts[0, :], + ) + + def test_forecasts_error(self): + assert_allclose( + self.results_a.forecasts_error[0, :], self.results_b.forecasts_error[0, :] + ) + + def test_forecasts_error_cov(self): + assert_allclose( + self.results_a.forecasts_error_cov[0, 0, :], + self.results_b.forecasts_error_cov[0, 0, :], + ) + + def test_filtered_state(self): + assert_allclose(self.results_a.filtered_state, self.results_b.filtered_state) + + def test_filtered_state_cov(self): + assert_allclose( + self.results_a.filtered_state_cov, self.results_b.filtered_state_cov + ) + + def test_predicted_state(self): + assert_allclose(self.results_a.predicted_state, self.results_b.predicted_state) + + def test_predicted_state_cov(self): + assert_allclose( + self.results_a.predicted_state_cov, self.results_b.predicted_state_cov + ) + + def test_loglike(self): + assert_allclose(self.results_a.llf_obs, self.results_b.llf_obs) + + def test_smoothed_states(self): + assert_allclose(self.results_a.smoothed_state, self.results_b.smoothed_state) + + def test_smoothed_states_cov(self): + assert_allclose( + self.results_a.smoothed_state_cov, + self.results_b.smoothed_state_cov, + atol=1e-4, + ) + + def test_smoothed_states_autocov(self): + # Cov(\alpha_{t+1}, \alpha_t) + # Test collapsed against non-collapsed + assert_allclose( + self.results_a.smoothed_state_autocov, self.results_b.smoothed_state_autocov + ) + + # Directly test using the augmented model + # Initialization makes these two methods slightly different for the + # first few observations + assert_allclose( + self.results_a.smoothed_state_autocov[:, :, 0:5], + self.augmented_results.smoothed_state_cov[:2, 2:, 1:6], + atol=1e-4, + ) + assert_allclose( + self.results_a.smoothed_state_autocov[:, :, 5:-1], + self.augmented_results.smoothed_state_cov[:2, 2:, 6:], + atol=1e-7, + ) + + # Skipped because "measurement" refers to different things; even different + # dimensions + @pytest.mark.skip + def test_smoothed_measurement_disturbance(self): + assert_allclose( + self.results_a.smoothed_measurement_disturbance, + self.results_b.smoothed_measurement_disturbance, + ) + + # Skipped because "measurement" refers to different things; even different + # dimensions + @pytest.mark.skip + def test_smoothed_measurement_disturbance_cov(self): + assert_allclose( + self.results_a.smoothed_measurement_disturbance_cov, + self.results_b.smoothed_measurement_disturbance_cov, + ) + + def test_smoothed_state_disturbance(self): + assert_allclose( + self.results_a.smoothed_state_disturbance, + self.results_b.smoothed_state_disturbance, + ) + + def test_smoothed_state_disturbance_cov(self): + assert_allclose( + self.results_a.smoothed_state_disturbance_cov, + self.results_b.smoothed_state_disturbance_cov, + ) + + def test_simulation_smoothed_state(self): + assert_allclose(self.sim_a.simulated_state, self.sim_b.simulated_state) + + # Skipped because "measurement" refers to different things; even different + # dimensions + @pytest.mark.skip + def test_simulation_smoothed_measurement_disturbance(self): + assert_allclose( + self.sim_a.simulated_measurement_disturbance, + self.sim_b.simulated_measurement_disturbance, + ) + + def test_simulation_smoothed_state_disturbance(self): + assert_allclose( + self.sim_a.simulated_state_disturbance, + self.sim_b.simulated_state_disturbance, + ) + + +class TestDFMClassicalSmoothing(TestDFM): + @classmethod + def setup_class(cls, *args, **kwargs): + super().setup_class(*args, smooth_method=SMOOTH_CLASSICAL, **kwargs) + + def test_smooth_method(self): + assert_equal(self.model.smooth_method, SMOOTH_CLASSICAL) + assert_equal(self.model._kalman_smoother.smooth_method, SMOOTH_CLASSICAL) + assert_equal(self.model._kalman_smoother._smooth_method, SMOOTH_CLASSICAL) + + +class TestDFMUnivariateSmoothing(TestDFM): + @classmethod + def setup_class(cls, *args, **kwargs): + super().setup_class(*args, filter_method=FILTER_UNIVARIATE, **kwargs) + + def test_smooth_method(self): + assert_equal(self.model.smooth_method, 0) + assert_equal(self.model._kalman_smoother.smooth_method, 0) + assert_equal(self.model._kalman_smoother._smooth_method, SMOOTH_UNIVARIATE) + + +class TestDFMAlternativeSmoothing(TestDFM): + @classmethod + def setup_class(cls, *args, **kwargs): + super().setup_class(smooth_method=SMOOTH_ALTERNATIVE, **kwargs) + + def test_smooth_method(self): + assert_equal(self.model.smooth_method, SMOOTH_ALTERNATIVE) + assert_equal(self.model._kalman_smoother.smooth_method, SMOOTH_ALTERNATIVE) + assert_equal(self.model._kalman_smoother._smooth_method, SMOOTH_ALTERNATIVE) + + +class TestDFMMeasurementDisturbance(TestDFM): + @classmethod + def setup_class(cls, *args, **kwargs): + super().setup_class(smooth_method=SMOOTH_CLASSICAL, which="none", **kwargs) + + def test_smoothed_state_disturbance(self): + assert_allclose( + self.results_a.smoothed_state_disturbance, + self.results_b.smoothed_state_disturbance, + atol=1e-7, + ) + + def test_smoothed_measurement_disturbance(self): + assert_allclose( + self.collapse(self.results_a.smoothed_measurement_disturbance.T).T, + self.results_b.smoothed_measurement_disturbance, + atol=1e-7, + ) + + def test_simulation_smoothed_measurement_disturbance(self): + assert_allclose( + self.collapse(self.sim_a.simulated_measurement_disturbance.T), + self.sim_b.simulated_measurement_disturbance.T, + atol=1e-7, + ) + + def test_simulation_smoothed_state_disturbance(self): + assert_allclose( + self.sim_a.simulated_state_disturbance, + self.sim_b.simulated_state_disturbance, + atol=1e-7, + ) + + +def test_dfm_missing(): + # This test is not captured by the TestTrivariate and TestDFM tests above + # because it has k_states = 1 + rs = np.random.RandomState(328392) + endog = rs.normal(size=(100, 3)) + endog[0, :1] = np.nan + + mod = dynamic_factor.DynamicFactor(endog, k_factors=1, factor_order=1) + mod.ssm.filter_collapsed = True + res = mod.smooth(mod.start_params) + mod.ssm.filter_collapsed = False + res2 = mod.smooth(mod.start_params) + + assert_allclose(res.llf, res2.llf) diff --git a/shared/package-files/09/09687d2bdaf5f6b8c89dcb365117e5b06e0cc9ae0ad3e1ce949fc02c74d49c1b/blob b/shared/package-files/09/09687d2bdaf5f6b8c89dcb365117e5b06e0cc9ae0ad3e1ce949fc02c74d49c1b/blob new file mode 100644 index 0000000000000000000000000000000000000000..cb9e0683df7dc3d437f1f2b23a87831b098f41ad Binary files /dev/null and b/shared/package-files/09/09687d2bdaf5f6b8c89dcb365117e5b06e0cc9ae0ad3e1ce949fc02c74d49c1b/blob differ diff --git a/shared/package-files/09/096af33c9365a2c8e1c52717cc81d8650c028ec2e7900800788818ad8f7681b7/blob b/shared/package-files/09/096af33c9365a2c8e1c52717cc81d8650c028ec2e7900800788818ad8f7681b7/blob new file mode 100644 index 0000000000000000000000000000000000000000..1bdf9431fb82674ac53a41f7e86159e41eddb5bd --- /dev/null +++ b/shared/package-files/09/096af33c9365a2c8e1c52717cc81d8650c028ec2e7900800788818ad8f7681b7/blob @@ -0,0 +1,435 @@ +"""Low-level linear systems solver. """ + + +from sympy.utilities.exceptions import sympy_deprecation_warning +from sympy.utilities.iterables import connected_components + +from sympy.core.sympify import sympify +from sympy.core.numbers import Integer, Rational +from sympy.matrices.dense import MutableDenseMatrix +from sympy.polys.domains import ZZ, QQ + +from sympy.polys.domains import EX +from sympy.polys.rings import sring +from sympy.polys.polyerrors import NotInvertible +from sympy.polys.domainmatrix import DomainMatrix + + +class PolyNonlinearError(Exception): + """Raised by solve_lin_sys for nonlinear equations""" + pass + + +class RawMatrix(MutableDenseMatrix): + """ + .. deprecated:: 1.9 + + This class fundamentally is broken by design. Use ``DomainMatrix`` if + you want a matrix over the polys domains or ``Matrix`` for a matrix + with ``Expr`` elements. The ``RawMatrix`` class will be removed/broken + in future in order to reestablish the invariant that the elements of a + Matrix should be of type ``Expr``. + + """ + _sympify = staticmethod(lambda x: x) # type: ignore + + def __init__(self, *args, **kwargs): + sympy_deprecation_warning( + """ + The RawMatrix class is deprecated. Use either DomainMatrix or + Matrix instead. + """, + deprecated_since_version="1.9", + active_deprecations_target="deprecated-rawmatrix", + ) + + domain = ZZ + for i in range(self.rows): + for j in range(self.cols): + val = self[i,j] + if getattr(val, 'is_Poly', False): + K = val.domain[val.gens] + val_sympy = val.as_expr() + elif hasattr(val, 'parent'): + K = val.parent() + val_sympy = K.to_sympy(val) + elif isinstance(val, (int, Integer)): + K = ZZ + val_sympy = sympify(val) + elif isinstance(val, Rational): + K = QQ + val_sympy = val + else: + for K in ZZ, QQ: + if K.of_type(val): + val_sympy = K.to_sympy(val) + break + else: + raise TypeError + domain = domain.unify(K) + self[i,j] = val_sympy + self.ring = domain + + +def eqs_to_matrix(eqs_coeffs, eqs_rhs, gens, domain): + """Get matrix from linear equations in dict format. + + Explanation + =========== + + Get the matrix representation of a system of linear equations represented + as dicts with low-level DomainElement coefficients. This is an + *internal* function that is used by solve_lin_sys. + + Parameters + ========== + + eqs_coeffs: list[dict[Symbol, DomainElement]] + The left hand sides of the equations as dicts mapping from symbols to + coefficients where the coefficients are instances of + DomainElement. + eqs_rhs: list[DomainElements] + The right hand sides of the equations as instances of + DomainElement. + gens: list[Symbol] + The unknowns in the system of equations. + domain: Domain + The domain for coefficients of both lhs and rhs. + + Returns + ======= + + The augmented matrix representation of the system as a DomainMatrix. + + Examples + ======== + + >>> from sympy import symbols, ZZ + >>> from sympy.polys.solvers import eqs_to_matrix + >>> x, y = symbols('x, y') + >>> eqs_coeff = [{x:ZZ(1), y:ZZ(1)}, {x:ZZ(1), y:ZZ(-1)}] + >>> eqs_rhs = [ZZ(0), ZZ(-1)] + >>> eqs_to_matrix(eqs_coeff, eqs_rhs, [x, y], ZZ) + DomainMatrix([[1, 1, 0], [1, -1, 1]], (2, 3), ZZ) + + See also + ======== + + solve_lin_sys: Uses :func:`~eqs_to_matrix` internally + """ + sym2index = {x: n for n, x in enumerate(gens)} + nrows = len(eqs_coeffs) + ncols = len(gens) + 1 + rows = [[domain.zero] * ncols for _ in range(nrows)] + for row, eq_coeff, eq_rhs in zip(rows, eqs_coeffs, eqs_rhs): + for sym, coeff in eq_coeff.items(): + row[sym2index[sym]] = domain.convert(coeff) + row[-1] = -domain.convert(eq_rhs) + + return DomainMatrix(rows, (nrows, ncols), domain) + + +def sympy_eqs_to_ring(eqs, symbols): + """Convert a system of equations from Expr to a PolyRing + + Explanation + =========== + + High-level functions like ``solve`` expect Expr as inputs but can use + ``solve_lin_sys`` internally. This function converts equations from + ``Expr`` to the low-level poly types used by the ``solve_lin_sys`` + function. + + Parameters + ========== + + eqs: List of Expr + A list of equations as Expr instances + symbols: List of Symbol + A list of the symbols that are the unknowns in the system of + equations. + + Returns + ======= + + Tuple[List[PolyElement], Ring]: The equations as PolyElement instances + and the ring of polynomials within which each equation is represented. + + Examples + ======== + + >>> from sympy import symbols + >>> from sympy.polys.solvers import sympy_eqs_to_ring + >>> a, x, y = symbols('a, x, y') + >>> eqs = [x-y, x+a*y] + >>> eqs_ring, ring = sympy_eqs_to_ring(eqs, [x, y]) + >>> eqs_ring + [x - y, x + a*y] + >>> type(eqs_ring[0]) + + >>> ring + ZZ(a)[x,y] + + With the equations in this form they can be passed to ``solve_lin_sys``: + + >>> from sympy.polys.solvers import solve_lin_sys + >>> solve_lin_sys(eqs_ring, ring) + {y: 0, x: 0} + """ + try: + K, eqs_K = sring(eqs, symbols, field=True, extension=True) + except NotInvertible: + # https://github.com/sympy/sympy/issues/18874 + K, eqs_K = sring(eqs, symbols, domain=EX) + return eqs_K, K.to_domain() + + +def solve_lin_sys(eqs, ring, _raw=True): + """Solve a system of linear equations from a PolynomialRing + + Explanation + =========== + + Solves a system of linear equations given as PolyElement instances of a + PolynomialRing. The basic arithmetic is carried out using instance of + DomainElement which is more efficient than :class:`~sympy.core.expr.Expr` + for the most common inputs. + + While this is a public function it is intended primarily for internal use + so its interface is not necessarily convenient. Users are suggested to use + the :func:`sympy.solvers.solveset.linsolve` function (which uses this + function internally) instead. + + Parameters + ========== + + eqs: list[PolyElement] + The linear equations to be solved as elements of a + PolynomialRing (assumed equal to zero). + ring: PolynomialRing + The polynomial ring from which eqs are drawn. The generators of this + ring are the unknowns to be solved for and the domain of the ring is + the domain of the coefficients of the system of equations. + _raw: bool + If *_raw* is False, the keys and values in the returned dictionary + will be of type Expr (and the unit of the field will be removed from + the keys) otherwise the low-level polys types will be returned, e.g. + PolyElement: PythonRational. + + Returns + ======= + + ``None`` if the system has no solution. + + dict[Symbol, Expr] if _raw=False + + dict[Symbol, DomainElement] if _raw=True. + + Examples + ======== + + >>> from sympy import symbols + >>> from sympy.polys.solvers import solve_lin_sys, sympy_eqs_to_ring + >>> x, y = symbols('x, y') + >>> eqs = [x - y, x + y - 2] + >>> eqs_ring, ring = sympy_eqs_to_ring(eqs, [x, y]) + >>> solve_lin_sys(eqs_ring, ring) + {y: 1, x: 1} + + Passing ``_raw=False`` returns the same result except that the keys are + ``Expr`` rather than low-level poly types. + + >>> solve_lin_sys(eqs_ring, ring, _raw=False) + {x: 1, y: 1} + + See also + ======== + + sympy_eqs_to_ring: prepares the inputs to ``solve_lin_sys``. + linsolve: ``linsolve`` uses ``solve_lin_sys`` internally. + sympy.solvers.solvers.solve: ``solve`` uses ``solve_lin_sys`` internally. + """ + as_expr = not _raw + + assert ring.domain.is_Field + + eqs_dict = [dict(eq) for eq in eqs] + + one_monom = ring.one.monoms()[0] + zero = ring.domain.zero + + eqs_rhs = [] + eqs_coeffs = [] + for eq_dict in eqs_dict: + eq_rhs = eq_dict.pop(one_monom, zero) + eq_coeffs = {} + for monom, coeff in eq_dict.items(): + if sum(monom) != 1: + msg = "Nonlinear term encountered in solve_lin_sys" + raise PolyNonlinearError(msg) + eq_coeffs[ring.gens[monom.index(1)]] = coeff + if not eq_coeffs: + if not eq_rhs: + continue + else: + return None + eqs_rhs.append(eq_rhs) + eqs_coeffs.append(eq_coeffs) + + result = _solve_lin_sys(eqs_coeffs, eqs_rhs, ring) + + if result is not None and as_expr: + + def to_sympy(x): + as_expr = getattr(x, 'as_expr', None) + if as_expr: + return as_expr() + else: + return ring.domain.to_sympy(x) + + tresult = {to_sympy(sym): to_sympy(val) for sym, val in result.items()} + + # Remove 1.0x + result = {} + for k, v in tresult.items(): + if k.is_Mul: + c, s = k.as_coeff_Mul() + result[s] = v/c + else: + result[k] = v + + return result + + +def _solve_lin_sys(eqs_coeffs, eqs_rhs, ring): + """Solve a linear system from dict of PolynomialRing coefficients + + Explanation + =========== + + This is an **internal** function used by :func:`solve_lin_sys` after the + equations have been preprocessed. The role of this function is to split + the system into connected components and pass those to + :func:`_solve_lin_sys_component`. + + Examples + ======== + + Setup a system for $x-y=0$ and $x+y=2$ and solve: + + >>> from sympy import symbols, sring + >>> from sympy.polys.solvers import _solve_lin_sys + >>> x, y = symbols('x, y') + >>> R, (xr, yr) = sring([x, y], [x, y]) + >>> eqs = [{xr:R.one, yr:-R.one}, {xr:R.one, yr:R.one}] + >>> eqs_rhs = [R.zero, -2*R.one] + >>> _solve_lin_sys(eqs, eqs_rhs, R) + {y: 1, x: 1} + + See also + ======== + + solve_lin_sys: This function is used internally by :func:`solve_lin_sys`. + """ + V = ring.gens + E = [] + for eq_coeffs in eqs_coeffs: + syms = list(eq_coeffs) + E.extend(zip(syms[:-1], syms[1:])) + G = V, E + + components = connected_components(G) + + sym2comp = {} + for n, component in enumerate(components): + for sym in component: + sym2comp[sym] = n + + subsystems = [([], []) for _ in range(len(components))] + for eq_coeff, eq_rhs in zip(eqs_coeffs, eqs_rhs): + sym = next(iter(eq_coeff), None) + sub_coeff, sub_rhs = subsystems[sym2comp[sym]] + sub_coeff.append(eq_coeff) + sub_rhs.append(eq_rhs) + + sol = {} + for subsystem in subsystems: + subsol = _solve_lin_sys_component(subsystem[0], subsystem[1], ring) + if subsol is None: + return None + sol.update(subsol) + + return sol + + +def _solve_lin_sys_component(eqs_coeffs, eqs_rhs, ring): + """Solve a linear system from dict of PolynomialRing coefficients + + Explanation + =========== + + This is an **internal** function used by :func:`solve_lin_sys` after the + equations have been preprocessed. After :func:`_solve_lin_sys` splits the + system into connected components this function is called for each + component. The system of equations is solved using Gauss-Jordan + elimination with division followed by back-substitution. + + Examples + ======== + + Setup a system for $x-y=0$ and $x+y=2$ and solve: + + >>> from sympy import symbols, sring + >>> from sympy.polys.solvers import _solve_lin_sys_component + >>> x, y = symbols('x, y') + >>> R, (xr, yr) = sring([x, y], [x, y]) + >>> eqs = [{xr:R.one, yr:-R.one}, {xr:R.one, yr:R.one}] + >>> eqs_rhs = [R.zero, -2*R.one] + >>> _solve_lin_sys_component(eqs, eqs_rhs, R) + {y: 1, x: 1} + + See also + ======== + + solve_lin_sys: This function is used internally by :func:`solve_lin_sys`. + """ + + # transform from equations to matrix form + matrix = eqs_to_matrix(eqs_coeffs, eqs_rhs, ring.gens, ring.domain) + + # convert to a field for rref + if not matrix.domain.is_Field: + matrix = matrix.to_field() + + # solve by row-reduction + echelon, pivots = matrix.rref() + + # construct the returnable form of the solutions + keys = ring.gens + + if pivots and pivots[-1] == len(keys): + return None + + if len(pivots) == len(keys): + sol = [] + for s in [row[-1] for row in echelon.rep.to_ddm()]: + a = s + sol.append(a) + sols = dict(zip(keys, sol)) + else: + sols = {} + g = ring.gens + # Extract ground domain coefficients and convert to the ring: + if hasattr(ring, 'ring'): + convert = ring.ring.ground_new + else: + convert = ring.ground_new + echelon = echelon.rep.to_ddm() + vals_set = {v for row in echelon for v in row} + vals_map = {v: convert(v) for v in vals_set} + echelon = [[vals_map[eij] for eij in ei] for ei in echelon] + for i, p in enumerate(pivots): + v = echelon[i][-1] - sum(echelon[i][j]*g[j] for j in range(p+1, len(g)) if echelon[i][j]) + sols[keys[p]] = v + + return sols diff --git a/shared/package-files/09/096ba81c1aaa3dd17d02a21843bfddb40f3b6b540e62541b69134a8bf58c1480/blob b/shared/package-files/09/096ba81c1aaa3dd17d02a21843bfddb40f3b6b540e62541b69134a8bf58c1480/blob new file mode 100644 index 0000000000000000000000000000000000000000..8c2672218f273c6ff39ae0a0b9c86f21879e45f3 --- /dev/null +++ b/shared/package-files/09/096ba81c1aaa3dd17d02a21843bfddb40f3b6b540e62541b69134a8bf58c1480/blob @@ -0,0 +1,59 @@ +import numpy as np +import pytest + +import pandas as pd +import pandas._testing as tm + + +def test_astype(using_infer_string): + # with missing values + arr = pd.array([True, False, None], dtype="boolean") + + with pytest.raises(ValueError, match="cannot convert NA to integer"): + arr.astype("int64") + + with pytest.raises(ValueError, match="cannot convert float NaN to"): + arr.astype("bool") + + result = arr.astype("float64") + expected = np.array([1, 0, np.nan], dtype="float64") + tm.assert_numpy_array_equal(result, expected) + + result = arr.astype("str") + if using_infer_string: + expected = pd.array( + ["True", "False", None], dtype=pd.StringDtype(na_value=np.nan) + ) + tm.assert_extension_array_equal(result, expected) + else: + expected = np.array(["True", "False", ""], dtype=f"{tm.ENDIAN}U5") + tm.assert_numpy_array_equal(result, expected) + + # no missing values + arr = pd.array([True, False, True], dtype="boolean") + result = arr.astype("int64") + expected = np.array([1, 0, 1], dtype="int64") + tm.assert_numpy_array_equal(result, expected) + + result = arr.astype("bool") + expected = np.array([True, False, True], dtype="bool") + tm.assert_numpy_array_equal(result, expected) + + +def test_astype_to_boolean_array(): + # astype to BooleanArray + arr = pd.array([True, False, None], dtype="boolean") + + result = arr.astype("boolean") + tm.assert_extension_array_equal(result, arr) + result = arr.astype(pd.BooleanDtype()) + tm.assert_extension_array_equal(result, arr) + + +def test_astype_to_integer_array(): + # astype to IntegerArray + arr = pd.array([True, False, None], dtype="boolean") + + result = arr.astype("Int64") + expected = pd.array([1, 0, None], dtype="Int64") + tm.assert_extension_array_equal(result, expected) diff --git a/shared/package-files/09/096e3387c4666e870875abb77101e69b8fe1b1c36f4b3d5e11d7627222de23a0/blob b/shared/package-files/09/096e3387c4666e870875abb77101e69b8fe1b1c36f4b3d5e11d7627222de23a0/blob new file mode 100644 index 0000000000000000000000000000000000000000..b32751d6e2493ab6a81f5a7f91a572553201f466 --- /dev/null +++ b/shared/package-files/09/096e3387c4666e870875abb77101e69b8fe1b1c36f4b3d5e11d7627222de23a0/blob @@ -0,0 +1,3 @@ +from .rearrange import rearrange + +__all__ = ["rearrange"] diff --git a/shared/package-files/09/097216cf659e1afde4ca842c3010ce3b49b7c85f4cfe92b5122857974d70d1bc/blob b/shared/package-files/09/097216cf659e1afde4ca842c3010ce3b49b7c85f4cfe92b5122857974d70d1bc/blob new file mode 100644 index 0000000000000000000000000000000000000000..df4f4afadf96bfb30c5eb62f2b9301994cc395fd --- /dev/null +++ b/shared/package-files/09/097216cf659e1afde4ca842c3010ce3b49b7c85f4cfe92b5122857974d70d1bc/blob @@ -0,0 +1,813 @@ +#### MATPLOTLIBRC FORMAT + +## NOTE FOR END USERS: DO NOT EDIT THIS FILE! +## +## This is a sample Matplotlib configuration file - you can find a copy +## of it on your system in site-packages/matplotlib/mpl-data/matplotlibrc +## (relative to your Python installation location). +## DO NOT EDIT IT! +## +## If you wish to change your default style, copy this file to one of the +## following locations: +## Unix/Linux: +## $HOME/.config/matplotlib/matplotlibrc OR +## $XDG_CONFIG_HOME/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is set) +## Other platforms: +## $HOME/.matplotlib/matplotlibrc +## and edit that copy. +## +## See https://matplotlib.org/stable/users/explain/customizing.html#customizing-with-matplotlibrc-files +## for more details on the paths which are checked for the configuration file. +## +## Blank lines, or lines starting with a comment symbol, are ignored, as are +## trailing comments. Other lines must have the format: +## key: val # optional comment +## +## Formatting: Use PEP8-like style (as enforced in the rest of the codebase). +## All lines start with an additional '#', so that removing all leading '#'s +## yields a valid style file. +## +## Colors: for the color values below, you can either use +## - a Matplotlib color string, such as r, k, or b +## - an RGB tuple, such as (1.0, 0.5, 0.0) +## - a double-quoted hex string, such as "#ff00ff". +## The unquoted string ff00ff is also supported for backward +## compatibility, but is discouraged. +## - a scalar grayscale intensity such as 0.75 +## - a legal html color name, e.g., red, blue, darkslategray +## +## String values may optionally be enclosed in double quotes, which allows +## using the comment character # in the string. +## +## This file (and other style files) must be encoded as utf-8. +## +## Matplotlib configuration are currently divided into following parts: +## - BACKENDS +## - LINES +## - PATCHES +## - HATCHES +## - BOXPLOT +## - FONT +## - TEXT +## - LaTeX +## - AXES +## - DATES +## - TICKS +## - GRIDS +## - LEGEND +## - FIGURE +## - IMAGES +## - CONTOUR PLOTS +## - ERRORBAR PLOTS +## - HISTOGRAM PLOTS +## - SCATTER PLOTS +## - AGG RENDERING +## - PATHS +## - SAVING FIGURES +## - INTERACTIVE KEYMAPS +## - ANIMATION + +##### CONFIGURATION BEGINS HERE + + +## *************************************************************************** +## * BACKENDS * +## *************************************************************************** +## The default backend. If you omit this parameter, the first working +## backend from the following list is used: +## MacOSX QtAgg Gtk4Agg Gtk3Agg TkAgg WxAgg Agg +## Other choices include: +## QtCairo GTK4Cairo GTK3Cairo TkCairo WxCairo Cairo +## Qt5Agg Qt5Cairo Wx # deprecated. +## PS PDF SVG Template +## You can also deploy your own backend outside of Matplotlib by referring to +## the module name (which must be in the PYTHONPATH) as 'module://my_backend'. +##backend: Agg + +## The port to use for the web server in the WebAgg backend. +#webagg.port: 8988 + +## The address on which the WebAgg web server should be reachable +#webagg.address: 127.0.0.1 + +## If webagg.port is unavailable, a number of other random ports will +## be tried until one that is available is found. +#webagg.port_retries: 50 + +## When True, open the web browser to the plot that is shown +#webagg.open_in_browser: True + +## If you are running pyplot inside a GUI and your backend choice +## conflicts, we will automatically try to find a compatible one for +## you if backend_fallback is True +#backend_fallback: True + +#interactive: False +#figure.hooks: # list of dotted.module.name:dotted.callable.name +#toolbar: toolbar2 # {None, toolbar2, toolmanager} +#timezone: UTC # a pytz timezone string, e.g., US/Central or Europe/Paris + + +## *************************************************************************** +## * LINES * +## *************************************************************************** +## See https://matplotlib.org/stable/api/artist_api.html#module-matplotlib.lines +## for more information on line properties. +#lines.linewidth: 1.5 # line width in points +#lines.linestyle: - # solid line +#lines.color: C0 # has no affect on plot(); see axes.prop_cycle +#lines.marker: None # the default marker +#lines.markerfacecolor: auto # the default marker face color +#lines.markeredgecolor: auto # the default marker edge color +#lines.markeredgewidth: 1.0 # the line width around the marker symbol +#lines.markersize: 6 # marker size, in points +#lines.dash_joinstyle: round # {miter, round, bevel} +#lines.dash_capstyle: butt # {butt, round, projecting} +#lines.solid_joinstyle: round # {miter, round, bevel} +#lines.solid_capstyle: projecting # {butt, round, projecting} +#lines.antialiased: True # render lines in antialiased (no jaggies) + +## The three standard dash patterns. These are scaled by the linewidth. +#lines.dashed_pattern: 3.7, 1.6 +#lines.dashdot_pattern: 6.4, 1.6, 1, 1.6 +#lines.dotted_pattern: 1, 1.65 +#lines.scale_dashes: True + +#markers.fillstyle: full # {full, left, right, bottom, top, none} + +#pcolor.shading: auto +#pcolormesh.snap: True # Whether to snap the mesh to pixel boundaries. This is + # provided solely to allow old test images to remain + # unchanged. Set to False to obtain the previous behavior. + +## *************************************************************************** +## * PATCHES * +## *************************************************************************** +## Patches are graphical objects that fill 2D space, like polygons or circles. +## See https://matplotlib.org/stable/api/artist_api.html#module-matplotlib.patches +## for more information on patch properties. +#patch.linewidth: 1.0 # edge width in points. +#patch.facecolor: C0 +#patch.edgecolor: black # By default, Patches and Collections do not draw edges. + # This value is only used if facecolor is "none" + # (an Artist without facecolor and edgecolor would be + # invisible) or if patch.force_edgecolor is True. +#patch.force_edgecolor: False # By default, Patches and Collections do not draw edges. + # Set this to True to draw edges with patch.edgedcolor + # as the default edgecolor. + # This is mainly relevant for styles. +#patch.antialiased: True # render patches in antialiased (no jaggies) + + +## *************************************************************************** +## * HATCHES * +## *************************************************************************** +#hatch.color: black +#hatch.linewidth: 1.0 + + +## *************************************************************************** +## * BOXPLOT * +## *************************************************************************** +#boxplot.notch: False +#boxplot.vertical: True +#boxplot.whiskers: 1.5 +#boxplot.bootstrap: None +#boxplot.patchartist: False +#boxplot.showmeans: False +#boxplot.showcaps: True +#boxplot.showbox: True +#boxplot.showfliers: True +#boxplot.meanline: False + +#boxplot.flierprops.color: black +#boxplot.flierprops.marker: o +#boxplot.flierprops.markerfacecolor: none +#boxplot.flierprops.markeredgecolor: black +#boxplot.flierprops.markeredgewidth: 1.0 +#boxplot.flierprops.markersize: 6 +#boxplot.flierprops.linestyle: none +#boxplot.flierprops.linewidth: 1.0 + +#boxplot.boxprops.color: black +#boxplot.boxprops.linewidth: 1.0 +#boxplot.boxprops.linestyle: - + +#boxplot.whiskerprops.color: black +#boxplot.whiskerprops.linewidth: 1.0 +#boxplot.whiskerprops.linestyle: - + +#boxplot.capprops.color: black +#boxplot.capprops.linewidth: 1.0 +#boxplot.capprops.linestyle: - + +#boxplot.medianprops.color: C1 +#boxplot.medianprops.linewidth: 1.0 +#boxplot.medianprops.linestyle: - + +#boxplot.meanprops.color: C2 +#boxplot.meanprops.marker: ^ +#boxplot.meanprops.markerfacecolor: C2 +#boxplot.meanprops.markeredgecolor: C2 +#boxplot.meanprops.markersize: 6 +#boxplot.meanprops.linestyle: -- +#boxplot.meanprops.linewidth: 1.0 + + +## *************************************************************************** +## * FONT * +## *************************************************************************** +## The font properties used by `text.Text`. +## See https://matplotlib.org/stable/api/font_manager_api.html for more information +## on font properties. The 6 font properties used for font matching are +## given below with their default values. +## +## The font.family property can take either a single or multiple entries of any +## combination of concrete font names (not supported when rendering text with +## usetex) or the following five generic values: +## - 'serif' (e.g., Times), +## - 'sans-serif' (e.g., Helvetica), +## - 'cursive' (e.g., Zapf-Chancery), +## - 'fantasy' (e.g., Western), and +## - 'monospace' (e.g., Courier). +## Each of these values has a corresponding default list of font names +## (font.serif, etc.); the first available font in the list is used. Note that +## for font.serif, font.sans-serif, and font.monospace, the first element of +## the list (a DejaVu font) will always be used because DejaVu is shipped with +## Matplotlib and is thus guaranteed to be available; the other entries are +## left as examples of other possible values. +## +## The font.style property has three values: normal (or roman), italic +## or oblique. The oblique style will be used for italic, if it is not +## present. +## +## The font.variant property has two values: normal or small-caps. For +## TrueType fonts, which are scalable fonts, small-caps is equivalent +## to using a font size of 'smaller', or about 83 % of the current font +## size. +## +## The font.weight property has effectively 13 values: normal, bold, +## bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as +## 400, and bold is 700. bolder and lighter are relative values with +## respect to the current weight. +## +## The font.stretch property has 11 values: ultra-condensed, +## extra-condensed, condensed, semi-condensed, normal, semi-expanded, +## expanded, extra-expanded, ultra-expanded, wider, and narrower. This +## property is not currently implemented. +## +## The font.size property is the default font size for text, given in points. +## 10 pt is the standard value. +## +## Note that font.size controls default text sizes. To configure +## special text sizes tick labels, axes, labels, title, etc., see the rc +## settings for axes and ticks. Special text sizes can be defined +## relative to font.size, using the following values: xx-small, x-small, +## small, medium, large, x-large, xx-large, larger, or smaller + +#font.family: sans-serif +#font.style: normal +#font.variant: normal +#font.weight: normal +#font.stretch: normal +#font.size: 10.0 + +#font.serif: DejaVu Serif, Bitstream Vera Serif, Computer Modern Roman, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif +#font.sans-serif: DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif +#font.cursive: Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, Comic Neue, Comic Sans MS, cursive +#font.fantasy: Chicago, Charcoal, Impact, Western, xkcd script, fantasy +#font.monospace: DejaVu Sans Mono, Bitstream Vera Sans Mono, Computer Modern Typewriter, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace + + +## *************************************************************************** +## * TEXT * +## *************************************************************************** +## The text properties used by `text.Text`. +## See https://matplotlib.org/stable/api/artist_api.html#module-matplotlib.text +## for more information on text properties +#text.color: black + +## FreeType hinting flag ("foo" corresponds to FT_LOAD_FOO); may be one of the +## following (Proprietary Matplotlib-specific synonyms are given in parentheses, +## but their use is discouraged): +## - default: Use the font's native hinter if possible, else FreeType's auto-hinter. +## ("either" is a synonym). +## - no_autohint: Use the font's native hinter if possible, else don't hint. +## ("native" is a synonym.) +## - force_autohint: Use FreeType's auto-hinter. ("auto" is a synonym.) +## - no_hinting: Disable hinting. ("none" is a synonym.) +#text.hinting: force_autohint + +#text.hinting_factor: 8 # Specifies the amount of softness for hinting in the + # horizontal direction. A value of 1 will hint to full + # pixels. A value of 2 will hint to half pixels etc. +#text.kerning_factor: 0 # Specifies the scaling factor for kerning values. This + # is provided solely to allow old test images to remain + # unchanged. Set to 6 to obtain previous behavior. + # Values other than 0 or 6 have no defined meaning. +#text.antialiased: True # If True (default), the text will be antialiased. + # This only affects raster outputs. +#text.parse_math: True # Use mathtext if there is an even number of unescaped + # dollar signs. + + +## *************************************************************************** +## * LaTeX * +## *************************************************************************** +## For more information on LaTeX properties, see +## https://matplotlib.org/stable/users/explain/text/usetex.html +#text.usetex: False # use latex for all text handling. The following fonts + # are supported through the usual rc parameter settings: + # new century schoolbook, bookman, times, palatino, + # zapf chancery, charter, serif, sans-serif, helvetica, + # avant garde, courier, monospace, computer modern roman, + # computer modern sans serif, computer modern typewriter +#text.latex.preamble: # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES + # AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP + # IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO. + # text.latex.preamble is a single line of LaTeX code that + # will be passed on to the LaTeX system. It may contain + # any code that is valid for the LaTeX "preamble", i.e. + # between the "\documentclass" and "\begin{document}" + # statements. + # Note that it has to be put on a single line, which may + # become quite long. + # The following packages are always loaded with usetex, + # so beware of package collisions: + # geometry, inputenc, type1cm. + # PostScript (PSNFSS) font packages may also be + # loaded, depending on your font settings. + +## The following settings allow you to select the fonts in math mode. +#mathtext.fontset: dejavusans # Should be 'dejavusans' (default), + # 'dejavuserif', 'cm' (Computer Modern), 'stix', + # 'stixsans' or 'custom' +## "mathtext.fontset: custom" is defined by the mathtext.bf, .cal, .it, ... +## settings which map a TeX font name to a fontconfig font pattern. (These +## settings are not used for other font sets.) +#mathtext.bf: sans:bold +#mathtext.bfit: sans:italic:bold +#mathtext.cal: cursive +#mathtext.it: sans:italic +#mathtext.rm: sans +#mathtext.sf: sans +#mathtext.tt: monospace +#mathtext.fallback: cm # Select fallback font from ['cm' (Computer Modern), 'stix' + # 'stixsans'] when a symbol cannot be found in one of the + # custom math fonts. Select 'None' to not perform fallback + # and replace the missing character by a dummy symbol. +#mathtext.default: it # The default font to use for math. + # Can be any of the LaTeX font names, including + # the special name "regular" for the same font + # used in regular text. + + +## *************************************************************************** +## * AXES * +## *************************************************************************** +## Following are default face and edge colors, default tick sizes, +## default font sizes for tick labels, and so on. See +## https://matplotlib.org/stable/api/axes_api.html#module-matplotlib.axes +#axes.facecolor: white # axes background color +#axes.edgecolor: black # axes edge color +#axes.linewidth: 0.8 # edge line width +#axes.grid: False # display grid or not +#axes.grid.axis: both # which axis the grid should apply to +#axes.grid.which: major # grid lines at {major, minor, both} ticks +#axes.titlelocation: center # alignment of the title: {left, right, center} +#axes.titlesize: large # font size of the axes title +#axes.titleweight: normal # font weight of title +#axes.titlecolor: auto # color of the axes title, auto falls back to + # text.color as default value +#axes.titley: None # position title (axes relative units). None implies auto +#axes.titlepad: 6.0 # pad between axes and title in points +#axes.labelsize: medium # font size of the x and y labels +#axes.labelpad: 4.0 # space between label and axis +#axes.labelweight: normal # weight of the x and y labels +#axes.labelcolor: black +#axes.axisbelow: line # draw axis gridlines and ticks: + # - below patches (True) + # - above patches but below lines ('line') + # - above all (False) + +#axes.formatter.limits: -5, 6 # use scientific notation if log10 + # of the axis range is smaller than the + # first or larger than the second +#axes.formatter.use_locale: False # When True, format tick labels + # according to the user's locale. + # For example, use ',' as a decimal + # separator in the fr_FR locale. +#axes.formatter.use_mathtext: False # When True, use mathtext for scientific + # notation. +#axes.formatter.min_exponent: 0 # minimum exponent to format in scientific notation +#axes.formatter.useoffset: True # If True, the tick label formatter + # will default to labeling ticks relative + # to an offset when the data range is + # small compared to the minimum absolute + # value of the data. +#axes.formatter.offset_threshold: 4 # When useoffset is True, the offset + # will be used when it can remove + # at least this number of significant + # digits from tick labels. + +#axes.spines.left: True # display axis spines +#axes.spines.bottom: True +#axes.spines.top: True +#axes.spines.right: True + +#axes.unicode_minus: True # use Unicode for the minus symbol rather than hyphen. See + # https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes +#axes.prop_cycle: cycler('color', ['1f77b4', 'ff7f0e', '2ca02c', 'd62728', '9467bd', '8c564b', 'e377c2', '7f7f7f', 'bcbd22', '17becf']) + # color cycle for plot lines as list of string color specs: + # single letter, long name, or web-style hex + # As opposed to all other parameters in this file, the color + # values must be enclosed in quotes for this parameter, + # e.g. '1f77b4', instead of 1f77b4. + # See also https://matplotlib.org/stable/users/explain/artists/color_cycle.html + # for more details on prop_cycle usage. +#axes.xmargin: .05 # x margin. See `axes.Axes.margins` +#axes.ymargin: .05 # y margin. See `axes.Axes.margins` +#axes.zmargin: .05 # z margin. See `axes.Axes.margins` +#axes.autolimit_mode: data # If "data", use axes.xmargin and axes.ymargin as is. + # If "round_numbers", after application of margins, axis + # limits are further expanded to the nearest "round" number. +#polaraxes.grid: True # display grid on polar axes +#axes3d.grid: True # display grid on 3D axes +#axes3d.automargin: False # automatically add margin when manually setting 3D axis limits + +#axes3d.xaxis.panecolor: (0.95, 0.95, 0.95, 0.5) # background pane on 3D axes +#axes3d.yaxis.panecolor: (0.90, 0.90, 0.90, 0.5) # background pane on 3D axes +#axes3d.zaxis.panecolor: (0.925, 0.925, 0.925, 0.5) # background pane on 3D axes + +#axes3d.mouserotationstyle: arcball # {azel, trackball, sphere, arcball} + # See also https://matplotlib.org/stable/api/toolkits/mplot3d/view_angles.html#rotation-with-mouse +#axes3d.trackballsize: 0.667 # trackball diameter, in units of the Axes bbox +#axes3d.trackballborder: 0.2 # trackball border width, in units of the Axes bbox (only for 'sphere' and 'arcball' style) + +## *************************************************************************** +## * AXIS * +## *************************************************************************** +#xaxis.labellocation: center # alignment of the xaxis label: {left, right, center} +#yaxis.labellocation: center # alignment of the yaxis label: {bottom, top, center} + + +## *************************************************************************** +## * DATES * +## *************************************************************************** +## These control the default format strings used in AutoDateFormatter. +## Any valid format datetime format string can be used (see the python +## `datetime` for details). For example, by using: +## - '%x' will use the locale date representation +## - '%X' will use the locale time representation +## - '%c' will use the full locale datetime representation +## These values map to the scales: +## {'year': 365, 'month': 30, 'day': 1, 'hour': 1/24, 'minute': 1 / (24 * 60)} + +#date.autoformatter.year: %Y +#date.autoformatter.month: %Y-%m +#date.autoformatter.day: %Y-%m-%d +#date.autoformatter.hour: %m-%d %H +#date.autoformatter.minute: %d %H:%M +#date.autoformatter.second: %H:%M:%S +#date.autoformatter.microsecond: %M:%S.%f +## The reference date for Matplotlib's internal date representation +## See https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html +#date.epoch: 1970-01-01T00:00:00 +## 'auto', 'concise': +#date.converter: auto +## For auto converter whether to use interval_multiples: +#date.interval_multiples: True + +## *************************************************************************** +## * TICKS * +## *************************************************************************** +## See https://matplotlib.org/stable/api/axis_api.html#matplotlib.axis.Tick +#xtick.top: False # draw ticks on the top side +#xtick.bottom: True # draw ticks on the bottom side +#xtick.labeltop: False # draw label on the top +#xtick.labelbottom: True # draw label on the bottom +#xtick.major.size: 3.5 # major tick size in points +#xtick.minor.size: 2 # minor tick size in points +#xtick.major.width: 0.8 # major tick width in points +#xtick.minor.width: 0.6 # minor tick width in points +#xtick.major.pad: 3.5 # distance to major tick label in points +#xtick.minor.pad: 3.4 # distance to the minor tick label in points +#xtick.color: black # color of the ticks +#xtick.labelcolor: inherit # color of the tick labels or inherit from xtick.color +#xtick.labelsize: medium # font size of the tick labels +#xtick.direction: out # direction: {in, out, inout} +#xtick.minor.visible: False # visibility of minor ticks on x-axis +#xtick.major.top: True # draw x axis top major ticks +#xtick.major.bottom: True # draw x axis bottom major ticks +#xtick.minor.top: True # draw x axis top minor ticks +#xtick.minor.bottom: True # draw x axis bottom minor ticks +#xtick.minor.ndivs: auto # number of minor ticks between the major ticks on x-axis +#xtick.alignment: center # alignment of xticks + +#ytick.left: True # draw ticks on the left side +#ytick.right: False # draw ticks on the right side +#ytick.labelleft: True # draw tick labels on the left side +#ytick.labelright: False # draw tick labels on the right side +#ytick.major.size: 3.5 # major tick size in points +#ytick.minor.size: 2 # minor tick size in points +#ytick.major.width: 0.8 # major tick width in points +#ytick.minor.width: 0.6 # minor tick width in points +#ytick.major.pad: 3.5 # distance to major tick label in points +#ytick.minor.pad: 3.4 # distance to the minor tick label in points +#ytick.color: black # color of the ticks +#ytick.labelcolor: inherit # color of the tick labels or inherit from ytick.color +#ytick.labelsize: medium # font size of the tick labels +#ytick.direction: out # direction: {in, out, inout} +#ytick.minor.visible: False # visibility of minor ticks on y-axis +#ytick.major.left: True # draw y axis left major ticks +#ytick.major.right: True # draw y axis right major ticks +#ytick.minor.left: True # draw y axis left minor ticks +#ytick.minor.right: True # draw y axis right minor ticks +#ytick.minor.ndivs: auto # number of minor ticks between the major ticks on y-axis +#ytick.alignment: center_baseline # alignment of yticks + + +## *************************************************************************** +## * GRIDS * +## *************************************************************************** +#grid.color: "#b0b0b0" # grid color +#grid.linestyle: - # solid +#grid.linewidth: 0.8 # in points +#grid.alpha: 1.0 # transparency, between 0.0 and 1.0 + + +## *************************************************************************** +## * LEGEND * +## *************************************************************************** +#legend.loc: best +#legend.frameon: True # if True, draw the legend on a background patch +#legend.framealpha: 0.8 # legend patch transparency +#legend.facecolor: inherit # inherit from axes.facecolor; or color spec +#legend.edgecolor: 0.8 # background patch boundary color +#legend.fancybox: True # if True, use a rounded box for the + # legend background, else a rectangle +#legend.shadow: False # if True, give background a shadow effect +#legend.numpoints: 1 # the number of marker points in the legend line +#legend.scatterpoints: 1 # number of scatter points +#legend.markerscale: 1.0 # the relative size of legend markers vs. original +#legend.fontsize: medium +#legend.labelcolor: None +#legend.title_fontsize: None # None sets to the same as the default axes. + +## Dimensions as fraction of font size: +#legend.borderpad: 0.4 # border whitespace +#legend.labelspacing: 0.5 # the vertical space between the legend entries +#legend.handlelength: 2.0 # the length of the legend lines +#legend.handleheight: 0.7 # the height of the legend handle +#legend.handletextpad: 0.8 # the space between the legend line and legend text +#legend.borderaxespad: 0.5 # the border between the axes and legend edge +#legend.columnspacing: 2.0 # column separation + + +## *************************************************************************** +## * FIGURE * +## *************************************************************************** +## See https://matplotlib.org/stable/api/figure_api.html#matplotlib.figure.Figure +#figure.titlesize: large # size of the figure title (``Figure.suptitle()``) +#figure.titleweight: normal # weight of the figure title +#figure.labelsize: large # size of the figure label (``Figure.sup[x|y]label()``) +#figure.labelweight: normal # weight of the figure label +#figure.figsize: 6.4, 4.8 # figure size in inches +#figure.dpi: 100 # figure dots per inch +#figure.facecolor: white # figure face color +#figure.edgecolor: white # figure edge color +#figure.frameon: True # enable figure frame +#figure.max_open_warning: 20 # The maximum number of figures to open through + # the pyplot interface before emitting a warning. + # If less than one this feature is disabled. +#figure.raise_window : True # Raise the GUI window to front when show() is called. + +## The figure subplot parameters. All dimensions are a fraction of the figure width and height. +#figure.subplot.left: 0.125 # the left side of the subplots of the figure +#figure.subplot.right: 0.9 # the right side of the subplots of the figure +#figure.subplot.bottom: 0.11 # the bottom of the subplots of the figure +#figure.subplot.top: 0.88 # the top of the subplots of the figure +#figure.subplot.wspace: 0.2 # the amount of width reserved for space between subplots, + # expressed as a fraction of the average axis width +#figure.subplot.hspace: 0.2 # the amount of height reserved for space between subplots, + # expressed as a fraction of the average axis height + +## Figure layout +#figure.autolayout: False # When True, automatically adjust subplot + # parameters to make the plot fit the figure + # using `tight_layout` +#figure.constrained_layout.use: False # When True, automatically make plot + # elements fit on the figure. (Not + # compatible with `autolayout`, above). +## Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points. +#figure.constrained_layout.h_pad: 0.04167 +#figure.constrained_layout.w_pad: 0.04167 +## Spacing between subplots, relative to the subplot sizes. Much smaller than for +## tight_layout (figure.subplot.hspace, figure.subplot.wspace) as constrained_layout +## already takes surrounding texts (titles, labels, # ticklabels) into account. +#figure.constrained_layout.hspace: 0.02 +#figure.constrained_layout.wspace: 0.02 + + +## *************************************************************************** +## * IMAGES * +## *************************************************************************** +#image.aspect: equal # {equal, auto} or a number +#image.interpolation: auto # see help(imshow) for options +#image.interpolation_stage: auto # see help(imshow) for options +#image.cmap: viridis # A colormap name (plasma, magma, etc.) +#image.lut: 256 # the size of the colormap lookup table +#image.origin: upper # {lower, upper} +#image.resample: True +#image.composite_image: True # When True, all the images on a set of axes are + # combined into a single composite image before + # saving a figure as a vector graphics file, + # such as a PDF. + + +## *************************************************************************** +## * CONTOUR PLOTS * +## *************************************************************************** +#contour.negative_linestyle: dashed # string or on-off ink sequence +#contour.corner_mask: True # {True, False} +#contour.linewidth: None # {float, None} Size of the contour line + # widths. If set to None, it falls back to + # `line.linewidth`. +#contour.algorithm: mpl2014 # {mpl2005, mpl2014, serial, threaded} + + +## *************************************************************************** +## * ERRORBAR PLOTS * +## *************************************************************************** +#errorbar.capsize: 0 # length of end cap on error bars in pixels + + +## *************************************************************************** +## * HISTOGRAM PLOTS * +## *************************************************************************** +#hist.bins: 10 # The default number of histogram bins or 'auto'. + + +## *************************************************************************** +## * SCATTER PLOTS * +## *************************************************************************** +#scatter.marker: o # The default marker type for scatter plots. +#scatter.edgecolors: face # The default edge colors for scatter plots. + + +## *************************************************************************** +## * AGG RENDERING * +## *************************************************************************** +## Warning: experimental, 2008/10/10 +#agg.path.chunksize: 0 # 0 to disable; values in the range + # 10000 to 100000 can improve speed slightly + # and prevent an Agg rendering failure + # when plotting very large data sets, + # especially if they are very gappy. + # It may cause minor artifacts, though. + # A value of 20000 is probably a good + # starting point. + + +## *************************************************************************** +## * PATHS * +## *************************************************************************** +#path.simplify: True # When True, simplify paths by removing "invisible" + # points to reduce file size and increase rendering + # speed +#path.simplify_threshold: 0.111111111111 # The threshold of similarity below + # which vertices will be removed in + # the simplification process. +#path.snap: True # When True, rectilinear axis-aligned paths will be snapped + # to the nearest pixel when certain criteria are met. + # When False, paths will never be snapped. +#path.sketch: None # May be None, or a tuple of the form: + # path.sketch: (scale, length, randomness) + # - *scale* is the amplitude of the wiggle + # perpendicular to the line (in pixels). + # - *length* is the length of the wiggle along the + # line (in pixels). + # - *randomness* is the factor by which the length is + # randomly scaled. +#path.effects: + + +## *************************************************************************** +## * SAVING FIGURES * +## *************************************************************************** +## The default savefig parameters can be different from the display parameters +## e.g., you may want a higher resolution, or to make the figure +## background white +#savefig.dpi: figure # figure dots per inch or 'figure' +#savefig.facecolor: auto # figure face color when saving +#savefig.edgecolor: auto # figure edge color when saving +#savefig.format: png # {png, ps, pdf, svg} +#savefig.bbox: standard # {tight, standard} + # 'tight' is incompatible with generating frames + # for animation +#savefig.pad_inches: 0.1 # padding to be used, when bbox is set to 'tight' +#savefig.directory: ~ # default directory in savefig dialog, gets updated after + # interactive saves, unless set to the empty string (i.e. + # the current directory); use '.' to start at the current + # directory but update after interactive saves +#savefig.transparent: False # whether figures are saved with a transparent + # background by default +#savefig.orientation: portrait # orientation of saved figure, for PostScript output only + +### macosx backend params +#macosx.window_mode : system # How to open new figures (system, tab, window) + # system uses the MacOS system preferences + +### tk backend params +#tk.window_focus: False # Maintain shell focus for TkAgg + +### ps backend params +#ps.papersize: letter # {figure, letter, legal, ledger, A0-A10, B0-B10} +#ps.useafm: False # use AFM fonts, results in small files +#ps.usedistiller: False # {ghostscript, xpdf, None} + # Experimental: may produce smaller files. + # xpdf intended for production of publication quality files, + # but requires ghostscript, xpdf and ps2eps +#ps.distiller.res: 6000 # dpi +#ps.fonttype: 3 # Output Type 3 (Type3) or Type 42 (TrueType) + +### PDF backend params +#pdf.compression: 6 # integer from 0 to 9 + # 0 disables compression (good for debugging) +#pdf.fonttype: 3 # Output Type 3 (Type3) or Type 42 (TrueType) +#pdf.use14corefonts: False +#pdf.inheritcolor: False + +### SVG backend params +#svg.image_inline: True # Write raster image data directly into the SVG file +#svg.fonttype: path # How to handle SVG fonts: + # path: Embed characters as paths -- supported + # by most SVG renderers + # None: Assume fonts are installed on the + # machine where the SVG will be viewed. +#svg.hashsalt: None # If not None, use this string as hash salt instead of uuid4 +#svg.id: None # If not None, use this string as the value for the `id` + # attribute in the top tag + +### pgf parameter +## See https://matplotlib.org/stable/tutorials/text/pgf.html for more information. +#pgf.rcfonts: True +#pgf.preamble: # See text.latex.preamble for documentation +#pgf.texsystem: xelatex + +### docstring params +#docstring.hardcopy: False # set this when you want to generate hardcopy docstring + + +## *************************************************************************** +## * INTERACTIVE KEYMAPS * +## *************************************************************************** +## Event keys to interact with figures/plots via keyboard. +## See https://matplotlib.org/stable/users/explain/interactive.html for more +## details on interactive navigation. Customize these settings according to +## your needs. Leave the field(s) empty if you don't need a key-map. (i.e., +## fullscreen : '') +#keymap.fullscreen: f, ctrl+f # toggling +#keymap.home: h, r, home # home or reset mnemonic +#keymap.back: left, c, backspace, MouseButton.BACK # forward / backward keys +#keymap.forward: right, v, MouseButton.FORWARD # for quick navigation +#keymap.pan: p # pan mnemonic +#keymap.zoom: o # zoom mnemonic +#keymap.save: s, ctrl+s # saving current figure +#keymap.help: f1 # display help about active tools +#keymap.quit: ctrl+w, cmd+w, q # close the current figure +#keymap.quit_all: # close all figures +#keymap.grid: g # switching on/off major grids in current axes +#keymap.grid_minor: G # switching on/off minor grids in current axes +#keymap.yscale: l # toggle scaling of y-axes ('log'/'linear') +#keymap.xscale: k, L # toggle scaling of x-axes ('log'/'linear') +#keymap.copy: ctrl+c, cmd+c # copy figure to clipboard + + +## *************************************************************************** +## * ANIMATION * +## *************************************************************************** +#animation.html: none # How to display the animation as HTML in + # the IPython notebook: + # - 'html5' uses HTML5 video tag + # - 'jshtml' creates a JavaScript animation +#animation.writer: ffmpeg # MovieWriter 'backend' to use +#animation.codec: h264 # Codec to use for writing movie +#animation.bitrate: -1 # Controls size/quality trade-off for movie. + # -1 implies let utility auto-determine +#animation.frame_format: png # Controls frame format used by temp files + +## Path to ffmpeg binary. Unqualified paths are resolved by subprocess.Popen. +#animation.ffmpeg_path: ffmpeg +## Additional arguments to pass to ffmpeg. +#animation.ffmpeg_args: + +## Path to ImageMagick's convert binary. Unqualified paths are resolved by +## subprocess.Popen, except that on Windows, we look up an install of +## ImageMagick in the registry (as convert is also the name of a system tool). +#animation.convert_path: convert +## Additional arguments to pass to convert. +#animation.convert_args: -layers, OptimizePlus +# +#animation.embed_limit: 20.0 # Limit, in MB, of size of base64 encoded + # animation in HTML (i.e. IPython notebook) diff --git a/shared/package-files/09/0975621e605521a74de035ab49d753f653753b559a363a71bdacfe294083f02d/blob b/shared/package-files/09/0975621e605521a74de035ab49d753f653753b559a363a71bdacfe294083f02d/blob new file mode 100644 index 0000000000000000000000000000000000000000..549b569e7356d5a76d5d7a547efe434ccbaba1be --- /dev/null +++ b/shared/package-files/09/0975621e605521a74de035ab49d753f653753b559a363a71bdacfe294083f02d/blob @@ -0,0 +1,25 @@ +from typing import Any + +DEBUG: int +INFO: int +WARN: int +ERROR: int +FATAL: int + +class Log: + def __init__(self, threshold: int = ...) -> None: ... + def log(self, level: int, msg: str, *args: Any) -> None: ... + def debug(self, msg: str, *args: Any) -> None: ... + def info(self, msg: str, *args: Any) -> None: ... + def warn(self, msg: str, *args: Any) -> None: ... + def error(self, msg: str, *args: Any) -> None: ... + def fatal(self, msg: str, *args: Any) -> None: ... + +def log(level: int, msg: str, *args: Any) -> None: ... +def debug(msg: str, *args: Any) -> None: ... +def info(msg: str, *args: Any) -> None: ... +def warn(msg: str, *args: Any) -> None: ... +def error(msg: str, *args: Any) -> None: ... +def fatal(msg: str, *args: Any) -> None: ... +def set_threshold(level: int) -> int: ... +def set_verbosity(v: int) -> None: ... diff --git a/shared/package-files/09/09765b2732153a1295f082dcc6ecb76d3bdc69c0ae7806f24319af0246cf92b9/blob b/shared/package-files/09/09765b2732153a1295f082dcc6ecb76d3bdc69c0ae7806f24319af0246cf92b9/blob new file mode 100644 index 0000000000000000000000000000000000000000..3e1276463db6866665e6a0fe114efc247971b57e --- /dev/null +++ b/shared/package-files/09/09765b2732153a1295f082dcc6ecb76d3bdc69c0ae7806f24319af0246cf92b9/blob @@ -0,0 +1,152 @@ +import dask +from distributed.client import Client, _get_global_client +from distributed.worker import Worker + +from fsspec import filesystem +from fsspec.spec import AbstractBufferedFile, AbstractFileSystem +from fsspec.utils import infer_storage_options + + +def _get_client(client): + if client is None: + return _get_global_client() + elif isinstance(client, Client): + return client + else: + # e.g., connection string + return Client(client) + + +def _in_worker(): + return bool(Worker._instances) + + +class DaskWorkerFileSystem(AbstractFileSystem): + """View files accessible to a worker as any other remote file-system + + When instances are run on the worker, uses the real filesystem. When + run on the client, they call the worker to provide information or data. + + **Warning** this implementation is experimental, and read-only for now. + """ + + def __init__( + self, target_protocol=None, target_options=None, fs=None, client=None, **kwargs + ): + super().__init__(**kwargs) + if not (fs is None) ^ (target_protocol is None): + raise ValueError( + "Please provide one of filesystem instance (fs) or" + " target_protocol, not both" + ) + self.target_protocol = target_protocol + self.target_options = target_options + self.worker = None + self.client = client + self.fs = fs + self._determine_worker() + + @staticmethod + def _get_kwargs_from_urls(path): + so = infer_storage_options(path) + if "host" in so and "port" in so: + return {"client": f"{so['host']}:{so['port']}"} + else: + return {} + + def _determine_worker(self): + if _in_worker(): + self.worker = True + if self.fs is None: + self.fs = filesystem( + self.target_protocol, **(self.target_options or {}) + ) + else: + self.worker = False + self.client = _get_client(self.client) + self.rfs = dask.delayed(self) + + def mkdir(self, *args, **kwargs): + if self.worker: + self.fs.mkdir(*args, **kwargs) + else: + self.rfs.mkdir(*args, **kwargs).compute() + + def rm(self, *args, **kwargs): + if self.worker: + self.fs.rm(*args, **kwargs) + else: + self.rfs.rm(*args, **kwargs).compute() + + def copy(self, *args, **kwargs): + if self.worker: + self.fs.copy(*args, **kwargs) + else: + self.rfs.copy(*args, **kwargs).compute() + + def mv(self, *args, **kwargs): + if self.worker: + self.fs.mv(*args, **kwargs) + else: + self.rfs.mv(*args, **kwargs).compute() + + def ls(self, *args, **kwargs): + if self.worker: + return self.fs.ls(*args, **kwargs) + else: + return self.rfs.ls(*args, **kwargs).compute() + + def _open( + self, + path, + mode="rb", + block_size=None, + autocommit=True, + cache_options=None, + **kwargs, + ): + if self.worker: + return self.fs._open( + path, + mode=mode, + block_size=block_size, + autocommit=autocommit, + cache_options=cache_options, + **kwargs, + ) + else: + return DaskFile( + fs=self, + path=path, + mode=mode, + block_size=block_size, + autocommit=autocommit, + cache_options=cache_options, + **kwargs, + ) + + def fetch_range(self, path, mode, start, end): + if self.worker: + with self._open(path, mode) as f: + f.seek(start) + return f.read(end - start) + else: + return self.rfs.fetch_range(path, mode, start, end).compute() + + +class DaskFile(AbstractBufferedFile): + def __init__(self, mode="rb", **kwargs): + if mode != "rb": + raise ValueError('Remote dask files can only be opened in "rb" mode') + super().__init__(**kwargs) + + def _upload_chunk(self, final=False): + pass + + def _initiate_upload(self): + """Create remote file/upload""" + pass + + def _fetch_range(self, start, end): + """Get the specified set of bytes from remote""" + return self.fs.fetch_range(self.path, self.mode, start, end) diff --git a/shared/package-files/09/0976957e2bf4b5670334f93183c8fbb3505efad787930315b9864b66d3156ac3/blob b/shared/package-files/09/0976957e2bf4b5670334f93183c8fbb3505efad787930315b9864b66d3156ac3/blob new file mode 100644 index 0000000000000000000000000000000000000000..dc163ab30bb0b46d40640e857a37a0c27766c7ce --- /dev/null +++ b/shared/package-files/09/0976957e2bf4b5670334f93183c8fbb3505efad787930315b9864b66d3156ac3/blob @@ -0,0 +1,27 @@ +from typing import Any, Optional, Sequence, Tuple, Type, TypeVar + +from django.db.backends.base.schema import BaseDatabaseSchemaEditor +from django.db.models.base import Model +from django.db.models.query_utils import Q + +_T = TypeVar("_T", bound="BaseConstraint") + +class BaseConstraint: + name: str + def __init__(self, name: str) -> None: ... + def constraint_sql( + self, model: Optional[Type[Model]], schema_editor: Optional[BaseDatabaseSchemaEditor] + ) -> str: ... + def create_sql(self, model: Optional[Type[Model]], schema_editor: Optional[BaseDatabaseSchemaEditor]) -> str: ... + def remove_sql(self, model: Optional[Type[Model]], schema_editor: Optional[BaseDatabaseSchemaEditor]) -> str: ... + def deconstruct(self) -> Any: ... + def clone(self: _T) -> _T: ... + +class CheckConstraint(BaseConstraint): + check: Q + def __init__(self, *, check: Q, name: str) -> None: ... + +class UniqueConstraint(BaseConstraint): + fields: Tuple[str] + condition: Optional[Q] + def __init__(self, *, fields: Sequence[str], name: str, condition: Optional[Q] = ...): ... diff --git a/shared/package-files/09/0976b5d05430d908fa32a26e682f059b8b25b288a92858c2229605e9ce482005/blob b/shared/package-files/09/0976b5d05430d908fa32a26e682f059b8b25b288a92858c2229605e9ce482005/blob new file mode 100644 index 0000000000000000000000000000000000000000..a381fa1d8905bf922d607643514cb30a4c645e0e --- /dev/null +++ b/shared/package-files/09/0976b5d05430d908fa32a26e682f059b8b25b288a92858c2229605e9ce482005/blob @@ -0,0 +1,443 @@ +import asyncio +import gc +import os +import pytest +import numpy as np +import threading +import warnings +from numpy.testing import extbuild, assert_warns, IS_WASM +import sys + + +# FIXME: numpy.testing.extbuild uses `numpy.distutils`, so this won't work on +# Python 3.12 and up. It's an internal test utility, so for now we just skip +# these tests. + + +@pytest.fixture +def get_module(tmp_path): + """ Add a memory policy that returns a false pointer 64 bytes into the + actual allocation, and fill the prefix with some text. Then check at each + memory manipulation that the prefix exists, to make sure all alloc/realloc/ + free/calloc go via the functions here. + """ + if sys.platform.startswith('cygwin'): + pytest.skip('link fails on cygwin') + if IS_WASM: + pytest.skip("Can't build module inside Wasm") + functions = [ + ("get_default_policy", "METH_NOARGS", """ + Py_INCREF(PyDataMem_DefaultHandler); + return PyDataMem_DefaultHandler; + """), + ("set_secret_data_policy", "METH_NOARGS", """ + PyObject *secret_data = + PyCapsule_New(&secret_data_handler, "mem_handler", NULL); + if (secret_data == NULL) { + return NULL; + } + PyObject *old = PyDataMem_SetHandler(secret_data); + Py_DECREF(secret_data); + return old; + """), + ("set_old_policy", "METH_O", """ + PyObject *old; + if (args != NULL && PyCapsule_CheckExact(args)) { + old = PyDataMem_SetHandler(args); + } + else { + old = PyDataMem_SetHandler(NULL); + } + return old; + """), + ("get_array", "METH_NOARGS", """ + char *buf = (char *)malloc(20); + npy_intp dims[1]; + dims[0] = 20; + PyArray_Descr *descr = PyArray_DescrNewFromType(NPY_UINT8); + return PyArray_NewFromDescr(&PyArray_Type, descr, 1, dims, NULL, + buf, NPY_ARRAY_WRITEABLE, NULL); + """), + ("set_own", "METH_O", """ + if (!PyArray_Check(args)) { + PyErr_SetString(PyExc_ValueError, + "need an ndarray"); + return NULL; + } + PyArray_ENABLEFLAGS((PyArrayObject*)args, NPY_ARRAY_OWNDATA); + // Maybe try this too? + // PyArray_BASE(PyArrayObject *)args) = NULL; + Py_RETURN_NONE; + """), + ("get_array_with_base", "METH_NOARGS", """ + char *buf = (char *)malloc(20); + npy_intp dims[1]; + dims[0] = 20; + PyArray_Descr *descr = PyArray_DescrNewFromType(NPY_UINT8); + PyObject *arr = PyArray_NewFromDescr(&PyArray_Type, descr, 1, dims, + NULL, buf, + NPY_ARRAY_WRITEABLE, NULL); + if (arr == NULL) return NULL; + PyObject *obj = PyCapsule_New(buf, "buf capsule", + (PyCapsule_Destructor)&warn_on_free); + if (obj == NULL) { + Py_DECREF(arr); + return NULL; + } + if (PyArray_SetBaseObject((PyArrayObject *)arr, obj) < 0) { + Py_DECREF(arr); + Py_DECREF(obj); + return NULL; + } + return arr; + + """), + ] + prologue = ''' + #define NPY_TARGET_VERSION NPY_1_22_API_VERSION + #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION + #include + /* + * This struct allows the dynamic configuration of the allocator funcs + * of the `secret_data_allocator`. It is provided here for + * demonstration purposes, as a valid `ctx` use-case scenario. + */ + typedef struct { + void *(*malloc)(size_t); + void *(*calloc)(size_t, size_t); + void *(*realloc)(void *, size_t); + void (*free)(void *); + } SecretDataAllocatorFuncs; + + NPY_NO_EXPORT void * + shift_alloc(void *ctx, size_t sz) { + SecretDataAllocatorFuncs *funcs = (SecretDataAllocatorFuncs *)ctx; + char *real = (char *)funcs->malloc(sz + 64); + if (real == NULL) { + return NULL; + } + snprintf(real, 64, "originally allocated %ld", (unsigned long)sz); + return (void *)(real + 64); + } + NPY_NO_EXPORT void * + shift_zero(void *ctx, size_t sz, size_t cnt) { + SecretDataAllocatorFuncs *funcs = (SecretDataAllocatorFuncs *)ctx; + char *real = (char *)funcs->calloc(sz + 64, cnt); + if (real == NULL) { + return NULL; + } + snprintf(real, 64, "originally allocated %ld via zero", + (unsigned long)sz); + return (void *)(real + 64); + } + NPY_NO_EXPORT void + shift_free(void *ctx, void * p, npy_uintp sz) { + SecretDataAllocatorFuncs *funcs = (SecretDataAllocatorFuncs *)ctx; + if (p == NULL) { + return ; + } + char *real = (char *)p - 64; + if (strncmp(real, "originally allocated", 20) != 0) { + fprintf(stdout, "uh-oh, unmatched shift_free, " + "no appropriate prefix\\n"); + /* Make C runtime crash by calling free on the wrong address */ + funcs->free((char *)p + 10); + /* funcs->free(real); */ + } + else { + npy_uintp i = (npy_uintp)atoi(real +20); + if (i != sz) { + fprintf(stderr, "uh-oh, unmatched shift_free" + "(ptr, %ld) but allocated %ld\\n", sz, i); + /* This happens in some places, only print */ + funcs->free(real); + } + else { + funcs->free(real); + } + } + } + NPY_NO_EXPORT void * + shift_realloc(void *ctx, void * p, npy_uintp sz) { + SecretDataAllocatorFuncs *funcs = (SecretDataAllocatorFuncs *)ctx; + if (p != NULL) { + char *real = (char *)p - 64; + if (strncmp(real, "originally allocated", 20) != 0) { + fprintf(stdout, "uh-oh, unmatched shift_realloc\\n"); + return realloc(p, sz); + } + return (void *)((char *)funcs->realloc(real, sz + 64) + 64); + } + else { + char *real = (char *)funcs->realloc(p, sz + 64); + if (real == NULL) { + return NULL; + } + snprintf(real, 64, "originally allocated " + "%ld via realloc", (unsigned long)sz); + return (void *)(real + 64); + } + } + /* As an example, we use the standard {m|c|re}alloc/free funcs. */ + static SecretDataAllocatorFuncs secret_data_handler_ctx = { + malloc, + calloc, + realloc, + free + }; + static PyDataMem_Handler secret_data_handler = { + "secret_data_allocator", + 1, + { + &secret_data_handler_ctx, /* ctx */ + shift_alloc, /* malloc */ + shift_zero, /* calloc */ + shift_realloc, /* realloc */ + shift_free /* free */ + } + }; + void warn_on_free(void *capsule) { + PyErr_WarnEx(PyExc_UserWarning, "in warn_on_free", 1); + void * obj = PyCapsule_GetPointer(capsule, + PyCapsule_GetName(capsule)); + free(obj); + }; + ''' + more_init = "import_array();" + try: + import mem_policy + return mem_policy + except ImportError: + pass + # if it does not exist, build and load it + return extbuild.build_and_import_extension('mem_policy', + functions, + prologue=prologue, + include_dirs=[np.get_include()], + build_dir=tmp_path, + more_init=more_init) + + +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") +def test_set_policy(get_module): + + get_handler_name = np.core.multiarray.get_handler_name + get_handler_version = np.core.multiarray.get_handler_version + orig_policy_name = get_handler_name() + + a = np.arange(10).reshape((2, 5)) # a doesn't own its own data + assert get_handler_name(a) is None + assert get_handler_version(a) is None + assert get_handler_name(a.base) == orig_policy_name + assert get_handler_version(a.base) == 1 + + orig_policy = get_module.set_secret_data_policy() + + b = np.arange(10).reshape((2, 5)) # b doesn't own its own data + assert get_handler_name(b) is None + assert get_handler_version(b) is None + assert get_handler_name(b.base) == 'secret_data_allocator' + assert get_handler_version(b.base) == 1 + + if orig_policy_name == 'default_allocator': + get_module.set_old_policy(None) # tests PyDataMem_SetHandler(NULL) + assert get_handler_name() == 'default_allocator' + else: + get_module.set_old_policy(orig_policy) + assert get_handler_name() == orig_policy_name + + +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") +def test_default_policy_singleton(get_module): + get_handler_name = np.core.multiarray.get_handler_name + + # set the policy to default + orig_policy = get_module.set_old_policy(None) + + assert get_handler_name() == 'default_allocator' + + # re-set the policy to default + def_policy_1 = get_module.set_old_policy(None) + + assert get_handler_name() == 'default_allocator' + + # set the policy to original + def_policy_2 = get_module.set_old_policy(orig_policy) + + # since default policy is a singleton, + # these should be the same object + assert def_policy_1 is def_policy_2 is get_module.get_default_policy() + + +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") +def test_policy_propagation(get_module): + # The memory policy goes hand-in-hand with flags.owndata + + class MyArr(np.ndarray): + pass + + get_handler_name = np.core.multiarray.get_handler_name + orig_policy_name = get_handler_name() + a = np.arange(10).view(MyArr).reshape((2, 5)) + assert get_handler_name(a) is None + assert a.flags.owndata is False + + assert get_handler_name(a.base) is None + assert a.base.flags.owndata is False + + assert get_handler_name(a.base.base) == orig_policy_name + assert a.base.base.flags.owndata is True + + +async def concurrent_context1(get_module, orig_policy_name, event): + if orig_policy_name == 'default_allocator': + get_module.set_secret_data_policy() + assert np.core.multiarray.get_handler_name() == 'secret_data_allocator' + else: + get_module.set_old_policy(None) + assert np.core.multiarray.get_handler_name() == 'default_allocator' + event.set() + + +async def concurrent_context2(get_module, orig_policy_name, event): + await event.wait() + # the policy is not affected by changes in parallel contexts + assert np.core.multiarray.get_handler_name() == orig_policy_name + # change policy in the child context + if orig_policy_name == 'default_allocator': + get_module.set_secret_data_policy() + assert np.core.multiarray.get_handler_name() == 'secret_data_allocator' + else: + get_module.set_old_policy(None) + assert np.core.multiarray.get_handler_name() == 'default_allocator' + + +async def async_test_context_locality(get_module): + orig_policy_name = np.core.multiarray.get_handler_name() + + event = asyncio.Event() + # the child contexts inherit the parent policy + concurrent_task1 = asyncio.create_task( + concurrent_context1(get_module, orig_policy_name, event)) + concurrent_task2 = asyncio.create_task( + concurrent_context2(get_module, orig_policy_name, event)) + await concurrent_task1 + await concurrent_task2 + + # the parent context is not affected by child policy changes + assert np.core.multiarray.get_handler_name() == orig_policy_name + + +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") +def test_context_locality(get_module): + if (sys.implementation.name == 'pypy' + and sys.pypy_version_info[:3] < (7, 3, 6)): + pytest.skip('no context-locality support in PyPy < 7.3.6') + asyncio.run(async_test_context_locality(get_module)) + + +def concurrent_thread1(get_module, event): + get_module.set_secret_data_policy() + assert np.core.multiarray.get_handler_name() == 'secret_data_allocator' + event.set() + + +def concurrent_thread2(get_module, event): + event.wait() + # the policy is not affected by changes in parallel threads + assert np.core.multiarray.get_handler_name() == 'default_allocator' + # change policy in the child thread + get_module.set_secret_data_policy() + + +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") +def test_thread_locality(get_module): + orig_policy_name = np.core.multiarray.get_handler_name() + + event = threading.Event() + # the child threads do not inherit the parent policy + concurrent_task1 = threading.Thread(target=concurrent_thread1, + args=(get_module, event)) + concurrent_task2 = threading.Thread(target=concurrent_thread2, + args=(get_module, event)) + concurrent_task1.start() + concurrent_task2.start() + concurrent_task1.join() + concurrent_task2.join() + + # the parent thread is not affected by child policy changes + assert np.core.multiarray.get_handler_name() == orig_policy_name + + +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") +@pytest.mark.skip(reason="too slow, see gh-23975") +def test_new_policy(get_module): + a = np.arange(10) + orig_policy_name = np.core.multiarray.get_handler_name(a) + + orig_policy = get_module.set_secret_data_policy() + + b = np.arange(10) + assert np.core.multiarray.get_handler_name(b) == 'secret_data_allocator' + + # test array manipulation. This is slow + if orig_policy_name == 'default_allocator': + # when the np.core.test tests recurse into this test, the + # policy will be set so this "if" will be false, preventing + # infinite recursion + # + # if needed, debug this by + # - running tests with -- -s (to not capture stdout/stderr + # - setting verbose=2 + # - setting extra_argv=['-vv'] here + assert np.core.test('full', verbose=1, extra_argv=[]) + # also try the ma tests, the pickling test is quite tricky + assert np.ma.test('full', verbose=1, extra_argv=[]) + + get_module.set_old_policy(orig_policy) + + c = np.arange(10) + assert np.core.multiarray.get_handler_name(c) == orig_policy_name + + +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") +@pytest.mark.xfail(sys.implementation.name == "pypy", + reason=("bad interaction between getenv and " + "os.environ inside pytest")) +@pytest.mark.parametrize("policy", ["0", "1", None]) +def test_switch_owner(get_module, policy): + a = get_module.get_array() + assert np.core.multiarray.get_handler_name(a) is None + get_module.set_own(a) + + if policy is None: + # See what we expect to be set based on the env variable + policy = os.getenv("NUMPY_WARN_IF_NO_MEM_POLICY", "0") == "1" + oldval = None + else: + policy = policy == "1" + oldval = np.core._multiarray_umath._set_numpy_warn_if_no_mem_policy( + policy) + try: + # The policy should be NULL, so we have to assume we can call + # "free". A warning is given if the policy == "1" + if policy: + with assert_warns(RuntimeWarning) as w: + del a + gc.collect() + else: + del a + gc.collect() + + finally: + if oldval is not None: + np.core._multiarray_umath._set_numpy_warn_if_no_mem_policy(oldval) + + +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") +def test_owner_is_base(get_module): + a = get_module.get_array_with_base() + with pytest.warns(UserWarning, match='warn_on_free'): + del a + gc.collect() + gc.collect() diff --git a/shared/package-files/09/0979373c62bd58be6dfb927e1b65f94e5fa76fa95c12b4c14b9a148f64ade9a5/blob b/shared/package-files/09/0979373c62bd58be6dfb927e1b65f94e5fa76fa95c12b4c14b9a148f64ade9a5/blob new file mode 100644 index 0000000000000000000000000000000000000000..d883d9224a6e61436205a18182f5e66708312976 Binary files /dev/null and b/shared/package-files/09/0979373c62bd58be6dfb927e1b65f94e5fa76fa95c12b4c14b9a148f64ade9a5/blob differ diff --git a/shared/package-files/09/097ac7fd806967e1c89871eba9722142dfef7afa783f93570a5a7b86714c54b3/blob b/shared/package-files/09/097ac7fd806967e1c89871eba9722142dfef7afa783f93570a5a7b86714c54b3/blob new file mode 100644 index 0000000000000000000000000000000000000000..2140970015d099763797d60a98a3a3b6f4b5f219 --- /dev/null +++ b/shared/package-files/09/097ac7fd806967e1c89871eba9722142dfef7afa783f93570a5a7b86714c54b3/blob @@ -0,0 +1,14 @@ +""" +Module containing private utility functions +=========================================== + +The ``scipy._lib`` namespace is empty (for now). Tests for all +utilities in submodules of ``_lib`` can be run with:: + + from scipy import _lib + _lib.test() + +""" +from scipy._lib._testutils import PytestTester +test = PytestTester(__name__) +del PytestTester diff --git a/shared/package-files/09/097c9d03bc92bc447abf0e7caa9fd98a10a483a632c726ac49b0424ab6e7dace/blob b/shared/package-files/09/097c9d03bc92bc447abf0e7caa9fd98a10a483a632c726ac49b0424ab6e7dace/blob new file mode 100644 index 0000000000000000000000000000000000000000..d0af2537a11dcfc32ad43c065f9ce472e7ee517a --- /dev/null +++ b/shared/package-files/09/097c9d03bc92bc447abf0e7caa9fd98a10a483a632c726ac49b0424ab6e7dace/blob @@ -0,0 +1,88 @@ +Metadata-Version: 2.1 +Name: duckdb +Version: 1.4.4 +Summary: DuckDB in-process database +Keywords: DuckDB,Database,SQL,OLAP +Author: DuckDB Foundation +Maintainer: DuckDB Foundation +Classifier: Development Status :: 5 - Production/Stable +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Topic :: Database +Classifier: Topic :: Database :: Database Engines/Servers +Classifier: Topic :: Scientific/Engineering +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Education +Classifier: Intended Audience :: Information Technology +Classifier: Intended Audience :: Science/Research +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Programming Language :: C++ +Project-URL: Documentation, https://duckdb.org/docs/stable/clients/python/overview +Project-URL: Source, https://github.com/duckdb/duckdb-python +Project-URL: Issues, https://github.com/duckdb/duckdb-python/issues +Project-URL: Changelog, https://github.com/duckdb/duckdb-python/releases +Requires-Python: >=3.9.0 +Provides-Extra: all +Requires-Dist: ipython; extra == "all" +Requires-Dist: fsspec; extra == "all" +Requires-Dist: numpy; extra == "all" +Requires-Dist: pandas; extra == "all" +Requires-Dist: pyarrow; extra == "all" +Requires-Dist: adbc-driver-manager; extra == "all" +Description-Content-Type: text/markdown + +
+ + + + DuckDB logo + +
+
+

+ Discord + PyPI Latest Release +

+
+

+ DuckDB.org + | + User Guide (Python) + - + API Docs (Python) +

+ +# DuckDB: A Fast, In-Process, Portable, Open Source, Analytical Database System + +* **Simple**: DuckDB is easy to install and deploy. It has zero external dependencies and runs in-process in its host application or as a single binary. +* **Portable**: DuckDB runs on Linux, macOS, Windows, Android, iOS and all popular hardware architectures. It has idiomatic client APIs for major programming languages. +* **Feature-rich**: DuckDB offers a rich SQL dialect. It can read and write file formats such as CSV, Parquet, and JSON, to and from the local file system and remote endpoints such as S3 buckets. +* **Fast**: DuckDB runs analytical queries at blazing speed thanks to its columnar engine, which supports parallel execution and can process larger-than-memory workloads. +* **Extensible**: DuckDB is extensible by third-party features such as new data types, functions, file formats and new SQL syntax. User contributions are available as community extensions. +* **Free**: DuckDB and its core extensions are open-source under the permissive MIT License. The intellectual property of the project is held by the DuckDB Foundation. + +## Installation + +Install the latest release of DuckDB directly from [PyPI](https://pypi.org/project/duckdb/): + +```bash +pip install duckdb +``` + +Install with all optional dependencies: + +```bash +pip install 'duckdb[all]' +``` + +## Contributing + +See the [CONTRIBUTING.md](CONTRIBUTING.md) for instructions on how to set up a development environment. diff --git a/shared/package-files/09/0985045a454c8186b4e690ebefb6cea1ef7c13292c98d50abda470a0ff3ad425/blob b/shared/package-files/09/0985045a454c8186b4e690ebefb6cea1ef7c13292c98d50abda470a0ff3ad425/blob new file mode 100644 index 0000000000000000000000000000000000000000..d0239769ba485c9d8d1c9d085ac9624f2682a507 Binary files /dev/null and b/shared/package-files/09/0985045a454c8186b4e690ebefb6cea1ef7c13292c98d50abda470a0ff3ad425/blob differ diff --git a/shared/package-files/09/09883943e9dcb5c2e23f8baed6df41baf0d35b7e9877821c2208067c459edbbd/blob b/shared/package-files/09/09883943e9dcb5c2e23f8baed6df41baf0d35b7e9877821c2208067c459edbbd/blob new file mode 100644 index 0000000000000000000000000000000000000000..6c4c03572e3ab3c0c7ed9ff9f816ceac3b725051 --- /dev/null +++ b/shared/package-files/09/09883943e9dcb5c2e23f8baed6df41baf0d35b7e9877821c2208067c459edbbd/blob @@ -0,0 +1,188 @@ +import inspect +import re +import string +from dataclasses import dataclass, field +from enum import Enum +from typing import Any, Dict, List, Optional, Set, Tuple, Union +from types import ModuleType + +import torch + +_TAGS: Dict[str, Dict[str, Any]] = { + "torch": { + "cond": {}, + "dynamic-shape": {}, + "escape-hatch": {}, + "map": {}, + "dynamic-value": {}, + "operator": {}, + "mutation": {}, + }, + "python": { + "assert": {}, + "builtin": {}, + "closure": {}, + "context-manager": {}, + "control-flow": {}, + "data-structure": {}, + "standard-library": {}, + "object-model": {}, + }, +} + + +class SupportLevel(Enum): + """ + Indicates at what stage the feature + used in the example is handled in export. + """ + + SUPPORTED = 1 + NOT_SUPPORTED_YET = 0 + + +class ExportArgs: + __slots__ = ("args", "kwargs") + + def __init__(self, *args, **kwargs): + self.args = args + self.kwargs = kwargs + + +InputsType = Union[Tuple[Any, ...], ExportArgs] + + +def check_inputs_type(x): + if not isinstance(x, (ExportArgs, tuple)): + raise ValueError( + f"Expecting inputs type to be either a tuple, or ExportArgs, got: {type(x)}" + ) + + +def _validate_tag(tag: str): + parts = tag.split(".") + t = _TAGS + for part in parts: + assert set(part) <= set( + string.ascii_lowercase + "-" + ), f"Tag contains invalid characters: {part}" + if part in t: + t = t[part] + else: + raise ValueError(f"Tag {tag} is not found in registered tags.") + + +@dataclass(frozen=True) +class ExportCase: + example_inputs: InputsType + description: str # A description of the use case. + model: torch.nn.Module + name: str + extra_inputs: Optional[InputsType] = None # For testing graph generalization. + # Tags associated with the use case. (e.g dynamic-shape, escape-hatch) + tags: Set[str] = field(default_factory=set) + support_level: SupportLevel = SupportLevel.SUPPORTED + dynamic_shapes: Optional[Dict[str, Any]] = None + + def __post_init__(self): + check_inputs_type(self.example_inputs) + if self.extra_inputs is not None: + check_inputs_type(self.extra_inputs) + + for tag in self.tags: + _validate_tag(tag) + + if not isinstance(self.description, str) or len(self.description) == 0: + raise ValueError(f'Invalid description: "{self.description}"') + + +_EXAMPLE_CASES: Dict[str, ExportCase] = {} +_MODULES: Set[ModuleType] = set() +_EXAMPLE_CONFLICT_CASES: Dict[str, List[ExportCase]] = {} +_EXAMPLE_REWRITE_CASES: Dict[str, List[ExportCase]] = {} + + +def register_db_case(case: ExportCase) -> None: + """ + Registers a user provided ExportCase into example bank. + """ + if case.name in _EXAMPLE_CASES: + if case.name not in _EXAMPLE_CONFLICT_CASES: + _EXAMPLE_CONFLICT_CASES[case.name] = [_EXAMPLE_CASES[case.name]] + _EXAMPLE_CONFLICT_CASES[case.name].append(case) + return + + _EXAMPLE_CASES[case.name] = case + + +def to_snake_case(name): + name = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name) + return re.sub("([a-z0-9])([A-Z])", r"\1_\2", name).lower() + + +def _make_export_case(m, name, configs): + if not issubclass(m, torch.nn.Module): + raise TypeError("Export case class should be a torch.nn.Module.") + m = m() + + if "description" not in configs: + # Fallback to docstring if description is missing. + assert ( + m.__doc__ is not None + ), f"Could not find description or docstring for export case: {m}" + configs = {**configs, "description": m.__doc__} + return ExportCase(**{**configs, "model": m, "name": name}) + + +def export_case(**kwargs): + """ + Decorator for registering a user provided case into example bank. + """ + + def wrapper(m): + configs = kwargs + module = inspect.getmodule(m) + if module in _MODULES: + raise RuntimeError("export_case should only be used once per example file.") + + assert module is not None + _MODULES.add(module) + normalized_name = to_snake_case(m.__name__) + module_name = module.__name__.split(".")[-1] + if module_name != normalized_name: + raise RuntimeError( + f'Module name "{module.__name__}" is inconsistent with exported program ' + + f'name "{m.__name__}". Please rename the module to "{normalized_name}".' + ) + + case = _make_export_case(m, module_name, configs) + register_db_case(case) + return case + + return wrapper + + +def export_rewrite_case(**kwargs): + def wrapper(m): + configs = kwargs + + parent = configs.pop("parent") + assert isinstance(parent, ExportCase) + key = parent.name + if key not in _EXAMPLE_REWRITE_CASES: + _EXAMPLE_REWRITE_CASES[key] = [] + + configs["example_inputs"] = parent.example_inputs + case = _make_export_case(m, to_snake_case(m.__name__), configs) + _EXAMPLE_REWRITE_CASES[key].append(case) + return case + + return wrapper + + +def normalize_inputs(x: InputsType) -> ExportArgs: + if isinstance(x, tuple): + return ExportArgs(*x) + + assert isinstance(x, ExportArgs) + return x diff --git a/shared/package-files/09/0988a21e41eb43d425734266b59bd405650fc5e5090e36b1cf005bae24adc68f/blob b/shared/package-files/09/0988a21e41eb43d425734266b59bd405650fc5e5090e36b1cf005bae24adc68f/blob new file mode 100644 index 0000000000000000000000000000000000000000..60ea30e0c8b3e73c4e98f03005cbf83bbf3e64a4 --- /dev/null +++ b/shared/package-files/09/0988a21e41eb43d425734266b59bd405650fc5e5090e36b1cf005bae24adc68f/blob @@ -0,0 +1,8 @@ +from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment +from typing import Iterable, Mapping, Optional, Text + +class DispatcherMiddleware(object): + app: WSGIApplication + mounts: Mapping[Text, WSGIApplication] + def __init__(self, app: WSGIApplication, mounts: Optional[Mapping[Text, WSGIApplication]] = ...) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... diff --git a/shared/package-files/09/0988a26c4f1a5fb3109c16ad97fff993f3d673ff6f1d489fc12fac159cf32a4d/blob b/shared/package-files/09/0988a26c4f1a5fb3109c16ad97fff993f3d673ff6f1d489fc12fac159cf32a4d/blob new file mode 100644 index 0000000000000000000000000000000000000000..5888c91c20db96c95930381bdff8ff83563b63c2 --- /dev/null +++ b/shared/package-files/09/0988a26c4f1a5fb3109c16ad97fff993f3d673ff6f1d489fc12fac159cf32a4d/blob @@ -0,0 +1,1429 @@ +dtype,input,output,ulperrortol +np.float32,0xfee27582,0xff800000,2 +np.float32,0xff19f092,0xff800000,2 +np.float32,0xbf393576,0xbf49cb31,2 +np.float32,0x8020fdea,0x8020fdea,2 +np.float32,0x455f4e,0x455f4e,2 +np.float32,0xff718c35,0xff800000,2 +np.float32,0x3f3215e3,0x3f40cce5,2 +np.float32,0x19e833,0x19e833,2 +np.float32,0xff2dcd49,0xff800000,2 +np.float32,0x7e8f6c95,0x7f800000,2 +np.float32,0xbf159dac,0xbf1e47a5,2 +np.float32,0x100d3d,0x100d3d,2 +np.float32,0xff673441,0xff800000,2 +np.float32,0x80275355,0x80275355,2 +np.float32,0x4812d0,0x4812d0,2 +np.float32,0x8072b956,0x8072b956,2 +np.float32,0xff3bb918,0xff800000,2 +np.float32,0x0,0x0,2 +np.float32,0xfe327798,0xff800000,2 +np.float32,0x41d4e2,0x41d4e2,2 +np.float32,0xfe34b1b8,0xff800000,2 +np.float32,0x80199f72,0x80199f72,2 +np.float32,0x807242ce,0x807242ce,2 +np.float32,0x3ef4202d,0x3efd7b48,2 +np.float32,0x763529,0x763529,2 +np.float32,0x4f6662,0x4f6662,2 +np.float32,0x3f18efe9,0x3f2232b5,2 +np.float32,0x80701846,0x80701846,2 +np.float32,0x3f599948,0x3f74c393,2 +np.float32,0x5a3d69,0x5a3d69,2 +np.float32,0xbf4a7e65,0xbf6047a3,2 +np.float32,0xff0d4c82,0xff800000,2 +np.float32,0x7a74db,0x7a74db,2 +np.float32,0x803388e6,0x803388e6,2 +np.float32,0x7f4430bb,0x7f800000,2 +np.float32,0x14c5b1,0x14c5b1,2 +np.float32,0xfa113400,0xff800000,2 +np.float32,0x7f4b3209,0x7f800000,2 +np.float32,0x8038d88c,0x8038d88c,2 +np.float32,0xbef2f9de,0xbefc330b,2 +np.float32,0xbe147b38,0xbe15008f,2 +np.float32,0x2b61e6,0x2b61e6,2 +np.float32,0x80000001,0x80000001,2 +np.float32,0x8060456c,0x8060456c,2 +np.float32,0x3f30fa82,0x3f3f6a99,2 +np.float32,0xfd1f0220,0xff800000,2 +np.float32,0xbf2b7555,0xbf389151,2 +np.float32,0xff100b7a,0xff800000,2 +np.float32,0x70d3cd,0x70d3cd,2 +np.float32,0x2a8d4a,0x2a8d4a,2 +np.float32,0xbf7b733f,0xbf92f05f,2 +np.float32,0x3f7106dc,0x3f8b1fc6,2 +np.float32,0x3f39da7a,0x3f4a9d79,2 +np.float32,0x3f5dd73f,0x3f7aaab5,2 +np.float32,0xbe8c8754,0xbe8e4cba,2 +np.float32,0xbf6c74c9,0xbf87c556,2 +np.float32,0x800efbbb,0x800efbbb,2 +np.float32,0xff054ab5,0xff800000,2 +np.float32,0x800b4b46,0x800b4b46,2 +np.float32,0xff77fd74,0xff800000,2 +np.float32,0x257d0,0x257d0,2 +np.float32,0x7caa0c,0x7caa0c,2 +np.float32,0x8025d24d,0x8025d24d,2 +np.float32,0x3d9f1b60,0x3d9f445c,2 +np.float32,0xbe3bf6e8,0xbe3d0595,2 +np.float32,0x54bb93,0x54bb93,2 +np.float32,0xbf3e6a45,0xbf507716,2 +np.float32,0x3f4bb26e,0x3f61e1cd,2 +np.float32,0x3f698edc,0x3f85aac5,2 +np.float32,0xff7bd0ef,0xff800000,2 +np.float32,0xbed07b68,0xbed64a8e,2 +np.float32,0xbf237c72,0xbf2ed3d2,2 +np.float32,0x27b0fa,0x27b0fa,2 +np.float32,0x3f7606d1,0x3f8ed7d6,2 +np.float32,0x790dc0,0x790dc0,2 +np.float32,0x7f68f3ac,0x7f800000,2 +np.float32,0xbed39288,0xbed9a52f,2 +np.float32,0x3f6f8266,0x3f8a0187,2 +np.float32,0x3fbdca,0x3fbdca,2 +np.float32,0xbf7c3e5d,0xbf938b2c,2 +np.float32,0x802321a8,0x802321a8,2 +np.float32,0x3eecab66,0x3ef53031,2 +np.float32,0x62b324,0x62b324,2 +np.float32,0x3f13afac,0x3f1c03fe,2 +np.float32,0xff315ad7,0xff800000,2 +np.float32,0xbf1fac0d,0xbf2a3a63,2 +np.float32,0xbf543984,0xbf6d61d6,2 +np.float32,0x71a212,0x71a212,2 +np.float32,0x114fbe,0x114fbe,2 +np.float32,0x3f5b6ff2,0x3f77505f,2 +np.float32,0xff6ff89e,0xff800000,2 +np.float32,0xff4527a1,0xff800000,2 +np.float32,0x22cb3,0x22cb3,2 +np.float32,0x7f53bb6b,0x7f800000,2 +np.float32,0xff3d2dea,0xff800000,2 +np.float32,0xfd21dac0,0xff800000,2 +np.float32,0xfc486140,0xff800000,2 +np.float32,0x7e2b693a,0x7f800000,2 +np.float32,0x8022a9fb,0x8022a9fb,2 +np.float32,0x80765de0,0x80765de0,2 +np.float32,0x13d299,0x13d299,2 +np.float32,0x7ee53713,0x7f800000,2 +np.float32,0xbde1c770,0xbde23c96,2 +np.float32,0xbd473fc0,0xbd4753de,2 +np.float32,0x3f1cb455,0x3f26acf3,2 +np.float32,0x683e49,0x683e49,2 +np.float32,0x3ed5a9fc,0x3edbeb79,2 +np.float32,0x3f4fe3f6,0x3f67814f,2 +np.float32,0x802a2bce,0x802a2bce,2 +np.float32,0x7e951b4c,0x7f800000,2 +np.float32,0xbe6eb260,0xbe70dd44,2 +np.float32,0xbe3daca8,0xbe3ec2cb,2 +np.float32,0xbe9c38b2,0xbe9ea822,2 +np.float32,0xff2e29dc,0xff800000,2 +np.float32,0x7f62c7cc,0x7f800000,2 +np.float32,0xbf6799a4,0xbf84416c,2 +np.float32,0xbe30a7f0,0xbe318898,2 +np.float32,0xc83d9,0xc83d9,2 +np.float32,0x3f05abf4,0x3f0bd447,2 +np.float32,0x7e9b018a,0x7f800000,2 +np.float32,0xbf0ed72e,0xbf165e5b,2 +np.float32,0x8011ac8c,0x8011ac8c,2 +np.float32,0xbeb7c706,0xbebbbfcb,2 +np.float32,0x803637f9,0x803637f9,2 +np.float32,0xfe787cc8,0xff800000,2 +np.float32,0x3f533d4b,0x3f6c0a50,2 +np.float32,0x3f5c0f1c,0x3f782dde,2 +np.float32,0x3f301f36,0x3f3e590d,2 +np.float32,0x2dc929,0x2dc929,2 +np.float32,0xff15018a,0xff800000,2 +np.float32,0x3f4d0c56,0x3f63afeb,2 +np.float32,0xbf7a2ae3,0xbf91f6e4,2 +np.float32,0xbe771b84,0xbe798346,2 +np.float32,0x80800000,0x80800000,2 +np.float32,0x7f5689ba,0x7f800000,2 +np.float32,0x3f1c3177,0x3f2610df,2 +np.float32,0x3f1b9664,0x3f255825,2 +np.float32,0x3f7e5066,0x3f9520d4,2 +np.float32,0xbf1935f8,0xbf2285ab,2 +np.float32,0x3f096cc7,0x3f101ef9,2 +np.float32,0x8030c180,0x8030c180,2 +np.float32,0x6627ed,0x6627ed,2 +np.float32,0x454595,0x454595,2 +np.float32,0x7de66a33,0x7f800000,2 +np.float32,0xbf800000,0xbf966cfe,2 +np.float32,0xbf35c0a8,0xbf456939,2 +np.float32,0x3f6a6266,0x3f8643e0,2 +np.float32,0x3f0cbcee,0x3f13ef6a,2 +np.float32,0x7efd1e58,0x7f800000,2 +np.float32,0xfe9a74c6,0xff800000,2 +np.float32,0x807ebe6c,0x807ebe6c,2 +np.float32,0x80656736,0x80656736,2 +np.float32,0x800e0608,0x800e0608,2 +np.float32,0xbf30e39a,0xbf3f4e00,2 +np.float32,0x802015fd,0x802015fd,2 +np.float32,0x3e3ce26d,0x3e3df519,2 +np.float32,0x7ec142ac,0x7f800000,2 +np.float32,0xbf68c9ce,0xbf851c78,2 +np.float32,0xfede8356,0xff800000,2 +np.float32,0xbf1507ce,0xbf1d978d,2 +np.float32,0x3e53914c,0x3e551374,2 +np.float32,0x7f3e1c14,0x7f800000,2 +np.float32,0x8070d2ba,0x8070d2ba,2 +np.float32,0xbf4eb793,0xbf65ecee,2 +np.float32,0x7365a6,0x7365a6,2 +np.float32,0x8045cba2,0x8045cba2,2 +np.float32,0x7e4af521,0x7f800000,2 +np.float32,0xbf228625,0xbf2da9e1,2 +np.float32,0x7ee0536c,0x7f800000,2 +np.float32,0x3e126607,0x3e12e5d5,2 +np.float32,0x80311d92,0x80311d92,2 +np.float32,0xbf386b8b,0xbf48ca54,2 +np.float32,0x7f800000,0x7f800000,2 +np.float32,0x8049ec7a,0x8049ec7a,2 +np.float32,0xbf1dfde4,0xbf2836be,2 +np.float32,0x7e719a8c,0x7f800000,2 +np.float32,0x3eb9c856,0x3ebde2e6,2 +np.float32,0xfe3efda8,0xff800000,2 +np.float32,0xbe89d60c,0xbe8b81d1,2 +np.float32,0x3eaad338,0x3eae0317,2 +np.float32,0x7f4e5217,0x7f800000,2 +np.float32,0x3e9d0f40,0x3e9f88ce,2 +np.float32,0xbe026708,0xbe02c155,2 +np.float32,0x5fc22f,0x5fc22f,2 +np.float32,0x1c4572,0x1c4572,2 +np.float32,0xbed89d96,0xbedf22c5,2 +np.float32,0xbf3debee,0xbf4fd441,2 +np.float32,0xbf465520,0xbf5ac6e5,2 +np.float32,0x3f797081,0x3f9169b3,2 +np.float32,0xbf250734,0xbf30b2aa,2 +np.float32,0x7f5068e9,0x7f800000,2 +np.float32,0x3f1b814e,0x3f253f0c,2 +np.float32,0xbf27c5d3,0xbf340b05,2 +np.float32,0x3f1b78ae,0x3f2534c8,2 +np.float32,0x8059b51a,0x8059b51a,2 +np.float32,0x8059f182,0x8059f182,2 +np.float32,0xbf1bb36e,0xbf257ab8,2 +np.float32,0x41ac35,0x41ac35,2 +np.float32,0x68f41f,0x68f41f,2 +np.float32,0xbea504dc,0xbea7e40f,2 +np.float32,0x1,0x1,2 +np.float32,0x3e96b5b0,0x3e98e542,2 +np.float32,0x7f7fffff,0x7f800000,2 +np.float32,0x3c557a80,0x3c557c0c,2 +np.float32,0x800ca3ec,0x800ca3ec,2 +np.float32,0x8077d4aa,0x8077d4aa,2 +np.float32,0x3f000af0,0x3f0572d6,2 +np.float32,0x3e0434dd,0x3e0492f8,2 +np.float32,0x7d1a710a,0x7f800000,2 +np.float32,0x3f70f996,0x3f8b15f8,2 +np.float32,0x8033391d,0x8033391d,2 +np.float32,0x11927c,0x11927c,2 +np.float32,0x7f7784be,0x7f800000,2 +np.float32,0x7acb22af,0x7f800000,2 +np.float32,0x7e8b153c,0x7f800000,2 +np.float32,0x66d402,0x66d402,2 +np.float32,0xfed6e7b0,0xff800000,2 +np.float32,0x7f6872d3,0x7f800000,2 +np.float32,0x1bd49c,0x1bd49c,2 +np.float32,0xfdc4f1b8,0xff800000,2 +np.float32,0xbed8a466,0xbedf2a33,2 +np.float32,0x7ee789,0x7ee789,2 +np.float32,0xbece94b4,0xbed43b52,2 +np.float32,0x3cf3f734,0x3cf4006f,2 +np.float32,0x7e44aa00,0x7f800000,2 +np.float32,0x7f19e99c,0x7f800000,2 +np.float32,0x806ff1bc,0x806ff1bc,2 +np.float32,0x80296934,0x80296934,2 +np.float32,0x7f463363,0x7f800000,2 +np.float32,0xbf212ac3,0xbf2c06bb,2 +np.float32,0x3dc63778,0x3dc686ba,2 +np.float32,0x7f1b4328,0x7f800000,2 +np.float32,0x6311f6,0x6311f6,2 +np.float32,0xbf6b6fb6,0xbf870751,2 +np.float32,0xbf2c44cf,0xbf399155,2 +np.float32,0x3e7a67bc,0x3e7ce887,2 +np.float32,0x7f57c5f7,0x7f800000,2 +np.float32,0x7f2bb4ff,0x7f800000,2 +np.float32,0xbe9d448e,0xbe9fc0a4,2 +np.float32,0xbf4840f0,0xbf5d4f6b,2 +np.float32,0x7f1e1176,0x7f800000,2 +np.float32,0xff76638e,0xff800000,2 +np.float32,0xff055555,0xff800000,2 +np.float32,0x3f32b82b,0x3f419834,2 +np.float32,0xff363aa8,0xff800000,2 +np.float32,0x7f737fd0,0x7f800000,2 +np.float32,0x3da5d798,0x3da60602,2 +np.float32,0x3f1cc126,0x3f26bc3e,2 +np.float32,0x7eb07541,0x7f800000,2 +np.float32,0x3f7b2ff2,0x3f92bd2a,2 +np.float32,0x474f7,0x474f7,2 +np.float32,0x7fc00000,0x7fc00000,2 +np.float32,0xff2b0a4e,0xff800000,2 +np.float32,0xfeb24f16,0xff800000,2 +np.float32,0x2cb9fc,0x2cb9fc,2 +np.float32,0x67189d,0x67189d,2 +np.float32,0x8033d854,0x8033d854,2 +np.float32,0xbe85e94c,0xbe87717a,2 +np.float32,0x80767c6c,0x80767c6c,2 +np.float32,0x7ea84d65,0x7f800000,2 +np.float32,0x3f024bc7,0x3f07fead,2 +np.float32,0xbdcb0100,0xbdcb5625,2 +np.float32,0x3f160a9e,0x3f1ec7c9,2 +np.float32,0xff1734c8,0xff800000,2 +np.float32,0x7f424d5e,0x7f800000,2 +np.float32,0xbf75b215,0xbf8e9862,2 +np.float32,0x3f262a42,0x3f3214c4,2 +np.float32,0xbf4cfb53,0xbf639927,2 +np.float32,0x3f4ac8b8,0x3f60aa7c,2 +np.float32,0x3e90e593,0x3e92d6b3,2 +np.float32,0xbf66bccf,0xbf83a2d8,2 +np.float32,0x7d3d851a,0x7f800000,2 +np.float32,0x7bac783c,0x7f800000,2 +np.float32,0x8001c626,0x8001c626,2 +np.float32,0xbdffd480,0xbe003f7b,2 +np.float32,0x7f6680bf,0x7f800000,2 +np.float32,0xbecf448e,0xbed4f9bb,2 +np.float32,0x584c7,0x584c7,2 +np.float32,0x3f3e8ea0,0x3f50a5fb,2 +np.float32,0xbf5a5f04,0xbf75d56e,2 +np.float32,0x8065ae47,0x8065ae47,2 +np.float32,0xbf48dce3,0xbf5e1dba,2 +np.float32,0xbe8dae2e,0xbe8f7ed8,2 +np.float32,0x3f7ca6ab,0x3f93dace,2 +np.float32,0x4c3e81,0x4c3e81,2 +np.float32,0x80000000,0x80000000,2 +np.float32,0x3ee1f7d9,0x3ee96033,2 +np.float32,0x80588c6f,0x80588c6f,2 +np.float32,0x5ba34e,0x5ba34e,2 +np.float32,0x80095d28,0x80095d28,2 +np.float32,0xbe7ba198,0xbe7e2bdd,2 +np.float32,0xbe0bdcb4,0xbe0c4c22,2 +np.float32,0x1776f7,0x1776f7,2 +np.float32,0x80328b2a,0x80328b2a,2 +np.float32,0x3e978d37,0x3e99c63e,2 +np.float32,0x7ed50906,0x7f800000,2 +np.float32,0x3f776a54,0x3f8fe2bd,2 +np.float32,0xbed624c4,0xbedc7120,2 +np.float32,0x7f0b6a31,0x7f800000,2 +np.float32,0x7eb13913,0x7f800000,2 +np.float32,0xbe733684,0xbe758190,2 +np.float32,0x80016474,0x80016474,2 +np.float32,0x7a51ee,0x7a51ee,2 +np.float32,0x3f6cb91e,0x3f87f729,2 +np.float32,0xbd99b050,0xbd99d540,2 +np.float32,0x7c6e3cba,0x7f800000,2 +np.float32,0xbf00179a,0xbf05811e,2 +np.float32,0x3e609b29,0x3e626954,2 +np.float32,0xff3fd71a,0xff800000,2 +np.float32,0x5d8c2,0x5d8c2,2 +np.float32,0x7ee93662,0x7f800000,2 +np.float32,0x4b0b31,0x4b0b31,2 +np.float32,0x3ec243b7,0x3ec6f594,2 +np.float32,0x804d60f1,0x804d60f1,2 +np.float32,0xbf0cb784,0xbf13e929,2 +np.float32,0x3f13b74d,0x3f1c0cee,2 +np.float32,0xfe37cb64,0xff800000,2 +np.float32,0x1a88,0x1a88,2 +np.float32,0x3e22a472,0x3e2353ba,2 +np.float32,0x7f07d6a0,0x7f800000,2 +np.float32,0x3f78f435,0x3f910bb5,2 +np.float32,0x555a4a,0x555a4a,2 +np.float32,0x3e306c1f,0x3e314be3,2 +np.float32,0x8005877c,0x8005877c,2 +np.float32,0x4df389,0x4df389,2 +np.float32,0x8069ffc7,0x8069ffc7,2 +np.float32,0x3f328f24,0x3f4164c6,2 +np.float32,0x53a31b,0x53a31b,2 +np.float32,0xbe4d6768,0xbe4ec8be,2 +np.float32,0x7fa00000,0x7fe00000,2 +np.float32,0x3f484c1b,0x3f5d5e2f,2 +np.float32,0x8038be05,0x8038be05,2 +np.float32,0x58ac0f,0x58ac0f,2 +np.float32,0x7ed7fb72,0x7f800000,2 +np.float32,0x5a22e1,0x5a22e1,2 +np.float32,0xbebb7394,0xbebfaad6,2 +np.float32,0xbda98160,0xbda9b2ef,2 +np.float32,0x7f3e5c42,0x7f800000,2 +np.float32,0xfed204ae,0xff800000,2 +np.float32,0xbf5ef782,0xbf7c3ec5,2 +np.float32,0xbef7a0a8,0xbf00b292,2 +np.float32,0xfee6e176,0xff800000,2 +np.float32,0xfe121140,0xff800000,2 +np.float32,0xfe9e13be,0xff800000,2 +np.float32,0xbf3c98b1,0xbf4e2003,2 +np.float32,0x77520d,0x77520d,2 +np.float32,0xf17b2,0xf17b2,2 +np.float32,0x724d2f,0x724d2f,2 +np.float32,0x7eb326f5,0x7f800000,2 +np.float32,0x3edd6bf2,0x3ee4636e,2 +np.float32,0x350f57,0x350f57,2 +np.float32,0xff7d4435,0xff800000,2 +np.float32,0x802b2b9d,0x802b2b9d,2 +np.float32,0xbf7fbeee,0xbf963acf,2 +np.float32,0x804f3100,0x804f3100,2 +np.float32,0x7c594a71,0x7f800000,2 +np.float32,0x3ef49340,0x3efdfbb6,2 +np.float32,0x2e0659,0x2e0659,2 +np.float32,0x8006d5fe,0x8006d5fe,2 +np.float32,0xfd2a00b0,0xff800000,2 +np.float32,0xbee1c016,0xbee922ed,2 +np.float32,0x3e3b7de8,0x3e3c8a8b,2 +np.float32,0x805e6bba,0x805e6bba,2 +np.float32,0x1a7da2,0x1a7da2,2 +np.float32,0x6caba4,0x6caba4,2 +np.float32,0x802f7eab,0x802f7eab,2 +np.float32,0xff68b16b,0xff800000,2 +np.float32,0x8064f5e5,0x8064f5e5,2 +np.float32,0x2e39b4,0x2e39b4,2 +np.float32,0x800000,0x800000,2 +np.float32,0xfd0334c0,0xff800000,2 +np.float32,0x3e952fc4,0x3e974e7e,2 +np.float32,0x80057d33,0x80057d33,2 +np.float32,0x3ed3ddc4,0x3ed9f6f1,2 +np.float32,0x3f74ce18,0x3f8dedf4,2 +np.float32,0xff6bb7c0,0xff800000,2 +np.float32,0xff43bc21,0xff800000,2 +np.float32,0x80207570,0x80207570,2 +np.float32,0x7e1dda75,0x7f800000,2 +np.float32,0x3efe335c,0x3f0462ff,2 +np.float32,0xbf252c0c,0xbf30df70,2 +np.float32,0x3ef4b8e3,0x3efe25ba,2 +np.float32,0x7c33938d,0x7f800000,2 +np.float32,0x3eb1593c,0x3eb4ea95,2 +np.float32,0xfe1d0068,0xff800000,2 +np.float32,0xbf10da9b,0xbf18b551,2 +np.float32,0xfeb65748,0xff800000,2 +np.float32,0xfe8c6014,0xff800000,2 +np.float32,0x3f0503e2,0x3f0b14e3,2 +np.float32,0xfe5e5248,0xff800000,2 +np.float32,0xbd10afa0,0xbd10b754,2 +np.float32,0xff64b609,0xff800000,2 +np.float32,0xbf674a96,0xbf84089c,2 +np.float32,0x7f5d200d,0x7f800000,2 +np.float32,0x3cf44900,0x3cf45245,2 +np.float32,0x8044445a,0x8044445a,2 +np.float32,0xff35b676,0xff800000,2 +np.float32,0x806452cd,0x806452cd,2 +np.float32,0xbf2930fb,0xbf35c7b4,2 +np.float32,0x7e500617,0x7f800000,2 +np.float32,0x543719,0x543719,2 +np.float32,0x3ed11068,0x3ed6ec1d,2 +np.float32,0xbd8db068,0xbd8dcd59,2 +np.float32,0x3ede62c8,0x3ee571d0,2 +np.float32,0xbf00a410,0xbf061f9c,2 +np.float32,0xbf44fa39,0xbf58ff5b,2 +np.float32,0x3f1c3114,0x3f261069,2 +np.float32,0xbdea6210,0xbdeae521,2 +np.float32,0x80059f6d,0x80059f6d,2 +np.float32,0xbdba15f8,0xbdba578c,2 +np.float32,0x6d8a61,0x6d8a61,2 +np.float32,0x6f5428,0x6f5428,2 +np.float32,0x18d0e,0x18d0e,2 +np.float32,0x50e131,0x50e131,2 +np.float32,0x3f2f52be,0x3f3d5a7e,2 +np.float32,0x7399d8,0x7399d8,2 +np.float32,0x106524,0x106524,2 +np.float32,0x7ebf1c53,0x7f800000,2 +np.float32,0x80276458,0x80276458,2 +np.float32,0x3ebbde67,0x3ec01ceb,2 +np.float32,0x80144d9d,0x80144d9d,2 +np.float32,0x8017ea6b,0x8017ea6b,2 +np.float32,0xff38f201,0xff800000,2 +np.float32,0x7f2daa82,0x7f800000,2 +np.float32,0x3f3cb7c7,0x3f4e47ed,2 +np.float32,0x7f08c779,0x7f800000,2 +np.float32,0xbecc907a,0xbed20cec,2 +np.float32,0x7d440002,0x7f800000,2 +np.float32,0xbd410d80,0xbd411fcd,2 +np.float32,0x3d63ae07,0x3d63cc0c,2 +np.float32,0x805a9c13,0x805a9c13,2 +np.float32,0x803bdcdc,0x803bdcdc,2 +np.float32,0xbe88b354,0xbe8a5497,2 +np.float32,0x3f4eaf43,0x3f65e1c2,2 +np.float32,0x3f15e5b8,0x3f1e9c60,2 +np.float32,0x3e8a870c,0x3e8c394e,2 +np.float32,0x7e113de9,0x7f800000,2 +np.float32,0x7ee5ba41,0x7f800000,2 +np.float32,0xbe73d178,0xbe7620eb,2 +np.float32,0xfe972e6a,0xff800000,2 +np.float32,0xbf65567d,0xbf82a25a,2 +np.float32,0x3f38247e,0x3f487010,2 +np.float32,0xbece1c62,0xbed3b918,2 +np.float32,0x442c8d,0x442c8d,2 +np.float32,0x2dc52,0x2dc52,2 +np.float32,0x802ed923,0x802ed923,2 +np.float32,0x788cf8,0x788cf8,2 +np.float32,0x8024888e,0x8024888e,2 +np.float32,0x3f789bde,0x3f90c8fc,2 +np.float32,0x3f5de620,0x3f7abf88,2 +np.float32,0x3f0ffc45,0x3f17b2a7,2 +np.float32,0xbf709678,0xbf8accd4,2 +np.float32,0x12181f,0x12181f,2 +np.float32,0xfe54bbe4,0xff800000,2 +np.float32,0x7f1daba0,0x7f800000,2 +np.float32,0xbf6226df,0xbf805e3c,2 +np.float32,0xbd120610,0xbd120dfb,2 +np.float32,0x7f75e951,0x7f800000,2 +np.float32,0x80068048,0x80068048,2 +np.float32,0x45f04a,0x45f04a,2 +np.float32,0xff4c4f58,0xff800000,2 +np.float32,0x311604,0x311604,2 +np.float32,0x805e809c,0x805e809c,2 +np.float32,0x3d1d62c0,0x3d1d6caa,2 +np.float32,0x7f14ccf9,0x7f800000,2 +np.float32,0xff10017c,0xff800000,2 +np.float32,0xbf43ec48,0xbf579df4,2 +np.float32,0xff64da57,0xff800000,2 +np.float32,0x7f0622c5,0x7f800000,2 +np.float32,0x7f5460cd,0x7f800000,2 +np.float32,0xff0ef1c6,0xff800000,2 +np.float32,0xbece1146,0xbed3ad13,2 +np.float32,0x3f4d457f,0x3f63fc70,2 +np.float32,0xbdc1da28,0xbdc2244b,2 +np.float32,0xbe46d3f4,0xbe481463,2 +np.float32,0xff36b3d6,0xff800000,2 +np.float32,0xbec2e76c,0xbec7a540,2 +np.float32,0x8078fb81,0x8078fb81,2 +np.float32,0x7ec819cb,0x7f800000,2 +np.float32,0x39c4d,0x39c4d,2 +np.float32,0xbe8cddc2,0xbe8ea670,2 +np.float32,0xbf36dffb,0xbf46d48b,2 +np.float32,0xbf2302a3,0xbf2e4065,2 +np.float32,0x3e7b34a2,0x3e7dbb9a,2 +np.float32,0x3e3d87e1,0x3e3e9d62,2 +np.float32,0x7f3c94b1,0x7f800000,2 +np.float32,0x80455a85,0x80455a85,2 +np.float32,0xfd875568,0xff800000,2 +np.float32,0xbf618103,0xbf7fd1c8,2 +np.float32,0xbe332e3c,0xbe3418ac,2 +np.float32,0x80736b79,0x80736b79,2 +np.float32,0x3f705d9a,0x3f8aa2e6,2 +np.float32,0xbf3a36d2,0xbf4b134b,2 +np.float32,0xfddc55c0,0xff800000,2 +np.float32,0x805606fd,0x805606fd,2 +np.float32,0x3f4f0bc4,0x3f665e25,2 +np.float32,0xfebe7494,0xff800000,2 +np.float32,0xff0c541b,0xff800000,2 +np.float32,0xff0b8e7f,0xff800000,2 +np.float32,0xbcc51640,0xbcc51b1e,2 +np.float32,0x7ec1c4d0,0x7f800000,2 +np.float32,0xfc5c8e00,0xff800000,2 +np.float32,0x7f48d682,0x7f800000,2 +np.float32,0x7d5c7d8d,0x7f800000,2 +np.float32,0x8052ed03,0x8052ed03,2 +np.float32,0x7d4db058,0x7f800000,2 +np.float32,0xff3a65ee,0xff800000,2 +np.float32,0x806eeb93,0x806eeb93,2 +np.float32,0x803f9733,0x803f9733,2 +np.float32,0xbf2d1388,0xbf3a90e3,2 +np.float32,0x68e260,0x68e260,2 +np.float32,0x3e47a69f,0x3e48eb0e,2 +np.float32,0x3f0c4623,0x3f136646,2 +np.float32,0x3f37a831,0x3f47d249,2 +np.float32,0xff153a0c,0xff800000,2 +np.float32,0x2e8086,0x2e8086,2 +np.float32,0xc3f5e,0xc3f5e,2 +np.float32,0x7f31dc14,0x7f800000,2 +np.float32,0xfee37d68,0xff800000,2 +np.float32,0x711d4,0x711d4,2 +np.float32,0x7ede2ce4,0x7f800000,2 +np.float32,0xbf5d76d0,0xbf7a23d0,2 +np.float32,0xbe2b9eb4,0xbe2c6cac,2 +np.float32,0x2b14d7,0x2b14d7,2 +np.float32,0x3ea1db72,0x3ea4910e,2 +np.float32,0x7f3f03f7,0x7f800000,2 +np.float32,0x92de5,0x92de5,2 +np.float32,0x80322e1b,0x80322e1b,2 +np.float32,0xbf5eb214,0xbf7bdd55,2 +np.float32,0xbf21bf87,0xbf2cba14,2 +np.float32,0xbf5d4b78,0xbf79e73a,2 +np.float32,0xbc302840,0xbc30291e,2 +np.float32,0xfee567c6,0xff800000,2 +np.float32,0x7f70ee14,0x7f800000,2 +np.float32,0x7e5c4b33,0x7f800000,2 +np.float32,0x3f1e7b64,0x3f28ccfd,2 +np.float32,0xbf6309f7,0xbf80ff3e,2 +np.float32,0x1c2fe3,0x1c2fe3,2 +np.float32,0x8e78d,0x8e78d,2 +np.float32,0x7f2fce73,0x7f800000,2 +np.float32,0x7f25f690,0x7f800000,2 +np.float32,0x8074cba5,0x8074cba5,2 +np.float32,0x16975f,0x16975f,2 +np.float32,0x8012cf5c,0x8012cf5c,2 +np.float32,0x7da72138,0x7f800000,2 +np.float32,0xbf563f35,0xbf7025be,2 +np.float32,0x3f69d3f5,0x3f85dcbe,2 +np.float32,0xbf15c148,0xbf1e7184,2 +np.float32,0xbe7a077c,0xbe7c8564,2 +np.float32,0x3ebb6ef1,0x3ebfa5e3,2 +np.float32,0xbe41fde4,0xbe43277b,2 +np.float32,0x7f10b479,0x7f800000,2 +np.float32,0x3e021ace,0x3e02747d,2 +np.float32,0x3e93d984,0x3e95e9be,2 +np.float32,0xfe17e924,0xff800000,2 +np.float32,0xfe21a7cc,0xff800000,2 +np.float32,0x8019b660,0x8019b660,2 +np.float32,0x7e954631,0x7f800000,2 +np.float32,0x7e7330d1,0x7f800000,2 +np.float32,0xbe007d98,0xbe00d3fb,2 +np.float32,0x3ef3870e,0x3efcd077,2 +np.float32,0x7f5bbde8,0x7f800000,2 +np.float32,0x14a5b3,0x14a5b3,2 +np.float32,0x3e84d23f,0x3e8650e8,2 +np.float32,0x80763017,0x80763017,2 +np.float32,0xfe871f36,0xff800000,2 +np.float32,0x7ed43150,0x7f800000,2 +np.float32,0x3cc44547,0x3cc44a16,2 +np.float32,0x3ef0c0fa,0x3ef9b97d,2 +np.float32,0xbede9944,0xbee5ad86,2 +np.float32,0xbf10f0b2,0xbf18cf0a,2 +np.float32,0x3ecdaa78,0x3ed33dd9,2 +np.float32,0x3f7cc058,0x3f93ee6b,2 +np.float32,0x2d952f,0x2d952f,2 +np.float32,0x3f2cf2de,0x3f3a687a,2 +np.float32,0x8029b33c,0x8029b33c,2 +np.float32,0xbf22c737,0xbf2df888,2 +np.float32,0xff53c84a,0xff800000,2 +np.float32,0x40a509,0x40a509,2 +np.float32,0x56abce,0x56abce,2 +np.float32,0xff7fffff,0xff800000,2 +np.float32,0xbf3e67f6,0xbf50741c,2 +np.float32,0xfde67580,0xff800000,2 +np.float32,0x3f103e9b,0x3f17ffc7,2 +np.float32,0x3f3f7232,0x3f51cbe2,2 +np.float32,0x803e6d78,0x803e6d78,2 +np.float32,0x3a61da,0x3a61da,2 +np.float32,0xbc04de80,0xbc04dedf,2 +np.float32,0x7f1e7c52,0x7f800000,2 +np.float32,0x8058ee88,0x8058ee88,2 +np.float32,0x806dd660,0x806dd660,2 +np.float32,0x7e4af9,0x7e4af9,2 +np.float32,0x80702d27,0x80702d27,2 +np.float32,0x802cdad1,0x802cdad1,2 +np.float32,0x3e9b5c23,0x3e9dc149,2 +np.float32,0x7f076e89,0x7f800000,2 +np.float32,0x7f129d68,0x7f800000,2 +np.float32,0x7f6f0b0a,0x7f800000,2 +np.float32,0x7eafafb5,0x7f800000,2 +np.float32,0xbf2ef2ca,0xbf3ce332,2 +np.float32,0xff34c000,0xff800000,2 +np.float32,0x7f559274,0x7f800000,2 +np.float32,0xfed08556,0xff800000,2 +np.float32,0xbf014621,0xbf06d6ad,2 +np.float32,0xff23086a,0xff800000,2 +np.float32,0x6cb33f,0x6cb33f,2 +np.float32,0xfe6e3ffc,0xff800000,2 +np.float32,0x3e6bbec0,0x3e6dd546,2 +np.float32,0x8036afa6,0x8036afa6,2 +np.float32,0xff800000,0xff800000,2 +np.float32,0x3e0ed05c,0x3e0f46ff,2 +np.float32,0x3ec9215c,0x3ece57e6,2 +np.float32,0xbf449fa4,0xbf5888aa,2 +np.float32,0xff2c6640,0xff800000,2 +np.float32,0x7f08f4a7,0x7f800000,2 +np.float32,0xbf4f63e5,0xbf66d4c1,2 +np.float32,0x3f800000,0x3f966cfe,2 +np.float32,0xfe86c7d2,0xff800000,2 +np.float32,0x3f63f969,0x3f81a970,2 +np.float32,0xbd7022d0,0xbd704609,2 +np.float32,0xbead906c,0xbeb0e853,2 +np.float32,0x7ef149ee,0x7f800000,2 +np.float32,0xff0b9ff7,0xff800000,2 +np.float32,0x3f38380d,0x3f4888e7,2 +np.float32,0x3ef3a3e2,0x3efcf09e,2 +np.float32,0xff616477,0xff800000,2 +np.float32,0x3f3f83e4,0x3f51e2c3,2 +np.float32,0xbf79963c,0xbf918642,2 +np.float32,0x801416f4,0x801416f4,2 +np.float32,0xff75ce6d,0xff800000,2 +np.float32,0xbdbf3588,0xbdbf7cad,2 +np.float32,0xbe6ea938,0xbe70d3dc,2 +np.float32,0x8066f977,0x8066f977,2 +np.float32,0x3f5b5362,0x3f7728aa,2 +np.float32,0xbf72052c,0xbf8bdbd8,2 +np.float32,0xbe21ed74,0xbe229a6f,2 +np.float32,0x8062d19c,0x8062d19c,2 +np.float32,0x3ed8d01f,0x3edf59e6,2 +np.float32,0x803ed42b,0x803ed42b,2 +np.float32,0xbe099a64,0xbe0a0481,2 +np.float32,0xbe173eb4,0xbe17cba2,2 +np.float32,0xbebdcf02,0xbec22faf,2 +np.float32,0x7e3ff29e,0x7f800000,2 +np.float32,0x367c92,0x367c92,2 +np.float32,0xbf5c9db8,0xbf78f4a4,2 +np.float32,0xff0b49ea,0xff800000,2 +np.float32,0x3f4f9bc4,0x3f672001,2 +np.float32,0x85d4a,0x85d4a,2 +np.float32,0x80643e33,0x80643e33,2 +np.float32,0x8013aabd,0x8013aabd,2 +np.float32,0xff6997c3,0xff800000,2 +np.float32,0x3f4dd43c,0x3f64bbb6,2 +np.float32,0xff13bbb9,0xff800000,2 +np.float32,0x3f34efa2,0x3f446187,2 +np.float32,0x3e4b2f10,0x3e4c850d,2 +np.float32,0xfef695c6,0xff800000,2 +np.float32,0x7f7e0057,0x7f800000,2 +np.float32,0x3f6e1b9c,0x3f88fa40,2 +np.float32,0x806e46cf,0x806e46cf,2 +np.float32,0x3f15a88a,0x3f1e546c,2 +np.float32,0xbd2de7d0,0xbd2df530,2 +np.float32,0xbf63cae0,0xbf818854,2 +np.float32,0xbdc3e1a0,0xbdc42e1e,2 +np.float32,0xbf11a038,0xbf199b98,2 +np.float32,0xbec13706,0xbec5d56b,2 +np.float32,0x3f1c5f54,0x3f26478d,2 +np.float32,0x3e9ea97e,0x3ea136b4,2 +np.float32,0xfeb5a508,0xff800000,2 +np.float32,0x7f4698f4,0x7f800000,2 +np.float32,0xff51ee2c,0xff800000,2 +np.float32,0xff5994df,0xff800000,2 +np.float32,0x4b9fb9,0x4b9fb9,2 +np.float32,0xfda10d98,0xff800000,2 +np.float32,0x525555,0x525555,2 +np.float32,0x7ed571ef,0x7f800000,2 +np.float32,0xbf600d18,0xbf7dc50c,2 +np.float32,0x3ec674ca,0x3ecb768b,2 +np.float32,0x3cb69115,0x3cb694f3,2 +np.float32,0x7eac75f2,0x7f800000,2 +np.float32,0x804d4d75,0x804d4d75,2 +np.float32,0xfed5292e,0xff800000,2 +np.float32,0x800ed06a,0x800ed06a,2 +np.float32,0xfec37584,0xff800000,2 +np.float32,0x3ef96ac7,0x3f01b326,2 +np.float32,0x42f743,0x42f743,2 +np.float32,0x3f56f442,0x3f711e39,2 +np.float32,0xbf7ea726,0xbf956375,2 +np.float32,0x806c7202,0x806c7202,2 +np.float32,0xbd8ee980,0xbd8f0733,2 +np.float32,0xbdf2e930,0xbdf37b18,2 +np.float32,0x3f103910,0x3f17f955,2 +np.float32,0xff123e8f,0xff800000,2 +np.float32,0x806e4b5d,0x806e4b5d,2 +np.float32,0xbf4f3bfc,0xbf669f07,2 +np.float32,0xbf070c16,0xbf0d6609,2 +np.float32,0xff00e0ba,0xff800000,2 +np.float32,0xff49d828,0xff800000,2 +np.float32,0x7e47f04a,0x7f800000,2 +np.float32,0x7e984dac,0x7f800000,2 +np.float32,0x3f77473c,0x3f8fc858,2 +np.float32,0x3f017439,0x3f070ac8,2 +np.float32,0x118417,0x118417,2 +np.float32,0xbcf7a2c0,0xbcf7ac68,2 +np.float32,0xfee46fee,0xff800000,2 +np.float32,0x3e42a648,0x3e43d2e9,2 +np.float32,0x80131916,0x80131916,2 +np.float32,0x806209d3,0x806209d3,2 +np.float32,0x807c1f12,0x807c1f12,2 +np.float32,0x2f3696,0x2f3696,2 +np.float32,0xff28722b,0xff800000,2 +np.float32,0x7f1416a1,0x7f800000,2 +np.float32,0x8054e7a1,0x8054e7a1,2 +np.float32,0xbddc39a0,0xbddca656,2 +np.float32,0x7dc60175,0x7f800000,2 +np.float64,0x7fd0ae584da15cb0,0x7ff0000000000000,2 +np.float64,0x7fd41d68e5283ad1,0x7ff0000000000000,2 +np.float64,0x7fe93073bb7260e6,0x7ff0000000000000,2 +np.float64,0x3fb4fd19d229fa34,0x3fb5031f57dbac0f,2 +np.float64,0x85609ce10ac2,0x85609ce10ac2,2 +np.float64,0xbfd7aa12ccaf5426,0xbfd8351003a320e2,2 +np.float64,0x8004487c9b4890fa,0x8004487c9b4890fa,2 +np.float64,0x7fe7584cfd2eb099,0x7ff0000000000000,2 +np.float64,0x800ea8edc6dd51dc,0x800ea8edc6dd51dc,2 +np.float64,0x3fe0924aa5a12495,0x3fe15276e271c6dc,2 +np.float64,0x3feb1abf6d36357f,0x3fee76b4d3d06964,2 +np.float64,0x3fa8c14534318280,0x3fa8c3bd5ce5923c,2 +np.float64,0x800b9f5915d73eb3,0x800b9f5915d73eb3,2 +np.float64,0xffc05aaa7820b554,0xfff0000000000000,2 +np.float64,0x800157eda8c2afdc,0x800157eda8c2afdc,2 +np.float64,0xffe8d90042b1b200,0xfff0000000000000,2 +np.float64,0x3feda02ea93b405d,0x3ff1057e61d08d59,2 +np.float64,0xffd03b7361a076e6,0xfff0000000000000,2 +np.float64,0x3fe1a8ecd7e351da,0x3fe291eda9080847,2 +np.float64,0xffc5bfdff82b7fc0,0xfff0000000000000,2 +np.float64,0xbfe6fb3d386df67a,0xbfe9022c05df0565,2 +np.float64,0x7fefffffffffffff,0x7ff0000000000000,2 +np.float64,0x7fa10c340c221867,0x7ff0000000000000,2 +np.float64,0x3fe55cbf1daab97e,0x3fe6fc1648258b75,2 +np.float64,0xbfddeb5f60bbd6be,0xbfdf056d4fb5825f,2 +np.float64,0xffddb1a8213b6350,0xfff0000000000000,2 +np.float64,0xbfb20545e4240a88,0xbfb2091579375176,2 +np.float64,0x3f735ded2026bbda,0x3f735df1dad4ee3a,2 +np.float64,0xbfd1eb91efa3d724,0xbfd227c044dead61,2 +np.float64,0xffd737c588ae6f8c,0xfff0000000000000,2 +np.float64,0x3fc46818ec28d032,0x3fc47e416c4237a6,2 +np.float64,0x0,0x0,2 +np.float64,0xffb632097a2c6410,0xfff0000000000000,2 +np.float64,0xbfcb5ae84b36b5d0,0xbfcb905613af55b8,2 +np.float64,0xbfe7b926402f724c,0xbfe9f4f0be6aacc3,2 +np.float64,0x80081840b3f03082,0x80081840b3f03082,2 +np.float64,0x3fe767a656eecf4d,0x3fe98c53b4779de7,2 +np.float64,0x8005834c088b0699,0x8005834c088b0699,2 +np.float64,0x80074e92658e9d26,0x80074e92658e9d26,2 +np.float64,0x80045d60c268bac2,0x80045d60c268bac2,2 +np.float64,0xffb9aecfe8335da0,0xfff0000000000000,2 +np.float64,0x7fcad3e1cd35a7c3,0x7ff0000000000000,2 +np.float64,0xbf881853d03030c0,0xbf8818783e28fc87,2 +np.float64,0xe18c6d23c318e,0xe18c6d23c318e,2 +np.float64,0x7fcb367b8f366cf6,0x7ff0000000000000,2 +np.float64,0x5c13436cb8269,0x5c13436cb8269,2 +np.float64,0xffe5399938aa7332,0xfff0000000000000,2 +np.float64,0xbfdc45dbc3b88bb8,0xbfdd33958222c27e,2 +np.float64,0xbfd714691bae28d2,0xbfd7954edbef810b,2 +np.float64,0xbfdf18b02b3e3160,0xbfe02ad13634c651,2 +np.float64,0x8003e6f276e7cde6,0x8003e6f276e7cde6,2 +np.float64,0x3febb6b412776d68,0x3fef4f753def31f9,2 +np.float64,0x7fe016a3b4a02d46,0x7ff0000000000000,2 +np.float64,0x3fdc899ac7b91336,0x3fdd7e1cee1cdfc8,2 +np.float64,0x800219271e24324f,0x800219271e24324f,2 +np.float64,0x1529d93e2a53c,0x1529d93e2a53c,2 +np.float64,0x800d5bc827fab790,0x800d5bc827fab790,2 +np.float64,0x3e1495107c293,0x3e1495107c293,2 +np.float64,0x3fe89da0f2b13b42,0x3feb1dc1f3015ad7,2 +np.float64,0x800ba8c17b975183,0x800ba8c17b975183,2 +np.float64,0x8002dacf0265b59f,0x8002dacf0265b59f,2 +np.float64,0xffe6d0a4cc2da149,0xfff0000000000000,2 +np.float64,0x3fdf23fe82be47fc,0x3fe03126d8e2b309,2 +np.float64,0xffe41b1f1c28363e,0xfff0000000000000,2 +np.float64,0xbfd635c634ac6b8c,0xbfd6a8966da6adaa,2 +np.float64,0x800755bc08eeab79,0x800755bc08eeab79,2 +np.float64,0x800ba4c47c374989,0x800ba4c47c374989,2 +np.float64,0x7fec9f7649793eec,0x7ff0000000000000,2 +np.float64,0x7fdbf45738b7e8ad,0x7ff0000000000000,2 +np.float64,0x3f5597f07eab4,0x3f5597f07eab4,2 +np.float64,0xbfbf4599183e8b30,0xbfbf5985d8c65097,2 +np.float64,0xbf5b200580364000,0xbf5b2006501b21ae,2 +np.float64,0x7f91868370230d06,0x7ff0000000000000,2 +np.float64,0x3838e2a67071d,0x3838e2a67071d,2 +np.float64,0xffefe3ff5d3fc7fe,0xfff0000000000000,2 +np.float64,0xffe66b26d06cd64d,0xfff0000000000000,2 +np.float64,0xbfd830a571b0614a,0xbfd8c526927c742c,2 +np.float64,0x7fe8442122f08841,0x7ff0000000000000,2 +np.float64,0x800efa8c637df519,0x800efa8c637df519,2 +np.float64,0xf0026835e004d,0xf0026835e004d,2 +np.float64,0xffb11beefe2237e0,0xfff0000000000000,2 +np.float64,0x3fef9bbb327f3776,0x3ff2809f10641c32,2 +np.float64,0x350595306a0b3,0x350595306a0b3,2 +np.float64,0xf7f6538befecb,0xf7f6538befecb,2 +np.float64,0xffe36379c4a6c6f3,0xfff0000000000000,2 +np.float64,0x28b1d82e5163c,0x28b1d82e5163c,2 +np.float64,0x70a3d804e147c,0x70a3d804e147c,2 +np.float64,0xffd96c1bc9b2d838,0xfff0000000000000,2 +np.float64,0xffce8e00893d1c00,0xfff0000000000000,2 +np.float64,0x800f2bdcb25e57b9,0x800f2bdcb25e57b9,2 +np.float64,0xbfe0d9c63361b38c,0xbfe1a3eb02192b76,2 +np.float64,0xbfdc7b8711b8f70e,0xbfdd6e9db3a01e51,2 +np.float64,0x99e22ec133c46,0x99e22ec133c46,2 +np.float64,0xffeaef6ddab5dedb,0xfff0000000000000,2 +np.float64,0x7fe89c22c0f13845,0x7ff0000000000000,2 +np.float64,0x8002d5207de5aa42,0x8002d5207de5aa42,2 +np.float64,0x3fd1b13353236267,0x3fd1eb1b9345dfca,2 +np.float64,0x800ccae0a41995c1,0x800ccae0a41995c1,2 +np.float64,0x3fdbdaba38b7b574,0x3fdcbdfcbca37ce6,2 +np.float64,0x5b06d12cb60db,0x5b06d12cb60db,2 +np.float64,0xffd52262752a44c4,0xfff0000000000000,2 +np.float64,0x5a17f050b42ff,0x5a17f050b42ff,2 +np.float64,0x3d24205e7a485,0x3d24205e7a485,2 +np.float64,0x7fbed4dec63da9bd,0x7ff0000000000000,2 +np.float64,0xbfe56e9776aadd2f,0xbfe71212863c284f,2 +np.float64,0x7fea0bc952341792,0x7ff0000000000000,2 +np.float64,0x800f692d139ed25a,0x800f692d139ed25a,2 +np.float64,0xffdb63feab36c7fe,0xfff0000000000000,2 +np.float64,0x3fe1c2297fe38452,0x3fe2af21293c9571,2 +np.float64,0x7fede384747bc708,0x7ff0000000000000,2 +np.float64,0x800440169288802e,0x800440169288802e,2 +np.float64,0xffe3241eeb26483e,0xfff0000000000000,2 +np.float64,0xffe28f3879651e70,0xfff0000000000000,2 +np.float64,0xa435cbc1486d,0xa435cbc1486d,2 +np.float64,0x7fe55e08db6abc11,0x7ff0000000000000,2 +np.float64,0x1405e624280be,0x1405e624280be,2 +np.float64,0x3fd861bdf0b0c37c,0x3fd8f9d2e33e45e5,2 +np.float64,0x3feeb67cdc3d6cfa,0x3ff1d337d81d1c14,2 +np.float64,0x3fd159a10e22b342,0x3fd1903be7c2ea0c,2 +np.float64,0x3fd84626bc308c4d,0x3fd8dc373645e65b,2 +np.float64,0xffd3da81d9a7b504,0xfff0000000000000,2 +np.float64,0xbfd4a768b8294ed2,0xbfd503aa7c240051,2 +np.float64,0x3fe3059f2a660b3e,0x3fe42983e0c6bb2e,2 +np.float64,0x3fe3b8353827706a,0x3fe4fdd635c7269b,2 +np.float64,0xbfe4af0399695e07,0xbfe6277d9002b46c,2 +np.float64,0xbfd7e18a92afc316,0xbfd87066b54c4fe6,2 +np.float64,0x800432bcab48657a,0x800432bcab48657a,2 +np.float64,0x80033d609d267ac2,0x80033d609d267ac2,2 +np.float64,0x7fef5f758e7ebeea,0x7ff0000000000000,2 +np.float64,0xbfed7833dbfaf068,0xbff0e85bf45a5ebc,2 +np.float64,0x3fe2283985a45073,0x3fe325b0a9099c74,2 +np.float64,0xe820b4b3d0417,0xe820b4b3d0417,2 +np.float64,0x8003ecb72aa7d96f,0x8003ecb72aa7d96f,2 +np.float64,0xbfeab2c755b5658f,0xbfede7c83e92a625,2 +np.float64,0xbfc7b287f72f6510,0xbfc7d53ef2ffe9dc,2 +np.float64,0xffd9a41d0f33483a,0xfff0000000000000,2 +np.float64,0x3fd3a5b6e3a74b6c,0x3fd3f516f39a4725,2 +np.float64,0x800bc72091578e42,0x800bc72091578e42,2 +np.float64,0x800ff405ce9fe80c,0x800ff405ce9fe80c,2 +np.float64,0x57918600af24,0x57918600af24,2 +np.float64,0x2a5be7fa54b7e,0x2a5be7fa54b7e,2 +np.float64,0xbfdca7886bb94f10,0xbfdd9f142b5b43e4,2 +np.float64,0xbfe216993ee42d32,0xbfe3112936590995,2 +np.float64,0xbfe06bd9cf20d7b4,0xbfe126cd353ab42f,2 +np.float64,0x8003e6c31827cd87,0x8003e6c31827cd87,2 +np.float64,0x8005f37d810be6fc,0x8005f37d810be6fc,2 +np.float64,0x800715b081ae2b62,0x800715b081ae2b62,2 +np.float64,0x3fef94c35bff2986,0x3ff27b4bed2f4051,2 +np.float64,0x6f5798e0deb0,0x6f5798e0deb0,2 +np.float64,0x3fcef1f05c3de3e1,0x3fcf3f557550598f,2 +np.float64,0xbf9a91c400352380,0xbf9a92876273b85c,2 +np.float64,0x3fc9143f7f322880,0x3fc93d678c05d26b,2 +np.float64,0x78ad847af15b1,0x78ad847af15b1,2 +np.float64,0x8000fdc088c1fb82,0x8000fdc088c1fb82,2 +np.float64,0x800200fd304401fb,0x800200fd304401fb,2 +np.float64,0x7fb8ab09dc315613,0x7ff0000000000000,2 +np.float64,0x3fe949771b7292ee,0x3fec00891c3fc5a2,2 +np.float64,0xbfc54cae0e2a995c,0xbfc565e0f3d0e3af,2 +np.float64,0xffd546161e2a8c2c,0xfff0000000000000,2 +np.float64,0x800fe1d1279fc3a2,0x800fe1d1279fc3a2,2 +np.float64,0x3fd9c45301b388a8,0x3fda77fa1f4c79bf,2 +np.float64,0x7fe10ff238221fe3,0x7ff0000000000000,2 +np.float64,0xbfbc2181ae384300,0xbfbc3002229155c4,2 +np.float64,0xbfe7bbfae4ef77f6,0xbfe9f895e91f468d,2 +np.float64,0x800d3d994f7a7b33,0x800d3d994f7a7b33,2 +np.float64,0xffe6e15a896dc2b4,0xfff0000000000000,2 +np.float64,0x800e6b6c8abcd6d9,0x800e6b6c8abcd6d9,2 +np.float64,0xbfd862c938b0c592,0xbfd8faf1cdcb09db,2 +np.float64,0xffe2411f8464823e,0xfff0000000000000,2 +np.float64,0xffd0b32efaa1665e,0xfff0000000000000,2 +np.float64,0x3ac4ace475896,0x3ac4ace475896,2 +np.float64,0xf9c3a7ebf3875,0xf9c3a7ebf3875,2 +np.float64,0xdb998ba5b7332,0xdb998ba5b7332,2 +np.float64,0xbfe438a14fe87142,0xbfe5981751e4c5cd,2 +np.float64,0xbfbcf48cbc39e918,0xbfbd045d60e65d3a,2 +np.float64,0x7fde499615bc932b,0x7ff0000000000000,2 +np.float64,0x800bba269057744e,0x800bba269057744e,2 +np.float64,0x3fc9bb1ba3337638,0x3fc9e78fdb6799c1,2 +np.float64,0xffd9f974fbb3f2ea,0xfff0000000000000,2 +np.float64,0x7fcf1ad1693e35a2,0x7ff0000000000000,2 +np.float64,0x7fe5dcedd32bb9db,0x7ff0000000000000,2 +np.float64,0xeb06500bd60ca,0xeb06500bd60ca,2 +np.float64,0x7fd73e7b592e7cf6,0x7ff0000000000000,2 +np.float64,0xbfe9d91ae873b236,0xbfecc08482849bcd,2 +np.float64,0xffc85338b730a670,0xfff0000000000000,2 +np.float64,0x7fbba41eee37483d,0x7ff0000000000000,2 +np.float64,0x3fed5624fb7aac4a,0x3ff0cf9f0de1fd54,2 +np.float64,0xffe566d80d6acdb0,0xfff0000000000000,2 +np.float64,0x3fd4477884a88ef1,0x3fd49ec7acdd25a0,2 +np.float64,0x3fcb98c5fd37318c,0x3fcbcfa20e2c2712,2 +np.float64,0xffdeba71d5bd74e4,0xfff0000000000000,2 +np.float64,0x8001edc59dc3db8c,0x8001edc59dc3db8c,2 +np.float64,0x3fe6b09e896d613e,0x3fe8a3bb541ec0e3,2 +np.float64,0x3fe8694b4970d296,0x3fead94d271d05cf,2 +np.float64,0xb52c27bf6a585,0xb52c27bf6a585,2 +np.float64,0x7fcb0a21d9361443,0x7ff0000000000000,2 +np.float64,0xbfd9efc68cb3df8e,0xbfdaa7058c0ccbd1,2 +np.float64,0x8007cd170fef9a2f,0x8007cd170fef9a2f,2 +np.float64,0x3fe83325e770664c,0x3fea92c55c9d567e,2 +np.float64,0x800bd0085537a011,0x800bd0085537a011,2 +np.float64,0xffe05b9e7820b73c,0xfff0000000000000,2 +np.float64,0x3fea4ce4347499c8,0x3fed5cea9fdc541b,2 +np.float64,0x7fe08aae1921155b,0x7ff0000000000000,2 +np.float64,0x3fe7a5e7deef4bd0,0x3fe9dc2e20cfb61c,2 +np.float64,0xbfe0ccc8e6e19992,0xbfe195175f32ee3f,2 +np.float64,0xbfe8649717f0c92e,0xbfead3298974dcf0,2 +np.float64,0x7fed6c5308bad8a5,0x7ff0000000000000,2 +np.float64,0xffdbd8c7af37b190,0xfff0000000000000,2 +np.float64,0xbfb2bc4d06257898,0xbfb2c09569912839,2 +np.float64,0x3fc62eca512c5d95,0x3fc64b4251bce8f9,2 +np.float64,0xbfcae2ddbd35c5bc,0xbfcb15971fc61312,2 +np.float64,0x18d26ce831a4f,0x18d26ce831a4f,2 +np.float64,0x7fe38b279267164e,0x7ff0000000000000,2 +np.float64,0x97e1d9ab2fc3b,0x97e1d9ab2fc3b,2 +np.float64,0xbfee8e4785fd1c8f,0xbff1b52d16807627,2 +np.float64,0xbfb189b4a6231368,0xbfb18d37e83860ee,2 +np.float64,0xffd435761ea86aec,0xfff0000000000000,2 +np.float64,0x3fe6c48ebced891e,0x3fe8bcea189c3867,2 +np.float64,0x7fdadd3678b5ba6c,0x7ff0000000000000,2 +np.float64,0x7fea8f15b7b51e2a,0x7ff0000000000000,2 +np.float64,0xbff0000000000000,0xbff2cd9fc44eb982,2 +np.float64,0x80004c071120980f,0x80004c071120980f,2 +np.float64,0x8005367adfea6cf6,0x8005367adfea6cf6,2 +np.float64,0x3fbdc9139a3b9220,0x3fbdda4aba667ce5,2 +np.float64,0x7fed5ee3ad7abdc6,0x7ff0000000000000,2 +np.float64,0x51563fb2a2ac9,0x51563fb2a2ac9,2 +np.float64,0xbfba7d26ce34fa50,0xbfba894229c50ea1,2 +np.float64,0x6c10db36d821c,0x6c10db36d821c,2 +np.float64,0xbfbdaec0d03b5d80,0xbfbdbfca6ede64f4,2 +np.float64,0x800a1cbe7414397d,0x800a1cbe7414397d,2 +np.float64,0x800ae6e7f2d5cdd0,0x800ae6e7f2d5cdd0,2 +np.float64,0x3fea63d3fef4c7a8,0x3fed7c1356688ddc,2 +np.float64,0xbfde1e3a88bc3c76,0xbfdf3dfb09cc2260,2 +np.float64,0xbfd082d75a2105ae,0xbfd0b1e28c84877b,2 +np.float64,0x7fea1e5e85f43cbc,0x7ff0000000000000,2 +np.float64,0xffe2237a1a6446f4,0xfff0000000000000,2 +np.float64,0x3fd1e2be8523c57d,0x3fd21e93dfd1bbc4,2 +np.float64,0x3fd1acd428a359a8,0x3fd1e6916a42bc3a,2 +np.float64,0x61a152f0c342b,0x61a152f0c342b,2 +np.float64,0xbfc61a6b902c34d8,0xbfc6369557690ba0,2 +np.float64,0x7fd1a84b1f235095,0x7ff0000000000000,2 +np.float64,0x1c5cc7e638b9a,0x1c5cc7e638b9a,2 +np.float64,0x8008039755f0072f,0x8008039755f0072f,2 +np.float64,0x80097532d6f2ea66,0x80097532d6f2ea66,2 +np.float64,0xbfc6d979a12db2f4,0xbfc6f89777c53f8f,2 +np.float64,0x8004293ab1085276,0x8004293ab1085276,2 +np.float64,0x3fc2af5c21255eb8,0x3fc2c05dc0652554,2 +np.float64,0xbfd9a5ab87b34b58,0xbfda56d1076abc98,2 +np.float64,0xbfebd360ba77a6c2,0xbfef779fd6595f9b,2 +np.float64,0xffd5313c43aa6278,0xfff0000000000000,2 +np.float64,0xbfe994a262b32945,0xbfec64b969852ed5,2 +np.float64,0x3fce01a52e3c034a,0x3fce48324eb29c31,2 +np.float64,0x56bd74b2ad7af,0x56bd74b2ad7af,2 +np.float64,0xb84093ff70813,0xb84093ff70813,2 +np.float64,0x7fe776df946eedbe,0x7ff0000000000000,2 +np.float64,0xbfe294ac2e652958,0xbfe3a480938afa26,2 +np.float64,0x7fe741b4d0ee8369,0x7ff0000000000000,2 +np.float64,0x800b7e8a1056fd15,0x800b7e8a1056fd15,2 +np.float64,0x7fd28f1269251e24,0x7ff0000000000000,2 +np.float64,0x8009d4492e73a893,0x8009d4492e73a893,2 +np.float64,0x3fe3f27fca67e500,0x3fe543aff825e244,2 +np.float64,0x3fd12447e5a24890,0x3fd158efe43c0452,2 +np.float64,0xbfd58df0f2ab1be2,0xbfd5f6d908e3ebce,2 +np.float64,0xffc0a8e4642151c8,0xfff0000000000000,2 +np.float64,0xbfedb197787b632f,0xbff112367ec9d3e7,2 +np.float64,0xffdde07a7f3bc0f4,0xfff0000000000000,2 +np.float64,0x3fe91f3e5b723e7d,0x3febc886a1d48364,2 +np.float64,0x3fe50415236a082a,0x3fe68f43a5468d8c,2 +np.float64,0xd9a0c875b3419,0xd9a0c875b3419,2 +np.float64,0xbfee04ccf4bc099a,0xbff14f4740a114cf,2 +np.float64,0xbfd2bcc6a125798e,0xbfd30198b1e7d7ed,2 +np.float64,0xbfeb3c16f8f6782e,0xbfeea4ce47d09f58,2 +np.float64,0xffd3ba19e4a77434,0xfff0000000000000,2 +np.float64,0x8010000000000000,0x8010000000000000,2 +np.float64,0x3fdef0a642bde14d,0x3fe0146677b3a488,2 +np.float64,0x3fdc3dd0a2b87ba0,0x3fdd2abe65651487,2 +np.float64,0x3fdbb1fd47b763fb,0x3fdc915a2fd19f4b,2 +np.float64,0x7fbaa375e63546eb,0x7ff0000000000000,2 +np.float64,0x433ef8ee867e0,0x433ef8ee867e0,2 +np.float64,0xf5345475ea68b,0xf5345475ea68b,2 +np.float64,0xa126419b424c8,0xa126419b424c8,2 +np.float64,0x3fe0057248200ae5,0x3fe0b2f488339709,2 +np.float64,0xffc5e3b82f2bc770,0xfff0000000000000,2 +np.float64,0xffb215c910242b90,0xfff0000000000000,2 +np.float64,0xbfeba4ae0837495c,0xbfef3642e4b54aac,2 +np.float64,0xffbb187ebe363100,0xfff0000000000000,2 +np.float64,0x3fe4c6a496a98d49,0x3fe64440cdf06aab,2 +np.float64,0x800767a28f6ecf46,0x800767a28f6ecf46,2 +np.float64,0x3fdbed63b1b7dac8,0x3fdcd27318c0b683,2 +np.float64,0x80006d8339e0db07,0x80006d8339e0db07,2 +np.float64,0x8000b504f0416a0b,0x8000b504f0416a0b,2 +np.float64,0xbfe88055bfb100ac,0xbfeaf767bd2767b9,2 +np.float64,0x3fefe503317fca06,0x3ff2b8d4057240c8,2 +np.float64,0x7fe307538b660ea6,0x7ff0000000000000,2 +np.float64,0x944963c12892d,0x944963c12892d,2 +np.float64,0xbfd2c20b38a58416,0xbfd30717900f8233,2 +np.float64,0x7feed04e3e3da09b,0x7ff0000000000000,2 +np.float64,0x3fe639619cac72c3,0x3fe80de7b8560a8d,2 +np.float64,0x3fde066c66bc0cd9,0x3fdf237fb759a652,2 +np.float64,0xbfc56b22b52ad644,0xbfc584c267a47ebd,2 +np.float64,0x3fc710d5b12e21ab,0x3fc730d817ba0d0c,2 +np.float64,0x3fee1dfc347c3bf8,0x3ff161d9c3e15f68,2 +np.float64,0x3fde400954bc8013,0x3fdf639e5cc9e7a9,2 +np.float64,0x56e701f8adce1,0x56e701f8adce1,2 +np.float64,0xbfe33bbc89e67779,0xbfe46996b39381fe,2 +np.float64,0x7fec89e2f87913c5,0x7ff0000000000000,2 +np.float64,0xbfdad58b40b5ab16,0xbfdba098cc0ad5d3,2 +np.float64,0x3fe99c76a13338ed,0x3fec6f31bae613e7,2 +np.float64,0x3fe4242a29a84854,0x3fe57f6b45e5c0ef,2 +np.float64,0xbfe79d3199ef3a63,0xbfe9d0fb96c846ba,2 +np.float64,0x7ff8000000000000,0x7ff8000000000000,2 +np.float64,0xbfeb35a6cf766b4e,0xbfee9be4e7e943f7,2 +np.float64,0x3e047f267c091,0x3e047f267c091,2 +np.float64,0x4bf1376a97e28,0x4bf1376a97e28,2 +np.float64,0x800ef419685de833,0x800ef419685de833,2 +np.float64,0x3fe0efa61a21df4c,0x3fe1bce98baf2f0f,2 +np.float64,0x3fcc13c4d738278a,0x3fcc4d8c778bcaf7,2 +np.float64,0x800f1d291afe3a52,0x800f1d291afe3a52,2 +np.float64,0x3fd3f10e6da7e21d,0x3fd444106761ea1d,2 +np.float64,0x800706d6d76e0dae,0x800706d6d76e0dae,2 +np.float64,0xffa1ffbc9023ff80,0xfff0000000000000,2 +np.float64,0xbfe098f26d6131e5,0xbfe15a08a5f3eac0,2 +np.float64,0x3fe984f9cc7309f4,0x3fec4fcdbdb1cb9b,2 +np.float64,0x7fd7c2f1eaaf85e3,0x7ff0000000000000,2 +np.float64,0x800a8adb64f515b7,0x800a8adb64f515b7,2 +np.float64,0x80060d3ffc8c1a81,0x80060d3ffc8c1a81,2 +np.float64,0xbfec37e4aef86fc9,0xbff0029a6a1d61e2,2 +np.float64,0x800b21bcfcf6437a,0x800b21bcfcf6437a,2 +np.float64,0xbfc08facc1211f58,0xbfc09b8380ea8032,2 +np.float64,0xffebb4b52577696a,0xfff0000000000000,2 +np.float64,0x800b08096df61013,0x800b08096df61013,2 +np.float64,0x8000000000000000,0x8000000000000000,2 +np.float64,0xffd2f0c9c8a5e194,0xfff0000000000000,2 +np.float64,0xffe78b2299af1644,0xfff0000000000000,2 +np.float64,0x7fd0444794a0888e,0x7ff0000000000000,2 +np.float64,0x307c47b460f8a,0x307c47b460f8a,2 +np.float64,0xffe6b4c851ad6990,0xfff0000000000000,2 +np.float64,0xffe1877224a30ee4,0xfff0000000000000,2 +np.float64,0x48d7b5c091af7,0x48d7b5c091af7,2 +np.float64,0xbfa1dc6b1c23b8d0,0xbfa1dd5889e1b7da,2 +np.float64,0x3fe5004737ea008e,0x3fe68a9c310b08c1,2 +np.float64,0x7fec5f0742b8be0e,0x7ff0000000000000,2 +np.float64,0x3fd0a86285a150c5,0x3fd0d8b238d557fa,2 +np.float64,0x7fed60380efac06f,0x7ff0000000000000,2 +np.float64,0xeeca74dfdd94f,0xeeca74dfdd94f,2 +np.float64,0x3fda05aaa8b40b54,0x3fdabebdbf405e84,2 +np.float64,0x800e530ceb1ca61a,0x800e530ceb1ca61a,2 +np.float64,0x800b3866379670cd,0x800b3866379670cd,2 +np.float64,0xffedb3e7fa3b67cf,0xfff0000000000000,2 +np.float64,0xffdfa4c0713f4980,0xfff0000000000000,2 +np.float64,0x7fe4679e0728cf3b,0x7ff0000000000000,2 +np.float64,0xffe978611ef2f0c2,0xfff0000000000000,2 +np.float64,0x7fc9f4601f33e8bf,0x7ff0000000000000,2 +np.float64,0x3fd4942de6a9285c,0x3fd4ef6e089357dd,2 +np.float64,0x3faafe064435fc00,0x3fab0139cd6564dc,2 +np.float64,0x800d145a519a28b5,0x800d145a519a28b5,2 +np.float64,0xbfd82636f2304c6e,0xbfd8b9f75ddd2f02,2 +np.float64,0xbfdf2e975e3e5d2e,0xbfe037174280788c,2 +np.float64,0x7fd7051d7c2e0a3a,0x7ff0000000000000,2 +np.float64,0x8007933d452f267b,0x8007933d452f267b,2 +np.float64,0xb2043beb64088,0xb2043beb64088,2 +np.float64,0x3febfd9708f7fb2e,0x3fefb2ef090f18d2,2 +np.float64,0xffd9bc6bc83378d8,0xfff0000000000000,2 +np.float64,0xc10f9fd3821f4,0xc10f9fd3821f4,2 +np.float64,0x3fe3c83413a79068,0x3fe510fa1dd8edf7,2 +np.float64,0x3fbe26ccda3c4da0,0x3fbe38a892279975,2 +np.float64,0x3fcc1873103830e6,0x3fcc5257a6ae168d,2 +np.float64,0xe7e000e9cfc00,0xe7e000e9cfc00,2 +np.float64,0xffda73852bb4e70a,0xfff0000000000000,2 +np.float64,0xbfe831be19f0637c,0xbfea90f1b34da3e5,2 +np.float64,0xbfeb568f3076ad1e,0xbfeec97eebfde862,2 +np.float64,0x510a6ad0a214e,0x510a6ad0a214e,2 +np.float64,0x3fe6ba7e35ed74fc,0x3fe8b032a9a28c6a,2 +np.float64,0xffeb5cdcff76b9b9,0xfff0000000000000,2 +np.float64,0x4f0a23e89e145,0x4f0a23e89e145,2 +np.float64,0x446ec20288dd9,0x446ec20288dd9,2 +np.float64,0x7fe2521b02e4a435,0x7ff0000000000000,2 +np.float64,0x8001cd2969e39a54,0x8001cd2969e39a54,2 +np.float64,0x3fdfe90600bfd20c,0x3fe09fdcca10001c,2 +np.float64,0x7fd660c5762cc18a,0x7ff0000000000000,2 +np.float64,0xbfb11b23aa223648,0xbfb11e661949b377,2 +np.float64,0x800e025285fc04a5,0x800e025285fc04a5,2 +np.float64,0xffb180bb18230178,0xfff0000000000000,2 +np.float64,0xaaf590df55eb2,0xaaf590df55eb2,2 +np.float64,0xbfe8637d9df0c6fb,0xbfead1ba429462ec,2 +np.float64,0x7fd2577866a4aef0,0x7ff0000000000000,2 +np.float64,0xbfcfb2ab5a3f6558,0xbfd002ee87f272b9,2 +np.float64,0x7fdd64ae2f3ac95b,0x7ff0000000000000,2 +np.float64,0xffd1a502c9234a06,0xfff0000000000000,2 +np.float64,0x7fc4be4b60297c96,0x7ff0000000000000,2 +np.float64,0xbfb46b712a28d6e0,0xbfb470fca9919172,2 +np.float64,0xffdef913033df226,0xfff0000000000000,2 +np.float64,0x3fd94a3545b2946b,0x3fd9f40431ce9f9c,2 +np.float64,0x7fef88a0b6ff1140,0x7ff0000000000000,2 +np.float64,0xbfbcc81876399030,0xbfbcd7a0ab6cb388,2 +np.float64,0x800a4acfdd9495a0,0x800a4acfdd9495a0,2 +np.float64,0xffe270b3d5e4e167,0xfff0000000000000,2 +np.float64,0xbfd23f601e247ec0,0xbfd27eeca50a49eb,2 +np.float64,0x7fec6e796a78dcf2,0x7ff0000000000000,2 +np.float64,0x3fb85e0c9630bc19,0x3fb867791ccd6c72,2 +np.float64,0x7fe49fc424a93f87,0x7ff0000000000000,2 +np.float64,0xbfe75a99fbaeb534,0xbfe97ba37663de4c,2 +np.float64,0xffe85011b630a023,0xfff0000000000000,2 +np.float64,0xffe5962e492b2c5c,0xfff0000000000000,2 +np.float64,0x6f36ed4cde6de,0x6f36ed4cde6de,2 +np.float64,0x3feb72170af6e42e,0x3feeefbe6f1a2084,2 +np.float64,0x80014d8d60629b1c,0x80014d8d60629b1c,2 +np.float64,0xbfe0eb40d321d682,0xbfe1b7e31f252bf1,2 +np.float64,0x31fe305663fc7,0x31fe305663fc7,2 +np.float64,0x3fd2cd6381a59ac7,0x3fd312edc9868a4d,2 +np.float64,0xffcf0720793e0e40,0xfff0000000000000,2 +np.float64,0xbfeef1ef133de3de,0xbff1ffd5e1a3b648,2 +np.float64,0xbfd01c787aa038f0,0xbfd0482be3158a01,2 +np.float64,0x3fda3607c5b46c10,0x3fdaf3301e217301,2 +np.float64,0xffda9a9911b53532,0xfff0000000000000,2 +np.float64,0x3fc0b37c392166f8,0x3fc0bfa076f3c43e,2 +np.float64,0xbfe06591c760cb24,0xbfe11fad179ea12c,2 +np.float64,0x8006e369c20dc6d4,0x8006e369c20dc6d4,2 +np.float64,0x3fdf2912a8be5224,0x3fe033ff74b92f4d,2 +np.float64,0xffc0feb07821fd60,0xfff0000000000000,2 +np.float64,0xa4b938c949727,0xa4b938c949727,2 +np.float64,0x8008fe676571fccf,0x8008fe676571fccf,2 +np.float64,0xbfdda68459bb4d08,0xbfdeb8faab34fcbc,2 +np.float64,0xbfda18b419343168,0xbfdad360ca52ec7c,2 +np.float64,0x3febcbae35b7975c,0x3fef6cd51c9ebc15,2 +np.float64,0x3fbec615f63d8c30,0x3fbed912ba729926,2 +np.float64,0x7f99a831c8335063,0x7ff0000000000000,2 +np.float64,0x3fe663e8826cc7d1,0x3fe84330bd9aada8,2 +np.float64,0x70a9f9e6e1540,0x70a9f9e6e1540,2 +np.float64,0x8a13a5db14275,0x8a13a5db14275,2 +np.float64,0x7fc4330a3b286613,0x7ff0000000000000,2 +np.float64,0xbfe580c6136b018c,0xbfe728806cc7a99a,2 +np.float64,0x8000000000000001,0x8000000000000001,2 +np.float64,0xffec079d5df80f3a,0xfff0000000000000,2 +np.float64,0x8e1173c31c22f,0x8e1173c31c22f,2 +np.float64,0x3fe088456d21108b,0x3fe14712ca414103,2 +np.float64,0x3fe1b76f73636edf,0x3fe2a2b658557112,2 +np.float64,0xbfd4a1dd162943ba,0xbfd4fdd45cae8fb8,2 +np.float64,0x7fd60b46c8ac168d,0x7ff0000000000000,2 +np.float64,0xffe36cc3b166d987,0xfff0000000000000,2 +np.float64,0x3fdc2ae0cfb855c0,0x3fdd15f026773151,2 +np.float64,0xbfc41aa203283544,0xbfc42fd1b145fdd5,2 +np.float64,0xffed90c55fbb218a,0xfff0000000000000,2 +np.float64,0x3fe67e3a9aecfc75,0x3fe86440db65b4f6,2 +np.float64,0x7fd12dbeaba25b7c,0x7ff0000000000000,2 +np.float64,0xbfe1267c0de24cf8,0xbfe1fbb611bdf1e9,2 +np.float64,0x22e5619645cad,0x22e5619645cad,2 +np.float64,0x7fe327c72ea64f8d,0x7ff0000000000000,2 +np.float64,0x7fd2c3f545a587ea,0x7ff0000000000000,2 +np.float64,0x7fc7b689372f6d11,0x7ff0000000000000,2 +np.float64,0xc5e140bd8bc28,0xc5e140bd8bc28,2 +np.float64,0x3fccb3627a3966c5,0x3fccf11b44fa4102,2 +np.float64,0xbfd2cf725c259ee4,0xbfd315138d0e5dca,2 +np.float64,0x10000000000000,0x10000000000000,2 +np.float64,0xbfd3dfa8b627bf52,0xbfd431d17b235477,2 +np.float64,0xbfb82124e6304248,0xbfb82a4b6d9c2663,2 +np.float64,0x3fdcd590d9b9ab22,0x3fddd1d548806347,2 +np.float64,0x7fdee0cd1b3dc199,0x7ff0000000000000,2 +np.float64,0x8004ebfc60a9d7fa,0x8004ebfc60a9d7fa,2 +np.float64,0x3fe8eb818b71d704,0x3feb842679806108,2 +np.float64,0xffdd5e8fe63abd20,0xfff0000000000000,2 +np.float64,0xbfe3efcbd9e7df98,0xbfe54071436645ee,2 +np.float64,0x3fd5102557aa204b,0x3fd57203d31a05b8,2 +np.float64,0x3fe6318af7ec6316,0x3fe8041a177cbf96,2 +np.float64,0x3fdf3cecdabe79da,0x3fe03f2084ffbc78,2 +np.float64,0x7fe0ab6673a156cc,0x7ff0000000000000,2 +np.float64,0x800037d5c6c06fac,0x800037d5c6c06fac,2 +np.float64,0xffce58b86a3cb170,0xfff0000000000000,2 +np.float64,0xbfe3455d6ce68abb,0xbfe475034cecb2b8,2 +np.float64,0x991b663d3236d,0x991b663d3236d,2 +np.float64,0x3fda82d37c3505a7,0x3fdb46973da05c12,2 +np.float64,0x3f9b736fa036e6df,0x3f9b74471c234411,2 +np.float64,0x8001c96525e392cb,0x8001c96525e392cb,2 +np.float64,0x7ff0000000000000,0x7ff0000000000000,2 +np.float64,0xbfaf59122c3eb220,0xbfaf5e15f8b272b0,2 +np.float64,0xbf9aa7d288354fa0,0xbf9aa897d2a40cb5,2 +np.float64,0x8004a43428694869,0x8004a43428694869,2 +np.float64,0x7feead476dbd5a8e,0x7ff0000000000000,2 +np.float64,0xffca150f81342a20,0xfff0000000000000,2 +np.float64,0x80047ec3bc88fd88,0x80047ec3bc88fd88,2 +np.float64,0xbfee3e5b123c7cb6,0xbff179c8b8334278,2 +np.float64,0x3fd172359f22e46b,0x3fd1a9ba6b1420a1,2 +np.float64,0x3fe8e5e242f1cbc5,0x3feb7cbcaefc4d5c,2 +np.float64,0x8007fb059a6ff60c,0x8007fb059a6ff60c,2 +np.float64,0xe3899e71c7134,0xe3899e71c7134,2 +np.float64,0x7fe3b98326a77305,0x7ff0000000000000,2 +np.float64,0x7fec4e206cb89c40,0x7ff0000000000000,2 +np.float64,0xbfa3b012c4276020,0xbfa3b150c13b3cc5,2 +np.float64,0xffefffffffffffff,0xfff0000000000000,2 +np.float64,0xffe28a5b9aa514b6,0xfff0000000000000,2 +np.float64,0xbfd76a6cc2aed4da,0xbfd7f10f4d04e7f6,2 +np.float64,0xbc2b1c0178564,0xbc2b1c0178564,2 +np.float64,0x6d9d444adb3a9,0x6d9d444adb3a9,2 +np.float64,0xbfdcadd368395ba6,0xbfdda6037b5c429c,2 +np.float64,0x3fe11891fde23124,0x3fe1ebc1c204b14b,2 +np.float64,0x3fdd66c3eebacd88,0x3fde72526b5304c4,2 +np.float64,0xbfe79d85612f3b0b,0xbfe9d1673bd1f6d6,2 +np.float64,0x3fed60abdabac158,0x3ff0d7426b3800a2,2 +np.float64,0xbfb0ffa54021ff48,0xbfb102d81073a9f0,2 +np.float64,0xd2452af5a48a6,0xd2452af5a48a6,2 +np.float64,0xf4b835c1e971,0xf4b835c1e971,2 +np.float64,0x7e269cdafc4d4,0x7e269cdafc4d4,2 +np.float64,0x800097a21d812f45,0x800097a21d812f45,2 +np.float64,0x3fdfcc85e8bf990c,0x3fe08fcf770fd456,2 +np.float64,0xd8d53155b1aa6,0xd8d53155b1aa6,2 +np.float64,0x7fb8ed658831daca,0x7ff0000000000000,2 +np.float64,0xbfec865415b90ca8,0xbff03a4584d719f9,2 +np.float64,0xffd8cda62a319b4c,0xfff0000000000000,2 +np.float64,0x273598d84e6b4,0x273598d84e6b4,2 +np.float64,0x7fd566b5c32acd6b,0x7ff0000000000000,2 +np.float64,0xff61d9d48023b400,0xfff0000000000000,2 +np.float64,0xbfec5c3bf4f8b878,0xbff01c594243337c,2 +np.float64,0x7fd1be0561a37c0a,0x7ff0000000000000,2 +np.float64,0xffeaee3271b5dc64,0xfff0000000000000,2 +np.float64,0x800c0e1931b81c33,0x800c0e1931b81c33,2 +np.float64,0xbfad1171583a22e0,0xbfad1570e5c466d2,2 +np.float64,0x7fd783b0fe2f0761,0x7ff0000000000000,2 +np.float64,0x7fc39903e6273207,0x7ff0000000000000,2 +np.float64,0xffe00003c5600007,0xfff0000000000000,2 +np.float64,0x35a7b9c06b50,0x35a7b9c06b50,2 +np.float64,0x7fee441a22bc8833,0x7ff0000000000000,2 +np.float64,0xff6e47fbc03c9000,0xfff0000000000000,2 +np.float64,0xbfd3c3c9c8a78794,0xbfd41499b1912534,2 +np.float64,0x82c9c87f05939,0x82c9c87f05939,2 +np.float64,0xbfedeb0fe4fbd620,0xbff13c573ce9d3d0,2 +np.float64,0x2b79298656f26,0x2b79298656f26,2 +np.float64,0xbf5ee44f003dc800,0xbf5ee4503353c0ba,2 +np.float64,0xbfe1dd264e63ba4c,0xbfe2ce68116c7bf6,2 +np.float64,0x3fece10b7579c217,0x3ff07b21b11799c6,2 +np.float64,0x3fba47143a348e28,0x3fba52e601adf24c,2 +np.float64,0xffe9816e7a7302dc,0xfff0000000000000,2 +np.float64,0x8009a8047fd35009,0x8009a8047fd35009,2 +np.float64,0x800ac28e4e95851d,0x800ac28e4e95851d,2 +np.float64,0x80093facf4f27f5a,0x80093facf4f27f5a,2 +np.float64,0x3ff0000000000000,0x3ff2cd9fc44eb982,2 +np.float64,0x3fe76a9857eed530,0x3fe99018a5895a4f,2 +np.float64,0xbfd13c59a3a278b4,0xbfd171e133df0b16,2 +np.float64,0x7feb43bc83368778,0x7ff0000000000000,2 +np.float64,0xbfe2970c5fa52e18,0xbfe3a74a434c6efe,2 +np.float64,0xffd091c380212388,0xfff0000000000000,2 +np.float64,0x3febb3b9d2f76774,0x3fef4b4af2bd8580,2 +np.float64,0x7fec66787ef8ccf0,0x7ff0000000000000,2 +np.float64,0xbf935e185826bc40,0xbf935e640557a354,2 +np.float64,0x979df1552f3be,0x979df1552f3be,2 +np.float64,0x7fc096ee73212ddc,0x7ff0000000000000,2 +np.float64,0xbfe9de88faf3bd12,0xbfecc7d1ae691d1b,2 +np.float64,0x7fdc733f06b8e67d,0x7ff0000000000000,2 +np.float64,0xffd71be1a0ae37c4,0xfff0000000000000,2 +np.float64,0xb50dabd36a1b6,0xb50dabd36a1b6,2 +np.float64,0x7fce3d94d63c7b29,0x7ff0000000000000,2 +np.float64,0x7fbaf95e4435f2bc,0x7ff0000000000000,2 +np.float64,0x81a32a6f03466,0x81a32a6f03466,2 +np.float64,0xa99b5b4d5336c,0xa99b5b4d5336c,2 +np.float64,0x7f97c1eeb82f83dc,0x7ff0000000000000,2 +np.float64,0x3fe761636d6ec2c6,0x3fe98451160d2ffb,2 +np.float64,0xbfe3224ef5e6449e,0xbfe44b73eeadac52,2 +np.float64,0x7fde6feb0dbcdfd5,0x7ff0000000000000,2 +np.float64,0xbfee87f9ca7d0ff4,0xbff1b079e9d7f706,2 +np.float64,0x3fe46f4c9828de99,0x3fe5da2ab9609ea5,2 +np.float64,0xffb92fe882325fd0,0xfff0000000000000,2 +np.float64,0x80054bc63cea978d,0x80054bc63cea978d,2 +np.float64,0x3d988bea7b312,0x3d988bea7b312,2 +np.float64,0x3fe6468e1d6c8d1c,0x3fe81e64d37d39a8,2 +np.float64,0x3fd68eefc22d1de0,0x3fd7074264faeead,2 +np.float64,0xffb218a074243140,0xfff0000000000000,2 +np.float64,0x3fdbcb3b6cb79678,0x3fdcad011de40b7d,2 +np.float64,0x7fe3c161772782c2,0x7ff0000000000000,2 +np.float64,0x25575c904aaec,0x25575c904aaec,2 +np.float64,0x800fa43a8f5f4875,0x800fa43a8f5f4875,2 +np.float64,0x3fe41fc9e1e83f94,0x3fe57a25dd1a37f1,2 +np.float64,0x3fd895f4a7b12be9,0x3fd931e7b721a08a,2 +np.float64,0xce31469f9c629,0xce31469f9c629,2 +np.float64,0xffea0f55ca341eab,0xfff0000000000000,2 +np.float64,0xffe831c9ba306393,0xfff0000000000000,2 +np.float64,0x7fe2056f03a40add,0x7ff0000000000000,2 +np.float64,0x7fd6b075e02d60eb,0x7ff0000000000000,2 +np.float64,0x3fdfbef4273f7de8,0x3fe0882c1f59efc0,2 +np.float64,0x8005b9e094ab73c2,0x8005b9e094ab73c2,2 +np.float64,0x3fea881ac6351036,0x3fedad7a319b887c,2 +np.float64,0xbfe2c61c7ee58c39,0xbfe3de9a99d8a9c6,2 +np.float64,0x30b0d3786161b,0x30b0d3786161b,2 +np.float64,0x3fa51d56a02a3aad,0x3fa51edee2d2ecef,2 +np.float64,0x79745732f2e8c,0x79745732f2e8c,2 +np.float64,0x800d55b4907aab69,0x800d55b4907aab69,2 +np.float64,0xbfbe8fcf0a3d1fa0,0xbfbea267fbb5bfdf,2 +np.float64,0xbfd04e2756a09c4e,0xbfd07b74d079f9a2,2 +np.float64,0x3fc65170552ca2e1,0x3fc66e6eb00c82ed,2 +np.float64,0xbfb0674b8020ce98,0xbfb06a2b4771b64c,2 +np.float64,0x2059975840b34,0x2059975840b34,2 +np.float64,0x33d1385467a28,0x33d1385467a28,2 +np.float64,0x3fea41b74ff4836f,0x3fed4dc1a09e53cc,2 +np.float64,0xbfe8e08c9d71c119,0xbfeb75b4c59a6bec,2 +np.float64,0x7fdbbf14d6377e29,0x7ff0000000000000,2 +np.float64,0x3fcd8b71513b16e0,0x3fcdcec80174f9ad,2 +np.float64,0x5c50bc94b8a18,0x5c50bc94b8a18,2 +np.float64,0x969a18f52d343,0x969a18f52d343,2 +np.float64,0x3fd7ae44462f5c89,0x3fd8398bc34e395c,2 +np.float64,0xffdd0f8617ba1f0c,0xfff0000000000000,2 +np.float64,0xfff0000000000000,0xfff0000000000000,2 +np.float64,0xbfe2f9badb65f376,0xbfe41b771320ece8,2 +np.float64,0x3fd140bc7fa29,0x3fd140bc7fa29,2 +np.float64,0xbfe14523b5628a48,0xbfe21ee850972043,2 +np.float64,0x3feedd0336bdba06,0x3ff1f01afc1f3a06,2 +np.float64,0x800de423ad7bc848,0x800de423ad7bc848,2 +np.float64,0x4cef857c99df1,0x4cef857c99df1,2 +np.float64,0xbfea55e0e374abc2,0xbfed691e41d648dd,2 +np.float64,0x3fe70d7a18ae1af4,0x3fe91955a34d8094,2 +np.float64,0xbfc62fc3032c5f88,0xbfc64c3ec25decb8,2 +np.float64,0x3fc915abb5322b58,0x3fc93edac5cc73fe,2 +np.float64,0x69aaff66d3561,0x69aaff66d3561,2 +np.float64,0x5c6a90f2b8d53,0x5c6a90f2b8d53,2 +np.float64,0x3fefe30dc1bfc61c,0x3ff2b752257bdacd,2 +np.float64,0x3fef15db15fe2bb6,0x3ff21aea05601396,2 +np.float64,0xbfe353e5ac66a7cc,0xbfe48644e6553d1a,2 +np.float64,0x3fe6d30cffada61a,0x3fe8cf3e4c61ddac,2 +np.float64,0x7fb7857eb62f0afc,0x7ff0000000000000,2 +np.float64,0xbfdd9b53d23b36a8,0xbfdeac91a7af1340,2 +np.float64,0x3fd1456357228ac7,0x3fd17b3f7d39b27a,2 +np.float64,0x3fb57d10ae2afa21,0x3fb5838702b806f4,2 +np.float64,0x800c59c96c98b393,0x800c59c96c98b393,2 +np.float64,0x7fc1f2413823e481,0x7ff0000000000000,2 +np.float64,0xbfa3983624273070,0xbfa3996fa26c419a,2 +np.float64,0x7fb28874ae2510e8,0x7ff0000000000000,2 +np.float64,0x3fe826d02a304da0,0x3fea82bec50bc0b6,2 +np.float64,0x8008d6f0d3d1ade2,0x8008d6f0d3d1ade2,2 +np.float64,0xffe7c970ca2f92e1,0xfff0000000000000,2 +np.float64,0x7fcf42bcaa3e8578,0x7ff0000000000000,2 +np.float64,0x7fda1ab517343569,0x7ff0000000000000,2 +np.float64,0xbfe7926a65ef24d5,0xbfe9c323dd890d5b,2 +np.float64,0xbfcaf6282d35ec50,0xbfcb294f36a0a33d,2 +np.float64,0x800ca49df8d9493c,0x800ca49df8d9493c,2 +np.float64,0xffea18d26af431a4,0xfff0000000000000,2 +np.float64,0x3fb72f276e2e5e50,0x3fb7374539fd1221,2 +np.float64,0xffa6b613842d6c20,0xfff0000000000000,2 +np.float64,0xbfeb3c7263f678e5,0xbfeea54cdb60b54c,2 +np.float64,0x3fc976d2ba32eda5,0x3fc9a1e83a058de4,2 +np.float64,0xbfe4acd4b0e959aa,0xbfe624d5d4f9b9a6,2 +np.float64,0x7fca410a0f348213,0x7ff0000000000000,2 +np.float64,0xbfde368f77bc6d1e,0xbfdf5910c8c8bcb0,2 +np.float64,0xbfed7412937ae825,0xbff0e55afc428453,2 +np.float64,0xffef6b7b607ed6f6,0xfff0000000000000,2 +np.float64,0xbfb936f17e326de0,0xbfb941629a53c694,2 +np.float64,0x800dbb0c469b7619,0x800dbb0c469b7619,2 +np.float64,0x800f68b0581ed161,0x800f68b0581ed161,2 +np.float64,0x3fe25b2aad64b656,0x3fe361266fa9c5eb,2 +np.float64,0xbfb87e445a30fc88,0xbfb887d676910c3f,2 +np.float64,0x6e6ba9b6dcd76,0x6e6ba9b6dcd76,2 +np.float64,0x3fad27ce583a4f9d,0x3fad2bd72782ffdb,2 +np.float64,0xbfec0bc5d638178c,0xbfefc6e8c8f9095f,2 +np.float64,0x7fcba4a296374944,0x7ff0000000000000,2 +np.float64,0x8004ca237cc99448,0x8004ca237cc99448,2 +np.float64,0xffe85b8c3270b718,0xfff0000000000000,2 +np.float64,0x7fe7ee3eddafdc7d,0x7ff0000000000000,2 +np.float64,0xffd275967ca4eb2c,0xfff0000000000000,2 +np.float64,0xbfa95bc3a032b780,0xbfa95e6b288ecf43,2 +np.float64,0x3fc9e3214b33c643,0x3fca10667e7e7ff4,2 +np.float64,0x8001b89c5d837139,0x8001b89c5d837139,2 +np.float64,0xbf8807dfc0300fc0,0xbf880803e3badfbd,2 +np.float64,0x800aca94b895952a,0x800aca94b895952a,2 +np.float64,0x7fd79534a02f2a68,0x7ff0000000000000,2 +np.float64,0x3fe1b81179e37023,0x3fe2a371d8cc26f0,2 +np.float64,0x800699539d6d32a8,0x800699539d6d32a8,2 +np.float64,0xffe51dfbb3aa3bf7,0xfff0000000000000,2 +np.float64,0xbfdfb775abbf6eec,0xbfe083f48be2f98f,2 +np.float64,0x3fe87979d7b0f2f4,0x3feaee701d959079,2 +np.float64,0x3fd8e4e6a731c9cd,0x3fd986d29f25f982,2 +np.float64,0x3fe3dadaaf67b5b6,0x3fe527520fb02920,2 +np.float64,0x8003c2262bc7844d,0x8003c2262bc7844d,2 +np.float64,0x800c930add392616,0x800c930add392616,2 +np.float64,0xffb7a152a22f42a8,0xfff0000000000000,2 +np.float64,0x80028fe03dc51fc1,0x80028fe03dc51fc1,2 +np.float64,0xffe32ae60c6655cc,0xfff0000000000000,2 +np.float64,0x3fea3527e4746a50,0x3fed3cbbf47f18eb,2 +np.float64,0x800a53059e14a60c,0x800a53059e14a60c,2 +np.float64,0xbfd79e3b202f3c76,0xbfd828672381207b,2 +np.float64,0xffeed7e2eb7dafc5,0xfff0000000000000,2 +np.float64,0x3fec51ed6778a3db,0x3ff01509e34df61d,2 +np.float64,0xbfd84bc577b0978a,0xbfd8e23ec55e42e8,2 +np.float64,0x2483aff849077,0x2483aff849077,2 +np.float64,0x6f57883adeaf2,0x6f57883adeaf2,2 +np.float64,0xffd3fd74d927faea,0xfff0000000000000,2 +np.float64,0x7fca49ec773493d8,0x7ff0000000000000,2 +np.float64,0x7fd08fe2e8211fc5,0x7ff0000000000000,2 +np.float64,0x800852086db0a411,0x800852086db0a411,2 +np.float64,0x3fe5b1f2c9eb63e6,0x3fe7654f511bafc6,2 +np.float64,0xbfe01e2a58e03c54,0xbfe0cedb68f021e6,2 +np.float64,0x800988421d331085,0x800988421d331085,2 +np.float64,0xffd5038b18aa0716,0xfff0000000000000,2 +np.float64,0x8002c9264c85924d,0x8002c9264c85924d,2 +np.float64,0x3fd21ca302243946,0x3fd25ac653a71aab,2 +np.float64,0xbfea60d6e6f4c1ae,0xbfed78031d9dfa2b,2 +np.float64,0xffef97b6263f2f6b,0xfff0000000000000,2 +np.float64,0xbfd524732faa48e6,0xbfd5876ecc415dcc,2 +np.float64,0x660387e8cc072,0x660387e8cc072,2 +np.float64,0x7fcfc108a33f8210,0x7ff0000000000000,2 +np.float64,0x7febe5b0f877cb61,0x7ff0000000000000,2 +np.float64,0xbfa55fdfac2abfc0,0xbfa56176991851a8,2 +np.float64,0x25250f4c4a4a3,0x25250f4c4a4a3,2 +np.float64,0xffe2f6a2f2a5ed46,0xfff0000000000000,2 +np.float64,0x7fa754fcc02ea9f9,0x7ff0000000000000,2 +np.float64,0x3febd19dea37a33c,0x3fef75279f75d3b8,2 +np.float64,0xc5ed55218bdab,0xc5ed55218bdab,2 +np.float64,0x3fe72ff6b3ee5fed,0x3fe945388b979882,2 +np.float64,0xbfe16b854e22d70a,0xbfe24b10fc0dff14,2 +np.float64,0xffb22cbe10245980,0xfff0000000000000,2 +np.float64,0xa54246b54a849,0xa54246b54a849,2 +np.float64,0x3fe7f4cda76fe99c,0x3fea41edc74888b6,2 +np.float64,0x1,0x1,2 +np.float64,0x800d84acce9b095a,0x800d84acce9b095a,2 +np.float64,0xb0eef04761dde,0xb0eef04761dde,2 +np.float64,0x7ff4000000000000,0x7ffc000000000000,2 +np.float64,0xffecaf1dbb795e3b,0xfff0000000000000,2 +np.float64,0x90dbab8d21b76,0x90dbab8d21b76,2 +np.float64,0x3fe79584a9ef2b09,0x3fe9c71fa9e40eb5,2 diff --git a/shared/package-files/09/098e43e53ec992a1459c875eebeb40f9a739daf901dfa9345cb37bc274e81109/blob b/shared/package-files/09/098e43e53ec992a1459c875eebeb40f9a739daf901dfa9345cb37bc274e81109/blob new file mode 100644 index 0000000000000000000000000000000000000000..4982c878a4da0da5a71b6a7602d5b4c557e9521f --- /dev/null +++ b/shared/package-files/09/098e43e53ec992a1459c875eebeb40f9a739daf901dfa9345cb37bc274e81109/blob @@ -0,0 +1,83 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API special_shifted_chebyshev_polynomial_t { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_shifted_chebyshev_polynomial_t") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_shifted_chebyshev_polynomial_t(Tensor x, Tensor n) -> Tensor") + static at::Tensor call(const at::Tensor & x, const at::Tensor & n); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Tensor & n); +}; + +struct TORCH_API special_shifted_chebyshev_polynomial_t_x_scalar { + using schema = at::Tensor (const at::Scalar &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_shifted_chebyshev_polynomial_t") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "x_scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_shifted_chebyshev_polynomial_t.x_scalar(Scalar x, Tensor n) -> Tensor") + static at::Tensor call(const at::Scalar & x, const at::Tensor & n); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & x, const at::Tensor & n); +}; + +struct TORCH_API special_shifted_chebyshev_polynomial_t_n_scalar { + using schema = at::Tensor (const at::Tensor &, const at::Scalar &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_shifted_chebyshev_polynomial_t") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "n_scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_shifted_chebyshev_polynomial_t.n_scalar(Tensor x, Scalar n) -> Tensor") + static at::Tensor call(const at::Tensor & x, const at::Scalar & n); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Scalar & n); +}; + +struct TORCH_API special_shifted_chebyshev_polynomial_t_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_shifted_chebyshev_polynomial_t") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_shifted_chebyshev_polynomial_t.out(Tensor x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & x, const at::Tensor & n, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Tensor & n, at::Tensor & out); +}; + +struct TORCH_API special_shifted_chebyshev_polynomial_t_x_scalar_out { + using schema = at::Tensor & (const at::Scalar &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_shifted_chebyshev_polynomial_t") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "x_scalar_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_shifted_chebyshev_polynomial_t.x_scalar_out(Scalar x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Scalar & x, const at::Tensor & n, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & x, const at::Tensor & n, at::Tensor & out); +}; + +struct TORCH_API special_shifted_chebyshev_polynomial_t_n_scalar_out { + using schema = at::Tensor & (const at::Tensor &, const at::Scalar &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_shifted_chebyshev_polynomial_t") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "n_scalar_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_shifted_chebyshev_polynomial_t.n_scalar_out(Tensor x, Scalar n, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & x, const at::Scalar & n, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Scalar & n, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/09/098fb5f7bbd1333f4eab1a4e4cc1098f9655832783a4dcbc507bf5c5c52a02a8/blob b/shared/package-files/09/098fb5f7bbd1333f4eab1a4e4cc1098f9655832783a4dcbc507bf5c5c52a02a8/blob new file mode 100644 index 0000000000000000000000000000000000000000..26e66dfbb9e5999ecc9011acd3c2dc19edff5426 --- /dev/null +++ b/shared/package-files/09/098fb5f7bbd1333f4eab1a4e4cc1098f9655832783a4dcbc507bf5c5c52a02a8/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & quantized_batch_norm_out(at::Tensor & out, const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, const at::Tensor & mean, const at::Tensor & var, double eps, double output_scale, int64_t output_zero_point); +TORCH_API at::Tensor & quantized_batch_norm_outf(const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, const at::Tensor & mean, const at::Tensor & var, double eps, double output_scale, int64_t output_zero_point, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/09/0990f00cfb1d10b2ad76bece5a6705c86a9ec6bdf751c7e7bff454f79549c484/blob b/shared/package-files/09/0990f00cfb1d10b2ad76bece5a6705c86a9ec6bdf751c7e7bff454f79549c484/blob new file mode 100644 index 0000000000000000000000000000000000000000..3c55d3c8d2eda434131a6f991f023914eea93d9c --- /dev/null +++ b/shared/package-files/09/0990f00cfb1d10b2ad76bece5a6705c86a9ec6bdf751c7e7bff454f79549c484/blob @@ -0,0 +1,41 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, NoReturn + +from narwhals._ibis.utils import native_to_narwhals_dtype +from narwhals.dependencies import get_ibis + +if TYPE_CHECKING: + from types import ModuleType + + from typing_extensions import Self + + from narwhals._utils import Version + from narwhals.dtypes import DType + + +class IbisInterchangeSeries: + def __init__(self, df: Any, version: Version) -> None: + self._native_series = df + self._version = version + + def __narwhals_series__(self) -> Self: + return self + + def __native_namespace__(self) -> ModuleType: + return get_ibis() + + @property + def dtype(self) -> DType: + return native_to_narwhals_dtype( + self._native_series.schema().types[0], self._version + ) + + def __getattr__(self, attr: str) -> NoReturn: + msg = ( + f"Attribute {attr} is not supported for interchange-level dataframes.\n\n" + "If you would like to see this kind of object better supported in " + "Narwhals, please open a feature request " + "at https://github.com/narwhals-dev/narwhals/issues." + ) + raise NotImplementedError(msg) diff --git a/shared/package-files/09/099649b613a396a58120d8407db81e32b49ad5f90db47f9efe61530725d3fd0b/blob b/shared/package-files/09/099649b613a396a58120d8407db81e32b49ad5f90db47f9efe61530725d3fd0b/blob new file mode 100644 index 0000000000000000000000000000000000000000..301705e7121f4ad6dea7871e597ac691557f1346 --- /dev/null +++ b/shared/package-files/09/099649b613a396a58120d8407db81e32b49ad5f90db47f9efe61530725d3fd0b/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor linalg_householder_product(const at::Tensor & input, const at::Tensor & tau); +TORCH_API at::Tensor & linalg_householder_product_out(at::Tensor & out, const at::Tensor & input, const at::Tensor & tau); +TORCH_API at::Tensor & linalg_householder_product_outf(const at::Tensor & input, const at::Tensor & tau, at::Tensor & out); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/09/099d0630427a95408d0b158863e97b592caed0ef330d211bbfd44815719869ee/blob b/shared/package-files/09/099d0630427a95408d0b158863e97b592caed0ef330d211bbfd44815719869ee/blob new file mode 100644 index 0000000000000000000000000000000000000000..ea087a462dbd84fe7d6af65c8da43b28e3e35770 --- /dev/null +++ b/shared/package-files/09/099d0630427a95408d0b158863e97b592caed0ef330d211bbfd44815719869ee/blob @@ -0,0 +1,13 @@ +*** Sat, 3 Sep 2016 22:32:25 *** +TEST FOR GRANGER-CAUSALITY: +H0: "realcons, realinv" do not Granger-cause "realgdp" + +Test statistic l = 10.1522 +pval-F( l; 8, 555) = 0.0000 + +TEST FOR INSTANTANEOUS CAUSALITY: +H0: No instantaneous causality between "realcons, realinv" and "realgdp" + +Test statistic: c = 86.2497 +pval-Chi( c; 2) = 0.0000 +