文档反馈

问题文档片段

问题文档片段包含公式时,显示为空格。

提交类型
issue

有点复杂...

找人问问吧。

请选择提交类型

问题类型
规范和低错类

- 规范和低错类:

- 错别字或拼写错误,标点符号使用错误、公式错误或显示异常。

- 链接错误、空单元格、格式错误。

- 英文中包含中文字符。

- 界面和描述不一致,但不影响操作。

- 表述不通顺,但不影响理解。

- 版本号不匹配:如软件包名称、界面版本号。

易用性

- 易用性:

- 关键步骤错误或缺失,无法指导用户完成任务。

- 缺少主要功能描述、关键词解释、必要前提条件、注意事项等。

- 描述内容存在歧义指代不明、上下文矛盾。

- 逻辑不清晰,该分类、分项、分步骤的没有给出。

正确性

- 正确性:

- 技术原理、功能、支持平台、参数类型、异常报错等描述和软件实现不一致。

- 原理图、架构图等存在错误。

- 命令、命令参数等错误。

- 代码片段错误。

- 命令无法完成对应功能。

- 界面错误,无法指导操作。

- 代码样例运行报错、运行结果不符。

风险提示

- 风险提示:

- 对重要数据或系统存在风险的操作,缺少安全提示。

内容合规

- 内容合规:

- 违反法律法规,涉及政治、领土主权等敏感词。

- 内容侵权。

请选择问题类型

问题描述

点击输入详细问题描述,以帮助我们快速定位问题。

mindspore.nn.probability.bnn_layers.ConvReparam

class mindspore.nn.probability.bnn_layers.ConvReparam(in_channels, out_channels, kernel_size, stride=1, pad_mode='same', padding=0, dilation=1, group=1, has_bias=False, weight_prior_fn=NormalPrior, weight_posterior_fn=<lambda name, shape: NormalPosterior(name=name, shape=shape)>, bias_prior_fn=NormalPrior, bias_posterior_fn=<lambda name, shape: NormalPosterior(name=name, shape=shape)>)[source]

Convolutional variational layers with Reparameterization.

For more details, refer to the paper Auto-Encoding Variational Bayes.

Parameters
  • in_channels (int) – The number of input channel Cin.

  • out_channels (int) – The number of output channel Cout.

  • kernel_size (Union[int, tuple[int]]) – The data type is an integer or a tuple of 2 integers. The kernel size specifies the height and width of the 2D convolution window. a single integer stands for the value is for both height and width of the kernel. With the kernel_size being a tuple of 2 integers, the first value is for the height and the other is the width of the kernel.

  • stride (Union[int, tuple[int]]) – The distance of kernel moving, an integer number represents that the height and width of movement are both strides, or a tuple of two integers numbers represents that height and width of movement respectively. Default: 1.

  • pad_mode (str) –

    Specifies the padding mode. The optional values are “same”, “valid”, and “pad”. Default: “same”.

    • same: Adopts the way of completion. Output height and width will be the same as the input. The total number of padding will be calculated for in horizontal and vertical directions and evenly distributed to top and bottom, left and right if possible. Otherwise, the last extra padding will be done from the bottom and the right side. If this mode is set, padding must be 0.

    • valid: Adopts the way of discarding. The possible largest height and width of the output will be returned without padding. Extra pixels will be discarded. If this mode is set, padding must be 0.

    • pad: Implicit paddings on both sides of the input. The number of padding will be padded to the input Tensor borders. padding must be greater than or equal to 0.

  • padding (Union[int, tuple[int]]) – Implicit paddings on both sides of the input. Default: 0.

  • dilation (Union[int, tuple[int]]) – The data type is an integer or a tuple of 2 integers. This parameter specifies the dilation rate of the dilated convolution. If set to be k>1, there will be k1 pixels skipped for each sampling location. Its value must be greater or equal to 1 and bounded by the height and width of the input. Default: 1.

  • group (int) – Splits filter into groups, in_ channels and out_channels must be divisible by the number of groups. Default: 1.

  • has_bias (bool) – Specifies whether the layer uses a bias vector. Default: False.

  • weight_prior_fn – The prior distribution for weight. It must return a mindspore distribution instance. Default: NormalPrior. (which creates an instance of standard normal distribution). The current version only supports normal distribution.

  • weight_posterior_fn – The posterior distribution for sampling weight. It must be a function handle which returns a mindspore distribution instance. Default: lambda name, shape: NormalPosterior(name=name, shape=shape). The current version only supports normal distribution.

  • bias_prior_fn – The prior distribution for bias vector. It must return a mindspore distribution. Default: NormalPrior(which creates an instance of standard normal distribution). The current version only supports normal distribution.

  • bias_posterior_fn – The posterior distribution for sampling bias vector. It must be a function handle which returns a mindspore distribution instance. Default: lambda name, shape: NormalPosterior(name=name, shape=shape). The current version only supports normal distribution.

Inputs:
  • input (Tensor) - The shape of the tensor is (N,Cin,Hin,Win).

Outputs:

Tensor, with the shape being (N,Cout,Hout,Wout).

Supported Platforms:

Ascend GPU

Examples

>>> net = ConvReparam(120, 240, 4, has_bias=False)
>>> input = Tensor(np.ones([1, 120, 1024, 640]), mindspore.float32)
>>> output = net(input).shape
>>> print(output)
(1, 240, 1024, 640)