def to_one_hot(self, input_str,max_index=256, padding_length=30):
"""Transform single input string into zero-padded one-hot (index) encoding."""
input_one_hot = one_hot(" ".join(list(input_str)), n = max_index)
return pad_sequences([input_one_hot], maxlen=padding_length)
评论列表
文章目录