Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit 82058e6

Browse files
committed
Rename files for easier handling
-Removed whitespace from tutorial makrdown filenames - Fixed relative reference to images
1 parent 4ea5297 commit 82058e6

8 files changed

Lines changed: 31 additions & 32 deletions

README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Tutorial for the Low Altitude Disaster Imagery (LADI) dataset. This tutorial was
44

55
- [Tutorials Guide](#tutorials-guide)
66
- [Getting Started](#getting-started)
7-
- [Getting Dataset](#getting-dataset)
87
- [Clean and Validate LADI Dataset](#clean-and-validate-ladi-dataset)
98
- [PyTorch Data Loading](#pytorch-data-loading)
109
- [Train and Test A Classifier](#train-and-test-a-classifier)
@@ -14,46 +13,40 @@ Tutorial for the Low Altitude Disaster Imagery (LADI) dataset. This tutorial was
1413

1514
## Getting Started
1615

17-
[Getting Started](https://github.com/NaeRong/DS440_Capstone/blob/master/Tutorials/Getting%20Started.md)
16+
[Getting Started](./Tutorials/Get_Started.md)
1817

1918
This documentation is about installing AWS tools and configuring AWS environment to download LADI dataset and load dataset in Python locally and remotely.
2019

21-
## Getting Dataset
22-
23-
[Getting Dataset](https://github.com/NaeRong/DS440_Capstone/blob/master/Data)
24-
25-
This folder contains dataset with 2000 images and labels.
26-
2720
## Clean and Validate LADI Dataset
2821

29-
[Clean and Validate LADI Dataset](https://github.com/NaeRong/DS440_Capstone/blob/master/Tutorials/Clean%20and%20Validate%20LADI%20Dataset.md)
22+
[Clean and Validate LADI Dataset](./Tutorials/Clean_Validate.md)
3023

3124
This documentation is about clean the LADI dataset. For this project, we have only extracted 2000 images for training.
3225

3326
## PyTorch Data Loading
3427

35-
[PyTorch Data Loading](https://github.com/NaeRong/DS440_Capstone/blob/master/Tutorials/Pytorch%20Data%20Load.md)
28+
[PyTorch Data Loading](./Tutorials/Pytorch_Data_Load.md)
3629

3730
This documentation is about loading LADI dataset in PyTorch framework including examples of writing custom `Dataset`, `Transforms` and `Dataloader`.
3831

3932
## Train and Test A Classifier
4033

41-
[Train and Test A Classifier](https://github.com/NaeRong/DS440_Capstone/blob/master/Tutorials/Train%20and%20Test%20A%20Classifier.md)
34+
[Train and Test A Classifier](./Tutorials/Train_Test_Classifier.md)
4235

4336
This documentation is about training and testing a classifier model using Convolutional Neural Network (CNN) from scratch.
4437

4538
## Fine Tuning Torchvision Models
4639

47-
[Fine Tuning Torchvision Models](Tutorials/Fine%20Tuning%20Torchvision%20Models.md)
40+
[Fine Tuning Torchvision Models](./Tutorials/Fine_Tune_Torchvision_Models.md)
4841

4942
This documentation is about training and testing a classifier model using pre-trained ResNet and AlexNet.
5043

5144
## SageMaker Build Train and Deploy ML Models
5245

53-
[SageMaker Build Train and Deploy ML Models](Tutorials/SageMaker%20-%20Build,%20Train,%20and%20Deploy%20ML%20Model.md)
46+
[SageMaker Build Train and Deploy ML Models](./Tutorials/SageMaker_Intro.md)
5447

5548
This documentation is about migrating model scripts into the AWS SageMaker environment.
5649

5750
## Distribution Statement
5851

59-
[BSD -Clause License](https://github.com/LADI-Dataset/ladi-tutorial/blob/master/LICENSE)
52+
[BSD -Clause License](https://github.com/LADI-Dataset/ladi-tutorial/blob/master/LICENSE)
File renamed without changes.

Tutorials/Fine Tuning Torchvision Models.md renamed to Tutorials/Fine_Tune_Torchvision_Models.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
Pytorch provides `cnn_finetune`, which includes multiple deep learning models, pre-trained on the ImageNet dataset. The package automatically replaces classifier on top of the network, which allows the user to train a network with a dataset that has a different number of classes.
2323
Also, `cnn_finetune` allows users to add a dropout layer or a custom pooling layer.
2424

25-
In this project, we are focusing on ResNet and AlexNet
25+
In this project, we are focusing on ResNet and AlexNet:
26+
2627
- ResNet (resnet18, resnet34, resnet50, resnet101, resnet152)
2728
- AlexNet (alexnet)
2829
- DenseNet (densenet161)
@@ -94,7 +95,9 @@ parser.add_argument('--no-cuda', action='store_true', default=False,
9495
parser.add_argument('--model-name', type=str, default='resnet34', metavar='M',
9596
help='model name (default: resnet34)')
9697
```
98+
9799
Users can use "to.device" to switch the training from using cpu to gpu.
100+
98101
```python
99102
args = parser.parse_args()
100103
use_cuda = not args.no_cuda and torch.cuda.is_available()
@@ -170,6 +173,7 @@ def test(model, test_loader, criterion=nn.CrossEntropyLoss()):
170173
```
171174

172175
## Run Training and Testing Step
176+
173177
Finally, the last step is to setup the loss for the model, then run the training and testing function for the set number of epochs.
174178
In this step, we also create an optimizer that only updates the desired parameters. To construct an Optimizer you have to give it an iterable containing the parameters (all should be Variable s) to optimize. Then, you can specify optimizer-specific options such as the learning rate, weight decay, etc.
175179
The common optimizer includes:
@@ -207,9 +211,10 @@ In PyTorch, the user can save the trained model into a .pt or .pth file extensio
207211
In this step, we used the existing model to predict the new dataset.
208212

209213
Parameter Tuning Example: (define new parameter using "parser.add_argument" function)
210-
* Change the number of epochs from 30 to 50
211-
* Change the batch size from 4 to 16
212-
* Change the learing rate from 0.1 to 0.01
214+
215+
- Change the number of epochs from 30 to 50
216+
- Change the batch size from 4 to 16
217+
- Change the learing rate from 0.1 to 0.01
213218

214219
### ResNet / DenseNet / MobileNet
215220

@@ -305,7 +310,7 @@ print('Predicted: ', ' '.join('%5s' % predicted[j]
305310
for j in range(8)))
306311
```
307312

308-
![pred.png](./Images/pred.png)
313+
![pred.png](../Images/pred.png)
309314

310315
## Model Accuracy
311316

@@ -334,7 +339,7 @@ In terms of future improvement, we are looking into fine-tuning the MobilNetV2 a
334339

335340
The true positives rate and true negatives rate are both about 80%, which indicates a good precision / recall of our model.
336341

337-
![confusionmatrix](./Images/cm.png)
342+
![confusionmatrix](../Images/cm.png)
338343

339344
### Python Script for Confusion Matrix
340345

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ image_path = 'Images/FEMA_CAP/1012/20118/VIRB0002_fa5065eb-773a-4b41-8f2c-80a734
162162
im = Image.open(image_path)
163163
plt.imshow(im, cmap='Greys_r')
164164
```
165-
![img](https://github.com/NaeRong/DS440_Capstone/blob/master/Images/010_0775_4365f589-de67-4561-8fdd-f1ac1ac1ae07.jpg)
165+
![img](../Images/010_0775_4365f589-de67-4561-8fdd-f1ac1ac1ae07.jpg)
166166

167167
## Distribution Statement
168168

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ for i in range(len(flood_tiny_dataset)):
221221
222222
The first 4 samples will shown below.
223223
224-
![img](./Images/custom_flood_tiny_dataset_output.png)
224+
![img](../Images/custom_flood_tiny_dataset_output.png)
225225
226226
Output:
227227
@@ -388,7 +388,7 @@ for i_batch, sample_batched in enumerate(dataloader):
388388
389389
The transformed images in the 4th batch:
390390
391-
![img](./Images/dataloader_batch_result.png)
391+
![img](../Images/dataloader_batch_result.png)
392392
393393
The index and size of images in batch:
394394

Tutorials/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Default directory for tutorials markdowns.
44

55
## Distribution Statement
66

7-
[BSD -Clause License](https://github.com/LADI-Dataset/ladi-tutorial/blob/master/LICENSE)
7+
[BSD -Clause License](https://github.com/LADI-Dataset/ladi-tutorial/blob/master/LICENSE)

Tutorials/SageMaker - Build, Train, and Deploy ML Model.md renamed to Tutorials/SageMaker_Intro.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,29 @@
1010

1111
1. Enter Amazon SageMaker console
1212

13-
![img](./Images/sagemaker1.png)
13+
![img](../Images/sagemaker1.png)
1414

1515
2. Navigate to the Amazon SageMaker dashboard located in the left-hand panel and select **Notebook Instances**.
16-
![img](./Images/sagemaker2.png)
16+
![img](../Images/sagemaker2.png)
1717

1818
3. Select **Create notebook instance** button to begin creating the notebook instance.
19-
![img](./Images/sagemaker3.png)
19+
![img](../Images/sagemaker3.png)
2020

2121
4. Enter a name in the **Notebook instance name** field. Keep ml.t2.medium as the **Notebook instance type**.
22-
![img](./Images/sagemaker4.png)
22+
![img](../Images/sagemaker4.png)
2323

2424
5. An IAM role must be specified to enable the notebook instance to access and securely upload data to Amazon S3. In the **IAM role** field, choose **Create a new role** to have Amazon SageMaker create a role with the required permissions and assign it to your instance.
25-
![img](./Images/sagemaker5.png)
25+
![img](../Images/sagemaker5.png)
2626

2727
6. In the **Create an IAM role** box, select **Any S3 bucket**. This allows your Amazon SageMaker instance to access all S3 buckets in your account. For now, we will allow **Any S3 bucket** until we upload our our own bucket.
28-
![img](./Images/sagemaker6.png)
28+
![img](../Images/sagemaker6.png)
2929

3030
1. If you would like to clone our Git respository for your notebook instance, go to the **Git repositories** box and select **Clone a public Git repository to this notebook instance only**. Then insert "https://github.com/LADI-Dataset/ladi-tutorial.git" in the **Git repository URL** box.
31+
3132
7. Choose **Create role**.
3233

3334
8. On the **Notebook instances** page, your new instance with your specified name should be shown with a **Pending** status. Your noteobok instance should transition from **Pending** to **InService** status in less than 2 minutes.
34-
![img](./Images/sagemaker7.png)
35+
![img](../Images/sagemaker7.png)
3536

3637
## Distribution Statement
3738

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ imshow(torchvision.utils.make_grid(images))
255255
print('GroundTruth: ', ' '.join('%5s' % labels[j] for j in range(16)))
256256
```
257257

258-
![img](https://github.com/NaeRong/DS440_Capstone/blob/master/Images/testimages.png)
258+
![testimages.png](../Images/testimages.png)
259259

260260
Out:
261261

0 commit comments

Comments
 (0)