e43badcb8cbfe35a639da9060c20665e7e7544b2,autokeras/keras_layers.py,MultiColumnCategoricalEncoding,call,#MultiColumnCategoricalEncoding#Any#,46

Before Change


        output_nodes = []
        for input_node, encoding_layer in zip(split_inputs, self.encoding_layers):
            if encoding_layer is None:
                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)

After Change


        output_nodes = []
        for input_node, encoding_layer in zip(split_inputs, self.encoding_layers):
            if encoding_layer is None:
                number = tf.strings.to_number(input_node, tf.float32)
                // Replace NaN with 0.
                imputed = tf.where(tf.math.is_nan(number),
                                   tf.zeros_like(number),
                                   number)
                output_nodes.append(imputed)
            else:
                output_nodes.append(tf.cast(encoding_layer(input_node), tf.float32))
        return tf.keras.layers.Concatenate()(output_nodes)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: keras-team/autokeras
Commit Name: e43badcb8cbfe35a639da9060c20665e7e7544b2
Time: 2020-05-24
Author: jin@tamu.edu
File Name: autokeras/keras_layers.py
Class Name: MultiColumnCategoricalEncoding
Method Name: call


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