code: public void calcExpectation(double[] expected, double Z, int size)
      {
          double c = Math.exp(lnode.alpha + cost + rnode.beta - Z);
          for (int i = 0; fvector.get(i) != -1; i++)
          {
              int idx = fvector.get(i) + lnode.y * size + rnode.y;
              expected[idx] += c;
          }
      }
docs: 计算边的期望
  
  @param expected 输出期望
  @param Z        规范化因子
  @param size     标签个数