From a6d60d75910bbbc3a60fc1b66e340b8254227851 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Mon, 2 Dec 2024 17:05:05 -0500 Subject: [PATCH 01/21] add svgs basis --- docs/background/basis/images/EvalBSpline.svg | 360 +++++++++++ .../basis/images/EvalCyclicBSpline.svg | 427 +++++++++++++ docs/background/basis/images/EvalMSpline.svg | 289 +++++++++ .../basis/images/EvalOrthExponential.svg | 564 ++++++++++++++++++ .../basis/images/EvalRaisedCosineLinear.svg | 367 ++++++++++++ .../basis/images/EvalRaisedCosineLog.svg | 310 ++++++++++ 6 files changed, 2317 insertions(+) create mode 100644 docs/background/basis/images/EvalBSpline.svg create mode 100644 docs/background/basis/images/EvalCyclicBSpline.svg create mode 100644 docs/background/basis/images/EvalMSpline.svg create mode 100644 docs/background/basis/images/EvalOrthExponential.svg create mode 100644 docs/background/basis/images/EvalRaisedCosineLinear.svg create mode 100644 docs/background/basis/images/EvalRaisedCosineLog.svg diff --git a/docs/background/basis/images/EvalBSpline.svg b/docs/background/basis/images/EvalBSpline.svg new file mode 100644 index 00000000..66776ff8 --- /dev/null +++ b/docs/background/basis/images/EvalBSpline.svg @@ -0,0 +1,360 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> + <metadata> + <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <cc:Work> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:date>2024-12-02T16:54:50.980497</dc:date> + <dc:format>image/svg+xml</dc:format> + <dc:creator> + <cc:Agent> + <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> + </cc:Agent> + </dc:creator> + </cc:Work> + </rdf:RDF> + </metadata> + <defs> + <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> + </defs> + <g id="figure_1"> + <g id="patch_1"> + <path d="M 0 45 +L 90 45 +L 90 0 +L 0 0 +z +" style="fill: #ffffff"/> + </g> + <g id="axes_1"> + <g id="patch_2"> + <path d="M 1.8 44.1 +L 88.2 44.1 +L 88.2 0.9 +L 1.8 0.9 +z +" style="fill: #ffffff"/> + </g> + <g id="matplotlib.axis_1"/> + <g id="matplotlib.axis_2"/> + <g id="line2d_1"> + <path d="M 5.727273 2.863636 +L 6.778048 12.895825 +L 7.828823 21.055116 +L 8.879599 27.535018 +L 9.930374 32.529042 +L 10.718455 35.415861 +L 11.506537 37.657359 +L 12.294618 39.335174 +L 13.0827 40.530942 +L 13.870781 41.3263 +L 14.658863 41.802886 +L 15.446944 42.042336 +L 16.760413 42.13618 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_2"> + <path d="M 5.727273 42.136364 +L 6.778048 32.596588 +L 7.56613 27.272162 +L 8.354211 23.357917 +L 9.142292 20.710988 +L 9.66768 19.579883 +L 10.193068 18.906203 +L 10.718455 18.647619 +L 11.243843 18.761801 +L 11.769231 19.206418 +L 12.294618 19.93914 +L 13.0827 21.485821 +L 14.133475 24.161349 +L 18.073883 34.986885 +L 19.124658 36.995115 +L 20.175433 38.586952 +L 21.226209 39.810776 +L 22.276984 40.714963 +L 23.327759 41.347891 +L 24.378535 41.757937 +L 25.692004 42.030767 +L 27.53086 42.134559 +L 48.020979 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_3"> + <path d="M 5.727273 42.136364 +L 6.25266 42.010909 +L 6.778048 41.649326 +L 7.56613 40.712715 +L 8.354211 39.369539 +L 9.404986 37.075546 +L 10.981149 32.916815 +L 14.396169 23.575788 +L 15.446944 21.333124 +L 16.235026 20.040162 +L 17.023107 19.163789 +L 17.548495 18.838947 +L 18.073883 18.713229 +L 18.59927 18.772527 +L 19.124658 19.00273 +L 19.912739 19.637614 +L 20.700821 20.577665 +L 21.751596 22.223461 +L 23.065065 24.752602 +L 25.42931 29.959664 +L 27.53086 34.415194 +L 28.84433 36.703295 +L 30.157799 38.491078 +L 31.471268 39.836121 +L 32.784737 40.801416 +L 34.098206 41.449954 +L 35.411675 41.844726 +L 36.987838 42.072174 +L 39.352083 42.136363 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_4"> + <path d="M 5.727273 42.136364 +L 8.616905 42.024575 +L 10.193068 41.723728 +L 11.506537 41.242053 +L 12.820006 40.483216 +L 13.870781 39.634259 +L 14.921557 38.535352 +L 15.972332 37.154244 +L 17.023107 35.458689 +L 18.336576 32.897508 +L 20.438127 28.174455 +L 23.327759 21.687781 +L 24.641228 19.225946 +L 25.692004 17.656888 +L 26.480085 16.777162 +L 27.268167 16.19742 +L 28.056248 15.958479 +L 28.581636 16.006721 +L 29.369717 16.380305 +L 30.157799 17.079139 +L 30.94588 18.062408 +L 31.996656 19.745334 +L 33.310125 22.310628 +L 35.411675 27.03652 +L 38.301307 33.519575 +L 39.614777 35.977096 +L 40.928246 37.931176 +L 42.241715 39.42092 +L 43.555184 40.509318 +L 44.868653 41.259362 +L 46.182122 41.734043 +L 47.758285 42.028874 +L 49.859836 42.134405 +L 70.612648 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_5"> + <path d="M 5.727273 42.136364 +L 19.650046 42.044968 +L 21.226209 41.773586 +L 22.539678 41.326364 +L 23.853147 40.610978 +L 24.903922 39.803261 +L 25.954697 38.751354 +L 27.005473 37.423003 +L 28.056248 35.785959 +L 29.369717 33.288515 +L 31.208574 29.22067 +L 34.623594 21.535081 +L 35.937063 19.100654 +L 36.987838 17.561297 +L 37.77592 16.708382 +L 38.564001 16.159339 +L 39.089389 15.982284 +L 39.614777 15.970201 +L 40.140164 16.124384 +L 40.928246 16.642359 +L 41.716327 17.468092 +L 42.767102 18.977254 +L 44.080572 21.383656 +L 45.656735 24.784485 +L 49.859836 34.195459 +L 51.173305 36.527418 +L 52.486774 38.356081 +L 53.800243 39.736605 +L 55.113712 40.731981 +L 56.427182 41.405201 +L 57.740651 41.819257 +L 59.316814 42.062717 +L 61.418364 42.136038 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_6"> + <path d="M 5.727273 42.136364 +L 30.94588 42.037139 +L 32.522043 41.754155 +L 33.835512 41.293306 +L 35.148981 40.560694 +L 36.199757 39.736605 +L 37.250532 38.666021 +L 38.301307 37.316691 +L 39.352083 35.656363 +L 40.665552 33.132976 +L 42.504409 29.046918 +L 45.919428 21.383656 +L 47.232898 18.977254 +L 48.283673 17.468092 +L 49.071754 16.642359 +L 49.859836 16.124384 +L 50.385223 15.970201 +L 50.910611 15.982284 +L 51.435999 16.159339 +L 52.22408 16.708382 +L 53.012162 17.561297 +L 54.062937 19.100654 +L 55.376406 21.535081 +L 57.215263 25.557067 +L 60.892977 33.823273 +L 62.206446 36.225924 +L 63.519915 38.12375 +L 64.833384 39.564437 +L 66.146853 40.610978 +L 67.460322 41.326364 +L 68.773791 41.773586 +L 70.349954 42.044968 +L 72.451505 42.135361 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_7"> + <path d="M 5.727273 42.136364 +L 42.241715 42.028874 +L 43.817878 41.734043 +L 45.131347 41.259362 +L 46.444816 40.509318 +L 47.495591 39.668691 +L 48.546367 38.579266 +L 49.597142 37.208792 +L 50.647917 35.525017 +L 51.961386 32.97628 +L 54.062937 28.261907 +L 56.952569 21.764598 +L 58.266038 19.289291 +L 59.316814 17.705568 +L 60.104895 16.812575 +L 60.892977 16.217622 +L 61.681058 15.961527 +L 62.206446 15.99774 +L 62.731833 16.19742 +L 63.519915 16.777162 +L 64.307996 17.656888 +L 65.358772 19.225946 +L 66.672241 21.687781 +L 68.511098 25.729996 +L 72.188811 33.973166 +L 73.50228 36.347785 +L 74.815749 38.217791 +L 76.129219 39.634259 +L 77.442688 40.66018 +L 78.756157 41.358545 +L 80.069626 41.792346 +L 81.645789 42.052375 +L 83.74734 42.135692 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_8"> + <path d="M 5.727273 42.136364 +L 53.274856 42.048724 +L 54.851019 41.783049 +L 56.164488 41.342563 +L 57.477957 40.635713 +L 58.528732 39.836121 +L 59.579507 38.79349 +L 60.630283 37.475568 +L 61.681058 35.850104 +L 62.994527 33.369486 +L 65.096078 28.77919 +L 67.460322 23.690373 +L 68.773791 21.350386 +L 69.824567 19.919409 +L 70.612648 19.177511 +L 71.40073 18.772527 +L 71.926117 18.713229 +L 72.451505 18.838947 +L 72.976893 19.163789 +L 73.50228 19.698058 +L 74.290362 20.860466 +L 75.341137 22.96786 +L 76.654606 26.248665 +L 81.383095 38.8444 +L 82.43387 40.712715 +L 83.221952 41.649326 +L 83.74734 42.010909 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_9"> + <path d="M 5.727273 42.136364 +L 64.307996 42.030767 +L 65.621465 41.757937 +L 66.672241 41.347891 +L 67.723016 40.714963 +L 68.773791 39.810776 +L 69.824567 38.586952 +L 70.875342 36.995115 +L 71.926117 34.986885 +L 72.976893 32.513887 +L 74.290362 28.800955 +L 76.391912 22.753611 +L 77.442688 20.400312 +L 78.230769 19.206418 +L 78.756157 18.761801 +L 79.281545 18.647619 +L 79.806932 18.906203 +L 80.33232 19.579883 +L 80.857708 20.710988 +L 81.383095 22.34185 +L 82.171177 25.817782 +L 82.959258 30.656274 +L 83.74734 37.00019 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_10"> + <path d="M 5.727273 42.136364 +L 74.553056 42.042336 +L 75.341137 41.802886 +L 76.129219 41.3263 +L 76.9173 40.530942 +L 77.705382 39.335174 +L 78.493463 37.657359 +L 79.281545 35.415861 +L 80.069626 32.529042 +L 80.857708 28.915266 +L 81.908483 22.824975 +L 82.959258 15.103673 +L 84.010033 5.55785 +L 84.272727 2.863636 +L 84.272727 2.863636 +" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> + </g> + </g> + </g> + <defs> + <clipPath id="pb3495c303b"> + <rect x="1.8" y="0.9" width="86.4" height="43.2"/> + </clipPath> + </defs> +</svg> diff --git a/docs/background/basis/images/EvalCyclicBSpline.svg b/docs/background/basis/images/EvalCyclicBSpline.svg new file mode 100644 index 00000000..35fa9481 --- /dev/null +++ b/docs/background/basis/images/EvalCyclicBSpline.svg @@ -0,0 +1,427 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> + <metadata> + <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <cc:Work> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:date>2024-12-02T16:54:50.989322</dc:date> + <dc:format>image/svg+xml</dc:format> + <dc:creator> + <cc:Agent> + <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> + </cc:Agent> + </dc:creator> + </cc:Work> + </rdf:RDF> + </metadata> + <defs> + <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> + </defs> + <g id="figure_1"> + <g id="patch_1"> + <path d="M 0 45 +L 90 45 +L 90 0 +L 0 0 +z +" style="fill: #ffffff"/> + </g> + <g id="axes_1"> + <g id="patch_2"> + <path d="M 1.8 44.1 +L 88.2 44.1 +L 88.2 0.9 +L 1.8 0.9 +z +" style="fill: #ffffff"/> + </g> + <g id="matplotlib.axis_1"/> + <g id="matplotlib.axis_2"/> + <g id="line2d_1"> + <path d="M 5.727273 32.318182 +L 6.778048 35.754951 +L 7.828823 38.278474 +L 8.616905 39.656642 +L 9.404986 40.659947 +L 10.193068 41.347891 +L 10.981149 41.779976 +L 12.031925 42.060929 +L 13.345394 42.136096 +L 61.943752 42.09823 +L 62.994527 41.894497 +L 63.782609 41.548096 +L 64.57069 40.969636 +L 65.358772 40.099616 +L 66.146853 38.878533 +L 66.934935 37.246885 +L 67.723016 35.145171 +L 68.511098 32.513887 +L 69.561873 28.15951 +L 71.40073 19.224262 +L 73.239587 10.558978 +L 74.290362 6.601292 +L 75.078443 4.431349 +L 75.603831 3.464043 +L 76.129219 2.9419 +L 76.391912 2.864294 +L 76.654606 2.916206 +L 77.179994 3.390923 +L 77.705382 4.316093 +L 78.493463 6.432749 +L 79.281545 9.265414 +L 80.595014 15.092822 +L 84.010033 31.301235 +L 84.272727 32.318182 +L 84.272727 32.318182 +" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_2"> + <path d="M 5.727273 2.863636 +L 5.989967 2.928428 +L 6.515354 3.426923 +L 7.040742 4.373227 +L 7.828823 6.516626 +L 8.616905 9.370084 +L 9.930374 15.218923 +L 13.345394 31.405707 +L 14.396169 35.066323 +L 15.446944 37.783029 +L 16.235026 39.28526 +L 17.023107 40.394776 +L 17.811189 41.17108 +L 18.59927 41.673675 +L 19.650046 42.020874 +L 20.963515 42.134222 +L 35.937063 42.136364 +L 70.087261 42.0647 +L 71.138036 41.790667 +L 71.926117 41.366086 +L 72.714199 40.687629 +L 73.50228 39.695795 +L 74.290362 38.33108 +L 75.078443 36.533984 +L 75.866525 34.245003 +L 76.9173 30.335109 +L 78.230769 24.314375 +L 81.383095 9.370084 +L 82.43387 5.71445 +L 83.221952 3.847405 +L 83.74734 3.118394 +L 84.272727 2.863636 +L 84.272727 2.863636 +" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_3"> + <path d="M 5.727273 32.318182 +L 6.778048 27.921151 +L 8.616905 18.962146 +L 10.455762 10.337896 +L 11.506537 6.432749 +L 12.294618 4.316093 +L 12.820006 3.390923 +L 13.345394 2.916206 +L 13.608088 2.864294 +L 13.870781 2.9419 +L 14.396169 3.464043 +L 14.921557 4.431349 +L 15.709638 6.601292 +L 16.49772 9.475345 +L 17.811189 15.345285 +L 21.226209 31.509579 +L 22.276984 35.145171 +L 23.327759 37.840059 +L 24.115841 39.32824 +L 24.903922 40.425691 +L 25.692004 41.191913 +L 26.480085 41.686409 +L 27.53086 42.025894 +L 28.84433 42.134559 +L 46.444816 42.136364 +L 77.968075 42.060929 +L 79.018851 41.779976 +L 79.806932 41.347891 +L 80.595014 40.659947 +L 81.383095 39.656642 +L 82.171177 38.278474 +L 82.959258 36.465939 +L 83.74734 34.159538 +L 84.272727 32.318182 +L 84.272727 32.318182 +" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_4"> + <path d="M 5.727273 42.136364 +L 7.303436 42.057027 +L 8.354211 41.769067 +L 9.142292 41.329412 +L 9.930374 40.631915 +L 10.718455 39.617073 +L 11.506537 38.225384 +L 12.294618 36.397346 +L 13.0827 34.073458 +L 14.133475 30.114378 +L 15.446944 24.057502 +L 18.336576 10.228149 +L 19.387352 6.349668 +L 20.175433 4.259953 +L 20.700821 3.35605 +L 21.226209 2.905244 +L 21.488902 2.866263 +L 21.751596 2.956618 +L 22.276984 3.502275 +L 22.802372 4.490451 +L 23.590453 6.686741 +L 24.378535 9.581189 +L 25.692004 15.4719 +L 29.107023 31.612845 +L 30.157799 35.22343 +L 31.208574 37.896589 +L 31.996656 39.370787 +L 32.784737 40.456238 +L 33.572818 41.212444 +L 34.3609 41.698907 +L 35.411675 42.030767 +L 36.725144 42.134859 +L 57.477957 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_5"> + <path d="M 5.727273 42.136364 +L 15.184251 42.052994 +L 16.235026 41.757937 +L 17.023107 41.310646 +L 17.811189 40.60353 +L 18.59927 39.577085 +L 19.387352 38.17181 +L 20.175433 36.328202 +L 20.963515 33.98676 +L 22.01429 30.003229 +L 23.327759 23.928778 +L 26.217391 10.118939 +L 27.268167 6.267389 +L 28.056248 4.204813 +L 28.581636 3.322309 +L 29.107023 2.895546 +L 29.369717 2.869537 +L 29.632411 2.972575 +L 30.157799 3.541614 +L 30.683186 4.550527 +L 31.471268 6.772965 +L 32.522043 10.78213 +L 33.835512 16.879501 +L 36.725144 30.662189 +L 37.77592 34.497732 +L 38.826695 37.369628 +L 39.614777 38.972053 +L 40.402858 40.167881 +L 41.190939 41.016612 +L 41.979021 41.577751 +L 42.767102 41.910797 +L 43.817878 42.102894 +L 45.919428 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_6"> + <path d="M 5.727273 42.136364 +L 23.065065 42.048826 +L 24.115841 41.746585 +L 24.903922 41.291592 +L 25.692004 40.57479 +L 26.480085 39.536676 +L 27.268167 38.117748 +L 28.056248 36.258505 +L 28.84433 33.899444 +L 29.895105 29.891567 +L 31.208574 23.799871 +L 34.098206 10.010274 +L 35.148981 6.185918 +L 35.937063 4.150681 +L 36.462451 3.289707 +L 36.987838 2.88712 +L 37.250532 2.874109 +L 37.513226 2.989763 +L 38.038614 3.582052 +L 38.564001 4.611571 +L 39.352083 6.859958 +L 40.402858 10.894467 +L 41.716327 17.008642 +L 44.605959 30.770118 +L 45.656735 34.58076 +L 46.70751 37.430221 +L 47.495591 39.018135 +L 48.283673 40.201434 +L 49.071754 41.03962 +L 49.859836 41.592197 +L 50.647917 41.918665 +L 51.698693 42.105076 +L 53.800243 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_7"> + <path d="M 5.727273 42.136364 +L 30.94588 42.044522 +L 31.996656 41.735008 +L 32.784737 41.272247 +L 33.572818 40.545693 +L 34.3609 39.495844 +L 35.148981 38.063198 +L 35.937063 36.188253 +L 36.725144 33.811506 +L 37.77592 29.779398 +L 39.089389 23.670788 +L 41.979021 9.90216 +L 43.029796 6.105263 +L 43.817878 4.097562 +L 44.343265 3.258251 +L 44.868653 2.879972 +L 45.131347 2.879972 +L 45.656735 3.258251 +L 46.182122 4.097562 +L 46.70751 5.345013 +L 47.495591 7.865755 +L 48.546367 12.161588 +L 50.12253 19.749102 +L 52.22408 29.779398 +L 53.274856 33.811506 +L 54.325631 36.866052 +L 55.113712 38.586952 +L 55.901794 39.885388 +L 56.689875 40.820861 +L 57.477957 41.452873 +L 58.266038 41.840926 +L 59.316814 42.081682 +L 60.892977 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_8"> + <path d="M 5.727273 42.136364 +L 38.826695 42.040079 +L 39.87747 41.723204 +L 40.665552 41.252609 +L 41.453633 40.516237 +L 42.241715 39.454586 +L 43.029796 38.008156 +L 43.817878 36.117442 +L 44.605959 33.722944 +L 45.656735 29.666728 +L 46.970204 23.541535 +L 49.859836 9.794603 +L 50.910611 6.02543 +L 51.698693 4.045463 +L 52.22408 3.227948 +L 52.749468 2.874109 +L 53.012162 2.88712 +L 53.537549 3.289707 +L 54.062937 4.150681 +L 54.588325 5.41715 +L 55.376406 7.961462 +L 56.427182 12.279465 +L 58.266038 21.193501 +L 60.104895 29.891567 +L 61.15567 33.899444 +L 62.206446 36.93085 +L 62.994527 38.63671 +L 63.782609 39.922088 +L 64.57069 40.846487 +L 65.358772 41.469408 +L 66.146853 41.850354 +L 67.197628 42.084719 +L 68.773791 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_9"> + <path d="M 5.727273 42.136364 +L 46.70751 42.035495 +L 47.758285 41.711171 +L 48.546367 41.232675 +L 49.334448 40.486419 +L 50.12253 39.412902 +L 50.910611 37.95262 +L 51.698693 36.046073 +L 52.486774 33.633757 +L 53.537549 29.553565 +L 55.113712 22.110444 +L 57.477957 10.78213 +L 58.528732 6.772965 +L 59.316814 4.550527 +L 59.842201 3.541614 +L 60.367589 2.972575 +L 60.630283 2.869537 +L 60.892977 2.895546 +L 61.418364 3.322309 +L 61.943752 4.204813 +L 62.46914 5.49017 +L 63.257221 8.057852 +L 64.307996 12.397761 +L 66.146853 21.324678 +L 67.98571 30.003229 +L 69.036485 33.98676 +L 70.087261 36.995115 +L 70.875342 38.686 +L 71.663424 39.958387 +L 72.451505 40.871778 +L 73.239587 41.485674 +L 74.027668 41.859579 +L 75.078443 42.087641 +L 76.654606 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_10"> + <path d="M 5.727273 42.136364 +L 54.588325 42.030767 +L 55.6391 41.698907 +L 56.427182 41.212444 +L 57.215263 40.456238 +L 58.003344 39.370787 +L 58.791426 37.896589 +L 59.579507 35.974141 +L 60.367589 33.543942 +L 61.418364 29.439915 +L 62.994527 21.97967 +L 65.358772 10.670298 +L 66.409547 6.686741 +L 67.197628 4.490451 +L 67.723016 3.502275 +L 68.248404 2.956618 +L 68.511098 2.866263 +L 68.773791 2.905244 +L 69.299179 3.35605 +L 69.824567 4.259953 +L 70.612648 6.349668 +L 71.40073 9.161342 +L 72.451505 13.724759 +L 76.654606 33.178355 +L 77.705382 36.397346 +L 78.493463 38.225384 +L 79.281545 39.617073 +L 80.069626 40.631915 +L 80.857708 41.329412 +L 81.645789 41.769067 +L 82.696564 42.057027 +L 84.010033 42.135996 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> + </g> + </g> + </g> + <defs> + <clipPath id="p11fbba2f81"> + <rect x="1.8" y="0.9" width="86.4" height="43.2"/> + </clipPath> + </defs> +</svg> diff --git a/docs/background/basis/images/EvalMSpline.svg b/docs/background/basis/images/EvalMSpline.svg new file mode 100644 index 00000000..36945902 --- /dev/null +++ b/docs/background/basis/images/EvalMSpline.svg @@ -0,0 +1,289 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> + <metadata> + <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <cc:Work> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:date>2024-12-02T16:54:50.998126</dc:date> + <dc:format>image/svg+xml</dc:format> + <dc:creator> + <cc:Agent> + <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> + </cc:Agent> + </dc:creator> + </cc:Work> + </rdf:RDF> + </metadata> + <defs> + <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> + </defs> + <g id="figure_1"> + <g id="patch_1"> + <path d="M 0 45 +L 90 45 +L 90 0 +L 0 0 +z +" style="fill: #ffffff"/> + </g> + <g id="axes_1"> + <g id="patch_2"> + <path d="M 1.8 44.1 +L 88.2 44.1 +L 88.2 0.9 +L 1.8 0.9 +z +" style="fill: #ffffff"/> + </g> + <g id="matplotlib.axis_1"/> + <g id="matplotlib.axis_2"/> + <g id="line2d_1"> + <path d="M 5.727273 2.863636 +L 6.778048 12.895825 +L 7.828823 21.055116 +L 8.879599 27.535018 +L 9.930374 32.529042 +L 10.718455 35.415861 +L 11.506537 37.657359 +L 12.294618 39.335174 +L 13.0827 40.530942 +L 13.870781 41.3263 +L 14.658863 41.802886 +L 15.446944 42.042336 +L 16.760413 42.13618 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_2"> + <path d="M 5.727273 42.136364 +L 6.778048 37.366476 +L 7.56613 34.704263 +L 8.354211 32.74714 +L 9.142292 31.423676 +L 9.66768 30.858123 +L 10.193068 30.521283 +L 10.718455 30.391992 +L 11.243843 30.449082 +L 12.031925 30.837887 +L 12.820006 31.527 +L 13.870781 32.789498 +L 15.709638 35.468659 +L 17.285801 37.657359 +L 18.59927 39.091218 +L 19.912739 40.180874 +L 21.226209 40.97357 +L 22.539678 41.51655 +L 24.115841 41.905019 +L 25.954697 42.098646 +L 29.107023 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_3"> + <path d="M 5.727273 42.136364 +L 6.515354 42.043658 +L 7.56613 41.661814 +L 8.616905 41.039043 +L 9.930374 40.011852 +L 12.294618 37.8157 +L 14.396169 35.949505 +L 15.709638 35.044398 +L 16.760413 34.559248 +L 17.811189 34.341602 +L 18.861964 34.379958 +L 19.912739 34.63678 +L 21.226209 35.207704 +L 22.802372 36.162321 +L 25.42931 38.077464 +L 27.793554 39.728598 +L 29.369717 40.582765 +L 30.94588 41.206643 +L 32.784737 41.691381 +L 34.886288 41.995322 +L 37.513226 42.126161 +L 45.919428 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_4"> + <path d="M 5.727273 42.136364 +L 10.193068 42.033205 +L 12.557312 41.767318 +L 14.658863 41.311092 +L 16.49772 40.689219 +L 18.336576 39.82665 +L 21.488902 38.034772 +L 24.115841 36.640527 +L 25.692004 36.016495 +L 27.005473 35.690977 +L 28.318942 35.592654 +L 29.632411 35.747054 +L 30.94588 36.117875 +L 32.522043 36.782015 +L 34.886288 38.056424 +L 39.089389 40.365233 +L 40.928246 41.085067 +L 42.767102 41.577501 +L 44.868653 41.917113 +L 47.495591 42.101361 +L 51.961386 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_5"> + <path d="M 5.727273 42.136364 +L 21.488902 42.027915 +L 23.853147 41.755017 +L 25.954697 41.290111 +L 27.793554 40.658754 +L 29.632411 39.787058 +L 33.047431 37.841094 +L 35.411675 36.606139 +L 36.987838 35.992597 +L 38.301307 35.67879 +L 39.614777 35.594823 +L 40.928246 35.762862 +L 42.241715 36.144623 +L 43.817878 36.818328 +L 46.182122 38.099794 +L 50.12253 40.277685 +L 51.961386 41.022753 +L 53.800243 41.536424 +L 55.901794 41.894908 +L 58.528732 42.094647 +L 62.731833 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_6"> + <path d="M 5.727273 42.136364 +L 32.522043 42.040812 +L 34.886288 41.785268 +L 36.987838 41.341908 +L 38.826695 40.734127 +L 40.665552 39.885517 +L 43.555184 38.252168 +L 46.444816 36.69286 +L 48.283673 35.969296 +L 49.597142 35.667354 +L 50.910611 35.597844 +L 52.22408 35.779368 +L 53.800243 36.271589 +L 55.6391 37.120992 +L 58.791426 38.90744 +L 61.418364 40.312998 +L 63.257221 41.047966 +L 65.096078 41.553088 +L 67.197628 41.903962 +L 69.824567 42.097427 +L 74.290362 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_7"> + <path d="M 5.727273 42.136364 +L 43.817878 42.035783 +L 46.182122 41.773368 +L 48.283673 41.321451 +L 50.12253 40.704293 +L 51.961386 39.846343 +L 55.113712 38.056424 +L 57.740651 36.657872 +L 59.316814 36.028665 +L 60.630283 35.697349 +L 61.943752 35.591893 +L 63.257221 35.739415 +L 64.57069 36.104707 +L 66.146853 36.763996 +L 68.511098 38.034772 +L 72.714199 40.347921 +L 74.553056 41.072795 +L 76.391912 41.569441 +L 78.493463 41.912786 +L 81.120401 42.100081 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_8"> + <path d="M 5.727273 42.136364 +L 54.588325 42.039151 +L 56.689875 41.789347 +L 58.528732 41.369616 +L 60.367589 40.701783 +L 61.943752 39.888221 +L 63.782609 38.658402 +L 68.248404 35.498729 +L 69.561873 34.835358 +L 70.875342 34.425152 +L 71.926117 34.328652 +L 72.976893 34.478839 +L 74.027668 34.900427 +L 75.341137 35.746863 +L 76.9173 37.078682 +L 81.120401 40.852634 +L 82.43387 41.661814 +L 83.484646 42.043658 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_9"> + <path d="M 5.727273 42.136364 +L 64.833384 42.042336 +L 66.409547 41.802886 +L 67.98571 41.3263 +L 69.299179 40.689103 +L 70.612648 39.783292 +L 71.926117 38.561625 +L 73.239587 36.97704 +L 75.341137 33.901535 +L 76.654606 32.11797 +L 77.705382 31.037752 +L 78.493463 30.540907 +L 79.018851 30.398562 +L 79.544238 30.432017 +L 80.069626 30.662437 +L 80.595014 31.110988 +L 81.120401 31.798834 +L 81.908483 33.325581 +L 82.696564 35.509796 +L 83.484646 38.422913 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_10"> + <path d="M 5.727273 42.136364 +L 74.553056 42.042336 +L 75.341137 41.802886 +L 76.129219 41.3263 +L 76.9173 40.530942 +L 77.705382 39.335174 +L 78.493463 37.657359 +L 79.281545 35.415861 +L 80.069626 32.529042 +L 80.857708 28.915266 +L 81.908483 22.824975 +L 82.959258 15.103673 +L 84.010033 5.55785 +L 84.272727 2.863636 +L 84.272727 2.863636 +" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> + </g> + </g> + </g> + <defs> + <clipPath id="p374bc9105e"> + <rect x="1.8" y="0.9" width="86.4" height="43.2"/> + </clipPath> + </defs> +</svg> diff --git a/docs/background/basis/images/EvalOrthExponential.svg b/docs/background/basis/images/EvalOrthExponential.svg new file mode 100644 index 00000000..0326c6e6 --- /dev/null +++ b/docs/background/basis/images/EvalOrthExponential.svg @@ -0,0 +1,564 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> + <metadata> + <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <cc:Work> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:date>2024-12-02T16:54:51.006464</dc:date> + <dc:format>image/svg+xml</dc:format> + <dc:creator> + <cc:Agent> + <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> + </cc:Agent> + </dc:creator> + </cc:Work> + </rdf:RDF> + </metadata> + <defs> + <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> + </defs> + <g id="figure_1"> + <g id="patch_1"> + <path d="M 0 45 +L 90 45 +L 90 0 +L 0 0 +z +" style="fill: #ffffff"/> + </g> + <g id="axes_1"> + <g id="patch_2"> + <path d="M 1.8 44.1 +L 88.2 44.1 +L 88.2 0.9 +L 1.8 0.9 +z +" style="fill: #ffffff"/> + </g> + <g id="matplotlib.axis_1"/> + <g id="matplotlib.axis_2"/> + <g id="line2d_1"> + <path d="M 5.727273 35.58081 +L 8.091517 33.98823 +L 10.455762 32.660072 +L 13.0827 31.432516 +L 15.972332 30.321367 +L 19.387352 29.258445 +L 23.327759 28.2861 +L 27.793554 27.425161 +L 33.047431 26.645627 +L 39.352083 25.939769 +L 47.232898 25.290606 +L 57.215263 24.703544 +L 70.087261 24.180349 +L 84.272727 23.784436 +L 84.272727 23.784436 +" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_2"> + <path d="M 5.727273 7.107421 +L 7.303436 10.459536 +L 8.879599 13.2971 +L 10.455762 15.698587 +L 12.031925 17.730182 +L 13.870781 19.706908 +L 15.709638 21.329868 +L 17.548495 22.659938 +L 19.650046 23.885276 +L 21.751596 24.854225 +L 24.115841 25.698449 +L 26.742779 26.395403 +L 29.632411 26.936314 +L 33.047431 27.348374 +L 37.250532 27.616004 +L 42.504409 27.706692 +L 49.334448 27.58845 +L 60.104895 27.154988 +L 84.272727 25.9988 +L 84.272727 25.9988 +" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_3"> + <path d="M 5.727273 6.191507 +L 7.040742 11.76016 +L 8.354211 16.248426 +L 9.66768 19.829383 +L 10.981149 22.650026 +L 12.031925 24.443622 +L 13.0827 25.885853 +L 14.133475 27.024927 +L 15.446944 28.086252 +L 16.760413 28.810505 +L 18.073883 29.257751 +L 19.387352 29.478712 +L 20.963515 29.504903 +L 22.802372 29.282065 +L 24.903922 28.786699 +L 27.53086 27.933476 +L 31.733962 26.304207 +L 39.87747 23.121475 +L 44.605959 21.54092 +L 49.071754 20.28864 +L 53.537549 19.267035 +L 58.266038 18.415228 +L 63.257221 17.73954 +L 68.773791 17.215766 +L 75.078443 16.846564 +L 82.43387 16.65031 +L 84.272727 16.632196 +L 84.272727 16.632196 +" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_4"> + <path d="M 5.727273 5.261615 +L 6.778048 12.548948 +L 7.828823 18.167184 +L 8.879599 22.400215 +L 9.66768 24.813088 +L 10.455762 26.672486 +L 11.243843 28.056931 +L 12.031925 29.035833 +L 12.820006 29.670459 +L 13.608088 30.014793 +L 14.396169 30.116316 +L 15.184251 30.016704 +L 16.235026 29.63342 +L 17.548495 28.853474 +L 19.124658 27.627834 +L 22.01429 25.022107 +L 25.42931 22.017432 +L 27.793554 20.249528 +L 29.895105 18.968265 +L 31.733962 18.086232 +L 33.572818 17.425692 +L 35.411675 16.976637 +L 37.513226 16.702788 +L 39.614777 16.657965 +L 41.979021 16.844483 +L 44.605959 17.296391 +L 47.495591 18.027388 +L 51.173305 19.211412 +L 56.164488 21.083935 +L 70.087261 26.441715 +L 75.603831 28.256829 +L 80.595014 29.672904 +L 84.272727 30.57337 +L 84.272727 30.57337 +" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_5"> + <path d="M 5.727273 4.469995 +L 6.515354 12.609147 +L 7.303436 18.794265 +L 8.091517 23.356576 +L 8.879599 26.581715 +L 9.66768 28.71526 +L 10.193068 29.636406 +L 10.718455 30.221133 +L 11.243843 30.518467 +L 11.769231 30.572352 +L 12.294618 30.422099 +L 13.0827 29.889623 +L 13.870781 29.078323 +L 15.184251 27.331969 +L 20.175433 20.169338 +L 21.488902 18.766097 +L 22.802372 17.672005 +L 24.115841 16.894234 +L 25.42931 16.423072 +L 26.742779 16.237192 +L 28.056248 16.307734 +L 29.369717 16.601433 +L 30.94588 17.19869 +L 32.784737 18.155675 +L 35.148981 19.655964 +L 43.29249 25.06931 +L 45.656735 26.275397 +L 47.758285 27.114872 +L 49.859836 27.715678 +L 51.961386 28.070172 +L 54.062937 28.179489 +L 56.164488 28.051609 +L 58.266038 27.699659 +L 60.630283 27.05693 +L 62.994527 26.179569 +L 65.621465 24.965801 +L 68.511098 23.388602 +L 71.926117 21.27045 +L 76.391912 18.21908 +L 84.272727 12.520624 +L 84.272727 12.520624 +" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_6"> + <path d="M 5.727273 3.83944 +L 6.515354 14.763305 +L 7.303436 22.24323 +L 7.828823 25.693142 +L 8.354211 28.139132 +L 8.879599 29.748453 +L 9.404986 30.667803 +L 9.930374 31.025411 +L 10.455762 30.932932 +L 10.981149 30.487178 +L 11.769231 29.335624 +L 12.820006 27.247679 +L 15.972332 20.505907 +L 17.023107 18.766802 +L 18.073883 17.43456 +L 18.861964 16.715331 +L 19.650046 16.233175 +L 20.438127 15.977532 +L 21.226209 15.932546 +L 22.01429 16.078639 +L 23.065065 16.532414 +L 24.115841 17.231056 +L 25.42931 18.362763 +L 27.53086 20.523917 +L 31.208574 24.369969 +L 33.047431 25.954804 +L 34.623594 27.019202 +L 35.937063 27.671383 +L 37.250532 28.100862 +L 38.564001 28.308377 +L 39.87747 28.302083 +L 41.190939 28.096136 +L 42.767102 27.61225 +L 44.605959 26.771167 +L 46.70751 25.530893 +L 49.597142 23.53335 +L 54.851019 19.860947 +L 57.215263 18.502144 +L 59.316814 17.566978 +L 61.15567 17.003752 +L 62.731833 16.732625 +L 64.307996 16.670516 +L 65.884159 16.826367 +L 67.460322 17.20557 +L 69.036485 17.81027 +L 70.612648 18.63969 +L 72.451505 19.886729 +L 74.290362 21.425707 +L 76.129219 23.243835 +L 78.230769 25.643271 +L 80.595014 28.720043 +L 83.221952 32.556893 +L 84.272727 34.201461 +L 84.272727 34.201461 +" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_7"> + <path d="M 5.727273 41.656016 +L 6.515354 27.764306 +L 7.040742 21.682925 +L 7.56613 17.589782 +L 8.091517 15.085496 +L 8.616905 13.830088 +L 8.879599 13.578929 +L 9.142292 13.5358 +L 9.404986 13.671834 +L 9.930374 14.378262 +L 10.718455 16.195067 +L 12.031925 20.124502 +L 13.608088 24.65073 +L 14.658863 26.952704 +L 15.446944 28.186438 +L 16.235026 28.982513 +L 16.760413 29.277386 +L 17.285801 29.394588 +L 17.811189 29.346831 +L 18.59927 28.998594 +L 19.387352 28.367892 +L 20.438127 27.188326 +L 22.01429 24.969271 +L 25.166616 20.353368 +L 26.480085 18.801463 +L 27.53086 17.824634 +L 28.581636 17.111983 +L 29.632411 16.673893 +L 30.683186 16.507683 +L 31.733962 16.599849 +L 32.784737 16.928287 +L 34.098206 17.627054 +L 35.411675 18.584572 +L 37.250532 20.223665 +L 43.029796 25.647209 +L 44.605959 26.750728 +L 46.182122 27.56523 +L 47.495591 27.998 +L 48.809061 28.196796 +L 50.12253 28.161299 +L 51.435999 27.899347 +L 52.749468 27.426058 +L 54.325631 26.609725 +L 56.164488 25.375321 +L 58.528732 23.481311 +L 64.307996 18.701698 +L 66.146853 17.536983 +L 67.723016 16.811021 +L 69.036485 16.442594 +L 70.349954 16.322181 +L 71.40073 16.423379 +L 72.451505 16.714371 +L 73.50228 17.206971 +L 74.553056 17.91174 +L 75.866525 19.105087 +L 77.179994 20.659698 +L 78.493463 22.587819 +L 79.806932 24.898664 +L 81.383095 28.185493 +L 82.959258 32.037777 +L 84.272727 35.680051 +L 84.272727 35.680051 +" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_8"> + <path d="M 5.727273 41.970701 +L 6.25266 29.600363 +L 6.778048 21.398515 +L 7.303436 16.412914 +L 7.828823 13.856627 +L 8.091517 13.282954 +L 8.354211 13.084674 +L 8.616905 13.199977 +L 8.879599 13.573496 +L 9.404986 14.902929 +L 10.193068 17.766311 +L 12.031925 24.863372 +L 12.820006 27.129488 +L 13.608088 28.688013 +L 14.133475 29.321666 +L 14.658863 29.643558 +L 15.184251 29.675827 +L 15.709638 29.447511 +L 16.235026 28.992157 +L 17.023107 27.962694 +L 18.073883 26.137016 +L 21.751596 19.185344 +L 22.802372 17.792628 +L 23.590453 17.038864 +L 24.378535 16.549013 +L 25.166616 16.322992 +L 25.954697 16.350446 +L 26.742779 16.612648 +L 27.53086 17.084361 +L 28.581636 17.986885 +L 29.895105 19.442301 +L 32.522043 22.832477 +L 34.623594 25.35917 +L 35.937063 26.624078 +L 37.250532 27.55524 +L 38.301307 28.030225 +L 39.352083 28.254993 +L 40.402858 28.231479 +L 41.453633 27.971164 +L 42.504409 27.493764 +L 43.817878 26.632669 +L 45.394041 25.296323 +L 47.758285 22.934574 +L 50.910611 19.802314 +L 52.486774 18.512178 +L 53.800243 17.672809 +L 55.113712 17.091688 +L 56.164488 16.831985 +L 57.215263 16.763969 +L 58.266038 16.890348 +L 59.316814 17.208311 +L 60.630283 17.862158 +L 61.943752 18.774656 +L 63.519915 20.154764 +L 65.621465 22.328717 +L 69.824567 26.77335 +L 71.40073 28.050842 +L 72.451505 28.663362 +L 73.50228 29.030336 +L 74.290362 29.116321 +L 75.078443 29.018267 +L 75.866525 28.716698 +L 76.654606 28.192388 +L 77.442688 27.426437 +L 78.230769 26.400349 +L 79.281545 24.596503 +L 80.33232 22.257016 +L 81.383095 19.342641 +L 82.43387 15.816308 +L 83.74734 10.4952 +L 84.272727 8.069753 +L 84.272727 8.069753 +" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_9"> + <path d="M 5.727273 42.136364 +L 6.25266 27.274067 +L 6.778048 18.462945 +L 7.303436 14.032339 +L 7.56613 13.034673 +L 7.828823 12.660335 +L 8.091517 12.788946 +L 8.354211 13.315055 +L 8.879599 15.204287 +L 9.930374 20.463666 +L 10.981149 25.410231 +L 11.769231 28.056845 +L 12.294618 29.193794 +L 12.820006 29.826796 +L 13.345394 29.987768 +L 13.870781 29.728171 +L 14.396169 29.111617 +L 15.184251 27.671031 +L 16.235026 25.15903 +L 18.336576 19.950344 +L 19.387352 17.968677 +L 20.175433 16.926446 +L 20.963515 16.301648 +L 21.488902 16.118148 +L 22.01429 16.114442 +L 22.539678 16.280132 +L 23.327759 16.81543 +L 24.115841 17.64334 +L 25.166616 19.088775 +L 27.005473 22.09708 +L 28.84433 25.014309 +L 30.157799 26.679032 +L 31.208574 27.636224 +L 31.996656 28.105284 +L 32.784737 28.352237 +L 33.572818 28.37836 +L 34.3609 28.192519 +L 35.148981 27.810168 +L 36.199757 27.031552 +L 37.513226 25.714305 +L 39.352083 23.479145 +L 42.241715 19.921559 +L 43.555184 18.603469 +L 44.868653 17.611366 +L 45.919428 17.095673 +L 46.970204 16.847467 +L 48.020979 16.872153 +L 49.071754 17.16302 +L 50.12253 17.702136 +L 51.435999 18.681746 +L 53.012162 20.207189 +L 55.376406 22.881883 +L 58.003344 25.758628 +L 59.579507 27.122792 +L 60.892977 27.923128 +L 61.943752 28.297048 +L 62.994527 28.409436 +L 64.045303 28.247569 +L 65.096078 27.809142 +L 66.146853 27.102896 +L 67.197628 26.149057 +L 68.511098 24.658392 +L 70.349954 22.180535 +L 73.50228 17.833651 +L 74.815749 16.447913 +L 75.603831 15.866117 +L 76.391912 15.531426 +L 77.179994 15.495623 +L 77.705382 15.664351 +L 78.230769 16.006307 +L 78.756157 16.538299 +L 79.544238 17.730137 +L 80.33232 19.447097 +L 81.120401 21.749319 +L 81.908483 24.69788 +L 82.696564 28.354555 +L 83.74734 34.439209 +L 84.272727 38.041336 +L 84.272727 38.041336 +" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_10"> + <path d="M 5.727273 2.863636 +L 6.25266 20.228205 +L 6.778048 29.207243 +L 7.040742 31.440665 +L 7.303436 32.553204 +L 7.56613 32.783653 +L 7.828823 32.336838 +L 8.354211 30.082658 +L 10.718455 16.877093 +L 11.243843 15.468078 +L 11.769231 14.809233 +L 12.031925 14.742473 +L 12.294618 14.835488 +L 12.820006 15.444506 +L 13.345394 16.514136 +L 14.133475 18.700858 +L 16.49772 25.893011 +L 17.285801 27.582708 +L 18.073883 28.67162 +L 18.59927 29.045343 +L 19.124658 29.14255 +L 19.650046 28.979135 +L 20.175433 28.578944 +L 20.963515 27.601259 +L 22.01429 25.77873 +L 25.692004 18.675085 +L 26.480085 17.652058 +L 27.268167 16.939324 +L 28.056248 16.557297 +L 28.84433 16.507095 +L 29.632411 16.772785 +L 30.420493 17.324109 +L 31.471268 18.430411 +L 32.784737 20.237928 +L 36.725144 26.021736 +L 37.77592 27.107901 +L 38.826695 27.848681 +L 39.614777 28.154804 +L 40.402858 28.240485 +L 41.190939 28.108686 +L 41.979021 27.769968 +L 43.029796 27.02734 +L 44.080572 26.005248 +L 45.656735 24.105641 +L 49.597142 19.114847 +L 50.910611 17.901272 +L 51.961386 17.229968 +L 53.012162 16.864863 +L 53.800243 16.804107 +L 54.588325 16.928316 +L 55.376406 17.233623 +L 56.427182 17.905736 +L 57.477957 18.847089 +L 58.791426 20.324915 +L 60.892977 23.083086 +L 63.257221 26.092566 +L 64.57069 27.403795 +L 65.621465 28.144997 +L 66.409547 28.482127 +L 67.197628 28.609922 +L 67.98571 28.514679 +L 68.773791 28.18903 +L 69.561873 27.632695 +L 70.612648 26.546258 +L 71.663424 25.105443 +L 72.976893 22.916338 +L 76.654606 16.505794 +L 77.442688 15.60817 +L 77.968075 15.218701 +L 78.493463 15.037174 +L 79.018851 15.10099 +L 79.544238 15.449698 +L 80.069626 16.124966 +L 80.595014 17.170545 +L 81.120401 18.632233 +L 81.908483 21.710065 +L 82.696564 26.001642 +L 83.484646 31.685907 +L 84.272727 38.950776 +L 84.272727 38.950776 +" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> + </g> + </g> + </g> + <defs> + <clipPath id="pb94f8c55b8"> + <rect x="1.8" y="0.9" width="86.4" height="43.2"/> + </clipPath> + </defs> +</svg> diff --git a/docs/background/basis/images/EvalRaisedCosineLinear.svg b/docs/background/basis/images/EvalRaisedCosineLinear.svg new file mode 100644 index 00000000..fbdbd641 --- /dev/null +++ b/docs/background/basis/images/EvalRaisedCosineLinear.svg @@ -0,0 +1,367 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> + <metadata> + <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <cc:Work> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:date>2024-12-02T16:54:51.015187</dc:date> + <dc:format>image/svg+xml</dc:format> + <dc:creator> + <cc:Agent> + <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> + </cc:Agent> + </dc:creator> + </cc:Work> + </rdf:RDF> + </metadata> + <defs> + <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> + </defs> + <g id="figure_1"> + <g id="patch_1"> + <path d="M 0 45 +L 90 45 +L 90 0 +L 0 0 +z +" style="fill: #ffffff"/> + </g> + <g id="axes_1"> + <g id="patch_2"> + <path d="M 1.8 44.1 +L 88.2 44.1 +L 88.2 0.9 +L 1.8 0.9 +z +" style="fill: #ffffff"/> + </g> + <g id="matplotlib.axis_1"/> + <g id="matplotlib.axis_2"/> + <g id="line2d_1"> + <path d="M 5.727273 2.863636 +L 6.25266 2.951367 +L 6.778048 3.213774 +L 7.56613 3.929352 +L 8.354211 5.017944 +L 9.142292 6.457682 +L 10.193068 8.872634 +L 11.506537 12.562942 +L 13.0827 17.700614 +L 17.811189 33.654726 +L 19.124658 37.129419 +L 20.175433 39.331058 +L 20.963515 40.591897 +L 21.751596 41.489339 +L 22.539678 42.005358 +L 23.065065 42.132028 +L 29.895105 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_2"> + <path d="M 5.727273 22.5 +L 8.354211 13.557714 +L 9.930374 9.021931 +L 10.981149 6.577546 +L 12.031925 4.700989 +L 12.820006 3.707301 +L 13.608088 3.091085 +L 14.133475 2.896415 +L 14.658863 2.876913 +L 15.184251 3.032752 +L 15.709638 3.362541 +L 16.49772 4.176515 +L 17.285801 5.358537 +L 18.336576 7.465043 +L 19.387352 10.107728 +L 20.700821 14.019956 +L 22.802372 21.159967 +L 25.954697 31.898358 +L 27.268167 35.675028 +L 28.318942 38.177467 +L 29.369717 40.120814 +L 30.157799 41.168906 +L 30.94588 41.842011 +L 31.471268 42.075426 +L 32.259349 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_3"> + <path d="M 5.727273 42.136364 +L 6.25266 42.048633 +L 6.778048 41.786226 +L 7.56613 41.070648 +L 8.354211 39.982056 +L 9.142292 38.542318 +L 10.193068 36.127366 +L 11.506537 32.437058 +L 13.0827 27.299386 +L 17.811189 11.345274 +L 19.124658 7.870581 +L 20.175433 5.668942 +L 20.963515 4.408103 +L 21.751596 3.510661 +L 22.539678 2.994642 +L 23.065065 2.867972 +L 23.590453 2.916723 +L 24.115841 3.140461 +L 24.903922 3.799371 +L 25.692004 4.833904 +L 26.480085 6.223281 +L 27.53086 8.57857 +L 28.84433 12.20926 +L 30.420493 17.301579 +L 35.411675 34.075323 +L 36.725144 37.468394 +L 37.77592 39.590903 +L 38.564001 40.786145 +L 39.352083 41.614089 +L 40.140164 42.058104 +L 40.928246 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_4"> + <path d="M 5.727273 42.136364 +L 14.921557 42.067035 +L 15.446944 41.823949 +L 16.235026 41.136667 +L 17.023107 40.075046 +L 17.811189 38.66041 +L 18.861964 36.275159 +L 20.175433 32.614457 +L 21.751596 27.499179 +L 26.480085 11.515684 +L 27.793554 8.00901 +L 28.84433 5.776141 +L 29.632411 4.489305 +L 30.420493 3.564235 +L 31.208574 3.019511 +L 31.733962 2.873391 +L 32.259349 2.902644 +L 32.784737 3.107009 +L 33.572818 3.737473 +L 34.3609 4.744805 +L 35.148981 6.108769 +L 36.199757 8.433835 +L 37.513226 12.034114 +L 39.089389 17.102912 +L 44.080572 33.908026 +L 45.394041 37.33403 +L 46.444816 39.48837 +L 47.232898 40.709952 +L 48.020979 41.565767 +L 48.809061 42.038623 +L 49.597142 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_5"> + <path d="M 5.727273 42.136364 +L 23.590453 42.083277 +L 24.115841 41.859539 +L 24.903922 41.200629 +L 25.692004 40.166096 +L 26.480085 38.776719 +L 27.53086 36.42143 +L 28.84433 32.79074 +L 30.420493 27.698421 +L 35.411675 10.924677 +L 36.725144 7.531606 +L 37.77592 5.409097 +L 38.564001 4.213855 +L 39.352083 3.385911 +L 40.140164 2.941896 +L 40.665552 2.863907 +L 41.190939 2.961377 +L 41.716327 3.233434 +L 42.504409 3.963131 +L 43.29249 5.065163 +L 44.080572 6.517393 +L 45.131347 8.947095 +L 46.444816 12.652054 +L 48.283673 18.707084 +L 52.486774 32.965886 +L 53.800243 36.566165 +L 54.851019 38.891231 +L 55.901794 40.631749 +L 56.689875 41.51534 +L 57.477957 42.016985 +L 58.003344 42.133925 +L 70.087261 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_6"> + <path d="M 5.727273 42.136364 +L 32.259349 42.097356 +L 32.784737 41.892991 +L 33.572818 41.262527 +L 34.3609 40.255195 +L 35.148981 38.891231 +L 36.199757 36.566165 +L 37.513226 32.965886 +L 39.089389 27.897088 +L 44.080572 11.091974 +L 45.394041 7.66597 +L 46.444816 5.51163 +L 47.232898 4.290048 +L 48.020979 3.434233 +L 48.809061 2.961377 +L 49.334448 2.863907 +L 49.859836 2.941896 +L 50.385223 3.194646 +L 51.173305 3.896086 +L 51.961386 4.971207 +L 52.749468 6.398414 +L 53.800243 8.798549 +L 55.113712 12.474104 +L 56.689875 17.60065 +L 61.418364 33.569674 +L 62.731833 37.060405 +L 63.782609 39.27769 +L 64.57069 40.551545 +L 65.358772 41.462814 +L 66.146853 41.993192 +L 66.672241 42.12959 +L 71.138036 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_7"> + <path d="M 5.727273 42.136364 +L 41.190939 42.038623 +L 41.716327 41.766566 +L 42.504409 41.036869 +L 43.29249 39.934837 +L 44.080572 38.482607 +L 45.131347 36.052905 +L 46.444816 32.347946 +L 48.283673 26.292916 +L 52.486774 12.034114 +L 53.800243 8.433835 +L 54.851019 6.108769 +L 55.901794 4.368251 +L 56.689875 3.48466 +L 57.477957 2.983015 +L 58.003344 2.866075 +L 58.528732 2.924574 +L 59.05412 3.157989 +L 59.842201 3.831094 +L 60.630283 4.879186 +L 61.418364 6.281211 +L 62.46914 8.651514 +L 63.782609 12.297261 +L 65.358772 17.40113 +L 70.349954 34.158493 +L 71.663424 37.534957 +L 72.714199 39.641463 +L 73.50228 40.823485 +L 74.290362 41.637459 +L 75.078443 42.067035 +L 75.866525 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_8"> + <path d="M 5.727273 42.136364 +L 49.859836 42.058104 +L 50.385223 41.805354 +L 51.173305 41.103914 +L 51.961386 40.028793 +L 52.749468 38.601586 +L 53.800243 36.201451 +L 55.113712 32.525896 +L 56.689875 27.39935 +L 61.418364 11.430326 +L 62.731833 7.939595 +L 63.782609 5.72231 +L 64.57069 4.448455 +L 65.358772 3.537186 +L 66.146853 3.006808 +L 66.672241 2.87041 +L 67.197628 2.909413 +L 67.723016 3.123468 +L 68.511098 3.768164 +L 69.299179 4.78911 +L 70.087261 6.1658 +L 71.138036 8.506009 +L 72.451505 12.121544 +L 74.027668 17.202172 +L 79.018851 33.991833 +L 80.33232 37.401418 +L 81.383095 39.539872 +L 82.171177 40.748301 +L 82.959258 41.590191 +L 83.74734 42.048633 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_9"> + <path d="M 5.727273 42.136364 +L 58.528732 42.075426 +L 59.05412 41.842011 +L 59.842201 41.168906 +L 60.630283 40.120814 +L 61.418364 38.718789 +L 62.46914 36.348486 +L 63.782609 32.702739 +L 65.358772 27.59887 +L 70.349954 10.841507 +L 71.663424 7.465043 +L 72.714199 5.358537 +L 73.50228 4.176515 +L 74.290362 3.362541 +L 75.078443 2.932965 +L 75.603831 2.86472 +L 76.129219 2.971926 +L 76.654606 3.253626 +L 77.442688 3.997422 +L 78.230769 5.112863 +L 79.018851 6.577546 +L 80.069626 9.021931 +L 81.383095 12.741438 +L 83.221952 18.808353 +L 84.272727 22.5 +L 84.272727 22.5 +" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_10"> + <path d="M 5.727273 42.136364 +L 67.197628 42.090587 +L 67.723016 41.876532 +L 68.511098 41.231836 +L 69.299179 40.21089 +L 70.087261 38.8342 +L 71.138036 36.493991 +L 72.451505 32.878456 +L 74.027668 27.797828 +L 79.018851 11.008167 +L 80.33232 7.598582 +L 81.383095 5.460128 +L 82.171177 4.251699 +L 82.959258 3.409809 +L 83.74734 2.951367 +L 84.272727 2.863636 +L 84.272727 2.863636 +" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> + </g> + </g> + </g> + <defs> + <clipPath id="pa3d24875ec"> + <rect x="1.8" y="0.9" width="86.4" height="43.2"/> + </clipPath> + </defs> +</svg> diff --git a/docs/background/basis/images/EvalRaisedCosineLog.svg b/docs/background/basis/images/EvalRaisedCosineLog.svg new file mode 100644 index 00000000..6389fc18 --- /dev/null +++ b/docs/background/basis/images/EvalRaisedCosineLog.svg @@ -0,0 +1,310 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> + <metadata> + <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <cc:Work> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:date>2024-12-02T16:54:51.023103</dc:date> + <dc:format>image/svg+xml</dc:format> + <dc:creator> + <cc:Agent> + <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> + </cc:Agent> + </dc:creator> + </cc:Work> + </rdf:RDF> + </metadata> + <defs> + <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> + </defs> + <g id="figure_1"> + <g id="patch_1"> + <path d="M 0 45 +L 90 45 +L 90 0 +L 0 0 +z +" style="fill: #ffffff"/> + </g> + <g id="axes_1"> + <g id="patch_2"> + <path d="M 1.8 44.1 +L 88.2 44.1 +L 88.2 0.9 +L 1.8 0.9 +z +" style="fill: #ffffff"/> + </g> + <g id="matplotlib.axis_1"/> + <g id="matplotlib.axis_2"/> + <g id="line2d_1"> + <path d="M 5.727273 2.863636 +L 5.989967 7.225475 +L 6.778048 34.84641 +L 7.040742 39.996484 +L 7.303436 42.060117 +L 7.828823 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_2"> + <path d="M 5.727273 22.5 +L 5.989967 10.159998 +L 6.25266 3.757449 +L 6.515354 3.319737 +L 6.778048 7.230654 +L 8.091517 37.807425 +L 8.354211 40.640345 +L 8.616905 41.980383 +L 8.879599 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_3"> + <path d="M 5.727273 42.136364 +L 5.989967 37.774525 +L 6.778048 10.15359 +L 7.040742 5.003516 +L 7.303436 2.939883 +L 7.56613 3.544813 +L 7.828823 6.18689 +L 8.354211 14.982377 +L 9.404986 33.406194 +L 9.930374 39.108852 +L 10.455762 41.819178 +L 10.718455 42.136362 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_4"> + <path d="M 5.727273 42.136364 +L 6.25266 42.136364 +L 6.515354 41.680263 +L 6.778048 37.769346 +L 8.091517 7.192575 +L 8.354211 4.359655 +L 8.616905 3.019617 +L 8.879599 3.0177 +L 9.142292 4.144683 +L 9.66768 8.868257 +L 12.031925 36.605077 +L 12.557312 39.866149 +L 13.0827 41.667204 +L 13.345394 42.05409 +L 13.870781 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_5"> + <path d="M 5.727273 42.136364 +L 7.303436 42.136364 +L 7.56613 41.455187 +L 7.828823 38.81311 +L 8.354211 30.017623 +L 9.404986 11.593806 +L 9.930374 5.891148 +L 10.455762 3.180822 +L 10.718455 2.863638 +L 10.981149 3.153569 +L 11.243843 3.974888 +L 11.769231 6.895082 +L 12.557312 13.33465 +L 14.658863 31.83752 +L 15.446944 36.770073 +L 16.235026 40.088617 +L 16.760413 41.405742 +L 17.285801 42.049351 +L 17.811189 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_6"> + <path d="M 5.727273 42.136364 +L 8.616905 42.136364 +L 8.879599 41.9823 +L 9.142292 40.855317 +L 9.66768 36.131743 +L 12.031925 8.394923 +L 12.557312 5.133851 +L 13.0827 3.332796 +L 13.345394 2.94591 +L 13.608088 2.873877 +L 13.870781 3.092334 +L 14.133475 3.575193 +L 14.658863 5.225814 +L 15.446944 9.01105 +L 16.760413 17.19343 +L 18.59927 28.76697 +L 19.650046 34.123507 +L 20.438127 37.271726 +L 21.226209 39.622337 +L 22.01429 41.18088 +L 22.539678 41.798355 +L 23.065065 42.098662 +L 23.853147 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_7"> + <path d="M 5.727273 42.136364 +L 10.718455 42.136364 +L 10.981149 41.846431 +L 11.243843 41.025112 +L 11.769231 38.104918 +L 12.557312 31.66535 +L 14.658863 13.16248 +L 15.446944 8.229927 +L 16.235026 4.911383 +L 16.760413 3.594258 +L 17.285801 2.950649 +L 17.548495 2.864134 +L 17.811189 2.923725 +L 18.336576 3.446071 +L 18.861964 4.4448 +L 19.650046 6.673413 +L 20.700821 10.632486 +L 22.539678 18.872292 +L 24.641228 28.112641 +L 25.954697 32.980145 +L 27.005473 36.167788 +L 28.056248 38.669523 +L 28.84433 40.088543 +L 29.632411 41.122946 +L 30.420493 41.78746 +L 31.208574 42.10235 +L 32.259349 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_8"> + <path d="M 5.727273 42.136364 +L 13.608088 42.126123 +L 13.870781 41.907666 +L 14.133475 41.424807 +L 14.658863 39.774186 +L 15.446944 35.98895 +L 16.760413 27.80657 +L 18.59927 16.23303 +L 19.650046 10.876493 +L 20.438127 7.728274 +L 21.226209 5.377663 +L 22.01429 3.81912 +L 22.539678 3.201645 +L 23.065065 2.901338 +L 23.590453 2.897184 +L 24.115841 3.165915 +L 24.641228 3.682852 +L 25.42931 4.868038 +L 26.217391 6.468634 +L 27.268167 9.105234 +L 28.84433 13.769025 +L 33.835512 29.203857 +L 35.411675 33.192156 +L 36.725144 35.98094 +L 38.038614 38.246232 +L 39.089389 39.674544 +L 40.140164 40.765404 +L 41.190939 41.528846 +L 42.241715 41.979595 +L 43.29249 42.135904 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_9"> + <path d="M 5.727273 42.136364 +L 17.811189 42.076275 +L 18.336576 41.553929 +L 18.861964 40.5552 +L 19.650046 38.326587 +L 20.700821 34.367514 +L 22.539678 26.127708 +L 24.641228 16.887359 +L 25.954697 12.019855 +L 27.005473 8.832212 +L 28.056248 6.330477 +L 28.84433 4.911457 +L 29.632411 3.877054 +L 30.420493 3.21254 +L 31.208574 2.89765 +L 31.996656 2.908124 +L 32.784737 3.216996 +L 33.572818 3.795658 +L 34.623594 4.936064 +L 35.674369 6.43421 +L 36.987838 8.707085 +L 38.826695 12.41608 +L 41.979021 19.432411 +L 45.131347 26.303705 +L 47.232898 30.412552 +L 49.071754 33.562317 +L 50.647917 35.885128 +L 52.22408 37.839264 +L 53.800243 39.41776 +L 55.113712 40.447984 +L 56.427182 41.224904 +L 57.740651 41.757275 +L 59.05412 42.056197 +L 60.367589 42.136364 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> + </g> + <g id="line2d_10"> + <path d="M 5.727273 42.136364 +L 23.590453 42.102816 +L 24.115841 41.834085 +L 24.641228 41.317148 +L 25.42931 40.131962 +L 26.217391 38.531366 +L 27.268167 35.894766 +L 28.84433 31.230975 +L 33.835512 15.796143 +L 35.411675 11.807844 +L 36.725144 9.01906 +L 38.038614 6.753768 +L 39.089389 5.325456 +L 40.140164 4.234596 +L 41.190939 3.471154 +L 42.241715 3.020405 +L 43.29249 2.864096 +L 44.343265 2.981443 +L 45.394041 3.349967 +L 46.444816 3.94619 +L 47.758285 4.975242 +L 49.334448 6.564989 +L 51.173305 8.810749 +L 53.274856 11.751411 +L 56.427182 16.586902 +L 62.46914 25.915289 +L 65.358772 29.917573 +L 67.723016 32.829343 +L 69.824567 35.102947 +L 71.926117 37.060316 +L 74.027668 38.692273 +L 75.866525 39.85226 +L 77.705382 40.76559 +L 79.544238 41.438826 +L 81.383095 41.881051 +L 83.221952 42.103323 +L 84.272727 42.136364 +L 84.272727 42.136364 +" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> + </g> + </g> + </g> + <defs> + <clipPath id="pe65a61e677"> + <rect x="1.8" y="0.9" width="86.4" height="43.2"/> + </clipPath> + </defs> +</svg> From 4be4c63245cda3352e530f319659a32ffa8c135b Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Mon, 2 Dec 2024 17:05:15 -0500 Subject: [PATCH 02/21] added table for basis --- docs/assets/stylesheets/custom.css | 36 ++++++---- docs/background/README.md | 17 +---- docs/background/basis/README.md | 71 +++++++++++++++++++ .../{ => basis}/plot_01_1D_basis_function.md | 0 .../{ => basis}/plot_02_ND_basis_function.md | 0 docs/conf.py | 4 ++ docs/tutorials/plot_02_head_direction.md | 1 + docs/tutorials/plot_03_grid_cells.md | 11 ++- docs/tutorials/plot_05_place_cells.md | 1 + 9 files changed, 109 insertions(+), 32 deletions(-) create mode 100644 docs/background/basis/README.md rename docs/background/{ => basis}/plot_01_1D_basis_function.md (100%) rename docs/background/{ => basis}/plot_02_ND_basis_function.md (100%) diff --git a/docs/assets/stylesheets/custom.css b/docs/assets/stylesheets/custom.css index f7dc7a81..463be8a4 100644 --- a/docs/assets/stylesheets/custom.css +++ b/docs/assets/stylesheets/custom.css @@ -94,17 +94,25 @@ html[data-theme=light]{ font-weight: normal; } -/*!* Style the brackets *!*/ -/*span.fn-bracket {*/ -/* color: #666; !* Dim the brackets *!*/ -/*}*/ - -/*!* Style the links within the footnotes *!*/ -/*aside.footnote a {*/ -/* color: #007BFF; !* Blue link color *!*/ -/* text-decoration: none; !* Remove underline *!*/ -/*}*/ - -/*aside.footnote a:hover {*/ -/* text-decoration: underline; !* Add underline on hover *!*/ -/*}*/ + #table-basis { + table-layout: auto; + width: 100%; +} + +#table-basis th:nth-child(1), #table-basis td:nth-child(1) { + width: 22%; +} + +#table-basis th:nth-child(2), #table-basis td:nth-child(2) { + width: 22%; +} +#table-basis th:nth-child(3), #table-basis td:nth-child(3) { + width: 10%; +} + +#table-basis th:nth-child(4), #table-basis td:nth-child(4) { + width: 20%; +} +#table-basis th:nth-child(5), #table-basis td:nth-child(5) { + width: 10%; +} diff --git a/docs/background/README.md b/docs/background/README.md index 3215c329..331a9b8c 100644 --- a/docs/background/README.md +++ b/docs/background/README.md @@ -34,26 +34,13 @@ plot_00_conceptual_intro.md :::{grid-item-card} <figure> -<img src="../_static/thumbnails/background/plot_01_1D_basis_function.svg" style="height: 100px", alt="One-Dimensional Basis."/> +<img src="../_images/EvalRaisedCosineLinear.svg" style="height: 100px", alt="Basis Functions"/> </figure> ```{toctree} :maxdepth: 2 -plot_01_1D_basis_function.md -``` -::: - -:::{grid-item-card} - -<figure> -<img src="../_static/thumbnails/background/plot_02_ND_basis_function.svg" style="height: 100px", alt="N-Dimensional Basis."/> -</figure> - -```{toctree} -:maxdepth: 2 - -plot_02_ND_basis_function.md +basis/README.md ``` ::: diff --git a/docs/background/basis/README.md b/docs/background/basis/README.md new file mode 100644 index 00000000..3ed0c087 --- /dev/null +++ b/docs/background/basis/README.md @@ -0,0 +1,71 @@ +# Basis Function + +```{table} +:name: table-basis + +| **Basis** | **Kernel Visualization** | **Examples** | **Evaluation/Convolution** | **Preferred Mode** | +|:---------------------------------:|:----------------------------------------------------------------------------:|:--------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------:|:--------------------:| +| **B-Spline** | <img src="images/EvalBSpline.svg" alt="B-spline."/> | [Grid cells](grid_cells_nemos) | [EvalBSpline](nemos.basis.basis.EvalBSpline)<br>[ConvBSpline](nemos.basis.basis.ConvBSpline) | 🟢 Eval | +| **Cyclic B-Spline** | <img src="images/EvalCyclicBSpline.svg" alt="Cyclic B-spline."/> | [Place cells](basis_eval_place_cells) | [EvalCyclicBSpline](nemos.basis.basis.EvalCyclicBSpline)<br>[ConvCyclicBSpline](nemos.basis.basis.ConvCyclicBSpline) | 🟢 Eval | +| **M-Spline** | <img src="images/EvalMSpline.svg" alt="M-spline."/> | [Place cells](basis_eval_place_cells) | [EvalMSpline](nemos.basis.basis.EvalMSpline)<br>[ConvMSpline](nemos.basis.basis.ConvMSpline) | 🟢 Eval | +| **Linearly Spaced Raised Cosine** | <img src="images/EvalRaisedCosineLinear.svg" alt="Raised Cosine Linear."/> | | [EvalRaisedCosineLinear](nemos.basis.basis.EvalRaisedCosineLinear)<br>[ConvRaisedCosineLinear](nemos.basis.basis.ConvRaisedCosineLinear) | 🟢 Eval | +| **Log Spaced Raised Cosine** | <img src="images/EvalRaisedCosineLog.svg" alt="Raised Cosine Log."/> | [Head Direction](head_direction_reducing_dimensionality) | [EvalRaisedCosineLog](nemos.basis.basis.EvalRaisedCosineLog)<br>[ConvRaisedCosineLog](nemos.basis.basis.ConvRaisedCosineLog) | 🔵 Conv | +``` + +## Overview + +A basis function is a collection of simple building blocks—functions that, when combined (weighted and summed together), can represent more complex, non-linear relationships. Think of them as tools for constructing predictors in GLMs, helping to model: + +1. **Non-linear mappings** between task variables (like velocity or position) and firing rates. +2. **Linear temporal effects**, such as spike history, neuron-to-neuron couplings, or how stimuli are integrated over time. + +In a GLM, we assume a non-linear mapping exists between task variables and neuronal firing rates. This mapping isn’t something we can directly observe—what we do see are the inputs (task covariates) and the resulting neural activity. The challenge is to infer a "good" approximation of this hidden relationship. + +Basis functions help simplify this process by representing the non-linearity as a weighted sum of fixed functions, $\psi_1(x), \dots, \psi_n(x)$, with weights $\alpha_1, \dots, \alpha_n$. Mathematically: + +$$ +f(x) \approx \alpha_1 \psi_1(x) + \dots + \alpha_n \psi_n(x) +$$ + +Here, $\approx$ means "approximately equal". Instead of tackling the hard problem of learning an unknown function $f(x)$ directly, we reduce it to the simpler task of learning the weights $\{\alpha_i\}$. + + + +## Basis in NeMoS + +NeMoS provides a variety of basis function objects, each tailored for specific shapes and use cases. These objects make it easy to define both non-linear features and temporal predictors. Depending on the type of modeling you need, NeMoS offers: + +- **Eval-basis objects**: For creating non-linear features. (Names start with `Eval`.) +- **Conv-basis objects**: For defining temporal predictors. (Names start with `Conv`.) + +If you want to know how to create and use one-dimensional bases or combining them to build multi-dimensional predictors, check out these resources: + +::::{grid} 1 2 2 2 + +:::{grid-item-card} + +<figure> +<img src="../../_static/thumbnails/background/plot_01_1D_basis_function.svg" style="height: 100px", alt="One-Dimensional Basis."/> +</figure> + +```{toctree} +:maxdepth: 2 + +plot_01_1D_basis_function.md +``` +::: + +:::{grid-item-card} + +<figure> +<img src="../../_static/thumbnails/background/plot_02_ND_basis_function.svg" style="height: 100px", alt="N-Dimensional Basis."/> +</figure> + +```{toctree} +:maxdepth: 2 + +plot_02_ND_basis_function.md +``` +::: + +:::: \ No newline at end of file diff --git a/docs/background/plot_01_1D_basis_function.md b/docs/background/basis/plot_01_1D_basis_function.md similarity index 100% rename from docs/background/plot_01_1D_basis_function.md rename to docs/background/basis/plot_01_1D_basis_function.md diff --git a/docs/background/plot_02_ND_basis_function.md b/docs/background/basis/plot_02_ND_basis_function.md similarity index 100% rename from docs/background/plot_02_ND_basis_function.md rename to docs/background/basis/plot_02_ND_basis_function.md diff --git a/docs/conf.py b/docs/conf.py index c8f5e3a2..6204fa1e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -121,6 +121,10 @@ "logo": { "image_light": "_static/NeMoS_Logo_CMYK_Full.svg", "image_dark": "_static/NeMoS_Logo_CMYK_White.svg", + }, + "secondary_sidebar_items": { + "**": ["page-toc", "sourcelink"], + "background/basis/README": [], } } diff --git a/docs/tutorials/plot_02_head_direction.md b/docs/tutorials/plot_02_head_direction.md index e4402053..ee7c478c 100644 --- a/docs/tutorials/plot_02_head_direction.md +++ b/docs/tutorials/plot_02_head_direction.md @@ -374,6 +374,7 @@ worst if we needed a finer temporal resolution, such 1ms time bins (which would require 800 coefficients instead of 80). What can we do to mitigate over-fitting now? +(head_direction_reducing_dimensionality)= #### Reducing feature dimensionality One way to proceed is to find a lower-dimensional representation of the response by parametrizing the decay effect. For instance, we could try to model it diff --git a/docs/tutorials/plot_03_grid_cells.md b/docs/tutorials/plot_03_grid_cells.md index a7f767ef..d0b58e0a 100644 --- a/docs/tutorials/plot_03_grid_cells.md +++ b/docs/tutorials/plot_03_grid_cells.md @@ -123,6 +123,8 @@ for i in range(len(spikes)): plt.tight_layout() ``` + +(grid_cells_nemos)= ## NeMoS It's time to use NeMoS. Let's try to predict the spikes as a function of position and see if we can generate better tuning curves @@ -146,9 +148,9 @@ We can define a two-dimensional basis for position by multiplying two one-dimens see [here](../../background/plot_02_ND_basis_function) for more details. ```{code-cell} ipython3 -basis_2d = nmo.basis.EvalRaisedCosineLinear( +basis_2d = nmo.basis.EvalBspline( n_basis_funcs=10 -) * nmo.basis.EvalRaisedCosineLinear(n_basis_funcs=10) +) * nmo.basis.EvalBspline(n_basis_funcs=10) ``` Let's see what a few basis look like. Here we evaluate it on a 100 x 100 grid. @@ -219,7 +221,10 @@ Here we will focus on the last neuron (neuron 7) who has a nice grid pattern ```{code-cell} ipython3 model = nmo.glm.GLM( regularizer="Ridge", - regularizer_strength=0.001 + regularizer_strength=0.001, + # lowering the tolerance means that the solution will be closer to the optimum + # (at the cost of increasing execution time) + solver_kwargs=dict(tol=10**-12), ) ``` diff --git a/docs/tutorials/plot_05_place_cells.md b/docs/tutorials/plot_05_place_cells.md index 597959c3..88eb081f 100644 --- a/docs/tutorials/plot_05_place_cells.md +++ b/docs/tutorials/plot_05_place_cells.md @@ -331,6 +331,7 @@ print(speed.shape) print(count.shape) ``` +(basis_eval_place_cells)= ## Basis evaluation For each feature, we will use a different set of basis : From 98eaf253ecc6597bed736d663fd7023adb626d73 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Mon, 2 Dec 2024 17:10:18 -0500 Subject: [PATCH 03/21] fix notebook --- docs/tutorials/plot_03_grid_cells.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/plot_03_grid_cells.md b/docs/tutorials/plot_03_grid_cells.md index d0b58e0a..92a045bc 100644 --- a/docs/tutorials/plot_03_grid_cells.md +++ b/docs/tutorials/plot_03_grid_cells.md @@ -148,9 +148,9 @@ We can define a two-dimensional basis for position by multiplying two one-dimens see [here](../../background/plot_02_ND_basis_function) for more details. ```{code-cell} ipython3 -basis_2d = nmo.basis.EvalBspline( +basis_2d = nmo.basis.EvalBSpline( n_basis_funcs=10 -) * nmo.basis.EvalBspline(n_basis_funcs=10) +) * nmo.basis.EvalBSpline(n_basis_funcs=10) ``` Let's see what a few basis look like. Here we evaluate it on a 100 x 100 grid. From 7a13bcdd20156b3ae654838fc52aab756d6b53d6 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Mon, 2 Dec 2024 17:18:10 -0500 Subject: [PATCH 04/21] fix notebook --- docs/tutorials/plot_03_grid_cells.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/plot_03_grid_cells.md b/docs/tutorials/plot_03_grid_cells.md index 92a045bc..d2e8da7a 100644 --- a/docs/tutorials/plot_03_grid_cells.md +++ b/docs/tutorials/plot_03_grid_cells.md @@ -221,7 +221,7 @@ Here we will focus on the last neuron (neuron 7) who has a nice grid pattern ```{code-cell} ipython3 model = nmo.glm.GLM( regularizer="Ridge", - regularizer_strength=0.001, + regularizer_strength=0.0001, # lowering the tolerance means that the solution will be closer to the optimum # (at the cost of increasing execution time) solver_kwargs=dict(tol=10**-12), From 0a53a594064342bf8f3946a190cc224eddab7655 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Mon, 2 Dec 2024 17:43:13 -0500 Subject: [PATCH 05/21] ADDED ORTH exp --- docs/background/basis/README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/background/basis/README.md b/docs/background/basis/README.md index 3ed0c087..507060b0 100644 --- a/docs/background/basis/README.md +++ b/docs/background/basis/README.md @@ -1,5 +1,6 @@ # Basis Function +(table_basis)= ```{table} :name: table-basis @@ -10,6 +11,7 @@ | **M-Spline** | <img src="images/EvalMSpline.svg" alt="M-spline."/> | [Place cells](basis_eval_place_cells) | [EvalMSpline](nemos.basis.basis.EvalMSpline)<br>[ConvMSpline](nemos.basis.basis.ConvMSpline) | 🟢 Eval | | **Linearly Spaced Raised Cosine** | <img src="images/EvalRaisedCosineLinear.svg" alt="Raised Cosine Linear."/> | | [EvalRaisedCosineLinear](nemos.basis.basis.EvalRaisedCosineLinear)<br>[ConvRaisedCosineLinear](nemos.basis.basis.ConvRaisedCosineLinear) | 🟢 Eval | | **Log Spaced Raised Cosine** | <img src="images/EvalRaisedCosineLog.svg" alt="Raised Cosine Log."/> | [Head Direction](head_direction_reducing_dimensionality) | [EvalRaisedCosineLog](nemos.basis.basis.EvalRaisedCosineLog)<br>[ConvRaisedCosineLog](nemos.basis.basis.ConvRaisedCosineLog) | 🔵 Conv | +| **Orthogonalized Exponential Decays** | <img src="images/EvalOrthExponential.svg" alt="Orth Exponential Decays"/> | [Head Direction](head_direction_reducing_dimensionality) | [EvalOrthExponential](nemos.basis.basis.EvalOrthExponential)<br>[ConvOrthExponential](nemos.basis.basis.ConvOrthExponential) | 🟢 Eval | ``` ## Overview @@ -27,18 +29,21 @@ $$ f(x) \approx \alpha_1 \psi_1(x) + \dots + \alpha_n \psi_n(x) $$ -Here, $\approx$ means "approximately equal". Instead of tackling the hard problem of learning an unknown function $f(x)$ directly, we reduce it to the simpler task of learning the weights $\{\alpha_i\}$. +Here, $\approx$ means "approximately equal". +Instead of tackling the hard problem of learning an unknown function $f(x)$ directly, we reduce it to the simpler task of learning the weights $\{\alpha_i\}$. ## Basis in NeMoS -NeMoS provides a variety of basis function objects, each tailored for specific shapes and use cases. These objects make it easy to define both non-linear features and temporal predictors. Depending on the type of modeling you need, NeMoS offers: +NeMoS provides a variety of basis functions (see the [table](table_basis) above). For each basis type, there are two dedicated classes of objects, corresponding to the two key uses described in the overview: -- **Eval-basis objects**: For creating non-linear features. (Names start with `Eval`.) -- **Conv-basis objects**: For defining temporal predictors. (Names start with `Conv`.) +- **Eval-basis objects**: For representing non-linear mappings between task variables and outputs. These objects are identified by names starting with `Eval`. +- **Conv-basis objects**: For linear temporal effects. These objects are identified by names starting with `Conv`. -If you want to know how to create and use one-dimensional bases or combining them to build multi-dimensional predictors, check out these resources: +`Eval` and `Conv` objects can be combined to construct multi-dimensional basis functions, enabling complex feature construction. + +## Learn More ::::{grid} 1 2 2 2 From 4777a252ea79296cfdbd443b079ca8efa4787d4b Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Mon, 2 Dec 2024 17:44:41 -0500 Subject: [PATCH 06/21] fixed entry --- docs/background/basis/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/background/basis/README.md b/docs/background/basis/README.md index 507060b0..cbfbbab9 100644 --- a/docs/background/basis/README.md +++ b/docs/background/basis/README.md @@ -11,7 +11,7 @@ | **M-Spline** | <img src="images/EvalMSpline.svg" alt="M-spline."/> | [Place cells](basis_eval_place_cells) | [EvalMSpline](nemos.basis.basis.EvalMSpline)<br>[ConvMSpline](nemos.basis.basis.ConvMSpline) | 🟢 Eval | | **Linearly Spaced Raised Cosine** | <img src="images/EvalRaisedCosineLinear.svg" alt="Raised Cosine Linear."/> | | [EvalRaisedCosineLinear](nemos.basis.basis.EvalRaisedCosineLinear)<br>[ConvRaisedCosineLinear](nemos.basis.basis.ConvRaisedCosineLinear) | 🟢 Eval | | **Log Spaced Raised Cosine** | <img src="images/EvalRaisedCosineLog.svg" alt="Raised Cosine Log."/> | [Head Direction](head_direction_reducing_dimensionality) | [EvalRaisedCosineLog](nemos.basis.basis.EvalRaisedCosineLog)<br>[ConvRaisedCosineLog](nemos.basis.basis.ConvRaisedCosineLog) | 🔵 Conv | -| **Orthogonalized Exponential Decays** | <img src="images/EvalOrthExponential.svg" alt="Orth Exponential Decays"/> | [Head Direction](head_direction_reducing_dimensionality) | [EvalOrthExponential](nemos.basis.basis.EvalOrthExponential)<br>[ConvOrthExponential](nemos.basis.basis.ConvOrthExponential) | 🟢 Eval | +| **Orthogonalized Exponential Decays** | <img src="images/EvalOrthExponential.svg" alt="Orth Exponential Decays"/> | | [EvalOrthExponential](nemos.basis.basis.EvalOrthExponential)<br>[ConvOrthExponential](nemos.basis.basis.ConvOrthExponential) | 🟢 Eval | ``` ## Overview From be197c13db1c91d620832261d71fd015d8b3bcbc Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Wed, 4 Dec 2024 09:17:30 -0500 Subject: [PATCH 07/21] add script to gen figs --- docs/conf.py | 7 +- docs/scripts/basis_table_figs.py | 50 ++++ src/nemos/_inspect_utils/__init__.py | 34 +++ .../nemos/_inspect_utils/inpsect_utils.py | 41 ++- tests/test_basis.py | 265 +++++++++--------- tox.ini | 3 + 6 files changed, 261 insertions(+), 139 deletions(-) create mode 100644 docs/scripts/basis_table_figs.py create mode 100644 src/nemos/_inspect_utils/__init__.py rename tests/utils_testing.py => src/nemos/_inspect_utils/inpsect_utils.py (85%) diff --git a/docs/conf.py b/docs/conf.py index 6204fa1e..f4a40b05 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,6 +40,7 @@ 'sphinx.ext.mathjax', 'sphinx_autodoc_typehints', 'sphinx_togglebutton', + 'matplotlib.sphinxext.plot_directive', ] myst_enable_extensions = [ @@ -68,7 +69,7 @@ 'inherited-members': True, 'undoc-members': True, 'show-inheritance': True, - 'special-members': '__call__, __add__, __mul__, __pow__' + 'special-members': ' __add__, __mul__, __pow__' } # # napolean configs @@ -121,10 +122,6 @@ "logo": { "image_light": "_static/NeMoS_Logo_CMYK_Full.svg", "image_dark": "_static/NeMoS_Logo_CMYK_White.svg", - }, - "secondary_sidebar_items": { - "**": ["page-toc", "sourcelink"], - "background/basis/README": [], } } diff --git a/docs/scripts/basis_table_figs.py b/docs/scripts/basis_table_figs.py new file mode 100644 index 00000000..7e3b503f --- /dev/null +++ b/docs/scripts/basis_table_figs.py @@ -0,0 +1,50 @@ +import matplotlib.pyplot as plt +import numpy as np + +import nemos as nmo +from nemos._inspect_utils import trim_kwargs + +KWARGS = dict( + n_basis_funcs=10, + decay_rates=np.arange(1, 10 + 1), + enforce_decay_to_zero=True, + order=4, + width=2, +) + + +def plot_basis(cls): + cls_params = cls._get_param_names() + new_kwargs = trim_kwargs(cls, KWARGS.copy(), {cls.__name__: cls_params}) + bas = cls(**new_kwargs) + fig, ax = plt.subplots(1, 1, figsize=(5 / 4, 2.5 / 4)) + ax.plot(*bas.evaluate_on_grid(300), lw=0.8) + for side in ["left", "right", "top", "bottom"]: + ax.spines[side].set_visible(False) + ax.set_xticks([]) + ax.set_yticks([]) + plt.subplots_adjust(left=0.02, right=0.98, top=0.98, bottom=0.02) + + +def plot_raised_cosine_linear(): + plot_basis(nmo.basis.RaisedCosineLinearEval) + + +def plot_raised_cosine_log(): + plot_basis(nmo.basis.RaisedCosineLogEval) + + +def plot_mspline(): + plot_basis(nmo.basis.MSplineEval) + + +def plot_bspline(): + plot_basis(nmo.basis.BSplineEval) + + +def plot_cyclic_bspline(): + plot_basis(nmo.basis.CyclicBSplineEval) + + +def plot_orth_exp_basis(): + plot_basis(nmo.basis.OrthExponentialEval) diff --git a/src/nemos/_inspect_utils/__init__.py b/src/nemos/_inspect_utils/__init__.py new file mode 100644 index 00000000..21743bd6 --- /dev/null +++ b/src/nemos/_inspect_utils/__init__.py @@ -0,0 +1,34 @@ +""" +This module provides utilities for inspecting class hierarchies, +abstract methods, and subclass method implementations. + +Modules +------- +inspect_utils : module + Contains utility functions to analyze abstract and concrete class methods, + identify abstract classes, and verify method compliance in subclasses. +""" + +from .inpsect_utils import ( + check_all_abstract_methods_compliance, + get_abstract_classes, + get_non_abstract_classes, + get_subclass_methods, + get_superclass_abstract_methods, + is_abstract, + list_abstract_methods, + reimplements_method, + trim_kwargs, +) + +__all__ = [ + "reimplements_method", + "get_subclass_methods", + "list_abstract_methods", + "is_abstract", + "get_non_abstract_classes", + "get_abstract_classes", + "get_superclass_abstract_methods", + "check_all_abstract_methods_compliance", + "trim_kwargs", +] diff --git a/tests/utils_testing.py b/src/nemos/_inspect_utils/inpsect_utils.py similarity index 85% rename from tests/utils_testing.py rename to src/nemos/_inspect_utils/inpsect_utils.py index 344ad451..eab425ef 100644 --- a/tests/utils_testing.py +++ b/src/nemos/_inspect_utils/inpsect_utils.py @@ -40,7 +40,7 @@ def get_subclass_methods(class_obj: type) -> List[Tuple[str, type]]: Returns ------- - List[Tuple[str, type]] + : A list of tuples representing the methods that are specific to the subclass. Each tuple contains the method name (str) and the corresponding method object. """ @@ -113,7 +113,7 @@ def get_non_abstract_classes(module) -> List[Tuple[str, type]]: Returns ------- - List[Tuple[str, type]] + : A list of tuples representing the non-abstract classes in the module. Each tuple contains the class name (str) and the corresponding class object. """ @@ -208,3 +208,40 @@ def check_all_abstract_methods_compliance(module) -> None: raise ValueError( f"Abstract method {method} not implemented in {base_class} sub-class!" ) + + +def trim_kwargs(cls: type, kwargs: dict, class_specific_params: dict): + """ + Filter a dictionary of keyword arguments to include only those specific to a given class. + + Parameters + ---------- + cls : + The class object for which the keyword arguments are filtered. + kwargs : + A dictionary of keyword arguments to be filtered. + class_specific_params : + A mapping of class names to sets or lists of allowed parameter names. + + Returns + ------- + : + A dictionary containing only the keyword arguments specific to the given class. + + Example + ------- + >>> class_specific_params = { + ... 'MyClass': {'param1', 'param2'}, + ... 'OtherClass': {'param3', 'param4'} + ... } + >>> kwargs = {'param1': 10, 'param3': 20, 'param5': 30} + >>> class MyClass: + ... pass + >>> trim_kwargs(MyClass, kwargs, class_specific_params) + {'param1': 10} + """ + return { + key: value + for key, value in kwargs.items() + if key in class_specific_params[cls.__name__] + } diff --git a/tests/test_basis.py b/tests/test_basis.py index 3f86ebe7..b85f2d9e 100644 --- a/tests/test_basis.py +++ b/tests/test_basis.py @@ -11,10 +11,10 @@ import numpy as np import pynapple as nap import pytest -import utils_testing from sklearn.base import clone as sk_clone import nemos as nmo +import nemos._inspect_utils as inspect_utils import nemos.basis.basis as basis import nemos.convolve as convolve from nemos.basis._basis import AdditiveBasis, Basis, MultiplicativeBasis, add_docstring @@ -27,14 +27,6 @@ from nemos.utils import pynapple_concatenate_numpy -def trim_kwargs(cls, kwargs, class_specific_params): - return { - key: value - for key, value in kwargs.items() - if key in class_specific_params[cls.__name__] - } - - def extra_decay_rates(cls, n_basis): name = cls.__name__ if "OrthExp" in name: @@ -50,11 +42,11 @@ def list_all_basis_classes(filter_basis="all") -> list[type]: """ all_basis = [ class_obj - for _, class_obj in utils_testing.get_non_abstract_classes(basis) + for _, class_obj in inspect_utils.get_non_abstract_classes(basis) if issubclass(class_obj, Basis) ] + [ bas - for _, bas in utils_testing.get_non_abstract_classes(nmo.basis._basis) + for _, bas in inspect_utils.get_non_abstract_classes(nmo.basis._basis) if bas != basis.TransformerBasis ] if filter_basis != "all": @@ -132,7 +124,7 @@ def test_all_basis_are_tested() -> None: ("evaluate_on_grid", "The number of points in the uniformly spaced grid"), ( "compute_features", - "Compute the basis functions and transform input data into model features", + "Apply the basis transformation to the input data", ), ( "split_by_feature", @@ -167,7 +159,7 @@ def test_example_docstrings_add( continue if basis_name == basis_instance.__class__.__name__: continue - assert basis_name not in doc_components[1] + assert f" {basis_name}" not in doc_components[1] def test_add_docstring(): @@ -191,19 +183,19 @@ def method(self): @pytest.mark.parametrize( "basis_instance, super_class", [ - (basis.EvalBSpline(10), BSplineBasis), - (basis.ConvBSpline(10, window_size=11), BSplineBasis), - (basis.EvalCyclicBSpline(10), CyclicBSplineBasis), - (basis.ConvCyclicBSpline(10, window_size=11), CyclicBSplineBasis), - (basis.EvalMSpline(10), MSplineBasis), - (basis.ConvMSpline(10, window_size=11), MSplineBasis), - (basis.EvalRaisedCosineLinear(10), RaisedCosineBasisLinear), - (basis.ConvRaisedCosineLinear(10, window_size=11), RaisedCosineBasisLinear), - (basis.EvalRaisedCosineLog(10), RaisedCosineBasisLog), - (basis.ConvRaisedCosineLog(10, window_size=11), RaisedCosineBasisLog), - (basis.EvalOrthExponential(10, np.arange(1, 11)), OrthExponentialBasis), + (basis.BSplineEval(10), BSplineBasis), + (basis.BSplineConv(10, window_size=11), BSplineBasis), + (basis.CyclicBSplineEval(10), CyclicBSplineBasis), + (basis.CyclicBSplineConv(10, window_size=11), CyclicBSplineBasis), + (basis.MSplineEval(10), MSplineBasis), + (basis.MSplineConv(10, window_size=11), MSplineBasis), + (basis.RaisedCosineLinearEval(10), RaisedCosineBasisLinear), + (basis.RaisedCosineLinearConv(10, window_size=11), RaisedCosineBasisLinear), + (basis.RaisedCosineLogEval(10), RaisedCosineBasisLog), + (basis.RaisedCosineLogConv(10, window_size=11), RaisedCosineBasisLog), + (basis.OrthExponentialEval(10, np.arange(1, 11)), OrthExponentialBasis), ( - basis.ConvOrthExponential(10, decay_rates=np.arange(1, 11), window_size=12), + basis.OrthExponentialConv(10, decay_rates=np.arange(1, 11), window_size=12), OrthExponentialBasis, ), ], @@ -218,19 +210,19 @@ def test_expected_output_eval_on_grid(basis_instance, super_class): @pytest.mark.parametrize( "basis_instance, super_class", [ - (basis.EvalBSpline(10), BSplineBasis), - (basis.ConvBSpline(10, window_size=11), BSplineBasis), - (basis.EvalCyclicBSpline(10), CyclicBSplineBasis), - (basis.ConvCyclicBSpline(10, window_size=11), CyclicBSplineBasis), - (basis.EvalMSpline(10), MSplineBasis), - (basis.ConvMSpline(10, window_size=11), MSplineBasis), - (basis.EvalRaisedCosineLinear(10), RaisedCosineBasisLinear), - (basis.ConvRaisedCosineLinear(10, window_size=11), RaisedCosineBasisLinear), - (basis.EvalRaisedCosineLog(10), RaisedCosineBasisLog), - (basis.ConvRaisedCosineLog(10, window_size=11), RaisedCosineBasisLog), - (basis.EvalOrthExponential(10, np.arange(1, 11)), OrthExponentialBasis), + (basis.BSplineEval(10), BSplineBasis), + (basis.BSplineConv(10, window_size=11), BSplineBasis), + (basis.CyclicBSplineEval(10), CyclicBSplineBasis), + (basis.CyclicBSplineConv(10, window_size=11), CyclicBSplineBasis), + (basis.MSplineEval(10), MSplineBasis), + (basis.MSplineConv(10, window_size=11), MSplineBasis), + (basis.RaisedCosineLinearEval(10), RaisedCosineBasisLinear), + (basis.RaisedCosineLinearConv(10, window_size=11), RaisedCosineBasisLinear), + (basis.RaisedCosineLogEval(10), RaisedCosineBasisLog), + (basis.RaisedCosineLogConv(10, window_size=11), RaisedCosineBasisLog), + (basis.OrthExponentialEval(10, np.arange(1, 11)), OrthExponentialBasis), ( - basis.ConvOrthExponential(10, decay_rates=np.arange(1, 11), window_size=12), + basis.OrthExponentialConv(10, decay_rates=np.arange(1, 11), window_size=12), OrthExponentialBasis, ), ], @@ -246,31 +238,31 @@ def test_expected_output_compute_features(basis_instance, super_class): @pytest.mark.parametrize( "basis_instance, super_class", [ - (basis.EvalBSpline(10, label="label"), BSplineBasis), - (basis.ConvBSpline(10, window_size=11, label="label"), BSplineBasis), - (basis.EvalCyclicBSpline(10, label="label"), CyclicBSplineBasis), + (basis.BSplineEval(10, label="label"), BSplineBasis), + (basis.BSplineConv(10, window_size=11, label="label"), BSplineBasis), + (basis.CyclicBSplineEval(10, label="label"), CyclicBSplineBasis), ( - basis.ConvCyclicBSpline(10, window_size=11, label="label"), + basis.CyclicBSplineConv(10, window_size=11, label="label"), CyclicBSplineBasis, ), - (basis.EvalMSpline(10, label="label"), MSplineBasis), - (basis.ConvMSpline(10, window_size=11, label="label"), MSplineBasis), - (basis.EvalRaisedCosineLinear(10, label="label"), RaisedCosineBasisLinear), + (basis.MSplineEval(10, label="label"), MSplineBasis), + (basis.MSplineConv(10, window_size=11, label="label"), MSplineBasis), + (basis.RaisedCosineLinearEval(10, label="label"), RaisedCosineBasisLinear), ( - basis.ConvRaisedCosineLinear(10, window_size=11, label="label"), + basis.RaisedCosineLinearConv(10, window_size=11, label="label"), RaisedCosineBasisLinear, ), - (basis.EvalRaisedCosineLog(10, label="label"), RaisedCosineBasisLog), + (basis.RaisedCosineLogEval(10, label="label"), RaisedCosineBasisLog), ( - basis.ConvRaisedCosineLog(10, window_size=11, label="label"), + basis.RaisedCosineLogConv(10, window_size=11, label="label"), RaisedCosineBasisLog, ), ( - basis.EvalOrthExponential(10, np.arange(1, 11), label="label"), + basis.OrthExponentialEval(10, np.arange(1, 11), label="label"), OrthExponentialBasis, ), ( - basis.ConvOrthExponential( + basis.OrthExponentialConv( 10, decay_rates=np.arange(1, 11), window_size=12, label="label" ), OrthExponentialBasis, @@ -305,12 +297,12 @@ def cls(self): @pytest.mark.parametrize( "cls", [ - {"eval": basis.EvalRaisedCosineLog, "conv": basis.ConvRaisedCosineLog}, - {"eval": basis.EvalRaisedCosineLinear, "conv": basis.ConvRaisedCosineLinear}, - {"eval": basis.EvalBSpline, "conv": basis.ConvBSpline}, - {"eval": basis.EvalCyclicBSpline, "conv": basis.ConvCyclicBSpline}, - {"eval": basis.EvalMSpline, "conv": basis.ConvMSpline}, - {"eval": basis.EvalOrthExponential, "conv": basis.ConvOrthExponential}, + {"eval": basis.RaisedCosineLogEval, "conv": basis.RaisedCosineLogConv}, + {"eval": basis.RaisedCosineLinearEval, "conv": basis.RaisedCosineLinearConv}, + {"eval": basis.BSplineEval, "conv": basis.BSplineConv}, + {"eval": basis.CyclicBSplineEval, "conv": basis.CyclicBSplineConv}, + {"eval": basis.MSplineEval, "conv": basis.MSplineConv}, + {"eval": basis.OrthExponentialEval, "conv": basis.OrthExponentialConv}, ], ) class TestSharedMethods: @@ -345,7 +337,7 @@ def test_call_vmin_vmax(self, samples, vmin, vmax, expectation, cls): return bas = cls["eval"](5, bounds=(vmin, vmax), **extra_decay_rates(cls["eval"], 5)) with expectation: - bas(samples) + bas._evaluate(samples) @pytest.mark.parametrize( "attribute, value", @@ -532,7 +524,7 @@ def test_call_basis_number(self, n_basis, mode, kwargs, cls): n_basis_funcs=n_basis, **kwargs, **extra_decay_rates(cls[mode], n_basis) ) x = np.linspace(0, 1, 10) - assert bas(x).shape[1] == n_basis + assert bas._evaluate(x).shape[1] == n_basis @pytest.mark.parametrize("n_basis", [6]) def test_call_equivalent_in_conv(self, n_basis, cls): @@ -545,7 +537,7 @@ def test_call_equivalent_in_conv(self, n_basis, cls): n_basis_funcs=n_basis, **extra_decay_rates(cls["eval"], n_basis) ) x = np.linspace(0, 1, 10) - assert np.all(bas_con(x) == bas_eval(x)) + assert np.all(bas_con._evaluate(x) == bas_eval._evaluate(x)) @pytest.mark.parametrize( "num_input, expectation", @@ -564,7 +556,7 @@ def test_call_input_num(self, num_input, n_basis, mode, kwargs, expectation, cls n_basis_funcs=n_basis, **kwargs, **extra_decay_rates(cls[mode], n_basis) ) with expectation: - bas(*([np.linspace(0, 1, 10)] * num_input)) + bas._evaluate(*([np.linspace(0, 1, 10)] * num_input)) @pytest.mark.parametrize( "inp, expectation", @@ -582,7 +574,7 @@ def test_call_input_shape(self, inp, mode, kwargs, expectation, n_basis, cls): n_basis_funcs=n_basis, **kwargs, **extra_decay_rates(cls[mode], n_basis) ) with expectation: - bas(inp) + bas._evaluate(inp) @pytest.mark.parametrize( "samples, expectation", @@ -600,7 +592,7 @@ def test_call_input_type(self, samples, expectation, n_basis, cls): n_basis_funcs=n_basis, **extra_decay_rates(cls["eval"], n_basis) ) # Only eval mode is relevant here with expectation: - bas(samples) + bas._evaluate(samples) @pytest.mark.parametrize( "mode, kwargs", [("eval", {}), ("conv", {"window_size": 3})] @@ -609,7 +601,7 @@ def test_call_nan(self, mode, kwargs, cls): bas = cls[mode](n_basis_funcs=5, **kwargs, **extra_decay_rates(cls[mode], 5)) x = np.linspace(0, 1, 10) x[3] = np.nan - assert all(np.isnan(bas(x)[3])) + assert all(np.isnan(bas._evaluate(x)[3])) @pytest.mark.parametrize("n_basis", [6, 7]) @pytest.mark.parametrize( @@ -620,7 +612,7 @@ def test_call_non_empty(self, n_basis, mode, kwargs, cls): n_basis_funcs=n_basis, **kwargs, **extra_decay_rates(cls[mode], n_basis) ) with pytest.raises(ValueError, match="All sample provided must"): - bas(np.array([])) + bas._evaluate(np.array([])) @pytest.mark.parametrize("time_axis_shape", [10, 11, 12]) @pytest.mark.parametrize( @@ -628,7 +620,10 @@ def test_call_non_empty(self, n_basis, mode, kwargs, cls): ) def test_call_sample_axis(self, time_axis_shape, mode, kwargs, cls): bas = cls[mode](n_basis_funcs=5, **kwargs, **extra_decay_rates(cls[mode], 5)) - assert bas(np.linspace(0, 1, time_axis_shape)).shape[0] == time_axis_shape + assert ( + bas._evaluate(np.linspace(0, 1, time_axis_shape)).shape[0] + == time_axis_shape + ) @pytest.mark.parametrize( "mn, mx, expectation", @@ -643,7 +638,7 @@ def test_call_sample_axis(self, time_axis_shape, mode, kwargs, cls): def test_call_sample_range(self, mn, mx, expectation, mode, kwargs, cls): bas = cls[mode](n_basis_funcs=5, **kwargs, **extra_decay_rates(cls[mode], 5)) with expectation: - bas(np.linspace(mn, mx, 10)) + bas._evaluate(np.linspace(mn, mx, 10)) @pytest.mark.parametrize( "kwargs, input1_shape, expectation", @@ -718,7 +713,7 @@ def test_compute_features_conv_input( ) # figure out which kwargs needs to be removed - kwargs = trim_kwargs(cls["conv"], kwargs, class_specific_params) + kwargs = inspect_utils.trim_kwargs(cls["conv"], kwargs, class_specific_params) basis_obj = cls["conv"](**kwargs) out = basis_obj.compute_features(x) @@ -1020,9 +1015,9 @@ def test_init_window_size(self, mode, ws, expectation, cls): # @pytest.mark.parametrize("mode, kwargs", [("eval", {}), ("conv", {"window_size": 2})]) # def test_minimum_number_of_basis_required_is_matched(self, n_basis_funcs, mode, kwargs, order, cls): # min_per_basis = { - # "EvalMSpline": (order < 1) | (n_basis_funcs < 1) | (order > n_basis_funcs), - # "EvalRaisedCosineLog": lambda x: x < 2, - # "EvalBSpline": lambda x: order > x, + # "MSplineEval": (order < 1) | (n_basis_funcs < 1) | (order > n_basis_funcs), + # "RaisedCosineLogEval": lambda x: x < 2, + # "BSplineEval": lambda x: order > x, # } # if n_basis_funcs < 2: # with pytest.raises( @@ -1070,7 +1065,7 @@ def test_number_of_required_inputs_compute_features( ) elif n_input != basis_obj._n_input_dimensionality: expectation = pytest.raises( - TypeError, match="takes 2 positional arguments but \d were given" + TypeError, match=r"takes 2 positional arguments but \d were given" ) else: expectation = does_not_raise() @@ -1085,8 +1080,8 @@ def test_pynapple_support(self, mode, kwargs, cls): bas = cls[mode](n_basis_funcs=5, **kwargs, **extra_decay_rates(cls[mode], 5)) x = np.linspace(0, 1, 10) x_nap = nap.Tsd(t=np.arange(10), d=x) - y = bas(x) - y_nap = bas(x_nap) + y = bas._evaluate(x) + y_nap = bas._evaluate(x_nap) assert isinstance(y_nap, nap.TsdFrame) assert np.all(y == y_nap.d) assert np.all(y_nap.t == x_nap.t) @@ -1258,7 +1253,7 @@ def test_transformer_get_params(self, cls): class TestRaisedCosineLogBasis(BasisFuncsTesting): - cls = {"eval": basis.EvalRaisedCosineLog, "conv": basis.ConvRaisedCosineLog} + cls = {"eval": basis.RaisedCosineLogEval, "conv": basis.RaisedCosineLogConv} @pytest.mark.parametrize("width", [1.5, 2, 2.5]) def test_decay_to_zero_basis_number_match(self, width): @@ -1332,7 +1327,7 @@ def test_set_width(self, width, expectation, mode, kwargs): def test_time_scaling_property(self): time_scaling = [0.1, 10, 100] n_basis_funcs = 5 - _, lin_ev = basis.EvalRaisedCosineLinear(n_basis_funcs).evaluate_on_grid(100) + _, lin_ev = basis.RaisedCosineLinearEval(n_basis_funcs).evaluate_on_grid(100) corr = np.zeros(len(time_scaling)) for idx, ts in enumerate(time_scaling): basis_log = self.cls["eval"]( @@ -1395,7 +1390,7 @@ def test_width_values(self, width, expectation, mode, kwargs): class TestRaisedCosineLinearBasis(BasisFuncsTesting): - cls = {"eval": basis.EvalRaisedCosineLinear, "conv": basis.ConvRaisedCosineLinear} + cls = {"eval": basis.RaisedCosineLinearEval, "conv": basis.RaisedCosineLinearConv} @pytest.mark.parametrize("n_basis_funcs", [-1, 0, 1, 3, 10, 20]) @pytest.mark.parametrize( @@ -1469,7 +1464,7 @@ def test_width_values(self, width, expectation, mode, kwargs): class TestMSplineBasis(BasisFuncsTesting): - cls = {"eval": basis.EvalMSpline, "conv": basis.ConvMSpline} + cls = {"eval": basis.MSplineEval, "conv": basis.MSplineConv} @pytest.mark.parametrize("n_basis_funcs", [-1, 0, 1, 3, 10, 20]) @pytest.mark.parametrize("order", [-1, 0, 1, 2, 3, 4, 5]) @@ -1573,7 +1568,7 @@ def test_vmin_vmax_eval_on_grid_scaling_effect_on_eval( class TestOrthExponentialBasis(BasisFuncsTesting): - cls = {"eval": basis.EvalOrthExponential, "conv": basis.ConvOrthExponential} + cls = {"eval": basis.OrthExponentialEval, "conv": basis.OrthExponentialConv} @pytest.mark.parametrize( "decay_rates", [[1, 2, 3], [0.01, 0.02, 0.001], [2, 1, 1, 2.4]] @@ -1645,7 +1640,7 @@ def test_minimum_number_of_basis_required_is_matched( class TestBSplineBasis(BasisFuncsTesting): - cls = {"eval": basis.EvalBSpline, "conv": basis.ConvBSpline} + cls = {"eval": basis.BSplineEval, "conv": basis.BSplineConv} @pytest.mark.parametrize("n_basis_funcs", [-1, 0, 1, 3, 10, 20]) @pytest.mark.parametrize("order", [1, 2, 3, 4, 5]) @@ -1733,7 +1728,7 @@ def test_samples_range_matches_compute_features_requirements( class TestCyclicBSplineBasis(BasisFuncsTesting): - cls = {"eval": basis.EvalCyclicBSpline, "conv": basis.ConvCyclicBSpline} + cls = {"eval": basis.CyclicBSplineEval, "conv": basis.CyclicBSplineConv} @pytest.mark.parametrize("n_basis_funcs", [-1, 0, 1, 3, 10, 20]) @pytest.mark.parametrize("order", [2, 3, 4, 5]) @@ -1871,28 +1866,28 @@ def instantiate_basis( kwargs = {**default_kwargs, **kwargs} if basis_class == AdditiveBasis: - kwargs_mspline = trim_kwargs( - basis.EvalMSpline, kwargs, class_specific_params + kwargs_mspline = inspect_utils.trim_kwargs( + basis.MSplineEval, kwargs, class_specific_params ) - kwargs_raised_cosine = trim_kwargs( - basis.ConvRaisedCosineLinear, kwargs, class_specific_params + kwargs_raised_cosine = inspect_utils.trim_kwargs( + basis.RaisedCosineLinearConv, kwargs, class_specific_params ) - b1 = basis.EvalMSpline(**kwargs_mspline) - b2 = basis.ConvRaisedCosineLinear(**kwargs_raised_cosine) + b1 = basis.MSplineEval(**kwargs_mspline) + b2 = basis.RaisedCosineLinearConv(**kwargs_raised_cosine) basis_obj = b1 + b2 elif basis_class == MultiplicativeBasis: - kwargs_mspline = trim_kwargs( - basis.EvalMSpline, kwargs, class_specific_params + kwargs_mspline = inspect_utils.trim_kwargs( + basis.MSplineEval, kwargs, class_specific_params ) - kwargs_raised_cosine = trim_kwargs( - basis.ConvRaisedCosineLinear, kwargs, class_specific_params + kwargs_raised_cosine = inspect_utils.trim_kwargs( + basis.RaisedCosineLinearConv, kwargs, class_specific_params ) - b1 = basis.EvalMSpline(**kwargs_mspline) - b2 = basis.ConvRaisedCosineLinear(**kwargs_raised_cosine) + b1 = basis.MSplineEval(**kwargs_mspline) + b2 = basis.RaisedCosineLinearConv(**kwargs_raised_cosine) basis_obj = b1 * b2 else: basis_obj = basis_class( - **trim_kwargs(basis_class, kwargs, class_specific_params) + **inspect_utils.trim_kwargs(basis_class, kwargs, class_specific_params) ) return basis_obj @@ -1901,10 +1896,10 @@ class TestAdditiveBasis(CombinedBasis): cls = {"eval": AdditiveBasis, "conv": AdditiveBasis} @pytest.mark.parametrize("samples", [[[0], []], [[], [0]], [[0, 0], [0, 0]]]) - @pytest.mark.parametrize("base_cls", [basis.EvalBSpline, basis.ConvBSpline]) + @pytest.mark.parametrize("base_cls", [basis.BSplineEval, basis.BSplineConv]) def test_non_empty_samples(self, base_cls, samples, class_specific_params): kwargs = {"window_size": 2, "n_basis_funcs": 5} - kwargs = trim_kwargs(base_cls, kwargs, class_specific_params) + kwargs = inspect_utils.trim_kwargs(base_cls, kwargs, class_specific_params) basis_obj = base_cls(**kwargs) + base_cls(**kwargs) if any(tuple(len(s) == 0 for s in samples)): with pytest.raises( @@ -1928,7 +1923,7 @@ def test_compute_features_input(self, eval_input): """ Checks that the sample size of the output from the compute_features() method matches the input sample size. """ - basis_obj = basis.EvalMSpline(5) + basis.EvalMSpline(5) + basis_obj = basis.MSplineEval(5) + basis.MSplineEval(5) basis_obj.compute_features(*eval_input) @pytest.mark.parametrize("n_basis_a", [5, 6]) @@ -2183,7 +2178,7 @@ def test_call_input_num( TypeError, match="Input dimensionality mismatch" ) with expectation: - basis_obj(*([np.linspace(0, 1, 10)] * num_input)) + basis_obj._evaluate(*([np.linspace(0, 1, 10)] * num_input)) @pytest.mark.parametrize( "inp, expectation", @@ -2216,7 +2211,7 @@ def test_call_input_shape( ) basis_obj = basis_a_obj + basis_b_obj with expectation: - basis_obj(*([inp] * basis_obj._n_input_dimensionality)) + basis_obj._evaluate(*([inp] * basis_obj._n_input_dimensionality)) @pytest.mark.parametrize("time_axis_shape", [10, 11, 12]) @pytest.mark.parametrize(" window_size", [3]) @@ -2242,7 +2237,7 @@ def test_call_sample_axis( ) basis_obj = basis_a_obj + basis_b_obj inp = [np.linspace(0, 1, time_axis_shape)] * basis_obj._n_input_dimensionality - assert basis_obj(*inp).shape[0] == time_axis_shape + assert basis_obj._evaluate(*inp).shape[0] == time_axis_shape @pytest.mark.parametrize(" window_size", [3]) @pytest.mark.parametrize("basis_a", list_all_basis_classes()) @@ -2267,7 +2262,7 @@ def test_call_nan( inp = [np.linspace(0, 1, 10)] * basis_obj._n_input_dimensionality for x in inp: x[3] = np.nan - assert all(np.isnan(basis_obj(*inp)[3])) + assert all(np.isnan(basis_obj._evaluate(*inp)[3])) @pytest.mark.parametrize("basis_a", list_all_basis_classes()) @pytest.mark.parametrize("basis_b", list_all_basis_classes()) @@ -2293,7 +2288,7 @@ def test_call_equivalent_in_conv( bas_con = basis_a_obj + basis_b_obj x = [np.linspace(0, 1, 10)] * bas_con._n_input_dimensionality - assert np.all(bas_con(*x) == bas_eva(*x)) + assert np.all(bas_con._evaluate(*x) == bas_eva._evaluate(*x)) @pytest.mark.parametrize(" window_size", [3]) @pytest.mark.parametrize("basis_a", list_all_basis_classes()) @@ -2313,8 +2308,8 @@ def test_pynapple_support( x = np.linspace(0, 1, 10) x_nap = [nap.Tsd(t=np.arange(10), d=x)] * bas._n_input_dimensionality x = [x] * bas._n_input_dimensionality - y = bas(*x) - y_nap = bas(*x_nap) + y = bas._evaluate(*x) + y_nap = bas._evaluate(*x_nap) assert isinstance(y_nap, nap.TsdFrame) assert np.all(y == y_nap.d) assert np.all(y_nap.t == x_nap[0].t) @@ -2335,7 +2330,10 @@ def test_call_basis_number( ) bas = basis_a_obj + basis_b_obj x = [np.linspace(0, 1, 10)] * bas._n_input_dimensionality - assert bas(*x).shape[1] == basis_a_obj.n_basis_funcs + basis_b_obj.n_basis_funcs + assert ( + bas._evaluate(*x).shape[1] + == basis_a_obj.n_basis_funcs + basis_b_obj.n_basis_funcs + ) @pytest.mark.parametrize(" window_size", [3]) @pytest.mark.parametrize("basis_a", list_all_basis_classes()) @@ -2353,7 +2351,7 @@ def test_call_non_empty( ) bas = basis_a_obj + basis_b_obj with pytest.raises(ValueError, match="All sample provided must"): - bas(*([np.array([])] * bas._n_input_dimensionality)) + bas._evaluate(*([np.array([])] * bas._n_input_dimensionality)) @pytest.mark.parametrize( "mn, mx, expectation", @@ -2398,7 +2396,7 @@ def test_call_sample_range( ) bas = basis_a_obj + basis_b_obj with expectation: - bas(*([np.linspace(mn, mx, 10)] * bas._n_input_dimensionality)) + bas._evaluate(*([np.linspace(mn, mx, 10)] * bas._n_input_dimensionality)) @pytest.mark.parametrize("basis_a", list_all_basis_classes()) @pytest.mark.parametrize("basis_b", list_all_basis_classes()) @@ -2457,8 +2455,8 @@ def test_transform_fails( @pytest.mark.parametrize("n_basis_input1", [1, 2, 3]) @pytest.mark.parametrize("n_basis_input2", [1, 2, 3]) def test_set_num_output_features(self, n_basis_input1, n_basis_input2): - bas1 = basis.ConvRaisedCosineLinear(10, window_size=10) - bas2 = basis.ConvBSpline(11, window_size=10) + bas1 = basis.RaisedCosineLinearConv(10, window_size=10) + bas2 = basis.BSplineConv(11, window_size=10) bas_add = bas1 + bas2 assert bas_add.n_output_features is None bas_add.compute_features( @@ -2469,8 +2467,8 @@ def test_set_num_output_features(self, n_basis_input1, n_basis_input2): @pytest.mark.parametrize("n_basis_input1", [1, 2, 3]) @pytest.mark.parametrize("n_basis_input2", [1, 2, 3]) def test_set_num_basis_input(self, n_basis_input1, n_basis_input2): - bas1 = basis.ConvRaisedCosineLinear(10, window_size=10) - bas2 = basis.ConvBSpline(10, window_size=10) + bas1 = basis.RaisedCosineLinearConv(10, window_size=10) + bas2 = basis.BSplineConv(10, window_size=10) bas_add = bas1 + bas2 assert bas_add.n_basis_input is None bas_add.compute_features( @@ -2488,8 +2486,8 @@ def test_set_num_basis_input(self, n_basis_input1, n_basis_input2): ], ) def test_expected_input_number(self, n_input, expectation): - bas1 = basis.ConvRaisedCosineLinear(10, window_size=10) - bas2 = basis.ConvBSpline(10, window_size=10) + bas1 = basis.RaisedCosineLinearConv(10, window_size=10) + bas2 = basis.BSplineConv(10, window_size=10) bas = bas1 + bas2 x = np.random.randn(20, 2), np.random.randn(20, 3) bas.compute_features(*x) @@ -2505,7 +2503,7 @@ class TestMultiplicativeBasis(CombinedBasis): ) @pytest.mark.parametrize(" ws", [3]) def test_non_empty_samples(self, samples, ws): - basis_obj = basis.EvalMSpline(5) * basis.EvalRaisedCosineLinear(5) + basis_obj = basis.MSplineEval(5) * basis.RaisedCosineLinearEval(5) if any(tuple(len(s) == 0 for s in samples)): with pytest.raises( ValueError, match="All sample provided must be non empty" @@ -2528,7 +2526,7 @@ def test_compute_features_input(self, eval_input): """ Checks that the sample size of the output from the compute_features() method matches the input sample size. """ - basis_obj = basis.EvalMSpline(5) * basis.EvalMSpline(5) + basis_obj = basis.MSplineEval(5) * basis.MSplineEval(5) basis_obj.compute_features(*eval_input) @pytest.mark.parametrize("n_basis_a", [5, 6]) @@ -2821,7 +2819,7 @@ def test_call_input_num( TypeError, match="Input dimensionality mismatch" ) with expectation: - basis_obj(*([np.linspace(0, 1, 10)] * num_input)) + basis_obj._evaluate(*([np.linspace(0, 1, 10)] * num_input)) @pytest.mark.parametrize( "inp, expectation", @@ -2854,7 +2852,7 @@ def test_call_input_shape( ) basis_obj = basis_a_obj * basis_b_obj with expectation: - basis_obj(*([inp] * basis_obj._n_input_dimensionality)) + basis_obj._evaluate(*([inp] * basis_obj._n_input_dimensionality)) @pytest.mark.parametrize("time_axis_shape", [10, 11, 12]) @pytest.mark.parametrize(" window_size", [3]) @@ -2880,7 +2878,7 @@ def test_call_sample_axis( ) basis_obj = basis_a_obj * basis_b_obj inp = [np.linspace(0, 1, time_axis_shape)] * basis_obj._n_input_dimensionality - assert basis_obj(*inp).shape[0] == time_axis_shape + assert basis_obj._evaluate(*inp).shape[0] == time_axis_shape @pytest.mark.parametrize(" window_size", [3]) @pytest.mark.parametrize("basis_a", list_all_basis_classes()) @@ -2905,7 +2903,7 @@ def test_call_nan( inp = [np.linspace(0, 1, 10)] * basis_obj._n_input_dimensionality for x in inp: x[3] = np.nan - assert all(np.isnan(basis_obj(*inp)[3])) + assert all(np.isnan(basis_obj._evaluate(*inp)[3])) @pytest.mark.parametrize("basis_a", list_all_basis_classes()) @pytest.mark.parametrize("basis_b", list_all_basis_classes()) @@ -2931,7 +2929,7 @@ def test_call_equivalent_in_conv( bas_con = basis_a_obj * basis_b_obj x = [np.linspace(0, 1, 10)] * bas_con._n_input_dimensionality - assert np.all(bas_con(*x) == bas_eva(*x)) + assert np.all(bas_con._evaluate(*x) == bas_eva._evaluate(*x)) @pytest.mark.parametrize(" window_size", [3]) @pytest.mark.parametrize("basis_a", list_all_basis_classes()) @@ -2951,8 +2949,8 @@ def test_pynapple_support( x = np.linspace(0, 1, 10) x_nap = [nap.Tsd(t=np.arange(10), d=x)] * bas._n_input_dimensionality x = [x] * bas._n_input_dimensionality - y = bas(*x) - y_nap = bas(*x_nap) + y = bas._evaluate(*x) + y_nap = bas._evaluate(*x_nap) assert isinstance(y_nap, nap.TsdFrame) assert np.all(y == y_nap.d) assert np.all(y_nap.t == x_nap[0].t) @@ -2973,7 +2971,10 @@ def test_call_basis_number( ) bas = basis_a_obj * basis_b_obj x = [np.linspace(0, 1, 10)] * bas._n_input_dimensionality - assert bas(*x).shape[1] == basis_a_obj.n_basis_funcs * basis_b_obj.n_basis_funcs + assert ( + bas._evaluate(*x).shape[1] + == basis_a_obj.n_basis_funcs * basis_b_obj.n_basis_funcs + ) @pytest.mark.parametrize(" window_size", [3]) @pytest.mark.parametrize("basis_a", list_all_basis_classes()) @@ -2991,7 +2992,7 @@ def test_call_non_empty( ) bas = basis_a_obj * basis_b_obj with pytest.raises(ValueError, match="All sample provided must"): - bas(*([np.array([])] * bas._n_input_dimensionality)) + bas._evaluate(*([np.array([])] * bas._n_input_dimensionality)) @pytest.mark.parametrize( "mn, mx, expectation", @@ -3036,7 +3037,7 @@ def test_call_sample_range( ) bas = basis_a_obj * basis_b_obj with expectation: - bas(*([np.linspace(mn, mx, 10)] * bas._n_input_dimensionality)) + bas._evaluate(*([np.linspace(mn, mx, 10)] * bas._n_input_dimensionality)) @pytest.mark.parametrize("basis_a", list_all_basis_classes()) @pytest.mark.parametrize("basis_b", list_all_basis_classes()) @@ -3095,8 +3096,8 @@ def test_transform_fails( @pytest.mark.parametrize("n_basis_input1", [1, 2, 3]) @pytest.mark.parametrize("n_basis_input2", [1, 2, 3]) def test_set_num_output_features(self, n_basis_input1, n_basis_input2): - bas1 = basis.ConvRaisedCosineLinear(10, window_size=10) - bas2 = basis.ConvBSpline(11, window_size=10) + bas1 = basis.RaisedCosineLinearConv(10, window_size=10) + bas2 = basis.BSplineConv(11, window_size=10) bas_add = bas1 * bas2 assert bas_add.n_output_features is None bas_add.compute_features( @@ -3107,8 +3108,8 @@ def test_set_num_output_features(self, n_basis_input1, n_basis_input2): @pytest.mark.parametrize("n_basis_input1", [1, 2, 3]) @pytest.mark.parametrize("n_basis_input2", [1, 2, 3]) def test_set_num_basis_input(self, n_basis_input1, n_basis_input2): - bas1 = basis.ConvRaisedCosineLinear(10, window_size=10) - bas2 = basis.ConvBSpline(10, window_size=10) + bas1 = basis.RaisedCosineLinearConv(10, window_size=10) + bas2 = basis.BSplineConv(10, window_size=10) bas_add = bas1 * bas2 assert bas_add.n_basis_input is None bas_add.compute_features( @@ -3126,8 +3127,8 @@ def test_set_num_basis_input(self, n_basis_input1, n_basis_input2): ], ) def test_expected_input_number(self, n_input, expectation): - bas1 = basis.ConvRaisedCosineLinear(10, window_size=10) - bas2 = basis.ConvBSpline(10, window_size=10) + bas1 = basis.RaisedCosineLinearConv(10, window_size=10) + bas2 = basis.BSplineConv(10, window_size=10) bas = bas1 * bas2 x = np.random.randn(20, 2), np.random.randn(20, 3) bas.compute_features(*x) @@ -3137,8 +3138,8 @@ def test_expected_input_number(self, n_input, expectation): @pytest.mark.parametrize("n_basis_input1", [1, 2, 3]) @pytest.mark.parametrize("n_basis_input2", [1, 2, 3]) def test_n_basis_input(self, n_basis_input1, n_basis_input2): - bas1 = basis.ConvRaisedCosineLinear(10, window_size=10) - bas2 = basis.ConvBSpline(10, window_size=10) + bas1 = basis.RaisedCosineLinearConv(10, window_size=10) + bas2 = basis.BSplineConv(10, window_size=10) bas_prod = bas1 * bas2 bas_prod.compute_features( np.ones((20, n_basis_input1)), np.ones((20, n_basis_input2)) @@ -3147,7 +3148,7 @@ def test_n_basis_input(self, n_basis_input1, n_basis_input2): @pytest.mark.parametrize( - "exponent", [-1, 0, 0.5, basis.EvalRaisedCosineLog(4), 1, 2, 3] + "exponent", [-1, 0, 0.5, basis.RaisedCosineLogEval(4), 1, 2, 3] ) @pytest.mark.parametrize("basis_class", list_all_basis_classes()) def test_power_of_basis(exponent, basis_class, class_specific_params): diff --git a/tox.ini b/tox.ini index 94bd7a4f..8464ba95 100644 --- a/tox.ini +++ b/tox.ini @@ -30,6 +30,9 @@ commands= black tests isort tests --profile=black flake8 --config={toxinidir}/tox.ini src # convenient instead of remembering to run fix followed by check + black docs/scripts + isort docs/scripts --profile=black + flake8 --config={toxinidir}/tox.ini docs/scripts [testenv:check] commands= From e39b1c09d225807221b6d3a72c132326b1dca9ad Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Wed, 4 Dec 2024 10:17:48 -0500 Subject: [PATCH 08/21] Fix table layout --- docs/assets/stylesheets/custom.css | 4 + docs/background/README.md | 2 +- docs/background/basis/README.md | 26 +- docs/background/basis/images/EvalBSpline.svg | 360 ----------- .../basis/images/EvalCyclicBSpline.svg | 427 ------------- docs/background/basis/images/EvalMSpline.svg | 289 --------- .../basis/images/EvalOrthExponential.svg | 564 ------------------ .../basis/images/EvalRaisedCosineLinear.svg | 367 ------------ .../basis/images/EvalRaisedCosineLog.svg | 310 ---------- docs/conf.py | 4 + docs/scripts/basis_table_figs.py | 11 +- 11 files changed, 36 insertions(+), 2328 deletions(-) delete mode 100644 docs/background/basis/images/EvalBSpline.svg delete mode 100644 docs/background/basis/images/EvalCyclicBSpline.svg delete mode 100644 docs/background/basis/images/EvalMSpline.svg delete mode 100644 docs/background/basis/images/EvalOrthExponential.svg delete mode 100644 docs/background/basis/images/EvalRaisedCosineLinear.svg delete mode 100644 docs/background/basis/images/EvalRaisedCosineLog.svg diff --git a/docs/assets/stylesheets/custom.css b/docs/assets/stylesheets/custom.css index 463be8a4..e557aa08 100644 --- a/docs/assets/stylesheets/custom.css +++ b/docs/assets/stylesheets/custom.css @@ -94,6 +94,10 @@ html[data-theme=light]{ font-weight: normal; } +table.table-center{ + text-align: center; +} + #table-basis { table-layout: auto; width: 100%; diff --git a/docs/background/README.md b/docs/background/README.md index 331a9b8c..530c454a 100644 --- a/docs/background/README.md +++ b/docs/background/README.md @@ -34,7 +34,7 @@ plot_00_conceptual_intro.md :::{grid-item-card} <figure> -<img src="../_images/EvalRaisedCosineLinear.svg" style="height: 100px", alt="Basis Functions"/> +<img src="../plot_directive/scripts/basis_table_figs_plot_raised_cosine_linear.png" style="height: 100px", alt="Basis Functions"/> </figure> ```{toctree} diff --git a/docs/background/basis/README.md b/docs/background/basis/README.md index 59dd1dee..60516ad4 100644 --- a/docs/background/basis/README.md +++ b/docs/background/basis/README.md @@ -3,9 +3,13 @@ (table_basis)= ```{eval-rst} +.. role:: raw-html(raw) + :format: html + .. list-table:: :header-rows: 1 - :widths: 20 30 20 30 20 + :name: table-basis + :align: center * - **Basis** - **Kernel Visualization** @@ -14,38 +18,44 @@ - **Preferred Mode** * - **B-Spline** - .. plot:: scripts/basis_table_figs.py plot_bspline + :show-source-link: False - `Grid cells <grid_cells_nemos>`_ - - `EvalBSpline <nemos.basis.basis.EvalBSpline>`_ - `ConvBSpline <nemos.basis.basis.ConvBSpline>`_ + - `EvalBSpline <nemos.basis.basis.EvalBSpline>`_ :raw-html:`<br />` + `BSplineConv <nemos.basis.basis.BSplineConv>`_ - 🟢 Eval * - **Cyclic B-Spline** - .. plot:: scripts/basis_table_figs.py plot_cyclic_bspline + :show-source-link: False - `Place cells <basis_eval_place_cells>`_ - - `EvalCyclicBSpline <nemos.basis.basis.EvalCyclicBSpline>`_ + - `EvalCyclicBSpline <nemos.basis.basis.EvalCyclicBSpline>`_ :raw-html:`<br />` `ConvCyclicBSpline <nemos.basis.basis.ConvCyclicBSpline>`_ - 🟢 Eval * - **M-Spline** - .. plot:: scripts/basis_table_figs.py plot_mspline + :show-source-link: False - `Place cells <basis_eval_place_cells>`_ - - `EvalMSpline <nemos.basis.basis.EvalMSpline>`_ + - `EvalMSpline <nemos.basis.basis.EvalMSpline>`_ :raw-html:`<br />` `ConvMSpline <nemos.basis.basis.ConvMSpline>`_ - 🟢 Eval * - **Linearly Spaced Raised Cosine** - .. plot:: scripts/basis_table_figs.py plot_raised_cosine_linear + :show-source-link: False - - - `EvalRaisedCosineLinear <nemos.basis.basis.EvalRaisedCosineLinear>`_ + - `EvalRaisedCosineLinear <nemos.basis.basis.EvalRaisedCosineLinear>`_ :raw-html:`<br />` `ConvRaisedCosineLinear <nemos.basis.basis.ConvRaisedCosineLinear>`_ - 🟢 Eval * - **Log Spaced Raised Cosine** - .. plot:: scripts/basis_table_figs.py plot_raised_cosine_log + :show-source-link: False - `Head Direction <head_direction_reducing_dimensionality>`_ - - `EvalRaisedCosineLog <nemos.basis.basis.EvalRaisedCosineLog>`_ + - `EvalRaisedCosineLog <nemos.basis.basis.EvalRaisedCosineLog>`_ :raw-html:`<br />` `ConvRaisedCosineLog <nemos.basis.basis.ConvRaisedCosineLog>`_ - 🔵 Conv * - **Orthogonalized Exponential Decays** - .. plot:: scripts/basis_table_figs.py plot_orth_exp_basis + :show-source-link: False - - - `EvalOrthExponential <nemos.basis.basis.EvalOrthExponential>`_ + - `EvalOrthExponential <nemos.basis.basis.EvalOrthExponential>`_ :raw-html:`<br />` `ConvOrthExponential <nemos.basis.basis.ConvOrthExponential>`_ - 🟢 Eval ``` diff --git a/docs/background/basis/images/EvalBSpline.svg b/docs/background/basis/images/EvalBSpline.svg deleted file mode 100644 index 66776ff8..00000000 --- a/docs/background/basis/images/EvalBSpline.svg +++ /dev/null @@ -1,360 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> - <metadata> - <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <cc:Work> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> - <dc:date>2024-12-02T16:54:50.980497</dc:date> - <dc:format>image/svg+xml</dc:format> - <dc:creator> - <cc:Agent> - <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> - </cc:Agent> - </dc:creator> - </cc:Work> - </rdf:RDF> - </metadata> - <defs> - <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> - </defs> - <g id="figure_1"> - <g id="patch_1"> - <path d="M 0 45 -L 90 45 -L 90 0 -L 0 0 -z -" style="fill: #ffffff"/> - </g> - <g id="axes_1"> - <g id="patch_2"> - <path d="M 1.8 44.1 -L 88.2 44.1 -L 88.2 0.9 -L 1.8 0.9 -z -" style="fill: #ffffff"/> - </g> - <g id="matplotlib.axis_1"/> - <g id="matplotlib.axis_2"/> - <g id="line2d_1"> - <path d="M 5.727273 2.863636 -L 6.778048 12.895825 -L 7.828823 21.055116 -L 8.879599 27.535018 -L 9.930374 32.529042 -L 10.718455 35.415861 -L 11.506537 37.657359 -L 12.294618 39.335174 -L 13.0827 40.530942 -L 13.870781 41.3263 -L 14.658863 41.802886 -L 15.446944 42.042336 -L 16.760413 42.13618 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_2"> - <path d="M 5.727273 42.136364 -L 6.778048 32.596588 -L 7.56613 27.272162 -L 8.354211 23.357917 -L 9.142292 20.710988 -L 9.66768 19.579883 -L 10.193068 18.906203 -L 10.718455 18.647619 -L 11.243843 18.761801 -L 11.769231 19.206418 -L 12.294618 19.93914 -L 13.0827 21.485821 -L 14.133475 24.161349 -L 18.073883 34.986885 -L 19.124658 36.995115 -L 20.175433 38.586952 -L 21.226209 39.810776 -L 22.276984 40.714963 -L 23.327759 41.347891 -L 24.378535 41.757937 -L 25.692004 42.030767 -L 27.53086 42.134559 -L 48.020979 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_3"> - <path d="M 5.727273 42.136364 -L 6.25266 42.010909 -L 6.778048 41.649326 -L 7.56613 40.712715 -L 8.354211 39.369539 -L 9.404986 37.075546 -L 10.981149 32.916815 -L 14.396169 23.575788 -L 15.446944 21.333124 -L 16.235026 20.040162 -L 17.023107 19.163789 -L 17.548495 18.838947 -L 18.073883 18.713229 -L 18.59927 18.772527 -L 19.124658 19.00273 -L 19.912739 19.637614 -L 20.700821 20.577665 -L 21.751596 22.223461 -L 23.065065 24.752602 -L 25.42931 29.959664 -L 27.53086 34.415194 -L 28.84433 36.703295 -L 30.157799 38.491078 -L 31.471268 39.836121 -L 32.784737 40.801416 -L 34.098206 41.449954 -L 35.411675 41.844726 -L 36.987838 42.072174 -L 39.352083 42.136363 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_4"> - <path d="M 5.727273 42.136364 -L 8.616905 42.024575 -L 10.193068 41.723728 -L 11.506537 41.242053 -L 12.820006 40.483216 -L 13.870781 39.634259 -L 14.921557 38.535352 -L 15.972332 37.154244 -L 17.023107 35.458689 -L 18.336576 32.897508 -L 20.438127 28.174455 -L 23.327759 21.687781 -L 24.641228 19.225946 -L 25.692004 17.656888 -L 26.480085 16.777162 -L 27.268167 16.19742 -L 28.056248 15.958479 -L 28.581636 16.006721 -L 29.369717 16.380305 -L 30.157799 17.079139 -L 30.94588 18.062408 -L 31.996656 19.745334 -L 33.310125 22.310628 -L 35.411675 27.03652 -L 38.301307 33.519575 -L 39.614777 35.977096 -L 40.928246 37.931176 -L 42.241715 39.42092 -L 43.555184 40.509318 -L 44.868653 41.259362 -L 46.182122 41.734043 -L 47.758285 42.028874 -L 49.859836 42.134405 -L 70.612648 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_5"> - <path d="M 5.727273 42.136364 -L 19.650046 42.044968 -L 21.226209 41.773586 -L 22.539678 41.326364 -L 23.853147 40.610978 -L 24.903922 39.803261 -L 25.954697 38.751354 -L 27.005473 37.423003 -L 28.056248 35.785959 -L 29.369717 33.288515 -L 31.208574 29.22067 -L 34.623594 21.535081 -L 35.937063 19.100654 -L 36.987838 17.561297 -L 37.77592 16.708382 -L 38.564001 16.159339 -L 39.089389 15.982284 -L 39.614777 15.970201 -L 40.140164 16.124384 -L 40.928246 16.642359 -L 41.716327 17.468092 -L 42.767102 18.977254 -L 44.080572 21.383656 -L 45.656735 24.784485 -L 49.859836 34.195459 -L 51.173305 36.527418 -L 52.486774 38.356081 -L 53.800243 39.736605 -L 55.113712 40.731981 -L 56.427182 41.405201 -L 57.740651 41.819257 -L 59.316814 42.062717 -L 61.418364 42.136038 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_6"> - <path d="M 5.727273 42.136364 -L 30.94588 42.037139 -L 32.522043 41.754155 -L 33.835512 41.293306 -L 35.148981 40.560694 -L 36.199757 39.736605 -L 37.250532 38.666021 -L 38.301307 37.316691 -L 39.352083 35.656363 -L 40.665552 33.132976 -L 42.504409 29.046918 -L 45.919428 21.383656 -L 47.232898 18.977254 -L 48.283673 17.468092 -L 49.071754 16.642359 -L 49.859836 16.124384 -L 50.385223 15.970201 -L 50.910611 15.982284 -L 51.435999 16.159339 -L 52.22408 16.708382 -L 53.012162 17.561297 -L 54.062937 19.100654 -L 55.376406 21.535081 -L 57.215263 25.557067 -L 60.892977 33.823273 -L 62.206446 36.225924 -L 63.519915 38.12375 -L 64.833384 39.564437 -L 66.146853 40.610978 -L 67.460322 41.326364 -L 68.773791 41.773586 -L 70.349954 42.044968 -L 72.451505 42.135361 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_7"> - <path d="M 5.727273 42.136364 -L 42.241715 42.028874 -L 43.817878 41.734043 -L 45.131347 41.259362 -L 46.444816 40.509318 -L 47.495591 39.668691 -L 48.546367 38.579266 -L 49.597142 37.208792 -L 50.647917 35.525017 -L 51.961386 32.97628 -L 54.062937 28.261907 -L 56.952569 21.764598 -L 58.266038 19.289291 -L 59.316814 17.705568 -L 60.104895 16.812575 -L 60.892977 16.217622 -L 61.681058 15.961527 -L 62.206446 15.99774 -L 62.731833 16.19742 -L 63.519915 16.777162 -L 64.307996 17.656888 -L 65.358772 19.225946 -L 66.672241 21.687781 -L 68.511098 25.729996 -L 72.188811 33.973166 -L 73.50228 36.347785 -L 74.815749 38.217791 -L 76.129219 39.634259 -L 77.442688 40.66018 -L 78.756157 41.358545 -L 80.069626 41.792346 -L 81.645789 42.052375 -L 83.74734 42.135692 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_8"> - <path d="M 5.727273 42.136364 -L 53.274856 42.048724 -L 54.851019 41.783049 -L 56.164488 41.342563 -L 57.477957 40.635713 -L 58.528732 39.836121 -L 59.579507 38.79349 -L 60.630283 37.475568 -L 61.681058 35.850104 -L 62.994527 33.369486 -L 65.096078 28.77919 -L 67.460322 23.690373 -L 68.773791 21.350386 -L 69.824567 19.919409 -L 70.612648 19.177511 -L 71.40073 18.772527 -L 71.926117 18.713229 -L 72.451505 18.838947 -L 72.976893 19.163789 -L 73.50228 19.698058 -L 74.290362 20.860466 -L 75.341137 22.96786 -L 76.654606 26.248665 -L 81.383095 38.8444 -L 82.43387 40.712715 -L 83.221952 41.649326 -L 83.74734 42.010909 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_9"> - <path d="M 5.727273 42.136364 -L 64.307996 42.030767 -L 65.621465 41.757937 -L 66.672241 41.347891 -L 67.723016 40.714963 -L 68.773791 39.810776 -L 69.824567 38.586952 -L 70.875342 36.995115 -L 71.926117 34.986885 -L 72.976893 32.513887 -L 74.290362 28.800955 -L 76.391912 22.753611 -L 77.442688 20.400312 -L 78.230769 19.206418 -L 78.756157 18.761801 -L 79.281545 18.647619 -L 79.806932 18.906203 -L 80.33232 19.579883 -L 80.857708 20.710988 -L 81.383095 22.34185 -L 82.171177 25.817782 -L 82.959258 30.656274 -L 83.74734 37.00019 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_10"> - <path d="M 5.727273 42.136364 -L 74.553056 42.042336 -L 75.341137 41.802886 -L 76.129219 41.3263 -L 76.9173 40.530942 -L 77.705382 39.335174 -L 78.493463 37.657359 -L 79.281545 35.415861 -L 80.069626 32.529042 -L 80.857708 28.915266 -L 81.908483 22.824975 -L 82.959258 15.103673 -L 84.010033 5.55785 -L 84.272727 2.863636 -L 84.272727 2.863636 -" clip-path="url(#pb3495c303b)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> - </g> - </g> - </g> - <defs> - <clipPath id="pb3495c303b"> - <rect x="1.8" y="0.9" width="86.4" height="43.2"/> - </clipPath> - </defs> -</svg> diff --git a/docs/background/basis/images/EvalCyclicBSpline.svg b/docs/background/basis/images/EvalCyclicBSpline.svg deleted file mode 100644 index 35fa9481..00000000 --- a/docs/background/basis/images/EvalCyclicBSpline.svg +++ /dev/null @@ -1,427 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> - <metadata> - <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <cc:Work> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> - <dc:date>2024-12-02T16:54:50.989322</dc:date> - <dc:format>image/svg+xml</dc:format> - <dc:creator> - <cc:Agent> - <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> - </cc:Agent> - </dc:creator> - </cc:Work> - </rdf:RDF> - </metadata> - <defs> - <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> - </defs> - <g id="figure_1"> - <g id="patch_1"> - <path d="M 0 45 -L 90 45 -L 90 0 -L 0 0 -z -" style="fill: #ffffff"/> - </g> - <g id="axes_1"> - <g id="patch_2"> - <path d="M 1.8 44.1 -L 88.2 44.1 -L 88.2 0.9 -L 1.8 0.9 -z -" style="fill: #ffffff"/> - </g> - <g id="matplotlib.axis_1"/> - <g id="matplotlib.axis_2"/> - <g id="line2d_1"> - <path d="M 5.727273 32.318182 -L 6.778048 35.754951 -L 7.828823 38.278474 -L 8.616905 39.656642 -L 9.404986 40.659947 -L 10.193068 41.347891 -L 10.981149 41.779976 -L 12.031925 42.060929 -L 13.345394 42.136096 -L 61.943752 42.09823 -L 62.994527 41.894497 -L 63.782609 41.548096 -L 64.57069 40.969636 -L 65.358772 40.099616 -L 66.146853 38.878533 -L 66.934935 37.246885 -L 67.723016 35.145171 -L 68.511098 32.513887 -L 69.561873 28.15951 -L 71.40073 19.224262 -L 73.239587 10.558978 -L 74.290362 6.601292 -L 75.078443 4.431349 -L 75.603831 3.464043 -L 76.129219 2.9419 -L 76.391912 2.864294 -L 76.654606 2.916206 -L 77.179994 3.390923 -L 77.705382 4.316093 -L 78.493463 6.432749 -L 79.281545 9.265414 -L 80.595014 15.092822 -L 84.010033 31.301235 -L 84.272727 32.318182 -L 84.272727 32.318182 -" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_2"> - <path d="M 5.727273 2.863636 -L 5.989967 2.928428 -L 6.515354 3.426923 -L 7.040742 4.373227 -L 7.828823 6.516626 -L 8.616905 9.370084 -L 9.930374 15.218923 -L 13.345394 31.405707 -L 14.396169 35.066323 -L 15.446944 37.783029 -L 16.235026 39.28526 -L 17.023107 40.394776 -L 17.811189 41.17108 -L 18.59927 41.673675 -L 19.650046 42.020874 -L 20.963515 42.134222 -L 35.937063 42.136364 -L 70.087261 42.0647 -L 71.138036 41.790667 -L 71.926117 41.366086 -L 72.714199 40.687629 -L 73.50228 39.695795 -L 74.290362 38.33108 -L 75.078443 36.533984 -L 75.866525 34.245003 -L 76.9173 30.335109 -L 78.230769 24.314375 -L 81.383095 9.370084 -L 82.43387 5.71445 -L 83.221952 3.847405 -L 83.74734 3.118394 -L 84.272727 2.863636 -L 84.272727 2.863636 -" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_3"> - <path d="M 5.727273 32.318182 -L 6.778048 27.921151 -L 8.616905 18.962146 -L 10.455762 10.337896 -L 11.506537 6.432749 -L 12.294618 4.316093 -L 12.820006 3.390923 -L 13.345394 2.916206 -L 13.608088 2.864294 -L 13.870781 2.9419 -L 14.396169 3.464043 -L 14.921557 4.431349 -L 15.709638 6.601292 -L 16.49772 9.475345 -L 17.811189 15.345285 -L 21.226209 31.509579 -L 22.276984 35.145171 -L 23.327759 37.840059 -L 24.115841 39.32824 -L 24.903922 40.425691 -L 25.692004 41.191913 -L 26.480085 41.686409 -L 27.53086 42.025894 -L 28.84433 42.134559 -L 46.444816 42.136364 -L 77.968075 42.060929 -L 79.018851 41.779976 -L 79.806932 41.347891 -L 80.595014 40.659947 -L 81.383095 39.656642 -L 82.171177 38.278474 -L 82.959258 36.465939 -L 83.74734 34.159538 -L 84.272727 32.318182 -L 84.272727 32.318182 -" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_4"> - <path d="M 5.727273 42.136364 -L 7.303436 42.057027 -L 8.354211 41.769067 -L 9.142292 41.329412 -L 9.930374 40.631915 -L 10.718455 39.617073 -L 11.506537 38.225384 -L 12.294618 36.397346 -L 13.0827 34.073458 -L 14.133475 30.114378 -L 15.446944 24.057502 -L 18.336576 10.228149 -L 19.387352 6.349668 -L 20.175433 4.259953 -L 20.700821 3.35605 -L 21.226209 2.905244 -L 21.488902 2.866263 -L 21.751596 2.956618 -L 22.276984 3.502275 -L 22.802372 4.490451 -L 23.590453 6.686741 -L 24.378535 9.581189 -L 25.692004 15.4719 -L 29.107023 31.612845 -L 30.157799 35.22343 -L 31.208574 37.896589 -L 31.996656 39.370787 -L 32.784737 40.456238 -L 33.572818 41.212444 -L 34.3609 41.698907 -L 35.411675 42.030767 -L 36.725144 42.134859 -L 57.477957 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_5"> - <path d="M 5.727273 42.136364 -L 15.184251 42.052994 -L 16.235026 41.757937 -L 17.023107 41.310646 -L 17.811189 40.60353 -L 18.59927 39.577085 -L 19.387352 38.17181 -L 20.175433 36.328202 -L 20.963515 33.98676 -L 22.01429 30.003229 -L 23.327759 23.928778 -L 26.217391 10.118939 -L 27.268167 6.267389 -L 28.056248 4.204813 -L 28.581636 3.322309 -L 29.107023 2.895546 -L 29.369717 2.869537 -L 29.632411 2.972575 -L 30.157799 3.541614 -L 30.683186 4.550527 -L 31.471268 6.772965 -L 32.522043 10.78213 -L 33.835512 16.879501 -L 36.725144 30.662189 -L 37.77592 34.497732 -L 38.826695 37.369628 -L 39.614777 38.972053 -L 40.402858 40.167881 -L 41.190939 41.016612 -L 41.979021 41.577751 -L 42.767102 41.910797 -L 43.817878 42.102894 -L 45.919428 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_6"> - <path d="M 5.727273 42.136364 -L 23.065065 42.048826 -L 24.115841 41.746585 -L 24.903922 41.291592 -L 25.692004 40.57479 -L 26.480085 39.536676 -L 27.268167 38.117748 -L 28.056248 36.258505 -L 28.84433 33.899444 -L 29.895105 29.891567 -L 31.208574 23.799871 -L 34.098206 10.010274 -L 35.148981 6.185918 -L 35.937063 4.150681 -L 36.462451 3.289707 -L 36.987838 2.88712 -L 37.250532 2.874109 -L 37.513226 2.989763 -L 38.038614 3.582052 -L 38.564001 4.611571 -L 39.352083 6.859958 -L 40.402858 10.894467 -L 41.716327 17.008642 -L 44.605959 30.770118 -L 45.656735 34.58076 -L 46.70751 37.430221 -L 47.495591 39.018135 -L 48.283673 40.201434 -L 49.071754 41.03962 -L 49.859836 41.592197 -L 50.647917 41.918665 -L 51.698693 42.105076 -L 53.800243 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_7"> - <path d="M 5.727273 42.136364 -L 30.94588 42.044522 -L 31.996656 41.735008 -L 32.784737 41.272247 -L 33.572818 40.545693 -L 34.3609 39.495844 -L 35.148981 38.063198 -L 35.937063 36.188253 -L 36.725144 33.811506 -L 37.77592 29.779398 -L 39.089389 23.670788 -L 41.979021 9.90216 -L 43.029796 6.105263 -L 43.817878 4.097562 -L 44.343265 3.258251 -L 44.868653 2.879972 -L 45.131347 2.879972 -L 45.656735 3.258251 -L 46.182122 4.097562 -L 46.70751 5.345013 -L 47.495591 7.865755 -L 48.546367 12.161588 -L 50.12253 19.749102 -L 52.22408 29.779398 -L 53.274856 33.811506 -L 54.325631 36.866052 -L 55.113712 38.586952 -L 55.901794 39.885388 -L 56.689875 40.820861 -L 57.477957 41.452873 -L 58.266038 41.840926 -L 59.316814 42.081682 -L 60.892977 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_8"> - <path d="M 5.727273 42.136364 -L 38.826695 42.040079 -L 39.87747 41.723204 -L 40.665552 41.252609 -L 41.453633 40.516237 -L 42.241715 39.454586 -L 43.029796 38.008156 -L 43.817878 36.117442 -L 44.605959 33.722944 -L 45.656735 29.666728 -L 46.970204 23.541535 -L 49.859836 9.794603 -L 50.910611 6.02543 -L 51.698693 4.045463 -L 52.22408 3.227948 -L 52.749468 2.874109 -L 53.012162 2.88712 -L 53.537549 3.289707 -L 54.062937 4.150681 -L 54.588325 5.41715 -L 55.376406 7.961462 -L 56.427182 12.279465 -L 58.266038 21.193501 -L 60.104895 29.891567 -L 61.15567 33.899444 -L 62.206446 36.93085 -L 62.994527 38.63671 -L 63.782609 39.922088 -L 64.57069 40.846487 -L 65.358772 41.469408 -L 66.146853 41.850354 -L 67.197628 42.084719 -L 68.773791 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_9"> - <path d="M 5.727273 42.136364 -L 46.70751 42.035495 -L 47.758285 41.711171 -L 48.546367 41.232675 -L 49.334448 40.486419 -L 50.12253 39.412902 -L 50.910611 37.95262 -L 51.698693 36.046073 -L 52.486774 33.633757 -L 53.537549 29.553565 -L 55.113712 22.110444 -L 57.477957 10.78213 -L 58.528732 6.772965 -L 59.316814 4.550527 -L 59.842201 3.541614 -L 60.367589 2.972575 -L 60.630283 2.869537 -L 60.892977 2.895546 -L 61.418364 3.322309 -L 61.943752 4.204813 -L 62.46914 5.49017 -L 63.257221 8.057852 -L 64.307996 12.397761 -L 66.146853 21.324678 -L 67.98571 30.003229 -L 69.036485 33.98676 -L 70.087261 36.995115 -L 70.875342 38.686 -L 71.663424 39.958387 -L 72.451505 40.871778 -L 73.239587 41.485674 -L 74.027668 41.859579 -L 75.078443 42.087641 -L 76.654606 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_10"> - <path d="M 5.727273 42.136364 -L 54.588325 42.030767 -L 55.6391 41.698907 -L 56.427182 41.212444 -L 57.215263 40.456238 -L 58.003344 39.370787 -L 58.791426 37.896589 -L 59.579507 35.974141 -L 60.367589 33.543942 -L 61.418364 29.439915 -L 62.994527 21.97967 -L 65.358772 10.670298 -L 66.409547 6.686741 -L 67.197628 4.490451 -L 67.723016 3.502275 -L 68.248404 2.956618 -L 68.511098 2.866263 -L 68.773791 2.905244 -L 69.299179 3.35605 -L 69.824567 4.259953 -L 70.612648 6.349668 -L 71.40073 9.161342 -L 72.451505 13.724759 -L 76.654606 33.178355 -L 77.705382 36.397346 -L 78.493463 38.225384 -L 79.281545 39.617073 -L 80.069626 40.631915 -L 80.857708 41.329412 -L 81.645789 41.769067 -L 82.696564 42.057027 -L 84.010033 42.135996 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p11fbba2f81)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> - </g> - </g> - </g> - <defs> - <clipPath id="p11fbba2f81"> - <rect x="1.8" y="0.9" width="86.4" height="43.2"/> - </clipPath> - </defs> -</svg> diff --git a/docs/background/basis/images/EvalMSpline.svg b/docs/background/basis/images/EvalMSpline.svg deleted file mode 100644 index 36945902..00000000 --- a/docs/background/basis/images/EvalMSpline.svg +++ /dev/null @@ -1,289 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> - <metadata> - <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <cc:Work> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> - <dc:date>2024-12-02T16:54:50.998126</dc:date> - <dc:format>image/svg+xml</dc:format> - <dc:creator> - <cc:Agent> - <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> - </cc:Agent> - </dc:creator> - </cc:Work> - </rdf:RDF> - </metadata> - <defs> - <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> - </defs> - <g id="figure_1"> - <g id="patch_1"> - <path d="M 0 45 -L 90 45 -L 90 0 -L 0 0 -z -" style="fill: #ffffff"/> - </g> - <g id="axes_1"> - <g id="patch_2"> - <path d="M 1.8 44.1 -L 88.2 44.1 -L 88.2 0.9 -L 1.8 0.9 -z -" style="fill: #ffffff"/> - </g> - <g id="matplotlib.axis_1"/> - <g id="matplotlib.axis_2"/> - <g id="line2d_1"> - <path d="M 5.727273 2.863636 -L 6.778048 12.895825 -L 7.828823 21.055116 -L 8.879599 27.535018 -L 9.930374 32.529042 -L 10.718455 35.415861 -L 11.506537 37.657359 -L 12.294618 39.335174 -L 13.0827 40.530942 -L 13.870781 41.3263 -L 14.658863 41.802886 -L 15.446944 42.042336 -L 16.760413 42.13618 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_2"> - <path d="M 5.727273 42.136364 -L 6.778048 37.366476 -L 7.56613 34.704263 -L 8.354211 32.74714 -L 9.142292 31.423676 -L 9.66768 30.858123 -L 10.193068 30.521283 -L 10.718455 30.391992 -L 11.243843 30.449082 -L 12.031925 30.837887 -L 12.820006 31.527 -L 13.870781 32.789498 -L 15.709638 35.468659 -L 17.285801 37.657359 -L 18.59927 39.091218 -L 19.912739 40.180874 -L 21.226209 40.97357 -L 22.539678 41.51655 -L 24.115841 41.905019 -L 25.954697 42.098646 -L 29.107023 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_3"> - <path d="M 5.727273 42.136364 -L 6.515354 42.043658 -L 7.56613 41.661814 -L 8.616905 41.039043 -L 9.930374 40.011852 -L 12.294618 37.8157 -L 14.396169 35.949505 -L 15.709638 35.044398 -L 16.760413 34.559248 -L 17.811189 34.341602 -L 18.861964 34.379958 -L 19.912739 34.63678 -L 21.226209 35.207704 -L 22.802372 36.162321 -L 25.42931 38.077464 -L 27.793554 39.728598 -L 29.369717 40.582765 -L 30.94588 41.206643 -L 32.784737 41.691381 -L 34.886288 41.995322 -L 37.513226 42.126161 -L 45.919428 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_4"> - <path d="M 5.727273 42.136364 -L 10.193068 42.033205 -L 12.557312 41.767318 -L 14.658863 41.311092 -L 16.49772 40.689219 -L 18.336576 39.82665 -L 21.488902 38.034772 -L 24.115841 36.640527 -L 25.692004 36.016495 -L 27.005473 35.690977 -L 28.318942 35.592654 -L 29.632411 35.747054 -L 30.94588 36.117875 -L 32.522043 36.782015 -L 34.886288 38.056424 -L 39.089389 40.365233 -L 40.928246 41.085067 -L 42.767102 41.577501 -L 44.868653 41.917113 -L 47.495591 42.101361 -L 51.961386 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_5"> - <path d="M 5.727273 42.136364 -L 21.488902 42.027915 -L 23.853147 41.755017 -L 25.954697 41.290111 -L 27.793554 40.658754 -L 29.632411 39.787058 -L 33.047431 37.841094 -L 35.411675 36.606139 -L 36.987838 35.992597 -L 38.301307 35.67879 -L 39.614777 35.594823 -L 40.928246 35.762862 -L 42.241715 36.144623 -L 43.817878 36.818328 -L 46.182122 38.099794 -L 50.12253 40.277685 -L 51.961386 41.022753 -L 53.800243 41.536424 -L 55.901794 41.894908 -L 58.528732 42.094647 -L 62.731833 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_6"> - <path d="M 5.727273 42.136364 -L 32.522043 42.040812 -L 34.886288 41.785268 -L 36.987838 41.341908 -L 38.826695 40.734127 -L 40.665552 39.885517 -L 43.555184 38.252168 -L 46.444816 36.69286 -L 48.283673 35.969296 -L 49.597142 35.667354 -L 50.910611 35.597844 -L 52.22408 35.779368 -L 53.800243 36.271589 -L 55.6391 37.120992 -L 58.791426 38.90744 -L 61.418364 40.312998 -L 63.257221 41.047966 -L 65.096078 41.553088 -L 67.197628 41.903962 -L 69.824567 42.097427 -L 74.290362 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_7"> - <path d="M 5.727273 42.136364 -L 43.817878 42.035783 -L 46.182122 41.773368 -L 48.283673 41.321451 -L 50.12253 40.704293 -L 51.961386 39.846343 -L 55.113712 38.056424 -L 57.740651 36.657872 -L 59.316814 36.028665 -L 60.630283 35.697349 -L 61.943752 35.591893 -L 63.257221 35.739415 -L 64.57069 36.104707 -L 66.146853 36.763996 -L 68.511098 38.034772 -L 72.714199 40.347921 -L 74.553056 41.072795 -L 76.391912 41.569441 -L 78.493463 41.912786 -L 81.120401 42.100081 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_8"> - <path d="M 5.727273 42.136364 -L 54.588325 42.039151 -L 56.689875 41.789347 -L 58.528732 41.369616 -L 60.367589 40.701783 -L 61.943752 39.888221 -L 63.782609 38.658402 -L 68.248404 35.498729 -L 69.561873 34.835358 -L 70.875342 34.425152 -L 71.926117 34.328652 -L 72.976893 34.478839 -L 74.027668 34.900427 -L 75.341137 35.746863 -L 76.9173 37.078682 -L 81.120401 40.852634 -L 82.43387 41.661814 -L 83.484646 42.043658 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_9"> - <path d="M 5.727273 42.136364 -L 64.833384 42.042336 -L 66.409547 41.802886 -L 67.98571 41.3263 -L 69.299179 40.689103 -L 70.612648 39.783292 -L 71.926117 38.561625 -L 73.239587 36.97704 -L 75.341137 33.901535 -L 76.654606 32.11797 -L 77.705382 31.037752 -L 78.493463 30.540907 -L 79.018851 30.398562 -L 79.544238 30.432017 -L 80.069626 30.662437 -L 80.595014 31.110988 -L 81.120401 31.798834 -L 81.908483 33.325581 -L 82.696564 35.509796 -L 83.484646 38.422913 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_10"> - <path d="M 5.727273 42.136364 -L 74.553056 42.042336 -L 75.341137 41.802886 -L 76.129219 41.3263 -L 76.9173 40.530942 -L 77.705382 39.335174 -L 78.493463 37.657359 -L 79.281545 35.415861 -L 80.069626 32.529042 -L 80.857708 28.915266 -L 81.908483 22.824975 -L 82.959258 15.103673 -L 84.010033 5.55785 -L 84.272727 2.863636 -L 84.272727 2.863636 -" clip-path="url(#p374bc9105e)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> - </g> - </g> - </g> - <defs> - <clipPath id="p374bc9105e"> - <rect x="1.8" y="0.9" width="86.4" height="43.2"/> - </clipPath> - </defs> -</svg> diff --git a/docs/background/basis/images/EvalOrthExponential.svg b/docs/background/basis/images/EvalOrthExponential.svg deleted file mode 100644 index 0326c6e6..00000000 --- a/docs/background/basis/images/EvalOrthExponential.svg +++ /dev/null @@ -1,564 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> - <metadata> - <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <cc:Work> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> - <dc:date>2024-12-02T16:54:51.006464</dc:date> - <dc:format>image/svg+xml</dc:format> - <dc:creator> - <cc:Agent> - <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> - </cc:Agent> - </dc:creator> - </cc:Work> - </rdf:RDF> - </metadata> - <defs> - <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> - </defs> - <g id="figure_1"> - <g id="patch_1"> - <path d="M 0 45 -L 90 45 -L 90 0 -L 0 0 -z -" style="fill: #ffffff"/> - </g> - <g id="axes_1"> - <g id="patch_2"> - <path d="M 1.8 44.1 -L 88.2 44.1 -L 88.2 0.9 -L 1.8 0.9 -z -" style="fill: #ffffff"/> - </g> - <g id="matplotlib.axis_1"/> - <g id="matplotlib.axis_2"/> - <g id="line2d_1"> - <path d="M 5.727273 35.58081 -L 8.091517 33.98823 -L 10.455762 32.660072 -L 13.0827 31.432516 -L 15.972332 30.321367 -L 19.387352 29.258445 -L 23.327759 28.2861 -L 27.793554 27.425161 -L 33.047431 26.645627 -L 39.352083 25.939769 -L 47.232898 25.290606 -L 57.215263 24.703544 -L 70.087261 24.180349 -L 84.272727 23.784436 -L 84.272727 23.784436 -" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_2"> - <path d="M 5.727273 7.107421 -L 7.303436 10.459536 -L 8.879599 13.2971 -L 10.455762 15.698587 -L 12.031925 17.730182 -L 13.870781 19.706908 -L 15.709638 21.329868 -L 17.548495 22.659938 -L 19.650046 23.885276 -L 21.751596 24.854225 -L 24.115841 25.698449 -L 26.742779 26.395403 -L 29.632411 26.936314 -L 33.047431 27.348374 -L 37.250532 27.616004 -L 42.504409 27.706692 -L 49.334448 27.58845 -L 60.104895 27.154988 -L 84.272727 25.9988 -L 84.272727 25.9988 -" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_3"> - <path d="M 5.727273 6.191507 -L 7.040742 11.76016 -L 8.354211 16.248426 -L 9.66768 19.829383 -L 10.981149 22.650026 -L 12.031925 24.443622 -L 13.0827 25.885853 -L 14.133475 27.024927 -L 15.446944 28.086252 -L 16.760413 28.810505 -L 18.073883 29.257751 -L 19.387352 29.478712 -L 20.963515 29.504903 -L 22.802372 29.282065 -L 24.903922 28.786699 -L 27.53086 27.933476 -L 31.733962 26.304207 -L 39.87747 23.121475 -L 44.605959 21.54092 -L 49.071754 20.28864 -L 53.537549 19.267035 -L 58.266038 18.415228 -L 63.257221 17.73954 -L 68.773791 17.215766 -L 75.078443 16.846564 -L 82.43387 16.65031 -L 84.272727 16.632196 -L 84.272727 16.632196 -" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_4"> - <path d="M 5.727273 5.261615 -L 6.778048 12.548948 -L 7.828823 18.167184 -L 8.879599 22.400215 -L 9.66768 24.813088 -L 10.455762 26.672486 -L 11.243843 28.056931 -L 12.031925 29.035833 -L 12.820006 29.670459 -L 13.608088 30.014793 -L 14.396169 30.116316 -L 15.184251 30.016704 -L 16.235026 29.63342 -L 17.548495 28.853474 -L 19.124658 27.627834 -L 22.01429 25.022107 -L 25.42931 22.017432 -L 27.793554 20.249528 -L 29.895105 18.968265 -L 31.733962 18.086232 -L 33.572818 17.425692 -L 35.411675 16.976637 -L 37.513226 16.702788 -L 39.614777 16.657965 -L 41.979021 16.844483 -L 44.605959 17.296391 -L 47.495591 18.027388 -L 51.173305 19.211412 -L 56.164488 21.083935 -L 70.087261 26.441715 -L 75.603831 28.256829 -L 80.595014 29.672904 -L 84.272727 30.57337 -L 84.272727 30.57337 -" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_5"> - <path d="M 5.727273 4.469995 -L 6.515354 12.609147 -L 7.303436 18.794265 -L 8.091517 23.356576 -L 8.879599 26.581715 -L 9.66768 28.71526 -L 10.193068 29.636406 -L 10.718455 30.221133 -L 11.243843 30.518467 -L 11.769231 30.572352 -L 12.294618 30.422099 -L 13.0827 29.889623 -L 13.870781 29.078323 -L 15.184251 27.331969 -L 20.175433 20.169338 -L 21.488902 18.766097 -L 22.802372 17.672005 -L 24.115841 16.894234 -L 25.42931 16.423072 -L 26.742779 16.237192 -L 28.056248 16.307734 -L 29.369717 16.601433 -L 30.94588 17.19869 -L 32.784737 18.155675 -L 35.148981 19.655964 -L 43.29249 25.06931 -L 45.656735 26.275397 -L 47.758285 27.114872 -L 49.859836 27.715678 -L 51.961386 28.070172 -L 54.062937 28.179489 -L 56.164488 28.051609 -L 58.266038 27.699659 -L 60.630283 27.05693 -L 62.994527 26.179569 -L 65.621465 24.965801 -L 68.511098 23.388602 -L 71.926117 21.27045 -L 76.391912 18.21908 -L 84.272727 12.520624 -L 84.272727 12.520624 -" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_6"> - <path d="M 5.727273 3.83944 -L 6.515354 14.763305 -L 7.303436 22.24323 -L 7.828823 25.693142 -L 8.354211 28.139132 -L 8.879599 29.748453 -L 9.404986 30.667803 -L 9.930374 31.025411 -L 10.455762 30.932932 -L 10.981149 30.487178 -L 11.769231 29.335624 -L 12.820006 27.247679 -L 15.972332 20.505907 -L 17.023107 18.766802 -L 18.073883 17.43456 -L 18.861964 16.715331 -L 19.650046 16.233175 -L 20.438127 15.977532 -L 21.226209 15.932546 -L 22.01429 16.078639 -L 23.065065 16.532414 -L 24.115841 17.231056 -L 25.42931 18.362763 -L 27.53086 20.523917 -L 31.208574 24.369969 -L 33.047431 25.954804 -L 34.623594 27.019202 -L 35.937063 27.671383 -L 37.250532 28.100862 -L 38.564001 28.308377 -L 39.87747 28.302083 -L 41.190939 28.096136 -L 42.767102 27.61225 -L 44.605959 26.771167 -L 46.70751 25.530893 -L 49.597142 23.53335 -L 54.851019 19.860947 -L 57.215263 18.502144 -L 59.316814 17.566978 -L 61.15567 17.003752 -L 62.731833 16.732625 -L 64.307996 16.670516 -L 65.884159 16.826367 -L 67.460322 17.20557 -L 69.036485 17.81027 -L 70.612648 18.63969 -L 72.451505 19.886729 -L 74.290362 21.425707 -L 76.129219 23.243835 -L 78.230769 25.643271 -L 80.595014 28.720043 -L 83.221952 32.556893 -L 84.272727 34.201461 -L 84.272727 34.201461 -" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_7"> - <path d="M 5.727273 41.656016 -L 6.515354 27.764306 -L 7.040742 21.682925 -L 7.56613 17.589782 -L 8.091517 15.085496 -L 8.616905 13.830088 -L 8.879599 13.578929 -L 9.142292 13.5358 -L 9.404986 13.671834 -L 9.930374 14.378262 -L 10.718455 16.195067 -L 12.031925 20.124502 -L 13.608088 24.65073 -L 14.658863 26.952704 -L 15.446944 28.186438 -L 16.235026 28.982513 -L 16.760413 29.277386 -L 17.285801 29.394588 -L 17.811189 29.346831 -L 18.59927 28.998594 -L 19.387352 28.367892 -L 20.438127 27.188326 -L 22.01429 24.969271 -L 25.166616 20.353368 -L 26.480085 18.801463 -L 27.53086 17.824634 -L 28.581636 17.111983 -L 29.632411 16.673893 -L 30.683186 16.507683 -L 31.733962 16.599849 -L 32.784737 16.928287 -L 34.098206 17.627054 -L 35.411675 18.584572 -L 37.250532 20.223665 -L 43.029796 25.647209 -L 44.605959 26.750728 -L 46.182122 27.56523 -L 47.495591 27.998 -L 48.809061 28.196796 -L 50.12253 28.161299 -L 51.435999 27.899347 -L 52.749468 27.426058 -L 54.325631 26.609725 -L 56.164488 25.375321 -L 58.528732 23.481311 -L 64.307996 18.701698 -L 66.146853 17.536983 -L 67.723016 16.811021 -L 69.036485 16.442594 -L 70.349954 16.322181 -L 71.40073 16.423379 -L 72.451505 16.714371 -L 73.50228 17.206971 -L 74.553056 17.91174 -L 75.866525 19.105087 -L 77.179994 20.659698 -L 78.493463 22.587819 -L 79.806932 24.898664 -L 81.383095 28.185493 -L 82.959258 32.037777 -L 84.272727 35.680051 -L 84.272727 35.680051 -" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_8"> - <path d="M 5.727273 41.970701 -L 6.25266 29.600363 -L 6.778048 21.398515 -L 7.303436 16.412914 -L 7.828823 13.856627 -L 8.091517 13.282954 -L 8.354211 13.084674 -L 8.616905 13.199977 -L 8.879599 13.573496 -L 9.404986 14.902929 -L 10.193068 17.766311 -L 12.031925 24.863372 -L 12.820006 27.129488 -L 13.608088 28.688013 -L 14.133475 29.321666 -L 14.658863 29.643558 -L 15.184251 29.675827 -L 15.709638 29.447511 -L 16.235026 28.992157 -L 17.023107 27.962694 -L 18.073883 26.137016 -L 21.751596 19.185344 -L 22.802372 17.792628 -L 23.590453 17.038864 -L 24.378535 16.549013 -L 25.166616 16.322992 -L 25.954697 16.350446 -L 26.742779 16.612648 -L 27.53086 17.084361 -L 28.581636 17.986885 -L 29.895105 19.442301 -L 32.522043 22.832477 -L 34.623594 25.35917 -L 35.937063 26.624078 -L 37.250532 27.55524 -L 38.301307 28.030225 -L 39.352083 28.254993 -L 40.402858 28.231479 -L 41.453633 27.971164 -L 42.504409 27.493764 -L 43.817878 26.632669 -L 45.394041 25.296323 -L 47.758285 22.934574 -L 50.910611 19.802314 -L 52.486774 18.512178 -L 53.800243 17.672809 -L 55.113712 17.091688 -L 56.164488 16.831985 -L 57.215263 16.763969 -L 58.266038 16.890348 -L 59.316814 17.208311 -L 60.630283 17.862158 -L 61.943752 18.774656 -L 63.519915 20.154764 -L 65.621465 22.328717 -L 69.824567 26.77335 -L 71.40073 28.050842 -L 72.451505 28.663362 -L 73.50228 29.030336 -L 74.290362 29.116321 -L 75.078443 29.018267 -L 75.866525 28.716698 -L 76.654606 28.192388 -L 77.442688 27.426437 -L 78.230769 26.400349 -L 79.281545 24.596503 -L 80.33232 22.257016 -L 81.383095 19.342641 -L 82.43387 15.816308 -L 83.74734 10.4952 -L 84.272727 8.069753 -L 84.272727 8.069753 -" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_9"> - <path d="M 5.727273 42.136364 -L 6.25266 27.274067 -L 6.778048 18.462945 -L 7.303436 14.032339 -L 7.56613 13.034673 -L 7.828823 12.660335 -L 8.091517 12.788946 -L 8.354211 13.315055 -L 8.879599 15.204287 -L 9.930374 20.463666 -L 10.981149 25.410231 -L 11.769231 28.056845 -L 12.294618 29.193794 -L 12.820006 29.826796 -L 13.345394 29.987768 -L 13.870781 29.728171 -L 14.396169 29.111617 -L 15.184251 27.671031 -L 16.235026 25.15903 -L 18.336576 19.950344 -L 19.387352 17.968677 -L 20.175433 16.926446 -L 20.963515 16.301648 -L 21.488902 16.118148 -L 22.01429 16.114442 -L 22.539678 16.280132 -L 23.327759 16.81543 -L 24.115841 17.64334 -L 25.166616 19.088775 -L 27.005473 22.09708 -L 28.84433 25.014309 -L 30.157799 26.679032 -L 31.208574 27.636224 -L 31.996656 28.105284 -L 32.784737 28.352237 -L 33.572818 28.37836 -L 34.3609 28.192519 -L 35.148981 27.810168 -L 36.199757 27.031552 -L 37.513226 25.714305 -L 39.352083 23.479145 -L 42.241715 19.921559 -L 43.555184 18.603469 -L 44.868653 17.611366 -L 45.919428 17.095673 -L 46.970204 16.847467 -L 48.020979 16.872153 -L 49.071754 17.16302 -L 50.12253 17.702136 -L 51.435999 18.681746 -L 53.012162 20.207189 -L 55.376406 22.881883 -L 58.003344 25.758628 -L 59.579507 27.122792 -L 60.892977 27.923128 -L 61.943752 28.297048 -L 62.994527 28.409436 -L 64.045303 28.247569 -L 65.096078 27.809142 -L 66.146853 27.102896 -L 67.197628 26.149057 -L 68.511098 24.658392 -L 70.349954 22.180535 -L 73.50228 17.833651 -L 74.815749 16.447913 -L 75.603831 15.866117 -L 76.391912 15.531426 -L 77.179994 15.495623 -L 77.705382 15.664351 -L 78.230769 16.006307 -L 78.756157 16.538299 -L 79.544238 17.730137 -L 80.33232 19.447097 -L 81.120401 21.749319 -L 81.908483 24.69788 -L 82.696564 28.354555 -L 83.74734 34.439209 -L 84.272727 38.041336 -L 84.272727 38.041336 -" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_10"> - <path d="M 5.727273 2.863636 -L 6.25266 20.228205 -L 6.778048 29.207243 -L 7.040742 31.440665 -L 7.303436 32.553204 -L 7.56613 32.783653 -L 7.828823 32.336838 -L 8.354211 30.082658 -L 10.718455 16.877093 -L 11.243843 15.468078 -L 11.769231 14.809233 -L 12.031925 14.742473 -L 12.294618 14.835488 -L 12.820006 15.444506 -L 13.345394 16.514136 -L 14.133475 18.700858 -L 16.49772 25.893011 -L 17.285801 27.582708 -L 18.073883 28.67162 -L 18.59927 29.045343 -L 19.124658 29.14255 -L 19.650046 28.979135 -L 20.175433 28.578944 -L 20.963515 27.601259 -L 22.01429 25.77873 -L 25.692004 18.675085 -L 26.480085 17.652058 -L 27.268167 16.939324 -L 28.056248 16.557297 -L 28.84433 16.507095 -L 29.632411 16.772785 -L 30.420493 17.324109 -L 31.471268 18.430411 -L 32.784737 20.237928 -L 36.725144 26.021736 -L 37.77592 27.107901 -L 38.826695 27.848681 -L 39.614777 28.154804 -L 40.402858 28.240485 -L 41.190939 28.108686 -L 41.979021 27.769968 -L 43.029796 27.02734 -L 44.080572 26.005248 -L 45.656735 24.105641 -L 49.597142 19.114847 -L 50.910611 17.901272 -L 51.961386 17.229968 -L 53.012162 16.864863 -L 53.800243 16.804107 -L 54.588325 16.928316 -L 55.376406 17.233623 -L 56.427182 17.905736 -L 57.477957 18.847089 -L 58.791426 20.324915 -L 60.892977 23.083086 -L 63.257221 26.092566 -L 64.57069 27.403795 -L 65.621465 28.144997 -L 66.409547 28.482127 -L 67.197628 28.609922 -L 67.98571 28.514679 -L 68.773791 28.18903 -L 69.561873 27.632695 -L 70.612648 26.546258 -L 71.663424 25.105443 -L 72.976893 22.916338 -L 76.654606 16.505794 -L 77.442688 15.60817 -L 77.968075 15.218701 -L 78.493463 15.037174 -L 79.018851 15.10099 -L 79.544238 15.449698 -L 80.069626 16.124966 -L 80.595014 17.170545 -L 81.120401 18.632233 -L 81.908483 21.710065 -L 82.696564 26.001642 -L 83.484646 31.685907 -L 84.272727 38.950776 -L 84.272727 38.950776 -" clip-path="url(#pb94f8c55b8)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> - </g> - </g> - </g> - <defs> - <clipPath id="pb94f8c55b8"> - <rect x="1.8" y="0.9" width="86.4" height="43.2"/> - </clipPath> - </defs> -</svg> diff --git a/docs/background/basis/images/EvalRaisedCosineLinear.svg b/docs/background/basis/images/EvalRaisedCosineLinear.svg deleted file mode 100644 index fbdbd641..00000000 --- a/docs/background/basis/images/EvalRaisedCosineLinear.svg +++ /dev/null @@ -1,367 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> - <metadata> - <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <cc:Work> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> - <dc:date>2024-12-02T16:54:51.015187</dc:date> - <dc:format>image/svg+xml</dc:format> - <dc:creator> - <cc:Agent> - <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> - </cc:Agent> - </dc:creator> - </cc:Work> - </rdf:RDF> - </metadata> - <defs> - <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> - </defs> - <g id="figure_1"> - <g id="patch_1"> - <path d="M 0 45 -L 90 45 -L 90 0 -L 0 0 -z -" style="fill: #ffffff"/> - </g> - <g id="axes_1"> - <g id="patch_2"> - <path d="M 1.8 44.1 -L 88.2 44.1 -L 88.2 0.9 -L 1.8 0.9 -z -" style="fill: #ffffff"/> - </g> - <g id="matplotlib.axis_1"/> - <g id="matplotlib.axis_2"/> - <g id="line2d_1"> - <path d="M 5.727273 2.863636 -L 6.25266 2.951367 -L 6.778048 3.213774 -L 7.56613 3.929352 -L 8.354211 5.017944 -L 9.142292 6.457682 -L 10.193068 8.872634 -L 11.506537 12.562942 -L 13.0827 17.700614 -L 17.811189 33.654726 -L 19.124658 37.129419 -L 20.175433 39.331058 -L 20.963515 40.591897 -L 21.751596 41.489339 -L 22.539678 42.005358 -L 23.065065 42.132028 -L 29.895105 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_2"> - <path d="M 5.727273 22.5 -L 8.354211 13.557714 -L 9.930374 9.021931 -L 10.981149 6.577546 -L 12.031925 4.700989 -L 12.820006 3.707301 -L 13.608088 3.091085 -L 14.133475 2.896415 -L 14.658863 2.876913 -L 15.184251 3.032752 -L 15.709638 3.362541 -L 16.49772 4.176515 -L 17.285801 5.358537 -L 18.336576 7.465043 -L 19.387352 10.107728 -L 20.700821 14.019956 -L 22.802372 21.159967 -L 25.954697 31.898358 -L 27.268167 35.675028 -L 28.318942 38.177467 -L 29.369717 40.120814 -L 30.157799 41.168906 -L 30.94588 41.842011 -L 31.471268 42.075426 -L 32.259349 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_3"> - <path d="M 5.727273 42.136364 -L 6.25266 42.048633 -L 6.778048 41.786226 -L 7.56613 41.070648 -L 8.354211 39.982056 -L 9.142292 38.542318 -L 10.193068 36.127366 -L 11.506537 32.437058 -L 13.0827 27.299386 -L 17.811189 11.345274 -L 19.124658 7.870581 -L 20.175433 5.668942 -L 20.963515 4.408103 -L 21.751596 3.510661 -L 22.539678 2.994642 -L 23.065065 2.867972 -L 23.590453 2.916723 -L 24.115841 3.140461 -L 24.903922 3.799371 -L 25.692004 4.833904 -L 26.480085 6.223281 -L 27.53086 8.57857 -L 28.84433 12.20926 -L 30.420493 17.301579 -L 35.411675 34.075323 -L 36.725144 37.468394 -L 37.77592 39.590903 -L 38.564001 40.786145 -L 39.352083 41.614089 -L 40.140164 42.058104 -L 40.928246 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_4"> - <path d="M 5.727273 42.136364 -L 14.921557 42.067035 -L 15.446944 41.823949 -L 16.235026 41.136667 -L 17.023107 40.075046 -L 17.811189 38.66041 -L 18.861964 36.275159 -L 20.175433 32.614457 -L 21.751596 27.499179 -L 26.480085 11.515684 -L 27.793554 8.00901 -L 28.84433 5.776141 -L 29.632411 4.489305 -L 30.420493 3.564235 -L 31.208574 3.019511 -L 31.733962 2.873391 -L 32.259349 2.902644 -L 32.784737 3.107009 -L 33.572818 3.737473 -L 34.3609 4.744805 -L 35.148981 6.108769 -L 36.199757 8.433835 -L 37.513226 12.034114 -L 39.089389 17.102912 -L 44.080572 33.908026 -L 45.394041 37.33403 -L 46.444816 39.48837 -L 47.232898 40.709952 -L 48.020979 41.565767 -L 48.809061 42.038623 -L 49.597142 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_5"> - <path d="M 5.727273 42.136364 -L 23.590453 42.083277 -L 24.115841 41.859539 -L 24.903922 41.200629 -L 25.692004 40.166096 -L 26.480085 38.776719 -L 27.53086 36.42143 -L 28.84433 32.79074 -L 30.420493 27.698421 -L 35.411675 10.924677 -L 36.725144 7.531606 -L 37.77592 5.409097 -L 38.564001 4.213855 -L 39.352083 3.385911 -L 40.140164 2.941896 -L 40.665552 2.863907 -L 41.190939 2.961377 -L 41.716327 3.233434 -L 42.504409 3.963131 -L 43.29249 5.065163 -L 44.080572 6.517393 -L 45.131347 8.947095 -L 46.444816 12.652054 -L 48.283673 18.707084 -L 52.486774 32.965886 -L 53.800243 36.566165 -L 54.851019 38.891231 -L 55.901794 40.631749 -L 56.689875 41.51534 -L 57.477957 42.016985 -L 58.003344 42.133925 -L 70.087261 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_6"> - <path d="M 5.727273 42.136364 -L 32.259349 42.097356 -L 32.784737 41.892991 -L 33.572818 41.262527 -L 34.3609 40.255195 -L 35.148981 38.891231 -L 36.199757 36.566165 -L 37.513226 32.965886 -L 39.089389 27.897088 -L 44.080572 11.091974 -L 45.394041 7.66597 -L 46.444816 5.51163 -L 47.232898 4.290048 -L 48.020979 3.434233 -L 48.809061 2.961377 -L 49.334448 2.863907 -L 49.859836 2.941896 -L 50.385223 3.194646 -L 51.173305 3.896086 -L 51.961386 4.971207 -L 52.749468 6.398414 -L 53.800243 8.798549 -L 55.113712 12.474104 -L 56.689875 17.60065 -L 61.418364 33.569674 -L 62.731833 37.060405 -L 63.782609 39.27769 -L 64.57069 40.551545 -L 65.358772 41.462814 -L 66.146853 41.993192 -L 66.672241 42.12959 -L 71.138036 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_7"> - <path d="M 5.727273 42.136364 -L 41.190939 42.038623 -L 41.716327 41.766566 -L 42.504409 41.036869 -L 43.29249 39.934837 -L 44.080572 38.482607 -L 45.131347 36.052905 -L 46.444816 32.347946 -L 48.283673 26.292916 -L 52.486774 12.034114 -L 53.800243 8.433835 -L 54.851019 6.108769 -L 55.901794 4.368251 -L 56.689875 3.48466 -L 57.477957 2.983015 -L 58.003344 2.866075 -L 58.528732 2.924574 -L 59.05412 3.157989 -L 59.842201 3.831094 -L 60.630283 4.879186 -L 61.418364 6.281211 -L 62.46914 8.651514 -L 63.782609 12.297261 -L 65.358772 17.40113 -L 70.349954 34.158493 -L 71.663424 37.534957 -L 72.714199 39.641463 -L 73.50228 40.823485 -L 74.290362 41.637459 -L 75.078443 42.067035 -L 75.866525 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_8"> - <path d="M 5.727273 42.136364 -L 49.859836 42.058104 -L 50.385223 41.805354 -L 51.173305 41.103914 -L 51.961386 40.028793 -L 52.749468 38.601586 -L 53.800243 36.201451 -L 55.113712 32.525896 -L 56.689875 27.39935 -L 61.418364 11.430326 -L 62.731833 7.939595 -L 63.782609 5.72231 -L 64.57069 4.448455 -L 65.358772 3.537186 -L 66.146853 3.006808 -L 66.672241 2.87041 -L 67.197628 2.909413 -L 67.723016 3.123468 -L 68.511098 3.768164 -L 69.299179 4.78911 -L 70.087261 6.1658 -L 71.138036 8.506009 -L 72.451505 12.121544 -L 74.027668 17.202172 -L 79.018851 33.991833 -L 80.33232 37.401418 -L 81.383095 39.539872 -L 82.171177 40.748301 -L 82.959258 41.590191 -L 83.74734 42.048633 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_9"> - <path d="M 5.727273 42.136364 -L 58.528732 42.075426 -L 59.05412 41.842011 -L 59.842201 41.168906 -L 60.630283 40.120814 -L 61.418364 38.718789 -L 62.46914 36.348486 -L 63.782609 32.702739 -L 65.358772 27.59887 -L 70.349954 10.841507 -L 71.663424 7.465043 -L 72.714199 5.358537 -L 73.50228 4.176515 -L 74.290362 3.362541 -L 75.078443 2.932965 -L 75.603831 2.86472 -L 76.129219 2.971926 -L 76.654606 3.253626 -L 77.442688 3.997422 -L 78.230769 5.112863 -L 79.018851 6.577546 -L 80.069626 9.021931 -L 81.383095 12.741438 -L 83.221952 18.808353 -L 84.272727 22.5 -L 84.272727 22.5 -" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_10"> - <path d="M 5.727273 42.136364 -L 67.197628 42.090587 -L 67.723016 41.876532 -L 68.511098 41.231836 -L 69.299179 40.21089 -L 70.087261 38.8342 -L 71.138036 36.493991 -L 72.451505 32.878456 -L 74.027668 27.797828 -L 79.018851 11.008167 -L 80.33232 7.598582 -L 81.383095 5.460128 -L 82.171177 4.251699 -L 82.959258 3.409809 -L 83.74734 2.951367 -L 84.272727 2.863636 -L 84.272727 2.863636 -" clip-path="url(#pa3d24875ec)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> - </g> - </g> - </g> - <defs> - <clipPath id="pa3d24875ec"> - <rect x="1.8" y="0.9" width="86.4" height="43.2"/> - </clipPath> - </defs> -</svg> diff --git a/docs/background/basis/images/EvalRaisedCosineLog.svg b/docs/background/basis/images/EvalRaisedCosineLog.svg deleted file mode 100644 index 6389fc18..00000000 --- a/docs/background/basis/images/EvalRaisedCosineLog.svg +++ /dev/null @@ -1,310 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="90pt" height="45pt" viewBox="0 0 90 45" xmlns="http://www.w3.org/2000/svg" version="1.1"> - <metadata> - <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <cc:Work> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> - <dc:date>2024-12-02T16:54:51.023103</dc:date> - <dc:format>image/svg+xml</dc:format> - <dc:creator> - <cc:Agent> - <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title> - </cc:Agent> - </dc:creator> - </cc:Work> - </rdf:RDF> - </metadata> - <defs> - <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> - </defs> - <g id="figure_1"> - <g id="patch_1"> - <path d="M 0 45 -L 90 45 -L 90 0 -L 0 0 -z -" style="fill: #ffffff"/> - </g> - <g id="axes_1"> - <g id="patch_2"> - <path d="M 1.8 44.1 -L 88.2 44.1 -L 88.2 0.9 -L 1.8 0.9 -z -" style="fill: #ffffff"/> - </g> - <g id="matplotlib.axis_1"/> - <g id="matplotlib.axis_2"/> - <g id="line2d_1"> - <path d="M 5.727273 2.863636 -L 5.989967 7.225475 -L 6.778048 34.84641 -L 7.040742 39.996484 -L 7.303436 42.060117 -L 7.828823 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #1f77b4; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_2"> - <path d="M 5.727273 22.5 -L 5.989967 10.159998 -L 6.25266 3.757449 -L 6.515354 3.319737 -L 6.778048 7.230654 -L 8.091517 37.807425 -L 8.354211 40.640345 -L 8.616905 41.980383 -L 8.879599 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #ff7f0e; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_3"> - <path d="M 5.727273 42.136364 -L 5.989967 37.774525 -L 6.778048 10.15359 -L 7.040742 5.003516 -L 7.303436 2.939883 -L 7.56613 3.544813 -L 7.828823 6.18689 -L 8.354211 14.982377 -L 9.404986 33.406194 -L 9.930374 39.108852 -L 10.455762 41.819178 -L 10.718455 42.136362 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #2ca02c; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_4"> - <path d="M 5.727273 42.136364 -L 6.25266 42.136364 -L 6.515354 41.680263 -L 6.778048 37.769346 -L 8.091517 7.192575 -L 8.354211 4.359655 -L 8.616905 3.019617 -L 8.879599 3.0177 -L 9.142292 4.144683 -L 9.66768 8.868257 -L 12.031925 36.605077 -L 12.557312 39.866149 -L 13.0827 41.667204 -L 13.345394 42.05409 -L 13.870781 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #d62728; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_5"> - <path d="M 5.727273 42.136364 -L 7.303436 42.136364 -L 7.56613 41.455187 -L 7.828823 38.81311 -L 8.354211 30.017623 -L 9.404986 11.593806 -L 9.930374 5.891148 -L 10.455762 3.180822 -L 10.718455 2.863638 -L 10.981149 3.153569 -L 11.243843 3.974888 -L 11.769231 6.895082 -L 12.557312 13.33465 -L 14.658863 31.83752 -L 15.446944 36.770073 -L 16.235026 40.088617 -L 16.760413 41.405742 -L 17.285801 42.049351 -L 17.811189 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #9467bd; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_6"> - <path d="M 5.727273 42.136364 -L 8.616905 42.136364 -L 8.879599 41.9823 -L 9.142292 40.855317 -L 9.66768 36.131743 -L 12.031925 8.394923 -L 12.557312 5.133851 -L 13.0827 3.332796 -L 13.345394 2.94591 -L 13.608088 2.873877 -L 13.870781 3.092334 -L 14.133475 3.575193 -L 14.658863 5.225814 -L 15.446944 9.01105 -L 16.760413 17.19343 -L 18.59927 28.76697 -L 19.650046 34.123507 -L 20.438127 37.271726 -L 21.226209 39.622337 -L 22.01429 41.18088 -L 22.539678 41.798355 -L 23.065065 42.098662 -L 23.853147 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #8c564b; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_7"> - <path d="M 5.727273 42.136364 -L 10.718455 42.136364 -L 10.981149 41.846431 -L 11.243843 41.025112 -L 11.769231 38.104918 -L 12.557312 31.66535 -L 14.658863 13.16248 -L 15.446944 8.229927 -L 16.235026 4.911383 -L 16.760413 3.594258 -L 17.285801 2.950649 -L 17.548495 2.864134 -L 17.811189 2.923725 -L 18.336576 3.446071 -L 18.861964 4.4448 -L 19.650046 6.673413 -L 20.700821 10.632486 -L 22.539678 18.872292 -L 24.641228 28.112641 -L 25.954697 32.980145 -L 27.005473 36.167788 -L 28.056248 38.669523 -L 28.84433 40.088543 -L 29.632411 41.122946 -L 30.420493 41.78746 -L 31.208574 42.10235 -L 32.259349 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #e377c2; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_8"> - <path d="M 5.727273 42.136364 -L 13.608088 42.126123 -L 13.870781 41.907666 -L 14.133475 41.424807 -L 14.658863 39.774186 -L 15.446944 35.98895 -L 16.760413 27.80657 -L 18.59927 16.23303 -L 19.650046 10.876493 -L 20.438127 7.728274 -L 21.226209 5.377663 -L 22.01429 3.81912 -L 22.539678 3.201645 -L 23.065065 2.901338 -L 23.590453 2.897184 -L 24.115841 3.165915 -L 24.641228 3.682852 -L 25.42931 4.868038 -L 26.217391 6.468634 -L 27.268167 9.105234 -L 28.84433 13.769025 -L 33.835512 29.203857 -L 35.411675 33.192156 -L 36.725144 35.98094 -L 38.038614 38.246232 -L 39.089389 39.674544 -L 40.140164 40.765404 -L 41.190939 41.528846 -L 42.241715 41.979595 -L 43.29249 42.135904 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #7f7f7f; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_9"> - <path d="M 5.727273 42.136364 -L 17.811189 42.076275 -L 18.336576 41.553929 -L 18.861964 40.5552 -L 19.650046 38.326587 -L 20.700821 34.367514 -L 22.539678 26.127708 -L 24.641228 16.887359 -L 25.954697 12.019855 -L 27.005473 8.832212 -L 28.056248 6.330477 -L 28.84433 4.911457 -L 29.632411 3.877054 -L 30.420493 3.21254 -L 31.208574 2.89765 -L 31.996656 2.908124 -L 32.784737 3.216996 -L 33.572818 3.795658 -L 34.623594 4.936064 -L 35.674369 6.43421 -L 36.987838 8.707085 -L 38.826695 12.41608 -L 41.979021 19.432411 -L 45.131347 26.303705 -L 47.232898 30.412552 -L 49.071754 33.562317 -L 50.647917 35.885128 -L 52.22408 37.839264 -L 53.800243 39.41776 -L 55.113712 40.447984 -L 56.427182 41.224904 -L 57.740651 41.757275 -L 59.05412 42.056197 -L 60.367589 42.136364 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #bcbd22; stroke-width: 0.8; stroke-linecap: square"/> - </g> - <g id="line2d_10"> - <path d="M 5.727273 42.136364 -L 23.590453 42.102816 -L 24.115841 41.834085 -L 24.641228 41.317148 -L 25.42931 40.131962 -L 26.217391 38.531366 -L 27.268167 35.894766 -L 28.84433 31.230975 -L 33.835512 15.796143 -L 35.411675 11.807844 -L 36.725144 9.01906 -L 38.038614 6.753768 -L 39.089389 5.325456 -L 40.140164 4.234596 -L 41.190939 3.471154 -L 42.241715 3.020405 -L 43.29249 2.864096 -L 44.343265 2.981443 -L 45.394041 3.349967 -L 46.444816 3.94619 -L 47.758285 4.975242 -L 49.334448 6.564989 -L 51.173305 8.810749 -L 53.274856 11.751411 -L 56.427182 16.586902 -L 62.46914 25.915289 -L 65.358772 29.917573 -L 67.723016 32.829343 -L 69.824567 35.102947 -L 71.926117 37.060316 -L 74.027668 38.692273 -L 75.866525 39.85226 -L 77.705382 40.76559 -L 79.544238 41.438826 -L 81.383095 41.881051 -L 83.221952 42.103323 -L 84.272727 42.136364 -L 84.272727 42.136364 -" clip-path="url(#pe65a61e677)" style="fill: none; stroke: #17becf; stroke-width: 0.8; stroke-linecap: square"/> - </g> - </g> - </g> - <defs> - <clipPath id="pe65a61e677"> - <rect x="1.8" y="0.9" width="86.4" height="43.2"/> - </clipPath> - </defs> -</svg> diff --git a/docs/conf.py b/docs/conf.py index f4a40b05..f4d73d48 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,6 +41,7 @@ 'sphinx_autodoc_typehints', 'sphinx_togglebutton', 'matplotlib.sphinxext.plot_directive', + "matplotlib.sphinxext.mathmpl", ] myst_enable_extensions = [ @@ -161,3 +162,6 @@ nb_execution_excludepatterns = ["tutorials/**", "how_to_guide/**", "background/**"] viewcode_follow_imported_members = True + +# option for mpl extension +plot_html_show_formats = False \ No newline at end of file diff --git a/docs/scripts/basis_table_figs.py b/docs/scripts/basis_table_figs.py index 7e3b503f..721f6635 100644 --- a/docs/scripts/basis_table_figs.py +++ b/docs/scripts/basis_table_figs.py @@ -1,9 +1,16 @@ +import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import nemos as nmo from nemos._inspect_utils import trim_kwargs +plt.rcParams.update( + { + "figure.dpi": 300, + } +) + KWARGS = dict( n_basis_funcs=10, decay_rates=np.arange(1, 10 + 1), @@ -17,8 +24,8 @@ def plot_basis(cls): cls_params = cls._get_param_names() new_kwargs = trim_kwargs(cls, KWARGS.copy(), {cls.__name__: cls_params}) bas = cls(**new_kwargs) - fig, ax = plt.subplots(1, 1, figsize=(5 / 4, 2.5 / 4)) - ax.plot(*bas.evaluate_on_grid(300), lw=0.8) + fig, ax = plt.subplots(1, 1, figsize=(5, 2.5)) + ax.plot(*bas.evaluate_on_grid(300), lw=4) for side in ["left", "right", "top", "bottom"]: ax.spines[side].set_visible(False) ax.set_xticks([]) From aafa384ff2cddab2cd0e27839f970fb0532acb1d Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Wed, 4 Dec 2024 12:12:25 -0500 Subject: [PATCH 09/21] fix background note path --- docs/background/basis/plot_01_1D_basis_function.md | 2 +- docs/background/basis/plot_02_ND_basis_function.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/background/basis/plot_01_1D_basis_function.md b/docs/background/basis/plot_01_1D_basis_function.md index fa5c5879..cf534004 100644 --- a/docs/background/basis/plot_01_1D_basis_function.md +++ b/docs/background/basis/plot_01_1D_basis_function.md @@ -96,7 +96,7 @@ else: path = Path("../_build/html/_static/thumbnails/background") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../../_build/html/_static").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/background/basis/plot_02_ND_basis_function.md b/docs/background/basis/plot_02_ND_basis_function.md index a9636285..8bb8015e 100644 --- a/docs/background/basis/plot_02_ND_basis_function.md +++ b/docs/background/basis/plot_02_ND_basis_function.md @@ -304,7 +304,7 @@ if root: path = Path(root) / "html/_static/thumbnails/background" # if local store in ../_build/html/... else: - path = Path("../_build/html/_static/thumbnails/background") + path = Path("../../_build/html/_static/thumbnails/background") # make sure the folder exists if run from build if root or Path("../_build/html/_static").exists(): From 0fa061f0f85a4303693aa6cd97f729d262c480fc Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Wed, 4 Dec 2024 12:20:10 -0500 Subject: [PATCH 10/21] fix background note path --- docs/background/basis/plot_01_1D_basis_function.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/background/basis/plot_01_1D_basis_function.md b/docs/background/basis/plot_01_1D_basis_function.md index cf534004..bddf798d 100644 --- a/docs/background/basis/plot_01_1D_basis_function.md +++ b/docs/background/basis/plot_01_1D_basis_function.md @@ -93,7 +93,7 @@ if root: path = Path(root) / "html/_static/thumbnails/background" # if local store in ../_build/html/... else: - path = Path("../_build/html/_static/thumbnails/background") + path = Path("../../_build/html/_static/thumbnails/background") # make sure the folder exists if run from build if root or Path("../../_build/html/_static").exists(): @@ -101,6 +101,9 @@ if root or Path("../../_build/html/_static").exists(): if path.exists(): fig.savefig(path / "plot_01_1D_basis_function.svg") + + +print(path.resolve(), path.exists()) ``` ## Feature Computation From 44e61cc4d960c1a3c9bf26637fb5e3d9c80870e3 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Wed, 4 Dec 2024 14:28:11 -0500 Subject: [PATCH 11/21] fixing links --- docs/background/basis/README.md | 32 +++++++++---------- .../basis/plot_01_1D_basis_function.md | 2 +- docs/conf.py | 6 +++- docs/scripts/basis_table_figs.py | 2 +- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/docs/background/basis/README.md b/docs/background/basis/README.md index 60516ad4..60789b5c 100644 --- a/docs/background/basis/README.md +++ b/docs/background/basis/README.md @@ -19,44 +19,44 @@ * - **B-Spline** - .. plot:: scripts/basis_table_figs.py plot_bspline :show-source-link: False - - `Grid cells <grid_cells_nemos>`_ - - `EvalBSpline <nemos.basis.basis.EvalBSpline>`_ :raw-html:`<br />` - `BSplineConv <nemos.basis.basis.BSplineConv>`_ + - :ref:`Grid cells <grid_cells_nemos>` + - :class:`~nemos.basis.BSplineEval` :raw-html:`<br />` + :class:`~nemos.basis.BSplineConv` - 🟢 Eval * - **Cyclic B-Spline** - .. plot:: scripts/basis_table_figs.py plot_cyclic_bspline :show-source-link: False - - `Place cells <basis_eval_place_cells>`_ - - `EvalCyclicBSpline <nemos.basis.basis.EvalCyclicBSpline>`_ :raw-html:`<br />` - `ConvCyclicBSpline <nemos.basis.basis.ConvCyclicBSpline>`_ + - :ref:`Place cells <basis_eval_place_cells>` + - :class:`~nemos.basis.CyclicBSplineEval` :raw-html:`<br />` + :class:`~nemos.basis.CyclicBSplineConv` - 🟢 Eval * - **M-Spline** - .. plot:: scripts/basis_table_figs.py plot_mspline :show-source-link: False - - `Place cells <basis_eval_place_cells>`_ - - `EvalMSpline <nemos.basis.basis.EvalMSpline>`_ :raw-html:`<br />` - `ConvMSpline <nemos.basis.basis.ConvMSpline>`_ + - :ref:`Place cells <basis_eval_place_cells>` + - :class:`~nemos.basis.MSplineEval` :raw-html:`<br />` + :class:`~nemos.basis.MSplineConv` - 🟢 Eval * - **Linearly Spaced Raised Cosine** - .. plot:: scripts/basis_table_figs.py plot_raised_cosine_linear :show-source-link: False - - - `EvalRaisedCosineLinear <nemos.basis.basis.EvalRaisedCosineLinear>`_ :raw-html:`<br />` - `ConvRaisedCosineLinear <nemos.basis.basis.ConvRaisedCosineLinear>`_ + - :class:`~nemos.basis.RaisedCosineLinearEval` :raw-html:`<br />` + :class:`~nemos.basis.RaisedCosineLinearConv` - 🟢 Eval * - **Log Spaced Raised Cosine** - .. plot:: scripts/basis_table_figs.py plot_raised_cosine_log :show-source-link: False - - `Head Direction <head_direction_reducing_dimensionality>`_ - - `EvalRaisedCosineLog <nemos.basis.basis.EvalRaisedCosineLog>`_ :raw-html:`<br />` - `ConvRaisedCosineLog <nemos.basis.basis.ConvRaisedCosineLog>`_ + - :ref:`Head Direction <head_direction_reducing_dimensionality>` + - :class:`~nemos.basis.RaisedCosineLogEval` :raw-html:`<br />` + :class:`nemos.basis.RaisedCosineLogConv` - 🔵 Conv * - **Orthogonalized Exponential Decays** - .. plot:: scripts/basis_table_figs.py plot_orth_exp_basis :show-source-link: False - - - `EvalOrthExponential <nemos.basis.basis.EvalOrthExponential>`_ :raw-html:`<br />` - `ConvOrthExponential <nemos.basis.basis.ConvOrthExponential>`_ + - :class:`~nemos.basis.OrthExponentialEval` :raw-html:`<br />` + :class:`~nemos.basis.OrthExponentialConv` - 🟢 Eval ``` diff --git a/docs/background/basis/plot_01_1D_basis_function.md b/docs/background/basis/plot_01_1D_basis_function.md index 29f32993..36ab66d6 100644 --- a/docs/background/basis/plot_01_1D_basis_function.md +++ b/docs/background/basis/plot_01_1D_basis_function.md @@ -156,7 +156,7 @@ Convolution is performed in "valid" mode, and then NaN-padded. The default behav is padding left, which makes the output feature causal. This is why the first half of the `conv_feature` is full of NaNs and appears as white. If you want to learn more about convolutions, as well as how and when to change defaults -check out the tutorial on [1D convolutions](plot_03_1D_convolution). +check out the tutorial on [1D convolutions](convolution_background). ::: diff --git a/docs/conf.py b/docs/conf.py index f4d73d48..2e752238 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -123,7 +123,11 @@ "logo": { "image_light": "_static/NeMoS_Logo_CMYK_Full.svg", "image_dark": "_static/NeMoS_Logo_CMYK_White.svg", - } + }, + "secondary_sidebar_items": { + "**": ["page-toc", "sourcelink"], + "background/basis/README": [], + }, } html_sidebars = { diff --git a/docs/scripts/basis_table_figs.py b/docs/scripts/basis_table_figs.py index 721f6635..3a442c6e 100644 --- a/docs/scripts/basis_table_figs.py +++ b/docs/scripts/basis_table_figs.py @@ -24,7 +24,7 @@ def plot_basis(cls): cls_params = cls._get_param_names() new_kwargs = trim_kwargs(cls, KWARGS.copy(), {cls.__name__: cls_params}) bas = cls(**new_kwargs) - fig, ax = plt.subplots(1, 1, figsize=(5, 2.5)) + fig, ax = plt.subplots(1, 1, figsize=(5/4, 2.5/4)) ax.plot(*bas.evaluate_on_grid(300), lw=4) for side in ["left", "right", "top", "bottom"]: ax.spines[side].set_visible(False) From 09e0c8e419cfc75a67cc69a3e14f2ea16f687bd0 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Wed, 4 Dec 2024 16:39:24 -0500 Subject: [PATCH 12/21] use plot directive for thumbnail --- docs/background/README.md | 9 ++++++--- docs/background/basis/README.md | 6 ++++++ docs/scripts/basis_table_figs.py | 3 +-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/background/README.md b/docs/background/README.md index 530c454a..f67f4eda 100644 --- a/docs/background/README.md +++ b/docs/background/README.md @@ -33,9 +33,12 @@ plot_00_conceptual_intro.md :::{grid-item-card} -<figure> -<img src="../plot_directive/scripts/basis_table_figs_plot_raised_cosine_linear.png" style="height: 100px", alt="Basis Functions"/> -</figure> +```{eval-rst} + +.. plot:: scripts/basis_table_figs.py plot_raised_cosine_linear + :show-source-link: False + :height: 100px +``` ```{toctree} :maxdepth: 2 diff --git a/docs/background/basis/README.md b/docs/background/basis/README.md index 60789b5c..bec07e73 100644 --- a/docs/background/basis/README.md +++ b/docs/background/basis/README.md @@ -19,6 +19,7 @@ * - **B-Spline** - .. plot:: scripts/basis_table_figs.py plot_bspline :show-source-link: False + :height: 80px - :ref:`Grid cells <grid_cells_nemos>` - :class:`~nemos.basis.BSplineEval` :raw-html:`<br />` :class:`~nemos.basis.BSplineConv` @@ -26,6 +27,7 @@ * - **Cyclic B-Spline** - .. plot:: scripts/basis_table_figs.py plot_cyclic_bspline :show-source-link: False + :height: 80px - :ref:`Place cells <basis_eval_place_cells>` - :class:`~nemos.basis.CyclicBSplineEval` :raw-html:`<br />` :class:`~nemos.basis.CyclicBSplineConv` @@ -33,6 +35,7 @@ * - **M-Spline** - .. plot:: scripts/basis_table_figs.py plot_mspline :show-source-link: False + :height: 80px - :ref:`Place cells <basis_eval_place_cells>` - :class:`~nemos.basis.MSplineEval` :raw-html:`<br />` :class:`~nemos.basis.MSplineConv` @@ -40,6 +43,7 @@ * - **Linearly Spaced Raised Cosine** - .. plot:: scripts/basis_table_figs.py plot_raised_cosine_linear :show-source-link: False + :height: 80px - - :class:`~nemos.basis.RaisedCosineLinearEval` :raw-html:`<br />` :class:`~nemos.basis.RaisedCosineLinearConv` @@ -47,6 +51,7 @@ * - **Log Spaced Raised Cosine** - .. plot:: scripts/basis_table_figs.py plot_raised_cosine_log :show-source-link: False + :height: 80px - :ref:`Head Direction <head_direction_reducing_dimensionality>` - :class:`~nemos.basis.RaisedCosineLogEval` :raw-html:`<br />` :class:`nemos.basis.RaisedCosineLogConv` @@ -54,6 +59,7 @@ * - **Orthogonalized Exponential Decays** - .. plot:: scripts/basis_table_figs.py plot_orth_exp_basis :show-source-link: False + :height: 80px - - :class:`~nemos.basis.OrthExponentialEval` :raw-html:`<br />` :class:`~nemos.basis.OrthExponentialConv` diff --git a/docs/scripts/basis_table_figs.py b/docs/scripts/basis_table_figs.py index 3a442c6e..f60bed8c 100644 --- a/docs/scripts/basis_table_figs.py +++ b/docs/scripts/basis_table_figs.py @@ -1,4 +1,3 @@ -import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np @@ -24,7 +23,7 @@ def plot_basis(cls): cls_params = cls._get_param_names() new_kwargs = trim_kwargs(cls, KWARGS.copy(), {cls.__name__: cls_params}) bas = cls(**new_kwargs) - fig, ax = plt.subplots(1, 1, figsize=(5/4, 2.5/4)) + fig, ax = plt.subplots(1, 1, figsize=(5, 2.5)) ax.plot(*bas.evaluate_on_grid(300), lw=4) for side in ["left", "right", "top", "bottom"]: ax.spines[side].set_visible(False) From 57e2bd2e91867ebfaf94927fb540a4f33f3acc54 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Thu, 5 Dec 2024 09:27:03 -0500 Subject: [PATCH 13/21] fixed description of basis --- docs/background/basis/plot_01_1D_basis_function.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/background/basis/plot_01_1D_basis_function.md b/docs/background/basis/plot_01_1D_basis_function.md index 36ab66d6..0ccbc611 100644 --- a/docs/background/basis/plot_01_1D_basis_function.md +++ b/docs/background/basis/plot_01_1D_basis_function.md @@ -47,10 +47,10 @@ warnings.filterwarnings( ## Defining a 1D Basis Object We'll start by defining a 1D basis function object of the type [`MSplineEval`](nemos.basis.MSplineEval). -The hyperparameters required to initialize this class are: +The hyperparameters needed to initialize this class are: -- The number of basis functions, which should be a positive integer. -- The order of the spline, which should be an integer greater than 1. +- The number of basis functions, which should be a positive integer (required). +- The order of the spline, which should be an integer greater than 1 (optional, default 4 for a cubic spline). ```{code-cell} ipython3 import matplotlib.pylab as plt @@ -107,11 +107,12 @@ print(path.resolve(), path.exists()) ``` ## Feature Computation -The bases in the `nemos.basis` module can be grouped into two categories: +All bases in the `nemos.basis` module perform a transformation of one or more time series into a set of features. This operation is always carried out by the method [`compute_features`](nemos.basis._basis.Basis.compute_features). +We can be group the bases into two categories depending on the type of transformation that [`compute_features`](nemos.basis._basis.Basis.compute_features) applies: -1. **Evaluation Bases**: These bases use the [`compute_features`](nemos.basis._basis.Basis.compute_features) method to evaluate the basis directly, applying a non-linear transformation to the input. Classes in this category have names starting with "Eval," such as `BSplineEval`. +1. **Evaluation Bases**: These bases use the [`compute_features`](nemos.basis._basis.Basis.compute_features) method to evaluate the basis directly, applying a non-linear transformation to the input. Classes in this category have names ends with "Eval," such as `BSplineEval`. -2. **Convolution Bases**: These bases use the [`compute_features`](nemos.basis._basis.Basis.compute_features) method to convolve the input with a kernel of basis elements, using a `window_size` specified by the user. Classes in this category have names starting with "Conv," such as `BSplineConv`. +2. **Convolution Bases**: These bases use the [`compute_features`](nemos.basis._basis.Basis.compute_features) method to convolve the input with a kernel of basis elements, using a `window_size` specified by the user. Classes in this category have names ending with "Conv", such as `BSplineConv`. Let's see how this two modalities operate. From ddc357bfbb3dc59b1a27cacece2986c812b7fe73 Mon Sep 17 00:00:00 2001 From: "William F. Broderick" <billbrod@gmail.com> Date: Wed, 11 Dec 2024 11:13:04 -0500 Subject: [PATCH 14/21] tweak text in plot 1d --- .../basis/plot_01_1D_basis_function.md | 57 ++++++------------- 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/docs/background/basis/plot_01_1D_basis_function.md b/docs/background/basis/plot_01_1D_basis_function.md index e23d15d8..31131bf2 100644 --- a/docs/background/basis/plot_01_1D_basis_function.md +++ b/docs/background/basis/plot_01_1D_basis_function.md @@ -46,7 +46,7 @@ warnings.filterwarnings( ## Defining a 1D Basis Object -We'll start by defining a 1D basis function object of the type [`MSplineEval`](nemos.basis.MSplineEval). +We'll start by defining a 1D basis function object of the type [`BSplineEval`](nemos.basis.BSplineEval). The hyperparameters needed to initialize this class are: - The number of basis functions, which should be a positive integer (required). @@ -106,26 +106,25 @@ if path.exists(): print(path.resolve(), path.exists()) ``` -## Feature Computation +## Computing Features All bases in the `nemos.basis` module perform a transformation of one or more time series into a set of features. This operation is always carried out by the method [`compute_features`](nemos.basis._basis.Basis.compute_features). -We can be group the bases into two categories depending on the type of transformation that [`compute_features`](nemos.basis._basis.Basis.compute_features) applies: +We can group the bases into two categories depending on the type of transformation that [`compute_features`](nemos.basis._basis.Basis.compute_features) applies: -1. **Evaluation Bases**: These bases use the [`compute_features`](nemos.basis._basis.Basis.compute_features) method to evaluate the basis directly, applying a non-linear transformation to the input. Classes in this category have names ends with "Eval," such as `BSplineEval`. +1. **Evaluation Bases**: These bases use `compute_features` to evaluate the basis directly, applying a non-linear transformation to the input. Classes in this category have names ending with "Eval," such as `BSplineEval`. -2. **Convolution Bases**: These bases use the [`compute_features`](nemos.basis._basis.Basis.compute_features) method to convolve the input with a kernel of basis elements, using a `window_size` specified by the user. Classes in this category have names ending with "Conv", such as `BSplineConv`. +2. **Convolution Bases**: These bases use `compute_features` to convolve the input with a kernel of basis elements, using a `window_size` specified by the user. Classes in this category have names ending with "Conv", such as `BSplineConv`. - -Let's see how this two modalities operate. +Let's see how these two categories operate: ```{code-cell} ipython3 -eval_mode = nmo.basis.MSplineEval(n_basis_funcs=n_basis) -conv_mode = nmo.basis.MSplineConv(n_basis_funcs=n_basis, window_size=100) +eval_mode = nmo.basis.BSplineEval(n_basis_funcs=n_basis) +conv_mode = nmo.basis.BSplineConv(n_basis_funcs=n_basis, window_size=100) # define an input angles = np.linspace(0, np.pi*4, 201) y = np.cos(angles) -# compute features in the two modalities +# compute features eval_feature = eval_mode.compute_features(y) conv_feature = conv_mode.compute_features(y) @@ -162,15 +161,17 @@ check out the tutorial on [1D convolutions](convolution_background). ::: -Plotting the Basis Function Elements: +Plotting the Basis Function Elements -------------------------------------- We suggest visualizing the basis post-instantiation by evaluating each element on a set of equi-spaced sample points and then plotting the result. The method [`Basis.evaluate_on_grid`](nemos.basis._basis.Basis.evaluate_on_grid) is designed for this, as it generates and returns -the equi-spaced samples along with the evaluated basis functions. The benefits of using Basis.evaluate_on_grid become -particularly evident when working with multidimensional basis functions. You can find more details and visual -background in the -[2D basis elements plotting section](plotting-2d-additive-basis-elements). +the equi-spaced samples along with the evaluated basis functions. + +:::{admonition} Note +The array returned by `evaluate_on_grid(n_samples)` is the same as the kernel that is used by the Conv bases initialized with `window_sizes=n_samples`! + +::: ```{code-cell} ipython3 # Call evaluate on grid on 100 sample points to generate samples and evaluate the basis at those samples @@ -184,12 +185,13 @@ plt.plot(equispaced_samples, eval_basis) plt.show() ``` +The benefits of using `evaluate_on_grid` become particularly evident when working with multidimensional basis functions. You can find more details in the [2D basis elements plotting section](plotting-2d-additive-basis-elements). ## Setting the basis support (Eval only) Sometimes, it is useful to restrict the basis to a fixed range. This can help manage outliers or ensure that your basis covers the same range across multiple experimental sessions. You can specify a range for the support of your basis by setting the `bounds` -parameter at initialization of "Eval" type basis (it doesn't make sense for convolutions). +parameter at initialization of Eval bases. Evaluating the basis at any sample outside the bounds will result in a NaN. @@ -215,26 +217,3 @@ axs[1].plot(samples, bspline_range.compute_features(samples), color="tomato") axs[1].set_title("bounds=[0.2, 0.8]") plt.tight_layout() ``` - -Other Basis Types ------------------ -Each basis type may necessitate specific hyperparameters for instantiation. For a comprehensive description, -please refer to the [API Guide](nemos_basis). After instantiation, all classes -share the same syntax for basis evaluation. The following is an example of how to instantiate and -evaluate a log-spaced cosine raised function basis. - - -```{code-cell} ipython3 -# Instantiate the basis noting that the `RaisedCosineLog` basis does not require an `order` parameter -raised_cosine_log = nmo.basis.RaisedCosineLogEval(n_basis_funcs=10, width=1.5, time_scaling=50) - -# Evaluate the raised cosine basis at the equi-spaced sample points -# (same method in all Basis elements) -samples, eval_basis = raised_cosine_log.evaluate_on_grid(100) - -# Plot the evaluated log-spaced raised cosine basis -plt.figure() -plt.title(f"Log-spaced Raised Cosine basis with {eval_basis.shape[1]} elements") -plt.plot(samples, eval_basis) -plt.show() -``` From e384d10ecbccb801a280eb49831501c20055cf21 Mon Sep 17 00:00:00 2001 From: "William F. Broderick" <billbrod@gmail.com> Date: Wed, 11 Dec 2024 11:13:10 -0500 Subject: [PATCH 15/21] try to add summary to plot 2d --- docs/background/basis/plot_02_ND_basis_function.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/background/basis/plot_02_ND_basis_function.md b/docs/background/basis/plot_02_ND_basis_function.md index 8bb8015e..828e0ea8 100644 --- a/docs/background/basis/plot_02_ND_basis_function.md +++ b/docs/background/basis/plot_02_ND_basis_function.md @@ -51,10 +51,9 @@ combination of some multidimensional basis elements. In this document, we introduce two strategies for defining a high-dimensional basis function by combining two lower-dimensional bases. We refer to these strategies as "addition" and "multiplication" of bases, -and the resulting basis objects will be referred to as additive or multiplicative basis respectively. +and the resulting basis objects will be referred to as additive or multiplicative basis respectively: additive bases have their component bases operate *independently*, whereas multiplicative bases take the *outer product*. And these composite basis objects can be constructed using other composite bases, so that you can combine them as much as you'd like! - -Consider we have two inputs $\mathbf{x} \in \mathbb{R}^N,\; \mathbf{y}\in \mathbb{R}^M$. +More precisely, let's say we have two inputs $\mathbf{x} \in \mathbb{R}^N,\; \mathbf{y}\in \mathbb{R}^M$. Let's say we've defined two basis functions for these inputs: - $ [ a_0 (\mathbf{x}), ..., a_{k-1} (\mathbf{x}) ] $ for $\mathbf{x}$ @@ -106,6 +105,7 @@ In the subsequent sections, we will: 1. Demonstrate the definition, evaluation, and visualization of 2D additive and multiplicative bases. 2. Illustrate how to iteratively apply addition and multiplication operations to extend to dimensions beyond two. +(composite_basis_2d)= ## 2D Basis Functions Consider an instance where we want to capture a neuron's response to an animal's position within a given arena. From a1e6ecd39e140053013a0da34b3d48e69423859b Mon Sep 17 00:00:00 2001 From: "William F. Broderick" <billbrod@gmail.com> Date: Wed, 11 Dec 2024 11:14:43 -0500 Subject: [PATCH 16/21] correct filename typo --- src/nemos/_inspect_utils/{inpsect_utils.py => inspect_utils.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/nemos/_inspect_utils/{inpsect_utils.py => inspect_utils.py} (100%) diff --git a/src/nemos/_inspect_utils/inpsect_utils.py b/src/nemos/_inspect_utils/inspect_utils.py similarity index 100% rename from src/nemos/_inspect_utils/inpsect_utils.py rename to src/nemos/_inspect_utils/inspect_utils.py From acda0f24e4c5f94ed0ed99e13befae68cba432fb Mon Sep 17 00:00:00 2001 From: "William F. Broderick" <billbrod@gmail.com> Date: Wed, 11 Dec 2024 11:26:19 -0500 Subject: [PATCH 17/21] small fixes in basis/readme --- docs/background/basis/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/background/basis/README.md b/docs/background/basis/README.md index bec07e73..74e9dde6 100644 --- a/docs/background/basis/README.md +++ b/docs/background/basis/README.md @@ -54,7 +54,7 @@ :height: 80px - :ref:`Head Direction <head_direction_reducing_dimensionality>` - :class:`~nemos.basis.RaisedCosineLogEval` :raw-html:`<br />` - :class:`nemos.basis.RaisedCosineLogConv` + :class:`~nemos.basis.RaisedCosineLogConv` - 🔵 Conv * - **Orthogonalized Exponential Decays** - .. plot:: scripts/basis_table_figs.py plot_orth_exp_basis @@ -88,12 +88,12 @@ Instead of tackling the hard problem of learning an unknown function $f(x)$ dire ## Basis in NeMoS -NeMoS provides a variety of basis functions (see the [table](table_basis) above). For each basis type, there are two dedicated classes of objects, corresponding to the two key uses described in the overview: +NeMoS provides a variety of basis functions (see the [table](table_basis) above). For each basis type, there are two dedicated classes of objects, corresponding to the two uses described above: -- **Eval-basis objects**: For representing non-linear mappings between task variables and outputs. These objects are identified by names starting with `Eval`. -- **Conv-basis objects**: For linear temporal effects. These objects are identified by names starting with `Conv`. +- **Eval basis objects**: For representing non-linear mappings between task variables and outputs. These objects all have names ending with `Eval`. +- **Conv basis objects**: For linear temporal effects. These objects all have names ending with `Conv`. -`Eval` and `Conv` objects can be combined to construct multi-dimensional basis functions, enabling complex feature construction. +`Eval` and `Conv` objects can be combined to construct multi-dimensional basis functions, enabling [complex feature construction](composing_basis_function). ## Learn More @@ -125,4 +125,4 @@ plot_02_ND_basis_function.md ``` ::: -:::: \ No newline at end of file +:::: From 387aeff5692eaebe2400546bfb29238380143e29 Mon Sep 17 00:00:00 2001 From: Edoardo Balzani <edoardo.balzani87@gmail.com> Date: Wed, 11 Dec 2024 23:09:41 -0500 Subject: [PATCH 18/21] Update docs/background/basis/README.md Co-authored-by: William F. Broderick <billbrod@gmail.com> --- docs/background/basis/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/background/basis/README.md b/docs/background/basis/README.md index 74e9dde6..11d7a7ca 100644 --- a/docs/background/basis/README.md +++ b/docs/background/basis/README.md @@ -83,7 +83,7 @@ $$ Here, $\approx$ means "approximately equal". -Instead of tackling the hard problem of learning an unknown function $f(x)$ directly, we reduce it to the simpler task of learning the weights $\{\alpha_i\}$. +Instead of tackling the hard problem of learning an unknown function $f(x)$ directly, we reduce it to the simpler task of learning the weights $\{\alpha_i\}$. This preserves convexity, resulting in a much simpler optimization problem. ## Basis in NeMoS From 0fa80d443d6ebc9d7c4df101b8d483c21357cd4c Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Thu, 12 Dec 2024 00:00:16 -0500 Subject: [PATCH 19/21] fix paths and module name --- docs/background/README.md | 2 +- docs/background/basis/README.md | 30 +++-- .../basis/plot_01_1D_basis_function.md | 24 ---- .../basis/plot_02_ND_basis_function.md | 22 ---- docs/background/plot_03_1D_convolution.md | 2 +- docs/how_to_guide/plot_02_glm_demo.md | 2 +- docs/how_to_guide/plot_03_population_glm.md | 2 +- docs/how_to_guide/plot_04_batch_glm.md | 2 +- .../plot_05_sklearn_pipeline_cv_demo.md | 2 +- docs/how_to_guide/plot_06_glm_pytree.md | 2 +- docs/scripts/basis_figs.py | 108 ++++++++++++++++++ docs/scripts/basis_table_figs.py | 56 --------- docs/tutorials/plot_01_current_injection.md | 2 +- docs/tutorials/plot_02_head_direction.md | 2 +- docs/tutorials/plot_03_grid_cells.md | 2 +- docs/tutorials/plot_04_v1_cells.md | 2 +- docs/tutorials/plot_05_place_cells.md | 2 +- docs/tutorials/plot_06_calcium_imaging.md | 2 +- src/nemos/_inspect_utils/__init__.py | 2 +- 19 files changed, 140 insertions(+), 128 deletions(-) create mode 100644 docs/scripts/basis_figs.py delete mode 100644 docs/scripts/basis_table_figs.py diff --git a/docs/background/README.md b/docs/background/README.md index f67f4eda..3a21d06d 100644 --- a/docs/background/README.md +++ b/docs/background/README.md @@ -35,7 +35,7 @@ plot_00_conceptual_intro.md ```{eval-rst} -.. plot:: scripts/basis_table_figs.py plot_raised_cosine_linear +.. plot:: scripts/basis_figs.py plot_raised_cosine_linear :show-source-link: False :height: 100px ``` diff --git a/docs/background/basis/README.md b/docs/background/basis/README.md index 74e9dde6..72a8a598 100644 --- a/docs/background/basis/README.md +++ b/docs/background/basis/README.md @@ -17,7 +17,7 @@ - **Evaluation/Convolution** - **Preferred Mode** * - **B-Spline** - - .. plot:: scripts/basis_table_figs.py plot_bspline + - .. plot:: scripts/basis_figs.py plot_bspline :show-source-link: False :height: 80px - :ref:`Grid cells <grid_cells_nemos>` @@ -25,7 +25,7 @@ :class:`~nemos.basis.BSplineConv` - 🟢 Eval * - **Cyclic B-Spline** - - .. plot:: scripts/basis_table_figs.py plot_cyclic_bspline + - .. plot:: scripts/basis_figs.py plot_cyclic_bspline :show-source-link: False :height: 80px - :ref:`Place cells <basis_eval_place_cells>` @@ -33,7 +33,7 @@ :class:`~nemos.basis.CyclicBSplineConv` - 🟢 Eval * - **M-Spline** - - .. plot:: scripts/basis_table_figs.py plot_mspline + - .. plot:: scripts/basis_figs.py plot_mspline :show-source-link: False :height: 80px - :ref:`Place cells <basis_eval_place_cells>` @@ -41,7 +41,7 @@ :class:`~nemos.basis.MSplineConv` - 🟢 Eval * - **Linearly Spaced Raised Cosine** - - .. plot:: scripts/basis_table_figs.py plot_raised_cosine_linear + - .. plot:: scripts/basis_figs.py plot_raised_cosine_linear :show-source-link: False :height: 80px - @@ -49,7 +49,7 @@ :class:`~nemos.basis.RaisedCosineLinearConv` - 🟢 Eval * - **Log Spaced Raised Cosine** - - .. plot:: scripts/basis_table_figs.py plot_raised_cosine_log + - .. plot:: scripts/basis_figs.py plot_raised_cosine_log :show-source-link: False :height: 80px - :ref:`Head Direction <head_direction_reducing_dimensionality>` @@ -57,7 +57,7 @@ :class:`~nemos.basis.RaisedCosineLogConv` - 🔵 Conv * - **Orthogonalized Exponential Decays** - - .. plot:: scripts/basis_table_figs.py plot_orth_exp_basis + - .. plot:: scripts/basis_figs.py plot_orth_exp_basis :show-source-link: False :height: 80px - @@ -101,9 +101,12 @@ NeMoS provides a variety of basis functions (see the [table](table_basis) above) :::{grid-item-card} -<figure> -<img src="../../_static/thumbnails/background/plot_01_1D_basis_function.svg" style="height: 100px", alt="One-Dimensional Basis."/> -</figure> +```{eval-rst} + +.. plot:: scripts/basis_figs.py plot_1d_basis_thumbnail + :show-source-link: False + :height: 100px +``` ```{toctree} :maxdepth: 2 @@ -114,9 +117,12 @@ plot_01_1D_basis_function.md :::{grid-item-card} -<figure> -<img src="../../_static/thumbnails/background/plot_02_ND_basis_function.svg" style="height: 100px", alt="N-Dimensional Basis."/> -</figure> +```{eval-rst} + +.. plot:: scripts/basis_figs.py plot_nd_basis_thumbnail + :show-source-link: False + :height: 100px +``` ```{toctree} :maxdepth: 2 diff --git a/docs/background/basis/plot_01_1D_basis_function.md b/docs/background/basis/plot_01_1D_basis_function.md index 31131bf2..d4ac0070 100644 --- a/docs/background/basis/plot_01_1D_basis_function.md +++ b/docs/background/basis/plot_01_1D_basis_function.md @@ -81,30 +81,6 @@ plt.plot(x, y, lw=2) plt.title("B-Spline Basis") ``` -```{code-cell} ipython3 -:tags: [hide-input] - -# save image for thumbnail -from pathlib import Path -import os - -root = os.environ.get("READTHEDOCS_OUTPUT") -if root: - path = Path(root) / "html/_static/thumbnails/background" -# if local store in ../_build/html/... -else: - path = Path("../../_build/html/_static/thumbnails/background") - -# make sure the folder exists if run from build -if root or Path("../../_build/html/_static").exists(): - path.mkdir(parents=True, exist_ok=True) - -if path.exists(): - fig.savefig(path / "plot_01_1D_basis_function.svg") - - -print(path.resolve(), path.exists()) -``` ## Computing Features All bases in the `nemos.basis` module perform a transformation of one or more time series into a set of features. This operation is always carried out by the method [`compute_features`](nemos.basis._basis.Basis.compute_features). diff --git a/docs/background/basis/plot_02_ND_basis_function.md b/docs/background/basis/plot_02_ND_basis_function.md index 828e0ea8..9efeff40 100644 --- a/docs/background/basis/plot_02_ND_basis_function.md +++ b/docs/background/basis/plot_02_ND_basis_function.md @@ -292,28 +292,6 @@ axs[2, 1].set_xlabel('y-coord') plt.tight_layout() ``` -```{code-cell} ipython3 -:tags: [hide-input] - -# save image for thumbnail -from pathlib import Path -import os - -root = os.environ.get("READTHEDOCS_OUTPUT") -if root: - path = Path(root) / "html/_static/thumbnails/background" -# if local store in ../_build/html/... -else: - path = Path("../../_build/html/_static/thumbnails/background") - -# make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): - path.mkdir(parents=True, exist_ok=True) - -if path.exists(): - fig.savefig(path / "plot_02_ND_basis_function.svg") -``` - :::{note} Basis objects of different types can be combined through multiplication or addition. This feature is particularly useful when one of the axes represents a periodic variable and another is non-periodic. diff --git a/docs/background/plot_03_1D_convolution.md b/docs/background/plot_03_1D_convolution.md index 1967148d..a237a0f7 100644 --- a/docs/background/plot_03_1D_convolution.md +++ b/docs/background/plot_03_1D_convolution.md @@ -179,7 +179,7 @@ else: path = Path("../_build/html/_static/thumbnails/background") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/how_to_guide/plot_02_glm_demo.md b/docs/how_to_guide/plot_02_glm_demo.md index 83591da4..511a9d8c 100644 --- a/docs/how_to_guide/plot_02_glm_demo.md +++ b/docs/how_to_guide/plot_02_glm_demo.md @@ -450,7 +450,7 @@ else: path = Path("../_build/html/_static/thumbnails/how_to_guide") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/how_to_guide/plot_03_population_glm.md b/docs/how_to_guide/plot_03_population_glm.md index 7c27acd5..a129a65e 100644 --- a/docs/how_to_guide/plot_03_population_glm.md +++ b/docs/how_to_guide/plot_03_population_glm.md @@ -231,7 +231,7 @@ else: path = Path("../_build/html/_static/thumbnails/how_to_guide") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/how_to_guide/plot_04_batch_glm.md b/docs/how_to_guide/plot_04_batch_glm.md index 217de9ba..36bd31b8 100644 --- a/docs/how_to_guide/plot_04_batch_glm.md +++ b/docs/how_to_guide/plot_04_batch_glm.md @@ -208,7 +208,7 @@ else: path = Path("../_build/html/_static/thumbnails/how_to_guide") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/how_to_guide/plot_05_sklearn_pipeline_cv_demo.md b/docs/how_to_guide/plot_05_sklearn_pipeline_cv_demo.md index 166a5cbb..9f5a9652 100644 --- a/docs/how_to_guide/plot_05_sklearn_pipeline_cv_demo.md +++ b/docs/how_to_guide/plot_05_sklearn_pipeline_cv_demo.md @@ -435,7 +435,7 @@ else: path = Path("../_build/html/_static/thumbnails/how_to_guide") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/how_to_guide/plot_06_glm_pytree.md b/docs/how_to_guide/plot_06_glm_pytree.md index e5949f58..4c82be40 100644 --- a/docs/how_to_guide/plot_06_glm_pytree.md +++ b/docs/how_to_guide/plot_06_glm_pytree.md @@ -261,7 +261,7 @@ else: path = Path("../_build/html/_static/thumbnails/how_to_guide") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/scripts/basis_figs.py b/docs/scripts/basis_figs.py new file mode 100644 index 00000000..5113a577 --- /dev/null +++ b/docs/scripts/basis_figs.py @@ -0,0 +1,108 @@ +import matplotlib.pyplot as plt +import numpy as np + +import nemos as nmo +from nemos._inspect_utils.inspect_utils import trim_kwargs + +plt.rcParams.update( + { + "figure.dpi": 300, + } +) + +KWARGS = dict( + n_basis_funcs=10, + decay_rates=np.arange(1, 10 + 1), + enforce_decay_to_zero=True, + order=4, + width=2, +) + + +def plot_basis(cls): + cls_params = cls._get_param_names() + new_kwargs = trim_kwargs(cls, KWARGS.copy(), {cls.__name__: cls_params}) + bas = cls(**new_kwargs) + fig, ax = plt.subplots(1, 1, figsize=(5, 2.5)) + ax.plot(*bas.evaluate_on_grid(300), lw=4) + for side in ["left", "right", "top", "bottom"]: + ax.spines[side].set_visible(False) + ax.set_xticks([]) + ax.set_yticks([]) + plt.subplots_adjust(left=0.02, right=0.98, top=0.98, bottom=0.02) + + +def plot_raised_cosine_linear(): + plot_basis(nmo.basis.RaisedCosineLinearEval) + + +def plot_raised_cosine_log(): + plot_basis(nmo.basis.RaisedCosineLogEval) + + +def plot_mspline(): + plot_basis(nmo.basis.MSplineEval) + + +def plot_bspline(): + plot_basis(nmo.basis.BSplineEval) + + +def plot_cyclic_bspline(): + plot_basis(nmo.basis.CyclicBSplineEval) + + +def plot_orth_exp_basis(): + plot_basis(nmo.basis.OrthExponentialEval) + + +def plot_nd_basis_thumbnail(): + a_basis = nmo.basis.MSplineEval(n_basis_funcs=15, order=3) + b_basis = nmo.basis.RaisedCosineLogEval(n_basis_funcs=14) + prod_basis = a_basis * b_basis + + x_coord = np.linspace(0, 1, 1000) + y_coord = np.linspace(0, 1, 1000) + + X, Y, Z = prod_basis.evaluate_on_grid(200, 200) + + # basis element pairs + element_pairs = [[0, 0], [5, 1], [10, 5]] + + # plot the 1D basis element and their product + fig, axs = plt.subplots(3,3,figsize=(8, 6)) + cc = 0 + for i, j in element_pairs: + # plot the element form a_basis + axs[cc, 0].plot(x_coord, a_basis.compute_features(x_coord), "grey", alpha=.3) + axs[cc, 0].plot(x_coord, a_basis.compute_features(x_coord)[:, i], "b") + axs[cc, 0].set_title(f"$a_{{{i}}}(x)$",color='b') + + # plot the element form b_basis + axs[cc, 1].plot(y_coord, b_basis.compute_features(y_coord), "grey", alpha=.3) + axs[cc, 1].plot(y_coord, b_basis.compute_features(y_coord)[:, j], "b") + axs[cc, 1].set_title(f"$b_{{{j}}}(y)$",color='b') + + # select & plot the corresponding product basis element + k = i * b_basis.n_basis_funcs + j + axs[cc, 2].contourf(X, Y, Z[:, :, k], cmap='Blues') + axs[cc, 2].set_title(fr"$A_{{{k}}}(x,y) = a_{{{i}}}(x) \cdot b_{{{j}}}(y)$", color='b') + axs[cc, 2].set_xlabel('x-coord') + axs[cc, 2].set_ylabel('y-coord') + axs[cc, 2].set_aspect("equal") + + cc += 1 + axs[2, 0].set_xlabel('x-coord') + axs[2, 1].set_xlabel('y-coord') + + plt.tight_layout() + +def plot_1d_basis_thumbnail(): + order = 4 + n_basis = 10 + bspline = nmo.basis.BSplineEval(n_basis_funcs=n_basis, order=order) + x, y = bspline.evaluate_on_grid(100) + + plt.figure(figsize=(5, 3)) + plt.plot(x, y, lw=2) + plt.title("B-Spline Basis") \ No newline at end of file diff --git a/docs/scripts/basis_table_figs.py b/docs/scripts/basis_table_figs.py deleted file mode 100644 index f60bed8c..00000000 --- a/docs/scripts/basis_table_figs.py +++ /dev/null @@ -1,56 +0,0 @@ -import matplotlib.pyplot as plt -import numpy as np - -import nemos as nmo -from nemos._inspect_utils import trim_kwargs - -plt.rcParams.update( - { - "figure.dpi": 300, - } -) - -KWARGS = dict( - n_basis_funcs=10, - decay_rates=np.arange(1, 10 + 1), - enforce_decay_to_zero=True, - order=4, - width=2, -) - - -def plot_basis(cls): - cls_params = cls._get_param_names() - new_kwargs = trim_kwargs(cls, KWARGS.copy(), {cls.__name__: cls_params}) - bas = cls(**new_kwargs) - fig, ax = plt.subplots(1, 1, figsize=(5, 2.5)) - ax.plot(*bas.evaluate_on_grid(300), lw=4) - for side in ["left", "right", "top", "bottom"]: - ax.spines[side].set_visible(False) - ax.set_xticks([]) - ax.set_yticks([]) - plt.subplots_adjust(left=0.02, right=0.98, top=0.98, bottom=0.02) - - -def plot_raised_cosine_linear(): - plot_basis(nmo.basis.RaisedCosineLinearEval) - - -def plot_raised_cosine_log(): - plot_basis(nmo.basis.RaisedCosineLogEval) - - -def plot_mspline(): - plot_basis(nmo.basis.MSplineEval) - - -def plot_bspline(): - plot_basis(nmo.basis.BSplineEval) - - -def plot_cyclic_bspline(): - plot_basis(nmo.basis.CyclicBSplineEval) - - -def plot_orth_exp_basis(): - plot_basis(nmo.basis.OrthExponentialEval) diff --git a/docs/tutorials/plot_01_current_injection.md b/docs/tutorials/plot_01_current_injection.md index bffd5a35..361f513b 100644 --- a/docs/tutorials/plot_01_current_injection.md +++ b/docs/tutorials/plot_01_current_injection.md @@ -635,7 +635,7 @@ else: path = Path("../_build/html/_static/thumbnails/tutorials") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/tutorials/plot_02_head_direction.md b/docs/tutorials/plot_02_head_direction.md index 6a44fdd7..c038c0fa 100644 --- a/docs/tutorials/plot_02_head_direction.md +++ b/docs/tutorials/plot_02_head_direction.md @@ -717,7 +717,7 @@ else: path = Path("../_build/html/_static/thumbnails/tutorials") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/tutorials/plot_03_grid_cells.md b/docs/tutorials/plot_03_grid_cells.md index 6d244f28..75659a5e 100644 --- a/docs/tutorials/plot_03_grid_cells.md +++ b/docs/tutorials/plot_03_grid_cells.md @@ -348,7 +348,7 @@ else: path = Path("../_build/html/_static/thumbnails/tutorials") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/tutorials/plot_04_v1_cells.md b/docs/tutorials/plot_04_v1_cells.md index c9faaa82..3ee0bcff 100644 --- a/docs/tutorials/plot_04_v1_cells.md +++ b/docs/tutorials/plot_04_v1_cells.md @@ -247,7 +247,7 @@ else: path = Path("../_build/html/_static/thumbnails/tutorials") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/tutorials/plot_05_place_cells.md b/docs/tutorials/plot_05_place_cells.md index 4657c0f5..9726f5cb 100644 --- a/docs/tutorials/plot_05_place_cells.md +++ b/docs/tutorials/plot_05_place_cells.md @@ -159,7 +159,7 @@ else: path = Path("../_build/html/_static/thumbnails/tutorials") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/docs/tutorials/plot_06_calcium_imaging.md b/docs/tutorials/plot_06_calcium_imaging.md index c95987a9..426f9b6a 100644 --- a/docs/tutorials/plot_06_calcium_imaging.md +++ b/docs/tutorials/plot_06_calcium_imaging.md @@ -371,7 +371,7 @@ else: path = Path("../_build/html/_static/thumbnails/tutorials") # make sure the folder exists if run from build -if root or Path("../_build/html/_static").exists(): +if root or Path("../assets/stylesheets").exists(): path.mkdir(parents=True, exist_ok=True) if path.exists(): diff --git a/src/nemos/_inspect_utils/__init__.py b/src/nemos/_inspect_utils/__init__.py index 21743bd6..0fec61ec 100644 --- a/src/nemos/_inspect_utils/__init__.py +++ b/src/nemos/_inspect_utils/__init__.py @@ -9,7 +9,7 @@ identify abstract classes, and verify method compliance in subclasses. """ -from .inpsect_utils import ( +from .inspect_utils import ( check_all_abstract_methods_compliance, get_abstract_classes, get_non_abstract_classes, From 01e6e7dc29b830d30d7a9a26271001f73a7d2ed3 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Thu, 12 Dec 2024 00:11:31 -0500 Subject: [PATCH 20/21] linted --- docs/scripts/basis_figs.py | 27 +++++++++++++++------------ tests/test_basis.py | 4 +++- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/scripts/basis_figs.py b/docs/scripts/basis_figs.py index 5113a577..af8b6701 100644 --- a/docs/scripts/basis_figs.py +++ b/docs/scripts/basis_figs.py @@ -70,33 +70,36 @@ def plot_nd_basis_thumbnail(): element_pairs = [[0, 0], [5, 1], [10, 5]] # plot the 1D basis element and their product - fig, axs = plt.subplots(3,3,figsize=(8, 6)) + fig, axs = plt.subplots(3, 3, figsize=(8, 6)) cc = 0 for i, j in element_pairs: # plot the element form a_basis - axs[cc, 0].plot(x_coord, a_basis.compute_features(x_coord), "grey", alpha=.3) + axs[cc, 0].plot(x_coord, a_basis.compute_features(x_coord), "grey", alpha=0.3) axs[cc, 0].plot(x_coord, a_basis.compute_features(x_coord)[:, i], "b") - axs[cc, 0].set_title(f"$a_{{{i}}}(x)$",color='b') + axs[cc, 0].set_title(f"$a_{{{i}}}(x)$", color="b") # plot the element form b_basis - axs[cc, 1].plot(y_coord, b_basis.compute_features(y_coord), "grey", alpha=.3) + axs[cc, 1].plot(y_coord, b_basis.compute_features(y_coord), "grey", alpha=0.3) axs[cc, 1].plot(y_coord, b_basis.compute_features(y_coord)[:, j], "b") - axs[cc, 1].set_title(f"$b_{{{j}}}(y)$",color='b') + axs[cc, 1].set_title(f"$b_{{{j}}}(y)$", color="b") # select & plot the corresponding product basis element k = i * b_basis.n_basis_funcs + j - axs[cc, 2].contourf(X, Y, Z[:, :, k], cmap='Blues') - axs[cc, 2].set_title(fr"$A_{{{k}}}(x,y) = a_{{{i}}}(x) \cdot b_{{{j}}}(y)$", color='b') - axs[cc, 2].set_xlabel('x-coord') - axs[cc, 2].set_ylabel('y-coord') + axs[cc, 2].contourf(X, Y, Z[:, :, k], cmap="Blues") + axs[cc, 2].set_title( + rf"$A_{{{k}}}(x,y) = a_{{{i}}}(x) \cdot b_{{{j}}}(y)$", color="b" + ) + axs[cc, 2].set_xlabel("x-coord") + axs[cc, 2].set_ylabel("y-coord") axs[cc, 2].set_aspect("equal") cc += 1 - axs[2, 0].set_xlabel('x-coord') - axs[2, 1].set_xlabel('y-coord') + axs[2, 0].set_xlabel("x-coord") + axs[2, 1].set_xlabel("y-coord") plt.tight_layout() + def plot_1d_basis_thumbnail(): order = 4 n_basis = 10 @@ -105,4 +108,4 @@ def plot_1d_basis_thumbnail(): plt.figure(figsize=(5, 3)) plt.plot(x, y, lw=2) - plt.title("B-Spline Basis") \ No newline at end of file + plt.title("B-Spline Basis") diff --git a/tests/test_basis.py b/tests/test_basis.py index 47db8dd0..0f4574db 100644 --- a/tests/test_basis.py +++ b/tests/test_basis.py @@ -971,7 +971,9 @@ def test_fit_kernel_shape(self, cls): ( "conv", -1, - pytest.raises(ValueError, match="`window_size` must be a positive integer"), + pytest.raises( + ValueError, match="`window_size` must be a positive integer" + ), ), ( "conv", From afdf8a8e70e8bb5f838f5dc8d8865267b1b083f2 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo <edoardo.balzani87@gmail.com> Date: Thu, 12 Dec 2024 08:31:11 -0500 Subject: [PATCH 21/21] added pages in readme subsection --- docs/background/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/background/README.md b/docs/background/README.md index 3a21d06d..435e5bdb 100644 --- a/docs/background/README.md +++ b/docs/background/README.md @@ -41,10 +41,11 @@ plot_00_conceptual_intro.md ``` ```{toctree} -:maxdepth: 2 +:maxdepth: 3 basis/README.md ``` + ::: :::{grid-item-card}