| 所在主题: | |
| 文件名: som-master.zip | |
| 资料下载链接地址: https://bbs.pinggu.org/a-2057113.html | |
| 附件大小: | |
|
ml-som
self-organizing map (SOM) / Kohonen network Installation$ npm install ml-som Methodsnew SOM(x, y, [options])Creates a new SOM instance with x * y dimensions. Arguments
Options
Example var SOM = require('ml-som');var options = {fields: { r: [0, 255], g: [0, 255], b: [0, 255]}};var som = new SOM(20, 20, options);train(trainingSet) Train the SOM with the provided trainingSet. Arguments
Example var trainingSet = [{ r: 0, g: 0, b: 0 },{ r: 255, g: 0, b: 0 },{ r: 0, g: 255, b: 0 },{ r: 0, g: 0, b: 255 },{ r: 255, g: 255, b: 255 }];som.train(trainingSet);getConvertedNodes() Returns a 2D array containing the nodes of the grid, in the structure described by the fields option. setTraining(trainingSet)Set the training set for use with the next method trainOne()Executes the next training iteration and returns true. Returns false if the training is over. Useful to draw the grid or compute some things after each learning step. Example som.setTraining(trainingSet);while(som.trainOne()) {var nodes = som.getConvertedNodes();// do something with the nodes}predict([data], [computePosition]) Returns for each data point the coordinates of the corresponding best matching unit (BMU) on the grid Arguments
Example // create and train the somvar result1 = som.predict({ r: 45, g: 209, b: 100 });// result1 = [ 2, 26 ]var result2 = som.predict([{ r: 45, g: 209, b: 100 }, { r: 155, g: 22, b: 12 }], true);// result2 = [ [ 2, 26, [ 0.236, 0.694 ] ], [ 33, 12, [ 0.354, 0.152 ] ] ]getFit([dataset]) Returns an array of fit values which are the square root of the distance between the input vector and its corresponding BMU. Arguments
Returns the mean of the fit values for the training set. This number can be used to compare several runs of the same SOM. getUMatrix()Returns a 2D array representing the grid. Each value is the mean of the distances between the corresponding node and its direct neighbors. Currently only available for square nodes export()Exports the model to a JSON object that can be written to disk and reloaded SOM.load(model, [distanceFunction])Returns a new SOM instance based on the model. If the model was created with a custom distance function, the distanceargument should be this function. Arguments
[hide][/hide] |
|
熟悉论坛请点击新手指南
|
|
| 下载说明 | |
|
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。 2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。 3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。 (如有侵权,欢迎举报) |
|
京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明