I just started to learn about machine learning. When I tried to do some small things, I found that there was only one feature entered in the pytorch content on the Internet, which may be because my keywords were wrong. If I want to use pytorch to create a model, how can I enter multiple features to achieve better calculation results?
as follows, if I want to be a classifier to judge the type of encryption, the type of a ciphertext can be judged by the character type and the length of the ciphertext, but now I can only enter one feature, the character type.
class PasswordClassifier(nn.Module):
def __init__(self, i_char, o_labels):
super(PasswordClassifier, self).__init__()
self.l_char = nn.Linear(i_char, o_labels)
def forward(self, f_char):
return self.linear(f_char)
model = PasswordClassifier(CHARS_LEN, len(LABELS_INDEX))
loss_func = nn.CrossEntropyLoss()
optimizer = torch.optim.SGD(model.parameters(), lr=LEARNING_RATE)
now I want to enter another ciphertext length feature. How can I add input features and loss functions to my model to better connect the model to the output tag?