803d7e1fc61536c846c811bdee158bd21db36779,models/Pointnet2Cls.py,,,#,92
Before Change
from torch.autograd import Variable
model = PointnetCls()
data = Variable(torch.randn(2, 10, 3))
print(model(data))
After Change
import torch.optim as optim
B = 2
N = 32
inputs = torch.randn(B, N, 9).cuda()
labels = torch.from_numpy(np.random.randint(0, 3, size=B)).cuda()
model = Pointnet2SSG(3)
model.cuda()
optimizer = optim.Adam(model.parameters(), lr=1e-2)
model_fn = model_fn_decorator(nn.CrossEntropyLoss())
for _ in range(20):
optimizer.zero_grad()
_, loss, _ = model_fn(model, (inputs, labels))
loss.backward()
print(loss.data[0])
optimizer.step()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: erikwijmans/Pointnet2_PyTorch
Commit Name: 803d7e1fc61536c846c811bdee158bd21db36779
Time: 2017-12-26
Author: ewijmans2@gmail.com
File Name: models/Pointnet2Cls.py
Class Name:
Method Name:
Project Name: fperazzi/proSR
Commit Name: 13287043443135f6f3f8ed787d3978866c390d81
Time: 2019-03-27
Author: fperazzi@adobe.com
File Name: test.py
Class Name:
Method Name:
Project Name: leftthomas/SRGAN
Commit Name: 14c0cf773f514788aca6b935298fa186890eecc1
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name: