mirror of
https://github.com/wassname/Castor.git
synced 2026-09-11 11:51:23 +08:00
Make Kim CNN ONNX-exportable (#136)
* Kim CNN - only set embedding for corresponding mode * Kim CNN ONNX Export * Specify dummy ONNX input size from command line
This commit is contained in:
@@ -28,7 +28,7 @@ class SSTTrainer(Trainer):
|
||||
self.iterations += 1
|
||||
self.model.train()
|
||||
self.optimizer.zero_grad()
|
||||
scores = self.model(batch)
|
||||
scores = self.model(batch.text)
|
||||
n_correct += (torch.max(scores, 1)[1].view(batch.label.size()).data == batch.label.data).sum().item()
|
||||
n_total += batch.batch_size
|
||||
train_acc = 100. * n_correct / n_total
|
||||
|
||||
Reference in New Issue
Block a user