Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,26 +21,25 @@ def simulate_training(epochs, learning_rate):
|
|
| 21 |
accuracies = []
|
| 22 |
logs = []
|
| 23 |
|
| 24 |
-
# start
|
| 25 |
current_acc = 0.55 + random.uniform(0, 0.05)
|
| 26 |
|
| 27 |
for epoch in range(epochs):
|
| 28 |
time.sleep(0.3)
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
improvement = learning_rate * random.uniform(
|
| 32 |
current_acc += improvement
|
| 33 |
|
| 34 |
-
#
|
| 35 |
if epoch > epochs * 0.6:
|
| 36 |
-
current_acc += random.uniform(-0.01, 0.
|
| 37 |
|
| 38 |
-
# clamp and record
|
| 39 |
current_acc = max(min(current_acc, 0.98), 0.55)
|
| 40 |
accuracies.append(round(current_acc, 3))
|
| 41 |
logs.append(f"Epoch {epoch+1}: Validation Accuracy = {current_acc:.3f}")
|
| 42 |
|
| 43 |
-
#
|
| 44 |
plt.figure(figsize=(4, 2))
|
| 45 |
plt.plot(range(1, epochs + 1), accuracies, marker="o", color="tab:blue")
|
| 46 |
plt.title("Simulated Validation Accuracy per Epoch")
|
|
|
|
| 21 |
accuracies = []
|
| 22 |
logs = []
|
| 23 |
|
| 24 |
+
# start lower for visible climb
|
| 25 |
current_acc = 0.55 + random.uniform(0, 0.05)
|
| 26 |
|
| 27 |
for epoch in range(epochs):
|
| 28 |
time.sleep(0.3)
|
| 29 |
|
| 30 |
+
# scale improvement more aggressively
|
| 31 |
+
improvement = learning_rate * random.uniform(200, 400)
|
| 32 |
current_acc += improvement
|
| 33 |
|
| 34 |
+
# plateau effect
|
| 35 |
if epoch > epochs * 0.6:
|
| 36 |
+
current_acc += random.uniform(-0.01, 0.003)
|
| 37 |
|
|
|
|
| 38 |
current_acc = max(min(current_acc, 0.98), 0.55)
|
| 39 |
accuracies.append(round(current_acc, 3))
|
| 40 |
logs.append(f"Epoch {epoch+1}: Validation Accuracy = {current_acc:.3f}")
|
| 41 |
|
| 42 |
+
# plot exaggerated climb
|
| 43 |
plt.figure(figsize=(4, 2))
|
| 44 |
plt.plot(range(1, epochs + 1), accuracies, marker="o", color="tab:blue")
|
| 45 |
plt.title("Simulated Validation Accuracy per Epoch")
|