Rimjhim Mittal commited on
Commit
93d9fe9
β€’
1 Parent(s): 7a4280c

made a much better UI

Browse files
pages/3_πŸ“ˆ_Arc_Functions.py β†’ Arc_Functions.py RENAMED
@@ -13,13 +13,14 @@ def run_streamlit_app():
13
  st.markdown(introduction)
14
  input_value = st.number_input("Input Value for arctan_node", value=1.0)
15
 
16
- if st.button("Show Computational Graph"):
 
17
  image_path = main(input_value=input_value, mode="graph")
18
  if image_path and os.path.exists(image_path):
19
  st.image(image_path, caption="Model Graph Visualization")
20
  else:
21
  st.error("Error generating the graph.")
22
- if st.button("Execute"):
23
  results = main(input_value=input_value, mode="run")
24
  if results:
25
  st.write("### Results")
 
13
  st.markdown(introduction)
14
  input_value = st.number_input("Input Value for arctan_node", value=1.0)
15
 
16
+ col1, col2 = st.columns(2)
17
+ with col1:
18
  image_path = main(input_value=input_value, mode="graph")
19
  if image_path and os.path.exists(image_path):
20
  st.image(image_path, caption="Model Graph Visualization")
21
  else:
22
  st.error("Error generating the graph.")
23
+ with col2:
24
  results = main(input_value=input_value, mode="run")
25
  if results:
26
  st.write("### Results")
pages/2_πŸ‘Ύ_Newton_Law_Of_Cooling.py β†’ Newton_Law_Of_Cooling.py RENAMED
@@ -38,12 +38,12 @@ def run_simulation(mod_graph, duration=100, dt=0.1, mode=None, mod = None):
38
 
39
  def main():
40
  st.title("❄️ Newton Cooling Model Simulator")
41
- with open("./markdowns/css.md") as file:
42
- custom_styles = file.read()
43
  with open("./markdowns/introduction.md") as file:
44
  introduction = file.read()
45
  st.markdown(introduction)
46
- st.markdown(custom_styles, unsafe_allow_html=True)
47
 
48
 
49
  if "mod_graph" not in st.session_state:
@@ -57,9 +57,8 @@ def main():
57
  with col2:
58
  duration = st.number_input("Duration", value=100)
59
  dt = st.number_input("Time Step", value=0.1)
60
-
61
- button_label = "Re-Run" if "run_once" in st.session_state else "Run Simulation"
62
- if st.button(button_label):
63
  update_model_parameters(cooling_coeff, T_a)
64
  times, temperatures = run_simulation(st.session_state.mod_graph, duration, dt, mode="run", mod = st.session_state.mod)
65
  times = times[1:] # Adjust based on your needs
@@ -73,7 +72,7 @@ def main():
73
  # temperatures = temperatures # Adjust based on your needs
74
  st.line_chart(chart_data, use_container_width=True, height=400, x="Time (s)", y="Temperature (K)")
75
  st.session_state.run_once = True
76
- if st.button("Show Computational Graph"):
77
  # from IPython.display import Image
78
  image_path = run_simulation(st.session_state.mod_graph, duration, dt, mode="graph", mod=st.session_state.mod)
79
  st.image(image_path, caption="Model Graph Visualization")
 
38
 
39
  def main():
40
  st.title("❄️ Newton Cooling Model Simulator")
41
+ # with open("./markdowns/css.md") as file:
42
+ # custom_styles = file.read()
43
  with open("./markdowns/introduction.md") as file:
44
  introduction = file.read()
45
  st.markdown(introduction)
46
+ # st.markdown(custom_styles, unsafe_allow_html=True)
47
 
48
 
49
  if "mod_graph" not in st.session_state:
 
57
  with col2:
58
  duration = st.number_input("Duration", value=100)
59
  dt = st.number_input("Time Step", value=0.1)
60
+ col1, col2 = st.columns(2)
61
+ with col1:
 
62
  update_model_parameters(cooling_coeff, T_a)
63
  times, temperatures = run_simulation(st.session_state.mod_graph, duration, dt, mode="run", mod = st.session_state.mod)
64
  times = times[1:] # Adjust based on your needs
 
72
  # temperatures = temperatures # Adjust based on your needs
73
  st.line_chart(chart_data, use_container_width=True, height=400, x="Time (s)", y="Temperature (K)")
74
  st.session_state.run_once = True
75
+ with col2:
76
  # from IPython.display import Image
77
  image_path = run_simulation(st.session_state.mod_graph, duration, dt, mode="graph", mod=st.session_state.mod)
78
  st.image(image_path, caption="Model Graph Visualization")
pages/1_∿_Sine_Approximator.py β†’ Sine_Approximator.py RENAMED
@@ -8,7 +8,7 @@ import onnx
8
  import pandas as pd
9
  import os
10
  import sys
11
-
12
  graphviz_bin_dir = os.path.join(sys.prefix, "bin")
13
  os.environ["PATH"] += os.pathsep + graphviz_bin_dir
14
 
@@ -26,6 +26,9 @@ class SineApproximator(nn.Module):
26
  def forward(self, x):
