经典神经网络架构参考 v1.0(4)

简介: 经典神经网络架构参考 v1.0

经典神经网络架构参考 v1.0(3)https://developer.aliyun.com/article/1489285

4.4 卷积自编码器

主体:

digraph ConvAutoEncoder {
  rankdir=BT
    node [
    style=filled, 
    color=Black
    fontcolor=White, 
    fillcolor="#30638e", 
    fontname="SimHei",
    fontsize=32,
    width=5, height=2,
    shape="box",
  ]
  
  
  inp         [label="输入\n[BatchSize,\n W=256, H=256, C=3]", shape="Mrecord"]
  conv1       [label="ConvBlock1\n[In=3, Out=16]"]
  featmap_e1  [label="[BatchSize,\nW=128, H=128, C=16]", shape="Mrecord"]
  conv2       [label="ConvBlock2\n[In=16, Out=32]"]
  featmap_e2  [label="[BatchSize,\nW=64, H=64, C=32]", shape="Mrecord"]
  conv3       [label="ConvBlock3\n[In=32, Out=32]"]
  featmap_e3  [label="[BatchSize,\nW=32, H=32, C=32]", shape="Mrecord"]
  upconv3     [label="UpConvBlock3\n[In=32, Out=32]"]
  featmap_d2  [label="[BatchSize,\nW=64, H=64, C=32]", shape="Mrecord"]
  upconv2     [label="UpConvBlock2\n[In=32, Out=16]"]
  featmap_d1  [label="[BatchSize,\nW=128, H=128, C=16", shape="Mrecord"]
  upconv1     [label="UpConvBlock1\n[In=16, Out=3]"]
  tanh        [label="Tanh"]
  oup         [label="输出\n[BatchSize,\n W=256, H=256, C=3]", shape="Mrecord"]
  inp -> conv1 -> featmap_e1 -> conv2 -> featmap_e2
        -> conv3 -> featmap_e3 -> upconv3 -> featmap_d2
        -> upconv2 -> featmap_d1 -> upconv1
        -> tanh -> oup 
}

卷积块:

digraph CAEConvBlock {
  rankdir=BT
    node [
    style=filled, 
    color=Black
    fontcolor=White, 
    fillcolor="#30638e", 
    fontname="SimHei",
    fontsize=32,
    width=5, height=2,
    shape="box",
  ]
  
  
  inp         [label="输入\n[BatchSize,\n W=BlockW,\n H=BlockH,\n C=BlockIn]", shape="Mrecord"]
  conv        [label="Conv2D\n[K=3, P=1,\n In=BlockIn,\n Out=BlockOut]"]
  batchnorm   [label="BatchNorm(BlockOut)"]
    relu        [label="Relu"]
    maxpool     [label="MaxPool2D\n[K=2, S=2]"]
  oup         [label="输出\n[BatchSize,\n W=BlockW/2,\n H=BlockH/2,\n C=BlockOut]", shape="Mrecord"]
  inp -> conv -> batchnorm -> relu -> maxpool -> oup 
}

反卷积块:

digraph CAEDeconvBlock {
  rankdir=BT
    node [
    style=filled, 
    color=Black
    fontcolor=White, 
    fillcolor="#30638e", 
    fontname="SimHei",
    fontsize=32,
    width=5, height=2,
    shape="box",
  ]
  
  
  inp         [label="输入\n[BatchSize,\n W=BlockW,\n H=BlockH,\n C=BlockIn]", shape="Mrecord"]
    upsamp      [label="UpSample x2"]
  conv        [label="Conv2D\n[K=3, P=1,\n In=BlockIn,\n Out=BlockOut]"]
  batchnorm   [label="BatchNorm(BlockOut)"]
    relu        [label="Relu"]
  oup         [label="输出\n[BatchSize,\n W=BlockW*2,\n H=BlockH*2,\n C=BlockOut]", shape="Mrecord"]
  inp -> upsamp -> conv -> batchnorm -> relu -> oup 
}

五、循环神经网络

5.1 时序 RNN

