【MATLAB强化学习工具箱】学习笔记--actor网络和critic网络的结果放在哪里?
原算例见
【MATLAB强化学习工具箱】学习笔记--在Simulink环境中训练智能体Create Simulink Environment and Train Agent_bear_miao的博客-CSDN博客Simulink中便于搭建各类动力学与控制模型,通过将原有的控制器替换为AI控制器,可以方便使用已有模型,提供增量效果。本节的重点是如何引入Simulink模型作为env,其他的内容在之前的文章中已有说明。以水箱模型watertank为例,如下图所示:采用PI控制器,控制效果如下所示:将此PI控制器替换为神经网络控制器后,系统架构如下图所示:具体替换策略如下所示:(1)删去PID控制器;(2)增加RL Agent模块;(3)观测器模块:观测向量为:,其中...https://blog.csdn.net/bear_miao/article/details/121337953?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163724860816780261990267%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=163724860816780261990267&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-3-121337953.first_rank_v2_pc_rank_v29&utm_term=%E3%80%90MATLAB%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0%E5%B7%A5%E5%85%B7%E7%AE%B1%E3%80%91%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0--%E5%9C%A8Simulink%E7%8E%AF%E5%A2%83%E4%B8%AD%E8%AE%AD%E7%BB%83%E6%99%BA%E8%83%BD%E4%BD%93Create+Simulink+Environment+and+Train+Agent&spm=1018.2226.3001.4187里面包含了训练结果,在agent里面。但是究竟包含了哪些数据?
actor
从agent中提取actor信息
actor = getActor(agent)
得到如下内容:
>> actor = getActor(agent)
actor =
rlDeterministicActorRepresentation with properties:ActionInfo: [1×1 rl.util.rlNumericSpec]
ObservationInfo: [1×1 rl.util.rlNumericSpec]
Options: [1×1 rl.option.rlRepresentationOptions]
从actor中提取学习到的参数
params = getLearnableParameters(actor)
得到如下结果
>> params = getLearnableParameters(actor)
params =
1×4 cell array
{3×3 single} {3×1 single} {1×3 single} {[1.8352]}
那么上述数据究竟是何含义?
从actor中提取actor网络
actorNet=getModel(actor)
得到如下内容:
>> actorNet=getModel(actor)
actorNet =
DAGNetwork with properties:Layers: [5×1 nnet.cnn.layer.Layer]
Connections: [4×2 table]
InputNames: {'State'}
OutputNames: {'RepresentationLoss'}
在criticNet中终于看到了Layers信息和Connections信息,如下所示:
>> actorNet.Layers
ans =
5×1 Layer array with layers:1 'State' Feature Input 3 features
2 'actorFC' Fully Connected 3 fully connected layer
3 'actorTanh' Tanh Hyperbolic tangent
4 'Action' Fully Connected 1 fully connected layer
5 'RepresentationLoss' Regression Output mean-squared-error
>> actorNet.Connections
ans =
4×2 table
Source Destination
_____________ ______________________
{'State' } {'actorFC' }
{'actorFC' } {'actorTanh' }
{'actorTanh'} {'Action' }
{'Action' } {'RepresentationLoss'}
上述信息不直观,在 deepNetworkDesigner中打开如下所示:
deepNetworkDesigner(actorNet)
在这张图上终于看到了全景。
根据右侧的Propeties可以清楚看到params与网络的对应关系,如下所示:
可以得到:
params{1}为actorFC的W;
params{2}为actorFC的b;
params{3}为Action的W;
params{4}为Action的b;
critic
从agent中提取critic信息
critic = getCritic(agent)
得到如下内容:
>> critic = getCritic(agent)
critic =
rlQValueRepresentation with properties:ActionInfo: [1×1 rl.util.rlNumericSpec]
ObservationInfo: [1×1 rl.util.rlNumericSpec]
Options: [1×1 rl.option.rlRepresentationOptions]
从critic中提取学习到的参数
params = getLearnableParameters(critic)
得到如下结果
>> params = getLearnableParameters(critic)
params =
1×8 cell array
Columns 1 through 2
{50×3 single} {50×1 single}
Columns 3 through 4
{25×50 single} {25×1 single}
Columns 5 through 6
{25×1 single} {25×1 single}
Columns 7 through 8
{1×25 single} {[0.0879]}
那么上述数据究竟是何含义?
从critic中提取critic网络
criticNet = getModel(critic)
得到如下内容:
>> criticNet = getModel(critic)
criticNet =
DAGNetwork with properties:Layers: [10×1 nnet.cnn.layer.Layer]
Connections: [9×2 table]
InputNames: {'State' 'Action'}
OutputNames: {'RepresentationLoss'}
在criticNet中终于看到了Layers信息和Connections信息,如下所示:
>> criticNet.Layers
ans =
10×1 Layer array with layers:1 'State' Feature Input 3 features
2 'CriticStateFC1' Fully Connected 50 fully connected layer
3 'CriticRelu1' ReLU ReLU
4 'CriticStateFC2' Fully Connected 25 fully connected layer
5 'Action' Feature Input 1 features
6 'CriticActionFC1' Fully Connected 25 fully connected layer
7 'add' Addition Element-wise addition of 2 inputs
8 'CriticCommonRelu' ReLU ReLU
9 'CriticOutput' Fully Connected 1 fully connected layer
10 'RepresentationLoss' Regression Output mean-squared-error
>> criticNet.Connections
ans =
9×2 table
Source Destination
____________________ ______________________
{'State' } {'CriticStateFC1' }
{'CriticStateFC1' } {'CriticRelu1' }
{'CriticRelu1' } {'CriticStateFC2' }
{'CriticStateFC2' } {'add/in1' }
{'Action' } {'CriticActionFC1' }
{'CriticActionFC1' } {'add/in2' }
{'add' } {'CriticCommonRelu' }
{'CriticCommonRelu'} {'CriticOutput' }
{'CriticOutput' } {'RepresentationLoss'}
上述信息不直观,在 deepNetworkDesigner中打开如下所示:
deepNetworkDesigner(criticNet)
在这张图上终于看到了全景。
根据右侧的Propeties可以清楚看到params与网络的对应关系,如下所示:
可以得到:
params{1}为CriticStateFC1的W;
params{2}为CriticStateFC1的b;
params{3}为CriticStateFC2的W;
params{4}为CriticStateFC2的b;
params{5}为CriticActionFC1的W;
params{6}为CriticActionFC1的b;
params{7}为CriticOutput的W;
params{8}为CriticOutput的b;
【MATLAB强化学习工具箱】学习笔记--actor网络和critic网络的结果放在哪里?相关推荐
- s matlab toolbox,Matlab Robotic Toolbox工具箱学习笔记(一 )
Matlab Robotic Toolbox工具箱学习笔记(一) 软件:matlab2013a 工具箱:Matlab Robotic Toolbox v9.8 Matlab Robotic Toolb ...
- 【matlab】强化/深度学习工具箱例程调用汇总及编程实例
前言 前段时间帮导师申请项目时涉及到了智能化,因为行文过于天马行空导师要求将大致思路仿真出来试试,于是就又找到了强大的MATLAB,在网上一顿搜索后发现最新的强化学习以及深度学习的工具箱只有2019年 ...
- 系统学习深度学习(三十六)--Actor-Critic
转自:https://www.cnblogs.com/pinard/p/10272023.html 1. Actor-Critic算法简介 Actor-Critic从名字上看包括两部分,演员(Acto ...
- 【MATLAB深度学习工具箱】学习笔记--体脂估计算例再分析:拟合神经网络fitnet里面的数据结构】
原文链接如下 [MATLAB深度学习工具箱]学习笔记--体脂估计Body Fat Estimation_bear_miao的博客-CSDN博客介绍本示例展示一个函数拟合神经网络如何根据解剖学测量结果估 ...
- 【MATLAB深度学习工具箱】学习笔记--体脂估计算例再分析:拟合神经网络fitnet里面的函数】
介绍 上一篇 [MATLAB深度学习工具箱]学习笔记--体脂估计算例再分析:拟合神经网络fitnet里面的数据结构]_bear_miao的博客-CSDN博客原文链接如下[MATLAB深度学习工具箱]学 ...
- 什么是强化学习,强化学习在控制系统中的应用以及matlab强化学习工具箱的介绍
一.Reinforcement Learning Toolbox介绍 强化学习工具箱使用强化学习算法(包括DQN,A2C和DDPG)为训练策略(policy)提供函数和模块.您可以使用这些策略为复杂的 ...
- MATLAB强化学习工具箱(十三)创建策略和价值函数表示
创建策略和价值函数表示 行动者和评论者表示 表近似器 深度神经网络近似器 网络的输入和输出维度 构建深度神经网络 创建和配置表示 递归神经网络 自定义基础函数逼近器 创建智能体或指定智能体表示 强化学 ...
- matlab机器人工具箱学习笔记——ikine函数
matlab机器人工具箱学习笔记--ikine函数 ikine函数用法 使用实例 链接: https://blog.csdn.net/weixin_42596724/article/details/8 ...
- MATLAB强化学习工具箱(十二)强化学习智能体创建总览
强化学习智能体创建总览 强化学习介绍 内置智能体 选择智能体类型 自定义智能体 关于强化学习的更多介绍 强化学习介绍 强化学习的目标是训练智能体在不确定的环境中完成任务.智能体从环境中接收观察和奖励, ...
最新文章
- 高性能的MySQL(6)查询慢与重构查询
- 一年暴涨近20倍,比特币是郁金香泡沫还是庞氏骗局?
- MyBatis-21MyBatis高级结果映射【一对多映射(2种方式)】
- Linux Shell脚本编程--cut命令
- Eclipse中javascript文件 clg 变为console.log();
- 这是一份面向Android开发者的复习指南,成功入职字节跳动
- 代码review,瑞出事来了!
- matlab中circle函数_JavaScript碎片——函数闭包(模拟面向对象)
- 仿ios桌面vivo_流畅就是跑分高?vivo选择说不,用这款杀器终结国产手机内卷
- Tomcat日志打印乱码解决方法
- Java 中文乱码问题
- 如何用EasyRecovery找回已经删除的图片?
- 提高笔记本无线网络速度
- raspberry 防火墙_用Raspberry Pi对您的家庭网络进行防火墙
- velodyne运行Loam_velodyne过程记录
- ASP.NET2.0数据操作之母板页和站点导航
- windows 下编译 DSview 记录
- springboot整合elasticsearch8
- 点击网页中正常链接结果跳转到天猫淘宝的页面
- 基于图像的三维重建——特征点检测与匹配(2)
热门文章
- 蓝牙运动手环app开发方案
- w ndows无法连接到System,Windows无法连接到System Event Notification Service 服务
- !include: could not find: nsProcess.nsh
- 微信小程序使用formdata传参上传图片
- dw改透明度_div 背景透明度 如何设置一个div的背景透明度
- 本周AI热点回顾:AI消除马赛克神器公布;Github黑暗模式正式发布;「中国AlphaFold」创生!
- JScript 06 根据成绩平均分划分等级
- SpringBoot整合微信扫码登录
- windows快速添加开机启动项/禁用开机启动项
- 一个DataFrame赋值的诡异报错 A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc