aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/tensor_forest/kernels/v4/BUILD
blob: 794b76d8583c3608d540d34a5aaf1d1a799f35e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# TensorFlow code for training random forests.

load("//tensorflow:tensorflow.bzl", "tf_cc_test")
load("//tensorflow/core:platform/default/build_config_root.bzl", "if_static")

package(
    default_visibility = ["//visibility:public"],
)

licenses(["notice"])  # Apache 2.0

exports_files(["LICENSE"])

filegroup(
    name = "all_files",
    srcs = glob(["**/*"]),
)

DECISION_TREE_RESOURCE_DEPS = [
    ":decision_node_evaluator",
    ":input_data",
    ":leaf_model_operators",
    "//tensorflow/core:framework_headers_lib",
] + if_static(
    [
        "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
        "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc",
    ],
    [
        "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
        "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc_headers_only",
    ],
)

cc_library(
    name = "decision-tree-resource",
    hdrs = ["decision-tree-resource.h"],
    deps = DECISION_TREE_RESOURCE_DEPS + if_static([":decision-tree-resource_impl"]),
)

cc_library(
    name = "decision-tree-resource_impl",
    srcs = ["decision-tree-resource.cc"],
    hdrs = ["decision-tree-resource.h"],
    deps = DECISION_TREE_RESOURCE_DEPS,
)

cc_library(
    name = "fertile-stats-resource",
    srcs = ["fertile-stats-resource.cc"],
    hdrs = ["fertile-stats-resource.h"],
    deps = [
        ":decision_node_evaluator",
        ":input_data",
        ":input_target",
        ":leaf_model_operators",
        ":split_collection_operators",
        "//tensorflow/core:framework_headers_lib",
    ] + if_static(
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc",
        ],
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc_headers_only",
        ],
    ),
)

cc_library(
    name = "input_data",
    srcs = ["input_data.cc"],
    hdrs = ["input_data.h"],
    deps = [
        "//tensorflow/contrib/tensor_forest:tree_utils",
        "//tensorflow/core:framework_headers_lib",
    ] + if_static(
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_extensions_cc",
        ],
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_extensions_cc_headers_only",
        ],
    ),
)

cc_library(
    name = "input_target",
    hdrs = ["input_target.h"],
    deps = [
        "//tensorflow/core:framework_headers_lib",
        "//third_party/eigen3",
    ],
)

cc_library(
    name = "leaf_model_operators",
    srcs = ["leaf_model_operators.cc"],
    hdrs = ["leaf_model_operators.h"],
    deps = [
        ":input_target",
        ":params",
    ] + if_static(
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc",
        ],
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc_headers_only",
        ],
    ),
)

tf_cc_test(
    name = "leaf_model_operators_test",
    srcs = ["leaf_model_operators_test.cc"],
    deps = [
        ":leaf_model_operators",
        ":test_utils",
        "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
        "//tensorflow/contrib/decision_trees/proto:generic_tree_model_extensions_cc",
        "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc",
        "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc",
        "//tensorflow/core",
        "//tensorflow/core:lib",
        "//tensorflow/core:test",
        "//tensorflow/core:test_main",
    ],
)

cc_library(
    name = "grow_stats",
    srcs = ["grow_stats.cc"],
    hdrs = ["grow_stats.h"],
    deps = [
        ":decision_node_evaluator",
        ":input_data",
        ":input_target",
        ":params",
        ":stat_utils",
        "//tensorflow/contrib/tensor_forest:tree_utils",
        "//tensorflow/core:framework_headers_lib",
    ] + if_static(
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc",
        ],
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc_headers_only",
        ],
    ),
)

tf_cc_test(
    name = "grow_stats_test",
    srcs = ["grow_stats_test.cc"],
    deps = [
        ":grow_stats",
        ":test_utils",
        "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
        "//tensorflow/contrib/decision_trees/proto:generic_tree_model_extensions_cc",
        "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc",
        "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc",
        "//tensorflow/core",
        "//tensorflow/core:lib",
        "//tensorflow/core:test",
        "//tensorflow/core:test_main",
    ],
)

cc_library(
    name = "candidate_graph_runner",
    srcs = ["candidate_graph_runner.cc"],
    hdrs = ["candidate_graph_runner.h"],
    deps = [
        ":input_data",
        ":input_target",
        "//tensorflow/core:core_cpu",
        "//tensorflow/core:framework",
        "//tensorflow/core:lib",
        "//tensorflow/core:protos_all_cc",
    ] + if_static(
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc",
        ],
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc_headers_only",
        ],
    ),
)

cc_library(
    name = "decision_node_evaluator",
    srcs = ["decision_node_evaluator.cc"],
    hdrs = ["decision_node_evaluator.h"],
    deps = [
        ":input_data",
        "//tensorflow/core:framework_headers_lib",
    ] + if_static(
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_extensions_cc",
        ],
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_extensions_cc_headers_only",
        ],
    ),
)

tf_cc_test(
    name = "decision_node_evaluator_test",
    srcs = ["decision_node_evaluator_test.cc"],
    deps = [
        ":decision_node_evaluator",
        ":test_utils",
        "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
        "//tensorflow/contrib/decision_trees/proto:generic_tree_model_extensions_cc",
        "//tensorflow/core",
        "//tensorflow/core:test",
        "//tensorflow/core:test_main",
    ],
)

cc_library(
    name = "split_collection_operators",
    srcs = ["split_collection_operators.cc"],
    hdrs = ["split_collection_operators.h"],
    deps = [
        ":grow_stats",
        ":input_data",
        ":input_target",
        ":leaf_model_operators",
        ":params",
        ":stat_utils",
        "//tensorflow/contrib/tensor_forest:tree_utils",
    ] + if_static(
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_extensions_cc",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc",
        ],
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_extensions_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc_headers_only",
        ],
    ),
)

cc_library(
    name = "graph_collection_operator",
    srcs = ["graph_collection_operator.cc"],
    hdrs = ["graph_collection_operator.h"],
    deps = [
        ":candidate_graph_runner",
        ":grow_stats",
        ":input_data",
        ":input_target",
        ":leaf_model_operators",
        ":params",
        ":split_collection_operators",
        "//tensorflow/contrib/tensor_forest:tree_utils",
    ] + if_static(
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc",
        ],
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc_headers_only",
        ],
    ),
)

cc_library(
    name = "stat_utils",
    srcs = ["stat_utils.cc"],
    hdrs = ["stat_utils.h"],
    deps = [
        "//tensorflow/core:framework_headers_lib",
    ] + if_static(
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc",
        ],
        [
            "//third_party/eigen3",
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:fertile_stats_proto_cc_headers_only",
        ],
    ),
)

cc_library(
    name = "test_utils",
    hdrs = ["test_utils.h"],
    deps = [
        ":input_data",
        ":input_target",
    ],
)

cc_library(
    name = "params",
    srcs = ["params.cc"],
    hdrs = ["params.h"],
    deps = [
        "//third_party/eigen3",
        "//tensorflow/core:framework_headers_lib",
    ] + if_static(
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc",
        ],
        [
            "//tensorflow/contrib/decision_trees/proto:generic_tree_model_cc_headers_only",
            "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc_headers_only",
        ],
    ),
)

tf_cc_test(
    name = "params_test",
    srcs = ["params_test.cc"],
    deps = [
        ":params",
        "//tensorflow/contrib/tensor_forest/proto:tensor_forest_params_proto_cc",
        "//tensorflow/core:test",
        "//tensorflow/core:test_main",
    ],
)