JC4004 Computational Intelligence

news/2024/12/12 18:41:03/文章来源:https://www.cnblogs.com/CSE2425/p/18601753

Programming assignment – Groupwork by a team of 4-5 students

Title: JC4004 – Computational Intelligence

Note: This assignment accounts for 30% ofthe total mark of the course.

Deadline: Submit the assignment in MyAberdeen by 19. December 2024 at 23:00 (China time).Information for Plagiarism and Collusion: The source code and your report may be submitted forplagiarism check in MyAberdeen. Please refer to the slides available at MyAberdeen for moreinformation about avoiding plagiarism before you start working on the assessment. Excessive useof large language models, such as ChatGPT, for writing the code or the report can also be consideredas plagiarism. In addition, submitting similar work with another group can be considered ascollusion.

Information about Extensions: According to the new extension policy of University of Aberdeen,teachers are no longer allowed to give deadline extensions for coursework assignments. Extensionmay be requested from the school administration by e-mail: uoa-ji-evidence, such as a medical certificate. See also a separate

ocument for the extension policy. Since this assignment is a groupwork assignment, extensionswould be granted in very exceptional situations only.page 2 of 6

Introduction In this assignment, your task is to build an artificial intelligence game bot for playing the traditionalboard game Fox and Goose. Your game bot should be able to play the game on both sides, as a foxand as a goose. The detailed rules of the game are explained below. Please note that there aredifferent versions of the game: for this assignment, you should follow therules described in thiscument.ox and Goose is a two-player board game. One of the players is a fox trying to capture all thegeese.Another player represents the geese and tries to surround the fox so that it cannot move any more.The game is played on a board with 33 possible locations for the fox and the geese. In the beginning,there are 15 geese and one fox on heboard, as illustrated in the Figure 1. The white pieces are thegeese, and the red piece is the fox.The game is played in turns. In this version of the game, the fox and the geese can both move one

tep horizontally, vertically, or diagonally on their turn along the lines on the board. The playerplaying goose can select any of the geese on the board to move. Please note that diagonal movement is only allowed from some of the positions, as indicated by the lineson the board. You cannot move a piece to a position that is already taken by another piece. However, the fox canapture (or eat) a goose by jumping over it to a freeposition. Thecaptured goose is removed fromhe board. It is also possible to capture multiple geese in one turn by chaining the jumps like inCheckers. A goose cannot capture the fox. It is not mandatory tocaptureeven if it is possible, but itis mandatory for both the fox and the geese to make a move in their turn. Examples of legal movesare shown in Figure 2 below.

The goal of the geese is to surround the fox so that it cannot make any legal moves anymore. Thegoal of the fox is to capture all the geese. Theoretically, the minimum of four geese would be enoughto surround the fox; therefore, the fox wins when there are less than four geese left on the board.Examples of winning the game are shown in Figure 3.nce the fox and thegeese have a different goal and follow different rules, the game is unbalanced.herefore, the players usually play an even number of games, swapping their roles. The playerthatFigure 1. Initial positions in Fox and Goose.wins more games is the final winner. In this assignment, your task is to implement the game logic forboth the fox and the goose.Figure 2. Examples of legal moves for the geese (left) and the fox(right)espectively.Figure 3. Examples of the fox winning the game (left) and the geese winning the game (right).General Guidance and Requirements ard ispassed to the methods as a parameter, and the methods will return the next move as a fox or as aoose, respectively. Python file TestFoxAndGoose.py will be shared to demonstrate how the gametesting framework uses the Player class.

page 3 of 6page 4 of 6 The board is a 2-D list object with 7 × 7 characters representing the state of the game. Characters'F' and 'G' mark the fox and the geese, respectively. An empty position ismarked with a dot '.'

