(W12_flat)
return mse
A function that has all of the parameters flattened
    as input for numdifftools.
A function that has all of the parameters flattened
    as input for numdifftools.
A function that has all of the parameters flattened as input for numdifftools .
def f_loss(W12_flat):
    """A function that has all of the parameters flattened
    as input for numdifftools."""
    W1, W2 = unpack(W12_flat)
    out1 = x_np.dot(W1.T)
    out1 = np.concatenate((x_np, out1), axis=1)
    out2 = out1.dot(W2.T)
    out2 = np.concatenate((out1, out2), axis=1)

    mse_batch = np.mean(np.square(out2-exp_np), axis=1)
    mse = np.mean(mse_batch)
    return mse
def f_loss ( W12_flat ) : W1 , W2 = unpack ( W12_flat ) out1 = x_np . dot ( W1 . T ) out1 = np . concatenate ( ( x_np , out1 ) , axis = 1 ) out2 = out1 . dot ( W2 . T ) out2 = np . concatenate ( ( out1 , out2 ) , axis = 1 ) mse_batch = np . mean ( np . square ( out2 - exp_np ) , axis = 1 ) mse = np . mean ( mse_batch ) return mse