Neste capĂtulo, apresentaremos as redes neurais e descobriremos para que foram projetadas. Este capĂtulo serve de base para os capĂtulos subsequentes, enquanto este mostra os conceitos básicos de redes neurais. Neste capĂtulo, cobriremos os seguintes tĂłpicos:
NeurĂ´nios artificiais
Pesos e preconceitos
Funções de ativação
Camadas de neurĂ´nios
Implementando uma rede neural em Java
Descobrindo redes neurais
Primeiro, o termo "redes neurais" pode criar um instantâneo do cĂ©rebro em sua mente, em particular para aqueles que já se familiarizaram com ele. Isso Ă© realmente verdade, pensamos no cĂ©rebro como uma grande rede neural natural. No entanto, o que podemos dizer sobre redes neurais artificiais ( RNAs )? Bem, começa com o antĂ´nimo natural e o primeiro pensamento que vem Ă nossa mente Ă© a imagem de um cĂ©rebro artificial ou de um robĂ´ que leva em consideração o termo “ artificial" Neste caso, estamos tratando tambĂ©m da criação de uma estrutura semelhante e inspirada no cĂ©rebro humano; portanto, Ă© chamado de inteligĂŞncia artificial. Portanto, um leitor que nĂŁo tem experiĂŞncia anterior com RNA pode agora pensar que o livro ensina como construir sistemas inteligentes, incluindo um cĂ©rebro artificial que pode emular a consciĂŞncia humana usando programas Java, certo? É claro que nĂŁo cobriremos a criação de máquinas pensantes artificiais como na trilogia Matrix; entretanto, este livro explicará várias habilidades incrĂveis e o que essas estruturas podem fazer. Forneceremos ao leitor os cĂłdigos-fonte Java com a definição e criação das estruturas básicas da rede neural, aproveitando todas as vantagens da linguagem de programação Java.
Por que redes neurais artificiais?
, . (NN) ANN , NN ,
. , ANN? .
1940- Warren McCulloch Walter Pits , . , . McCulloch Pits , . , , , , , . , , , .
, McCulloch Pits , . , ; , , , . , , .
, ANN , , , , , . ANN , , .
, |
, |
|
|
, ANN — , . , , . , .
, . ( ), ( ), ( ), :
, .
—
, — , . , (inputs) (output), , . , , :
, , . , .
—
. , , . , , .
:
(Sygmoid)
(Hyberbolic tangent)
(Hard limiting threshold)
(linear)
,
:
— (weights)
, , , , . , , (weights) (output), . , inputs , (weights) . , , , — .
—
, .
—
, ; , , , . , , . , :
, . 3 :
1. Input layer;
2. Hidden layer;
3. Output layer;
,
,
.
/ . , .
, , . . , . , 2 :
1. :
1.1 (monolayer) ;
1.2 (multilayer) ;
2. :
2.1 (Feedforward networks);
2.2 (Feedback networks);
, . . : , Adaline( ), , (Elman) .
, , , :
– . , . , , , , , .
(feedforward networks)
. – feedforward, ; , , , . – feedforward .
(Feedback networks)
, , , , – feedback-. :
– , , , . , , . feedback – , (Elman) (Hopfield), , .
—
, . , . . , , . :
, , (supervised learning), , , ( ). , « », .
!
Java. Java — - , 1990- Sun Microsystems, Oracle 2010-. , Java , . - , Java, . — - , — , , car(, ) my car(, — ). Java ( ), - (). , — . :
: , , .
: , ((public) ), ((private) (protected)), .
: , ; , - . , , .
: , , .
, , , . , , , , , : , . . / , .
, , . , - , / . . , 6 , :
: Neuron |
|
|
|
private ArrayList listOfWeightIn |
ArrayList |
private ArrayList listOfWeightOut |
ArrayList |
|
|
|
public double initNeuron() |
listOfWeightIn, listOfWeightOut |
: |
|
: |
|
public ArrayList getListOfWeightIn() |
ListOfWeightIn |
: |
|
: , ListOfWeightIn |
|
public void setListOfWeightIn(ArrayList listOfWeightIn) |
ListOfWeightIn |
: , |
|
: |
|
public ArrayList getListOfWeightOut() |
ListOfWeightOut |
: |
|
: , ListOfWeightOut |
|
public void setListOfWeightOut(ArrayList listOfWeightOut) |
ListOfWeightOut |
: , |
|
: |
|
: Neuron.java |
|
: Layer |
|
: . |
|
|
|
private ArrayList listOfNeurons |
ArrayList Neuron |
private int numberOfNeuronsInLayer |
, . |
|
|
public ArrayList getListOfNeurons() |
listOfNeurons |
: |
|
: listOfNeurons |
|
public void setListOfNeurons(ArrayList listOfNeurons) |
listOfNeurons |
: listOfNeurons |
|
: |
|
public int getNumberOfNeuronsInLayer() |
numberOfNeuronsInLayer |
: |
|
: numberOfNeuronsInLayer |
|
public void setNumberOfNeuronsInLayer(int numberOfNeuronsInLayer) |
numberOfNeuronsInLayer |
: numberOfNeuronsInLayer |
|
: |
|
: Layer.java |
|
: InputLayer |
|
: Layer |
|
|
|
|
|
|
|
|
public void initLayer(InputLayer inputLayer) |
|
: InputLayer |
|
: |
|
public void printLayer(InputLayer inputLayer) |
|
: InputLayer |
|
: |
|
: InputLayer.java |
|
: HiddenLayer |
|
: Layer |
|
|
|
|
|
|
|
|
public ArrayList initLayer( HiddenLayer hiddenLayer, ArrayList listOfHiddenLayers, InputLayer inputLayer, OutputLayer outputLayer ) |
() |
: HiddenLayer, HiddenLayer, InputLayer, OutputLayer |
|
: |
|
public void printLayer(ArrayList listOfHiddenLayers) |
() |
: HiddenLayer |
|
: |
|
: HiddenLayer.java |
|
: OutputLayer |
|
: Layer |
|
|
|
|
|
|
|
|
public void initLayer(OutputLayer outputLayer) |
|
: OutputLayer |
|
: |
|
public void printLayer(OutputLayer outputLayer) |
|
: OutputLayer |
|
: |
|
: OutputLayer.java |
|
: NeuralNet |
|
: ( , , ). : . |
|
|
|
private InputLayer inputLayer |
InputLayer |
private HiddenLayer hiddenLayer |
HiddenLayer |
private ArrayList listOfHiddenLayer |
ArrayList HiddenLayer. |
private OutputLayer outputLayer |
OutputLayer |
private int numberOfHiddenLayers |
, |
|
|
public void initNet() |
. |
: |
|
: |
|
public void printNet() |
. . |
: |
|
: |
|
: NeuralNet.java |
|
— (UML). UML , , , , , / . : , .
, NeuralNet, n. n ( ), initNet () printNet () n, , . , :
public class NeuralNetTest {
public static void main(String[] args) {
NeuralNet n = new NeuralNet();
n.initNet();
n.printNet();
}
}
, , , . , , :
Neste capĂtulo, vimos uma introdução Ă s redes neurais, o que sĂŁo, para que sĂŁo usadas e seus conceitos básicos. TambĂ©m vimos uma implementação muito simples de uma rede neural na linguagem de programação Java, na qual aplicamos os conceitos teĂłricos da rede neural na prática, codificando cada um dos elementos da rede neural. É importante compreender os conceitos básicos antes de passarmos para os conceitos avançados. O mesmo Ă© verdade para o cĂłdigo Java. No prĂłximo capĂtulo, vamos nos aprofundar no processo de treinamento de redes neurais e explorar os diferentes tipos de inclinações com exemplos simples.
Do tradutor
Livro original: Neural Network Programming with Java