View source on GitHub |
Indicator for resetting the tree state after every a few number of queries.
Inherits From: RestartIndicator
tf_privacy.restart_query.PeriodicRoundRestartIndicator(
period: int, warmup: Optional[int] = None
)
The indicator will maintain an internal counter as state.
Args | |
---|---|
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
initialize()
Returns initialized state of 0 for PeriodicRoundRestartIndicator
.
next
next(
state
)
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 .
|