Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
正统之独孤求败
mindspore
提交
6d821235
M
mindspore
项目概览
正统之独孤求败
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6d821235
编写于
8月 24, 2020
作者:
Z
zhangxinfeng3
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update some comments of api
上级
b7c92aa8
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
443 addition
and
11 deletion
+443
-11
mindspore/nn/probability/README.md
mindspore/nn/probability/README.md
+429
-0
mindspore/nn/probability/bnn_layers/bnn_cell_wrapper.py
mindspore/nn/probability/bnn_layers/bnn_cell_wrapper.py
+3
-0
mindspore/nn/probability/dpn/vae/cvae.py
mindspore/nn/probability/dpn/vae/cvae.py
+6
-6
mindspore/nn/probability/dpn/vae/vae.py
mindspore/nn/probability/dpn/vae/vae.py
+3
-3
mindspore/nn/probability/infer/variational/elbo.py
mindspore/nn/probability/infer/variational/elbo.py
+1
-1
tests/st/probability/test_gpu_svi_cvae.py
tests/st/probability/test_gpu_svi_cvae.py
+1
-1
未找到文件。
mindspore/nn/probability/README.md
0 → 100644
浏览文件 @
6d821235
此差异已折叠。
点击以展开。
mindspore/nn/probability/bnn_layers/bnn_cell_wrapper.py
浏览文件 @
6d821235
...
...
@@ -25,6 +25,9 @@ class ClassWrap:
def
__init__
(
self
,
cls
):
self
.
_cls
=
cls
self
.
bnn_loss_file
=
None
self
.
__doc__
=
cls
.
__doc__
self
.
__name__
=
cls
.
__name__
self
.
__bases__
=
cls
.
__bases__
def
__call__
(
self
,
backbone
,
loss_fn
,
dnn_factor
,
bnn_factor
):
obj
=
self
.
_cls
(
backbone
,
loss_fn
,
dnn_factor
,
bnn_factor
)
...
...
mindspore/nn/probability/dpn/vae/cvae.py
浏览文件 @
6d821235
...
...
@@ -31,7 +31,7 @@ class ConditionalVAE(Cell):
Note:
When define the encoder and decoder, the shape of the encoder's output tensor and decoder's input tensor
should be :math:`(N, hidden_size)`.
should be :math:`(N, hidden
\
_size)`.
The latent_size should be less than or equal to the hidden_size.
Args:
...
...
@@ -42,8 +42,8 @@ class ConditionalVAE(Cell):
num_classes(int): The number of classes.
Inputs:
- **input_x** (Tensor) - the same shape as the input of encoder.
- **input_y** (Tensor) - the tensor of the target data, the shape is :math:`(N,
1
)`.
- **input_x** (Tensor) - the same shape as the input of encoder
, the shape is :math:`(N, C, H, W)`
.
- **input_y** (Tensor) - the tensor of the target data, the shape is :math:`(N,)`.
Outputs:
- **output** (tuple) - (recon_x(Tensor), x(Tensor), mu(Tensor), std(Tensor)).
...
...
@@ -99,7 +99,7 @@ class ConditionalVAE(Cell):
Randomly sample from latent space to generate sample.
Args:
sample_y (Tensor): Define the label of sample, int tensor.
sample_y (Tensor): Define the label of sample, int tensor
, the shape is (generate_nums, )
.
generate_nums (int): The number of samples to generate.
shape(tuple): The shape of sample, it should be (generate_nums, C, H, W) or (-1, C, H, W).
...
...
@@ -121,8 +121,8 @@ class ConditionalVAE(Cell):
Reconstruct sample from original data.
Args:
x (Tensor): The input tensor to be reconstructed.
y (Tensor): The label of the input tensor.
x (Tensor): The input tensor to be reconstructed
, the shape is (N, C, H, W)
.
y (Tensor): The label of the input tensor
, the shape is (N,)
.
Returns:
Tensor, the reconstructed sample.
...
...
mindspore/nn/probability/dpn/vae/vae.py
浏览文件 @
6d821235
...
...
@@ -29,7 +29,7 @@ class VAE(Cell):
Note:
When define the encoder and decoder, the shape of the encoder's output tensor and decoder's input tensor
should be :math:`(N, hidden_size)`.
should be :math:`(N, hidden
\
_size)`.
The latent_size should be less than or equal to the hidden_size.
Args:
...
...
@@ -39,7 +39,7 @@ class VAE(Cell):
latent_size(int): The size of the latent space.
Inputs:
- **input** (Tensor) - the same shape as the input of encoder.
- **input** (Tensor) - the same shape as the input of encoder
, the shape is :math:`(N, C, H, W)`
.
Outputs:
- **output** (Tuple) - (recon_x(Tensor), x(Tensor), mu(Tensor), std(Tensor)).
...
...
@@ -106,7 +106,7 @@ class VAE(Cell):
Reconstruct sample from original data.
Args:
x (Tensor): The input tensor to be reconstructed.
x (Tensor): The input tensor to be reconstructed
, the shape is (N, C, H, W)
.
Returns:
Tensor, the reconstructed sample.
...
...
mindspore/nn/probability/infer/variational/elbo.py
浏览文件 @
6d821235
...
...
@@ -37,7 +37,7 @@ class ELBO(Cell):
Inputs:
- **input_data** (Tuple) - (recon_x(Tensor), x(Tensor), mu(Tensor), std(Tensor)).
- **target_data** (Tensor) - the target tensor.
- **target_data** (Tensor) - the target tensor
of shape :math:`(N,)`
.
Outputs:
Tensor, loss float tensor.
...
...
tests/st/probability/test_gpu_svi_cvae.py
浏览文件 @
6d821235
...
...
@@ -98,7 +98,7 @@ def create_dataset(data_path, batch_size=32, repeat_size=1,
return
mnist_ds
def
test_svi_c
av
e
():
def
test_svi_c
va
e
():
# define the encoder and decoder
encoder
=
Encoder
(
num_classes
=
10
)
decoder
=
Decoder
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录