Merge pull request #8 from ModECI/development
Browse files- .DS_Store +0 -0
- .gitattributes +35 -0
- .streamlit/config.toml +6 -0
- README.md +12 -2
- app.py +337 -0
- environment.yml +9 -0
- examples/ABCD.json +185 -0
- examples/ABCD.mdf.json +522 -0
- examples/Arrays.json +93 -0
- examples/FN.mdf.json +144 -0
- examples/IAFs.json +241 -0
- examples/IzhikevichTest.mdf.json +196 -0
- examples/NewtonCoolingModel.json +54 -0
- examples/RNNs.json +197 -0
- examples/Simple.json +73 -0
- examples/States.json +54 -0
- examples/inception.json +0 -0
- examples/switched_rlc_circuit.json +90 -0
- logo.jpg +0 -0
- packages.txt +1 -0
- requirements.txt +9 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
.streamlit/config.toml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[theme]
|
| 2 |
+
primaryColor="#f6b17a"
|
| 3 |
+
backgroundColor="#04043B"
|
| 4 |
+
secondaryBackgroundColor="#424971"
|
| 5 |
+
textColor="#ffffff"
|
| 6 |
+
|
README.md
CHANGED
|
@@ -1,2 +1,12 @@
|
|
| 1 |
-
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Model Description Format
|
| 3 |
+
emoji: 🐠
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.37.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st, pandas as pd, os, io
|
| 2 |
+
from modeci_mdf.mdf import Model, Graph, Node, Parameter, OutputPort
|
| 3 |
+
from modeci_mdf.utils import load_mdf_json, load_mdf, load_mdf_yaml
|
| 4 |
+
from modeci_mdf.execution_engine import EvaluableGraph, EvaluableOutput
|
| 5 |
+
import json
|
| 6 |
+
import numpy as np
|
| 7 |
+
import requests
|
| 8 |
+
st.set_page_config(layout="wide", page_icon="logo.png", page_title="Model Description Format", menu_items={
|
| 9 |
+
'Report a bug': "https://github.com/ModECI/MDF/",
|
| 10 |
+
'About': "ModECI (Model Exchange and Convergence Initiative) is a multi-investigator collaboration that aims to develop a standardized format for exchanging computational models across diverse software platforms and domains of scientific research and technology development, with a particular focus on neuroscience, Machine Learning and Artificial Intelligence. Refer to https://modeci.org/ for more."
|
| 11 |
+
})
|
| 12 |
+
|
| 13 |
+
def reset_simulation_state():
|
| 14 |
+
"""Reset simulation-related session state variables."""
|
| 15 |
+
if 'simulation_results' in st.session_state:
|
| 16 |
+
del st.session_state.simulation_results
|
| 17 |
+
if 'selected_columns' in st.session_state:
|
| 18 |
+
del st.session_state.selected_columns
|
| 19 |
+
|
| 20 |
+
def run_simulation(param_inputs, mdf_model, stateful):
|
| 21 |
+
mod_graph = mdf_model.graphs[0]
|
| 22 |
+
nodes = mod_graph.nodes
|
| 23 |
+
all_node_results = {}
|
| 24 |
+
if stateful:
|
| 25 |
+
duration = param_inputs["Simulation Duration (s)"]
|
| 26 |
+
dt = param_inputs["Time Step (s)"]
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
for node in nodes:
|
| 31 |
+
eg = EvaluableGraph(mod_graph, verbose=False)
|
| 32 |
+
t = 0
|
| 33 |
+
times = []
|
| 34 |
+
node_outputs = {op.value : [] for op in node.output_ports}
|
| 35 |
+
node_outputs['Time'] = []
|
| 36 |
+
|
| 37 |
+
while t <= duration:
|
| 38 |
+
times.append(t)
|
| 39 |
+
if t == 0:
|
| 40 |
+
eg.evaluate()
|
| 41 |
+
else:
|
| 42 |
+
eg.evaluate(time_increment=dt)
|
| 43 |
+
|
| 44 |
+
node_outputs['Time'].append(t)
|
| 45 |
+
for op in node.output_ports:
|
| 46 |
+
eval_param = eg.enodes[node.id].evaluable_outputs[op.id]
|
| 47 |
+
output_value = eval_param.curr_value
|
| 48 |
+
if isinstance(output_value, (list, np.ndarray)):
|
| 49 |
+
scalar_value = output_value[0] if len(output_value) > 0 else np.nan
|
| 50 |
+
node_outputs[op.value].append(float(scalar_value))
|
| 51 |
+
else:
|
| 52 |
+
node_outputs[op.value].append(float(output_value))
|
| 53 |
+
t += dt
|
| 54 |
+
|
| 55 |
+
all_node_results[node.id] = pd.DataFrame(node_outputs).set_index('Time')
|
| 56 |
+
|
| 57 |
+
return all_node_results
|
| 58 |
+
else:
|
| 59 |
+
for node in nodes:
|
| 60 |
+
eg = EvaluableGraph(mod_graph, verbose=False)
|
| 61 |
+
eg.evaluate()
|
| 62 |
+
all_node_results[node.id] = pd.DataFrame({op.value: [float(eg.enodes[node.id].evaluable_outputs[op.id].curr_value)] for op in node.output_ports})
|
| 63 |
+
|
| 64 |
+
return all_node_results
|
| 65 |
+
def show_simulation_results(all_node_results, stateful_nodes):
|
| 66 |
+
if all_node_results is not None:
|
| 67 |
+
for node_id, chart_data in all_node_results.items():
|
| 68 |
+
st.subheader(f"Results for Node: {node_id}")
|
| 69 |
+
if node_id in stateful_nodes:
|
| 70 |
+
if 'selected_columns' not in st.session_state:
|
| 71 |
+
st.session_state.selected_columns = {node_id: {col: True for col in chart_data.columns}}
|
| 72 |
+
elif node_id not in st.session_state.selected_columns:
|
| 73 |
+
st.session_state.selected_columns[node_id] = {col: True for col in chart_data.columns}
|
| 74 |
+
columns = chart_data.columns
|
| 75 |
+
for column in columns:
|
| 76 |
+
st.checkbox(
|
| 77 |
+
f"{column}",
|
| 78 |
+
value=st.session_state.selected_columns[node_id][column],
|
| 79 |
+
key=f"checkbox_{node_id}_{column}",
|
| 80 |
+
on_change=update_selected_columns,
|
| 81 |
+
args=(node_id, column,)
|
| 82 |
+
)
|
| 83 |
+
|
| 84 |
+
# Filter the data based on selected checkboxes
|
| 85 |
+
filtered_data = chart_data[[col for col, selected in st.session_state.selected_columns[node_id].items() if selected]]
|
| 86 |
+
|
| 87 |
+
# Display the line chart with filtered data
|
| 88 |
+
st.line_chart(filtered_data, use_container_width=True, height=400)
|
| 89 |
+
else:
|
| 90 |
+
st.write(all_node_results[node_id])
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def update_selected_columns(node_id, column):
|
| 94 |
+
st.session_state.selected_columns[node_id][column] = st.session_state[f"checkbox_{node_id}_{column}"]
|
| 95 |
+
|
| 96 |
+
def show_mdf_graph(mdf_model):
|
| 97 |
+
st.subheader("MDF Graph")
|
| 98 |
+
mdf_model.to_graph_image(engine="dot", output_format="png", view_on_render=False, level=3, filename_root=mdf_model.id, only_warn_on_fail=(os.name == "nt"))
|
| 99 |
+
image_path = mdf_model.id + ".png"
|
| 100 |
+
st.image(image_path, caption="Model Graph Visualization")
|
| 101 |
+
|
| 102 |
+
def show_json_output(mdf_model):
|
| 103 |
+
st.subheader("JSON Model")
|
| 104 |
+
st.json(mdf_model.to_json())
|
| 105 |
+
|
| 106 |
+
# st.cache_data()
|
| 107 |
+
def view_tabs(mdf_model, param_inputs, stateful): # view
|
| 108 |
+
tab1, tab2, tab3 = st.tabs(["Simulation Results", "MDF Graph", "Json Model"])
|
| 109 |
+
with tab1:
|
| 110 |
+
if stateful:
|
| 111 |
+
if 'simulation_results' not in st.session_state:
|
| 112 |
+
st.session_state.simulation_results = None
|
| 113 |
+
|
| 114 |
+
if st.session_state.simulation_results is not None:
|
| 115 |
+
show_simulation_results(st.session_state.simulation_results, stateful)
|
| 116 |
+
else:
|
| 117 |
+
st.write("Run the simulation to see results.") # model
|
| 118 |
+
else:
|
| 119 |
+
if 'simulation_results' not in st.session_state:
|
| 120 |
+
st.session_state.simulation_results = None
|
| 121 |
+
|
| 122 |
+
if st.session_state.simulation_results is not None:
|
| 123 |
+
show_simulation_results(st.session_state.simulation_results, stateful)
|
| 124 |
+
else:
|
| 125 |
+
st.write("Stateless.")
|
| 126 |
+
|
| 127 |
+
with tab2:
|
| 128 |
+
show_mdf_graph(mdf_model) # view
|
| 129 |
+
with tab3:
|
| 130 |
+
show_json_output(mdf_model) # view
|
| 131 |
+
|
| 132 |
+
def display_and_edit_array(array, key):
|
| 133 |
+
if isinstance(array, list):
|
| 134 |
+
array = np.array(array)
|
| 135 |
+
|
| 136 |
+
rows, cols = array.shape if array.ndim > 1 else (1, len(array))
|
| 137 |
+
|
| 138 |
+
edited_array = []
|
| 139 |
+
for i in range(rows):
|
| 140 |
+
row = []
|
| 141 |
+
for j in range(cols):
|
| 142 |
+
value = array[i][j] if array.ndim > 1 else array[i]
|
| 143 |
+
edited_value = st.text_input(f"[{i}][{j}]", value=str(value), key=f"{key}_{i}_{j}")
|
| 144 |
+
try:
|
| 145 |
+
row.append(float(edited_value))
|
| 146 |
+
except ValueError:
|
| 147 |
+
st.error(f"Invalid input for [{i}][{j}]. Please enter a valid number.")
|
| 148 |
+
edited_array.append(row)
|
| 149 |
+
|
| 150 |
+
return np.array(edited_array)
|
| 151 |
+
|
| 152 |
+
def parameter_form_to_update_model_and_view(mdf_model):
|
| 153 |
+
mod_graph = mdf_model.graphs[0]
|
| 154 |
+
nodes = mod_graph.nodes
|
| 155 |
+
parameters = []
|
| 156 |
+
stateful_nodes = []
|
| 157 |
+
stateful = False
|
| 158 |
+
|
| 159 |
+
for node in nodes:
|
| 160 |
+
for param in node.parameters:
|
| 161 |
+
if param.is_stateful():
|
| 162 |
+
stateful_nodes.append(node.id)
|
| 163 |
+
stateful = True
|
| 164 |
+
break
|
| 165 |
+
else:
|
| 166 |
+
stateful = False
|
| 167 |
+
|
| 168 |
+
param_inputs = {}
|
| 169 |
+
if stateful:
|
| 170 |
+
if mdf_model.metadata:
|
| 171 |
+
preferred_duration = float(mdf_model.metadata.get("preferred_duration", 10))
|
| 172 |
+
preferred_dt = float(mdf_model.metadata.get("preferred_dt", 0.1))
|
| 173 |
+
else:
|
| 174 |
+
preferred_duration = 100
|
| 175 |
+
preferred_dt = 0.1
|
| 176 |
+
param_inputs["Simulation Duration (s)"] = preferred_duration
|
| 177 |
+
param_inputs["Time Step (s)"] = preferred_dt
|
| 178 |
+
|
| 179 |
+
with st.form(key="parameter_form"):
|
| 180 |
+
valid_inputs = True
|
| 181 |
+
st.write("Model Parameters:")
|
| 182 |
+
|
| 183 |
+
for node_index, node in enumerate(nodes):
|
| 184 |
+
with st.container(border=True):
|
| 185 |
+
st.write(f"Node: {node.id}")
|
| 186 |
+
|
| 187 |
+
# Create four columns for each node
|
| 188 |
+
col1, col2, col3, col4 = st.columns(4)
|
| 189 |
+
|
| 190 |
+
for i, param in enumerate(node.parameters):
|
| 191 |
+
if isinstance(param.value, str) or param.value is None:
|
| 192 |
+
continue
|
| 193 |
+
key = f"{param.id}_{node_index}_{i}"
|
| 194 |
+
|
| 195 |
+
# Alternate between columns
|
| 196 |
+
current_col = [col1, col2, col3, col4][i % 4]
|
| 197 |
+
|
| 198 |
+
with current_col:
|
| 199 |
+
if isinstance(param.value, (list, np.ndarray)):
|
| 200 |
+
st.write(f"{param.id}:")
|
| 201 |
+
value = display_and_edit_array(param.value, key)
|
| 202 |
+
else:
|
| 203 |
+
if param.metadata:
|
| 204 |
+
value = st.text_input(f"{param.metadata.get('description', param.id)} ({param.id})", value=str(param.value), key=key)
|
| 205 |
+
else:
|
| 206 |
+
value = st.text_input(f"{param.id}", value=str(param.value), key=key)
|
| 207 |
+
try:
|
| 208 |
+
param_inputs[param.id] = float(value)
|
| 209 |
+
except ValueError:
|
| 210 |
+
st.error(f"Invalid input for {param.id}. Please enter a valid number.")
|
| 211 |
+
valid_inputs = False
|
| 212 |
+
|
| 213 |
+
param_inputs[param.id] = value
|
| 214 |
+
if stateful:
|
| 215 |
+
st.write("Simulation Parameters:")
|
| 216 |
+
with st.container(border=True):
|
| 217 |
+
# Add Simulation Duration and Time Step inputs
|
| 218 |
+
col1, col2 = st.columns(2)
|
| 219 |
+
with col1:
|
| 220 |
+
sim_duration = st.text_input("Simulation Duration (s)", value=str(param_inputs["Simulation Duration (s)"]), key="sim_duration")
|
| 221 |
+
with col2:
|
| 222 |
+
time_step = st.text_input("Time Step (s)", value=str(param_inputs["Time Step (s)"]), key="time_step")
|
| 223 |
+
|
| 224 |
+
try:
|
| 225 |
+
param_inputs["Simulation Duration (s)"] = float(sim_duration)
|
| 226 |
+
except ValueError:
|
| 227 |
+
st.error("Invalid input for Simulation Duration. Please enter a valid number.")
|
| 228 |
+
valid_inputs = False
|
| 229 |
+
try:
|
| 230 |
+
param_inputs["Time Step (s)"] = float(time_step)
|
| 231 |
+
except ValueError:
|
| 232 |
+
st.error("Invalid input for Time Step. Please enter a valid number.")
|
| 233 |
+
valid_inputs = False
|
| 234 |
+
|
| 235 |
+
run_button = st.form_submit_button("Run Simulation")
|
| 236 |
+
|
| 237 |
+
if run_button:
|
| 238 |
+
if valid_inputs:
|
| 239 |
+
for node in nodes:
|
| 240 |
+
for param in node.parameters:
|
| 241 |
+
if param.id in param_inputs:
|
| 242 |
+
param.value = param_inputs[param.id]
|
| 243 |
+
st.session_state.simulation_results = run_simulation(param_inputs, mdf_model, stateful)
|
| 244 |
+
|
| 245 |
+
view_tabs(mdf_model, param_inputs, stateful_nodes)
|
| 246 |
+
|
| 247 |
+
def upload_file_and_load_to_model():
|
| 248 |
+
|
| 249 |
+
uploaded_file = st.sidebar.file_uploader("Choose a JSON/YAML/BSON file", type=["json", "yaml", "bson"])
|
| 250 |
+
github_url = st.sidebar.text_input("Enter GitHub raw file URL:", placeholder="Enter GitHub raw file URL")
|
| 251 |
+
example_models = {
|
| 252 |
+
"Newton Cooling Model": "./examples/NewtonCoolingModel.json",
|
| 253 |
+
# "ABCD": "./examples/ABCD.json",
|
| 254 |
+
"FN": "./examples/FN.mdf.json",
|
| 255 |
+
"States": "./examples/States.json",
|
| 256 |
+
"Swicthed RLC Circuit": "./examples/switched_rlc_circuit.json",
|
| 257 |
+
"Simple":"./examples/Simple.json",
|
| 258 |
+
# "Arrays":"./examples/Arrays.json",
|
| 259 |
+
# "RNN":"./examples/RNNs.json",
|
| 260 |
+
"IAF":"./examples/IAFs.json",
|
| 261 |
+
"Izhikevich Test":"./examples/IzhikevichTest.mdf.json"
|
| 262 |
+
}
|
| 263 |
+
selected_model = st.sidebar.selectbox("Choose an example model", list(example_models.keys()), index=None, placeholder="Dont have an MDF Model? Try some sample examples here!")
|
| 264 |
+
|
| 265 |
+
if uploaded_file is not None:
|
| 266 |
+
file_content = uploaded_file.getvalue()
|
| 267 |
+
file_extension = uploaded_file.name.split('.')[-1].lower()
|
| 268 |
+
return load_model_from_content(file_content, file_extension)
|
| 269 |
+
|
| 270 |
+
if github_url:
|
| 271 |
+
try:
|
| 272 |
+
response = requests.get(github_url)
|
| 273 |
+
response.raise_for_status()
|
| 274 |
+
file_content = response.content
|
| 275 |
+
file_extension = github_url.split('.')[-1].lower()
|
| 276 |
+
return load_model_from_content(file_content, file_extension)
|
| 277 |
+
except requests.RequestException as e:
|
| 278 |
+
st.error(f"Error loading file from GitHub: {e}")
|
| 279 |
+
return None
|
| 280 |
+
|
| 281 |
+
|
| 282 |
+
if selected_model:
|
| 283 |
+
return load_mdf_json(example_models[selected_model])
|
| 284 |
+
|
| 285 |
+
|
| 286 |
+
|
| 287 |
+
def load_model_from_content(file_content, file_extension):
|
| 288 |
+
try:
|
| 289 |
+
if file_extension == 'json':
|
| 290 |
+
json_data = json.loads(file_content)
|
| 291 |
+
mdf_model = Model.from_dict(json_data)
|
| 292 |
+
elif file_extension in ['yaml', 'yml']:
|
| 293 |
+
mdf_model = load_mdf_yaml(io.BytesIO(file_content))
|
| 294 |
+
else:
|
| 295 |
+
st.error("Unsupported file format. Please use JSON or YAML files.")
|
| 296 |
+
return None
|
| 297 |
+
|
| 298 |
+
st.session_state.original_mdf_model = mdf_model # Save the original model
|
| 299 |
+
st.session_state.mdf_model_yaml = mdf_model # Save the current model state
|
| 300 |
+
return mdf_model
|
| 301 |
+
except Exception as e:
|
| 302 |
+
st.error(f"Error loading model: {e}")
|
| 303 |
+
return None
|
| 304 |
+
|
| 305 |
+
|
| 306 |
+
def main():
|
| 307 |
+
if "checkbox" not in st.session_state:
|
| 308 |
+
st.session_state.checkbox = False
|
| 309 |
+
|
| 310 |
+
|
| 311 |
+
mdf_model = upload_file_and_load_to_model() # controller
|
| 312 |
+
|
| 313 |
+
if mdf_model:
|
| 314 |
+
header1, header2 = st.columns([1, 8], vertical_alignment="top")
|
| 315 |
+
with header1:
|
| 316 |
+
with st.container():
|
| 317 |
+
st.image("logo.jpg")
|
| 318 |
+
with header2:
|
| 319 |
+
with st.container():
|
| 320 |
+
st.title("MDF: "+ mdf_model.id)
|
| 321 |
+
|
| 322 |
+
parameter_form_to_update_model_and_view(mdf_model)
|
| 323 |
+
else:
|
| 324 |
+
header1, header2 = st.columns([1, 8], vertical_alignment="top")
|
| 325 |
+
with header1:
|
| 326 |
+
with st.container():
|
| 327 |
+
st.image("logo.jpg")
|
| 328 |
+
with header2:
|
| 329 |
+
with st.container():
|
| 330 |
+
st.title("Welcome to Model Description Format")
|
| 331 |
+
st.write("ModECI (Model Exchange and Convergence Initiative) is a multi-investigator collaboration that aims to develop a standardized format for exchanging computational models across diverse software platforms and domains of scientific research and technology development, with a particular focus on neuroscience, Machine Learning and Artificial Intelligence. Refer to https://modeci.org/ for more.")
|
| 332 |
+
st.header("Lets get started! Choose one of the following methods.")
|
| 333 |
+
if __name__ == "__main__":
|
| 334 |
+
main()
|
| 335 |
+
|
| 336 |
+
|
| 337 |
+
|
environment.yml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: my_environment
|
| 2 |
+
channels:
|
| 3 |
+
- defaults
|
| 4 |
+
dependencies:
|
| 5 |
+
- python
|
| 6 |
+
- pip
|
| 7 |
+
- modeci_mdf
|
| 8 |
+
- streamlit
|
| 9 |
+
- matplotlib
|
examples/ABCD.json
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ABCD": {
|
| 3 |
+
"format": "ModECI MDF v0.4",
|
| 4 |
+
"generating_application": "Python modeci-mdf v0.4.10",
|
| 5 |
+
"graphs": {
|
| 6 |
+
"abcd_example": {
|
| 7 |
+
"nodes": {
|
| 8 |
+
"input0": {
|
| 9 |
+
"metadata": {
|
| 10 |
+
"color": ".8 .8 .8"
|
| 11 |
+
},
|
| 12 |
+
"parameters": {
|
| 13 |
+
"input_level": {
|
| 14 |
+
"value": 0.0
|
| 15 |
+
}
|
| 16 |
+
},
|
| 17 |
+
"output_ports": {
|
| 18 |
+
"out_port": {
|
| 19 |
+
"value": "input_level"
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
},
|
| 23 |
+
"A": {
|
| 24 |
+
"metadata": {
|
| 25 |
+
"color": ".8 0 0"
|
| 26 |
+
},
|
| 27 |
+
"input_ports": {
|
| 28 |
+
"input_port1": {}
|
| 29 |
+
},
|
| 30 |
+
"parameters": {
|
| 31 |
+
"slope": {
|
| 32 |
+
"value": 1.1
|
| 33 |
+
},
|
| 34 |
+
"intercept": {
|
| 35 |
+
"value": 1.2
|
| 36 |
+
},
|
| 37 |
+
"linear_func": {
|
| 38 |
+
"function": "linear",
|
| 39 |
+
"args": {
|
| 40 |
+
"variable0": "input_port1",
|
| 41 |
+
"slope": "slope",
|
| 42 |
+
"intercept": "intercept"
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"output_ports": {
|
| 47 |
+
"out_port": {
|
| 48 |
+
"value": "linear_func"
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
},
|
| 52 |
+
"B": {
|
| 53 |
+
"metadata": {
|
| 54 |
+
"color": "0 .8 0"
|
| 55 |
+
},
|
| 56 |
+
"input_ports": {
|
| 57 |
+
"input_port1": {}
|
| 58 |
+
},
|
| 59 |
+
"parameters": {
|
| 60 |
+
"gain": {
|
| 61 |
+
"value": 2.1
|
| 62 |
+
},
|
| 63 |
+
"bias": {
|
| 64 |
+
"value": 2.2
|
| 65 |
+
},
|
| 66 |
+
"offset": {
|
| 67 |
+
"value": 2.3
|
| 68 |
+
},
|
| 69 |
+
"logistic_func": {
|
| 70 |
+
"function": "logistic",
|
| 71 |
+
"args": {
|
| 72 |
+
"variable0": "input_port1",
|
| 73 |
+
"gain": "gain",
|
| 74 |
+
"bias": "bias",
|
| 75 |
+
"offset": "offset"
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
"output_ports": {
|
| 80 |
+
"out_port": {
|
| 81 |
+
"value": "logistic_func"
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
},
|
| 85 |
+
"C": {
|
| 86 |
+
"metadata": {
|
| 87 |
+
"color": "0 0 .8"
|
| 88 |
+
},
|
| 89 |
+
"input_ports": {
|
| 90 |
+
"input_port1": {
|
| 91 |
+
"shape": [
|
| 92 |
+
1
|
| 93 |
+
]
|
| 94 |
+
}
|
| 95 |
+
},
|
| 96 |
+
"parameters": {
|
| 97 |
+
"scale": {
|
| 98 |
+
"value": 3.1
|
| 99 |
+
},
|
| 100 |
+
"rate": {
|
| 101 |
+
"value": 3.2
|
| 102 |
+
},
|
| 103 |
+
"bias": {
|
| 104 |
+
"value": 3.3
|
| 105 |
+
},
|
| 106 |
+
"offset": {
|
| 107 |
+
"value": 3.4
|
| 108 |
+
},
|
| 109 |
+
"exponential_func": {
|
| 110 |
+
"function": "exponential",
|
| 111 |
+
"args": {
|
| 112 |
+
"variable0": "input_port1",
|
| 113 |
+
"scale": "scale",
|
| 114 |
+
"rate": "rate",
|
| 115 |
+
"bias": "bias",
|
| 116 |
+
"offset": "offset"
|
| 117 |
+
}
|
| 118 |
+
}
|
| 119 |
+
},
|
| 120 |
+
"output_ports": {
|
| 121 |
+
"out_port": {
|
| 122 |
+
"value": "exponential_func"
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
},
|
| 126 |
+
"D": {
|
| 127 |
+
"metadata": {
|
| 128 |
+
"color": ".8 0 .8"
|
| 129 |
+
},
|
| 130 |
+
"input_ports": {
|
| 131 |
+
"input_port1": {
|
| 132 |
+
"shape": [
|
| 133 |
+
1
|
| 134 |
+
]
|
| 135 |
+
}
|
| 136 |
+
},
|
| 137 |
+
"parameters": {
|
| 138 |
+
"scale": {
|
| 139 |
+
"value": 4.0
|
| 140 |
+
},
|
| 141 |
+
"sin_func": {
|
| 142 |
+
"function": "sin",
|
| 143 |
+
"args": {
|
| 144 |
+
"variable0": "input_port1",
|
| 145 |
+
"scale": "scale"
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
},
|
| 149 |
+
"output_ports": {
|
| 150 |
+
"out_port": {
|
| 151 |
+
"value": "sin_func"
|
| 152 |
+
}
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
},
|
| 156 |
+
"edges": {
|
| 157 |
+
"edge_input0_A": {
|
| 158 |
+
"sender": "input0",
|
| 159 |
+
"receiver": "A",
|
| 160 |
+
"sender_port": "out_port",
|
| 161 |
+
"receiver_port": "input_port1"
|
| 162 |
+
},
|
| 163 |
+
"edge_A_B": {
|
| 164 |
+
"sender": "A",
|
| 165 |
+
"receiver": "B",
|
| 166 |
+
"sender_port": "out_port",
|
| 167 |
+
"receiver_port": "input_port1"
|
| 168 |
+
},
|
| 169 |
+
"edge_B_C": {
|
| 170 |
+
"sender": "B",
|
| 171 |
+
"receiver": "C",
|
| 172 |
+
"sender_port": "out_port",
|
| 173 |
+
"receiver_port": "input_port1"
|
| 174 |
+
},
|
| 175 |
+
"edge_C_D": {
|
| 176 |
+
"sender": "C",
|
| 177 |
+
"receiver": "D",
|
| 178 |
+
"sender_port": "out_port",
|
| 179 |
+
"receiver_port": "input_port1"
|
| 180 |
+
}
|
| 181 |
+
}
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
}
|
| 185 |
+
}
|
examples/ABCD.mdf.json
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ABCD": {
|
| 3 |
+
"format": "ModECI MDF v0.4",
|
| 4 |
+
"graphs": {
|
| 5 |
+
"ABCD": {
|
| 6 |
+
"notes": "Example of a simplified network",
|
| 7 |
+
"nodes": {
|
| 8 |
+
"A_input": {
|
| 9 |
+
"metadata": {
|
| 10 |
+
"color": "0.2 0.2 0.2",
|
| 11 |
+
"radius": 3,
|
| 12 |
+
"region": "region1"
|
| 13 |
+
},
|
| 14 |
+
"parameters": {
|
| 15 |
+
"variable": {
|
| 16 |
+
"value": [
|
| 17 |
+
2.0
|
| 18 |
+
]
|
| 19 |
+
},
|
| 20 |
+
"spike": {
|
| 21 |
+
"default_initial_value": [
|
| 22 |
+
0
|
| 23 |
+
],
|
| 24 |
+
"conditions": {
|
| 25 |
+
"condition_0_on": {
|
| 26 |
+
"test": "OUTPUT < 0",
|
| 27 |
+
"value": 1
|
| 28 |
+
},
|
| 29 |
+
"condition_0_off": {
|
| 30 |
+
"test": "spike > 0",
|
| 31 |
+
"value": 0
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
},
|
| 35 |
+
"V": {
|
| 36 |
+
"value": 0
|
| 37 |
+
},
|
| 38 |
+
"OUTPUT": {
|
| 39 |
+
"value": "variable"
|
| 40 |
+
}
|
| 41 |
+
},
|
| 42 |
+
"input_ports": {
|
| 43 |
+
"INPUT": {}
|
| 44 |
+
},
|
| 45 |
+
"output_ports": {
|
| 46 |
+
"spike": {
|
| 47 |
+
"value": "spike"
|
| 48 |
+
},
|
| 49 |
+
"V": {
|
| 50 |
+
"value": "V"
|
| 51 |
+
},
|
| 52 |
+
"OUTPUT": {
|
| 53 |
+
"value": "OUTPUT"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"notes": "Cell: [Cell(notes=None, id='a_input', parameters={'variable': 'A_initial'}, neuroml2_source_file=None, lems_source_file='PNL.xml', neuroml2_cell=None, pynn_cell=None, arbor_cell=None, bindsnet_node=None)] is defined in PNL.xml and in Lems is: Component, id: a_input, type: inputNode,\n parameters: {'variable': '2'}\n parent: None\n"
|
| 57 |
+
},
|
| 58 |
+
"A": {
|
| 59 |
+
"metadata": {
|
| 60 |
+
"color": "0 0.9 0",
|
| 61 |
+
"radius": 5,
|
| 62 |
+
"region": "region1"
|
| 63 |
+
},
|
| 64 |
+
"parameters": {
|
| 65 |
+
"slope": {
|
| 66 |
+
"value": [
|
| 67 |
+
2.0
|
| 68 |
+
]
|
| 69 |
+
},
|
| 70 |
+
"intercept": {
|
| 71 |
+
"value": [
|
| 72 |
+
2.0
|
| 73 |
+
]
|
| 74 |
+
},
|
| 75 |
+
"spike": {
|
| 76 |
+
"default_initial_value": [
|
| 77 |
+
0
|
| 78 |
+
],
|
| 79 |
+
"conditions": {
|
| 80 |
+
"condition_0_on": {
|
| 81 |
+
"test": "OUTPUT < 0",
|
| 82 |
+
"value": 1
|
| 83 |
+
},
|
| 84 |
+
"condition_0_off": {
|
| 85 |
+
"test": "spike > 0",
|
| 86 |
+
"value": 0
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
},
|
| 90 |
+
"V": {
|
| 91 |
+
"value": 0
|
| 92 |
+
},
|
| 93 |
+
"OUTPUT": {
|
| 94 |
+
"value": "INPUT*slope + intercept"
|
| 95 |
+
}
|
| 96 |
+
},
|
| 97 |
+
"input_ports": {
|
| 98 |
+
"INPUT": {}
|
| 99 |
+
},
|
| 100 |
+
"output_ports": {
|
| 101 |
+
"spike": {
|
| 102 |
+
"value": "spike"
|
| 103 |
+
},
|
| 104 |
+
"V": {
|
| 105 |
+
"value": "V"
|
| 106 |
+
},
|
| 107 |
+
"OUTPUT": {
|
| 108 |
+
"value": "OUTPUT"
|
| 109 |
+
}
|
| 110 |
+
},
|
| 111 |
+
"notes": "Cell: [Cell(notes=None, id='a', parameters=None, neuroml2_source_file=None, lems_source_file='PNL.xml', neuroml2_cell=None, pynn_cell=None, arbor_cell=None, bindsnet_node=None)] is defined in PNL.xml and in Lems is: Component, id: a, type: pnlLinearFunctionTM,\n parameters: {'slope': '2', 'intercept': '2'}\n parent: None\n"
|
| 112 |
+
},
|
| 113 |
+
"B": {
|
| 114 |
+
"metadata": {
|
| 115 |
+
"color": ".8 .8 .8",
|
| 116 |
+
"radius": 5,
|
| 117 |
+
"region": "region1"
|
| 118 |
+
},
|
| 119 |
+
"parameters": {
|
| 120 |
+
"gain": {
|
| 121 |
+
"value": [
|
| 122 |
+
1.0
|
| 123 |
+
]
|
| 124 |
+
},
|
| 125 |
+
"bias": {
|
| 126 |
+
"value": [
|
| 127 |
+
0.0
|
| 128 |
+
]
|
| 129 |
+
},
|
| 130 |
+
"x_0": {
|
| 131 |
+
"value": [
|
| 132 |
+
0.0
|
| 133 |
+
]
|
| 134 |
+
},
|
| 135 |
+
"offset": {
|
| 136 |
+
"value": [
|
| 137 |
+
0.0
|
| 138 |
+
]
|
| 139 |
+
},
|
| 140 |
+
"spike": {
|
| 141 |
+
"default_initial_value": [
|
| 142 |
+
0
|
| 143 |
+
],
|
| 144 |
+
"conditions": {
|
| 145 |
+
"condition_0_on": {
|
| 146 |
+
"test": "OUTPUT < 0",
|
| 147 |
+
"value": 1
|
| 148 |
+
},
|
| 149 |
+
"condition_0_off": {
|
| 150 |
+
"test": "spike > 0",
|
| 151 |
+
"value": 0
|
| 152 |
+
}
|
| 153 |
+
}
|
| 154 |
+
},
|
| 155 |
+
"V": {
|
| 156 |
+
"value": 0
|
| 157 |
+
},
|
| 158 |
+
"OUTPUT": {
|
| 159 |
+
"value": "1/(1+numpy.exp(-1*gain*(INPUT + bias - x_0)+offset))"
|
| 160 |
+
}
|
| 161 |
+
},
|
| 162 |
+
"input_ports": {
|
| 163 |
+
"INPUT": {}
|
| 164 |
+
},
|
| 165 |
+
"output_ports": {
|
| 166 |
+
"spike": {
|
| 167 |
+
"value": "spike"
|
| 168 |
+
},
|
| 169 |
+
"V": {
|
| 170 |
+
"value": "V"
|
| 171 |
+
},
|
| 172 |
+
"OUTPUT": {
|
| 173 |
+
"value": "OUTPUT"
|
| 174 |
+
}
|
| 175 |
+
},
|
| 176 |
+
"notes": "Cell: [Cell(notes=None, id='b', parameters=None, neuroml2_source_file=None, lems_source_file='PNL.xml', neuroml2_cell=None, pynn_cell=None, arbor_cell=None, bindsnet_node=None)] is defined in PNL.xml and in Lems is: Component, id: b, type: pnlLogisticFunctionTM,\n parameters: {'gain': '1.0', 'bias': '0.0', 'x_0': '0.0', 'offset': '0.0'}\n parent: None\n"
|
| 177 |
+
},
|
| 178 |
+
"C": {
|
| 179 |
+
"metadata": {
|
| 180 |
+
"color": "0.7 0.7 0.7",
|
| 181 |
+
"radius": 5,
|
| 182 |
+
"region": "region1"
|
| 183 |
+
},
|
| 184 |
+
"parameters": {
|
| 185 |
+
"rate": {
|
| 186 |
+
"value": [
|
| 187 |
+
1.0
|
| 188 |
+
]
|
| 189 |
+
},
|
| 190 |
+
"bias": {
|
| 191 |
+
"value": [
|
| 192 |
+
0.0
|
| 193 |
+
]
|
| 194 |
+
},
|
| 195 |
+
"scale": {
|
| 196 |
+
"value": [
|
| 197 |
+
1.0
|
| 198 |
+
]
|
| 199 |
+
},
|
| 200 |
+
"offset": {
|
| 201 |
+
"value": [
|
| 202 |
+
0.0
|
| 203 |
+
]
|
| 204 |
+
},
|
| 205 |
+
"spike": {
|
| 206 |
+
"default_initial_value": [
|
| 207 |
+
0
|
| 208 |
+
],
|
| 209 |
+
"conditions": {
|
| 210 |
+
"condition_0_on": {
|
| 211 |
+
"test": "OUTPUT < 0",
|
| 212 |
+
"value": 1
|
| 213 |
+
},
|
| 214 |
+
"condition_0_off": {
|
| 215 |
+
"test": "spike > 0",
|
| 216 |
+
"value": 0
|
| 217 |
+
}
|
| 218 |
+
}
|
| 219 |
+
},
|
| 220 |
+
"V": {
|
| 221 |
+
"value": 0
|
| 222 |
+
},
|
| 223 |
+
"OUTPUT": {
|
| 224 |
+
"value": "scale * numpy.exp((rate * INPUT) + bias) + offset"
|
| 225 |
+
}
|
| 226 |
+
},
|
| 227 |
+
"input_ports": {
|
| 228 |
+
"INPUT": {}
|
| 229 |
+
},
|
| 230 |
+
"output_ports": {
|
| 231 |
+
"spike": {
|
| 232 |
+
"value": "spike"
|
| 233 |
+
},
|
| 234 |
+
"V": {
|
| 235 |
+
"value": "V"
|
| 236 |
+
},
|
| 237 |
+
"OUTPUT": {
|
| 238 |
+
"value": "OUTPUT"
|
| 239 |
+
}
|
| 240 |
+
},
|
| 241 |
+
"notes": "Cell: [Cell(notes=None, id='c', parameters=None, neuroml2_source_file=None, lems_source_file='PNL.xml', neuroml2_cell=None, pynn_cell=None, arbor_cell=None, bindsnet_node=None)] is defined in PNL.xml and in Lems is: Component, id: c, type: pnlExponentialFunctionTM,\n parameters: {'rate': '1.0', 'bias': '0.0', 'scale': '1.0', 'offset': '0.0'}\n parent: None\n"
|
| 242 |
+
},
|
| 243 |
+
"D": {
|
| 244 |
+
"metadata": {
|
| 245 |
+
"color": "0.7 0 0",
|
| 246 |
+
"radius": 5,
|
| 247 |
+
"region": "region1"
|
| 248 |
+
},
|
| 249 |
+
"parameters": {
|
| 250 |
+
"rate": {
|
| 251 |
+
"value": [
|
| 252 |
+
0.05
|
| 253 |
+
]
|
| 254 |
+
},
|
| 255 |
+
"time_step_size": {
|
| 256 |
+
"value": [
|
| 257 |
+
0.1
|
| 258 |
+
]
|
| 259 |
+
},
|
| 260 |
+
"spike": {
|
| 261 |
+
"default_initial_value": [
|
| 262 |
+
0
|
| 263 |
+
],
|
| 264 |
+
"conditions": {
|
| 265 |
+
"condition_0_on": {
|
| 266 |
+
"test": "OUTPUT < 0",
|
| 267 |
+
"value": 1
|
| 268 |
+
},
|
| 269 |
+
"condition_0_off": {
|
| 270 |
+
"test": "spike > 0",
|
| 271 |
+
"value": 0
|
| 272 |
+
}
|
| 273 |
+
}
|
| 274 |
+
},
|
| 275 |
+
"OUTPUT": {
|
| 276 |
+
"time_derivative": "(rate * INPUT) / time_step_size",
|
| 277 |
+
"default_initial_value": [
|
| 278 |
+
0
|
| 279 |
+
]
|
| 280 |
+
},
|
| 281 |
+
"V": {
|
| 282 |
+
"value": 0
|
| 283 |
+
}
|
| 284 |
+
},
|
| 285 |
+
"input_ports": {
|
| 286 |
+
"INPUT": {}
|
| 287 |
+
},
|
| 288 |
+
"output_ports": {
|
| 289 |
+
"spike": {
|
| 290 |
+
"value": "spike"
|
| 291 |
+
},
|
| 292 |
+
"OUTPUT": {
|
| 293 |
+
"value": "OUTPUT"
|
| 294 |
+
},
|
| 295 |
+
"V": {
|
| 296 |
+
"value": "V"
|
| 297 |
+
}
|
| 298 |
+
},
|
| 299 |
+
"notes": "Cell: [Cell(notes=None, id='d', parameters=None, neuroml2_source_file=None, lems_source_file='PNL.xml', neuroml2_cell=None, pynn_cell=None, arbor_cell=None, bindsnet_node=None)] is defined in PNL.xml and in Lems is: Component, id: d, type: pnlSimpleIntegratorMechanism,\n parameters: {'rate': '0.05', 'time_step_size': '0.1s'}\n parent: None\n"
|
| 300 |
+
},
|
| 301 |
+
"proj_input_rsDL": {
|
| 302 |
+
"parameters": {
|
| 303 |
+
"weight": {
|
| 304 |
+
"value": [
|
| 305 |
+
1.0
|
| 306 |
+
]
|
| 307 |
+
},
|
| 308 |
+
"SEC": {
|
| 309 |
+
"value": [
|
| 310 |
+
1.0
|
| 311 |
+
]
|
| 312 |
+
},
|
| 313 |
+
"rpeer": {
|
| 314 |
+
"value": "peer_OUTPUT"
|
| 315 |
+
},
|
| 316 |
+
"I": {
|
| 317 |
+
"value": "weight * rpeer"
|
| 318 |
+
}
|
| 319 |
+
},
|
| 320 |
+
"input_ports": {
|
| 321 |
+
"peer_OUTPUT": {}
|
| 322 |
+
},
|
| 323 |
+
"output_ports": {
|
| 324 |
+
"I": {
|
| 325 |
+
"value": "I"
|
| 326 |
+
}
|
| 327 |
+
},
|
| 328 |
+
"notes": "Cell: [Synapse(notes=None, id='rsDL', parameters=None, neuroml2_source_file=None, lems_source_file='PNL.xml', pynn_synapse_type=None, pynn_receptor_type=None)] is defined in PNL.xml and in Lems is: Component, id: rsDL, type: synapseDL,\n parameters: {}\n parent: None\n"
|
| 329 |
+
},
|
| 330 |
+
"proj0_rsDL": {
|
| 331 |
+
"parameters": {
|
| 332 |
+
"weight": {
|
| 333 |
+
"value": [
|
| 334 |
+
1.0
|
| 335 |
+
]
|
| 336 |
+
},
|
| 337 |
+
"SEC": {
|
| 338 |
+
"value": [
|
| 339 |
+
1.0
|
| 340 |
+
]
|
| 341 |
+
},
|
| 342 |
+
"rpeer": {
|
| 343 |
+
"value": "peer_OUTPUT"
|
| 344 |
+
},
|
| 345 |
+
"I": {
|
| 346 |
+
"value": "weight * rpeer"
|
| 347 |
+
}
|
| 348 |
+
},
|
| 349 |
+
"input_ports": {
|
| 350 |
+
"peer_OUTPUT": {}
|
| 351 |
+
},
|
| 352 |
+
"output_ports": {
|
| 353 |
+
"I": {
|
| 354 |
+
"value": "I"
|
| 355 |
+
}
|
| 356 |
+
},
|
| 357 |
+
"notes": "Cell: [Synapse(notes=None, id='rsDL', parameters=None, neuroml2_source_file=None, lems_source_file='PNL.xml', pynn_synapse_type=None, pynn_receptor_type=None)] is defined in PNL.xml and in Lems is: Component, id: rsDL, type: synapseDL,\n parameters: {}\n parent: None\n"
|
| 358 |
+
},
|
| 359 |
+
"proj1_rsDL": {
|
| 360 |
+
"parameters": {
|
| 361 |
+
"weight": {
|
| 362 |
+
"value": [
|
| 363 |
+
1.0
|
| 364 |
+
]
|
| 365 |
+
},
|
| 366 |
+
"SEC": {
|
| 367 |
+
"value": [
|
| 368 |
+
1.0
|
| 369 |
+
]
|
| 370 |
+
},
|
| 371 |
+
"rpeer": {
|
| 372 |
+
"value": "peer_OUTPUT"
|
| 373 |
+
},
|
| 374 |
+
"I": {
|
| 375 |
+
"value": "weight * rpeer"
|
| 376 |
+
}
|
| 377 |
+
},
|
| 378 |
+
"input_ports": {
|
| 379 |
+
"peer_OUTPUT": {}
|
| 380 |
+
},
|
| 381 |
+
"output_ports": {
|
| 382 |
+
"I": {
|
| 383 |
+
"value": "I"
|
| 384 |
+
}
|
| 385 |
+
},
|
| 386 |
+
"notes": "Cell: [Synapse(notes=None, id='rsDL', parameters=None, neuroml2_source_file=None, lems_source_file='PNL.xml', pynn_synapse_type=None, pynn_receptor_type=None)] is defined in PNL.xml and in Lems is: Component, id: rsDL, type: synapseDL,\n parameters: {}\n parent: None\n"
|
| 387 |
+
},
|
| 388 |
+
"proj2_rsDL": {
|
| 389 |
+
"parameters": {
|
| 390 |
+
"weight": {
|
| 391 |
+
"value": [
|
| 392 |
+
1.0
|
| 393 |
+
]
|
| 394 |
+
},
|
| 395 |
+
"SEC": {
|
| 396 |
+
"value": [
|
| 397 |
+
1.0
|
| 398 |
+
]
|
| 399 |
+
},
|
| 400 |
+
"rpeer": {
|
| 401 |
+
"value": "peer_OUTPUT"
|
| 402 |
+
},
|
| 403 |
+
"I": {
|
| 404 |
+
"value": "weight * rpeer"
|
| 405 |
+
}
|
| 406 |
+
},
|
| 407 |
+
"input_ports": {
|
| 408 |
+
"peer_OUTPUT": {}
|
| 409 |
+
},
|
| 410 |
+
"output_ports": {
|
| 411 |
+
"I": {
|
| 412 |
+
"value": "I"
|
| 413 |
+
}
|
| 414 |
+
},
|
| 415 |
+
"notes": "Cell: [Synapse(notes=None, id='rsDL', parameters=None, neuroml2_source_file=None, lems_source_file='PNL.xml', pynn_synapse_type=None, pynn_receptor_type=None)] is defined in PNL.xml and in Lems is: Component, id: rsDL, type: synapseDL,\n parameters: {}\n parent: None\n"
|
| 416 |
+
},
|
| 417 |
+
"proj3_rsDL": {
|
| 418 |
+
"parameters": {
|
| 419 |
+
"weight": {
|
| 420 |
+
"value": [
|
| 421 |
+
1.0
|
| 422 |
+
]
|
| 423 |
+
},
|
| 424 |
+
"SEC": {
|
| 425 |
+
"value": [
|
| 426 |
+
1.0
|
| 427 |
+
]
|
| 428 |
+
},
|
| 429 |
+
"rpeer": {
|
| 430 |
+
"value": "peer_OUTPUT"
|
| 431 |
+
},
|
| 432 |
+
"I": {
|
| 433 |
+
"value": "weight * rpeer"
|
| 434 |
+
}
|
| 435 |
+
},
|
| 436 |
+
"input_ports": {
|
| 437 |
+
"peer_OUTPUT": {}
|
| 438 |
+
},
|
| 439 |
+
"output_ports": {
|
| 440 |
+
"I": {
|
| 441 |
+
"value": "I"
|
| 442 |
+
}
|
| 443 |
+
},
|
| 444 |
+
"notes": "Cell: [Synapse(notes=None, id='rsDL', parameters=None, neuroml2_source_file=None, lems_source_file='PNL.xml', pynn_synapse_type=None, pynn_receptor_type=None)] is defined in PNL.xml and in Lems is: Component, id: rsDL, type: synapseDL,\n parameters: {}\n parent: None\n"
|
| 445 |
+
}
|
| 446 |
+
},
|
| 447 |
+
"edges": {
|
| 448 |
+
"A_TO_proj_input_rsDL": {
|
| 449 |
+
"name": "A_TO_proj_input_rsDL",
|
| 450 |
+
"sender_port": "OUTPUT",
|
| 451 |
+
"receiver_port": "peer_OUTPUT",
|
| 452 |
+
"sender": "A",
|
| 453 |
+
"receiver": "proj_input_rsDL"
|
| 454 |
+
},
|
| 455 |
+
"proj_input_rsDL_TO_B": {
|
| 456 |
+
"name": "proj_input_rsDL_TO_B",
|
| 457 |
+
"sender_port": "I",
|
| 458 |
+
"receiver_port": "INPUT",
|
| 459 |
+
"sender": "proj_input_rsDL",
|
| 460 |
+
"receiver": "B"
|
| 461 |
+
},
|
| 462 |
+
"A_input_TO_proj0_rsDL": {
|
| 463 |
+
"name": "A_input_TO_proj0_rsDL",
|
| 464 |
+
"sender_port": "OUTPUT",
|
| 465 |
+
"receiver_port": "peer_OUTPUT",
|
| 466 |
+
"sender": "A_input",
|
| 467 |
+
"receiver": "proj0_rsDL"
|
| 468 |
+
},
|
| 469 |
+
"proj0_rsDL_TO_A": {
|
| 470 |
+
"name": "proj0_rsDL_TO_A",
|
| 471 |
+
"sender_port": "I",
|
| 472 |
+
"receiver_port": "INPUT",
|
| 473 |
+
"sender": "proj0_rsDL",
|
| 474 |
+
"receiver": "A"
|
| 475 |
+
},
|
| 476 |
+
"A_TO_proj1_rsDL": {
|
| 477 |
+
"name": "A_TO_proj1_rsDL",
|
| 478 |
+
"sender_port": "OUTPUT",
|
| 479 |
+
"receiver_port": "peer_OUTPUT",
|
| 480 |
+
"sender": "A",
|
| 481 |
+
"receiver": "proj1_rsDL"
|
| 482 |
+
},
|
| 483 |
+
"proj1_rsDL_TO_C": {
|
| 484 |
+
"name": "proj1_rsDL_TO_C",
|
| 485 |
+
"sender_port": "I",
|
| 486 |
+
"receiver_port": "INPUT",
|
| 487 |
+
"sender": "proj1_rsDL",
|
| 488 |
+
"receiver": "C"
|
| 489 |
+
},
|
| 490 |
+
"B_TO_proj2_rsDL": {
|
| 491 |
+
"name": "B_TO_proj2_rsDL",
|
| 492 |
+
"sender_port": "OUTPUT",
|
| 493 |
+
"receiver_port": "peer_OUTPUT",
|
| 494 |
+
"sender": "B",
|
| 495 |
+
"receiver": "proj2_rsDL"
|
| 496 |
+
},
|
| 497 |
+
"proj2_rsDL_TO_D": {
|
| 498 |
+
"name": "proj2_rsDL_TO_D",
|
| 499 |
+
"sender_port": "I",
|
| 500 |
+
"receiver_port": "INPUT",
|
| 501 |
+
"sender": "proj2_rsDL",
|
| 502 |
+
"receiver": "D"
|
| 503 |
+
},
|
| 504 |
+
"C_TO_proj3_rsDL": {
|
| 505 |
+
"name": "C_TO_proj3_rsDL",
|
| 506 |
+
"sender_port": "OUTPUT",
|
| 507 |
+
"receiver_port": "peer_OUTPUT",
|
| 508 |
+
"sender": "C",
|
| 509 |
+
"receiver": "proj3_rsDL"
|
| 510 |
+
},
|
| 511 |
+
"proj3_rsDL_TO_D": {
|
| 512 |
+
"name": "proj3_rsDL_TO_D",
|
| 513 |
+
"sender_port": "I",
|
| 514 |
+
"receiver_port": "INPUT",
|
| 515 |
+
"sender": "proj3_rsDL",
|
| 516 |
+
"receiver": "D"
|
| 517 |
+
}
|
| 518 |
+
}
|
| 519 |
+
}
|
| 520 |
+
}
|
| 521 |
+
}
|
| 522 |
+
}
|
examples/Arrays.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"Arrays": {
|
| 3 |
+
"format": "ModECI MDF v0.4",
|
| 4 |
+
"generating_application": "Python modeci-mdf v0.4.11",
|
| 5 |
+
"graphs": {
|
| 6 |
+
"array_example": {
|
| 7 |
+
"nodes": {
|
| 8 |
+
"input_node": {
|
| 9 |
+
"parameters": {
|
| 10 |
+
"input_level": {
|
| 11 |
+
"value": [
|
| 12 |
+
[
|
| 13 |
+
1,
|
| 14 |
+
2.0
|
| 15 |
+
],
|
| 16 |
+
[
|
| 17 |
+
3,
|
| 18 |
+
4
|
| 19 |
+
]
|
| 20 |
+
]
|
| 21 |
+
}
|
| 22 |
+
},
|
| 23 |
+
"output_ports": {
|
| 24 |
+
"out_port": {
|
| 25 |
+
"value": "input_level"
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
"middle_node": {
|
| 30 |
+
"input_ports": {
|
| 31 |
+
"input_port1": {
|
| 32 |
+
"shape": [
|
| 33 |
+
2,
|
| 34 |
+
2
|
| 35 |
+
]
|
| 36 |
+
}
|
| 37 |
+
},
|
| 38 |
+
"parameters": {
|
| 39 |
+
"slope": {
|
| 40 |
+
"value": 0.5
|
| 41 |
+
},
|
| 42 |
+
"intercept": {
|
| 43 |
+
"value": [
|
| 44 |
+
[
|
| 45 |
+
0.0,
|
| 46 |
+
1.0
|
| 47 |
+
],
|
| 48 |
+
[
|
| 49 |
+
2.0,
|
| 50 |
+
2.0
|
| 51 |
+
]
|
| 52 |
+
]
|
| 53 |
+
},
|
| 54 |
+
"linear_1": {
|
| 55 |
+
"function": "linear",
|
| 56 |
+
"args": {
|
| 57 |
+
"variable0": "input_port1",
|
| 58 |
+
"slope": "slope",
|
| 59 |
+
"intercept": "intercept"
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
},
|
| 63 |
+
"output_ports": {
|
| 64 |
+
"output_1": {
|
| 65 |
+
"value": "linear_1"
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
},
|
| 70 |
+
"edges": {
|
| 71 |
+
"input_edge": {
|
| 72 |
+
"sender": "input_node",
|
| 73 |
+
"receiver": "middle_node",
|
| 74 |
+
"sender_port": "out_port",
|
| 75 |
+
"receiver_port": "input_port1",
|
| 76 |
+
"parameters": {
|
| 77 |
+
"weight": [
|
| 78 |
+
[
|
| 79 |
+
1,
|
| 80 |
+
0
|
| 81 |
+
],
|
| 82 |
+
[
|
| 83 |
+
0,
|
| 84 |
+
1
|
| 85 |
+
]
|
| 86 |
+
]
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
}
|
examples/FN.mdf.json
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"FN": {
|
| 3 |
+
"format": "ModECI MDF v0.4",
|
| 4 |
+
"metadata": {
|
| 5 |
+
"preferred_duration": 0.1,
|
| 6 |
+
"preferred_dt": 0.00005
|
| 7 |
+
},
|
| 8 |
+
"graphs": {
|
| 9 |
+
"FN": {
|
| 10 |
+
"notes": "FitzHugh Nagumo cell model - originally specified in NeuroML/LEMS",
|
| 11 |
+
"nodes": {
|
| 12 |
+
"FNpop": {
|
| 13 |
+
"metadata": {
|
| 14 |
+
"color": "0.2 0.2 0.2",
|
| 15 |
+
"radius": 3,
|
| 16 |
+
"region": "region1"
|
| 17 |
+
},
|
| 18 |
+
"parameters": {
|
| 19 |
+
"initial_w": {
|
| 20 |
+
"value": [
|
| 21 |
+
0.0
|
| 22 |
+
]
|
| 23 |
+
},
|
| 24 |
+
"initial_v": {
|
| 25 |
+
"value": [
|
| 26 |
+
-1.0
|
| 27 |
+
]
|
| 28 |
+
},
|
| 29 |
+
"a_v": {
|
| 30 |
+
"value": [
|
| 31 |
+
-0.3333333333333333
|
| 32 |
+
]
|
| 33 |
+
},
|
| 34 |
+
"b_v": {
|
| 35 |
+
"value": [
|
| 36 |
+
0.0
|
| 37 |
+
]
|
| 38 |
+
},
|
| 39 |
+
"c_v": {
|
| 40 |
+
"value": [
|
| 41 |
+
1.0
|
| 42 |
+
]
|
| 43 |
+
},
|
| 44 |
+
"d_v": {
|
| 45 |
+
"value": [
|
| 46 |
+
1.0
|
| 47 |
+
]
|
| 48 |
+
},
|
| 49 |
+
"e_v": {
|
| 50 |
+
"value": [
|
| 51 |
+
-1.0
|
| 52 |
+
]
|
| 53 |
+
},
|
| 54 |
+
"f_v": {
|
| 55 |
+
"value": [
|
| 56 |
+
1.0
|
| 57 |
+
]
|
| 58 |
+
},
|
| 59 |
+
"time_constant_v": {
|
| 60 |
+
"value": [
|
| 61 |
+
1.0
|
| 62 |
+
]
|
| 63 |
+
},
|
| 64 |
+
"a_w": {
|
| 65 |
+
"value": [
|
| 66 |
+
1.0
|
| 67 |
+
]
|
| 68 |
+
},
|
| 69 |
+
"b_w": {
|
| 70 |
+
"value": [
|
| 71 |
+
-0.8
|
| 72 |
+
]
|
| 73 |
+
},
|
| 74 |
+
"c_w": {
|
| 75 |
+
"value": [
|
| 76 |
+
0.7
|
| 77 |
+
]
|
| 78 |
+
},
|
| 79 |
+
"time_constant_w": {
|
| 80 |
+
"value": [
|
| 81 |
+
12.5
|
| 82 |
+
]
|
| 83 |
+
},
|
| 84 |
+
"threshold_exc": {
|
| 85 |
+
"value": [
|
| 86 |
+
-1.0
|
| 87 |
+
]
|
| 88 |
+
},
|
| 89 |
+
"mode": {
|
| 90 |
+
"value": [
|
| 91 |
+
1.0
|
| 92 |
+
]
|
| 93 |
+
},
|
| 94 |
+
"uncorrelated_activity": {
|
| 95 |
+
"value": [
|
| 96 |
+
0.0
|
| 97 |
+
]
|
| 98 |
+
},
|
| 99 |
+
"Iext": {
|
| 100 |
+
"value": [
|
| 101 |
+
0.0
|
| 102 |
+
]
|
| 103 |
+
},
|
| 104 |
+
"MSEC": {
|
| 105 |
+
"value": [
|
| 106 |
+
0.001
|
| 107 |
+
]
|
| 108 |
+
},
|
| 109 |
+
"spike": {
|
| 110 |
+
"value": [
|
| 111 |
+
0
|
| 112 |
+
]
|
| 113 |
+
},
|
| 114 |
+
"V": {
|
| 115 |
+
"default_initial_value": "initial_v",
|
| 116 |
+
"time_derivative": "(a_v*V*V*V + (1+threshold_exc)*b_v*V*V + (-1*threshold_exc)*c_v*V + d_v + e_v*W + f_v*Iext + INPUT) / (time_constant_v*MSEC)"
|
| 117 |
+
},
|
| 118 |
+
"W": {
|
| 119 |
+
"default_initial_value": "initial_w",
|
| 120 |
+
"time_derivative": "(mode*a_w*V + b_w*W + c_w + (1-mode)*uncorrelated_activity) / (time_constant_w*MSEC)"
|
| 121 |
+
}
|
| 122 |
+
},
|
| 123 |
+
"input_ports": {
|
| 124 |
+
"INPUT": {}
|
| 125 |
+
},
|
| 126 |
+
"output_ports": {
|
| 127 |
+
"spike": {
|
| 128 |
+
"value": "spike"
|
| 129 |
+
},
|
| 130 |
+
"V": {
|
| 131 |
+
"value": "V"
|
| 132 |
+
},
|
| 133 |
+
"W": {
|
| 134 |
+
"value": "W"
|
| 135 |
+
}
|
| 136 |
+
},
|
| 137 |
+
"notes": "Cell: [Cell(notes=None, id='fn', parameters={'initial_w': 'initial_w', 'initial_v': 'initial_v', 'a_v': 'a_v', 'b_v': 'b_v', 'c_v': 'c_v', 'd_v': 'd_v', 'e_v': 'e_v', 'f_v': 'f_v', 'time_constant_v': 'time_constant_v', 'a_w': 'a_w', 'b_w': 'b_w', 'c_w': 'c_w', 'time_constant_w': 'time_constant_w', 'threshold': 'threshold', 'mode': 'mode', 'uncorrelated_activity': 'uncorrelated_activity', 'Iext': 'Iext'}, neuroml2_source_file=None, lems_source_file='FN_Definitions.xml', neuroml2_cell=None, pynn_cell=None, arbor_cell=None, bindsnet_node=None)] is defined in FN_Definitions.xml and in Lems is: Component, id: fn, type: fnCell,\n parameters: {'initial_w': '0.0', 'initial_v': '-1', 'a_v': '-0.3333333333333333', 'b_v': '0.0', 'c_v': '1.0', 'd_v': '1', 'e_v': '-1.0', 'f_v': '1.0', 'time_constant_v': '1.0', 'a_w': '1.0', 'b_w': '-0.8', 'c_w': '0.7', 'time_constant_w': '12.5', 'threshold_exc': '-1.0', 'mode': '1.0', 'uncorrelated_activity': '0.0', 'Iext': '0'}\n parent: None\n"
|
| 138 |
+
}
|
| 139 |
+
},
|
| 140 |
+
"edges": {}
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
}
|
| 144 |
+
}
|
examples/IAFs.json
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"IAFs": {
|
| 3 |
+
"format": "ModECI MDF v0.4",
|
| 4 |
+
"generating_application": "Python modeci-mdf v0.4.11",
|
| 5 |
+
"metadata": {
|
| 6 |
+
"preferred_duration": 100,
|
| 7 |
+
"preferred_dt": 0.1
|
| 8 |
+
},
|
| 9 |
+
"graphs": {
|
| 10 |
+
"IAFs": {
|
| 11 |
+
"nodes": {
|
| 12 |
+
"current_input_node": {
|
| 13 |
+
"parameters": {
|
| 14 |
+
"time": {
|
| 15 |
+
"default_initial_value": 0,
|
| 16 |
+
"time_derivative": "1"
|
| 17 |
+
},
|
| 18 |
+
"start": {
|
| 19 |
+
"value": 20
|
| 20 |
+
},
|
| 21 |
+
"duration": {
|
| 22 |
+
"value": 60
|
| 23 |
+
},
|
| 24 |
+
"amplitude": {
|
| 25 |
+
"value": 10
|
| 26 |
+
},
|
| 27 |
+
"level": {
|
| 28 |
+
"value": 0,
|
| 29 |
+
"conditions": [
|
| 30 |
+
{
|
| 31 |
+
"id": "on",
|
| 32 |
+
"test": "time > start",
|
| 33 |
+
"value": "amplitude"
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"id": "off",
|
| 37 |
+
"test": "time > start + duration",
|
| 38 |
+
"value": "amplitude*0"
|
| 39 |
+
}
|
| 40 |
+
]
|
| 41 |
+
}
|
| 42 |
+
},
|
| 43 |
+
"output_ports": {
|
| 44 |
+
"current_output": {
|
| 45 |
+
"value": "level"
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
},
|
| 49 |
+
"pre": {
|
| 50 |
+
"input_ports": {
|
| 51 |
+
"current_input": {
|
| 52 |
+
"shape": [
|
| 53 |
+
1
|
| 54 |
+
]
|
| 55 |
+
}
|
| 56 |
+
},
|
| 57 |
+
"parameters": {
|
| 58 |
+
"v0": {
|
| 59 |
+
"value": [
|
| 60 |
+
-60
|
| 61 |
+
]
|
| 62 |
+
},
|
| 63 |
+
"erev": {
|
| 64 |
+
"value": [
|
| 65 |
+
-70
|
| 66 |
+
]
|
| 67 |
+
},
|
| 68 |
+
"tau": {
|
| 69 |
+
"value": 10.0
|
| 70 |
+
},
|
| 71 |
+
"thresh": {
|
| 72 |
+
"value": [
|
| 73 |
+
-20
|
| 74 |
+
]
|
| 75 |
+
},
|
| 76 |
+
"spiking": {
|
| 77 |
+
"default_initial_value": "0",
|
| 78 |
+
"conditions": [
|
| 79 |
+
{
|
| 80 |
+
"id": "is_spiking",
|
| 81 |
+
"test": "v >= thresh",
|
| 82 |
+
"value": "1"
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"id": "not_spiking",
|
| 86 |
+
"test": "v < thresh",
|
| 87 |
+
"value": "0"
|
| 88 |
+
}
|
| 89 |
+
]
|
| 90 |
+
},
|
| 91 |
+
"v": {
|
| 92 |
+
"default_initial_value": "v0",
|
| 93 |
+
"time_derivative": "-1 * (v-erev)/tau + current_input",
|
| 94 |
+
"conditions": [
|
| 95 |
+
{
|
| 96 |
+
"id": "reset",
|
| 97 |
+
"test": "v > thresh",
|
| 98 |
+
"value": "erev"
|
| 99 |
+
}
|
| 100 |
+
]
|
| 101 |
+
}
|
| 102 |
+
},
|
| 103 |
+
"output_ports": {
|
| 104 |
+
"v_output": {
|
| 105 |
+
"value": "v"
|
| 106 |
+
},
|
| 107 |
+
"spiking_output": {
|
| 108 |
+
"value": "spiking"
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
},
|
| 112 |
+
"post": {
|
| 113 |
+
"input_ports": {
|
| 114 |
+
"current_input": {
|
| 115 |
+
"shape": [
|
| 116 |
+
1
|
| 117 |
+
]
|
| 118 |
+
}
|
| 119 |
+
},
|
| 120 |
+
"parameters": {
|
| 121 |
+
"v0": {
|
| 122 |
+
"value": [
|
| 123 |
+
-60
|
| 124 |
+
]
|
| 125 |
+
},
|
| 126 |
+
"erev": {
|
| 127 |
+
"value": [
|
| 128 |
+
-70
|
| 129 |
+
]
|
| 130 |
+
},
|
| 131 |
+
"tau": {
|
| 132 |
+
"value": 10.0
|
| 133 |
+
},
|
| 134 |
+
"thresh": {
|
| 135 |
+
"value": [
|
| 136 |
+
-20
|
| 137 |
+
]
|
| 138 |
+
},
|
| 139 |
+
"spiking": {
|
| 140 |
+
"default_initial_value": "0",
|
| 141 |
+
"conditions": [
|
| 142 |
+
{
|
| 143 |
+
"id": "is_spiking",
|
| 144 |
+
"test": "v >= thresh",
|
| 145 |
+
"value": "1"
|
| 146 |
+
},
|
| 147 |
+
{
|
| 148 |
+
"id": "not_spiking",
|
| 149 |
+
"test": "v < thresh",
|
| 150 |
+
"value": "0"
|
| 151 |
+
}
|
| 152 |
+
]
|
| 153 |
+
},
|
| 154 |
+
"v": {
|
| 155 |
+
"default_initial_value": "v0",
|
| 156 |
+
"time_derivative": "-1 * (v-erev)/tau + current_input",
|
| 157 |
+
"conditions": [
|
| 158 |
+
{
|
| 159 |
+
"id": "reset",
|
| 160 |
+
"test": "v > thresh",
|
| 161 |
+
"value": "erev"
|
| 162 |
+
}
|
| 163 |
+
]
|
| 164 |
+
}
|
| 165 |
+
},
|
| 166 |
+
"output_ports": {
|
| 167 |
+
"v_output": {
|
| 168 |
+
"value": "v"
|
| 169 |
+
},
|
| 170 |
+
"spiking_output": {
|
| 171 |
+
"value": "spiking"
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
},
|
| 175 |
+
"syn_post": {
|
| 176 |
+
"input_ports": {
|
| 177 |
+
"spike_input": {
|
| 178 |
+
"shape": [
|
| 179 |
+
1
|
| 180 |
+
]
|
| 181 |
+
}
|
| 182 |
+
},
|
| 183 |
+
"parameters": {
|
| 184 |
+
"syn_tau": {
|
| 185 |
+
"value": 10
|
| 186 |
+
},
|
| 187 |
+
"spike_weights": {
|
| 188 |
+
"value": [
|
| 189 |
+
40
|
| 190 |
+
]
|
| 191 |
+
},
|
| 192 |
+
"weighted_spike": {
|
| 193 |
+
"function": "MatMul",
|
| 194 |
+
"args": {
|
| 195 |
+
"A": "spike_weights",
|
| 196 |
+
"B": "spike_input"
|
| 197 |
+
}
|
| 198 |
+
},
|
| 199 |
+
"syn_i": {
|
| 200 |
+
"default_initial_value": "0",
|
| 201 |
+
"time_derivative": "-1 * syn_i",
|
| 202 |
+
"conditions": [
|
| 203 |
+
{
|
| 204 |
+
"id": "spike_detected",
|
| 205 |
+
"test": "spike_input > 0",
|
| 206 |
+
"value": "weighted_spike"
|
| 207 |
+
}
|
| 208 |
+
]
|
| 209 |
+
}
|
| 210 |
+
},
|
| 211 |
+
"output_ports": {
|
| 212 |
+
"current_output": {
|
| 213 |
+
"value": "syn_i"
|
| 214 |
+
}
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
},
|
| 218 |
+
"edges": {
|
| 219 |
+
"input_edge": {
|
| 220 |
+
"sender": "current_input_node",
|
| 221 |
+
"receiver": "pre",
|
| 222 |
+
"sender_port": "current_output",
|
| 223 |
+
"receiver_port": "current_input"
|
| 224 |
+
},
|
| 225 |
+
"post_internal_edge": {
|
| 226 |
+
"sender": "syn_post",
|
| 227 |
+
"receiver": "post",
|
| 228 |
+
"sender_port": "current_output",
|
| 229 |
+
"receiver_port": "current_input"
|
| 230 |
+
},
|
| 231 |
+
"syn_edge": {
|
| 232 |
+
"sender": "pre",
|
| 233 |
+
"receiver": "syn_post",
|
| 234 |
+
"sender_port": "spiking_output",
|
| 235 |
+
"receiver_port": "spike_input"
|
| 236 |
+
}
|
| 237 |
+
}
|
| 238 |
+
}
|
| 239 |
+
}
|
| 240 |
+
}
|
| 241 |
+
}
|
examples/IzhikevichTest.mdf.json
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"IzhikevichTest": {
|
| 3 |
+
"format": "ModECI MDF v0.4",
|
| 4 |
+
"metadata": {
|
| 5 |
+
"preferred_duration": 0.7,
|
| 6 |
+
"preferred_dt": 0.0005
|
| 7 |
+
},
|
| 8 |
+
"graphs": {
|
| 9 |
+
"IzhikevichTest": {
|
| 10 |
+
"notes": "Example Izhikevich",
|
| 11 |
+
"nodes": {
|
| 12 |
+
"izhPop": {
|
| 13 |
+
"parameters": {
|
| 14 |
+
"v0": {
|
| 15 |
+
"value": [
|
| 16 |
+
-0.08
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"C": {
|
| 20 |
+
"value": [
|
| 21 |
+
1e-10
|
| 22 |
+
]
|
| 23 |
+
},
|
| 24 |
+
"k": {
|
| 25 |
+
"value": [
|
| 26 |
+
7e-07
|
| 27 |
+
]
|
| 28 |
+
},
|
| 29 |
+
"vr": {
|
| 30 |
+
"value": [
|
| 31 |
+
-0.06
|
| 32 |
+
]
|
| 33 |
+
},
|
| 34 |
+
"vt": {
|
| 35 |
+
"value": [
|
| 36 |
+
-0.04
|
| 37 |
+
]
|
| 38 |
+
},
|
| 39 |
+
"vpeak": {
|
| 40 |
+
"value": [
|
| 41 |
+
0.035
|
| 42 |
+
]
|
| 43 |
+
},
|
| 44 |
+
"a": {
|
| 45 |
+
"value": [
|
| 46 |
+
30.0
|
| 47 |
+
]
|
| 48 |
+
},
|
| 49 |
+
"b": {
|
| 50 |
+
"value": [
|
| 51 |
+
-2e-09
|
| 52 |
+
]
|
| 53 |
+
},
|
| 54 |
+
"c": {
|
| 55 |
+
"value": [
|
| 56 |
+
-0.05
|
| 57 |
+
]
|
| 58 |
+
},
|
| 59 |
+
"d": {
|
| 60 |
+
"value": [
|
| 61 |
+
1e-10
|
| 62 |
+
]
|
| 63 |
+
},
|
| 64 |
+
"spike": {
|
| 65 |
+
"default_initial_value": [
|
| 66 |
+
0
|
| 67 |
+
],
|
| 68 |
+
"conditions": {
|
| 69 |
+
"condition_0_on": {
|
| 70 |
+
"test": "v > vpeak",
|
| 71 |
+
"value": 1
|
| 72 |
+
},
|
| 73 |
+
"condition_0_off": {
|
| 74 |
+
"test": "spike > 0",
|
| 75 |
+
"value": 0
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
"v": {
|
| 80 |
+
"default_initial_value": "v0",
|
| 81 |
+
"conditions": {
|
| 82 |
+
"condition_0": {
|
| 83 |
+
"test": "v > vpeak",
|
| 84 |
+
"value": "c"
|
| 85 |
+
}
|
| 86 |
+
},
|
| 87 |
+
"time_derivative": "iMemb / C"
|
| 88 |
+
},
|
| 89 |
+
"u": {
|
| 90 |
+
"default_initial_value": "0",
|
| 91 |
+
"conditions": {
|
| 92 |
+
"condition_0": {
|
| 93 |
+
"test": "v > vpeak",
|
| 94 |
+
"value": "u + d"
|
| 95 |
+
}
|
| 96 |
+
},
|
| 97 |
+
"time_derivative": "a * (b * (v-vr) - u)"
|
| 98 |
+
},
|
| 99 |
+
"iSyn": {
|
| 100 |
+
"value": "synapses_i"
|
| 101 |
+
},
|
| 102 |
+
"iMemb": {
|
| 103 |
+
"value": "k * (v-vr) * (v-vt) + iSyn - u"
|
| 104 |
+
}
|
| 105 |
+
},
|
| 106 |
+
"input_ports": {
|
| 107 |
+
"synapses_i": {}
|
| 108 |
+
},
|
| 109 |
+
"output_ports": {
|
| 110 |
+
"spike": {
|
| 111 |
+
"value": "spike"
|
| 112 |
+
},
|
| 113 |
+
"v": {
|
| 114 |
+
"value": "v"
|
| 115 |
+
},
|
| 116 |
+
"u": {
|
| 117 |
+
"value": "u"
|
| 118 |
+
},
|
| 119 |
+
"iMemb": {
|
| 120 |
+
"value": "iMemb"
|
| 121 |
+
}
|
| 122 |
+
},
|
| 123 |
+
"notes": "Cell: [Cell(notes=None, id='izhCell', parameters={'v0': 'v0', 'C': 'C', 'k': 'k', 'vr': 'vr', 'vt': 'vt', 'vpeak': 'vpeak', 'a': 'a', 'b': 'b', 'c': 'c', 'd': 'd'}, neuroml2_source_file=None, lems_source_file=None, neuroml2_cell='izhikevich2007Cell', pynn_cell=None, arbor_cell=None, bindsnet_node=None)] is defined in None and in Lems is: Component, id: izhCell, type: izhikevich2007Cell,\n parameters: {'v0': '-80mV', 'C': '100 pF', 'k': '0.7 nS_per_mV', 'vr': '-60 mV', 'vt': '-40 mV', 'vpeak': '35 mV', 'a': '0.03 per_ms', 'b': '-2 nS', 'c': '-50 mV', 'd': '100 pA'}\n parent: None\n"
|
| 124 |
+
},
|
| 125 |
+
"InputList_stim": {
|
| 126 |
+
"parameters": {
|
| 127 |
+
"amplitude": {
|
| 128 |
+
"value": [
|
| 129 |
+
1e-10
|
| 130 |
+
]
|
| 131 |
+
},
|
| 132 |
+
"delay": {
|
| 133 |
+
"value": [
|
| 134 |
+
0.1
|
| 135 |
+
]
|
| 136 |
+
},
|
| 137 |
+
"duration": {
|
| 138 |
+
"value": [
|
| 139 |
+
0.5
|
| 140 |
+
]
|
| 141 |
+
},
|
| 142 |
+
"weight": {
|
| 143 |
+
"value": [
|
| 144 |
+
1
|
| 145 |
+
]
|
| 146 |
+
},
|
| 147 |
+
"i": {
|
| 148 |
+
"conditions": {
|
| 149 |
+
"condition_0": {
|
| 150 |
+
"test": "t < delay",
|
| 151 |
+
"value": "0"
|
| 152 |
+
},
|
| 153 |
+
"condition_1": {
|
| 154 |
+
"test": "t >= delay and t < duration + delay",
|
| 155 |
+
"value": "weight * amplitude"
|
| 156 |
+
},
|
| 157 |
+
"condition_2": {
|
| 158 |
+
"test": "t >= duration + delay",
|
| 159 |
+
"value": "0"
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
},
|
| 163 |
+
"t": {
|
| 164 |
+
"default_initial_value": 0,
|
| 165 |
+
"time_derivative": "1"
|
| 166 |
+
}
|
| 167 |
+
},
|
| 168 |
+
"input_ports": {
|
| 169 |
+
"spike_input": {
|
| 170 |
+
"shape": [
|
| 171 |
+
1
|
| 172 |
+
],
|
| 173 |
+
"reduce": "add"
|
| 174 |
+
}
|
| 175 |
+
},
|
| 176 |
+
"output_ports": {
|
| 177 |
+
"i": {
|
| 178 |
+
"value": "i"
|
| 179 |
+
}
|
| 180 |
+
},
|
| 181 |
+
"notes": "Cell: [InputSource(notes=None, id='iclamp_0', parameters={'amplitude': 'stim_amp', 'delay': 'delay', 'duration': 'duration'}, neuroml2_source_file=None, neuroml2_input='pulseGenerator', lems_source_file=None, pynn_input=None)] is defined in None and in Lems is: Component, id: iclamp_0, type: pulseGenerator,\n parameters: {'amplitude': '100pA', 'delay': '100ms', 'duration': '500ms'}\n parent: None\n"
|
| 182 |
+
}
|
| 183 |
+
},
|
| 184 |
+
"edges": {
|
| 185 |
+
"Edge InputList_stim to izhPop": {
|
| 186 |
+
"name": "Edge InputList_stim to izhPop",
|
| 187 |
+
"sender_port": "i",
|
| 188 |
+
"receiver_port": "synapses_i",
|
| 189 |
+
"sender": "InputList_stim",
|
| 190 |
+
"receiver": "izhPop"
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
}
|
examples/NewtonCoolingModel.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"NewtonCoolingModel": {
|
| 3 |
+
"format": "ModECI MDF v0.4",
|
| 4 |
+
"generating_application": "Python modeci-mdf v0.4.11",
|
| 5 |
+
"metadata": {
|
| 6 |
+
"preferred_duration": 100,
|
| 7 |
+
"preferred_dt": 0.01
|
| 8 |
+
},
|
| 9 |
+
"graphs": {
|
| 10 |
+
"NewtonCoolingModel": {
|
| 11 |
+
"nodes": {
|
| 12 |
+
"cool_node": {
|
| 13 |
+
"parameters": {
|
| 14 |
+
"cooling_coeff": {
|
| 15 |
+
"metadata": {
|
| 16 |
+
"description": "Cooling coefficient in 1/s"
|
| 17 |
+
},
|
| 18 |
+
"value": 0.1
|
| 19 |
+
},
|
| 20 |
+
"T_a": {
|
| 21 |
+
"metadata": {
|
| 22 |
+
"description": "Ambient temperature in degrees C"
|
| 23 |
+
},
|
| 24 |
+
"value": 20
|
| 25 |
+
},
|
| 26 |
+
"T_curr": {
|
| 27 |
+
"metadata": {
|
| 28 |
+
"description": "Current temperature in degrees C"
|
| 29 |
+
},
|
| 30 |
+
"default_initial_value": 90,
|
| 31 |
+
"time_derivative": "dT_dt"
|
| 32 |
+
},
|
| 33 |
+
"dT_dt": {
|
| 34 |
+
"metadata": {
|
| 35 |
+
"description": "Rate of change of temperature in degrees C/s"
|
| 36 |
+
},
|
| 37 |
+
"value": "-cooling_coeff*(T_curr - T_a)",
|
| 38 |
+
"default_initial_value": 0
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"output_ports": {
|
| 42 |
+
"out_port": {
|
| 43 |
+
"value": "T_curr"
|
| 44 |
+
},
|
| 45 |
+
"out_port2": {
|
| 46 |
+
"value": "dT_dt"
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
}
|
examples/RNNs.json
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"RNNs": {
|
| 3 |
+
"format": "ModECI MDF v0.4",
|
| 4 |
+
"generating_application": "Python modeci-mdf v0.4.11",
|
| 5 |
+
"metadata": {
|
| 6 |
+
"preferred_duration": 50,
|
| 7 |
+
"preferred_dt": 0.1
|
| 8 |
+
},
|
| 9 |
+
"graphs": {
|
| 10 |
+
"RNNs": {
|
| 11 |
+
"nodes": {
|
| 12 |
+
"input_node": {
|
| 13 |
+
"parameters": {
|
| 14 |
+
"t": {
|
| 15 |
+
"default_initial_value": 0,
|
| 16 |
+
"time_derivative": "1"
|
| 17 |
+
},
|
| 18 |
+
"amplitude": {
|
| 19 |
+
"value": [
|
| 20 |
+
1
|
| 21 |
+
]
|
| 22 |
+
},
|
| 23 |
+
"period": {
|
| 24 |
+
"value": [
|
| 25 |
+
10
|
| 26 |
+
]
|
| 27 |
+
},
|
| 28 |
+
"level": {
|
| 29 |
+
"function": "sin",
|
| 30 |
+
"args": {
|
| 31 |
+
"variable0": "2*3.14159*t/period",
|
| 32 |
+
"scale": "amplitude"
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
},
|
| 36 |
+
"output_ports": {
|
| 37 |
+
"out_port": {
|
| 38 |
+
"value": "level"
|
| 39 |
+
},
|
| 40 |
+
"t_out_port": {
|
| 41 |
+
"value": "t"
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
"rnn_node": {
|
| 46 |
+
"input_ports": {
|
| 47 |
+
"ext_input": {
|
| 48 |
+
"shape": [
|
| 49 |
+
5
|
| 50 |
+
]
|
| 51 |
+
},
|
| 52 |
+
"fb_input": {
|
| 53 |
+
"shape": [
|
| 54 |
+
5
|
| 55 |
+
]
|
| 56 |
+
}
|
| 57 |
+
},
|
| 58 |
+
"parameters": {
|
| 59 |
+
"M": {
|
| 60 |
+
"value": [
|
| 61 |
+
[
|
| 62 |
+
-0.15378707975107808,
|
| 63 |
+
0.961528396769231,
|
| 64 |
+
0.3696594771697266,
|
| 65 |
+
-0.03813619703127813,
|
| 66 |
+
-0.21576496361169895
|
| 67 |
+
],
|
| 68 |
+
[
|
| 69 |
+
-0.3136439676982612,
|
| 70 |
+
0.45809941476808325,
|
| 71 |
+
-0.12285551064075118,
|
| 72 |
+
-0.8806442067808633,
|
| 73 |
+
-0.20391148933913716
|
| 74 |
+
],
|
| 75 |
+
[
|
| 76 |
+
0.4759908114640714,
|
| 77 |
+
-0.635016539093,
|
| 78 |
+
-0.6490964877050149,
|
| 79 |
+
0.06310274768367674,
|
| 80 |
+
0.06365517419373212
|
| 81 |
+
],
|
| 82 |
+
[
|
| 83 |
+
0.2688019171026421,
|
| 84 |
+
0.6988635881555791,
|
| 85 |
+
0.4489106497212705,
|
| 86 |
+
0.22204702135516574,
|
| 87 |
+
0.4448867651404431
|
| 88 |
+
],
|
| 89 |
+
[
|
| 90 |
+
-0.3540821722936436,
|
| 91 |
+
-0.2764226887553718,
|
| 92 |
+
-0.5434735382420888,
|
| 93 |
+
-0.41257190722234127,
|
| 94 |
+
0.2619522477089755
|
| 95 |
+
]
|
| 96 |
+
]
|
| 97 |
+
},
|
| 98 |
+
"g": {
|
| 99 |
+
"value": 1.5
|
| 100 |
+
},
|
| 101 |
+
"x": {
|
| 102 |
+
"default_initial_value": [
|
| 103 |
+
0.3929383711957233,
|
| 104 |
+
-0.42772133009924107,
|
| 105 |
+
-0.5462970928715938,
|
| 106 |
+
0.10262953816578246,
|
| 107 |
+
0.43893793957112615
|
| 108 |
+
],
|
| 109 |
+
"time_derivative": "-x + g*int_fb + ext_input"
|
| 110 |
+
},
|
| 111 |
+
"r": {
|
| 112 |
+
"function": "tanh",
|
| 113 |
+
"args": {
|
| 114 |
+
"variable0": "x",
|
| 115 |
+
"scale": 1
|
| 116 |
+
}
|
| 117 |
+
},
|
| 118 |
+
"int_fb": {
|
| 119 |
+
"function": "MatMul",
|
| 120 |
+
"args": {
|
| 121 |
+
"A": "M",
|
| 122 |
+
"B": "r"
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
},
|
| 126 |
+
"output_ports": {
|
| 127 |
+
"out_port_x": {
|
| 128 |
+
"value": "x"
|
| 129 |
+
},
|
| 130 |
+
"out_port_r": {
|
| 131 |
+
"value": "r"
|
| 132 |
+
}
|
| 133 |
+
}
|
| 134 |
+
},
|
| 135 |
+
"readout_node": {
|
| 136 |
+
"input_ports": {
|
| 137 |
+
"input": {
|
| 138 |
+
"shape": [
|
| 139 |
+
5
|
| 140 |
+
]
|
| 141 |
+
}
|
| 142 |
+
},
|
| 143 |
+
"parameters": {
|
| 144 |
+
"wr": {
|
| 145 |
+
"value": [
|
| 146 |
+
1.0,
|
| 147 |
+
1.0,
|
| 148 |
+
1.0,
|
| 149 |
+
1.0,
|
| 150 |
+
1.0
|
| 151 |
+
]
|
| 152 |
+
},
|
| 153 |
+
"zi": {
|
| 154 |
+
"function": "MatMul",
|
| 155 |
+
"args": {
|
| 156 |
+
"A": "input",
|
| 157 |
+
"B": "wr"
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
},
|
| 161 |
+
"output_ports": {
|
| 162 |
+
"z": {
|
| 163 |
+
"value": "zi"
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
},
|
| 168 |
+
"edges": {
|
| 169 |
+
"input_edge": {
|
| 170 |
+
"sender": "input_node",
|
| 171 |
+
"receiver": "rnn_node",
|
| 172 |
+
"sender_port": "out_port",
|
| 173 |
+
"receiver_port": "ext_input",
|
| 174 |
+
"parameters": {
|
| 175 |
+
"weight": [
|
| 176 |
+
1.0,
|
| 177 |
+
0.0,
|
| 178 |
+
0.0,
|
| 179 |
+
0.0,
|
| 180 |
+
0.0
|
| 181 |
+
]
|
| 182 |
+
}
|
| 183 |
+
},
|
| 184 |
+
"readout_edge": {
|
| 185 |
+
"sender": "rnn_node",
|
| 186 |
+
"receiver": "readout_node",
|
| 187 |
+
"sender_port": "out_port_r",
|
| 188 |
+
"receiver_port": "input",
|
| 189 |
+
"parameters": {
|
| 190 |
+
"weight": 1
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
}
|
| 197 |
+
}
|
examples/Simple.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"Simple": {
|
| 3 |
+
"format": "ModECI MDF v0.4",
|
| 4 |
+
"generating_application": "Python modeci-mdf v0.4.11",
|
| 5 |
+
"graphs": {
|
| 6 |
+
"simple_example": {
|
| 7 |
+
"nodes": {
|
| 8 |
+
"input_node": {
|
| 9 |
+
"parameters": {
|
| 10 |
+
"input_level": {
|
| 11 |
+
"value": 0.5
|
| 12 |
+
}
|
| 13 |
+
},
|
| 14 |
+
"output_ports": {
|
| 15 |
+
"out_port": {
|
| 16 |
+
"value": "input_level"
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
},
|
| 20 |
+
"processing_node": {
|
| 21 |
+
"input_ports": {
|
| 22 |
+
"input_port1": {}
|
| 23 |
+
},
|
| 24 |
+
"parameters": {
|
| 25 |
+
"lin_slope": {
|
| 26 |
+
"value": 0.5
|
| 27 |
+
},
|
| 28 |
+
"lin_intercept": {
|
| 29 |
+
"value": 0
|
| 30 |
+
},
|
| 31 |
+
"log_gain": {
|
| 32 |
+
"value": 3
|
| 33 |
+
},
|
| 34 |
+
"linear_1": {
|
| 35 |
+
"function": "linear",
|
| 36 |
+
"args": {
|
| 37 |
+
"variable0": "input_port1",
|
| 38 |
+
"slope": "lin_slope",
|
| 39 |
+
"intercept": "lin_intercept"
|
| 40 |
+
}
|
| 41 |
+
},
|
| 42 |
+
"logistic_1": {
|
| 43 |
+
"function": "logistic",
|
| 44 |
+
"args": {
|
| 45 |
+
"variable0": "linear_1",
|
| 46 |
+
"gain": "log_gain",
|
| 47 |
+
"bias": 0,
|
| 48 |
+
"offset": 0
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
},
|
| 52 |
+
"output_ports": {
|
| 53 |
+
"output_1": {
|
| 54 |
+
"value": "logistic_1"
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
},
|
| 59 |
+
"edges": {
|
| 60 |
+
"input_edge": {
|
| 61 |
+
"sender": "input_node",
|
| 62 |
+
"receiver": "processing_node",
|
| 63 |
+
"sender_port": "out_port",
|
| 64 |
+
"receiver_port": "input_port1",
|
| 65 |
+
"parameters": {
|
| 66 |
+
"weight": 0.55
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
}
|
examples/States.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"States": {
|
| 3 |
+
"format": "ModECI MDF v0.4",
|
| 4 |
+
"generating_application": "Python modeci-mdf v0.4.11",
|
| 5 |
+
"metadata": {
|
| 6 |
+
"preferred_duration": 10,
|
| 7 |
+
"preferred_dt": 0.01
|
| 8 |
+
},
|
| 9 |
+
"graphs": {
|
| 10 |
+
"state_example": {
|
| 11 |
+
"nodes": {
|
| 12 |
+
"counter_node": {
|
| 13 |
+
"parameters": {
|
| 14 |
+
"increment": {
|
| 15 |
+
"value": 1
|
| 16 |
+
},
|
| 17 |
+
"count": {
|
| 18 |
+
"value": "count + increment"
|
| 19 |
+
}
|
| 20 |
+
},
|
| 21 |
+
"output_ports": {
|
| 22 |
+
"out_port": {
|
| 23 |
+
"value": "count"
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"sine_node": {
|
| 28 |
+
"parameters": {
|
| 29 |
+
"amp": {
|
| 30 |
+
"value": 3
|
| 31 |
+
},
|
| 32 |
+
"period": {
|
| 33 |
+
"value": 0.4
|
| 34 |
+
},
|
| 35 |
+
"level": {
|
| 36 |
+
"default_initial_value": 0,
|
| 37 |
+
"time_derivative": "6.283185 * rate / period"
|
| 38 |
+
},
|
| 39 |
+
"rate": {
|
| 40 |
+
"default_initial_value": 1,
|
| 41 |
+
"time_derivative": "-1 * 6.283185 * level / period"
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"output_ports": {
|
| 45 |
+
"out_port": {
|
| 46 |
+
"value": "amp * level"
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
}
|
examples/inception.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
examples/switched_rlc_circuit.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"SwitchedRLC_Circuit": {
|
| 3 |
+
|
| 4 |
+
"format": "ModECI MDF v0.4",
|
| 5 |
+
"generating_application": "Python modeci-mdf v0.4.10",
|
| 6 |
+
"metadata": {
|
| 7 |
+
"preferred_duration": 2,
|
| 8 |
+
"preferred_dt": 0.001
|
| 9 |
+
},
|
| 10 |
+
"graphs": {
|
| 11 |
+
|
| 12 |
+
"SwitchedRLC_Circuit": {
|
| 13 |
+
"nodes": {
|
| 14 |
+
|
| 15 |
+
"V": {
|
| 16 |
+
"parameters": {
|
| 17 |
+
"Vs": {
|
| 18 |
+
"value":"0.5"
|
| 19 |
+
},
|
| 20 |
+
"R": {
|
| 21 |
+
"metadata": {
|
| 22 |
+
"description": "Resistance in Ohms"
|
| 23 |
+
},
|
| 24 |
+
"value": 100
|
| 25 |
+
},
|
| 26 |
+
"L": {
|
| 27 |
+
"metadata": {
|
| 28 |
+
"description": "Inductance in Henrys"
|
| 29 |
+
},
|
| 30 |
+
"value": 1
|
| 31 |
+
},
|
| 32 |
+
"C": {
|
| 33 |
+
"metadata": {
|
| 34 |
+
"description": "Capacitance in Farads"
|
| 35 |
+
},
|
| 36 |
+
"value": 0.001
|
| 37 |
+
},
|
| 38 |
+
"time": {
|
| 39 |
+
"default_initial_value": 0,
|
| 40 |
+
"time_derivative": "1"
|
| 41 |
+
},
|
| 42 |
+
"V": {
|
| 43 |
+
"metadata": {
|
| 44 |
+
"description": "Voltage across the circuit",
|
| 45 |
+
"plot":"True"
|
| 46 |
+
},
|
| 47 |
+
"default_initial_value": 0,
|
| 48 |
+
"time_derivative": "i_C /C"
|
| 49 |
+
},
|
| 50 |
+
"i_R": {
|
| 51 |
+
"metadata": {
|
| 52 |
+
"description": "Current through the resistor",
|
| 53 |
+
"plot":"True"
|
| 54 |
+
},
|
| 55 |
+
"value": "V / R"
|
| 56 |
+
},
|
| 57 |
+
"i_L": {
|
| 58 |
+
"metadata": {
|
| 59 |
+
"description": "Current through the inductor",
|
| 60 |
+
"plot":"True"
|
| 61 |
+
},
|
| 62 |
+
"default_initial_value": 0,
|
| 63 |
+
"time_derivative": "(Vs - V)/L"
|
| 64 |
+
},
|
| 65 |
+
"i_C": {
|
| 66 |
+
"metadata": {
|
| 67 |
+
"description": "Current through the capacitor",
|
| 68 |
+
"plot":"True"
|
| 69 |
+
},
|
| 70 |
+
"value": "i_L-i_R"
|
| 71 |
+
}
|
| 72 |
+
},
|
| 73 |
+
"output_ports": {
|
| 74 |
+
"V_out": {
|
| 75 |
+
"value": "V"
|
| 76 |
+
},
|
| 77 |
+
"i_L_out": {
|
| 78 |
+
"value": "i_L"
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
}
|
logo.jpg
ADDED
|
packages.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
graphviz
|
requirements.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
modeci_mdf
|
| 3 |
+
matplotlib==3.5.1
|
| 4 |
+
graphviz
|
| 5 |
+
ipython
|
| 6 |
+
torch
|
| 7 |
+
modelspec
|
| 8 |
+
graph_scheduler
|
| 9 |
+
streamlit-code-editor
|