Socket
Socket
Sign inDemoInstall

softmax-fn

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

softmax-fn - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

index.js

20

package.json
{
"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"
]
}

49

README.md
# 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)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc