From f0c2430b0b1529e3f76fb5d6cd6ca14be763d975 Mon Sep 17 00:00:00 2001 From: fxia22 Date: Wed, 17 Apr 2019 11:45:25 -0700 Subject: [PATCH] typo fix --- pointnet/model.py | 6 +++--- utils/train_classification.py | 4 ++-- utils/train_segmentation.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pointnet/model.py b/pointnet/model.py index 21d900b56..48de610c2 100644 --- a/pointnet/model.py +++ b/pointnet/model.py @@ -174,7 +174,7 @@ def forward(self, x): x = x.view(batchsize, n_pts, self.k) return x, trans, trans_feat -def feature_transform_reguliarzer(trans): +def feature_transform_regularizer(trans): d = trans.size()[1] batchsize = trans.size()[0] I = torch.eye(d)[None, :, :] @@ -188,13 +188,13 @@ def feature_transform_reguliarzer(trans): trans = STN3d() out = trans(sim_data) print('stn', out.size()) - print('loss', feature_transform_reguliarzer(out)) + print('loss', feature_transform_regularizer(out)) sim_data_64d = Variable(torch.rand(32, 64, 2500)) trans = STNkd(k=64) out = trans(sim_data_64d) print('stn64d', out.size()) - print('loss', feature_transform_reguliarzer(out)) + print('loss', feature_transform_regularizer(out)) pointfeat = PointNetfeat(global_feat=True) out, _, _ = pointfeat(sim_data) diff --git a/utils/train_classification.py b/utils/train_classification.py index f85edbe19..9302eca7c 100644 --- a/utils/train_classification.py +++ b/utils/train_classification.py @@ -7,7 +7,7 @@ import torch.optim as optim import torch.utils.data from pointnet.dataset import ShapeNetDataset, ModelNetDataset -from pointnet.model import PointNetCls, feature_transform_reguliarzer +from pointnet.model import PointNetCls, feature_transform_regularizer import torch.nn.functional as F from tqdm import tqdm @@ -109,7 +109,7 @@ pred, trans, trans_feat = classifier(points) loss = F.nll_loss(pred, target) if opt.feature_transform: - loss += feature_transform_reguliarzer(trans_feat) * 0.001 + loss += feature_transform_regularizer(trans_feat) * 0.001 loss.backward() optimizer.step() pred_choice = pred.data.max(1)[1] diff --git a/utils/train_segmentation.py b/utils/train_segmentation.py index 237c298c6..68e8c7f3b 100644 --- a/utils/train_segmentation.py +++ b/utils/train_segmentation.py @@ -7,7 +7,7 @@ import torch.optim as optim import torch.utils.data from pointnet.dataset import ShapeNetDataset -from pointnet.model import PointNetDenseCls, feature_transform_reguliarzer +from pointnet.model import PointNetDenseCls, feature_transform_regularizer import torch.nn.functional as F from tqdm import tqdm import numpy as np @@ -91,7 +91,7 @@ #print(pred.size(), target.size()) loss = F.nll_loss(pred, target) if opt.feature_transform: - loss += feature_transform_reguliarzer(trans_feat) * 0.001 + loss += feature_transform_regularizer(trans_feat) * 0.001 loss.backward() optimizer.step() pred_choice = pred.data.max(1)[1]