023331ec2a7b0086abfc81eca16c84a1692ee653,keras/layers/convolutional.py,Cropping2D,__init__,#Cropping2D#Any#Any#,1754

Before Change


        super(Cropping2D, self).__init__(**kwargs)
        if data_format == "default":
            data_format = K.image_data_format()
        self.cropping = tuple(cropping)
        if len(self.cropping) != 2:
            raise ValueError("`cropping` must be a tuple length of 2.")
        if len(self.cropping[0]) != 2:
            raise ValueError("`cropping[0]` must be a tuple length of 2.")
        if len(self.cropping[1]) != 2:
            raise ValueError("`cropping[1]` must be a tuple length of 2.")
        if data_format not in {"channels_last", "channels_first"}:
            raise ValueError("data_format must be in {"channels_last", "channels_first"}.")

After Change


    def __init__(self, cropping=((0, 0), (0, 0)),
                 data_format=None, **kwargs):
        super(Cropping2D, self).__init__(**kwargs)
        self.data_format = conv_utils.normalize_data_format(data_format)
        if isinstance(cropping, int):
            self.cropping = ((cropping, cropping), (cropping, cropping))
        if hasattr(cropping, "__len__"):
            if len(cropping) != 2:
                raise ValueError("TODO")
            height_cropping = conv_utils.normalize_tuple(
                cropping[0], 2,
                "1st entry of cropping")
            width_cropping = conv_utils.normalize_tuple(
                cropping[1], 2,
                "2nd entry of cropping")
            self.cropping = (height_cropping, width_cropping)
        else:
            raise ValueError("`cropping` should be either an int, "
                             "a tuple of 2 ints "
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 8

Instances


Project Name: keras-team/keras
Commit Name: 023331ec2a7b0086abfc81eca16c84a1692ee653
Time: 2017-02-09
Author: francois.chollet@gmail.com
File Name: keras/layers/convolutional.py
Class Name: Cropping2D
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 023331ec2a7b0086abfc81eca16c84a1692ee653
Time: 2017-02-09
Author: francois.chollet@gmail.com
File Name: keras/layers/convolutional.py
Class Name: Cropping3D
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 6710396acaf62b40ba01fadd9d488d6641995d83
Time: 2017-02-09
Author: francois.chollet@gmail.com
File Name: keras/layers/pooling.py
Class Name: _Pooling2D
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 6710396acaf62b40ba01fadd9d488d6641995d83
Time: 2017-02-09
Author: francois.chollet@gmail.com
File Name: keras/layers/pooling.py
Class Name: _Pooling3D
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 023331ec2a7b0086abfc81eca16c84a1692ee653
Time: 2017-02-09
Author: francois.chollet@gmail.com
File Name: keras/layers/convolutional.py
Class Name: Cropping2D
Method Name: __init__