View source on GitHub |
DPQuery
for SumAggregationDPQuery
with a reset_state
function.
Inherits From: SumAggregationDPQuery
, DPQuery
tf_privacy.restart_query.RestartQuery(
inner_query: tf_privacy.SumAggregationDPQuery
,
restart_indicator: tf_privacy.restart_query.RestartIndicator
)
Args | |
---|---|
inner_query
|
A SumAggregationDPQuery has reset_state attribute.
|
restart_indicator
|
A RestartIndicator to generate the boolean indicator
for resetting the state.
|
Methods
accumulate_preprocessed_record
accumulate_preprocessed_record(
sample_state, preprocessed_record
)
Implements tensorflow_privacy.DPQuery.accumulate_preprocessed_record
.
accumulate_record
accumulate_record(
params, sample_state, record
)
Accumulates a single record into the sample state.
This is a helper method that simply delegates to preprocess_record
and
accumulate_preprocessed_record
for the common case when both of those
functions run on a single device. Typically this will be a simple sum.
Args | |
---|---|
params
|
The parameters for the sample. In standard DP-SGD training, the clipping norm for the sample's microbatch gradients (i.e., a maximum norm magnitude to which each gradient is clipped) |
sample_state
|
The current sample state. In standard DP-SGD training, the accumulated sum of previous clipped microbatch gradients. |
record
|
The record to accumulate. In standard DP-SGD training, the gradient computed for the examples in one microbatch, which may be the gradient for just one example (for size 1 microbatches). |
Returns | |
---|---|
The updated sample state. In standard DP-SGD training, the set of previous microbatch gradients with the addition of the record argument. |
derive_metrics
derive_metrics(
global_state
)
Implements tensorflow_privacy.DPQuery.derive_metrics
.
derive_sample_params
derive_sample_params(
global_state
)
Implements tensorflow_privacy.DPQuery.derive_sample_params
.
get_noised_result
@tf.function
get_noised_result( sample_state, global_state )
Implements tensorflow_privacy.DPQuery.get_noised_result
.
initial_global_state
initial_global_state()
Implements tensorflow_privacy.DPQuery.initial_global_state
.
initial_sample_state
initial_sample_state(
template
)
Implements tensorflow_privacy.DPQuery.initial_sample_state
.
merge_sample_states
merge_sample_states(
sample_state_1, sample_state_2
)
Implements tensorflow_privacy.DPQuery.merge_sample_states
.
preprocess_record
preprocess_record(
params, record
)
Implements tensorflow_privacy.DPQuery.preprocess_record
.