当前位置:网站首页>Neural network
Neural network
2022-08-02 07:51:00 【Ah Qiangzhen】
人工神经网络
Artificial neurons are the basic building blocks of artificial neural network elements,如下图所示, = [ x 1 , x 2 , x 3 . . . x m ] T , W = [ w 1 , w 2 , . . . w m ] T =\left[ x_1,x_2,x_3...x_m \right] ^T,W=\left[ w_1,w_2,...w_m \right] ^T =[x1,x2,x3...xm]T,W=[w1,w2,...wm]TFor the connection right,So the network input u = ∑ i = 1 m w i x i u=\sum_{i=1}^m{w_ix_i} u=∑i=1mwixi,其向量形式为 u = W T X u=W^TX u=WTX
The picture above for single-layer perceptron neural model,其中mAs the number of neurons in input
v = ∑ i = 1 m w i x i , y = { 1 v ≥ 0 0 v < 0 v=\sum_{i=1}^m{w_ix_i},y=\begin{cases} 1 \quad v\ge 0\\ 0 \quad v<0\\ \end{cases} v=∑i=1mwixi,y={ 1v≥00v<0
Activation function also by excitation function,活化函数,Used to perform the neurons of network input transformation,一般有以下四种:
线性函数 f ( u ) = k u + c f(u)=ku+c f(u)=ku+c
非线性斜面函数 f ( u ) = { γ , u ≥ θ k u , ∣ u ∣ < θ − γ , u ≤ − θ f\left( u \right) =\begin{cases} \gamma ,u\ge \theta\\ ku,\left| u \right|<\theta\\ -\gamma ,u\le -\theta\\ \end{cases} f(u)=⎩⎨⎧γ,u≥θku,∣u∣<θ−γ,u≤−θ
其中 θ , γ \theta ,\gamma θ,γ为非负实数, γ \gamma γReferred to as the saturation value,即 γ \gamma γAs the biggest output neurons阈值函数/阶跃函数
f ( u ) = { β , u > θ − γ , u ≤ θ f\left( u \right) =\begin{cases} \beta ,u>\theta\\ -\gamma ,u\le \theta\\ \end{cases} f(u)={ β,u>θ−γ,u≤θ在logisticReturn to have been introduced insigmoid函数,This function will range minus infinity to infinite is mapped to the(0,1)
sigmoid函数的公式为:
f ( u ) = 1 1 + e − u f\left( u \right) =\frac{1}{1+e^{-u}} f(u)=1+e−u1tanhFunction about educationsigmoid函数要常见一些,This function will range minus infinity to infinite is mapped to the(-1,1),其公式为:
f ( u ) = e u − e u e u + e − u f\left( u \right) =\frac{e^u-e^u}{e^u+e^{-u}} f(u)=eu+e−ueu−eu
例:
Using a single perceptron neural solve the problem of the classification of simple:There are two types of four input vector,Two vector corresponding to the target value as1,The other two vector corresponding to the target value as0,The input vector matrix:
[ − 0.5 − 0.5 0.3 0 − 0.5 0.5 − 0.5 1 ] \left[ \begin{matrix} -0.5& -0.5& 0.3& 0\\ -0.5& 0.5& -0.5& 1\\ \end{matrix} \right] [−0.5−0.5−0.50.50.3−0.501]
其中每一列1Column is the value of an input,Target classification and vectorT=[1,1,0,0].Try to predict new input vector p = [ − 0.5 , 0.2 ] T p=\left[ -0.5,0.2 \right] ^T p=[−0.5,0.2]T的目标值:
from sklearn.linear_model import Perceptron
import numpy as np
x0=np.array([[-0.5,-0.5,0.3,0.0],[-0.5,0.5,-0.5,1.0]]).T
y0=np.array([1,1,0,0])
md=Perceptron().fit(x0,y0)#Construction and fitting model
print("Model coefficients and constant term respectively:",md.coef_,",",md.intercept_)
print("模型精度:",md.score(x0,y0))#模型检验
print("预测值为:",md.predict([[-0.5,0.2]]))

Remember two indicators variables respectively x 1 , x 2 x_1,x_2 x1,x2,For the classification function was obtained v = − 1.3 x 1 − 0.5 x 2 v=-1.3x_1-0.5x_2 v=−1.3x1−0.5x2.New input vectorp的目标值为1
BP神经网络
BPNeural network is the biggest advantage is with strong nonlinear mapping ability,He is mainly used in the following four aspects:
- 函数逼近.With the input vector and the corresponding output vector training a network to approximate a function
- 模式识别
- 预测
- 数据压缩
BPNeural network specific process is as follows:
(1) 初始化,To the connection weight and threshold is given[-1,1]的随机值
(2) Choose a random pattern of X 0 = [ x 1 0 , x 2 0 . . . . x n 0 ] , Y 0 = [ y 1 0 , y 2 0 , . . . y n 0 ] X_0=\left[ x_{1}^{0},x_{2}^{0}....x_{n}^{0} \right] ,Y_0=\left[ y_{1}^{0},y_{2}^{0},...y_{n}^{0} \right] X0=[x10,x20....xn0],Y0=[y10,y20,...yn0]提供给网络
(3)用输入模式、连接权,And the value,计算中间层各单元的输入,然后用sThe middle layer through the calculation of living function of each unit output.
(4)With the output of the middle layer;连接权.And the broad terms of input output layer units,然后用.After activation function calculating the response of the output layer unitsd.
(5)With hope output mode、Network actual output calculation of generalization error output layer units..
(6)With connection powerg、Output layer of generalization error、中间层输出,Calculate the middle tier units generalization error
Yuan generalization errorc、The middle tier units output,修正连接权u,和阈值.Every unit input,Fixed connection weight and threshold.
(7)重新从mA learning model of randomly selected from a pattern of,Namely return step3,Until the network global error functionE小于预先设定的一个极小值,即网络收敛;Or study number is greater than the preset value,The network can't convergence
边栏推荐
猜你喜欢

59:第五章:开发admin管理服务:12:MongoDB的使用场景;(非核心数据,数据量比较大的非核心数据,人脸照片等隐私的小文件;)

论文《Deep Multifaceted Transformers for Multi-objective Ranking in Large-Scale E-commerce Recommender》

【图像去噪】基于matlab双立方插值和稀疏表示图像去噪【含Matlab源码 2009期】

埋点开发流程

【CV】OpenVINO安装教程

吃透Chisel语言.30.Chisel进阶之通信状态机(二)——FSMD:以Popcount为例

Splunk Filed extraction field interception

FormData upload binary file, object, object array

【ROS基础】map、odom、base_link、laser 的理解 及其 tf 树的理解

企业实训复现指导手册——基于华为ModelArts平台的OpenPose模型的训练和推理、基于关键点数据实现对攀爬和翻越护栏两种行为的识别、并完成在图片中只标注发生行为的人
随机推荐
LeetCode 2360. The longest cycle in a graph
Splunk Field Caculated Calculated Field
获取间隔的日期列表工具类
查看僵尸进程
docker 安装mysql
59:第五章:开发admin管理服务:12:MongoDB的使用场景;(非核心数据,数据量比较大的非核心数据,人脸照片等隐私的小文件;)
自然语言处理 文本预处理(上)(分词、词性标注、命名实体识别等)
Analysis of GCC compiler technology
在VMware上安装Metasploitable2
regular expression
图腾柱和推挽电路介绍
论文《Deep Multifaceted Transformers for Multi-objective Ranking in Large-Scale E-commerce Recommender》
C#重点问题之Struct和Class的异同
实例032:反向输出II
【红队】ATT&CK - 创建或修改系统进程实现持久化(更新ing)
LeetCode Algorithm 1374. 生成每种字符都是奇数个的字符串
【机器学习】实验5布置:AAAI会议论文聚类分析
正则表达式的理解学习
FormData upload binary file, object, object array
【机器学习】课程设计布置:某闯关类手游用户流失预测