Skip to content

Instantly share code, notes, and snippets.

@sbos
Created October 24, 2015 05:01
Show Gist options
  • Save sbos/4cfe3e13510b8b670619 to your computer and use it in GitHub Desktop.
Save sbos/4cfe3e13510b8b670619 to your computer and use it in GitHub Desktop.
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