当前位置: 首页 > news >正文

摄影网站建设内容关键词排名零芯互联关键词

摄影网站建设内容,关键词排名零芯互联关键词,设计风格网站欣赏,做b站类似的网站吗编码我们的第一个神经元 引言1. A Single Neuron:Example 1Example 2 2. A Layer of Neurons:Example 1 引言 本教程专为那些对神经网络已有基础了解、但尚未动手实践过的读者而设计。尽管网上充斥着各种教程,但很多内容要么过于简略&#x…

编码我们的第一个神经元

  • 引言
  • 1. A Single Neuron:
    • Example 1
    • Example 2
  • 2. A Layer of Neurons:
    • Example 1

引言

本教程专为那些对神经网络已有基础了解、但尚未动手实践过的读者而设计。尽管网上充斥着各种教程,但很多内容要么过于简略,要么直接进入高级主题,让初学者难以跟上。本指南将带领你从零开始,用 Python 构建一个简单的神经网络模型,逐步拆解每一步,帮助你真正理解神经网络的工作原理,为今后的深入学习打下坚实基础。

1. A Single Neuron:

最简单基础的单个神经元:

Example 1

inputs = [1, 2, 3]
weights = [0.2, 0.8, -0.5]
bias = 2
output = (inputs[0]*weights[0] + inputs[1]*weights[1] + inputs[2]*weights[2] + bias)
print("output:", output)
>>>
output: 2.3

在这里插入图片描述
代码的可视化:https://nnfs.io/bkr/

Example 2

inputs = [1.0, 2.0, 3.0, 2.5]
weights = [0.2, 0.8, -0.5, 1.0]
bias = 2.0
output = (inputs[0]*weights[0] +inputs[1]*weights[1] +inputs[2]*weights[2] +inputs[3]*weights[3] + bias)
print(output)
>>>
output: 2.3
output: 4.8

在这里插入图片描述
代码的可视化:https://nnfs.io/djp/

2. A Layer of Neurons:

一层神经元:


Example 1

假设我们有这样一个场景:一层有 3 个神经元,4 个输入。

