使用python学线性代数_最简单的神经网络简介| 使用Python的线性代数

使用python学线性代数

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. 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.

神经网络是机器学习中经常使用的强大工具,因为神经网络从根本上说是非常数学的。 我们将使用线性代数和NumPy的基础知识来理解使用神经网络进行机器学习的基础。 我们的文章展示了线性代数的应用,Python提供了广泛的库,有助于建立我们使用Python进行机器学习的动机。

The figure is showing the simplest neural network of two input nodes and one output node.

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

neural network


Simplest Neural Network: 2 Input - 1 Output Node

最简单的神经网络:2输入-1输出节点

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

输入到神经网络的是X 1X 2 ,它们相应的权重分别是w 1w 2 。 输出z是用于决策的正切双曲函数,其输入为输入与权重的乘积之和。 数学上

    z = tanh(X1w1 + X2w2)

Where, tanh() is an 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 range of 0 to 1.

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

Parameter(s):

参数:

    Vector X  = [[X1][X2]] and W = [[w1][w2]]

Return value:

返回值:

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

    金融科技

# Linear Algebra and Neural Network
# Linear Algebra Learning Sequence
# Simplest Neural Network for 2 input 1 output node
import numpy as np
# Use of np.array() to define an Input Vector
V = np.array([.323,.432])
print("The Vector A : ",V)
# defining Weight Vector
VV = np.array([.3,.63,])
print("\nThe Vector B : ",VV)
# 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(V,VV)
# printing the expected output
print("Expected Output of the given Input data and their respective Weight : ", outputi)

Output:

输出:

The Vector A :  [0.323 0.432]
The Vector B :  [0.3  0.63]
Expected Output of the given Input data and their respective Weight :  0.35316923056117167

翻译自: https://www.includehelp.com/python/introduction-to-simplest-neural-network.aspx

使用python学线性代数

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/380672.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

php七天登录,十天学会php之第七天

十天学会php之第七天推荐查看本文HTML版本学习目的:学会SESSION的使用SESSION的作用很多,最多用的就是站点内页面间变量传递。在页面开始我们要session_start();开启SESSION;然后就可以使用SESSION变量了,比如说要赋值就是…

电脑安装了mysql,但找不到mysql服务

首先找到mysql的bin文件目录,我的是在:C:\Program Files\mysql-5.7.27-winx64\bin 然后找到下图内容,右键以管理者身份运行 然后cd 到mysql的bin目录 在输入mysqld -install 服务就重启好了

Item 34. Restricting Heap Allocation

Item 34. Restricting Heap Allocation1、什么情况下要限制堆分配?假如一个句柄对象("handle" object )维护了一个体对象("body" object)的引用数量,就需要确保对象的析构函数调用。局…

Web Service 缓存

由于微软的Web service实现是基于Asp.net,所以会出现缓存也就在情理之中了.主要有2中缓存:输出缓存和数据缓存.由于Web Service的缓存管理与asp.net基本是一样的,就不说他的原理,主要说一下在Web service中是如何实现的. 输出缓存 实现方法是在WebMethod这个特性里面加一个属性…

在JavaScript中使用示例继续语句

JavaScript继续声明 (JavaScript continue statement) continue is a keyword in JavaScript, it is used with the looping statements to continue the loops iteration. continue是JavaScript中的关键字,它与循环语句一起使用以继续循环的迭代。 When a continu…

php title限制字数,dedecms:title解决字数限制的两种方法

织梦title字数怎样限制呢?相信对织梦cms熟悉的朋友来说,这真不是一个问题。当然了,有些方法并不能通用,在特殊情况下,是没有效果的哦。好了,别的不说了,给大家贴两种常用的方法吧。织梦cms限制t…

win10安装masm32 SDK并运行一个小程序

