Browse code

fix live_info css

Bas Nijholt authored on 19/10/2018 13:24:42
Showing 4 changed files
... ...
@@ -176,7 +176,7 @@ def _info_html(runner):
176 176
     with suppress(Exception):
177 177
         info.append(('latest loss', f'{runner.learner._cache["loss"]:.3f}'))
178 178
 
179
-    template = '<dt>{}</dt><dd>{}</dd>'
179
+    template = '<dt class="ignore-css">{}</dt><dd>{}</dd>'
180 180
     table = '\n'.join(template.format(k, v) for k, v in info)
181 181
 
182 182
     return f'''
183 183
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+.ignore-css{all:unset !important;}
... ...
@@ -148,4 +148,5 @@ def setup(app):
148 148
     for url in css:
149 149
         app.add_stylesheet(url)
150 150
 
151
+    app.add_stylesheet('custom.css')  # For the `live_info` widget
151 152
     app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.14.4/dist/embed-amd.js")
... ...
@@ -39,7 +39,7 @@ background with a sharp peak at a random location:
39 39
 
40 40
         a = 0.01
41 41
         if wait:
42
-            sleep(random())
42
+            sleep(random() / 10)
43 43
         return x + a**2 / (a**2 + (x - offset)**2)
44 44
 
45 45
 We start by initializing a 1D “learner”, which will suggest points to