-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Develop Side Channels tutorial #3391
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
Conversation
docs/Python-API.md
Outdated
To send a byte array from Python to C#, call the `super().queue_message_to_send(bytes_data)` method inside the | ||
side channel. The `bytes_data` argument must be a `bytes` object. | ||
|
||
To register a side channel on the Python side, call pass the side channel as argument when creating the |
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.
This means that custom Side Channels and mlagents-learn
are currently mutually exclusive.
@harperj Another use case for plugins.
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, you are right. But I do not see how our training process would make use of custom made side channels. I see the side channels more as a research use case.
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.
Yeah, can't help but think some form of extension / plugin could allow us to add these more easily. That said, I think you're right @vincentpierre that it isn't obvious how we could use these side channels even if the user could add them.
Here is an implementation of a `StringLogSideChannel` that will listed to the `UnityEngine.Debug.LogError` calls in | ||
the game : | ||
|
||
```csharp |
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 think this code (and RegisterStringLogSideChannel ) should be an actual .cs file in the Examples directory. Otherwise it's way too easy for it to get out of date during refactors.
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.
FWIW we might be able to populate the package docs based on code; there's a thread I started here https://unity.slack.com/archives/C070VFPRV/p1575917230249200
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.
(this critique isn't specific to this example, large blocks of uncompiled unexecuted code always makes me nervous; see also the jupyter notebook)
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.
This is a very fair concern. I would like to have a tutorial rather than code because I would like users to make their own rather than rely on our own implementations.
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.
Would solve the problem if there was a way to show code from a file in md
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 think a block of markdown code and actual .cs file are equally likely to get copy-pasted. If it's in the Examples and not the SDK, we're free to change the implementation later.
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 think links from the docs to the .cs and vice versa is sufficient for now.
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 would rather keep the code in there. I would argue that If I add the .cs
script in the Examples folder, it will still be untested code. If I add the .cs
I would have to add the python code as well and we do not have a place to put this code right now (I do not want to put if in yet another notebook).
I do agree that it is very bad to have large amount of code in markdown as tutorial (looking at you RollerBall) but I do not think I like the alternative. Maybe we should put a hold on this PR for now ?
Co-Authored-By: Chris Goy <christopherg@unity3d.com>
Co-Authored-By: Chris Elion <chris.elion@unity3d.com>
Co-Authored-By: Chris Goy <christopherg@unity3d.com>
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 aside from markdown vs. source files (and one edit). OK to merge now and we can migrate later.
Co-Authored-By: Chris Elion <chris.elion@unity3d.com>
No description provided.