digraph TimeRNN {
  rankdir=BT
    node [
    style=filled, 
    color=Black
    fontcolor=White, 
    fillcolor="#30638e", 
    fontname="SimHei",
    fontsize=32,
    width=5, height=2,
    shape="box",
  ]
  
  
  inp      [label="输入\n[BatchSize,\n SeqLen, NFeature]", shape="Mrecord"]
    rnn1     [label="RNNCell1\n[NFeature, NHidden]"]
    rnn_rest [label="RNNCell x (NLayers-1)\n[NHidden, NHidden]"]
    hidst    [label="[BatchSize,\n SeqLen, NHidden]", shape="Mrecord"]
  ll       [label="Linear\n[NHidden, NLabels]"]
  oup      [label="输出\n[BatchSize,\n SeqLen, NLabels]", shape="Mrecord"]
  
  inp -> rnn1 -> rnn_rest -> hidst -> ll -> oup
}

5.2 NLP RNN

digraph NLPRNN {
  rankdir=BT
    node [
    style=filled, 
    color=Black
    fontcolor=White, 
    fillcolor="#30638e", 
    fontname="SimHei",
    fontsize=32,
    width=5, height=2,
    shape="box",
  ]
  
  
  inp      [label="输入(单词ID)\n[BatchSize, SeqLen]", shape="Mrecord"]
  emb      [label="Embedding\n[VocabSize, NHidden]"]
  inp_emb  [label="[BatchSize,\n SeqLen, NHidden]", shape="Mrecord"]
    rnn      [label="RNNCell x NLayers\n[NHidden, NHidden]"]
    hidst    [label="[BatchSize,\n SeqLen, NHidden]", shape="Mrecord"]
  emb_w_t  [label="@ Embedding.w.T\n[NHidden, VocabSize]"]
  oup      [label="输出(单词概率)\n[BatchSize,\n SeqLen, VocabSize]", shape="Mrecord"]
  
  inp -> emb -> inp_emb -> rnn -> hidst -> emb_w_t -> oup
}
• 1
• 2
• 3
• 4
• 5
• 6
• 7
• 8
• 9
• 10
• 11
• 12
• 13
• 14
• 15
• 16
• 17
• 18
• 19
• 20
• 21
• 22
• 23
• 24

5.3 RNN 单元

digraph RNNCell {
  rankdir=BT
    node [
    style=filled, 
    color=Black
    fontcolor=White, 
    fillcolor="#30638e", 
    fontname="SimHei",
    fontsize=32,
    width=5, height=2,
    shape="box",
  ]
    x [label="X[t](输入)\n[BatchSize, NIn]", shape="Mrecord"]
    his [label="H[t-1](历史)\n[BatchSize, NOut]", shape="Mrecord"]
    w_x [label="W(参数)\n[NIn, NOut]", shape="Mrecord"]
    w_h [label="U(参数)\n[NOut, NOut]", shape="Mrecord"]
    b   [label="b(参数)\n[1, NOut]", shape="Mrecord"]
    σ   [label="Sigmoid"]
    matmul1 [label="@"]
    matmul2 [label="@"]
    plus  [label="+"]
    h   [label="H[t](输出)\n[BatchSize, NOut]", shape="Mrecord"]
    x -> matmul1
    w_x -> matmul1
    his -> matmul2
    w_h -> matmul2
    matmul1 -> plus
    matmul2 -> plus
    b -> plus
    plus -> σ
    σ -> h
}

5.4 LSTM 单元

