-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbrowser.min.js
25 lines (17 loc) · 9.65 KB
/
browser.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),_randomInput=require("./random-input"),_randomInput2=_interopRequireDefault(_randomInput);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var BrainCT=function(){function e(n,t){_classCallCheck(this,e),this.net=n,this.inputGenerators=t||this.randomInputGenerators()}return _createClass(e,[{key:"randomInputGenerators",value:function(){for(var e=[],n=0;n<this.net.sizes[0];n++)e.push(new _randomInput2.default);return e}},{key:"scanSync",value:function(e){for(var n=[],t=0;t<e;t++){var r=this.inputGenerators.map(function(e){return e.value()}),a=Array.prototype.slice.call(this.net.run(r));n.push({inputs:r,outputs:a})}return n}}]),e}();exports.default=BrainCT;
},{"./random-input":3}],2:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _brainCt=require("./brain-ct"),_brainCt2=_interopRequireDefault(_brainCt),_randomInput=require("./random-input"),_randomInput2=_interopRequireDefault(_randomInput),_translate=require("./translate"),_translate2=_interopRequireDefault(_translate),_valuesInput=require("./values-input"),_valuesInput2=_interopRequireDefault(_valuesInput);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var brainCT={BrainCT:_brainCt2.default,RandomInput:_randomInput2.default,Translate:_translate2.default,ValuesInput:_valuesInput2.default};exports.default=brainCT,"undefined"!=typeof window&&(window.brainCT=brainCT);
},{"./brain-ct":1,"./random-input":3,"./translate":7,"./values-input":8}],3:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(n,t,a){return t&&e(n.prototype,t),a&&e(n,a),n}}();function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var RandomInput=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"value",value:function(){return Math.random()}}]),e}();exports.default=RandomInput;
},{}],4:[function(require,module,exports){
"use strict";function _toConsumableArray(t){if(Array.isArray(t)){for(var a=0,e=Array(t.length);a<t.length;a++)e[a]=t[a];return e}return Array.from(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(t,a){return data.input=t.outputs[0],data.output=t.outputs[t.outputs.length-1],informAboutDependencies(),generateOptions(t,a)};var data={input:void 0,output:void 0};function informAboutDependencies(){console.log('Ensure you are including both Highcharts and the Draggable Points plugin, e.g. \n <script src="https://code.highcharts.com/highcharts.js"><\/script>\n <script src="https://rawgithub.com/highcharts/draggable-points/master/draggable-points.js"><\/script>\nYou can find more information Highcharts and this plugin at https://www.highcharts.com/')}function updateData(t,a,e){data.input[t]=a,data.output=net.run(data.input),e.series[1].setData(data.output,!0,!1,!0),e.redraw()}function generateOptions(t,a){return{chart:{animation:!1},title:{text:"Neural Net Explorer"},xAxis:[{categories:data.input.map(function(t,a){return"Input "+a})},{categories:[].concat(_toConsumableArray(data.output)).map(function(t,a){return"Output "+a})}],yAxis:{min:0,max:1},plotOptions:{series:{point:{events:{drag:function(t){updateData(this.x,this.y,this.series.chart)},drop:function(){updateData(this.x,this.y,this.series.chart)}}},stickyTracking:!1},line:{cursor:"ns-resize"}},tooltip:{yDecimals:2},series:[{data:[].concat(_toConsumableArray(data.input)),name:"Inputs",draggableY:!0,dragMinY:0,dragMaxY:1,dragPrecision:.01,type:"column",minPointLength:2,xAxis:0},{data:[].concat(_toConsumableArray(data.output)),type:"scatter"===a.outputType?"scatter":"line",name:"Outputs",draggableY:!1,xAxis:1}]}}
},{}],5:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},_createClass=function(){function e(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}return function(r,n,t){return n&&e(r.prototype,n),t&&e(r,t),r}}(),_scanner=require("./scanner"),_scanner2=_interopRequireDefault(_scanner),_explorer2=require("./explorer"),_explorer3=_interopRequireDefault(_explorer2);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}var highcharts=function(){function e(r){_classCallCheck(this,e),this.brainCT=r}return _createClass(e,[{key:"explorer",value:function(r){var n=_extends({},e.defaultOptions.explorer,r);return(0,_explorer3.default)(this.brainCT.net,n)}},{key:"scannerSync",value:function(r){var n=_extends({},e.defaultOptions.scanner,r),t=this.brainCT.scanSync(n.iterations);return(0,_scanner2.default)(t,n)}}],[{key:"defaultOptions",get:function(){return{explorer:{outputType:"scatter"},scanner:{iterations:1e5}}}}]),e}();exports.default=highcharts;
},{"./explorer":4,"./scanner":6}],6:[function(require,module,exports){
"use strict";function informAboutDependencies(){console.log('For Brain-CT Scanner, ensure you are including Highcharts and, for better performance, the boost module, e.g. \n <script src="https://code.highcharts.com/highcharts.js"><\/script>\n <script src="https://code.highcharts.com/modules/boost-canvas.js"><\/script>\n <script src="https://code.highcharts.com/modules/boost.js"><\/script>\nYou can find more information Highcharts and this module at https://www.highcharts.com/')}function generateOptions(t,e){return{title:{text:"Neural Net CT Scan"},boost:{useGPUTranslations:!0,enabled:!0},chart:{width:1e3,height:750,type:"scatter"},plotOptions:{series:{animation:!1}},xAxis:{title:{text:"Output"},min:0,max:t[0].outputs.length,tickInterval:1,gridLineWidth:1},yAxis:{title:{text:"Input"},min:0,max:t[0].inputs.length,tickInterval:1,gridLineWidth:1},legend:{layout:"vertical",align:"left",verticalAlign:"top"},tooltip:{pointFormatter:function(){return"<b>Output:</b> "+this.x%1+"<br /><b>Input:</b> "+this.y%1}},series:outputData(t)}}function coerceAllToNearest(t,e){if(!(e=e||{}).toNearest)return t;var n=1/e.toNearest;return t.map(function(t){return Math.round(t*n)/n})}function outputData(t,e){return e=e||{},t[0].outputs.map(function(t,e){return{id:"output"+e,name:"All Output "+e,showInLegend:!0}}).concat(t.reduce(function(t,e){return e.inputs.forEach(function(n,r){e.outputs.forEach(function(o,i){var s=r+i*e.inputs.length;t[s]=t[s]||{linkedTo:"output"+i,showInLegend:!0,name:"Output "+i+" - Input "+r,data:[],type:"scatter",boostThreshold:1,marker:{radius:.3}};var u=o+i,a=n+r;t[s].data.push([u,a])})}),t},[]))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(t,e){return informAboutDependencies(),generateOptions(t,e)};
},{}],7:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_highcharts=require("./highcharts/"),_highcharts2=_interopRequireDefault(_highcharts);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Translate=function(){function e(){_classCallCheck(this,e),this.brainCt=null}return _createClass(e,[{key:"from",value:function(e){return this.brainCt=e,this}},{key:"to",get:function(){return this}},{key:"highcharts",get:function(){return new _highcharts2.default(this.brainCt)}}],[{key:"from",get:function(){var t=new e;return t.from=t.from.bind(t)}}]),e}();exports.default=Translate;
},{"./highcharts/":5}],8:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ValuesInput=function(){function e(t){_classCallCheck(this,e),this.values=t}return _createClass(e,[{key:"value",value:function(){return this.values[Math.floor(Math.random()*this.values.length)]}}]),e}();exports.default=ValuesInput;
},{}]},{},[2]);