class_docstr: Implements dp_query for accurate range queries using tree aggregation.
  
  Implements a variant of the tree aggregation protocol from. "Is interaction
  necessary for distributed private learning?. Adam Smith, Abhradeep Thakurta,
  Jalaj Upadhyay." Builds a tree on top of the input record and adds noise to
  the tree for differential privacy. Any range query can be decomposed into the
  sum of O(log(n)) nodes in the tree compared to O(n) when using a histogram.
  Improves efficiency and reduces noise scale.
class_docstr_tok: ["Implements","dp_query","for","accurate","range","queries","using","tree","aggregation",".","Implements","a","variant","of","the","tree","aggregation","protocol","from",".","``","Is","interaction","necessary","for","distributed","private","learning","?",".","Adam","Smith",",","Abhradeep","Thakurta",",","Jalaj","Upadhyay",".","''","Builds","a","tree","on","top","of","the","input","record","and","adds","noise","to","the","tree","for","differential","privacy",".","Any","range","query","can","be","decomposed","into","the","sum","of","O","(","log","(","n",")",")","nodes","in","the","tree","compared","to","O","(","n",")","when","using","a","histogram",".","Improves","efficiency","and","reduces","noise","scale","."]
docstr: Implements `tensorflow_privacy.DPQuery.initial_sample_state`.
docstr_tok: ["Implements","`","tensorflow_privacy.DPQuery.initial_sample_state","`","."]
code: def initial_sample_state(self, template=None):
      """Implements `tensorflow_privacy.DPQuery.initial_sample_state`."""
      return self.preprocess_record(
          self.derive_sample_params(self.initial_global_state()),
          super().initial_sample_state(template),
      )
  
file_path: privacy/tensorflow_privacy/privacy/dp_query/tree_range_query.py
imports: import distutils
  import math
  from typing import Any, NamedTuple, Optional
  import dp_accounting
  import tensorflow
  from tensorflow_privacy.privacy.dp_query import distributed_discrete_gaussian_query
  from tensorflow_privacy.privacy.dp_query import dp_query
  from tensorflow_privacy.privacy.dp_query import gaussian_query
label_desc: Use image node_id 3 for calling the TreeRangeSumQuery obj's underlying member method code with example usage: obj.initial_sample_state(template) and returns: self