DasariHarshitha commited on
Commit
48060b4
Β·
verified Β·
1 Parent(s): 2a3f3ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +57 -35
app.py CHANGED
@@ -1,11 +1,11 @@
1
  import streamlit as st
2
  import base64
3
 
4
- # Set page config
5
  st.set_page_config(page_title="🧠 Neural Network Playground", layout="wide")
6
 
7
- # Background image function
8
- def set_background(image_path):
9
  with open(image_path, "rb") as image_file:
10
  encoded = base64.b64encode(image_file.read()).decode()
11
 
@@ -18,41 +18,63 @@ def set_background(image_path):
18
  background-repeat: no-repeat;
19
  background-position: center;
20
  background-attachment: fixed;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }}
22
  </style>
23
  """,
24
  unsafe_allow_html=True
25
  )
26
 
27
- # Set background image
28
- #set_background(r"ann.jpeg")
29
-
30
-
31
- # --- Project README/Intro Section ---
32
-
33
- st.markdown("""
34
- # 🧠 Interactive Neural Network Playground
35
- A Python app that lets users explore how neural networks learn by adjusting hyperparameters and visualizing the results.
36
- ---
37
- ### πŸš€ What It Does
38
- - Lets you choose:
39
- - **Dataset**: moons, circles, blobs, classification
40
- - **Learning rate**
41
- - **Activation**: ReLU, Sigmoid, Tanh
42
- - **Train-test split ratio**
43
- - **Batch size**
44
- - **Epochs**:
45
- - **Hidden Layes**
46
- - **Number of Neurons**
47
-
48
-
49
- - Builds & trains a TensorFlow/Keras neural network on synthetic data.
50
- - Visualizes:
51
- - 🌈 **Decision boundaries** (how the model classifies the space)
52
- - πŸ“ˆ **Training vs testing error** across epochs
53
- ---
54
- ### 🎯 Why It’s Useful
55
- βœ… Understand hyperparameter effects
56
- βœ… See overfitting vs underfitting visually
57
- βœ… Learn neural network behavior interactively
58
- """)
 
1
  import streamlit as st
2
  import base64
3
 
4
+ # Set Streamlit page config
5
  st.set_page_config(page_title="🧠 Neural Network Playground", layout="wide")
6
 
7
+ # Function to apply blurred background image
8
+ def set_background_blur(image_path):
9
  with open(image_path, "rb") as image_file:
10
  encoded = base64.b64encode(image_file.read()).decode()
11
 
 
18
  background-repeat: no-repeat;
19
  background-position: center;
20
  background-attachment: fixed;
21
+ filter: blur(6px);
22
+ }}
23
+ .main > div {{
24
+ background-color: rgba(255, 255, 255, 0.85);
25
+ padding: 2rem;
26
+ border-radius: 15px;
27
+ }}
28
+ .typing {{
29
+ font-family: 'Courier New', monospace;
30
+ color: #6A0DAD;
31
+ font-size: 45px;
32
+ font-weight: bold;
33
+ white-space: nowrap;
34
+ overflow: hidden;
35
+ border-right: 0.15em solid orange;
36
+ width: 0;
37
+ animation:
38
+ typing 3.5s steps(40, end) forwards,
39
+ blink-caret 0.75s step-end infinite;
40
+ }}
41
+ @keyframes typing {{
42
+ from {{ width: 0 }}
43
+ to {{ width: 100% }}
44
+ }}
45
+ @keyframes blink-caret {{
46
+ from, to {{ border-color: transparent }}
47
+ 50% {{ border-color: orange }}
48
  }}
49
  </style>
50
  """,
51
  unsafe_allow_html=True
52
  )
53
 
54
+ # Set background image (optional - uncomment below)
55
+ # set_background_blur("ann.jpeg")
56
+
57
+ # Typing animation title
58
+ st.markdown("<div class='typing'>⚑ Neural Network Lab</div>", unsafe_allow_html=True)
59
+ st.markdown("### πŸ§ͺ *Tinker. Train. Transform. β€” Explore neural networks like never before!*")
60
+
61
+ # Add a horizontal line
62
+ st.markdown("<hr style='border-top: 2px solid #bbb;'>", unsafe_allow_html=True)
63
+
64
+ # Collapsible section for details
65
+ with st.expander("πŸ“˜ Click to Learn More About This App"):
66
+ st.markdown("""
67
+ ### πŸ”§ What You Can Do Here
68
+ - 🧩 Choose from datasets like **Moons**, **Circles**, or **Custom Classification**
69
+ - πŸ”’ Tweak model structure: layers, neurons, activations, learning rate
70
+ - πŸ“‰ Train interactively and watch how it learns over time
71
+ - 🎨 Visualize decision boundaries and loss curves instantly
72
+
73
+ ### 🎯 Why Use This?
74
+ - πŸ‘€ See neural network behavior come to life
75
+ - 🧠 Understand how changes impact learning
76
+ - πŸŽ“ Perfect for education, demos, and self-learning
77
+ """)
78
+
79
+ # Add another subtle separator
80
+ st.markdown("<hr style='border-top: 1px dashed #ccc;'>", unsafe_allow_html=True)