def setUp(self):
     self.input_data = [[-1., 0.], [-1., 2.], [1., 0.], [1., -2.]]
     self.input_labels = [0., 1., 2., 3.]
     self.tree = [[1, 0], [-1, 0], [-1, 0]]
     self.tree_weights = [[1.0, 0.0], [1.0, 0.0], [1.0, 0.0]]
     self.tree_thresholds = [0., 0., 0.]
     self.ops = training_ops.Load()
Ejemplo n.º 2
0
    def setUp(self):
        self.input_data = [[-1., 0.], [-1., 2.], [1., 0.], [1., -2.]]
        self.input_labels = [0., 1., 2., 3.]
        self.tree = [[1, 0], [-1, 0], [-1, 0]]
        self.tree_weights = [[1.0, 0.0], [1.0, 0.0], [1.0, 0.0]]
        self.tree_thresholds = [0., 0., 0.]

        self.ops = training_ops.Load()

        self.params = tensor_forest.ForestHParams(num_features=2,
                                                  hybrid_tree_depth=2,
                                                  base_random_seed=10,
                                                  feature_bagging_fraction=1.0,
                                                  regularization_strength=0.01,
                                                  regularization="",
                                                  weight_init_mean=0.0,
                                                  weight_init_std=0.1)
        self.params.num_nodes = 2**self.params.hybrid_tree_depth - 1
        self.params.num_leaves = 2**(self.params.hybrid_tree_depth - 1)
        self.params.num_features_per_node = (
            self.params.feature_bagging_fraction * self.params.num_features)
        self.params.regression = False
Ejemplo n.º 3
0
    def __init__(self, params, layer_num, device_assigner, *args, **kwargs):
        super(KFeatureDecisionsToDataLayer,
              self).__init__(params, layer_num, device_assigner, *args,
                             **kwargs)

        self.training_ops = training_ops.Load()