Skip to content

Commit f733020

Browse files
authored
Gaudi Doc Updates (#467)
* initial commit for gaudi doc updates * created README for anomaly detection * addressed review comments * Update README.md * added comment
1 parent 7386b0e commit f733020

File tree

4 files changed

+91
-10
lines changed

4 files changed

+91
-10
lines changed

notebooks/README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ and [Intel Extension for PyTorch](https://github.com/intel/intel-extension-for-p
1111

1212
## Intel® Transfer Learning Tool Tutorial Notebooks
1313

14-
| Notebook | Domain: Use Case | Framework| Description |
15-
| ---------| ---------|----------|-------------|
16-
| [BERT Text Classification with TensorFlow using the Intel® Transfer Learning Tool](/notebooks/text_classification/tlt_api_tf_text_classification) | NLP: Text Classification | TensorFlow and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to fine tune a BERT model from Hugging Face using text classification datasets. |
17-
| [BERT Text Classification with PyTorch using the Intel® Transfer Learning Tool](/notebooks/text_classification/tlt_api_pyt_text_classification) | NLP: Text Classification | PyTorch and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to fine tune a BERT model from Hugging Face using text classification datasets. |
18-
| [Image Classification with TensorFlow using Intel® Transfer Learning Tool](/notebooks/image_classification/tlt_api_tf_image_classification) | CV: Image Classification | TensorFlow and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to do transfer learning for image classification using a TensorFlow model. |
19-
| [Image Classification with TensorFlow using Graph Optimization and Intel® Transfer Learning Tool](/notebooks/image_classification/tlt_api_tf_image_classification) | CV: Image Classification | TensorFlow and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to do transfer learning with graph optimization that increases throughput for image classification using a TensorFlow model. |
20-
| [Image Classification with PyTorch using Intel® Transfer Learning Tool](/notebooks/image_classification/tlt_api_pyt_image_classification) | CV: Image Classification | PyTorch and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to do transfer learning for image classification using a PyTorch model. |
21-
| [Image Anomaly Detection with PyTorch using Intel® Transfer Learning Tool](/notebooks/image_anomaly_detection/tlt_api_pyt_anomaly_detection) | CV: Image Anomaly Detection| PyTorch and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to do feature extraction and pca analysis using a single function for image anomaly detection using a Torchvision model. |
22-
| [Text Generation with PyTorch using Intel® Transfer Learning Tool](/notebooks/text_generation/tlt_api_pyt_text_generation) | NLP: Text Generation| PyTorch and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to do instruction fine-tuning for text generation with a large language model (LLM) from Hugging Face. |
14+
| Notebook | Domain: Use Case | Framework| Description | Devices |
15+
| ---------| ---------|----------|-------------|-------|
16+
| [BERT Text Classification with TensorFlow using the Intel® Transfer Learning Tool](/notebooks/text_classification/tlt_api_tf_text_classification) | NLP: Text Classification | TensorFlow and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to fine tune a BERT model from Hugging Face using text classification datasets. | cpu
17+
| [BERT Text Classification with PyTorch using the Intel® Transfer Learning Tool](/notebooks/text_classification/tlt_api_pyt_text_classification) | NLP: Text Classification | PyTorch and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to fine tune a BERT model from Hugging Face using text classification datasets. | cpu
18+
| [Image Classification with TensorFlow using Intel® Transfer Learning Tool](/notebooks/image_classification/tlt_api_tf_image_classification) | CV: Image Classification | TensorFlow and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to do transfer learning for image classification using a TensorFlow model. | cpu
19+
| [Image Classification with TensorFlow using Graph Optimization and Intel® Transfer Learning Tool](/notebooks/image_classification/tlt_api_tf_image_classification) | CV: Image Classification | TensorFlow and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to do transfer learning with graph optimization that increases throughput for image classification using a TensorFlow model. | cpu
20+
| [Image Classification with PyTorch using Intel® Transfer Learning Tool](/notebooks/image_classification/tlt_api_pyt_image_classification) | CV: Image Classification | PyTorch and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to do transfer learning for image classification using a PyTorch model. | cpu, Intel® Gaudi®
21+
| [Image Anomaly Detection with PyTorch using Intel® Transfer Learning Tool](/notebooks/image_anomaly_detection/tlt_api_pyt_anomaly_detection) | CV: Image Anomaly Detection| PyTorch and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to do feature extraction and pca analysis using a single function for image anomaly detection using a Torchvision model. | cpu, Intel Gaudi
22+
| [Text Generation with PyTorch using Intel® Transfer Learning Tool](/notebooks/text_generation/tlt_api_pyt_text_generation) | NLP: Text Generation| PyTorch and the Intel Transfer Learning Tool API | Demonstrates how to use the Intel Transfer Learning Tool API to do instruction fine-tuning for text generation with a large language model (LLM) from Hugging Face. | cpu
2323

2424
## Native Framework Transfer Learning Notebooks
2525

notebooks/image_anomaly_detection/tlt_api_pyt_anomaly_detection/Anomaly_Detection.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"metadata": {},
1717
"source": [
1818
"### Intel® Gaudi® AI accelerator\n",
19-
"To use HPU training and inference with Gaudi, follow these steps to install required HPU drivers and software from the official [Habana Docs](https://docs.habana.ai/en/latest/Installation_Guide/SW_Verification.html)"
19+
"To use HPU training and inference with Gaudi, follow these steps to install required HPU drivers and software from [README](/notebooks/image_anomaly_detection/tlt_api_pyt_anomaly_detection/README.md) or the official [Habana Docs](https://docs.habana.ai/en/latest/Installation_Guide/SW_Verification.html)"
2020
]
2121
},
2222
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Transfer Learning for PyTorch Image Anomaly Classification using the Intel® Transfer Learning Tool API
2+
3+
This notebook demonstrates how to use the Intel Transfer Learning Tool API to do transfer learning for
4+
image anomaly detection using PyTorch.
5+
6+
The notebook performs the following steps:
7+
1. Import dependencies and setup parameters
8+
1. Get the model
9+
1. Get the dataset
10+
1. Prepare the dataset
11+
1. Predict using the original model
12+
1. Finetuning / Feature Extraction
13+
1. Predict
14+
1. Export
15+
1. Post-Training Quantization
16+
17+
## Running the notebook
18+
19+
To run the notebook, follow the instructions to setup the [PyTorch notebook environment](/notebooks/setup.md).
20+
21+
To use Gaudi for training and inference, install required software for Intel Gaudi:
22+
1. Temporarily uninstall torch
23+
```
24+
# Torch will later be re-installed below
25+
pip uninstall torch
26+
```
27+
2. Install the Gaudi Intel SW Stack
28+
```
29+
wget -nv https://vault.habana.ai/artifactory/gaudi-installer/1.15.0/habanalabs-installer.sh
30+
chmod +x habanalabs-installer.sh
31+
sudo apt-get update
32+
```
33+
```
34+
# Note: This may not be required depending on what is already installed on your machine
35+
./habanalabs-installer.sh install --type base
36+
```
37+
3. Install the Gaudi Intel Pytorch environment
38+
```
39+
# Note: This step may not be required depending on what is already installed on your machine
40+
./habanalabs-installer.sh install -t dependencies
41+
```
42+
```
43+
./habanalabs-installer.sh install --type pytorch –venv
44+
```
45+
46+
See [Habana Docs](https://docs.habana.ai/en/latest/Installation_Guide/SW_Verification.html) for detailed installation instructions
47+
48+
## Dataset Citations
49+
```
50+
Paul Bergmann, Kilian Batzner, Michael Fauser, David Sattlegger, Carsten Steger: The MVTec Anomaly Detection Dataset: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection; in: International Journal of Computer Vision 129(4):1038-1059, 2021, DOI: 10.1007/s11263-020-01400-4.
51+
```
52+
```
53+
Paul Bergmann, Michael Fauser, David Sattlegger, Carsten Steger: MVTec AD — A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection; in: IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 9584-9592, 2019, DOI: 10.1109/CVPR.2019.00982.
54+
```

notebooks/image_classification/tlt_api_pyt_image_classification/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,33 @@ The notebook performs the following steps:
1717

1818
To run the notebook, follow the instructions to setup the [PyTorch notebook environment](/notebooks/setup.md).
1919

20+
To use Gaudi for training and inference, install required software for Intel Gaudi:
21+
1. Temporarily uninstall torch
22+
```
23+
# Torch will later be re-installed below
24+
pip uninstall torch
25+
```
26+
2. Install the Gaudi Intel SW Stack
27+
```
28+
wget -nv https://vault.habana.ai/artifactory/gaudi-installer/1.15.0/habanalabs-installer.sh
29+
chmod +x habanalabs-installer.sh
30+
sudo apt-get update
31+
```
32+
```
33+
# Note: This may not be required depending on what is already installed on your machine
34+
./habanalabs-installer.sh install --type base
35+
```
36+
3. Install the Gaudi Intel Pytorch environment
37+
```
38+
# Note: This step may not be required depending on what is already installed on your machine
39+
./habanalabs-installer.sh install -t dependencies
40+
```
41+
```
42+
./habanalabs-installer.sh install --type pytorch –venv
43+
```
44+
45+
See [Habana Docs](https://docs.habana.ai/en/latest/Installation_Guide/SW_Verification.html) for detailed installation instructions
46+
2047
## References
2148

2249
Dataset citations

0 commit comments

Comments
 (0)