Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,6 +65,16 @@ def visualize_memory_grid(memory_grid):
|
|
| 65 |
ax.set_ylabel("Memory Cells (Rows)")
|
| 66 |
st.pyplot(fig) # Render plot in Streamlit using st.pyplot
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
# Generate spikes for the given pressure value
|
| 69 |
def generate_spikes_for_pressure(pressure):
|
| 70 |
# Simulate the pressure as the input (scale to appropriate format for LSTM)
|
|
@@ -84,6 +94,9 @@ def generate_spikes_for_pressure(pressure):
|
|
| 84 |
# Visualize the memory grid (4x4 grid)
|
| 85 |
visualize_memory_grid(memory_grid)
|
| 86 |
|
|
|
|
|
|
|
|
|
|
| 87 |
# Optionally, print the output
|
| 88 |
print(f"Filtered Output: {output}")
|
| 89 |
print(f"Memory Grid after update:\n{memory_grid}")
|
|
|
|
| 65 |
ax.set_ylabel("Memory Cells (Rows)")
|
| 66 |
st.pyplot(fig) # Render plot in Streamlit using st.pyplot
|
| 67 |
|
| 68 |
+
# Visualize the Spike Potential Output
|
| 69 |
+
def visualize_spike_output(output):
|
| 70 |
+
# Plot the spike potential (filtered output)
|
| 71 |
+
fig, ax = plt.subplots(figsize=(6, 4))
|
| 72 |
+
ax.plot(output.detach().numpy(), marker='o', linestyle='-', color='b')
|
| 73 |
+
ax.set_title("Spike Potential Output")
|
| 74 |
+
ax.set_xlabel("Spike Index")
|
| 75 |
+
ax.set_ylabel("Spike Potential")
|
| 76 |
+
st.pyplot(fig)
|
| 77 |
+
|
| 78 |
# Generate spikes for the given pressure value
|
| 79 |
def generate_spikes_for_pressure(pressure):
|
| 80 |
# Simulate the pressure as the input (scale to appropriate format for LSTM)
|
|
|
|
| 94 |
# Visualize the memory grid (4x4 grid)
|
| 95 |
visualize_memory_grid(memory_grid)
|
| 96 |
|
| 97 |
+
# Visualize the spike potential output
|
| 98 |
+
visualize_spike_output(output)
|
| 99 |
+
|
| 100 |
# Optionally, print the output
|
| 101 |
print(f"Filtered Output: {output}")
|
| 102 |
print(f"Memory Grid after update:\n{memory_grid}")
|