73260e319a82fbc14e8984962f903838ffdf13dc,1_linear_regression.py,,train,#,12

Before Change


    optimizer.zero_grad()

    // Forward
    fx = model.forward(x.view(len(x), 1))
    output = loss.forward(fx, y)

    // Backward
    output.backward()

    // Update parameters
    optimizer.step()

    return output.data[0]


def main():
    torch.manual_seed(42)

After Change


    optimizer.zero_grad()

    // Forward
    fx = model.forward(x.view(len(x), 1)).squeeze()
    output = loss.forward(fx, y)

    // Backward
    output.backward()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: vinhkhuc/PyTorch-Mini-Tutorials
Commit Name: 73260e319a82fbc14e8984962f903838ffdf13dc
Time: 2018-10-03
Author: knvinh@gmail.com
File Name: 1_linear_regression.py
Class Name:
Method Name: train


Project Name: richzhang/PerceptualSimilarity
Commit Name: a464ecf6f2244c266ad42134b69c2d9581074ede
Time: 2018-04-10
Author: cobarnes@adobe.com
File Name: test_network.py
Class Name:
Method Name: