| 250 | return s.format(classname=self.__class__.__name__, **self.__dict__) |
| 251 | |
| 252 | def _get_param_shape(self, inputs_shape): |
| 253 | if self.data_format == 'channels_last': |
| 254 | axis = -1 |
| 255 | elif self.data_format == 'channels_first': |
| 256 | axis = 1 |
| 257 | else: |
| 258 | raise ValueError('data_format should be either %s or %s' % ('channels_last', 'channels_first')) |
| 259 | |
| 260 | channels = inputs_shape[axis] |
| 261 | params_shape = [channels] |
| 262 | |
| 263 | return params_shape |
| 264 | |
| 265 | def _check_input_shape(self, inputs): |
| 266 | inputs_shape = _compute_shape(inputs) |