Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random number generation and modules (and simplification again) #58

Open
sbos opened this issue Nov 5, 2015 · 0 comments
Open

Random number generation and modules (and simplification again) #58

sbos opened this issue Nov 5, 2015 · 0 comments

Comments

@sbos
Copy link
Contributor

sbos commented Nov 5, 2015

It seems that there are still problems with simplification of random number generation operation if they are encapsulated into modules.

The following code prints two last lines equal when simplification is turned on:

import cgt
import cgt.nn as nn

z1 = cgt.randn()
z2 = cgt.randn()

m = nn.Module([cgt.scalar()], [z1, z2])
f = cgt.function([], m([0.]))

print 'A', f()
print 'A', f()

z = cgt.randn(2)
m = nn.Module([cgt.scalar()], [z])

f = cgt.function([], m([0.]) + m([0.]))

print 'B', f()
print 'B', f()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant