Update app.py
Browse files
app.py
CHANGED
@@ -169,30 +169,29 @@ class Network(object):
|
|
169 |
# return idx, other_data_input, true_output, predicted_output
|
170 |
return table
|
171 |
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
|
|
|
|
|
|
176 |
def simple_synthesis(index):
|
177 |
-
|
178 |
-
pred, true = net.synthesis(index)
|
179 |
return plotly_fig(pred), plotly_fig(true)
|
180 |
|
181 |
def synthesis_from_spectrum(df):
|
182 |
-
|
183 |
-
pred = net.synthesis_from_spectrum(df.to_numpy())
|
184 |
return plotly_fig(pred)
|
185 |
|
186 |
import plotly.graph_objects as go
|
187 |
import numpy as np
|
188 |
|
189 |
def performance(index):
|
190 |
-
|
191 |
-
return net.get_performance(index)
|
192 |
|
193 |
def geometry(index):
|
194 |
-
|
195 |
-
values = net.get_geometry(index)
|
196 |
return plotly_fig(values)
|
197 |
|
198 |
|
|
|
169 |
# return idx, other_data_input, true_output, predicted_output
|
170 |
return table
|
171 |
|
172 |
+
forward_net = Network("16forward_structure.json", "16forward_weights.h5")
|
173 |
+
|
174 |
+
def simple_analysis(index):
|
175 |
+
return forward_net.analysis(index)
|
176 |
+
|
177 |
+
inverse_net = Network("16inverse_structure.json", "16inverse_weights.h5")
|
178 |
+
|
179 |
def simple_synthesis(index):
|
180 |
+
pred, true = inverse_net.synthesis(index)
|
|
|
181 |
return plotly_fig(pred), plotly_fig(true)
|
182 |
|
183 |
def synthesis_from_spectrum(df):
|
184 |
+
pred = inverse_net.synthesis_from_spectrum(df.to_numpy())
|
|
|
185 |
return plotly_fig(pred)
|
186 |
|
187 |
import plotly.graph_objects as go
|
188 |
import numpy as np
|
189 |
|
190 |
def performance(index):
|
191 |
+
return forward_net.get_performance(index)
|
|
|
192 |
|
193 |
def geometry(index):
|
194 |
+
values = forward_net.get_geometry(index)
|
|
|
195 |
return plotly_fig(values)
|
196 |
|
197 |
|