and a space ' ' marks a position that is off the playing area. The board is initialised in classFoxAndGoose in file TestFoxAndGoose.py as follows:The play_fox() and wo or more pairs of integers, where the first value represents the row, and the second valuerepresents the column on the board. The first pair is the initial position, and the second pair is thetarget position. For example, return value [[3,2],[3,3]] meansthat the piece in the 4th row, 3rdcolumn will be moved to the 4th row, 4th column. Note that the numbering starts from zero: forexample, position [0,1] is the 2 nd column of the 1 st row.The play_fox()method can return a longer list with several target positions in case the foxcaptures more than just one goose in one move. For example, return value [[3,3],[3,1],

5,3]] meansthat the fox first jumps from position [3,3] to position [3,1], capturing the goosein position [3,2], and then continues to position [5,3], capturing the goose in position [4,2].You can decide freely what kind of techniques of computational intelligence you use to implementthe game logic. You can implement additional functions and classes if necessary. However, thePlayer class should interact with the game framework only through the play_fox() andlay_goose()methods, as described above. The bot should have a reasonable complexity: in theesting phase, a time limit of 5 seconds will be applied to consider the moves. If your implementationrequires time-consuming initialisation, such as downloading a deep neural network, initialisationshould be done in the class Player constructor __init__, not the play_fox()andplay_goose()methods.You can use code generation tools and code from external sources moderately for assistingimplementation of parts of the code, but the use of any sources or tools should be explained, andou should submit the work in the course page in MyAberdeen. Your submission should include atleast two files: file TeamXX.py that includes the Python code implementing 代写JC4004  Computational Intelligence class Player withmethods play_fox() and play_goose(), and ReportXX.pdf that is the projectreport. In theile names, replace XX with team number, for example 05. As an example, we provide file Team00.py that allows you to play the game manually with moves entered by ahuman user. If your code requiresany additional files to run, such as pre-trained neural network, you should include them also in yoursubmission.Please note that it is your responsibility to make sure thatthe code in TeamXX.py works when wetest it: you should use file TestFoxAndGoose.py to import your class and to test that your code workswith the testing framework. Replace module name Team00 in module=__import__("Team00") with your own file name without .py extension. If your code has externaldependencies requiring additional installations, they should be clearly explained in the project reportor readme file included in the submission.Note that the game bots implemented by different groups will play against each other, so it is essential to ensurecompatibility. You should use Python 3. If you use any third-party packages suchas TensorFlow or PyTorch, we recommend using the latest stable version and to avoid using featureswith known backwards compatibility problems. We suggest startingwith a clean environment and tokeep track of all the installed packages and their version numbers and reporting them in the projectreport or readme file.Note that at the time of writing, the latest TensorFlow version is not compatible with the latest stablePython release 3.13.0. Therefore, if you plan to use TensorFlow, the Python version should be 3.12.7 or earlier.Thelength of the project report should be approximately 1,500 words. It is recommended to includegraphical illustrations, but screenshots of the program code should be avoided. If the codemplements some complex algorithms that are difficult to explain otherwise, flowcharts orpseudocode can be used as tools of illustration. The report should include thefollowing sections:

  1. Introduction: about 200 words.
  2. Theoretical basis, including description of the used methods and algorithms with a briejustification why those techniques were chosen: about 600 words.
  1. Implementation details, including the used libraries and e.g., an UML diagram or a list of thessential methods and their parameters: about 300 words.Conclusions, including self-reflection, difficulties faced, experiences from testing the code,and ideas for future improvements: about 300 words. Summary of the individual roles, including brief description of team members’ contributions:about 100 words.
  1. References.If you wish the results for your group to be published in the leaderboard in MyAberdeen, please givea name for your group in the report!

page 5 of 6page 6 of 6 Marking Criteria The assignment will be marked based on the project report (40 marks), methodology (40 marks), andperformance (20 marks).The project report will be marked according to the coverage of the required aspects, clarity of

presentation (including language and illustrations), consistency between the report and thesubmitted code, and relevance of the references.The methodology will be evaluated based on the suitability of the chosen methods and algorithmsfor the given task, creativity (for example, combining different methods in an unconventional way),and implementation (e.g., clarity of the source code, computational efficiency).For performance evaluation, we will test all the submitted assignments by arranging them to playagainst each other. Every submission will play against each of the other submissions twice, once as afox and once as a goose. The results will be aggregated in a league table, where a win gives one point,and a loss gives zero points. The winner will be awarded 20 marks, and the other groups will beawarded marks based on the formula:𝑚𝑖 =20𝑥𝑖𝑥𝑤𝑖𝑛𝑛𝑒𝑟where 𝑚𝑖 is the markfor group 𝑖, 𝑥𝑖 is the total points for group 𝑖, and 𝑥𝑤𝑖𝑛𝑛𝑒𝑟 is the total points forthe winner of the league.Note that if both game bots repeat moves back and forth to the same position, the game may end ina deadlock situation. To resolve deadlocks, the maximum number of movesis set to 1000. If the gamends without a winner due to a deadlock, both players will be awarded zero points.

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/851513.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

转载:【AI系统】CANN 算子类型

算子是编程和数学中的重要概念,它们是用于执行特定操作的符号或函数,以便处理输入值并生成输出值。本文将会介绍 CANN 算子类型及其在 AI 编程和神经网络中的应用,以及华为 CANN 算子在 AI CPU 的详细架构和开发要求。 算子基本介绍 一元算子通过对单个操作数进行操作,如取…

