Skip to content
Permalink
Browse files Browse the repository at this point in the history
remove sensitive info of guest sending to host
Signed-off-by: mgqa34 <mgq3374541@163.com>
  • Loading branch information
mgqa34 committed Aug 7, 2020
1 parent 67708d5 commit 6feccf6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion federatedml/tree/hetero/hetero_decision_tree_guest.py
Expand Up @@ -529,10 +529,23 @@ def redispatch_node(self, dep=-1, max_depth_reach=False):
unleaf_state_nodeid1) == 2 else unleaf_state_nodeid2)
self.node_dispatch = self.node_dispatch.union(dispatch_guest_result)

def remove_sensitive_info(self):
"""
host is not allowed to get weights/g/h
"""
new_tree_ = copy.deepcopy(self.tree_)
for node in new_tree_:
node.weight = None
node.sum_grad = None
node.sum_hess = None

return new_tree_

def sync_tree(self):
LOGGER.info("sync tree to host")

self.transfer_inst.tree.remote(self.tree_,
tree_nodes = self.remove_sensitive_info()
self.transfer_inst.tree.remote(tree_nodes,
role=consts.HOST,
idx=-1)
"""
Expand Down

0 comments on commit 6feccf6

Please sign in to comment.