https://github.com/pytorch/pytorch/blob/master/torch/nn/init.py

@weak_script
def _calculate_fan_in_and_fan_out(tensor):
dimensions = tensor.dim()
if dimensions < 2:
raise ValueError("Fan in and fan out can not be computed for tensor with fewer than 2 dimensions") if dimensions == 2: # Linear
fan_in = tensor.size(1)
fan_out = tensor.size(0)
else:
num_input_fmaps = tensor.size(1)
num_output_fmaps = tensor.size(0)
receptive_field_size = 1
if tensor.dim() > 2:
receptive_field_size = tensor[0][0].numel()
fan_in = num_input_fmaps * receptive_field_size
fan_out = num_output_fmaps * receptive_field_size return fan_in, fan_out

Fan-in: 影响到该Neuron的输入数目。

Fan-out: 该Neron所能影响的输出的数目。

https://stackoverflow.com/questions/42670274/how-to-calculate-fan-in-and-fan-out-in-xavier-initialization-for-neural-networks

fan_in = n_feature_maps_in * receptive_field_height * receptive_field_width
fan_out = n_feature_maps_out * receptive_field_height * receptive_field_width / max_pool_area

https://blog.csdn.net/wumo1556/article/details/86583946

https://blog.csdn.net/dss_dssssd/article/details/83992701

Network Initialization: Fan-in and Fan-out的更多相关文章

  1. SuperSocket 2.0 发布第一个预览版, 另寻找Yang Fan哥哥

    昨天,SuperSocket的作者发布了2.0版本的第一个预览版.SuperSocket 2.0 是一个经过全新设计的,第一个完全基于.NET Core的版本.作者正在积极尝试提供更简单易用的API的 ...

  2. [java作业]Fan、求直线交点、Triangle2D、选课

    public class Fan { public static void main(String[] args) { Fan fan1 = new Fan(), fan2 = new Fan(); ...

  3. 【BZOJ1834】network 网络扩容(最大流,费用流)

    题意:给定一张有向图,每条边都有一个容量C和一个扩容费用W.这里扩容费用是指将容量扩大1所需的费用. 求: 1. 在不扩容的情况下,1到N的最大流: 2. 将1到N的最大流增加K所需的最小扩容费用. ...

  4. RAC的QA

    RAC: Frequently Asked Questions [ID 220970.1]   修改时间 13-JAN-2011     类型 FAQ     状态 PUBLISHED   Appli ...

  5. HP StorageWorks MSL2024 Tape Libraries - Tape library Error Codes

    Main error codes Error Code Description Details and Solution 80 Can not initialize bar code reader P ...

  6. pytorch基础学习(二)

    在神经网络训练时,还涉及到一些tricks,如网络权重的初始化方法,优化器种类(权重更新),图片预处理等,继续填坑. 1. 神经网络初始化(Network Initialization ) 1.1 初 ...

  7. 【转】Oracle RAC 环境下的连接管理

    文章转自:http://www.oracle.com/technetwork/cn/articles/database-performance/oracle-rac-connection-mgmt-1 ...

  8. USB HID usage table

    This usage table lets usbhidctl decode the HID data correctly for the APC RS/XS1000's. This work was ...

  9. usb.ids

    # # List of USB ID's # # Maintained by Vojtech Pavlik <vojtech@suse.cz> # If you have any new ...

随机推荐

  1. Django 系列

    Django基础 Django框架简介 Django 静态文件 Django request对象与ORM简介 Django路由系统 Django之视图层 Django之模板层 Django的setti ...

  2. clr via c# 程序集加载和反射集(一)

    1,程序集加载---弱的程序集可以加载强签名的程序集,但是不可相反.否则引用会报错!(但是,反射是没问题的) //获取当前类的Assembly Assembly.GetEntryAssembly() ...

  3. ES6 - 报错整理(1): Unexpected end of JSON input while parsing near '...es":"7.0.0-alpha.11",'

    npm install --save-dev 安装 babel-preset-env时一直报错 Unexpected end of JSON input while parsing near '... ...

  4. centos7下NAT模式下设置静态ip

    1.在虚拟网络编辑器下查看子网IP.子网掩码以及网关 2.在Linux系统中进入 /etc/sysconfig/network-scripts目录下,编辑ifcfg-ens33文件,改成下面的内容: ...

  5. Gird(2)

    目录 grid 布局(2) grid区域属性 网格线名称 grid-template-areas 属性 grid-auto-flow 容器内子元素的属性 grid 布局(2) grid区域属性 网格线 ...

  6. [Python]scatter_matrix报错 module 'pandas' has no attribute 'scatter_matrix'

    运行pandas.scatter_matrix()散点图函数时报错, 原因是该函数在新版本用法发生了变化: pandas.plotting.scatter_matrix 完整用法:pd.plottin ...

  7. 转载 selenium_对浏览器操作、鼠标操作等总结

    https://www.jianshu.com/p/7a4414082ce2 查看环境conda info --env 激活环境conda activate machine 路径改成H:cd H:\p ...

  8. 论文-MobileNetV2: Inverted Residuals and Linear Bottlenecks

    1.主要创新 1)提出了一种新的layer module:the inverted residual with linear bottleneck, 2)short connect被置于bottlen ...

  9. MariaDB(MySQL)创建、删除、选择及数据类型使用详解

    一.MariaDB简介(MySQL简介略过) MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行 ...

  10. ex03

    1. a heuristic function h(n): a heuristic value of n, that is the estimated cost of reaching goal fr ...