四个强大的 Salesforce 开源替方案(附成本对比)

探索 Salesforce CRM 的最佳开源替代方案。了解像 NocoBase 这样的工具如何为寻求强大 CRM 解决方案的企业提供灵活定制和高性价比。关于 Salesforce Salesforce 于1999 年在美国旧金山创立,作为最早一批提供软件即服务(SaaS) 的公司之一,Salesforce 开创了基于云计算的商业…

转载:【AI系统】混合并行

混合并行(HybridParallel)是一种用于分布式计算的高级策略,它结合了数据并行和模型并行的优势,以更高效地利用计算资源,解决深度学习中的大模型训练问题。混合并行不仅能提高计算效率,还能在有限的硬件资源下处理更大的模型和数据集。在深度学习中,数据并行和模型并行各…

转载:【AI系统】张量并行

在大模型的训练中,单个设备往往无法满足计算和存储需求,因此需要借助分布式训练技术。其中,模型并行(Model Parallelism, MP)是一种重要的方法。模型并行的基本思想是将模型的计算任务拆分到不同的设备上执行,以提高训练效率和处理更大规模的模型。下面将重点介绍模型并行…

转载:【AI系统】动手实现 PyTorch 微分

这里记录一下使用操作符重载(OO)编程方式的自动微分,其中数学实现模式则是使用反向模式(Reverse Mode),综合起来就叫做反向 OO 实现 AD 啦。 基础知识 下面一起来回顾一下操作符重载和反向模式的一些基本概念,然后一起去尝试着用 Python 去实现 PyTorch 这个 AI 框架中最…

转载:【AI系统】计算图原理

在前面的文章曾经提到过,目前主流的 AI 框架都选择使用计算图来抽象神经网络计算表达,通过通用的数据结构(张量)来理解、表达和执行神经网络模型,通过计算图可以把 AI 系统化的问题形象地表示出来。 本文将会以 AI 概念落地的时候,遇到的一些问题与挑战,因此引出了计算图…

转载:【AI系统】计算图基本介绍

在 AI 框架发展的最近一个阶段,技术上主要以计算图来描述神经网络。前期实践最终催生出了工业级 AI:TensorFlow 和 PyTorch,这一时期同时伴随着如 Chainer、DyNet、CNTK、PaddlePaddle、JAX 等激发了框架设计灵感的诸多实验课程。 TensorFlow 和 PyTorch,特别是 PyTorch 代…

转载:【AI系统】什么是微分

自动微分(Automatic Differentiation,AD)是一种对计算机程序进行高效准确求导的技术,一直被广泛应用于计算流体力学、大气科学、工业设计仿真优化等领域。 近年来,机器学习技术的兴起也驱动着对自动微分技术的研究进入一个新的阶段。随着自动微分和其他微分技术研究的深入…

转载:【AI系统】Auto-Tuning 原理

在硬件平台驱动算子运行需要使用各种优化方式来提高性能,然而传统的手工编写算子库面临各种窘境,衍生出了自动生成高性能算子的的方式,称为自动调优。在本文我们首先分析传统算子库面临的挑战,之后介绍基于 TVM 的业界领先的三个自动调优系统。 高性能算子挑战 DNN 部署的硬…

转载:【AI系统】微分计算模式

上一篇文章简单了解计算机中常用几种微分方式。本文将深入介绍 AI 框架离不开的核心功能:自动微分。 而自动微分则是分为前向微分和后向微分两种实现模式,不同的实现模式有不同的机制和计算逻辑,而无论哪种模式都离不开雅克比矩阵,所以我们也会深入了解一下雅克比矩阵的原理…

转载:【AI系统】AI 框架之争

在前面的内容主要是讲述了 AI 框架在数学上对自动微分进行表达和处理,最后表示称为开发者和应用程序都能很好地去编写深度学习中神经网络的工具和库,整体流程如下所示:除了要回答最核心的数学表示原理以外,实际上 AI 框架还要思考和解决许多问题,如 AI 框架如何对实际的神…

转载:【AI系统】指令和存储优化

除了应用极广的循环优化,在 AI 编译器底层还存在指令和存储这两种不同优化。 指令优化 指令优化依赖于硬件提供的特殊加速计算指令。这些指令,如向量化和张量化,能够显著提高计算密度和执行效率。向量化允许我们并行处理数据,而张量化则进一步扩展了这一概念,通过将数据组…