kdqemre commited on
Commit
36383e0
·
verified ·
1 Parent(s): 0f1d0ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 Modelinin Görselleştirilmesi", fontsize=16)
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="Giriş Katmanı Nöron Sayısı")
79
- hidden_slider = gr.Slider(minimum=1, maximum=10, value=hidden_size, label="Gizli Katman Nöron Sayısı")
80
- output_slider = gr.Slider(minimum=1, maximum=10, value=output_size, label="Çıkış Katmanı Nöron Sayısı")
81
 
82
  output_plot = gr.Plot(label="MLP Model Grafiği")
83
 
84
- update_button = gr.Button("Güncelle")
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