建议在安装之前,先装一下notepad编辑器(其他也行),Visual C 首先我们到官网下载masm32(http://www.masm32.com/),到了官网后,点击download就行了。 随便点一个就可以了。 将zip文件解压&#…

怎样改进数据库的查询性能?

数据库的查询功能,其性能终究是有限的。即使我们对数据库进行了最优配置,对数据表设计再三斟酌,然而一旦面临海量数据,且返回结果集较大的时候,常规的查询语句就无能为力了。一般说来,当返回的结果集超过总…

MySQL Show命令的使用

MySQL Show命令的使用 show tables或show tables from database_name; 解释:显示当前数据库中所有表的名称 show databases; 解释:显示mysql中所有数据库的名称 show processlist; 解释:显示系统中正在运行的所有进程,也就是当前正…

Python | Lambda和map()与示例

The map() function is used to apply the function to all items of an iterable collection like list, tuple etc and it returns the list of the result after performing the functionality defined in the applied function. map()函数用于将函数应用于可迭代集合的所有…

win10系统,在安装masm32的时候出现DELETE operation of EXE file has failed 解决方案

在安装之前,要将所有的像360安全管家、火绒等安全类软件关闭 官网在介绍安装masm32时说到: MASM32 SDK是开发软件,必须安装在属性配置的计算机上,否则由于安全或操作系统设置,可能会阻止安装完全安装。您不应该尝试在计…

matlab figure 嵌套,操作Matlab的Figure窗口(一)

以前,我和很多人一样,总是将数据保存到mat文件中。后来突然发现,如果数据量不大的话,直接将Figure窗口中的图形保存为fig文件是更好的选择。fig文件与一般的图像文件不同,并不是由图像的像素构成,它包含了当…

令人兴奋的好消息(2005-6-7)

从今天起(也可能是昨天)用Google也可以搜到我的Blog了,很高兴,以后流量会更大的拉我测了一下Google搜索关键字及排名搜“乖狗狗” 排名:第八搜“誓言不会融化的那个夏天” 排名:第一搜“Using NameSpace …

struts2自定义拦截器一——模拟登陆权限验证

1、http://localhost:8083/struts2/user.jsp 表示用户已登陆,存放session对象 2、http://localhost:8083/struts2/quit.jsp 表示用户已退出,移除session对象 3、http://localhost:8083/struts2/login/addUIHelloWorld.do 如果session存在则往下执行&…

c语言中fflush函数z_带有示例的C语言fflush()函数

c语言中fflush函数zC中的fflush()函数 (fflush() function in C) Prototype: 原型: int fflush(FILE *filename);Parameters: 参数: FILE *filenameReturn type: 0 or EOF 返回类型: 0或EOF Use of function: 使用功能: When …

masm32使用nmake工具

nmake.exe如果你安装了Visual C你可以在bin文件目录下找到,然后复制到masm32的bin目录下,如果没有安装visual C就百度下一个吧! 使nmake之前,我们的.obj和.res文件都创建好了,在工程建一个文件Makefile,不需要后缀 里面内容填&am…

SQL Server 2005 中的商务智能和数据仓库

SQL Server 2005 中的商务智能和数据仓库 发布日期: 2005年03月11日摘要:本文概述了 SQL Server 2005 Beta 2 中“商务智能”平台的增强功能。本文并非实施指南,而是为读者提供了关于“商务智能”平台增强功能的信息。本页内容 简介SQL Serve…

doublevalue_Java Integer类doubleValue()方法与示例

doublevalue整数类doubleValue()方法 (Integer class doubleValue() method) doubleValue() method is available in java.lang package. doubleValue()方法在java.lang包中可用。 doubleValue() method is used to return the value denoted by this Integer object converted…

MVVM实践教程

算算,从事Silverlight和WPF的开发也有1年多的时间了,虽然时间不算长,虽然还没有突出的成就,但是感觉也还算一般。 但是,从头至今都没有去认真研究和使用过MVVM,虽然它被认为是Silverlight和WPF开发的最佳架…

32位通用寄存器ESP、EIP、EAX、EBX、ECX、EDX,在OD里操作这些寄存器

EIP:指向CPU下一步即将执行的指令 I EIP为00401000,表示,CPU下一步到00401000这个地址去执行,下一步执行push 0x0指令 ESP:始终指向堆栈的最顶端 现在的ESP是0012FFC4,现在堆栈的顶部在这个地址 EAX、EBX、…