用法:
class torch.nn.intrinsic.qat.LinearReLU(in_features, out_features, bias=True, qconfig=None)
~LinearReLU.weight(torch.Tensor) -重量的假量化模块
由 Linear 和 ReLU 模块融合而成的 LinearReLU 模块,附加了 FakeQuantize 模块用于权重,用于量化感知训练。
我们采用与
torch.nn.Linear
相同的接口。类似于
torch.nn.intrinsic.LinearReLU
,将 FakeQuantize 模块初始化为默认值。例子:
>>> m = nn.qat.LinearReLU(20, 30) >>> input = torch.randn(128, 20) >>> output = m(input) >>> print(output.size()) torch.Size([128, 30])
变量:
相关用法
- Python torch.nn.intrinsic.quantized.LinearReLU用法及代码示例
- Python torch.nn.init.xavier_normal_用法及代码示例
- Python torch.nn.init.orthogonal_用法及代码示例
- Python torch.nn.init.normal_用法及代码示例
- Python torch.nn.init.kaiming_uniform_用法及代码示例
- Python torch.nn.init.kaiming_normal_用法及代码示例
- Python torch.nn.init.calculate_gain用法及代码示例
- Python torch.nn.init.xavier_uniform_用法及代码示例
- Python torch.nn.init.sparse_用法及代码示例
- Python torch.nn.init.ones_用法及代码示例
- Python torch.nn.init.eye_用法及代码示例
- Python torch.nn.init.zeros_用法及代码示例
- Python torch.nn.init.dirac_用法及代码示例
- Python torch.nn.init.uniform_用法及代码示例
- Python torch.nn.init.constant_用法及代码示例
- Python torch.nn.InstanceNorm3d用法及代码示例
- Python torch.nn.quantized.dynamic.LSTM用法及代码示例
- Python torch.nn.EmbeddingBag用法及代码示例
- Python torch.nn.Module.register_forward_hook用法及代码示例
- Python torch.nn.AvgPool2d用法及代码示例
注:本文由纯净天空筛选整理自pytorch.org大神的英文原创作品 torch.nn.intrinsic.qat.LinearReLU。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。