This file contains 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
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
This file contains 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 omni.usd | |
from pxr import UsdGeom, Usd, UsdGeom | |
def get_prims_startswith(stage, root_path, starts_with): | |
matching_prims = [] | |
root_prim = stage.GetPrimAtPath(root_path) | |
for prim in Usd.PrimRange(root_prim): | |
if prim.GetName().startswith(starts_with): | |
matching_prims.append(prim) | |
return matching_prims |
This file contains 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
from torch.utils.data.distributed import DistributedSampler | |
from torch.utils.data import DataLoader | |
# Each process runs on 1 GPU device specified by the local_rank argument. | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--local_rank", type=int) | |
args = parser.parse_args() | |
# Initializes the distributed backend which will take care of sychronizing nodes/GPUs | |
torch.distributed.init_process_group(backend='nccl') |
This file contains 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 torch | |
from torchvision import datasets | |
class ImageFolderWithPaths(datasets.ImageFolder): | |
"""Custom dataset that includes image file paths. Extends | |
torchvision.datasets.ImageFolder | |
""" | |
# override the __getitem__ method. this is the method that dataloader calls | |
def __getitem__(self, index): |
This file contains 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 numpy as np | |
EPSILON = 1e-10 | |
def _error(actual: np.ndarray, predicted: np.ndarray): | |
""" Simple error """ | |
return actual - predicted | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
prop_a4_pile_01 | |
prop_a4_sheet_01 | |
prop_a4_sheet_02 | |
prop_a4_sheet_03 | |
prop_a4_sheet_04 | |
prop_a4_sheet_05 | |
prop_abat_roller_static | |
prop_abat_slide | |
prop_acc_guitar_01 | |
prop_acc_guitar_01_d1 |
This file contains 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
Download/Copy all related *.zip files in one directory. | |
Open terminal and change to that directory which has all zip files. | |
Enter command zip -s- FILE_NAME.zip -O COMBINED_FILE.zip | |
Enter unzip COMBINED_FILE.zip |
This file contains 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
'''Functional Keras is a more functional replacement for the Graph API. | |
''' | |
################### | |
# 2 LSTM branches # | |
################### | |
a = Input(input_shape=(10, 32)) # output is a TF/TH placeholder, augmented with Keras attributes | |
b = Input(input_shape=(10, 32)) | |
encoded_a = LSTM(32)(a) # output is a TF/TH tensor | |
encoded_b = LSTM(32)(b) |
NewerOlder