Function of intermediateReward

78 views
Skip to first unread message

Juan Luis

unread,
Jun 10, 2012, 4:48:51 AM6/10/12
to Mario Competition
Hi All,

I can't understand the purpose of intermediateReward in
MarioEnvironment. It never changes (-1.0), but you can use it in your
agent with giveIntermediateReward method if you want.

What is its purpose?

Juan Luis

unread,
Jun 26, 2012, 6:41:30 AM6/26/12
to mariocom...@googlegroups.com
anyone??

Sergey Karakovskiy

unread,
Jun 26, 2012, 8:05:56 AM6/26/12
to mariocom...@googlegroups.com
Hi, Juan

This inermediateReward allows one to fine tune the events happening to Mario. So you can set inside the benchmark inermediateReward +5, for instance, for getting a mushroom and -10 if Mario gets hurt. It's an optional thing for end user of a benchmark.

Sergey

2012/6/26 Juan Luis <chi...@gmail.com>



--
--
Kind regards,
Sergey

Simos Gerasimou

unread,
Jun 26, 2012, 8:13:56 AM6/26/12
to mariocom...@googlegroups.com
Hi, 

the intermediateReward function is mainly used to get immediate feedback regarding the actions the agent performs. For example a positive immediate reward will be given when Mario performs a good action such as  collecting a coin, killing an enemy etc and a negative immediate reward will be given when he collides with an enemy, falls into the gap etc.

Hint: if you are using any CI based technique to train your agent, you should implement and use this function in an appropriate way so as to provide the necessary feedback to the agent.

Simos


On Sunday, June 10, 2012 10:48:51 AM UTC+2, Juan Luis wrote:

Juan Luis

unread,
Jun 27, 2012, 10:59:27 AM6/27/12
to mariocom...@googlegroups.com
Hi, thanks both for your answers.

I understand that I have to modify the method giveIntermediateReward in my agent, but it only have one parameter, environment.getIntermediateReward() and it always have the same value, -1. It never changes.

So Can I modify it in basicTask class and use it for my agen?

Thanks all

On Sunday, June 10, 2012 10:48:51 AM UTC+2, Juan Luis wrote:

Simos Gerasimou

unread,
Jun 28, 2012, 4:38:09 AM6/28/12
to mariocom...@googlegroups.com
Hi,

Em.... No no.... Don't mess up with the Task classes. You only have to implement the Agent/Learning interface, depending on which track you want to compete in. For instance, if you want to compete in the Learning Track your class should implement the Learning Agent interface and write the code you want for the unimplemented methods (including giveIntermediateReward). Otherwise, if you aim for the GamePlay track you should implement the Agent interface. 

Have a look in the "competition" folder for more examples.

PS: The MarioAI package although is not sufficiently explained and documented, it is not that difficult to understand how the interaction between the classes is achieved. You just have to spend some time looking at the source code and keeping useful notes. 
This procedure worked for me last year, when I implemented my learning agent using Reinforcement Learning.

Simos
Reply all
Reply to author
Forward
0 new messages