awesome-sigmoid
Advanced tools
Comparing version 0.0.7 to 1.0.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = exports.makeAwesomeSigmoid = exports.sigmoid = void 0; | ||
var sigmoid = function sigmoid(x, gain) { | ||
return (Math.tanh(gain * x / 2) + 1) / 2; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sigmoid = function (x, gain) { | ||
return (Math.tanh((gain * x) / 2) + 1) / 2; | ||
}; | ||
exports.sigmoid = sigmoid; | ||
var makeAwesomeSigmoid = function makeAwesomeSigmoid(_ref) { | ||
var center = _ref.center, | ||
deviation = _ref.deviation, | ||
deviation_output = _ref.deviation_output; | ||
/* | ||
see: https://www.wolframalpha.com/input/?i=solve+y+%3D+sigmoid((g)x)+for+g | ||
variables: x: sigmoid input, y: sigmoid output, g: gain | ||
*/ | ||
var gain = Math.log(-1 * deviation_output / (deviation_output - 1)) / deviation; | ||
return function (x) { | ||
return sigmoid(x - center, gain); | ||
}; | ||
exports.makeSigmoid = function (_a) { | ||
var center = _a.center, deviation = _a.deviation, deviation_output = _a.deviation_output; | ||
/* | ||
see: https://www.wolframalpha.com/input/?i=solve+y+%3D+sigmoid((g)x)+for+g | ||
variables: x: sigmoid input, y: sigmoid output, g: gain | ||
*/ | ||
var gain = Math.log((-1 * deviation_output) / (deviation_output - 1)) / deviation; | ||
return function (x) { return exports.sigmoid(x - center, gain); }; | ||
}; | ||
exports.makeAwesomeSigmoid = makeAwesomeSigmoid; | ||
var _default = makeAwesomeSigmoid; | ||
exports.default = _default; | ||
exports.default = exports.makeSigmoid; |
{ | ||
"name": "awesome-sigmoid", | ||
"version": "0.0.7", | ||
"description": "generate perfect sigmoid function for you", | ||
"version": "1.0.0", | ||
"description": "generate sigmoid function flexible and easy", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
@@ -11,7 +12,7 @@ "lib", | ||
"scripts": { | ||
"eslint:init": "eslint --init", | ||
"test:mocha": "nyc mocha -r @babel/register", | ||
"test:eslint": "eslint src/index.js", | ||
"test:jest": "jest --coverage", | ||
"test:typescript": "tsc --noEmit", | ||
"test:eslint": "eslint src/index.ts", | ||
"test": "npm-run-all test:*", | ||
"build": "babel src --out-dir lib", | ||
"build": "tsc", | ||
"prepublish": "npm run test && npm run build" | ||
@@ -30,12 +31,13 @@ }, | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.3.4", | ||
"@babel/preset-env": "^7.3.4", | ||
"@babel/register": "^7.0.0", | ||
"eslint": "^5.15.1", | ||
"eslint-config-google": "^0.12.0", | ||
"mocha": "^6.0.2", | ||
"@types/jest": "^25.2.1", | ||
"@types/node": "^13.11.1", | ||
"@typescript-eslint/eslint-plugin": "^2.28.0", | ||
"@typescript-eslint/parser": "^2.28.0", | ||
"eslint": "^5.16.0", | ||
"husky": "^4.2.5", | ||
"jest": "^25.3.0", | ||
"npm-run-all": "^4.1.5", | ||
"nyc": "^13.3.0" | ||
"ts-jest": "^25.3.1", | ||
"typescript": "^3.8.3" | ||
} | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7272
9
143
1
10