Neuroph studio 入门教程
PERCEPTRON
Perceptron is a simple two layer neural network with several neurons in input layer, and one or more neurons in output layer. All neurons use step transfer function and network can use LMS based learning algorithm such as Perceptron Learning or Delta Rule. This network can be used as a linear classifier, and it can only be applied to linear separable problems.

To create and train Perceptron neural network using Neuroph Studio do the following:
- Create Neuroph Project.
- Create Perceptron network.
- Create training set (in main menu choose Training >New Training Set).
- Train network
- Test trained network
Step 1. Create Neuroph project.
Click File > New Project.

Select Neuroph Project, click Next.

Enter project name and location, click Finish.

Project is created, now create neural network.
Step 2. Create Perceptron network.
Click File > New File

Select project from Project drop-down menu, select Neural Network file type, click next.

Enter network name, select Perceptron network type, click next.

In new perceptron dialog enter number ofneurons in input (2) and output layer (1) , choose Perceptron Learningand click Create button.

This will create the Perceptron neural network with two neurons in input, and one in output layer. By default, all neurons with Steptransfer functions.

Now we shall train this simple network to learn logical AND function. First we have to create the training setaccording to AND truth table.
Step 3. To create training set, click File>New File to open Data Set wizard.

Select DataSet file type, then click next.

Enter training set name, number of inputs andoutputs as shown on picture below and click Finish button.

Then create training set by entering training elements as input and desired output values of neurons in input and outputlayer. Use Add row button to add new elements, and click OK button when finished.

Step 4. Training network. To start network training procedure, drag n' drop training set to corresponding field in the network window, and 'Train' button will become enabled in toolbar. Click the 'Train' button to open Set Learning Parameters dialog.

In Set Learning parameters dialoguse default learning parameters, and just click the Train button.

When the Total Net Error is zero, thetraining is complete.

Step 5. After the training is complete, you can test the network for the whole training set by selecting training set to test, and clicking Test button..

This will show test results in the new tab.

To test single input, use Set Input button. This will open Set Network Input dialog in which you can enter input values for network delimited withspace.

The result of network test is shown on picture below. Network learned logical AND function. As we can see the outputneuron has value 1. Test the network to see how it behaves for other input values.

