Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,7 @@ def update_graph(input_size, hidden_size, output_size):
|
|
65 |
plt.figure(figsize=(10, 6))
|
66 |
nx.draw(G, pos, with_labels=True, node_size=2000, node_color='skyblue', font_size=12, font_weight='bold', arrows=True)
|
67 |
nx.draw_networkx_edge_labels(G, pos, edge_labels={(u, v): f'{d["weight"]:.2f}' for u, v, d in edges})
|
68 |
-
plt.title("MLP
|
69 |
plt.axis('off') # Eksenleri kapat
|
70 |
plt.tight_layout() # Düzeni ayarla
|
71 |
|
@@ -75,13 +75,13 @@ def update_graph(input_size, hidden_size, output_size):
|
|
75 |
with gr.Blocks() as demo:
|
76 |
gr.Markdown("### MLP Modeli Görselleştirici")
|
77 |
|
78 |
-
input_slider = gr.Slider(minimum=1, maximum=10, value=input_size, label="
|
79 |
-
hidden_slider = gr.Slider(minimum=1, maximum=10, value=hidden_size, label="
|
80 |
-
output_slider = gr.Slider(minimum=1, maximum=10, value=output_size, label="
|
81 |
|
82 |
output_plot = gr.Plot(label="MLP Model Grafiği")
|
83 |
|
84 |
-
update_button = gr.Button("
|
85 |
|
86 |
update_button.click(fn=update_graph, inputs=[input_slider, hidden_slider, output_slider], outputs=output_plot)
|
87 |
|
|
|
65 |
plt.figure(figsize=(10, 6))
|
66 |
nx.draw(G, pos, with_labels=True, node_size=2000, node_color='skyblue', font_size=12, font_weight='bold', arrows=True)
|
67 |
nx.draw_networkx_edge_labels(G, pos, edge_labels={(u, v): f'{d["weight"]:.2f}' for u, v, d in edges})
|
68 |
+
plt.title("Visual MLP", fontsize=16)
|
69 |
plt.axis('off') # Eksenleri kapat
|
70 |
plt.tight_layout() # Düzeni ayarla
|
71 |
|
|
|
75 |
with gr.Blocks() as demo:
|
76 |
gr.Markdown("### MLP Modeli Görselleştirici")
|
77 |
|
78 |
+
input_slider = gr.Slider(minimum=1, maximum=10, value=input_size, label="Input Layer")
|
79 |
+
hidden_slider = gr.Slider(minimum=1, maximum=10, value=hidden_size, label="Hidden Layer")
|
80 |
+
output_slider = gr.Slider(minimum=1, maximum=10, value=output_size, label="Output Layer")
|
81 |
|
82 |
output_plot = gr.Plot(label="MLP Model Grafiği")
|
83 |
|
84 |
+
update_button = gr.Button("Update")
|
85 |
|
86 |
update_button.click(fn=update_graph, inputs=[input_slider, hidden_slider, output_slider], outputs=output_plot)
|
87 |
|