文档章节

Neuroph studio 入门教程[译文]

nickles
 nickles
发布于 2017/07/18 23:26
字数 810
阅读 87
收藏 0

 

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.

感知器是一个简单的两层神经网络,在输入层有多个神经元,输出层有一个或多个神经元。所有的神经元都使用阶跃传递函数,网络可以使用基于LMS的学习算法,如感知器学习或delta规则。该网络可用作线性分类器,只适用于线性可分问题。

To create and train Perceptron neural network using Neuroph Studio do the following:

使用Neuroph Studio创建和训练感知器神经网络遵循以下步骤:

  1. Create Neuroph Project.
  2. Create Perceptron network.
  3. Create training set (in main menu choose Training >New Training Set).
  4. Train network
  5. 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 set according 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.

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) );

}

}

}

 

PERCEPTRON IN Java CODE

EXTERNAL LINKS

To learn more about the Perceptrons see:

© 著作权归作者所有

共有 人打赏支持
nickles
粉丝 4
博文 39
码字总数 32378
作品 0
深圳
程序员
Java神经网络的框架Neuroph 2.5 测试版发布

Neuroph是轻量级的Java神经网络的框架,可以用来模拟常见的神经网络架构。少数基本类别相对应的基本网络的概念,它非常容易学习。它也有一个不错的GUI应用程序。 Neuroph 2.5 with Neuroph S...

小编辑
2011/01/02
1K
2
关于neuroph studio的使用

求教为什么我安装好neuroph studio后打开显示加载高速缓存的对象界面后就自动关闭消失了。求问neuroph studio如何打开?

hresolutio
2016/12/07
597
1
Asp.Net MVC4入门指南(1)入门介绍

前言 本教程将为您讲解使用微软的Visual Studio Express 2012或Visual Web Developer 2010 Express Service Pack 1 来建立一个ASP.NET MVC4 Web应用程序所需要的基础知识。建议您使用Visual ...

葡萄城控件技术团队
2014/06/11
0
0
Neuroph 2.6如何和Neuroph studio及NetBeans Platform配合使用

根据http://www.oracle.com/technetwork/cn/articles/java/nbneural-317387-zhs.html这篇文章的介绍,我下载了Neuroph studio和NetBeans Platform及Neuroph 2.6。可是,不明白这三个软件之间...

東南
2012/04/21
1K
2
Asp.Net MVC4入门指南(3):添加一个视图

在本节中,您需要修改HelloWorldController类,从而使用视图模板文件,干净优雅的封装生成返回到客户端浏览器HTML的过程。 您将创建一个视图模板文件,其中使用了ASP.NET MVC 3所引入的Razor...

葡萄城控件技术团队
2014/06/11
0
0

没有更多内容

加载失败,请刷新页面

加载更多

awk命令用法介绍

10月18日任务 9.6/9.7 awk 1.awk(上)(下) 1.awk 分段操作功能 指定分隔符,并把第一段打印出来,不会改动文件内容 将所有内容打印出来 awk 没有指定分隔符号,则会默认用空格或者空白字符...

hhpuppy
40分钟前
1
0
Spring Cloud Eureka Server高可用之:在线扩容

本文共 1591字,阅读大约需要 6分钟 ! 概述 业务微服务化以后,我们要求服务高可用,于是我们可以部署多个相同的服务实例,并引入负载均衡机制。而微服务注册中心作为微服务化系统的重要单元...

CodeSheep
53分钟前
1
0
内网esxi主机上安装CoreOS虚拟机

CoreOS是一个为专门运行容器而设计的轻量级linux发行版,旨在通过轻量的系统架构和灵活的应用程序部署能力简化数据中心的维护成本和复杂度。它没有包管理工具,运行容器化应用以提供服务;默...

hiwill
今天
1
0
20181018 上课截图

![](https://oscimg.oschina.net/oscnet/49f66c08ab8c59a21a3b98889d961672f30.jpg) ![](https://oscimg.oschina.net/oscnet/a61bc2d618b403650dbd4bf68a671fabecb.jpg)......

小丑鱼00
今天
3
0
WinDbg

参考来自:http://www.cnit.net.cn/?id=225 SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols ctrl + d to open dump_file Microsoft (R) Windows Debugger Version 6.12.0002.633......

xueyuse0012
今天
3
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部