Exemple #1
0
 def test_evaluate(self):
     model = SingleInputModel()
     trainer = Trainer(model,
                       nn.CrossEntropyLoss(),
                       Adam(model.parameters()),
                       metrics=[Accuracy()])
     trainer.evaluate(train_x, train_y)
Exemple #2
0
 def test_evaluate(self, model, data):
     t = Trainer(model, nn.CrossEntropyLoss(), _get_optim(model))
     t.evaluate(data, np_target, batch_size=128)