|
|
import streamlit as st |
|
|
import base64 |
|
|
|
|
|
|
|
|
st.set_page_config(page_title="π§ Neural Network Playground", layout="wide") |
|
|
|
|
|
|
|
|
def set_background_blur(image_path): |
|
|
with open(image_path, "rb") as image_file: |
|
|
encoded = base64.b64encode(image_file.read()).decode() |
|
|
|
|
|
st.markdown( |
|
|
f""" |
|
|
<style> |
|
|
/* Full screen blurred background image container */ |
|
|
.blur-background {{ |
|
|
position: fixed; |
|
|
top: 0; |
|
|
left: 0; |
|
|
height: 100%; |
|
|
width: 100%; |
|
|
z-index: -1; |
|
|
}} |
|
|
|
|
|
.blur-background::before {{ |
|
|
content: ""; |
|
|
position: absolute; |
|
|
top: 0; |
|
|
left: 0; |
|
|
height: 100%; |
|
|
width: 100%; |
|
|
background-image: url("data:image/png;base64,{encoded}"); |
|
|
background-size: cover; |
|
|
background-position: center; |
|
|
background-attachment: fixed; |
|
|
filter: blur(8px); |
|
|
z-index: -1; |
|
|
}} |
|
|
|
|
|
/* Typing animation */ |
|
|
.typing {{ |
|
|
font-family: 'Courier New', monospace; |
|
|
color: #6A0DAD; |
|
|
font-size: 45px; |
|
|
font-weight: bold; |
|
|
white-space: nowrap; |
|
|
overflow: hidden; |
|
|
border-right: 0.15em solid orange; |
|
|
width: 0; |
|
|
animation: |
|
|
typing 3.5s steps(40, end) forwards, |
|
|
blink-caret 0.75s step-end infinite; |
|
|
}} |
|
|
@keyframes typing {{ |
|
|
from {{ width: 0 }} |
|
|
to {{ width: 100% }} |
|
|
}} |
|
|
@keyframes blink-caret {{ |
|
|
from, to {{ border-color: transparent }} |
|
|
50% {{ border-color: orange }} |
|
|
}} |
|
|
</style> |
|
|
|
|
|
<div class="blur-background"></div> |
|
|
""", |
|
|
unsafe_allow_html=True |
|
|
) |
|
|
|
|
|
|
|
|
set_background_blur("ann.jpeg") |
|
|
|
|
|
|
|
|
st.markdown("<div class='typing'>β‘ Neural Network Lab</div>", unsafe_allow_html=True) |
|
|
st.markdown("### π§ͺ *Tinker. Train. Transform. β Explore neural networks like never before!*") |
|
|
|
|
|
|
|
|
st.markdown("<hr style='border-top: 2px solid #bbb;'>", unsafe_allow_html=True) |
|
|
|
|
|
|
|
|
with st.expander("π Click to Learn More About This App"): |
|
|
st.markdown(""" |
|
|
### π§ What You Can Do Here |
|
|
- π§© Choose from datasets like **Moons**, **Circles**, or **Custom Classification** |
|
|
- π’ Tweak model structure: layers, neurons, activations, learning rate |
|
|
- π Train interactively and watch how it learns over time |
|
|
- π¨ Visualize decision boundaries and loss curves instantly |
|
|
|
|
|
### π― Why Use This? |
|
|
- π See neural network behavior come to life |
|
|
- π§ Understand how changes impact learning |
|
|
- π Perfect for education, demos, and self-learning |
|
|
""") |
|
|
|
|
|
|
|
|
st.markdown("<hr style='border-top: 1px dashed #ccc;'>", unsafe_allow_html=True) |
|
|
|