def __init__(self, num_point, batch_size, momentum=0.1): super(PointNet, self).__init__() self.conv1 = torch_util.conv2d(in_channels=1, out_channels=64, kernel_size=(1, 3), momentum=momentum) self.conv2 = torch_util.conv2d(in_channels=64, out_channels=64, kernel_size=(1, 1), momentum=momentum) self.conv3 = torch_util.conv2d(in_channels=64, out_channels=64, kernel_size=(1, 1), momentum=momentum) self.conv4 = torch_util.conv2d(in_channels=64, out_channels=128, kernel_size=(1, 1), momentum=momentum) self.conv5 = torch_util.conv2d(in_channels=128, out_channels=1024, kernel_size=(1, 1), momentum=momentum) self.fc1 = torch_util.fully_connected(1024, 512) self.fc2 = torch_util.fully_connected(512, 256) self.fc3 = nn.Linear(256, 10) self.feature_transform = feature_transform_net(in_channels=64, momentum=momentum, num_point=num_point, batch_size=batch_size) self.maxpool = nn.MaxPool2d((num_point, 1)) self.relu = nn.ReLU() self.drop1 = nn.Dropout(p=0.7) self.drop2 = nn.Dropout(p=0.7)
def __init__(self): super(SegNet, self).__init__() self.conv1 = torch_util.conv2d(1, 16, kernel_size=5, padding=2) self.conv2 = torch_util.conv2d(16, 64, kernel_size=3, padding=1) self.conv3 = torch_util.conv2d(64, 256, kernel_size=3, padding=1) self.conv3_drop = nn.Dropout2d() self.conv4 = torch_util.conv2d(256, 64, kernel_size=1) self.conv4_drop = nn.Dropout2d() self.conv5 = torch_util.conv2d(64, 2, kernel_size=1)
def __init__(self): super(CNN, self).__init__() self.conv1 = torch_util.conv2d(1, 16, kernel_size=4) self.conv2 = torch_util.conv2d(16, 64, kernel_size=3) self.conv3 = torch_util.conv2d(64, 256, kernel_size=3) self.conv4 = torch_util.conv2d(256, 1024, kernel_size=4) self.conv3_drop = nn.Dropout2d() self.fc1 = torch_util.fully_connected(1024 * 3 * 3, 256) self.fc2 = torch_util.fully_connected(256, 64) self.fc3 = torch_util.fully_connected(64, 10)
def __init__(self, in_channels, momentum, num_point, batch_size): super(feature_transform_net, self).__init__() self.batch_size = batch_size self.conv1 = torch_util.conv2d(in_channels, 64, (1, 1), momentum) self.conv2 = torch_util.conv2d(64, 128, (1, 1), momentum) self.conv3 = torch_util.conv2d(128, 1024, (1, 1), momentum) self.maxpool = nn.MaxPool2d((num_point, 1)) self.fc1 = torch_util.fully_connected(1024, 512) self.fc2 = torch_util.fully_connected(512, 256) self.fc3 = nn.Linear(256, 64 * 64)