GithubHelp home page GithubHelp logo

Comments (6)

ibab avatar ibab commented on May 4, 2024

There's no reason behind picking stddev=0.3 at the moment, and using Xavier initialization would be nice. Note that the learnable filter isn't just an (in_channels, out_channels) matrix, as needed for the Xavier initializer, but a (filter_width, in_channels, out_channels) tensor.
Maybe stacking together filter_width Xavier initializers would work well.

from tensorflow-wavenet.

jyegerlehner avatar jyegerlehner commented on May 4, 2024

Right,well there's also tf.contrib.layers.xavier_initializer_conv2d. But no tf.contrib.layers.xavier_initializer_conv1d. But the only difference is amonst these is how they compute fan-in and fan-out; after that they compute the normal-std-dev or uniform-width from that. Should be straightforward to roll our own.

from tensorflow-wavenet.

ibab avatar ibab commented on May 4, 2024

@jyegerlehner: I didn't actually know about xavier_initializer_conv2d. Looking at the code, I can see that it only accesses the last 2 dimensions of the tensor, so we can just use it for our rank 3 tensors.
This example just works:

import tensorflow as tf

initializer = tf.contrib.layers.xavier_initializer_conv2d()
variable = tf.get_variable('x', shape=[2, 32, 32], initializer=initializer)

sess = tf.Session()
sess.run(tf.initialize_all_variables())
print(sess.run(variable))

from tensorflow-wavenet.

jyegerlehner avatar jyegerlehner commented on May 4, 2024

OK I'll try to get to this in the not-too-distant future. If anyone else wants to pick it up please speak up so we don't end up duplicating effort.

from tensorflow-wavenet.

ibab avatar ibab commented on May 4, 2024

@jyegerlehner: It would make sense to define a _create_variable(name, shape) method that defines a new variable and initializes it using the Xavier initializer, so that it becomes easier to make the initializer configurable.

from tensorflow-wavenet.

jyegerlehner avatar jyegerlehner commented on May 4, 2024

@ibab Sounds like a good idea.

from tensorflow-wavenet.

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.