PERCEPTRON IN JAVA CODE
package org.neuroph.samples;
import java.util.Arrays;
import org.neuroph.core.NeuralNetwork;
import org.neuroph.nnet.Perceptron;
import org.neuroph.core.data.DataSet;
import org.neuroph.core.data.DataSetRow;
/**
* This sample shows how to create, train, save and load simple Perceptron neural network
*/
public class PerceptronSample {
public static void main(String args[]) {
// create training set (logical AND function)
DataSet trainingSet = new DataSet(2, 1);
trainingSet.addRow(new DataSetRow(new double[]{0, 0}, new double[]{0}));
trainingSet.addRow(new DataSetRow(new double[]{0, 1}, new double[]{0}));
trainingSet.addRow(new DataSetRow(new double[]{1, 0}, new double[]{0}));
trainingSet.addRow(new DataSetRow(new double[]{1, 1}, new double[]{1}));// create perceptron neural network
NeuralNetwork myPerceptron = new Perceptron(2, 1);// learn the training set
myPerceptron.learn(trainingSet);// test perceptron
System.out.println("Testing trained perceptron");
testNeuralNetwork(myPerceptron, trainingSet);// save trained perceptron
myPerceptron.save("mySamplePerceptron.nnet");// load saved neural network
NeuralNetwork loadedPerceptron = NeuralNetwork.createFromFile("mySamplePerceptron.nnet");// test loaded neural network
System.out.println("Testing loaded perceptron");
testNeuralNetwork(loadedPerceptron, trainingSet);}
public static void testNeuralNetwork(NeuralNetwork nnet, DataSet tset) {
for(DataSetRow dataRow : tset.getRows()) {
nnet.setInput(dataRow.getInput());
nnet.calculate();
double[ ] networkOutput = nnet.getOutput();
System.out.print("Input: " + Arrays.toString(dataRow.getInput()) );
System.out.println(" Output: " + Arrays.toString(networkOutput) );}
}
}
EXTERNAL LINKS
To learn more about the Perceptrons see:
Neuroph studio 入门教程的更多相关文章
- 自动化测试工具 Test Studio入门教程
Test Studio安装 可以到下载试用版 官网 http://www.telerik.com/teststudio , 装完以后需要装silverlight 安装好了,主界面是介个样子的 Test ...
- Android Studio JNI开发入门教程
Android Studio JNI开发入门教程 2016-08-29 14:38 3269人阅读 评论(0) 收藏 举报 分类: JNI(3) 目录(?)[+] 概述 在Andorid ...
- 《Visual C++ 2010入门教程》系列一:关于Visual Studio、VC和C++的那些事
原文:http://www.cnblogs.com/Mrt-02/archive/2011/07/24/2115606.html 作者:董波 日期:2010.6.15 写在前面 在我还在上学的时候,我 ...
- 官方入门教程和文档 | Visual Studio
Visual Studio 2017 概述 | Microsoft Docs(直接教你用vs) https://docs.microsoft.com/zh-cn/visualstudio/ide/vi ...
- 1,[VS入门教程] 使用Visual Studio写c语言 入门与技巧精品文~~~~下载安装篇
Microsoft Visual Studio是微软(俗称巨硬)公司出品的强大IDE(Integrated Development Environment 集成开发环境),功能强大齐全,界面舒服之类的 ...
- eclipse再见,android studio 新手入门教程(一)基本设置
写在前面: 作为一个刚半只脚踏入android开发的新手,在使用eclipse开发了两个自我感觉不甚成熟的商城类app之后,遇到了一些问题,总结为如下: 代码复用性.findviewById,oncl ...
- SharePoint 2013 入门教程
以下文章是自己在学习SharePoint的过程中,不断积累和总结的博文,现在总结一个目录,分享给大家.这个博客也是自己从SharePoint入门,到一个SharePoint开发的成长记录,里面记录的都 ...
- .NET轻量级MVC框架:Nancy入门教程(二)——Nancy和MVC的简单对比
在上一篇的.NET轻量级MVC框架:Nancy入门教程(一)——初识Nancy中,简单介绍了Nancy,并写了一个Hello,world.看到大家的评论,都在问Nancy的优势在哪里?和微软的MVC比 ...
- UWP 入门教程2——如何实现自适应用户界面
系列文章 UWP入门教程1——UWP的前世今生 如上文所说的,布局面板根据可用的屏幕空间,指定界面元素的大小和位置.例如StackPanel 会水平或垂直排列界面元素.Grid 布局与CSS 中的表格 ...
随机推荐
- break,continue,return 的区别
(1)break 跳出当前循环体 (2)continue 跳过当前循环体continue后面的代码,继续执行下一个循环 (3)return 和循环没关系,就是跳出该函数
- java 使用volatile实现线程数据的共享
java 使用volatile实现线程数据的共享 直接上代码看效果: public class VolatileTest extends Thread { private volatile boole ...
- bzoj1061-[Noi2008]志愿者招募-单纯形 & 费用流
有\(n\)天,\(m\)类志愿者,一个第\(i\)类志愿者可以从第\(s_i\)天工作到第\(t_i\)天,第\(i\)天工作的志愿者不少于\(b_i\)个.每一类志愿者都有单价\(c_i\),问满 ...
- logstash收集MySQL慢查询日志
#此处以收集mysql慢查询日志为准,根据文件名不同添加不同的字段值input { file { path => "/data/order-slave-slow.log" t ...
- 题解 P1334 【瑞瑞的木板】
声明:本题解已经与其他题解重合, ### 且存在压行情况. 首先,这个题解是我有了惨痛的教训:全部WA... 先发一个CODE做声明: #include <bits/stdc++.h> / ...
- Oracle 多表关联并且批量修改
描述:A表有 id,or_id 字段,B表有 id,code 字段 A表有 or_id 与B表的 id 关联,现要将A.or_id 替换成 B.code 数据 UPDATE AS ...
- 解决:warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;找到 MSIL .netmodule 或使用 /GL 编译的模块;正在。。;LINK : warning LNK4075: 忽略“/INCREMENTAL”(由于“/LTCG”规范)
原文链接地址:https://www.cnblogs.com/qrlozte/p/4844411.html 参考资料: http://blog.csdn.net/laogaoav/article/de ...
- 通过系统自带的MSI安装包来提权账号
Windows environments provide a group policy setting which allows a regular user to install a Microso ...
- P5028 Annihilate
P5028 Annihilate 50个串,任意两两的最长公共子串 回忆最长公共子串求法 1.hash+二分 2.SAM 3.SA,属于不同的串的hei的max 1.hash+二分 暴力两两枚举再跑的 ...
- Mobile Service
link 试题分析 我们发现$dp(t,s1,s2,s3)$表示在$t$时刻$3$个人的位置.发现时间复杂度为$O(n \times L^3)$.不仅会$T$还会$MLE$,所以需要优化$dp$.我们 ...