zoukankan      html  css  js  c++  java
  • CS231n 2016 通关 第五、六章 Dropout 作业

    Dropout的作用:

    cell  1 - cell 2 依旧

    cell 3 Dropout层的前向传播

      核心代码:

        train 时:

    1   if mode == 'train':
    2     ###########################################################################
    3     # TODO: Implement the training phase forward pass for inverted dropout.   #
    4     # Store the dropout mask in the mask variable.                            #
    5     ###########################################################################
    6     mask = (np.random.rand(*x.shape) < p) /p
    7     out = x * mask

        test 时:

    1     ###########################################################################
    2   elif mode == 'test':
    3     ###########################################################################
    4     # TODO: Implement the test phase forward pass for inverted dropout.       #
    5     ###########################################################################
    6     out = x

      原理较为简单。

    cell 4 反向传播:

      主要是计算偏导。

      核心代码:

    1     dx = dout * mask    

    cell 5 对全连接网络使用Dropout

      将相应的层加入到模型即可。

    附:通关CS231n企鹅群:578975100 validation:DL-CS231n 

  • 相关阅读:
    2019.3.18 IP通信基础
    2019.3.11 IP通信基础
    2019.3.7 IP通信基础
    2019.3.4 IP通信基础
    员工贷项目优劣点总结
    mysql事务_事务隔离级别详解
    mysql锁
    mybatis错误——java.io.IOException: Could not find resource com/xxx/xxxMapper.xml
    小问题
    关于char是否能表示一个中文
  • 原文地址:https://www.cnblogs.com/wangxiu/p/5689840.html
Copyright © 2011-2022 走看看