Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,7 +70,6 @@ if st.button("Set Up") or 'func' not in st.session_state or 'points' not in st.s
|
|
| 70 |
except Exception as e:
|
| 71 |
st.error(f"Error setting up function: {e}")
|
| 72 |
|
| 73 |
-
# ------------------------ ITERATION STEP ------------------------
|
| 74 |
def gradient_step(x_val, func, lr):
|
| 75 |
x = torch.tensor([x_val], dtype=torch.float32, requires_grad=True)
|
| 76 |
y = func(x)
|
|
@@ -101,7 +100,7 @@ if 'func' in st.session_state:
|
|
| 101 |
except Exception as e:
|
| 102 |
st.error(f"Error in multiple iterations: {e}")
|
| 103 |
|
| 104 |
-
|
| 105 |
if 'func' in st.session_state and len(st.session_state.points) > 0:
|
| 106 |
try:
|
| 107 |
x_val = np.linspace(-10, 10, 500)
|
|
|
|
| 70 |
except Exception as e:
|
| 71 |
st.error(f"Error setting up function: {e}")
|
| 72 |
|
|
|
|
| 73 |
def gradient_step(x_val, func, lr):
|
| 74 |
x = torch.tensor([x_val], dtype=torch.float32, requires_grad=True)
|
| 75 |
y = func(x)
|
|
|
|
| 100 |
except Exception as e:
|
| 101 |
st.error(f"Error in multiple iterations: {e}")
|
| 102 |
|
| 103 |
+
|
| 104 |
if 'func' in st.session_state and len(st.session_state.points) > 0:
|
| 105 |
try:
|
| 106 |
x_val = np.linspace(-10, 10, 500)
|