86aca57545cfe312151cc35528035cd9c0aafe2d,art/classifiers/pytorch.py,PyTorchClassifier,__init__,#PyTorchClassifier#Any#Any#Any#Any#Any#Any#Any#,14

Before Change


        self._optimizer = optimizer

        // Store the logit layer
        self._logit_layer = len(list(model.modules())) - 2 if use_logits else len(list(model.modules())) - 3

        // Use GPU if possible
        device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

After Change


        
        super(PyTorchClassifier, self).__init__(clip_values, defences)
        //self._nb_classes = list(model.modules())[-1 if use_logits else -2].out_features
        self._nb_classes = output_shape[0]
        self._input_shape = input_shape
        self._model = model
        self._loss = loss
        self._optimizer = optimizer
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 86aca57545cfe312151cc35528035cd9c0aafe2d
Time: 2018-05-17
Author: M.N.Tran@ibm.com
File Name: art/classifiers/pytorch.py
Class Name: PyTorchClassifier
Method Name: __init__


Project Name: CellProfiler/CellProfiler
Commit Name: a742e23d10c88b0b37cba7950226d703356a542a
Time: 2010-02-19
Author: leek@1fc53939-2000-0410-845c-e8453a809027
File Name: pyCellProfiler/cellprofiler/modules/relateobjects.py
Class Name: RelateObjects
Method Name: get_measurements


Project Name: CellProfiler/CellProfiler
Commit Name: e97fe6ed9fd91501b2e8509ce41915fa6c63c51a
Time: 2013-04-25
Author: leek@broadinstitute.org
File Name: cellprofiler/gui/pipelinelistview.py
Class Name: PipelineListView
Method Name: on_validate_module