Julien Simon
commited on
Commit
•
0ccc8c8
1
Parent(s):
f8024d7
Update README.md
Browse files
README.md
CHANGED
@@ -67,17 +67,19 @@ SequenceClassifierOutput(loss=None, logits=tensor([[-0.4635, -1.0112, 4.7935,
|
|
67 |
-2.4848, 0.2630, -0.4584, -2.4327, -1.1654, 0.3897, -0.3374, -1.2418,
|
68 |
-0.1045, 0.2827, -1.5667, -0.0963]], grad_fn=<AddmmBackward0>), hidden_states=None, attentions=None)
|
69 |
>>> classes = torch.softmax(logits.logits, dim = -1)
|
|
|
70 |
>>> classes
|
71 |
-
tensor([[
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
grad_fn=<SoftmaxBackward0>)
|
78 |
>>> top_class = torch.argmax(logits.logits, dim = -1)
|
79 |
-
>>> top_class
|
80 |
-
|
|
|
81 |
'up'
|
82 |
```
|
83 |
|
|
|
67 |
-2.4848, 0.2630, -0.4584, -2.4327, -1.1654, 0.3897, -0.3374, -1.2418,
|
68 |
-0.1045, 0.2827, -1.5667, -0.0963]], grad_fn=<AddmmBackward0>), hidden_states=None, attentions=None)
|
69 |
>>> classes = torch.softmax(logits.logits, dim = -1)
|
70 |
+
>>> torch.set_printoptions(precision=3, sci_mode=False)
|
71 |
>>> classes
|
72 |
+
tensor([[ 0.004, 0.002, 0.701, 0.014, 0.030, 0.011,
|
73 |
+
0.027, 0.043, 0.029, 0.010, 0.001, 0.014,
|
74 |
+
0.013, 0.001, 0.001, 0.004, 0.005, 0.001,
|
75 |
+
0.011, 0.005, 0.006, 0.003, 0.009, 0.006,
|
76 |
+
0.000, 0.008, 0.004, 0.001, 0.002, 0.009,
|
77 |
+
0.004, 0.002, 0.005, 0.008, 0.001, 0.005]],
|
78 |
grad_fn=<SoftmaxBackward0>)
|
79 |
>>> top_class = torch.argmax(logits.logits, dim = -1)
|
80 |
+
>>> top_class
|
81 |
+
tensor([2])
|
82 |
+
>>> model.config.id2label[top_class.numpy()[0]]
|
83 |
'up'
|
84 |
```
|
85 |
|