Yanpei
Yanpei

Reputation: 159

tensorflow operation for complex numbers

I have a dataset which contains complex numbers. And when I feed the data into the network, I got an error:

ValueError: An initializer for variable encoder/conv2d/kernel of <dtype: 'complex64'> is required

Here is some of the code in my network:

self.input_placeholder=tf.placeholder(tf.complex64,[None,self.train_data[0].shape[1],self.train_data[0].shape[2],self.train_data[0].shape[3]])

The error occurs in the convolution step before initialize all of the parameters:

layer=tf.layers.conv2d(inputs,64,[1,self.F],strides=(1,1),padding='same',activation=None)

Is there any solution?

Is there any support in tensorflow for complex numbers?

Thank you very much!

Upvotes: 3

Views: 4271

Answers (1)

Juan Leni
Juan Leni

Reputation: 7598

Support for complex initializers is not available yet.

There is an open issue describing a feature request here:

https://github.com/tensorflow/tensorflow/issues/17097

According to the discussion in that ticket, it seems that Keras already provides a way to do it. Maybe you can do something similar to that.

Upvotes: 2

Related Questions