Giter Club home page Giter Club logo

Comments (3)

NEGU93 avatar NEGU93 commented on May 30, 2024 1

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.

annabelleYan avatar annabelleYan commented on May 30, 2024

I think my question has been solved when I read codes related to convolutional layers. Sorry to bother you.

from cvnn.

annabelleYan avatar annabelleYan commented on May 30, 2024

Thanks for your reply. You’ve helped make it clearer for me.

from cvnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.