Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "softmax-fn", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Softmax Function", | ||
"main": "dist/softmax.js", | ||
"directories": { | ||
"lib": "lib", | ||
"example": "example" | ||
}, | ||
"scripts": { | ||
"test": "istanbul cover node_modules/jasmine/bin/jasmine.js" | ||
}, | ||
"main": "index.js", | ||
"repository": { | ||
@@ -39,3 +32,3 @@ "type": "git", | ||
}, | ||
"homepage": "https://lewismoten.github.io/softmax", | ||
"homepage": "https://github.com/lewismoten/softmax", | ||
"devDependencies": { | ||
@@ -49,5 +42,2 @@ "babel-preset-es2015-script": "^1.0.0", | ||
"gulp-jasmine": "^2.3.0", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-sourcemaps": "^2.0.0-alpha", | ||
"gulp-uglify": "^1.5.3", | ||
"istanbul": "^0.4.3", | ||
@@ -61,6 +51,4 @@ "jasmine": "^2.4.1" | ||
"files": [ | ||
"lib/", | ||
"dist/", | ||
"example/" | ||
"index.js" | ||
] | ||
} |
# Softmax Function | ||
Creates a normalized exponential array from an array of numbers. | ||
The Softmax function | ||
## Example | ||
The function is compatible with CommonJS and AMD. The softmax function will also be available on the global object *(window, global, this, etc.)* | ||
```javascript | ||
let softmax = require('softmax-fn'); | ||
### HTML | ||
softmax([1]); | ||
// [1] | ||
```html | ||
<script src="softmax.js" type="text/javascript"></script> | ||
<script type="text/javascript"> | ||
let inputs = [1, 2, 4.3], | ||
outputs = softmax(inputs); | ||
console.log(outputs); | ||
</script> | ||
softmax([1, 2, 4.3]); | ||
// [0.03243497033829723, 0.08816739047720148, 0.8793976391845013] | ||
``` | ||
### CommonJS | ||
```javascript | ||
let softmax = require('softmax-fn'), | ||
inputs = [1, 2, 4.3], | ||
outputs = softmax(inputs); | ||
console.log(outputs); | ||
## Installation | ||
``` | ||
### AMD | ||
$ npm install softmax-fn | ||
``` | ||
## API | ||
```javascript | ||
define(['softmax-fn'], function(softmax) { | ||
let inputs = [1, 2, 4.3], | ||
outputs = softmax(inputs); | ||
console.log(outputs); | ||
}); | ||
var softmax = require('softmax-fn'); | ||
``` | ||
### softmax(values) | ||
- parameter *{number[]}* values: A list of numbers ranging from -10 to 10. | ||
- returns *{number[]}*: A normalized list of entries between 0 and 1 where the sum is 1. | ||
### Output | ||
All of the previous examples have the same output. | ||
```javascript | ||
[ | ||
0.03243497033829723, | ||
0.08816739047720148, | ||
0.8793976391845013 | ||
] | ||
``` | ||
## Links | ||
@@ -48,0 +29,0 @@ - Github: [Softmax](https://github.com/lewismoten/softmax) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
9
0
4561
4
64
32
1