Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSlim
提交
c4c00f5d
P
PaddleSlim
项目概览
PaddlePaddle
/
PaddleSlim
1 年多 前同步成功
通知
51
Star
1434
Fork
344
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
16
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSlim
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
16
合并请求
16
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c4c00f5d
编写于
7月 03, 2020
作者:
C
ceci3
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
ae28ccf8
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
94 addition
and
22 deletion
+94
-22
demo/gan_compression/configs/__init__.py
demo/gan_compression/configs/__init__.py
+3
-0
demo/gan_compression/configs/resnet_configs.py
demo/gan_compression/configs/resnet_configs.py
+2
-0
demo/gan_compression/configs/single_configs.py
demo/gan_compression/configs/single_configs.py
+3
-0
demo/gan_compression/distillers/__init__.py
demo/gan_compression/distillers/__init__.py
+2
-0
demo/gan_compression/get_real_stat.py
demo/gan_compression/get_real_stat.py
+13
-0
demo/gan_compression/models/__init__.py
demo/gan_compression/models/__init__.py
+2
-0
demo/gan_compression/models/generator/mobile_generator.py
demo/gan_compression/models/generator/mobile_generator.py
+13
-0
demo/gan_compression/models/generator/resnet_generator.py
demo/gan_compression/models/generator/resnet_generator.py
+13
-0
demo/gan_compression/models/generator/sub_mobile_generator.py
.../gan_compression/models/generator/sub_mobile_generator.py
+13
-0
demo/gan_compression/models/generator/super_generator.py
demo/gan_compression/models/generator/super_generator.py
+13
-0
demo/gan_compression/search.py
demo/gan_compression/search.py
+13
-0
demo/gan_compression/select_arch.py
demo/gan_compression/select_arch.py
+2
-0
demo/gan_compression/supernets/__init__.py
demo/gan_compression/supernets/__init__.py
+2
-0
demo/gan_compression/utils/image_pool.py
demo/gan_compression/utils/image_pool.py
+0
-22
未找到文件。
demo/gan_compression/configs/__init__.py
浏览文件 @
c4c00f5d
"""Based on https://github.com/mit-han-lab/gan-compression """
def
encode_config
(
config
):
return
'_'
.
join
([
str
(
c
)
for
c
in
config
[
'channels'
]])
...
...
demo/gan_compression/configs/resnet_configs.py
浏览文件 @
c4c00f5d
"""Based on https://github.com/mit-han-lab/gan-compression """
import
random
...
...
demo/gan_compression/configs/single_configs.py
浏览文件 @
c4c00f5d
"""Based on https://github.com/mit-han-lab/gan-compression """
class
SingleConfigs
:
def
__init__
(
self
,
config
):
self
.
attributes
=
[
'n_channels'
]
...
...
demo/gan_compression/distillers/__init__.py
浏览文件 @
c4c00f5d
"""Based on https://github.com/mit-han-lab/gan-compression """
import
importlib
from
models.base_model
import
BaseModel
...
...
demo/gan_compression/get_real_stat.py
浏览文件 @
c4c00f5d
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
numpy
as
np
import
argparse
...
...
demo/gan_compression/models/__init__.py
浏览文件 @
c4c00f5d
"""Based on https://github.com/mit-han-lab/gan-compression """
import
importlib
from
.base_model
import
BaseModel
...
...
demo/gan_compression/models/generator/mobile_generator.py
浏览文件 @
c4c00f5d
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
functools
import
paddle.fluid
as
fluid
from
paddle.fluid.dygraph.nn
import
InstanceNorm
,
Conv2D
,
Conv2DTranspose
...
...
demo/gan_compression/models/generator/resnet_generator.py
浏览文件 @
c4c00f5d
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
functools
import
paddle.fluid
as
fluid
import
paddle.tensor
as
tensor
...
...
demo/gan_compression/models/generator/sub_mobile_generator.py
浏览文件 @
c4c00f5d
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
functools
import
paddle.fluid
as
fluid
import
paddle.tensor
as
tensor
...
...
demo/gan_compression/models/generator/super_generator.py
浏览文件 @
c4c00f5d
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
functools
import
paddle.fluid
as
fluid
import
paddle.tensor
as
tensor
...
...
demo/gan_compression/search.py
浏览文件 @
c4c00f5d
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
pickle
import
random
...
...
demo/gan_compression/select_arch.py
浏览文件 @
c4c00f5d
"""Based on https://github.com/mit-han-lab/gan-compression """
import
argparse
import
pickle
...
...
demo/gan_compression/supernets/__init__.py
浏览文件 @
c4c00f5d
"""Based on https://github.com/mit-han-lab/gan-compression """
import
importlib
from
models.base_model
import
BaseModel
...
...
demo/gan_compression/utils/image_pool.py
浏览文件 @
c4c00f5d
...
...
@@ -25,25 +25,3 @@ class ImagePool():
return
temp
else
:
return
image
# return_images = []
# for img in image:
# img = img.detach()
# img = fluid.layers.unsqueeze(img, axes=0)
# if self.num_imgs < self.pool_size:
# self.num_imgs = self.num_imgs + 1
# self.images.append(img)
# return_images.append(img)
# else:
# p = random.uniform(0, 1)
# if p > 0.5:
# random_id = random.randint(0, self.pool_size - 1)
# temp = self.images[random_id]
# self.images[random_id] = img
# return_images.append(temp)
# else:
# return_images.append(img)
#
# return_images = fluid.layers.concat(return_images, axis=0)
# return return_images
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录