INNER CODE UNIT · Python
w2
drawbridge/keras-mmoe · synthetic_demo.py:49
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)
num2 = w2.dot(x)
comp1, comp2 = 0.0, 0.0
for j in range(m):
comp1 += np.sin(alpha[j] * num1 + beta[j])