41c99fbf385a8c875fb6181ce7301e4bc218535b,autokeras/keras_layers.py,CategoricalEncoding,call,#CategoricalEncoding#Any#,58

Before Change


        inputs = nest.flatten(inputs)[0]
        outputs = []
        for index in range(len(self.encoding)):
            col = tf.slice(inputs, [0, index], [-1, 1])
            if self.encoding[index] in [INT, ONE_HOT]:
                col = self.tables[str(index)].lookup(col)
                col = tf.cast(col, tf.float32)
            else:
                col = tf.strings.to_number(col, tf.float32)
            outputs.append(col)

After Change


                output_nodes.append(tf.strings.to_number(input_node, tf.float32))
            else:
                output_nodes.append(tf.cast(encoding_layer(input_node), tf.float32))
        return tf.keras.layers.Concatenate()(output_nodes)

    def adapt(self, data):
        for index, encoding_layer in enumerate(self.encoding_layers):
            if encoding_layer is None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: jhfjhfj1/autokeras
Commit Name: 41c99fbf385a8c875fb6181ce7301e4bc218535b
Time: 2020-04-18
Author: jhfjhfj1@gmail.com
File Name: autokeras/keras_layers.py
Class Name: CategoricalEncoding
Method Name: call


Project Name: commonsense/conceptnet5
Commit Name: ae46206d17e595dd4c774a7bc7af77f970798a7b
Time: 2016-06-13
Author: rob@luminoso.com
File Name: conceptnet5/language/lemmatize.py
Class Name:
Method Name: lemmatize_uri


Project Name: dpressel/mead-baseline
Commit Name: 78eba7b3f82b8420deac3cd28318dbfead0f9b9e
Time: 2018-10-30
Author: dpressel@gmail.com
File Name: python/baseline/dy/embeddings.py
Class Name: LookupTableEmbeddings
Method Name: encode