-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Added the side channel for the Engine Configuration. #2958
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
Added the side channel for the Engine Configuration. #2958
Conversation
Note that this change does not require modifying a lot of files : - Adding a sender in Python - Adding a receiver in C# - subscribe the receiver to the communicator (here is a one liner in the Academy) - Add the side channel to the Python UnityEnvironment (not represented here) Adding the side channel to the environment would look like such : ```python from mlagents.envs.environment import UnityEnvironment from mlagents.envs.side_channel.raw_bytes_channel import RawBytesChannel from mlagents.envs.side_channel.engine_configuration_channel import EngineConfigurationChannel channel0 = RawBytesChannel() channel1 = EngineConfigurationChannel() env = UnityEnvironment(base_port = 5004, side_channels = [channel0, channel1]) ```
""" | ||
|
||
def __init__(self): | ||
self.received_messages = [] |
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.
Don't need self.received_messages
?
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.
right
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.
Looks good. I think if this is only going to be set once, we don't need any more structure around the args for set_configuration()
(I thought initially we might need a NamedTuple)
* [WIP] Side Channel initial layout * Working prototype for raw bytes * fixing format mistake * Added some errors and some unit tests in C# * Added the side channel for the Engine Configuration. (#2958) * Added the side channel for the Engine Configuration. Note that this change does not require modifying a lot of files : - Adding a sender in Python - Adding a receiver in C# - subscribe the receiver to the communicator (here is a one liner in the Academy) - Add the side channel to the Python UnityEnvironment (not represented here) Adding the side channel to the environment would look like such : ```python from mlagents.envs.environment import UnityEnvironment from mlagents.envs.side_channel.raw_bytes_channel import RawBytesChannel from mlagents.envs.side_channel.engine_configuration_channel import EngineConfigurationChannel channel0 = RawBytesChannel() channel1 = EngineConfigurationChannel() env = UnityEnvironment(base_port = 5004, side_channels = [channel0, channel1]) ``` * renamings * addressing comments * Logging a message when an unknown side channel number has been received by Unity * Addressing comments * renamings * renamings * Adding FloatProperties to the side channels (#2968) * renaming m_SideChannelsDict to m_SideChannel * renaming and some comments * renaming and adding a GetAndClearReceivedMessages() in the RawBytesSideChannel * micro-optimization * more errors and some nit * addressing comments * Using little-endian format in Python * adding some comments * Code comments * some changes and added the unit tests on both Python and C# * removing default default in get default * Update UnitySDK/Assets/ML-Agents/Scripts/SideChannel/SideChannel.cs Co-Authored-By: Chris Elion <chris.elion@unity3d.com> * Update ml-agents-envs/mlagents/envs/side_channel/raw_bytes_channel.py Co-Authored-By: Chris Elion <chris.elion@unity3d.com> * addressing comments * fixing tests
* [WIP] Side Channel initial layout * Working prototype for raw bytes * fixing format mistake * Added some errors and some unit tests in C# * Added the side channel for the Engine Configuration. (#2958) * Added the side channel for the Engine Configuration. Note that this change does not require modifying a lot of files : - Adding a sender in Python - Adding a receiver in C# - subscribe the receiver to the communicator (here is a one liner in the Academy) - Add the side channel to the Python UnityEnvironment (not represented here) Adding the side channel to the environment would look like such : ```python from mlagents.envs.environment import UnityEnvironment from mlagents.envs.side_channel.raw_bytes_channel import RawBytesChannel from mlagents.envs.side_channel.engine_configuration_channel import EngineConfigurationChannel channel0 = RawBytesChannel() channel1 = EngineConfigurationChannel() env = UnityEnvironment(base_port = 5004, side_channels = [channel0, channel1]) ``` * renamings * addressing comments * Logging a message when an unknown side channel number has been received by Unity * Addressing comments * renamings * renamings * Adding FloatProperties to the side channels (#2968) * renaming m_SideChannelsDict to m_SideChannel * renaming and some comments * renaming and adding a GetAndClearReceivedMessages() in the RawBytesSideChannel * micro-optimization * more errors and some nit * addressing comments * Using little-endian format in Python * adding some comments * Code comments * some changes and added the unit tests on both Python and C# * removing default default in get default * Update UnitySDK/Assets/ML-Agents/Scripts/SideChannel/SideChannel.cs Co-Authored-By: Chris Elion <chris.elion@unity3d.com> * Update ml-agents-envs/mlagents/envs/side_channel/raw_bytes_channel.py Co-Authored-By: Chris Elion <chris.elion@unity3d.com> * addressing comments * fixing tests * removing the arguments to reset and the property reset_parameters on the UnityEnvironment * curriculum works but removed the check for reset parameters in the scene * processing side channels before the reset command * Removing engine configuration from C# * Engine configuration removed * fixing the tests * Update ml-agents-envs/mlagents/envs/subprocess_env_manager.py Co-Authored-By: Chris Elion <chris.elion@unity3d.com> * Removing register callbacks with empty calls in FloarProperties * Clamp instead of min max * removing the brain names from the environment.py print * renaming reset_parameters to get properties * made a default engine config * bug fix * Empty commit * Docs changes for the Side Channels feature (#3011) * Docs changes for the Side Channels feature * replace deprecated with removed on the CustomResetPratmeters` * Update docs/Python-API.md Co-Authored-By: Chris Elion <chris.elion@unity3d.com> * Update docs/Training-Generalized-Reinforcement-Learning-Agents.md Co-Authored-By: Chris Elion <chris.elion@unity3d.com> * Removing the console outputs in the docs * Update docs/Training-ML-Agents.md Co-Authored-By: Chris Elion <chris.elion@unity3d.com> * replace does not work with ignored * adding a note on side channels * adding some steps to migrate * addressing comments * adding more docs to the LL-API * added a blob on how to access the properties in C# * adding space between ResetParameters * fix typo * bug fixes * addressing comments
Note that this change does not require modifying a lot of files :
Adding the side channel to the environment would look like such :