#NEWLINE# def __init__( self , vocab_size , embedding_dim , state_dim , **kwargs ) : #NEWLINE# #INDENT# super ( BidirectionalEncoder , self ) . __init__ ( ** kwargs ) #NEWLINE# self . vocab_size = name #NEWLINE# self . embedding_dim = embedding_dim #NEWLINE# self . state_dim = state_dim #NEWLINE# self . lookup = LookupTable ( name = 'embeddings' ) #NEWLINE# self . bidir = BidirectionalWMT15 ( GatedRecurrent ( activation = Tanh ( ) , dim = state_dim ) ) #NEWLINE# self . fwd_fork = Fork ( [ name for name in self . bidir . prototype . apply . sequences if ( name != 'mask' ) ] , prototype = Linear ( ) , name = 'fwd_fork' ) #NEWLINE# self . back_fork = Fork ( [ name for name in self . bidir . prototype . apply . sequences if ( name != 'mask' ) ] , prototype = Linear ( ) , name = 'back_fork' ) #NEWLINE# self . children = [ self . lookup , self . bidir , self . fwd_fork , self . back_fork ]