-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from RLBots/copy_trainer
Added keras support to the model. Also added some ways to visualize the models Fixed a ton of bugs
- Loading branch information
Showing
36 changed files
with
1,209 additions
and
533 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import numpy as np | ||
|
||
from conversions.input.input_formatter import InputFormatter | ||
|
||
|
||
class SimpleInputFormatter(InputFormatter): | ||
|
||
def create_input_array(self, game_tick_packet, passed_time=0.0): | ||
# posx, posy, posz, rotx, roty, rotz, vx, vy, vz, angvx, angy, angvz, boost_amt, ballx, bally, ballz, ballvx, ballvy, ballvz | ||
inputs = [game_tick_packet.gamecars[self.index].Location.X, | ||
game_tick_packet.gamecars[self.index].Location.Y, | ||
game_tick_packet.gamecars[self.index].Location.Z, | ||
game_tick_packet.gamecars[self.index].Rotation.Pitch, | ||
game_tick_packet.gamecars[self.index].Rotation.Yaw, | ||
game_tick_packet.gamecars[self.index].Rotation.Roll, | ||
game_tick_packet.gamecars[self.index].Velocity.X, | ||
game_tick_packet.gamecars[self.index].Velocity.Y, | ||
game_tick_packet.gamecars[self.index].Velocity.Z, | ||
game_tick_packet.gamecars[self.index].AngularVelocity.X, | ||
game_tick_packet.gamecars[self.index].AngularVelocity.Y, | ||
game_tick_packet.gamecars[self.index].AngularVelocity.Z, | ||
game_tick_packet.gamecars[self.index].Boost, | ||
game_tick_packet.gameball.Location.X, | ||
game_tick_packet.gameball.Location.Y, | ||
game_tick_packet.gameball.Location.Z, | ||
game_tick_packet.gameball.Velocity.X, | ||
game_tick_packet.gameball.Velocity.Y, | ||
game_tick_packet.gameball.Velocity.Z | ||
] | ||
return inputs | ||
|
||
def get_state_dim(self): | ||
return 19 | ||
|
||
def format_array(self, input_length, array): | ||
""" | ||
Formats the array to properly fit the model | ||
:param input_length: The batch size of the array | ||
:param array: A numpy array that is being rescaled | ||
:return: A new array that has been properly formatted | ||
""" | ||
return array.reshape(input_length, get_state_dim()) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.