Created
October 24, 2015 05:01
-
-
Save sbos/4cfe3e13510b8b670619 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cgt | |
import cgt.nn as nn | |
import numpy as np | |
batch = 5000 | |
mean = 0. | |
for i in xrange(batch): | |
mean += (cgt.randn() - mean) / (i+1) | |
estimate_mean = cgt.function([], [mean]) | |
for i in xrange(10): | |
print estimate_mean() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment