INNER CODE UNIT · Python
mu1
drawbridge/keras-mmoe · synthetic_demo.py:44
mu1 = (mu1 - np.mean(mu1)) / (np.std(mu1) * np.sqrt(num_dimension))
mu2 = np.random.normal(size=num_dimension)
mu2 -= mu2.dot(mu1) * mu1
mu2 /= np.linalg.norm(mu2)
w1 = c * mu1
w2 = c * (rho * mu1 + np.sqrt(1. - rho ** 2) * mu2)
# Feature and label generation
alpha = np.random.normal(size=m)
beta = np.random.normal(size=m)
y0 = []
y1 = []
X = []
for i in range(num_row):
x = np.random.normal(size=num_dimension)
X.append(x)
num1 = w1.dot(x)