Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OPTHREE
Paddle
提交
a83a368f
P
Paddle
项目概览
OPTHREE
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a83a368f
编写于
7月 28, 2021
作者:
Z
zhiboniu
提交者:
GitHub
7月 28, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
reverse paddle.vision.xxx import (#34432)
上级
0b2e510f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
56 addition
and
44 deletion
+56
-44
python/paddle/__init__.py
python/paddle/__init__.py
+0
-1
python/paddle/vision/__init__.py
python/paddle/vision/__init__.py
+56
-43
未找到文件。
python/paddle/__init__.py
浏览文件 @
a83a368f
...
...
@@ -425,7 +425,6 @@ __all__ = [ # noqa
'exp'
,
'expm1'
,
'bernoulli'
,
'summary'
,
'sinh'
,
'round'
,
'DataParallel'
,
...
...
python/paddle/vision/__init__.py
浏览文件 @
a83a368f
...
...
@@ -20,50 +20,63 @@ from . import ops # noqa: F401
from
.image
import
set_image_backend
# noqa: F401
from
.image
import
get_image_backend
# noqa: F401
from
.image
import
image_load
# noqa: F401
from
.models
import
LeNet
as
models_LeNet
import
paddle.utils.deprecated
as
deprecated
from
.datasets
import
DatasetFolder
# noqa: F401
from
.datasets
import
ImageFolder
# noqa: F401
from
.datasets
import
MNIST
# noqa: F401
from
.datasets
import
FashionMNIST
# noqa: F401
from
.datasets
import
Flowers
# noqa: F401
from
.datasets
import
Cifar10
# noqa: F401
from
.datasets
import
Cifar100
# noqa: F401
from
.datasets
import
VOC2012
# noqa: F401
from
.models
import
ResNet
# noqa: F401
from
.models
import
resnet18
# noqa: F401
from
.models
import
resnet34
# noqa: F401
from
.models
import
resnet50
# noqa: F401
from
.models
import
resnet101
# noqa: F401
from
.models
import
resnet152
# noqa: F401
from
.models
import
MobileNetV1
# noqa: F401
from
.models
import
mobilenet_v1
# noqa: F401
from
.models
import
MobileNetV2
# noqa: F401
from
.models
import
mobilenet_v2
# noqa: F401
from
.models
import
VGG
# noqa: F401
from
.models
import
vgg11
# noqa: F401
from
.models
import
vgg13
# noqa: F401
from
.models
import
vgg16
# noqa: F401
from
.models
import
vgg19
# noqa: F401
from
.models
import
LeNet
# noqa: F401
from
.transforms
import
BaseTransform
# noqa: F401
from
.transforms
import
Compose
# noqa: F401
from
.transforms
import
Resize
# noqa: F401
from
.transforms
import
RandomResizedCrop
# noqa: F401
from
.transforms
import
CenterCrop
# noqa: F401
from
.transforms
import
RandomHorizontalFlip
# noqa: F401
from
.transforms
import
RandomVerticalFlip
# noqa: F401
from
.transforms
import
Transpose
# noqa: F401
from
.transforms
import
Normalize
# noqa: F401
from
.transforms
import
BrightnessTransform
# noqa: F401
from
.transforms
import
SaturationTransform
# noqa: F401
from
.transforms
import
ContrastTransform
# noqa: F401
from
.transforms
import
HueTransform
# noqa: F401
from
.transforms
import
ColorJitter
# noqa: F401
from
.transforms
import
RandomCrop
# noqa: F401
from
.transforms
import
Pad
# noqa: F401
from
.transforms
import
RandomRotation
# noqa: F401
from
.transforms
import
Grayscale
# noqa: F401
from
.transforms
import
ToTensor
# noqa: F401
from
.transforms
import
to_tensor
# noqa: F401
from
.transforms
import
hflip
# noqa: F401
from
.transforms
import
vflip
# noqa: F401
from
.transforms
import
resize
# noqa: F401
from
.transforms
import
pad
# noqa: F401
from
.transforms
import
rotate
# noqa: F401
from
.transforms
import
to_grayscale
# noqa: F401
from
.transforms
import
crop
# noqa: F401
from
.transforms
import
center_crop
# noqa: F401
from
.transforms
import
adjust_brightness
# noqa: F401
from
.transforms
import
adjust_contrast
# noqa: F401
from
.transforms
import
adjust_hue
# noqa: F401
from
.transforms
import
normalize
# noqa: F401
__all__
=
[
#noqa
'set_image_backend'
,
'get_image_backend'
,
'image_load'
]
class
LeNet
(
models_LeNet
):
"""LeNet model from
`"LeCun Y, Bottou L, Bengio Y, et al. Gradient-based learning applied to document recognition[J]. Proceedings of the IEEE, 1998, 86(11): 2278-2324.`_
Args:
num_classes (int): output dim of last fc layer. If num_classes <=0, last fc layer
will not be defined. Default: 10.
Examples:
.. code-block:: python
from paddle.vision.models import LeNet
model = LeNet()
"""
@
deprecated
(
since
=
"2.0.0"
,
update_to
=
"paddle.vision.models.LeNet"
,
level
=
1
,
reason
=
"Please use new API in models, paddle.vision.LeNet will be removed in future"
)
def
__init__
(
self
,
num_classes
=
10
):
super
(
LeNet
,
self
).
__init__
(
num_classes
=
10
)
self
.
num_classes
=
num_classes
self
.
features
=
nn
.
Sequential
(
nn
.
Conv2D
(
1
,
6
,
3
,
stride
=
1
,
padding
=
1
),
nn
.
ReLU
(),
nn
.
MaxPool2D
(
2
,
2
),
nn
.
Conv2D
(
6
,
16
,
5
,
stride
=
1
,
padding
=
0
),
nn
.
ReLU
(),
nn
.
MaxPool2D
(
2
,
2
))
if
num_classes
>
0
:
self
.
fc
=
nn
.
Sequential
(
nn
.
Linear
(
400
,
120
),
nn
.
Linear
(
120
,
84
),
nn
.
Linear
(
84
,
num_classes
))
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录