Semi-Constant Parameters

20 views
Skip to first unread message

Matthew Rocklin

unread,
May 3, 2013, 11:12:16 PM5/3/13
to theano-dev
I have a function that takes a large set of inputs.  I'd prefer to think of some of those inputs as constant parameters.  

Occasionally I will want to change them though and don't want to do a recompile each time I make this change.  Is there a standard solution to this in Theano that doesn't involve inputing the parameters to the function each time I run it?

Olivier Delalleau

unread,
May 3, 2013, 11:38:19 PM5/3/13
to thean...@googlegroups.com
What about using shared variables?

-=- Olivier


2013/5/3 Matthew Rocklin <mroc...@gmail.com>
I have a function that takes a large set of inputs.  I'd prefer to think of some of those inputs as constant parameters.  

Occasionally I will want to change them though and don't want to do a recompile each time I make this change.  Is there a standard solution to this in Theano that doesn't involve inputing the parameters to the function each time I run it?

--
 
---
You received this message because you are subscribed to the Google Groups "theano-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

David Warde-Farley

unread,
May 4, 2013, 2:00:45 AM5/4/13
to thean...@googlegroups.com
Shared variables are probably what you want, especially if it's
important to keep these values on the GPU. If you don't care about
device transfer, you could compile a theano function with your
semi-constant arguments as the first K arguments, and use
functools.partial to build wrappers around them for various
combinations of the semi-constant parameters.

Matthew Rocklin

unread,
May 4, 2013, 7:02:53 AM5/4/13
to theano-dev, Dale Lukas Peterson

Partial was my planned solution. I hadn't thought of shared variables. They actually map really cleanly to another incarnation of the problem. Thanks for the idea!

Reply all
Reply to author
Forward
0 new messages