99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫Tic-Tac-To: Markov Decision、代做java程序語言
代寫Tic-Tac-To: Markov Decision、代做java程序語言

時間:2024-12-14  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



Coursework 2 – Tic-Tac-To: Markov Decision
Processes & Reinforcement Learning (worth 25%
of your final mark)
Deadline: Thursday, 28th November 2024
How to Submit: To be submitted to GitLab (via git commit & push) – Commits are
timestamped: all commits after the deadline will be considered late.
Introduction
Coursework 2 is an individual assignment, where you will each implement Value
Iteration, Policy Iteration that plan/learn to play 3x3 Tic-Tac-Toe game. You will test
your agents against other rule-based agents that are provided. You can also play against
all the agents including your own agents to test them.
The Starter Code for this project is commented extensively to guide you, and includes
Javadoc under src/main/javadoc/ folder in the main project folder - you should read
these carefully to learn to use the classes. This is comprised of the files below.
You should get the Starter Code from GitLab: Follow the step by step instructions in
the document I have put together for you:
Open Canvas->F29AI -> Modules -> GitLab (and Git) Learning Materials (Videos and
Crib Sheets) -> Introduction to Eclipse, Git & GitLab.
If you are unfamiliar with git and/or GitLab I strongly suggest watching Rob
Stewart’s instructive videos on Canvas under the same module
Files you will edit & submit
ValueIterationAgent.java A Value Iteration agent for solving the Tic-Tac-Toe
game with an assumed MDP model.
PolicyIterationAgent.java A Policy Iteration agent for solving the Tic-Tac-Toe
game with an assumed MDP model.
QLearningAgent.java A q-learner, Reinforcement Learning agent for the
Tic-Tac-Toe game.
Files you should read & use but shouldn’t need to edit
Game.java The 3x3 Tic-Tac-Toe game implementation.
TTTMDP.java Defines the Tic-Tac-Toe MDP model
TTTEnvironment.java Defines the Tic-Tac-Toe Reinforcement Learning
environment
Agent.java Abstract class defining a general agent, which other
agents subclass.
HumanAgent.java Defines a human agent that uses the command line to
ask the user for the next move
RandomAgent.java Tic-Tac-Toe agent that plays randomly according to a
RandomPolicy
Move.java Defines a Tic-Tac-Toe game move
Outcome.java A transition outcome tuple (s,a,r,s’)
Policy.java An abstract class defining a policy – you should subclass
this to define your own policies
TransitionProb.java A tuple containing an Outcome object and a probability
of the Outcome occurring.
RandomPolicy.java A subclass of policy – it’s a random policy used by a
RandomAgent instance.
What to submit: You will fill in portions of ValueIterationAgent.java,
PolicyIterationAgent.java and QLearningAgent.java during the assignment.
Commit & push your changes to your fork of the repository. Do this frequently so
nothing is lost. There will soon be automatic unit tests written for this project, which
means that you’ll be able to see whether your code passes the tests, both locally, and on
GitLab. I will send an announcement once I’ve uploaded the tests.
PLEASE DO NOT UPLOAD YOUR SOLUTIONS TO A PUBLIC REPOSITORY. We have
spent a great deal of time writing the code & designing the coursework and want to be
able to reuse this coursework in the coming years.
Evaluation: Your code will be tested on GitLab for correctness using Maven & the Java
Unit Test framework. Please do not change the names of any provided functions or
classes within the code, or you will wreck the tests.
Mistakes in the code: If you are sure you have found a mistake in the current code let
me or the lab helpers know and we will fix it.
Plagiarism: While you are welcome to discuss the problem together in the labs, we will
be checking your code against other submissions in the class for logical redundancy. If
you copy someone else's code and submit it with minor changes, we will know. These
cheat detectors are quite hard to fool, so please don't try. We trust you all to submit
your own work only; please don't let us down. If you do, we will pursue the strongest
consequences with the school that are available to us.
Getting Help: You are not alone! If you find yourself stuck on something, ask in the
labs. You can ask for help on GitLab too – but it means you will need to commit & push
your code first: don’t worry, you won’t be judged until the deadline. It’s good practice to
commit & push your code frequently to the repository, even if it doesn’t work.
We want this coursework to be intellectually rewarding and fun.
MDPs & Reinforcement Learning
To get started, run Game.java without any parameters and you’ll be able to play the
RandomAgent using the command line. From within the top level, main project folder:
java –cp target/classes/ ticTacToe.Game
You should be able to win or draw easily against this agent. Not a very good agent!
You can control many aspects of the Game, but mainly which agents will play each
other. A full list of options is available by running:
java –cp target/classes/ ticTacToe.Game -h
Use the –x & -o options to specify the agents that you want to play the game. Your own
agents, namely, Value Iteration, Policy Iteration, and Q-Learning agents are denoted as
vi, pi & ql respectively, and can only play X in the game. This ignores the problem of
dealing with isomorphic state spaces (mapping x’s to o’s and o’s to x’s in this case). For
example if you want two RandomAgents to play out the game, you do it like this:
java target/classes/ ticTacToe.Game –x random –o
random
Look at the console output that accompanies playing the game. You will be told about
the rewards that the ‘X’ agent receives. The `O’ agent is always assumed to be part of
the environment.
Question 1 (6 points) Write a value iteration agent in ValueIterationAgent.java
which has been partially specified for you. Here you need to implement the iterate() &
extractPolicy() methods. The former should perform value iteration for a number of
steps (k steps – this is one of the fields of the class) and the latter should extract the
policy from the computed values.
Your value iteration agent is an offline planner, not a reinforcement agent, and so the
relevant training option is the number of iterations of value iteration it should run in its
initial planning phase – you can change this in ValueIterationAgent.java.
ValueIterationAgent constructs a TTTMDP object on construction – you do not need to
change this class, but use it in your value iteration implementation to generate the set of
next game states (the sPrimes), their associated probabilities & rewards when executing
a move from a particular game state (a Game object). You can do this using the provided
generateTransitions method in the TTTMDP class, which effectively gives you a
probability distribution over Outcomes.
Value iteration computes k-step estimates of the optimal values, Vk. You will see that the
the Value Function, Vk is stored as a java HashMap, from Game objects (states) to a
double value. The corresponding hashCode function for Game objects has been
implemented so you can safely use whole Game objects as keys in the HashMap.
Note: You may assume that 50 iterations is enough for convergence in this question.
Note: Unlike the MDPs in the class, in the CW2 implementation, your agent receives a
reward when entering a state – the reward simply depends on the target state, rather
than on source state, action, and target state. This means that there is no imagined
terminal state outside the game like in the lectures. Don’t worry – all the methods you
have learned are compatible with this setting.
Note: The O agent is modelled as part of the environment, so that once your agent
(X) takes an action, any next observed state would include O’s move. The agents need
NOT care about the intermediate game/state where only they have played and not yet
the opponent.
The following command loads your ValueIterationAgent, which will compute a policy
and executes it 10 times against the other agent which you specify, e.g. random, or
aggressive. The –s option specifies which agent goes first (X or O). By default, the X
agent goes first.
java target/classes/ ticTacToe.Game -x vi -o
random –s x
Question 2 (1 point): Test your Value Iteration Agent against each of the provided
agents 50 times and report on the results – how many games they won, lost & drew
against each of the other rule based agents. The rule based agents are: random,
aggressive, defensive.
This should take the form of a very short .pdf report named: vi-agent-report.pdf.
Commit this together with your code, and push to your fork.
Question 3 (6 point) Write a Policy Iteration agent in PolicyIterationAgent.java by
implementing the initRandomPolicy(), evaluatePolicy(), improvePolicy() &
train() methods. The evaluatePolicy() method should evaluate the current policy
(see your lecture notes), specified in the curPolicy field (which your
initRandomPolicy() initialized). The current values for the current policy should be
stored in the provided policyValues map. The improvePolicy() method performs the
Policy improvement step, and updates curPolicy.
Question 4 (1 point): As in Question 2, this time test your Policy Iteration Agent
against each of the provided agents 50 times and report on the results – how many
games they won, lost & drew. The other agents are: random, aggressive, defensive.
This should take the form of a very short .pdf report named: pi-agent-report.pdf.
Commit this together with your code, and push to your fork.
Questions 5 & 6 are on Reinforcement Learning:
Question 5 (5 points): Write a Q-Learning agent in QLearningAgent.java by
implementing the train() & extractPolicy()methods. Your agent should follow an
e-greedy policy during training (and only during training – during testing it should follow
the extracted policy). Your agent will need to train for many episodes before the qvalues converge. Although default values have been set/given in the code, you are
strongly encouraged to play round with the hyperparameters of q-learning: the learning
rate (a), number of episodes to train, as well as the epsilon in the e-greedy policy
followed during training.
Question 6 (1 point): Like the previous questions, test your Q-Learning Agent against
each of the provided agents 50 times and report on the results - how many games they
won, lost & drew. The other agents are: random, aggressive, defensive.
This should take the form of a very short .pdf report named: ql-agent-report.pdf.
Commit this together with your code, and push to your fork.
Javadoc: There is extensive comments in the code, Javadoc (under the folder doc/ in
the project folder) and inline. You should read these carefully to understand what is
going on, and what methods to call/use. They might also contain hints in the right
direction.
Value of Terminal States: you need to be careful about the values of terminal states -
terminal states are states where X has won, states where O has won, and states where
the game is a draw. The value of these game states - V(g) - should under all
circumstances and in all iterations be set to 0. Here’s why: to find the optimal value
of a state you will be looping over all possible actions from that state. For terminal states
this is empty, and might, depending on your implementation of finding the
maximum, lead to a result where you would be setting the value of the terminal state to
a very low negative value (e.g. Double.MIN_VALUE). To avoid this, for every game
state g that you are considering and calculating its optimal value, CHECK IF IT
IS A TERMINAL STATE (using g.isTerminal()); if it is, set its value to 0, and
move to the next game state (you can use the ‘continue;’ statement inside your
loop). Note that your agent would have already received its reward when
transitioning INTO that state, not out of it.
Testing your agent: If everything is working well, and you have the right parameters
(e.g. reward function) your agents should never lose.
You can play around with the reward values in the TTTMDP class – especially try
increasing or decreasing the negative losing reward. Increasing this negative reward (to
more negative numbers) would encourage your agent to prefer defensive moves to
attacking moves. This will change their behavior (both for Policy & Value iteration) and
should encourage your agent to never lose the game. Machine Learning isn't like
Mathematics with complete certainty - you almost always have to experiment to get the
parameters of your model right!

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp





 

掃一掃在手機打開當前頁
  • 上一篇:泰國駕照轉廣州駕照要怎么做(多長時間)
  • 下一篇:代寫JC4004編程、代做Python設計程序
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                国产偷v国产偷v亚洲高清| 成人av在线一区二区三区| 91.com在线观看| 成人动漫精品一区二区| 欧美一区二区三区在线观看视频| 国产91精品一区二区麻豆网站| 678五月天丁香亚洲综合网| 成人免费va视频| 国产精品99久久久久久久vr| 日本不卡一二三| 一区二区三区在线影院| 国产精品久久久久影院老司| 粉嫩av一区二区三区| 粉嫩aⅴ一区二区三区四区五区 | 欧美久久免费观看| 波多野结衣中文字幕一区二区三区| 日韩二区三区在线观看| 亚洲一二三四久久| 中文字幕不卡三区| 国产人成一区二区三区影院| www激情久久| xnxx国产精品| 国产亚洲精品aa| 精品99久久久久久| 精品99一区二区三区| 精品国产一区二区三区av性色 | 麻豆成人在线观看| 日产欧产美韩系列久久99| 欧美三区免费完整视频在线观看| 高清国产午夜精品久久久久久| 亚洲va国产va欧美va观看| 亚洲男帅同性gay1069| 国产精品久久久久影院亚瑟| 国产精品丝袜黑色高跟| 国产欧美日韩在线视频| 中文字幕第一区| 日韩在线a电影| 欧美手机在线视频| 成人高清视频在线| av亚洲精华国产精华精| 麻豆国产一区二区| 久久久精品tv| 国产精品理伦片| 亚洲欧美日韩久久精品| 久久久99久久| 中文字幕精品一区二区精品绿巨人| 欧美成人bangbros| 色综合视频在线观看| 在线观看国产91| 亚洲成人精品一区二区| 国产精品九色蝌蚪自拍| 91老师片黄在线观看| 欧美日本在线一区| 欧美精品一区二区三区高清aⅴ| 久久久久国产精品麻豆| 亚洲视频图片小说| 日韩中文字幕亚洲一区二区va在线 | 91国产成人在线| av不卡免费电影| 亚洲激情自拍偷拍| 麻豆精品视频在线观看| bt欧美亚洲午夜电影天堂| 欧美日韩精品一二三区| 26uuu色噜噜精品一区| 亚洲色图.com| 日韩黄色免费电影| 国产精品主播直播| 在线观看日韩一区| 国产午夜亚洲精品理论片色戒 | 色婷婷av一区二区三区大白胸| 乱一区二区av| 日韩av电影天堂| 国产成人免费网站| 欧美日韩一区二区三区免费看| 精品国产一区a| 亚洲在线成人精品| av一区二区三区黑人| 精品久久久久香蕉网| 亚洲高清不卡在线| 不卡一区中文字幕| 亚洲精品在线一区二区| 亚洲国产一区二区a毛片| 国产精品99久久久久久有的能看| 欧美精品丝袜久久久中文字幕| 日本一区二区综合亚洲| 日韩精品乱码av一区二区| 国产主播一区二区三区| 欧美日韩高清在线播放| 中文字幕一区二区视频| 国内成人精品2018免费看| 亚洲成人先锋电影| 香蕉久久一区二区不卡无毒影院| 日韩欧美成人一区| 日精品一区二区三区| 亚洲国产精品一区二区www| 欧美精品一区二区三区一线天视频 | 午夜天堂影视香蕉久久| 国产精品理论在线观看| 色婷婷精品大在线视频| 狠狠网亚洲精品| 奇米精品一区二区三区在线观看 | 日本一区二区在线不卡| 欧美精品三级在线观看| 欧美日韩高清一区二区| 欧美亚洲尤物久久| 日韩欧美国产三级电影视频| 综合网在线视频| 亚洲激情成人在线| 亚洲精品国久久99热| 亚洲伊人色欲综合网| 亚洲一区二区三区不卡国产欧美| 久久久久久影视| 久久久久久97三级| 日本一区二区三区久久久久久久久不| 亚洲国产高清在线观看视频| 亚洲国产成人午夜在线一区| 欧美三级电影网站| 91精品国产黑色紧身裤美女| 91极品美女在线| 欧美日韩一区二区在线观看| 欧美日韩中文精品| 国产91精品露脸国语对白| 北岛玲一区二区三区四区 | 成人性生交大片免费看中文网站| 美女被吸乳得到大胸91| 亚洲黄色小视频| 亚洲成av人片观看| 老司机精品视频在线| 粉嫩嫩av羞羞动漫久久久| 99r国产精品| 91精品国产一区二区| 欧美tk—视频vk| 欧美高清视频一二三区| 久久精品人人做人人综合| 国产精品久久久久久妇女6080| 一区二区三区免费网站| 国产精品久久久99| 一区二区三区产品免费精品久久75| 日韩影视精彩在线| 色婷婷久久综合| 久久毛片高清国产| 一区二区三区四区乱视频| 国产成+人+日韩+欧美+亚洲| 国产精品资源网站| 欧美精品成人一区二区三区四区| 亚洲综合激情另类小说区| 麻豆中文一区二区| 国产精品色噜噜| 欧美一区二区黄色| 北条麻妃一区二区三区| 青草av.久久免费一区| 欧美激情自拍偷拍| 欧美自拍偷拍午夜视频| 久久99精品国产.久久久久久| 中文字幕精品一区二区三区精品 | 国产九色精品成人porny| 亚洲日韩欧美一区二区在线| 欧美乱妇23p| 高清shemale亚洲人妖| 午夜精品福利一区二区三区av | 亚洲视频一区在线| 91精品国产欧美一区二区成人| 国产 欧美在线| 免费欧美高清视频| 亚洲精品你懂的| 久久久久久亚洲综合| 色婷婷综合在线| 经典三级一区二区| 亚洲国产美国国产综合一区二区| 久久亚区不卡日本| 久久夜色精品国产噜噜av| 欧美中文字幕亚洲一区二区va在线| 国产精品一二三区| 亚洲大片在线观看| 国产欧美日韩在线| 日韩片之四级片| 精品视频一区二区不卡| 国产一区二区免费看| 日韩精品一二三四| 国产精品的网站| 精品成人一区二区三区四区| 欧美日韩免费在线视频| 成人精品视频.| 国产资源在线一区| 久久狠狠亚洲综合| 日韩国产欧美在线视频| 国产精品久久久久影院老司| 欧美不卡一二三| 日韩一级完整毛片| 欧美精品少妇一区二区三区| 在线精品观看国产| 日本精品免费观看高清观看| 豆国产96在线|亚洲| 狠狠色丁香久久婷婷综合丁香| 美女爽到高潮91| 国产乱码精品一区二区三区忘忧草 | 一区二区在线看| 一区二区三区精品在线| 亚洲国产日韩av| 日韩国产精品久久久|