saritha5 commited on
Commit
7d59a55
·
1 Parent(s): a54869e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -22,13 +22,12 @@ def prediction(price_max,price_step,policy_net):
22
  1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
23
  Q_s = policy_net(to_tensor(sample_state))
24
  a_opt = Q_s.max(0)[1].detach()
25
- st.header('Optimal price action')
26
- st.write(str(price_grid[a_opt])
27
- plt.figure(figsize=(16, 5))
28
- plt.xlabel("Price action ($)")
29
- plt.ylabel("Q ($)")
30
- plt.bar(price_grid, Q_s.detach().numpy(), color='crimson', width=6, alpha=0.8)
31
- plt.show()
32
  st.header('Enter the Spectification')
33
  max_value = st.number_input('Enter the Maximun Value of Price',min_value=50,value = 500,step=1)
34
  step = st.number_input('Enter the Price step',min_value = 10,value = 10,step=1)
 
22
  1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
23
  Q_s = policy_net(to_tensor(sample_state))
24
  a_opt = Q_s.max(0)[1].detach()
25
+ #plt.figure(figsize=(16, 5))
26
+ #plt.xlabel("Price action ($)")
27
+ #plt.ylabel("Q ($)")
28
+ #plt.bar(price_grid, Q_s.detach().numpy(), color='crimson', width=6, alpha=0.8)
29
+ #plt.show()
30
+ return price_grid[a_opt]
 
31
  st.header('Enter the Spectification')
32
  max_value = st.number_input('Enter the Maximun Value of Price',min_value=50,value = 500,step=1)
33
  step = st.number_input('Enter the Price step',min_value = 10,value = 10,step=1)