645c7c386e62d2fb1d50f4621c1a52645a13869f,time_sequence_prediction/train.py,,,#,40
Before Change
pred = seq(test_input, future = future)
loss = criterion(pred[:, :-future], test_target)
print("test loss:", loss.data.numpy()[0])
y = pred.data.numpy()
// draw the result
plt.figure(figsize=(30,10))
plt.title("Predict future values for time sequences\n(Dashlines are predicted values)", fontsize=30)
plt.xlabel("x", fontsize=20)
After Change
return loss
optimizer.step(closure)
// begin to predict, no need to track gradient here
with torch.no_grad():
future = 1000
pred = seq(test_input, future=future)
loss = criterion(pred[:, :-future], test_target)
print("test loss:", loss.item())
y = pred.detach().numpy()
// draw the result
plt.figure(figsize=(30,10))
plt.title("Predict future values for time sequences\n(Dashlines are predicted values)", fontsize=30)
plt.xlabel("x", fontsize=20)
plt.ylabel("y", fontsize=20)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: pytorch/examples
Commit Name: 645c7c386e62d2fb1d50f4621c1a52645a13869f
Time: 2018-04-24
Author: soumith@gmail.com
File Name: time_sequence_prediction/train.py
Class Name:
Method Name:
Project Name: deepchem/deepchem
Commit Name: 306694396489426b1eaa069ffc858da4fedb509c
Time: 2019-08-20
Author: vsomnath@student.ethz.ch
File Name: deepchem/models/tests/test_pretrained.py
Class Name: TestPretrained
Method Name: test_load_from_pretrained_eager_mode
Project Name: apache/incubator-tvm
Commit Name: 4c13ae9d17d1709ed7a777ce1bb72212e8d2559d
Time: 2020-12-25
Author: masahi129@gmail.com
File Name: tests/python/frontend/pytorch/test_object_detection.py
Class Name:
Method Name: test_detection_models