Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ st.markdown(r"""
|
|
| 18 |
""")
|
| 19 |
|
| 20 |
|
| 21 |
-
st_col
|
| 22 |
|
| 23 |
old_loss = 1000.0
|
| 24 |
lengthscale = st.slider('Lengthscale', min_value=0.01, max_value=1.0, value=0.25, step=0.01)
|
|
@@ -60,13 +60,13 @@ ax.fill_between(x_test.ravel(), pred_mean.ravel()-pred_std2.ravel(),
|
|
| 60 |
pred_mean.ravel()+pred_std2.ravel(), alpha=0.5, label='$\\mu \\pm 2\\sigma$')
|
| 61 |
ax.set_xlabel('x')
|
| 62 |
ax.set_ylabel('y')
|
| 63 |
-
|
| 64 |
ax.legend()
|
| 65 |
|
| 66 |
with st_col:
|
| 67 |
st.pyplot(fig)
|
| 68 |
-
new_loss = scipy.stats.multivariate_normal(np.zeros(3), k_train_with_noise).logpdf(y_train.ravel())
|
| 69 |
-
new_loss_str = f"{new_loss:.4f}"
|
| 70 |
|
| 71 |
def percentage_change():
|
| 72 |
global old_loss
|
|
@@ -74,8 +74,8 @@ def percentage_change():
|
|
| 74 |
old_loss = new_loss
|
| 75 |
return f"{ans:.1f}%"
|
| 76 |
|
| 77 |
-
with st_met:
|
| 78 |
-
st.metric('Loss', f"{new_loss:.4f}")
|
| 79 |
|
| 80 |
hide_streamlit_style = """
|
| 81 |
<style>
|
|
|
|
| 18 |
""")
|
| 19 |
|
| 20 |
|
| 21 |
+
st_col = st.columns(1)[0]
|
| 22 |
|
| 23 |
old_loss = 1000.0
|
| 24 |
lengthscale = st.slider('Lengthscale', min_value=0.01, max_value=1.0, value=0.25, step=0.01)
|
|
|
|
| 60 |
pred_mean.ravel()+pred_std2.ravel(), alpha=0.5, label='$\\mu \\pm 2\\sigma$')
|
| 61 |
ax.set_xlabel('x')
|
| 62 |
ax.set_ylabel('y')
|
| 63 |
+
ax.set_title(f"Negative Log Marginal Likelihood: {scipy.stats.multivariate_normal(np.zeros(3), k_train_with_noise).logpdf(y_train.ravel()):.4f}")
|
| 64 |
ax.legend()
|
| 65 |
|
| 66 |
with st_col:
|
| 67 |
st.pyplot(fig)
|
| 68 |
+
# new_loss = scipy.stats.multivariate_normal(np.zeros(3), k_train_with_noise).logpdf(y_train.ravel())
|
| 69 |
+
# new_loss_str = f"{new_loss:.4f}"
|
| 70 |
|
| 71 |
def percentage_change():
|
| 72 |
global old_loss
|
|
|
|
| 74 |
old_loss = new_loss
|
| 75 |
return f"{ans:.1f}%"
|
| 76 |
|
| 77 |
+
# with st_met:
|
| 78 |
+
# st.metric('Loss', f"{new_loss:.4f}")
|
| 79 |
|
| 80 |
hide_streamlit_style = """
|
| 81 |
<style>
|