trohith89 commited on
Commit
1d23952
·
verified ·
1 Parent(s): 52f9369

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -69,6 +69,14 @@ st.markdown(
69
  .center-title {
70
  text-align: center;
71
  }
 
 
 
 
 
 
 
 
72
  </style>
73
  """,
74
  unsafe_allow_html=True,
@@ -99,9 +107,14 @@ with col1:
99
  step=0.01,
100
  key="learning_rate"
101
  )
102
- if st.button("Reset"):
103
- reset_state()
104
- if st.button("Next Iteration"):
 
 
 
 
 
105
  try:
106
  grad = derivative(st.session_state.func_input, st.session_state.x)
107
  st.session_state.x = st.session_state.x - learning_rate * grad
 
69
  .center-title {
70
  text-align: center;
71
  }
72
+ .button-style {
73
+ background-color: black;
74
+ color: #FF1493;
75
+ border: 2px solid #FF1493;
76
+ border-radius: 8px;
77
+ padding: 10px 20px;
78
+ font-size: 18px;
79
+ }
80
  </style>
81
  """,
82
  unsafe_allow_html=True,
 
107
  step=0.01,
108
  key="learning_rate"
109
  )
110
+ if st.button("Setup", key="setup_button", help="Click to reset the function and starting point",
111
+ use_container_width=True,
112
+ on_click=reset_state,
113
+ args=(),
114
+ kwargs={}):
115
+ pass
116
+ if st.button("Next Iteration", key="next_iteration_button", help="Click to perform the next gradient descent iteration",
117
+ use_container_width=True):
118
  try:
119
  grad = derivative(st.session_state.func_input, st.session_state.x)
120
  st.session_state.x = st.session_state.x - learning_rate * grad