-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Following petting_zoo registry API #5557
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
Changes from all commits
a4c985f
609cfbf
965f271
6d33c73
18b6796
71edd21
3ec0816
5682b95
f275dd5
1db02a9
b25e8ca
532fd27
abec580
9cecfe5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,8 @@ jobs: | |
ruby-version: '2.6' | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
dotnet-version: '6.0.x' | ||
include-prerelease: true | ||
- uses: pre-commit/[email protected] | ||
|
||
markdown-link-check: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ and this project adheres to | |
terminated teammates. (#5441) | ||
- Fixed wrong attribute name in argparser for torch device option (#5433)(#5467) | ||
- Fixed conflicting CLI and yaml options regarding resume & initialize_from (#5495) | ||
- Added minimal analytics collection to LL-API (#5511) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. strange that this PR would contain this change, are you sure you cherry picked the right commits? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes this commit contains the default analytics side channels for custom trainers. |
||
## [2.1.0-exp.1] - 2021-06-09 | ||
### Minor Changes | ||
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import sys | ||
import uuid | ||
import mlagents_envs | ||
|
||
from mlagents_envs.exception import UnityCommunicationException | ||
from mlagents_envs.side_channel import SideChannel, IncomingMessage, OutgoingMessage | ||
from mlagents_envs.communicator_objects.training_analytics_pb2 import ( | ||
TrainingEnvironmentInitialized, | ||
) | ||
from google.protobuf.any_pb2 import Any | ||
|
||
|
||
class DefaultTrainingAnalyticsSideChannel(SideChannel): | ||
""" | ||
Side channel that sends information about the training to the Unity environment so it can be logged. | ||
""" | ||
|
||
CHANNEL_ID = uuid.UUID("b664a4a9-d86f-5a5f-95cb-e8353a7e8356") | ||
|
||
def __init__(self) -> None: | ||
# >>> uuid.uuid5(uuid.NAMESPACE_URL, "com.unity.ml-agents/TrainingAnalyticsSideChannel") | ||
# UUID('b664a4a9-d86f-5a5f-95cb-e8353a7e8356') | ||
# We purposefully use the SAME side channel as the TrainingAnalyticsSideChannel | ||
|
||
super().__init__(DefaultTrainingAnalyticsSideChannel.CHANNEL_ID) | ||
|
||
def on_message_received(self, msg: IncomingMessage) -> None: | ||
raise UnityCommunicationException( | ||
"The DefaultTrainingAnalyticsSideChannel received a message from Unity, " | ||
+ "this should not have happened." | ||
) | ||
|
||
def environment_initialized(self) -> None: | ||
# Tuple of (major, minor, patch) | ||
vi = sys.version_info | ||
|
||
msg = TrainingEnvironmentInitialized( | ||
python_version=f"{vi[0]}.{vi[1]}.{vi[2]}", | ||
mlagents_version="Custom", | ||
mlagents_envs_version=mlagents_envs.__version__, | ||
torch_version="Unknown", | ||
torch_device_type="Unknown", | ||
) | ||
any_message = Any() | ||
any_message.Pack(msg) | ||
|
||
env_init_msg = OutgoingMessage() | ||
env_init_msg.set_raw_bytes(any_message.SerializeToString()) # type: ignore | ||
super().queue_message_to_send(env_init_msg) |
Uh oh!
There was an error while loading. Please reload this page.