예제 #1
0
    def forward(self, data1):
        data1.input = F.elu(self.conv1(data1.adj, data1.input))
        size, start = self.pool_args(32, 24)
        data2, c1 = sparse_voxel_max_pool(data1, size, start, transform)

        data2.input = F.elu(self.conv2(data2.adj, data2.input))
        size, start = self.pool_args(8, 3)
        data3, c2 = sparse_voxel_max_pool(data2, size, start, transform)

        data3.input = F.elu(self.conv2(data3.adj, data3.input))
        size, start = self.pool_args(4, 2)
        data4, c3 = sparse_voxel_max_pool(data3, size, start, transform)

        data4.input = F.dropout(data4.input, training=self.training)
        data4.input = F.elu(self.fc1(data4.input))

        x = [upscale(data4.input, c3), self.skip3(data3.input)]
        data3.input = F.elu(self.conv4(data3.adj, torch.cat(x, dim=1)))

        x = [upscale(data3.input, c2), self.skip2(data2.input)]
        data2.input = F.elu(self.conv5(data2.adj, torch.cat(x, dim=1)))

        x = [upscale(data2.input, c1), self.skip1(data1.input)]
        data1.input = F.elu(self.conv6(data1.adj, torch.cat(x, dim=1)))

        data1.input = F.dropout(data1.input, training=self.training)
        data1.input = self.fc2(data1.input)

        return F.log_softmax(data1.input, dim=1)
    def forward(self, data):
        data.input = F.elu(self.conv1(data.adj, data.input))
        size, start = self.pool_args(64, 16)
        data, _ = sparse_voxel_max_pool(data, size, start, transform)

        data.input = F.elu(self.conv2(data.adj, data.input))
        size, start = self.pool_args(32, 8)
        data, _ = sparse_voxel_max_pool(data, size, start, transform)

        data.input = F.elu(self.conv3(data.adj, data.input))
        size, start = self.pool_args(16, 4)
        data, _ = sparse_voxel_max_pool(data, size, start, transform)

        data.input = F.elu(self.conv4(data.adj, data.input))
        size, start = self.pool_args(8, 2)
        data, _ = sparse_voxel_max_pool(data, size, start, transform)

        data.input = F.elu(self.conv5(data.adj, data.input))
        size, start = self.pool_args(4, 1)
        data, _ = sparse_voxel_max_pool(data, size, start, transform)

        data.input = F.elu(self.conv6(data.adj, data.input))
        data, _ = dense_voxel_max_pool(data, 1, -0.5, 1.5, transform)

        x = data.input.view(-1, 8 * 128)
        x = F.dropout(x, training=self.training)
        x = self.fc1(x)
        return F.log_softmax(x, dim=1)
예제 #3
0
    def forward(self, data):
        f1 = F.relu(self.conv1(data.adj, data.input))
        f1 = F.relu(self.conv12(data.adj, f1))
        batch = Variable(data.batch.view(-1, 1).expand(data.batch.size(0), 64))
        f1_res = scatter_mean(batch, f1)

        size, start = self.pool_args(32, 8)
        data2, _ = sparse_voxel_max_pool(
            data, size, start, transform, weight=f1[:, 0])

        f2 = F.relu(self.conv2(data2.adj, data2.input))
        f2 = F.relu(self.conv22(data2.adj, f2))
        batch = Variable(
            data2.batch.view(-1, 1).expand(data2.batch.size(0), 64))
        f2_res = scatter_mean(batch, f2)

        size, start = self.pool_args(16, 4)
        data3, _ = sparse_voxel_max_pool(
            data2, size, start, transform, weight=f2[:, 0])

        f3 = F.relu(self.conv3(data3.adj, data3.input))
        f3 = F.relu(self.conv32(data3.adj, f3))
        batch = Variable(
            data3.batch.view(-1, 1).expand(data3.batch.size(0), 64))
        f3_res = scatter_mean(batch, f3)

        size, start = self.pool_args(8, 2)
        data4, _ = sparse_voxel_max_pool(
            data3, size, start, transform, weight=f3[:, 0])

        f4 = F.relu(self.conv4(data4.adj, data4.input))
        f4 = F.relu(self.conv42(data4.adj, f4))
        batch = Variable(
            data4.batch.view(-1, 1).expand(data4.batch.size(0), 64))
        f4_res = scatter_mean(batch, f4)

        size, start = self.pool_args(4, 1)
        data5, _ = sparse_voxel_max_pool(
            data4, size, start, transform, weight=f4[:, 0])

        f5 = F.relu(self.conv5(data5.adj, data5.input))
        f5 = F.relu(self.conv52(data5.adj, f5))
        batch = Variable(
            data5.batch.view(-1, 1).expand(data5.batch.size(0), 64))
        f5_res = scatter_mean(batch, f5)

        x = torch.cat([f1_res, f2_res, f3_res, f4_res, f5_res], dim=1)

        # data.input = F.relu(self.conv5(data.adj, data.input))
        # data, _ = dense_voxel_max_pool(data, 1, -0.5, 1.5)

        x = x.view(-1, self.fc1.weight.size(1))
        x = F.dropout(x, training=self.training)
        x = self.fc1(x)

        return F.log_softmax(x, dim=1)
예제 #4
0
    def forward(self, data):

        data.input = F.elu(self.conv1(data.adj, data.input))
        data, _ = sparse_voxel_max_pool(data, 5, 0, CartesianAdj())
        data.input = F.elu(self.conv2(data.adj, data.input))
        data, _ = sparse_voxel_max_pool(data, 7, 0, CartesianAdj())
        data.input = F.elu(self.conv3(data.adj, data.input))

        data, _ = dense_voxel_max_pool(data, 14, 0, 28)

        x = data.input.contiguous().view(-1, self.fc1.weight.size(1))
        x = F.elu(self.fc1(x))
        x = F.dropout(x, training=self.training)
        x = self.fc2(x)
        return F.log_softmax(x, dim=1)
