tf_privacy.restart_query.PeriodicRoundRestartIndicator

Indicator for resetting the tree state after every a few number of queries.

Inherits From: RestartIndicator

The indicator will maintain an internal counter as state.

period The next function will return True every period number of next calls.
warmup The first True will be returned at the warmup times call of next.

Methods

initialize

View source

Returns initialized state of 0 for PeriodicRoundRestartIndicator.

next

View source

Gets next bool indicator and advances the state.

Args
state The current state.

Returns
A pair (value, new_state) where value is the bool indicator and new_state of state+1.