fa961f2290c3144f1c5a5c9b8a484610ab835032,tests/defences/test_pixel_defend.py,TestPixelDefend,test_one_channel,#TestPixelDefend#,58

Before Change



    def test_one_channel(self):
        (x_train, _), (_, _), _, _ = load_mnist()
        x_train = x_train[:2]

        x_train = x_train[:, 10:15, 15:20, :]
        preprocess = PixelDefend(eps=5, pixel_cnn=self.pixelcnn)
        defended_x, _ = preprocess(x_train)

After Change


        x_train = x_train[:2, 10:15, 15:20, :]

        // Define the network
        model = ModelImage()
        loss_fn = nn.CrossEntropyLoss()
        optimizer = optim.Adam(model.parameters(), lr=0.01)
        self.pixelcnn = PyTorchClassifier(model=model, loss=loss_fn, optimizer=optimizer, input_shape=(1, 28, 28),
                                          nb_classes=10, clip_values=(0, 1))
        preprocess = PixelDefend(eps=5, pixel_cnn=self.pixelcnn)
        defended_x, _ = preprocess(x_train)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: fa961f2290c3144f1c5a5c9b8a484610ab835032
Time: 2019-05-14
Author: Maria-Irina.Nicolae@ibm.com
File Name: tests/defences/test_pixel_defend.py
Class Name: TestPixelDefend
Method Name: test_one_channel


Project Name: rusty1s/pytorch_geometric
Commit Name: e2db3b3f1d3d23cd5bc1e295835e0f4b33e95447
Time: 2018-03-07
Author: matthias.fey@tu-dortmund.de
File Name: examples/cora_gcn.py
Class Name:
Method Name:


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 0bb6982bd06bf21de58e61f021626ade1c9b6101
Time: 2018-02-04
Author: max.lapan@gmail.com
File Name: ch14/04_train_ddpg.py
Class Name:
Method Name: