def __init__(self, args, word_embedding): super(TANR, self).__init__() self.args = args self.news_encoder = NewsEncoder(args, word_embedding) self.user_encoder = UserEncoder(args) self.click_predictor = ClickPredictor() self.topic_predictor = nn.Linear(args.n_filters, args.n_categories)
def __init__(self, config, pretrained_word_embedding=None, writer=None): super(TANR, self).__init__() self.config = config self.news_encoder = NewsEncoder(config, pretrained_word_embedding) self.user_encoder = UserEncoder(config) self.click_predictor = DotProductClickPredictor() self.topic_predictor = nn.Linear(config.num_filters, config.num_categories)