27
  return self.network(x)
28
 
 
 
 
29
  def train_sine_model(model, epochs=1000, learning_rate=0.01):
30
  X = torch.unsqueeze(torch.linspace(-np.pi, np.pi, 200), dim=1)
31
  Y = torch.sin(X)
@@ -33,6 +36,10 @@ def train_sine_model(model, epochs=1000, learning_rate=0.01):
33
  loss_func = nn.MSELoss()
34
  optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate)
35
 
 
 
 
 
36
  for epoch in range(epochs):
37
  prediction = model(X)
38
  loss = loss_func(prediction, Y)
@@ -41,10 +48,15 @@ def train_sine_model(model, epochs=1000, learning_rate=0.01):
41
  loss.backward()
42
  optimizer.step()
43
 
44
- # if epoch % 100 == 0:
45
- # st.write(f'Epoch {epoch}, Loss {loss.item()}')
46
 
47
- st.success("Training complete.")
 
 
 
 
 
48
 
49
  def export_to_onnx(model):
50
  dummy_input = torch.tensor([[0.0]])
@@ -72,6 +84,7 @@ def plot_sine_curve(model):
72
 
73
 
74
  def main():
 
75
  # Streamlit UI setup
76
  st.title("Sine Function Approximator")
77
 
@@ -89,34 +102,34 @@ def main():
89
  epochs = st.slider("Epochs", min_value=0, max_value=100, value=50)
90
  graph_col1, graph_col2 = st.columns(2)
91
  with graph_col1:
92
- if st.button("Train Model"):
93
- model = SineApproximator()
94
- train_sine_model(model, epochs, learning_rate)
95
- export_to_onnx(model)
96
- plot_sine_curve(model)
97
- onnx_model = onnx.load("./sine_approximator.onnx")
98
- mdf_model = onnx_to_mdf(onnx_model)
99
- mdf_model.to_json_file("sine_approximator.json")
100
- mdf_model.to_yaml_file("sine_approximator.yaml")
101
- st.success("Conversion to MDF complete. Files saved as sine_approximator.json and sine_approximator.yaml")
102
  with graph_col2:
103
- if st.button("Generate Graph"):
104
- onnx_model = onnx.load("sine_approximator.onnx")
105
- mdf_model = onnx_to_mdf(onnx_model)
106
- mdf_model.to_graph_image(
107
- engine="dot",
108
- output_format="png",
109
- view_on_render=False,
110
- level=3,
111
- filename_root="sine_approximator",
112
- only_warn_on_fail=True,
113
- )
114
- # st.image("sine_approximator.png", caption="Model Graph Visualization")
115
- from IPython.display import Image
116
- Image(filename="sine_approximator.png")
117
- image_path = "./sine_approximator.png"
118
- st.image(image_path, caption="Model Graph Visualization")
119
- st.success('Graph generated successfully.')
120
  if __name__ == "__main__":
121
  main()
122
 
 
8
  import pandas as pd
9
  import os
10
  import sys
11
+ import time
12
  graphviz_bin_dir = os.path.join(sys.prefix, "bin")
13
  os.environ["PATH"] += os.pathsep + graphviz_bin_dir
14
 
 
26
  def forward(self, x):
27
  return self.network(x)
28
 
29
+ from time import sleep
30
+
31
+ # @st.cache(allow_output_mutation=True, suppress_st_warning=True)
32
  def train_sine_model(model, epochs=1000, learning_rate=0.01):
33
  X = torch.unsqueeze(torch.linspace(-np.pi, np.pi, 200), dim=1)
34
  Y = torch.sin(X)
 
36
  loss_func = nn.MSELoss()
37
  optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate)
38
 
39
+ progress_bar = st.progress(0)
40
+
41
+
42
+
43
  for epoch in range(epochs):
44
  prediction = model(X)
45
  loss = loss_func(prediction, Y)
 
48
  loss.backward()
49
  optimizer.step()
50
 
51
+ # Update progress bar and status text
52
+ progress_bar.progress((epoch + 1) / epochs)
53
 
54
+
55
+ # Dummy sleep to simulate long-running task
56
+ sleep(0.01)
57
+
58
+ progress_bar.empty()
59
+ return model
60
 
61
  def export_to_onnx(model):
62
  dummy_input = torch.tensor([[0.0]])
 
84
 
85
 
86
  def main():
87
+
88
  # Streamlit UI setup
89
  st.title("Sine Function Approximator")
90
 
 
102
  epochs = st.slider("Epochs", min_value=0, max_value=100, value=50)
103
  graph_col1, graph_col2 = st.columns(2)
104
  with graph_col1:
105
+ status_text = st.empty()
106
+ model = SineApproximator()
107
+ train_sine_model(model, epochs, learning_rate)
108
+ export_to_onnx(model)
109
+ plot_sine_curve(model)
110
+ onnx_model = onnx.load("./sine_approximator.onnx")
111
+ mdf_model = onnx_to_mdf(onnx_model)
112
+ mdf_model.to_json_file("sine_approximator.json")
113
+ mdf_model.to_yaml_file("sine_approximator.yaml")
114
+ status_text.success("Training complete.")
115
  with graph_col2:
