Skip to content
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

pass sensor name through to ObservationSpec #5036

Merged
merged 8 commits into from
Mar 10, 2021

Conversation

chriselion
Copy link
Contributor

@chriselion chriselion commented Mar 5, 2021

Proposed change(s)

Add a name field to the Observation proto, set this in C# when creating the proto, and pass it to the ObservationSpec on python.

I'll also combine this into #5030 (depending on which finishes first) to add the sensor name in the error message.

Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)

#5011

Types of change(s)

  • New feature

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)

Copy link
Contributor

@vincentpierre vincentpierre left a comment

Choose a reason for hiding this comment

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

I must admit that I am not a fan of exposing the sensor name to python because we do not have a use case for it. It is also an invitation for the user to try to communicate information with the name of the sensor, which could be a problem.
But these are not good reasons, if you are confident about this, let's do it.
Is there maybe a way to test it end to end ?

@ervteng
Copy link
Contributor

ervteng commented Mar 5, 2021

I'm actually in support of this in the long run. In the future we can go as far as e.g. configuring different encoders for different sensors in the YAML. Also in demos we could use it to, for instance, record all the sensor but only train using some subset of them, and save people from re-recording demos over and over.

@chriselion
Copy link
Contributor Author

chriselion commented Mar 8, 2021

@ervteng I don't think we should be picking encoders based on the string; we should add flags to explicitly control this (which is what we've been doing with e.g. dimension properties and ObservationType). This is intended to help with debugging, but I think it might make sense for the demonstration filtering too.

@vincentpierre Please see the linked issue - this was a request from a user of the LLAPI to help them debug their sensors+observations.

Is there maybe a way to test it end to end ?

I'll a check in the LLAPI test that the name is set to something non-empty

@@ -427,6 +427,11 @@ public static ObservationProto GetObservationProto(this ISensor sensor, Observat
}
}
observationProto.Shape.AddRange(shape);
var sensorName = sensor.GetName();
if (string.IsNullOrEmpty(sensorName))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is why we needed an end-to-end test.

@chriselion chriselion merged commit dd6575d into main Mar 10, 2021
@delete-merged-branch delete-merged-branch bot deleted the MLA-1823-obsspec-sensor-name branch March 10, 2021 00:46
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2022
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.

None yet

3 participants