예제 #5
0
    def forward(self, data):
        ones = Variable(data.input.data.new(data.input.size(0), 1).fill_(1))
        data.input = F.elu(self.conv1(data.adj, data.input))
        data1, cluster1 = sparse_voxel_max_pool(data, (1 / 64), 0, trans)
        x = torch.cat([data1.input, ones[:data1.input.size(0)]], dim=1)
        x = F.elu(self.conv2(data1.adj, x))
        x = self.conv22(data1.adj, x)
        data1.input = F.elu(x + self.skip1(data1.input))
        data2, cluster2 = sparse_voxel_max_pool(data1, (1 / 32), 0, trans)
        x = torch.cat((data2.input, ones[:data2.input.size(0), :]), dim=1)
        x = F.elu(self.conv3(data2.adj, x))
        x = self.conv32(data2.adj, x)
        data2.input = F.elu(x + data2.input)
        data3, cluster3 = sparse_voxel_max_pool(data2, (1 / 16), 0, trans)
        x = torch.cat([data3.input, ones[:data3.input.size(0)]], dim=1)
        x = F.elu(self.conv4(data3.adj, x))
        x = self.conv42(data3.adj, x)
        data3.input = F.elu(x + data3.input)
        data4, cluster4 = sparse_voxel_max_pool(data3, (1 / 8), 0, trans)
        x = torch.cat([data4.input, ones[:data4.input.size(0)]], dim=1)
        x = F.elu(self.conv5(data4.adj, x))
        x = self.conv52(data4.adj, x)
        data4.input = F.elu(x + self.skip2(data4.input))

        data3.input = torch.cat(
            [upscale(data4.input, cluster4),
             self.fc3(data3.input)], dim=1)
        data3.input = F.elu(self.convRPN1(data3.adj, data3.input))
        # data3.input = F.elu(self.conv52(data3.adj, data3.input))

        data2.input = torch.cat(
            [upscale(data3.input, cluster3),
             self.fc2(data2.input)], dim=1)
        data2.input = F.elu(self.convRPN2(data2.adj, data2.input))
        data2.input = self.convRPN4(data2.adj, data2.input)

        # data1.input = torch.cat(
        #    [upscale(data2.input, cluster2), self.fc1(data1.input)], dim=1)
        # data1.input = F.elu(self.convRPN3(data1.adj, data1.input))
        # data1.input = self.convRPN4(data1.adj, data1.input)
        class_out = data2.input[:, :num_classes *
                                num_anchors].contiguous().view(-1, 2)
        bb_out = data2.input[:, num_classes * num_anchors:].contiguous().view(
            -1, 7)

        return F.log_softmax(class_out, dim=1), bb_out, data2.pos, data2
    def forward(self, data):
        data.input = F.relu(self.conv1(data.adj, data.input))
        # att1 = self.att1(data.input)
        size, start = self.pool_args(32, 8)
        data, _ = sparse_voxel_max_pool(data,
                                        size,
                                        start,
                                        transform,
                                        weight=data.input[:, 0])

        data.input = F.relu(self.conv2(data.adj, data.input))
        # att2 = self.att2(data.input)
        size, start = self.pool_args(16, 4)
        data, _ = sparse_voxel_max_pool(data,
                                        size,
                                        start,
                                        transform,
                                        weight=data.input[:, 0])

        data.input = F.relu(self.conv3(data.adj, data.input))
        # att3 = self.att3(data.input)
        size, start = self.pool_args(8, 2)
        data, _ = sparse_voxel_max_pool(data,
                                        size,
                                        start,
                                        transform,
                                        weight=data.input[:, 0])

        data.input = F.relu(self.conv4(data.adj, data.input))
        # att4 = self.att4(data.input)
        size, start = self.pool_args(4, 1)
        data, _ = sparse_voxel_max_pool(data,
                                        size,
                                        start,
                                        transform,
                                        weight=data.input[:, 0])

        data.input = F.relu(self.conv5(data.adj, data.input))
        data, _ = dense_voxel_max_pool(data, 1, -0.5, 1.5)

        x = data.input.view(-1, self.fc1.weight.size(1))
        x = F.dropout(x, training=self.training)
        x = self.fc1(x)

        return F.log_softmax(x, dim=1)
예제 #7
0
    def forward(self, data):
        # data.input = F.elu(self.conv1(data.adj, data.input))
        size, start = self.pool_args(13, 5)
        data, _ = sparse_voxel_max_pool(data, size, start, CartesianAdj())

        data.input = F.elu(self.conv1(data.adj, data.input))
        size, start = self.pool_args(7, 3)
        data, _ = sparse_voxel_max_pool(data, size, start, CartesianAdj())

        data.input = F.elu(self.conv2(data.adj, data.input))
        size, start = self.pool_args(5, 2)
        data, _ = sparse_voxel_max_pool(data, size, start, CartesianAdj())

        data.input = F.elu(self.conv3(data.adj, data.input))
        data, _ = dense_voxel_max_pool(data, 1 / 2, 0, 1)

        x = data.input.view(-1, self.fc1.weight.size(1))
        x = F.elu(self.fc1(x))
        x = F.dropout(x, training=self.training)
        x = self.fc2(x)
        return F.log_softmax(x, dim=1)