joel-woodfield commited on
Commit
e1ff0b0
·
1 Parent(s): 07df3e3

Display model textbox and fix display formatting

Browse files
Files changed (2) hide show
  1. dataset.py +11 -9
  2. regularization.py +24 -15
dataset.py CHANGED
@@ -257,16 +257,18 @@ class DatasetView:
257
  options = state.value
258
 
259
  with gr.Column():
260
- mode = gr.Radio(
261
- label="Dataset",
262
- choices=["generate", "csv"],
263
- value="generate",
264
- )
 
265
 
266
- function = gr.Textbox(
267
- label="Function (in terms of x1 and x2)",
268
- value=options.function,
269
- )
 
270
 
271
  with gr.Row():
272
  x1_textbox = gr.Textbox(
 
257
  options = state.value
258
 
259
  with gr.Column():
260
+ with gr.Row():
261
+ mode = gr.Radio(
262
+ label="Dataset",
263
+ choices=["generate", "csv"],
264
+ value="generate",
265
+ )
266
 
267
+ with gr.Row():
268
+ function = gr.Textbox(
269
+ label="Function (in terms of x1 and x2)",
270
+ value=options.function,
271
+ )
272
 
273
  with gr.Row():
274
  x1_textbox = gr.Textbox(
regularization.py CHANGED
@@ -393,12 +393,20 @@ class Regularization:
393
 
394
  with gr.Column(scale=1):
395
  with gr.Tab("Settings"):
396
- loss_type_selection = gr.Dropdown(
397
- choices=['l1', 'l2'],
398
- label='Loss type',
399
- value='l2',
400
- visible=True,
401
- )
 
 
 
 
 
 
 
 
402
 
403
  with gr.Row():
404
  regularizer_type_selection = gr.Dropdown(
@@ -427,16 +435,17 @@ class Regularization:
427
  interactive=True,
428
  )
429
 
430
- resolution_slider = gr.Slider(
431
- minimum=100,
432
- maximum=1000,
433
- value=500,
434
- step=1,
435
- label="Resolution (#points)",
436
- )
 
437
 
438
- # plot path
439
- path_checkbox = gr.Checkbox(label="Show regularization path", value=False)
440
 
441
  with gr.Tab("Data"):
442
  dataset_view = DatasetView()
 
393
 
394
  with gr.Column(scale=1):
395
  with gr.Tab("Settings"):
396
+ with gr.Row():
397
+ model_textbox = gr.Textbox(
398
+ label="Model",
399
+ value="y = w1 * x1 + w2 * x2",
400
+ interactive=False,
401
+ )
402
+
403
+ with gr.Row():
404
+ loss_type_selection = gr.Dropdown(
405
+ choices=['l1', 'l2'],
406
+ label='Loss type',
407
+ value='l2',
408
+ visible=True,
409
+ )
410
 
411
  with gr.Row():
412
  regularizer_type_selection = gr.Dropdown(
 
435
  interactive=True,
436
  )
437
 
438
+ with gr.Row():
439
+ resolution_slider = gr.Slider(
440
+ minimum=100,
441
+ maximum=1000,
442
+ value=500,
443
+ step=1,
444
+ label="Resolution (#points)",
445
+ )
446
 
447
+ with gr.Row():
448
+ path_checkbox = gr.Checkbox(label="Show regularization path", value=False)
449
 
450
  with gr.Tab("Data"):
451
  dataset_view = DatasetView()