Skip to content

Instantly share code, notes, and snippets.

@joelthchao
Last active September 16, 2017 13:44
Show Gist options
  • Save joelthchao/929e59bc91b9fec7c9625eab8b5b88e3 to your computer and use it in GitHub Desktop.
Save joelthchao/929e59bc91b9fec7c9625eab8b5b88e3 to your computer and use it in GitHub Desktop.
Dead neuron
import numpy as np
# x: 4-dim zero mean random
# y: sign of x's mean
x = np.random.rand(320, 4) - 0.5
y = np.zeros((320, 1))
for i in range(x.shape[0]):
y[i] = int(np.mean(x[i, :]) > 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment