Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
hapi
提交
76876f52
H
hapi
项目概览
PaddlePaddle
/
hapi
通知
11
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hapi
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
76876f52
编写于
4月 10, 2020
作者:
L
LielinJiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix reviews
上级
a9ae9555
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
15 deletion
+20
-15
models/mobilenetv1.py
models/mobilenetv1.py
+5
-4
models/mobilenetv2.py
models/mobilenetv2.py
+5
-4
models/resnet.py
models/resnet.py
+5
-4
models/vgg.py
models/vgg.py
+3
-2
transform/transforms.py
transform/transforms.py
+2
-1
未找到文件。
models/mobilenetv1.py
浏览文件 @
76876f52
...
@@ -111,15 +111,16 @@ class MobileNetV1(Model):
...
@@ -111,15 +111,16 @@ class MobileNetV1(Model):
Args:
Args:
scale (float): scale of channels in each layer. Default: 1.0.
scale (float): scale of channels in each layer. Default: 1.0.
num_classes (int): output dim of last fc layer. Default: -1.
num_classes (int): output dim of last fc layer. If num_classes <=0, last fc layer
with_pool (bool): use pool or not. Default: False.
will not be defined. Default: 1000.
with_pool (bool): use pool before the last fc layer or not. Default: True.
classifier_activation (str): activation for the last fc layer. Default: 'softmax'.
classifier_activation (str): activation for the last fc layer. Default: 'softmax'.
"""
"""
def
__init__
(
self
,
def
__init__
(
self
,
scale
=
1.0
,
scale
=
1.0
,
num_classes
=
-
1
,
num_classes
=
1000
,
with_pool
=
Fals
e
,
with_pool
=
Tru
e
,
classifier_activation
=
'softmax'
):
classifier_activation
=
'softmax'
):
super
(
MobileNetV1
,
self
).
__init__
()
super
(
MobileNetV1
,
self
).
__init__
()
self
.
scale
=
scale
self
.
scale
=
scale
...
...
models/mobilenetv2.py
浏览文件 @
76876f52
...
@@ -156,15 +156,16 @@ class MobileNetV2(Model):
...
@@ -156,15 +156,16 @@ class MobileNetV2(Model):
Args:
Args:
scale (float): scale of channels in each layer. Default: 1.0.
scale (float): scale of channels in each layer. Default: 1.0.
num_classes (int): output dim of last fc layer. Default: -1.
num_classes (int): output dim of last fc layer. If num_classes <=0, last fc layer
with_pool (bool): use pool or not. Default: False.
will not be defined. Default: 1000.
with_pool (bool): use pool before the last fc layer or not. Default: True.
classifier_activation (str): activation for the last fc layer. Default: 'softmax'.
classifier_activation (str): activation for the last fc layer. Default: 'softmax'.
"""
"""
def
__init__
(
self
,
def
__init__
(
self
,
scale
=
1.0
,
scale
=
1.0
,
num_classes
=
-
1
,
num_classes
=
1000
,
with_pool
=
Fals
e
,
with_pool
=
Tru
e
,
classifier_activation
=
'softmax'
):
classifier_activation
=
'softmax'
):
super
(
MobileNetV2
,
self
).
__init__
()
super
(
MobileNetV2
,
self
).
__init__
()
self
.
scale
=
scale
self
.
scale
=
scale
...
...
models/resnet.py
浏览文件 @
76876f52
...
@@ -163,16 +163,17 @@ class ResNet(Model):
...
@@ -163,16 +163,17 @@ class ResNet(Model):
Args:
Args:
Block (BasicBlock|BottleneckBlock): block module of model.
Block (BasicBlock|BottleneckBlock): block module of model.
depth (int): layers of resnet, default: 50.
depth (int): layers of resnet, default: 50.
num_classes (int): output dim of last fc layer, default: 1000.
num_classes (int): output dim of last fc layer. If num_classes <=0, last fc layer
with_pool (bool): use pool or not. Default: False.
will not be defined. Default: 1000.
with_pool (bool): use pool before the last fc layer or not. Default: True.
classifier_activation (str): activation for the last fc layer. Default: 'softmax'.
classifier_activation (str): activation for the last fc layer. Default: 'softmax'.
"""
"""
def
__init__
(
self
,
def
__init__
(
self
,
Block
,
Block
,
depth
=
50
,
depth
=
50
,
num_classes
=
-
1
,
num_classes
=
1000
,
with_pool
=
Fals
e
,
with_pool
=
Tru
e
,
classifier_activation
=
'softmax'
):
classifier_activation
=
'softmax'
):
super
(
ResNet
,
self
).
__init__
()
super
(
ResNet
,
self
).
__init__
()
...
...
models/vgg.py
浏览文件 @
76876f52
...
@@ -58,13 +58,14 @@ class VGG(Model):
...
@@ -58,13 +58,14 @@ class VGG(Model):
Args:
Args:
features (fluid.dygraph.Layer): vgg features create by function make_layers.
features (fluid.dygraph.Layer): vgg features create by function make_layers.
num_classes (int): output dim of last fc layer. Default: -1.
num_classes (int): output dim of last fc layer. If num_classes <=0, last fc layer
will not be defined. Default: 1000.
classifier_activation (str): activation for the last fc layer. Default: 'softmax'.
classifier_activation (str): activation for the last fc layer. Default: 'softmax'.
"""
"""
def
__init__
(
self
,
def
__init__
(
self
,
features
,
features
,
num_classes
=
-
1
,
num_classes
=
1000
,
classifier_activation
=
'softmax'
):
classifier_activation
=
'softmax'
):
super
(
VGG
,
self
).
__init__
()
super
(
VGG
,
self
).
__init__
()
self
.
features
=
features
self
.
features
=
features
...
...
transform/transforms.py
浏览文件 @
76876f52
...
@@ -289,7 +289,8 @@ class Normalize(object):
...
@@ -289,7 +289,8 @@ class Normalize(object):
class
Permute
(
object
):
class
Permute
(
object
):
"""Change input data to a target mode.
"""Change input data to a target mode.
For example, most transforms use HWC mode image,
For example, most transforms use HWC mode image,
while the Neural Network might use CHW mode input tensor
while the Neural Network might use CHW mode input tensor.
Input image should be HWC mode and an instance of numpy.ndarray.
Args:
Args:
mode: Output mode of input. Use "CHW" mode by default.
mode: Output mode of input. Use "CHW" mode by default.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录