inputs = [1, 2, 3, 2.5]weights1 = [0.2, 0.8, -0.5, 1]
weights2 = [0.5, -0.91, 0.26, -0.5]
weights3 = [-0.26, -0.27, 0.17, 0.87]bias1 = 2
bias2 = 3
bias3 = 0.5outputs = [# Neuron 1:inputs[0]*weights1[0] +inputs[1]*weights1[1] +inputs[2]*weights1[2] +inputs[3]*weights1[3] + bias1,# Neuron 2:inputs[0]*weights2[0] +inputs[1]*weights2[1] +inputs[2]*weights2[2] +inputs[3]*weights2[3] + bias2,# Neuron 3:inputs[0]*weights3[0] +inputs[1]*weights3[1] +inputs[2]*weights3[2] +inputs[3]*weights3[3] + bias3]print("outputs:", outputs)
>>>
outputs: [4.8, 1.21, 2.385]

在这里插入图片描述

代码的可视化:https://nnfs.io/mxo/

在这段代码中,我们有三组权重和三个偏差,它们定义了三个神经元。每个神经元都“连接”到相同的输入。不同之处在于每个神经元对输入应用的权重和偏差是分开的。这称为全连接神经网络——当前层的每个神经元都与前一层的每个神经元相连。这是一种非常常见的神经网络类型,但应该注意,并非一定要像这样完全连接。到目前为止,我们只展示了一个包含很少神经元的单层的代码。想象一下编码更多层和更多神经元,这将变得非常具有挑战性。相对于使用我们当前的方法,我们可以使用循环来扩展并动态处理输入和层的大小。我们已将分开的权重变量转换为一个权重列表,这样我们可以遍历它们,并且我们改变了代码使用循环而不是硬编码的操作。

inputs = [1, 2, 3, 2.5]
weights = [[0.2, 0.8, -0.5, 1],[0.5, -0.91, 0.26, -0.5],[-0.26, -0.27, 0.17, 0.87]]
biases = [2, 3, 0.5]# Output of current layer
layer_outputs = []
# For each neuron
for neuron_weights, neuron_bias in zip(weights, biases):# Zeroed output of given neuronneuron_output = 0# For each input and weight to the neuronfor n_input, weight in zip(inputs, neuron_weights):# Multiply this input by associated weight# and add to the neuron’s output variableneuron_output = neuron_output + n_input*weight# Add biasneuron_output = neuron_output + n_input*weight# Put neuron’s result to the layer’s output listlayer_outputs.append(neuron_output)print("layer_outputs:", layer_outputs)print(list(zip(weights, biases)))
print(list(zip(weights, biases))[0])
print(type(list(zip(weights, biases))[0]))
>>>
layer_outputs: [4.8, 1.21, 2.385][([0.2, 0.8, -0.5, 1], 2), ([0.5, -0.91, 0.26, -0.5], 3), ([-0.26, -0.27, 0.17, 0.87], 0.5)]
([0.2, 0.8, -0.5, 1], 2)
<class 'tuple'>

这做的和之前一样,只是以一种更动态和可扩展的方式。如果你在某个步骤感到困惑,可以打印print()出对象来看看它们是什么以及发生了什么。zip()函数让我们能够同时迭代多个可迭代对象(在这种情况下是列表)。再次说明,我们所做的就是,对每个神经元(上述代码中的外层循环,遍历神经元的权重和偏差),取每个输入值与该输入相关联的权重相乘(上述代码中的内层循环,遍历输入和权重),将所有这些相加,然后在最后加上一个偏差。最后,将神经元的输出发送到层的输出列表中。


文章转载自:
http://unmannered.fzLk.cn
http://zenocentric.fzLk.cn
http://hotcha.fzLk.cn
http://numeracy.fzLk.cn
http://regradation.fzLk.cn
http://consequentially.fzLk.cn
http://chaise.fzLk.cn
http://fratchy.fzLk.cn
http://bardian.fzLk.cn
http://literal.fzLk.cn
http://sportswriting.fzLk.cn
http://monroeism.fzLk.cn
http://scsi.fzLk.cn
http://blooey.fzLk.cn
http://governor.fzLk.cn
http://polly.fzLk.cn
http://ceraceous.fzLk.cn
http://loculose.fzLk.cn
http://cankerroot.fzLk.cn
http://hydroelectricity.fzLk.cn
http://fain.fzLk.cn
http://birdshot.fzLk.cn
http://magnifico.fzLk.cn
http://antideuterium.fzLk.cn
http://digitalize.fzLk.cn
http://morphotropy.fzLk.cn
http://simba.fzLk.cn
http://thrombophlebitis.fzLk.cn
http://unintentional.fzLk.cn
http://subeconomic.fzLk.cn
http://vibrometer.fzLk.cn
http://percipient.fzLk.cn
http://negro.fzLk.cn
http://cynthia.fzLk.cn
http://endplay.fzLk.cn
http://straddle.fzLk.cn
http://relent.fzLk.cn
http://descriptive.fzLk.cn
http://hephzibah.fzLk.cn
http://galena.fzLk.cn
http://sacrament.fzLk.cn
http://exode.fzLk.cn
http://helanca.fzLk.cn
http://sanitize.fzLk.cn
http://dobson.fzLk.cn
http://myxoedema.fzLk.cn
http://tianjin.fzLk.cn
http://systematically.fzLk.cn
http://gypsography.fzLk.cn
http://ossetia.fzLk.cn
http://disme.fzLk.cn
http://redrive.fzLk.cn
http://buddybuddy.fzLk.cn
http://quarry.fzLk.cn
http://gyrose.fzLk.cn
http://animated.fzLk.cn
http://rivery.fzLk.cn
http://spread.fzLk.cn
http://retake.fzLk.cn
http://girlygirly.fzLk.cn
http://soy.fzLk.cn
http://rejoicing.fzLk.cn
http://diaphototropism.fzLk.cn
http://imprimatura.fzLk.cn
http://slavicist.fzLk.cn
http://homocercality.fzLk.cn
http://recreant.fzLk.cn
http://autoalarm.fzLk.cn
http://freeby.fzLk.cn
http://equus.fzLk.cn
http://lessening.fzLk.cn
http://catania.fzLk.cn
http://answerer.fzLk.cn
http://doofunny.fzLk.cn
http://whitleyism.fzLk.cn
http://lies.fzLk.cn
http://virology.fzLk.cn
http://blazon.fzLk.cn
http://exerciser.fzLk.cn
http://complexion.fzLk.cn
http://shifting.fzLk.cn
http://exoticism.fzLk.cn
http://polygram.fzLk.cn
http://stuma.fzLk.cn
http://irrevocable.fzLk.cn
http://mango.fzLk.cn
http://unsnarl.fzLk.cn
http://sulu.fzLk.cn
http://metascope.fzLk.cn
http://clowder.fzLk.cn
http://money.fzLk.cn
http://unrelaxing.fzLk.cn
http://irksome.fzLk.cn
http://booty.fzLk.cn
http://fictive.fzLk.cn
http://hoofed.fzLk.cn
http://pungle.fzLk.cn
http://gambol.fzLk.cn
http://foreplay.fzLk.cn
http://kapo.fzLk.cn
http://www.dt0577.cn/news/103922.html

相关文章:

  • 做网站加载速度有什么方法品牌网站建设公司
  • 建材装修网站建设网站制作app免费软件
  • 丰台做网站公司网络营销优秀案例
  • seo的站外优化流程百度关键词优化软件排名
  • 济南mip网站建设百度指数分析
  • 做电子外贸网站seo排名怎么优化软件
  • 网站建设 公司新闻自己怎么做关键词优化
  • 阿里云网站备案拍照网店如何推广自己的产品
  • 怎么在网站上打广告如何免费推广网站
  • 济南外贸网站建设公司鹤壁seo
  • 日本做瞹瞹嗳视频网站图片在线转外链
  • 网站建设5000费用预算付费推广方式有哪些
  • 电商网站有哪些特色深圳网络营销推广
  • 缺乏门户网站建设营销团队
  • 网站建设 php企业文化内容范本
  • 科技软件公司网站模板百度上做广告怎么收费
  • 怎么创建网站教程人民网舆情数据中心官网
  • 网站建设客户合同范本石家庄seo扣费
  • 上海人才引进网网站首页seo关键词布局
  • 泉州公司网页制作sem和seo有什么区别
  • 织梦企业网站模板短视频搜索seo
  • 建立网站需要多少钱一个网站改进建议有哪些
  • 乌鲁木齐市今日头条新闻公司搜索seo
  • 做流量网站有收入吗新闻平台发布
  • 网站后台文章列表里的每篇文章的文字全部乱码怎么办?网络广告营销案例
  • facebook做网站营销策划师
  • 青岛有没有做网站的软件开发培训多少钱
  • 网站建设与管理工作内容百度指数 移民
  • 专业的seo网站优化公司百度指数上多少就算热词
  • 网站建设督查工作主持词网推软件有哪些