|
A derived policy to eliminate features in variable follow the
Inherits From: RestrictPolicy
oldest-out-first
rule.
__init__(var)
A timestamp status sparse variable is created. The timestamp status has same key_dtype as the target variable and value_dtype in int32, which indicates the timestamp value. The timestamp means a digital record of time. The later the time, the larger the timestamp.
var
: Adynamic_embedding.Variable
object to be restricted.
Get status variable which save information about properties of features.
apply_restriction(
num_reserved,
**kwargs
)
Define the rule to restrict the size of the target variable by eliminating
the oldest k features, and number of num_reserved
feature will be kept.
num_reserved
: int. Number of remained keys after restriction.**kwargs
: (Optional) reserved keyword arguments. trigger: int. The triggered threshold to execute restriction. Default equals tonum_reserved
.
An operation to restrict the sizes of variable and variables in slots.
apply_update(ids)
Define the rule to update the timestamp status. If any feature shows up in training, then its timestamp will be updated.
ids
: A Tensor. Keys appear in training. These keys in status variable will be updated if needed.
An operation to update timestamp status.