当前位置:网站首页>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
边栏推荐
- 2022年数据泄露平均成本高达435万美元,创历史新高!
- SQL server 2014 怎么一次性导出多个查询结果?
- 以训辅教,以战促学 | 新版攻防世界平台正式上线运营!
- A Preliminary Study on the Basic Principles of Formal Methods
- Agile, DevOps and Embedded Systems Testing
- OC-NSDictionary
- LeetCode Algorithm 1374. 生成每种字符都是奇数个的字符串
- OC-NSArray
- 初探形式化方法基本原理
- 【ROS基础】map、odom、base_link、laser 的理解 及其 tf 树的理解
猜你喜欢
FaceBook社媒营销高效转化技巧分享
企业实训复现指导手册——基于华为ModelArts平台的OpenPose模型的训练和推理、基于关键点数据实现对攀爬和翻越护栏两种行为的识别、并完成在图片中只标注发生行为的人
以训辅教,以战促学 | 新版攻防世界平台正式上线运营!
实例027:递归输出
雷达人体存在感应器方案,智能物联网感知技术,实时感应人体存在
A Preliminary Study on the Basic Principles of Formal Methods
(2022牛客多校五)B-Watches(二分)
Xilinx约束学习笔记—— 时序约束
实例029:反向输出
张驰课堂:六西格玛测量系统的误差分析与判定
随机推荐
OC-NSDictionary
埋点开发流程
MySQL-慢查询日志
(2022牛客多校五)C-Bit Transmission(思维)
问个问题,我的Flinkcdc已经跑通了,可以监听msql的binlog了,也能发送kafk
gdalinfo: error while loading shared libraries: libgdal.so.30: cannot open shared object file: No su
【网络】IP、子网掩码
【CNN回归预测】基于matlab卷积神经网络CNN数据回归预测【含Matlab源码 2003期】
实例029:反向输出
带手续费买卖股票的最大利益[找DP的状态定义到底缺什么?]
Find the largest n files
主流定时任务解决方案全横评
暑假第五周总结
FaceBook社媒营销高效转化技巧分享
获取间隔的日期列表工具类
System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志。不可 访问的日志: Security
LeetCode 2360. The longest cycle in a graph
初探形式化方法基本原理
第06章 索引的数据结构【2.索引及调优篇】【MySQL高级】
队列题目:无法吃午餐的学生数量