Update app.py
Browse files
app.py
CHANGED
|
@@ -1,58 +1,58 @@
|
|
| 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 |
-
|
| 12 |
-
st.markdown(
|
| 13 |
-
f"""
|
| 14 |
-
<style>
|
| 15 |
-
.stApp {{
|
| 16 |
-
background-image: url("data:image/png;base64,{encoded}");
|
| 17 |
-
background-size: cover;
|
| 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 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 |
+
|
| 12 |
+
st.markdown(
|
| 13 |
+
f"""
|
| 14 |
+
<style>
|
| 15 |
+
.stApp {{
|
| 16 |
+
background-image: url("data:image/png;base64,{encoded}");
|
| 17 |
+
background-size: cover;
|
| 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 |
+
""")
|