This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.bumptech.glide.annotation.GlideModule; | |
| import com.bumptech.glide.module.AppGlideModule; | |
| @GlideModule | |
| public final class MyAppGlideModule extends AppGlideModule {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Mount Google Drive | |
| from google.colab import drive # import drive from google colab | |
| ROOT = "/content/drive" # default location for the drive | |
| print(ROOT) # print content of ROOT (Optional) | |
| drive.mount(ROOT) # we mount the google drive at /content/drive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Clone github repository setup | |
| # import join used to join ROOT path and MY_GOOGLE_DRIVE_PATH | |
| from os.path import join | |
| # path to your project on Google Drive | |
| MY_GOOGLE_DRIVE_PATH = 'My Drive/MyDrive/Udacity/deep-learning-v2-pytorch' | |
| # replace with your Github username | |
| GIT_USERNAME = "vsay01" | |
| # definitely replace with your | |
| GIT_TOKEN = "{YOUR_GITHUB_TOKEN}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !git clone "{GIT_PATH}" ./temp # clone github repository to temp folder | |
| !mv ./temp/* "{PROJECT_PATH}" # move all files/folders in temp folder to folder defined in project path | |
| !rm -rf ./temp # remove all the files/folders in temp folder | |
| !rsync -aP --exclude=data/ "{PROJECT_PATH}"/* ./ # use remote sync to copy from google drive to local runtime google colab | |
| # but exclude data folder | |
| # https://www.computerhope.com/unix/rsync.htm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Import drive | |
| from google.colab import drive | |
| #Mount Google Drive | |
| drive.mount("/content/drive") | |
| %cd './drive/My Drive/MyDrive/Udacity/deep-learning-v2-pytorch/intro-to-pytorch/' | |
| %pwd | |
| #import helper.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %cd "{PROJECT_PATH}" # Change directory to the location defined in project_path | |
| !git clone "{GIT_PATH}" # clone the github repository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !git add -u |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !git add . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # uncomment if you want to create directory checkpoint, best_model | |
| %mkdir checkpoint best_model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %matplotlib inline | |
| %config InlineBackend.figure_format = 'retina' | |
| import matplotlib.pyplot as plt | |
| import torch | |
| import shutil | |
| from torch import nn | |
| from torch import optim | |
| import torch.nn.functional as F | |
| from torchvision import datasets, transforms |