sakuya/node_modules/.vite/neataptic.js.map

8 lines
182 KiB
Plaintext
Raw Normal View History

2022-04-10 00:37:53 +08:00
{
"version": 3,
"sources": ["../neataptic/src/methods/activation.js", "../neataptic/src/methods/mutation.js", "../neataptic/src/methods/selection.js", "../neataptic/src/methods/crossover.js", "../neataptic/src/methods/cost.js", "../neataptic/src/methods/gating.js", "../neataptic/src/methods/connection.js", "../neataptic/src/methods/rate.js", "../neataptic/src/methods/methods.js", "../neataptic/src/architecture/connection.js", "browser-external:child_process", "browser-external:path", "../neataptic/src/multithreading/workers/node/testworker.js", "../neataptic/src/multithreading/workers/browser/testworker.js", "../neataptic/src/multithreading/workers/workers.js", "../neataptic/src/multithreading/multi.js", "../neataptic/src/config.js", "../neataptic/src/neat.js", "../neataptic/src/architecture/node.js", "browser-external:os", "../neataptic/src/architecture/network.js", "../neataptic/src/architecture/layer.js", "../neataptic/src/architecture/group.js", "../neataptic/src/architecture/architect.js", "../neataptic/src/neataptic.js", "dep:neataptic"],
"sourcesContent": ["/*******************************************************************************\r\n ACTIVATION FUNCTIONS\r\n*******************************************************************************/\r\n\r\n// https://en.wikipedia.org/wiki/Activation_function\r\n// https://stats.stackexchange.com/questions/115258/comprehensive-list-of-activation-functions-in-neural-networks-with-pros-cons\r\nvar activation = {\r\n LOGISTIC: function (x, derivate) {\r\n var fx = 1 / (1 + Math.exp(-x));\r\n if (!derivate) return fx;\r\n return fx * (1 - fx);\r\n },\r\n TANH: function (x, derivate) {\r\n if (derivate) return 1 - Math.pow(Math.tanh(x), 2);\r\n return Math.tanh(x);\r\n },\r\n IDENTITY: function (x, derivate) {\r\n return derivate ? 1 : x;\r\n },\r\n STEP: function (x, derivate) {\r\n return derivate ? 0 : x > 0 ? 1 : 0;\r\n },\r\n RELU: function (x, derivate) {\r\n if (derivate) return x > 0 ? 1 : 0;\r\n return x > 0 ? x : 0;\r\n },\r\n SOFTSIGN: function (x, derivate) {\r\n var d = 1 + Math.abs(x);\r\n if (derivate) return x / Math.pow(d, 2);\r\n return x / d;\r\n },\r\n SINUSOID: function (x, derivate) {\r\n if (derivate) return Math.cos(x);\r\n return Math.sin(x);\r\n },\r\n GAUSSIAN: function (x, derivate) {\r\n var d = Math.exp(-Math.pow(x, 2));\r\n if (derivate) return -2 * x * d;\r\n return d;\r\n },\r\n BENT_IDENTITY: function (x, derivate) {\r\n var d = Math.sqrt(Math.pow(x, 2) + 1);\r\n if (derivate) return x / (2 * d) + 1;\r\n return (d - 1) / 2 + x;\r\n },\r\n BIPOLAR: function (x, derivate) {\r\n return derivate ? 0 : x > 0 ? 1 : -1;\r\n },\r\n BIPOLAR_SIGMOID: function (x, derivate) {\r\n var d = 2 / (1 + Math.exp(-x)) - 1;\r\n if (derivate) return 1 / 2 * (1 + d) * (1 - d);\r\n return d;\r\n },\r\n HARD_TANH: function (x, derivate) {\r\n if (derivate) return x > -1 && x < 1 ? 1 : 0;\r\n return Math.max(-1, Math.min(1, x));\r\n },\r\n ABSOLUTE: function (x, derivate) {\r\n if (derivate) return x < 0 ? -1 : 1;\r\n return Math.abs(x);\r\n },\r\n INVERSE: function (x, derivate) {\r\n if (derivate) return -1;\r\n return 1 - x;\r\n },\r\n // https://arxiv.org/pdf/1706.02515.pdf\r\n SELU: function (x, derivate) {\r\n var alpha = 1.6732632423543772848170429916717;\r\n var scale = 1.0507009873554804934193349852946;\r\n var fx = x > 0 ? x : alpha * Math.exp(x) - alpha;\r\n if (derivate) { return x > 0 ? scale : (fx + alpha) * scale; }\r\n return fx * scale;\r\n }\r\n};\r\n\r\n/* Export */\r\nmodule.exports = activation;\r\n", "/* Import */\r\nvar activation = require('./activation');\r\n\r\n/*******************************************************************************\r\n MUTATION\r\n*******************************************************************************/\r\n\r\n// https://en.wikipedia.org/wiki/mutation_(genetic_algorithm)\r\nvar mutation = {\r\n ADD_NODE: {\r\n name: 'ADD_NODE'\r\n },\r\n SUB_NODE: {\r\n name: 'SUB_NODE',\r\n keep_gates: true\r\n },\r\n ADD_CONN: {\r\n name: 'ADD_CONN'\r\n },\r\n SUB_CONN: {\r\n name: 'REMOVE_CONN'\r\n },\r\n MOD_WEIGHT: {\r\n name: 'MOD_WEIGHT',\r\n min: -1,\r\n max: 1\r\n },\r\n MOD_BIAS: {\r\n name: 'MOD_BIAS',\r\n min: -1,\r\n max: 1\r\n },\r\n MOD_ACTIVATION: {\r\n name: 'MOD_ACTIVATION',\r\n mutateOutput: true,\r\n allowed: [\r\n activation.LOGISTIC,\r\n activation.TANH,\r\n activation.RELU,\r\n activation.IDENTITY,\r\n activation.STEP,\r\n activation.SOFTSIGN,\r\n activation.SINUSOID,\r\n activation.GAUSSIAN,\r\n activation.BENT_IDENTITY,\r\n activation.BIPOLAR,\r\n activation.BIPOLAR_SIGMOID,\r\n activation.HARD_TANH,\r\n activation.ABSOLUTE,\r\n activation.INVERSE,\r\n activation.SELU\r\n ]\r\n },\r\n ADD_SELF_CONN: {\r\n name: 'ADD_SELF_CONN'\r\n },\r\n SUB_SELF_CONN: {\r\n name: 'SUB_SELF_CONN'\r\n },\r\n ADD
"mappings": ";;;;;;;AAAA;AAAA;AAMA,QAAI,aAAa;AAAA,MACf,UAAU,SAAU,GAAG,UAAU;AAC/B,YAAI,KAAK,IAAK,KAAI,KAAK,IAAI,CAAC;AAC5B,YAAI,CAAC;AAAU,iBAAO;AACtB,eAAO,KAAM,KAAI;AAAA;AAAA,MAEnB,MAAM,SAAU,GAAG,UAAU;AAC3B,YAAI;AAAU,iBAAO,IAAI,KAAK,IAAI,KAAK,KAAK,IAAI;AAChD,eAAO,KAAK,KAAK;AAAA;AAAA,MAEnB,UAAU,SAAU,GAAG,UAAU;AAC/B,eAAO,WAAW,IAAI;AAAA;AAAA,MAExB,MAAM,SAAU,GAAG,UAAU;AAC3B,eAAO,WAAW,IAAI,IAAI,IAAI,IAAI;AAAA;AAAA,MAEpC,MAAM,SAAU,GAAG,UAAU;AAC3B,YAAI;AAAU,iBAAO,IAAI,IAAI,IAAI;AACjC,eAAO,IAAI,IAAI,I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