-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agent update #8
Agent update #8
Conversation
+minor reformat
using autoprep8 to reformat code for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested these on my end also and they as expected with your new code.
You can merge but i did put some comments in the review for you to check :)
|
||
def get_new_action(self, prev_step: AAIAction) -> AAIAction: | ||
""" | ||
Provide a vector of 9 real values, one for each action, which is then softmaxed to provide the probability of selecting that action. Relative differences between the values is what is important. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this need to be maintained in the long run? For example, we may add new actions to the agent so will this script need to be maintained accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will require updates.
@@ -20,6 +20,7 @@ def main(): | |||
rayMaxDegrees=30, | |||
raysPerSide=(n_rays - 1) // 2, | |||
play=False, | |||
inference=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was inference set true here and was not the case before the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because presumably the user would want to watch the agent completing the task to confirm expected behaviour.
animalai/raycastparser.py
Outdated
@@ -28,6 +28,7 @@ class RayCastObjects(enum.Enum): | |||
SIGNPOSTER = 11 | |||
DECAYGOAL = 12 | |||
DECAYGOALBOUNCE = 13 | |||
HOLLOWBOX = 14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this with this PR as otherwise it would have been delayed until the next major PR for python codebase. Standalone mod.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is best practice.
randomAgent = RandomActionAgent(step_length_distribution=lambda: np.random.normal( | ||
5, 1)) # a Rayleigh walker (sampling from normal distribution) | ||
|
||
# by default should be AnimalAI?team=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you mean by this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which part? a Rayleigh Walker
is a type of random walker in stochastic process theory, where angles and saccades are drawn from normal distributions. The default to AnimalAI?team=0
is the standard behaviour for the AAI low-level API.
actions = AAIActions() | ||
|
||
# Run two episodes | ||
for _episode in range(2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do the episodes start at index 0? so, arena 0, arena 1, ... , n arenas.
Did i misunderstand this loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It plays the config twice over.
@@ -7,11 +7,11 @@ arenas: | |||
- !Item | |||
name: Agent | |||
positions: | |||
- !Vector3 { x: 5, y: 1, z: 5 } | |||
- !Vector3 { x: 5, y: 0, z: 5 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to let you know the y value constraints are corrected in unity (as heads up note)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good change.
have you also considered the versioning? Is this a breaking change (becomes version 5.0.0) to the braintenberg agent? Or can we go to 4.1.0 OR 4.0.2 depending on the scale of the changes @kozzy97 |
This is not a breaking change (the behaviour of the braitenberg is slightly different and more reliable but all scripts should work the same), but the addition of the random action agent is significant. I would recommend this, plus the hollowbox change, be included in a 4.1.0 release. |
Proposed change(s)
I have added a random action agent implemented with the low-level API (as per Braitenberg) and fixed the reliability of the braitenberg agent.
Types of change(s)
Checklist
Other comments
Screenshots (if any)