IP Library › Granted Patent US 11,216,431
Granted Patent B2
US 11,216,431 · App. 15/851,668 · Granted Jan 4, 2022

Providing a compact representation of tree structures

Inventors: Hoyt A. Koepke (Seattle, WA); Srikrishna Sridhar (Seattle, WA)
Assignee: Apple Inc.
G06F16/2246G06F16/2237G06F16/9027G06N20/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,216,431
App. No.
15/851,668
Granted
Jan 4, 2022
Kind
B2
Abstract

The subject technology provides for generating a set of nodes representing a tree structure, each node comprising a feature index, a flag field indicating branch directions, an execution index storing locations related to the branch directions, and a feature value for comparing with the value stored in the input feature vector. The subject technology generates evaluation data, the evaluation data comprising a first array containing index values, and a second array containing evaluation values respectively corresponding to the index values, the evaluation data representing values of leaf nodes from the set of nodes. Further, the subject technology stores the set of nodes and the evaluation data as a contiguous block of data, where the set of nodes includes a first node and a second node, the second node corresponding to a likely execution path from the first node being physically stored adjacent to the first node.

Claims (48)

1. A method comprising:

generating a set of nodes representing a tree structure, each node comprising a feature index, stored as an initial set of contiguous bits, for accessing a value stored in an input feature vector, a flag field indicating branch directions, an execution index storing locations related to the branch directions, and a feature value for comparing with the value stored in the input feature vector, the tree structure corresponding to a machine learning model;

generating evaluation data, the evaluation data comprising a first array containing index values, and a second array containing evaluation values respectively corresponding to the index values, the evaluation data representing values of leaf nodes from the set of nodes; and

storing the set of nodes and the evaluation data as a contiguous block of data, wherein the set of nodes includes a first node and a second node, the second node corresponding to a predicted execution path from the first node and the second node being physically stored adjacent to the first node.

2. The method of claim 1 , wherein the feature index comprises a plurality of bits representing a feature index value, the plurality of bits corresponding to an initial set of bits of the contiguous block of data.

3. The method of claim 1 , wherein the feature value comprises a second plurality of bits that represent a floating point value, the second plurality of bits being byte aligned to a byte boundary of the contiguous block of data, the feature value representing a particular value to compare with the value stored at the feature index of the input feature vector.

4. The method of claim 1 , wherein the flag field comprises information indicating a branch comparison mode representing a comparison operation of the node.

5. The method of claim 4 , wherein the flag field further comprises information indicating a first leaf node or first particular node corresponding to a true condition for the comparison operation of the node, and a second leaf node or second particular node corresponding to a false condition for the comparison operation of the node.

6. The method of claim 5 , wherein the execution index comprises information indicating an index location related to a next operation based on a result of the comparison operation, the next operation corresponding to a different node or evaluation data.

7. The method of claim 6 , further comprising:

accessing the first node from the set of nodes;

performing the comparison operation based on the branch comparison mode from the flag field;

determining whether the comparison operation evaluates to the true condition or the false condition; and

based on comparison operation, accessing the first particular node or first leaf node corresponding to the true condition, or accessing the second particular node or the second leaf node corresponding to the false condition.

8. The method of claim 7 , wherein performing the comparison operation further comprises:

comparing, based on the comparison operation, a particular value stored at the feature index of the input feature vector with the feature value.

9. The method of claim 7 , further comprising:

applying an evaluation value to an output vector, the output vector including respective values indicating probabilities of potential results of the machine learning model.

10. The method of claim 9 , further comprising:

performing a post-processing operation on the output vector; and

providing the post-processed output vector as an output of the machine learning model.

11. A system comprising;

a processor;

a memory device containing instructions, which when executed by the processor cause the processor to:

generate a set of nodes representing a tree structure, each node comprising a feature index, stored as an initial set of contiguous bits, for accessing a value stored in an input feature vector, a flag field indicating branch directions, an execution index storing locations related to the branch directions, and a feature value for comparing with the value stored in the input feature vector, the tree structure corresponding to a machine learning model;

generate evaluation data, the evaluation data comprising a first array containing index values, and a second array containing evaluation values respectively corresponding to the index values, the evaluation data representing values of leaf nodes from the set of nodes; and

store the set of nodes and the evaluation data as a contiguous block of data, wherein the set of nodes includes a first node and a second node, the second node corresponding to a likely execution path from the first node being physically stored adjacent to the first node.

12. The system of claim 11 , wherein the feature index comprises a plurality of bits representing a feature index value, the plurality of bits corresponding to an initial set of bits of the contiguous block of data.

13. The system of claim 11 , wherein the feature value comprises a second plurality of bits that represent a floating point value, the second plurality of bits being byte aligned to a byte boundary of the contiguous block of data, the feature value representing a particular value to compare with the value stored at the feature index of the input feature vector.

14. The system of claim 13 , wherein the flag field comprises information indicating a branch comparison mode representing a comparison operation of the node.

15. The system of claim 14 , wherein the flag field further comprises information indicating a first leaf node or first particular node corresponding to a true condition for the comparison operation of the node, and a second leaf node or second particular node corresponding to a false condition for the comparison operation of the node.

16. The system of claim 15 , wherein the execution index comprises information indicating an index location related to a next operation based on a result of the comparison operation, the next operation corresponding to a different node or evaluation data.

17. The system of claim 16 , wherein the memory device contains further instructions, which when executed by the processor, further cause the processor to:

access the first node from the set of nodes;

perform the comparison operation based on the branch comparison mode from the flag field;

determine whether the comparison operation evaluates to the true condition or the false condition; and

based on comparison operation, access the first particular node or first leaf node corresponding to the true condition, or access the second particular node or the second leaf node corresponding to the false condition.

18. The system of claim 15 , wherein to perform the comparison operation further causes the processor to:

compare, based on the comparison operation, a particular value stored at the feature index of the input feature vector with the feature value.

19. The system of claim 18 , wherein the memory device contains further instructions, which when executed by the processor, further cause the processor to:

apply an evaluation value to an output vector, the output vector including respective values indicating probabilities of potential results of the machine learning model

perform a post-processing operation on the output vector; and

provide the post-processed output vector as an output of the machine learning model.

20. A non-transitory computer-readable medium comprising instructions, which when executed by a computing device, cause the computing device to perform operations comprising:

accessing a first node from a set of nodes representing a tree structure, each node comprising a feature index, stored as an initial set of contiguous bits, for accessing a value stored in an input feature vector, a flag field indicating a branch comparison mode and branch directions, an execution index storing locations related to the branch directions, and a feature value for comparing with the value stored in the input feature vector, the tree structure corresponding to a machine learning model;

performing a comparison operation, based on the branch comparison mode from the flag field, between the features value with the value stored in the input feature vector;

determining whether the comparison operation evaluates to a true condition or a false condition;

based on comparison operation and the branch directions indicated in the flag field, accessing a first particular node or a first leaf node corresponding to the true condition, or accessing a second particular node or a second leaf node corresponding to the false condition.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 5, 2018
From: KOEPKE, HOYT A.; SRIDHAR, SRIKRISHNA
To: APPLE INC.
Reel/Frame 044548/0008 →
Continuity (2)
Provisional Application 62557276 · Sep 12, 2017
Related Publication 20190079962A1 · Mar 14, 2019