Update app.py
Browse files
app.py
CHANGED
@@ -168,10 +168,8 @@ class Network(object):
|
|
168 |
# return idx, other_data_input, true_output, predicted_output
|
169 |
return table
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
global inverse_net
|
174 |
-
inverse_net = Network("16inverse_structure.json", "16inverse_weights.h5")
|
175 |
|
176 |
|
177 |
|
@@ -195,20 +193,25 @@ def plotly_fig(values):
|
|
195 |
|
196 |
|
197 |
def performance(index):
|
|
|
198 |
return forward_net.get_performance(index)
|
199 |
|
200 |
def geometry(index):
|
|
|
201 |
values = forward_net.get_geometry(index)
|
202 |
return plotly_fig(values)
|
203 |
|
204 |
-
def simple_analysis(index):
|
|
|
205 |
return forward_net.analysis(index)
|
206 |
|
207 |
def simple_synthesis(index):
|
|
|
208 |
pred, true = inverse_net.synthesis(index)
|
209 |
return plotly_fig(pred), plotly_fig(true)
|
210 |
|
211 |
def synthesis_from_spectrum(df):
|
|
|
212 |
pred = inverse_net.synthesis_from_spectrum(df.to_numpy())
|
213 |
return plotly_fig(pred)
|
214 |
|
|
|
168 |
# return idx, other_data_input, true_output, predicted_output
|
169 |
return table
|
170 |
|
171 |
+
# forward_net = Network("16forward_structure.json", "16forward_weights.h5")
|
172 |
+
# inverse_net = Network("16inverse_structure.json", "16inverse_weights.h5")
|
|
|
|
|
173 |
|
174 |
|
175 |
|
|
|
193 |
|
194 |
|
195 |
def performance(index):
|
196 |
+
forward_net = Network("16forward_structure.json", "16forward_weights.h5")
|
197 |
return forward_net.get_performance(index)
|
198 |
|
199 |
def geometry(index):
|
200 |
+
forward_net = Network("16forward_structure.json", "16forward_weights.h5")
|
201 |
values = forward_net.get_geometry(index)
|
202 |
return plotly_fig(values)
|
203 |
|
204 |
+
def simple_analysis(index):
|
205 |
+
forward_net = Network("16forward_structure.json", "16forward_weights.h5")
|
206 |
return forward_net.analysis(index)
|
207 |
|
208 |
def simple_synthesis(index):
|
209 |
+
inverse_net = Network("16inverse_structure.json", "16inverse_weights.h5")
|
210 |
pred, true = inverse_net.synthesis(index)
|
211 |
return plotly_fig(pred), plotly_fig(true)
|
212 |
|
213 |
def synthesis_from_spectrum(df):
|
214 |
+
inverse_net = Network("16inverse_structure.json", "16inverse_weights.h5")
|
215 |
pred = inverse_net.synthesis_from_spectrum(df.to_numpy())
|
216 |
return plotly_fig(pred)
|
217 |
|