单层神经网络线性回归

A neural network is a powerful tool often utilized in Machine Learning because neural networks are fundamentally very mathematical. We will use our basics of Linear Algebra and NumPy to understand the foundation of Machine Learning using Neural Networks.

神经网络是机器学习中经常使用的强大工具,因为神经网络从根本上说是非常数学的。 我们将使用线性代数和NumPy的基础知识来理解使用神经网络进行机器学习的基础。

Our article is a showcase of the application of Linear Algebra and, Python provides a wide set of libraries that help to build our motivation of using Python for machine learning.

我们的文章展示了线性代数的应用,Python提供了广泛的库,有助于建立我们使用Python进行机器学习的动机。

The figure is showing a neural network with multi-input and one output node.

该图显示了一个具有多输入和一个输出节点的神经网络。

Input to the neural network is X1, X2,  X3……... Xn and their corresponding weights are w1, w2, w3………..wn respectively. The output z is a tangent hyperbolic function for decision making which has input as the sum of products of Input and Weight.

输入到神经网络的是X 1X 2 X 3 ……... X n ,它们的相应权重分别是w 1w 2 ,w 3 ………..w n 。 输出z是决策的切线双曲函数,其输入为输入与权重的乘积之和。

Mathematically,  z = tanh(∑ Xiwi)

数学上z = tanh(∑ X i w i )

Where tanh( ) is an tangent hyperbolic function (Refer article Linear Algebra | Tangent Hyperbolic Function) because it is one of the most used decision-making functions.

其中tanh()是切线双曲函数(请参阅线性代数|切线双曲函数),因为它是最常用的决策函数之一。

So for drawing this mathematical network in a python code by defining a function neural_network( X, W). Note: The tangent hyperbolic function takes input within the range of 0 to 1.

因此,通过定义函数Neuro_network(X,W)以python代码绘制此数学网络。 注意:切线双曲函数的输入范围为0到1。

Input parameter(s): Vector X and W

输入参数:向量XW

Return: A value ranging between 0 and 1, as a prediction of the neural network based on the inputs.

返回一个介于0到1之间的值,作为基于输入的神经网络的预测。

Application:

应用:

  1. Machine Learning

    机器学习

  2. Computer Vision

    计算机视觉

  3. Data Analysis

    数据分析

  4. Fintech

    金融科技

单层神经网络的Python程序 (Python program for Uni - Layer Neural Network)

#Linear Algebra and Neural Network
#Linear Algebra Learning Sequence
import numpy as np
#Use of np.array() to define an Input Vector
inp = np.array([0.323, 0.432, 0.546, 0.44, 0.123, 0.78, 0.123])
print("The Vector A : ",inp)
#defining Weight Vector
weigh = np.array([0.3, 0.63, 0.99, 0.89, 0.50, 0.66, 0.123])
print("\nThe Vector B : ",weigh)
#defining a neural network for predicting an output value
def neural_network(inputs, weights):
wT = np.transpose(weights)
elpro = wT.dot(inputs)
#Tangent Hyperbolic Function for Decision Making
out = np.tanh(elpro)
return out
outputi = neural_network(inp,weigh)
#printing the expected output
print("\nExpected Output of the given Input data and their respective Weight : ", outputi)

Output:

输出:

The Vector A :  [0.323 0.432 0.546 0.44  0.123 0.78  0.123]
The Vector B :  [0.3   0.63  0.99  0.89  0.5   0.66  0.123]
Expected Output of the given Input data and their respective Weight :  0.9556019596251646

翻译自: https://www.includehelp.com/python/uni-layer-neural-network.aspx

单层神经网络线性回归

