matrix manipulator
npm install @totemstan/manExtends MathJX with various AI/ML methods:
* light weight image processing
* symbolic algebra
* time series analysis (
digital signal,
spectral)
* hidden markov methods (
viterbi, baum-welch,
EM)
* matrix decompositions (
eigen spectrums)
* bayesian belief networks
* recurrent neural networks
* convolutional neural networks
* regression methods (
logistic,
support vector,
other)
* non-linear optimizers (
least cost path,
linear programming,
gradient descent, newton-raphton)
* neural networks (
convolutional,
language models)
* special functions (
gamma,
multivariate normal,
rieman-zeta).
See the Program Reference for method details.
Acquire and optionally configure MAN as follows:
const $ = require("man").config({
key: value, // set key
"key.key": value, // indexed set
"key.key.": value // indexed append
});
where configuration keys follow ENUMS deep copy conventions
npm install @totemstan/enums # install
npm run start [ ? | $ | ...] # Unit test
npm run verminor # Roll minor version
npm run vermajor # Roll major version
npm run redoc # Regen documentation
String * Array
* ~copy()
* ~dist()
* ~nearestOf()
* ~batch()
* ~flush()
* ~draw()
* ~match()
* ~replace()
* ~$(index, ctx) ⇒ Object
* ~$$()
* ~unique()
Array Array Array Array Array Array Array Array string of the form "to=from & to=eval & to & ... & !where=eval"
hash of the form {to: from, ...}
callback of the form (idx,array) => { ... }
The "!where" clause returns only records having a nonzero eval.
Kind: inner method of Array
Returns: Object - Aggregated data
| Param | Type | Description |
| --- | --- | --- |
| index | String \| Object \| function | Indexer |
| ctx | Object | Context of functions etc |
Example
``js`
[{x:1,y:2},{x:10,y:20}].$("u=x+1&v=sin(y)&!where=x>5",Math)
{ u: [ 11 ], v: [ 0.9129452507276277 ] }`
Example js`
[{x:1,y:2},{x:10,y:20}].$("x")
{ x: [ 1, 10 ] }`
Example js`
[{x:1,y:2},{x:10,y:20}].$("x&mydata=y")
{ mydata: [ 2, 20 ], x: [ 1, 10 ] }`
Example js`
[{x:1,y:2},{x:10,y:20}].$("mydata=[x,y]")
{ mydata: [ [ 1, 2 ], [ 10, 20 ] ] }`
Example js`
[{x:1,y:2},{x:10,y:20}].$("mydata=x+1")
{ mydata: [ 2, 11 ] }`
Example js`
[{x:1,y:2},{x:10,y:20}].$("",{"!all":1})
{ x: [ 1, 10 ], y: [ 2, 20 ] }`
Example js`
[{x:1,y:2},{x:10,y:20}].$("")
[ { x: 1, y: 2 }, { x: 10, y: 20 } ]`
Example js`
[{x:1,y:2},{x:10,y:20}].$("u")
{ u: [ undefined, undefined ] }`
Example js`
[[1,2,3],[10,20,30]].$("1&0")
{ '0': [ 1, 10 ], '1': [ 2, 20 ] }
Array Array JIMP JIMP Requires: module:enums, module:mathjx, module:crypto, module:mathjs, module:fft-js, module:nodehmm, module:node-svd, module:node-svm, module:mljs, module:jimp, module:jsbayes, module:recurrent-js, module:gamma, module:expectation-maximization, module:multivariate-normal, module:newton-raphson, module:random-seed, module:edmonds-blossom, module:simple-simplex, module:tensorflow/tfjs
Author: ACMESDS
Example
`js$3
var
ctx = $( "script", ctx, ctx => { // eval with callback
Trace("updated context", ctx);
} ),
ctx = "script".$( ctx ), // abbreviated
{ x, y, ... } = "script".$( ctx ) || {}; // with context x,y extractions
``
Example js$3
var
A = $( N, (n,A) => A[n] = ... ) , // define N-length vector
A = $( [M,N], (n,m,A) => A[m][n] = ... ) ; // define M x N matrrix
``
Example js$3
A.$( (n,A) => A[n] = ... ) // index vector with callback
A.$$( (n,m,A) => A[n][m] = ... ) // index matrix with callback
``
Example js$3
var
B = A.get( idx , cb),
B = A.get( "key, ...", cb ),
B = A.get( [idx, ...] , cb),
B = A.get( [key, ...] , cb ),
B = A.get( {rekey: { toKey: "fromKey", ... }, cb ),
B = A.get( {draw: N}, cb ),
B = A.get( {start:N, count:N}, cb ),
B = A.get( {KEY_starts: "with", ...}, cb ),
B = A.get( {KEY_ends: "with", ...}, cb )
``
Example js$3
$( {
somefn: function (args) { ... },
:
:
} );
``
Example js$3
$( {
keys: "i,j,k", // array indicies
i: [0,1,2,3], // domain of index i
j: [4,8], // domain of index j
k: [0], // domain of index k
qos: 0, // regulation time in ms if not zero
local: false, // enable to run task local, i.e. w/o workers and nodes
workers: 4, // limit number of workers (aka cores) per node
nodes: 3 // limit number of nodes (ala locales) in the cluster
},
// here, a simple task that returns a message
$ => "my result is " + (i + j*k) + " from " + $.worker + " on " + $.node,
// here, a simple callback that displays the task results
msg => console.log(msg)
);
``
Example js$3
callback cb(unsaved events)
[ev, ...].save( ctx, evs => { ... } );
"query".save( ctx, evs => { ... } );
``
Example js$3
const $ = require("man")
$( "mathjs script", ctx, ctx => { ... } )
$( "mathjs script", ctx )
$( "mathjs script" )
$( [M,N], (m,n,A) => { A[m][n] = ... } )
$( N, (n,A) => { A[n] = ... } )
$({ // import functions
f: (...) => { ... },
...
})
$({ // task sharding
keys: "i,j,...", // array indicies
i: [...], // domain of index i
j: [...], // domain of index j
k: [...], // domain of index k
qos: N, // regulation time in ms if not zero
local: false, // enable to run task local, i.e. w/o workers and nodes
workers: N, // limit number of workers (aka cores) per node
nodes: N // limit number of nodes (ala locales) in the cluster
},
// here, a simple task that returns a message
$ => "my result is " + (i + j*k) + " from " + $.worker + " on " + $.node,
// here, a simple callback that displays the task results
msg => console.log(msg)
);
``
Example js$3
var
ctx = $( "mathjs script", ctx, ctx => {
x: 1,
y: 20, ...
} );
``
Example js$3
const {x, y, ... } = $( "mathjs script", ctx ) || {};
``
Example js`$3
$( {
somefn: function (args) { ... },
:
:
} );`
Example js$3
$( {
keys: "i,j,k", // array indicies
i: [0,1,2,3], // domain of index i
j: [4,8], // domain of index j
k: [0], // domain of index k
qos: 0, // regulation time in ms if not zero
local: false, // enable to run task local, i.e. w/o workers and nodes
workers: 4, // limit number of workers (aka cores) per node
nodes: 3 // limit number of nodes (ala locales) in the cluster
},
// here, a simple task that returns a message
$ => "my result is " + (i + j*k) + " from " + $.worker + " on " + $.node,
// here, a simple callback that displays the task results
msg => console.log(msg)
);
``
* MAN
* ~scripts
* .conf
* .pca
* .roc
* .snr
* .p0
* .pw
* .wk
* .trigger()
MAN * ~scripts
* .conf
* .pca
* .roc
* .snr
* .p0
* .pw
* .wk
* .trigger()
#### scripts.conf
Kind: static property of scripts
#### scripts.pca
Kind: static property of scripts
#### scripts.roc
Kind: static property of scripts
#### scripts.snr
Kind: static property of scripts
#### scripts.p0
Kind: static property of scripts
#### scripts.pw
Kind: static property of scripts
#### scripts.wk
Kind: static property of scripts
#### scripts.trigger()
Kind: static method of scripts
Feel free to
* submit and status TOTEM issues
* contribute to TOTEM notebooks
* revise TOTEM requirements
* browse TOTEM holdings
* or follow TOTEM milestones
*
© 2012 ACMESDS