ytrsoymr commited on
Commit
a3b182e
Β·
verified Β·
1 Parent(s): 2bf2ce1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -53,7 +53,7 @@ def plot_loss(history):
53
 
54
  # --- Streamlit UI ---
55
  st.set_page_config(page_title="TensorFlow Playground", layout="centered")
56
- st.title("🧠 TensorFlow Playground")
57
  st.write("Explore how hyperparameters affect decision boundaries in neural networks.")
58
 
59
  # --- Sidebar Controls ---
@@ -69,7 +69,7 @@ num_neurons = st.sidebar.slider("Neurons/Layer", 1, 100, 10)
69
  num_layers = st.sidebar.slider("Hidden Layers", 1, 5, 2)
70
 
71
  # --- Train Button ---
72
- if st.button("πŸš€ Train Model"):
73
  with st.spinner("Training the model..."):
74
  X, y = get_dataset(dataset, noise=noise)
75
  X = StandardScaler().fit_transform(X)
@@ -82,8 +82,8 @@ if st.button("πŸš€ Train Model"):
82
  test_loss, test_acc = model.evaluate(X_test, y_test, verbose=0)
83
  st.success(f"βœ… Trained Successfully! Test Accuracy: {test_acc:.2f}")
84
 
85
- st.subheader("πŸ“Š Decision Boundary")
86
  st.pyplot(visualize_decision_boundary(model, X, y))
87
 
88
- st.subheader("πŸ“ˆ Loss Over Epochs")
89
  st.pyplot(plot_loss(history))
 
53
 
54
  # --- Streamlit UI ---
55
  st.set_page_config(page_title="TensorFlow Playground", layout="centered")
56
+ st.title(" TensorFlow Playground")
57
  st.write("Explore how hyperparameters affect decision boundaries in neural networks.")
58
 
59
  # --- Sidebar Controls ---
 
69
  num_layers = st.sidebar.slider("Hidden Layers", 1, 5, 2)
70
 
71
  # --- Train Button ---
72
+ if st.button(" Train Model"):
73
  with st.spinner("Training the model..."):
74
  X, y = get_dataset(dataset, noise=noise)
75
  X = StandardScaler().fit_transform(X)
 
82
  test_loss, test_acc = model.evaluate(X_test, y_test, verbose=0)
83
  st.success(f"βœ… Trained Successfully! Test Accuracy: {test_acc:.2f}")
84
 
85
+ st.subheader(" Decision Boundary")
86
  st.pyplot(visualize_decision_boundary(model, X, y))
87
 
88
+ st.subheader(" Loss Over Epochs")
89
  st.pyplot(plot_loss(history))