e29ea9571ae112b5f628a3fc4780a6a8adae45e5,art/defences/thermometer_encoding.py,ThermometerEncoding,__call__,#ThermometerEncoding#Any#Any#,59
Before Change
:rtype: `np.ndarray`
result = []
for c in range(x.shape[-1]):
result.append(self._perchannel(x[:, :, :, c]))
result = np.concatenate(result, axis=3)
result = np.clip(result, self.clip_values[0], self.clip_values[1])
return result.astype(NUMPY_DTYPE), y
After Change
result = np.apply_along_axis(self._perchannel, self.channel_index, x)
// result = np.concatenate(result, axis=self.channel_index)
if hasattr(self, "clip_values") and self.clip_values is not None:
np.clip(result, self.clip_values[0], self.clip_values[1], out=result)
return result.astype(NUMPY_DTYPE), y
def _perchannel(self, x):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: e29ea9571ae112b5f628a3fc4780a6a8adae45e5
Time: 2019-05-14
Author: Maria-Irina.Nicolae@ibm.com
File Name: art/defences/thermometer_encoding.py
Class Name: ThermometerEncoding
Method Name: __call__
Project Name: spectralpython/spectral
Commit Name: 0817e41d3d104da9a8e4ffb84d12fd72e5687434
Time: 2017-03-26
Author: thomas.boggs@gmail.com
File Name: spectral/graphics/spypylab.py
Class Name:
Method Name: plot
Project Name: geomstats/geomstats
Commit Name: b7efa1f037f8adc94a28fc421dd7934b63b3043e
Time: 2020-04-22
Author: 62605255+pchauchat@users.noreply.github.com
File Name: geomstats/_backend/numpy/__init__.py
Class Name:
Method Name: assignment