You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a proposed change to the C++ building blocks library. I'm posting it here to solicit feedback and suggestions before we make a final call on implementing it.
Currently all our Algorithms return their results in the form out Output protocol buffers. Most users use our custom utility functions to retrieve the result. Output protocol buffers can contain any one of a number of different data types, which are represented as different fields.
We've seen this lead to a lot of confusion. Some Algorithms don't return the same type as their input (e.g. Count), and if you try to fetch the wrong type of result you'll get a default value rather than an error. "Why does the algorithm always return 0?" is a frequent question for users of Count.
We'd like to stop returning multiple types and return only doubles instead. We'll still use the proto structure (the ability to return more than one double is useful in, e.g. ApproxBounds), but will replace the inner Value proto (which can hold multiple types) with a double. We're doing all the math as doubles anyway, so there's no precision loss. If you want your differentially private count to be an integer rather than a double, you can cast it yourself rather than having us do it under the hood. We'll also modify the GetValue<T> methods to be simple casts, so if you're currently doing GetValue<T>(algorithm.PartialResult()) your code will keep working without any changes. If you are handling the Output protos yourself, though, this will be a breaking change for you.
The text was updated successfully, but these errors were encountered:
This is a proposed change to the C++ building blocks library. I'm posting it here to solicit feedback and suggestions before we make a final call on implementing it.
Currently all our
Algorithm
s return their results in the form outOutput
protocol buffers. Most users use our custom utility functions to retrieve the result.Output
protocol buffers can contain any one of a number of different data types, which are represented as different fields.We've seen this lead to a lot of confusion. Some
Algorithm
s don't return the same type as their input (e.g.Count
), and if you try to fetch the wrong type of result you'll get a default value rather than an error. "Why does the algorithm always return 0?" is a frequent question for users ofCount
.We'd like to stop returning multiple types and return only doubles instead. We'll still use the proto structure (the ability to return more than one double is useful in, e.g. ApproxBounds), but will replace the inner
Value
proto (which can hold multiple types) with a double. We're doing all the math as doubles anyway, so there's no precision loss. If you want your differentially private count to be an integer rather than a double, you can cast it yourself rather than having us do it under the hood. We'll also modify theGetValue<T>
methods to be simple casts, so if you're currently doingGetValue<T>(algorithm.PartialResult())
your code will keep working without any changes. If you are handling theOutput
protos yourself, though, this will be a breaking change for you.The text was updated successfully, but these errors were encountered: