# Get\_variable with initializer xavier

**URL:** <https://discourse.julialang.org/t/get-variable-with-initializer-xavier/7042>\
**Category:** Machine Learning\
**Tags:** tensorflow\
**Created:** [November 13, 2017, 2:09pm UTC](https://discourse.julialang.org/t/get-variable-with-initializer-xavier/7042 "2017-11-13T14:09:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Beckingham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colin_beckingham/32/4878_2.png) [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Post date:** [November 13, 2017, 2:09pm UTC](https://discourse.julialang.org/t/get-variable-with-initializer-xavier/7042/1 "2017-11-13T14:09:51Z")

</div>

I’m trying to emulate a python call to get\_variable() in Julia:  
Python:  
tf.get\_variable(name,size,initializer=tf.contrib.layers.xavier\_initializer(seed = 0))  
Julia:  
get\_variable(size,…?..)

but not getting the xavier initializer to work. I see that Knet offers an xavier() function but does not seem to fit in with this statement.

A search in the docs [http://malmaud.github.io/TensorFlow.jl/latest/search.html?q=xavier](http://malmaud.github.io/TensorFlow.jl/latest/search.html?q=xavier) pulls up two possibilities but no xavier mentioned. What am I missing?

---

<div class="post-metadata">

**Author:** ![Colin\_Beckingham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colin_beckingham/32/4878_2.png) [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Post date:** [November 13, 2017, 3:04pm UTC](https://discourse.julialang.org/t/get-variable-with-initializer-xavier/7042/2 "2017-11-13T15:04:30Z")

</div>

OK so a bit closer with variable\_scope() initialization, but no closer to xavier unless I need to provide a custom function.