digraph GRUCell {
  rankdir=BT
    node [
    style=filled, 
    color=Black
    fontcolor=White, 
    fillcolor="#30638e", 
    fontname="SimHei",
    fontsize=32,
    width=5, height=2,
    shape="box",
  ]
    x [label="X[t](输入)\n[BatchSize, NIn]", shape="Mrecord"]
    his_h [label="H[t-1](短期历史)\n[BatchSize, NOut]", shape="Mrecord"]
    his_c [label="C[t-1](长期历史)\n[BatchSize, NOut]", shape="Mrecord"]
    
    calc_f [label="σ(X[t] @ W[f]\n + H[t-1] @ U[f]\n + b[f])"]
    calc_i [label="σ(X[t] @ W[i]\n + H[t-1] @ U[i]\n + b[i])"]
    calc_c_cand [label="tanh(X[t] @ W[c]\n + H[t-1] @ U[c]\n + b[c])"]
    calc_o [label="σ(X[t] @ W[o]\n + H[t-1] @ U[o]\n + b[o])"]
    
    f   [label="F[t](遗忘门)\n[BatchSize, NOut]", shape="Mrecord"]
    i   [label="I[t](记忆门)\n[BatchSize, NOut]", shape="Mrecord"]
    c_cand   [label="CCand[t](长期候补)\n[BatchSize, NOut]", shape="Mrecord"]
    o   [label="O[t](输出门)\n[BatchSize, NOut]", shape="Mrecord"]
    calc_c [label="F[t] * C[t-1]\n + I[t] * CCand[t]"]
    calc_h [label="C[t] * tanh(O[t])"]
    h [label="H[t](输出&短期记忆)\n[BatchSize, NOut]", shape="Mrecord"]
    c [label="C[t](长期记忆)\n[BatchSize, NOut]", shape="Mrecord"]
    x -> calc_f
    x -> calc_i
    x -> calc_c_cand
    x -> calc_o
    his_h -> calc_f -> f
    his_h -> calc_i -> i
    his_h -> calc_c_cand -> c_cand
    his_h -> calc_o -> o
    f -> calc_c
    i -> calc_c
    c_cand -> calc_c
    calc_c -> c
    c -> calc_h
    o -> calc_h
    calc_h -> h
}

5.5 GRU 单元

digraph LSTMCell {
  rankdir=BT
    node [
    style=filled, 
    color=Black
    fontcolor=White, 
    fillcolor="#30638e", 
    fontname="SimHei",
    fontsize=32,
    width=5, height=2,
    shape="box",
  ]
    x [label="X[t](输入)\n[BatchSize, NIn]", shape="Mrecord"]
    his_h [label="H[t-1](历史)\n[BatchSize, NOut]", shape="Mrecord"]
    
    calc_z [label="σ(X[t] @ W[z]\n + H[t-1] @ U[x]\n + b[z])"]
    calc_r [label="σ(X[t] @ W[r]\n + H[t-1] @ U[r]\n + b[r])"]
    calc_h_cand [label="tanh(X[t] @ W[h]\n + (H[t-1] * R[t]) @ U[h]\n + b[h])"]
    
    z   [label="Z[t](更新门)\n[BatchSize, NOut]", shape="Mrecord"]
    r   [label="R[t](复位门)\n[BatchSize, NOut]", shape="Mrecord"]
    h_cand   [label="HCand[t](候补)\n[BatchSize, NOut]", shape="Mrecord"]
    calc_h [label="(1 - Z[t]) * H[t-1]\n + Z[t] * HCand[t]"]
    h [label="H[t](输出)\n[BatchSize, NOut]", shape="Mrecord"]
    x -> calc_z
    x -> calc_r
    x -> calc_h_cand
    his_h -> calc_z -> z
    his_h -> calc_r -> r
    his_h -> calc_h_cand
    r -> calc_h_cand -> h_cand
    z -> calc_h
    h_cand -> calc_h
    calc_h -> h
}
• 1
• 2
• 3
• 4
• 5
• 6
• 7
• 8
• 9
• 10
• 11
• 12
• 13
• 14
• 15
• 16
• 17
• 18
• 19
• 20
• 21
• 22
• 23
• 24
• 25
• 26
• 27
• 28
• 29
• 30
• 31
• 32
• 33
• 34
• 35
• 36
• 37
• 38
• 39
• 40
• 41


