(input_, size, num_layers=1, bias=-2.0, f=tf.nn.relu, scope='Highway')
return output
Highway Network (cf. http://arxiv.org/abs/1505.00387).
    t = sigmoid(Wy + b)
    z = t * g(Wy + b) + (1 - t) * y
    where g is nonlinearity, t is transform gate, and (1 - t) is carry gate.
Highway Network (cf. http://arxiv.org/abs/1505.00387).
    t = sigmoid(Wy + b)
    z = t * g(Wy + b) + (1 - t) * y
    where g is nonlinearity, t is transform gate, and (1 - t) is carry gate.
Highway Network ( cf . http : // arxiv . org / abs / 1505 . 00387 ) . t = sigmoid ( Wy + b ) z = t * g ( Wy + b ) + ( 1 - t ) * y where g is nonlinearity t is transform gate and ( 1 - t ) is carry gate .
def highway(input_, size, num_layers=1, bias=-2.0, f=tf.nn.relu, scope='Highway'):
    """Highway Network (cf. http://arxiv.org/abs/1505.00387).
    t = sigmoid(Wy + b)
    z = t * g(Wy + b) + (1 - t) * y
    where g is nonlinearity, t is transform gate, and (1 - t) is carry gate.
    """

    with tf.variable_scope(scope):
        for idx in range(num_layers):
            g = f(linear(input_, size, scope='highway_lin_%d' % idx))

            t = tf.sigmoid(linear(input_, size, scope='highway_gate_%d' % idx) + bias)

            output = t * g + (1. - t) * input_
            input_ = output

    return output
def highway ( input_ , size , num_layers = 1 , bias = - 2.0 , f = tf . nn . relu , scope = 'Highway' ) : with tf . variable_scope ( scope ) : for idx in range ( num_layers ) : g = f ( linear ( input_ , size , scope = 'highway_lin_%d' % idx ) ) t = tf . sigmoid ( linear ( input_ , size , scope = 'highway_gate_%d' % idx ) + bias ) output = t * g + ( 1. - t ) * input_ input_ = output return output