Skip to content

Using call_get_leaves inside @tf.function call in ensemble model inherits from tensorflow.keras.Model #199

@advahadr

Description

@advahadr

Hi All,

I would like to get you help on the following Ensemble architecture:
created this colab notebook for your convenience.

I'm using the output of pre-trained tfdf model and concat it to a dense layer output, when I call the tfdf model directly I can concatenate is to the output of the dense layer [please see class MyEnsembleWorking], however my problem is when trying to concat the index of the leaves instead, by using:call_get_leaves [please see class MyEnsembleLeaves].

When adding the line:
tfdf_output_leaves = tf.stop_gradient(self.tfdf_model.call_get_leaves(inputs))

It seems that the output has no shape, I get this print:

tfdf_output_leaves: Tensor("StopGradient_1:0", shape=(None, None), dtype=int32)
And can't work further with this output and concatenate it.

I wonder what it the correct way to ensemble the leaves prediction and not the probability in my architecture.

Would appreciate any help,
Regards
Adva

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions