-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Add enum for sensor implementations, send in analytics #4871
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
@@ -20,6 +20,7 @@ internal class InferenceAnalytics | |||
{ | |||
const string k_VendorKey = "unity.ml-agents"; | |||
const string k_EventName = "ml_agents_inferencemodelset"; | |||
const int k_EventVersion = 1; |
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 we'll need to use version 2 here, waiting to hear back from analytics team.
Unknown = 0, | ||
VectorSensor = 1, | ||
// Note that StackingSensor actually returns the wrapped sensor's type | ||
StackingSensor = 2, |
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 can omit this if you don't like it here (since it's not actually used).
CameraSensor = 5, | ||
RenderTextureSensor = 6, | ||
BufferSensor = 7, | ||
PhysicsBodySensor = 8, |
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.
The ordering doesn't actually matter here, but I could make the extensions implementations start at some offset, say 1000.
public BuiltInSensorType GetBuiltInSensorType() | ||
{ | ||
IBuiltInSensor wrappedBuiltInSensor = m_WrappedSensor as IBuiltInSensor; | ||
return wrappedBuiltInSensor?.GetBuiltInSensorType() ?? BuiltInSensorType.Unknown; |
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.
TODO add unit test that checks this explicitly.
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.
LGTM
Proposed change(s)
Followup from the other analytics PRs. This tags ObservationSpecs in the events if we know that the sensor involved is one that we provided. Future sensor implementations should also inherit from the interface and add to the enum.
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
#4780
Types of change(s)
Checklist