npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-neuralnetwork

v0.1.1

Published

SmartNode node package, provided by MakerCollider

Downloads

24

Readme

node-red-contrib-neuralnetwork

Install


Download node-red-contrib-neuralnetwork to nodered root directory. 
Windows for example: C:\node-red\node_modules
Linux for example: /home/root/node-red/node_modules

You will need to restart Node-RED for it to pick-up the new nodes.

Usage

node-red-contrib-neuralnetwork is based on brain. You need to see it basic usage at first.

Train

When there is no msg.netJSON input, brain node will train with msg.trainData and output net.toJSON in msg.net.

Run

When there is msg.netJSON input, brain node will not train anymore. Instead, it will directory run net.run() with your msg.runData. And output the result in msg.payload.

Example

Train:

[{"id":"d4a484b.f2b5b78","type":"debug","z":"46d50fa1.b92af","name":"","active":true,"console":"false","complete":"net","x":679,"y":175,"wires":[]},{"id":"3b4d60b3.c4b2a","type":"inject","z":"46d50fa1.b92af","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":150,"y":144,"wires":[["6d766489.92899c"]]},{"id":"6d766489.92899c","type":"function","z":"46d50fa1.b92af","name":"fake data","func":"// This function return a fake json array\nvar trainData = [{input: { r: 0.03, g: 0.7, b: 0.5 }, output: { black: 1 }},\n           {input: { r: 0.16, g: 0.09, b: 0.2 }, output: { white: 1 }},\n           {input: { r: 0.5, g: 0.5, b: 1.0 }, output: { white: 1 }}]\n\nmsg.trainData = trainData\nreturn msg;","outputs":1,"noerr":0,"x":333,"y":183,"wires":[["2fe2efbc.d01d1"]]},{"id":"2fe2efbc.d01d1","type":"neuralNetwork","z":"46d50fa1.b92af","name":"neuralNetwork","learningRate":0.3,"errorThresh":0.005,"iterations":20000,"log":false,"logPeriod":10,"x":516,"y":185,"wires":[["d4a484b.f2b5b78"]]}]

Run:

[{"id":"10d56f1d.ef2a91","type":"debug","z":"46d50fa1.b92af","name":"","active":true,"console":"false","complete":"payload","x":687,"y":346,"wires":[]},{"id":"808a1160.7f75f","type":"inject","z":"46d50fa1.b92af","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":131,"y":325,"wires":[["fbed5f0e.0412a"]]},{"id":"fbed5f0e.0412a","type":"function","z":"46d50fa1.b92af","name":"fake data","func":"// This function return a fake json array\nvar netJSON = {\"layers\":[{\"r\":{},\"g\":{},\"b\":{}},{\"0\":{\"bias\":0.5976173927716023,\"weights\":{\"r\":3.5006895738532835,\"g\":-4.542455700505483,\"b\":0.9988932386815509}},\"1\":{\"bias\":0.6470978455858952,\"weights\":{\"r\":3.6115725201557827,\"g\":-4.875546614413311,\"b\":1.211740813346471}},\"2\":{\"bias\":-0.3559477465736521,\"weights\":{\"r\":1.1063595019849224,\"g\":-1.857026678772011,\"b\":0.14886809335684345}}},{\"black\":{\"bias\":3.3336645409591017,\"weights\":{\"0\":-3.7876606581596914,\"1\":-4.023316483216229,\"2\":-1.0819957068479935}},\"white\":{\"bias\":-3.29149645757729,\"weights\":{\"0\":3.782751737648757,\"1\":4.173873416865656,\"2\":0.7154074171638515}}}],\"outputLookup\":true,\"inputLookup\":true}    \nvar runData = { r: 1, g: 0.4, b: 0 }\n\nmsg.runData = runData\nmsg.netJSON = netJSON\nreturn msg;","outputs":1,"noerr":0,"x":315,"y":336,"wires":[["3132e68b.cecd1a"]]},{"id":"3132e68b.cecd1a","type":"neuralNetwork","z":"46d50fa1.b92af","name":"neuralNetwork","learningRate":0.3,"errorThresh":0.005,"iterations":20000,"log":false,"logPeriod":10,"x":501,"y":341,"wires":[["10d56f1d.ef2a91"]]}]

License

MIT License \ No newline at end of file