Esempio n. 1
0
 def __make_model(self):
     self.__model = wrapper.make_model(
         # encoder
         w_xi = functions.EmbedID(len(self.__src_vocab), self.__n_embed),
         w_ip = functions.Linear(self.__n_embed, 4 * self.__n_hidden),
         w_pp = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         # decoder
         w_pq = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         w_qj = functions.Linear(self.__n_hidden, self.__n_embed),
         w_jy = functions.Linear(self.__n_embed, len(self.__trg_vocab)),
         w_yq = functions.EmbedID(len(self.__trg_vocab), 4 * self.__n_hidden),
         w_qq = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
     )
Esempio n. 2
0
 def __make_model(self):
     self.__model = wrapper.make_model(
         # encoder
         w_xi = functions.EmbedID(len(self.__src_vocab), self.__n_embed),
         w_ip = functions.Linear(self.__n_embed, 4 * self.__n_hidden),
         w_pp = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         # decoder
         w_pq = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         w_qj = functions.Linear(self.__n_hidden, self.__n_embed),
         w_jy = functions.Linear(self.__n_embed, len(self.__trg_vocab)),
         w_yq = functions.EmbedID(len(self.__trg_vocab), 4 * self.__n_hidden),
         w_qq = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
     )
Esempio n. 3
0
 def __make_model(self):
     self.__model = wrapper.make_model(
         # input embedding
         w_xi=functions.EmbedID(len(self.__src_vocab), self.__n_embed),
         # forward encoder
         w_ia=functions.Linear(self.__n_embed, 4 * self.__n_hidden),
         w_aa=functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         # backward encoder
         w_ib=functions.Linear(self.__n_embed, 4 * self.__n_hidden),
         w_bb=functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         # attentional weight estimator
         w_aw=functions.Linear(self.__n_hidden, self.__n_hidden),
         w_bw=functions.Linear(self.__n_hidden, self.__n_hidden),
         w_pw=functions.Linear(self.__n_hidden, self.__n_hidden),
         w_we=functions.Linear(self.__n_hidden, 1),
         # decoder
         w_ap=functions.Linear(self.__n_hidden, self.__n_hidden),
         w_bp=functions.Linear(self.__n_hidden, self.__n_hidden),
         w_yp=functions.EmbedID(len(self.__trg_vocab), 4 * self.__n_hidden),
         w_pp=functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         w_cp=functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         w_dp=functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         w_py=functions.Linear(self.__n_hidden, len(self.__trg_vocab)),
     )
 def __make_model(self):
     self.__model = wrapper.make_model(
         # input embedding
         w_xi = functions.EmbedID(len(self.__src_vocab), self.__n_embed),
         # forward encoder
         w_ia = functions.Linear(self.__n_embed, 4 * self.__n_hidden),
         w_aa = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         # backward encoder
         w_ib = functions.Linear(self.__n_embed, 4 * self.__n_hidden),
         w_bb = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         # attentional weight estimator
         w_aw = functions.Linear(self.__n_hidden, self.__n_hidden),
         w_bw = functions.Linear(self.__n_hidden, self.__n_hidden),
         w_pw = functions.Linear(self.__n_hidden, self.__n_hidden),
         w_we = functions.Linear(self.__n_hidden, 1),
         # decoder
         w_ap = functions.Linear(self.__n_hidden, self.__n_hidden),
         w_bp = functions.Linear(self.__n_hidden, self.__n_hidden),
         w_yp = functions.EmbedID(len(self.__trg_vocab), 4 * self.__n_hidden),
         w_pp = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         w_cp = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         w_dp = functions.Linear(self.__n_hidden, 4 * self.__n_hidden),
         w_py = functions.Linear(self.__n_hidden, len(self.__trg_vocab)),
     )