116
+ onnx_model = onnx.load("sine_approximator.onnx")
117
+ mdf_model = onnx_to_mdf(onnx_model)
118
+ mdf_model.to_graph_image(
119
+ engine="dot",
120
+ output_format="png",
121
+ view_on_render=False,
122
+ level=3,
123
+ filename_root="sine_approximator",
124
+ only_warn_on_fail=True,
125
+ )
126
+ # st.image("sine_approximator.png", caption="Model Graph Visualization")
127
+ from IPython.display import Image
128
+ Image(filename="sine_approximator.png")
129
+ image_path = "./sine_approximator.png"
130
+ st.success('Graph generated successfully.')
131
+ st.image(image_path, caption="Model Graph Visualization")
132
+
133
  if __name__ == "__main__":
134
  main()
135
 
__pycache__/Arc_Functions.cpython-311.pyc ADDED
Binary file (2.72 kB). View file
 
__pycache__/Newton_Law_Of_Cooling.cpython-311.pyc ADDED
Binary file (6.95 kB). View file
 
__pycache__/Sine_Approximator.cpython-311.pyc ADDED
Binary file (8.57 kB). View file
 
app.py CHANGED
@@ -31,11 +31,16 @@ with col3:
31
  st.image(gmail_icon, width=30)
32
  st.markdown("[Email](mailto:rimjhimittal2003@gmail.com)", unsafe_allow_html=True)
33
 
 
 
 
 
34
  def main():
 
35
  with open("./markdowns/css.md") as file:
36
  custom_styles = file.read()
37
  st.markdown(custom_styles, unsafe_allow_html=True)
38
-
39
 
40
  if __name__ == "__main__":
41
  main()
 
31
  st.image(gmail_icon, width=30)
32
  st.markdown("[Email](mailto:rimjhimittal2003@gmail.com)", unsafe_allow_html=True)
33
 
34
+ def hide_pages(pages_to_hide):
35
+ for page in pages_to_hide:
36
+ st.sidebar.markdown(f"## {page}")
37
+
38
  def main():
39
+ hide_pages(["Arc_Functions", "Newton Cooling Model Simulator", "Arc Functions"])
40
  with open("./markdowns/css.md") as file:
41
  custom_styles = file.read()
42
  st.markdown(custom_styles, unsafe_allow_html=True)
43
+
44
 
45
  if __name__ == "__main__":
46
  main()
arc_functions ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ digraph arc_functions {
2
+ node [color="#444444" fontcolor="#444444" penwidth=1 shape=box style=rounded]
3
+ arctan_node [label=<<table border="0" cellborder="0"><tr><td colspan="2"><b>arctan_node</b></td></tr><tr><td><font color="#1666ff">input_value</font> = 1.0</td></tr><tr><td><font color="#1666ff">arctan_result</font> = <i>arctan</i>(<font color="#1666ff">input_value</font>, 0.4)</td></tr><tr><td><i>arctan(variable0, scale) = scale * arctan(variable0)</i></td></tr><tr><td><font color="#cc3355">output</font> = <font color="#1666ff">arctan_result</font> </td></tr></table>>]
4
+ node [color="#444444" fontcolor="#444444" penwidth=1 shape=box style=rounded]
5
+ arccos_node [label=<<table border="0" cellborder="0"><tr><td colspan="2"><b>arccos_node</b></td></tr><tr><td><font color="#188855">input_from_arctan</font> </td></tr><tr><td><font color="#1666ff">arccos_result</font> = <i>arccos</i>(<font color="#188855">input_from_arctan</font>, 0.3)</td></tr><tr><td><i>arccos(variable0, scale) = scale * arccos(variable0)</i></td></tr><tr><td><font color="#cc3355">output</font> = <font color="#1666ff">arccos_result</font> </td></tr></table>>]
6
+ node [color="#444444" fontcolor="#444444" penwidth=1 shape=box style=rounded]
7
+ arcsin_node [label=<<table border="0" cellborder="0"><tr><td colspan="2"><b>arcsin_node</b></td></tr><tr><td><font color="#188855">input_from_arccos</font> </td></tr><tr><td><font color="#1666ff">arcsin_result</font> = <i>arcsin</i>(<font color="#188855">input_from_arccos</font>, 0.2)</td></tr><tr><td><i>arcsin(variable0, scale) = scale * arcsin(variable0)</i></td></tr><tr><td><font color="#cc3355">output</font> = <font color="#1666ff">arcsin_result</font> </td></tr></table>>]
8
+ arctan_node -> arccos_node [label=<h (<font color="#cc3355">output</font> -&gt; <font color="#188855">input_from_arctan</font>)> arrowhead=empty]
9
+ arccos_node -> arcsin_node [label=<i (<font color="#cc3355">output</font> -&gt; <font color="#188855">input_from_arccos</font>)> arrowhead=empty]
10
+ }
arc_functions.png ADDED
markdowns/css.md CHANGED
@@ -1,5 +1,5 @@
1
  <style>
