NeonSamurai commited on
Commit
e8a168d
Β·
verified Β·
1 Parent(s): 7ccfb9a

Update pages/About.py

Browse files
Files changed (1) hide show
  1. pages/About.py +148 -145
pages/About.py CHANGED
@@ -1,145 +1,148 @@
1
- import streamlit as st
2
- import base64
3
-
4
- def main():
5
- st.set_page_config(page_title="Neural Network Playground", page_icon="🧠", layout="centered")
6
-
7
- def encode_image(image_path):
8
- with open(image_path, "rb") as image_file:
9
- return base64.b64encode(image_file.read()).decode()
10
-
11
- def add_bg_from_local(image_file):
12
- encoded_string = encode_image(image_file)
13
- st.markdown(
14
- f"""
15
- <style>
16
- .stApp {{
17
- background-image: url(data:image/png;base64,{encoded_string});
18
- background-size: cover;
19
- background-position: center;
20
- background-repeat: no-repeat;
21
- background-attachment: fixed;
22
- }}
23
- </style>
24
- """,
25
- unsafe_allow_html=True
26
- )
27
-
28
- add_bg_from_local("Images/bkg13.jpg")
29
-
30
- st.markdown(
31
- f"""
32
- <h1 style='text-align: center; color: white;'>
33
- 🧠 Neural Network Playground
34
- </h1>
35
- """,
36
- unsafe_allow_html=True
37
- )
38
-
39
- st.markdown("""<h2 style='text-align: center;'>πŸ” What is a Neural Network?</h2>""", unsafe_allow_html=True)
40
- st.markdown(
41
- "A neural network is a type of machine learning model inspired by how the human brain works. "
42
- "Think of it as a web of tiny processing units (neurons) that work together to recognize patterns, "
43
- "make predictions, and learn from data."
44
- )
45
-
46
- st.markdown("---")
47
- st.markdown("""<h2 style='text-align: center;'>βš™οΈ How Does This Playground Work?</h2>""", unsafe_allow_html=True)
48
- st.markdown(
49
- "This interactive app lets you experiment with a simple neural network. "
50
- "By adjusting various settings, you can see how different configurations affect learning and performance."
51
- )
52
-
53
- st.markdown("---")
54
- st.markdown("""<h2 style='text-align: center;'>πŸ”§ Configuration Settings Explained</h2>""", unsafe_allow_html=True)
55
- st.markdown("Modify these settings to understand how neural networks learn:")
56
-
57
- st.markdown("**🧱 Number of Layers & Neurons**")
58
- st.markdown(
59
- "- More layers and neurons make the network more powerful but can lead to **overfitting**. "
60
- "Think of it like adding more people to solve a problem: sometimes helpful, but too many can cause confusion."
61
- )
62
-
63
- st.markdown("**⚑ Learning Rate**")
64
- st.markdown(
65
- "- Determines how fast the network learns. A high learning rate makes quick progress but might miss details, "
66
- "while a low one learns slowly but carefully. It's like choosing between sprinting and walking while learning something new."
67
- )
68
-
69
- st.markdown("**πŸš€ Activation Functions**")
70
- st.markdown("These control how neurons pass information. Common options include:")
71
- st.code(
72
- "ReLU (Rectified Linear Unit): Great for deep networks\n"
73
- "Sigmoid: Useful for probability-based problems\n"
74
- "Tanh: Works best when data is centered around zero"
75
- )
76
-
77
- st.markdown("**πŸ“† Epochs & Batch Size**")
78
- st.markdown(
79
- "- **Epochs**: How many times the network sees the entire dataset. Too many can cause overfitting."
80
- "\n- **Batch Size**: How many data points the network processes at once. A larger batch makes training faster but uses more memory."
81
- )
82
-
83
- st.markdown("---")
84
- st.markdown("""<h2 style='text-align: center;'>πŸ’‘ My Learning Experience</h2>""", unsafe_allow_html=True)
85
- st.markdown(
86
- "When I first started learning about neural networks, everything felt complicated. "
87
- "But after playing around with different settings and seeing how they change the learning process, "
88
- "things started making sense."
89
- )
90
- st.markdown(
91
- "One resource that helped me a lot was the **TensorFlow Playground**. "
92
- "It's an amazing interactive tool that lets you visualize how neural networks learn in real time!"
93
- )
94
- st.markdown("🌐 [Check out the TensorFlow Playground](https://playground.tensorflow.org/)")
95
-
96
- st.markdown("---")
97
- st.markdown("""<h2 style='text-align: center;'>πŸš€ Start Experimenting!</h2>""", unsafe_allow_html=True)
98
- st.markdown(
99
- "Now it's your turn! Adjust the settings, train the model, and see how small changes can make a big difference. "
100
- "The best way to learn is by doingβ€”so have fun exploring!"
101
- )
102
-
103
- st.markdown("""
104
- <style>
105
- .footer {
106
- width: 100%;
107
- text-align: center;
108
- color: white;
109
- padding: 20px 0;
110
- background: linear-gradient(135deg, #f36f6f, #FF7F50);
111
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
112
- margin-top: 50px;
113
- border-radius: 10px 10px 0 0;
114
- }
115
- .footer p {
116
- font-size: 18px;
117
- font-weight: bold;
118
- }
119
- .footer a {
120
- color: white;
121
- text-decoration: none;
122
- margin: 0 10px;
123
- transition: transform 0.3s ease, scale 0.2s;
124
- }
125
- .footer a:hover {
126
- transform: scale(1.2);
127
- }
128
- .footer img {
129
- margin-left: 8px;
130
- }
131
- </style>
132
- <div class="footer">
133
- <p>Created with πŸ’‘ by Aamer
134
- <a href='https://linkedin.com/mohd-suhaib-aamer' target='_blank'>
135
- <img src='https://img.icons8.com/fluent/48/000000/linkedin.png' width='24' height='24'/>
136
- </a>
137
- <a href='https://github.com/Suhaib-Aamer' target='_blank'>
138
- <img src='https://img.icons8.com/fluent/48/000000/github.png' width='24' height='24'/>
139
- </a>
140
- </p>
141
- </div>
142
- """, unsafe_allow_html=True)
143
-
144
- if __name__ == "__main__":
145
- main()
 
 
 
 
1
+ import streamlit as st
2
+
3
+ st.set_page_config(page_title="Neural Network Playground", page_icon="🧠", layout="centered")
4
+
5
+ def main():
6
+ st.markdown(
7
+ f"""
8
+ <h1 style='text-align: center; color: white;'>
9
+ 🧠 Neural Network Playground
10
+ </h1>
11
+ """,
12
+ unsafe_allow_html=True
13
+ )
14
+
15
+ st.markdown("""<h2 style='text-align: center;'>πŸ” What is a Neural Network?</h2>""", unsafe_allow_html=True)
16
+ st.markdown(
17
+ "A neural network is a type of machine learning model inspired by how the human brain works. "
18
+ "Think of it as a web of tiny processing units (neurons) that work together to recognize patterns, "
19
+ "make predictions, and learn from data."
20
+ )
21
+
22
+ st.markdown("---")
23
+ st.markdown("""<h2 style='text-align: center;'>βš™οΈ How Does This Playground Work?</h2>""", unsafe_allow_html=True)
24
+ st.markdown(
25
+ "This interactive app lets you experiment with a simple neural network. "
26
+ "By adjusting various settings, you can see how different configurations affect learning and performance."
27
+ )
28
+
29
+ st.markdown("---")
30
+ st.markdown("""<h2 style='text-align: center;'>πŸ”§ Configuration Settings Explained</h2>""", unsafe_allow_html=True)
31
+ st.markdown("Modify these settings to understand how neural networks learn:")
32
+
33
+ st.markdown("**🧱 Number of Layers & Neurons**")
34
+ st.markdown(
35
+ "- More layers and neurons make the network more powerful but can lead to **overfitting**. "
36
+ "Think of it like adding more people to solve a problem: sometimes helpful, but too many can cause confusion."
37
+ )
38
+
39
+ st.markdown("**⚑ Learning Rate**")
40
+ st.markdown(
41
+ "- Determines how fast the network learns. A high learning rate makes quick progress but might miss details, "
42
+ "while a low one learns slowly but carefully. It's like choosing between sprinting and walking while learning something new."
43
+ )
44
+
45
+ st.markdown("**πŸš€ Activation Functions**")
46
+ st.markdown("These control how neurons pass information. Common options include:")
47
+ st.code(
48
+ "ReLU (Rectified Linear Unit): Great for deep networks\n"
49
+ "Sigmoid: Useful for probability-based problems\n"
50
+ "Tanh: Works best when data is centered around zero"
51
+ )
52
+
53
+ st.markdown("**πŸ“† Epochs & Batch Size**")
54
+ st.markdown(
55
+ "- **Epochs**: How many times the network sees the entire dataset. Too many can cause overfitting."
56
+ "\n- **Batch Size**: How many data points the network processes at once. A larger batch makes training faster but uses more memory."
57
+ )
58
+
59
+ st.markdown("---")
60
+ st.markdown("""<h2 style='text-align: center;'>πŸ’‘ My Learning Experience</h2>""", unsafe_allow_html=True)
61
+ st.markdown(
62
+ "When I first started learning about neural networks, everything felt complicated. "
63
+ "But after playing around with different settings and seeing how they change the learning process, "
64
+ "things started making sense."
65
+ )
66
+ st.markdown(
67
+ "One resource that helped me a lot was the **TensorFlow Playground**. "
68
+ "It's an amazing interactive tool that lets you visualize how neural networks learn in real time!"
69
+ )
70
+ st.markdown("🌐 [Check out the TensorFlow Playground](https://playground.tensorflow.org/)")
71
+
72
+ st.markdown("---")
73
+ st.markdown("""<h2 style='text-align: center;'>πŸš€ Start Experimenting!</h2>""", unsafe_allow_html=True)
74
+ st.markdown(
75
+ "Now it's your turn! Adjust the settings, train the model, and see how small changes can make a big difference. "
76
+ "The best way to learn is by doingβ€”so have fun exploring!"
77
+ )
78
+
79
+ st.markdown("""
80
+ <style>
81
+ .footer {
82
+ width: 100%;
83
+ text-align: center;
84
+ color: white;
85
+ padding: 20px 0;
86
+ background: linear-gradient(135deg, #f36f6f, #FF7F50);
87
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
88
+ margin-top: 50px;
89
+ border-radius: 10px 10px 0 0;
90
+ }
91
+ .footer p {
92
+ font-size: 18px;
93
+ font-weight: bold;
94
+ }
95
+ .footer a {
96
+ color: white;
97
+ text-decoration: none;
98
+ margin: 0 10px;
99
+ transition: transform 0.3s ease, scale 0.2s;
100
+ }
101
+ .footer a:hover {
102
+ transform: scale(1.2);
103
+ }
104
+ .footer img {
105
+ margin-left: 8px;
106
+ }
107
+ </style>
108
+ <div class="footer">
109
+ <p>Created with πŸ’‘ by Aamer
110
+ <a href='https://linkedin.com/mohd-suhaib-aamer' target='_blank'>
111
+ <img src='https://img.icons8.com/fluent/48/000000/linkedin.png' width='24' height='24'/>
112
+ </a>
113
+ <a href='https://github.com/Suhaib-Aamer' target='_blank'>
114
+ <img src='https://img.icons8.com/fluent/48/000000/github.png' width='24' height='24'/>
115
+ </a>
116
+ </p>
117
+ </div>
118
+ """, unsafe_allow_html=True)
119
+
120
+ # Adding a Background
121
+ st.markdown(
122
+ """
123
+ <style>
124
+ .stApp {
125
+ background-image: url("https://cdn-uploads.huggingface.co/production/uploads/673f5e166c2774fcc8a82f0b/VHiP7IHKe-9tIY2ZiLIAZ.jpeg");
126
+ background-size: cover;
127
+ background-position: center;
128
+ height: 100vh;
129
+ background-attachment: fixed;
130
+ }
131
+
132
+ /* Semi-transparent overlay */
133
+ .stApp::before {
134
+ content: "";
135
+ position: absolute;
136
+ top: 0;
137
+ left: 0;
138
+ width: 100%;
139
+ height: 100%;
140
+ background: rgba(0, 0, 0, 0.4); /* 40% transparency */
141
+ z-index: -1;
142
+ }
143
+ </style>
144
+ """,
145
+ unsafe_allow_html=True)
146
+
147
+ if __name__ == "__main__":
148
+ main()