@totemorg/man

2.24.0 • Public • Published

MAN

Extends MathJX with various AI/ML methods:

See the Program Reference for method details.

Usage

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

Manage

npm install @totemorg/enums	# install
npm run start [ ? | $ | ...]	# Unit test
npm run verminor				# Roll minor version
npm run vermajor				# Roll major version
npm run redoc					# Regen documentation

Program Reference

Open/Close ## Modules
String
Array
JIMP

toMathJS

MAN

Add AI/ML methods to MathJX. This module documented in accordance with jsdoc.

String

String~$()

Kind: inner method of String

Array

Array~copy()

Kind: inner method of Array

Array~dist()

Kind: inner method of Array

Array~nearestOf()

Kind: inner method of Array

Array~batch()

Kind: inner method of Array

Array~flush()

Kind: inner method of Array

Array~draw()

Kind: inner method of Array

Array~match()

Kind: inner method of Array

Array~replace()

Kind: inner method of Array

Array~unique()

Kind: inner method of Array

JIMP

toMathJS

JIMP~save()

Kind: inner method of JIMP

JIMP~sym()

Kind: inner method of JIMP

MAN

Add AI/ML methods to MathJX. This module documented in accordance with jsdoc.

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

### Eval a js or mathjs script in a context ctx:

		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

### Create a matrix:

		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

### Index a matrix:

		A.$( (n,A) => A[n] = ... ) 	// index vector with callback
		A.$$( (n,m,A) => A[n][m] = ... ) 	// index matrix with callback

	

Example

### Sample a matrix with optional callback cb(val):

		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

### Import functions to $.somefn and to $( "somefn(...)" )

		$( {
			somefn: function (args) { ... },
			:
			:
		} );

	

Example

### Use the task sharder:

		$( { 
			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

### Aggregate and save events ev = {at: "KEY", ...} to ctx.Save_KEY with 
	callback cb(unsaved events)

		[ev, ...].save( ctx, evs => { ... } );
		"query".save( ctx, evs => { ... } );

	

Example

### Usage methods of $().

		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

### Eval a mathjs script with optional callback and optional context:

		var 
			ctx = $( "mathjs script", ctx, ctx => {   
				x: 1, 
				y: 20, ...
			} );

	

Example

### Eval with extraction of context keys:

		const {x, y, ... } = $( "mathjs script", ctx ) || {};

	

Example

### import functions to $.somefn and to $( "somefn(...)" )
		$( {
			somefn: function (args) { ... },
			:
			:
		} );

	

Example

### Use the task sharder:

		$( { 
				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

Kind: inner property of MAN

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

Contacting, Contributing, Following

Feel free to

License

MIT


© 2012 ACMESDS

Readme

Keywords

none

Package Sidebar

Install

npm i @totemorg/man

Weekly Downloads

176

Version

2.24.0

License

ISC

Unpacked Size

16.5 MB

Total Files

2094

Last publish

Collaborators

  • totem4
  • totem3
  • totem2
  • totem1