GithubHelp home page GithubHelp logo

pyll's People

Contributors

jaberg avatar npinto avatar yamins81 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

pyll's Issues

pos_args and named_args -> args

The AST nodes should be invariant to the calling convention (positional vs. named) used in the function calls that built the nodes.

args should be a dictionary mapping paramname -> argval

how do I sample a consistent random seem in pyll?

e.g. the replacement of

genson_template.sample(seed)

?

Right now,

 stochastic.sample(template, np.random.RandomState(seed))

does NOT yield the same result on each call with a fixed seed, e.g. 0. Is it supposed to? If so, I'll submit a test

bug in replace_implicit_stochastic_nodes

In [8]: stochastic.sample(L.template, np.random)

UnboundLocalError Traceback (most recent call last)
/Users/dyamins/eccv12/ in ()
----> 1 stochastic.sample(L.template, np.random)

/Users/dyamins/eccv12/pyll/pyll/stochastic.pyc in sample(expr, rng)
199
200 def sample(expr, rng):
--> 201 foo, newrng = replace_implicit_stochastic_nodes(expr, as_apply(rng))
202 return rec_eval(foo)
203

/Users/dyamins/eccv12/pyll/pyll/stochastic.pyc in replace_implicit_stochastic_nodes(expr, rng, scope)
163 expr = draw
164 lrng = new_lrng
--> 165 return expr, new_lrng
166
167

UnboundLocalError: local variable 'new_lrng' referenced before assignment

namespaces!!!!!

This is very high priority if pyll is be used as a way to write lazy functional code.

PyPi v0.0.1 release?

Hey James,

I'd like to package pyll (and later pyautodiff) for Gentoo and having a alpha version on PyPi would help. Would you be interested in pushing 0.0.1 releases of some of these packages on PyPi? It will also make requirements.txt files simpler ;-)

Thanks!

n

using replace_input / adding nodes

This is more of a "how to use pyll" question than an "issue":

Suppose I have a pyll object, e.g. a model spec generator. Suppose I want to programmatically replace one value in it with something determined by a function from some inputs. E.g. I want to set a key "num_filters" = pyll.scope.choice(function(some_inputs)), where the "num_filters" key is a node that appears somewhere down the object tree. I suspect I need to use replace_input? But the exact way to construct the arguments escapes me. Or do I need to do something else?

Similarly, suppose I want to add a key?

I guess I'm in general asking: how do I do simple transformations on pyll ASTs of this kind? If you could point me to the relevant place to figure it out, that would be great.

reloading python modules

currently pyll does not play well with reload python modules ... you get lots of 'Cannot override existing symbol' errors

can this be improved?

support for non-string dict key

Crude way to reproduce:


In [36]: pyll.stochastic.sample({1:[s.uniform(0, 1), s.one_of(0, 1, 2)]}, np.random)
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
/home/npinto/<ipython-input-36-6a0b951cbcec> in <module>()
----> 1 pyll.stochastic.sample({1:[s.uniform(0, 1), s.one_of(0, 1, 2)]}, np.random)

/home/npinto/venv/pyll-system/pyll/pyll/stochastic.py in sample(expr, rng)
    154 
    155 def sample(expr, rng):
--> 156     foo = recursive_set_rng_kwarg(clone(as_apply(expr)), as_apply(rng))
    157     return rec_eval(foo)
    158 

/home/npinto/venv/pyll-system/pyll/pyll/base.py in as_apply(obj)
    132         items.sort()
    133         named_args = [(k, as_apply(v)) for (k, v) in items]
--> 134         rval = Apply('dict', [], named_args, len(named_args))
    135     else:
    136         rval = Literal(obj)

/home/npinto/venv/pyll-system/pyll/pyll/base.py in __init__(self, name, pos_args, named_args, o_len)
    154         assert all(isinstance(v, Apply) for v in pos_args)
    155         assert all(isinstance(v, Apply) for k, v in named_args)
--> 156         assert all(isinstance(k, basestring) for k, v in named_args)

have a complete working replacement of genson and genson_helpers

For users of genson (such as myself), ... pyll is currently not a complete working replacement, so code that depends heavily on genson and hyperopt must stil use old versions of all that.

It is critical for moving to pyll (which I think would be a good idea sooner rather than later) that pyll support genson completely, with a simple drop-in replacement. Genson have a good interface for a variety of tasks -- especially sampling -- which pyll seems less suited to. These are important tasks for our purposes, I think.

I will assume that I will assign myself to this issue ...

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.