|
| 1 | +<!DOCTYPE html> |
| 2 | +<!-- |
| 3 | + This file is part of GauProS-Sandbox. |
| 4 | + https://github.com/DirkToewe/gaupros_sandbox |
| 5 | +
|
| 6 | + GauProS is free software: you can redistribute it and/or modify |
| 7 | + it under the terms of the GNU General Public License as published by |
| 8 | + the Free Software Foundation, either version 3 of the License, or |
| 9 | + (at your option) any later version. |
| 10 | +
|
| 11 | + GauProS is distributed in the hope that it will be useful, |
| 12 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + GNU General Public License for more details. |
| 15 | +
|
| 16 | + You should have received a copy of the GNU General Public License |
| 17 | + along with GauProS. If not, see <https://www.gnu.org/licenses/>. |
| 18 | +--> |
| 19 | +<html lang="en"> |
| 20 | + <head> |
| 21 | + <meta charset="utf-8"> |
| 22 | + <title>Dr. Kriger</title> |
| 23 | + <script type="text/javascript" async |
| 24 | + src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"> |
| 25 | + </script> |
| 26 | + <style media="all"> |
| 27 | + .grid-container { |
| 28 | + width : 99vw; |
| 29 | + height: auto; |
| 30 | + display: grid; |
| 31 | + grid-column-gap: 8px; |
| 32 | + grid-template-rows: 64px 1fr; |
| 33 | + grid-template-columns: 1fr 400px; |
| 34 | + grid-template-areas: |
| 35 | + 'header sidebar' |
| 36 | + 'canvas sidebar'; |
| 37 | + } |
| 38 | + .grid-header { |
| 39 | + grid-area: header; |
| 40 | + } |
| 41 | + .grid-canvas { |
| 42 | + grid-area: canvas; |
| 43 | + } |
| 44 | + .grid-sidebar { |
| 45 | + display: flex; |
| 46 | + flex-direction: column; |
| 47 | + width: 100%; |
| 48 | + grid-area: sidebar; |
| 49 | + } |
| 50 | + .fit_button { |
| 51 | + width: 100%; |
| 52 | + } |
| 53 | + .spinner_val { |
| 54 | + width: 80px |
| 55 | + } |
| 56 | + .slider_val { |
| 57 | + width: 80px |
| 58 | + } |
| 59 | + .spinner_min_max { |
| 60 | + width: 64px |
| 61 | + } |
| 62 | + #console_div { |
| 63 | + color: red; |
| 64 | + height: 100%; |
| 65 | + width: 100%; |
| 66 | + background-color: #eeeeee; |
| 67 | + } |
| 68 | + #forkongithub a { |
| 69 | + /* "Fork me on GitHub" source: |
| 70 | + * https://codepo8.github.io/css-fork-on-github-ribbon/ |
| 71 | + */ |
| 72 | + background:#000; |
| 73 | + color:#fff; |
| 74 | + text-decoration:none; |
| 75 | + font-family:arial,sans-serif; |
| 76 | + text-align:center; |
| 77 | + font-weight:bold; |
| 78 | + padding:5px 40px; |
| 79 | + font-size:1rem; |
| 80 | + line-height:2rem; |
| 81 | + position:relative; |
| 82 | + transition:0.5s; |
| 83 | + } |
| 84 | + #forkongithub a:hover { |
| 85 | + background:#c11; |
| 86 | + color:#fff; |
| 87 | + } |
| 88 | + #forkongithub a::before, |
| 89 | + #forkongithub a::after { |
| 90 | + content:""; |
| 91 | + width:100%; |
| 92 | + display:block; |
| 93 | + position:absolute; |
| 94 | + top:1px; |
| 95 | + left:0; |
| 96 | + height:1px; |
| 97 | + background:#fff; |
| 98 | + } |
| 99 | + #forkongithub a::after { |
| 100 | + bottom:1px;top:auto; |
| 101 | + } |
| 102 | + @media screen and (min-width:800px) { |
| 103 | + #forkongithub{ |
| 104 | + position:absolute; |
| 105 | + display:block; |
| 106 | + top:0; |
| 107 | + right:0; |
| 108 | + width:200px; |
| 109 | + overflow:hidden; |
| 110 | + height:200px; |
| 111 | + z-index:9999; |
| 112 | + } |
| 113 | + #forkongithub a { |
| 114 | + width:200px; |
| 115 | + position:absolute; |
| 116 | + top:60px; |
| 117 | + right:-60px; |
| 118 | + transform:rotate(45deg); |
| 119 | + -webkit-transform:rotate(45deg); |
| 120 | + -ms-transform:rotate(45deg); |
| 121 | + -moz-transform:rotate(45deg); |
| 122 | + -o-transform:rotate(45deg); |
| 123 | + box-shadow:4px 4px 10px rgba(0,0,0,0.8); |
| 124 | + } |
| 125 | + } |
| 126 | + </style> |
| 127 | + </head> |
| 128 | + <body> |
| 129 | + <span id="forkongithub"><a href="https://github.com/DirkToewe/gaupros_sandbox">Fork me on GitHub</a></span> |
| 130 | + <div class="grid-container"> |
| 131 | + <div class="grid-header"> |
| 132 | + <h1>Gaussian Process Sandbox</h1> |
| 133 | + </div> |
| 134 | + <div class="grid-canvas"> |
| 135 | + <svg id="svg_root" width="100%" height="100%" viewBox="0 0 1280 720"> |
| 136 | + <rect width="100%" height="100%" style="fill:#dddddd;"/> |
| 137 | + <polyline id="svg_curve_cov" fill="#cccccc"/> |
| 138 | + <polyline id="svg_curve_mean" stroke="black" stroke-width="0.25%" fill="none"/> |
| 139 | + <g id="svg_points"></g> |
| 140 | + </svg> |
| 141 | + </div> |
| 142 | + <div class="grid-sidebar"> |
| 143 | + <h2>Controls:</h2> |
| 144 | + <table> |
| 145 | + <tr> <th align="right">Shift + L-Click: <td align="left"> add Point |
| 146 | + <tr> <th align="right"> Left-Drag: <td align="left"> move Point |
| 147 | + <tr> <th align="right"> CTRL + L-Click: <td align="left"> Remove Point |
| 148 | + </table> |
| 149 | + |
| 150 | + <h2>Kernel:</h2> |
| 151 | + <small> |
| 152 | + <!-- $$K_{i,j} = {σ_f}^2 \exp{\left( - \frac{1}{2 \ell^2} {\lVert x_i - x_j \rVert}^p \right)} + \begin{cases}{σ_n}^2 & i = j \\ 0 & i \neq j\end{cases}$$ --> |
| 153 | + <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> |
| 154 | + <msub> |
| 155 | + <mi>K</mi> |
| 156 | + <mrow class="MJX-TeXAtom-ORD"> |
| 157 | + <mi>i</mi> |
| 158 | + <mo>,</mo> |
| 159 | + <mi>j</mi> |
| 160 | + </mrow> |
| 161 | + </msub> |
| 162 | + <mo>=</mo> |
| 163 | + <msup> |
| 164 | + <mrow class="MJX-TeXAtom-ORD"> |
| 165 | + <msub> |
| 166 | + <mrow class="MJX-TeXAtom-ORD"> |
| 167 | + <mo>σ</mo> |
| 168 | + </mrow> |
| 169 | + <mi>f</mi> |
| 170 | + </msub> |
| 171 | + </mrow> |
| 172 | + <mn>2</mn> |
| 173 | + </msup> |
| 174 | + <mi>exp</mi> |
| 175 | + <mo>⁡<!-- --></mo> |
| 176 | + <mrow class="MJX-TeXAtom-ORD"> |
| 177 | + <mrow> |
| 178 | + <mo>(</mo> |
| 179 | + <mo>−<!-- − --></mo> |
| 180 | + <mfrac> |
| 181 | + <mn>1</mn> |
| 182 | + <mrow> |
| 183 | + <mn>2</mn> |
| 184 | + <msup> |
| 185 | + <mi>ℓ<!-- ℓ --></mi> |
| 186 | + <mn>2</mn> |
| 187 | + </msup> |
| 188 | + </mrow> |
| 189 | + </mfrac> |
| 190 | + <msup> |
| 191 | + <mrow class="MJX-TeXAtom-ORD"> |
| 192 | + <mo fence="false" stretchy="false">‖<!-- ‖ --></mo> |
| 193 | + <msub> |
| 194 | + <mi>x</mi> |
| 195 | + <mi>i</mi> |
| 196 | + </msub> |
| 197 | + <mo>−<!-- − --></mo> |
| 198 | + <msub> |
| 199 | + <mi>x</mi> |
| 200 | + <mi>j</mi> |
| 201 | + </msub> |
| 202 | + <mo fence="false" stretchy="false">‖<!-- ‖ --></mo> |
| 203 | + </mrow> |
| 204 | + <mi>p</mi> |
| 205 | + </msup> |
| 206 | + <mo>)</mo> |
| 207 | + </mrow> |
| 208 | + </mrow> |
| 209 | + <mo>+</mo> |
| 210 | + <mrow> |
| 211 | + <mo>{</mo> |
| 212 | + <mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false"> |
| 213 | + <mtr> |
| 214 | + <mtd> |
| 215 | + <msup> |
| 216 | + <mrow class="MJX-TeXAtom-ORD"> |
| 217 | + <msub> |
| 218 | + <mrow class="MJX-TeXAtom-ORD"> |
| 219 | + <mo>σ</mo> |
| 220 | + </mrow> |
| 221 | + <mi>n</mi> |
| 222 | + </msub> |
| 223 | + </mrow> |
| 224 | + <mn>2</mn> |
| 225 | + </msup> |
| 226 | + </mtd> |
| 227 | + <mtd> |
| 228 | + <mi>i</mi> |
| 229 | + <mo>=</mo> |
| 230 | + <mi>j</mi> |
| 231 | + </mtd> |
| 232 | + </mtr> |
| 233 | + <mtr> |
| 234 | + <mtd> |
| 235 | + <mn>0</mn> |
| 236 | + </mtd> |
| 237 | + <mtd> |
| 238 | + <mi>i</mi> |
| 239 | + <mo>≠<!-- ≠ --></mo> |
| 240 | + <mi>j</mi> |
| 241 | + </mtd> |
| 242 | + </mtr> |
| 243 | + </mtable> |
| 244 | + <mo fence="true" stretchy="true" symmetric="true"></mo> |
| 245 | + </mrow> |
| 246 | + </math> |
| 247 | + </small> |
| 248 | + |
| 249 | + <p><table> |
| 250 | + <tr> |
| 251 | + <td><td><td><td colspan="2" align="center">(Optimization) |
| 252 | + <tr> |
| 253 | + <th><th><th><th>Min<th>Max |
| 254 | + <tr> |
| 255 | + <th><label for="shift_spinner"><b>E[y]</b></label> |
| 256 | + <td><input id ="shift_spinner" overflow="auto" class="spinner_val" type="number" min="-1e3" max="2e3" step="1" value="360"/> |
| 257 | + <td><input id ="shift_slider" class="slider_val" type="range" min="-1e3" max="2e3" step="1" value="360"/> |
| 258 | + <td><input id ="shift_spinner_min" overflow="auto" class="spinner_min_max" type="number" min="-1e3" max="2e3" step="1" value="-1e3"/> |
| 259 | + <td><input id ="shift_spinner_max" overflow="auto" class="spinner_min_max" type="number" min="-1e3" max="2e3" step="1" value= "2e3"/> |
| 260 | + <tr> |
| 261 | + <th><label for="noise_spinner"><b>σ<sub>n</sub></b></a></label> |
| 262 | + <td><input id ="noise_spinner" overflow="auto" class="spinner_val" type="number" min="0" max="2e3" step="1" value="1"/> |
| 263 | + <td><input id ="noise_slider" class="slider_val" type="range" min="0" max="2e3" step="1" value="1"/> |
| 264 | + <td><input id ="noise_spinner_min" overflow="auto" class="spinner_min_max" type="number" min="0" max="2e3" step="1" value="0"/> |
| 265 | + <td><input id ="noise_spinner_max" overflow="auto" class="spinner_min_max" type="number" min="0" max="2e3" step="1" value="1e3"/> |
| 266 | + <tr> |
| 267 | + <th><label for="sigma_spinner"><b>ℓ</b></label> |
| 268 | + <td><input id ="sigma_spinner" overflow="auto" class="spinner_val" type="number" min="1" max="4e3" step="1" value="100"/> |
| 269 | + <td><input id ="sigma_slider" class="slider_val" type="range" min="1" max="4e3" step="1" value="100"/> |
| 270 | + <td><input id ="sigma_spinner_min" overflow="auto" class="spinner_min_max" type="number" min="0" max="4e3" step="1" value="1"/> |
| 271 | + <td><input id ="sigma_spinner_max" overflow="auto" class="spinner_min_max" type="number" min="0" max="4e3" step="1" value="2e3"/> |
| 272 | + <tr> |
| 273 | + <th><label for="kernel_exp_spinner"><b>p</b></label> |
| 274 | + <td><input id ="kernel_exp_spinner" overflow="auto" class="spinner_val" type="number" min="1" max="3" step="0.05" value="1.9"/> |
| 275 | + <td><input id ="kernel_exp_slider" class="slider_val" type="range" min="1" max="3" step="0.05" value="1.9"/> |
| 276 | + <tr> |
| 277 | + <th><label for="σ_f_spinner"><b>σ<sub>f</sub></b></label> |
| 278 | + <td><input id ="σ_f_spinner" overflow="auto" class="spinner_val" type="number" min="1" max="2e3" step="1" value="100"/> |
| 279 | + <td><input id ="σ_f_slider" class="slider_val" type="range" min="1" max="2e3" step="1" value="100"/> |
| 280 | + <td><input id ="σ_f_spinner_min" overflow="auto" class="spinner_min_max" type="number" min="1" max="2e3" step="1" value="1"/> |
| 281 | + <td><input id ="σ_f_spinner_max" overflow="auto" class="spinner_min_max" type="number" min="1" max="2e3" step="1" value="2e3"/> |
| 282 | + <tr> |
| 283 | + <td><td><td colspan="3"><button id="btn_fit_marginal" class="fit_button">Fit (Marginal)</button> |
| 284 | + <tr> |
| 285 | + <td><td><td colspan="3"><button id="btn_fit_loo" class="fit_button">Fit (Leave-One-Out)</button> |
| 286 | + <tr> |
| 287 | + <td><td><td colspan="3"><button id="btn_fit_educated" class="fit_button">Fit (Educated Guess)</button> |
| 288 | + </table> |
| 289 | + <h3>Console:</h3> |
| 290 | + <div id="console_div"> |
| 291 | + </div> |
| 292 | + </div> |
| 293 | + </div> |
| 294 | + <script type="text/javascript" src="./gaupros_sandbox-0.1.0.js"></script> |
| 295 | + </body> |
| 296 | +</html> |
0 commit comments