joel-woodfield commited on
Commit
6cac300
·
1 Parent(s): 720ba77

Add usage

Browse files
Files changed (2) hide show
  1. frontends/gradio/main.py +31 -2
  2. usage.md +9 -1
frontends/gradio/main.py CHANGED
@@ -247,6 +247,7 @@ def launch():
247
  y_col,
248
  ],
249
  )
 
250
 
251
  with gr.Tab("Regularization"):
252
  with gr.Row():
@@ -271,8 +272,35 @@ def launch():
271
  step=1,
272
  interactive=True,
273
  )
274
-
275
- gr.Button("Regenerate Plots").click(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  fn=handle_generate_plots,
277
  inputs=[
278
  manager_state,
@@ -295,6 +323,7 @@ def launch():
295
  outputs=[manager_state, main_plot, data_plot, strength_plot],
296
  )
297
 
 
298
  demo.launch(css=CSS)
299
 
300
 
 
247
  y_col,
248
  ],
249
  )
250
+ regenerate_plots_button1 = gr.Button("Regenerate Plots")
251
 
252
  with gr.Tab("Regularization"):
253
  with gr.Row():
 
272
  step=1,
273
  interactive=True,
274
  )
275
+ regenerate_plots_button2 = gr.Button("Regenerate Plots")
276
+
277
+ with gr.Tab("Usage"):
278
+ with open(root_dir / "usage.md", "r") as f:
279
+ gr.Markdown(f.read())
280
+
281
+ regenerate_plots_button1.click(
282
+ fn=handle_generate_plots,
283
+ inputs=[
284
+ manager_state,
285
+ dataset_type,
286
+ function,
287
+ x1_textbox,
288
+ x2_textbox,
289
+ x_selection_method,
290
+ sigma,
291
+ nsample,
292
+ csv_file,
293
+ has_header,
294
+ x1_col,
295
+ x2_col,
296
+ y_col,
297
+ loss_type_dropdown,
298
+ regularizer_type_dropdown,
299
+ resolution_slider,
300
+ ],
301
+ outputs=[manager_state, main_plot, data_plot, strength_plot],
302
+ )
303
+ regenerate_plots_button2.click(
304
  fn=handle_generate_plots,
305
  inputs=[
306
  manager_state,
 
323
  outputs=[manager_state, main_plot, data_plot, strength_plot],
324
  )
325
 
326
+
327
  demo.launch(css=CSS)
328
 
329
 
usage.md CHANGED
@@ -1 +1,9 @@
1
- **Quick start**
 
 
 
 
 
 
 
 
 
1
+ **Usage**
2
+
3
+ 1. In the **Data** tab, generate a dataset using a custom function or upload a csv file
4
+ 2. In the **Regularization** tab, select your loss type and regularizer type
5
+ 3. Click **Regenerate Plots** to update plots with the current settings
6
+ 4. View the three plots on the left
7
+ * Loss and regularizer norm contour plot
8
+ * Plot of the dataset used
9
+ * Plot of regularization strength vs weight