NeonSamurai commited on
Commit
bfa433b
Β·
verified Β·
1 Parent(s): 391adc7

Upload About.py

Browse files
Files changed (1) hide show
  1. pages/About.py +145 -0
pages/About.py ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()