2
-
3
  .stApp {
4
  background-image: linear-gradient(to right, rgba(13, 19, 48, 1) 0%, rgba(30, 37, 88, 1) 50%, #084349 100%), url("https://dl.dropboxusercontent.com/scl/fi/vrlu5xm5uh7nj6tor97my/glow_bg-7-1.png?rlkey=raqq4j45y0ogyuvu4rgvjcc3a&dl=1");
5
  background-size: cover, cover;
@@ -39,7 +39,7 @@
39
  background-image: linear-gradient(to right, #5456F7, #27B1FF) !important;
40
  border: none !important;
41
  color: white !important;
42
- }
43
 
44
  </style>
45
 
 
1
  <style>
2
+ /*
3
  .stApp {
4
  background-image: linear-gradient(to right, rgba(13, 19, 48, 1) 0%, rgba(30, 37, 88, 1) 50%, #084349 100%), url("https://dl.dropboxusercontent.com/scl/fi/vrlu5xm5uh7nj6tor97my/glow_bg-7-1.png?rlkey=raqq4j45y0ogyuvu4rgvjcc3a&dl=1");
5
  background-size: cover, cover;
 
39
  background-image: linear-gradient(to right, #5456F7, #27B1FF) !important;
40
  border: none !important;
41
  color: white !important;
42
+ } */
43
 
44
  </style>
45
 
model_graph ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ digraph cooling_process {
2
+ graph [rankdir=LR]
3
+ node [color="#444444" fontcolor="#444444" penwidth=1 shape=box style=rounded]
4
+ node1 [label=<<table border="0" cellborder="0"><tr><td colspan="2"><b>node1</b></td></tr><tr><td><font color="#1666ff">cooling_coeff</font> = 0.1</td></tr><tr><td><font color="#1666ff">T_a</font> = 20</td></tr><tr><td><b><font color="#1666ff">T_curr</font></b> = <i>def init value:</i> 90, <i>d/dt:</i> <font color="#1666ff">dT_dt</font></td></tr><tr><td><b><font color="#1666ff">dT_dt</font></b> = -<font color="#1666ff">cooling_coeff</font>*(<font color="#1666ff">T_curr</font> - <font color="#1666ff">T_a</font>)<i>def init value:</i> 0</td></tr><tr><td><font color="#cc3355">out_port</font> = <font color="#1666ff">T_curr</font> </td></tr></table>>]
5
+ }
model_graph.png ADDED
models/__pycache__/arc_functions.cpython-311.pyc CHANGED
Binary files a/models/__pycache__/arc_functions.cpython-311.pyc and b/models/__pycache__/arc_functions.cpython-311.pyc differ
 
models/__pycache__/execute.cpython-311.pyc ADDED
Binary file (58 kB). View file
 
models/arc_functions.py CHANGED
@@ -87,7 +87,6 @@ def main(input_value=1.0, mode=None):
87
  view_on_render=False,
88
  level=3,
89
  filename_root="arc_functions",
90
- is_horizontal=True
91
  )
92
 
93
  return image_path
 
87
  view_on_render=False,
88
  level=3,
89
  filename_root="arc_functions",
 
90
  )
91
 
92
  return image_path
