Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSlim
提交
689bddf4
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看板
未验证
提交
689bddf4
编写于
5月 06, 2020
作者:
C
ceci3
提交者:
GitHub
5月 06, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix lstm windows (#255)
* fix * fix win
上级
9a9cf241
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
12 addition
and
11 deletion
+12
-11
demo/nas/sa_nas_mobilenetv2.py
demo/nas/sa_nas_mobilenetv2.py
+1
-1
docs/zh_cn/api_cn/custom_rl_controller.md
docs/zh_cn/api_cn/custom_rl_controller.md
+2
-2
paddleslim/common/client.py
paddleslim/common/client.py
+1
-1
paddleslim/common/rl_controller/__init__.py
paddleslim/common/rl_controller/__init__.py
+2
-2
paddleslim/common/rl_controller/ddpg/__init__.py
paddleslim/common/rl_controller/ddpg/__init__.py
+1
-1
paddleslim/common/rl_controller/ddpg/ddpg_controller.py
paddleslim/common/rl_controller/ddpg/ddpg_controller.py
+0
-0
paddleslim/common/rl_controller/ddpg/ddpg_model.py
paddleslim/common/rl_controller/ddpg/ddpg_model.py
+0
-0
paddleslim/common/rl_controller/ddpg/noise.py
paddleslim/common/rl_controller/ddpg/noise.py
+0
-0
paddleslim/common/rl_controller/lstm/__init__.py
paddleslim/common/rl_controller/lstm/__init__.py
+1
-1
paddleslim/common/rl_controller/lstm/lstm_controller.py
paddleslim/common/rl_controller/lstm/lstm_controller.py
+2
-1
paddleslim/common/rl_controller/utils.py
paddleslim/common/rl_controller/utils.py
+0
-0
paddleslim/common/server.py
paddleslim/common/server.py
+1
-1
paddleslim/nas/rl_nas.py
paddleslim/nas/rl_nas.py
+1
-1
未找到文件。
demo/nas/sa_nas_mobilenetv2.py
浏览文件 @
689bddf4
...
...
@@ -177,7 +177,7 @@ def test_search_result(tokens, image_size, args, config):
image_shape
=
[
3
,
image_size
,
image_size
]
archs
=
sa_nas
.
tokens2arch
(
tokens
)
archs
=
sa_nas
.
tokens2arch
(
tokens
)
[
0
]
train_program
=
fluid
.
Program
()
test_program
=
fluid
.
Program
()
...
...
docs/zh_cn/api_cn/custom_rl_controller.md
浏览文件 @
689bddf4
...
...
@@ -3,8 +3,8 @@
首先导入必要的依赖:
```
python
### 引入强化学习Controller基类函数和注册类函数
from
paddleslim.common.
RL
_controller.utils
import
RLCONTROLLER
from
paddleslim.common.
RL
_controller
import
RLBaseController
from
paddleslim.common.
rl
_controller.utils
import
RLCONTROLLER
from
paddleslim.common.
rl
_controller
import
RLBaseController
```
通过装饰器的方式把自定义强化学习Controller注册到PaddleSlim,继承基类之后需要重写基类中的
`next_tokens`
和
`update`
两个函数。注意:本示例仅说明一些必不可少的步骤,并不能直接运行,完整代码请参考
[
这里
](
)
...
...
paddleslim/common/client.py
浏览文件 @
689bddf4
...
...
@@ -25,7 +25,7 @@ if six.PY2:
else
:
import
pickle
from
.log_helper
import
get_logger
from
.
RL
_controller.utils
import
compute_grad
,
ConnectMessage
from
.
rl
_controller.utils
import
compute_grad
,
ConnectMessage
_logger
=
get_logger
(
__name__
,
level
=
logging
.
INFO
)
...
...
paddleslim/common/
RL
_controller/__init__.py
→
paddleslim/common/
rl
_controller/__init__.py
浏览文件 @
689bddf4
...
...
@@ -17,11 +17,11 @@ from ..log_helper import get_logger
_logger
=
get_logger
(
__name__
,
level
=
logging
.
INFO
)
try
:
import
parl
from
.
DDPG
import
*
from
.
ddpg
import
*
except
ImportError
as
e
:
_logger
.
warn
(
"If you want to use DDPG in RLNAS, please pip intall parl first. Now states: {}"
.
format
(
e
))
from
.
LSTM
import
*
from
.
lstm
import
*
from
.utils
import
*
paddleslim/common/
RL_controller/LSTM
/__init__.py
→
paddleslim/common/
rl_controller/ddpg
/__init__.py
浏览文件 @
689bddf4
...
...
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
.
LSTM_C
ontroller
import
*
from
.
ddpg_c
ontroller
import
*
paddleslim/common/
RL_controller/DDPG/DDPGC
ontroller.py
→
paddleslim/common/
rl_controller/ddpg/ddpg_c
ontroller.py
浏览文件 @
689bddf4
文件已移动
paddleslim/common/
RL_controller/DDPG
/ddpg_model.py
→
paddleslim/common/
rl_controller/ddpg
/ddpg_model.py
浏览文件 @
689bddf4
文件已移动
paddleslim/common/
RL_controller/DDPG
/noise.py
→
paddleslim/common/
rl_controller/ddpg
/noise.py
浏览文件 @
689bddf4
文件已移动
paddleslim/common/
RL_controller/DDPG
/__init__.py
→
paddleslim/common/
rl_controller/lstm
/__init__.py
浏览文件 @
689bddf4
...
...
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
.
DDPGC
ontroller
import
*
from
.
lstm_c
ontroller
import
*
paddleslim/common/
RL_controller/LSTM/LSTM_C
ontroller.py
→
paddleslim/common/
rl_controller/lstm/lstm_c
ontroller.py
浏览文件 @
689bddf4
...
...
@@ -224,7 +224,8 @@ class LSTM(RLBaseController):
actual_rewards
=
actual_rewards
.
astype
(
np
.
float32
)
feed_dict
[
'rewards'
]
=
actual_rewards
feed_dict
[
'init_actions'
]
=
np
.
array
(
self
.
init_tokens
)
feed_dict
[
'init_actions'
]
=
np
.
array
(
self
.
init_tokens
).
astype
(
'int64'
)
return
feed_dict
...
...
paddleslim/common/
RL
_controller/utils.py
→
paddleslim/common/
rl
_controller/utils.py
浏览文件 @
689bddf4
文件已移动
paddleslim/common/server.py
浏览文件 @
689bddf4
...
...
@@ -25,7 +25,7 @@ import logging
import
time
import
threading
from
.log_helper
import
get_logger
from
.
RL
_controller.utils
import
add_grad
,
ConnectMessage
from
.
rl
_controller.utils
import
add_grad
,
ConnectMessage
_logger
=
get_logger
(
__name__
,
level
=
logging
.
INFO
)
...
...
paddleslim/nas/rl_nas.py
浏览文件 @
689bddf4
...
...
@@ -20,7 +20,7 @@ import json
import
hashlib
import
time
import
paddle.fluid
as
fluid
from
..common.
RL
_controller.utils
import
RLCONTROLLER
from
..common.
rl
_controller.utils
import
RLCONTROLLER
from
..common
import
get_logger
from
..common
import
Server
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录