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": "Train/test split 1",
|
8 |
+
"targetHandle": "bundle"
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"id": "Train/test split 1 Create graph 1",
|
12 |
+
"source": "Train/test split 1",
|
13 |
+
"sourceHandle": "output",
|
14 |
+
"target": "Create graph 1",
|
15 |
+
"targetHandle": "bundle"
|
16 |
+
},
|
17 |
+
{
|
18 |
+
"id": "Biomedical foundation graph (PLACEHOLDER) 1 Create graph 1",
|
19 |
+
"source": "Biomedical foundation graph (PLACEHOLDER) 1",
|
20 |
+
"sourceHandle": "output",
|
21 |
+
"target": "Create graph 1",
|
22 |
+
"targetHandle": "bundle"
|
23 |
+
},
|
24 |
+
{
|
25 |
+
"id": "Define model 1 Create graph 1",
|
26 |
+
"source": "Define model 1",
|
27 |
+
"sourceHandle": "output",
|
28 |
+
"target": "Create graph 1",
|
29 |
+
"targetHandle": "bundle"
|
30 |
+
},
|
31 |
+
{
|
32 |
+
"id": "Create graph 1 Train model 1",
|
33 |
+
"source": "Create graph 1",
|
34 |
+
"sourceHandle": "output",
|
35 |
+
"target": "Train model 1",
|
36 |
+
"targetHandle": "bundle"
|
37 |
+
},
|
38 |
+
{
|
39 |
+
"id": "Train model 1 Model inference 1",
|
40 |
+
"source": "Train model 1",
|
41 |
+
"sourceHandle": "output",
|
42 |
+
"target": "Model inference 1",
|
43 |
+
"targetHandle": "bundle"
|
44 |
+
}
|
45 |
+
],
|
46 |
+
"env": "LynxKite Graph Analytics",
|
47 |
+
"nodes": [
|
48 |
+
{
|
49 |
+
"data": {
|
50 |
+
"__execution_delay": 0.0,
|
51 |
+
"collapsed": null,
|
52 |
+
"display": null,
|
53 |
+
"error": null,
|
54 |
+
"meta": {
|
55 |
+
"inputs": {},
|
56 |
+
"name": "Biomedical foundation graph (PLACEHOLDER)",
|
57 |
+
"outputs": {
|
58 |
+
"output": {
|
59 |
+
"name": "output",
|
60 |
+
"position": "right",
|
61 |
+
"type": {
|
62 |
+
"type": "None"
|
63 |
+
}
|
64 |
+
}
|
65 |
+
},
|
66 |
+
"params": {
|
67 |
+
"filter_nodes": {
|
68 |
+
"default": null,
|
69 |
+
"name": "filter_nodes",
|
70 |
+
"type": {
|
71 |
+
"type": "<class 'str'>"
|
72 |
+
}
|
73 |
+
}
|
74 |
+
},
|
75 |
+
"type": "basic"
|
76 |
+
},
|
77 |
+
"params": {
|
78 |
+
"filter_nodes": "drug,gene,disease"
|
79 |
+
},
|
80 |
+
"status": "done",
|
81 |
+
"title": "Biomedical foundation graph (PLACEHOLDER)"
|
82 |
+
},
|
83 |
+
"dragHandle": ".bg-primary",
|
84 |
+
"height": 200.0,
|
85 |
+
"id": "Biomedical foundation graph (PLACEHOLDER) 1",
|
86 |
+
"position": {
|
87 |
+
"x": 230.1082040835347,
|
88 |
+
"y": 643.2454063689602
|
89 |
+
},
|
90 |
+
"type": "basic",
|
91 |
+
"width": 200.0
|
92 |
+
},
|
93 |
+
{
|
94 |
+
"data": {
|
95 |
+
"__execution_delay": null,
|
96 |
+
"collapsed": true,
|
97 |
+
"display": null,
|
98 |
+
"error": "Missing input: bundle",
|
99 |
+
"meta": {
|
100 |
+
"inputs": {
|
101 |
+
"bundle": {
|
102 |
+
"name": "bundle",
|
103 |
+
"position": "left",
|
104 |
+
"type": {
|
105 |
+
"type": "<class 'lynxkite_graph_analytics.core.Bundle'>"
|
106 |
+
}
|
107 |
+
}
|
108 |
+
},
|
109 |
+
"name": "Train/test split",
|
110 |
+
"outputs": {
|
111 |
+
"output": {
|
112 |
+
"name": "output",
|
113 |
+
"position": "right",
|
114 |
+
"type": {
|
115 |
+
"type": "None"
|
116 |
+
}
|
117 |
+
}
|
118 |
+
},
|
119 |
+
"params": {
|
120 |
+
"table_name": {
|
121 |
+
"default": null,
|
122 |
+
"name": "table_name",
|
123 |
+
"type": {
|
124 |
+
"type": "<class 'str'>"
|
125 |
+
}
|
126 |
+
},
|
127 |
+
"test_ratio": {
|
128 |
+
"default": 0.1,
|
129 |
+
"name": "test_ratio",
|
130 |
+
"type": {
|
131 |
+
"type": "<class 'float'>"
|
132 |
+
}
|
133 |
+
}
|
134 |
+
},
|
135 |
+
"type": "basic"
|
136 |
+
},
|
137 |
+
"params": {
|
138 |
+
"table_name": null,
|
139 |
+
"test_ratio": 0.1
|
140 |
+
},
|
141 |
+
"status": "planned",
|
142 |
+
"title": "Train/test split"
|
143 |
+
},
|
144 |
+
"dragHandle": ".bg-primary",
|
145 |
+
"height": 200.0,
|
146 |
+
"id": "Train/test split 1",
|
147 |
+
"position": {
|
148 |
+
"x": 313.3745540124723,
|
149 |
+
"y": 412.5466021460861
|
150 |
+
},
|
151 |
+
"type": "basic",
|
152 |
+
"width": 200.0
|
153 |
+
},
|
154 |
+
{
|
155 |
+
"data": {
|
156 |
+
"display": null,
|
157 |
+
"error": "[Errno 2] No such file or directory: ''",
|
158 |
+
"meta": {
|
159 |
+
"inputs": {},
|
160 |
+
"name": "Import CSV",
|
161 |
+
"outputs": {
|
162 |
+
"output": {
|
163 |
+
"name": "output",
|
164 |
+
"position": "right",
|
165 |
+
"type": {
|
166 |
+
"type": "None"
|
167 |
+
}
|
168 |
+
}
|
169 |
+
},
|
170 |
+
"params": {
|
171 |
+
"columns": {
|
172 |
+
"default": "<from file>",
|
173 |
+
"name": "columns",
|
174 |
+
"type": {
|
175 |
+
"type": "<class 'str'>"
|
176 |
+
}
|
177 |
+
},
|
178 |
+
"filename": {
|
179 |
+
"default": null,
|
180 |
+
"name": "filename",
|
181 |
+
"type": {
|
182 |
+
"type": "<class 'str'>"
|
183 |
+
}
|
184 |
+
},
|
185 |
+
"separator": {
|
186 |
+
"default": "<auto>",
|
187 |
+
"name": "separator",
|
188 |
+
"type": {
|
189 |
+
"type": "<class 'str'>"
|
190 |
+
}
|
191 |
+
}
|
192 |
+
},
|
193 |
+
"type": "basic"
|
194 |
+
},
|
195 |
+
"params": {
|
196 |
+
"columns": "<from file>",
|
197 |
+
"filename": null,
|
198 |
+
"separator": "<auto>"
|
199 |
+
},
|
200 |
+
"status": "done",
|
201 |
+
"title": "Import CSV"
|
202 |
+
},
|
203 |
+
"dragHandle": ".bg-primary",
|
204 |
+
"height": 200.0,
|
205 |
+
"id": "Import CSV 1",
|
206 |
+
"position": {
|
207 |
+
"x": -2.1743215714344757,
|
208 |
+
"y": 346.06014722935214
|
209 |
+
},
|
210 |
+
"type": "basic",
|
211 |
+
"width": 200.0
|
212 |
+
},
|
213 |
+
{
|
214 |
+
"data": {
|
215 |
+
"__execution_delay": 0.0,
|
216 |
+
"collapsed": null,
|
217 |
+
"display": null,
|
218 |
+
"error": "Missing input: bundle",
|
219 |
+
"meta": {
|
220 |
+
"inputs": {
|
221 |
+
"bundle": {
|
222 |
+
"name": "bundle",
|
223 |
+
"position": "left",
|
224 |
+
"type": {
|
225 |
+
"type": "<class 'lynxkite_graph_analytics.core.Bundle'>"
|
226 |
+
}
|
227 |
+
}
|
228 |
+
},
|
229 |
+
"name": "Model inference",
|
230 |
+
"outputs": {
|
231 |
+
"output": {
|
232 |
+
"name": "output",
|
233 |
+
"position": "right",
|
234 |
+
"type": {
|
235 |
+
"type": "None"
|
236 |
+
}
|
237 |
+
}
|
238 |
+
},
|
239 |
+
"params": {
|
240 |
+
"model_mapping": {
|
241 |
+
"default": null,
|
242 |
+
"name": "model_mapping",
|
243 |
+
"type": {
|
244 |
+
"type": "<class 'str'>"
|
245 |
+
}
|
246 |
+
},
|
247 |
+
"model_name": {
|
248 |
+
"default": null,
|
249 |
+
"name": "model_name",
|
250 |
+
"type": {
|
251 |
+
"type": "<class 'str'>"
|
252 |
+
}
|
253 |
+
},
|
254 |
+
"save_output_as": {
|
255 |
+
"default": "prediction",
|
256 |
+
"name": "save_output_as",
|
257 |
+
"type": {
|
258 |
+
"type": "<class 'str'>"
|
259 |
+
}
|
260 |
+
}
|
261 |
+
},
|
262 |
+
"type": "basic"
|
263 |
+
},
|
264 |
+
"params": {
|
265 |
+
"model_mapping": "input: data_test",
|
266 |
+
"model_name": "model",
|
267 |
+
"save_output_as": "prediction"
|
268 |
+
},
|
269 |
+
"status": "done",
|
270 |
+
"title": "Model inference"
|
271 |
+
},
|
272 |
+
"dragHandle": ".bg-primary",
|
273 |
+
"height": 339.0,
|
274 |
+
"id": "Model inference 1",
|
275 |
+
"position": {
|
276 |
+
"x": 1736.5697434242886,
|
277 |
+
"y": 357.0743204289906
|
278 |
+
},
|
279 |
+
"type": "basic",
|
280 |
+
"width": 281.0
|
281 |
+
},
|
282 |
+
{
|
283 |
+
"data": {
|
284 |
+
"__execution_delay": null,
|
285 |
+
"collapsed": true,
|
286 |
+
"display": null,
|
287 |
+
"error": "Missing input: bundle",
|
288 |
+
"meta": {
|
289 |
+
"inputs": {
|
290 |
+
"bundle": {
|
291 |
+
"name": "bundle",
|
292 |
+
"position": "left",
|
293 |
+
"type": {
|
294 |
+
"type": "list[lynxkite_graph_analytics.core.Bundle]"
|
295 |
+
}
|
296 |
+
}
|
297 |
+
},
|
298 |
+
"name": "Create graph",
|
299 |
+
"outputs": {
|
300 |
+
"output": {
|
301 |
+
"name": "output",
|
302 |
+
"position": "right",
|
303 |
+
"type": {
|
304 |
+
"type": "None"
|
305 |
+
}
|
306 |
+
}
|
307 |
+
},
|
308 |
+
"params": {
|
309 |
+
"relations": {
|
310 |
+
"default": null,
|
311 |
+
"name": "relations",
|
312 |
+
"type": {
|
313 |
+
"type": "<class 'str'>"
|
314 |
+
}
|
315 |
+
}
|
316 |
+
},
|
317 |
+
"type": "graph_creation_view"
|
318 |
+
},
|
319 |
+
"params": {
|
320 |
+
"relations": null
|
321 |
+
},
|
322 |
+
"status": "planned",
|
323 |
+
"title": "Create graph"
|
324 |
+
},
|
325 |
+
"dragHandle": ".bg-primary",
|
326 |
+
"height": 322.0,
|
327 |
+
"id": "Create graph 1",
|
328 |
+
"position": {
|
329 |
+
"x": 846.6882598271658,
|
330 |
+
"y": 480.6258932907771
|
331 |
+
},
|
332 |
+
"type": "graph_creation_view",
|
333 |
+
"width": 313.0
|
334 |
+
},
|
335 |
+
{
|
336 |
+
"data": {
|
337 |
+
"__execution_delay": 0.0,
|
338 |
+
"collapsed": null,
|
339 |
+
"display": null,
|
340 |
+
"error": null,
|
341 |
+
"meta": {
|
342 |
+
"inputs": {},
|
343 |
+
"name": "Define model",
|
344 |
+
"outputs": {
|
345 |
+
"output": {
|
346 |
+
"name": "output",
|
347 |
+
"position": "right",
|
348 |
+
"type": {
|
349 |
+
"type": "None"
|
350 |
+
}
|
351 |
+
}
|
352 |
+
},
|
353 |
+
"params": {
|
354 |
+
"model_workspace": {
|
355 |
+
"default": null,
|
356 |
+
"name": "model_workspace",
|
357 |
+
"type": {
|
358 |
+
"type": "<class 'str'>"
|
359 |
+
}
|
360 |
+
},
|
361 |
+
"save_as": {
|
362 |
+
"default": "model",
|
363 |
+
"name": "save_as",
|
364 |
+
"type": {
|
365 |
+
"type": "<class 'str'>"
|
366 |
+
}
|
367 |
+
}
|
368 |
+
},
|
369 |
+
"position": {
|
370 |
+
"x": 286.0,
|
371 |
+
"y": 208.0
|
372 |
+
},
|
373 |
+
"type": "basic"
|
374 |
+
},
|
375 |
+
"params": {
|
376 |
+
"model_workspace": "ODE-GNN",
|
377 |
+
"save_as": "model"
|
378 |
+
},
|
379 |
+
"status": "done",
|
380 |
+
"title": "Define model"
|
381 |
+
},
|
382 |
+
"dragHandle": ".bg-primary",
|
383 |
+
"height": 200.0,
|
384 |
+
"id": "Define model 1",
|
385 |
+
"position": {
|
386 |
+
"x": 311.976524267066,
|
387 |
+
"y": 146.99006795914332
|
388 |
+
},
|
389 |
+
"type": "basic",
|
390 |
+
"width": 200.0
|
391 |
+
},
|
392 |
+
{
|
393 |
+
"data": {
|
394 |
+
"__execution_delay": 0.0,
|
395 |
+
"collapsed": null,
|
396 |
+
"display": null,
|
397 |
+
"error": "Missing input: bundle",
|
398 |
+
"meta": {
|
399 |
+
"inputs": {
|
400 |
+
"bundle": {
|
401 |
+
"name": "bundle",
|
402 |
+
"position": "left",
|
403 |
+
"type": {
|
404 |
+
"type": "<class 'lynxkite_graph_analytics.core.Bundle'>"
|
405 |
+
}
|
406 |
+
}
|
407 |
+
},
|
408 |
+
"name": "Train model",
|
409 |
+
"outputs": {
|
410 |
+
"output": {
|
411 |
+
"name": "output",
|
412 |
+
"position": "right",
|
413 |
+
"type": {
|
414 |
+
"type": "None"
|
415 |
+
}
|
416 |
+
}
|
417 |
+
},
|
418 |
+
"params": {
|
419 |
+
"epochs": {
|
420 |
+
"default": 1.0,
|
421 |
+
"name": "epochs",
|
422 |
+
"type": {
|
423 |
+
"type": "<class 'int'>"
|
424 |
+
}
|
425 |
+
},
|
426 |
+
"model_mapping": {
|
427 |
+
"default": null,
|
428 |
+
"name": "model_mapping",
|
429 |
+
"type": {
|
430 |
+
"type": "<class 'str'>"
|
431 |
+
}
|
432 |
+
},
|
433 |
+
"model_name": {
|
434 |
+
"default": null,
|
435 |
+
"name": "model_name",
|
436 |
+
"type": {
|
437 |
+
"type": "<class 'str'>"
|
438 |
+
}
|
439 |
+
}
|
440 |
+
},
|
441 |
+
"position": {
|
442 |
+
"x": 995.0,
|
443 |
+
"y": 350.0
|
444 |
+
},
|
445 |
+
"type": "basic"
|
446 |
+
},
|
447 |
+
"params": {
|
448 |
+
"epochs": 1.0,
|
449 |
+
"model_mapping": "input: data_train",
|
450 |
+
"model_name": "model"
|
451 |
+
},
|
452 |
+
"status": "planned",
|
453 |
+
"title": "Train model"
|
454 |
+
},
|
455 |
+
"dragHandle": ".bg-primary",
|
456 |
+
"height": 342.0,
|
457 |
+
"id": "Train model 1",
|
458 |
+
"position": {
|
459 |
+
"x": 1358.7213662492159,
|
460 |
+
"y": 352.03096133771896
|
461 |
+
},
|
462 |
+
"type": "basic",
|
463 |
+
"width": 296.0
|
464 |
+
}
|
465 |
+
]
|
466 |
+
}
|
lynxkite-graph-analytics/src/lynxkite_graph_analytics/lynxkite_ops.py
CHANGED
@@ -342,3 +342,41 @@ def create_graph(bundle: core.Bundle, *, relations: str = None) -> core.Bundle:
|
|
342 |
core.RelationDefinition(**r) for r in json.loads(relations).values()
|
343 |
]
|
344 |
return ops.Result(output=bundle, display=bundle.to_dict(limit=100))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
core.RelationDefinition(**r) for r in json.loads(relations).values()
|
343 |
]
|
344 |
return ops.Result(output=bundle, display=bundle.to_dict(limit=100))
|
345 |
+
|
346 |
+
|
347 |
+
@op("Define model")
|
348 |
+
def define_model(*, model_workspace: str, save_as: str = "model"):
|
349 |
+
"""Reads a PyTorch model workspace and returns it as a model in a bundle."""
|
350 |
+
return None
|
351 |
+
|
352 |
+
|
353 |
+
@op("Biomedical foundation graph (PLACEHOLDER)")
|
354 |
+
def biomedical_foundation_graph(*, filter_nodes: str):
|
355 |
+
"""Loads the gigantic Lynx-maintained knowledge graph. Includes drugs, diseases, genes, proteins, etc."""
|
356 |
+
return None
|
357 |
+
|
358 |
+
|
359 |
+
@op("Train model")
|
360 |
+
def train_model(
|
361 |
+
bundle: core.Bundle, *, model_name: str, model_mapping: str, epochs: int = 1
|
362 |
+
):
|
363 |
+
"""Trains the selected model on the selected dataset. Most training parameters are set in the model definition."""
|
364 |
+
return None
|
365 |
+
|
366 |
+
|
367 |
+
@op("Model inference")
|
368 |
+
def model_inference(
|
369 |
+
bundle: core.Bundle,
|
370 |
+
*,
|
371 |
+
model_name: str,
|
372 |
+
model_mapping: str,
|
373 |
+
save_output_as: str = "prediction",
|
374 |
+
):
|
375 |
+
"""Executes a trained model."""
|
376 |
+
return None
|
377 |
+
|
378 |
+
|
379 |
+
@op("Train/test split")
|
380 |
+
def train_test_split(bundle: core.Bundle, *, table_name: str, test_ratio: float = 0.1):
|
381 |
+
"""Splits a dataframe in the bundle into separate "_train" and "_test" dataframes."""
|
382 |
+
return None
|
lynxkite-graph-analytics/src/lynxkite_graph_analytics/pytorch_model_ops.py
CHANGED
@@ -33,7 +33,29 @@ reg("Input: sequential", outputs=["y"])
|
|
33 |
reg("Input: zeros", outputs=["x"])
|
34 |
|
35 |
reg("LSTM", inputs=["x", "h"], outputs=["x", "h"])
|
36 |
-
reg(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
reg("Attention", inputs=["q", "k", "v"], outputs=["x", "weights"])
|
38 |
reg("LayerNorm", inputs=["x"])
|
39 |
reg("Dropout", inputs=["x"], params=[P.basic("p", 0.5)])
|
|
|
33 |
reg("Input: zeros", outputs=["x"])
|
34 |
|
35 |
reg("LSTM", inputs=["x", "h"], outputs=["x", "h"])
|
36 |
+
reg(
|
37 |
+
"Neural ODE",
|
38 |
+
inputs=["x"],
|
39 |
+
params=[
|
40 |
+
P.basic("relative_tolerance"),
|
41 |
+
P.basic("absolute_tolerance"),
|
42 |
+
P.options(
|
43 |
+
"method",
|
44 |
+
[
|
45 |
+
"dopri8",
|
46 |
+
"dopri5",
|
47 |
+
"bosh3",
|
48 |
+
"fehlberg2",
|
49 |
+
"adaptive_heun",
|
50 |
+
"euler",
|
51 |
+
"midpoint",
|
52 |
+
"rk4",
|
53 |
+
"explicit_adams",
|
54 |
+
"implicit_adams",
|
55 |
+
],
|
56 |
+
),
|
57 |
+
],
|
58 |
+
)
|
59 |
reg("Attention", inputs=["q", "k", "v"], outputs=["x", "weights"])
|
60 |
reg("LayerNorm", inputs=["x"])
|
61 |
reg("Dropout", inputs=["x"], params=[P.basic("p", 0.5)])
|