snajmark commited on
Commit
c533659
·
1 Parent(s): 1282d04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -138,9 +138,9 @@ def predict_from_tuple(in1, in2, in3, in4, in5, request: gr.Request):
138
 
139
  def fit_outputs_constraints(x, hardness_target, ys_target, request: gr.Request):
140
  predictions = predict(x, request)
141
- error_hardness = np.sqrt(np.square(predictions[0]-hardness_target))
142
- error_ys = np.sqrt(np.square(predictions[2]-ys_target))
143
- print(predictions, hardness_target, ys_target, error_hardness, error_ys)
144
  return error_hardness + error_ys
145
 
146
  def predict_inverse(hardness_target, ys_target, request: gr.Request):
 
138
 
139
  def fit_outputs_constraints(x, hardness_target, ys_target, request: gr.Request):
140
  predictions = predict(x, request)
141
+ error_hardness = np.sqrt(np.square(predictions[0]-float(hardness_target)))
142
+ error_ys = np.sqrt(np.square(predictions[2]-float(ys_target)))
143
+ print(predictions, float(hardness_target), float(ys_target), error_hardness, error_ys)
144
  return error_hardness + error_ys
145
 
146
  def predict_inverse(hardness_target, ys_target, request: gr.Request):