Comments (3)
Actually, your question makes a lot of sense. It would be more logic to make cvnn.initializers.ComplexGlorotNormal()
return a complex data type instead of a real one. And there is a reason I made it return a float. The reason is simply:
Tensorflow optimizer raises an exception if trainable parameters (kernels, bias, weights) are complex.
My solution was, therefore, to have two variables, for example, kernel_r
and kernel_i
to make the real and imaginary part and simulate the operations. Some times I can even then create an intermediate variable kernel = tf.complex(kernel_r, kernel_i)
and it works (some points there for tensorflow 😤).
You can see how I init weights either here or here for example.
The question is now, why don't I use the tensorflow initializer if I am going to init as real dtype? Why use my own initializer?
The answer is xavier and he has properties of variance, that when using the TensorFlow initializer for both real and imaginary they loose those properties. In short, even though ComplexGlorotNormal()
gives a float output, it is not equivalent as tf.initilizers.GlorotNormal()
and the former should be use for complex layers if you want to maintain the good properties of these initializers.
from cvnn.
I think my question has been solved when I read codes related to convolutional layers. Sorry to bother you.
from cvnn.
Thanks for your reply. You’ve helped make it clearer for me.
from cvnn.
Related Issues (20)
- CVNN API 3D layers HOT 6
- Error: Inputs to a layer should be tensors. Got: <cvnn.layers.core.ComplexInput object at ...> HOT 1
- ValueError: Unknown loss function:ComplexAverageCrossEntropy HOT 3
- Complex data type error with TensorFlow Functional API HOT 2
- Model subclassing compatibility HOT 4
- load CVNN model with succes HOT 1
- Implement complex-valued constraint parameter HOT 7
- Terrible slow caused by ComplexBatchNormalization() HOT 4
- Custom Activation Functions with tensorflow 2.8.2 HOT 1
- Pytorch implementation HOT 3
- ComplexConv2D with bias vector slows down training a lot HOT 7
- "WARNING:tensorflow: You are casting an input of type complex64 to an incompatible dtype float32. This will discard the imaginary part and may not be what you intended." HOT 5
- ModuleNotFoundError: No module named 'cvnn.montecarlo' HOT 1
- Unknown activation function 'cart_relu': Please ensure this object is passed to 'custom objects' argument HOT 5
- Cant find Complex Softmax which takes complex input and output complex output HOT 1
- Best Activation Function in Complex Domain HOT 1
- using this function layers.complex_input(shape=input_shape + (3,)) gives off dtype error HOT 2
- Problem with loading complex valued model HOT 2
- Equivalent Data PreProcessing for complex-valued input
- Data Parallel Distributed support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cvnn.