13aa31bc1a0b87d6c4b5e787c9b041ec83831c34,autokeras/blocks/reduction.py,SpatialReduction,build,#SpatialReduction#Any#Any#,106

Before Change


                                                           "global_max",
                                                           "global_avg"],
                                                          default="global_avg")
        if reduction_type == "flatten":
            output_node = Flatten().build(hp, output_node)
        elif reduction_type == "global_max":
            output_node = layer_utils.get_global_max_pooling(
                output_node.shape)()(output_node)
        elif reduction_type == "global_avg":
            output_node = layer_utils.get_global_average_pooling(
                output_node.shape)()(output_node)
        return output_node


class TemporalReduction(block_module.Block):

After Change


        if len(output_node.shape) <= 2:
            return output_node

        if self.reduction_type is None:
            reduction_type = hp.Choice(
                REDUCTION_TYPE, [FLATTEN, GLOBAL_MAX, GLOBAL_AVG])
            with hp.conditional_scope(REDUCTION_TYPE, [reduction_type]):
                return self._build_block(hp, output_node, reduction_type)
        else:
            return self._build_block(hp, output_node, self.reduction_type)

    def _build_block(self, hp, output_node, reduction_type):
        if reduction_type == FLATTEN:
            output_node = Flatten().build(hp, output_node)
        elif reduction_type == GLOBAL_MAX:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: keras-team/autokeras
Commit Name: 13aa31bc1a0b87d6c4b5e787c9b041ec83831c34
Time: 2020-07-31
Author: jin@tamu.edu
File Name: autokeras/blocks/reduction.py
Class Name: SpatialReduction
Method Name: build


Project Name: tensorlayer/tensorlayer
Commit Name: aa968dad320137a31c229be3094c6538fd5ce39c
Time: 2019-03-06
Author: rundi_wu@pku.edu.cn
File Name: tensorlayer/layers/core.py
Class Name: Layer
Method Name: __call__


Project Name: keras-team/keras
Commit Name: 451d74c56d1b2f498e5c9a4856309d7f454b39e5
Time: 2017-02-19
Author: francois.chollet@gmail.com
File Name: keras/models.py
Class Name: Sequential
Method Name: non_trainable_weights