031392ff2cbb5703558d17a676a456521f754190,mnist/main.py,,,#,54

Before Change


        x = self.relu(self.fc2(x))
        return self.softmax(x)

model = Net()
if cuda == True:
    model.cuda()

criterion = nn.NLLLoss()

// Training settings
BATCH_SIZE = 150
TEST_BATCH_SIZE = 1000
NUM_EPOCHS = 2

optimizer = optim.SGD(model.parameters(), lr=1e-2, momentum=0.9)

def train(epoch):
    batch_data_t = torch.FloatTensor(BATCH_SIZE, 1, 28, 28)
    batch_targets_t = torch.LongTensor(BATCH_SIZE)

After Change


        test_loss, correct, test_data.size(0),
        float(correct)/test_data.size(0)*100))

for epoch in range(1, opt.nEpochs+1):
    train(epoch)
    test(epoch)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: pytorch/examples
Commit Name: 031392ff2cbb5703558d17a676a456521f754190
Time: 2016-12-15
Author: soumith@fb.com
File Name: mnist/main.py
Class Name:
Method Name:


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


Project Name: OpenNMT/OpenNMT-py
Commit Name: 031392ff2cbb5703558d17a676a456521f754190
Time: 2016-12-15
Author: soumith@fb.com
File Name: mnist/main.py
Class Name:
Method Name: