def __init__(self, args, corpus): self.max_his = args.history_max self.num_layers = args.num_layers self.dropout = args.dropout self.len_range = utils.numpy_to_torch(np.arange(self.max_his)) GRU4Rec.__init__(self, args, corpus)
def parse_model_args(parser, model_name='SASRec'): parser.add_argument('--num_layers', type=int, default=1, help='Number of self-attention layers.') return GRU4Rec.parse_model_args(parser, model_name)
def parse_model_args(parser, model_name='STAMP'): parser.add_argument('--attention_size', type=int, default=64, help='Size of attention hidden space.') return GRU4Rec.parse_model_args(parser, model_name)
def __init__(self, attention_size, *args, **kwargs): self.attention_size = attention_size GRU4Rec.__init__(self, *args, **kwargs)
def __init__(self, args, corpus): self.attention_size = args.attention_size GRU4Rec.__init__(self, args, corpus)