相关文章
|
4天前
|
机器学习/深度学习 计算机视觉 网络架构
是VGG网络的主要特点和架构描述
是VGG网络的主要特点和架构描述:
11 1
|
27天前
|
运维 安全 网络架构
【计算巢】网络模拟工具:设计与测试网络架构的有效方法
【6月更文挑战第1天】成为网络世界的超级英雄,利用网络模拟工具解决复杂架构难题!此工具提供安全的虚拟环境,允许自由设计和测试网络拓扑,进行性能挑战和压力测试。简单示例代码展示了创建网络拓扑的便捷性,它是网络设计和故障排查的“魔法棒”。无论新手还是专家,都能借助它探索网络的无限可能,开启精彩冒险!快行动起来,你会发现网络世界前所未有的乐趣!
【计算巢】网络模拟工具:设计与测试网络架构的有效方法
|
7天前
|
机器学习/深度学习 人工智能 自然语言处理
深度揭秘:深度学习框架下的神经网络架构进化
从感知机到深度学习的革命,神经网络经历了从简单到复杂的演变。反向传播使多层网络实用化,深度信念网络(DBN)和卷积神经网络(CNN)的兴起,尤其是AlexNet在ImageNet竞赛中的胜利,开启了深度学习黄金时代。ResNet的残差学习解决了深度梯度消失问题。循环神经网络(RNN)、LSTM和GRU改进了序列处理,Transformer模型(如BERT和GPT)引领了自然语言处理的变革。超大规模模型如GPT-3和通义千问展示惊人能力,影响医疗、自动驾驶等多个领域。未来,平衡模型复杂度、计算成本与应用需求将是关键。
51 2
|
10天前
|
机器学习/深度学习 网络架构 计算机视觉
VGG深度卷积神经网络架构
VGG深度卷积神经网络架构
|
22天前
网络编程中的互联网协议 , IP地址 , 域名 , 端口 , 架构 , 网页数据请求 , 响应码
网络编程中的互联网协议 , IP地址 , 域名 , 端口 , 架构 , 网页数据请求 , 响应码
|
1月前
|
安全 网络协议 网络安全
网络安全笔记整理,你花了多久弄明白架构设计
网络安全笔记整理,你花了多久弄明白架构设计
|
28天前
|
安全 网络安全 API
构建高效微服务架构的五大关键策略网络安全与信息安全:防范网络威胁的关键策略
【5月更文挑战第31天】 在现代软件开发领域,微服务架构已经成为实现灵活、可扩展及容错系统的重要解决方案。本文将深入探讨构建高效微服务架构的五个核心策略:服务划分原则、API网关设计、服务发现与注册、熔断机制以及持续集成与部署。这些策略不仅有助于开发团队提升系统的可维护性和可伸缩性,同时也确保了高可用性和服务质量。通过实践案例和性能分析,我们将展示如何有效应用这些策略以提高微服务的性能和稳定性。
|
1月前
|
监控 网络协议 安全
计算机网络概述及 参考模型
计算机网络概述及 参考模型
|
1月前
|
机器学习/深度学习 安全 网络安全
数字堡垒的构筑者:网络安全与信息安全的深层剖析构建高效微服务架构:后端开发的新趋势
【4月更文挑战第30天】在信息技术高速发展的今天,构建坚不可摧的数字堡垒已成为个人、企业乃至国家安全的重要组成部分。本文深入探讨网络安全漏洞的本质、加密技术的进展以及提升安全意识的必要性,旨在为读者提供全面的网络安全与信息安全知识框架。通过对网络攻防技术的解析和案例研究,我们揭示了防御策略的关键点,并强调了持续教育在塑造安全文化中的作用。
|
1月前
|
存储 网络协议 安全
【专栏】30 道初级网络工程师面试题为广大网络工程师提供参考。
【4月更文挑战第28天】本文为初级网络工程师提供了30道面试题,涵盖OSI七层模型、TCP/IP协议栈、IP地址分类、ARP、VLAN、STP、DHCP、DNS、防火墙、NAT、VPN、网络拓扑、广域网、以太网、网络存储、网络拥塞、流量监控、延迟、网络安全、网络攻击防范、协议分析、性能优化、故障排查、网络虚拟化和云计算等基础知识。这些问题旨在帮助面试者准备并提升网络工程领域的知识和技能。