Merged
Conversation
Contributor
|
Here's a slightly simpler (and super hacky) version (12 instead of 20 active nodes) of this idea that reaches an optimal score of ~14.7. |
Owner
|
Thanks, let me test it. And since @vforch proposed an improvement, you can you two submit another entry with the modification. |
Owner
|
I create the new entry. Impressive results. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
some explanation about the 'switcher' model
I define an "agent" with a subsumption architecture using 3 "behaviors". The agent follows the outer wall turning in an anti-clockwise direction and avoids obstacles too close on its left. When its energy rises up, it is a kind of positive reward signal for the agent that "memorize" it so as to trigger an "early" turn left in the middle corridor. At the end of this "turning left in the middle corridor", the agent silences the reward signal and its memorization.
Oh, and I'm using "ReLu" activation for neurons, easier to work with (on/off) for handcrafting weights.
This "handcrafted" agent could be streamlined, its behavior is not very robust and it sometimes get stuck. But the desired general behavior is there.
behavior : "away from right"
When input from the rightmost sensors is below a threshold, turn left (positive output).
behavior : "avoid close things on the left"
Sometimes, the agents comes to close to a left wall, so it avoids it by turning right (negative output when input of the leftmost sensor is above a threshold)
behavior : "when rewarded, take the first left"
First, the agents needs to create a "reward" signal, based on it energy variation. Energy variation is computed as inputEnergy(t) - inputEnergy(t-1), and cumulated if positive (being the main motivation for using ReLu activation function). BUT, as the initial difference is high (as the inputEnergy(0-1) is 0), I need to filter out "large" energy bumps.
Then, the reward signal is "memorized" (and slightly amplified) in
X[i_filter+2,0], this is a signal for initiating the "turn into the mid corridor".Not very proud of this part that seems a bit over complicated.
To trigger the turn in the middle corridor (only when the reward signal is high enough), the agent kind of detects when the leftmost sensor is low (below threshold) for sometime. Then it turns right until a centerSensor is low enough (meaning the agents faces a far away wall). When "turning into the mid corridor" ends, the agents shuts off the reward accumulation (
X[i_filter+2, 0]) and the signal that triggered the "mid_turn" (X[i_turn_mid+1]).