pages/1_Model_Category_1.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from importlib import import_module
3
+
4
+ # Page configuration
5
+ st.set_page_config(page_title="Dynamic Model Selection", layout="wide")
6
+
7
+ # Model names and the corresponding module functions to be imported
8
+ model_functions = {
9
+ "Sine_Approximator": "main",
10
+ "Arc_Functions": "run_streamlit_app"
11
+ }
12
+
13
+ # Define the sidebar selection dropdown
14
+ model_name = st.sidebar.selectbox('Choose a model:', options=list(model_functions.keys()))
15
+
16
+ # Function to dynamically import and run the selected model's main function
17
+ def run_model(model_key):
18
+ module = import_module(model_key)
19
+ main_function = getattr(module, model_functions[model_key])
20
+ main_function()
21
+
22
+ # Run the selected model when the button is pressed
23
+ if st.sidebar.button('Run Model'):
24
+ run_model(model_name)
pages/2_Model_Category_2.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from importlib import import_module
3
+
4
+ # Page configuration
5
+ st.set_page_config(page_title="Dynamic Model Selection", layout="wide")
6
+
7
+ # Model names and the corresponding module functions to be imported
8
+ model_functions = {
9
+ "Newton_Law_Of_Cooling": "main",
10
+ "Arc_Functions": "run_streamlit_app"
11
+ }
12
+
13
+ # Define the sidebar selection dropdown
14
+ model_name = st.sidebar.selectbox('Choose a model:', options=list(model_functions.keys()))
15
+
16
+ # Function to dynamically import and run the selected model's main function
17
+ def run_model(model_key):
18
+ module = import_module(model_key)
19
+ main_function = getattr(module, model_functions[model_key])
20
+ main_function()
21
+
22
+ # Run the selected model when the button is pressed
23
+ if st.sidebar.button('Run Model'):
24
+ run_model(model_name)
sine_approximator ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ digraph main_graph {
2
+ node [color="#444444" fontcolor="#444444" penwidth=1 shape=box style=rounded]
3
+ "/network/network.0/Gemm" [label=<<table border="0" cellborder="0"><tr><td colspan="2"><b>/network/network.0/Gemm</b></td></tr><tr><td><font color="#188855">input</font> (shape: (1, 1), type: float)</td></tr><tr><td><font color="#188855">network.0.weight</font> (shape: (64, 1), type: float)</td></tr><tr><td><font color="#188855">network.0.bias</font> (shape: (64,), type: float)</td></tr><tr><td><font color="#1666ff">alpha</font> = 1.0</td></tr><tr><td><font color="#1666ff">beta</font> = 1.0</td></tr><tr><td><font color="#1666ff">transB</font> = 1</td></tr><tr><td><font color="#1666ff">/network/network.0/Gemm</font> = <i>onnx::Gemm</i>(<font color="#188855">input</font>, <font color="#188855">network.0.weight</font>, <font color="#188855">network.0.bias</font>)</td></tr><tr><td><i>onnx::Gemm(A, B, C) = onnx_ops.gemm(A, B, C, alpha, beta, transA, transB)</i></td></tr><tr><td><font color="#cc3355">_network_network.0_Gemm_output_0</font> = <font color="#1666ff">/network/network.0/Gemm</font> </td></tr></table>>]
4
+ node [color="#444444" fontcolor="#444444" penwidth=1 shape=box style=rounded]
5
+ "/network/network.1/Relu" [label=<<table border="0" cellborder="0"><tr><td colspan="2"><b>/network/network.1/Relu</b></td></tr><tr><td><font color="#188855">_network_network.0_Gemm_output_0</font> (shape: (1, 64), type: float)</td></tr><tr><td><font color="#1666ff">/network/network.1/Relu</font> = <i>onnx::Relu</i>(<font color="#188855">_network_network.0_Gemm_output_0</font>)</td></tr><tr><td><i>onnx::Relu(X) = onnx_ops.relu(X)</i></td></tr><tr><td><font color="#cc3355">_network_network.1_Relu_output_0</font> = <font color="#1666ff">/network/network.1/Relu</font> </td></tr></table>>]
6
+ node [color="#444444" fontcolor="#444444" penwidth=1 shape=box style=rounded]
7
+ "/network/network.2/Gemm" [label=<<table border="0" cellborder="0"><tr><td colspan="2"><b>/network/network.2/Gemm</b></td></tr><tr><td><font color="#188855">_network_network.1_Relu_output_0</font> (shape: (1, 64), type: float)</td></tr><tr><td><font color="#188855">network.2.weight</font> (shape: (64, 64), type: float)</td></tr><tr><td><font color="#188855">network.2.bias</font> (shape: (64,), type: float)</td></tr><tr><td><font color="#1666ff">alpha</font> = 1.0</td></tr><tr><td><font color="#1666ff">beta</font> = 1.0</td></tr><tr><td><font color="#1666ff">transB</font> = 1</td></tr><tr><td><font color="#1666ff">/network/network.2/Gemm</font> = <i>onnx::Gemm</i>(<font color="#188855">_network_network.1_Relu_output_0</font>, <font color="#188855">network.2.weight</font>, <font color="#188855">network.2.bias</font>)</td></tr><tr><td><i>onnx::Gemm(A, B, C) = onnx_ops.gemm(A, B, C, alpha, beta, transA, transB)</i></td></tr><tr><td><font color="#cc3355">_network_network.2_Gemm_output_0</font> = <font color="#1666ff">/network/network.2/Gemm</font> </td></tr></table>>]
8
+ node [color="#444444" fontcolor="#444444" penwidth=1 shape=box style=rounded]
9
+ "/network/network.3/Relu" [label=<<table border="0" cellborder="0"><tr><td colspan="2"><b>/network/network.3/Relu</b></td></tr><tr><td><font color="#188855">_network_network.2_Gemm_output_0</font> (shape: (1, 64), type: float)</td></tr><tr><td><font color="#1666ff">/network/network.3/Relu</font> = <i>onnx::Relu</i>(<font color="#188855">_network_network.2_Gemm_output_0</font>)</td></tr><tr><td><i>onnx::Relu(X) = onnx_ops.relu(X)</i></td></tr><tr><td><font color="#cc3355">_network_network.3_Relu_output_0</font> = <font color="#1666ff">/network/network.3/Relu</font> </td></tr></table>>]
10
+ node [color="#444444" fontcolor="#444444" penwidth=1 shape=box style=rounded]
11
+ "/network/network.4/Gemm" [label=<<table border="0" cellborder="0"><tr><td colspan="2"><b>/network/network.4/Gemm</b></td></tr><tr><td><font color="#188855">_network_network.3_Relu_output_0</font> (shape: (1, 64), type: float)</td></tr><tr><td><font color="#188855">network.4.weight</font> (shape: (1, 64), type: float)</td></tr><tr><td><font color="#188855">network.4.bias</font> (shape: (1,), type: float)</td></tr><tr><td><font color="#1666ff">alpha</font> = 1.0</td></tr><tr><td><font color="#1666ff">beta</font> = 1.0</td></tr><tr><td><font color="#1666ff">transB</font> = 1</td></tr><tr><td><font color="#1666ff">/network/network.4/Gemm</font> = <i>onnx::Gemm</i>(<font color="#188855">_network_network.3_Relu_output_0</font>, <font color="#188855">network.4.weight</font>, <font color="#188855">network.4.bias</font>)</td></tr><tr><td><i>onnx::Gemm(A, B, C) = onnx_ops.gemm(A, B, C, alpha, beta, transA, transB)</i></td></tr><tr><td><font color="#cc3355">output</font> = <font color="#1666ff">/network/network.4/Gemm</font> </td></tr></table>>]
12
+ "/network/network.0/Gemm" -> "/network/network.1/Relu" [label=</network/network.0/Gemm._network_network.0_Gemm_output_0_/network/network.1/Relu._network_network.0_Gemm_output_0 (<font color="#cc3355">_network_network.0_Gemm_output_0</font> -&gt; <font color="#188855">_network_network.0_Gemm_output_0</font>)> arrowhead=empty]
13
+ "/network/network.1/Relu" -> "/network/network.2/Gemm" [label=</network/network.1/Relu._network_network.1_Relu_output_0_/network/network.2/Gemm._network_network.1_Relu_output_0 (<font color="#cc3355">_network_network.1_Relu_output_0</font> -&gt; <font color="#188855">_network_network.1_Relu_output_0</font>)> arrowhead=empty]
14
+ "/network/network.2/Gemm" -> "/network/network.3/Relu" [label=</network/network.2/Gemm._network_network.2_Gemm_output_0_/network/network.3/Relu._network_network.2_Gemm_output_0 (<font color="#cc3355">_network_network.2_Gemm_output_0</font> -&gt; <font color="#188855">_network_network.2_Gemm_output_0</font>)> arrowhead=empty]
15
+ "/network/network.3/Relu" -> "/network/network.4/Gemm" [label=</network/network.3/Relu._network_network.3_Relu_output_0_/network/network.4/Gemm._network_network.3_Relu_output_0 (<font color="#cc3355">_network_network.3_Relu_output_0</font> -&gt; <font color="#188855">_network_network.3_Relu_output_0</font>)> arrowhead=empty]
16
+ }
sine_approximator.json ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "ONNX Model": {
3
+ "format": "ModECI MDF v0.4",
4
+ "generating_application": "Python modeci-mdf v0.4.9",
5
+ "graphs": {
6
+ "main_graph": {
7
+ "nodes": {
8
+ "/network/network.0/Gemm": {
9
+ "input_ports": {
10
+ "input": {
11
+ "shape": [
12
+ 1,
13
+ 1
14
+ ],
15
+ "type": "float"
16
+ },
17
+ "network.0.weight": {
18
+ "shape": [
19
+ 64,
20
+ 1
21
+ ],
22
+ "type": "float"
23
+ },
24
+ "network.0.bias": {
25
+ "shape": [
26
+ 64
27
+ ],
28
+ "type": "float"
29
+ }
30
+ },
31
+ "parameters": {
32
+ "alpha": {
33
+ "value": 1.0
34
+ },
35
+ "beta": {
36
+ "value": 1.0
37
+ },
38
+ "transB": {
39
+ "value": 1
40
+ },
41
+ "/network/network.0/Gemm": {
42
+ "function": "onnx::Gemm",
43
+ "args": {
44
+ "A": "input",
45
+ "B": "network.0.weight",
46
+ "C": "network.0.bias"
47
+ }
48
+ }
49
+ },
50
+ "output_ports": {
51
+ "_network_network.0_Gemm_output_0": {
52
+ "value": "/network/network.0/Gemm"
53
+ }
54
+ }
55
+ },
56
+ "/network/network.1/Relu": {
57
+ "input_ports": {
58
+ "_network_network.0_Gemm_output_0": {
59
+ "shape": [
60
+ 1,
61
+ 64
62
+ ],
63
+ "type": "float"
64
+ }
65
+ },
66
+ "parameters": {
67
+ "/network/network.1/Relu": {
68
+ "function": "onnx::Relu",
69
+ "args": {
70
+ "X": "_network_network.0_Gemm_output_0"
71
+ }
72
+ }
73
+ },
74
+ "output_ports": {
75
+ "_network_network.1_Relu_output_0": {
76
+ "value": "/network/network.1/Relu"
77
+ }
78
+ }
79
+ },
80
+ "/network/network.2/Gemm": {
81
+ "input_ports": {
82
+ "_network_network.1_Relu_output_0": {
83
+ "shape": [
84
+ 1,
85
+ 64
86
+ ],
87
+ "type": "float"
88
+ },
89
+ "network.2.weight": {
90
+ "shape": [
91
+ 64,
92
+ 64
93
+ ],
94
+ "type": "float"
95
+ },
96
+ "network.2.bias": {
97
+ "shape": [
98
+ 64
99
+ ],
100
+ "type": "float"
101
+ }
102
+ },
103
+ "parameters": {
104
+ "alpha": {
105
+ "value": 1.0
106
+ },
107
+ "beta": {
108
+ "value": 1.0
109
+ },
110
+ "transB": {
111
+ "value": 1
112
+ },
113
+ "/network/network.2/Gemm": {
114
+ "function": "onnx::Gemm",
115
+ "args": {
116
+ "A": "_network_network.1_Relu_output_0",
117
+ "B": "network.2.weight",
118
+ "C": "network.2.bias"
119
+ }
120
+ }
121
+ },
122
+ "output_ports": {
123
+ "_network_network.2_Gemm_output_0": {
124
+ "value": "/network/network.2/Gemm"
125
+ }
126
+ }
127
+ },
128
+ "/network/network.3/Relu": {
129
+ "input_ports": {
130
+ "_network_network.2_Gemm_output_0": {
131
+ "shape": [
132
+ 1,
133
+ 64
134
+ ],
135
+ "type": "float"
136
+ }
137
+ },
138
+ "parameters": {
139
+ "/network/network.3/Relu": {
140
+ "function": "onnx::Relu",
141
+ "args": {
142
+ "X": "_network_network.2_Gemm_output_0"
143
+ }
144
+ }
145
+ },
146
+ "output_ports": {
147
+ "_network_network.3_Relu_output_0": {
148
+ "value": "/network/network.3/Relu"
149
+ }
150
+ }
151
+ },
152
+ "/network/network.4/Gemm": {
153
+ "input_ports": {
154
+ "_network_network.3_Relu_output_0": {
155
+ "shape": [
156
+ 1,
157
+ 64
158
+ ],
159
+ "type": "float"
160
+ },
161
+ "network.4.weight": {
162
+ "shape": [
163
+ 1,
164
+ 64
165
+ ],
166
+ "type": "float"
167
+ },
168
+ "network.4.bias": {
169
+ "shape": [
170
+ 1
171
+ ],
172
+ "type": "float"
173
+ }
174
+ },
175
+ "parameters": {
176
+ "alpha": {
177
+ "value": 1.0
178
+ },
179
+ "beta": {
180
+ "value": 1.0
181
+ },
182
+ "transB": {
183
+ "value": 1
184
+ },
185
+ "/network/network.4/Gemm": {
186
+ "function": "onnx::Gemm",
187
+ "args": {
188
+ "A": "_network_network.3_Relu_output_0",
189
+ "B": "network.4.weight",
190
+ "C": "network.4.bias"
191
+ }
192
+ }
193
+ },
194
+ "output_ports": {
195
+ "output": {
196
+ "value": "/network/network.4/Gemm"
197
+ }
198
+ }
199
+ }
200
+ },
201
+ "edges": {
202
+ "/network/network.0/Gemm._network_network.0_Gemm_output_0_/network/network.1/Relu._network_network.0_Gemm_output_0": {
203
+ "sender": "/network/network.0/Gemm",
204
+ "receiver": "/network/network.1/Relu",
205
+ "sender_port": "_network_network.0_Gemm_output_0",
206
+ "receiver_port": "_network_network.0_Gemm_output_0"
207
+ },
208
+ "/network/network.1/Relu._network_network.1_Relu_output_0_/network/network.2/Gemm._network_network.1_Relu_output_0": {
209
+ "sender": "/network/network.1/Relu",
210
+ "receiver": "/network/network.2/Gemm",
211
+ "sender_port": "_network_network.1_Relu_output_0",
212
+ "receiver_port": "_network_network.1_Relu_output_0"
213
+ },
214
+ "/network/network.2/Gemm._network_network.2_Gemm_output_0_/network/network.3/Relu._network_network.2_Gemm_output_0": {
215
+ "sender": "/network/network.2/Gemm",
216
+ "receiver": "/network/network.3/Relu",
217
+ "sender_port": "_network_network.2_Gemm_output_0",
218
+ "receiver_port": "_network_network.2_Gemm_output_0"
219
+ },
220
+ "/network/network.3/Relu._network_network.3_Relu_output_0_/network/network.4/Gemm._network_network.3_Relu_output_0": {
221
+ "sender": "/network/network.3/Relu",
222
+ "receiver": "/network/network.4/Gemm",
223
+ "sender_port": "_network_network.3_Relu_output_0",
224
+ "receiver_port": "_network_network.3_Relu_output_0"
225
+ }
226
+ }
227
+ }
228
+ }
229
+ }
230
+ }
sine_approximator.onnx CHANGED
Binary files a/sine_approximator.onnx and b/sine_approximator.onnx differ
 
