Esempio n. 1
0
        def step(x_t, c_tm1, y_tm1):
            con = T.concatenate([x_t, c_tm1, y_tm1], axis=1)

            z = T.dot(con, W) + b.dimshuffle('x', 0)
            zi = T.dot(con, Wi) + bi.dimshuffle('x', 0)
            zf = T.dot(con, Wf) + bf.dimshuffle('x', 0)
            zo = T.dot(con, Wo) + bo.dimshuffle('x', 0)

            c = Sigmoid(z) * Sigmoid(zi) + c_tm1 * Sigmoid(zf)
            y = Sigmoid(c) * Sigmoid(zo)

            c_ret = func.activation_func(c, act_type)
            y_ret = func.activation_func(y, act_type)

            return c_ret, y_ret
Esempio n. 2
0
        def step( x_t, c_tm1, y_tm1 ):
            con = T.concatenate([ x_t, c_tm1, y_tm1 ], axis = 1)

            z  = T.dot( con, W)  + b.dimshuffle('x',0)
            zi = T.dot( con, Wi) + bi.dimshuffle('x',0)
            zf = T.dot( con, Wf) + bf.dimshuffle('x',0)
            zo = T.dot( con, Wo) + bo.dimshuffle('x',0)

            c = Sigmoid(z) * Sigmoid(zi) + c_tm1 * Sigmoid(zf)
            y = Sigmoid(c) * Sigmoid(zo)

            c_ret = func.activation_func(c,act_type)
            y_ret = func.activation_func(y,act_type)

            return c_ret, y_ret
Esempio n. 3
0
 def step(z_t, out_tm1):
     out_t = F.activation_func(
         z_t + T.dot(out_tm1, Whi) + bi.dimshuffle('x', 0), act_type)
     return out_t
Esempio n. 4
0
 def step(x_t, out_tm1):
     out_t = F.activation_func(
         x_t + T.dot(out_tm1, Wh) + b.dimshuffle('x', 0), act_type)
     #out_t = ( T.dot( x_t , W ) + T.dot (out_tm1 , Wh) + b )
     return out_t
Esempio n. 5
0
 def step(x_t , out_tm1 ): 
     out_t = func.activation_func( x_t  
                                 + T.dot( out_tm1 , Wh) + b.dimshuffle('x',0) , act_type)
     #out_t = ( T.dot( x_t , W ) + T.dot (out_tm1 , Wh) + b )
     return out_t  
Esempio n. 6
0
 def step(z_t , out_tm1):
     out_t = func.activation_func( z_t + T.dot(out_tm1 , Whi) + bi.dimshuffle('x' , 0 ) , act_type )
     return out_t