/usr/local/lib64/python3.6/site-packages/torch/nn/modules/__pycache__
NameSizeModeActions
activation.cpython-36.pyc476350644editdlrm
adaptive.cpython-36.pyc97250644editdlrm
batchnorm.cpython-36.pyc310390644editdlrm
channelshuffle.cpython-36.pyc19010644editdlrm
container.cpython-36.pyc279700644editdlrm
conv.cpython-36.pyc577890644editdlrm
distance.cpython-36.pyc36840644editdlrm
dropout.cpython-36.pyc103100644editdlrm
flatten.cpython-36.pyc58130644editdlrm
fold.cpython-36.pyc128070644editdlrm
instancenorm.cpython-36.pyc188080644editdlrm
lazy.cpython-36.pyc116900644editdlrm
linear.cpython-36.pyc101880644editdlrm
loss.cpython-36.pyc914650644editdlrm
module.cpython-36.pyc665300644editdlrm
normalization.cpython-36.pyc113600644editdlrm
padding.cpython-36.pyc222170644editdlrm
pixelshuffle.cpython-36.pyc43980644editdlrm
pooling.cpython-36.pyc532030644editdlrm
rnn.cpython-36.pyc446530644editdlrm
sparse.cpython-36.pyc209560644editdlrm
transformer.cpython-36.pyc207370644editdlrm
upsampling.cpython-36.pyc107800644editdlrm
utils.cpython-36.pyc25280644editdlrm
_functions.cpython-36.pyc54410644editdlrm
__init__.cpython-36.pyc52360644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/nn/modules/__pycache__/instancenorm.cpython-36.pyc (18808B)
3 EgG@sddlmZddlmZmZddlmZGdddeZGdd d eZ Gd d d eeZ Gd d d eZ GdddeeZ GdddeZ GdddeeZdS))Tensor) _LazyNormBase _NormBase) functionalcsReZdZdeeeeeddfdd Zdd Zfd d Ze e d d dZ Z S) _InstanceNormh㈵>皙?FN) num_featuresepsmomentumaffinetrack_running_statsreturnc s*||d}tt|j|||||f|dS)N)devicedtype)superr__init__) selfr r r rrrrZfactory_kwargs) __class__I/usr/local/lib64/python3.6/site-packages/torch/nn/modules/instancenorm.pyrs  z_InstanceNorm.__init__cCstdS)N)NotImplementedError)rinputrrr_check_input_dimsz_InstanceNorm._check_input_dimc s|jdd}|dkr|j rg} x&d D]} || } | |kr&| j| q&Wt| dkr|jdjdjdd| D|jjd x| D]} |j| qWt t |j |||||||dS) Nversion running_mean running_varraUnexpected running stats buffer(s) {names} for {klass} with track_running_stats=False. If state_dict is a checkpoint saved before 0.4.0, this may be expected because {klass} does not track running stats by default since 0.4.0. Please remove these keys from state_dict. If the running stats are actually needed, instead set track_running_stats=True in {klass} to enable them. See the documentation of {klass} for details.z and css|]}dj|VqdS)z"{}"N)format).0krrr .sz6_InstanceNorm._load_from_state_dict..)namesklass)rr) getrappendlenrjoinr__name__poprr_load_from_state_dict) rZ state_dictprefixZlocal_metadatastrictZ missing_keysZunexpected_keysZ error_msgsrZrunning_stats_keysnamekey)rrrr+s"     z#_InstanceNorm._load_from_state_dict)rrc Cs8|j|tj||j|j|j|j|jp,|j |j |j S)N) rFZ instance_normrrZweightZbiasZtrainingrr r )rrrrrforward7s z_InstanceNorm.forward)r r FFNN) r) __module__ __qualname__intfloatboolrrr+rr1 __classcell__rr)rrrs  rc@seZdZdZddZdS)InstanceNorm1da Applies Instance Normalization over a 3D input (a mini-batch of 1D inputs with optional additional channel dimension) as described in the paper `Instance Normalization: The Missing Ingredient for Fast Stylization `__. .. math:: y = \frac{x - \mathrm{E}[x]}{ \sqrt{\mathrm{Var}[x] + \epsilon}} * \gamma + \beta The mean and standard-deviation are calculated per-dimension separately for each object in a mini-batch. :math:`\gamma` and :math:`\beta` are learnable parameter vectors of size `C` (where `C` is the input size) if :attr:`affine` is ``True``. The standard-deviation is calculated via the biased estimator, equivalent to `torch.var(input, unbiased=False)`. By default, this layer uses instance statistics computed from input data in both training and evaluation modes. If :attr:`track_running_stats` is set to ``True``, during training this layer keeps running estimates of its computed mean and variance, which are then used for normalization during evaluation. The running estimates are kept with a default :attr:`momentum` of 0.1. .. note:: This :attr:`momentum` argument is different from one used in optimizer classes and the conventional notion of momentum. Mathematically, the update rule for running statistics here is :math:`\hat{x}_\text{new} = (1 - \text{momentum}) \times \hat{x} + \text{momentum} \times x_t`, where :math:`\hat{x}` is the estimated statistic and :math:`x_t` is the new observed value. .. note:: :class:`InstanceNorm1d` and :class:`LayerNorm` are very similar, but have some subtle differences. :class:`InstanceNorm1d` is applied on each channel of channeled data like multidimensional time series, but :class:`LayerNorm` is usually applied on entire sample and often in NLP tasks. Additionally, :class:`LayerNorm` applies elementwise affine transform, while :class:`InstanceNorm1d` usually don't apply affine transform. Args: num_features: :math:`C` from an expected input of size :math:`(N, C, L)` or :math:`L` from input of size :math:`(N, L)` eps: a value added to the denominator for numerical stability. Default: 1e-5 momentum: the value used for the running_mean and running_var computation. Default: 0.1 affine: a boolean value that when set to ``True``, this module has learnable affine parameters, initialized the same way as done for batch normalization. Default: ``False``. track_running_stats: a boolean value that when set to ``True``, this module tracks the running mean and variance, and when set to ``False``, this module does not track such statistics and always uses batch statistics in both training and eval modes. Default: ``False`` Shape: - Input: :math:`(N, C, L)` - Output: :math:`(N, C, L)` (same shape as input) Examples:: >>> # Without Learnable Parameters >>> m = nn.InstanceNorm1d(100) >>> # With Learnable Parameters >>> m = nn.InstanceNorm1d(100, affine=True) >>> input = torch.randn(20, 100, 40) >>> output = m(input) cCs6|jdkrtd|jdkr2tdj|jdS)NrzInstanceNorm1d returns 0-filled tensor to 2D tensor.This is because InstanceNorm1d reshapes inputs to(1, N * C, ...) from (N, C,...) and this makesvariances 0.z!expected 3D input (got {}D input))dim ValueErrorr)rrrrrrs   zInstanceNorm1d._check_input_dimN)r)r2r3__doc__rrrrrr8>sBr8c@seZdZdZeZddZdS)LazyInstanceNorm1daA :class:`torch.nn.InstanceNorm1d` module with lazy initialization of the ``num_features`` argument of the :class:`InstanceNorm1d` that is inferred from the ``input.size(1)``. The attributes that will be lazily initialized are `weight`, `bias`, `running_mean` and `running_var`. Check the :class:`torch.nn.modules.lazy.LazyModuleMixin` for further documentation on lazy modules and their limitations. Args: num_features: :math:`C` from an expected input of size :math:`(N, C, L)` or :math:`L` from input of size :math:`(N, L)` eps: a value added to the denominator for numerical stability. Default: 1e-5 momentum: the value used for the running_mean and running_var computation. Default: 0.1 affine: a boolean value that when set to ``True``, this module has learnable affine parameters, initialized the same way as done for batch normalization. Default: ``False``. track_running_stats: a boolean value that when set to ``True``, this module tracks the running mean and variance, and when set to ``False``, this module does not track such statistics and always uses batch statistics in both training and eval modes. Default: ``False`` cCs6|jdkrtd|jdkr2tdj|jdS)NrzInstanceNorm1d returns 0-filled tensor to 2D tensor.This is because InstanceNorm1d reshapes inputs to(1, N * C, ...) from (N, C,...) and this makesvariances 0.r9z!expected 3D input (got {}D input))r:r;r)rrrrrrs   z#LazyInstanceNorm1d._check_input_dimN)r)r2r3r<r8 cls_to_becomerrrrrr=sr=c@seZdZdZddZdS)InstanceNorm2da Applies Instance Normalization over a 4D input (a mini-batch of 2D inputs with additional channel dimension) as described in the paper `Instance Normalization: The Missing Ingredient for Fast Stylization `__. .. math:: y = \frac{x - \mathrm{E}[x]}{ \sqrt{\mathrm{Var}[x] + \epsilon}} * \gamma + \beta The mean and standard-deviation are calculated per-dimension separately for each object in a mini-batch. :math:`\gamma` and :math:`\beta` are learnable parameter vectors of size `C` (where `C` is the input size) if :attr:`affine` is ``True``. The standard-deviation is calculated via the biased estimator, equivalent to `torch.var(input, unbiased=False)`. By default, this layer uses instance statistics computed from input data in both training and evaluation modes. If :attr:`track_running_stats` is set to ``True``, during training this layer keeps running estimates of its computed mean and variance, which are then used for normalization during evaluation. The running estimates are kept with a default :attr:`momentum` of 0.1. .. note:: This :attr:`momentum` argument is different from one used in optimizer classes and the conventional notion of momentum. Mathematically, the update rule for running statistics here is :math:`\hat{x}_\text{new} = (1 - \text{momentum}) \times \hat{x} + \text{momentum} \times x_t`, where :math:`\hat{x}` is the estimated statistic and :math:`x_t` is the new observed value. .. note:: :class:`InstanceNorm2d` and :class:`LayerNorm` are very similar, but have some subtle differences. :class:`InstanceNorm2d` is applied on each channel of channeled data like RGB images, but :class:`LayerNorm` is usually applied on entire sample and often in NLP tasks. Additionally, :class:`LayerNorm` applies elementwise affine transform, while :class:`InstanceNorm2d` usually don't apply affine transform. Args: num_features: :math:`C` from an expected input of size :math:`(N, C, H, W)` eps: a value added to the denominator for numerical stability. Default: 1e-5 momentum: the value used for the running_mean and running_var computation. Default: 0.1 affine: a boolean value that when set to ``True``, this module has learnable affine parameters, initialized the same way as done for batch normalization. Default: ``False``. track_running_stats: a boolean value that when set to ``True``, this module tracks the running mean and variance, and when set to ``False``, this module does not track such statistics and always uses batch statistics in both training and eval modes. Default: ``False`` Shape: - Input: :math:`(N, C, H, W)` - Output: :math:`(N, C, H, W)` (same shape as input) Examples:: >>> # Without Learnable Parameters >>> m = nn.InstanceNorm2d(100) >>> # With Learnable Parameters >>> m = nn.InstanceNorm2d(100, affine=True) >>> input = torch.randn(20, 100, 35, 45) >>> output = m(input) cCs"|jdkrtdj|jdS)Nz!expected 4D input (got {}D input))r:r;r)rrrrrrs zInstanceNorm2d._check_input_dimN)r)r2r3r<rrrrrr?sBr?c@seZdZdZeZddZdS)LazyInstanceNorm2daA :class:`torch.nn.InstanceNorm2d` module with lazy initialization of the ``num_features`` argument of the :class:`InstanceNorm2d` that is inferred from the ``input.size(1)``. The attributes that will be lazily initialized are `weight`, `bias`, `running_mean` and `running_var`. Check the :class:`torch.nn.modules.lazy.LazyModuleMixin` for further documentation on lazy modules and their limitations. Args: num_features: :math:`C` from an expected input of size :math:`(N, C, H, W)` eps: a value added to the denominator for numerical stability. Default: 1e-5 momentum: the value used for the running_mean and running_var computation. Default: 0.1 affine: a boolean value that when set to ``True``, this module has learnable affine parameters, initialized the same way as done for batch normalization. Default: ``False``. track_running_stats: a boolean value that when set to ``True``, this module tracks the running mean and variance, and when set to ``False``, this module does not track such statistics and always uses batch statistics in both training and eval modes. Default: ``False`` cCs"|jdkrtdj|jdS)Nr@z!expected 4D input (got {}D input))r:r;r)rrrrrrs z#LazyInstanceNorm2d._check_input_dimN)r)r2r3r<r?r>rrrrrrAsrAc@seZdZdZddZdS)InstanceNorm3da Applies Instance Normalization over a 5D input (a mini-batch of 3D inputs with additional channel dimension) as described in the paper `Instance Normalization: The Missing Ingredient for Fast Stylization `__. .. math:: y = \frac{x - \mathrm{E}[x]}{ \sqrt{\mathrm{Var}[x] + \epsilon}} * \gamma + \beta The mean and standard-deviation are calculated per-dimension separately for each object in a mini-batch. :math:`\gamma` and :math:`\beta` are learnable parameter vectors of size C (where C is the input size) if :attr:`affine` is ``True``. The standard-deviation is calculated via the biased estimator, equivalent to `torch.var(input, unbiased=False)`. By default, this layer uses instance statistics computed from input data in both training and evaluation modes. If :attr:`track_running_stats` is set to ``True``, during training this layer keeps running estimates of its computed mean and variance, which are then used for normalization during evaluation. The running estimates are kept with a default :attr:`momentum` of 0.1. .. note:: This :attr:`momentum` argument is different from one used in optimizer classes and the conventional notion of momentum. Mathematically, the update rule for running statistics here is :math:`\hat{x}_\text{new} = (1 - \text{momentum}) \times \hat{x} + \text{momentum} \times x_t`, where :math:`\hat{x}` is the estimated statistic and :math:`x_t` is the new observed value. .. note:: :class:`InstanceNorm3d` and :class:`LayerNorm` are very similar, but have some subtle differences. :class:`InstanceNorm3d` is applied on each channel of channeled data like 3D models with RGB color, but :class:`LayerNorm` is usually applied on entire sample and often in NLP tasks. Additionally, :class:`LayerNorm` applies elementwise affine transform, while :class:`InstanceNorm3d` usually don't apply affine transform. Args: num_features: :math:`C` from an expected input of size :math:`(N, C, D, H, W)` eps: a value added to the denominator for numerical stability. Default: 1e-5 momentum: the value used for the running_mean and running_var computation. Default: 0.1 affine: a boolean value that when set to ``True``, this module has learnable affine parameters, initialized the same way as done for batch normalization. Default: ``False``. track_running_stats: a boolean value that when set to ``True``, this module tracks the running mean and variance, and when set to ``False``, this module does not track such statistics and always uses batch statistics in both training and eval modes. Default: ``False`` Shape: - Input: :math:`(N, C, D, H, W)` - Output: :math:`(N, C, D, H, W)` (same shape as input) Examples:: >>> # Without Learnable Parameters >>> m = nn.InstanceNorm3d(100) >>> # With Learnable Parameters >>> m = nn.InstanceNorm3d(100, affine=True) >>> input = torch.randn(20, 100, 35, 45, 10) >>> output = m(input) cCs"|jdkrtdj|jdS)Nz!expected 5D input (got {}D input))r:r;r)rrrrrrcs zInstanceNorm3d._check_input_dimN)r)r2r3r<rrrrrrBsBrBc@seZdZdZeZddZdS)LazyInstanceNorm3daA :class:`torch.nn.InstanceNorm3d` module with lazy initialization of the ``num_features`` argument of the :class:`InstanceNorm3d` that is inferred from the ``input.size(1)``. The attributes that will be lazily initialized are `weight`, `bias`, `running_mean` and `running_var`. Check the :class:`torch.nn.modules.lazy.LazyModuleMixin` for further documentation on lazy modules and their limitations. Args: num_features: :math:`C` from an expected input of size :math:`(N, C, D, H, W)` eps: a value added to the denominator for numerical stability. Default: 1e-5 momentum: the value used for the running_mean and running_var computation. Default: 0.1 affine: a boolean value that when set to ``True``, this module has learnable affine parameters, initialized the same way as done for batch normalization. Default: ``False``. track_running_stats: a boolean value that when set to ``True``, this module tracks the running mean and variance, and when set to ``False``, this module does not track such statistics and always uses batch statistics in both training and eval modes. Default: ``False`` cCs"|jdkrtdj|jdS)NrCz!expected 5D input (got {}D input))r:r;r)rrrrrrs z#LazyInstanceNorm3d._check_input_dimN)r)r2r3r<rBr>rrrrrrDisrDN)ZtorchrZ batchnormrrrr0rr8r=r?rArBrDrrrrs  7Q'JJ