Spaces:
Sleeping
Sleeping
Update pages/About.py
Browse files- pages/About.py +148 -145
pages/About.py
CHANGED
|
@@ -1,145 +1,148 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
st.markdown(
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
""
|
| 36 |
-
|
| 37 |
-
)
|
| 38 |
-
|
| 39 |
-
st.markdown("
|
| 40 |
-
st.markdown(
|
| 41 |
-
"
|
| 42 |
-
"
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
st.markdown("
|
| 47 |
-
st.
|
| 48 |
-
|
| 49 |
-
"
|
| 50 |
-
"
|
| 51 |
-
)
|
| 52 |
-
|
| 53 |
-
st.markdown("
|
| 54 |
-
st.markdown(
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
st.markdown("
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
}
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|