/*! * * WebGazer.js: Scalable Webcam EyeTracking Using User Interactions * Copyright (c) 2016-2020, Brown HCI Group * Licensed under GPLv3. Companies with a valuation of less than $1M can use WebGazer.js under LGPLv3. * */ var webgazer = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 304); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "AdadeltaOptimizer", function() { return /* reexport */ adadelta_optimizer_AdadeltaOptimizer; }); __webpack_require__.d(__webpack_exports__, "AdagradOptimizer", function() { return /* reexport */ adagrad_optimizer_AdagradOptimizer; }); __webpack_require__.d(__webpack_exports__, "AdamOptimizer", function() { return /* reexport */ adam_optimizer_AdamOptimizer; }); __webpack_require__.d(__webpack_exports__, "AdamaxOptimizer", function() { return /* reexport */ adamax_optimizer_AdamaxOptimizer; }); __webpack_require__.d(__webpack_exports__, "MomentumOptimizer", function() { return /* reexport */ momentum_optimizer_MomentumOptimizer; }); __webpack_require__.d(__webpack_exports__, "Optimizer", function() { return /* reexport */ optimizer_Optimizer; }); __webpack_require__.d(__webpack_exports__, "RMSPropOptimizer", function() { return /* reexport */ rmsprop_optimizer_RMSPropOptimizer; }); __webpack_require__.d(__webpack_exports__, "SGDOptimizer", function() { return /* reexport */ sgd_optimizer_SGDOptimizer; }); __webpack_require__.d(__webpack_exports__, "Tensor", function() { return /* reexport */ dist_tensor["a" /* Tensor */]; }); __webpack_require__.d(__webpack_exports__, "TensorBuffer", function() { return /* reexport */ dist_tensor["b" /* TensorBuffer */]; }); __webpack_require__.d(__webpack_exports__, "Variable", function() { return /* reexport */ dist_tensor["c" /* Variable */]; }); __webpack_require__.d(__webpack_exports__, "Rank", function() { return /* reexport */ dist_types["a" /* Rank */]; }); __webpack_require__.d(__webpack_exports__, "sumOutType", function() { return /* reexport */ dist_types["b" /* sumOutType */]; }); __webpack_require__.d(__webpack_exports__, "upcastType", function() { return /* reexport */ dist_types["c" /* upcastType */]; }); __webpack_require__.d(__webpack_exports__, "abs", function() { return /* reexport */ ops["b" /* abs */]; }); __webpack_require__.d(__webpack_exports__, "acos", function() { return /* reexport */ ops["c" /* acos */]; }); __webpack_require__.d(__webpack_exports__, "acosh", function() { return /* reexport */ ops["d" /* acosh */]; }); __webpack_require__.d(__webpack_exports__, "add", function() { return /* reexport */ ops["e" /* add */]; }); __webpack_require__.d(__webpack_exports__, "addN", function() { return /* reexport */ ops["f" /* addN */]; }); __webpack_require__.d(__webpack_exports__, "all", function() { return /* reexport */ ops["g" /* all */]; }); __webpack_require__.d(__webpack_exports__, "any", function() { return /* reexport */ ops["h" /* any */]; }); __webpack_require__.d(__webpack_exports__, "argMax", function() { return /* reexport */ ops["i" /* argMax */]; }); __webpack_require__.d(__webpack_exports__, "argMin", function() { return /* reexport */ ops["j" /* argMin */]; }); __webpack_require__.d(__webpack_exports__, "asin", function() { return /* reexport */ ops["k" /* asin */]; }); __webpack_require__.d(__webpack_exports__, "asinh", function() { return /* reexport */ ops["l" /* asinh */]; }); __webpack_require__.d(__webpack_exports__, "atan", function() { return /* reexport */ ops["m" /* atan */]; }); __webpack_require__.d(__webpack_exports__, "atan2", function() { return /* reexport */ ops["n" /* atan2 */]; }); __webpack_require__.d(__webpack_exports__, "atanh", function() { return /* reexport */ ops["o" /* atanh */]; }); __webpack_require__.d(__webpack_exports__, "avgPool", function() { return /* reexport */ ops["p" /* avgPool */]; }); __webpack_require__.d(__webpack_exports__, "avgPool3d", function() { return /* reexport */ ops["q" /* avgPool3d */]; }); __webpack_require__.d(__webpack_exports__, "basicLSTMCell", function() { return /* reexport */ ops["r" /* basicLSTMCell */]; }); __webpack_require__.d(__webpack_exports__, "batchToSpaceND", function() { return /* reexport */ ops["w" /* batchToSpaceND */]; }); __webpack_require__.d(__webpack_exports__, "batchNorm", function() { return /* reexport */ ops["s" /* batchNorm */]; }); __webpack_require__.d(__webpack_exports__, "batchNorm2d", function() { return /* reexport */ ops["t" /* batchNorm2d */]; }); __webpack_require__.d(__webpack_exports__, "batchNorm3d", function() { return /* reexport */ ops["u" /* batchNorm3d */]; }); __webpack_require__.d(__webpack_exports__, "batchNorm4d", function() { return /* reexport */ ops["v" /* batchNorm4d */]; }); __webpack_require__.d(__webpack_exports__, "bincount", function() { return /* reexport */ ops["x" /* bincount */]; }); __webpack_require__.d(__webpack_exports__, "broadcastTo", function() { return /* reexport */ ops["z" /* broadcastTo */]; }); __webpack_require__.d(__webpack_exports__, "buffer", function() { return /* reexport */ ops["A" /* buffer */]; }); __webpack_require__.d(__webpack_exports__, "cast", function() { return /* reexport */ ops["B" /* cast */]; }); __webpack_require__.d(__webpack_exports__, "ceil", function() { return /* reexport */ ops["C" /* ceil */]; }); __webpack_require__.d(__webpack_exports__, "clipByValue", function() { return /* reexport */ ops["D" /* clipByValue */]; }); __webpack_require__.d(__webpack_exports__, "clone", function() { return /* reexport */ ops["E" /* clone */]; }); __webpack_require__.d(__webpack_exports__, "complex", function() { return /* reexport */ ops["F" /* complex */]; }); __webpack_require__.d(__webpack_exports__, "concat", function() { return /* reexport */ ops["G" /* concat */]; }); __webpack_require__.d(__webpack_exports__, "concat1d", function() { return /* reexport */ ops["H" /* concat1d */]; }); __webpack_require__.d(__webpack_exports__, "concat2d", function() { return /* reexport */ ops["I" /* concat2d */]; }); __webpack_require__.d(__webpack_exports__, "concat3d", function() { return /* reexport */ ops["J" /* concat3d */]; }); __webpack_require__.d(__webpack_exports__, "concat4d", function() { return /* reexport */ ops["K" /* concat4d */]; }); __webpack_require__.d(__webpack_exports__, "conv1d", function() { return /* reexport */ ops["L" /* conv1d */]; }); __webpack_require__.d(__webpack_exports__, "conv2d", function() { return /* reexport */ ops["M" /* conv2d */]; }); __webpack_require__.d(__webpack_exports__, "conv2dTranspose", function() { return /* reexport */ ops["N" /* conv2dTranspose */]; }); __webpack_require__.d(__webpack_exports__, "conv3d", function() { return /* reexport */ ops["O" /* conv3d */]; }); __webpack_require__.d(__webpack_exports__, "conv3dTranspose", function() { return /* reexport */ ops["P" /* conv3dTranspose */]; }); __webpack_require__.d(__webpack_exports__, "cos", function() { return /* reexport */ ops["Q" /* cos */]; }); __webpack_require__.d(__webpack_exports__, "cosh", function() { return /* reexport */ ops["R" /* cosh */]; }); __webpack_require__.d(__webpack_exports__, "cumsum", function() { return /* reexport */ ops["T" /* cumsum */]; }); __webpack_require__.d(__webpack_exports__, "denseBincount", function() { return /* reexport */ ops["U" /* denseBincount */]; }); __webpack_require__.d(__webpack_exports__, "depthToSpace", function() { return /* reexport */ ops["V" /* depthToSpace */]; }); __webpack_require__.d(__webpack_exports__, "depthwiseConv2d", function() { return /* reexport */ ops["W" /* depthwiseConv2d */]; }); __webpack_require__.d(__webpack_exports__, "diag", function() { return /* reexport */ ops["X" /* diag */]; }); __webpack_require__.d(__webpack_exports__, "dilation2d", function() { return /* reexport */ ops["Y" /* dilation2d */]; }); __webpack_require__.d(__webpack_exports__, "div", function() { return /* reexport */ ops["Z" /* div */]; }); __webpack_require__.d(__webpack_exports__, "divNoNan", function() { return /* reexport */ ops["ab" /* divNoNan */]; }); __webpack_require__.d(__webpack_exports__, "dot", function() { return /* reexport */ ops["bb" /* dot */]; }); __webpack_require__.d(__webpack_exports__, "einsum", function() { return /* reexport */ ops["db" /* einsum */]; }); __webpack_require__.d(__webpack_exports__, "elu", function() { return /* reexport */ ops["eb" /* elu */]; }); __webpack_require__.d(__webpack_exports__, "equal", function() { return /* reexport */ ops["gb" /* equal */]; }); __webpack_require__.d(__webpack_exports__, "erf", function() { return /* reexport */ ops["hb" /* erf */]; }); __webpack_require__.d(__webpack_exports__, "exp", function() { return /* reexport */ ops["ib" /* exp */]; }); __webpack_require__.d(__webpack_exports__, "expandDims", function() { return /* reexport */ ops["jb" /* expandDims */]; }); __webpack_require__.d(__webpack_exports__, "expm1", function() { return /* reexport */ ops["kb" /* expm1 */]; }); __webpack_require__.d(__webpack_exports__, "eye", function() { return /* reexport */ ops["lb" /* eye */]; }); __webpack_require__.d(__webpack_exports__, "fill", function() { return /* reexport */ ops["nb" /* fill */]; }); __webpack_require__.d(__webpack_exports__, "floor", function() { return /* reexport */ ops["ob" /* floor */]; }); __webpack_require__.d(__webpack_exports__, "floorDiv", function() { return /* reexport */ ops["pb" /* floorDiv */]; }); __webpack_require__.d(__webpack_exports__, "gather", function() { return /* reexport */ ops["rb" /* gather */]; }); __webpack_require__.d(__webpack_exports__, "greater", function() { return /* reexport */ ops["tb" /* greater */]; }); __webpack_require__.d(__webpack_exports__, "greaterEqual", function() { return /* reexport */ ops["ub" /* greaterEqual */]; }); __webpack_require__.d(__webpack_exports__, "imag", function() { return /* reexport */ ops["wb" /* imag */]; }); __webpack_require__.d(__webpack_exports__, "isFinite", function() { return /* reexport */ ops["Ab" /* isFinite */]; }); __webpack_require__.d(__webpack_exports__, "isInf", function() { return /* reexport */ ops["Bb" /* isInf */]; }); __webpack_require__.d(__webpack_exports__, "isNaN", function() { return /* reexport */ ops["Cb" /* isNaN */]; }); __webpack_require__.d(__webpack_exports__, "leakyRelu", function() { return /* reexport */ ops["Db" /* leakyRelu */]; }); __webpack_require__.d(__webpack_exports__, "less", function() { return /* reexport */ ops["Eb" /* less */]; }); __webpack_require__.d(__webpack_exports__, "lessEqual", function() { return /* reexport */ ops["Fb" /* lessEqual */]; }); __webpack_require__.d(__webpack_exports__, "linspace", function() { return /* reexport */ ops["Hb" /* linspace */]; }); __webpack_require__.d(__webpack_exports__, "localResponseNormalization", function() { return /* reexport */ ops["Ib" /* localResponseNormalization */]; }); __webpack_require__.d(__webpack_exports__, "log", function() { return /* reexport */ ops["Jb" /* log */]; }); __webpack_require__.d(__webpack_exports__, "log1p", function() { return /* reexport */ ops["Kb" /* log1p */]; }); __webpack_require__.d(__webpack_exports__, "logSigmoid", function() { return /* reexport */ ops["Lb" /* logSigmoid */]; }); __webpack_require__.d(__webpack_exports__, "logSoftmax", function() { return /* reexport */ ops["Mb" /* logSoftmax */]; }); __webpack_require__.d(__webpack_exports__, "logSumExp", function() { return /* reexport */ ops["Nb" /* logSumExp */]; }); __webpack_require__.d(__webpack_exports__, "logicalAnd", function() { return /* reexport */ ops["Ob" /* logicalAnd */]; }); __webpack_require__.d(__webpack_exports__, "logicalNot", function() { return /* reexport */ ops["Pb" /* logicalNot */]; }); __webpack_require__.d(__webpack_exports__, "logicalOr", function() { return /* reexport */ ops["Qb" /* logicalOr */]; }); __webpack_require__.d(__webpack_exports__, "logicalXor", function() { return /* reexport */ ops["Rb" /* logicalXor */]; }); __webpack_require__.d(__webpack_exports__, "matMul", function() { return /* reexport */ ops["Tb" /* matMul */]; }); __webpack_require__.d(__webpack_exports__, "max", function() { return /* reexport */ ops["Ub" /* max */]; }); __webpack_require__.d(__webpack_exports__, "maxPool", function() { return /* reexport */ ops["Vb" /* maxPool */]; }); __webpack_require__.d(__webpack_exports__, "maxPool3d", function() { return /* reexport */ ops["Wb" /* maxPool3d */]; }); __webpack_require__.d(__webpack_exports__, "maxPoolWithArgmax", function() { return /* reexport */ ops["Xb" /* maxPoolWithArgmax */]; }); __webpack_require__.d(__webpack_exports__, "maximum", function() { return /* reexport */ ops["Yb" /* maximum */]; }); __webpack_require__.d(__webpack_exports__, "mean", function() { return /* reexport */ ops["Zb" /* mean */]; }); __webpack_require__.d(__webpack_exports__, "meshgrid", function() { return /* reexport */ ops["ac" /* meshgrid */]; }); __webpack_require__.d(__webpack_exports__, "min", function() { return /* reexport */ ops["bc" /* min */]; }); __webpack_require__.d(__webpack_exports__, "minimum", function() { return /* reexport */ ops["cc" /* minimum */]; }); __webpack_require__.d(__webpack_exports__, "mirrorPad", function() { return /* reexport */ ops["dc" /* mirrorPad */]; }); __webpack_require__.d(__webpack_exports__, "mod", function() { return /* reexport */ ops["ec" /* mod */]; }); __webpack_require__.d(__webpack_exports__, "moments", function() { return /* reexport */ ops["fc" /* moments */]; }); __webpack_require__.d(__webpack_exports__, "mul", function() { return /* reexport */ ops["hc" /* mul */]; }); __webpack_require__.d(__webpack_exports__, "multiRNNCell", function() { return /* reexport */ ops["ic" /* multiRNNCell */]; }); __webpack_require__.d(__webpack_exports__, "multinomial", function() { return /* reexport */ ops["jc" /* multinomial */]; }); __webpack_require__.d(__webpack_exports__, "neg", function() { return /* reexport */ ops["kc" /* neg */]; }); __webpack_require__.d(__webpack_exports__, "notEqual", function() { return /* reexport */ ops["mc" /* notEqual */]; }); __webpack_require__.d(__webpack_exports__, "oneHot", function() { return /* reexport */ ops["nc" /* oneHot */]; }); __webpack_require__.d(__webpack_exports__, "ones", function() { return /* reexport */ ops["oc" /* ones */]; }); __webpack_require__.d(__webpack_exports__, "onesLike", function() { return /* reexport */ ops["pc" /* onesLike */]; }); __webpack_require__.d(__webpack_exports__, "outerProduct", function() { return /* reexport */ ops["rc" /* outerProduct */]; }); __webpack_require__.d(__webpack_exports__, "pad", function() { return /* reexport */ ops["sc" /* pad */]; }); __webpack_require__.d(__webpack_exports__, "pad1d", function() { return /* reexport */ ops["tc" /* pad1d */]; }); __webpack_require__.d(__webpack_exports__, "pad2d", function() { return /* reexport */ ops["uc" /* pad2d */]; }); __webpack_require__.d(__webpack_exports__, "pad3d", function() { return /* reexport */ ops["vc" /* pad3d */]; }); __webpack_require__.d(__webpack_exports__, "pad4d", function() { return /* reexport */ ops["wc" /* pad4d */]; }); __webpack_require__.d(__webpack_exports__, "pool", function() { return /* reexport */ ops["xc" /* pool */]; }); __webpack_require__.d(__webpack_exports__, "pow", function() { return /* reexport */ ops["yc" /* pow */]; }); __webpack_require__.d(__webpack_exports__, "prelu", function() { return /* reexport */ ops["zc" /* prelu */]; }); __webpack_require__.d(__webpack_exports__, "print", function() { return /* reexport */ ops["Ac" /* print */]; }); __webpack_require__.d(__webpack_exports__, "prod", function() { return /* reexport */ ops["Bc" /* prod */]; }); __webpack_require__.d(__webpack_exports__, "rand", function() { return /* reexport */ ops["Cc" /* rand */]; }); __webpack_require__.d(__webpack_exports__, "randomGamma", function() { return /* reexport */ ops["Dc" /* randomGamma */]; }); __webpack_require__.d(__webpack_exports__, "randomNormal", function() { return /* reexport */ ops["Ec" /* randomNormal */]; }); __webpack_require__.d(__webpack_exports__, "randomUniform", function() { return /* reexport */ ops["Fc" /* randomUniform */]; }); __webpack_require__.d(__webpack_exports__, "range", function() { return /* reexport */ ops["Gc" /* range */]; }); __webpack_require__.d(__webpack_exports__, "real", function() { return /* reexport */ ops["Hc" /* real */]; }); __webpack_require__.d(__webpack_exports__, "reciprocal", function() { return /* reexport */ ops["Ic" /* reciprocal */]; }); __webpack_require__.d(__webpack_exports__, "relu", function() { return /* reexport */ ops["Jc" /* relu */]; }); __webpack_require__.d(__webpack_exports__, "relu6", function() { return /* reexport */ ops["Kc" /* relu6 */]; }); __webpack_require__.d(__webpack_exports__, "reshape", function() { return /* reexport */ ops["Lc" /* reshape */]; }); __webpack_require__.d(__webpack_exports__, "reverse", function() { return /* reexport */ ops["Mc" /* reverse */]; }); __webpack_require__.d(__webpack_exports__, "reverse1d", function() { return /* reexport */ ops["Nc" /* reverse1d */]; }); __webpack_require__.d(__webpack_exports__, "reverse2d", function() { return /* reexport */ ops["Oc" /* reverse2d */]; }); __webpack_require__.d(__webpack_exports__, "reverse3d", function() { return /* reexport */ ops["Pc" /* reverse3d */]; }); __webpack_require__.d(__webpack_exports__, "reverse4d", function() { return /* reexport */ ops["Qc" /* reverse4d */]; }); __webpack_require__.d(__webpack_exports__, "round", function() { return /* reexport */ ops["Sc" /* round */]; }); __webpack_require__.d(__webpack_exports__, "rsqrt", function() { return /* reexport */ ops["Tc" /* rsqrt */]; }); __webpack_require__.d(__webpack_exports__, "scalar", function() { return /* reexport */ ops["Uc" /* scalar */]; }); __webpack_require__.d(__webpack_exports__, "selu", function() { return /* reexport */ ops["Wc" /* selu */]; }); __webpack_require__.d(__webpack_exports__, "separableConv2d", function() { return /* reexport */ ops["Xc" /* separableConv2d */]; }); __webpack_require__.d(__webpack_exports__, "setdiff1dAsync", function() { return /* reexport */ ops["Yc" /* setdiff1dAsync */]; }); __webpack_require__.d(__webpack_exports__, "sigmoid", function() { return /* reexport */ ops["Zc" /* sigmoid */]; }); __webpack_require__.d(__webpack_exports__, "sign", function() { return /* reexport */ ops["ad" /* sign */]; }); __webpack_require__.d(__webpack_exports__, "sin", function() { return /* reexport */ ops["cd" /* sin */]; }); __webpack_require__.d(__webpack_exports__, "sinh", function() { return /* reexport */ ops["dd" /* sinh */]; }); __webpack_require__.d(__webpack_exports__, "slice", function() { return /* reexport */ ops["ed" /* slice */]; }); __webpack_require__.d(__webpack_exports__, "slice1d", function() { return /* reexport */ ops["fd" /* slice1d */]; }); __webpack_require__.d(__webpack_exports__, "slice2d", function() { return /* reexport */ ops["gd" /* slice2d */]; }); __webpack_require__.d(__webpack_exports__, "slice3d", function() { return /* reexport */ ops["hd" /* slice3d */]; }); __webpack_require__.d(__webpack_exports__, "slice4d", function() { return /* reexport */ ops["id" /* slice4d */]; }); __webpack_require__.d(__webpack_exports__, "softmax", function() { return /* reexport */ ops["jd" /* softmax */]; }); __webpack_require__.d(__webpack_exports__, "softplus", function() { return /* reexport */ ops["kd" /* softplus */]; }); __webpack_require__.d(__webpack_exports__, "spaceToBatchND", function() { return /* reexport */ ops["ld" /* spaceToBatchND */]; }); __webpack_require__.d(__webpack_exports__, "fft", function() { return /* reexport */ ops["mb" /* fft */]; }); __webpack_require__.d(__webpack_exports__, "ifft", function() { return /* reexport */ ops["vb" /* ifft */]; }); __webpack_require__.d(__webpack_exports__, "irfft", function() { return /* reexport */ ops["zb" /* irfft */]; }); __webpack_require__.d(__webpack_exports__, "rfft", function() { return /* reexport */ ops["Rc" /* rfft */]; }); __webpack_require__.d(__webpack_exports__, "split", function() { return /* reexport */ ops["pd" /* split */]; }); __webpack_require__.d(__webpack_exports__, "sqrt", function() { return /* reexport */ ops["qd" /* sqrt */]; }); __webpack_require__.d(__webpack_exports__, "square", function() { return /* reexport */ ops["rd" /* square */]; }); __webpack_require__.d(__webpack_exports__, "squaredDifference", function() { return /* reexport */ ops["sd" /* squaredDifference */]; }); __webpack_require__.d(__webpack_exports__, "squeeze", function() { return /* reexport */ ops["td" /* squeeze */]; }); __webpack_require__.d(__webpack_exports__, "stack", function() { return /* reexport */ ops["ud" /* stack */]; }); __webpack_require__.d(__webpack_exports__, "step", function() { return /* reexport */ ops["vd" /* step */]; }); __webpack_require__.d(__webpack_exports__, "stridedSlice", function() { return /* reexport */ ops["wd" /* stridedSlice */]; }); __webpack_require__.d(__webpack_exports__, "sub", function() { return /* reexport */ ops["xd" /* sub */]; }); __webpack_require__.d(__webpack_exports__, "sum", function() { return /* reexport */ ops["yd" /* sum */]; }); __webpack_require__.d(__webpack_exports__, "tan", function() { return /* reexport */ ops["zd" /* tan */]; }); __webpack_require__.d(__webpack_exports__, "tanh", function() { return /* reexport */ ops["Ad" /* tanh */]; }); __webpack_require__.d(__webpack_exports__, "tensor", function() { return /* reexport */ ops["Bd" /* tensor */]; }); __webpack_require__.d(__webpack_exports__, "tensor1d", function() { return /* reexport */ ops["Cd" /* tensor1d */]; }); __webpack_require__.d(__webpack_exports__, "tensor2d", function() { return /* reexport */ ops["Dd" /* tensor2d */]; }); __webpack_require__.d(__webpack_exports__, "tensor3d", function() { return /* reexport */ ops["Ed" /* tensor3d */]; }); __webpack_require__.d(__webpack_exports__, "tensor4d", function() { return /* reexport */ ops["Fd" /* tensor4d */]; }); __webpack_require__.d(__webpack_exports__, "tensor5d", function() { return /* reexport */ ops["Gd" /* tensor5d */]; }); __webpack_require__.d(__webpack_exports__, "tensor6d", function() { return /* reexport */ ops["Hd" /* tensor6d */]; }); __webpack_require__.d(__webpack_exports__, "tile", function() { return /* reexport */ ops["Id" /* tile */]; }); __webpack_require__.d(__webpack_exports__, "topk", function() { return /* reexport */ ops["Jd" /* topk */]; }); __webpack_require__.d(__webpack_exports__, "truncatedNormal", function() { return /* reexport */ ops["Ld" /* truncatedNormal */]; }); __webpack_require__.d(__webpack_exports__, "unique", function() { return /* reexport */ ops["Md" /* unique */]; }); __webpack_require__.d(__webpack_exports__, "unsortedSegmentSum", function() { return /* reexport */ ops["Nd" /* unsortedSegmentSum */]; }); __webpack_require__.d(__webpack_exports__, "unstack", function() { return /* reexport */ ops["Od" /* unstack */]; }); __webpack_require__.d(__webpack_exports__, "variable", function() { return /* reexport */ ops["Pd" /* variable */]; }); __webpack_require__.d(__webpack_exports__, "where", function() { return /* reexport */ ops["Qd" /* where */]; }); __webpack_require__.d(__webpack_exports__, "whereAsync", function() { return /* reexport */ ops["Rd" /* whereAsync */]; }); __webpack_require__.d(__webpack_exports__, "zeros", function() { return /* reexport */ ops["Sd" /* zeros */]; }); __webpack_require__.d(__webpack_exports__, "zerosLike", function() { return /* reexport */ ops["Td" /* zerosLike */]; }); __webpack_require__.d(__webpack_exports__, "booleanMaskAsync", function() { return /* reexport */ ops["y" /* booleanMaskAsync */]; }); __webpack_require__.d(__webpack_exports__, "transpose", function() { return /* reexport */ ops["Kd" /* transpose */]; }); __webpack_require__.d(__webpack_exports__, "norm", function() { return /* reexport */ ops["lc" /* norm */]; }); __webpack_require__.d(__webpack_exports__, "movingAverage", function() { return /* reexport */ ops["gc" /* movingAverage */]; }); __webpack_require__.d(__webpack_exports__, "scatterND", function() { return /* reexport */ ops["Vc" /* scatterND */]; }); __webpack_require__.d(__webpack_exports__, "sparseToDense", function() { return /* reexport */ ops["nd" /* sparseToDense */]; }); __webpack_require__.d(__webpack_exports__, "gatherND", function() { return /* reexport */ ops["sb" /* gatherND */]; }); __webpack_require__.d(__webpack_exports__, "dropout", function() { return /* reexport */ ops["cb" /* dropout */]; }); __webpack_require__.d(__webpack_exports__, "enclosingPowerOfTwo", function() { return /* reexport */ ops["fb" /* enclosingPowerOfTwo */]; }); __webpack_require__.d(__webpack_exports__, "cosineWindow", function() { return /* reexport */ ops["S" /* cosineWindow */]; }); __webpack_require__.d(__webpack_exports__, "inTopKAsync", function() { return /* reexport */ ops["yb" /* inTopKAsync */]; }); __webpack_require__.d(__webpack_exports__, "op", function() { return /* reexport */ ops["qc" /* op */]; }); __webpack_require__.d(__webpack_exports__, "OP_SCOPE_SUFFIX", function() { return /* reexport */ ops["a" /* OP_SCOPE_SUFFIX */]; }); __webpack_require__.d(__webpack_exports__, "image", function() { return /* reexport */ ops["xb" /* image */]; }); __webpack_require__.d(__webpack_exports__, "linalg", function() { return /* reexport */ ops["Gb" /* linalg */]; }); __webpack_require__.d(__webpack_exports__, "losses", function() { return /* reexport */ ops["Sb" /* losses */]; }); __webpack_require__.d(__webpack_exports__, "spectral", function() { return /* reexport */ ops["od" /* spectral */]; }); __webpack_require__.d(__webpack_exports__, "fused", function() { return /* reexport */ ops["qb" /* fused */]; }); __webpack_require__.d(__webpack_exports__, "signal", function() { return /* reexport */ ops["bd" /* signal */]; }); __webpack_require__.d(__webpack_exports__, "sparse", function() { return /* reexport */ ops["md" /* sparse */]; }); __webpack_require__.d(__webpack_exports__, "Reduction", function() { return /* reexport */ loss_ops_utils["a" /* Reduction */]; }); __webpack_require__.d(__webpack_exports__, "train", function() { return /* reexport */ train; }); __webpack_require__.d(__webpack_exports__, "enableProdMode", function() { return /* reexport */ globals["g" /* enableProdMode */]; }); __webpack_require__.d(__webpack_exports__, "enableDebugMode", function() { return /* reexport */ globals["f" /* enableDebugMode */]; }); __webpack_require__.d(__webpack_exports__, "disableDeprecationWarnings", function() { return /* reexport */ globals["c" /* disableDeprecationWarnings */]; }); __webpack_require__.d(__webpack_exports__, "deprecationWarn", function() { return /* reexport */ globals["b" /* deprecationWarn */]; }); __webpack_require__.d(__webpack_exports__, "disposeVariables", function() { return /* reexport */ globals["e" /* disposeVariables */]; }); __webpack_require__.d(__webpack_exports__, "engine", function() { return /* reexport */ globals["h" /* engine */]; }); __webpack_require__.d(__webpack_exports__, "memory", function() { return /* reexport */ globals["m" /* memory */]; }); __webpack_require__.d(__webpack_exports__, "profile", function() { return /* reexport */ globals["n" /* profile */]; }); __webpack_require__.d(__webpack_exports__, "tidy", function() { return /* reexport */ globals["t" /* tidy */]; }); __webpack_require__.d(__webpack_exports__, "dispose", function() { return /* reexport */ globals["d" /* dispose */]; }); __webpack_require__.d(__webpack_exports__, "keep", function() { return /* reexport */ globals["l" /* keep */]; }); __webpack_require__.d(__webpack_exports__, "time", function() { return /* reexport */ globals["u" /* time */]; }); __webpack_require__.d(__webpack_exports__, "setBackend", function() { return /* reexport */ globals["r" /* setBackend */]; }); __webpack_require__.d(__webpack_exports__, "ready", function() { return /* reexport */ globals["o" /* ready */]; }); __webpack_require__.d(__webpack_exports__, "getBackend", function() { return /* reexport */ globals["k" /* getBackend */]; }); __webpack_require__.d(__webpack_exports__, "removeBackend", function() { return /* reexport */ globals["q" /* removeBackend */]; }); __webpack_require__.d(__webpack_exports__, "findBackend", function() { return /* reexport */ globals["i" /* findBackend */]; }); __webpack_require__.d(__webpack_exports__, "findBackendFactory", function() { return /* reexport */ globals["j" /* findBackendFactory */]; }); __webpack_require__.d(__webpack_exports__, "registerBackend", function() { return /* reexport */ globals["p" /* registerBackend */]; }); __webpack_require__.d(__webpack_exports__, "backend", function() { return /* reexport */ globals["a" /* backend */]; }); __webpack_require__.d(__webpack_exports__, "setPlatform", function() { return /* reexport */ globals["s" /* setPlatform */]; }); __webpack_require__.d(__webpack_exports__, "getKernel", function() { return /* reexport */ kernel_registry["c" /* getKernel */]; }); __webpack_require__.d(__webpack_exports__, "getGradient", function() { return /* reexport */ kernel_registry["b" /* getGradient */]; }); __webpack_require__.d(__webpack_exports__, "getKernelsForBackend", function() { return /* reexport */ kernel_registry["d" /* getKernelsForBackend */]; }); __webpack_require__.d(__webpack_exports__, "registerKernel", function() { return /* reexport */ kernel_registry["f" /* registerKernel */]; }); __webpack_require__.d(__webpack_exports__, "registerGradient", function() { return /* reexport */ kernel_registry["e" /* registerGradient */]; }); __webpack_require__.d(__webpack_exports__, "unregisterKernel", function() { return /* reexport */ kernel_registry["h" /* unregisterKernel */]; }); __webpack_require__.d(__webpack_exports__, "unregisterGradient", function() { return /* reexport */ kernel_registry["g" /* unregisterGradient */]; }); __webpack_require__.d(__webpack_exports__, "copyRegisteredKernels", function() { return /* reexport */ kernel_registry["a" /* copyRegisteredKernels */]; }); __webpack_require__.d(__webpack_exports__, "customGrad", function() { return /* reexport */ gradients["a" /* customGrad */]; }); __webpack_require__.d(__webpack_exports__, "grad", function() { return /* reexport */ gradients["b" /* grad */]; }); __webpack_require__.d(__webpack_exports__, "grads", function() { return /* reexport */ gradients["c" /* grads */]; }); __webpack_require__.d(__webpack_exports__, "valueAndGrad", function() { return /* reexport */ gradients["d" /* valueAndGrad */]; }); __webpack_require__.d(__webpack_exports__, "valueAndGrads", function() { return /* reexport */ gradients["e" /* valueAndGrads */]; }); __webpack_require__.d(__webpack_exports__, "variableGrads", function() { return /* reexport */ gradients["f" /* variableGrads */]; }); __webpack_require__.d(__webpack_exports__, "Environment", function() { return /* reexport */ environment["b" /* Environment */]; }); __webpack_require__.d(__webpack_exports__, "env", function() { return /* reexport */ environment["c" /* env */]; }); __webpack_require__.d(__webpack_exports__, "ENV", function() { return /* reexport */ environment["a" /* ENV */]; }); __webpack_require__.d(__webpack_exports__, "version_core", function() { return /* reexport */ version; }); __webpack_require__.d(__webpack_exports__, "nextFrame", function() { return /* reexport */ browser_util["a" /* nextFrame */]; }); __webpack_require__.d(__webpack_exports__, "browser", function() { return /* reexport */ browser_namespaceObject; }); __webpack_require__.d(__webpack_exports__, "io", function() { return /* reexport */ io_namespaceObject; }); __webpack_require__.d(__webpack_exports__, "math", function() { return /* reexport */ math_namespaceObject; }); __webpack_require__.d(__webpack_exports__, "serialization", function() { return /* reexport */ serialization_namespaceObject; }); __webpack_require__.d(__webpack_exports__, "test_util", function() { return /* reexport */ test_util; }); __webpack_require__.d(__webpack_exports__, "util", function() { return /* reexport */ util; }); __webpack_require__.d(__webpack_exports__, "backend_util", function() { return /* reexport */ backend_util_namespaceObject; }); __webpack_require__.d(__webpack_exports__, "tensor_util", function() { return /* reexport */ tensor_util; }); __webpack_require__.d(__webpack_exports__, "slice_util", function() { return /* reexport */ slice_util; }); __webpack_require__.d(__webpack_exports__, "gather_util", function() { return /* reexport */ gather_nd_util_namespaceObject; }); __webpack_require__.d(__webpack_exports__, "scatter_util", function() { return /* reexport */ scatter_nd_util; }); __webpack_require__.d(__webpack_exports__, "device_util", function() { return /* reexport */ device_util; }); __webpack_require__.d(__webpack_exports__, "kernel_impls", function() { return /* reexport */ kernel_impls_namespaceObject; }); __webpack_require__.d(__webpack_exports__, "KernelBackend", function() { return /* reexport */ backend["b" /* KernelBackend */]; }); __webpack_require__.d(__webpack_exports__, "DataStorage", function() { return /* reexport */ backend["a" /* DataStorage */]; }); __webpack_require__.d(__webpack_exports__, "Abs", function() { return /* reexport */ kernel_names["a" /* Abs */]; }); __webpack_require__.d(__webpack_exports__, "Acos", function() { return /* reexport */ kernel_names["b" /* Acos */]; }); __webpack_require__.d(__webpack_exports__, "Acosh", function() { return /* reexport */ kernel_names["c" /* Acosh */]; }); __webpack_require__.d(__webpack_exports__, "Add", function() { return /* reexport */ kernel_names["d" /* Add */]; }); __webpack_require__.d(__webpack_exports__, "AddN", function() { return /* reexport */ kernel_names["e" /* AddN */]; }); __webpack_require__.d(__webpack_exports__, "All", function() { return /* reexport */ kernel_names["f" /* All */]; }); __webpack_require__.d(__webpack_exports__, "Any", function() { return /* reexport */ kernel_names["g" /* Any */]; }); __webpack_require__.d(__webpack_exports__, "ArgMax", function() { return /* reexport */ kernel_names["h" /* ArgMax */]; }); __webpack_require__.d(__webpack_exports__, "ArgMin", function() { return /* reexport */ kernel_names["i" /* ArgMin */]; }); __webpack_require__.d(__webpack_exports__, "Asin", function() { return /* reexport */ kernel_names["j" /* Asin */]; }); __webpack_require__.d(__webpack_exports__, "Asinh", function() { return /* reexport */ kernel_names["k" /* Asinh */]; }); __webpack_require__.d(__webpack_exports__, "Atan", function() { return /* reexport */ kernel_names["l" /* Atan */]; }); __webpack_require__.d(__webpack_exports__, "Atanh", function() { return /* reexport */ kernel_names["n" /* Atanh */]; }); __webpack_require__.d(__webpack_exports__, "Atan2", function() { return /* reexport */ kernel_names["m" /* Atan2 */]; }); __webpack_require__.d(__webpack_exports__, "AvgPool", function() { return /* reexport */ kernel_names["o" /* AvgPool */]; }); __webpack_require__.d(__webpack_exports__, "AvgPoolGrad", function() { return /* reexport */ kernel_names["r" /* AvgPoolGrad */]; }); __webpack_require__.d(__webpack_exports__, "AvgPool3D", function() { return /* reexport */ kernel_names["p" /* AvgPool3D */]; }); __webpack_require__.d(__webpack_exports__, "AvgPool3DGrad", function() { return /* reexport */ kernel_names["q" /* AvgPool3DGrad */]; }); __webpack_require__.d(__webpack_exports__, "BatchMatMul", function() { return /* reexport */ kernel_names["s" /* BatchMatMul */]; }); __webpack_require__.d(__webpack_exports__, "BatchToSpaceND", function() { return /* reexport */ kernel_names["t" /* BatchToSpaceND */]; }); __webpack_require__.d(__webpack_exports__, "Bincount", function() { return /* reexport */ kernel_names["u" /* Bincount */]; }); __webpack_require__.d(__webpack_exports__, "BroadcastTo", function() { return /* reexport */ kernel_names["v" /* BroadcastTo */]; }); __webpack_require__.d(__webpack_exports__, "Cast", function() { return /* reexport */ kernel_names["w" /* Cast */]; }); __webpack_require__.d(__webpack_exports__, "Ceil", function() { return /* reexport */ kernel_names["x" /* Ceil */]; }); __webpack_require__.d(__webpack_exports__, "ClipByValue", function() { return /* reexport */ kernel_names["y" /* ClipByValue */]; }); __webpack_require__.d(__webpack_exports__, "Complex", function() { return /* reexport */ kernel_names["z" /* Complex */]; }); __webpack_require__.d(__webpack_exports__, "ComplexAbs", function() { return /* reexport */ kernel_names["A" /* ComplexAbs */]; }); __webpack_require__.d(__webpack_exports__, "Concat", function() { return /* reexport */ kernel_names["B" /* Concat */]; }); __webpack_require__.d(__webpack_exports__, "Conv2D", function() { return /* reexport */ kernel_names["C" /* Conv2D */]; }); __webpack_require__.d(__webpack_exports__, "Conv2DBackpropFilter", function() { return /* reexport */ kernel_names["D" /* Conv2DBackpropFilter */]; }); __webpack_require__.d(__webpack_exports__, "Conv2DBackpropInput", function() { return /* reexport */ kernel_names["E" /* Conv2DBackpropInput */]; }); __webpack_require__.d(__webpack_exports__, "Conv3D", function() { return /* reexport */ kernel_names["F" /* Conv3D */]; }); __webpack_require__.d(__webpack_exports__, "Conv3DBackpropFilterV2", function() { return /* reexport */ kernel_names["G" /* Conv3DBackpropFilterV2 */]; }); __webpack_require__.d(__webpack_exports__, "Conv3DBackpropInputV2", function() { return /* reexport */ kernel_names["H" /* Conv3DBackpropInputV2 */]; }); __webpack_require__.d(__webpack_exports__, "Cos", function() { return /* reexport */ kernel_names["I" /* Cos */]; }); __webpack_require__.d(__webpack_exports__, "Cosh", function() { return /* reexport */ kernel_names["J" /* Cosh */]; }); __webpack_require__.d(__webpack_exports__, "Cumsum", function() { return /* reexport */ kernel_names["L" /* Cumsum */]; }); __webpack_require__.d(__webpack_exports__, "CropAndResize", function() { return /* reexport */ kernel_names["K" /* CropAndResize */]; }); __webpack_require__.d(__webpack_exports__, "DenseBincount", function() { return /* reexport */ kernel_names["M" /* DenseBincount */]; }); __webpack_require__.d(__webpack_exports__, "DepthToSpace", function() { return /* reexport */ kernel_names["N" /* DepthToSpace */]; }); __webpack_require__.d(__webpack_exports__, "DepthwiseConv2dNative", function() { return /* reexport */ kernel_names["O" /* DepthwiseConv2dNative */]; }); __webpack_require__.d(__webpack_exports__, "DepthwiseConv2dNativeBackpropFilter", function() { return /* reexport */ kernel_names["P" /* DepthwiseConv2dNativeBackpropFilter */]; }); __webpack_require__.d(__webpack_exports__, "DepthwiseConv2dNativeBackpropInput", function() { return /* reexport */ kernel_names["Q" /* DepthwiseConv2dNativeBackpropInput */]; }); __webpack_require__.d(__webpack_exports__, "Diag", function() { return /* reexport */ kernel_names["R" /* Diag */]; }); __webpack_require__.d(__webpack_exports__, "Dilation2D", function() { return /* reexport */ kernel_names["S" /* Dilation2D */]; }); __webpack_require__.d(__webpack_exports__, "Dilation2DBackpropInput", function() { return /* reexport */ kernel_names["U" /* Dilation2DBackpropInput */]; }); __webpack_require__.d(__webpack_exports__, "Dilation2DBackpropFilter", function() { return /* reexport */ kernel_names["T" /* Dilation2DBackpropFilter */]; }); __webpack_require__.d(__webpack_exports__, "RealDiv", function() { return /* reexport */ kernel_names["lc" /* RealDiv */]; }); __webpack_require__.d(__webpack_exports__, "Einsum", function() { return /* reexport */ kernel_names["V" /* Einsum */]; }); __webpack_require__.d(__webpack_exports__, "Elu", function() { return /* reexport */ kernel_names["W" /* Elu */]; }); __webpack_require__.d(__webpack_exports__, "EluGrad", function() { return /* reexport */ kernel_names["X" /* EluGrad */]; }); __webpack_require__.d(__webpack_exports__, "Erf", function() { return /* reexport */ kernel_names["Z" /* Erf */]; }); __webpack_require__.d(__webpack_exports__, "Equal", function() { return /* reexport */ kernel_names["Y" /* Equal */]; }); __webpack_require__.d(__webpack_exports__, "Exp", function() { return /* reexport */ kernel_names["ab" /* Exp */]; }); __webpack_require__.d(__webpack_exports__, "ExpandDims", function() { return /* reexport */ kernel_names["bb" /* ExpandDims */]; }); __webpack_require__.d(__webpack_exports__, "Expm1", function() { return /* reexport */ kernel_names["cb" /* Expm1 */]; }); __webpack_require__.d(__webpack_exports__, "FFT", function() { return /* reexport */ kernel_names["db" /* FFT */]; }); __webpack_require__.d(__webpack_exports__, "Fill", function() { return /* reexport */ kernel_names["eb" /* Fill */]; }); __webpack_require__.d(__webpack_exports__, "FlipLeftRight", function() { return /* reexport */ kernel_names["fb" /* FlipLeftRight */]; }); __webpack_require__.d(__webpack_exports__, "Floor", function() { return /* reexport */ kernel_names["gb" /* Floor */]; }); __webpack_require__.d(__webpack_exports__, "FloorDiv", function() { return /* reexport */ kernel_names["hb" /* FloorDiv */]; }); __webpack_require__.d(__webpack_exports__, "FusedBatchNorm", function() { return /* reexport */ kernel_names["jb" /* FusedBatchNorm */]; }); __webpack_require__.d(__webpack_exports__, "GatherV2", function() { return /* reexport */ kernel_names["nb" /* GatherV2 */]; }); __webpack_require__.d(__webpack_exports__, "GatherNd", function() { return /* reexport */ kernel_names["mb" /* GatherNd */]; }); __webpack_require__.d(__webpack_exports__, "Greater", function() { return /* reexport */ kernel_names["ob" /* Greater */]; }); __webpack_require__.d(__webpack_exports__, "GreaterEqual", function() { return /* reexport */ kernel_names["pb" /* GreaterEqual */]; }); __webpack_require__.d(__webpack_exports__, "Identity", function() { return /* reexport */ kernel_names["rb" /* Identity */]; }); __webpack_require__.d(__webpack_exports__, "IFFT", function() { return /* reexport */ kernel_names["qb" /* IFFT */]; }); __webpack_require__.d(__webpack_exports__, "Imag", function() { return /* reexport */ kernel_names["sb" /* Imag */]; }); __webpack_require__.d(__webpack_exports__, "IsFinite", function() { return /* reexport */ kernel_names["tb" /* IsFinite */]; }); __webpack_require__.d(__webpack_exports__, "IsInf", function() { return /* reexport */ kernel_names["ub" /* IsInf */]; }); __webpack_require__.d(__webpack_exports__, "IsNan", function() { return /* reexport */ kernel_names["vb" /* IsNan */]; }); __webpack_require__.d(__webpack_exports__, "LeakyRelu", function() { return /* reexport */ kernel_names["yb" /* LeakyRelu */]; }); __webpack_require__.d(__webpack_exports__, "Less", function() { return /* reexport */ kernel_names["zb" /* Less */]; }); __webpack_require__.d(__webpack_exports__, "LessEqual", function() { return /* reexport */ kernel_names["Ab" /* LessEqual */]; }); __webpack_require__.d(__webpack_exports__, "LinSpace", function() { return /* reexport */ kernel_names["Bb" /* LinSpace */]; }); __webpack_require__.d(__webpack_exports__, "Log", function() { return /* reexport */ kernel_names["Cb" /* Log */]; }); __webpack_require__.d(__webpack_exports__, "Log1p", function() { return /* reexport */ kernel_names["Db" /* Log1p */]; }); __webpack_require__.d(__webpack_exports__, "LogicalAnd", function() { return /* reexport */ kernel_names["Fb" /* LogicalAnd */]; }); __webpack_require__.d(__webpack_exports__, "LogicalNot", function() { return /* reexport */ kernel_names["Gb" /* LogicalNot */]; }); __webpack_require__.d(__webpack_exports__, "LogicalOr", function() { return /* reexport */ kernel_names["Hb" /* LogicalOr */]; }); __webpack_require__.d(__webpack_exports__, "LogSoftmax", function() { return /* reexport */ kernel_names["Eb" /* LogSoftmax */]; }); __webpack_require__.d(__webpack_exports__, "LRN", function() { return /* reexport */ kernel_names["wb" /* LRN */]; }); __webpack_require__.d(__webpack_exports__, "LRNGrad", function() { return /* reexport */ kernel_names["xb" /* LRNGrad */]; }); __webpack_require__.d(__webpack_exports__, "Max", function() { return /* reexport */ kernel_names["Ib" /* Max */]; }); __webpack_require__.d(__webpack_exports__, "Maximum", function() { return /* reexport */ kernel_names["Ob" /* Maximum */]; }); __webpack_require__.d(__webpack_exports__, "MaxPool", function() { return /* reexport */ kernel_names["Jb" /* MaxPool */]; }); __webpack_require__.d(__webpack_exports__, "MaxPoolGrad", function() { return /* reexport */ kernel_names["Mb" /* MaxPoolGrad */]; }); __webpack_require__.d(__webpack_exports__, "MaxPool3D", function() { return /* reexport */ kernel_names["Kb" /* MaxPool3D */]; }); __webpack_require__.d(__webpack_exports__, "MaxPool3DGrad", function() { return /* reexport */ kernel_names["Lb" /* MaxPool3DGrad */]; }); __webpack_require__.d(__webpack_exports__, "MaxPoolWithArgmax", function() { return /* reexport */ kernel_names["Nb" /* MaxPoolWithArgmax */]; }); __webpack_require__.d(__webpack_exports__, "Mean", function() { return /* reexport */ kernel_names["Pb" /* Mean */]; }); __webpack_require__.d(__webpack_exports__, "Min", function() { return /* reexport */ kernel_names["Qb" /* Min */]; }); __webpack_require__.d(__webpack_exports__, "Minimum", function() { return /* reexport */ kernel_names["Rb" /* Minimum */]; }); __webpack_require__.d(__webpack_exports__, "MirrorPad", function() { return /* reexport */ kernel_names["Sb" /* MirrorPad */]; }); __webpack_require__.d(__webpack_exports__, "Mod", function() { return /* reexport */ kernel_names["Tb" /* Mod */]; }); __webpack_require__.d(__webpack_exports__, "Multinomial", function() { return /* reexport */ kernel_names["Ub" /* Multinomial */]; }); __webpack_require__.d(__webpack_exports__, "Multiply", function() { return /* reexport */ kernel_names["Vb" /* Multiply */]; }); __webpack_require__.d(__webpack_exports__, "Neg", function() { return /* reexport */ kernel_names["Wb" /* Neg */]; }); __webpack_require__.d(__webpack_exports__, "NotEqual", function() { return /* reexport */ kernel_names["ac" /* NotEqual */]; }); __webpack_require__.d(__webpack_exports__, "NonMaxSuppressionV3", function() { return /* reexport */ kernel_names["Xb" /* NonMaxSuppressionV3 */]; }); __webpack_require__.d(__webpack_exports__, "NonMaxSuppressionV4", function() { return /* reexport */ kernel_names["Yb" /* NonMaxSuppressionV4 */]; }); __webpack_require__.d(__webpack_exports__, "NonMaxSuppressionV5", function() { return /* reexport */ kernel_names["Zb" /* NonMaxSuppressionV5 */]; }); __webpack_require__.d(__webpack_exports__, "OnesLike", function() { return /* reexport */ kernel_names["cc" /* OnesLike */]; }); __webpack_require__.d(__webpack_exports__, "OneHot", function() { return /* reexport */ kernel_names["bc" /* OneHot */]; }); __webpack_require__.d(__webpack_exports__, "Pack", function() { return /* reexport */ kernel_names["dc" /* Pack */]; }); __webpack_require__.d(__webpack_exports__, "PadV2", function() { return /* reexport */ kernel_names["ec" /* PadV2 */]; }); __webpack_require__.d(__webpack_exports__, "Pool", function() { return /* reexport */ kernel_names["fc" /* Pool */]; }); __webpack_require__.d(__webpack_exports__, "Pow", function() { return /* reexport */ kernel_names["gc" /* Pow */]; }); __webpack_require__.d(__webpack_exports__, "Prelu", function() { return /* reexport */ kernel_names["hc" /* Prelu */]; }); __webpack_require__.d(__webpack_exports__, "Prod", function() { return /* reexport */ kernel_names["ic" /* Prod */]; }); __webpack_require__.d(__webpack_exports__, "Range", function() { return /* reexport */ kernel_names["jc" /* Range */]; }); __webpack_require__.d(__webpack_exports__, "Real", function() { return /* reexport */ kernel_names["kc" /* Real */]; }); __webpack_require__.d(__webpack_exports__, "Reciprocal", function() { return /* reexport */ kernel_names["mc" /* Reciprocal */]; }); __webpack_require__.d(__webpack_exports__, "Relu", function() { return /* reexport */ kernel_names["nc" /* Relu */]; }); __webpack_require__.d(__webpack_exports__, "Reshape", function() { return /* reexport */ kernel_names["pc" /* Reshape */]; }); __webpack_require__.d(__webpack_exports__, "ResizeNearestNeighbor", function() { return /* reexport */ kernel_names["sc" /* ResizeNearestNeighbor */]; }); __webpack_require__.d(__webpack_exports__, "ResizeNearestNeighborGrad", function() { return /* reexport */ kernel_names["tc" /* ResizeNearestNeighborGrad */]; }); __webpack_require__.d(__webpack_exports__, "ResizeBilinear", function() { return /* reexport */ kernel_names["qc" /* ResizeBilinear */]; }); __webpack_require__.d(__webpack_exports__, "ResizeBilinearGrad", function() { return /* reexport */ kernel_names["rc" /* ResizeBilinearGrad */]; }); __webpack_require__.d(__webpack_exports__, "Relu6", function() { return /* reexport */ kernel_names["oc" /* Relu6 */]; }); __webpack_require__.d(__webpack_exports__, "Reverse", function() { return /* reexport */ kernel_names["uc" /* Reverse */]; }); __webpack_require__.d(__webpack_exports__, "Round", function() { return /* reexport */ kernel_names["wc" /* Round */]; }); __webpack_require__.d(__webpack_exports__, "Rsqrt", function() { return /* reexport */ kernel_names["xc" /* Rsqrt */]; }); __webpack_require__.d(__webpack_exports__, "ScatterNd", function() { return /* reexport */ kernel_names["yc" /* ScatterNd */]; }); __webpack_require__.d(__webpack_exports__, "Select", function() { return /* reexport */ kernel_names["zc" /* Select */]; }); __webpack_require__.d(__webpack_exports__, "Selu", function() { return /* reexport */ kernel_names["Ac" /* Selu */]; }); __webpack_require__.d(__webpack_exports__, "Slice", function() { return /* reexport */ kernel_names["Fc" /* Slice */]; }); __webpack_require__.d(__webpack_exports__, "Sin", function() { return /* reexport */ kernel_names["Dc" /* Sin */]; }); __webpack_require__.d(__webpack_exports__, "Sinh", function() { return /* reexport */ kernel_names["Ec" /* Sinh */]; }); __webpack_require__.d(__webpack_exports__, "Sign", function() { return /* reexport */ kernel_names["Cc" /* Sign */]; }); __webpack_require__.d(__webpack_exports__, "Sigmoid", function() { return /* reexport */ kernel_names["Bc" /* Sigmoid */]; }); __webpack_require__.d(__webpack_exports__, "Softplus", function() { return /* reexport */ kernel_names["Hc" /* Softplus */]; }); __webpack_require__.d(__webpack_exports__, "Sqrt", function() { return /* reexport */ kernel_names["Mc" /* Sqrt */]; }); __webpack_require__.d(__webpack_exports__, "Sum", function() { return /* reexport */ kernel_names["Sc" /* Sum */]; }); __webpack_require__.d(__webpack_exports__, "SpaceToBatchND", function() { return /* reexport */ kernel_names["Ic" /* SpaceToBatchND */]; }); __webpack_require__.d(__webpack_exports__, "SplitV", function() { return /* reexport */ kernel_names["Lc" /* SplitV */]; }); __webpack_require__.d(__webpack_exports__, "Softmax", function() { return /* reexport */ kernel_names["Gc" /* Softmax */]; }); __webpack_require__.d(__webpack_exports__, "SparseReshape", function() { return /* reexport */ kernel_names["Jc" /* SparseReshape */]; }); __webpack_require__.d(__webpack_exports__, "SparseToDense", function() { return /* reexport */ kernel_names["Kc" /* SparseToDense */]; }); __webpack_require__.d(__webpack_exports__, "SquaredDifference", function() { return /* reexport */ kernel_names["Oc" /* SquaredDifference */]; }); __webpack_require__.d(__webpack_exports__, "Square", function() { return /* reexport */ kernel_names["Nc" /* Square */]; }); __webpack_require__.d(__webpack_exports__, "StridedSlice", function() { return /* reexport */ kernel_names["Qc" /* StridedSlice */]; }); __webpack_require__.d(__webpack_exports__, "Sub", function() { return /* reexport */ kernel_names["Rc" /* Sub */]; }); __webpack_require__.d(__webpack_exports__, "Tan", function() { return /* reexport */ kernel_names["Tc" /* Tan */]; }); __webpack_require__.d(__webpack_exports__, "Tanh", function() { return /* reexport */ kernel_names["Uc" /* Tanh */]; }); __webpack_require__.d(__webpack_exports__, "Tile", function() { return /* reexport */ kernel_names["Vc" /* Tile */]; }); __webpack_require__.d(__webpack_exports__, "TopK", function() { return /* reexport */ kernel_names["Wc" /* TopK */]; }); __webpack_require__.d(__webpack_exports__, "Transform", function() { return /* reexport */ kernel_names["Xc" /* Transform */]; }); __webpack_require__.d(__webpack_exports__, "Transpose", function() { return /* reexport */ kernel_names["Yc" /* Transpose */]; }); __webpack_require__.d(__webpack_exports__, "Unique", function() { return /* reexport */ kernel_names["Zc" /* Unique */]; }); __webpack_require__.d(__webpack_exports__, "Unpack", function() { return /* reexport */ kernel_names["ad" /* Unpack */]; }); __webpack_require__.d(__webpack_exports__, "UnsortedSegmentSum", function() { return /* reexport */ kernel_names["bd" /* UnsortedSegmentSum */]; }); __webpack_require__.d(__webpack_exports__, "ZerosLike", function() { return /* reexport */ kernel_names["cd" /* ZerosLike */]; }); __webpack_require__.d(__webpack_exports__, "Step", function() { return /* reexport */ kernel_names["Pc" /* Step */]; }); __webpack_require__.d(__webpack_exports__, "FromPixels", function() { return /* reexport */ kernel_names["ib" /* FromPixels */]; }); __webpack_require__.d(__webpack_exports__, "RotateWithOffset", function() { return /* reexport */ kernel_names["vc" /* RotateWithOffset */]; }); __webpack_require__.d(__webpack_exports__, "_FusedMatMul", function() { return /* reexport */ kernel_names["dd" /* _FusedMatMul */]; }); __webpack_require__.d(__webpack_exports__, "FusedConv2D", function() { return /* reexport */ kernel_names["kb" /* FusedConv2D */]; }); __webpack_require__.d(__webpack_exports__, "FusedDepthwiseConv2D", function() { return /* reexport */ kernel_names["lb" /* FusedDepthwiseConv2D */]; }); // NAMESPACE OBJECT: ./node_modules/@tensorflow/tfjs-core/dist/io/io.js var io_namespaceObject = {}; __webpack_require__.r(io_namespaceObject); __webpack_require__.d(io_namespaceObject, "copyModel", function() { return copyModel; }); __webpack_require__.d(io_namespaceObject, "listModels", function() { return listModels; }); __webpack_require__.d(io_namespaceObject, "moveModel", function() { return moveModel; }); __webpack_require__.d(io_namespaceObject, "removeModel", function() { return removeModel; }); __webpack_require__.d(io_namespaceObject, "browserFiles", function() { return browserFiles; }); __webpack_require__.d(io_namespaceObject, "browserHTTPRequest", function() { return browserHTTPRequest; }); __webpack_require__.d(io_namespaceObject, "concatenateArrayBuffers", function() { return io_utils["d" /* concatenateArrayBuffers */]; }); __webpack_require__.d(io_namespaceObject, "decodeWeights", function() { return io_utils["e" /* decodeWeights */]; }); __webpack_require__.d(io_namespaceObject, "encodeWeights", function() { return io_utils["f" /* encodeWeights */]; }); __webpack_require__.d(io_namespaceObject, "fromMemory", function() { return fromMemory; }); __webpack_require__.d(io_namespaceObject, "getLoadHandlers", function() { return getLoadHandlers; }); __webpack_require__.d(io_namespaceObject, "getModelArtifactsInfoForJSON", function() { return io_utils["g" /* getModelArtifactsInfoForJSON */]; }); __webpack_require__.d(io_namespaceObject, "getSaveHandlers", function() { return getSaveHandlers; }); __webpack_require__.d(io_namespaceObject, "http", function() { return http; }); __webpack_require__.d(io_namespaceObject, "isHTTPScheme", function() { return isHTTPScheme; }); __webpack_require__.d(io_namespaceObject, "loadWeights", function() { return loadWeights; }); __webpack_require__.d(io_namespaceObject, "registerLoadRouter", function() { return registerLoadRouter; }); __webpack_require__.d(io_namespaceObject, "registerSaveRouter", function() { return registerSaveRouter; }); __webpack_require__.d(io_namespaceObject, "weightsLoaderFactory", function() { return weightsLoaderFactory; }); __webpack_require__.d(io_namespaceObject, "withSaveHandler", function() { return withSaveHandler; }); // NAMESPACE OBJECT: ./node_modules/@tensorflow/tfjs-core/dist/math.js var math_namespaceObject = {}; __webpack_require__.r(math_namespaceObject); __webpack_require__.d(math_namespaceObject, "confusionMatrix", function() { return confusionMatrix; }); // NAMESPACE OBJECT: ./node_modules/@tensorflow/tfjs-core/dist/ops/browser.js var browser_namespaceObject = {}; __webpack_require__.r(browser_namespaceObject); __webpack_require__.d(browser_namespaceObject, "fromPixelsAsync", function() { return fromPixelsAsync; }); __webpack_require__.d(browser_namespaceObject, "toPixels", function() { return toPixels; }); __webpack_require__.d(browser_namespaceObject, "fromPixels", function() { return fromPixels; }); // NAMESPACE OBJECT: ./node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.js var gather_nd_util_namespaceObject = {}; __webpack_require__.r(gather_nd_util_namespaceObject); __webpack_require__.d(gather_nd_util_namespaceObject, "prepareAndValidate", function() { return prepareAndValidate; }); // NAMESPACE OBJECT: ./node_modules/@tensorflow/tfjs-core/dist/serialization.js var serialization_namespaceObject = {}; __webpack_require__.r(serialization_namespaceObject); __webpack_require__.d(serialization_namespaceObject, "Serializable", function() { return Serializable; }); __webpack_require__.d(serialization_namespaceObject, "SerializationMap", function() { return SerializationMap; }); __webpack_require__.d(serialization_namespaceObject, "registerClass", function() { return registerClass; }); // NAMESPACE OBJECT: ./node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js var segment_util_namespaceObject = {}; __webpack_require__.r(segment_util_namespaceObject); __webpack_require__.d(segment_util_namespaceObject, "segOpComputeOptimalWindowSize", function() { return segOpComputeOptimalWindowSize; }); __webpack_require__.d(segment_util_namespaceObject, "computeOutShape", function() { return segment_util_computeOutShape; }); __webpack_require__.d(segment_util_namespaceObject, "collectGatherOpShapeInfo", function() { return collectGatherOpShapeInfo; }); // NAMESPACE OBJECT: ./node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.js var backend_util_namespaceObject = {}; __webpack_require__.r(backend_util_namespaceObject); __webpack_require__.d(backend_util_namespaceObject, "axesAreInnerMostDims", function() { return axis_util["b" /* axesAreInnerMostDims */]; }); __webpack_require__.d(backend_util_namespaceObject, "combineLocations", function() { return axis_util["c" /* combineLocations */]; }); __webpack_require__.d(backend_util_namespaceObject, "computeOutAndReduceShapes", function() { return axis_util["d" /* computeOutAndReduceShapes */]; }); __webpack_require__.d(backend_util_namespaceObject, "expandShapeToKeepDim", function() { return axis_util["e" /* expandShapeToKeepDim */]; }); __webpack_require__.d(backend_util_namespaceObject, "assertAxesAreInnerMostDims", function() { return axis_util["a" /* assertAxesAreInnerMostDims */]; }); __webpack_require__.d(backend_util_namespaceObject, "getAxesPermutation", function() { return axis_util["f" /* getAxesPermutation */]; }); __webpack_require__.d(backend_util_namespaceObject, "getUndoAxesPermutation", function() { return axis_util["h" /* getUndoAxesPermutation */]; }); __webpack_require__.d(backend_util_namespaceObject, "getInnerMostAxes", function() { return axis_util["g" /* getInnerMostAxes */]; }); __webpack_require__.d(backend_util_namespaceObject, "getBroadcastDims", function() { return broadcast_util["b" /* getBroadcastDims */]; }); __webpack_require__.d(backend_util_namespaceObject, "getReductionAxes", function() { return broadcast_util["c" /* getReductionAxes */]; }); __webpack_require__.d(backend_util_namespaceObject, "assertAndGetBroadcastShape", function() { return broadcast_util["a" /* assertAndGetBroadcastShape */]; }); __webpack_require__.d(backend_util_namespaceObject, "assertParamsConsistent", function() { return assertParamsConsistent; }); __webpack_require__.d(backend_util_namespaceObject, "computeOutShape", function() { return computeOutShape; }); __webpack_require__.d(backend_util_namespaceObject, "computeDilation2DInfo", function() { return conv_util["d" /* computeDilation2DInfo */]; }); __webpack_require__.d(backend_util_namespaceObject, "computePool2DInfo", function() { return conv_util["e" /* computePool2DInfo */]; }); __webpack_require__.d(backend_util_namespaceObject, "computePool3DInfo", function() { return conv_util["f" /* computePool3DInfo */]; }); __webpack_require__.d(backend_util_namespaceObject, "computeConv2DInfo", function() { return conv_util["a" /* computeConv2DInfo */]; }); __webpack_require__.d(backend_util_namespaceObject, "computeConv3DInfo", function() { return conv_util["b" /* computeConv3DInfo */]; }); __webpack_require__.d(backend_util_namespaceObject, "computeDefaultPad", function() { return conv_util["c" /* computeDefaultPad */]; }); __webpack_require__.d(backend_util_namespaceObject, "tupleValuesAreOne", function() { return conv_util["i" /* tupleValuesAreOne */]; }); __webpack_require__.d(backend_util_namespaceObject, "eitherStridesOrDilationsAreOne", function() { return conv_util["h" /* eitherStridesOrDilationsAreOne */]; }); __webpack_require__.d(backend_util_namespaceObject, "convertConv2DDataFormat", function() { return conv_util["g" /* convertConv2DDataFormat */]; }); __webpack_require__.d(backend_util_namespaceObject, "getFusedDyActivation", function() { return fused_util["c" /* getFusedDyActivation */]; }); __webpack_require__.d(backend_util_namespaceObject, "getFusedBiasGradient", function() { return fused_util["b" /* getFusedBiasGradient */]; }); __webpack_require__.d(backend_util_namespaceObject, "applyActivation", function() { return fused_util["a" /* applyActivation */]; }); __webpack_require__.d(backend_util_namespaceObject, "shouldFuse", function() { return fused_util["d" /* shouldFuse */]; }); __webpack_require__.d(backend_util_namespaceObject, "PARALLELIZE_THRESHOLD", function() { return PARALLELIZE_THRESHOLD; }); __webpack_require__.d(backend_util_namespaceObject, "computeOptimalWindowSize", function() { return computeOptimalWindowSize; }); __webpack_require__.d(backend_util_namespaceObject, "slice_util", function() { return slice_util; }); __webpack_require__.d(backend_util_namespaceObject, "upcastType", function() { return dist_types["c" /* upcastType */]; }); __webpack_require__.d(backend_util_namespaceObject, "getImageCenter", function() { return getImageCenter; }); __webpack_require__.d(backend_util_namespaceObject, "getReshaped", function() { return getReshaped; }); __webpack_require__.d(backend_util_namespaceObject, "getPermuted", function() { return getPermuted; }); __webpack_require__.d(backend_util_namespaceObject, "getReshapedPermuted", function() { return getReshapedPermuted; }); __webpack_require__.d(backend_util_namespaceObject, "getSliceBeginCoords", function() { return getSliceBeginCoords; }); __webpack_require__.d(backend_util_namespaceObject, "getSliceSize", function() { return getSliceSize; }); __webpack_require__.d(backend_util_namespaceObject, "prepareAndValidate", function() { return prepareAndValidate; }); __webpack_require__.d(backend_util_namespaceObject, "validateUpdateShape", function() { return scatter_nd_util["validateUpdateShape"]; }); __webpack_require__.d(backend_util_namespaceObject, "validateInput", function() { return scatter_nd_util["validateInput"]; }); __webpack_require__.d(backend_util_namespaceObject, "calculateShapes", function() { return scatter_nd_util["calculateShapes"]; }); __webpack_require__.d(backend_util_namespaceObject, "SELU_SCALEALPHA", function() { return selu_util["b" /* SELU_SCALEALPHA */]; }); __webpack_require__.d(backend_util_namespaceObject, "SELU_SCALE", function() { return selu_util["a" /* SELU_SCALE */]; }); __webpack_require__.d(backend_util_namespaceObject, "ERF_P", function() { return ERF_P; }); __webpack_require__.d(backend_util_namespaceObject, "ERF_A1", function() { return ERF_A1; }); __webpack_require__.d(backend_util_namespaceObject, "ERF_A2", function() { return ERF_A2; }); __webpack_require__.d(backend_util_namespaceObject, "ERF_A3", function() { return ERF_A3; }); __webpack_require__.d(backend_util_namespaceObject, "ERF_A4", function() { return ERF_A4; }); __webpack_require__.d(backend_util_namespaceObject, "ERF_A5", function() { return ERF_A5; }); __webpack_require__.d(backend_util_namespaceObject, "warn", function() { return warn; }); __webpack_require__.d(backend_util_namespaceObject, "log", function() { return log; }); __webpack_require__.d(backend_util_namespaceObject, "mergeRealAndImagArrays", function() { return mergeRealAndImagArrays; }); __webpack_require__.d(backend_util_namespaceObject, "splitRealAndImagArrays", function() { return splitRealAndImagArrays; }); __webpack_require__.d(backend_util_namespaceObject, "complexWithEvenIndex", function() { return complexWithEvenIndex; }); __webpack_require__.d(backend_util_namespaceObject, "complexWithOddIndex", function() { return complexWithOddIndex; }); __webpack_require__.d(backend_util_namespaceObject, "getComplexWithIndex", function() { return getComplexWithIndex; }); __webpack_require__.d(backend_util_namespaceObject, "assignToTypedArray", function() { return assignToTypedArray; }); __webpack_require__.d(backend_util_namespaceObject, "exponents", function() { return exponents; }); __webpack_require__.d(backend_util_namespaceObject, "exponent", function() { return exponent; }); __webpack_require__.d(backend_util_namespaceObject, "decodeEinsumEquation", function() { return decodeEinsumEquation; }); __webpack_require__.d(backend_util_namespaceObject, "getEinsumPermutation", function() { return getEinsumPermutation; }); __webpack_require__.d(backend_util_namespaceObject, "checkEinsumDimSizes", function() { return checkEinsumDimSizes; }); __webpack_require__.d(backend_util_namespaceObject, "getEinsumComputePath", function() { return getEinsumComputePath; }); __webpack_require__.d(backend_util_namespaceObject, "isIdentityPermutation", function() { return isIdentityPermutation; }); __webpack_require__.d(backend_util_namespaceObject, "prepareSplitSize", function() { return prepareSplitSize; }); __webpack_require__.d(backend_util_namespaceObject, "segment_util", function() { return segment_util_namespaceObject; }); __webpack_require__.d(backend_util_namespaceObject, "fromUint8ToStringArray", function() { return fromUint8ToStringArray; }); __webpack_require__.d(backend_util_namespaceObject, "fromStringArrayToUint8", function() { return fromStringArrayToUint8; }); // NAMESPACE OBJECT: ./node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.js var kernel_impls_namespaceObject = {}; __webpack_require__.r(kernel_impls_namespaceObject); __webpack_require__.d(kernel_impls_namespaceObject, "nonMaxSuppressionV3Impl", function() { return non_max_suppression_impl["a" /* nonMaxSuppressionV3Impl */]; }); __webpack_require__.d(kernel_impls_namespaceObject, "nonMaxSuppressionV4Impl", function() { return non_max_suppression_impl["b" /* nonMaxSuppressionV4Impl */]; }); __webpack_require__.d(kernel_impls_namespaceObject, "nonMaxSuppressionV5Impl", function() { return non_max_suppression_impl["c" /* nonMaxSuppressionV5Impl */]; }); __webpack_require__.d(kernel_impls_namespaceObject, "whereImpl", function() { return where_impl["a" /* whereImpl */]; }); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/engine.js + 2 modules var engine = __webpack_require__(5); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/flags.js var flags = __webpack_require__(143); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/environment.js var environment = __webpack_require__(22); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js var io_utils = __webpack_require__(40); // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ class IORouterRegistry { constructor() { this.saveRouters = []; this.loadRouters = []; } static getInstance() { if (IORouterRegistry.instance == null) { IORouterRegistry.instance = new IORouterRegistry(); } return IORouterRegistry.instance; } /** * Register a save-handler router. * * @param saveRouter A function that maps a URL-like string onto an instance * of `IOHandler` with the `save` method defined or `null`. */ static registerSaveRouter(saveRouter) { IORouterRegistry.getInstance().saveRouters.push(saveRouter); } /** * Register a load-handler router. * * @param loadRouter A function that maps a URL-like string onto an instance * of `IOHandler` with the `load` method defined or `null`. */ static registerLoadRouter(loadRouter) { IORouterRegistry.getInstance().loadRouters.push(loadRouter); } /** * Look up IOHandler for saving, given a URL-like string. * * @param url * @returns If only one match is found, an instance of IOHandler with the * `save` method defined. If no match is found, `null`. * @throws Error, if more than one match is found. */ static getSaveHandlers(url) { return IORouterRegistry.getHandlers(url, 'save'); } /** * Look up IOHandler for loading, given a URL-like string. * * @param url * @param loadOptions Optional, custom load options. * @returns All valid handlers for `url`, given the currently registered * handler routers. */ static getLoadHandlers(url, loadOptions) { return IORouterRegistry.getHandlers(url, 'load', loadOptions); } static getHandlers(url, handlerType, loadOptions) { const validHandlers = []; const routers = handlerType === 'load' ? IORouterRegistry.getInstance().loadRouters : IORouterRegistry.getInstance().saveRouters; routers.forEach(router => { const handler = router(url, loadOptions); if (handler !== null) { validHandlers.push(handler); } }); return validHandlers; } } const registerSaveRouter = (loudRouter) => IORouterRegistry.registerSaveRouter(loudRouter); const registerLoadRouter = (loudRouter) => IORouterRegistry.registerLoadRouter(loudRouter); const getSaveHandlers = (url) => IORouterRegistry.getSaveHandlers(url); const getLoadHandlers = (url, loadOptions) => IORouterRegistry.getLoadHandlers(url, loadOptions); //# sourceMappingURL=router_registry.js.map // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ const DATABASE_NAME = 'tensorflowjs'; const DATABASE_VERSION = 1; // Model data and ModelArtifactsInfo (metadata) are stored in two separate // stores for efficient access of the list of stored models and their metadata. // 1. The object store for model data: topology, weights and weight manifests. const MODEL_STORE_NAME = 'models_store'; // 2. The object store for ModelArtifactsInfo, including meta-information such // as the type of topology (JSON vs binary), byte size of the topology, byte // size of the weights, etc. const INFO_STORE_NAME = 'model_info_store'; /** * Delete the entire database for tensorflow.js, including the models store. */ async function deleteDatabase() { const idbFactory = getIndexedDBFactory(); return new Promise((resolve, reject) => { const deleteRequest = idbFactory.deleteDatabase(DATABASE_NAME); deleteRequest.onsuccess = () => resolve(); deleteRequest.onerror = error => reject(error); }); } function getIndexedDBFactory() { if (!Object(environment["c" /* env */])().getBool('IS_BROWSER')) { // TODO(cais): Add more info about what IOHandler subtypes are available. // Maybe point to a doc page on the web and/or automatically determine // the available IOHandlers and print them in the error message. throw new Error('Failed to obtain IndexedDB factory because the current environment' + 'is not a web browser.'); } // tslint:disable-next-line:no-any const theWindow = typeof window === 'undefined' ? self : window; const factory = theWindow.indexedDB || theWindow.mozIndexedDB || theWindow.webkitIndexedDB || theWindow.msIndexedDB || theWindow.shimIndexedDB; if (factory == null) { throw new Error('The current browser does not appear to support IndexedDB.'); } return factory; } function setUpDatabase(openRequest) { const db = openRequest.result; db.createObjectStore(MODEL_STORE_NAME, { keyPath: 'modelPath' }); db.createObjectStore(INFO_STORE_NAME, { keyPath: 'modelPath' }); } /** * IOHandler subclass: Browser IndexedDB. * * See the doc string of `browserIndexedDB` for more details. */ class indexed_db_BrowserIndexedDB { constructor(modelPath) { this.indexedDB = getIndexedDBFactory(); if (modelPath == null || !modelPath) { throw new Error('For IndexedDB, modelPath must not be null, undefined or empty.'); } this.modelPath = modelPath; } async save(modelArtifacts) { // TODO(cais): Support saving GraphDef models. if (modelArtifacts.modelTopology instanceof ArrayBuffer) { throw new Error('BrowserLocalStorage.save() does not support saving model topology ' + 'in binary formats yet.'); } return this.databaseAction(this.modelPath, modelArtifacts); } async load() { return this.databaseAction(this.modelPath); } /** * Perform database action to put model artifacts into or read model artifacts * from IndexedDB object store. * * Whether the action is put or get depends on whether `modelArtifacts` is * specified. If it is specified, the action will be put; otherwise the action * will be get. * * @param modelPath A unique string path for the model. * @param modelArtifacts If specified, it will be the model artifacts to be * stored in IndexedDB. * @returns A `Promise` of `SaveResult`, if the action is put, or a `Promise` * of `ModelArtifacts`, if the action is get. */ databaseAction(modelPath, modelArtifacts) { return new Promise((resolve, reject) => { const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); openRequest.onupgradeneeded = () => setUpDatabase(openRequest); openRequest.onsuccess = () => { const db = openRequest.result; if (modelArtifacts == null) { // Read model out from object store. const modelTx = db.transaction(MODEL_STORE_NAME, 'readonly'); const modelStore = modelTx.objectStore(MODEL_STORE_NAME); const getRequest = modelStore.get(this.modelPath); getRequest.onsuccess = () => { if (getRequest.result == null) { db.close(); return reject(new Error(`Cannot find model with path '${this.modelPath}' ` + `in IndexedDB.`)); } else { resolve(getRequest.result.modelArtifacts); } }; getRequest.onerror = error => { db.close(); return reject(getRequest.error); }; modelTx.oncomplete = () => db.close(); } else { // Put model into object store. const modelArtifactsInfo = Object(io_utils["g" /* getModelArtifactsInfoForJSON */])(modelArtifacts); // First, put ModelArtifactsInfo into info store. const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite'); let infoStore = infoTx.objectStore(INFO_STORE_NAME); const putInfoRequest = infoStore.put({ modelPath: this.modelPath, modelArtifactsInfo }); let modelTx; putInfoRequest.onsuccess = () => { // Second, put model data into model store. modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite'); const modelStore = modelTx.objectStore(MODEL_STORE_NAME); const putModelRequest = modelStore.put({ modelPath: this.modelPath, modelArtifacts, modelArtifactsInfo }); putModelRequest.onsuccess = () => resolve({ modelArtifactsInfo }); putModelRequest.onerror = error => { // If the put-model request fails, roll back the info entry as // well. infoStore = infoTx.objectStore(INFO_STORE_NAME); const deleteInfoRequest = infoStore.delete(this.modelPath); deleteInfoRequest.onsuccess = () => { db.close(); return reject(putModelRequest.error); }; deleteInfoRequest.onerror = error => { db.close(); return reject(putModelRequest.error); }; }; }; putInfoRequest.onerror = error => { db.close(); return reject(putInfoRequest.error); }; infoTx.oncomplete = () => { if (modelTx == null) { db.close(); } else { modelTx.oncomplete = () => db.close(); } }; } }; openRequest.onerror = error => reject(openRequest.error); }); } } indexed_db_BrowserIndexedDB.URL_SCHEME = 'indexeddb://'; const indexedDBRouter = (url) => { if (!Object(environment["c" /* env */])().getBool('IS_BROWSER')) { return null; } else { if (!Array.isArray(url) && url.startsWith(indexed_db_BrowserIndexedDB.URL_SCHEME)) { return browserIndexedDB(url.slice(indexed_db_BrowserIndexedDB.URL_SCHEME.length)); } else { return null; } } }; IORouterRegistry.registerSaveRouter(indexedDBRouter); IORouterRegistry.registerLoadRouter(indexedDBRouter); /** * Creates a browser IndexedDB IOHandler for saving and loading models. * * ```js * const model = tf.sequential(); * model.add( * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'})); * * const saveResult = await model.save('indexeddb://MyModel')); * console.log(saveResult); * ``` * * @param modelPath A unique identifier for the model to be saved. Must be a * non-empty string. * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`), * which can be used with, e.g., `tf.Model.save`. */ function browserIndexedDB(modelPath) { return new indexed_db_BrowserIndexedDB(modelPath); } function maybeStripScheme(key) { return key.startsWith(indexed_db_BrowserIndexedDB.URL_SCHEME) ? key.slice(indexed_db_BrowserIndexedDB.URL_SCHEME.length) : key; } class BrowserIndexedDBManager { constructor() { this.indexedDB = getIndexedDBFactory(); } async listModels() { return new Promise((resolve, reject) => { const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); openRequest.onupgradeneeded = () => setUpDatabase(openRequest); openRequest.onsuccess = () => { const db = openRequest.result; const tx = db.transaction(INFO_STORE_NAME, 'readonly'); const store = tx.objectStore(INFO_STORE_NAME); // tslint:disable:max-line-length // Need to cast `store` as `any` here because TypeScript's DOM // library does not have the `getAll()` method even though the // method is supported in the latest version of most mainstream // browsers: // https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll // tslint:enable:max-line-length // tslint:disable-next-line:no-any const getAllInfoRequest = store.getAll(); getAllInfoRequest.onsuccess = () => { const out = {}; for (const item of getAllInfoRequest.result) { out[item.modelPath] = item.modelArtifactsInfo; } resolve(out); }; getAllInfoRequest.onerror = error => { db.close(); return reject(getAllInfoRequest.error); }; tx.oncomplete = () => db.close(); }; openRequest.onerror = error => reject(openRequest.error); }); } async removeModel(path) { path = maybeStripScheme(path); return new Promise((resolve, reject) => { const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); openRequest.onupgradeneeded = () => setUpDatabase(openRequest); openRequest.onsuccess = () => { const db = openRequest.result; const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite'); const infoStore = infoTx.objectStore(INFO_STORE_NAME); const getInfoRequest = infoStore.get(path); let modelTx; getInfoRequest.onsuccess = () => { if (getInfoRequest.result == null) { db.close(); return reject(new Error(`Cannot find model with path '${path}' ` + `in IndexedDB.`)); } else { // First, delete the entry in the info store. const deleteInfoRequest = infoStore.delete(path); const deleteModelData = () => { // Second, delete the entry in the model store. modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite'); const modelStore = modelTx.objectStore(MODEL_STORE_NAME); const deleteModelRequest = modelStore.delete(path); deleteModelRequest.onsuccess = () => resolve(getInfoRequest.result.modelArtifactsInfo); deleteModelRequest.onerror = error => reject(getInfoRequest.error); }; // Proceed with deleting model data regardless of whether deletion // of info data succeeds or not. deleteInfoRequest.onsuccess = deleteModelData; deleteInfoRequest.onerror = error => { deleteModelData(); db.close(); return reject(getInfoRequest.error); }; } }; getInfoRequest.onerror = error => { db.close(); return reject(getInfoRequest.error); }; infoTx.oncomplete = () => { if (modelTx == null) { db.close(); } else { modelTx.oncomplete = () => db.close(); } }; }; openRequest.onerror = error => reject(openRequest.error); }); } } //# sourceMappingURL=indexed_db.js.map // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/util_base.js var util_base = __webpack_require__(8); // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ const PATH_SEPARATOR = '/'; const PATH_PREFIX = 'tensorflowjs_models'; const INFO_SUFFIX = 'info'; const MODEL_TOPOLOGY_SUFFIX = 'model_topology'; const WEIGHT_SPECS_SUFFIX = 'weight_specs'; const WEIGHT_DATA_SUFFIX = 'weight_data'; const MODEL_METADATA_SUFFIX = 'model_metadata'; /** * Purge all tensorflow.js-saved model artifacts from local storage. * * @returns Paths of the models purged. */ function purgeLocalStorageArtifacts() { if (!Object(environment["c" /* env */])().getBool('IS_BROWSER') || typeof window === 'undefined' || typeof window.localStorage === 'undefined') { throw new Error('purgeLocalStorageModels() cannot proceed because local storage is ' + 'unavailable in the current environment.'); } const LS = window.localStorage; const purgedModelPaths = []; for (let i = 0; i < LS.length; ++i) { const key = LS.key(i); const prefix = PATH_PREFIX + PATH_SEPARATOR; if (key.startsWith(prefix) && key.length > prefix.length) { LS.removeItem(key); const modelName = getModelPathFromKey(key); if (purgedModelPaths.indexOf(modelName) === -1) { purgedModelPaths.push(modelName); } } } return purgedModelPaths; } function getModelKeys(path) { return { info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR), topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR), weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR), weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR), modelMetadata: [PATH_PREFIX, path, MODEL_METADATA_SUFFIX].join(PATH_SEPARATOR) }; } /** * Get model path from a local-storage key. * * E.g., 'tensorflowjs_models/my/model/1/info' --> 'my/model/1' * * @param key */ function getModelPathFromKey(key) { const items = key.split(PATH_SEPARATOR); if (items.length < 3) { throw new Error(`Invalid key format: ${key}`); } return items.slice(1, items.length - 1).join(PATH_SEPARATOR); } function local_storage_maybeStripScheme(key) { return key.startsWith(local_storage_BrowserLocalStorage.URL_SCHEME) ? key.slice(local_storage_BrowserLocalStorage.URL_SCHEME.length) : key; } /** * IOHandler subclass: Browser Local Storage. * * See the doc string to `browserLocalStorage` for more details. */ class local_storage_BrowserLocalStorage { constructor(modelPath) { if (!Object(environment["c" /* env */])().getBool('IS_BROWSER') || typeof window === 'undefined' || typeof window.localStorage === 'undefined') { // TODO(cais): Add more info about what IOHandler subtypes are // available. // Maybe point to a doc page on the web and/or automatically determine // the available IOHandlers and print them in the error message. throw new Error('The current environment does not support local storage.'); } this.LS = window.localStorage; if (modelPath == null || !modelPath) { throw new Error('For local storage, modelPath must not be null, undefined or empty.'); } this.modelPath = modelPath; this.keys = getModelKeys(this.modelPath); } /** * Save model artifacts to browser local storage. * * See the documentation to `browserLocalStorage` for details on the saved * artifacts. * * @param modelArtifacts The model artifacts to be stored. * @returns An instance of SaveResult. */ async save(modelArtifacts) { if (modelArtifacts.modelTopology instanceof ArrayBuffer) { throw new Error('BrowserLocalStorage.save() does not support saving model topology ' + 'in binary formats yet.'); } else { const topology = JSON.stringify(modelArtifacts.modelTopology); const weightSpecs = JSON.stringify(modelArtifacts.weightSpecs); const modelArtifactsInfo = Object(io_utils["g" /* getModelArtifactsInfoForJSON */])(modelArtifacts); try { this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo)); this.LS.setItem(this.keys.topology, topology); this.LS.setItem(this.keys.weightSpecs, weightSpecs); this.LS.setItem(this.keys.weightData, Object(io_utils["a" /* arrayBufferToBase64String */])(modelArtifacts.weightData)); const result = { format: modelArtifacts.format, generatedBy: modelArtifacts.generatedBy, convertedBy: modelArtifacts.convertedBy }; if (modelArtifacts.signature != null) { result.signature = modelArtifacts.signature; } if (modelArtifacts.userDefinedMetadata != null) { result.userDefinedMetadata = modelArtifacts.userDefinedMetadata; } if (modelArtifacts.modelInitializer != null) { result.modelInitializer = modelArtifacts.modelInitializer; } this.LS.setItem(this.keys.modelMetadata, JSON.stringify(result)); return { modelArtifactsInfo }; } catch (err) { // If saving failed, clean up all items saved so far. this.LS.removeItem(this.keys.info); this.LS.removeItem(this.keys.topology); this.LS.removeItem(this.keys.weightSpecs); this.LS.removeItem(this.keys.weightData); this.LS.removeItem(this.keys.modelMetadata); throw new Error(`Failed to save model '${this.modelPath}' to local storage: ` + `size quota being exceeded is a possible cause of this failure: ` + `modelTopologyBytes=${modelArtifactsInfo.modelTopologyBytes}, ` + `weightSpecsBytes=${modelArtifactsInfo.weightSpecsBytes}, ` + `weightDataBytes=${modelArtifactsInfo.weightDataBytes}.`); } } } /** * Load a model from local storage. * * See the documentation to `browserLocalStorage` for details on the saved * artifacts. * * @returns The loaded model (if loading succeeds). */ async load() { const info = JSON.parse(this.LS.getItem(this.keys.info)); if (info == null) { throw new Error(`In local storage, there is no model with name '${this.modelPath}'`); } if (info.modelTopologyType !== 'JSON') { throw new Error('BrowserLocalStorage does not support loading non-JSON model ' + 'topology yet.'); } const out = {}; // Load topology. const topology = JSON.parse(this.LS.getItem(this.keys.topology)); if (topology == null) { throw new Error(`In local storage, the topology of model '${this.modelPath}' ` + `is missing.`); } out.modelTopology = topology; // Load weight specs. const weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs)); if (weightSpecs == null) { throw new Error(`In local storage, the weight specs of model '${this.modelPath}' ` + `are missing.`); } out.weightSpecs = weightSpecs; // Load meta-data fields. const metadataString = this.LS.getItem(this.keys.modelMetadata); if (metadataString != null) { const metadata = JSON.parse(metadataString); out.format = metadata['format']; out.generatedBy = metadata['generatedBy']; out.convertedBy = metadata['convertedBy']; if (metadata['signature'] != null) { out.signature = metadata['signature']; } if (metadata['userDefinedMetadata'] != null) { out.userDefinedMetadata = metadata['userDefinedMetadata']; } if (metadata['modelInitializer'] != null) { out.modelInitializer = metadata['modelInitializer']; } } // Load weight data. const weightDataBase64 = this.LS.getItem(this.keys.weightData); if (weightDataBase64 == null) { throw new Error(`In local storage, the binary weight values of model ` + `'${this.modelPath}' are missing.`); } out.weightData = Object(io_utils["b" /* base64StringToArrayBuffer */])(weightDataBase64); return out; } } local_storage_BrowserLocalStorage.URL_SCHEME = 'localstorage://'; const localStorageRouter = (url) => { if (!Object(environment["c" /* env */])().getBool('IS_BROWSER')) { return null; } else { if (!Array.isArray(url) && url.startsWith(local_storage_BrowserLocalStorage.URL_SCHEME)) { return browserLocalStorage(url.slice(local_storage_BrowserLocalStorage.URL_SCHEME.length)); } else { return null; } } }; IORouterRegistry.registerSaveRouter(localStorageRouter); IORouterRegistry.registerLoadRouter(localStorageRouter); /** * Factory function for local storage IOHandler. * * This `IOHandler` supports both `save` and `load`. * * For each model's saved artifacts, four items are saved to local storage. * - `${PATH_SEPARATOR}/${modelPath}/info`: Contains meta-info about the * model, such as date saved, type of the topology, size in bytes, etc. * - `${PATH_SEPARATOR}/${modelPath}/topology`: Model topology. For Keras- * style models, this is a stringized JSON. * - `${PATH_SEPARATOR}/${modelPath}/weight_specs`: Weight specs of the * model, can be used to decode the saved binary weight values (see * item below). * - `${PATH_SEPARATOR}/${modelPath}/weight_data`: Concatenated binary * weight values, stored as a base64-encoded string. * * Saving may throw an `Error` if the total size of the artifacts exceed the * browser-specific quota. * * @param modelPath A unique identifier for the model to be saved. Must be a * non-empty string. * @returns An instance of `IOHandler`, which can be used with, e.g., * `tf.Model.save`. */ function browserLocalStorage(modelPath) { return new local_storage_BrowserLocalStorage(modelPath); } class local_storage_BrowserLocalStorageManager { constructor() { Object(util_base["b" /* assert */])(Object(environment["c" /* env */])().getBool('IS_BROWSER'), () => 'Current environment is not a web browser'); Object(util_base["b" /* assert */])(typeof window === 'undefined' || typeof window.localStorage !== 'undefined', () => 'Current browser does not appear to support localStorage'); this.LS = window.localStorage; } async listModels() { const out = {}; const prefix = PATH_PREFIX + PATH_SEPARATOR; const suffix = PATH_SEPARATOR + INFO_SUFFIX; for (let i = 0; i < this.LS.length; ++i) { const key = this.LS.key(i); if (key.startsWith(prefix) && key.endsWith(suffix)) { const modelPath = getModelPathFromKey(key); out[modelPath] = JSON.parse(this.LS.getItem(key)); } } return out; } async removeModel(path) { path = local_storage_maybeStripScheme(path); const keys = getModelKeys(path); if (this.LS.getItem(keys.info) == null) { throw new Error(`Cannot find model at path '${path}'`); } const info = JSON.parse(this.LS.getItem(keys.info)); this.LS.removeItem(keys.info); this.LS.removeItem(keys.topology); this.LS.removeItem(keys.weightSpecs); this.LS.removeItem(keys.weightData); return info; } } //# sourceMappingURL=local_storage.js.map // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/model_management.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * Classes and functions for model management across multiple storage mediums. * * Supported client actions: * - Listing models on all registered storage mediums. * - Remove model by URL from any registered storage mediums, by using URL * string. * - Moving or copying model from one path to another in the same medium or from * one medium to another, by using URL strings. */ const URL_SCHEME_SUFFIX = '://'; class model_management_ModelStoreManagerRegistry { constructor() { this.managers = {}; } static getInstance() { if (model_management_ModelStoreManagerRegistry.instance == null) { model_management_ModelStoreManagerRegistry.instance = new model_management_ModelStoreManagerRegistry(); } return model_management_ModelStoreManagerRegistry.instance; } /** * Register a save-handler router. * * @param saveRouter A function that maps a URL-like string onto an instance * of `IOHandler` with the `save` method defined or `null`. */ static registerManager(scheme, manager) { Object(util_base["b" /* assert */])(scheme != null, () => 'scheme must not be undefined or null.'); if (scheme.endsWith(URL_SCHEME_SUFFIX)) { scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX)); } Object(util_base["b" /* assert */])(scheme.length > 0, () => 'scheme must not be an empty string.'); const registry = model_management_ModelStoreManagerRegistry.getInstance(); Object(util_base["b" /* assert */])(registry.managers[scheme] == null, () => `A model store manager is already registered for scheme '${scheme}'.`); registry.managers[scheme] = manager; } static getManager(scheme) { const manager = this.getInstance().managers[scheme]; if (manager == null) { throw new Error(`Cannot find model manager for scheme '${scheme}'`); } return manager; } static getSchemes() { return Object.keys(this.getInstance().managers); } } /** * Helper method for parsing a URL string into a scheme and a path. * * @param url E.g., 'localstorage://my-model' * @returns A dictionary with two fields: scheme and path. * Scheme: e.g., 'localstorage' in the example above. * Path: e.g., 'my-model' in the example above. */ function parseURL(url) { if (url.indexOf(URL_SCHEME_SUFFIX) === -1) { throw new Error(`The url string provided does not contain a scheme. ` + `Supported schemes are: ` + `${model_management_ModelStoreManagerRegistry.getSchemes().join(',')}`); } return { scheme: url.split(URL_SCHEME_SUFFIX)[0], path: url.split(URL_SCHEME_SUFFIX)[1], }; } async function cloneModelInternal(sourceURL, destURL, deleteSource = false) { Object(util_base["b" /* assert */])(sourceURL !== destURL, () => `Old path and new path are the same: '${sourceURL}'`); const loadHandlers = IORouterRegistry.getLoadHandlers(sourceURL); Object(util_base["b" /* assert */])(loadHandlers.length > 0, () => `Copying failed because no load handler is found for source URL ${sourceURL}.`); Object(util_base["b" /* assert */])(loadHandlers.length < 2, () => `Copying failed because more than one (${loadHandlers.length}) ` + `load handlers for source URL ${sourceURL}.`); const loadHandler = loadHandlers[0]; const saveHandlers = IORouterRegistry.getSaveHandlers(destURL); Object(util_base["b" /* assert */])(saveHandlers.length > 0, () => `Copying failed because no save handler is found for destination ` + `URL ${destURL}.`); Object(util_base["b" /* assert */])(saveHandlers.length < 2, () => `Copying failed because more than one (${loadHandlers.length}) ` + `save handlers for destination URL ${destURL}.`); const saveHandler = saveHandlers[0]; const sourceScheme = parseURL(sourceURL).scheme; const sourcePath = parseURL(sourceURL).path; const sameMedium = sourceScheme === parseURL(sourceURL).scheme; const modelArtifacts = await loadHandler.load(); // If moving within the same storage medium, remove the old model as soon as // the loading is done. Without doing this, it is possible that the combined // size of the two models will cause the cloning to fail. if (deleteSource && sameMedium) { await model_management_ModelStoreManagerRegistry.getManager(sourceScheme) .removeModel(sourcePath); } const saveResult = await saveHandler.save(modelArtifacts); // If moving between mediums, the deletion is done after the save succeeds. // This guards against the case in which saving to the destination medium // fails. if (deleteSource && !sameMedium) { await model_management_ModelStoreManagerRegistry.getManager(sourceScheme) .removeModel(sourcePath); } return saveResult.modelArtifactsInfo; } /** * List all models stored in registered storage mediums. * * For a web browser environment, the registered mediums are Local Storage and * IndexedDB. * * ```js * // First create and save a model. * const model = tf.sequential(); * model.add(tf.layers.dense( * {units: 1, inputShape: [10], activation: 'sigmoid'})); * await model.save('localstorage://demo/management/model1'); * * // Then list existing models. * console.log(JSON.stringify(await tf.io.listModels())); * * // Delete the model. * await tf.io.removeModel('localstorage://demo/management/model1'); * * // List models again. * console.log(JSON.stringify(await tf.io.listModels())); * ``` * * @returns A `Promise` of a dictionary mapping URLs of existing models to * their model artifacts info. URLs include medium-specific schemes, e.g., * 'indexeddb://my/model/1'. Model artifacts info include type of the * model's topology, byte sizes of the topology, weights, etc. * * @doc { * heading: 'Models', * subheading: 'Management', * namespace: 'io', * ignoreCI: true * } */ async function listModels() { const schemes = model_management_ModelStoreManagerRegistry.getSchemes(); const out = {}; for (const scheme of schemes) { const schemeOut = await model_management_ModelStoreManagerRegistry.getManager(scheme).listModels(); for (const path in schemeOut) { const url = scheme + URL_SCHEME_SUFFIX + path; out[url] = schemeOut[path]; } } return out; } /** * Remove a model specified by URL from a reigstered storage medium. * * ```js * // First create and save a model. * const model = tf.sequential(); * model.add(tf.layers.dense( * {units: 1, inputShape: [10], activation: 'sigmoid'})); * await model.save('localstorage://demo/management/model1'); * * // Then list existing models. * console.log(JSON.stringify(await tf.io.listModels())); * * // Delete the model. * await tf.io.removeModel('localstorage://demo/management/model1'); * * // List models again. * console.log(JSON.stringify(await tf.io.listModels())); * ``` * * @param url A URL to a stored model, with a scheme prefix, e.g., * 'localstorage://my-model-1', 'indexeddb://my/model/2'. * @returns ModelArtifactsInfo of the deleted model (if and only if deletion * is successful). * @throws Error if deletion fails, e.g., if no model exists at `path`. * * @doc { * heading: 'Models', * subheading: 'Management', * namespace: 'io', * ignoreCI: true * } */ async function removeModel(url) { const schemeAndPath = parseURL(url); const manager = model_management_ModelStoreManagerRegistry.getManager(schemeAndPath.scheme); return manager.removeModel(schemeAndPath.path); } /** * Copy a model from one URL to another. * * This function supports: * * 1. Copying within a storage medium, e.g., * `tf.io.copyModel('localstorage://model-1', 'localstorage://model-2')` * 2. Copying between two storage mediums, e.g., * `tf.io.copyModel('localstorage://model-1', 'indexeddb://model-1')` * * ```js * // First create and save a model. * const model = tf.sequential(); * model.add(tf.layers.dense( * {units: 1, inputShape: [10], activation: 'sigmoid'})); * await model.save('localstorage://demo/management/model1'); * * // Then list existing models. * console.log(JSON.stringify(await tf.io.listModels())); * * // Copy the model, from Local Storage to IndexedDB. * await tf.io.copyModel( * 'localstorage://demo/management/model1', * 'indexeddb://demo/management/model1'); * * // List models again. * console.log(JSON.stringify(await tf.io.listModels())); * * // Remove both models. * await tf.io.removeModel('localstorage://demo/management/model1'); * await tf.io.removeModel('indexeddb://demo/management/model1'); * ``` * * @param sourceURL Source URL of copying. * @param destURL Destination URL of copying. * @returns ModelArtifactsInfo of the copied model (if and only if copying * is successful). * @throws Error if copying fails, e.g., if no model exists at `sourceURL`, or * if `oldPath` and `newPath` are identical. * * @doc { * heading: 'Models', * subheading: 'Management', * namespace: 'io', * ignoreCI: true * } */ async function copyModel(sourceURL, destURL) { const deleteSource = false; return cloneModelInternal(sourceURL, destURL, deleteSource); } /** * Move a model from one URL to another. * * This function supports: * * 1. Moving within a storage medium, e.g., * `tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')` * 2. Moving between two storage mediums, e.g., * `tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')` * * ```js * // First create and save a model. * const model = tf.sequential(); * model.add(tf.layers.dense( * {units: 1, inputShape: [10], activation: 'sigmoid'})); * await model.save('localstorage://demo/management/model1'); * * // Then list existing models. * console.log(JSON.stringify(await tf.io.listModels())); * * // Move the model, from Local Storage to IndexedDB. * await tf.io.moveModel( * 'localstorage://demo/management/model1', * 'indexeddb://demo/management/model1'); * * // List models again. * console.log(JSON.stringify(await tf.io.listModels())); * * // Remove the moved model. * await tf.io.removeModel('indexeddb://demo/management/model1'); * ``` * * @param sourceURL Source URL of moving. * @param destURL Destination URL of moving. * @returns ModelArtifactsInfo of the copied model (if and only if copying * is successful). * @throws Error if moving fails, e.g., if no model exists at `sourceURL`, or * if `oldPath` and `newPath` are identical. * * @doc { * heading: 'Models', * subheading: 'Management', * namespace: 'io', * ignoreCI: true * } */ async function moveModel(sourceURL, destURL) { const deleteSource = true; return cloneModelInternal(sourceURL, destURL, deleteSource); } //# sourceMappingURL=model_management.js.map // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.js /** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ class PlatformBrowser { fetch(path, init) { return fetch(path, init); } now() { return performance.now(); } encode(text, encoding) { if (encoding !== 'utf-8' && encoding !== 'utf8') { throw new Error(`Browser's encoder only supports utf-8, but got ${encoding}`); } if (this.textEncoder == null) { this.textEncoder = new TextEncoder(); } return this.textEncoder.encode(text); } decode(bytes, encoding) { return new TextDecoder(encoding).decode(bytes); } } if (Object(environment["c" /* env */])().get('IS_BROWSER')) { Object(environment["c" /* env */])().setPlatform('browser', new PlatformBrowser()); // Register LocalStorage IOHandler try { model_management_ModelStoreManagerRegistry.registerManager(local_storage_BrowserLocalStorage.URL_SCHEME, new local_storage_BrowserLocalStorageManager()); } catch (err) { } // Register IndexedDB IOHandler try { model_management_ModelStoreManagerRegistry.registerManager(indexed_db_BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager()); } catch (err) { } } //# sourceMappingURL=platform_browser.js.map // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.js var platform_node = __webpack_require__(278); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/buffer.js var buffer = __webpack_require__(47); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/cast.js var cast = __webpack_require__(12); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/clone.js var clone = __webpack_require__(70); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/print.js var print = __webpack_require__(150); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/tensor.js + 1 modules var dist_tensor = __webpack_require__(6); // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/base_side_effects.js /** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ // Required side effectful code for tfjs-core // Set up Engine and ENV Object(engine["b" /* getOrMakeEngine */])(); // Register backend-agnostic flags. // Register platforms // Set up OpHandler const opHandler = { buffer: buffer["a" /* buffer */], cast: cast["a" /* cast */], clone: clone["a" /* clone */], print: print["a" /* print */] }; Object(dist_tensor["f" /* setOpHandler */])(opHandler); //# sourceMappingURL=base_side_effects.js.map // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * IOHandlers related to files, such as browser-triggered file downloads, * user-selected files in browser. */ const DEFAULT_FILE_NAME_PREFIX = 'model'; const DEFAULT_JSON_EXTENSION_NAME = '.json'; const DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin'; function defer(f) { return new Promise(resolve => setTimeout(resolve)).then(f); } class browser_files_BrowserDownloads { constructor(fileNamePrefix) { if (!Object(environment["c" /* env */])().getBool('IS_BROWSER')) { // TODO(cais): Provide info on what IOHandlers are available under the // current environment. throw new Error('browserDownloads() cannot proceed because the current environment ' + 'is not a browser.'); } if (fileNamePrefix.startsWith(browser_files_BrowserDownloads.URL_SCHEME)) { fileNamePrefix = fileNamePrefix.slice(browser_files_BrowserDownloads.URL_SCHEME.length); } if (fileNamePrefix == null || fileNamePrefix.length === 0) { fileNamePrefix = DEFAULT_FILE_NAME_PREFIX; } this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME; this.weightDataFileName = fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME; } async save(modelArtifacts) { if (typeof (document) === 'undefined') { throw new Error('Browser downloads are not supported in ' + 'this environment since `document` is not present'); } const weightsURL = window.URL.createObjectURL(new Blob([modelArtifacts.weightData], { type: 'application/octet-stream' })); if (modelArtifacts.modelTopology instanceof ArrayBuffer) { throw new Error('BrowserDownloads.save() does not support saving model topology ' + 'in binary formats yet.'); } else { const weightsManifest = [{ paths: ['./' + this.weightDataFileName], weights: modelArtifacts.weightSpecs }]; const modelTopologyAndWeightManifest = { modelTopology: modelArtifacts.modelTopology, format: modelArtifacts.format, generatedBy: modelArtifacts.generatedBy, convertedBy: modelArtifacts.convertedBy, weightsManifest }; if (modelArtifacts.signature != null) { modelTopologyAndWeightManifest.signature = modelArtifacts.signature; } if (modelArtifacts.userDefinedMetadata != null) { modelTopologyAndWeightManifest.userDefinedMetadata = modelArtifacts.userDefinedMetadata; } if (modelArtifacts.modelInitializer != null) { modelTopologyAndWeightManifest.modelInitializer = modelArtifacts.modelInitializer; } const modelTopologyAndWeightManifestURL = window.URL.createObjectURL(new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: 'application/json' })); // If anchor elements are not provided, create them without attaching them // to parents, so that the downloaded file names can be controlled. const jsonAnchor = this.jsonAnchor == null ? document.createElement('a') : this.jsonAnchor; jsonAnchor.download = this.modelTopologyFileName; jsonAnchor.href = modelTopologyAndWeightManifestURL; // Trigger downloads by evoking a click event on the download anchors. // When multiple downloads are started synchronously, Firefox will only // save the last one. await defer(() => jsonAnchor.dispatchEvent(new MouseEvent('click'))); if (modelArtifacts.weightData != null) { const weightDataAnchor = this.weightDataAnchor == null ? document.createElement('a') : this.weightDataAnchor; weightDataAnchor.download = this.weightDataFileName; weightDataAnchor.href = weightsURL; await defer(() => weightDataAnchor.dispatchEvent(new MouseEvent('click'))); } return { modelArtifactsInfo: Object(io_utils["g" /* getModelArtifactsInfoForJSON */])(modelArtifacts) }; } } } browser_files_BrowserDownloads.URL_SCHEME = 'downloads://'; class browser_files_BrowserFiles { constructor(files) { if (files == null || files.length < 1) { throw new Error(`When calling browserFiles, at least 1 file is required, ` + `but received ${files}`); } this.files = files; } async load() { const jsonFile = this.files[0]; const weightFiles = this.files.slice(1); return new Promise((resolve, reject) => { const jsonReader = new FileReader(); jsonReader.onload = (event) => { // tslint:disable-next-line:no-any const modelJSON = JSON.parse(event.target.result); const modelTopology = modelJSON.modelTopology; if (modelTopology == null) { reject(new Error(`modelTopology field is missing from file ${jsonFile.name}`)); return; } if (weightFiles.length === 0) { resolve({ modelTopology }); } const weightsManifest = modelJSON.weightsManifest; if (weightsManifest == null) { reject(new Error(`weightManifest field is missing from file ${jsonFile.name}`)); return; } let pathToFile; try { pathToFile = this.checkManifestAndWeightFiles(weightsManifest, weightFiles); } catch (err) { reject(err); return; } const weightSpecs = []; const paths = []; const perFileBuffers = []; weightsManifest.forEach(weightsGroup => { weightsGroup.paths.forEach(path => { paths.push(path); perFileBuffers.push(null); }); weightSpecs.push(...weightsGroup.weights); }); weightsManifest.forEach(weightsGroup => { weightsGroup.paths.forEach(path => { const weightFileReader = new FileReader(); weightFileReader.onload = (event) => { // tslint:disable-next-line:no-any const weightData = event.target.result; const index = paths.indexOf(path); perFileBuffers[index] = weightData; if (perFileBuffers.indexOf(null) === -1) { const result = { modelTopology, weightSpecs, weightData: Object(io_utils["d" /* concatenateArrayBuffers */])(perFileBuffers), format: modelJSON.format, generatedBy: modelJSON.generatedBy, convertedBy: modelJSON.convertedBy }; if (modelJSON.signature != null) { result.signature = modelJSON.signature; } if (modelJSON.userDefinedMetadata != null) { result.userDefinedMetadata = modelJSON.userDefinedMetadata; } if (modelJSON.modelInitializer != null) { result.modelInitializer = modelJSON.modelInitializer; } resolve(result); } }; weightFileReader.onerror = error => reject(`Failed to weights data from file of path '${path}'.`); weightFileReader.readAsArrayBuffer(pathToFile[path]); }); }); }; jsonReader.onerror = error => reject(`Failed to read model topology and weights manifest JSON ` + `from file '${jsonFile.name}'. BrowserFiles supports loading ` + `Keras-style tf.Model artifacts only.`); jsonReader.readAsText(jsonFile); }); } /** * Check the compatibility between weights manifest and weight files. */ checkManifestAndWeightFiles(manifest, files) { const basenames = []; const fileNames = files.map(file => Object(io_utils["c" /* basename */])(file.name)); const pathToFile = {}; for (const group of manifest) { group.paths.forEach(path => { const pathBasename = Object(io_utils["c" /* basename */])(path); if (basenames.indexOf(pathBasename) !== -1) { throw new Error(`Duplicate file basename found in weights manifest: ` + `'${pathBasename}'`); } basenames.push(pathBasename); if (fileNames.indexOf(pathBasename) === -1) { throw new Error(`Weight file with basename '${pathBasename}' is not provided.`); } else { pathToFile[path] = files[fileNames.indexOf(pathBasename)]; } }); } if (basenames.length !== files.length) { throw new Error(`Mismatch in the number of files in weights manifest ` + `(${basenames.length}) and the number of weight files provided ` + `(${files.length}).`); } return pathToFile; } } const browserDownloadsRouter = (url) => { if (!Object(environment["c" /* env */])().getBool('IS_BROWSER')) { return null; } else { if (!Array.isArray(url) && url.startsWith(browser_files_BrowserDownloads.URL_SCHEME)) { return browserDownloads(url.slice(browser_files_BrowserDownloads.URL_SCHEME.length)); } else { return null; } } }; IORouterRegistry.registerSaveRouter(browserDownloadsRouter); /** * Creates an IOHandler that triggers file downloads from the browser. * * The returned `IOHandler` instance can be used as model exporting methods such * as `tf.Model.save` and supports only saving. * * ```js * const model = tf.sequential(); * model.add(tf.layers.dense( * {units: 1, inputShape: [10], activation: 'sigmoid'})); * const saveResult = await model.save('downloads://mymodel'); * // This will trigger downloading of two files: * // 'mymodel.json' and 'mymodel.weights.bin'. * console.log(saveResult); * ``` * * @param fileNamePrefix Prefix name of the files to be downloaded. For use with * `tf.Model`, `fileNamePrefix` should follow either of the following two * formats: * 1. `null` or `undefined`, in which case the default file * names will be used: * - 'model.json' for the JSON file containing the model topology and * weights manifest. * - 'model.weights.bin' for the binary file containing the binary weight * values. * 2. A single string or an Array of a single string, as the file name prefix. * For example, if `'foo'` is provided, the downloaded JSON * file and binary weights file will be named 'foo.json' and * 'foo.weights.bin', respectively. * @param config Additional configuration for triggering downloads. * @returns An instance of `BrowserDownloads` `IOHandler`. * * @doc { * heading: 'Models', * subheading: 'Loading', * namespace: 'io', * ignoreCI: true * } */ function browserDownloads(fileNamePrefix = 'model') { return new browser_files_BrowserDownloads(fileNamePrefix); } /** * Creates an IOHandler that loads model artifacts from user-selected files. * * This method can be used for loading from files such as user-selected files * in the browser. * When used in conjunction with `tf.loadLayersModel`, an instance of * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts. * * ```js * // Note: This code snippet won't run properly without the actual file input * // elements in the HTML DOM. * * // Suppose there are two HTML file input (``) * // elements. * const uploadJSONInput = document.getElementById('upload-json'); * const uploadWeightsInput = document.getElementById('upload-weights'); * const model = await tf.loadLayersModel(tf.io.browserFiles( * [uploadJSONInput.files[0], uploadWeightsInput.files[0]])); * ``` * * @param files `File`s to load from. Currently, this function supports only * loading from files that contain Keras-style models (i.e., `tf.Model`s), for * which an `Array` of `File`s is expected (in that order): * - A JSON file containing the model topology and weight manifest. * - Optionally, One or more binary files containing the binary weights. * These files must have names that match the paths in the `weightsManifest` * contained by the aforementioned JSON file, or errors will be thrown * during loading. These weights files have the same format as the ones * generated by `tensorflowjs_converter` that comes with the `tensorflowjs` * Python PIP package. If no weights files are provided, only the model * topology will be loaded from the JSON file above. * @returns An instance of `Files` `IOHandler`. * * @doc { * heading: 'Models', * subheading: 'Loading', * namespace: 'io', * ignoreCI: true * } */ function browserFiles(files) { return new browser_files_BrowserFiles(files); } //# sourceMappingURL=browser_files.js.map // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/progress.js /** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * Monitor Promise.all progress, fire onProgress callback function. * * @param promises Promise list going to be monitored * @param onProgress Callback function. Fired when a promise resolved. * @param startFraction Optional fraction start. Default to 0. * @param endFraction Optional fraction end. Default to 1. */ function monitorPromisesProgress(promises, onProgress, startFraction, endFraction) { checkPromises(promises); startFraction = startFraction == null ? 0 : startFraction; endFraction = endFraction == null ? 1 : endFraction; checkFraction(startFraction, endFraction); let resolvedPromise = 0; const registerMonitor = (promise) => { promise.then(value => { const fraction = startFraction + ++resolvedPromise / promises.length * (endFraction - startFraction); // pass fraction as parameter to callback function. onProgress(fraction); return value; }); return promise; }; function checkPromises(promises) { Object(util_base["b" /* assert */])(promises != null && Array.isArray(promises) && promises.length > 0, () => 'promises must be a none empty array'); } function checkFraction(startFraction, endFraction) { Object(util_base["b" /* assert */])(startFraction >= 0 && startFraction <= 1, () => `Progress fraction must be in range [0, 1], but ` + `got startFraction ${startFraction}`); Object(util_base["b" /* assert */])(endFraction >= 0 && endFraction <= 1, () => `Progress fraction must be in range [0, 1], but ` + `got endFraction ${endFraction}`); Object(util_base["b" /* assert */])(endFraction >= startFraction, () => `startFraction must be no more than endFraction, but ` + `got startFraction ${startFraction} and endFraction ` + `${endFraction}`); } return Promise.all(promises.map(registerMonitor)); } //# sourceMappingURL=progress.js.map // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/types.js var types = __webpack_require__(148); // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * Reads binary weights data from a number of URLs. * * @param fetchURLs URLs to send the HTTP requests at, using `fetch` calls. * @param requestOptions RequestInit (options) for the HTTP requests. * @param fetchFunc Optional overriding value for the `window.fetch` function. * @param onProgress Optional, progress callback function, fired periodically * before the load is completed. * @returns A `Promise` of an Array of `ArrayBuffer`. The Array has the same * length as `fetchURLs`. */ async function loadWeightsAsArrayBuffer(fetchURLs, loadOptions) { if (loadOptions == null) { loadOptions = {}; } const fetchFunc = loadOptions.fetchFunc == null ? Object(environment["c" /* env */])().platform.fetch : loadOptions.fetchFunc; // Create the requests for all of the weights in parallel. const requests = fetchURLs.map(fetchURL => fetchFunc(fetchURL, loadOptions.requestInit, { isBinary: true })); const fetchStartFraction = 0; const fetchEndFraction = 0.5; const responses = loadOptions.onProgress == null ? await Promise.all(requests) : await monitorPromisesProgress(requests, loadOptions.onProgress, fetchStartFraction, fetchEndFraction); const bufferPromises = responses.map(response => response.arrayBuffer()); const bufferStartFraction = 0.5; const bufferEndFraction = 1; const buffers = loadOptions.onProgress == null ? await Promise.all(bufferPromises) : await monitorPromisesProgress(bufferPromises, loadOptions.onProgress, bufferStartFraction, bufferEndFraction); return buffers; } /** * Reads a weights manifest JSON configuration, fetches the weights and * returns them as `Tensor`s. * * @param manifest The weights manifest JSON. * @param filePathPrefix The path prefix for filenames given in the manifest. * Defaults to the empty string. * @param weightNames The names of the weights to be fetched. */ async function loadWeights(manifest, filePathPrefix = '', weightNames, requestInit) { // TODO(nsthorat): Groups are currently fetched atomically. If you need a // single weight from a group, the whole group will be fetched. At a future // date, we should support fetching only the individual shards within a // group that are needed to reconstruct the requested weight. // TODO(cais): Use `decodeWeights` for implementation. const fetchWeights = (fetchUrls) => loadWeightsAsArrayBuffer(fetchUrls, { requestInit }); const loadWeights = weightsLoaderFactory(fetchWeights); return loadWeights(manifest, filePathPrefix, weightNames); } /** * Creates a function, which reads a weights manifest JSON configuration, * fetches the weight files using the specified function and returns them as * `Tensor`s. * * ```js * // example for creating a nodejs weight loader, which reads the weight files * // from disk using fs.readFileSync * * import * as fs from 'fs' * * const fetchWeightsFromDisk = (filePaths: string[]) => * filePaths.map(filePath => fs.readFileSync(filePath).buffer) * * const loadWeights = tf.io.weightsLoaderFactory(fetchWeightsFromDisk) * * const manifest = JSON.parse( * fs.readFileSync('./my_model-weights_manifest').toString() * ) * const weightMap = await loadWeights(manifest, './') * ``` * @param fetchWeightsFunction The function used for fetching the weight files. * @returns Weight loading function. */ function weightsLoaderFactory(fetchWeightsFunction) { return async (manifest, filePathPrefix = '', weightNames) => { // Collect all the groups, weights, and their relative offsets to be // fetched. const groupIndicesToFetchMap = manifest.map(() => false); const groupWeightsToFetch = {}; const weightsFound = weightNames != null ? weightNames.map(() => false) : []; const allManifestWeightNames = []; manifest.forEach((manifestGroupConfig, groupIndex) => { let groupOffset = 0; manifestGroupConfig.weights.forEach(weightsEntry => { const rawDtype = ('quantization' in weightsEntry) ? weightsEntry.quantization.dtype : weightsEntry.dtype; const weightsBytes = types["a" /* DTYPE_VALUE_SIZE_MAP */][rawDtype] * util_base["O" /* sizeFromShape */](weightsEntry.shape); const enqueueWeightsForFetchingFn = () => { groupIndicesToFetchMap[groupIndex] = true; if (groupWeightsToFetch[groupIndex] == null) { groupWeightsToFetch[groupIndex] = []; } groupWeightsToFetch[groupIndex].push({ manifestEntry: weightsEntry, groupOffset, sizeBytes: weightsBytes }); }; if (weightNames != null) { weightNames.forEach((weightName, weightIndex) => { if (weightName === weightsEntry.name) { enqueueWeightsForFetchingFn(); weightsFound[weightIndex] = true; } }); } else { enqueueWeightsForFetchingFn(); } allManifestWeightNames.push(weightsEntry.name); groupOffset += weightsBytes; }); }); if (!weightsFound.every(found => found)) { const weightsNotFound = weightNames.filter((_, i) => !weightsFound[i]); throw new Error(`Could not find weights in manifest with names: ` + `${weightsNotFound.join(', ')}. \n` + `Manifest JSON has weights with names: ` + `${allManifestWeightNames.join(', ')}.`); } // Convert the one-hot boolean groupId => shouldFetch map to a list of group // IDs. const groupIndicesToFetch = groupIndicesToFetchMap.reduce((accumulator, shouldFetch, i) => { if (shouldFetch) { accumulator.push(i); } return accumulator; }, []); const fetchUrls = []; groupIndicesToFetch.forEach(i => { manifest[i].paths.forEach(filepath => { const fetchUrl = filePathPrefix + (!filePathPrefix.endsWith('/') ? '/' : '') + filepath; fetchUrls.push(fetchUrl); }); }); const buffers = await fetchWeightsFunction(fetchUrls); const weightsTensorMap = {}; let bufferIndexOffset = 0; groupIndicesToFetch.forEach(i => { const numBuffers = manifest[i].paths.length; let groupBytes = 0; for (let i = 0; i < numBuffers; i++) { groupBytes += buffers[bufferIndexOffset + i].byteLength; } // Create a buffer for the whole group. const groupBuffer = new ArrayBuffer(groupBytes); const groupByteBuffer = new Uint8Array(groupBuffer); let groupBufferOffset = 0; for (let i = 0; i < numBuffers; i++) { const buffer = new Uint8Array(buffers[bufferIndexOffset + i]); groupByteBuffer.set(buffer, groupBufferOffset); groupBufferOffset += buffer.byteLength; } const weightsEntries = groupWeightsToFetch[i]; weightsEntries.forEach(weightsEntry => { const byteBuffer = groupBuffer.slice(weightsEntry.groupOffset, weightsEntry.groupOffset + weightsEntry.sizeBytes); const nameToTensorMap = Object(io_utils["e" /* decodeWeights */])(byteBuffer, [weightsEntry.manifestEntry]); for (const name in nameToTensorMap) { weightsTensorMap[name] = nameToTensorMap[name]; } }); bufferIndexOffset += numBuffers; }); return weightsTensorMap; }; } //# sourceMappingURL=weights_loader.js.map // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/http.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * IOHandler implementations based on HTTP requests in the web browser. * * Uses [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). */ const OCTET_STREAM_MIME_TYPE = 'application/octet-stream'; const JSON_TYPE = 'application/json'; class http_HTTPRequest { constructor(path, loadOptions) { this.DEFAULT_METHOD = 'POST'; if (loadOptions == null) { loadOptions = {}; } this.weightPathPrefix = loadOptions.weightPathPrefix; this.onProgress = loadOptions.onProgress; this.weightUrlConverter = loadOptions.weightUrlConverter; if (loadOptions.fetchFunc != null) { Object(util_base["b" /* assert */])(typeof loadOptions.fetchFunc === 'function', () => 'Must pass a function that matches the signature of ' + '`fetch` (see ' + 'https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)'); this.fetch = loadOptions.fetchFunc; } else { this.fetch = Object(environment["c" /* env */])().platform.fetch; } Object(util_base["b" /* assert */])(path != null && path.length > 0, () => 'URL path for http must not be null, undefined or ' + 'empty.'); if (Array.isArray(path)) { Object(util_base["b" /* assert */])(path.length === 2, () => 'URL paths for http must have a length of 2, ' + `(actual length is ${path.length}).`); } this.path = path; if (loadOptions.requestInit != null && loadOptions.requestInit.body != null) { throw new Error('requestInit is expected to have no pre-existing body, but has one.'); } this.requestInit = loadOptions.requestInit || {}; } async save(modelArtifacts) { if (modelArtifacts.modelTopology instanceof ArrayBuffer) { throw new Error('BrowserHTTPRequest.save() does not support saving model topology ' + 'in binary formats yet.'); } const init = Object.assign({ method: this.DEFAULT_METHOD }, this.requestInit); init.body = new FormData(); const weightsManifest = [{ paths: ['./model.weights.bin'], weights: modelArtifacts.weightSpecs, }]; const modelTopologyAndWeightManifest = { modelTopology: modelArtifacts.modelTopology, format: modelArtifacts.format, generatedBy: modelArtifacts.generatedBy, convertedBy: modelArtifacts.convertedBy, weightsManifest }; if (modelArtifacts.signature != null) { modelTopologyAndWeightManifest.signature = modelArtifacts.signature; } if (modelArtifacts.userDefinedMetadata != null) { modelTopologyAndWeightManifest.userDefinedMetadata = modelArtifacts.userDefinedMetadata; } if (modelArtifacts.modelInitializer != null) { modelTopologyAndWeightManifest.modelInitializer = modelArtifacts.modelInitializer; } init.body.append('model.json', new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: JSON_TYPE }), 'model.json'); if (modelArtifacts.weightData != null) { init.body.append('model.weights.bin', new Blob([modelArtifacts.weightData], { type: OCTET_STREAM_MIME_TYPE }), 'model.weights.bin'); } const response = await this.fetch(this.path, init); if (response.ok) { return { modelArtifactsInfo: Object(io_utils["g" /* getModelArtifactsInfoForJSON */])(modelArtifacts), responses: [response], }; } else { throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ` + `${response.status}.`); } } /** * Load model artifacts via HTTP request(s). * * See the documentation to `tf.io.http` for details on the saved * artifacts. * * @returns The loaded model artifacts (if loading succeeds). */ async load() { const modelConfigRequest = await this.fetch(this.path, this.requestInit); if (!modelConfigRequest.ok) { throw new Error(`Request to ${this.path} failed with status code ` + `${modelConfigRequest.status}. Please verify this URL points to ` + `the model JSON of the model to load.`); } let modelConfig; try { modelConfig = await modelConfigRequest.json(); } catch (e) { let message = `Failed to parse model JSON of response from ${this.path}.`; // TODO(nsthorat): Remove this after some time when we're comfortable that // .pb files are mostly gone. if (this.path.endsWith('.pb')) { message += ' Your path contains a .pb file extension. ' + 'Support for .pb models have been removed in TensorFlow.js 1.0 ' + 'in favor of .json models. You can re-convert your Python ' + 'TensorFlow model using the TensorFlow.js 1.0 conversion scripts ' + 'or you can convert your.pb models with the \'pb2json\'' + 'NPM script in the tensorflow/tfjs-converter repository.'; } else { message += ' Please make sure the server is serving valid ' + 'JSON for this request.'; } throw new Error(message); } const modelTopology = modelConfig.modelTopology; const weightsManifest = modelConfig.weightsManifest; const generatedBy = modelConfig.generatedBy; const convertedBy = modelConfig.convertedBy; const format = modelConfig.format; const signature = modelConfig.signature; const userDefinedMetadata = modelConfig.userDefinedMetadata; // We do not allow both modelTopology and weightsManifest to be missing. if (modelTopology == null && weightsManifest == null) { throw new Error(`The JSON from HTTP path ${this.path} contains neither model ` + `topology or manifest for weights.`); } let weightSpecs; let weightData; if (weightsManifest != null) { const results = await this.loadWeights(weightsManifest); [weightSpecs, weightData] = results; } const artifacts = { modelTopology, weightSpecs, weightData, generatedBy, convertedBy, format }; if (signature != null) { artifacts.signature = signature; } if (userDefinedMetadata != null) { artifacts.userDefinedMetadata = userDefinedMetadata; } const initializer = modelConfig.modelInitializer; if (initializer) { artifacts.modelInitializer = initializer; } return artifacts; } async loadWeights(weightsManifest) { const weightPath = Array.isArray(this.path) ? this.path[1] : this.path; const [prefix, suffix] = parseUrl(weightPath); const pathPrefix = this.weightPathPrefix || prefix; const weightSpecs = []; for (const entry of weightsManifest) { weightSpecs.push(...entry.weights); } const fetchURLs = []; const urlPromises = []; for (const weightsGroup of weightsManifest) { for (const path of weightsGroup.paths) { if (this.weightUrlConverter != null) { urlPromises.push(this.weightUrlConverter(path)); } else { fetchURLs.push(pathPrefix + path + suffix); } } } if (this.weightUrlConverter) { fetchURLs.push(...await Promise.all(urlPromises)); } const buffers = await loadWeightsAsArrayBuffer(fetchURLs, { requestInit: this.requestInit, fetchFunc: this.fetch, onProgress: this.onProgress }); return [weightSpecs, Object(io_utils["d" /* concatenateArrayBuffers */])(buffers)]; } } http_HTTPRequest.URL_SCHEME_REGEX = /^https?:\/\//; /** * Extract the prefix and suffix of the url, where the prefix is the path before * the last file, and suffix is the search params after the last file. * ``` * const url = 'http://tfhub.dev/model/1/tensorflowjs_model.pb?tfjs-format=file' * [prefix, suffix] = parseUrl(url) * // prefix = 'http://tfhub.dev/model/1/' * // suffix = '?tfjs-format=file' * ``` * @param url the model url to be parsed. */ function parseUrl(url) { const lastSlash = url.lastIndexOf('/'); const lastSearchParam = url.lastIndexOf('?'); const prefix = url.substring(0, lastSlash); const suffix = lastSearchParam > lastSlash ? url.substring(lastSearchParam) : ''; return [prefix + '/', suffix]; } function isHTTPScheme(url) { return url.match(http_HTTPRequest.URL_SCHEME_REGEX) != null; } const httpRouter = (url, loadOptions) => { if (typeof fetch === 'undefined' && (loadOptions == null || loadOptions.fetchFunc == null)) { // `http` uses `fetch` or `node-fetch`, if one wants to use it in // an environment that is not the browser or node they have to setup a // global fetch polyfill. return null; } else { let isHTTP = true; if (Array.isArray(url)) { isHTTP = url.every(urlItem => isHTTPScheme(urlItem)); } else { isHTTP = isHTTPScheme(url); } if (isHTTP) { return http(url, loadOptions); } } return null; }; IORouterRegistry.registerSaveRouter(httpRouter); IORouterRegistry.registerLoadRouter(httpRouter); /** * Creates an IOHandler subtype that sends model artifacts to HTTP server. * * An HTTP request of the `multipart/form-data` mime type will be sent to the * `path` URL. The form data includes artifacts that represent the topology * and/or weights of the model. In the case of Keras-style `tf.Model`, two * blobs (files) exist in form-data: * - A JSON file consisting of `modelTopology` and `weightsManifest`. * - A binary weights file consisting of the concatenated weight values. * These files are in the same format as the one generated by * [tfjs_converter](https://js.tensorflow.org/tutorials/import-keras.html). * * The following code snippet exemplifies the client-side code that uses this * function: * * ```js * const model = tf.sequential(); * model.add( * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'})); * * const saveResult = await model.save(tf.io.http( * 'http://model-server:5000/upload', {requestInit: {method: 'PUT'}})); * console.log(saveResult); * ``` * * If the default `POST` method is to be used, without any custom parameters * such as headers, you can simply pass an HTTP or HTTPS URL to `model.save`: * * ```js * const saveResult = await model.save('http://model-server:5000/upload'); * ``` * * The following GitHub Gist * https://gist.github.com/dsmilkov/1b6046fd6132d7408d5257b0976f7864 * implements a server based on [flask](https://github.com/pallets/flask) that * can receive the request. Upon receiving the model artifacts via the requst, * this particular server reconsistutes instances of [Keras * Models](https://keras.io/models/model/) in memory. * * * @param path A URL path to the model. * Can be an absolute HTTP path (e.g., * 'http://localhost:8000/model-upload)') or a relative path (e.g., * './model-upload'). * @param requestInit Request configurations to be used when sending * HTTP request to server using `fetch`. It can contain fields such as * `method`, `credentials`, `headers`, `mode`, etc. See * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request * for more information. `requestInit` must not have a body, because the * body will be set by TensorFlow.js. File blobs representing the model * topology (filename: 'model.json') and the weights of the model (filename: * 'model.weights.bin') will be appended to the body. If `requestInit` has a * `body`, an Error will be thrown. * @param loadOptions Optional configuration for the loading. It includes the * following fields: * - weightPathPrefix Optional, this specifies the path prefix for weight * files, by default this is calculated from the path param. * - fetchFunc Optional, custom `fetch` function. E.g., in Node.js, * the `fetch` from node-fetch can be used here. * - onProgress Optional, progress callback function, fired periodically * before the load is completed. * @returns An instance of `IOHandler`. * * @doc { * heading: 'Models', * subheading: 'Loading', * namespace: 'io', * ignoreCI: true * } */ function http(path, loadOptions) { return new http_HTTPRequest(path, loadOptions); } /** * Deprecated. Use `tf.io.http`. * @param path * @param loadOptions */ function browserHTTPRequest(path, loadOptions) { return http(path, loadOptions); } //# sourceMappingURL=http.js.map // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ class PassthroughLoader { constructor(modelArtifacts) { this.modelArtifacts = modelArtifacts; } async load() { return this.modelArtifacts; } } class PassthroughSaver { constructor(saveHandler) { this.saveHandler = saveHandler; } async save(modelArtifacts) { return this.saveHandler(modelArtifacts); } } /** * Creates an IOHandler that loads model artifacts from memory. * * When used in conjunction with `tf.loadLayersModel`, an instance of * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts. * * ```js * const model = await tf.loadLayersModel(tf.io.fromMemory( * modelTopology, weightSpecs, weightData)); * ``` * * @param modelArtifacts a object containing model topology (i.e., parsed from * the JSON format). * @param weightSpecs An array of `WeightsManifestEntry` objects describing the * names, shapes, types, and quantization of the weight data. * @param weightData A single `ArrayBuffer` containing the weight data, * concatenated in the order described by the weightSpecs. * @param trainingConfig Model training configuration. Optional. * * @returns A passthrough `IOHandler` that simply loads the provided data. */ function fromMemory(modelArtifacts, weightSpecs, weightData, trainingConfig) { if (arguments.length === 1) { const isModelArtifacts = modelArtifacts.modelTopology != null || modelArtifacts.weightSpecs != null; if (isModelArtifacts) { return new PassthroughLoader(modelArtifacts); } else { // Legacy support: with only modelTopology. // TODO(cais): Remove this deprecated API. console.warn('Please call tf.io.fromMemory() with only one argument. ' + 'The argument should be of type ModelArtifacts. ' + 'The multi-argument signature of tf.io.fromMemory() has been ' + 'deprecated and will be removed in a future release.'); return new PassthroughLoader({ modelTopology: modelArtifacts }); } } else { // Legacy support. // TODO(cais): Remove this deprecated API. console.warn('Please call tf.io.fromMemory() with only one argument. ' + 'The argument should be of type ModelArtifacts. ' + 'The multi-argument signature of tf.io.fromMemory() has been ' + 'deprecated and will be removed in a future release.'); return new PassthroughLoader({ modelTopology: modelArtifacts, weightSpecs, weightData, trainingConfig }); } } /** * Creates an IOHandler that passes saved model artifacts to a callback. * * ```js * function handleSave(artifacts) { * // ... do something with the artifacts ... * return {modelArtifactsInfo: {...}, ...}; * } * * const saveResult = model.save(tf.io.withSaveHandler(handleSave)); * ``` * * @param saveHandler A function that accepts a `ModelArtifacts` and returns a * `SaveResult`. */ function withSaveHandler(saveHandler) { return new PassthroughSaver(saveHandler); } //# sourceMappingURL=passthrough.js.map // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/io/io.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ // Importing local_storage and indexed_db is necessary for the routers to be // registered. //# sourceMappingURL=io.js.map // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js var tensor_util_env = __webpack_require__(2); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.js var mat_mul = __webpack_require__(24); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.js var one_hot = __webpack_require__(106); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/operation.js var operation = __webpack_require__(4); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js var transpose = __webpack_require__(52); // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * Computes the confusion matrix from true labels and predicted labels. * * ```js * const labels = tf.tensor1d([0, 1, 2, 1, 0], 'int32'); * const predictions = tf.tensor1d([0, 2, 2, 1, 0], 'int32'); * const numClasses = 3; * const out = tf.math.confusionMatrix(labels, predictions, numClasses); * out.print(); * // Expected output matrix: * // [[2, 0, 0], * // [0, 1, 1], * // [0, 0, 1]] * ``` * * @param labels The target labels, assumed to be 0-based integers * for the classes. The shape is `[numExamples]`, where * `numExamples` is the number of examples included. * @param predictions The predicted classes, assumed to be * 0-based integers for the classes. Must have the same shape as `labels`. * @param numClasses Number of all classes, as an integer. * Its value must be larger than the largest element in `labels` and * `predictions`. * @returns The confusion matrix as a int32-type 2D tensor. The value at * row `r` and column `c` is the number of times examples of actual class * `r` were predicted as class `c`. * * @doc {heading: 'Operations', subheading: 'Evaluation'} */ function confusionMatrix_(labels, predictions, numClasses) { const $labels = Object(tensor_util_env["a" /* convertToTensor */])(labels, 'labels', 'confusionMatrix'); const $predictions = Object(tensor_util_env["a" /* convertToTensor */])(predictions, 'predictions', 'confusionMatrix'); util_base["b" /* assert */](numClasses == null || numClasses > 0 && Number.isInteger(numClasses), () => `If provided, numClasses must be a positive integer, ` + `but got ${numClasses}`); util_base["b" /* assert */]($labels.rank === 1, () => `Expected the rank of labels to be 1, but got ${$labels.rank}`); util_base["b" /* assert */]($predictions.rank === 1, () => `Expected the rank of predictions to be 1, ` + `but got ${$predictions.rank}`); util_base["b" /* assert */]($labels.shape[0] === $predictions.shape[0], () => `Mismatch in the number of examples: ` + `${$labels.shape[0]} vs. ${$predictions.shape[0]}. ` + `Labels and predictions should have the same number of elements.`); util_base["b" /* assert */](numClasses > 0 && Number.isInteger(numClasses), () => `numClasses is required to be a positive integer, but got ` + `${numClasses}`); // TODO(cais): In the future, if oneHot supports tensors inputs for // `numClasses`, `confusionMatrix` can make `numClasses` optional. const oneHotLabels = Object(one_hot["a" /* oneHot */])(Object(cast["a" /* cast */])($labels, 'int32'), numClasses); const oneHotPredictions = Object(one_hot["a" /* oneHot */])(Object(cast["a" /* cast */])($predictions, 'int32'), numClasses); const oneHotLabelsT = Object(transpose["a" /* transpose */])(oneHotLabels); const product = Object(mat_mul["a" /* matMul */])(oneHotLabelsT, oneHotPredictions); return Object(cast["a" /* cast */])(product, 'int32'); } const confusionMatrix = Object(operation["b" /* op */])({ confusionMatrix_ }); //# sourceMappingURL=confusion_matrix.js.map // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/math.js /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * Exports under the tf.math.* namespace. */ //# sourceMappingURL=math.js.map // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/kernel_names.js var kernel_names = __webpack_require__(3); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/kernel_registry.js var kernel_registry = __webpack_require__(62); // EXTERNAL MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.js var tensor3d = __webpack_require__(178); // CONCATENATED MODULE: ./node_modules/@tensorflow/tfjs-core/dist/ops/browser.js /** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ let fromPixels2DContext; /** * Creates a `tf.Tensor` from an image. * * ```js * const image = new ImageData(1, 1); * image.data[0] = 100; * image.data[1] = 150; * image.data[2] = 200; * image.data[3] = 255; * * tf.browser.fromPixels(image).print(); * ``` * * @param pixels The input image to construct the tensor from. The * supported image types are all 4-channel. You can also pass in an image * object with following attributes: * `{data: Uint8Array; width: number; height: number}` * @param numChannels The number of channels of the output tensor. A * numChannels value less than 4 allows you to ignore channels. Defaults to * 3 (ignores alpha channel of input image). * * @returns A Tensor3D with the shape `[height, width, numChannels]`. * * @doc {heading: 'Browser', namespace: 'browser', ignoreCI: true} */ function fromPixels_(pixels, numChannels = 3) { // Sanity checks. if (numChannels > 4) { throw new Error('Cannot construct Tensor with more than 4 channels from pixels.'); } if (pixels == null) { throw new Error('pixels passed to tf.browser.fromPixels() can not be null'); } let isPixelData = false; let isImageData = false; let isVideo = false; let isImage = false; let isCanvasLike = false; let isImageBitmap = false; if (pixels.data instanceof Uint8Array) { isPixelData = true; } else if (typeof (ImageData) !== 'undefined' && pixels instanceof ImageData) { isImageData = true; } else if (typeof (HTMLVideoElement) !== 'undefined' && pixels instanceof HTMLVideoElement) { isVideo = true; } else if (typeof (HTMLImageElement) !== 'undefined' && pixels instanceof HTMLImageElement) { isImage = true; // tslint:disable-next-line: no-any } else if (pixels.getContext != null) { isCanvasLike = true; } else if (typeof (ImageBitmap) !== 'undefined' && pixels instanceof ImageBitmap) { isImageBitmap = true; } else { throw new Error('pixels passed to tf.browser.fromPixels() must be either an ' + `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData ` + `in browser, or OffscreenCanvas, ImageData in webworker` + ` or {data: Uint32Array, width: number, height: number}, ` + `but was ${pixels.constructor.name}`); } if (isVideo) { const HAVE_CURRENT_DATA_READY_STATE = 2; if (isVideo && pixels.readyState < HAVE_CURRENT_DATA_READY_STATE) { throw new Error('The video element has not loaded data yet. Please wait for ' + '`loadeddata` event on the