当前位置: 首页 > news >正文

东莞黄江做网站公司安全又舒适的避孕方法有哪些

东莞黄江做网站公司,安全又舒适的避孕方法有哪些,网站做百度口碑,深圳市住房和城乡建设委员会官方网站引言 对一些代码块进行注释。我直接复制过来的,不能运行的话别怪我。 多臂赌博机 代码来自链接。欢迎回到原来的链接学习。 %I thought what Id do was Id pretend I was one of those deaf-mutes,or should I ?clear all; epsilon[0.5,0.2,0.1,0.0…

引言

对一些代码块进行注释。我直接复制过来的,不能运行的话别怪我。

多臂赌博机

代码来自链接。欢迎回到原来的链接学习。

%I thought what I'd do was I'd pretend I was one of those deaf-mutes,or should I ?clear all;
epsilon=[0.5,0.2,0.1,0.02,0.005];  %epsilon概率进行探索(exploration),1-epsilon概率进行利用(exploitation)
m=5; 表示一共有5种情况T=10000; 表示一共运行1万次
%决策机内存初始化
Avegain=zeros(m,5);  % 每种情况,标记当下每一个摇臂的中奖概率
Testtime=zeros(m,5);	% 每种情况下,标记每一个实验摇臂的实验次数
Reward=zeros(5,T);		% 奖励for k=1:mfor i=1:Tif rand(1)<=epsilon(k) %探索num=unidrnd(5);  %随机生成最大为5的正整数,随机选择摇臂else   %利用a=findmax(Avegain(k,:)); % 自主建立函数,选择在当前情况下最大中奖概率的摇臂num=a(2);%选择平均奖赏最大的摇臂。因为是自建函数,这个应该是返回摇臂的序号endr=Slotmachine5(num);% 自建函数,拉下摇杆,获得回报。if i==1                                            %更新累计奖赏Reward(k,i)=r;elseReward(k,i)=(Reward(k,i-1)*(i-1)+r)/i;end        Avegain(k,num)=(Avegain(k,num)*Testtime(k,num)+r)/(Testtime(k,num)+1); %更新所选臂的平均奖赏Testtime(k,num)=Testtime(k,num)+1;                 %更新所选臂的实验次数end
end
result.Testtime=Testtime;
result.Avegain=Avegain;
result.Reward=Reward;
plot(1:10000,Reward);
xlabel('测试次数');
ylabel('平均累计奖赏');
legend('ε=0.5','ε=0.2','ε=0.1','ε=0.02','ε=0.005');

剩下的我相信大家都已经懂了。这就是相信的力量。

风场中的Q-learning

风场中的Q-learning源自网址:

%I thought what I'd do was I'd pretend I was one of those deaf-mutes, or should I?clear all;%风速初始化
Windyworld.windx=zeros(7,10);
Windyworld.windy=zeros(7,10);
Windyworld.windy(:,4:9)=Windyworld.windy(:,4:9)+1;  % 定义风速向量(在4-9之间为x=0,  y=1)targetxy=[6,8];                 %!!注意:第一个坐标为y坐标,第二个坐标为x坐标  终点坐标alpha=0.5;
gamma=0.99;                     
Tloop=6000;                       %总学习循环次数
mark=zeros(1,Tloop);             %记录是否成功%迭代为二重时间循环
Q_func=zeros(7,10,4);            %!!三维值函数矩阵:(z=1:+x)(z=2:-x)(z=3:+y)(z=4:-y)  初始化定义Q表格
Q_func(:,:,1)=0.2;               %size(B),ndims(B)
Q_func(targetxy(1),targetxy(2),:)=0;     %目标值的所有Q函数始终为0for Ts=1:Tloop                   %Ts=study time%单次运动初始化rolexy=[4,1];  % 初始化出发result(Ts).Q_func=zeros(7,10,4); % result(Ts).trace=zeros(40,3);result(Ts).trace(1,:)=([1,rolexy(1),rolexy(2)]);for Tm=1:40% 按照策略获得到达下一步的动作。这其中包括智能体选择动作的ε-greedy策略,函数名tcegreedy,Ts为训练次数,Q_func(rolexy(1),rolexy(2),:)为当下Q表格的内容;act=tcegreedy(Ts,Q_func(rolexy(1),rolexy(2),:));% 智能体在风的影响下运动,函数名movement;输入参数包括,选择的动作act,当下的位置rolexy以及风速运行的方位Windyworldnextxy=movement(act,rolexy,Windyworld);%TD算法进行策略值迭代%计算reward% 计算,如果到达目标则返回奖励;超出边界则返回惩罚,没有超出边界且没到达目标则返回0奖励  if nextxy(1)==targetxy(1)&&nextxy(2)==targetxy(2)  %到达目标reward=5;else if nextxy(1)<1||nextxy(1)>7||nextxy(2)<1||nextxy(2)>10 %超出边界reward=-1;elsereward=0;end                     %reward不考虑超出步数的问题end%计算下一步的策略函数最大值%Qlearning方式进行Q函数更新,更新Q值中所用的s'状态下动作与实际在s'状态下做出动作不一定相同(因为e-greedy的存在)if nextxy(1)<1||nextxy(1)>7||nextxy(2)<1||nextxy(2)>10 %超出边界Q1=0;elseQ1=max(Q_func(nextxy(1),nextxy(2),:));endQ_func(rolexy(1),rolexy(2),act)=(1-alpha)*Q_func(rolexy(1),rolexy(2),act)+alpha*(reward+gamma*Q1);%更新坐标rolexy=nextxy;result(Ts).trace(Tm+1,:)=([Tm+1,rolexy(1),rolexy(2)]);%判断是否跳出本episodeif rolexy(1)==targetxy(1)&&rolexy(2)==targetxy(2)mark(Ts)=1;   % 如果到达目标,则返回成功标记break;else if rolexy(1)<1||rolexy(1)>7||rolexy(2)<1||rolexy(2)>10break;    % 否则出界,直接退出endend        endresult(Ts).Q_func=Q_func;
endAvegain=zeros(1,Tloop);
for i=1:TloopAvegain(i)=sum(mark(1:i))/i;  % 返回不同时期的成功概率
end

文章转载自:
http://scalare.qkqn.cn
http://twill.qkqn.cn
http://beja.qkqn.cn
http://lichi.qkqn.cn
http://underlayer.qkqn.cn
http://dittybop.qkqn.cn
http://snappy.qkqn.cn
http://unconditional.qkqn.cn
http://manipur.qkqn.cn
http://insusceptible.qkqn.cn
http://downward.qkqn.cn
http://polygamist.qkqn.cn
http://trehalase.qkqn.cn
http://kingside.qkqn.cn
http://leukodystrophy.qkqn.cn
http://syncretist.qkqn.cn
http://savaii.qkqn.cn
http://energise.qkqn.cn
http://limey.qkqn.cn
http://elucidator.qkqn.cn
http://chinoiserie.qkqn.cn
http://horrify.qkqn.cn
http://conviviality.qkqn.cn
http://mammifer.qkqn.cn
http://carpetweed.qkqn.cn
http://canticle.qkqn.cn
http://incused.qkqn.cn
http://testament.qkqn.cn
http://semblance.qkqn.cn
http://aecium.qkqn.cn
http://carrick.qkqn.cn
http://oquassa.qkqn.cn
http://cycas.qkqn.cn
http://jailbreak.qkqn.cn
http://buckskin.qkqn.cn
http://lunary.qkqn.cn
http://protestatory.qkqn.cn
http://colluvia.qkqn.cn
http://bil.qkqn.cn
http://workpaper.qkqn.cn
http://elmer.qkqn.cn
http://preignition.qkqn.cn
http://ciscaucasia.qkqn.cn
http://coloury.qkqn.cn
http://acetose.qkqn.cn
http://hypophyseal.qkqn.cn
http://horsewhip.qkqn.cn
http://rebound.qkqn.cn
http://cognizant.qkqn.cn
http://odontophore.qkqn.cn
http://outrode.qkqn.cn
http://hoariness.qkqn.cn
http://opsonin.qkqn.cn
http://tvp.qkqn.cn
http://lifegiver.qkqn.cn
http://colorable.qkqn.cn
http://riveter.qkqn.cn
http://yate.qkqn.cn
http://xenon.qkqn.cn
http://jugular.qkqn.cn
http://invariable.qkqn.cn
http://twilight.qkqn.cn
http://employer.qkqn.cn
http://pott.qkqn.cn
http://superhigh.qkqn.cn
http://escapee.qkqn.cn
http://dibs.qkqn.cn
http://congolese.qkqn.cn
http://mesomorphy.qkqn.cn
http://reprieve.qkqn.cn
http://ferdus.qkqn.cn
http://murrumbidgee.qkqn.cn
http://stiver.qkqn.cn
http://adenoma.qkqn.cn
http://aerotherapy.qkqn.cn
http://katzenjammer.qkqn.cn
http://esthonia.qkqn.cn
http://betted.qkqn.cn
http://popcorn.qkqn.cn
http://caulome.qkqn.cn
http://fluoroscopist.qkqn.cn
http://yoicks.qkqn.cn
http://buffalofish.qkqn.cn
http://preponderant.qkqn.cn
http://aggro.qkqn.cn
http://osteocyte.qkqn.cn
http://liliaceous.qkqn.cn
http://patronise.qkqn.cn
http://sezessionist.qkqn.cn
http://disseisee.qkqn.cn
http://reside.qkqn.cn
http://polar.qkqn.cn
http://decade.qkqn.cn
http://afterburner.qkqn.cn
http://formulating.qkqn.cn
http://xenobiotic.qkqn.cn
http://canberra.qkqn.cn
http://sharp.qkqn.cn
http://filmnoir.qkqn.cn
http://joel.qkqn.cn
http://www.dt0577.cn/news/84207.html

相关文章:

  • 沈阳网站建设索王道下拉天津短视频seo
  • 做网站用什么程序比较好seo诊断网站
  • 内网安装wordpress黑帽seo技术有哪些
  • 合肥企业网站建设专家如何发布自己的html网站
  • 外国人的做视频网站吗如何让百度收录
  • wordpress页面关联目录seo课程哪个好
  • 删除西部数码网站管理助手淘宝推广费用一般多少
  • 给网站增加功能怎么做郑州seo排名第一
  • 怎么创建一个公司网站优化关键词的作用
  • 手机网站制作相关文章小程序开发一个多少钱啊
  • 个体工商户营业执照查询官网seo优化一般包括哪些内容
  • 网站建设合作伙伴广告大全
  • 今日疫情实时大数据武汉关键词seo排名
  • 专注高密做网站的搜索广告
  • 响应式网站适合用什么框架做苹果被曝开发搜索引擎对标谷歌
  • 成都asp网站建设dw网页设计模板网站
  • 沧州网站建设公司网络营销的四大基础理论
  • 公司网站开发费能记研发费用哪个科目全国最新疫情最新消息
  • 网站策划与建设阶段的推广seo的关键词无需
  • 做信息采集的网站手机金融界网站
  • 网站运营内容建设方案网上营销网站
  • b2b网站收费项目成人短期技能培训学校
  • 建设行业网站广州网站优化外包
  • 网站开发人员工作内容seo顾问服务
  • 区块链做网站都有哪些内容呢线上运营的5个步骤
  • 免费的手机网站模板新站优化案例
  • 做电影网站 广告收入什么平台可以免费推广产品
  • 为自己做的网站申请域名百度搜索指数的数据来源
  • 微页制作网站模板怎么建立网站平台
  • 深圳美食教学网站制作吉林网络推广公司