首页 > 其他分享 >深度学习入门9787115485588 Chapter3

深度学习入门9787115485588 Chapter3

时间:2023-03-20 23:01:42浏览次数:36  
标签:function 9787115485588 入门 activation ReLU zero Chapter3 output input

explain the activation function in neural network with an actual case and demonstrate it in python code 

In a neural network, an activation function is used to introduce non-linearity into the output of a neuron. It is applied to the weighted sum of the inputs and biases in a neuron神经元, which produces the neuron's output.

One commonly used activation function is the Rectified Linear Unit (ReLU), which is defined as:

f(x) = max(0, x)

 

The ReLU function returns the input value if it is greater than zero, and returns zero otherwise. This means that the function is "activated" only when the input is positive, and otherwise it has no effect. This non-linear behavior allows the neural network to model more complex functions than a purely linear model.

Here's an example of how to implement ReLU activation in Python using NumPy:

import numpy as np

# Define the ReLU function
def relu(x):
    return np.maximum(0, x)

# Example input vector
x = np.array([-1, 2, 3, -4, 0])

# Apply ReLU activation
y = relu(x)

# Print the output
print(y)

In this example, we define the ReLU function using NumPy's maximum function, which returns the element-wise maximum of two arrays. We then apply the function to an example input vector x and print the output. The ReLU activation function will set any negative input values to zero, while leaving positive values unchanged.

  感知机的公式可以表示为 y=h(b+w1x1+w2x2)  式3.2   h(x)  式3.3 if x>0 h(x)=1 if x<=0  h(x)=0 h(x)将输入信号的总和转换为输出信号,这种函数一般称为激活函数activation function。     a=b+w1x1+w2x2  加权输入信号和偏置的总和。 y=h(a)  用h函数将a转换为输出y     上面的h表示的激活函数以阈值为界,一旦输入超过阈值,就切换输出。这样的函数称为阶跃函数。 因此,可以说感知机使用了阶跃函数作为激活函数。          

 

标签:function,9787115485588,入门,activation,ReLU,zero,Chapter3,output,input
From: https://www.cnblogs.com/chucklu/p/17238305.html

相关文章

  • 前端三剑客基础入门(html css js)
    首先对他们的在界面中的功用做一个说明HTML来决定界面的结构,CSS保证界面的美化,JS保证界面的效果/动作HTML1.HTML介绍HTML(HyperTextMarkupLanguage):超文本标记语......
  • RocketMQ入门探索以及踩坑
    前置说明以下环境使用centos7;没有任何已经启动的服务,8080端口未占用!下载解压rocketmq-all-5.1.0-bin-release.zip安装安装jdk1.8以上(略)配置环境变量>vi/etc/pro......
  • Pinyin4j入门教程
    <dependency><groupId>com.belerweb</groupId><artifactId>pinyin4j</artifactId><version>2.5.0</version></dependency>[c......
  • AVR64DD32Arduino 使用入门
    大神的教程FunPack4AVR64DD32使用入门ArduinoIDE手动安装开发板/库ArduinoIDE安装开发板依赖下载失败的情况ESP8266链接打开依赖http://drazzy.com/package_drazz......
  • python-运维开发-入门上
    一、Python快速入门上1.1python基础知识01python介绍python是一种面向对象、解释型、多用途设计语言,具有很丰富和强大的库,语法简介,强制用空格作为语法缩进,能够完成快......
  • Microsoft Project教程_编程入门自学教程_菜鸟教程-免费教程分享
    教程简介IT宝库MS项目入门教程-从基本概念开始,简单易学地学习MS项目,包括设置,简介,入门,创建新计划,设置资源,为任务分配资源,计划持续时间成本和时间,跟踪进度,高级计划,项目状......
  • Blender材质贴图入门图文教程
    推荐:将 ​​NSDT场景编辑器​​ 加入你的3D开发工具链大家好,今天跟大家分享Blender材质贴图入门图文教程,一套blender的PBR材质包,和HDRI环境纹理贴图,在文末领取,希望能助到......
  • 密码学SAT入门文献0——Using Walk-SAT and Rel-SAT for cryptographic key search
     FabioMassacci.1999.UsingWalk-SATandRel-SATforcryptographickeysearch.InIJCAI,Vol.1999.290–295.  本人的组织架构:第2节介绍一些关于密码......
  • Microsoft Access教程_编程入门自学教程_菜鸟教程-免费教程分享
    教程简介IT宝库整理的初学者MSAccess教程-从简单和简单的步骤学习MSAccess,从基本到高级概念,包括概述,RDBMS,对象,创建数据库,表,查询,关系,表单,数据类型,添加,查询,分组,汇总等示......
  • vue3 简单入门总结
    (vite+vue3)基础1.基础语法和传值问题//传值definePropsdefineEmits//父组件<template><div><Child:msg="userInfo.info"@change="change"/></Child><......