Skip to content

Docs changes for the Side Channels feature#3011

Merged
vincentpierre merged 16 commits into
develop-side-channel-2from
develop-side-channel-docs
Dec 2, 2019
Merged

Docs changes for the Side Channels feature#3011
vincentpierre merged 16 commits into
develop-side-channel-2from
develop-side-channel-docs

Conversation

@vincentpierre
Copy link
Copy Markdown
Contributor

No description provided.

@vincentpierre vincentpierre self-assigned this Dec 2, 2019
Comment thread docs/Python-API.md Outdated
Comment thread docs/Training-Generalized-Reinforcement-Learning-Agents.md Outdated
Comment thread docs/Basic-Guide.md
'--run-id': 'first-run',
'--save-freq': '50000',
'--seed': '-1',
'--slow': False,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, none of this is accurate anymore. It looks like

INFO:mlagents.trainers:CommandLineOptions(debug=False, num_runs=1, seed=-1, env_path=None, run_id='first-run', load_model=False, train_model=True, save_freq=50000, keep_checkpoints=5, base_port=5005, num_envs=1, curriculum_folder=None, lesson=0, slow=False, no_graphics=False, multi_gpu=False, trainer_config_path='config/trainer_config.yaml', sampler_file_path=None, docker_target_name=None, env_args=None, cpu=False)
INFO:mlagents.envs:Start training by pressing the Play button in the Unity Editor.

today, Maybe just delete this part?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree to delete it. It does not add anything.

Comment thread docs/Training-ML-Agents.md Outdated
Comment thread docs/Migrating.md Outdated
* `CustomResetParameters` are now removed.
* `reset()` on the Low-Level Python API no longer takes a `train_mode` argument. To modify the performance/speed of the engine, you must use an `EngineConfigurationChannel`
* `reset()` on the Low-Level Python API no longer takes a `config` argument. `UnityEnvironment` no longer has a `reset_parameters` field. To modify float properties in the environment, you must use a `FloatPropertiesChannel`
* The Academy no longer has a `Training Configuration` nor `Inference Configuration` field in the inspector. To modify the configuration form the Low-Level Python API, use an `EngineConfigurationChannel`. To modify it during training, use the new command line arguments `--width`, `--heigth`, `--quality-level`, `--time-scale` and `--target-frame-rate` in `mlagents-learn`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like "These default to the previous default values of the Training Configuration fields. If you weren't using --slow, you don't need to change anything. If you were running training with --slow, you should now pass --quality-level=... etc" (it might be better in a "Steps to Migrate" section" with slightly different wording)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added :

Steps to Migrate

  • If you had a custom Training Configuration in the Academy inspector, you will need to pass your custom configuration at every training run using the new command line arguments --width, --heigth, --quality-level, --time-scale and --target-frame-rate.
  • If you were using --slow in mlagents-learn, you will need to pass your old Inference Configuration of the Academy inspector with the new command line arguments --width, --heigth, --quality-level, --time-scale and --target-frame-rate instead.

Copy link
Copy Markdown
Contributor

@chriselion chriselion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment on the migration guide, looks good otherwise.

Comment thread docs/Migrating.md Outdated
* `CustomResetParameters` are now removed.
* `reset()` on the Low-Level Python API no longer takes a `train_mode` argument. To modify the performance/speed of the engine, you must use an `EngineConfigurationChannel`
* `reset()` on the Low-Level Python API no longer takes a `config` argument. `UnityEnvironment` no longer has a `reset_parameters` field. To modify float properties in the environment, you must use a `FloatPropertiesChannel`
* The Academy no longer has a `Training Configuration` nor `Inference Configuration` field in the inspector. To modify the configuration form the Low-Level Python API, use an `EngineConfigurationChannel`. To modify it during training, use the new command line arguments `--width`, `--heigth`, `--quality-level`, `--time-scale` and `--target-frame-rate` in `mlagents-learn`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling on --height

Also isn't this waaay too many options to do command line? I'd assume for most things you'd want to change all of them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For us, the defaults are pretty standard. Width and height are not really useful. Quality settings do not make a huge difference and can be left at default value. Target frame rate of -1 is default and should not change. The only one that really changes is time scale

Good catch on the typo

Copy link
Copy Markdown
Contributor

@ervteng ervteng Dec 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. So in training we'd just have them pass --time-scale=whatevertheywant. This is actually pretty nice, rather than baking it into the game.

Comment thread docs/Migrating.md Outdated
### Important changes
* `CustomResetParameters` are now removed.
* `reset()` on the Low-Level Python API no longer takes a `train_mode` argument. To modify the performance/speed of the engine, you must use an `EngineConfigurationChannel`
* `reset()` on the Low-Level Python API no longer takes a `config` argument. `UnityEnvironment` no longer has a `reset_parameters` field. To modify float properties in the environment, you must use a `FloatPropertiesChannel`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would link to the Python API page here

Comment thread docs/Python-API.md
__Note__ : A side channel will only send/receive messages when `env.step` is
called.

#### EngineConfigurationChannel
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would add a two-line example for creating each of these, and how to pass the list into the UnityEnvironment. Unless that's somewhere else in the docs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay will do


To enable variations in the environments, we implemented `Reset Parameters`. We
To enable variations in the environments, we implemented `Reset Parameters`.
`ResetParameters` are `Academy.FloatProperties` that are used only when
Copy link
Copy Markdown
Contributor

@ervteng ervteng Dec 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space in Reset Parameters.

So what differentiates these two is that FloatProperties could (technically) be used anytime but our example envs only use them at reset right? The phrasing is a bit confusing but I think that makes sense.

To enable variations in the environments, we implemented `Reset Parameters`.
`ResetParameters` are `Academy.FloatProperties` that are used only when
`Reset Parameters` are `Academy.FloatProperties` that are used only when
reseting the environment. We
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also spelling on the word reseting -> resetting

Copy link
Copy Markdown
Contributor

@ervteng ervteng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had one last spelling comment but other than that LGTM

@vincentpierre vincentpierre merged commit 83ff9da into develop-side-channel-2 Dec 2, 2019
@delete-merged-branch delete-merged-branch Bot deleted the develop-side-channel-docs branch December 2, 2019 23:09
vincentpierre added a commit that referenced this pull request Dec 4, 2019
* [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
@MarkTension
Copy link
Copy Markdown

Heya, I was directed here from this feature request. Where exactly can I find the part that covers the tensorboard C# variable functionality? Will my input still be relevant?

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants