AI With Reinforcement Learning

Your task, put simply, is to design a reinforcement learning algorithm to teach the mouse how to find the food. The fundamental task is as follows: • There is a 100×100 matrix representing a grid where any space can either be occupied by a mouse or a piece of food. There is only one mouse, and an arbitrary amount of food. • The mouse is able to sense the food with a 3×3 matrix representing its sense of smell, the range of which is the full grid, and stacks (Two foods next to each other will generate twice as much smell). This will be the input for your algorithm. Note that the center of this matrix will always be 0, as that space represents the mouse itself. • The mouse has a limited amount of energy, which is fully replenished when it finds food. If it runs out of energy, it dies, and the game is over. • The mouse is able to move in any cardinal direction (North, South, East, and West). The goal is for them to eat all of the food in the grid as quickly as possible. This simulation is visually represented using PyGame. This task can also be solved by a trivial algorithm using nothing but simple arithmetic, as the ‘scent’ of food is a function of distance from the mouse. You can try to find a non RL solution and compare it to the best version of the RL algorithm’s results. For each frame, a forward pass is run through your model. The input for each frame is an array (or tuple) with four numbers between 0 and 1. These are the probabilities generated from your model. These will determine how the mouse moves. QUESTIONS: (The questions are not graded by correct/incorrect. They are just here to get the student thinking.) Q: Does the order matter for the reinforcement learning model? (Ex: Inputting (N,S,E,W) vs (N,E,S,W)) Q: Does the order matter for a closed form solution? Q: What would be better for reinforcement learning; taking the highest value from the array as the movement choice, or choosing a random direction weighted by the given probabilities? Why? Tasks for the students • Write a reward function. You have access to the current game state, as well as the number of previous frames (Ex: 50) of input matrices, food level, and number of food tiles found. This number of frames will be the same number of frames it takes to starve from a full energy level. This can be very simple, like just using the number of food tiles found, or use reward shaping using multiple frames of previous input matrices to create more frequent positive/negative rewards (Ex: when the mouse moves closer or farther away from food.) QUESTIONS: Q: What would be a sparse reward function for this model? Q: How can the reward function be improved? • Write a model: As described above, write a model that takes in 8 inputs (The mouse’s sensory matrix minus the center), and outputs four probabilities for each cardinal direction. In addition, you will be handling when to back-propagate a reward, or when to keep running. Additional task (Optional worth extra credit): There are many variables that you can mess around with to complicate the problem to make it more suitable to Reinforcement learning. One of them is decreasing the range of the mouse’s scent with the variable SCENT_RANGE. Another is the variable VARIABLE_TERRAIN which gives the mouse a second sense (sight) and adds a value to each terrain section which indicates how much energy is spend by stepping over that tile. Q: How does the reward function change if you add the new variables? For more Information on AI With Reinforcement Learning  check on this:


Don't use plagiarized sources. Get Your Custom Essay on
AI With Reinforcement Learning
Order Essay


Grand Paper Writers
Order NOW For A 10% Discount!
Pages (550 words)
Approximate price: -

Our Advantages

Plagiarism Free Papers

All papers are written by the best professional writers to ensure 100% originality. We always provide plagiarism reports whenever we deliver completed papers.

Free Revisions

All papers by Grand Paper Writers are completed and submitted on time. This timely delivery of papers gives you time to go through the paper before the official deadline.


As an additional service, we will provide a title page that precedes the contents of your paper. Here, you will provide your personal details.


We also ensure that we provide an extra page for the references or bibliographies following referencing rules.

Originality & Security

At, we guarantee students for the provision of security and original work. All your personal information is handled with confidentiality and is not shared with third parties. Additionally, we ensure that we provide original content with accompanying plagiarism reports to show originality.

24/7 Customer Support

Our customer support team is always available 24/7 to provide instant responses to any queries raised by students.

Try it now!

Calculate the price of your order

We'll send you the first draft for approval by at
Total price:

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services has the best professional essay writers for quality services.


Flexible Pricing

Here, a, we do not compromise on the time of our clients. We always deliver all completed papers on or before the deadlines.


Admission Help & Client-Writer Contact provides an interactive portal where students can communicate directly to their writers.


Paper Submission

Here, a, we do not compromise on the time of our clients. We always deliver all completed papers on or before the deadlines.


Customer Feedback appreciates feedback from our clients to help us improve the delivery of essay writing services. As such, we are constantly changing our policies to ensure maximum customer and writer satisfaction.