示例#1
0
 def test_predict(self):
     model = SingleInputModel()
     trainer = Trainer(model,
                       nn.CrossEntropyLoss(),
                       Adam(model.parameters()),
                       metrics=[Accuracy()])
     trainer.predict(train_x)
示例#2
0
 def test_predict(self, model, data, classes):
     t = Trainer(model, nn.CrossEntropyLoss(), _get_optim(model))
     t.predict(data, classes=classes, batch_size=128)