def hi_given(samples, i, W_list, b_list, beta=1.0, apply_sigmoid=True):
 depth = len(samples)
 hi_mean = 0.0
 if (i < (depth - 1)):
  wip1 = W_list[(i + 1)]
  hi_mean += (T.dot(samples[(i + 1)], wip1.T) * beta)
 if (i > 0):
  wi = W_list[i]
  hi_mean += (T.dot(samples[(i - 1)], wi) * beta)
 hi_mean += (b_list[i] * beta)
 if apply_sigmoid:
  return T.nnet.sigmoid(hi_mean)
 else:
  return hi_mean

def hi_given ( samples , i , W_list , b_list , beta = 1.0 , apply_sigmoid = True ) : depth = len ( samples ) hi_mean = 0.0 if ( i < ( depth - 1 ) ) : wip1 = W_list [ ( i + 1 ) ] hi_mean += ( T . dot ( samples [ ( i + 1 ) ] , wip1 . T ) * beta ) if ( i > 0 ) : wi = W_list [ i ] hi_mean += ( T . dot ( samples [ ( i - 1 ) ] , wi ) * beta ) hi_mean += ( b_list [ i ] * beta ) if apply_sigmoid : return T . nnet . sigmoid ( hi_mean ) else : return hi_mean
compute the state of hidden layer i given all other layers parameters samples : array-like object of theano shared variables for the positive phase .