@almadar/std 16.213.0 → 16.215.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/canonical-operators.json +300 -198
- package/dist/behaviors-embeddings.hash.json +1 -1
- package/dist/index.js +222 -215
- package/dist/knob-embeddings.hash.json +1 -1
- package/dist/modules/array.js +22 -22
- package/dist/modules/behavior.js +2 -2
- package/dist/modules/browser.js +1 -1
- package/dist/modules/contract.js +6 -6
- package/dist/modules/core.js +43 -32
- package/dist/modules/data.js +7 -7
- package/dist/modules/graph.js +14 -14
- package/dist/modules/index.js +222 -215
- package/dist/modules/integration.js +1 -1
- package/dist/modules/llm.js +2 -2
- package/dist/modules/nn.js +6 -6
- package/dist/modules/object.js +11 -11
- package/dist/modules/prob.js +4 -4
- package/dist/modules/session.js +4 -4
- package/dist/modules/str.js +1 -1
- package/dist/modules/tensor.js +29 -29
- package/dist/modules/time.js +17 -17
- package/dist/modules/trace.js +1 -1
- package/dist/modules/train.js +23 -23
- package/dist/modules/validate.js +23 -27
- package/dist/modules/workspace.js +5 -5
- package/dist/registry.js +222 -215
- package/package.json +1 -1
package/dist/modules/graph.js
CHANGED
|
@@ -14,7 +14,7 @@ var GRAPH_OPERATORS = {
|
|
|
14
14
|
params: [
|
|
15
15
|
{ name: "config", type: "object", description: "Graph construction config (nodes, edges, node-features, edge-features, directed)" }
|
|
16
16
|
],
|
|
17
|
-
example: '["graph/from-entities", { "
|
|
17
|
+
example: '["graph/from-entities", [{ "age": 30, "score": 0.5 }, { "age": 25, "score": 0.7 }]]'
|
|
18
18
|
},
|
|
19
19
|
"graph/from-adjacency": {
|
|
20
20
|
module: "graph",
|
|
@@ -28,7 +28,7 @@ var GRAPH_OPERATORS = {
|
|
|
28
28
|
{ name: "adjacency", type: "tensor", description: "Adjacency matrix" },
|
|
29
29
|
{ name: "features", type: "tensor", description: "Node feature matrix" }
|
|
30
30
|
],
|
|
31
|
-
example: '["graph/from-adjacency",
|
|
31
|
+
example: '["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]'
|
|
32
32
|
},
|
|
33
33
|
"graph/from-edge-list": {
|
|
34
34
|
module: "graph",
|
|
@@ -42,7 +42,7 @@ var GRAPH_OPERATORS = {
|
|
|
42
42
|
{ name: "edges", type: "tensor", description: "Edge index tensor [2, num_edges]" },
|
|
43
43
|
{ name: "features", type: "tensor", description: "Node feature matrix" }
|
|
44
44
|
],
|
|
45
|
-
example: '["graph/from-edge-list",
|
|
45
|
+
example: '["graph/from-edge-list", [[0, 1]], [[1.0], [2.0]]]'
|
|
46
46
|
},
|
|
47
47
|
// ============================================================================
|
|
48
48
|
// Transforms
|
|
@@ -58,7 +58,7 @@ var GRAPH_OPERATORS = {
|
|
|
58
58
|
params: [
|
|
59
59
|
{ name: "graph", type: "graph", description: "Input graph" }
|
|
60
60
|
],
|
|
61
|
-
example: '["graph/add-self-loops", "
|
|
61
|
+
example: '["graph/add-self-loops", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
|
|
62
62
|
},
|
|
63
63
|
"graph/to-undirected": {
|
|
64
64
|
module: "graph",
|
|
@@ -71,7 +71,7 @@ var GRAPH_OPERATORS = {
|
|
|
71
71
|
params: [
|
|
72
72
|
{ name: "graph", type: "graph", description: "Input graph" }
|
|
73
73
|
],
|
|
74
|
-
example: '["graph/to-undirected", "
|
|
74
|
+
example: '["graph/to-undirected", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
|
|
75
75
|
},
|
|
76
76
|
"graph/subgraph": {
|
|
77
77
|
module: "graph",
|
|
@@ -85,7 +85,7 @@ var GRAPH_OPERATORS = {
|
|
|
85
85
|
{ name: "graph", type: "graph", description: "Input graph" },
|
|
86
86
|
{ name: "mask", type: "tensor", description: "Boolean node mask" }
|
|
87
87
|
],
|
|
88
|
-
example: '["graph/subgraph", "
|
|
88
|
+
example: '["graph/subgraph", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]], [true, false]]'
|
|
89
89
|
},
|
|
90
90
|
"graph/k-hop": {
|
|
91
91
|
module: "graph",
|
|
@@ -100,7 +100,7 @@ var GRAPH_OPERATORS = {
|
|
|
100
100
|
{ name: "node", type: "number", description: "Center node index" },
|
|
101
101
|
{ name: "k", type: "number", description: "Number of hops" }
|
|
102
102
|
],
|
|
103
|
-
example: '["graph/k-hop", "
|
|
103
|
+
example: '["graph/k-hop", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]], 0, 2]'
|
|
104
104
|
},
|
|
105
105
|
// ============================================================================
|
|
106
106
|
// Accessors
|
|
@@ -116,7 +116,7 @@ var GRAPH_OPERATORS = {
|
|
|
116
116
|
params: [
|
|
117
117
|
{ name: "graph", type: "graph", description: "Input graph" }
|
|
118
118
|
],
|
|
119
|
-
example: '["graph/node-features", "
|
|
119
|
+
example: '["graph/node-features", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
|
|
120
120
|
},
|
|
121
121
|
"graph/edge-index": {
|
|
122
122
|
module: "graph",
|
|
@@ -129,7 +129,7 @@ var GRAPH_OPERATORS = {
|
|
|
129
129
|
params: [
|
|
130
130
|
{ name: "graph", type: "graph", description: "Input graph" }
|
|
131
131
|
],
|
|
132
|
-
example: '["graph/edge-index", "
|
|
132
|
+
example: '["graph/edge-index", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
|
|
133
133
|
},
|
|
134
134
|
"graph/edge-features": {
|
|
135
135
|
module: "graph",
|
|
@@ -142,7 +142,7 @@ var GRAPH_OPERATORS = {
|
|
|
142
142
|
params: [
|
|
143
143
|
{ name: "graph", type: "graph", description: "Input graph" }
|
|
144
144
|
],
|
|
145
|
-
example: '["graph/edge-features", "
|
|
145
|
+
example: '["graph/edge-features", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
|
|
146
146
|
},
|
|
147
147
|
"graph/num-nodes": {
|
|
148
148
|
module: "graph",
|
|
@@ -155,7 +155,7 @@ var GRAPH_OPERATORS = {
|
|
|
155
155
|
params: [
|
|
156
156
|
{ name: "graph", type: "graph", description: "Input graph" }
|
|
157
157
|
],
|
|
158
|
-
example: '["graph/num-nodes", "
|
|
158
|
+
example: '["graph/num-nodes", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
|
|
159
159
|
},
|
|
160
160
|
"graph/num-edges": {
|
|
161
161
|
module: "graph",
|
|
@@ -168,7 +168,7 @@ var GRAPH_OPERATORS = {
|
|
|
168
168
|
params: [
|
|
169
169
|
{ name: "graph", type: "graph", description: "Input graph" }
|
|
170
170
|
],
|
|
171
|
-
example: '["graph/num-edges", "
|
|
171
|
+
example: '["graph/num-edges", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
|
|
172
172
|
},
|
|
173
173
|
"graph/degree": {
|
|
174
174
|
module: "graph",
|
|
@@ -181,7 +181,7 @@ var GRAPH_OPERATORS = {
|
|
|
181
181
|
params: [
|
|
182
182
|
{ name: "graph", type: "graph", description: "Input graph" }
|
|
183
183
|
],
|
|
184
|
-
example: '["graph/degree", "
|
|
184
|
+
example: '["graph/degree", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
|
|
185
185
|
},
|
|
186
186
|
// ============================================================================
|
|
187
187
|
// Batching
|
|
@@ -197,7 +197,7 @@ var GRAPH_OPERATORS = {
|
|
|
197
197
|
params: [
|
|
198
198
|
{ name: "graphs", type: "array", description: "List of graphs" }
|
|
199
199
|
],
|
|
200
|
-
example: '["graph/batch", "
|
|
200
|
+
example: '["graph/batch", [["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]]'
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
203
|
function getGraphOperators() {
|