Spaces:
Sleeping
Sleeping
Commit ·
e1ff0b0
1
Parent(s): 07df3e3
Display model textbox and fix display formatting
Browse files- dataset.py +11 -9
- regularization.py +24 -15
dataset.py
CHANGED
|
@@ -257,16 +257,18 @@ class DatasetView:
|
|
| 257 |
options = state.value
|
| 258 |
|
| 259 |
with gr.Column():
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
|
|
|
| 265 |
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 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 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 402 |
|
| 403 |
with gr.Row():
|
| 404 |
regularizer_type_selection = gr.Dropdown(
|
|
@@ -427,16 +435,17 @@ class Regularization:
|
|
| 427 |
interactive=True,
|
| 428 |
)
|
| 429 |
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
|
|
|
| 437 |
|
| 438 |
-
|
| 439 |
-
|
| 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()
|