ccm commited on
Commit
b68dcad
·
1 Parent(s): 83c071f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -16
app.py CHANGED
@@ -1,25 +1,21 @@
1
  # For neural networks
2
  import keras
3
- # For train-test splits
4
- import sklearn.model_selection
5
  # For random calculations
6
  import numpy
7
- # For help with saving and opening things
8
- import os
9
 
10
  # Disable eager execution because its bad
11
  from tensorflow.python.framework.ops import disable_eager_execution
12
  disable_eager_execution()
13
 
14
  # Start a session for checking calculations and stuff
15
- import tensorflow as tf
16
- sess = tf.compat.v1.Session()
17
 
18
- from keras import backend as K
19
- K.set_session(sess)
20
 
21
  # Do you want it loud?
22
- VERBOSE = 1
23
 
24
  # This function loads a fuckton of data
25
  def load_data():
@@ -161,20 +157,15 @@ class Network(object):
161
  df_pred = pandas.DataFrame(other_data_input.transpose()).rename(columns={0: "Surge", 1: "Heave", 2: "Pitch"})
162
  table = pandas.concat([fd, df_pred], axis=1)
163
 
164
- # return idx, other_data_input, true_output, predicted_output
165
  return table
166
 
167
- # forward_net = Network("16forward_structure.json", "16forward_weights.h5")
168
- # inverse_net = Network("16inverse_structure.json", "16inverse_weights.h5")
169
-
170
 
171
 
172
  import plotly.graph_objects as go
173
- import numpy as np
174
 
175
 
176
  def plotly_fig(values):
177
- X, Y, Z = np.mgrid[0:1:32j, 0:1:32j, 0:1:32j]
178
  fig = go.Figure(data=go.Volume(
179
  x=X.flatten(),
180
  y=Y.flatten(),
@@ -234,7 +225,7 @@ with gradio.Blocks() as demo:
234
  gradio.HTML("Christopher McComb, Carnegie Mellon University")
235
  gradio.Markdown("Additive manufacturing is advantageous for producing lightweight components while maintaining function and form. This ability has been bolstered by the introduction of unit lattice cells and the gradation of those cells. In cases where loading varies throughout a part, it may be necessary to use multiple lattice cell types, also known as multi-lattice structures. In such structures, abrupt transitions between geometries may cause stress concentrations, making the boundary a primary failure point; thus, transition regions should be created between each lattice cell type. Although computational approaches have been proposed, smooth transition regions are still difficult to intuit and design, especially between lattices of drastically different geometries. This work demonstrates and assesses a method for using variational autoencoders to automate the creation of transitional lattice cells. In particular, the work focuses on identifying the relationships that exist within the latent space produced by the variational autoencoder. Through computational experimentation, it was found that the smoothness of transition regions was higher when the endpoints were located closer together in the latent space.")
236
  with gradio.Column():
237
- download = gradio.HTML("<a href=\"M169970.pdf\" style=\"width: 60%; display: block; margin: auto;\"><img src=\"coverpage.png\"></a>")
238
 
239
  with gradio.Tab("Analysis"):
240
  with gradio.Tab("Spectrum from Dataset"):
 
1
  # For neural networks
2
  import keras
 
 
3
  # For random calculations
4
  import numpy
 
 
5
 
6
  # Disable eager execution because its bad
7
  from tensorflow.python.framework.ops import disable_eager_execution
8
  disable_eager_execution()
9
 
10
  # Start a session for checking calculations and stuff
11
+ # import tensorflow as tf
12
+ # sess = tf.compat.v1.Session()
13
 
14
+ # from keras import backend as K
15
+ # K.set_session(sess)
16
 
17
  # Do you want it loud?
18
+ # VERBOSE = 1
19
 
20
  # This function loads a fuckton of data
21
  def load_data():
 
157
  df_pred = pandas.DataFrame(other_data_input.transpose()).rename(columns={0: "Surge", 1: "Heave", 2: "Pitch"})
158
  table = pandas.concat([fd, df_pred], axis=1)
159
 
 
160
  return table
161
 
 
 
 
162
 
163
 
164
  import plotly.graph_objects as go
 
165
 
166
 
167
  def plotly_fig(values):
168
+ X, Y, Z = numpy.mgrid[0:1:32j, 0:1:32j, 0:1:32j]
169
  fig = go.Figure(data=go.Volume(
170
  x=X.flatten(),
171
  y=Y.flatten(),
 
225
  gradio.HTML("Christopher McComb, Carnegie Mellon University")
226
  gradio.Markdown("Additive manufacturing is advantageous for producing lightweight components while maintaining function and form. This ability has been bolstered by the introduction of unit lattice cells and the gradation of those cells. In cases where loading varies throughout a part, it may be necessary to use multiple lattice cell types, also known as multi-lattice structures. In such structures, abrupt transitions between geometries may cause stress concentrations, making the boundary a primary failure point; thus, transition regions should be created between each lattice cell type. Although computational approaches have been proposed, smooth transition regions are still difficult to intuit and design, especially between lattices of drastically different geometries. This work demonstrates and assesses a method for using variational autoencoders to automate the creation of transitional lattice cells. In particular, the work focuses on identifying the relationships that exist within the latent space produced by the variational autoencoder. Through computational experimentation, it was found that the smoothness of transition regions was higher when the endpoints were located closer together in the latent space.")
227
  with gradio.Column():
228
+ download = gradio.HTML("<a href=\"https://huggingface.co/spaces/cmudrc/wecnet/resolve/main/McComb2019_Chapter_TowardTheRapidDesignOfEngineer.pdf\" style=\"width: 60%; display: block; margin: auto;\"><img src=\"https://huggingface.co/spaces/cmudrc/wecnet/resolve/main/coverpage.png\"></a>")
229
 
230
  with gradio.Tab("Analysis"):
231
  with gradio.Tab("Spectrum from Dataset"):