单层神经网络线性回归_单层神经网络| 使用Python的线性代数相关推荐

  1. 神经网络推理_分析神经网络推理性能的新工具

    神经网络推理 Measuring the inference time of a trained deep neural model on different hardware devices is ...

  2. 人工神经网络 神经网络区别_人工神经网络概述

    人工神经网络 神经网络区别 Artificial neural networks (ANN) in machine learning (artificial intelligence) are com ...

  3. 使用python学线性代数_二项式过程| 使用Python的线性代数

    使用python学线性代数 When we flip a coin, there are two possible outcomes as head or tail. Each outcome has ...

  4. python深度神经网络量化_深度神经网络数据集大小

    问题描述 我的数据集才一千多个,是不是用深度神经网络的模型,不够,容易欠拟合 问题出现的环境背景及自己尝试过哪些方法 我之前的训练参照了两层的CIFAR卷积层测试了 用1000次迭代 每次10batc ...

  5. python 卷积神经网络 应用_卷积神经网络概述及python实现

    摘要:本文概括地介绍CNN的基本原理 ,并通过阿拉伯字母分类例子具体介绍其实现过程,理论与实践的结合体. 对于卷积神经网络(CNN)而言,相信很多读者并不陌生,该网络近年来在大多数领域都表现优异,尤其 ...

  6. python 卷积神经网络猫狗大战_卷积神经网络入门(1) 识别猫狗

    按照我的理解,CNN的核心其实就是卷积核的作用,只要明白了这个问题,其余的就都是数学坑了(当然,相比较而言之后的数学坑更难). 如果学过数字图像处理,对于卷积核的作用应该不陌生,比如你做一个最简单的方 ...

  7. 模块说和神经网络学说_让神经网络解释自己:牛津大学博士小姐姐,用毕业论文揭示“炼丹炉”结构...

    萧箫 发自 凹非寺 量子位 报道 | 公众号 QbitAI 神经网络就像"炼丹炉"一样,投喂大量数据,或许能获得神奇的效果. "炼丹"成功后,神经网络也能对没见 ...

  8. python梯度下降法实现线性回归_梯度下降法的python代码实现(多元线性回归)

    梯度下降法的python代码实现(多元线性回归最小化损失函数) 1.梯度下降法主要用来最小化损失函数,是一种比较常用的最优化方法,其具体包含了以下两种不同的方式:批量梯度下降法(沿着梯度变化最快的方向 ...

  9. 卷积神经网络流程图_卷积神经网络

    卷积操作 % ------------------------------------ %关于卷积操作 % % date 2019/05/14 % by Dufy % % -------------- ...

最新文章

  1. OpenCV代码提取:transpose函数的实现
  2. Function in loop and closure
  3. 【Spring】12、Spring Security 四种使用方式
  4. stm8s003程序跑飞_A股要大跌?跑不跑就看明天……
  5. 北斗导航 | 卫星导航在动态监测中的应用(RTK)
  6. drbd实现mysql地热备_heartheartbeat+drbd+mysql主库热备
  7. 来了就不会空着手回去.
  8. 无法从套接字读取更多的数据 oracle_小伙面试时被追问数据库优化,面试前如何埋点反杀?
  9. sphinx 字符串转html,在Pycharm中获取Sphinx,以将我的文档字符串包含在生成的html中...
  10. 编程杂谈---vb,vb.net,java数据类型区分
  11. mysql8.0 linux 安装
  12. 计算机办公软件考证教学总结,考证经历——办公软件的套路
  13. U盘启动盘,启动时报错Failed to load ldlinux.c32的解决办法
  14. 【AlphaGo论文学习】Mastering the game of Go without human knowledge翻译及心得
  15. 3ds Max 2014插件安装(插件无效的原因~)
  16. Java-简易加法计算器代码优化
  17. 弹弹堂弹道模拟程序——第一帖
  18. 【微前端】微前端——功能团队中缺失的一块拼图
  19. oralce 递归查询语句
  20. 【NVMe2.0b 2】NVMe 结构理论

热门文章

  1. android 资源如何下沉,关于Android业务模块下沉的一些实践及总结
  2. val_loss突然变很大_女朋友突然变得很冷淡是怎么回事?该怎么办
  3. oracle的buffercache
  4. 问题 B: 调整表中元素顺序(线性表)
  5. 算法导论2nd 10.1-7
  6. 持续集成之 Spring Boot 实战篇
  7. HDU 4812 D Tree
  8. TOP命令监视系统任务及掩码umask的作用
  9. [java] 找出字符串中出现最多的字符和出现的次数
  10. 让zabbix图像中文不再是乱码