Update README.md
Browse files
README.md
CHANGED
|
@@ -56,3 +56,12 @@ predicted_class_idx = logits.argmax(-1).item()
|
|
| 56 |
predicted_class_label = test_dataset.classes[predicted_class_idx]
|
| 57 |
print(f"Predicted class: '{predicted_class_label}', confidence: {logits[0, predicted_class_idx]:.2f}")
|
| 58 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
predicted_class_label = test_dataset.classes[predicted_class_idx]
|
| 57 |
print(f"Predicted class: '{predicted_class_label}', confidence: {logits[0, predicted_class_idx]:.2f}")
|
| 58 |
```
|
| 59 |
+
|
| 60 |
+
The output of above code snippets should be like:
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
Ground truth class: 'cat'
|
| 64 |
+
tensor([[-1.1497, -0.1080, -0.7349, 9.2517, -1.3094, 0.5403, -0.9521, -1.0223,
|
| 65 |
+
-1.4102, -1.5389]], grad_fn=<AddmmBackward0>)
|
| 66 |
+
Predicted class: 'cat', confidence: 9.25
|
| 67 |
+
```
|