shadow
shadow

Reputation: 161

How do I realize the sparse convolution in tensorflow?

I know tensorflow has provided some approaches to deal with sparse tensor. For a example, the tf.sparse_tensor_dense_matmul is faster than the tf.matmul when there is a sparse matrix.

In a deep convolution network, I get sparse convolution kernels after a training process. I want to know how to save the convolution kernels so that the tensorflow knows the kernels are sparse?

I have read some papers. The papers propose the sparse convolution will bring more efficient calculation than traditional convolution. But the tf.nn.conv2d doesn't indicate that it will calculate with a sparse convolution kernel faster than a dense convolution kernel. How do I obtain the advantages from sparse kernels?

Upvotes: 3

Views: 3662

Answers (1)

Salvador Dali
Salvador Dali

Reputation: 222511

Yes, tf.nn.conv2d does not work with sparse kernel. If you think that sparse convolution will bring you the benefits of speed and feel comfortable writing efficient cpu/gpu code, you can write your own op, the way it is described in their docs

Upvotes: 2

Related Questions