sine_approximator.png CHANGED
sine_approximator.yaml ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ONNX Model:
2
+ format: ModECI MDF v0.4
3
+ generating_application: Python modeci-mdf v0.4.9
4
+ graphs:
5
+ main_graph:
6
+ nodes:
7
+ /network/network.0/Gemm:
8
+ input_ports:
9
+ input:
10
+ shape:
11
+ - 1
12
+ - 1
13
+ type: float
14
+ network.0.weight:
15
+ shape:
16
+ - 64
17
+ - 1
18
+ type: float
19
+ network.0.bias:
20
+ shape:
21
+ - 64
22
+ type: float
23
+ parameters:
24
+ alpha:
25
+ value: 1.0
26
+ beta:
27
+ value: 1.0
28
+ transB:
29
+ value: 1
30
+ /network/network.0/Gemm:
31
+ function: onnx::Gemm
32
+ args:
33
+ A: input
34
+ B: network.0.weight
35
+ C: network.0.bias
36
+ output_ports:
37
+ _network_network.0_Gemm_output_0:
38
+ value: /network/network.0/Gemm
39
+ /network/network.1/Relu:
40
+ input_ports:
41
+ _network_network.0_Gemm_output_0:
42
+ shape:
43
+ - 1
44
+ - 64
45
+ type: float
46
+ parameters:
47
+ /network/network.1/Relu:
48
+ function: onnx::Relu
49
+ args:
50
+ X: _network_network.0_Gemm_output_0
51
+ output_ports:
52
+ _network_network.1_Relu_output_0:
53
+ value: /network/network.1/Relu
54
+ /network/network.2/Gemm:
55
+ input_ports:
56
+ _network_network.1_Relu_output_0:
57
+ shape:
58
+ - 1
59
+ - 64
60
+ type: float
61
+ network.2.weight:
62
+ shape:
63
+ - 64
64
+ - 64
65
+ type: float
66
+ network.2.bias:
67
+ shape:
68
+ - 64
69
+ type: float
70
+ parameters:
71
+ alpha:
72
+ value: 1.0
73
+ beta:
74
+ value: 1.0
75
+ transB:
76
+ value: 1
77
+ /network/network.2/Gemm:
78
+ function: onnx::Gemm
79
+ args:
80
+ A: _network_network.1_Relu_output_0
81
+ B: network.2.weight
82
+ C: network.2.bias
83
+ output_ports:
84
+ _network_network.2_Gemm_output_0:
85
+ value: /network/network.2/Gemm
86
+ /network/network.3/Relu:
87
+ input_ports:
88
+ _network_network.2_Gemm_output_0:
89
+ shape:
90
+ - 1
91
+ - 64
92
+ type: float
93
+ parameters:
94
+ /network/network.3/Relu:
95
+ function: onnx::Relu
96
+ args:
97
+ X: _network_network.2_Gemm_output_0
98
+ output_ports:
99
+ _network_network.3_Relu_output_0:
100
+ value: /network/network.3/Relu
101
+ /network/network.4/Gemm:
102
+ input_ports:
103
+ _network_network.3_Relu_output_0:
104
+ shape:
105
+ - 1
106
+ - 64
107
+ type: float
108
+ network.4.weight:
109
+ shape:
110
+ - 1
111
+ - 64
112
+ type: float
113
+ network.4.bias:
114
+ shape:
115
+ - 1
116
+ type: float
117
+ parameters:
118
+ alpha:
119
+ value: 1.0
120
+ beta:
121
+ value: 1.0
122
+ transB:
123
+ value: 1
124
+ /network/network.4/Gemm:
125
+ function: onnx::Gemm
126
+ args:
127
+ A: _network_network.3_Relu_output_0
128
+ B: network.4.weight
129
+ C: network.4.bias
130
+ output_ports:
131
+ output:
132
+ value: /network/network.4/Gemm
133
+ edges:
134
+ /network/network.0/Gemm._network_network.0_Gemm_output_0_/network/network.1/Relu._network_network.0_Gemm_output_0:
135
+ sender: /network/network.0/Gemm
136
+ receiver: /network/network.1/Relu
137
+ sender_port: _network_network.0_Gemm_output_0
138
+ receiver_port: _network_network.0_Gemm_output_0
139
+ /network/network.1/Relu._network_network.1_Relu_output_0_/network/network.2/Gemm._network_network.1_Relu_output_0:
140
+ sender: /network/network.1/Relu
141
+ receiver: /network/network.2/Gemm
142
+ sender_port: _network_network.1_Relu_output_0
143
+ receiver_port: _network_network.1_Relu_output_0
144
+ /network/network.2/Gemm._network_network.2_Gemm_output_0_/network/network.3/Relu._network_network.2_Gemm_output_0:
145
+ sender: /network/network.2/Gemm
146
+ receiver: /network/network.3/Relu
147
+ sender_port: _network_network.2_Gemm_output_0
148
+ receiver_port: _network_network.2_Gemm_output_0
149
+ /network/network.3/Relu._network_network.3_Relu_output_0_/network/network.4/Gemm._network_network.3_Relu_output_0:
150
+ sender: /network/network.3/Relu
151
+ receiver: /network/network.4/Gemm
152
+ sender_port: _network_network.3_Relu_output_0
153
+ receiver_port: _network_network.3_Relu_output_0